@mappedin/mappedin-js 6.0.0-rc.0 → 6.0.0-rc.1

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 (36) hide show
  1. package/THIRD_PARTY_LICENSES.txt +19 -1039
  2. package/lib/esm/{GLTFExporter-OD4NIP5J.js → GLTFExporter-LCU7NXUM.js} +2 -2
  3. package/lib/esm/{GLTFLoader-2KHURE2O.js → GLTFLoader-M52U7R6R.js} +2 -2
  4. package/lib/esm/{browser-MJVP6R3A.js → browser-WC4BWEDX.js} +2 -2
  5. package/lib/esm/chunk-4EZCNQDU.js +3 -0
  6. package/lib/esm/chunk-4EZCNQDU.js.map +7 -0
  7. package/lib/esm/{chunk-J66EV4D7.js → chunk-DGI3RI5M.js} +2 -2
  8. package/lib/esm/{chunk-TJG5BXTK.js → chunk-MTBSFIDI.js} +2 -2
  9. package/lib/esm/chunk-OPUPAKD3.js +2343 -0
  10. package/lib/esm/chunk-OPUPAKD3.js.map +7 -0
  11. package/lib/esm/{chunk-R6ACEBVD.js → chunk-QVO3EAE3.js} +3 -3
  12. package/lib/esm/{chunk-R6ACEBVD.js.map → chunk-QVO3EAE3.js.map} +2 -2
  13. package/lib/esm/chunk-SYPB4R2Y.js +2 -0
  14. package/lib/esm/{chunk-LLHXGTB2.js.map → chunk-SYPB4R2Y.js.map} +1 -1
  15. package/lib/esm/index.d.ts +889 -691
  16. package/lib/esm/index.js +1 -1
  17. package/lib/esm/{inspector-KMBZXTF5.js → inspector-2WXCEJZC.js} +2 -2
  18. package/lib/esm/{internal-LZTQU5W2.js → internal-MR2VGL5Y.js} +2 -2
  19. package/lib/esm/{outdoor-context-v5-DPTEYL6O.js → outdoor-context-v5-QR4KQTZR.js} +2 -2
  20. package/lib/esm/{text3d-AEQ2USTW.js → text3d-ROTRSMZX.js} +2 -2
  21. package/lib/index-rn.js +223 -228
  22. package/package.json +2 -2
  23. package/lib/esm/chunk-2RJ5UTHX.js +0 -3
  24. package/lib/esm/chunk-2RJ5UTHX.js.map +0 -7
  25. package/lib/esm/chunk-LLHXGTB2.js +0 -2
  26. package/lib/esm/chunk-SWYBY4H7.js +0 -2269
  27. package/lib/esm/chunk-SWYBY4H7.js.map +0 -7
  28. /package/lib/esm/{GLTFExporter-OD4NIP5J.js.map → GLTFExporter-LCU7NXUM.js.map} +0 -0
  29. /package/lib/esm/{GLTFLoader-2KHURE2O.js.map → GLTFLoader-M52U7R6R.js.map} +0 -0
  30. /package/lib/esm/{browser-MJVP6R3A.js.map → browser-WC4BWEDX.js.map} +0 -0
  31. /package/lib/esm/{chunk-J66EV4D7.js.map → chunk-DGI3RI5M.js.map} +0 -0
  32. /package/lib/esm/{chunk-TJG5BXTK.js.map → chunk-MTBSFIDI.js.map} +0 -0
  33. /package/lib/esm/{inspector-KMBZXTF5.js.map → inspector-2WXCEJZC.js.map} +0 -0
  34. /package/lib/esm/{internal-LZTQU5W2.js.map → internal-MR2VGL5Y.js.map} +0 -0
  35. /package/lib/esm/{outdoor-context-v5-DPTEYL6O.js.map → outdoor-context-v5-QR4KQTZR.js.map} +0 -0
  36. /package/lib/esm/{text3d-AEQ2USTW.js.map → text3d-ROTRSMZX.js.map} +0 -0
package/lib/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{A as C,B as D,C as E,E as F,F as G,H,I,L as J,M as K,N as L,O as M,P as N,Q as O,R as P,S as Q,T as R,U as S,V as T,W as U,X as V,Y as W,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"./chunk-SWYBY4H7.js";import{a,b}from"./chunk-2RJ5UTHX.js";import"./chunk-R6ACEBVD.js";import"./chunk-J66EV4D7.js";import"./chunk-TJG5BXTK.js";import"./chunk-LLHXGTB2.js";import"./chunk-ROCNZJLL.js";export{x as ACTION_TYPE,o as Annotation,g as Area,y as BEARING_TYPE,z as CONNECTION_TYPE,l as Connection,c as Coordinate,B as DOORS,C as Directions,h as Door,a as E_SDK_LOG_LEVEL,s as EnterpriseCategory,r as EnterpriseLocation,t as EnterpriseVenue,q as Facade,j as Floor,p as FloorStack,e as Hyperlink,f as ImageMetaData,E as LocationCategory,D as LocationProfile,k as MAPPEDIN_COLORS,m as MapObject,K as MapView,d as Node,n as PointOfInterest,i as Space,A as WALLS,N as __setWatermarkOnClickFn,U as checkWorkerUrls,I as disableText3DWorker,F as enableTestMode,M as findPreferredLanguageInVenue,Q as forceEnterpriseLocations,S as getMapData,T as getMapDataEnterprise,H as getMultiFloorState,L as hydrateMapData,O as hydrateMapDataFromMVF,u as parseMVF,G as preloadFont,b as setLoggerLevel,P as setUseEnterpriseAPI,J as setWorkersUrl,R as shouldForceEnterpriseLocations,V as show3dMap,W as show3dMapGeojson,w as unzipAndParseMVFv2,v as unzipMVF};
1
+ import{$ as Y,A as C,C as D,D as E,F,G,H,J as I,K as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"./chunk-OPUPAKD3.js";import{a,b}from"./chunk-4EZCNQDU.js";import"./chunk-QVO3EAE3.js";import"./chunk-DGI3RI5M.js";import"./chunk-MTBSFIDI.js";import"./chunk-SYPB4R2Y.js";import"./chunk-ROCNZJLL.js";export{x as ACTION_TYPE,H as ANIMATION_TWEENS,o as Annotation,g as Area,y as BEARING_TYPE,z as CONNECTION_TYPE,l as Connection,c as Coordinate,B as DOORS,C as Directions,h as Door,a as E_SDK_LOG_LEVEL,s as EnterpriseCategory,r as EnterpriseLocation,t as EnterpriseVenue,q as Facade,j as Floor,p as FloorStack,e as Hyperlink,f as ImageMetaData,E as LocationCategory,D as LocationProfile,k as MAPPEDIN_COLORS,m as MapObject,L as MapView,d as Node,n as PointOfInterest,i as Space,A as WALLS,O as __setWatermarkOnClickFn,V as checkWorkerUrls,J as disableText3DWorker,F as enableTestMode,N as findPreferredLanguageInVenue,R as forceEnterpriseLocations,T as getMapData,U as getMapDataEnterprise,I as getMultiFloorState,X as getVersion,M as hydrateMapData,P as hydrateMapDataFromMVF,u as parseMVF,G as preloadFont,b as setLoggerLevel,Q as setUseEnterpriseAPI,K as setWorkersUrl,S as shouldForceEnterpriseLocations,W as show3dMap,Y as show3dMapGeojson,w as unzipAndParseMVFv2,v as unzipMVF};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{G as se,J as N,K as ae,a as re,g as P,p as S,q as H}from"./chunk-SWYBY4H7.js";import{u as I}from"./chunk-2RJ5UTHX.js";import"./chunk-R6ACEBVD.js";import"./chunk-J66EV4D7.js";import{W as oe}from"./chunk-TJG5BXTK.js";import{a as y}from"./chunk-LLHXGTB2.js";import{e as $}from"./chunk-ROCNZJLL.js";y();y();y();y();var M=class n{constructor(e,i,t,o,s="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",a=>a.stopPropagation()),this.domElement.addEventListener("keyup",a=>a.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},W=class extends M{constructor(e,i,t){super(e,i,t,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function V(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var _e={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:V,toHexString:V},D={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},Ee={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=D.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},ke={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=D.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},Me=[_e,D,Ee,ke];function Le(n){return Me.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,o){super(e,i,t,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=Le(this.initialValue),this._rgbScale=o,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=V(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},F=class extends M{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},Z=class extends M{constructor(e,i,t,o,s,a){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(s);let l=a!==void 0;this.step(l?a:this._getImplicitStep(),l),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let i=()=>{let f=parseFloat(this.$input.value);isNaN(f)||(this._stepExplicit&&(f=this._snap(f)),this.setValue(this._clamp(f)))},t=f=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+f),this.$input.value=this.getValue())},o=f=>{f.key==="Enter"&&this.$input.blur(),f.code==="ArrowUp"&&(f.preventDefault(),t(this._step*this._arrowKeyMultiplier(f))),f.code==="ArrowDown"&&(f.preventDefault(),t(this._step*this._arrowKeyMultiplier(f)*-1))},s=f=>{this._inputFocused&&(f.preventDefault(),t(this._step*this._normalizeMouseWheel(f)))},a=!1,l,h,m,d,g,r=5,c=f=>{l=f.clientX,h=m=f.clientY,a=!0,d=this.getValue(),g=0,window.addEventListener("mousemove",p),window.addEventListener("mouseup",v)},p=f=>{if(a){let C=f.clientX-l,L=f.clientY-h;Math.abs(L)>r?(f.preventDefault(),this.$input.blur(),a=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>r&&v()}if(!a){let C=f.clientY-m;g-=C*this._step*this._arrowKeyMultiplier(f),d+g>this._max?g=this._max-d:d+g<this._min&&(g=this._min-d),this._snapClampSetValue(d+g)}m=f.clientY},v=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",v)},x=()=>{this._inputFocused=!0},u=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",c),this.$input.addEventListener("focus",x),this.$input.addEventListener("blur",u)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(u,f,C,L,z)=>(u-f)/(C-f)*(z-L)+L,i=u=>{let f=this.$slider.getBoundingClientRect(),C=e(u,f.left,f.right,this._min,this._max);this._snapClampSetValue(C)},t=u=>{this._setDraggingStyle(!0),i(u.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",s)},o=u=>{i(u.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",s)},a=!1,l,h,m=u=>{u.preventDefault(),this._setDraggingStyle(!0),i(u.touches[0].clientX),a=!1},d=u=>{u.touches.length>1||(this._hasScrollBar?(l=u.touches[0].clientX,h=u.touches[0].clientY,a=!0):m(u),window.addEventListener("touchmove",g,{passive:!1}),window.addEventListener("touchend",r))},g=u=>{if(a){let f=u.touches[0].clientX-l,C=u.touches[0].clientY-h;Math.abs(f)>Math.abs(C)?m(u):(window.removeEventListener("touchmove",g),window.removeEventListener("touchend",r))}else u.preventDefault(),i(u.touches[0].clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",r)},c=this._callOnFinishChange.bind(this),p=400,v,x=u=>{if(Math.abs(u.deltaX)<Math.abs(u.deltaY)&&this._hasScrollBar)return;u.preventDefault();let C=this._normalizeMouseWheel(u)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(v),v=setTimeout(c,p)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",x,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${i}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},Q=class extends M{constructor(e,i,t,o){super(e,i,t,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},K=class extends M{constructor(e,i,t){super(e,i,t,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",o=>{o.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},$e=`.lil-gui {
1
+ import{I as se,L as N,M as ae,a as re,g as P,p as S,q as H}from"./chunk-OPUPAKD3.js";import{u as I}from"./chunk-4EZCNQDU.js";import"./chunk-QVO3EAE3.js";import"./chunk-DGI3RI5M.js";import{W as oe}from"./chunk-MTBSFIDI.js";import{a as y}from"./chunk-SYPB4R2Y.js";import{e as $}from"./chunk-ROCNZJLL.js";y();y();y();y();var M=class n{constructor(e,i,t,o,s="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",a=>a.stopPropagation()),this.domElement.addEventListener("keyup",a=>a.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},W=class extends M{constructor(e,i,t){super(e,i,t,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function V(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var _e={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:V,toHexString:V},D={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},Ee={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=D.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},ke={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=D.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},Me=[_e,D,Ee,ke];function Le(n){return Me.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,o){super(e,i,t,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=Le(this.initialValue),this._rgbScale=o,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=V(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},F=class extends M{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},Z=class extends M{constructor(e,i,t,o,s,a){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(s);let l=a!==void 0;this.step(l?a:this._getImplicitStep(),l),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let i=()=>{let f=parseFloat(this.$input.value);isNaN(f)||(this._stepExplicit&&(f=this._snap(f)),this.setValue(this._clamp(f)))},t=f=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+f),this.$input.value=this.getValue())},o=f=>{f.key==="Enter"&&this.$input.blur(),f.code==="ArrowUp"&&(f.preventDefault(),t(this._step*this._arrowKeyMultiplier(f))),f.code==="ArrowDown"&&(f.preventDefault(),t(this._step*this._arrowKeyMultiplier(f)*-1))},s=f=>{this._inputFocused&&(f.preventDefault(),t(this._step*this._normalizeMouseWheel(f)))},a=!1,l,h,m,d,g,r=5,c=f=>{l=f.clientX,h=m=f.clientY,a=!0,d=this.getValue(),g=0,window.addEventListener("mousemove",p),window.addEventListener("mouseup",v)},p=f=>{if(a){let C=f.clientX-l,L=f.clientY-h;Math.abs(L)>r?(f.preventDefault(),this.$input.blur(),a=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>r&&v()}if(!a){let C=f.clientY-m;g-=C*this._step*this._arrowKeyMultiplier(f),d+g>this._max?g=this._max-d:d+g<this._min&&(g=this._min-d),this._snapClampSetValue(d+g)}m=f.clientY},v=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",v)},x=()=>{this._inputFocused=!0},u=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",c),this.$input.addEventListener("focus",x),this.$input.addEventListener("blur",u)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(u,f,C,L,z)=>(u-f)/(C-f)*(z-L)+L,i=u=>{let f=this.$slider.getBoundingClientRect(),C=e(u,f.left,f.right,this._min,this._max);this._snapClampSetValue(C)},t=u=>{this._setDraggingStyle(!0),i(u.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",s)},o=u=>{i(u.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",s)},a=!1,l,h,m=u=>{u.preventDefault(),this._setDraggingStyle(!0),i(u.touches[0].clientX),a=!1},d=u=>{u.touches.length>1||(this._hasScrollBar?(l=u.touches[0].clientX,h=u.touches[0].clientY,a=!0):m(u),window.addEventListener("touchmove",g,{passive:!1}),window.addEventListener("touchend",r))},g=u=>{if(a){let f=u.touches[0].clientX-l,C=u.touches[0].clientY-h;Math.abs(f)>Math.abs(C)?m(u):(window.removeEventListener("touchmove",g),window.removeEventListener("touchend",r))}else u.preventDefault(),i(u.touches[0].clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",r)},c=this._callOnFinishChange.bind(this),p=400,v,x=u=>{if(Math.abs(u.deltaX)<Math.abs(u.deltaY)&&this._hasScrollBar)return;u.preventDefault();let C=this._normalizeMouseWheel(u)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(v),v=setTimeout(c,p)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",x,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${i}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},Q=class extends M{constructor(e,i,t,o){super(e,i,t,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},K=class extends M{constructor(e,i,t){super(e,i,t,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",o=>{o.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},$e=`.lil-gui {
2
2
  font-family: var(--font-family);
3
3
  font-size: var(--font-size);
4
4
  line-height: 1;
@@ -480,4 +480,4 @@ import{G as se,J as N,K as ae,a as re,g as P,p as S,q as H}from"./chunk-SWYBY4H7
480
480
  <br>
481
481
  <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>
482
482
  </div>`,{rank:"always-visible"});m.add(r),n.push(c)}})})}return()=>{n.forEach(h=>o.Markers.remove(h))}}}}var T={duration:300,easing:"ease-in-out"},R=Fe();y();var _={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function De(n){n.add(_.options.places.fields,"name").name("Places: Name"),n.add(_.options.places.fields,"description").name("Places: Description"),n.add(_.options.places.fields,"link").name("Places: Link"),n.add(_.options.places.fields,"category").name("Places: Category"),n.add(_.options.places,"limit"),n.add(_.options.locations.fields,"name").name("Locations: Name"),n.add(_.options.locations.fields,"tag").name("Locations: Tag"),n.add(_.options.locations.fields,"description").name("Locations: Description"),n.add(_.options.places,"limit"),n.add(_.options.categories.fields,"name").name("Categories: Name")}function ce(n,e,i){let t=new I,o=i.addFolder("Search");o.open();let s=o.add(_,"search").onChange(async d=>{let g=await e.Search.query(d,_.options);g&&(_.results=g,l(g,t))}),a=document.createElement("div");a.style.marginLeft="10px",s.domElement.parentElement?.appendChild(a);let{renderSearch:l,close:h}=Te(n,e,a,s.$input),m=o.addFolder("Advanced");return m.close(),De(m),document.addEventListener("keydown",d=>{(d.metaKey||d.ctrlKey)&&d.key==="k"?(d.preventDefault(),o._closed&&o.open(),s.$input.focus()):d.key==="Escape"&&(h(),t.publish("highlight",void 0))}),{pubsub:t}}function Te(n,e,i,t){let o,s;t.addEventListener("input",async l=>{l instanceof InputEvent&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")&&(clearTimeout(o),o=setTimeout(async()=>{let h=await e.Search.suggest(t.value);h&&h.length>0&&a(h[0]?.suggestion)},100))});function a(l){if(!l){t.placeholder="";return}let h=t.value;t.value=l,t.setSelectionRange(h.length,l.length)}return{renderSearch(l,h){if(l.places.length===0&&l.enterpriseCategories?.length===0&&l.enterpriseLocations?.length===0){i.textContent="No results found.";return}s=Oe(i,l,n,h)},close(){s.destroy()}}}function Oe(n,e,i,t){n.innerHTML="";let o=document.createElement("div");Object.assign(o.style,U.dropdownContainer);let s=document.createElement("ul");s.className="options-list",Object.assign(s.style,U.optionsList),s.style.display="block";let a=[],l=(r,c)=>{if(c&&c.length>0){let p=document.createElement("li");p.textContent=r,Object.assign(p.style,U.sectionHeader),s.appendChild(p),c.forEach((v,x)=>{let u=document.createElement("li");u.textContent=`${"name"in v.item?v.item.name:""} (${v.type})`,Object.assign(u.style,U.option),u.tabIndex=0,u.addEventListener("focus",()=>{m(a.indexOf(u))}),u.addEventListener("mouseover",()=>{u.style.backgroundColor="#f0f0f0"}),u.addEventListener("mouseout",()=>{u.style.backgroundColor=""}),u.addEventListener("click",()=>{}),u.setAttribute("data-type",r),u.setAttribute("data-index",x.toString()),s.appendChild(u),a.push(u)})}};l("enterpriseLocations",e.enterpriseLocations),l("enterpriseCategories",e.enterpriseCategories),l("Places",e.places),o.appendChild(s),n.appendChild(o);let h=[],m=r=>{h.forEach(u=>u()),h=[],a.forEach((u,f)=>{f===r?u.style.backgroundColor="#e0e0e0":u.style.backgroundColor=""});let c=a[r],p=c.getAttribute("data-type"),v=parseInt(c.getAttribute("data-index")||"0",10);if(!p)return;let{item:x}=e[p.toLowerCase()][v];t.publish("highlight",x)},d=r=>{!o.contains(r.target)&&r.target!==n&&g()};document.addEventListener("click",d);let g=()=>{n.innerHTML="",document.removeEventListener("click",d)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var U={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function he(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:o}=ce(n,e,i);o.on("highlight",d=>{if(d){t.forEach(r=>r()),t=[];let g=d instanceof S?d.spaces[0]:d;if(n.Camera.focusOn(d),g&&!P.is(g))return;t.push(R.highlightCard(n,g,{focus:!0}))}else t.forEach(g=>g()),t=[]});let s=i.addFolder("Click \u{1F447}").close(),{sub:a}=ze(n,s);a.on("click",d=>{t.forEach(g=>g()),t=[],d.spaces?.[0]&&(t=[R.highlightCard(n,d.spaces[0])])});let l=i.addFolder("Hover \u{1F681}").close(),{sub:h}=Pe(n,l),m;h.on("hover",d=>{d.spaces?.[0]?(m?.(),t.length===0&&(m=R.highlightCard(n,d.spaces[0]))):(m?.(),m=void 0)})}function ze(n,e){let i=new I,t={position:"",hoverColor:E(n.getHoverColor())},o=e.add(t,"position").disable(),s=[];function a(){s.forEach(h=>h()),s.length=0}let l=0;return n.on("click",h=>{let{labels:m,coordinate:d}=h;a(),i.publish("click",h),clearInterval(l),o.load(JSON.stringify([d.longitude,d.latitude]));let g=m?.[0];if(g!=null){let c=O(n,g,e);if(!c)return;s.push(c.destroy),c.labelItemFolder.openAnimated()}let r=h.spaces?.[0]??h.objects?.[0];if(r){let c={id:r.id,...n.getState(r.id),type:r.type,isInView:!1,isInViewCheck:j(n,r.id)},{cleanup:p}=B(n,c,e);l=setInterval(()=>{c.isInView=n.isInView(g||r)},500),s.push(p)}}),{sub:i}}function Pe(n,e){let i=new I;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},o=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(l=>{n.setHoverColor(l)});let s=[];function a(){s.forEach(l=>l()),s.length=0}return n.on("hover",l=>{let{coordinate:h,spaces:m,objects:d,markers:g,labels:r}=l;a(),i.publish("hover",l),o.load(JSON.stringify([h.longitude,h.latitude]));let c=m?.[0]??d?.[0]??g?.[0]??r?.[0];if(!c)return;let p=n.getState(c);p&&(t.type=p.type,t.id=c.id)}),{sub:i}}function j(n,e){return function(){console.log("isInView",n.isInView(e))}}function ue(n,e,i){let t={labels:{},all(){i.Labels.__EXPERIMENTAL__all().forEach(c=>{this.labels[c.id]=c}),h()},removeAllLabels(){i.Labels.removeAll().forEach(c=>{delete this.labels[c.id]}),h()}},{addLabel:o,destroy:s}=Be(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let a=n.addFolder("Label List");n.close();let l=new Map,{rerender:h}=m();function m(){function r(v){delete t.labels[v.id],l.get(v.id)?.destroy()}function c(v){let x=O(i,v,a,{onRemove:f=>{r(f)}});if(!x)return;let{labelItemFolder:u}=x;l.set(v.id,u)}function p(){a.destroy(),a=n.addFolder("Label");for(let v in t.labels){let x=t.labels[v];c(x)}}return{rerender:p,add:c,remove:r}}n.domElement.classList.add("list-items");let d;i.on("click",({labels:r,coordinate:c})=>{if(!n._closed)if(r?.[0]){d?.close();let p=l.get(r[0].id);if(n.open(),!p)return;p?.open(),p?.domElement.scrollIntoView({block:"start"}),p?.domElement.focus(),d=p}else o(c)});function g(r){for(let c of r)t.labels[c.id]=c;h()}return{populatelabels:g,destroy(){s()}}}function He(n,e,i,t,o){let{interactive:s,enabled:a,rank:l,anchor:h,dynamicResize:m,zIndex:d,contentHTML:g,lowPriorityPin:r}=t;if(s==null||a==null)throw new Error("incomplete marker state");let c={interactive:s,enabled:a,rank:l||"medium",anchor:Array.isArray(h)?h.join(", "):h||"center",dynamicResize:m||!1,zIndex:d||0,contentHTML:g||"",lowPriorityPin:{enabled:r?.enabled??!0,size:r?.size??8,color:E(r?.color??"#666")},remove(){n.Markers.remove(e),o?.(e),i.destroy()},isInView:j(n,e.id)};i.onChange(v=>{let x={interactive:c.interactive,enabled:c.enabled,rank:c.rank,dynamicResize:c.dynamicResize,contentHTML:c.contentHTML,lowPriorityPin:{enabled:c.lowPriorityPin.enabled,size:c.lowPriorityPin.size,color:c.lowPriorityPin.color}};c.rank==="always-visible"&&(x.zIndex=c.zIndex),n.updateState(e,x)}),i.add(c,"interactive"),i.add(c,"enabled"),i.add(c,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(c,"anchor").name("anchor (read-only)").disable(),i.add(c,"dynamicResize").name("dynamic resize"),c.rank==="always-visible"&&i.add(c,"zIndex",0,1e3,1).name("z-index"),i.add(c,"contentHTML").name("content HTML");let p=i.addFolder("Low Priority Pin");p.add(c.lowPriorityPin,"enabled"),p.add(c.lowPriorityPin,"size",1,20,1),p.addColor(c.lowPriorityPin,"color"),p.close(),i.add(c,"isInView"),i.add(c,"remove")}function Ge(n,e,i,t,o){let{appearance:s,interactive:a}=t;if(!s||s.margin==null||a==null)throw new Error("incomplte label state");let l={text:e.text,interactive:a,appearance:{...s,margin:s.margin||0,pinColor:s.pinColor?E(s.pinColor):"black",textColor:s.textColor?E(s.textColor):"black"},remove(){n.Labels.remove(e),o?.(e),i.destroy()},isInView:j(n,e.id)};i.onChange(h=>{n.updateState(e,{appearance:l.appearance,interactive:l.interactive})}),i.add(l.appearance,"margin",0,20).name("margin"),i.add(l,"text"),i.add(l,"interactive"),i.addColor(l.appearance,"pinColor").name("pin color"),i.addColor(l.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(l.appearance,"textColor").name("text color"),i.addColor(l.appearance,"textOutlineColor").name("text outline color"),i.add(l,"isInView"),i.add(l,"remove")}function O(n,e,i,{onRemove:t}={}){let o=n.getState(e);if(!o)throw new Error(`error getting state for entity: ${e.id}`);let s=o.type===N?e.text?.substring(0,12)||"Label":`Marker ${e.id.toString().substring(0,8)}`,a=i.addFolder(s);if(a.close(),o.type===N)Ge(n,e,a,o,t);else if(o.type===ae)He(n,e,a,o,t);else throw new Error(`unsupported entity type: ${o.type}`);return{labelItemFolder:a,destroy(){a.destroy()}}}function Be(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:0,text:"New Label!",interactive:!0,marginForegroundColor:E("skyblue"),marginBackgroundColor:E("coral"),textForegroundColor:E("slategray"),textBackgroundColor:E("white")};return i.add(t,"onClick"),i.add(t,"margin"),i.add(t,"interactive"),i.add(t,"text"),{destroy(){i.destroy()},addLabel(o){return i._closed||!t.onClick?void 0:e.Labels.add(o,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var pe={};y();var ge="camera-ui";function me(n,e,i){let t=n.addFolder("Camera \u{1F4F7}").onOpenClose(b=>{ee({opened:!b._closed},ge)}),{params:o}=te(ge);o.opened||t.close();let s=e.Camera.center.toJSON(),a=document.createElement("div");Object.assign(a.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(a);let l=()=>e.getDimensions(),[h,m,d,g]=i?.padding??[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],r={center_lat:s.latitude,center_lon:s.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i?.padding?"pixel":e.Camera.screenOffsets.type,inset_top:h,inset_left:g,inset_right:m,inset_bottom:d,animateOnLoad:!0,persist:()=>{ee(t.save().controllers,"camera"),navigator.clipboard.writeText(window.location.href)},visualizeInset:!!(h||m||d||g),"Focus on click":i?.focusOnClick??!0,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function c(){r.inset_type=e.Camera.screenOffsets.type,r.inset_left=e.Camera.screenOffsets.left,r.inset_top=e.Camera.screenOffsets.top,r.inset_right=e.Camera.screenOffsets.right,r.inset_bottom=e.Camera.screenOffsets.bottom;let{width:b,height:w}=l();r.inset_type==="portion"?Object.assign(a.style,{left:r.inset_left*b+"px",top:r.inset_top*w+"px",bottom:r.inset_bottom*w+"px",right:r.inset_right*b+"px"}):Object.assign(a.style,{left:r.inset_left+"px",top:r.inset_top+"px",bottom:r.inset_bottom+"px",right:r.inset_right+"px"})}t.add(r,"center_lat").listen().disable(),t.add(r,"center_lon").listen().disable(),t.add(r,"zoomLevel",16,22,.5).listen().disable(),t.add(r,"pitch").listen().disable(),t.add(r,"bearing").listen().disable(),t.add(r,"minZoomLevel",5,22,.5).onChange(b=>{e.Camera.setMinZoomLevel(b)}),t.add(r,"maxZoomLevel",10,22,.5).onChange(b=>{e.Camera.setMaxZoomLevel(b)}),t.add(r,"animateOnLoad"),t.add(r,"visualizeInset").onChange(ne),ne(r.visualizeInset);let p,v,x,u;function f(){let{width:b,height:w}=l(),X=e.Camera.screenOffsets.type,Y=r.inset_type;X!==Y&&(Y==="portion"&&X==="pixel"?(r.inset_top=b>0?Math.min(r.inset_top/w,1):0,r.inset_bottom=b>0?Math.min(r.inset_bottom/w,1):0,r.inset_left=w>0?Math.min(r.inset_left/b,1):0,r.inset_right=w>0?Math.min(r.inset_right/b,1):0):Y==="pixel"&&X==="portion"&&(r.inset_top=Math.round(r.inset_top*w),r.inset_bottom=Math.round(r.inset_bottom*w),r.inset_left=Math.round(r.inset_left*b),r.inset_right=Math.round(r.inset_right*b))),p&&p.destroy(),v&&v.destroy(),x&&x.destroy(),u&&u.destroy(),r.inset_type==="portion"?(p=t.add(r,"inset_top",0,1,.01).onChange(k),v=t.add(r,"inset_bottom",0,1,.01).onChange(k),x=t.add(r,"inset_left",0,1,.01).onChange(k),u=t.add(r,"inset_right",0,1,.01).onChange(k)):(p=t.add(r,"inset_top",0,w,1).onChange(k),v=t.add(r,"inset_bottom",0,w,1).onChange(k),x=t.add(r,"inset_left",0,b,1).onChange(k),u=t.add(r,"inset_right",0,b,1).onChange(k))}t.add(r,"inset_type",["pixel","portion"]).onChange(()=>{f(),k()}),f();let C=Ue(e);t.add(r,"Focus on click").onChange(b=>{b?e.on("click",C):e.off("click",C)}),r["Focus on click"]&&e.on("click",C),t.add(r,"persist"),t.add(r,"Focus on current floor");let L=b=>{t._closed||(r.center_lat=b.center.latitude,r.center_lon=b.center.longitude,r.zoomLevel=b.zoomLevel,r.bearing=b.bearing,r.pitch=b.pitch)};e.on("camera-change",L);let{params:z}=te("camera",r);if(Object.keys(z).length>0){let b=z;e.Camera.setScreenOffsets({top:b.inset_top,left:b.inset_left,right:b.inset_right,bottom:b.inset_bottom,type:b.inset_type});let w={pitch:b.pitch,center:new re(b.center_lat,b.center_lon),bearing:b.bearing,zoomLevel:b.zoomLevel};b.animateOnLoad?e.Camera.animateTo(w):e.Camera.set(w),t.load({controllers:b,folders:{}}),c()}let Ae=[()=>{e.off("camera-change",L)}];function k(){e.Camera.setScreenOffsets({top:r.inset_top,left:r.inset_left,right:r.inset_right,bottom:r.inset_bottom,type:r.inset_type}),c()}(r.inset_top||r.inset_right||r.inset_bottom||r.inset_left)&&k();function ne(b){c(),b?a.style.display="block":a.style.display="none"}return()=>({destroy(){t.destroy(),de(Ae)}})}function Ue(n){return function(i){let{spaces:t,objects:o}=i,s=t?.[0]??o?.[0];s&&n.Camera.focusOn(s)}}y();function fe(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(c=>{delete this.markers[c.id]}),h()}},{addMarker:o,destroy:s}=je(n,i);n.add(t,"removeAllMarkers");let a=n.addFolder("Marker List");n.close();let l=new Map,{rerender:h}=m();function m(){function r(v){delete t.markers[v.id],l.get(v.id)?.destroy()}function c(v){let x=O(i,v,a,{onRemove:f=>{r(f)}});if(!x)return;let{labelItemFolder:u}=x;l.set(v.id,u)}function p(){a.destroy(),a=n.addFolder("marker");for(let v in t.markers){let x=t.markers[v];c(x)}}return{rerender:p,add:c,remove:r}}n.domElement.classList.add("list-items");let d;i.on("click",({markers:r,coordinate:c})=>{if(!n._closed)if(r?.[0]){d?.close();let p=l.get(r[0].id);if(n.open(),!p)return;p?.open(),p?.domElement.scrollIntoView({block:"start"}),p?.domElement.focus(),d=p}else o(c)});function g(r){for(let c of r)t.markers[c.id]=c;h()}return{populateMarkers:g,destroy(){s()}}}function je(n,e){let i=n.addFolder("Add"),t={onClick:!1,interactive:!0,rank:"medium",anchor:"center",dynamicResize:!1,enabled:!0,zIndex:0,lowPriorityPin:{enabled:!0,size:8,color:"#666"},contentHTML:'<div style="padding: 8px; background: white; border: 2px solid #333; border-radius: 4px;">New Marker</div>'};i.add(t,"onClick"),i.add(t,"interactive"),i.add(t,"enabled"),i.add(t,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(t,"anchor",["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]).name("anchor"),i.add(t,"dynamicResize").name("dynamic resize"),i.add(t,"zIndex",0,1e3,1).name("z-index (always-visible only)"),i.add(t,"contentHTML").name("content HTML");let o=i.addFolder("Low Priority Pin");return o.add(t.lowPriorityPin,"enabled"),o.add(t.lowPriorityPin,"size",1,20,1),o.addColor(t.lowPriorityPin,"color"),o.close(),{destroy(){i.destroy()},addMarker(s){if(i._closed||!t.onClick)return;let a={interactive:t.interactive,enabled:t.enabled,rank:t.rank,anchor:t.anchor,dynamicResize:t.dynamicResize,lowPriorityPin:{enabled:t.lowPriorityPin.enabled,size:t.lowPriorityPin.size,color:t.lowPriorityPin.color}};return t.rank==="always-visible"&&(a.zIndex=t.zIndex),e.Markers.add(s,t.contentHTML,a)}}}y();function be(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(a=>{e.updateState("walls",{visible:a})}),i.addColor(t,"topColor").onChange(a=>{e.updateState("walls",{topColor:a})}),i.addColor(t,"color").onChange(a=>{e.updateState("walls",{color:a})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(a=>{e.updateState("walls",{texture:{url:a}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(a=>{e.updateState("walls",{topTexture:{url:a}})}),e.updateState("walls",{topColor:t.topColor}),e.updateState("walls",{color:t.color})}y();function ve(n,e,i){n.close();let t={language:i.currentLanguage?.code??"en"},o=i.getByType("enterprise-venue");n.add(t,"language",o?.languages.map(s=>s.code)).onChange(s=>{i.changeLanguage(s)})}y();function ye(n,e,i){let t=n.addFolder("Debug");t.close();let o=e.Debug.state,s={showPolygonLabelTextAreaMesh:o.showPolygonLabelTextAreaMesh,showCollisionBoxes:o.showCollisionBoxes,showEnvMap:o.showEnvMap};t.add(s,"showPolygonLabelTextAreaMesh").onChange(a=>{e.Debug.update({showPolygonLabelTextAreaMesh:a})}).name("Show Flat Label Text Area Mesh"),t.add(s,"showCollisionBoxes").onChange(a=>{e.Debug.update({showCollisionBoxes:a})}).name("Show Collision Boxes"),t.add(s,"showEnvMap").onChange(a=>{e.Debug.update({showEnvMap:a})}).name("Show Environment Map"),e.Debug.update(s)}y();function xe(n,e,i){let t=n.addFolder("Text3D").close(),o={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(o,"all").name("Show All"),t.add(o,"removeAll").name("Remove All")}function we(n,e,i){Xe();let t=new G({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),he(e,n,t),me(t,e,i?.camera);let o=t.addFolder("Levels").close(),s=t.addFolder("Scene Controls");s.close();let a=t.addFolder("Labels");xe(t,e,n);let l=t.addFolder("Markers");be(t,e);let h=t.addFolder("misc");ye(t,e,n),ve(h,e,n);let m={level:e.currentFloor.id},{populatelabels:d}=ue(a,n,e),{populateMarkers:g}=fe(l,n,e),r=n.getByType("floor").reduce((p,v)=>(p[v.name]=v.id,p),{}),c=o.add(m,"level",r).onChange(p=>{e.setFloor(p),m.level=e.currentFloor.id,c.updateDisplay()});return e.on("floor-change-start",p=>{o.controllers[0].setValue(p.floor.id)}),n.getByType("space").forEach(p=>{e.updateState(p,{interactive:!0})}),n.getByType("object").forEach(p=>{e.updateState(p,{interactive:!0})}),n.getByType("object").forEach(p=>{e.updateState(p,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:s,populateMarkers:g}}var Ce="mappedin-sdk-debug-css";function Xe(){if(document.getElementById(Ce))return;let n=document.createElement("style");n.id=Ce,n.textContent=pe,document.head.appendChild(n)}var ie=class{constructor(e,i){$(this,"_enabled",!1);$(this,"mv");$(this,"api");$(this,"mapData");$(this,"scenegraphVisualizerMounted",!1);$(this,"storeStateToLocalStorageEnabled",!1);this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:i}=we(this.mapData,this.mv,e);i.onOpenClose(t=>{t===i&&!t._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,se(this.api.core,i))}),this.api.getMapDataInternal()?.spaces.forEach(t=>{this.mv.updateState(t.id,{interactive:!0})})}get enabled(){return this._enabled}};export{ie as Inspector};
483
- //# sourceMappingURL=inspector-KMBZXTF5.js.map
483
+ //# sourceMappingURL=inspector-2WXCEJZC.js.map
@@ -1,2 +1,2 @@
1
- import{D as Se,b as H,n as X,o as ee,p as te,q as se}from"./chunk-SWYBY4H7.js";import{q as Z,z as g}from"./chunk-2RJ5UTHX.js";import"./chunk-R6ACEBVD.js";import"./chunk-J66EV4D7.js";import"./chunk-TJG5BXTK.js";import{a as O}from"./chunk-LLHXGTB2.js";import{d as ye,e as L,f as G,g as D,h as K,i as Y}from"./chunk-ROCNZJLL.js";O();O();var be="ENTRIES",ce="KEYS",ae="VALUES",y="",v=class{constructor(e,t){let s=e._tree,i=Array.from(s.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:s,keys:i}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=I(this._path);if(I(t)===y)return{done:!1,value:this.result()};let s=e.get(I(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=I(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>I(e)).filter(e=>e!==y).join("")}value(){return I(this._path).node.get(y)}result(){switch(this._type){case ae:return this.value();case ce:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},I=n=>n[n.length-1],xe=(n,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,o=i+t,r=new Uint8Array(o*i).fill(t+1);for(let c=0;c<i;++c)r[c]=c;for(let c=1;c<o;++c)r[c*i]=c;return ue(n,e,t,s,r,1,i,""),s},ue=(n,e,t,s,i,o,r,c)=>{let a=o*r;e:for(let u of n.keys())if(u===y){let l=i[a-1];l<=t&&s.set(c,[n.get(u),l])}else{let l=o;for(let h=0;h<u.length;++h,++l){let d=u[h],p=r*l,_=p-r,f=i[p],m=Math.max(0,l-t-1),w=Math.min(r-1,l+t);for(let S=m;S<w;++S){let V=d!==e[S],R=i[_+S]+ +V,C=i[_+S+1]+1,b=i[p+S]+1,z=i[p+S+1]=Math.min(R,C,b);z<f&&(f=z)}if(f>t)continue e}ue(n.get(u),e,t,s,i,l,r,c+u)}},F=class n{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[t,s]=T(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,o]=q(s);for(let r of i.keys())if(r!==y&&r.startsWith(o)){let c=new Map;return c.set(r.slice(o.length),i.get(r)),new n(c,e)}}return new n(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ie(this._tree,e)}entries(){return new v(this,be)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return xe(this._tree,e,t)}get(e){let t=N(this._tree,e);return t!==void 0?t.get(y):void 0}has(e){let t=N(this._tree,e);return t!==void 0&&t.has(y)}keys(){return new v(this,ce)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,j(this._tree,e).set(y,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e);return s.set(y,t(s.get(y))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e),i=s.get(y);return i===void 0&&s.set(y,i=t()),i}values(){return new v(this,ae)}[Symbol.iterator](){return this.entries()}static from(e){let t=new n;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return n.from(Object.entries(e))}},T=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(let s of n.keys())if(s!==y&&e.startsWith(s))return t.push([n,s]),T(n.get(s),e.slice(s.length),t);return t.push([n,e]),T(void 0,"",t)},N=(n,e)=>{if(e.length===0||n==null)return n;for(let t of n.keys())if(t!==y&&e.startsWith(t))return N(n.get(t),e.slice(t.length))},j=(n,e)=>{let t=e.length;e:for(let s=0;n&&s<t;){for(let o of n.keys())if(o!==y&&e[s]===o[0]){let r=Math.min(t-s,o.length),c=1;for(;c<r&&e[s+c]===o[c];)++c;let a=n.get(o);if(c===o.length)n=a;else{let u=new Map;u.set(o.slice(c),a),n.set(e.slice(s,s+c),u),n.delete(o),n=u}s+=c;continue e}let i=new Map;return n.set(e.slice(s),i),i}return n},Ie=(n,e)=>{let[t,s]=T(n,e);if(t!==void 0){if(t.delete(y),t.size===0)le(s);else if(t.size===1){let[i,o]=t.entries().next().value;de(s,i,o)}}},le=n=>{if(n.length===0)return;let[e,t]=q(n);if(e.delete(t),e.size===0)le(n.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==y&&de(n.slice(0,-1),s,i)}},de=(n,e,t)=>{if(n.length===0)return;let[s,i]=q(n);s.set(i+e,t),s.delete(i)},q=n=>n[n.length-1],Q="or",he="and",ze="and_not",x=class n{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?B:e.autoVacuum;this._options={...W,...e,autoVacuum:t,searchOptions:{...ie,...e.searchOptions||{}},autoSuggestOptions:{...Le,...e.autoSuggestOptions||{}}},this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=J,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:o,idField:r}=this._options,c=t(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let u of o){let l=t(e,u);if(l==null)continue;let h=s(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.addFieldLength(a,d,this._documentCount-1,p);for(let _ of h){let f=i(_,u);if(Array.isArray(f))for(let m of f)this.addTerm(d,a,m);else f&&this.addTerm(d,a,f)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:r}=e.reduce(({chunk:c,promise:a},u,l)=>(c.push(u),(l+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return r.then(()=>this.addAll(o))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:o,idField:r}=this._options,c=i(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);let a=this._idToShortId.get(c);if(a==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let u of o){let l=i(e,u);if(l==null)continue;let h=t(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.removeFieldLength(a,d,this._documentCount,p);for(let _ of h){let f=s(_,u);if(Array.isArray(f))for(let m of f)this.removeTerm(d,a,m);else f&&this.removeTerm(d,a,f)}}this._storedFields.delete(a),this._documentIds.delete(a),this._idToShortId.delete(c),this._fieldLength.delete(a),this._documentCount-=1}removeAll(e){if(e)for(let t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((s,i)=>{this.removeFieldLength(t,i,this._documentCount,s)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:s,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:s,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let s of e)this.discard(s)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:s}=this._options,i=s(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let s=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=J,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||$.batchSize,o=e.batchWait||$.batchWait,r=1;for(let[c,a]of this._index){for(let[u,l]of a)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?a.delete(u):l.delete(h));this._index.get(c).size===0&&this._index.delete(c),r%i===0&&await new Promise(u=>setTimeout(u,o)),r+=1}this._dirtCount-=s}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||B.minDirtCount,s=s||B.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=s}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){let{searchOptions:s}=this._options,i={...s,...t},o=this.executeQuery(e,t),r=[];for(let[c,{score:a,terms:u,match:l}]of o){let h=u.length||1,d={id:this._documentIds.get(c),score:a*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(c)),(i.filter==null||i.filter(d))&&r.push(d)}return e===n.wildcard&&i.boostDocument==null||r.sort(oe),r}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let s=new Map;for(let{score:o,terms:r}of this.search(e,t)){let c=r.join(" "),a=s.get(c);a!=null?(a.score+=o,a.count+=1):s.set(c,{score:o,terms:r,count:1})}let i=[];for(let[o,{score:r,terms:c,count:a}]of s)i.push({suggestion:o,terms:c,score:r/a});return i.sort(oe),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(W.hasOwnProperty(e))return P(W,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=k(i),a._fieldLength=k(o),a._storedFields=k(r);for(let[u,l]of a._documentIds)a._idToShortId.set(l,u);for(let[u,l]of s){let h=new Map;for(let d of Object.keys(l)){let p=l[d];c===1&&(p=p.ds),h.set(parseInt(d,10),k(p))}a._index.set(u,h)}return a}static async loadJSAsync(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=await A(i),a._fieldLength=await A(o),a._storedFields=await A(r);for(let[l,h]of a._documentIds)a._idToShortId.set(h,l);let u=0;for(let[l,h]of s){let d=new Map;for(let p of Object.keys(h)){let _=h[p];c===1&&(_=_.ds),d.set(parseInt(p,10),await A(_))}++u%1e3===0&&await fe(0),a._index.set(l,d)}return a}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:o,averageFieldLength:r,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new n(t);return u._documentCount=s,u._nextId=i,u._idToShortId=new Map,u._fieldIds=o,u._avgFieldLength=r,u._dirtCount=c||0,u._index=new F,u}executeQuery(e,t={}){if(e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let d={...t,...e,queries:void 0},p=e.queries.map(_=>this.executeQuery(_,d));return this.combineResults(p,d.combineWith)}let{tokenize:s,processTerm:i,searchOptions:o}=this._options,r={tokenize:s,processTerm:i,...o,...t},{tokenize:c,processTerm:a}=r,h=c(e).flatMap(d=>a(d)).filter(d=>!!d).map(Ce(r)).map(d=>this.executeQuerySpec(d,r));return this.combineResults(h,r.combineWith)}executeQuerySpec(e,t){let s={...this._options.searchOptions,...t},i=(s.fields||this._options.fields).reduce((f,m)=>({...f,[m]:P(s.boost,m)||1}),{}),{boostDocument:o,weights:r,maxFuzzy:c,bm25:a}=s,{fuzzy:u,prefix:l}={...ie.weights,...r},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,i,o,a),p,_;if(e.prefix&&(p=this._index.atPrefix(e.term)),e.fuzzy){let f=e.fuzzy===!0?.2:e.fuzzy,m=f<1?Math.min(c,Math.round(e.term.length*f)):f;m&&(_=this._index.fuzzyGet(e.term,m))}if(p)for(let[f,m]of p){let w=f.length-e.term.length;if(!w)continue;_?.delete(f);let S=l*f.length/(f.length+.3*w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}if(_)for(let f of _.keys()){let[m,w]=_.get(f);if(!w)continue;let S=u*f.length/(f.length+w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}return d}executeWildcardQuery(e){let t=new Map,s={...this._options.searchOptions,...e};for(let[i,o]of this._documentIds){let r=s.boostDocument?s.boostDocument(o,"",this._storedFields.get(i)):1;t.set(i,{score:r,terms:[],match:{}})}return t}combineResults(e,t=Q){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ve[s];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[o,r]of s)i[o]=Object.fromEntries(r);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,s,i,o,r,c,a,u=new Map){if(o==null)return u;for(let l of Object.keys(r)){let h=r[l],d=this._fieldIds[l],p=o.get(d);if(p==null)continue;let _=p.size,f=this._avgFieldLength[d];for(let m of p.keys()){if(!this._documentIds.has(m)){this.removeTerm(d,m,t),_-=1;continue}let w=c?c(this._documentIds.get(m),t,this._storedFields.get(m)):1;if(!w)continue;let S=p.get(m),V=this._fieldLength.get(m)[d],R=Me(S,_,this._documentCount,V,f,a),C=s*i*h*w*R,b=u.get(m);if(b){b.score+=C,Oe(b.terms,e);let z=P(b.match,t);z?z.push(l):b.match[t]=[l]}else u.set(m,{score:C,terms:[e],match:{[t]:[l]}})}}return u}addTerm(e,t,s){let i=this._index.fetch(s,re),o=i.get(e);if(o==null)o=new Map,o.set(t,1),i.set(e,o);else{let r=o.get(t);o.set(t,(r||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,re),o=i.get(e);o==null||o.get(t)==null?this.warnDocumentChanged(t,e,s):o.get(t)<=1?o.size<=1?i.delete(e):o.delete(t):o.set(t,o.get(t)-1),this._index.get(s).size===0&&this._index.delete(s)}warnDocumentChanged(e,t,s){for(let i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${s}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,s,i){let o=this._fieldLength.get(e);o==null&&this._fieldLength.set(e,o=[]),o[t]=i;let c=(this._avgFieldLength[t]||0)*s+i;this._avgFieldLength[t]=c/(s+1)}removeFieldLength(e,t,s,i){if(s===1){this._avgFieldLength[t]=0;return}let o=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=o/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let o=this._storedFields.get(e);o==null&&this._storedFields.set(e,o={});for(let r of s){let c=i(t,r);c!==void 0&&(o[r]=c)}}};x.wildcard=Symbol("*");var P=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,ve={[Q]:(n,e)=>{for(let t of e.keys()){let s=n.get(t);if(s==null)n.set(t,e.get(t));else{let{score:i,terms:o,match:r}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,r),ne(s.terms,o)}}return n},[he]:(n,e)=>{let t=new Map;for(let s of e.keys()){let i=n.get(s);if(i==null)continue;let{score:o,terms:r,match:c}=e.get(s);ne(i.terms,r),t.set(s,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,c)})}return t},[ze]:(n,e)=>{for(let t of e.keys())n.delete(t);return n}},Fe={k:1.2,b:.7,d:.5},Me=(n,e,t,s,i,o)=>{let{k:r,b:c,d:a}=o;return Math.log(1+(t-e+.5)/(e+.5))*(a+n*(r+1)/(n+r*(1-c+c*s/i)))},Ce=n=>(e,t,s)=>{let i=typeof n.fuzzy=="function"?n.fuzzy(e,t,s):n.fuzzy||!1,o=typeof n.prefix=="function"?n.prefix(e,t,s):n.prefix===!0,r=typeof n.boostTerm=="function"?n.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:o,termBoost:r}},W={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(ke),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},ie={combineWith:Q,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fe},Le={combineWith:he,prefix:(n,e,t)=>e===t.length-1},$={batchSize:1e3,batchWait:10},J={minDirtFactor:.1,minDirtCount:20},B={...$,...J},Oe=(n,e)=>{n.includes(e)||n.push(e)},ne=(n,e)=>{for(let t of e)n.includes(t)||n.push(t)},oe=({score:n},{score:e})=>e-n,re=()=>new Map,k=n=>{let e=new Map;for(let t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},A=async n=>{let e=new Map,t=0;for(let s of Object.keys(n))e.set(parseInt(s,10),n[s]),++t%1e3===0&&await fe(0);return e},fe=n=>new Promise(e=>setTimeout(e,n)),ke=/[\n\r\p{Z}\p{P}]+/u;var ge=ye(Se(),1);var M,E,_e,pe=class{constructor(e){D(this,E);L(this,"mapData");L(this,"indexes");L(this,"ready");D(this,M);this.mapData=e,this.indexes=Ee(e),this.ready=this.populate(),K(this,M,Z(Y(this,E,_e).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,o=[];return e.removeAll(),o=o.concat([e.addAllAsync(i.getByType("space")),e.addAllAsync(i.getByType("point-of-interest")),e.addAllAsync(i.getByType("connection")),e.addAllAsync(i.getByType("floor")),e.addAllAsync(i.getByType("door")),e.addAllAsync(i.getByType("annotation")),e.addAllAsync(i.getByType("area"))]),t&&(t?.removeAll(),o.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s?.removeAll(),o.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(o)}async search(e,t={}){await this.ready,Ve.parse(t);let s=(0,ge.default)({},t,Te),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(a=>s.places.fields[a])});s.places.limit&&(i=i.slice(0,s.places.limit));let o=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(a=>s.enterpriseLocations.fields[a])});o&&s.enterpriseLocations.limit&&(o=o.slice(0,s.enterpriseLocations.limit));let r=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(a=>s.enterpriseCategories.fields[a])});r&&s.enterpriseCategories.limit&&(r=r.slice(0,s.enterpriseCategories.limit));let c=Ae(this.mapData,{placesResult:i,locationsResult:o,categoriesResult:r});return G(this,M).call(this,e),c}async suggest(e,t={}){await this.ready,Re.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:o=!0}={}}=t;return o&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(r=>s.push(r)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(r=>s.push(r)),s.sort((r,c)=>c.score-r.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(r=>r.suggestion)}),s}};M=new WeakMap,E=new WeakSet,_e=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ae(n,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:u,score:l,__type:h})=>{let d=n.getById(h,a);return d!=null&&!H.is(d)&&!X.is(d)&&!ee.is(d)&&!te.is(d)&&!se.is(d)&&c.push({type:d.__type,match:u,score:l,item:d}),c},[]),o;if(t){o=[];for(let{id:c,match:a,score:u}of t){let l=n.getById("enterprise-location",c);l&&o.push({type:l.__type,match:a,score:u,item:l})}}let r;if(s){r=[];for(let{id:c,match:a,score:u}of s){let l=n.getById("enterprise-category",c);l&&r.push({type:l.__type,match:a,score:u,item:l})}}return{places:i,enterpriseLocations:o,enterpriseCategories:r}}var Te={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function U(n){return n.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ee(n){let e=new x({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(r,c)=>{let a=r[c];return typeof a=="string"?U(a):r[c]},processTerm:r=>De.has(r)?"":r.toLowerCase()}),t=n.getByType("enterprise-location"),s;t&&(s=new x({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(r,c)=>Array.isArray(r[c])?r[c].join(" "):typeof r[c]=="string"?U(r[c]):r[c]}));let i=n.getByType("enterprise-category"),o;return i&&(o=new x({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(r,c){return c==="locations.name"?r.locations.reduce((u,l)=>u+` ${me} `+l.name,"")+` ${me}`:typeof r[c]=="string"?U(r[c]):r[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:o,enterpriseLocations:s,places:e}}var Ve=g.object({places:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseCategories:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional(),"locations.name":g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseLocations:g.object({fields:g.object({name:g.boolean().optional(),tags:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional()}),Re=g.object({places:g.object({enabled:g.boolean().optional()}).optional(),enterpriseLocations:g.object({enabled:g.boolean().optional()}).optional()}),De=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),me="";export{pe as InternalSearch,U as removeAccents};
2
- //# sourceMappingURL=internal-LZTQU5W2.js.map
1
+ import{B as g,E as Se,b as H,n as X,o as ee,p as te,q as se}from"./chunk-OPUPAKD3.js";import{q as Z}from"./chunk-4EZCNQDU.js";import"./chunk-QVO3EAE3.js";import"./chunk-DGI3RI5M.js";import"./chunk-MTBSFIDI.js";import{a as O}from"./chunk-SYPB4R2Y.js";import{d as ye,e as L,f as G,g as D,h as K,i as Y}from"./chunk-ROCNZJLL.js";O();O();var be="ENTRIES",ce="KEYS",ae="VALUES",y="",v=class{constructor(e,t){let s=e._tree,i=Array.from(s.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:s,keys:i}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=I(this._path);if(I(t)===y)return{done:!1,value:this.result()};let s=e.get(I(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=I(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>I(e)).filter(e=>e!==y).join("")}value(){return I(this._path).node.get(y)}result(){switch(this._type){case ae:return this.value();case ce:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},I=n=>n[n.length-1],xe=(n,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,o=i+t,r=new Uint8Array(o*i).fill(t+1);for(let c=0;c<i;++c)r[c]=c;for(let c=1;c<o;++c)r[c*i]=c;return ue(n,e,t,s,r,1,i,""),s},ue=(n,e,t,s,i,o,r,c)=>{let a=o*r;e:for(let u of n.keys())if(u===y){let l=i[a-1];l<=t&&s.set(c,[n.get(u),l])}else{let l=o;for(let h=0;h<u.length;++h,++l){let d=u[h],p=r*l,_=p-r,f=i[p],m=Math.max(0,l-t-1),w=Math.min(r-1,l+t);for(let S=m;S<w;++S){let V=d!==e[S],R=i[_+S]+ +V,C=i[_+S+1]+1,b=i[p+S]+1,z=i[p+S+1]=Math.min(R,C,b);z<f&&(f=z)}if(f>t)continue e}ue(n.get(u),e,t,s,i,l,r,c+u)}},F=class n{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[t,s]=T(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,o]=q(s);for(let r of i.keys())if(r!==y&&r.startsWith(o)){let c=new Map;return c.set(r.slice(o.length),i.get(r)),new n(c,e)}}return new n(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ie(this._tree,e)}entries(){return new v(this,be)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return xe(this._tree,e,t)}get(e){let t=N(this._tree,e);return t!==void 0?t.get(y):void 0}has(e){let t=N(this._tree,e);return t!==void 0&&t.has(y)}keys(){return new v(this,ce)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,j(this._tree,e).set(y,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e);return s.set(y,t(s.get(y))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e),i=s.get(y);return i===void 0&&s.set(y,i=t()),i}values(){return new v(this,ae)}[Symbol.iterator](){return this.entries()}static from(e){let t=new n;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return n.from(Object.entries(e))}},T=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(let s of n.keys())if(s!==y&&e.startsWith(s))return t.push([n,s]),T(n.get(s),e.slice(s.length),t);return t.push([n,e]),T(void 0,"",t)},N=(n,e)=>{if(e.length===0||n==null)return n;for(let t of n.keys())if(t!==y&&e.startsWith(t))return N(n.get(t),e.slice(t.length))},j=(n,e)=>{let t=e.length;e:for(let s=0;n&&s<t;){for(let o of n.keys())if(o!==y&&e[s]===o[0]){let r=Math.min(t-s,o.length),c=1;for(;c<r&&e[s+c]===o[c];)++c;let a=n.get(o);if(c===o.length)n=a;else{let u=new Map;u.set(o.slice(c),a),n.set(e.slice(s,s+c),u),n.delete(o),n=u}s+=c;continue e}let i=new Map;return n.set(e.slice(s),i),i}return n},Ie=(n,e)=>{let[t,s]=T(n,e);if(t!==void 0){if(t.delete(y),t.size===0)le(s);else if(t.size===1){let[i,o]=t.entries().next().value;de(s,i,o)}}},le=n=>{if(n.length===0)return;let[e,t]=q(n);if(e.delete(t),e.size===0)le(n.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==y&&de(n.slice(0,-1),s,i)}},de=(n,e,t)=>{if(n.length===0)return;let[s,i]=q(n);s.set(i+e,t),s.delete(i)},q=n=>n[n.length-1],Q="or",he="and",ze="and_not",x=class n{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?B:e.autoVacuum;this._options={...W,...e,autoVacuum:t,searchOptions:{...ie,...e.searchOptions||{}},autoSuggestOptions:{...Le,...e.autoSuggestOptions||{}}},this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=J,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:o,idField:r}=this._options,c=t(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let u of o){let l=t(e,u);if(l==null)continue;let h=s(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.addFieldLength(a,d,this._documentCount-1,p);for(let _ of h){let f=i(_,u);if(Array.isArray(f))for(let m of f)this.addTerm(d,a,m);else f&&this.addTerm(d,a,f)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:r}=e.reduce(({chunk:c,promise:a},u,l)=>(c.push(u),(l+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return r.then(()=>this.addAll(o))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:o,idField:r}=this._options,c=i(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);let a=this._idToShortId.get(c);if(a==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let u of o){let l=i(e,u);if(l==null)continue;let h=t(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.removeFieldLength(a,d,this._documentCount,p);for(let _ of h){let f=s(_,u);if(Array.isArray(f))for(let m of f)this.removeTerm(d,a,m);else f&&this.removeTerm(d,a,f)}}this._storedFields.delete(a),this._documentIds.delete(a),this._idToShortId.delete(c),this._fieldLength.delete(a),this._documentCount-=1}removeAll(e){if(e)for(let t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((s,i)=>{this.removeFieldLength(t,i,this._documentCount,s)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:s,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:s,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let s of e)this.discard(s)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:s}=this._options,i=s(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let s=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=J,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||$.batchSize,o=e.batchWait||$.batchWait,r=1;for(let[c,a]of this._index){for(let[u,l]of a)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?a.delete(u):l.delete(h));this._index.get(c).size===0&&this._index.delete(c),r%i===0&&await new Promise(u=>setTimeout(u,o)),r+=1}this._dirtCount-=s}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||B.minDirtCount,s=s||B.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=s}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){let{searchOptions:s}=this._options,i={...s,...t},o=this.executeQuery(e,t),r=[];for(let[c,{score:a,terms:u,match:l}]of o){let h=u.length||1,d={id:this._documentIds.get(c),score:a*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(c)),(i.filter==null||i.filter(d))&&r.push(d)}return e===n.wildcard&&i.boostDocument==null||r.sort(oe),r}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let s=new Map;for(let{score:o,terms:r}of this.search(e,t)){let c=r.join(" "),a=s.get(c);a!=null?(a.score+=o,a.count+=1):s.set(c,{score:o,terms:r,count:1})}let i=[];for(let[o,{score:r,terms:c,count:a}]of s)i.push({suggestion:o,terms:c,score:r/a});return i.sort(oe),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(W.hasOwnProperty(e))return P(W,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=k(i),a._fieldLength=k(o),a._storedFields=k(r);for(let[u,l]of a._documentIds)a._idToShortId.set(l,u);for(let[u,l]of s){let h=new Map;for(let d of Object.keys(l)){let p=l[d];c===1&&(p=p.ds),h.set(parseInt(d,10),k(p))}a._index.set(u,h)}return a}static async loadJSAsync(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=await A(i),a._fieldLength=await A(o),a._storedFields=await A(r);for(let[l,h]of a._documentIds)a._idToShortId.set(h,l);let u=0;for(let[l,h]of s){let d=new Map;for(let p of Object.keys(h)){let _=h[p];c===1&&(_=_.ds),d.set(parseInt(p,10),await A(_))}++u%1e3===0&&await fe(0),a._index.set(l,d)}return a}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:o,averageFieldLength:r,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new n(t);return u._documentCount=s,u._nextId=i,u._idToShortId=new Map,u._fieldIds=o,u._avgFieldLength=r,u._dirtCount=c||0,u._index=new F,u}executeQuery(e,t={}){if(e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let d={...t,...e,queries:void 0},p=e.queries.map(_=>this.executeQuery(_,d));return this.combineResults(p,d.combineWith)}let{tokenize:s,processTerm:i,searchOptions:o}=this._options,r={tokenize:s,processTerm:i,...o,...t},{tokenize:c,processTerm:a}=r,h=c(e).flatMap(d=>a(d)).filter(d=>!!d).map(Ce(r)).map(d=>this.executeQuerySpec(d,r));return this.combineResults(h,r.combineWith)}executeQuerySpec(e,t){let s={...this._options.searchOptions,...t},i=(s.fields||this._options.fields).reduce((f,m)=>({...f,[m]:P(s.boost,m)||1}),{}),{boostDocument:o,weights:r,maxFuzzy:c,bm25:a}=s,{fuzzy:u,prefix:l}={...ie.weights,...r},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,i,o,a),p,_;if(e.prefix&&(p=this._index.atPrefix(e.term)),e.fuzzy){let f=e.fuzzy===!0?.2:e.fuzzy,m=f<1?Math.min(c,Math.round(e.term.length*f)):f;m&&(_=this._index.fuzzyGet(e.term,m))}if(p)for(let[f,m]of p){let w=f.length-e.term.length;if(!w)continue;_?.delete(f);let S=l*f.length/(f.length+.3*w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}if(_)for(let f of _.keys()){let[m,w]=_.get(f);if(!w)continue;let S=u*f.length/(f.length+w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}return d}executeWildcardQuery(e){let t=new Map,s={...this._options.searchOptions,...e};for(let[i,o]of this._documentIds){let r=s.boostDocument?s.boostDocument(o,"",this._storedFields.get(i)):1;t.set(i,{score:r,terms:[],match:{}})}return t}combineResults(e,t=Q){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ve[s];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[o,r]of s)i[o]=Object.fromEntries(r);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,s,i,o,r,c,a,u=new Map){if(o==null)return u;for(let l of Object.keys(r)){let h=r[l],d=this._fieldIds[l],p=o.get(d);if(p==null)continue;let _=p.size,f=this._avgFieldLength[d];for(let m of p.keys()){if(!this._documentIds.has(m)){this.removeTerm(d,m,t),_-=1;continue}let w=c?c(this._documentIds.get(m),t,this._storedFields.get(m)):1;if(!w)continue;let S=p.get(m),V=this._fieldLength.get(m)[d],R=Me(S,_,this._documentCount,V,f,a),C=s*i*h*w*R,b=u.get(m);if(b){b.score+=C,Oe(b.terms,e);let z=P(b.match,t);z?z.push(l):b.match[t]=[l]}else u.set(m,{score:C,terms:[e],match:{[t]:[l]}})}}return u}addTerm(e,t,s){let i=this._index.fetch(s,re),o=i.get(e);if(o==null)o=new Map,o.set(t,1),i.set(e,o);else{let r=o.get(t);o.set(t,(r||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,re),o=i.get(e);o==null||o.get(t)==null?this.warnDocumentChanged(t,e,s):o.get(t)<=1?o.size<=1?i.delete(e):o.delete(t):o.set(t,o.get(t)-1),this._index.get(s).size===0&&this._index.delete(s)}warnDocumentChanged(e,t,s){for(let i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${s}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,s,i){let o=this._fieldLength.get(e);o==null&&this._fieldLength.set(e,o=[]),o[t]=i;let c=(this._avgFieldLength[t]||0)*s+i;this._avgFieldLength[t]=c/(s+1)}removeFieldLength(e,t,s,i){if(s===1){this._avgFieldLength[t]=0;return}let o=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=o/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let o=this._storedFields.get(e);o==null&&this._storedFields.set(e,o={});for(let r of s){let c=i(t,r);c!==void 0&&(o[r]=c)}}};x.wildcard=Symbol("*");var P=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,ve={[Q]:(n,e)=>{for(let t of e.keys()){let s=n.get(t);if(s==null)n.set(t,e.get(t));else{let{score:i,terms:o,match:r}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,r),ne(s.terms,o)}}return n},[he]:(n,e)=>{let t=new Map;for(let s of e.keys()){let i=n.get(s);if(i==null)continue;let{score:o,terms:r,match:c}=e.get(s);ne(i.terms,r),t.set(s,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,c)})}return t},[ze]:(n,e)=>{for(let t of e.keys())n.delete(t);return n}},Fe={k:1.2,b:.7,d:.5},Me=(n,e,t,s,i,o)=>{let{k:r,b:c,d:a}=o;return Math.log(1+(t-e+.5)/(e+.5))*(a+n*(r+1)/(n+r*(1-c+c*s/i)))},Ce=n=>(e,t,s)=>{let i=typeof n.fuzzy=="function"?n.fuzzy(e,t,s):n.fuzzy||!1,o=typeof n.prefix=="function"?n.prefix(e,t,s):n.prefix===!0,r=typeof n.boostTerm=="function"?n.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:o,termBoost:r}},W={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(ke),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},ie={combineWith:Q,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fe},Le={combineWith:he,prefix:(n,e,t)=>e===t.length-1},$={batchSize:1e3,batchWait:10},J={minDirtFactor:.1,minDirtCount:20},B={...$,...J},Oe=(n,e)=>{n.includes(e)||n.push(e)},ne=(n,e)=>{for(let t of e)n.includes(t)||n.push(t)},oe=({score:n},{score:e})=>e-n,re=()=>new Map,k=n=>{let e=new Map;for(let t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},A=async n=>{let e=new Map,t=0;for(let s of Object.keys(n))e.set(parseInt(s,10),n[s]),++t%1e3===0&&await fe(0);return e},fe=n=>new Promise(e=>setTimeout(e,n)),ke=/[\n\r\p{Z}\p{P}]+/u;var ge=ye(Se(),1);var M,E,_e,pe=class{constructor(e){D(this,E);L(this,"mapData");L(this,"indexes");L(this,"ready");D(this,M);this.mapData=e,this.indexes=Ee(e),this.ready=this.populate(),K(this,M,Z(Y(this,E,_e).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,o=[];return e.removeAll(),o=o.concat([e.addAllAsync(i.getByType("space")),e.addAllAsync(i.getByType("point-of-interest")),e.addAllAsync(i.getByType("connection")),e.addAllAsync(i.getByType("floor")),e.addAllAsync(i.getByType("door")),e.addAllAsync(i.getByType("annotation")),e.addAllAsync(i.getByType("area"))]),t&&(t?.removeAll(),o.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s?.removeAll(),o.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(o)}async search(e,t={}){await this.ready,Ve.parse(t);let s=(0,ge.default)({},t,Te),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(a=>s.places.fields[a])});s.places.limit&&(i=i.slice(0,s.places.limit));let o=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(a=>s.enterpriseLocations.fields[a])});o&&s.enterpriseLocations.limit&&(o=o.slice(0,s.enterpriseLocations.limit));let r=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(a=>s.enterpriseCategories.fields[a])});r&&s.enterpriseCategories.limit&&(r=r.slice(0,s.enterpriseCategories.limit));let c=Ae(this.mapData,{placesResult:i,locationsResult:o,categoriesResult:r});return G(this,M).call(this,e),c}async suggest(e,t={}){await this.ready,Re.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:o=!0}={}}=t;return o&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(r=>s.push(r)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(r=>s.push(r)),s.sort((r,c)=>c.score-r.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(r=>r.suggestion)}),s}};M=new WeakMap,E=new WeakSet,_e=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ae(n,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:u,score:l,__type:h})=>{let d=n.getById(h,a);return d!=null&&!H.is(d)&&!X.is(d)&&!ee.is(d)&&!te.is(d)&&!se.is(d)&&c.push({type:d.__type,match:u,score:l,item:d}),c},[]),o;if(t){o=[];for(let{id:c,match:a,score:u}of t){let l=n.getById("enterprise-location",c);l&&o.push({type:l.__type,match:a,score:u,item:l})}}let r;if(s){r=[];for(let{id:c,match:a,score:u}of s){let l=n.getById("enterprise-category",c);l&&r.push({type:l.__type,match:a,score:u,item:l})}}return{places:i,enterpriseLocations:o,enterpriseCategories:r}}var Te={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function U(n){return n.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ee(n){let e=new x({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(r,c)=>{let a=r[c];return typeof a=="string"?U(a):r[c]},processTerm:r=>De.has(r)?"":r.toLowerCase()}),t=n.getByType("enterprise-location"),s;t&&(s=new x({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(r,c)=>Array.isArray(r[c])?r[c].join(" "):typeof r[c]=="string"?U(r[c]):r[c]}));let i=n.getByType("enterprise-category"),o;return i&&(o=new x({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(r,c){return c==="locations.name"?r.locations.reduce((u,l)=>u+` ${me} `+l.name,"")+` ${me}`:typeof r[c]=="string"?U(r[c]):r[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:o,enterpriseLocations:s,places:e}}var Ve=g.object({places:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseCategories:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional(),"locations.name":g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseLocations:g.object({fields:g.object({name:g.boolean().optional(),tags:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional()}),Re=g.object({places:g.object({enabled:g.boolean().optional()}).optional(),enterpriseLocations:g.object({enabled:g.boolean().optional()}).optional()}),De=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),me="";export{pe as InternalSearch,U as removeAccents};
2
+ //# sourceMappingURL=internal-MR2VGL5Y.js.map
@@ -1,2 +1,2 @@
1
- import{$ as _,A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,N as M,O as N,P as O,Q as P,R as Q,S as R,T as S,U as T,V as U,W as V,X as W,Y as X,Z as Y,_ as Z,a,aa as $,b,ba as aa,c,ca as ba,d,da as ca,e,ea as da,f,fa as ea,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x as w,y as x,z as y}from"./chunk-R6ACEBVD.js";import"./chunk-LLHXGTB2.js";import"./chunk-ROCNZJLL.js";var export_Point=W.default;export{d as AJAXError,L as AttributionControl,A as BoxZoomHandler,r as CanvasSource,K as CooperativeGesturesHandler,G as DoubleClickZoomHandler,H as DragPanHandler,I as DragRotateHandler,t as EdgeInsets,e as Event,f as Evented,S as FullscreenControl,o as GeoJSONSource,Q as GeolocateControl,U as GlobeControl,w as Hash,p as ImageSource,E as KeyboardHandler,i as LngLat,j as LngLatBounds,M as LogoControl,N as Map,x as MapMouseEvent,y as MapTouchEvent,z as MapWheelEvent,P as Marker,k as MercatorCoordinate,O as NavigationControl,export_Point as Point,V as Popup,n as RasterDEMTileSource,m as RasterTileSource,R as ScaleControl,F as ScrollZoomHandler,v as Style,T as TerrainControl,D as TwoFingersTouchPitchHandler,C as TwoFingersTouchRotateHandler,B as TwoFingersTouchZoomHandler,J as TwoFingersTouchZoomRotateHandler,l as VectorTileSource,q as VideoSource,b as addProtocol,s as addSourceType,h as clearPrewarmedResources,a as config,u as createTileMesh,aa as getMaxParallelImageRequests,Y as getRTLTextPluginStatus,Z as getVersion,_ as getWorkerCount,ca as getWorkerUrl,ea as importScriptInWorkers,g as prewarm,c as removeProtocol,ba as setMaxParallelImageRequests,X as setRTLTextPlugin,$ as setWorkerCount,da as setWorkerUrl};
2
- //# sourceMappingURL=outdoor-context-v5-DPTEYL6O.js.map
1
+ import{$ as _,A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,N as M,O as N,P as O,Q as P,R as Q,S as R,T as S,U as T,V as U,W as V,X as W,Y as X,Z as Y,_ as Z,a,aa as $,b,ba as aa,c,ca as ba,d,da as ca,e,ea as da,f,fa as ea,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x as w,y as x,z as y}from"./chunk-QVO3EAE3.js";import"./chunk-SYPB4R2Y.js";import"./chunk-ROCNZJLL.js";var export_Point=W.default;export{d as AJAXError,L as AttributionControl,A as BoxZoomHandler,r as CanvasSource,K as CooperativeGesturesHandler,G as DoubleClickZoomHandler,H as DragPanHandler,I as DragRotateHandler,t as EdgeInsets,e as Event,f as Evented,S as FullscreenControl,o as GeoJSONSource,Q as GeolocateControl,U as GlobeControl,w as Hash,p as ImageSource,E as KeyboardHandler,i as LngLat,j as LngLatBounds,M as LogoControl,N as Map,x as MapMouseEvent,y as MapTouchEvent,z as MapWheelEvent,P as Marker,k as MercatorCoordinate,O as NavigationControl,export_Point as Point,V as Popup,n as RasterDEMTileSource,m as RasterTileSource,R as ScaleControl,F as ScrollZoomHandler,v as Style,T as TerrainControl,D as TwoFingersTouchPitchHandler,C as TwoFingersTouchRotateHandler,B as TwoFingersTouchZoomHandler,J as TwoFingersTouchZoomRotateHandler,l as VectorTileSource,q as VideoSource,b as addProtocol,s as addSourceType,h as clearPrewarmedResources,a as config,u as createTileMesh,aa as getMaxParallelImageRequests,Y as getRTLTextPluginStatus,Z as getVersion,_ as getWorkerCount,ca as getWorkerUrl,ea as importScriptInWorkers,g as prewarm,c as removeProtocol,ba as setMaxParallelImageRequests,X as setRTLTextPlugin,$ as setWorkerCount,da as setWorkerUrl};
2
+ //# sourceMappingURL=outdoor-context-v5-QR4KQTZR.js.map
@@ -1,4 +1,4 @@
1
- import{Oa as Me,wa as wn}from"./chunk-2RJ5UTHX.js";import"./chunk-R6ACEBVD.js";import{$ as At,Ea as Yt,F as vn,H as _r,I as ot,J as pn,Ka as kn,La as _n,M as gn,N as Ur,Q as Xe,R as Sr,S as mn,T as Ft,W as Mt,Y as yn,_a as Un,ba as bn,e as Tr,fb as Sn,la as xn,m as kr,na as Tn,q as cn,r as hn,x as dn}from"./chunk-TJG5BXTK.js";import{a as Ie,b as Ke}from"./chunk-LLHXGTB2.js";import"./chunk-ROCNZJLL.js";Ie();Ie();Ie();function da(){var c=Object.create(null);function r(t,e){var n=t.id,o=t.name,a=t.dependencies;a===void 0&&(a=[]);var i=t.init;i===void 0&&(i=function(){});var s=t.getTransferables;if(s===void 0&&(s=null),!c[n])try{a=a.map(function(u){return u&&u.isWorkerModule&&(r(u,function(d){if(d instanceof Error)throw d}),u=c[u.id].value),u}),i=f("<"+o+">.init",i),s&&(s=f("<"+o+">.getTransferables",s));var l=null;typeof i=="function"?l=i.apply(void 0,a):console.error("worker module init function failed to rehydrate"),c[n]={id:n,value:l,getTransferables:s},e(l)}catch(u){u&&u.noLog||console.error(u),e(u)}}function h(t,e){var n,o=t.id,a=t.args;(!c[o]||typeof c[o].value!="function")&&e(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var i=(n=c[o]).value.apply(n,a);i&&typeof i.then=="function"?i.then(s,function(l){return e(l instanceof Error?l:new Error(""+l))}):s(i)}catch(l){e(l)}function s(l){try{var u=c[o].getTransferables&&c[o].getTransferables(l);(!u||!Array.isArray(u)||!u.length)&&(u=void 0),e(l,u)}catch(d){console.error(d),e(d)}}}function f(t,e){var n=void 0;self.troikaDefine=function(a){return n=a};var o=URL.createObjectURL(new Blob(["/** "+t.replace(/\*/g,"")+` **/
1
+ import{La as Me,ta as wn}from"./chunk-4EZCNQDU.js";import"./chunk-QVO3EAE3.js";import{$ as At,Ea as Yt,F as vn,H as _r,I as ot,J as pn,Ka as kn,La as _n,M as gn,N as Ur,Q as Xe,R as Sr,S as mn,T as Ft,W as Mt,Y as yn,_a as Un,ba as bn,e as Tr,fb as Sn,la as xn,m as kr,na as Tn,q as cn,r as hn,x as dn}from"./chunk-MTBSFIDI.js";import{a as Ie,b as Ke}from"./chunk-SYPB4R2Y.js";import"./chunk-ROCNZJLL.js";Ie();Ie();Ie();function da(){var c=Object.create(null);function r(t,e){var n=t.id,o=t.name,a=t.dependencies;a===void 0&&(a=[]);var i=t.init;i===void 0&&(i=function(){});var s=t.getTransferables;if(s===void 0&&(s=null),!c[n])try{a=a.map(function(u){return u&&u.isWorkerModule&&(r(u,function(d){if(d instanceof Error)throw d}),u=c[u.id].value),u}),i=f("<"+o+">.init",i),s&&(s=f("<"+o+">.getTransferables",s));var l=null;typeof i=="function"?l=i.apply(void 0,a):console.error("worker module init function failed to rehydrate"),c[n]={id:n,value:l,getTransferables:s},e(l)}catch(u){u&&u.noLog||console.error(u),e(u)}}function h(t,e){var n,o=t.id,a=t.args;(!c[o]||typeof c[o].value!="function")&&e(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var i=(n=c[o]).value.apply(n,a);i&&typeof i.then=="function"?i.then(s,function(l){return e(l instanceof Error?l:new Error(""+l))}):s(i)}catch(l){e(l)}function s(l){try{var u=c[o].getTransferables&&c[o].getTransferables(l);(!u||!Array.isArray(u)||!u.length)&&(u=void 0),e(l,u)}catch(d){console.error(d),e(d)}}}function f(t,e){var n=void 0;self.troikaDefine=function(a){return n=a};var o=URL.createObjectURL(new Blob(["/** "+t.replace(/\*/g,"")+` **/
2
2
 
3
3
  troikaDefine(
4
4
  `+e+`
@@ -250,4 +250,4 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
250
250
  }
251
251
  `}),f.setMatrixTexture=t=>{f.uniforms[r].value=t,f.uniforms[h].value.set(t.image.width,t.image.height)},f}function oo({vertexShader:c,fragmentShader:r},h,f=h){let t=new RegExp(`uniform\\s+(bool|float|vec[234]|mat[34])\\s+${h}\\b`),e,n=!1;r=r.replace(t,(a,i)=>(n=!0,`varying ${e=i} ${f}`));let o=!1;return c=c.replace(t,(a,i)=>(o=!0,`${n?"varying":""} ${e=i} ${f}`)),o||(c=`${n?"varying":""} ${e} ${f};
252
252
  ${c}`),{vertexShader:c,fragmentShader:r}}Ie();var aa="abcdefghijklmnopqrstuvwxyz";function oa(c){return new Promise((r,h)=>{c?typeof c=="string"?Pr({font:c,characters:aa},()=>{r(c)}):h(new Error(`bad fontUrl ${c}`)):import("./roboto-regular-R5KXKW73.js").then(f=>{Pr({font:f.default,characters:aa},()=>{r(f.default)})})})}var zr=.1,io=new Xe;function ia(c,r,h,f){return r<=0||h<=0?Promise.reject(`incoorect dimension [${r}, ${h}]`):new Promise((t,e)=>{c.sync(n);function n(){if(!c.geometry.boundingBox)return;let{x:o,y:a}=c.geometry.boundingBox.getSize(io);if(a>h||o>r){if(c.fontSize===zr)return e(`cannot find suitable font size for ${c.text}. MaxSize: [${r}, ${h}], Current size: [${o}, ${a}]. min font size${zr}.`);c.fontSize=Math.max(zr,c.fontSize-f),c.sync(n)}else return t({size:[o,a]})}})}function so(c){return new Promise(r=>{c.sync(()=>{r()})})}async function Wr(){return(await import("./roboto-regular-R5KXKW73.js")).default}function Po({useWorker:c=!0}){Jn({useWorker:c})}var er=new Ft,He=new Xe,lo=new Xe(0,0,1);async function Io(c,r,h,f){let t=r.feature.properties,e=new Ze;r.textMesh=e,e.text=t.text,e.anchorX="center",e.anchorY="middle",e.textAlign=t.align??"center",e.color=t.color??"black",e.fontSize=t.fontSize||20;let n=h.font??Me.font;n?e.font=n:gt?e.font=await gt:e.font=await Wr(),e.outlineOpacity=h.outlineOpacity??Me.outlineOpacity,e.outlineColor=h.outlineColor??Me.outlineColor,e.outlineOffsetY=h.outlineOffsetY??Me.outlineOffsetY,e.outlineOffsetX=h.outlineOffsetX??Me.outlineOffsetX,e.outlineWidth=h.outlineWidth??Me.outlineWidth,e.outlineBlur=h.outlineBlur??Me.outlineBlur,e.strokeWidth=h.strokeWidth??Me.strokeWidth,e.strokeColor=h.strokeColor??Me.strokeColor,e.strokeOpacity=h.strokeOpacity??Me.strokeOpacity;let o=f(r.feature.geometry.coordinates);return e.position.copy(o),e.position.z=t.verticalOffset,e.rotation.z=_r.degToRad(-t.rotation),e.userData={entityId:c.toString(),rotationZ:-t.rotation},{text:e}}async function zo(c,r,h,f){let t=r.feature.properties,{textArea:e}=t;if(!e)throw new Error("textArea is required");let n=h.margin??Me.margin,[o,a,i,s]=Array.isArray(n)?n:[n,n,n,n],l=new Ze;l.text=t.content;let u=e.maxHeight-o-i,d=e.maxWidth-s-a;l.fontSize=Math.min(u,h.fontSize??Me.fontSize),l.color=h.color??Me.color,l.maxWidth=h.maxWidth??d,l.anchorX="center",l.anchorY="middle",l.textAlign="center";let p=h.font??Me.font;p?l.font=p:gt?l.font=await gt:l.font=await Wr(),l.outlineOpacity=h.outlineOpacity??Me.outlineOpacity,l.outlineColor=h.outlineColor??Me.outlineColor,l.outlineOffsetY=h.outlineOffsetY??Me.outlineOffsetY,l.outlineOffsetX=h.outlineOffsetX??Me.outlineOffsetX,l.outlineWidth=h.outlineWidth??Me.outlineWidth,l.outlineBlur=h.outlineBlur??Me.outlineBlur,l.strokeWidth=h.strokeWidth??Me.strokeWidth,l.strokeColor=h.strokeColor??Me.strokeColor,l.strokeOpacity=h.strokeOpacity??Me.strokeOpacity;let g=f(e.position,He);l.position.copy(g);let m=wn(Math.PI/2-_r.degToRad(e.rotation));l.rotation.z=m,l.userData={entityId:c.toString(),rotationZ:m};let B,U;try{U=(await ia(l,d,u,l.fontSize*.2)).size}catch(_){throw l.dispose?.(),new Error(`Cannot fit text to area: entityId: ${r.polygonEntityId} ${_}`)}if(U)return er.identity(),He.set(0,0,1),er.makeRotationAxis(lo,m),He.set(e.align==="near"?s+U[0]/2:e.maxWidth/2,0,0),He.applyMatrix4(er),l.position.x-=He.x,l.position.y-=He.y,r.textMesh=l,B&&(He.set(e.maxWidth/2,0,0),He.applyMatrix4(er),B.position.x-=He.x,B.position.y-=He.y),{text:l}}var gt;function Wo(c){return gt=oa(c),gt}export{Gr as BatchedText,Ze as Text,Po as configureTroikaTextBuilder,zo as createTroikaTextArea,Io as createTroikaTextPoint,gt as fontPreloadLoadPromise,Wo as preloadFont,so as syncText};
253
- //# sourceMappingURL=text3d-AEQ2USTW.js.map
253
+ //# sourceMappingURL=text3d-ROTRSMZX.js.map