@mappedin/mappedin-js 6.1.0 → 6.1.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.
package/lib/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{A as C,B as D,C as E,D as G,E as H,G as I,H as J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,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-KYQ66GHT.js";import{_a as F,a,b}from"./chunk-C5ID5LHV.js";import"./chunk-RIFXMIJM.js";import"./chunk-DBCMQGTD.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,G 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,F 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};
1
+ import{A as C,B as D,C as E,D as G,E as H,G as I,H as J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,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-5EHRFS32.js";import{_a as F,a,b}from"./chunk-BXSPZW2B.js";import"./chunk-DERUYKVE.js";import"./chunk-PH2HNHTP.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,G 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,F 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{F as se,I as N,J as ae,a as re,g as P,p as S,q as H}from"./chunk-KYQ66GHT.js";import{u as I}from"./chunk-C5ID5LHV.js";import"./chunk-RIFXMIJM.js";import{_ as oe,a as y}from"./chunk-DBCMQGTD.js";import{e as $}from"./chunk-ROCNZJLL.js";y();y();y();y();var M=class n{constructor(e,i,t,s,o="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(o),this.domElement.classList.add("controller"),this.domElement.classList.add(s),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 s=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(s)}},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 s=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(s)}},Me=[_e,D,Ee,ke];function Le(n){return Me.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,s){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=s,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 o=V(this.$text.value);o&&this._setValueFromHexString(o)}),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",s=>{s.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,s,o,a){super(e,i,t,"number"),this._initInput(),this.min(s),this.max(o);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())},s=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))},o=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",s),this.$input.addEventListener("wheel",o,{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",s),window.addEventListener("mouseup",o)},s=u=>{i(u.clientX)},o=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",o)},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,s){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(s)}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",s=>{s.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{F as se,I as N,J as ae,a as re,g as P,p as S,q as H}from"./chunk-5EHRFS32.js";import{u as I}from"./chunk-BXSPZW2B.js";import"./chunk-DERUYKVE.js";import{_ as oe,a as y}from"./chunk-PH2HNHTP.js";import{e as $}from"./chunk-ROCNZJLL.js";y();y();y();y();var M=class n{constructor(e,i,t,s,o="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(o),this.domElement.classList.add("controller"),this.domElement.classList.add(s),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 s=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(s)}},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 s=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(s)}},Me=[_e,D,Ee,ke];function Le(n){return Me.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,s){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=s,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 o=V(this.$text.value);o&&this._setValueFromHexString(o)}),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",s=>{s.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,s,o,a){super(e,i,t,"number"),this._initInput(),this.min(s),this.max(o);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())},s=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))},o=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",s),this.$input.addEventListener("wheel",o,{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",s),window.addEventListener("mouseup",o)},s=u=>{i(u.clientX)},o=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",o)},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,s){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(s)}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",s=>{s.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{F as se,I as N,J as ae,a as re,g as P,p as S,q as H}from"./chunk-KYQ66GHT
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=>s.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,s=i.addFolder("Search");s.open();let o=s.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",o.domElement.parentElement?.appendChild(a);let{renderSearch:l,close:h}=Te(n,e,a,o.$input),m=s.addFolder("Advanced");return m.close(),De(m),document.addEventListener("keydown",d=>{(d.metaKey||d.ctrlKey)&&d.key==="k"?(d.preventDefault(),s._closed&&s.open(),o.$input.focus()):d.key==="Escape"&&(h(),t.publish("highlight",void 0))}),{pubsub:t}}function Te(n,e,i,t){let s,o;t.addEventListener("input",async l=>{l instanceof InputEvent&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")&&(clearTimeout(s),s=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}o=Oe(i,l,n,h)},close(){o.destroy()}}}function Oe(n,e,i,t){n.innerHTML="";let s=document.createElement("div");Object.assign(s.style,U.dropdownContainer);let o=document.createElement("ul");o.className="options-list",Object.assign(o.style,U.optionsList),o.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),o.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()),o.appendChild(u),a.push(u)})}};l("enterpriseLocations",e.enterpriseLocations),l("enterpriseCategories",e.enterpriseCategories),l("Places",e.places),s.appendChild(o),n.appendChild(s);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=>{!s.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:s}=ce(n,e,i);s.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 o=i.addFolder("Click \u{1F447}").close(),{sub:a}=ze(n,o);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())},s=e.add(t,"position").disable(),o=[];function a(){o.forEach(h=>h()),o.length=0}let l=0;return n.on("click",h=>{let{labels:m,coordinate:d}=h;a(),i.publish("click",h),clearInterval(l),s.load(JSON.stringify([d.longitude,d.latitude]));let g=m?.[0];if(g!=null){let c=O(n,g,e);if(!c)return;o.push(c.destroy),c.labelItemFolder.openAnimated()}let r=h.spaces?.[0]??h.objects?.[0];if(r){let c={...r,...n.getState(r),isInView:!1,isInViewCheck:j(n,r.id)},{cleanup:p}=B(n,c,e);l=setInterval(()=>{c.isInView=n.isInView(g||r)},500),o.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:""},s=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 o=[];function a(){o.forEach(l=>l()),o.length=0}return n.on("hover",l=>{let{coordinate:h,spaces:m,objects:d,markers:g,labels:r}=l;a(),i.publish("hover",l),s.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:s,destroy:o}=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 s(c)});function g(r){for(let c of r)t.labels[c.id]=c;h()}return{populatelabels:g,destroy(){o()}}}function He(n,e,i,t,s){let{interactive:o,enabled:a,rank:l,anchor:h,dynamicResize:m,zIndex:d,contentHTML:g,lowPriorityPin:r}=t;if(o==null||a==null)throw new Error("incomplete marker state");let c={interactive:o,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),s?.(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,s){let{appearance:o,interactive:a}=t;if(!o||o.margin==null||a==null)throw new Error("incomplte label state");let l={text:e.text,interactive:a,appearance:{...o,margin:o.margin||0,pinColor:o.pinColor?E(o.pinColor):"black",textColor:o.textColor?E(o.textColor):"black"},remove(){n.Labels.remove(e),s?.(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 s=n.getState(e);if(!s)throw new Error(`error getting state for entity: ${e.id}`);let o=s.type===N?e.text?.substring(0,12)||"Label":`Marker ${e.id.toString().substring(0,8)}`,a=i.addFolder(o);if(a.close(),s.type===N)Ge(n,e,a,s,t);else if(s.type===ae)He(n,e,a,s,t);else throw new Error(`unsupported entity type: ${s.type}`);return{labelItemFolder:a,destroy(){a.destroy()}}}function Be(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:6,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(s){return i._closed||!t.onClick?void 0:e.Labels.add(s,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:s}=te(ge);s.opened||t.close();let o=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:o.latitude,center_lon:o.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:A}=l();r.inset_type==="portion"?Object.assign(a.style,{left:r.inset_left*b+"px",top:r.inset_top*A+"px",bottom:r.inset_bottom*A+"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:A}=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/A,1):0,r.inset_bottom=b>0?Math.min(r.inset_bottom/A,1):0,r.inset_left=A>0?Math.min(r.inset_left/b,1):0,r.inset_right=A>0?Math.min(r.inset_right/b,1):0):Y==="pixel"&&X==="portion"&&(r.inset_top=Math.round(r.inset_top*A),r.inset_bottom=Math.round(r.inset_bottom*A),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,A,1).onChange(k),v=t.add(r,"inset_bottom",0,A,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 A={pitch:b.pitch,center:new re(b.center_lat,b.center_lon),bearing:b.bearing,zoomLevel:b.zoomLevel};b.animateOnLoad?e.Camera.animateTo(A):e.Camera.set(A),t.load({controllers:b,folders:{}}),c()}let we=[()=>{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(we)}})}function Ue(n){return function(i){let{spaces:t,objects:s}=i,o=t?.[0]??s?.[0];o&&n.Camera.focusOn(o)}}y();function fe(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(c=>{delete this.markers[c.id]}),h()}},{addMarker:s,destroy:o}=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 s(c)});function g(r){for(let c of r)t.markers[c.id]=c;h()}return{populateMarkers:g,destroy(){o()}}}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 s=i.addFolder("Low Priority Pin");return s.add(t.lowPriorityPin,"enabled"),s.add(t.lowPriorityPin,"size",1,20,1),s.addColor(t.lowPriorityPin,"color"),s.close(),{destroy(){i.destroy()},addMarker(o){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(o,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("exterior-walls",{visible:a})}),i.addColor(t,"topColor").onChange(a=>{e.updateState("exterior-walls",{topColor:a})}),i.addColor(t,"color").onChange(a=>{e.updateState("exterior-walls",{color:a})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(a=>{e.updateState("exterior-walls",{texture:{url:a}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(a=>{e.updateState("exterior-walls",{topTexture:{url:a}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}y();function ve(n,e,i){n.close();let t={language:i.currentLanguage?.code??"en"},s=i.getByType("enterprise-venue");n.add(t,"language",s?.languages.map(o=>o.code)).onChange(o=>{i.changeLanguage(o)})}y();function ye(n,e,i){let t=n.addFolder("Debug");t.close();let s=e.Debug.state,o={showPolygonLabelTextAreaMesh:s.showPolygonLabelTextAreaMesh,showCollisionBoxes:s.showCollisionBoxes,showEnvMap:s.showEnvMap};t.add(o,"showPolygonLabelTextAreaMesh").onChange(a=>{e.Debug.update({showPolygonLabelTextAreaMesh:a})}).name("Show Flat Label Text Area Mesh"),t.add(o,"showCollisionBoxes").onChange(a=>{e.Debug.update({showCollisionBoxes:a})}).name("Show Collision Boxes"),t.add(o,"showEnvMap").onChange(a=>{e.Debug.update({showEnvMap:a})}).name("Show Environment Map"),e.Debug.update(o)}y();function xe(n,e,i){let t=n.addFolder("Text3D").close(),s={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(s,"all").name("Show All"),t.add(s,"removeAll").name("Remove All")}function Ae(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 s=t.addFolder("Levels").close(),o=t.addFolder("Scene Controls");o.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=s.add(m,"level",r).onChange(p=>{e.setFloor(p),m.level=e.currentFloor.id,c.updateDisplay()});return e.on("floor-change-start",p=>{s.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:o,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}=Ae(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,{interactive:!0})})}get enabled(){return this._enabled}};export{ie as Inspector};
483
- //# sourceMappingURL=inspector-J5CSSXEZ.js.map
483
+ //# sourceMappingURL=inspector-MQK7ARFM.js.map
@@ -1,2 +1,2 @@
1
- import{b as Me,n as Le,o as Ee,p as je,q as De}from"./chunk-KYQ66GHT.js";import{q as Fe}from"./chunk-C5ID5LHV.js";import"./chunk-RIFXMIJM.js";import{a as A}from"./chunk-DBCMQGTD.js";import{b as At,d as Ft,e as $,f as Oe,g as re,h as Ce,i as Ae}from"./chunk-ROCNZJLL.js";var It=At((V,M)=>{A();var Wt=200,it="__lodash_hash_undefined__",Ut=800,$t=16,st=9007199254740991,rt="[object Arguments]",Gt="[object Array]",qt="[object AsyncFunction]",Jt="[object Boolean]",Ht="[object Date]",Kt="[object Error]",ot="[object Function]",Qt="[object GeneratorFunction]",Yt="[object Map]",Zt="[object Number]",Xt="[object Null]",at="[object Object]",en="[object Proxy]",tn="[object RegExp]",nn="[object Set]",sn="[object String]",rn="[object Undefined]",on="[object WeakMap]",an="[object ArrayBuffer]",cn="[object DataView]",un="[object Float32Array]",ln="[object Float64Array]",dn="[object Int8Array]",hn="[object Int16Array]",fn="[object Int32Array]",pn="[object Uint8Array]",gn="[object Uint8ClampedArray]",mn="[object Uint16Array]",_n="[object Uint32Array]",yn=/[\\^$.*+?()[\]{}|]/g,bn=/^\[object .+?Constructor\]$/,wn=/^(?:0|[1-9]\d*)$/,_={};_[un]=_[ln]=_[dn]=_[hn]=_[fn]=_[pn]=_[gn]=_[mn]=_[_n]=!0;_[rt]=_[Gt]=_[an]=_[Jt]=_[cn]=_[Ht]=_[Kt]=_[ot]=_[Yt]=_[Zt]=_[at]=_[tn]=_[nn]=_[sn]=_[on]=!1;var ct=typeof global=="object"&&global&&global.Object===Object&&global,Sn=typeof self=="object"&&self&&self.Object===Object&&self,N=ct||Sn||Function("return this")(),ut=typeof V=="object"&&V&&!V.nodeType&&V,P=ut&&typeof M=="object"&&M&&!M.nodeType&&M,lt=P&&P.exports===ut,ge=lt&&ct.process,He=function(){try{var t=P&&P.require&&P.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch{}}(),Ke=He&&He.isTypedArray;function dt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function vn(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function xn(t){return function(e){return t(e)}}function In(t,e){return t?.[e]}function Tn(t,e){return function(n){return t(e(n))}}var zn=Array.prototype,On=Function.prototype,Q=Object.prototype,me=N["__core-js_shared__"],Y=On.toString,x=Q.hasOwnProperty,Qe=function(){var t=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ht=Q.toString,Cn=Y.call(Object),An=RegExp("^"+Y.call(x).replace(yn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=lt?N.Buffer:void 0,Ye=N.Symbol,Ze=N.Uint8Array,Xe=H?H.allocUnsafe:void 0,ft=Tn(Object.getPrototypeOf,Object),et=Object.create,Fn=Q.propertyIsEnumerable,Mn=zn.splice,O=Ye?Ye.toStringTag:void 0,K=function(){try{var t=xe(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ln=H?H.isBuffer:void 0,tt=Math.max,En=Date.now,pt=xe(N,"Map"),B=xe(Object,"create"),jn=function(){function t(){}return function(e){if(!v(e))return{};if(et)return et(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function C(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Dn(){this.__data__=B?B(null):{},this.size=0}function Rn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Vn(t){var e=this.__data__;if(B){var n=e[t];return n===it?void 0:n}return x.call(e,t)?e[t]:void 0}function Pn(t){var e=this.__data__;return B?e[t]!==void 0:x.call(e,t)}function Bn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=B&&e===void 0?it:e,this}C.prototype.clear=Dn;C.prototype.delete=Rn;C.prototype.get=Vn;C.prototype.has=Pn;C.prototype.set=Bn;function I(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Nn(){this.__data__=[],this.size=0}function kn(t){var e=this.__data__,n=Z(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Mn.call(e,n,1),--this.size,!0}function Wn(t){var e=this.__data__,n=Z(e,t);return n<0?void 0:e[n][1]}function Un(t){return Z(this.__data__,t)>-1}function $n(t,e){var n=this.__data__,i=Z(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}I.prototype.clear=Nn;I.prototype.delete=kn;I.prototype.get=Wn;I.prototype.has=Un;I.prototype.set=$n;function L(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Gn(){this.size=0,this.__data__={hash:new C,map:new(pt||I),string:new C}}function qn(t){var e=ee(this,t).delete(t);return this.size-=e?1:0,e}function Jn(t){return ee(this,t).get(t)}function Hn(t){return ee(this,t).has(t)}function Kn(t,e){var n=ee(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}L.prototype.clear=Gn;L.prototype.delete=qn;L.prototype.get=Jn;L.prototype.has=Hn;L.prototype.set=Kn;function E(t){var e=this.__data__=new I(t);this.size=e.size}function Qn(){this.__data__=new I,this.size=0}function Yn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Zn(t){return this.__data__.get(t)}function Xn(t){return this.__data__.has(t)}function ei(t,e){var n=this.__data__;if(n instanceof I){var i=n.__data__;if(!pt||i.length<Wt-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new L(i)}return n.set(t,e),this.size=n.size,this}E.prototype.clear=Qn;E.prototype.delete=Yn;E.prototype.get=Zn;E.prototype.has=Xn;E.prototype.set=ei;function ti(t,e){var n=we(t),i=!n&&be(t),s=!n&&!i&&bt(t),r=!n&&!i&&!s&&St(t),o=n||i||s||r,a=o?vn(t.length,String):[],c=a.length;for(var u in t)(e||x.call(t,u))&&!(o&&(u=="length"||s&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_t(u,c)))&&a.push(u);return a}function _e(t,e,n){(n!==void 0&&!te(t[e],n)||n===void 0&&!(e in t))&&Se(t,e,n)}function ni(t,e,n){var i=t[e];(!(x.call(t,e)&&te(i,n))||n===void 0&&!(e in t))&&Se(t,e,n)}function Z(t,e){for(var n=t.length;n--;)if(te(t[n][0],e))return n;return-1}function Se(t,e,n){e=="__proto__"&&K?K(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var ii=gi();function X(t){return t==null?t===void 0?rn:Xt:O&&O in Object(t)?mi(t):vi(t)}function nt(t){return k(t)&&X(t)==rt}function si(t){if(!v(t)||wi(t))return!1;var e=Te(t)?An:bn;return e.test(zi(t))}function ri(t){return k(t)&&wt(t.length)&&!!_[X(t)]}function oi(t){if(!v(t))return Si(t);var e=yt(t),n=[];for(var i in t)i=="constructor"&&(e||!x.call(t,i))||n.push(i);return n}function ve(t,e,n,i,s){t!==e&&ii(e,function(r,o){if(s||(s=new E),v(r))ai(t,e,o,n,ve,i,s);else{var a=i?i(ye(t,o),r,o+"",t,e,s):void 0;a===void 0&&(a=r),_e(t,o,a)}},vt)}function ai(t,e,n,i,s,r,o){var a=ye(t,n),c=ye(e,n),u=o.get(c);if(u){_e(t,n,u);return}var l=r?r(a,c,n+"",t,e,o):void 0,h=l===void 0;if(h){var d=we(c),f=!d&&bt(c),g=!d&&!f&&St(c);l=c,d||f||g?we(a)?l=a:Oi(a)?l=hi(a):f?(h=!1,l=ui(c,!0)):g?(h=!1,l=di(c,!0)):l=[]:Ci(c)||be(c)?(l=a,be(a)?l=Ai(a):(!v(a)||Te(a))&&(l=_i(c))):h=!1}h&&(o.set(c,l),s(l,c,i,r,o),o.delete(c)),_e(t,n,l)}function gt(t,e){return Ii(xi(t,e,xt),t+"")}var ci=K?function(t,e){return K(t,"toString",{configurable:!0,enumerable:!1,value:Li(e),writable:!0})}:xt;function ui(t,e){if(e)return t.slice();var n=t.length,i=Xe?Xe(n):new t.constructor(n);return t.copy(i),i}function li(t){var e=new t.constructor(t.byteLength);return new Ze(e).set(new Ze(t)),e}function di(t,e){var n=e?li(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function hi(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function fi(t,e,n,i){var s=!n;n||(n={});for(var r=-1,o=e.length;++r<o;){var a=e[r],c=i?i(n[a],t[a],a,n,t):void 0;c===void 0&&(c=t[a]),s?Se(n,a,c):ni(n,a,c)}return n}function pi(t){return gt(function(e,n){var i=-1,s=n.length,r=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(s--,r):void 0,o&&yi(n[0],n[1],o)&&(r=s<3?void 0:r,s=1),e=Object(e);++i<s;){var a=n[i];a&&t(e,a,i,r)}return e})}function gi(t){return function(e,n,i){for(var s=-1,r=Object(e),o=i(e),a=o.length;a--;){var c=o[t?a:++s];if(n(r[c],c,r)===!1)break}return e}}function mt(t,e,n,i,s,r){return v(t)&&v(e)&&(r.set(e,t),ve(t,e,void 0,mt,r),r.delete(e)),t}function ee(t,e){var n=t.__data__;return bi(e)?n[typeof e=="string"?"string":"hash"]:n.map}function xe(t,e){var n=In(t,e);return si(n)?n:void 0}function mi(t){var e=x.call(t,O),n=t[O];try{t[O]=void 0;var i=!0}catch{}var s=ht.call(t);return i&&(e?t[O]=n:delete t[O]),s}function _i(t){return typeof t.constructor=="function"&&!yt(t)?jn(ft(t)):{}}function _t(t,e){var n=typeof t;return e=e??st,!!e&&(n=="number"||n!="symbol"&&wn.test(t))&&t>-1&&t%1==0&&t<e}function yi(t,e,n){if(!v(n))return!1;var i=typeof e;return(i=="number"?Ie(n)&&_t(e,n.length):i=="string"&&e in n)?te(n[e],t):!1}function bi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wi(t){return!!Qe&&Qe in t}function yt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Q;return t===n}function Si(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function vi(t){return ht.call(t)}function xi(t,e,n){return e=tt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=tt(i.length-e,0),o=Array(r);++s<r;)o[s]=i[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=i[s];return a[e]=n(o),dt(t,this,a)}}function ye(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Ii=Ti(ci);function Ti(t){var e=0,n=0;return function(){var i=En(),s=$t-(i-n);if(n=i,s>0){if(++e>=Ut)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function zi(t){if(t!=null){try{return Y.call(t)}catch{}try{return t+""}catch{}}return""}function te(t,e){return t===e||t!==t&&e!==e}var be=nt(function(){return arguments}())?nt:function(t){return k(t)&&x.call(t,"callee")&&!Fn.call(t,"callee")},we=Array.isArray;function Ie(t){return t!=null&&wt(t.length)&&!Te(t)}function Oi(t){return k(t)&&Ie(t)}var bt=Ln||Ei;function Te(t){if(!v(t))return!1;var e=X(t);return e==ot||e==Qt||e==qt||e==en}function wt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=st}function v(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function k(t){return t!=null&&typeof t=="object"}function Ci(t){if(!k(t)||X(t)!=at)return!1;var e=ft(t);if(e===null)return!0;var n=x.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Y.call(n)==Cn}var St=Ke?xn(Ke):ri;function Ai(t){return fi(t,vt(t))}var Fi=gt(function(t){return t.push(void 0,mt),dt(Mi,void 0,t)});function vt(t){return Ie(t)?ti(t,!0):oi(t)}var Mi=pi(function(t,e,n,i){ve(t,e,n,i)});function Li(t){return function(){return t}}function xt(t){return t}function Ei(){return!1}M.exports=Fi});A();A();var Mt="ENTRIES",ke="KEYS",We="VALUES",b="",D=class{constructor(e,n){let i=e._tree,s=Array.from(i.keys());this.set=e,this._type=n,this._path=s.length>0?[{node:i,keys:s}]:[]}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:n}=F(this._path);if(F(n)===b)return{done:!1,value:this.result()};let i=e.get(F(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=F(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>F(e)).filter(e=>e!==b).join("")}value(){return F(this._path).node.get(b)}result(){switch(this._type){case We:return this.value();case ke:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},F=t=>t[t.length-1],Lt=(t,e,n)=>{let i=new Map;if(e===void 0)return i;let s=e.length+1,r=s+n,o=new Uint8Array(r*s).fill(n+1);for(let a=0;a<s;++a)o[a]=a;for(let a=1;a<r;++a)o[a*s]=a;return Ue(t,e,n,i,o,1,s,""),i},Ue=(t,e,n,i,s,r,o,a)=>{let c=r*o;e:for(let u of t.keys())if(u===b){let l=s[c-1];l<=n&&i.set(a,[t.get(u),l])}else{let l=r;for(let h=0;h<u.length;++h,++l){let d=u[h],f=o*l,g=f-o,m=s[f],p=Math.max(0,l-n-1),w=Math.min(o-1,l+n);for(let S=p;S<w;++S){let ie=d!==e[S],se=s[g+S]+ +ie,U=s[g+S+1]+1,T=s[f+S]+1,j=s[f+S+1]=Math.min(se,U,T);j<m&&(m=j)}if(m>n)continue e}Ue(t.get(u),e,n,i,s,l,o,a+u)}},R=class t{constructor(e=new Map,n=""){this._size=void 0,this._tree=e,this._prefix=n}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[n,i]=J(this._tree,e.slice(this._prefix.length));if(n===void 0){let[s,r]=fe(i);for(let o of s.keys())if(o!==b&&o.startsWith(r)){let a=new Map;return a.set(o.slice(r.length),s.get(o)),new t(a,e)}}return new t(n,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Et(this._tree,e)}entries(){return new D(this,Mt)}forEach(e){for(let[n,i]of this)e(n,i,this)}fuzzyGet(e,n){return Lt(this._tree,e,n)}get(e){let n=le(this._tree,e);return n!==void 0?n.get(b):void 0}has(e){let n=le(this._tree,e);return n!==void 0&&n.has(b)}keys(){return new D(this,ke)}set(e,n){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,oe(this._tree,e).set(b,n),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,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=oe(this._tree,e);return i.set(b,n(i.get(b))),this}fetch(e,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=oe(this._tree,e),s=i.get(b);return s===void 0&&i.set(b,s=n()),s}values(){return new D(this,We)}[Symbol.iterator](){return this.entries()}static from(e){let n=new t;for(let[i,s]of e)n.set(i,s);return n}static fromObject(e){return t.from(Object.entries(e))}},J=(t,e,n=[])=>{if(e.length===0||t==null)return[t,n];for(let i of t.keys())if(i!==b&&e.startsWith(i))return n.push([t,i]),J(t.get(i),e.slice(i.length),n);return n.push([t,e]),J(void 0,"",n)},le=(t,e)=>{if(e.length===0||t==null)return t;for(let n of t.keys())if(n!==b&&e.startsWith(n))return le(t.get(n),e.slice(n.length))},oe=(t,e)=>{let n=e.length;e:for(let i=0;t&&i<n;){for(let r of t.keys())if(r!==b&&e[i]===r[0]){let o=Math.min(n-i,r.length),a=1;for(;a<o&&e[i+a]===r[a];)++a;let c=t.get(r);if(a===r.length)t=c;else{let u=new Map;u.set(r.slice(a),c),t.set(e.slice(i,i+a),u),t.delete(r),t=u}i+=a;continue e}let s=new Map;return t.set(e.slice(i),s),s}return t},Et=(t,e)=>{let[n,i]=J(t,e);if(n!==void 0){if(n.delete(b),n.size===0)$e(i);else if(n.size===1){let[s,r]=n.entries().next().value;Ge(i,s,r)}}},$e=t=>{if(t.length===0)return;let[e,n]=fe(t);if(e.delete(n),e.size===0)$e(t.slice(0,-1));else if(e.size===1){let[i,s]=e.entries().next().value;i!==b&&Ge(t.slice(0,-1),i,s)}},Ge=(t,e,n)=>{if(t.length===0)return;let[i,s]=fe(t);i.set(s+e,n),i.delete(s)},fe=t=>t[t.length-1],pe="or",qe="and",jt="and_not",z=class t{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let n=e.autoVacuum==null||e.autoVacuum===!0?ue:e.autoVacuum;this._options={...ce,...e,autoVacuum:n,searchOptions:{...Re,...e.searchOptions||{}},autoSuggestOptions:{...Bt,...e.autoSuggestOptions||{}}},this._index=new R,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=he,this.addFields(this._options.fields)}add(e){let{extractField:n,stringifyField:i,tokenize:s,processTerm:r,fields:o,idField:a}=this._options,c=n(e,a);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${a}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let u=this.addDocumentId(c);this.saveStoredFields(u,e);for(let l of o){let h=n(e,l);if(h==null)continue;let d=s(i(h,l),l),f=this._fieldIds[l],g=new Set(d).size;this.addFieldLength(u,f,this._documentCount-1,g);for(let m of d){let p=r(m,l);if(Array.isArray(p))for(let w of p)this.addTerm(f,u,w);else p&&this.addTerm(f,u,p)}}}addAll(e){for(let n of e)this.add(n)}addAllAsync(e,n={}){let{chunkSize:i=10}=n,s={chunk:[],promise:Promise.resolve()},{chunk:r,promise:o}=e.reduce(({chunk:a,promise:c},u,l)=>(a.push(u),(l+1)%i===0?{chunk:[],promise:c.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(a))}:{chunk:a,promise:c}),s);return o.then(()=>this.addAll(r))}remove(e){let{tokenize:n,processTerm:i,extractField:s,stringifyField:r,fields:o,idField:a}=this._options,c=s(e,a);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${a}"`);let u=this._idToShortId.get(c);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let l of o){let h=s(e,l);if(h==null)continue;let d=n(r(h,l),l),f=this._fieldIds[l],g=new Set(d).size;this.removeFieldLength(u,f,this._documentCount,g);for(let m of d){let p=i(m,l);if(Array.isArray(p))for(let w of p)this.removeTerm(f,u,w);else p&&this.removeTerm(f,u,p)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(c),this._fieldLength.delete(u),this._documentCount-=1}removeAll(e){if(e)for(let n of e)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new R,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 n=this._idToShortId.get(e);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((i,s)=>{this.removeFieldLength(n,s,this._documentCount,i)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:n,batchSize:i,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:i,batchWait:s},{minDirtCount:n,minDirtFactor:e})}discardAll(e){let n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let i of e)this.discard(i)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(e){let{idField:n,extractField:i}=this._options,s=i(e,n);this.discard(s),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let i=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=he,this.performVacuuming(e,i)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,n){let i=this._dirtCount;if(this.vacuumConditionsMet(n)){let s=e.batchSize||de.batchSize,r=e.batchWait||de.batchWait,o=1;for(let[a,c]of this._index){for(let[u,l]of c)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?c.delete(u):l.delete(h));this._index.get(a).size===0&&this._index.delete(a),o%s===0&&await new Promise(u=>setTimeout(u,r)),o+=1}this._dirtCount-=i}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:n,minDirtFactor:i}=e;return n=n||ue.minDirtCount,i=i||ue.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=i}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 n=this._idToShortId.get(e);if(n!=null)return this._storedFields.get(n)}search(e,n={}){let{searchOptions:i}=this._options,s={...i,...n},r=this.executeQuery(e,n),o=[];for(let[a,{score:c,terms:u,match:l}]of r){let h=u.length||1,d={id:this._documentIds.get(a),score:c*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(a)),(s.filter==null||s.filter(d))&&o.push(d)}return e===t.wildcard&&s.boostDocument==null||o.sort(Pe),o}autoSuggest(e,n={}){n={...this._options.autoSuggestOptions,...n};let i=new Map;for(let{score:r,terms:o}of this.search(e,n)){let a=o.join(" "),c=i.get(a);c!=null?(c.score+=r,c.count+=1):i.set(a,{score:r,terms:o,count:1})}let s=[];for(let[r,{score:o,terms:a,count:c}]of i)s.push({suggestion:r,terms:a,score:o/c});return s.sort(Pe),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),n)}static async loadJSONAsync(e,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),n)}static getDefault(e){if(ce.hasOwnProperty(e))return ae(ce,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:o,serializationVersion:a}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=G(s),c._fieldLength=G(r),c._storedFields=G(o);for(let[u,l]of c._documentIds)c._idToShortId.set(l,u);for(let[u,l]of i){let h=new Map;for(let d of Object.keys(l)){let f=l[d];a===1&&(f=f.ds),h.set(parseInt(d,10),G(f))}c._index.set(u,h)}return c}static async loadJSAsync(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:o,serializationVersion:a}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=await q(s),c._fieldLength=await q(r),c._storedFields=await q(o);for(let[l,h]of c._documentIds)c._idToShortId.set(h,l);let u=0;for(let[l,h]of i){let d=new Map;for(let f of Object.keys(h)){let g=h[f];a===1&&(g=g.ds),d.set(parseInt(f,10),await q(g))}++u%1e3===0&&await Je(0),c._index.set(l,d)}return c}static instantiateMiniSearch(e,n){let{documentCount:i,nextId:s,fieldIds:r,averageFieldLength:o,dirtCount:a,serializationVersion:c}=e;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new t(n);return u._documentCount=i,u._nextId=s,u._idToShortId=new Map,u._fieldIds=r,u._avgFieldLength=o,u._dirtCount=a||0,u._index=new R,u}executeQuery(e,n={}){if(e===t.wildcard)return this.executeWildcardQuery(n);if(typeof e!="string"){let d={...n,...e,queries:void 0},f=e.queries.map(g=>this.executeQuery(g,d));return this.combineResults(f,d.combineWith)}let{tokenize:i,processTerm:s,searchOptions:r}=this._options,o={tokenize:i,processTerm:s,...r,...n},{tokenize:a,processTerm:c}=o,h=a(e).flatMap(d=>c(d)).filter(d=>!!d).map(Pt(o)).map(d=>this.executeQuerySpec(d,o));return this.combineResults(h,o.combineWith)}executeQuerySpec(e,n){let i={...this._options.searchOptions,...n},s=(i.fields||this._options.fields).reduce((m,p)=>({...m,[p]:ae(i.boost,p)||1}),{}),{boostDocument:r,weights:o,maxFuzzy:a,bm25:c}=i,{fuzzy:u,prefix:l}={...Re.weights,...o},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,s,r,c),f,g;if(e.prefix&&(f=this._index.atPrefix(e.term)),e.fuzzy){let m=e.fuzzy===!0?.2:e.fuzzy,p=m<1?Math.min(a,Math.round(e.term.length*m)):m;p&&(g=this._index.fuzzyGet(e.term,p))}if(f)for(let[m,p]of f){let w=m.length-e.term.length;if(!w)continue;g?.delete(m);let S=l*m.length/(m.length+.3*w);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,d)}if(g)for(let m of g.keys()){let[p,w]=g.get(m);if(!w)continue;let S=u*m.length/(m.length+w);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,d)}return d}executeWildcardQuery(e){let n=new Map,i={...this._options.searchOptions,...e};for(let[s,r]of this._documentIds){let o=i.boostDocument?i.boostDocument(r,"",this._storedFields.get(s)):1;n.set(s,{score:o,terms:[],match:{}})}return n}combineResults(e,n=pe){if(e.length===0)return new Map;let i=n.toLowerCase(),s=Dt[i];if(!s)throw new Error(`Invalid combination operator: ${n}`);return e.reduce(s)||new Map}toJSON(){let e=[];for(let[n,i]of this._index){let s={};for(let[r,o]of i)s[r]=Object.fromEntries(o);e.push([n,s])}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,n,i,s,r,o,a,c,u=new Map){if(r==null)return u;for(let l of Object.keys(o)){let h=o[l],d=this._fieldIds[l],f=r.get(d);if(f==null)continue;let g=f.size,m=this._avgFieldLength[d];for(let p of f.keys()){if(!this._documentIds.has(p)){this.removeTerm(d,p,n),g-=1;continue}let w=a?a(this._documentIds.get(p),n,this._storedFields.get(p)):1;if(!w)continue;let S=f.get(p),ie=this._fieldLength.get(p)[d],se=Vt(S,g,this._documentCount,ie,m,c),U=i*s*h*w*se,T=u.get(p);if(T){T.score+=U,Nt(T.terms,e);let j=ae(T.match,n);j?j.push(l):T.match[n]=[l]}else u.set(p,{score:U,terms:[e],match:{[n]:[l]}})}}return u}addTerm(e,n,i){let s=this._index.fetch(i,Be),r=s.get(e);if(r==null)r=new Map,r.set(n,1),s.set(e,r);else{let o=r.get(n);r.set(n,(o||0)+1)}}removeTerm(e,n,i){if(!this._index.has(i)){this.warnDocumentChanged(n,e,i);return}let s=this._index.fetch(i,Be),r=s.get(e);r==null||r.get(n)==null?this.warnDocumentChanged(n,e,i):r.get(n)<=1?r.size<=1?s.delete(e):r.delete(n):r.set(n,r.get(n)-1),this._index.get(i).size===0&&this._index.delete(i)}warnDocumentChanged(e,n,i){for(let s of Object.keys(this._fieldIds))if(this._fieldIds[s]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${i}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let n=this._nextId;return this._idToShortId.set(e,n),this._documentIds.set(n,e),this._documentCount+=1,this._nextId+=1,n}addFields(e){for(let n=0;n<e.length;n++)this._fieldIds[e[n]]=n}addFieldLength(e,n,i,s){let r=this._fieldLength.get(e);r==null&&this._fieldLength.set(e,r=[]),r[n]=s;let a=(this._avgFieldLength[n]||0)*i+s;this._avgFieldLength[n]=a/(i+1)}removeFieldLength(e,n,i,s){if(i===1){this._avgFieldLength[n]=0;return}let r=this._avgFieldLength[n]*i-s;this._avgFieldLength[n]=r/(i-1)}saveStoredFields(e,n){let{storeFields:i,extractField:s}=this._options;if(i==null||i.length===0)return;let r=this._storedFields.get(e);r==null&&this._storedFields.set(e,r={});for(let o of i){let a=s(n,o);a!==void 0&&(r[o]=a)}}};z.wildcard=Symbol("*");var ae=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,Dt={[pe]:(t,e)=>{for(let n of e.keys()){let i=t.get(n);if(i==null)t.set(n,e.get(n));else{let{score:s,terms:r,match:o}=e.get(n);i.score=i.score+s,i.match=Object.assign(i.match,o),Ve(i.terms,r)}}return t},[qe]:(t,e)=>{let n=new Map;for(let i of e.keys()){let s=t.get(i);if(s==null)continue;let{score:r,terms:o,match:a}=e.get(i);Ve(s.terms,o),n.set(i,{score:s.score+r,terms:s.terms,match:Object.assign(s.match,a)})}return n},[jt]:(t,e)=>{for(let n of e.keys())t.delete(n);return t}},Rt={k:1.2,b:.7,d:.5},Vt=(t,e,n,i,s,r)=>{let{k:o,b:a,d:c}=r;return Math.log(1+(n-e+.5)/(e+.5))*(c+t*(o+1)/(t+o*(1-a+a*i/s)))},Pt=t=>(e,n,i)=>{let s=typeof t.fuzzy=="function"?t.fuzzy(e,n,i):t.fuzzy||!1,r=typeof t.prefix=="function"?t.prefix(e,n,i):t.prefix===!0,o=typeof t.boostTerm=="function"?t.boostTerm(e,n,i):1;return{term:e,fuzzy:s,prefix:r,termBoost:o}},ce={idField:"id",extractField:(t,e)=>t[e],stringifyField:(t,e)=>t.toString(),tokenize:t=>t.split(kt),processTerm:t=>t.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(t,e)=>{typeof console?.[t]=="function"&&console[t](e)},autoVacuum:!0},Re={combineWith:pe,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Rt},Bt={combineWith:qe,prefix:(t,e,n)=>e===n.length-1},de={batchSize:1e3,batchWait:10},he={minDirtFactor:.1,minDirtCount:20},ue={...de,...he},Nt=(t,e)=>{t.includes(e)||t.push(e)},Ve=(t,e)=>{for(let n of e)t.includes(n)||t.push(n)},Pe=({score:t},{score:e})=>e-t,Be=()=>new Map,G=t=>{let e=new Map;for(let n of Object.keys(t))e.set(parseInt(n,10),t[n]);return e},q=async t=>{let e=new Map,n=0;for(let i of Object.keys(t))e.set(parseInt(i,10),t[i]),++n%1e3===0&&await Je(0);return e},Je=t=>new Promise(e=>setTimeout(e,t)),kt=/[\n\r\p{Z}\p{P}]+/u;var Ot=Ft(It(),1);import{z as y}from"zod";var W,ne,Ct,Tt=class{constructor(e){re(this,ne);$(this,"mapData");$(this,"indexes");$(this,"ready");re(this,W);this.mapData=e,this.indexes=Ri(e),this.ready=this.populate(),Ce(this,W,Fe(Ae(this,ne,Ct).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:n,enterpriseCategories:i}=this.indexes,s=this.mapData,r=[];return e.removeAll(),r=r.concat([e.addAllAsync(s.getByType("space")),e.addAllAsync(s.getByType("point-of-interest")),e.addAllAsync(s.getByType("object")),e.addAllAsync(s.getByType("connection")),e.addAllAsync(s.getByType("floor")),e.addAllAsync(s.getByType("door")),e.addAllAsync(s.getByType("annotation")),e.addAllAsync(s.getByType("area"))]),n&&(n?.removeAll(),r.push(n.addAllAsync(s.getByType("enterprise-location")))),i&&(i?.removeAll(),r.push(i.addAllAsync(s.getByType("enterprise-category")))),Promise.all(r)}async search(e,n={}){await this.ready,Vi.parse(n);let i=(0,Ot.default)({},n,Di),s=this.indexes.places.search(e,{fields:Object.keys(i.places.fields).filter(c=>i.places.fields[c])});i.places.limit&&(s=s.slice(0,i.places.limit));let r=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(i.enterpriseLocations.fields).filter(c=>i.enterpriseLocations.fields[c])});r&&i.enterpriseLocations.limit&&(r=r.slice(0,i.enterpriseLocations.limit));let o=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(i.enterpriseCategories.fields).filter(c=>i.enterpriseCategories.fields[c])});o&&i.enterpriseCategories.limit&&(o=o.slice(0,i.enterpriseCategories.limit));let a=ji(this.mapData,{placesResult:s,locationsResult:r,categoriesResult:o});return Oe(this,W).call(this,e),a}async suggest(e,n={}){await this.ready,Pi.parse(n);let i=[],{places:{enabled:s=!0}={},enterpriseLocations:{enabled:r=!0}={}}=n;return r&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(o=>i.push(o)),s&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(o=>i.push(o)),i.sort((o,a)=>a.score-o.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:i.map(o=>o.suggestion)}),i}};W=new WeakMap,ne=new WeakSet,Ct=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function ji(t,{placesResult:e,locationsResult:n,categoriesResult:i}){let s=e.reduce((a,{id:c,match:u,score:l,__type:h})=>{let d=t.getById(h,c);return d!=null&&!Me.is(d)&&!Le.is(d)&&!Ee.is(d)&&!je.is(d)&&!De.is(d)&&a.push({type:d.__type,match:u,score:l,item:d}),a},[]),r;if(n){r=[];for(let{id:a,match:c,score:u}of n){let l=t.getById("enterprise-location",a);l&&r.push({type:l.__type,match:c,score:u,item:l})}}let o;if(i){o=[];for(let{id:a,match:c,score:u}of i){let l=t.getById("enterprise-category",a);l&&o.push({type:l.__type,match:c,score:u,item:l})}}return{places:s,enterpriseLocations:r,enterpriseCategories:o}}var Di={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function ze(t){return t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ri(t){let e=new z({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(o,a)=>{let c=o[a];return typeof c=="string"?ze(c):o[a]},processTerm:o=>Bi.has(o)?"":o.toLowerCase()}),n=t.getByType("enterprise-location"),i;n&&(i=new z({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(o,a)=>Array.isArray(o[a])?o[a].join(" "):typeof o[a]=="string"?ze(o[a]):o[a]}));let s=t.getByType("enterprise-category"),r;return s&&(r=new z({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(o,a){return a==="locations.name"?o.locations.reduce((u,l)=>u+` ${zt} `+l.name,"")+` ${zt}`:typeof o[a]=="string"?ze(o[a]):o[a]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:r,enterpriseLocations:i,places:e}}var Vi=y.object({places:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional()}).optional(),enterpriseCategories:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional(),"locations.name":y.boolean().optional()}).optional(),limit:y.number().positive().optional()}).optional(),enterpriseLocations:y.object({fields:y.object({name:y.boolean().optional(),tags:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional()}).optional()}),Pi=y.object({places:y.object({enabled:y.boolean().optional()}).optional(),enterpriseLocations:y.object({enabled:y.boolean().optional()}).optional()}),Bi=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),zt="";export{Tt as InternalSearch,ze as removeAccents};
2
- //# sourceMappingURL=internal-HTTM4ECA.js.map
1
+ import{b as Me,n as Le,o as Ee,p as je,q as De}from"./chunk-5EHRFS32.js";import{q as Fe}from"./chunk-BXSPZW2B.js";import"./chunk-DERUYKVE.js";import{a as A}from"./chunk-PH2HNHTP.js";import{b as At,d as Ft,e as $,f as Oe,g as re,h as Ce,i as Ae}from"./chunk-ROCNZJLL.js";var It=At((V,M)=>{A();var Wt=200,it="__lodash_hash_undefined__",Ut=800,$t=16,st=9007199254740991,rt="[object Arguments]",Gt="[object Array]",qt="[object AsyncFunction]",Jt="[object Boolean]",Ht="[object Date]",Kt="[object Error]",ot="[object Function]",Qt="[object GeneratorFunction]",Yt="[object Map]",Zt="[object Number]",Xt="[object Null]",at="[object Object]",en="[object Proxy]",tn="[object RegExp]",nn="[object Set]",sn="[object String]",rn="[object Undefined]",on="[object WeakMap]",an="[object ArrayBuffer]",cn="[object DataView]",un="[object Float32Array]",ln="[object Float64Array]",dn="[object Int8Array]",hn="[object Int16Array]",fn="[object Int32Array]",pn="[object Uint8Array]",gn="[object Uint8ClampedArray]",mn="[object Uint16Array]",_n="[object Uint32Array]",yn=/[\\^$.*+?()[\]{}|]/g,bn=/^\[object .+?Constructor\]$/,wn=/^(?:0|[1-9]\d*)$/,_={};_[un]=_[ln]=_[dn]=_[hn]=_[fn]=_[pn]=_[gn]=_[mn]=_[_n]=!0;_[rt]=_[Gt]=_[an]=_[Jt]=_[cn]=_[Ht]=_[Kt]=_[ot]=_[Yt]=_[Zt]=_[at]=_[tn]=_[nn]=_[sn]=_[on]=!1;var ct=typeof global=="object"&&global&&global.Object===Object&&global,Sn=typeof self=="object"&&self&&self.Object===Object&&self,N=ct||Sn||Function("return this")(),ut=typeof V=="object"&&V&&!V.nodeType&&V,P=ut&&typeof M=="object"&&M&&!M.nodeType&&M,lt=P&&P.exports===ut,ge=lt&&ct.process,He=function(){try{var t=P&&P.require&&P.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch{}}(),Ke=He&&He.isTypedArray;function dt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function vn(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function xn(t){return function(e){return t(e)}}function In(t,e){return t?.[e]}function Tn(t,e){return function(n){return t(e(n))}}var zn=Array.prototype,On=Function.prototype,Q=Object.prototype,me=N["__core-js_shared__"],Y=On.toString,x=Q.hasOwnProperty,Qe=function(){var t=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ht=Q.toString,Cn=Y.call(Object),An=RegExp("^"+Y.call(x).replace(yn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=lt?N.Buffer:void 0,Ye=N.Symbol,Ze=N.Uint8Array,Xe=H?H.allocUnsafe:void 0,ft=Tn(Object.getPrototypeOf,Object),et=Object.create,Fn=Q.propertyIsEnumerable,Mn=zn.splice,O=Ye?Ye.toStringTag:void 0,K=function(){try{var t=xe(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ln=H?H.isBuffer:void 0,tt=Math.max,En=Date.now,pt=xe(N,"Map"),B=xe(Object,"create"),jn=function(){function t(){}return function(e){if(!v(e))return{};if(et)return et(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function C(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Dn(){this.__data__=B?B(null):{},this.size=0}function Rn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Vn(t){var e=this.__data__;if(B){var n=e[t];return n===it?void 0:n}return x.call(e,t)?e[t]:void 0}function Pn(t){var e=this.__data__;return B?e[t]!==void 0:x.call(e,t)}function Bn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=B&&e===void 0?it:e,this}C.prototype.clear=Dn;C.prototype.delete=Rn;C.prototype.get=Vn;C.prototype.has=Pn;C.prototype.set=Bn;function I(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Nn(){this.__data__=[],this.size=0}function kn(t){var e=this.__data__,n=Z(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Mn.call(e,n,1),--this.size,!0}function Wn(t){var e=this.__data__,n=Z(e,t);return n<0?void 0:e[n][1]}function Un(t){return Z(this.__data__,t)>-1}function $n(t,e){var n=this.__data__,i=Z(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}I.prototype.clear=Nn;I.prototype.delete=kn;I.prototype.get=Wn;I.prototype.has=Un;I.prototype.set=$n;function L(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Gn(){this.size=0,this.__data__={hash:new C,map:new(pt||I),string:new C}}function qn(t){var e=ee(this,t).delete(t);return this.size-=e?1:0,e}function Jn(t){return ee(this,t).get(t)}function Hn(t){return ee(this,t).has(t)}function Kn(t,e){var n=ee(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}L.prototype.clear=Gn;L.prototype.delete=qn;L.prototype.get=Jn;L.prototype.has=Hn;L.prototype.set=Kn;function E(t){var e=this.__data__=new I(t);this.size=e.size}function Qn(){this.__data__=new I,this.size=0}function Yn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Zn(t){return this.__data__.get(t)}function Xn(t){return this.__data__.has(t)}function ei(t,e){var n=this.__data__;if(n instanceof I){var i=n.__data__;if(!pt||i.length<Wt-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new L(i)}return n.set(t,e),this.size=n.size,this}E.prototype.clear=Qn;E.prototype.delete=Yn;E.prototype.get=Zn;E.prototype.has=Xn;E.prototype.set=ei;function ti(t,e){var n=we(t),i=!n&&be(t),s=!n&&!i&&bt(t),r=!n&&!i&&!s&&St(t),o=n||i||s||r,a=o?vn(t.length,String):[],c=a.length;for(var u in t)(e||x.call(t,u))&&!(o&&(u=="length"||s&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_t(u,c)))&&a.push(u);return a}function _e(t,e,n){(n!==void 0&&!te(t[e],n)||n===void 0&&!(e in t))&&Se(t,e,n)}function ni(t,e,n){var i=t[e];(!(x.call(t,e)&&te(i,n))||n===void 0&&!(e in t))&&Se(t,e,n)}function Z(t,e){for(var n=t.length;n--;)if(te(t[n][0],e))return n;return-1}function Se(t,e,n){e=="__proto__"&&K?K(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var ii=gi();function X(t){return t==null?t===void 0?rn:Xt:O&&O in Object(t)?mi(t):vi(t)}function nt(t){return k(t)&&X(t)==rt}function si(t){if(!v(t)||wi(t))return!1;var e=Te(t)?An:bn;return e.test(zi(t))}function ri(t){return k(t)&&wt(t.length)&&!!_[X(t)]}function oi(t){if(!v(t))return Si(t);var e=yt(t),n=[];for(var i in t)i=="constructor"&&(e||!x.call(t,i))||n.push(i);return n}function ve(t,e,n,i,s){t!==e&&ii(e,function(r,o){if(s||(s=new E),v(r))ai(t,e,o,n,ve,i,s);else{var a=i?i(ye(t,o),r,o+"",t,e,s):void 0;a===void 0&&(a=r),_e(t,o,a)}},vt)}function ai(t,e,n,i,s,r,o){var a=ye(t,n),c=ye(e,n),u=o.get(c);if(u){_e(t,n,u);return}var l=r?r(a,c,n+"",t,e,o):void 0,h=l===void 0;if(h){var d=we(c),f=!d&&bt(c),g=!d&&!f&&St(c);l=c,d||f||g?we(a)?l=a:Oi(a)?l=hi(a):f?(h=!1,l=ui(c,!0)):g?(h=!1,l=di(c,!0)):l=[]:Ci(c)||be(c)?(l=a,be(a)?l=Ai(a):(!v(a)||Te(a))&&(l=_i(c))):h=!1}h&&(o.set(c,l),s(l,c,i,r,o),o.delete(c)),_e(t,n,l)}function gt(t,e){return Ii(xi(t,e,xt),t+"")}var ci=K?function(t,e){return K(t,"toString",{configurable:!0,enumerable:!1,value:Li(e),writable:!0})}:xt;function ui(t,e){if(e)return t.slice();var n=t.length,i=Xe?Xe(n):new t.constructor(n);return t.copy(i),i}function li(t){var e=new t.constructor(t.byteLength);return new Ze(e).set(new Ze(t)),e}function di(t,e){var n=e?li(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function hi(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function fi(t,e,n,i){var s=!n;n||(n={});for(var r=-1,o=e.length;++r<o;){var a=e[r],c=i?i(n[a],t[a],a,n,t):void 0;c===void 0&&(c=t[a]),s?Se(n,a,c):ni(n,a,c)}return n}function pi(t){return gt(function(e,n){var i=-1,s=n.length,r=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(s--,r):void 0,o&&yi(n[0],n[1],o)&&(r=s<3?void 0:r,s=1),e=Object(e);++i<s;){var a=n[i];a&&t(e,a,i,r)}return e})}function gi(t){return function(e,n,i){for(var s=-1,r=Object(e),o=i(e),a=o.length;a--;){var c=o[t?a:++s];if(n(r[c],c,r)===!1)break}return e}}function mt(t,e,n,i,s,r){return v(t)&&v(e)&&(r.set(e,t),ve(t,e,void 0,mt,r),r.delete(e)),t}function ee(t,e){var n=t.__data__;return bi(e)?n[typeof e=="string"?"string":"hash"]:n.map}function xe(t,e){var n=In(t,e);return si(n)?n:void 0}function mi(t){var e=x.call(t,O),n=t[O];try{t[O]=void 0;var i=!0}catch{}var s=ht.call(t);return i&&(e?t[O]=n:delete t[O]),s}function _i(t){return typeof t.constructor=="function"&&!yt(t)?jn(ft(t)):{}}function _t(t,e){var n=typeof t;return e=e??st,!!e&&(n=="number"||n!="symbol"&&wn.test(t))&&t>-1&&t%1==0&&t<e}function yi(t,e,n){if(!v(n))return!1;var i=typeof e;return(i=="number"?Ie(n)&&_t(e,n.length):i=="string"&&e in n)?te(n[e],t):!1}function bi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wi(t){return!!Qe&&Qe in t}function yt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Q;return t===n}function Si(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function vi(t){return ht.call(t)}function xi(t,e,n){return e=tt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=tt(i.length-e,0),o=Array(r);++s<r;)o[s]=i[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=i[s];return a[e]=n(o),dt(t,this,a)}}function ye(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Ii=Ti(ci);function Ti(t){var e=0,n=0;return function(){var i=En(),s=$t-(i-n);if(n=i,s>0){if(++e>=Ut)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function zi(t){if(t!=null){try{return Y.call(t)}catch{}try{return t+""}catch{}}return""}function te(t,e){return t===e||t!==t&&e!==e}var be=nt(function(){return arguments}())?nt:function(t){return k(t)&&x.call(t,"callee")&&!Fn.call(t,"callee")},we=Array.isArray;function Ie(t){return t!=null&&wt(t.length)&&!Te(t)}function Oi(t){return k(t)&&Ie(t)}var bt=Ln||Ei;function Te(t){if(!v(t))return!1;var e=X(t);return e==ot||e==Qt||e==qt||e==en}function wt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=st}function v(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function k(t){return t!=null&&typeof t=="object"}function Ci(t){if(!k(t)||X(t)!=at)return!1;var e=ft(t);if(e===null)return!0;var n=x.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Y.call(n)==Cn}var St=Ke?xn(Ke):ri;function Ai(t){return fi(t,vt(t))}var Fi=gt(function(t){return t.push(void 0,mt),dt(Mi,void 0,t)});function vt(t){return Ie(t)?ti(t,!0):oi(t)}var Mi=pi(function(t,e,n,i){ve(t,e,n,i)});function Li(t){return function(){return t}}function xt(t){return t}function Ei(){return!1}M.exports=Fi});A();A();var Mt="ENTRIES",ke="KEYS",We="VALUES",b="",D=class{constructor(e,n){let i=e._tree,s=Array.from(i.keys());this.set=e,this._type=n,this._path=s.length>0?[{node:i,keys:s}]:[]}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:n}=F(this._path);if(F(n)===b)return{done:!1,value:this.result()};let i=e.get(F(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=F(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>F(e)).filter(e=>e!==b).join("")}value(){return F(this._path).node.get(b)}result(){switch(this._type){case We:return this.value();case ke:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},F=t=>t[t.length-1],Lt=(t,e,n)=>{let i=new Map;if(e===void 0)return i;let s=e.length+1,r=s+n,o=new Uint8Array(r*s).fill(n+1);for(let a=0;a<s;++a)o[a]=a;for(let a=1;a<r;++a)o[a*s]=a;return Ue(t,e,n,i,o,1,s,""),i},Ue=(t,e,n,i,s,r,o,a)=>{let c=r*o;e:for(let u of t.keys())if(u===b){let l=s[c-1];l<=n&&i.set(a,[t.get(u),l])}else{let l=r;for(let h=0;h<u.length;++h,++l){let d=u[h],f=o*l,g=f-o,m=s[f],p=Math.max(0,l-n-1),w=Math.min(o-1,l+n);for(let S=p;S<w;++S){let ie=d!==e[S],se=s[g+S]+ +ie,U=s[g+S+1]+1,T=s[f+S]+1,j=s[f+S+1]=Math.min(se,U,T);j<m&&(m=j)}if(m>n)continue e}Ue(t.get(u),e,n,i,s,l,o,a+u)}},R=class t{constructor(e=new Map,n=""){this._size=void 0,this._tree=e,this._prefix=n}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[n,i]=J(this._tree,e.slice(this._prefix.length));if(n===void 0){let[s,r]=fe(i);for(let o of s.keys())if(o!==b&&o.startsWith(r)){let a=new Map;return a.set(o.slice(r.length),s.get(o)),new t(a,e)}}return new t(n,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Et(this._tree,e)}entries(){return new D(this,Mt)}forEach(e){for(let[n,i]of this)e(n,i,this)}fuzzyGet(e,n){return Lt(this._tree,e,n)}get(e){let n=le(this._tree,e);return n!==void 0?n.get(b):void 0}has(e){let n=le(this._tree,e);return n!==void 0&&n.has(b)}keys(){return new D(this,ke)}set(e,n){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,oe(this._tree,e).set(b,n),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,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=oe(this._tree,e);return i.set(b,n(i.get(b))),this}fetch(e,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=oe(this._tree,e),s=i.get(b);return s===void 0&&i.set(b,s=n()),s}values(){return new D(this,We)}[Symbol.iterator](){return this.entries()}static from(e){let n=new t;for(let[i,s]of e)n.set(i,s);return n}static fromObject(e){return t.from(Object.entries(e))}},J=(t,e,n=[])=>{if(e.length===0||t==null)return[t,n];for(let i of t.keys())if(i!==b&&e.startsWith(i))return n.push([t,i]),J(t.get(i),e.slice(i.length),n);return n.push([t,e]),J(void 0,"",n)},le=(t,e)=>{if(e.length===0||t==null)return t;for(let n of t.keys())if(n!==b&&e.startsWith(n))return le(t.get(n),e.slice(n.length))},oe=(t,e)=>{let n=e.length;e:for(let i=0;t&&i<n;){for(let r of t.keys())if(r!==b&&e[i]===r[0]){let o=Math.min(n-i,r.length),a=1;for(;a<o&&e[i+a]===r[a];)++a;let c=t.get(r);if(a===r.length)t=c;else{let u=new Map;u.set(r.slice(a),c),t.set(e.slice(i,i+a),u),t.delete(r),t=u}i+=a;continue e}let s=new Map;return t.set(e.slice(i),s),s}return t},Et=(t,e)=>{let[n,i]=J(t,e);if(n!==void 0){if(n.delete(b),n.size===0)$e(i);else if(n.size===1){let[s,r]=n.entries().next().value;Ge(i,s,r)}}},$e=t=>{if(t.length===0)return;let[e,n]=fe(t);if(e.delete(n),e.size===0)$e(t.slice(0,-1));else if(e.size===1){let[i,s]=e.entries().next().value;i!==b&&Ge(t.slice(0,-1),i,s)}},Ge=(t,e,n)=>{if(t.length===0)return;let[i,s]=fe(t);i.set(s+e,n),i.delete(s)},fe=t=>t[t.length-1],pe="or",qe="and",jt="and_not",z=class t{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let n=e.autoVacuum==null||e.autoVacuum===!0?ue:e.autoVacuum;this._options={...ce,...e,autoVacuum:n,searchOptions:{...Re,...e.searchOptions||{}},autoSuggestOptions:{...Bt,...e.autoSuggestOptions||{}}},this._index=new R,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=he,this.addFields(this._options.fields)}add(e){let{extractField:n,stringifyField:i,tokenize:s,processTerm:r,fields:o,idField:a}=this._options,c=n(e,a);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${a}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let u=this.addDocumentId(c);this.saveStoredFields(u,e);for(let l of o){let h=n(e,l);if(h==null)continue;let d=s(i(h,l),l),f=this._fieldIds[l],g=new Set(d).size;this.addFieldLength(u,f,this._documentCount-1,g);for(let m of d){let p=r(m,l);if(Array.isArray(p))for(let w of p)this.addTerm(f,u,w);else p&&this.addTerm(f,u,p)}}}addAll(e){for(let n of e)this.add(n)}addAllAsync(e,n={}){let{chunkSize:i=10}=n,s={chunk:[],promise:Promise.resolve()},{chunk:r,promise:o}=e.reduce(({chunk:a,promise:c},u,l)=>(a.push(u),(l+1)%i===0?{chunk:[],promise:c.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(a))}:{chunk:a,promise:c}),s);return o.then(()=>this.addAll(r))}remove(e){let{tokenize:n,processTerm:i,extractField:s,stringifyField:r,fields:o,idField:a}=this._options,c=s(e,a);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${a}"`);let u=this._idToShortId.get(c);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let l of o){let h=s(e,l);if(h==null)continue;let d=n(r(h,l),l),f=this._fieldIds[l],g=new Set(d).size;this.removeFieldLength(u,f,this._documentCount,g);for(let m of d){let p=i(m,l);if(Array.isArray(p))for(let w of p)this.removeTerm(f,u,w);else p&&this.removeTerm(f,u,p)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(c),this._fieldLength.delete(u),this._documentCount-=1}removeAll(e){if(e)for(let n of e)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new R,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 n=this._idToShortId.get(e);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((i,s)=>{this.removeFieldLength(n,s,this._documentCount,i)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:n,batchSize:i,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:i,batchWait:s},{minDirtCount:n,minDirtFactor:e})}discardAll(e){let n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let i of e)this.discard(i)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(e){let{idField:n,extractField:i}=this._options,s=i(e,n);this.discard(s),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let i=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=he,this.performVacuuming(e,i)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,n){let i=this._dirtCount;if(this.vacuumConditionsMet(n)){let s=e.batchSize||de.batchSize,r=e.batchWait||de.batchWait,o=1;for(let[a,c]of this._index){for(let[u,l]of c)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?c.delete(u):l.delete(h));this._index.get(a).size===0&&this._index.delete(a),o%s===0&&await new Promise(u=>setTimeout(u,r)),o+=1}this._dirtCount-=i}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:n,minDirtFactor:i}=e;return n=n||ue.minDirtCount,i=i||ue.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=i}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 n=this._idToShortId.get(e);if(n!=null)return this._storedFields.get(n)}search(e,n={}){let{searchOptions:i}=this._options,s={...i,...n},r=this.executeQuery(e,n),o=[];for(let[a,{score:c,terms:u,match:l}]of r){let h=u.length||1,d={id:this._documentIds.get(a),score:c*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(a)),(s.filter==null||s.filter(d))&&o.push(d)}return e===t.wildcard&&s.boostDocument==null||o.sort(Pe),o}autoSuggest(e,n={}){n={...this._options.autoSuggestOptions,...n};let i=new Map;for(let{score:r,terms:o}of this.search(e,n)){let a=o.join(" "),c=i.get(a);c!=null?(c.score+=r,c.count+=1):i.set(a,{score:r,terms:o,count:1})}let s=[];for(let[r,{score:o,terms:a,count:c}]of i)s.push({suggestion:r,terms:a,score:o/c});return s.sort(Pe),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),n)}static async loadJSONAsync(e,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),n)}static getDefault(e){if(ce.hasOwnProperty(e))return ae(ce,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:o,serializationVersion:a}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=G(s),c._fieldLength=G(r),c._storedFields=G(o);for(let[u,l]of c._documentIds)c._idToShortId.set(l,u);for(let[u,l]of i){let h=new Map;for(let d of Object.keys(l)){let f=l[d];a===1&&(f=f.ds),h.set(parseInt(d,10),G(f))}c._index.set(u,h)}return c}static async loadJSAsync(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:o,serializationVersion:a}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=await q(s),c._fieldLength=await q(r),c._storedFields=await q(o);for(let[l,h]of c._documentIds)c._idToShortId.set(h,l);let u=0;for(let[l,h]of i){let d=new Map;for(let f of Object.keys(h)){let g=h[f];a===1&&(g=g.ds),d.set(parseInt(f,10),await q(g))}++u%1e3===0&&await Je(0),c._index.set(l,d)}return c}static instantiateMiniSearch(e,n){let{documentCount:i,nextId:s,fieldIds:r,averageFieldLength:o,dirtCount:a,serializationVersion:c}=e;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new t(n);return u._documentCount=i,u._nextId=s,u._idToShortId=new Map,u._fieldIds=r,u._avgFieldLength=o,u._dirtCount=a||0,u._index=new R,u}executeQuery(e,n={}){if(e===t.wildcard)return this.executeWildcardQuery(n);if(typeof e!="string"){let d={...n,...e,queries:void 0},f=e.queries.map(g=>this.executeQuery(g,d));return this.combineResults(f,d.combineWith)}let{tokenize:i,processTerm:s,searchOptions:r}=this._options,o={tokenize:i,processTerm:s,...r,...n},{tokenize:a,processTerm:c}=o,h=a(e).flatMap(d=>c(d)).filter(d=>!!d).map(Pt(o)).map(d=>this.executeQuerySpec(d,o));return this.combineResults(h,o.combineWith)}executeQuerySpec(e,n){let i={...this._options.searchOptions,...n},s=(i.fields||this._options.fields).reduce((m,p)=>({...m,[p]:ae(i.boost,p)||1}),{}),{boostDocument:r,weights:o,maxFuzzy:a,bm25:c}=i,{fuzzy:u,prefix:l}={...Re.weights,...o},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,s,r,c),f,g;if(e.prefix&&(f=this._index.atPrefix(e.term)),e.fuzzy){let m=e.fuzzy===!0?.2:e.fuzzy,p=m<1?Math.min(a,Math.round(e.term.length*m)):m;p&&(g=this._index.fuzzyGet(e.term,p))}if(f)for(let[m,p]of f){let w=m.length-e.term.length;if(!w)continue;g?.delete(m);let S=l*m.length/(m.length+.3*w);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,d)}if(g)for(let m of g.keys()){let[p,w]=g.get(m);if(!w)continue;let S=u*m.length/(m.length+w);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,d)}return d}executeWildcardQuery(e){let n=new Map,i={...this._options.searchOptions,...e};for(let[s,r]of this._documentIds){let o=i.boostDocument?i.boostDocument(r,"",this._storedFields.get(s)):1;n.set(s,{score:o,terms:[],match:{}})}return n}combineResults(e,n=pe){if(e.length===0)return new Map;let i=n.toLowerCase(),s=Dt[i];if(!s)throw new Error(`Invalid combination operator: ${n}`);return e.reduce(s)||new Map}toJSON(){let e=[];for(let[n,i]of this._index){let s={};for(let[r,o]of i)s[r]=Object.fromEntries(o);e.push([n,s])}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,n,i,s,r,o,a,c,u=new Map){if(r==null)return u;for(let l of Object.keys(o)){let h=o[l],d=this._fieldIds[l],f=r.get(d);if(f==null)continue;let g=f.size,m=this._avgFieldLength[d];for(let p of f.keys()){if(!this._documentIds.has(p)){this.removeTerm(d,p,n),g-=1;continue}let w=a?a(this._documentIds.get(p),n,this._storedFields.get(p)):1;if(!w)continue;let S=f.get(p),ie=this._fieldLength.get(p)[d],se=Vt(S,g,this._documentCount,ie,m,c),U=i*s*h*w*se,T=u.get(p);if(T){T.score+=U,Nt(T.terms,e);let j=ae(T.match,n);j?j.push(l):T.match[n]=[l]}else u.set(p,{score:U,terms:[e],match:{[n]:[l]}})}}return u}addTerm(e,n,i){let s=this._index.fetch(i,Be),r=s.get(e);if(r==null)r=new Map,r.set(n,1),s.set(e,r);else{let o=r.get(n);r.set(n,(o||0)+1)}}removeTerm(e,n,i){if(!this._index.has(i)){this.warnDocumentChanged(n,e,i);return}let s=this._index.fetch(i,Be),r=s.get(e);r==null||r.get(n)==null?this.warnDocumentChanged(n,e,i):r.get(n)<=1?r.size<=1?s.delete(e):r.delete(n):r.set(n,r.get(n)-1),this._index.get(i).size===0&&this._index.delete(i)}warnDocumentChanged(e,n,i){for(let s of Object.keys(this._fieldIds))if(this._fieldIds[s]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${i}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let n=this._nextId;return this._idToShortId.set(e,n),this._documentIds.set(n,e),this._documentCount+=1,this._nextId+=1,n}addFields(e){for(let n=0;n<e.length;n++)this._fieldIds[e[n]]=n}addFieldLength(e,n,i,s){let r=this._fieldLength.get(e);r==null&&this._fieldLength.set(e,r=[]),r[n]=s;let a=(this._avgFieldLength[n]||0)*i+s;this._avgFieldLength[n]=a/(i+1)}removeFieldLength(e,n,i,s){if(i===1){this._avgFieldLength[n]=0;return}let r=this._avgFieldLength[n]*i-s;this._avgFieldLength[n]=r/(i-1)}saveStoredFields(e,n){let{storeFields:i,extractField:s}=this._options;if(i==null||i.length===0)return;let r=this._storedFields.get(e);r==null&&this._storedFields.set(e,r={});for(let o of i){let a=s(n,o);a!==void 0&&(r[o]=a)}}};z.wildcard=Symbol("*");var ae=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,Dt={[pe]:(t,e)=>{for(let n of e.keys()){let i=t.get(n);if(i==null)t.set(n,e.get(n));else{let{score:s,terms:r,match:o}=e.get(n);i.score=i.score+s,i.match=Object.assign(i.match,o),Ve(i.terms,r)}}return t},[qe]:(t,e)=>{let n=new Map;for(let i of e.keys()){let s=t.get(i);if(s==null)continue;let{score:r,terms:o,match:a}=e.get(i);Ve(s.terms,o),n.set(i,{score:s.score+r,terms:s.terms,match:Object.assign(s.match,a)})}return n},[jt]:(t,e)=>{for(let n of e.keys())t.delete(n);return t}},Rt={k:1.2,b:.7,d:.5},Vt=(t,e,n,i,s,r)=>{let{k:o,b:a,d:c}=r;return Math.log(1+(n-e+.5)/(e+.5))*(c+t*(o+1)/(t+o*(1-a+a*i/s)))},Pt=t=>(e,n,i)=>{let s=typeof t.fuzzy=="function"?t.fuzzy(e,n,i):t.fuzzy||!1,r=typeof t.prefix=="function"?t.prefix(e,n,i):t.prefix===!0,o=typeof t.boostTerm=="function"?t.boostTerm(e,n,i):1;return{term:e,fuzzy:s,prefix:r,termBoost:o}},ce={idField:"id",extractField:(t,e)=>t[e],stringifyField:(t,e)=>t.toString(),tokenize:t=>t.split(kt),processTerm:t=>t.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(t,e)=>{typeof console?.[t]=="function"&&console[t](e)},autoVacuum:!0},Re={combineWith:pe,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Rt},Bt={combineWith:qe,prefix:(t,e,n)=>e===n.length-1},de={batchSize:1e3,batchWait:10},he={minDirtFactor:.1,minDirtCount:20},ue={...de,...he},Nt=(t,e)=>{t.includes(e)||t.push(e)},Ve=(t,e)=>{for(let n of e)t.includes(n)||t.push(n)},Pe=({score:t},{score:e})=>e-t,Be=()=>new Map,G=t=>{let e=new Map;for(let n of Object.keys(t))e.set(parseInt(n,10),t[n]);return e},q=async t=>{let e=new Map,n=0;for(let i of Object.keys(t))e.set(parseInt(i,10),t[i]),++n%1e3===0&&await Je(0);return e},Je=t=>new Promise(e=>setTimeout(e,t)),kt=/[\n\r\p{Z}\p{P}]+/u;var Ot=Ft(It(),1);import{z as y}from"zod";var W,ne,Ct,Tt=class{constructor(e){re(this,ne);$(this,"mapData");$(this,"indexes");$(this,"ready");re(this,W);this.mapData=e,this.indexes=Ri(e),this.ready=this.populate(),Ce(this,W,Fe(Ae(this,ne,Ct).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:n,enterpriseCategories:i}=this.indexes,s=this.mapData,r=[];return e.removeAll(),r=r.concat([e.addAllAsync(s.getByType("space")),e.addAllAsync(s.getByType("point-of-interest")),e.addAllAsync(s.getByType("object")),e.addAllAsync(s.getByType("connection")),e.addAllAsync(s.getByType("floor")),e.addAllAsync(s.getByType("door")),e.addAllAsync(s.getByType("annotation")),e.addAllAsync(s.getByType("area"))]),n&&(n?.removeAll(),r.push(n.addAllAsync(s.getByType("enterprise-location")))),i&&(i?.removeAll(),r.push(i.addAllAsync(s.getByType("enterprise-category")))),Promise.all(r)}async search(e,n={}){await this.ready,Vi.parse(n);let i=(0,Ot.default)({},n,Di),s=this.indexes.places.search(e,{fields:Object.keys(i.places.fields).filter(c=>i.places.fields[c])});i.places.limit&&(s=s.slice(0,i.places.limit));let r=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(i.enterpriseLocations.fields).filter(c=>i.enterpriseLocations.fields[c])});r&&i.enterpriseLocations.limit&&(r=r.slice(0,i.enterpriseLocations.limit));let o=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(i.enterpriseCategories.fields).filter(c=>i.enterpriseCategories.fields[c])});o&&i.enterpriseCategories.limit&&(o=o.slice(0,i.enterpriseCategories.limit));let a=ji(this.mapData,{placesResult:s,locationsResult:r,categoriesResult:o});return Oe(this,W).call(this,e),a}async suggest(e,n={}){await this.ready,Pi.parse(n);let i=[],{places:{enabled:s=!0}={},enterpriseLocations:{enabled:r=!0}={}}=n;return r&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(o=>i.push(o)),s&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(o=>i.push(o)),i.sort((o,a)=>a.score-o.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:i.map(o=>o.suggestion)}),i}};W=new WeakMap,ne=new WeakSet,Ct=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function ji(t,{placesResult:e,locationsResult:n,categoriesResult:i}){let s=e.reduce((a,{id:c,match:u,score:l,__type:h})=>{let d=t.getById(h,c);return d!=null&&!Me.is(d)&&!Le.is(d)&&!Ee.is(d)&&!je.is(d)&&!De.is(d)&&a.push({type:d.__type,match:u,score:l,item:d}),a},[]),r;if(n){r=[];for(let{id:a,match:c,score:u}of n){let l=t.getById("enterprise-location",a);l&&r.push({type:l.__type,match:c,score:u,item:l})}}let o;if(i){o=[];for(let{id:a,match:c,score:u}of i){let l=t.getById("enterprise-category",a);l&&o.push({type:l.__type,match:c,score:u,item:l})}}return{places:s,enterpriseLocations:r,enterpriseCategories:o}}var Di={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function ze(t){return t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ri(t){let e=new z({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(o,a)=>{let c=o[a];return typeof c=="string"?ze(c):o[a]},processTerm:o=>Bi.has(o)?"":o.toLowerCase()}),n=t.getByType("enterprise-location"),i;n&&(i=new z({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(o,a)=>Array.isArray(o[a])?o[a].join(" "):typeof o[a]=="string"?ze(o[a]):o[a]}));let s=t.getByType("enterprise-category"),r;return s&&(r=new z({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(o,a){return a==="locations.name"?o.locations.reduce((u,l)=>u+` ${zt} `+l.name,"")+` ${zt}`:typeof o[a]=="string"?ze(o[a]):o[a]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:r,enterpriseLocations:i,places:e}}var Vi=y.object({places:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional()}).optional(),enterpriseCategories:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional(),"locations.name":y.boolean().optional()}).optional(),limit:y.number().positive().optional()}).optional(),enterpriseLocations:y.object({fields:y.object({name:y.boolean().optional(),tags:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional()}).optional()}),Pi=y.object({places:y.object({enabled:y.boolean().optional()}).optional(),enterpriseLocations:y.object({enabled:y.boolean().optional()}).optional()}),Bi=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),zt="";export{Tt as InternalSearch,ze as removeAccents};
2
+ //# sourceMappingURL=internal-3J7P44P6.js.map
@@ -1,4 +1,4 @@
1
- import{Ca as wn,Ua as Me}from"./chunk-C5ID5LHV.js";import"./chunk-RIFXMIJM.js";import{Ia as Yt,J as vn,L as _r,M as ot,N as pn,Oa as kn,Pa as _n,Q as gn,R as Ur,U as Xe,V as Sr,W as mn,X as Ft,_ as Mt,a as Ie,aa as yn,b as Ke,cb as Un,da as At,fa as bn,g as Tr,jb as Sn,o as kr,pa as xn,ra as Tn,s as cn,t as hn,z as dn}from"./chunk-DBCMQGTD.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{Ca as wn,Ua as Me}from"./chunk-BXSPZW2B.js";import"./chunk-DERUYKVE.js";import{Ia as Yt,J as vn,L as _r,M as ot,N as pn,Oa as kn,Pa as _n,Q as gn,R as Ur,U as Xe,V as Sr,W as mn,X as Ft,_ as Mt,a as Ie,aa as yn,b as Ke,cb as Un,da as At,fa as bn,g as Tr,jb as Sn,o as kr,pa as xn,ra as Tn,s as cn,t as hn,z as dn}from"./chunk-PH2HNHTP.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-FUGEPZHU.js.map
253
+ //# sourceMappingURL=text3d-IKFLZKII.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/mappedin-js",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "homepage": "https://developer.mappedin.com/",
5
5
  "private": false,
6
6
  "main": "lib/esm/index.js",
@@ -15,7 +15,9 @@
15
15
  "THIRD_PARTY_LICENSES.txt"
16
16
  ],
17
17
  "license": "SEE LICENSE IN LICENSE.txt",
18
- "dependencies": {},
18
+ "dependencies": {
19
+ "zod": "^4.0.0"
20
+ },
19
21
  "devDependencies": {},
20
22
  "volta": {
21
23
  "extends": "../../package.json"