@mappedin/mappedin-js 6.0.1-beta.52 → 6.0.1-beta.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/esm/{GLTFExporter-QN63B2QE.js → GLTFExporter-YFXXQH2L.js} +2 -2
  2. package/lib/esm/{GLTFLoader-7E66XH6W.js → GLTFLoader-LZNQSDLP.js} +2 -2
  3. package/lib/esm/{browser-UPE3UIJH.js → browser-L6WJGOEX.js} +2 -2
  4. package/lib/esm/{chunk-RMM4JL5D.js → chunk-BNEW6WES.js} +2 -2
  5. package/lib/esm/{chunk-EDIABNX3.js → chunk-EMVX4D2H.js} +2 -2
  6. package/lib/esm/{chunk-A2N3FISM.js → chunk-KKLQ3TRA.js} +3 -3
  7. package/lib/esm/{chunk-A2N3FISM.js.map → chunk-KKLQ3TRA.js.map} +3 -3
  8. package/lib/esm/{chunk-F3D2AS2N.js → chunk-LWBDZWW4.js} +2 -2
  9. package/lib/esm/chunk-ROCNZJLL.js +2 -0
  10. package/lib/esm/chunk-T5QQA4HH.js +2 -0
  11. package/lib/esm/{chunk-X26M5SQZ.js.map → chunk-T5QQA4HH.js.map} +1 -1
  12. package/lib/esm/chunk-W57RTQ3G.js +2214 -0
  13. package/lib/esm/{chunk-CUKGTP3B.js.map → chunk-W57RTQ3G.js.map} +4 -4
  14. package/lib/esm/{chunk-UQJ6CFWP.js → chunk-Y5QWL6TS.js} +2 -2
  15. package/lib/esm/{dist-33QC5I55.js → dist-HJXMUEN5.js} +2 -2
  16. package/lib/esm/index.d.ts +614 -480
  17. package/lib/esm/index.js +1 -1
  18. package/lib/esm/{inspector-2YAWFES6.js → inspector-FXVGOLBH.js} +2 -2
  19. package/lib/esm/{internal-GHV4UNDA.js → internal-7ECOLP5R.js} +2 -2
  20. package/lib/esm/{outdoor-context-v4-5AXRLXXA.js → outdoor-context-v4-IZYE32JG.js} +2 -2
  21. package/lib/esm/{roboto-regular-25PMWR2T.js → roboto-regular-R5KXKW73.js} +2 -2
  22. package/lib/esm/{text3d-3IUOJSOH.js → text3d-2TVGBQ3N.js} +18 -18
  23. package/lib/esm/{text3d-3IUOJSOH.js.map → text3d-2TVGBQ3N.js.map} +3 -3
  24. package/lib/index-rn.js +194 -194
  25. package/package.json +2 -2
  26. package/lib/esm/chunk-AHC6OWNT.js +0 -2
  27. package/lib/esm/chunk-CUKGTP3B.js +0 -2214
  28. package/lib/esm/chunk-X26M5SQZ.js +0 -2
  29. /package/lib/esm/{GLTFExporter-QN63B2QE.js.map → GLTFExporter-YFXXQH2L.js.map} +0 -0
  30. /package/lib/esm/{GLTFLoader-7E66XH6W.js.map → GLTFLoader-LZNQSDLP.js.map} +0 -0
  31. /package/lib/esm/{browser-UPE3UIJH.js.map → browser-L6WJGOEX.js.map} +0 -0
  32. /package/lib/esm/{chunk-RMM4JL5D.js.map → chunk-BNEW6WES.js.map} +0 -0
  33. /package/lib/esm/{chunk-EDIABNX3.js.map → chunk-EMVX4D2H.js.map} +0 -0
  34. /package/lib/esm/{chunk-F3D2AS2N.js.map → chunk-LWBDZWW4.js.map} +0 -0
  35. /package/lib/esm/{chunk-AHC6OWNT.js.map → chunk-ROCNZJLL.js.map} +0 -0
  36. /package/lib/esm/{chunk-UQJ6CFWP.js.map → chunk-Y5QWL6TS.js.map} +0 -0
  37. /package/lib/esm/{dist-33QC5I55.js.map → dist-HJXMUEN5.js.map} +0 -0
  38. /package/lib/esm/{inspector-2YAWFES6.js.map → inspector-FXVGOLBH.js.map} +0 -0
  39. /package/lib/esm/{internal-GHV4UNDA.js.map → internal-7ECOLP5R.js.map} +0 -0
  40. /package/lib/esm/{outdoor-context-v4-5AXRLXXA.js.map → outdoor-context-v4-IZYE32JG.js.map} +0 -0
  41. /package/lib/esm/{roboto-regular-25PMWR2T.js.map → roboto-regular-R5KXKW73.js.map} +0 -0
@@ -1,3 +1,3 @@
1
- import{i as ye,j as Le,k as Oe}from"./chunk-EDIABNX3.js";import{$ as he,I as H,Q as g,R as fe,T as de,V as L,W,Y as Pe,aa as Ce,db as re,qa as Ie}from"./chunk-F3D2AS2N.js";import{a as l,b as m}from"./chunk-X26M5SQZ.js";import{f as i,g as f,h as x,i as y}from"./chunk-AHC6OWNT.js";l();var ne="[MappedinJS]",nt=(o=>(o[o.LOG=0]="LOG",o[o.WARN=1]="WARN",o[o.ERROR=2]="ERROR",o[o.SILENT=3]="SILENT",o))(nt||{});function ot(r="",{prefix:e=ne}={}){let t=`${e}${r?`-${r}`:""}`,n=(o,s)=>{if(typeof window<"u"&&window.rnDebug){let a=s.map(u=>u instanceof Error&&u.stack?`${u.message}
2
- ${u.stack}`:u);window.rnDebug(`${r} ${o}: ${a.join(" ")}`)}};return{logState:m.env.NODE_ENV==="test"?3:0,log(...o){this.logState<=0&&(console.log(t,...o),n("log",o))},warn(...o){this.logState<=1&&(console.warn(t,...o),n("warn",o))},error(...o){this.logState<=2&&(console.error(t,...o),n("error",o))},assert(...o){console.assert(...o)},time(o){console.time(o)},timeEnd(o){console.timeEnd(o)},setLevel(o){0<=o&&o<=3&&(this.logState=o)}}}var Ge=ot();function jt(r){0<=r&&r<=3&&(Ge.logState=r)}var R=Ge;l();l();var B=class extends Error{};B.prototype.name="InvalidTokenError";function it(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function st(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return it(e)}catch{return atob(e)}}function Ae(r,e){if(typeof r!="string")throw new B("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new B(`Invalid token specified: missing part #${t+1}`);let o;try{o=st(n)}catch(s){throw new B(`Invalid token specified: invalid base64 for part #${t+1} (${s.message})`)}try{return JSON.parse(o)}catch(s){throw new B(`Invalid token specified: invalid json for part #${t+1} (${s.message})`)}}l();var j=63710088e-1;function Xt(r){let e=Ae(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:e.aud??[],capabilities:e.capabilities??{}}}function O(r){return r*(Math.PI/180)}function at(r){return r*(180/Math.PI)}function Zt(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}function _e(r,e){return(r%e+e)%e}function Qt([r,e],[t,n]){let o=O(n-e),s=O(t-r),a=O(e),u=O(n),c=Math.sin(o/2)*Math.sin(o/2)+Math.sin(s/2)*Math.sin(s/2)*Math.cos(a)*Math.cos(u),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return j*p}function er([r,e],[t,n]){let o=O(e),s=O(r),a=O(n),c=O(t)-s,p=Math.sin(c)*Math.cos(a),h=Math.cos(o)*Math.sin(a)-Math.sin(o)*Math.cos(a)*Math.cos(c);return at((Math.atan2(p,h)+Math.PI*2)%(Math.PI*2))}function tr(r,e){let t=_e(r,Math.PI*2),n=_e(e,Math.PI*2),o=n-t,s=n+(o>Math.PI?-Math.PI*2:o<-Math.PI?Math.PI*2:0);return{start:t,end:s}}function lt(r){return r instanceof re?Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y):Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&Number.isFinite(r.min.z)&&Number.isFinite(r.max.z)}function rr(r,e,t,n){return(r<e||r>t)&&R.warn(n),Math.min(t,Math.max(e,r))}function nr(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function or(){return typeof window<"u"&&window!==null}l();function ar(r,e,t=!1){let n=null,o=0;return function(...s){o++,o===1&&t===!0&&r(...s);let a=()=>{(!t||o>1)&&r(...s),n=null,o=0};clearTimeout(n),n=setTimeout(a,e)}}l();l();function ut(r,e){return`${e} ${r}`}var z=class extends Error{constructor(e,t=ne){super(ut(e,t)),this.name="MappedinError"}},Ne=class extends z{constructor(e,t=ne){super(e,t),this.name="MappedinRenderError"}};l();var ge=class r extends Error{constructor(t){super(t);i(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,r)}};function ke(r,e){if(r==null){let t;e?.customMessage?t=e.customMessage:t=`Expected ${e?.valueName?`'${e.valueName}'`:"value"} to be defined, but received ${r}`;let n=e?.errorClass||ge,o=new n(t);throw e?.captureStackTrace!==!1&&Error.captureStackTrace&&Error.captureStackTrace(o,ke),o}}function fr(r,e,t){if(ke(r),r?.type!==e){let n=`Expected type ${e} but got ${r?.type}`;throw new Error(t??n)}}l();var be=[0,4,6,8,10],v=()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&(n&3)===0&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],be.map((n,o)=>t.slice(n,o===be.length-1?void 0:be[o+1]).join("")).join("-")};l();var xe=class{constructor(){i(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};l();var Fe="mi-session-data",Re="mi-local-data",Y="id",K="deviceId",V,D,E,oe=class oe{constructor(){x(this,D);x(this,E);try{let e=sessionStorage.getItem(Fe);e?y(this,D,JSON.parse(e)):y(this,D,{[Y]:v()})}catch{y(this,D,{[Y]:v()})}try{let e=localStorage.getItem(Re);e?y(this,E,JSON.parse(e)):y(this,E,{[K]:v()})}catch{y(this,E,{[K]:v()})}f(this,D)[Y]||(f(this,D)[Y]=v()),f(this,E)[K]||(f(this,E)[K]=v())}static getInstance(){return f(this,V)||y(this,V,new oe),f(this,V)}static ___clearInstance(){y(this,V,void 0)}saveSessionData(e,t){f(this,D)[e]=t;try{return sessionStorage.setItem(Fe,JSON.stringify(f(this,D))),!0}catch{return!1}}loadSessionData(e){let t=f(this,D)[e];if(t!=null)return t}saveLocalData(e,t){f(this,E)[e]=t;try{return localStorage.setItem(Re,JSON.stringify(f(this,E))),!0}catch{return!1}}loadLocalData(e){let t=f(this,E)[e];if(t!=null)return t}};V=new WeakMap,D=new WeakMap,E=new WeakMap,x(oe,V);var ve=oe;l();var ct=new Set(Object.keys(W.NAMES)),De;function Be(){return De==null&&(De=new W),De}var mt=r=>ct.has(r.toLowerCase()),pt=r=>{if(!r.startsWith("#"))return!1;let e=r.slice(1);if(e.length!==3&&e.length!==6)return!1;for(let t=0;t<e.length;t++)if(!(e[t]>="0"&&e[t]<="9"||e[t]>="A"&&e[t]<="F"||e[t]>="a"&&e[t]<="f"))return!1;return!0},ft=r=>{if(!r.startsWith("rgb(")&&!r.startsWith("rgba("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let o=0;o<n.length;o++){let s=n[o].trim();if(o<3)if(s.endsWith("%")){let a=parseFloat(s.slice(0,-1));if(isNaN(a)||a<0||a>100)return!1}else{let a=parseInt(s,10);if(isNaN(a)||a<0||a>255)return!1}else{let a=parseFloat(s);if(isNaN(a)||a<0||a>1)return!1}}return!0},dt=r=>{if(!r.startsWith("hsl(")&&!r.startsWith("hsla("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let o=0;o<n.length;o++){let s=n[o].trim();if(o===0){let a=parseFloat(s);if(isNaN(a))return!1}else if(o<3){if(!s.endsWith("%"))return!1;let a=parseFloat(s.slice(0,-1));if(isNaN(a)||a<0||a>100)return!1}else{let a=parseFloat(s);if(isNaN(a)||a<0||a>1)return!1}}return!0},ie=r=>r==null||typeof r!="string"?!1:!!(pt(r)||ft(r)||dt(r)||mt(r)),Pr=r=>{let e=Be();return e.set(r),[e.r,e.g,e.b]},Cr=r=>{let e=Be();return e.set(r[0],r[1],r[2]),"#"+e.getHexString()};l();var je=r=>r,ht=r=>r*r,yt=r=>1-Math.cos(r*Math.PI/2),gt=r=>1-(1-r)*(1-r),Ve={linear:je,"ease-in":ht,"ease-out":gt,"ease-in-out":yt};function Gr(r,e,t,n,o,s=je){if(e===t)return o;r=Math.max(e,Math.min(r,t));let a=(r-Math.min(e,t))/Math.abs(t-e),u=typeof s=="function"?s(a):Ve[s](a);return n+u*(o-n)}function Ar(r,e,t,n="ease-in"){if(e.length!==t.length)throw new z("Input and output ranges must have the same number of values.");r=Math.max(e[0],Math.min(r,e[e.length-1]));let o=0;for(;o<e.length-1&&r>e[o+1];)o++;let s=(r-e[o])/(e[o+1]-e[o]),a=typeof n=="function"?n(s):Ve[n](s);return t[o]+a*(t[o+1]-t[o])}l();function bt(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}l();l();l();l();l();l();l();l();var b=63710088e-1,We={centimeters:b*100,centimetres:b*100,degrees:b/111325,feet:b*3.28084,inches:b*39.37,kilometers:b/1e3,kilometres:b/1e3,meters:b,metres:b,miles:b/1609.344,millimeters:b*1e3,millimetres:b*1e3,nauticalmiles:b/1852,radians:1,yards:b*1.0936},qr={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/b,yards:1.0936133};function C(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}function xt(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ue(r[0])||!Ue(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return C(n,e,t)}function Xr(r,e,t){t===void 0&&(t={});for(var n=0,o=r;n<o.length;n++){var s=o[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}var u={type:"Polygon",coordinates:r};return C(u,e,t)}function $e(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return C(n,e,t)}function Zr(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}function Qr(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return C(n,e,t)}function en(r,e,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:r};return C(n,e,t)}function tn(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return C(n,e,t)}function rn(r,e){e===void 0&&(e="kilometers");var t=We[e];if(!t)throw new Error(e+" units is invalid");return r*t}function nn(r,e){e===void 0&&(e="kilometers");var t=We[e];if(!t)throw new Error(e+" units is invalid");return r/t}function on(r){var e=r%(2*Math.PI);return e*180/Math.PI}function sn(r){var e=r%360;return e*Math.PI/180}function Ue(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function J(r,e,t){if(r!==null)for(var n,o,s,a,u,c,p,h=0,d=0,w,P=r.type,T=P==="FeatureCollection",N=P==="Feature",me=T?r.features.length:1,k=0;k<me;k++){p=T?r.features[k].geometry:N?r.geometry:r,w=p?p.type==="GeometryCollection":!1,u=w?p.geometries.length:1;for(var pe=0;pe<u;pe++){var S=0,F=0;if(a=w?p.geometries[pe]:p,a!==null){c=a.coordinates;var I=a.type;switch(h=t&&(I==="Polygon"||I==="MultiPolygon")?1:0,I){case null:break;case"Point":if(e(c,d,k,S,F)===!1)return!1;d++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],d,k,S,F)===!1)return!1;d++,I==="MultiPoint"&&S++}I==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-h;o++){if(e(c[n][o],d,k,S,F)===!1)return!1;d++}I==="MultiLineString"&&S++,I==="Polygon"&&F++}I==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(F=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-h;s++){if(e(c[n][o][s],d,k,S,F)===!1)return!1;d++}F++}S++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(J(a.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function mn(r,e,t,n){var o=t;return J(r,function(s,a,u,c,p){a===0&&t===void 0?o=s:o=e(o,s,a,u,c,p)},n),o}function pn(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}function vt(r,e){var t,n,o,s,a,u,c,p,h,d,w=0,P=r.type==="FeatureCollection",T=r.type==="Feature",N=P?r.features.length:1;for(t=0;t<N;t++){for(u=P?r.features[t].geometry:T?r.geometry:r,p=P?r.features[t].properties:T?r.properties:{},h=P?r.features[t].bbox:T?r.bbox:void 0,d=P?r.features[t].id:T?r.id:void 0,c=u?u.type==="GeometryCollection":!1,a=c?u.geometries.length:1,o=0;o<a;o++){if(s=c?u.geometries[o]:u,s===null){if(e(null,w,p,h,d)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,w,p,h,d)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],w,p,h,d)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}w++}}function Dt(r,e){vt(r,function(t,n,o,s,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(C(t,o,{bbox:s,id:a}),n,0)===!1?!1:void 0}var c;switch(u){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var h=t.coordinates[p],d={type:c,coordinates:h};if(e(C(d,o),n,p)===!1)return!1}})}function Et(r,e){Dt(r,function(t,n,o){var s=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,c=0,p=0,h=0;if(J(t,function(d,w,P,T,N){if(u===void 0||n>c||T>p||N>h){u=d,c=n,p=T,h=N,s=0;return}var me=$e([u,d],t.properties);if(e(me,n,o,N,s)===!1)return!1;s++,u=d})===!1)return!1}}})}function fn(r,e,t){var n=t,o=!1;return Et(r,function(s,a,u,c,p){o===!1&&t===void 0?n=s:n=e(n,s,a,u,c,p),o=!0}),n}function Ee(r){var e=[1/0,1/0,-1/0,-1/0];return J(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}Ee.default=Ee;var He=Ee;function ze(r){return He(r)}l();var Me="#ffffff",Mt=.1,se=.1,q,X,Z,Te=class{constructor(e={}){i(this,"initialColor",Me);x(this,q,Me);i(this,"initialTopColor");x(this,X);i(this,"topTexture");i(this,"texture");x(this,Z);i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"width",Mt);i(this,"height",se);i(this,"initialHeight",se);i(this,"altitude",0);i(this,"join","round");i(this,"cap","round");i(this,"showImage",!0);i(this,"flipImageToFaceCamera",!0);i(this,"url");i(this,"side","double");i(this,"renderOrder",0);this.color=e?.color!==void 0?e.color:this.color,this.initialColor=this.color,this.width=e?.width!==void 0?e.width:this.width,this.opacity=e?.opacity!==void 0?e.opacity:this.opacity,this.visible=e?.visible!==void 0?e.visible:this.visible,this.height=e?.height!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=e?.altitude!==void 0?e.altitude:this.altitude,this.join=e?.join!==void 0?e.join:this.join,this.cap=e?.cap!==void 0?e.cap:this.cap,this.topColor=e?.topColor,this.initialTopColor=this.topColor,this.texture=e?.texture,this.topTexture=e?.topTexture,this.showImage=e?.showImage!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=e?.flipImageToFaceCamera!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e?.url,this.side=e?.side!==void 0?e.side:this.side,this.renderOrder=e?.renderOrder!==void 0?e.renderOrder:this.renderOrder}set color(e){ie(e)?y(this,q,e):R.warn(`Failed to update color. Invalid color "${e}".`)}get color(){return f(this,q)}set topColor(e){e===void 0||ie(e)?y(this,X,e):R.warn(`Failed to update top color. Invalid color "${e}".`)}get topColor(){return f(this,X)}set hoverColor(e){ie(e)?y(this,Z,e):R.warn(`Failed to update hover color. Invalid color "${e}".`)}get hoverColor(){return f(this,Z)}};q=new WeakMap,X=new WeakMap,Z=new WeakMap;var ae=class extends Ie{constructor(){super(...arguments);i(this,"type","entityBatchedMesh");i(this,"userData",{entities:{}})}},Q,U,Ye=class{constructor(e){i(this,"mesh");i(this,"imageMesh");i(this,"textMesh");i(this,"textEntityId");i(this,"type","geometry");i(this,"dirty",!0);i(this,"detached",!1);i(this,"instanceIndex",-1);i(this,"geometry");i(this,"batchedProps");i(this,"material");i(this,"feature");i(this,"currentHeight",se);i(this,"color",new W);i(this,"topColor",new W);i(this,"position",new g);i(this,"altitude",0);x(this,Q,1);x(this,U);i(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){return this.material?.getColor(this.instanceIndex)}get opacity(){return f(this,Q)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}y(this,Q,e)}get texture(){return this.material?.texture?.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){return this.material?.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){return this.material?.topTexture?.image.src}get topTextureInstance(){return this.material?.topTexture}set blendTexture(e){this.material&&(this.material.blendTexture=e)}get featureBbox(){return f(this,U)?f(this,U):(y(this,U,ze(this.feature)),f(this,U))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};Q=new WeakMap,U=new WeakMap;l();var Ke="#ffffff",G,le=class{constructor(e={}){i(this,"color",Ke);i(this,"initialColor",Ke);i(this,"topColor");i(this,"initialTopColor");i(this,"opacity",1);i(this,"height");x(this,G);i(this,"outline",!0);i(this,"texture");i(this,"topTexture");i(this,"dirty",!0);this.color=e?.color??this.color,this.initialColor=this.color,this.topColor=e?.topColor,this.initialTopColor=this.topColor,this.opacity=e?.opacity??this.opacity,this.height=e?.height,this.shading=e?.shading,this.outline=e?.outline!==void 0?!!e.outline:this.outline}get shading(){return f(this,G)}set shading(e){if(!e){y(this,G,void 0);return}y(this,G,f(this,G)??{start:0,end:0,intensity:0}),Object.assign(f(this,G),e)}};G=new WeakMap;var M=class extends L{constructor(t,n=new le){super();i(this,"visible",!0);i(this,"type","geometry-group");i(this,"components");i(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=t}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let o of this.children)if(!o.userData.detached){t=o;break}return t instanceof ae?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};l();var A=class extends L{},ee=class{constructor(e,t,n=0){i(this,"id");i(this,"verticalOffset");i(this,"occluderId");i(this,"object3d",new A);i(this,"components");i(this,"disposed",!1);i(this,"worldPosition",new g);this.id=e.id||v(),this.components=[e],this.verticalOffset=n,this.object3d=new A,this.object3d.position.set(t.x,t.y,t.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type,this.positionDirty=!0}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.positionDirty&&(this.object3d.matrixAutoUpdate=!0,this.object3d.getWorldPosition(this.worldPosition),this.positionDirty=!1,this.object3d.matrixAutoUpdate=!1),this.worldPosition}get positionDirty(){return this.object3d.userData.worldPositionDirty}set positionDirty(e){this.object3d.userData.worldPositionDirty=e}updatePosition(e){this.object3d.position.copy(e),this.positionDirty=!0}setAltitude(e){this.object3d.position.z=e,this.positionDirty=!0}};l();var ue=class extends L{constructor(){super(...arguments);i(this,"type","geometry");i(this,"userData",{entityId:"",type:"geometry"})}raycast(t,n){this.userData.type==="model"&&this.children[0]&&t.intersectObject(this.children[0],!0).forEach(o=>{n.push(o)})}},te=class{constructor(e,t){i(this,"id",v());i(this,"components");i(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){return this.components[0].mesh?.parent}get type(){return this.components[0].type}attach(e){this.parentObject3D instanceof M?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof M&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};var $=class r extends L{constructor(t){super();i(this,"childrenIds",new Set);i(this,"children",[]);i(this,"type","group-container");i(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});i(this,"components",[]);this.userData.entityId=t}addOccluderFeature(t,n){this.userData.occluderFeature=t,this.userData.occluderId=n,this.userData.occluderDirty=!0}addEntity(t){t instanceof r?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ee?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id),t.positionDirty=!0):t instanceof M?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof te&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof r?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ee?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof M?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof te&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}),this.set2DGeometryChildrenPositionDirty())}set2DGeometryChildrenPositionDirty(){this.children.forEach(t=>{t instanceof A?t.userData.worldPositionDirty=!0:t instanceof r&&t.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(t){this.userData.opacity=t}get opacity(){return this.userData.opacity}};l();var io={top:0,bottom:0,left:0,right:0,type:"pixel"},Je="mappedin";var so={ALWAYS_ON_TOP:10},ao=250;l();function Tt(r){let e=r.min,t=r.max,n=new g(e.x,e.y,e.z),o=new g(t.x,e.y,e.z),s=new g(e.x,t.y,e.z),a=new g(t.x,t.y,e.z);return[n,o,s,a]}l();function qe(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof e?.id=="string"||typeof e?.id=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}function ho(r,e,t=[],n=new fe,o){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let s=qe(r.getInternalState(),e);return Xe(s,t,n,o),t}var ce=new g;function Xe(r,e=[],t=new fe,n){if(r.visible){if(r.isMesh||r.isLine||r.isPoints){let o=r.geometry;if(o.isBufferGeometry){let s=o.attributes.position;for(let a=0;a<s.count;a++)ce.fromBufferAttribute(s,a),n!==void 0&&(ce.z=n),e.push(ce.clone()),t.expandByPoint(ce)}}for(let o of r.children)Xe(o,e,t,n)}}l();function St(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}l();function wt(r,e,t=!1){let n=null,o=0;return function(...s){o++,o===1&&t===!0&&r(...s);let a=()=>{(!t||o>1)&&r(...s),n=null,o=0};clearTimeout(n),n=setTimeout(a,e)}}l();var Pt=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,o=/(iphone|ipod|ipad)/i.test(e),s=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,a=/android/i.test(e);return r={isIpad:s,isMobile:a||o||s,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Ze=Pt.getDeviceType,Qe=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let s=r.getContext("webgl")||r.getContext("experimental-webgl");if(!s)return e;try{let a=Ze().isFirefox?null:s.getExtension("WEBGL_debug_renderer_info");return e=a?s.getParameter(a.UNMASKED_RENDERER_WEBGL):s.getParameter(s.RENDERER),e}catch{let u=new Error("Failed getting device info");throw u.name="FailedGettingDeviceInfo",u}}function o(){if(!Ze().isWindows)return!1;if(t!==void 0)return t;let s=Ct()?.toLowerCase()??"";return t=s.includes("intel")&&(s.includes("uhd")||s.includes("iris")),t}return{getInfo:n,shouldDisableOffscreenCanvas:o,_setCanvas(s){r=s,e=void 0,t=void 0}}})(),Ct=Qe.getInfo,It=Qe.shouldDisableOffscreenCanvas;l();function Lt(r,e){let t={};for(let n=0;n<e.length;n++){let o=e[n];o in r&&(t[o]=r[o])}return t}function Ot(r){return Object.keys(r).length===0}l();var Gt=r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let o=r[n];e.includes("mappedin")||(r[n]=o)}return{url:e,headers:t}}return{url:e,headers:r}};function Fo(r,e,t,n){let o=r*(Math.PI/180),s=n/j,a=r+s*180/Math.PI,u=t/j/Math.cos(o),c=e+u*180/Math.PI;return{lat:a,lon:c}}function Ro(r,e,t,n){let o=t*(Math.PI/180),s=n*(Math.PI/180),a=r*(Math.PI/180),u=e*(Math.PI/180),c=o-a,p=s-u,h=j*p*Math.cos(a),d=j*c;return{x:h,y:d}}var At=(r,e,t)=>{if(r.children&&(r.visible||r instanceof $&&r.userData.preloadGeometry))for(let n of r.children){if(n.visible&&n.type)if("entities3D"in n.userData&&n.userData?.entities3D&&n instanceof M){e.add(n.userData.entityId),n.userData.dirty&&t.add(n.userData.entityId);for(let o of n.userData.entities3D.values())e.add(o)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof ue)&&e.add(n.userData.entityId);At(n,e,t)}return e},_t=(r,e)=>{if(r.children&&r.visible&&!r.userData?.hidden)for(let t of r.children)t.visible&&t instanceof A&&e.add(t.userData.entityId),_t(t,e);return e};function Nt(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Nt(r[t],e[t]):r[t]=e[t]}return r}function Bo(r,e,t,n){let o={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},s=new de,a=new g(o.scale,-o.scale,o.scale),u=new de().makeTranslation(o.translateX,o.translateY,o.translateZ).scale(a),c=t.elevation;return{id:Je,type:"custom",renderingMode:"3d",render:(p,h)=>{if(s.fromArray(h),c!==t.elevation){let d=Oe.fromLngLat(r.toLngLat(),t.elevation);u.makeTranslation(o.translateX,o.translateY,-d.z).scale(a)}e.projectionMatrix=s.multiply(u),c=t.elevation,n()}}}function kt(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}async function jo(r){let e=await kt(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}function Vo(r,e=0){let t=3735928559^e,n=1103547991^e;for(let o=0,s;o<r.length;o++)s=r.charCodeAt(o),t=Math.imul(t^s,2654435761),n=Math.imul(n^s,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}function Uo(r,e,t){let n=r*(Math.PI/180)/2,o=e/2;return t*Math.tan(n)/o}function Wo(r){return new Le(new ye(r[0][0],r[0][1]),new ye(r[1][0],r[1][1])).getCenter().toArray()}function $o(r,e){return r<e||e<=12}function Ho(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof $?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof M&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof $&&(e=r.parentObject3D.parent.userData.computedOpacity),e}function zo(r,e,t=1e-10){if(r.length!==e.length)return!1;let n=Math.abs(r[0]-e[0])<t,o=Math.abs(r[1]-e[1])<t;if(r.length===3&&e.length===3){let s=Math.abs(r[2]-e[2])<t;return n&&o&&s}return n&&o}var Ft="maplibre-frustum-culling-hack";function Yo(){let r=new Ce(.01,.01,.01),e=new Pe({opacity:0,depthWrite:!1,transparent:!0}),t=new he(r,e);return t.position.copy(new g(0,50,0)),t.frustumCulled=!1,t.name=Ft,t}var _=new g,et=new H;function Ko(r,e,t=new re){return r.traverse(n=>{if(n instanceof he){let s=n.geometry.attributes.position;if(e.position.distanceTo(n.position)<e.near)return;for(let u=0;u<s.count;u++)_.fromBufferAttribute(s,u),_.applyMatrix4(n.matrixWorld),_.applyMatrix4(e.matrixWorldInverse),_.applyMatrix4(e.projectionMatrix),_.z<1&&_.z>0&&(et.set(_.x,_.y),t.expandByPoint(et))}}),t}function tt(r,e){let t=e.clientWidth,n=e.clientHeight;return new H((r.x+1)*t/2,(1-r.y)*n/2)}function Jo(r,e,t){let n=document.createElement("div");n.style.position="absolute",n.style.border=`2px solid ${e}`,n.style.pointerEvents="none";let o=tt(new H(r.min.x,r.min.y),t),s=tt(new H(r.max.x,r.max.y),t);n.style.left=`${o.x}px`,n.style.top=`${s.y}px`;let a=Math.abs(s.x-o.x),u=Math.abs(s.y-o.y);return n.style.width=`${a}px`,n.style.height=`${u}px`,t.appendChild(n),n}l();var Se=class{constructor(e){i(this,"visible");i(this,"altitude");i(this,"color");i(this,"dirty",!0);i(this,"maxWidth");i(this,"maxHeight");i(this,"hoverByPolygon");i(this,"flipToFaceCamera",rt.flipToFaceCamera);i(this,"font");i(this,"fillOpacity");i(this,"fontSize");i(this,"margin");i(this,"outlineWidth");i(this,"outlineBlur");i(this,"outlineOffsetX");i(this,"strokeColor");i(this,"strokeOpacity");i(this,"strokeWidth");i(this,"hoverColor");i(this,"outlineOffsetY");i(this,"outlineColor");i(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}},rt=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});l();l();var we=class{constructor(e){i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"verticalOffset",0);i(this,"interactive",!1);i(this,"color");i(this,"material");i(this,"rotation");i(this,"scale");e&&Object.assign(this,e)}};l();var Rt=[1,1,1],Bt=[0,0,0];export{nt as a,jt as b,R as c,z as d,Ne as e,j as f,Xt as g,O as h,Zt as i,Qt as j,er as k,tr as l,lt as m,rr as n,nr as o,or as p,ar as q,fr as r,v as s,xe as t,ve as u,ie as v,Pr as w,Cr as x,je as y,yt as z,Gr as A,Ar as B,C,xt as D,Xr as E,$e as F,Zr as G,Qr as H,en as I,tn as J,rn as K,nn as L,on as M,sn as N,J as O,mn as P,pn as Q,Dt as R,fn as S,He as T,Me as U,Te as V,ae as W,Ye as X,le as Y,M as Z,A as _,ee as $,ue as aa,te as ba,$ as ca,io as da,Je as ea,so as fa,ao as ga,Tt as ha,qe as ia,ho as ja,St as ka,wt as la,It as ma,Lt as na,Ot as oa,Gt as pa,bt as qa,Fo as ra,Ro as sa,At as ta,_t as ua,Nt as va,Bo as wa,jo as xa,Vo as ya,Uo as za,Wo as Aa,$o as Ba,Ho as Ca,zo as Da,Yo as Ea,Ko as Fa,Jo as Ga,Se as Ha,rt as Ia,we as Ja,Rt as Ka,Bt as La};
3
- //# sourceMappingURL=chunk-A2N3FISM.js.map
1
+ import{i as ye,j as Le,k as Oe}from"./chunk-EMVX4D2H.js";import{$ as he,I as H,Q as g,R as fe,T as de,V as L,W,Y as Pe,aa as Ce,db as re,qa as Ie}from"./chunk-LWBDZWW4.js";import{a as l,b as m}from"./chunk-T5QQA4HH.js";import{e as i,f,g as x,h as y}from"./chunk-ROCNZJLL.js";l();var ne="[MappedinJS]",nt=(o=>(o[o.LOG=0]="LOG",o[o.WARN=1]="WARN",o[o.ERROR=2]="ERROR",o[o.SILENT=3]="SILENT",o))(nt||{});function ot(r="",{prefix:e=ne}={}){let t=`${e}${r?`-${r}`:""}`,n=(o,s)=>{if(typeof window<"u"&&window.rnDebug){let a=s.map(u=>u instanceof Error&&u.stack?`${u.message}
2
+ ${u.stack}`:u);window.rnDebug(`${r} ${o}: ${a.join(" ")}`)}};return{logState:m.env.NODE_ENV==="test"?3:0,log(...o){this.logState<=0&&(console.log(t,...o),n("log",o))},warn(...o){this.logState<=1&&(console.warn(t,...o),n("warn",o))},error(...o){this.logState<=2&&(console.error(t,...o),n("error",o))},assert(...o){console.assert(...o)},time(o){console.time(o)},timeEnd(o){console.timeEnd(o)},setLevel(o){0<=o&&o<=3&&(this.logState=o)}}}var Ae=ot();function jt(r){0<=r&&r<=3&&(Ae.logState=r)}var R=Ae;l();l();var B=class extends Error{};B.prototype.name="InvalidTokenError";function it(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function st(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return it(e)}catch{return atob(e)}}function Ge(r,e){if(typeof r!="string")throw new B("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new B(`Invalid token specified: missing part #${t+1}`);let o;try{o=st(n)}catch(s){throw new B(`Invalid token specified: invalid base64 for part #${t+1} (${s.message})`)}try{return JSON.parse(o)}catch(s){throw new B(`Invalid token specified: invalid json for part #${t+1} (${s.message})`)}}l();var j=63710088e-1;function Xt(r){let e=Ge(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:e.aud??[],capabilities:e.capabilities??{}}}function O(r){return r*(Math.PI/180)}function at(r){return r*(180/Math.PI)}function Zt(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}function _e(r,e){return(r%e+e)%e}function Qt([r,e],[t,n]){let o=O(n-e),s=O(t-r),a=O(e),u=O(n),c=Math.sin(o/2)*Math.sin(o/2)+Math.sin(s/2)*Math.sin(s/2)*Math.cos(a)*Math.cos(u),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return j*p}function er([r,e],[t,n]){let o=O(e),s=O(r),a=O(n),c=O(t)-s,p=Math.sin(c)*Math.cos(a),h=Math.cos(o)*Math.sin(a)-Math.sin(o)*Math.cos(a)*Math.cos(c);return at((Math.atan2(p,h)+Math.PI*2)%(Math.PI*2))}function tr(r,e){let t=_e(r,Math.PI*2),n=_e(e,Math.PI*2),o=n-t,s=n+(o>Math.PI?-Math.PI*2:o<-Math.PI?Math.PI*2:0);return{start:t,end:s}}function lt(r){return r instanceof re?Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y):Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&Number.isFinite(r.min.z)&&Number.isFinite(r.max.z)}function rr(r,e,t,n){return(r<e||r>t)&&R.warn(n),Math.min(t,Math.max(e,r))}function nr(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function or(){return typeof window<"u"&&window!==null}l();function ar(r,e,t=!1){let n=null,o=0;return function(...s){o++,o===1&&t===!0&&r(...s);let a=()=>{(!t||o>1)&&r(...s),n=null,o=0};clearTimeout(n),n=setTimeout(a,e)}}l();l();function ut(r,e){return`${e} ${r}`}var z=class extends Error{constructor(e,t=ne){super(ut(e,t)),this.name="MappedinError"}},ke=class extends z{constructor(e,t=ne){super(e,t),this.name="MappedinRenderError"}};l();var ge=class r extends Error{constructor(t){super(t);i(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,r)}};function Ne(r,e){if(r==null){let t;e?.customMessage?t=e.customMessage:t=`Expected ${e?.valueName?`'${e.valueName}'`:"value"} to be defined, but received ${r}`;let n=e?.errorClass||ge,o=new n(t);throw e?.captureStackTrace!==!1&&Error.captureStackTrace&&Error.captureStackTrace(o,Ne),o}}function fr(r,e,t){if(Ne(r),r?.type!==e){let n=`Expected type ${e} but got ${r?.type}`;throw new Error(t??n)}}l();var be=[0,4,6,8,10],v=()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&(n&3)===0&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],be.map((n,o)=>t.slice(n,o===be.length-1?void 0:be[o+1]).join("")).join("-")};l();var xe=class{constructor(){i(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};l();var Fe="mi-session-data",Re="mi-local-data",K="id",Y="deviceId",V,D,E,oe=class oe{constructor(){x(this,D);x(this,E);try{let e=sessionStorage.getItem(Fe);e?y(this,D,JSON.parse(e)):y(this,D,{[K]:v()})}catch{y(this,D,{[K]:v()})}try{let e=localStorage.getItem(Re);e?y(this,E,JSON.parse(e)):y(this,E,{[Y]:v()})}catch{y(this,E,{[Y]:v()})}f(this,D)[K]||(f(this,D)[K]=v()),f(this,E)[Y]||(f(this,E)[Y]=v())}static getInstance(){return f(this,V)||y(this,V,new oe),f(this,V)}static ___clearInstance(){y(this,V,void 0)}saveSessionData(e,t){f(this,D)[e]=t;try{return sessionStorage.setItem(Fe,JSON.stringify(f(this,D))),!0}catch{return!1}}loadSessionData(e){let t=f(this,D)[e];if(t!=null)return t}saveLocalData(e,t){f(this,E)[e]=t;try{return localStorage.setItem(Re,JSON.stringify(f(this,E))),!0}catch{return!1}}loadLocalData(e){let t=f(this,E)[e];if(t!=null)return t}};V=new WeakMap,D=new WeakMap,E=new WeakMap,x(oe,V);var ve=oe;l();var ct=new Set(Object.keys(W.NAMES)),De;function Be(){return De==null&&(De=new W),De}var mt=r=>ct.has(r.toLowerCase()),pt=r=>{if(!r.startsWith("#"))return!1;let e=r.slice(1);if(e.length!==3&&e.length!==6)return!1;for(let t=0;t<e.length;t++)if(!(e[t]>="0"&&e[t]<="9"||e[t]>="A"&&e[t]<="F"||e[t]>="a"&&e[t]<="f"))return!1;return!0},ft=r=>{if(!r.startsWith("rgb(")&&!r.startsWith("rgba("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let o=0;o<n.length;o++){let s=n[o].trim();if(o<3)if(s.endsWith("%")){let a=parseFloat(s.slice(0,-1));if(isNaN(a)||a<0||a>100)return!1}else{let a=parseInt(s,10);if(isNaN(a)||a<0||a>255)return!1}else{let a=parseFloat(s);if(isNaN(a)||a<0||a>1)return!1}}return!0},dt=r=>{if(!r.startsWith("hsl(")&&!r.startsWith("hsla("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let o=0;o<n.length;o++){let s=n[o].trim();if(o===0){let a=parseFloat(s);if(isNaN(a))return!1}else if(o<3){if(!s.endsWith("%"))return!1;let a=parseFloat(s.slice(0,-1));if(isNaN(a)||a<0||a>100)return!1}else{let a=parseFloat(s);if(isNaN(a)||a<0||a>1)return!1}}return!0},ie=r=>r==null||typeof r!="string"?!1:!!(pt(r)||ft(r)||dt(r)||mt(r)),Pr=r=>{let e=Be();return e.set(r),[e.r,e.g,e.b]},Cr=r=>{let e=Be();return e.set(r[0],r[1],r[2]),"#"+e.getHexString()};l();var je=r=>r,ht=r=>r*r,yt=r=>1-Math.cos(r*Math.PI/2),gt=r=>1-(1-r)*(1-r),Ve={linear:je,"ease-in":ht,"ease-out":gt,"ease-in-out":yt};function Ar(r,e,t,n,o,s=je){if(e===t)return o;r=Math.max(e,Math.min(r,t));let a=(r-Math.min(e,t))/Math.abs(t-e),u=typeof s=="function"?s(a):Ve[s](a);return n+u*(o-n)}function Gr(r,e,t,n="ease-in"){if(e.length!==t.length)throw new z("Input and output ranges must have the same number of values.");r=Math.max(e[0],Math.min(r,e[e.length-1]));let o=0;for(;o<e.length-1&&r>e[o+1];)o++;let s=(r-e[o])/(e[o+1]-e[o]),a=typeof n=="function"?n(s):Ve[n](s);return t[o]+a*(t[o+1]-t[o])}l();function bt(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}l();l();l();l();l();l();l();l();var b=63710088e-1,We={centimeters:b*100,centimetres:b*100,degrees:b/111325,feet:b*3.28084,inches:b*39.37,kilometers:b/1e3,kilometres:b/1e3,meters:b,metres:b,miles:b/1609.344,millimeters:b*1e3,millimetres:b*1e3,nauticalmiles:b/1852,radians:1,yards:b*1.0936},qr={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/b,yards:1.0936133};function C(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}function xt(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ue(r[0])||!Ue(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return C(n,e,t)}function Xr(r,e,t){t===void 0&&(t={});for(var n=0,o=r;n<o.length;n++){var s=o[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}var u={type:"Polygon",coordinates:r};return C(u,e,t)}function $e(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return C(n,e,t)}function Zr(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}function Qr(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return C(n,e,t)}function en(r,e,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:r};return C(n,e,t)}function tn(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return C(n,e,t)}function rn(r,e){e===void 0&&(e="kilometers");var t=We[e];if(!t)throw new Error(e+" units is invalid");return r*t}function nn(r,e){e===void 0&&(e="kilometers");var t=We[e];if(!t)throw new Error(e+" units is invalid");return r/t}function on(r){var e=r%(2*Math.PI);return e*180/Math.PI}function sn(r){var e=r%360;return e*Math.PI/180}function Ue(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function J(r,e,t){if(r!==null)for(var n,o,s,a,u,c,p,h=0,d=0,w,P=r.type,T=P==="FeatureCollection",k=P==="Feature",me=T?r.features.length:1,N=0;N<me;N++){p=T?r.features[N].geometry:k?r.geometry:r,w=p?p.type==="GeometryCollection":!1,u=w?p.geometries.length:1;for(var pe=0;pe<u;pe++){var S=0,F=0;if(a=w?p.geometries[pe]:p,a!==null){c=a.coordinates;var I=a.type;switch(h=t&&(I==="Polygon"||I==="MultiPolygon")?1:0,I){case null:break;case"Point":if(e(c,d,N,S,F)===!1)return!1;d++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],d,N,S,F)===!1)return!1;d++,I==="MultiPoint"&&S++}I==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-h;o++){if(e(c[n][o],d,N,S,F)===!1)return!1;d++}I==="MultiLineString"&&S++,I==="Polygon"&&F++}I==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(F=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-h;s++){if(e(c[n][o][s],d,N,S,F)===!1)return!1;d++}F++}S++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(J(a.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function mn(r,e,t,n){var o=t;return J(r,function(s,a,u,c,p){a===0&&t===void 0?o=s:o=e(o,s,a,u,c,p)},n),o}function pn(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}function vt(r,e){var t,n,o,s,a,u,c,p,h,d,w=0,P=r.type==="FeatureCollection",T=r.type==="Feature",k=P?r.features.length:1;for(t=0;t<k;t++){for(u=P?r.features[t].geometry:T?r.geometry:r,p=P?r.features[t].properties:T?r.properties:{},h=P?r.features[t].bbox:T?r.bbox:void 0,d=P?r.features[t].id:T?r.id:void 0,c=u?u.type==="GeometryCollection":!1,a=c?u.geometries.length:1,o=0;o<a;o++){if(s=c?u.geometries[o]:u,s===null){if(e(null,w,p,h,d)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,w,p,h,d)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],w,p,h,d)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}w++}}function Dt(r,e){vt(r,function(t,n,o,s,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(C(t,o,{bbox:s,id:a}),n,0)===!1?!1:void 0}var c;switch(u){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var h=t.coordinates[p],d={type:c,coordinates:h};if(e(C(d,o),n,p)===!1)return!1}})}function Et(r,e){Dt(r,function(t,n,o){var s=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,c=0,p=0,h=0;if(J(t,function(d,w,P,T,k){if(u===void 0||n>c||T>p||k>h){u=d,c=n,p=T,h=k,s=0;return}var me=$e([u,d],t.properties);if(e(me,n,o,k,s)===!1)return!1;s++,u=d})===!1)return!1}}})}function fn(r,e,t){var n=t,o=!1;return Et(r,function(s,a,u,c,p){o===!1&&t===void 0?n=s:n=e(n,s,a,u,c,p),o=!0}),n}function Ee(r){var e=[1/0,1/0,-1/0,-1/0];return J(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}Ee.default=Ee;var He=Ee;function ze(r){return He(r)}l();var Me="#ffffff",Mt=.1,se=.1,q,X,Z,Te=class{constructor(e={}){i(this,"initialColor",Me);x(this,q,Me);i(this,"initialTopColor");x(this,X);i(this,"topTexture");i(this,"texture");x(this,Z);i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"width",Mt);i(this,"height",se);i(this,"initialHeight",se);i(this,"altitude",0);i(this,"join","round");i(this,"cap","round");i(this,"showImage",!0);i(this,"flipImageToFaceCamera",!0);i(this,"url");i(this,"side","double");i(this,"renderOrder",0);this.color=e?.color!==void 0?e.color:this.color,this.initialColor=this.color,this.width=e?.width!==void 0?e.width:this.width,this.opacity=e?.opacity!==void 0?e.opacity:this.opacity,this.visible=e?.visible!==void 0?e.visible:this.visible,this.height=e?.height!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=e?.altitude!==void 0?e.altitude:this.altitude,this.join=e?.join!==void 0?e.join:this.join,this.cap=e?.cap!==void 0?e.cap:this.cap,this.topColor=e?.topColor,this.initialTopColor=this.topColor,this.texture=e?.texture,this.topTexture=e?.topTexture,this.showImage=e?.showImage!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=e?.flipImageToFaceCamera!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e?.url,this.side=e?.side!==void 0?e.side:this.side,this.renderOrder=e?.renderOrder!==void 0?e.renderOrder:this.renderOrder}set color(e){ie(e)?y(this,q,e):R.warn(`Failed to update color. Invalid color "${e}".`)}get color(){return f(this,q)}set topColor(e){e===void 0||ie(e)?y(this,X,e):R.warn(`Failed to update top color. Invalid color "${e}".`)}get topColor(){return f(this,X)}set hoverColor(e){ie(e)?y(this,Z,e):R.warn(`Failed to update hover color. Invalid color "${e}".`)}get hoverColor(){return f(this,Z)}};q=new WeakMap,X=new WeakMap,Z=new WeakMap;var ae=class extends Ie{constructor(){super(...arguments);i(this,"type","entityBatchedMesh");i(this,"userData",{entities:{}})}},Q,U,Ke=class{constructor(e){i(this,"mesh");i(this,"imageMesh");i(this,"textMesh");i(this,"textEntityId");i(this,"type","geometry");i(this,"dirty",!0);i(this,"detached",!1);i(this,"instanceIndex",-1);i(this,"geometry");i(this,"batchedProps");i(this,"material");i(this,"feature");i(this,"currentHeight",se);i(this,"color",new W);i(this,"topColor",new W);i(this,"position",new g);i(this,"altitude",0);x(this,Q,1);x(this,U);i(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){return this.material?.getColor(this.instanceIndex)}get opacity(){return f(this,Q)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}y(this,Q,e)}get texture(){return this.material?.texture?.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){return this.material?.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){return this.material?.topTexture?.image.src}get topTextureInstance(){return this.material?.topTexture}set blendTexture(e){this.material&&(this.material.blendTexture=e)}get featureBbox(){return f(this,U)?f(this,U):(y(this,U,ze(this.feature)),f(this,U))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};Q=new WeakMap,U=new WeakMap;l();var Ye="#ffffff",A,le=class{constructor(e={}){i(this,"color",Ye);i(this,"initialColor",Ye);i(this,"topColor");i(this,"initialTopColor");i(this,"opacity",1);i(this,"height");x(this,A);i(this,"outline",!0);i(this,"texture");i(this,"topTexture");i(this,"dirty",!0);this.color=e?.color??this.color,this.initialColor=this.color,this.topColor=e?.topColor,this.initialTopColor=this.topColor,this.opacity=e?.opacity??this.opacity,this.height=e?.height,this.shading=e?.shading,this.outline=e?.outline!==void 0?!!e.outline:this.outline}get shading(){return f(this,A)}set shading(e){if(!e){y(this,A,void 0);return}y(this,A,f(this,A)??{start:0,end:0,intensity:0}),Object.assign(f(this,A),e)}};A=new WeakMap;var M=class extends L{constructor(t,n=new le){super();i(this,"visible",!0);i(this,"type","geometry-group");i(this,"components");i(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=t}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let o of this.children)if(!o.userData.detached){t=o;break}return t instanceof ae?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};l();var G=class extends L{},ee=class{constructor(e,t,n=0){i(this,"id");i(this,"verticalOffset");i(this,"occluderId");i(this,"object3d",new G);i(this,"components");i(this,"disposed",!1);i(this,"worldPosition",new g);this.id=e.id||v(),this.components=[e],this.verticalOffset=n,this.object3d=new G,this.object3d.position.set(t.x,t.y,t.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type,this.positionDirty=!0}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.positionDirty&&(this.object3d.matrixAutoUpdate=!0,this.object3d.getWorldPosition(this.worldPosition),this.positionDirty=!1,this.object3d.matrixAutoUpdate=!1),this.worldPosition}get positionDirty(){return this.object3d.userData.worldPositionDirty}set positionDirty(e){this.object3d.userData.worldPositionDirty=e}updatePosition(e){this.object3d.position.copy(e),this.positionDirty=!0}setAltitude(e){this.object3d.position.z=e,this.positionDirty=!0}};l();var ue=class extends L{constructor(){super(...arguments);i(this,"type","geometry");i(this,"userData",{entityId:"",type:"geometry"})}raycast(t,n){this.userData.type==="model"&&this.children[0]&&t.intersectObject(this.children[0],!0).forEach(o=>{n.push(o)})}},te=class{constructor(e,t){i(this,"id",v());i(this,"components");i(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){return this.components[0].mesh?.parent}get type(){return this.components[0].type}attach(e){this.parentObject3D instanceof M?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof M&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};var $=class r extends L{constructor(t){super();i(this,"childrenIds",new Set);i(this,"children",[]);i(this,"type","group-container");i(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});i(this,"components",[]);this.userData.entityId=t}addOccluderFeature(t,n){this.userData.occluderFeature=t,this.userData.occluderId=n,this.userData.occluderDirty=!0}addEntity(t){t instanceof r?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ee?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id),t.positionDirty=!0):t instanceof M?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof te&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof r?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ee?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof M?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof te&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}),this.set2DGeometryChildrenPositionDirty())}set2DGeometryChildrenPositionDirty(){this.children.forEach(t=>{t instanceof G?t.userData.worldPositionDirty=!0:t instanceof r&&t.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(t){this.userData.opacity=t}get opacity(){return this.userData.opacity}};l();var io={top:0,bottom:0,left:0,right:0,type:"pixel"},Je="mappedin";var so={ALWAYS_ON_TOP:10},ao=250,lo="collision-worker.csp.js",uo="maplibre-worker.csp.js";l();function Tt(r){let e=r.min,t=r.max,n=new g(e.x,e.y,e.z),o=new g(t.x,e.y,e.z),s=new g(e.x,t.y,e.z),a=new g(t.x,t.y,e.z);return[n,o,s,a]}l();function qe(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof e?.id=="string"||typeof e?.id=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}function go(r,e,t=[],n=new fe,o){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let s=qe(r.getInternalState(),e);return Xe(s,t,n,o),t}var ce=new g;function Xe(r,e=[],t=new fe,n){if(r.visible){if(r.isMesh||r.isLine||r.isPoints){let o=r.geometry;if(o.isBufferGeometry){let s=o.attributes.position;for(let a=0;a<s.count;a++)ce.fromBufferAttribute(s,a),n!==void 0&&(ce.z=n),e.push(ce.clone()),t.expandByPoint(ce)}}for(let o of r.children)Xe(o,e,t,n)}}l();function St(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}l();function wt(r,e,t=!1){let n=null,o=0;return function(...s){o++,o===1&&t===!0&&r(...s);let a=()=>{(!t||o>1)&&r(...s),n=null,o=0};clearTimeout(n),n=setTimeout(a,e)}}l();var Pt=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,o=/(iphone|ipod|ipad)/i.test(e),s=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,a=/android/i.test(e);return r={isIpad:s,isMobile:a||o||s,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Ze=Pt.getDeviceType,Qe=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let s=r.getContext("webgl")||r.getContext("experimental-webgl");if(!s)return e;try{let a=Ze().isFirefox?null:s.getExtension("WEBGL_debug_renderer_info");return e=a?s.getParameter(a.UNMASKED_RENDERER_WEBGL):s.getParameter(s.RENDERER),e}catch{let u=new Error("Failed getting device info");throw u.name="FailedGettingDeviceInfo",u}}function o(){if(!Ze().isWindows)return!1;if(t!==void 0)return t;let s=Ct()?.toLowerCase()??"";return t=s.includes("intel")&&(s.includes("uhd")||s.includes("iris")),t}return{getInfo:n,shouldDisableOffscreenCanvas:o,_setCanvas(s){r=s,e=void 0,t=void 0}}})(),Ct=Qe.getInfo,It=Qe.shouldDisableOffscreenCanvas;l();function Lt(r,e){let t={};for(let n=0;n<e.length;n++){let o=e[n];o in r&&(t[o]=r[o])}return t}function Ot(r){return Object.keys(r).length===0}l();var At=r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let o=r[n];e.includes("mappedin")||(r[n]=o)}return{url:e,headers:t}}return{url:e,headers:r}};function Bo(r,e,t,n){let o=r*(Math.PI/180),s=n/j,a=r+s*180/Math.PI,u=t/j/Math.cos(o),c=e+u*180/Math.PI;return{lat:a,lon:c}}function jo(r,e,t,n){let o=t*(Math.PI/180),s=n*(Math.PI/180),a=r*(Math.PI/180),u=e*(Math.PI/180),c=o-a,p=s-u,h=j*p*Math.cos(a),d=j*c;return{x:h,y:d}}var Gt=(r,e,t)=>{if(r.children&&(r.visible||r instanceof $&&r.userData.preloadGeometry))for(let n of r.children){if(n.visible&&n.type)if("entities3D"in n.userData&&n.userData?.entities3D&&n instanceof M){e.add(n.userData.entityId),n.userData.dirty&&t.add(n.userData.entityId);for(let o of n.userData.entities3D.values())e.add(o)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof ue)&&e.add(n.userData.entityId);Gt(n,e,t)}return e},_t=(r,e)=>{if(r.children&&r.visible&&!r.userData?.hidden)for(let t of r.children)t.visible&&t instanceof G&&e.add(t.userData.entityId),_t(t,e);return e};function kt(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?kt(r[t],e[t]):r[t]=e[t]}return r}function Vo(r,e,t,n){let o={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},s=new de,a=new g(o.scale,-o.scale,o.scale),u=new de().makeTranslation(o.translateX,o.translateY,o.translateZ).scale(a),c=t.elevation;return{id:Je,type:"custom",renderingMode:"3d",render:(p,h)=>{if(s.fromArray(h),c!==t.elevation){let d=Oe.fromLngLat(r.toLngLat(),t.elevation);u.makeTranslation(o.translateX,o.translateY,-d.z).scale(a)}e.projectionMatrix=s.multiply(u),c=t.elevation,n()}}}function Nt(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}async function Uo(r){let e=await Nt(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}function Wo(r,e=0){let t=3735928559^e,n=1103547991^e;for(let o=0,s;o<r.length;o++)s=r.charCodeAt(o),t=Math.imul(t^s,2654435761),n=Math.imul(n^s,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}function $o(r,e,t){let n=r*(Math.PI/180)/2,o=e/2;return t*Math.tan(n)/o}function Ho(r){return new Le(new ye(r[0][0],r[0][1]),new ye(r[1][0],r[1][1])).getCenter().toArray()}function zo(r,e){return r<e||e<=12}function Ko(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof $?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof M&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof $&&(e=r.parentObject3D.parent.userData.computedOpacity),e}function Yo(r,e,t=1e-10){if(r.length!==e.length)return!1;let n=Math.abs(r[0]-e[0])<t,o=Math.abs(r[1]-e[1])<t;if(r.length===3&&e.length===3){let s=Math.abs(r[2]-e[2])<t;return n&&o&&s}return n&&o}var Ft="maplibre-frustum-culling-hack";function Jo(){let r=new Ce(.01,.01,.01),e=new Pe({opacity:0,depthWrite:!1,transparent:!0}),t=new he(r,e);return t.position.copy(new g(0,50,0)),t.frustumCulled=!1,t.name=Ft,t}var _=new g,et=new H;function qo(r,e,t=new re){return r.traverse(n=>{if(n instanceof he){let s=n.geometry.attributes.position;if(e.position.distanceTo(n.position)<e.near)return;for(let u=0;u<s.count;u++)_.fromBufferAttribute(s,u),_.applyMatrix4(n.matrixWorld),_.applyMatrix4(e.matrixWorldInverse),_.applyMatrix4(e.projectionMatrix),_.z<1&&_.z>0&&(et.set(_.x,_.y),t.expandByPoint(et))}}),t}function tt(r,e){let t=e.clientWidth,n=e.clientHeight;return new H((r.x+1)*t/2,(1-r.y)*n/2)}function Xo(r,e,t){let n=document.createElement("div");n.style.position="absolute",n.style.border=`2px solid ${e}`,n.style.pointerEvents="none";let o=tt(new H(r.min.x,r.min.y),t),s=tt(new H(r.max.x,r.max.y),t);n.style.left=`${o.x}px`,n.style.top=`${s.y}px`;let a=Math.abs(s.x-o.x),u=Math.abs(s.y-o.y);return n.style.width=`${a}px`,n.style.height=`${u}px`,t.appendChild(n),n}l();var Se=class{constructor(e){i(this,"visible");i(this,"altitude");i(this,"color");i(this,"dirty",!0);i(this,"maxWidth");i(this,"maxHeight");i(this,"hoverByPolygon");i(this,"flipToFaceCamera",rt.flipToFaceCamera);i(this,"font");i(this,"fillOpacity");i(this,"fontSize");i(this,"margin");i(this,"outlineWidth");i(this,"outlineBlur");i(this,"outlineOffsetX");i(this,"strokeColor");i(this,"strokeOpacity");i(this,"strokeWidth");i(this,"hoverColor");i(this,"outlineOffsetY");i(this,"outlineColor");i(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}},rt=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});l();l();var we=class{constructor(e){i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"verticalOffset",0);i(this,"interactive",!1);i(this,"color");i(this,"material");i(this,"rotation");i(this,"scale");e&&Object.assign(this,e)}};l();var Rt=[1,1,1],Bt=[0,0,0];export{nt as a,jt as b,R as c,z as d,ke as e,j as f,Xt as g,O as h,Zt as i,Qt as j,er as k,tr as l,lt as m,rr as n,nr as o,or as p,ar as q,fr as r,v as s,xe as t,ve as u,ie as v,Pr as w,Cr as x,je as y,yt as z,Ar as A,Gr as B,C,xt as D,Xr as E,$e as F,Zr as G,Qr as H,en as I,tn as J,rn as K,nn as L,on as M,sn as N,J as O,mn as P,pn as Q,Dt as R,fn as S,He as T,Me as U,Te as V,ae as W,Ke as X,le as Y,M as Z,G as _,ee as $,ue as aa,te as ba,$ as ca,io as da,Je as ea,so as fa,ao as ga,lo as ha,uo as ia,Tt as ja,qe as ka,go as la,St as ma,wt as na,It as oa,Lt as pa,Ot as qa,At as ra,bt as sa,Bo as ta,jo as ua,Gt as va,_t as wa,kt as xa,Vo as ya,Uo as za,Wo as Aa,$o as Ba,Ho as Ca,zo as Da,Ko as Ea,Yo as Fa,Jo as Ga,qo as Ha,Xo as Ia,Se as Ja,rt as Ka,we as La,Rt as Ma,Bt as Na};
3
+ //# sourceMappingURL=chunk-KKLQ3TRA.js.map