@mappedin/mappedin-js 6.0.1-beta.46 → 6.0.1-beta.48

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 (60) hide show
  1. package/THIRD_PARTY_LICENSES.txt +9289 -24606
  2. package/lib/esm/GLTFExporter-E2W4AY7T.js +2 -0
  3. package/lib/esm/GLTFExporter-E2W4AY7T.js.map +7 -0
  4. package/lib/esm/GLTFLoader-5VLIZ4BL.js +2 -0
  5. package/lib/esm/GLTFLoader-5VLIZ4BL.js.map +7 -0
  6. package/lib/esm/{browser-OJQDECWL.js → browser-RLBZMV2G.js} +2 -1
  7. package/lib/esm/browser-RLBZMV2G.js.map +7 -0
  8. package/lib/esm/chunk-AHC6OWNT.js +2 -0
  9. package/lib/esm/chunk-AHC6OWNT.js.map +7 -0
  10. package/lib/esm/chunk-F7Z3R7GK.js +3820 -0
  11. package/lib/esm/chunk-F7Z3R7GK.js.map +7 -0
  12. package/lib/esm/chunk-KDY73CVP.js +2 -0
  13. package/lib/esm/chunk-KDY73CVP.js.map +7 -0
  14. package/lib/esm/chunk-KTTWH67L.js +2229 -0
  15. package/lib/esm/chunk-KTTWH67L.js.map +7 -0
  16. package/lib/esm/chunk-QSFIJRMY.js +2 -0
  17. package/lib/esm/chunk-QSFIJRMY.js.map +7 -0
  18. package/lib/esm/{chunk-XIVNHXXU.js → chunk-SBJEVJF3.js} +2 -1
  19. package/lib/esm/chunk-SBJEVJF3.js.map +7 -0
  20. package/lib/esm/chunk-XFQBHAWO.js +578 -0
  21. package/lib/esm/chunk-XFQBHAWO.js.map +7 -0
  22. package/lib/esm/fonts/roboto-regular.ttf +0 -0
  23. package/lib/esm/index.css +2 -1
  24. package/lib/esm/index.css.map +7 -0
  25. package/lib/esm/index.d.ts +369 -153
  26. package/lib/esm/index.js +2 -1
  27. package/lib/esm/index.js.map +7 -0
  28. package/lib/esm/inspector-PKJEJRJY.js +483 -0
  29. package/lib/esm/inspector-PKJEJRJY.js.map +7 -0
  30. package/lib/esm/inspector-S63NMDZZ.css +2 -0
  31. package/lib/esm/inspector-S63NMDZZ.css.map +7 -0
  32. package/lib/esm/internal-DKUILLGA.js +2 -0
  33. package/lib/esm/internal-DKUILLGA.js.map +7 -0
  34. package/lib/esm/internal-WH523TQS.css +2 -0
  35. package/lib/esm/internal-WH523TQS.css.map +7 -0
  36. package/lib/esm/outdoor-context-v4-4RHE5GJB.js +2 -0
  37. package/lib/esm/outdoor-context-v4-4RHE5GJB.js.map +7 -0
  38. package/lib/esm/{roboto-regular-PKVZDOB2.js → roboto-regular-25PMWR2T.js} +2 -1
  39. package/lib/esm/roboto-regular-25PMWR2T.js.map +7 -0
  40. package/lib/esm/text3d-FHQNCDB4.js +253 -0
  41. package/lib/esm/text3d-FHQNCDB4.js.map +7 -0
  42. package/lib/esm/workers/collision-worker.csp.js +1 -1
  43. package/lib/esm/workers/maplibre-worker.csp.js +2 -1
  44. package/lib/index-rn.js +649 -0
  45. package/lib/index.css +2 -1
  46. package/package.json +12 -12
  47. package/lib/esm/GLTFExporter-AXJXTFZG.js +0 -1
  48. package/lib/esm/GLTFLoader-V2T33J7P.js +0 -1
  49. package/lib/esm/chunk-5XSHJ3NY.js +0 -1
  50. package/lib/esm/chunk-A6HW5N6M.js +0 -1
  51. package/lib/esm/chunk-GVMLK6WZ.js +0 -1
  52. package/lib/esm/chunk-MV2IWNRC.js +0 -1
  53. package/lib/esm/chunk-Q2KR5YO7.js +0 -1
  54. package/lib/esm/chunk-SRZSNPKD.js +0 -1
  55. package/lib/esm/inspector-4UPV6G6H.js +0 -1
  56. package/lib/esm/inspector-GOK26VAV.css +0 -1
  57. package/lib/esm/internal-7A3UJNAV.css +0 -1
  58. package/lib/esm/internal-NKXX4DDI.js +0 -1
  59. package/lib/esm/outdoor-context-v4-DTIGSNLG.js +0 -1
  60. package/lib/esm/text3d-Z4HFM4UG.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{j as ie,k as be,l as xe}from"./chunk-XFQBHAWO.js";import{Q as b,R as re,T as ne,V as L,W as oe,db as ge,qa as ye}from"./chunk-F7Z3R7GK.js";import{a,b as m}from"./chunk-QSFIJRMY.js";import{f as o,g as f,h as M,i as y}from"./chunk-AHC6OWNT.js";a();var je="[MappedinJS]",Be=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(Be||{});function Ve(r=""){let e=`${je}${r?`-${r}`:""}`;return{logState:m.env.NODE_ENV==="test"?3:0,log(...t){this.logState<=0&&console.log(e,...t)},warn(...t){this.logState<=1&&console.warn(e,...t)},error(...t){this.logState<=2&&console.error(e,...t)},assert(...t){console.assert(...t)},time(t){console.time(t)},timeEnd(t){console.timeEnd(t)},setLevel(t){0<=t&&t<=3&&(this.logState=t)}}}var De=Ve();function ft(r){0<=r&&r<=3&&(De.logState=r)}var se=De;a();a();var F=class extends Error{};F.prototype.name="InvalidTokenError";function Ue(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 He(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 Ue(e)}catch{return atob(e)}}function Te(r,e){if(typeof r!="string")throw new F("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 F(`Invalid token specified: missing part #${t+1}`);let i;try{i=He(n)}catch(s){throw new F(`Invalid token specified: invalid base64 for part #${t+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new F(`Invalid token specified: invalid json for part #${t+1} (${s.message})`)}}a();var R=63710088e-1;function St(r){let e=Te(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 We(r){return r*(180/Math.PI)}function Pt(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}function ve(r,e){return(r%e+e)%e}function wt([r,e],[t,n]){let i=O(n-e),s=O(t-r),l=O(e),c=O(n),u=Math.sin(i/2)*Math.sin(i/2)+Math.sin(s/2)*Math.sin(s/2)*Math.cos(l)*Math.cos(c),p=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return R*p}function It([r,e],[t,n]){let i=O(e),s=O(r),l=O(n),u=O(t)-s,p=Math.sin(u)*Math.cos(l),h=Math.cos(i)*Math.sin(l)-Math.sin(i)*Math.cos(l)*Math.cos(u);return We((Math.atan2(p,h)+Math.PI*2)%(Math.PI*2))}function Ct(r,e){let t=ve(r,Math.PI*2),n=ve(e,Math.PI*2),i=n-t,s=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:t,end:s}}function ze(r){return r instanceof ge?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 Lt(r,e,t,n){return(r<e||r>t)&&se.warn(n),Math.min(t,Math.max(e,r))}function Ot(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}a();function _t(r,e,t=!1){let n=null,i=0;return function(...s){i++,i===1&&t===!0&&r(...s);let l=()=>{(!t||i>1)&&r(...s),n=null,i=0};clearTimeout(n),n=setTimeout(l,e)}}a();a();var ae=class r extends Error{constructor(t){super(t);o(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,r)}};function Ee(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||ae,i=new n(t);throw e?.captureStackTrace!==!1&&Error.captureStackTrace&&Error.captureStackTrace(i,Ee),i}}function Ft(r,e,t){if(Ee(r),r?.type!==e){let n=`Expected type ${e} but got ${r?.type}`;throw new Error(t??n)}}a();var le=[0,4,6,8,10],x=()=>{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],le.map((n,i)=>t.slice(n,i===le.length-1?void 0:le[i+1]).join("")).join("-")};a();var ue=class{constructor(){o(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={}}};a();var Me="mi-session-data",Se="mi-local-data",V="id",U="deviceId",j,D,T,$=class ${constructor(){M(this,D);M(this,T);try{let e=sessionStorage.getItem(Me);e?y(this,D,JSON.parse(e)):y(this,D,{[V]:x()})}catch{y(this,D,{[V]:x()})}try{let e=localStorage.getItem(Se);e?y(this,T,JSON.parse(e)):y(this,T,{[U]:x()})}catch{y(this,T,{[U]:x()})}f(this,D)[V]||(f(this,D)[V]=x()),f(this,T)[U]||(f(this,T)[U]=x())}static getInstance(){return f(this,j)||y(this,j,new $),f(this,j)}static ___clearInstance(){y(this,j,void 0)}saveSessionData(e,t){f(this,D)[e]=t;try{return sessionStorage.setItem(Me,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,T)[e]=t;try{return localStorage.setItem(Se,JSON.stringify(f(this,T))),!0}catch{return!1}}loadLocalData(e){let t=f(this,T)[e];if(t!=null)return t}};j=new WeakMap,D=new WeakMap,T=new WeakMap,M($,j);var ce=$;a();function Ye(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}a();a();a();a();a();a();a();a();var g=63710088e-1,we={centimeters:g*100,centimetres:g*100,degrees:g/111325,feet:g*3.28084,inches:g*39.37,kilometers:g/1e3,kilometres:g/1e3,meters:g,metres:g,miles:g/1609.344,millimeters:g*1e3,millimetres:g*1e3,nauticalmiles:g/1852,radians:1,yards:g*1.0936},ar={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/g,yards:1.0936133};function I(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 Ke(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(!Pe(r[0])||!Pe(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return I(n,e,t)}function lr(r,e,t){t===void 0&&(t={});for(var n=0,i=r;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<s[s.length-1].length;l++)if(s[s.length-1][l]!==s[0][l])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return I(c,e,t)}function Ie(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 I(n,e,t)}function ur(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 cr(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return I(n,e,t)}function mr(r,e,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:r};return I(n,e,t)}function pr(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return I(n,e,t)}function dr(r,e){e===void 0&&(e="kilometers");var t=we[e];if(!t)throw new Error(e+" units is invalid");return r*t}function fr(r,e){e===void 0&&(e="kilometers");var t=we[e];if(!t)throw new Error(e+" units is invalid");return r/t}function hr(r){var e=r%(2*Math.PI);return e*180/Math.PI}function yr(r){var e=r%360;return e*Math.PI/180}function Pe(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function H(r,e,t){if(r!==null)for(var n,i,s,l,c,u,p,h=0,d=0,P,w=r.type,v=w==="FeatureCollection",_=w==="Feature",ee=v?r.features.length:1,k=0;k<ee;k++){p=v?r.features[k].geometry:_?r.geometry:r,P=p?p.type==="GeometryCollection":!1,c=P?p.geometries.length:1;for(var te=0;te<c;te++){var E=0,N=0;if(l=P?p.geometries[te]:p,l!==null){u=l.coordinates;var C=l.type;switch(h=t&&(C==="Polygon"||C==="MultiPolygon")?1:0,C){case null:break;case"Point":if(e(u,d,k,E,N)===!1)return!1;d++,E++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(e(u[n],d,k,E,N)===!1)return!1;d++,C==="MultiPoint"&&E++}C==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-h;i++){if(e(u[n][i],d,k,E,N)===!1)return!1;d++}C==="MultiLineString"&&E++,C==="Polygon"&&N++}C==="Polygon"&&E++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(N=0,i=0;i<u[n].length;i++){for(s=0;s<u[n][i].length-h;s++){if(e(u[n][i][s],d,k,E,N)===!1)return!1;d++}N++}E++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(H(l.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Tr(r,e,t,n){var i=t;return H(r,function(s,l,c,u,p){l===0&&t===void 0?i=s:i=e(i,s,l,c,u,p)},n),i}function vr(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 Je(r,e){var t,n,i,s,l,c,u,p,h,d,P=0,w=r.type==="FeatureCollection",v=r.type==="Feature",_=w?r.features.length:1;for(t=0;t<_;t++){for(c=w?r.features[t].geometry:v?r.geometry:r,p=w?r.features[t].properties:v?r.properties:{},h=w?r.features[t].bbox:v?r.bbox:void 0,d=w?r.features[t].id:v?r.id:void 0,u=c?c.type==="GeometryCollection":!1,l=u?c.geometries.length:1,i=0;i<l;i++){if(s=u?c.geometries[i]:c,s===null){if(e(null,P,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,P,p,h,d)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],P,p,h,d)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}P++}}function $e(r,e){Je(r,function(t,n,i,s,l){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(I(t,i,{bbox:s,id:l}),n,0)===!1?!1:void 0}var u;switch(c){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var h=t.coordinates[p],d={type:u,coordinates:h};if(e(I(d,i),n,p)===!1)return!1}})}function qe(r,e){$e(r,function(t,n,i){var s=0;if(t.geometry){var l=t.geometry.type;if(!(l==="Point"||l==="MultiPoint")){var c,u=0,p=0,h=0;if(H(t,function(d,P,w,v,_){if(c===void 0||n>u||v>p||_>h){c=d,u=n,p=v,h=_,s=0;return}var ee=Ie([c,d],t.properties);if(e(ee,n,i,_,s)===!1)return!1;s++,c=d})===!1)return!1}}})}function Er(r,e,t){var n=t,i=!1;return qe(r,function(s,l,c,u,p){i===!1&&t===void 0?n=s:n=e(n,s,l,c,u,p),i=!0}),n}function me(r){var e=[1/0,1/0,-1/0,-1/0];return H(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}me.default=me;var Ce=me;function Le(r){return Ce(r)}a();var pe="#ffffff";var de=class{constructor(e={}){o(this,"initialColor",pe);o(this,"color",pe);o(this,"initialTopColor");o(this,"topColor");o(this,"topTexture");o(this,"texture");o(this,"hoverColor");o(this,"dirty",!0);o(this,"visible",!0);o(this,"opacity",1);o(this,"width",.1);o(this,"height",.1);o(this,"initialHeight",.1);o(this,"altitude",0);o(this,"join","round");o(this,"cap","round");o(this,"showImage",!0);o(this,"flipImageToFaceCamera",!0);o(this,"url");o(this,"side","double");o(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}};var q=class extends ye{constructor(){super(...arguments);o(this,"type","entityBatchedMesh");o(this,"userData",{entities:{}})}},W,z,B,Oe=class{constructor(e){o(this,"mesh");o(this,"focusMesh");o(this,"imageMesh");o(this,"textMesh");o(this,"textEntityId");o(this,"type","geometry");o(this,"dirty",!0);o(this,"detached",!1);o(this,"instanceIndex",-1);o(this,"geometry");o(this,"material");o(this,"feature");o(this,"currentHeight",.1);o(this,"focusable",!1);o(this,"color",new oe);o(this,"topColor",new oe);o(this,"position",new b);M(this,W,0);M(this,z,1);M(this,B);o(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 altitude(){return f(this,W)}set altitude(e){this.mesh&&(this.mesh.position.z=e,y(this,W,e))}get opacity(){return f(this,z)}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,z,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,B)?f(this,B):(y(this,B,Le(this.feature)),f(this,B))}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)}};W=new WeakMap,z=new WeakMap,B=new WeakMap;a();var Ge="#ffffff",G,X=class{constructor(e={}){o(this,"color",Ge);o(this,"initialColor",Ge);o(this,"topColor");o(this,"initialTopColor");o(this,"opacity",1);o(this,"height");M(this,G);o(this,"outline",!0);o(this,"texture");o(this,"topTexture");o(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 S=class extends L{constructor(t,n=new X){super();o(this,"visible",!0);o(this,"type","geometry-group");o(this,"components");o(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 i of this.children)if(!i.userData.detached){t=i;break}return t instanceof q?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}};a();var A=class extends L{},Y=class{constructor(e,t,n=0){o(this,"id");o(this,"verticalOffset");o(this,"occluderId");o(this,"object3d",new A);o(this,"components");o(this,"disposed",!1);o(this,"worldPosition",new b);this.id=e.id||x(),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}};a();var Z=class extends L{constructor(){super(...arguments);o(this,"type","geometry");o(this,"userData",{entityId:"",type:"geometry"})}raycast(t,n){this.userData.type==="model"&&this.children[0]&&t.intersectObject(this.children[0],!0).forEach(i=>{n.push(i)})}},K=class{constructor(e,t){o(this,"id",x());o(this,"components");o(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 S?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof S&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};var J=class r extends L{constructor(t){super();o(this,"childrenIds",new Set);o(this,"children",[]);o(this,"type","group-container");o(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});o(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 Y?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id),t.positionDirty=!0):t instanceof S?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof K&&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 Y?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof S?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof K&&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}};a();var hn={top:0,bottom:0,left:0,right:0,type:"pixel"},Ae="mappedin";var yn={ALWAYS_ON_TOP:10},gn=250;a();function Ze(r){let e=r.min,t=r.max,n=new b(e.x,e.y,e.z),i=new b(t.x,e.y,e.z),s=new b(e.x,t.y,e.z),l=new b(t.x,t.y,e.z);return[n,i,s,l]}a();function _e(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 Mn(r,e,t=[],n=new re,i){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let s=_e(r.getInternalState(),e);return ke(s,t,n,i),t}var Q=new b;function ke(r,e=[],t=new re,n){if(r.visible){if(r.isMesh||r.isLine||r.isPoints){let i=r.geometry;if(i.isBufferGeometry){let s=i.attributes.position;for(let l=0;l<s.count;l++)Q.fromBufferAttribute(s,l),n!==void 0&&(Q.z=n),e.push(Q.clone()),t.expandByPoint(Q)}}for(let i of r.children)ke(i,e,t,n)}}a();function Qe(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}a();function et(r,e,t=!1){let n=null,i=0;return function(...s){i++,i===1&&t===!0&&r(...s);let l=()=>{(!t||i>1)&&r(...s),n=null,i=0};clearTimeout(n),n=setTimeout(l,e)}}a();var tt=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),s=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,l=/android/i.test(e);return r={isIpad:s,isMobile:l||i||s,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Ne=tt.getDeviceType,Fe=(()=>{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 l=Ne().isFirefox?null:s.getExtension("WEBGL_debug_renderer_info");return e=l?s.getParameter(l.UNMASKED_RENDERER_WEBGL):s.getParameter(s.RENDERER),e}catch{let c=new Error("Failed getting device info");throw c.name="FailedGettingDeviceInfo",c}}function i(){if(!Ne().isWindows)return!1;if(t!==void 0)return t;let s=rt()?.toLowerCase()??"";return t=s.includes("intel")&&(s.includes("uhd")||s.includes("iris")),t}return{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(s){r=s,e=void 0,t=void 0}}})(),rt=Fe.getInfo,nt=Fe.shouldDisableOffscreenCanvas;a();function ot(r,e){let t={};for(let n=0;n<e.length;n++){let i=e[n];i in r&&(t[i]=r[i])}return t}function it(r){return Object.keys(r).length===0}a();var st=r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let i=r[n];e.includes("mappedin")||(r[n]=i)}return{url:e,headers:t}}return{url:e,headers:r}};function Yn(r,e,t,n){let i=r*(Math.PI/180),s=n/R,l=r+s*180/Math.PI,c=t/R/Math.cos(i),u=e+c*180/Math.PI;return{lat:l,lon:u}}function Kn(r,e,t,n){let i=t*(Math.PI/180),s=n*(Math.PI/180),l=r*(Math.PI/180),c=e*(Math.PI/180),u=i-l,p=s-c,h=R*p*Math.cos(l),d=R*u;return{x:h,y:d}}var at=(r,e)=>{if(r.children&&r.visible)for(let t of r.children){if(t.visible&&t.type)if("entities3D"in t.userData&&t.userData?.entities3D&&t.type==="geometry-group"){e.add(t.userData.entityId);for(let n of t.userData.entities3D.values())e.add(n)}else(t.type==="group-container"||t.type==="custom-geometry"||t instanceof Z)&&e.add(t.userData.entityId);at(t,e)}return e},lt=(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),lt(t,e);return e};function ut(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?ut(r[t],e[t]):r[t]=e[t]}return r}function Jn(r,e,t,n){let i={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},s=new ne,l=new b(i.scale,-i.scale,i.scale),c=new ne().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(l),u=t.elevation;return{id:Ae,type:"custom",renderingMode:"3d",render:(p,h)=>{if(s.fromArray(h),u!==t.elevation){let d=xe.fromLngLat(r.toLngLat(),t.elevation);c.makeTranslation(i.translateX,i.translateY,-d.z).scale(l)}e.projectionMatrix=s.multiply(c),u=t.elevation,n()}}}function ct(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}async function $n(r){let e=await ct(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}function qn(r,e=0){let t=3735928559^e,n=1103547991^e;for(let i=0,s;i<r.length;i++)s=r.charCodeAt(i),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)}var mt=r=>r;var Xn=r=>1-Math.cos(r*Math.PI/2);function Zn(r,e,t,n,i,s=mt){r=Math.max(e,Math.min(r,t));let l=(r-Math.min(e,t))/Math.abs(t-e),c=s(l);return n+c*(i-n)}function Qn(r,e,t){let n=r*(Math.PI/180)/2,i=e/2;return t*Math.tan(n)/i}function eo(r){return new be(new ie(r[0][0],r[0][1]),new ie(r[1][0],r[1][1])).getCenter().toArray()}function to(r,e){return r<e||e<=12}function ro(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof J?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof S&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof J&&(e=r.parentObject3D.parent.userData.computedOpacity),e}a();var fe=class{constructor(e){o(this,"visible");o(this,"altitude");o(this,"color");o(this,"dirty",!0);o(this,"maxWidth");o(this,"maxHeight");o(this,"hoverByPolygon");o(this,"flipToFaceCamera",Re.flipToFaceCamera);o(this,"font");o(this,"fillOpacity");o(this,"fontSize");o(this,"margin");o(this,"outlineWidth");o(this,"outlineBlur");o(this,"outlineOffsetX");o(this,"strokeColor");o(this,"strokeOpacity");o(this,"strokeWidth");o(this,"hoverColor");o(this,"outlineOffsetY");o(this,"outlineColor");o(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}},Re=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});a();a();var he=class{constructor(e){o(this,"dirty",!0);o(this,"visible",!0);o(this,"opacity",1);o(this,"verticalOffset",0);o(this,"interactive",!1);o(this,"color");o(this,"material");o(this,"rotation");o(this,"scale");e&&Object.assign(this,e)}};a();var pt=[1,1,1],dt=[0,0,0];export{je as a,Be as b,ft as c,se as d,R as e,St as f,O as g,Pt as h,wt as i,It as j,Ct as k,ze as l,Lt as m,Ot as n,_t as o,Ft as p,x as q,ue as r,ce as s,I as t,Ke as u,lr as v,Ie as w,ur as x,cr as y,mr as z,pr as A,dr as B,fr as C,hr as D,yr as E,H as F,Tr as G,vr as H,$e as I,Er as J,Ce as K,pe as L,de as M,q as N,Oe as O,X as P,S as Q,A as R,Y as S,Z as T,K as U,J as V,hn as W,Ae as X,yn as Y,gn as Z,Ze as _,_e as $,Mn as aa,Qe as ba,et as ca,nt as da,ot as ea,it as fa,st as ga,Ye as ha,Yn as ia,Kn as ja,at as ka,lt as la,ut as ma,Jn as na,$n as oa,qn as pa,mt as qa,Xn as ra,Zn as sa,Qn as ta,eo as ua,to as va,ro as wa,fe as xa,Re as ya,he as za,pt as Aa,dt as Ba};
2
+ //# sourceMappingURL=chunk-KDY73CVP.js.map