@mappedin/mappedin-js 6.4.0 → 6.6.0
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/THIRD_PARTY_LICENSES.txt +31 -0
- package/lib/esm/{GLTFExporter-4HV63LGP.js → GLTFExporter-RQ4X3IWO.js} +1 -1
- package/lib/esm/GLTFLoader-VJHWNKS5.js +1 -0
- package/lib/esm/chunk-6SFEDLKY.js +1 -0
- package/lib/esm/chunk-CJ52KBIE.js +1 -0
- package/lib/esm/chunk-D53OXR7Z.js +1 -0
- package/lib/esm/{chunk-URGM6RST.js → chunk-RJF4TTOJ.js} +1 -1
- package/lib/esm/index.d.ts +310 -40
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-X3O45PWP.js +1 -0
- package/lib/esm/{internal-44KLJOB5.js → internal-YSYMTO44.js} +1 -1
- package/lib/esm/{text3d-RWSGYTTK.js → text3d-24KWRIMN.js} +1 -1
- package/package.json +1 -1
- package/lib/esm/GLTFLoader-HV7RBR5X.js +0 -1
- package/lib/esm/chunk-62AZLR6O.js +0 -1
- package/lib/esm/chunk-DXHWFRA5.js +0 -1
- package/lib/esm/chunk-GYYVZ4IB.js +0 -1
- package/lib/esm/inspector-J33EC64M.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as se,J as X,K as ae,h as H,q as S,r as B}from"./chunk-D53OXR7Z.js";import{y as D}from"./chunk-CJ52KBIE.js";import"./chunk-RJF4TTOJ.js";import{$ as re,a as v}from"./chunk-6SFEDLKY.js";import{a as $,b as z,i as I}from"./chunk-5W2UDR4H.js";v();v();v();v();var L=class n{constructor(e,i,t,r,a="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(a),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id="lil-gui-name-".concat(++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",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.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)}},K=class extends L{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 W(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:W,toHexString:W},T={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},we={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=T.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 r=n*t<<16^e*t<<8^i*t<<0;return T.toHexString(r)}},Ee={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=T.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 r=n*t<<16^e*t<<8^i*t<<0;return T.toHexString(r)}},Me=[_e,T,we,Ee];function ke(n){return Me.find(e=>e.match(n))}var V=class extends L{constructor(e,i,t,r){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=ke(this.initialValue),this._rgbScale=r,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 a=W(this.$text.value);a&&this._setValueFromHexString(a)}),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 L{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",r=>{r.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},Z=class extends L{constructor(e,i,t,r,a,l){super(e,i,t,"number"),this._initInput(),this.min(r),this.max(a);let o=l!==void 0;this.step(o?l:this._getImplicitStep(),o),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 b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},t=b=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+b),this.$input.value=this.getValue())},r=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b)*-1))},a=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,o,d,u,c,s,h=5,p=b=>{o=b.clientX,d=u=b.clientY,l=!0,c=this.getValue(),s=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let C=b.clientX-o,k=b.clientY-d;Math.abs(k)>h?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>h&&m()}if(!l){let C=b.clientY-u;s-=C*this._step*this._arrowKeyMultiplier(b),c+s>this._max?s=this._max-c:c+s<this._min&&(s=this._min-c),this._snapClampSetValue(c+s)}u=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m)},y=()=>{this._inputFocused=!0},f=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",r),this.$input.addEventListener("wheel",a,{passive:!1}),this.$input.addEventListener("mousedown",p),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",f)}_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=(f,b,C,k,w)=>(f-b)/(C-b)*(w-k)+k,i=f=>{let b=this.$slider.getBoundingClientRect(),C=e(f,b.left,b.right,this._min,this._max);this._snapClampSetValue(C)},t=f=>{this._setDraggingStyle(!0),i(f.clientX),window.addEventListener("mousemove",r),window.addEventListener("mouseup",a)},r=f=>{i(f.clientX)},a=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",a)},l=!1,o,d,u=f=>{f.preventDefault(),this._setDraggingStyle(!0),i(f.touches[0].clientX),l=!1},c=f=>{f.touches.length>1||(this._hasScrollBar?(o=f.touches[0].clientX,d=f.touches[0].clientY,l=!0):u(f),window.addEventListener("touchmove",s,{passive:!1}),window.addEventListener("touchend",h))},s=f=>{if(l){let b=f.touches[0].clientX-o,C=f.touches[0].clientY-d;Math.abs(b)>Math.abs(C)?u(f):(window.removeEventListener("touchmove",s),window.removeEventListener("touchend",h))}else f.preventDefault(),i(f.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",s),window.removeEventListener("touchend",h)},p=this._callOnFinishChange.bind(this),g=400,m,y=f=>{if(Math.abs(f.deltaX)<Math.abs(f.deltaY)&&this._hasScrollBar)return;f.preventDefault();let C=this._normalizeMouseWheel(f)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(p,g)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",y,{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-".concat(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 L{constructor(e,i,t,r){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(r)}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}},q=class extends L{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",r=>{r.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}},Le='.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n background: var(--background-color);\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "\u2195";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "\u25BE";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "\u25B8";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui label, .lil-gui input, .lil-gui button {\n -webkit-tap-highlight-color: transparent;\n}\n.lil-gui input {\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n -moz-appearance: textfield;\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "\u2713";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: none;\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n }\n .lil-gui button:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}';function $e(n){let e=document.createElement("style");e.innerHTML=n;let i=document.querySelector("head link[rel=stylesheet], head style");i?document.head.insertBefore(e,i):document.head.appendChild(e)}var le=!1,ee=class n{constructor({parent:e,autoPlace:i=e===void 0,container:t,width:r,title:a="Controls",closeFolders:l=!1,injectStyles:o=!0,touchStyles:d=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(a),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),d&&this.domElement.classList.add("allow-touch-styles"),!le&&o&&($e(Le),le=!0),t?t.appendChild(this.domElement):i&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=l}add(e,i,t,r,a){if(Object(t)===t)return new Q(this,e,i,t);let l=e[i];switch(typeof l){case"number":return new Z(this,e,i,t,r,a);case"boolean":return new K(this,e,i);case"string":return new q(this,e,i);case"function":return new F(this,e,i)}console.error("gui.add failed\n property:",i,"\n object:",e,"\n value:",l)}addColor(e,i,t=1){return new V(this,e,i,t)}addFolder(e){let i=new n({parent:this,title:e});return this.root._closeFolders&&i.close(),i}load(e,i=!0){return e.controllers&&this.controllers.forEach(t=>{t instanceof F||t._name in e.controllers&&t.load(e.controllers[t._name])}),i&&e.folders&&this.folders.forEach(t=>{t._title in e.folders&&t.load(e.folders[t._title])}),this}save(e=!0){let i={controllers:{},folders:{}};return this.controllers.forEach(t=>{if(!(t instanceof F)){if(t._name in i.controllers)throw new Error('Cannot save GUI with duplicate property "'.concat(t._name,'"'));i.controllers[t._name]=t.save()}}),e&&this.folders.forEach(t=>{if(t._title in i.folders)throw new Error('Cannot save GUI with duplicate folder "'.concat(t._title,'"'));i.folders[t._title]=t.save()}),i}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let i=this.$children.clientHeight;this.$children.style.height=i+"px",this.domElement.classList.add("transition");let t=a=>{a.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",t))};this.$children.addEventListener("transitionend",t);let r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=r+"px"})}),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(t=>t.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(i=>{e=e.concat(i.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(i=>{e=e.concat(i.foldersRecursive())}),e}},G=ee;v();v();var E=(()=>{let n=new re;return function(i){return n.set(i),"#".concat(n.getHexString())}})();function de(n){let e;for(e of n)e()}var Ie=["interactive"];function U(n,e,i){var a,l;let t={id:e.id,__type:e.__type},r=i.addFolder("".concat(e.type,"-").concat(e.id));for(let o in e){if(o==="visible"&&r.add(e,o).onChange(d=>{n.updateState(t,{[o]:d})}),o==="color"||o==="hoverColor"){e[o]=E(e[o]),r.addColor(e,o).onChange(d=>{n.updateState(t,{[o]:d})});continue}if(o==="height"){r.add(e,o,0,20,1).onChange(d=>{n.updateState(t,{[o]:d})});continue}if(o==="texture"&&e.texture){(a=r.addFolder("Texture - side").add(e,"texture"))==null||a.onChange(u=>{n.updateState(t,{texture:{url:u}})});continue}if(o==="topTexture"&&e.topTexture){(l=r.addFolder("Texture - top").add(e,"topTexture"))==null||l.onChange(u=>{n.updateState(t,{topTexture:{url:u}})});continue}if(o==="opacity"){r.add(e,o,0,1,.1).onChange(d=>{n.updateState(t,{[o]:d})});continue}if(o==="altitude"){r.add(e,o,0,100,1).onChange(d=>{n.updateState(t,{[o]:d})});continue}Ie.includes(o)&&r.add(e,o).onChange(d=>{n.updateState(t,{[o]:d})})}return e.isInView&&(r.add(e,"isInView").listen().disable(),r.add(e,"isInViewCheck")),{cleanup(){r.destroy()}}}v();v();function Se(){let n=[];function e(r,a){var d;let l=Object.values(r.getMapData())[0],o=a;if(o&&H.is(o)){let u=(d=l.getByType("enterprise-location"))==null?void 0:d.find(c=>c.spaces.some(s=>s.id===o.id));u&&(o=u)}return o}async function i(r,a){return a instanceof B?r.Camera.focusOn(a.locations.flatMap(l=>l.spaces),O):a instanceof S?r.Camera.focusOn(a.spaces,O):r.Camera.focusOn(a,O)}function t(r,a,{focus:l=!1}={}){if(!window.enableHighlightCard)return()=>{};let o=e(r,a),d=document.createElement("div");if(d.style.cssText="\n position: absolute;\n top: 20px;\n left: 20px;\n background-color: rgba(30, 30, 30, 0.95);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n border-radius: 12px;\n padding: 24px;\n max-width: 320px;\n z-index: 1000;\n font-family: 'Arial', sans-serif;\n transition: all 0.3s ease;\n color: #e0e0e0;\n ","name"in o){let c=document.createElement("h3");c.textContent=o.name,c.style.cssText="\n margin: 0 0 16px;\n font-size: 22px;\n font-weight: 600;\n color: #ffffff;\n letter-spacing: -0.5px;\n ",d.appendChild(c)}if(o instanceof S){if(o.description){let c=document.createElement("p");c.textContent=o.description,c.style.cssText="\n margin: 0 0 16px;\n font-size: 14px;\n color: #b0b0b0;\n line-height: 1.5;\n ",d.appendChild(c)}if(o.tags&&o.tags.length>0){let c=document.createElement("div");c.style.cssText="\n display: flex;\n flex-wrap: nowrap;\n gap: 8px;\n margin-bottom: 16px;\n overflow-x: hidden;\n max-height: 30px; /* Adjust this value based on your font size and padding */\n ",o.tags.forEach(s=>{let h=document.createElement("span");h.textContent=s,h.style.cssText="\n background-color: #3a3a3a;\n color: #e0e0e0;\n padding: 6px 12px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n white-space: nowrap;\n ",c.appendChild(h)}),d.appendChild(c)}}let u;if(!(a instanceof B)){let c=new G({autoPlace:!1});c.domElement.style.cssText="\n position: relative;\n overflow-y: auto;\n margin-top: 16px;\n border-top: 1px solid #444;\n padding-top: 16px;\n ";let s=r.getState(a);s&&(U(r,$({id:a.id},s),c),d.appendChild(c.domElement)),u=c}return document.body.appendChild(d),l&&i(r,o),()=>{d.style.opacity="0",d.style.transform="translateY(-10px)",setTimeout(()=>d.remove(),300),u==null||u.destroy()}}return{highlightCard:t,highlight:(r,a,{focus:l=!0}={})=>{n.length>0&&n.forEach(d=>r.Markers.remove(d));let o=e(r,a);if(o instanceof S)l&&r.Camera.focusOn(o.spaces,O),n.push(...o.spaces.map(d=>r.Markers.add(d,'<div style="padding: 15px; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); max-width: 250px; position: relative;">\n <h3 style="margin: 0 0 10px; color: #333; font-size: 16px; font-weight: 600;">'.concat(o.name,"</h3>\n ").concat(o.description?'<p style="margin: 0 0 10px; color: #666; font-size: 14px; font-weight: 400;">'.concat(o.description,"</p>"):"","\n ").concat(o.tags?o.tags.map(u=>'<span style="display: inline-block; padding: 3px 8px; background-color: #e0f2f1; color: #00796b; border-radius: 12px; font-size: 12px;">'.concat(u,"</span>")).join(" "):"",'\n <div style="position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #ffffff;"></div>\n </div>'),{rank:"always-visible",placement:"top"})));else if(o instanceof B){l&&r.Camera.focusOn(o.locations.flatMap(c=>c.spaces),O);let d=new Map,u=new Set;o.locations.forEach(c=>{d.has(c.name)||(c.spaces.forEach(s=>{n.push(r.Markers.add(s,'<div style="padding: 12px; background-color: rgba(0, 153, 51, 0.95); border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); transform: translateY(-4px); transition: all 0.3s ease;">\n <span style="font-weight: 600; color: #FFFFFF; font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">'.concat(c.name,"</span>\n </div>"),{rank:"always-visible"}))}),d.set(c.name,!0))}),o.locations.forEach(c=>{c.coordinates.forEach(s=>{let h="".concat(s.latitude,",").concat(s.longitude);if(!u.has(h)&&!d.has(c.name)){let p=r.Markers.add(s,'<div style="padding: 10px; background-color: rgba(51, 102, 204, 0.9); border-radius: 6px; box-shadow: 0 3px 6px rgba(0,0,0,0.2);">\n <span style="font-weight: 500; color: #FFFFFF; font-size: 16px;">'.concat(c.name,'</span>\n <br>\n <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>\n </div>'),{rank:"always-visible"});u.add(h),n.push(p)}})})}return()=>{n.forEach(d=>r.Markers.remove(d))}}}}var O={duration:300,easing:"ease-in-out"},R=Se();v();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){var c;let t=new D,r=i.addFolder("Search");r.open();let a=r.add(_,"search").onChange(async s=>{let h=await e.Search.query(s,_.options);h&&(_.results=h,o(h,t))}),l=document.createElement("div");l.style.marginLeft="10px",(c=a.domElement.parentElement)==null||c.appendChild(l);let{renderSearch:o,close:d}=Fe(n,e,l,a.$input),u=r.addFolder("Advanced");return u.close(),De(u),document.addEventListener("keydown",s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"?(s.preventDefault(),r._closed&&r.open(),a.$input.focus()):s.key==="Escape"&&(d(),t.publish("highlight",void 0))}),{pubsub:t}}function Fe(n,e,i,t){let r,a;t.addEventListener("input",async o=>{o instanceof InputEvent&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")&&(clearTimeout(r),r=setTimeout(async()=>{var u;let d=await e.Search.suggest(t.value);d&&d.length>0&&l((u=d[0])==null?void 0:u.suggestion)},100))});function l(o){if(!o){t.placeholder="";return}let d=t.value;t.value=o,t.setSelectionRange(d.length,o.length)}return{renderSearch(o,d){var u,c;if(o.places.length===0&&((u=o.enterpriseCategories)==null?void 0:u.length)===0&&((c=o.enterpriseLocations)==null?void 0:c.length)===0){i.textContent="No results found.";return}a=Te(i,o,n,d)},close(){a.destroy()}}}function Te(n,e,i,t){n.innerHTML="";let r=document.createElement("div");Object.assign(r.style,N.dropdownContainer);let a=document.createElement("ul");a.className="options-list",Object.assign(a.style,N.optionsList),a.style.display="block";let l=[],o=(h,p)=>{if(p&&p.length>0){let g=document.createElement("li");g.textContent=h,Object.assign(g.style,N.sectionHeader),a.appendChild(g),p.forEach((m,y)=>{let f=document.createElement("li");f.textContent="".concat("name"in m.item?m.item.name:""," (").concat(m.type,")"),Object.assign(f.style,N.option),f.tabIndex=0,f.addEventListener("focus",()=>{u(l.indexOf(f))}),f.addEventListener("mouseover",()=>{f.style.backgroundColor="#f0f0f0"}),f.addEventListener("mouseout",()=>{f.style.backgroundColor=""}),f.addEventListener("click",()=>{}),f.setAttribute("data-type",h),f.setAttribute("data-index",y.toString()),a.appendChild(f),l.push(f)})}};o("enterpriseLocations",e.enterpriseLocations),o("enterpriseCategories",e.enterpriseCategories),o("Places",e.places),r.appendChild(a),n.appendChild(r);let d=[],u=h=>{d.forEach(f=>f()),d=[],l.forEach((f,b)=>{b===h?f.style.backgroundColor="#e0e0e0":f.style.backgroundColor=""});let p=l[h],g=p.getAttribute("data-type"),m=parseInt(p.getAttribute("data-index")||"0",10);if(!g)return;let{item:y}=e[g.toLowerCase()][m];t.publish("highlight",y)},c=h=>{!r.contains(h.target)&&h.target!==n&&s()};document.addEventListener("click",c);let s=()=>{n.innerHTML="",document.removeEventListener("click",c)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var N={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:r}=ce(n,e,i);r.on("highlight",c=>{if(c){t.forEach(h=>h()),t=[];let s=c instanceof S?c.spaces[0]:c;if(n.Camera.focusOn(c),s&&!H.is(s))return;t.push(R.highlightCard(n,s,{focus:!0}))}else t.forEach(s=>s()),t=[]});let a=i.addFolder("Click \u{1F447}").close(),{sub:l}=Oe(n,a);l.on("click",c=>{var s;t.forEach(h=>h()),t=[],(s=c.spaces)!=null&&s[0]&&(t=[R.highlightCard(n,c.spaces[0])])});let o=i.addFolder("Hover \u{1F681}").close(),{sub:d}=Pe(n,o),u;d.on("hover",c=>{var s;(s=c.spaces)!=null&&s[0]?(u==null||u(),t.length===0&&(u=R.highlightCard(n,c.spaces[0]))):(u==null||u(),u=void 0)})}function Oe(n,e){let i=new D,t={position:"",hoverColor:E(n.getHoverColor())},r=e.add(t,"position").disable(),a=[];function l(){a.forEach(d=>d()),a.length=0}let o=0;return n.on("click",d=>{var p,g,m;let{labels:u,coordinate:c}=d;l(),i.publish("click",d),clearInterval(o),r.load(JSON.stringify([c.longitude,c.latitude]));let s=u==null?void 0:u[0];if(s!=null){let y=P(n,s,e);if(!y)return;a.push(y.destroy),y.labelItemFolder.openAnimated()}let h=(m=(p=d.spaces)==null?void 0:p[0])!=null?m:(g=d.objects)==null?void 0:g[0];if(h){let y=z($($({},h),n.getState(h)),{isInView:!1,isInViewCheck:j(n,h.id)}),{cleanup:f}=U(n,y,e);o=setInterval(()=>{y.isInView=n.isInView(s||h)},500),a.push(f)}}),{sub:i}}function Pe(n,e){let i=new D;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},r=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(o=>{n.setHoverColor(o)});let a=[];function l(){a.forEach(o=>o()),a.length=0}return n.on("hover",o=>{var m,y,f;let{coordinate:d,spaces:u,objects:c,markers:s,labels:h}=o;l(),i.publish("hover",o),r.load(JSON.stringify([d.longitude,d.latitude]));let p=(f=(y=(m=u==null?void 0:u[0])!=null?m:c==null?void 0:c[0])!=null?y:s==null?void 0:s[0])!=null?f:h==null?void 0:h[0];if(!p)return;let g=n.getState(p);g&&(t.type=g.type,t.id=p.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(p=>{this.labels[p.id]=p}),d()},removeAllLabels(){i.Labels.removeAll().forEach(p=>{delete this.labels[p.id]}),d()}},{addLabel:r,destroy:a}=Be(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let o=new Map,{rerender:d}=u();function u(){function h(m){var y;delete t.labels[m.id],(y=o.get(m.id))==null||y.destroy()}function p(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:f}=y;o.set(m.id,f)}function g(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let y=t.labels[m];p(y)}}return{rerender:g,add:p,remove:h}}n.domElement.classList.add("list-items");let c;i.on("click",({labels:h,coordinate:p})=>{if(!n._closed)if(h!=null&&h[0]){c==null||c.close();let g=o.get(h[0].id);if(n.open(),!g)return;g==null||g.open(),g==null||g.domElement.scrollIntoView({block:"start"}),g==null||g.domElement.focus(),c=g}else r(p)});function s(h){for(let p of h)t.labels[p.id]=p;d()}return{populatelabels:s,destroy(){a()}}}function ze(n,e,i,t,r){var m,y,f;let{interactive:a,enabled:l,rank:o,anchor:d,dynamicResize:u,zIndex:c,contentHTML:s,lowPriorityPin:h}=t;if(a==null||l==null)throw new Error("incomplete marker state");let p={interactive:a,enabled:l,rank:o||"medium",anchor:Array.isArray(d)?d.join(", "):d||"center",dynamicResize:u||!1,zIndex:c||0,contentHTML:s||"",lowPriorityPin:{enabled:(m=h==null?void 0:h.enabled)!=null?m:!0,size:(y=h==null?void 0:h.size)!=null?y:8,color:E((f=h==null?void 0:h.color)!=null?f:"#666")},remove(){n.Markers.remove(e),r==null||r(e),i.destroy()},isInView:j(n,e.id)};i.onChange(b=>{let C={interactive:p.interactive,enabled:p.enabled,rank:p.rank,dynamicResize:p.dynamicResize,contentHTML:p.contentHTML,lowPriorityPin:{enabled:p.lowPriorityPin.enabled,size:p.lowPriorityPin.size,color:p.lowPriorityPin.color}};p.rank==="always-visible"&&(C.zIndex=p.zIndex),n.updateState(e,C)}),i.add(p,"interactive"),i.add(p,"enabled"),i.add(p,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(p,"anchor").name("anchor (read-only)").disable(),i.add(p,"dynamicResize").name("dynamic resize"),p.rank==="always-visible"&&i.add(p,"zIndex",0,1e3,1).name("z-index"),i.add(p,"contentHTML").name("content HTML");let g=i.addFolder("Low Priority Pin");g.add(p.lowPriorityPin,"enabled"),g.add(p.lowPriorityPin,"size",1,20,1),g.addColor(p.lowPriorityPin,"color"),g.close(),i.add(p,"isInView"),i.add(p,"remove")}function He(n,e,i,t,r){let{appearance:a,interactive:l}=t;if(!a||a.margin==null||l==null)throw new Error("incomplte label state");let o={text:e.text,interactive:l,appearance:z($({},a),{margin:a.margin||0,pinColor:a.pinColor?E(a.pinColor):"black",textColor:a.textColor?E(a.textColor):"black"}),remove(){n.Labels.remove(e),r==null||r(e),i.destroy()},isInView:j(n,e.id)};i.onChange(d=>{n.updateState(e,{appearance:o.appearance,interactive:o.interactive})}),i.add(o.appearance,"margin",0,20).name("margin"),i.add(o,"text"),i.add(o,"interactive"),i.addColor(o.appearance,"pinColor").name("pin color"),i.addColor(o.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(o.appearance,"textColor").name("text color"),i.addColor(o.appearance,"textOutlineColor").name("text outline color"),i.add(o,"isInView"),i.add(o,"remove")}function P(n,e,i,{onRemove:t}={}){var o;let r=n.getState(e);if(!r)throw new Error("error getting state for entity: ".concat(e.id));let a=r.type===X?((o=e.text)==null?void 0:o.substring(0,12))||"Label":"Marker ".concat(e.id.toString().substring(0,8)),l=i.addFolder(a);if(l.close(),r.type===X)He(n,e,l,r,t);else if(r.type===ae)ze(n,e,l,r,t);else throw new Error("unsupported entity type: ".concat(r.type));return{labelItemFolder:l,destroy(){l.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(r){return i._closed||!t.onClick?void 0:e.Labels.add(r,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var pe={};v();function ge(n,e,i){var ne,oe;let t=n.addFolder("Camera \u{1F4F7}"),r=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(),[o,d,u,c]=(ne=i==null?void 0:i.padding)!=null?ne:[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],s={center_lat:r.latitude,center_lon:r.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i!=null&&i.padding?"pixel":e.Camera.screenOffsets.type,inset_top:o,inset_left:c,inset_right:d,inset_bottom:u,animateOnLoad:!0,visualizeInset:!!(o||d||u||c),"Focus on click":(oe=i==null?void 0:i.focusOnClick)!=null?oe:!1,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function h(){s.inset_type=e.Camera.screenOffsets.type,s.inset_left=e.Camera.screenOffsets.left,s.inset_top=e.Camera.screenOffsets.top,s.inset_right=e.Camera.screenOffsets.right,s.inset_bottom=e.Camera.screenOffsets.bottom;let{width:x,height:M}=l();s.inset_type==="portion"?Object.assign(a.style,{left:s.inset_left*x+"px",top:s.inset_top*M+"px",bottom:s.inset_bottom*M+"px",right:s.inset_right*x+"px"}):Object.assign(a.style,{left:s.inset_left+"px",top:s.inset_top+"px",bottom:s.inset_bottom+"px",right:s.inset_right+"px"})}t.add(s,"center_lat").listen().disable(),t.add(s,"center_lon").listen().disable(),t.add(s,"zoomLevel",16,22,.5).listen().disable(),t.add(s,"pitch").listen().disable(),t.add(s,"bearing").listen().disable(),t.add(s,"minZoomLevel",5,22,.5).onChange(x=>{e.Camera.setMinZoomLevel(x)}),t.add(s,"maxZoomLevel",10,22,.5).onChange(x=>{e.Camera.setMaxZoomLevel(x)}),t.add(s,"animateOnLoad"),t.add(s,"visualizeInset").onChange(ie),ie(s.visualizeInset);let p,g,m,y;function f(){let{width:x,height:M}=l(),Y=e.Camera.screenOffsets.type,J=s.inset_type;Y!==J&&(J==="portion"&&Y==="pixel"?(s.inset_top=x>0?Math.min(s.inset_top/M,1):0,s.inset_bottom=x>0?Math.min(s.inset_bottom/M,1):0,s.inset_left=M>0?Math.min(s.inset_left/x,1):0,s.inset_right=M>0?Math.min(s.inset_right/x,1):0):J==="pixel"&&Y==="portion"&&(s.inset_top=Math.round(s.inset_top*M),s.inset_bottom=Math.round(s.inset_bottom*M),s.inset_left=Math.round(s.inset_left*x),s.inset_right=Math.round(s.inset_right*x))),p&&p.destroy(),g&&g.destroy(),m&&m.destroy(),y&&y.destroy(),s.inset_type==="portion"?(p=t.add(s,"inset_top",0,1,.01).onChange(w),g=t.add(s,"inset_bottom",0,1,.01).onChange(w),m=t.add(s,"inset_left",0,1,.01).onChange(w),y=t.add(s,"inset_right",0,1,.01).onChange(w)):(p=t.add(s,"inset_top",0,M,1).onChange(w),g=t.add(s,"inset_bottom",0,M,1).onChange(w),m=t.add(s,"inset_left",0,x,1).onChange(w),y=t.add(s,"inset_right",0,x,1).onChange(w))}t.add(s,"inset_type",["pixel","portion"]).onChange(()=>{f(),w()}),f();let b=Ue(e);t.add(s,"Focus on click").onChange(x=>{x?e.on("click",b):e.off("click",b)}),s["Focus on click"]&&e.on("click",b),t.add(s,"Focus on current floor");let C=x=>{t._closed||(s.center_lat=x.center.latitude,s.center_lon=x.center.longitude,s.zoomLevel=x.zoomLevel,s.bearing=x.bearing,s.pitch=x.pitch)};e.on("camera-change",C);let k=[()=>{e.off("camera-change",C)}];function w(){e.Camera.setScreenOffsets({top:s.inset_top,left:s.inset_left,right:s.inset_right,bottom:s.inset_bottom,type:s.inset_type}),h()}(s.inset_top||s.inset_right||s.inset_bottom||s.inset_left)&&w();function ie(x){h(),x?a.style.display="block":a.style.display="none"}return()=>({destroy(){t.destroy(),de(k)}})}function Ue(n){return function(i){var l;let{spaces:t,objects:r}=i,a=(l=t==null?void 0:t[0])!=null?l:r==null?void 0:r[0];a&&n.Camera.focusOn(a)}}v();function fe(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(p=>{delete this.markers[p.id]}),d()}},{addMarker:r,destroy:a}=Re(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let o=new Map,{rerender:d}=u();function u(){function h(m){var y;delete t.markers[m.id],(y=o.get(m.id))==null||y.destroy()}function p(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:f}=y;o.set(m.id,f)}function g(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let y=t.markers[m];p(y)}}return{rerender:g,add:p,remove:h}}n.domElement.classList.add("list-items");let c;i.on("click",({markers:h,coordinate:p})=>{if(!n._closed)if(h!=null&&h[0]){c==null||c.close();let g=o.get(h[0].id);if(n.open(),!g)return;g==null||g.open(),g==null||g.domElement.scrollIntoView({block:"start"}),g==null||g.domElement.focus(),c=g}else r(p)});function s(h){for(let p of h)t.markers[p.id]=p;d()}return{populateMarkers:s,destroy(){a()}}}function Re(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 r=i.addFolder("Low Priority Pin");return r.add(t.lowPriorityPin,"enabled"),r.add(t.lowPriorityPin,"size",1,20,1),r.addColor(t.lowPriorityPin,"color"),r.close(),{destroy(){i.destroy()},addMarker(a){if(i._closed||!t.onClick)return;let l={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"&&(l.zIndex=t.zIndex),e.Markers.add(a,t.contentHTML,l)}}}v();function me(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(l=>{e.updateState("exterior-walls",{visible:l})}),i.addColor(t,"topColor").onChange(l=>{e.updateState("exterior-walls",{topColor:l})}),i.addColor(t,"color").onChange(l=>{e.updateState("exterior-walls",{color:l})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{texture:{url:l}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{topTexture:{url:l}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}v();function be(n,e,i){var a,l;n.close();let t={language:(l=(a=i.currentLanguage)==null?void 0:a.code)!=null?l:"en"},r=i.getByType("enterprise-venue");n.add(t,"language",r==null?void 0:r.languages.map(o=>o.code)).onChange(o=>{i.changeLanguage(o)})}v();function ye(n,e,i){let t=n.addFolder("Debug");t.close();let r=e.Debug.state,a={showPolygonLabelTextAreaMesh:r.showPolygonLabelTextAreaMesh,showCollisionBoxes:r.showCollisionBoxes,showEnvMap:r.showEnvMap};t.add(a,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(a,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(a,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(a)}v();function ve(n,e,i){let t=n.addFolder("Text3D").close(),r={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(r,"all").name("Show All"),t.add(r,"removeAll").name("Remove All")}v();function xe(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let r=localStorage.getItem("directionsMethod"),a=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",o={enabled:!1,method:r||"dp-optimal",radius:a?parseFloat(a):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},d,u,c;t.add(o,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(d=void 0,u=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",c&&(e.Paths.remove(c),c=void 0))}),t.add(o,"startCoordinate").name("Start").disable().listen(),t.add(o,"endCoordinate").name("End").disable().listen(),t.add(o,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),d&&u&&o.enabled&&p(d,u)}),t.add(o,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),d&&u&&o.enabled&&p(d,u)}),t.add(o,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),d&&u&&o.enabled&&p(d,u)}),t.add(o,"pathInfo").name("Path Info").disable().listen();let s={clear:()=>h()};t.add(s,"clear").name("Clear Path");function h(){d=void 0,u=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",c&&(e.Paths.remove(c),c=void 0)}async function p(m,y){var f;c&&(e.Paths.remove(c),c=void 0);try{let b=await e.getDirections(m,y,{smoothing:{enabled:!0,__EXPERIMENTAL_METHOD:o.method,radius:o.radius,__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:o.includeDoorBufferNodes}});if(b){c=e.Paths.add(b.coordinates,{interactive:!0,color:"green",width:1});let k=((f=b.distance)==null?void 0:f.toFixed(2))||"N/A";o.pathInfo="".concat(b.coordinates.length," pts, ").concat(k,"m")}else o.pathInfo="No path found"}catch(b){o.pathInfo="Error: ".concat(b instanceof Error?b.message:"Unknown")}}let g=async m=>{if(o.enabled)if(d){let y=m.coordinate;u=y,o.endCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),o.pathInfo="Calculating...",await p(d,u),d=void 0,u=void 0}else{let y=m.coordinate;d=y,o.startCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),o.pathInfo="Click to set end..."}};return e.on("click",g),{destroy(){e.off("click",g),t.destroy()}}}function Ae(n,e,i){Ne();let t=new G({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),he(e,n,t),ge(t,e,i==null?void 0:i.camera);let r=t.addFolder("Levels").close(),a=t.addFolder("Scene Controls");a.close();let l=t.addFolder("Labels");ve(t,e,n);let o=t.addFolder("Markers");me(t,e);let d=t.addFolder("misc");ye(t,e,n),xe(t,e,n),be(d,e,n);let u={level:e.currentFloor.id},{populatelabels:c}=ue(l,n,e),{populateMarkers:s}=fe(o,n,e),h=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),p=r.add(u,"level",h).onChange(g=>{e.setFloor(g),u.level=e.currentFloor.id,p.updateDisplay()});return e.on("floor-change-start",g=>{r.controllers[0].setValue(g.floor.id)}),n.getByType("space").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:c,sceneFolder:a,populateMarkers:s}}var Ce="mappedin-sdk-debug-css";function Ne(){if(document.getElementById(Ce))return;let n=document.createElement("style");n.id=Ce,n.textContent=pe,document.head.appendChild(n)}var te=class{constructor(e,i){I(this,"_enabled",!1);I(this,"mv");I(this,"api");I(this,"mapData");I(this,"scenegraphVisualizerMounted",!1);I(this,"storeStateToLocalStorageEnabled",!1);this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){var t;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(r=>{r===i&&!r._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,se(this.api.core,i))}),(t=this.api.getMapDataInternal())==null||t.spaces.forEach(r=>{this.mv.updateState(r,{interactive:!0})})}get enabled(){return this._enabled}};export{te as Inspector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ee,o as je,p as De,q as Re,r as Ve}from"./chunk-DXHWFRA5.js";import{q as Le}from"./chunk-GYYVZ4IB.js";import"./chunk-URGM6RST.js";import{a as M}from"./chunk-62AZLR6O.js";import{a as y,b as G,f as Ft,h as Lt,i as q,j as Ae,k as ae,l as Me,m as Fe}from"./chunk-5W2UDR4H.js";var zt=Ft((P,L)=>{M();var $t=200,rt="__lodash_hash_undefined__",Gt=800,qt=16,ot=9007199254740991,at="[object Arguments]",Jt="[object Array]",Ht="[object AsyncFunction]",Kt="[object Boolean]",Qt="[object Date]",Yt="[object Error]",ct="[object Function]",Zt="[object GeneratorFunction]",Xt="[object Map]",en="[object Number]",tn="[object Null]",ut="[object Object]",nn="[object Proxy]",sn="[object RegExp]",rn="[object Set]",on="[object String]",an="[object Undefined]",cn="[object WeakMap]",un="[object ArrayBuffer]",ln="[object DataView]",dn="[object Float32Array]",hn="[object Float64Array]",fn="[object Int8Array]",pn="[object Int16Array]",gn="[object Int32Array]",mn="[object Uint8Array]",_n="[object Uint8ClampedArray]",yn="[object Uint16Array]",bn="[object Uint32Array]",wn=/[\\^$.*+?()[\]{}|]/g,Sn=/^\[object .+?Constructor\]$/,vn=/^(?:0|[1-9]\d*)$/,_={};_[dn]=_[hn]=_[fn]=_[pn]=_[gn]=_[mn]=_[_n]=_[yn]=_[bn]=!0;_[at]=_[Jt]=_[un]=_[Kt]=_[ln]=_[Qt]=_[Yt]=_[ct]=_[Xt]=_[en]=_[ut]=_[sn]=_[rn]=_[on]=_[cn]=!1;var lt=typeof global=="object"&&global&&global.Object===Object&&global,xn=typeof self=="object"&&self&&self.Object===Object&&self,k=lt||xn||Function("return this")(),dt=typeof P=="object"&&P&&!P.nodeType&&P,B=dt&&typeof L=="object"&&L&&!L.nodeType&&L,ht=B&&B.exports===dt,_e=ht&<.process,Qe=function(){try{var t=B&&B.require&&B.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),Ye=Qe&&Qe.isTypedArray;function ft(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 In(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Tn(t){return function(e){return t(e)}}function zn(t,e){return t==null?void 0:t[e]}function On(t,e){return function(n){return t(e(n))}}var Cn=Array.prototype,An=Function.prototype,Z=Object.prototype,ye=k["__core-js_shared__"],X=An.toString,I=Z.hasOwnProperty,Ze=function(){var t=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),pt=Z.toString,Mn=X.call(Object),Fn=RegExp("^"+X.call(I).replace(wn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Q=ht?k.Buffer:void 0,Xe=k.Symbol,et=k.Uint8Array,tt=Q?Q.allocUnsafe:void 0,gt=On(Object.getPrototypeOf,Object),nt=Object.create,Ln=Z.propertyIsEnumerable,En=Cn.splice,C=Xe?Xe.toStringTag:void 0,Y=function(){try{var t=Te(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),jn=Q?Q.isBuffer:void 0,it=Math.max,Dn=Date.now,mt=Te(k,"Map"),N=Te(Object,"create"),Rn=function(){function t(){}return function(e){if(!x(e))return{};if(nt)return nt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function A(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 Vn(){this.__data__=N?N(null):{},this.size=0}function Pn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Bn(t){var e=this.__data__;if(N){var n=e[t];return n===rt?void 0:n}return I.call(e,t)?e[t]:void 0}function Nn(t){var e=this.__data__;return N?e[t]!==void 0:I.call(e,t)}function kn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=N&&e===void 0?rt:e,this}A.prototype.clear=Vn;A.prototype.delete=Pn;A.prototype.get=Bn;A.prototype.has=Nn;A.prototype.set=kn;function T(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 Wn(){this.__data__=[],this.size=0}function Un(t){var e=this.__data__,n=ee(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():En.call(e,n,1),--this.size,!0}function $n(t){var e=this.__data__,n=ee(e,t);return n<0?void 0:e[n][1]}function Gn(t){return ee(this.__data__,t)>-1}function qn(t,e){var n=this.__data__,i=ee(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}T.prototype.clear=Wn;T.prototype.delete=Un;T.prototype.get=$n;T.prototype.has=Gn;T.prototype.set=qn;function E(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 Jn(){this.size=0,this.__data__={hash:new A,map:new(mt||T),string:new A}}function Hn(t){var e=ne(this,t).delete(t);return this.size-=e?1:0,e}function Kn(t){return ne(this,t).get(t)}function Qn(t){return ne(this,t).has(t)}function Yn(t,e){var n=ne(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}E.prototype.clear=Jn;E.prototype.delete=Hn;E.prototype.get=Kn;E.prototype.has=Qn;E.prototype.set=Yn;function j(t){var e=this.__data__=new T(t);this.size=e.size}function Zn(){this.__data__=new T,this.size=0}function Xn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function ei(t){return this.__data__.get(t)}function ti(t){return this.__data__.has(t)}function ni(t,e){var n=this.__data__;if(n instanceof T){var i=n.__data__;if(!mt||i.length<$t-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new E(i)}return n.set(t,e),this.size=n.size,this}j.prototype.clear=Zn;j.prototype.delete=Xn;j.prototype.get=ei;j.prototype.has=ti;j.prototype.set=ni;function ii(t,e){var n=ve(t),i=!n&&Se(t),s=!n&&!i&&St(t),r=!n&&!i&&!s&&xt(t),a=n||i||s||r,o=a?In(t.length,String):[],c=o.length;for(var u in t)(e||I.call(t,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||bt(u,c)))&&o.push(u);return o}function be(t,e,n){(n!==void 0&&!ie(t[e],n)||n===void 0&&!(e in t))&&xe(t,e,n)}function si(t,e,n){var i=t[e];(!(I.call(t,e)&&ie(i,n))||n===void 0&&!(e in t))&&xe(t,e,n)}function ee(t,e){for(var n=t.length;n--;)if(ie(t[n][0],e))return n;return-1}function xe(t,e,n){e=="__proto__"&&Y?Y(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var ri=_i();function te(t){return t==null?t===void 0?an:tn:C&&C in Object(t)?yi(t):Ii(t)}function st(t){return W(t)&&te(t)==at}function oi(t){if(!x(t)||vi(t))return!1;var e=Oe(t)?Fn:Sn;return e.test(Ci(t))}function ai(t){return W(t)&&vt(t.length)&&!!_[te(t)]}function ci(t){if(!x(t))return xi(t);var e=wt(t),n=[];for(var i in t)i=="constructor"&&(e||!I.call(t,i))||n.push(i);return n}function Ie(t,e,n,i,s){t!==e&&ri(e,function(r,a){if(s||(s=new j),x(r))ui(t,e,a,n,Ie,i,s);else{var o=i?i(we(t,a),r,a+"",t,e,s):void 0;o===void 0&&(o=r),be(t,a,o)}},It)}function ui(t,e,n,i,s,r,a){var o=we(t,n),c=we(e,n),u=a.get(c);if(u){be(t,n,u);return}var l=r?r(o,c,n+"",t,e,a):void 0,h=l===void 0;if(h){var d=ve(c),f=!d&&St(c),g=!d&&!f&&xt(c);l=c,d||f||g?ve(o)?l=o:Ai(o)?l=pi(o):f?(h=!1,l=di(c,!0)):g?(h=!1,l=fi(c,!0)):l=[]:Mi(c)||Se(c)?(l=o,Se(o)?l=Fi(o):(!x(o)||Oe(o))&&(l=bi(c))):h=!1}h&&(a.set(c,l),s(l,c,i,r,a),a.delete(c)),be(t,n,l)}function _t(t,e){return zi(Ti(t,e,Tt),t+"")}var li=Y?function(t,e){return Y(t,"toString",{configurable:!0,enumerable:!1,value:ji(e),writable:!0})}:Tt;function di(t,e){if(e)return t.slice();var n=t.length,i=tt?tt(n):new t.constructor(n);return t.copy(i),i}function hi(t){var e=new t.constructor(t.byteLength);return new et(e).set(new et(t)),e}function fi(t,e){var n=e?hi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function pi(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function gi(t,e,n,i){var s=!n;n||(n={});for(var r=-1,a=e.length;++r<a;){var o=e[r],c=i?i(n[o],t[o],o,n,t):void 0;c===void 0&&(c=t[o]),s?xe(n,o,c):si(n,o,c)}return n}function mi(t){return _t(function(e,n){var i=-1,s=n.length,r=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(s--,r):void 0,a&&wi(n[0],n[1],a)&&(r=s<3?void 0:r,s=1),e=Object(e);++i<s;){var o=n[i];o&&t(e,o,i,r)}return e})}function _i(t){return function(e,n,i){for(var s=-1,r=Object(e),a=i(e),o=a.length;o--;){var c=a[t?o:++s];if(n(r[c],c,r)===!1)break}return e}}function yt(t,e,n,i,s,r){return x(t)&&x(e)&&(r.set(e,t),Ie(t,e,void 0,yt,r),r.delete(e)),t}function ne(t,e){var n=t.__data__;return Si(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Te(t,e){var n=zn(t,e);return oi(n)?n:void 0}function yi(t){var e=I.call(t,C),n=t[C];try{t[C]=void 0;var i=!0}catch(r){}var s=pt.call(t);return i&&(e?t[C]=n:delete t[C]),s}function bi(t){return typeof t.constructor=="function"&&!wt(t)?Rn(gt(t)):{}}function bt(t,e){var n=typeof t;return e=e==null?ot:e,!!e&&(n=="number"||n!="symbol"&&vn.test(t))&&t>-1&&t%1==0&&t<e}function wi(t,e,n){if(!x(n))return!1;var i=typeof e;return(i=="number"?ze(n)&&bt(e,n.length):i=="string"&&e in n)?ie(n[e],t):!1}function Si(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function vi(t){return!!Ze&&Ze in t}function wt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Z;return t===n}function xi(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Ii(t){return pt.call(t)}function Ti(t,e,n){return e=it(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=it(i.length-e,0),a=Array(r);++s<r;)a[s]=i[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=i[s];return o[e]=n(a),ft(t,this,o)}}function we(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var zi=Oi(li);function Oi(t){var e=0,n=0;return function(){var i=Dn(),s=qt-(i-n);if(n=i,s>0){if(++e>=Gt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ci(t){if(t!=null){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function ie(t,e){return t===e||t!==t&&e!==e}var Se=st(function(){return arguments}())?st:function(t){return W(t)&&I.call(t,"callee")&&!Ln.call(t,"callee")},ve=Array.isArray;function ze(t){return t!=null&&vt(t.length)&&!Oe(t)}function Ai(t){return W(t)&&ze(t)}var St=jn||Di;function Oe(t){if(!x(t))return!1;var e=te(t);return e==ct||e==Zt||e==Ht||e==nn}function vt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ot}function x(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function W(t){return t!=null&&typeof t=="object"}function Mi(t){if(!W(t)||te(t)!=ut)return!1;var e=gt(t);if(e===null)return!0;var n=I.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&X.call(n)==Mn}var xt=Ye?Tn(Ye):ai;function Fi(t){return gi(t,It(t))}var Li=_t(function(t){return t.push(void 0,yt),ft(Ei,void 0,t)});function It(t){return ze(t)?ii(t,!0):ci(t)}var Ei=mi(function(t,e,n,i){Ie(t,e,n,i)});function ji(t){return function(){return t}}function Tt(t){return t}function Di(){return!1}L.exports=Li});M();M();var Et="ENTRIES",Ue="KEYS",$e="VALUES",w="",R=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)===w)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!==w).join("")}value(){return F(this._path).node.get(w)}result(){switch(this._type){case $e:return this.value();case Ue:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},F=t=>t[t.length-1],jt=(t,e,n)=>{let i=new Map;if(e===void 0)return i;let s=e.length+1,r=s+n,a=new Uint8Array(r*s).fill(n+1);for(let o=0;o<s;++o)a[o]=o;for(let o=1;o<r;++o)a[o*s]=o;return Ge(t,e,n,i,a,1,s,""),i},Ge=(t,e,n,i,s,r,a,o)=>{let c=r*a;e:for(let u of t.keys())if(u===w){let l=s[c-1];l<=n&&i.set(o,[t.get(u),l])}else{let l=r;for(let h=0;h<u.length;++h,++l){let d=u[h],f=a*l,g=f-a,m=s[f],p=Math.max(0,l-n-1),S=Math.min(a-1,l+n);for(let v=p;v<S;++v){let re=d!==e[v],oe=s[g+v]+ +re,$=s[g+v+1]+1,z=s[f+v]+1,D=s[f+v+1]=Math.min(oe,$,z);D<m&&(m=D)}if(m>n)continue e}Ge(t.get(u),e,n,i,s,l,a,o+u)}},V=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]=K(this._tree,e.slice(this._prefix.length));if(n===void 0){let[s,r]=ge(i);for(let a of s.keys())if(a!==w&&a.startsWith(r)){let o=new Map;return o.set(a.slice(r.length),s.get(a)),new t(o,e)}}return new t(n,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Dt(this._tree,e)}entries(){return new R(this,Et)}forEach(e){for(let[n,i]of this)e(n,i,this)}fuzzyGet(e,n){return jt(this._tree,e,n)}get(e){let n=he(this._tree,e);return n!==void 0?n.get(w):void 0}has(e){let n=he(this._tree,e);return n!==void 0&&n.has(w)}keys(){return new R(this,Ue)}set(e,n){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,ce(this._tree,e).set(w,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=ce(this._tree,e);return i.set(w,n(i.get(w))),this}fetch(e,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=ce(this._tree,e),s=i.get(w);return s===void 0&&i.set(w,s=n()),s}values(){return new R(this,$e)}[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))}},K=(t,e,n=[])=>{if(e.length===0||t==null)return[t,n];for(let i of t.keys())if(i!==w&&e.startsWith(i))return n.push([t,i]),K(t.get(i),e.slice(i.length),n);return n.push([t,e]),K(void 0,"",n)},he=(t,e)=>{if(e.length===0||t==null)return t;for(let n of t.keys())if(n!==w&&e.startsWith(n))return he(t.get(n),e.slice(n.length))},ce=(t,e)=>{let n=e.length;e:for(let i=0;t&&i<n;){for(let r of t.keys())if(r!==w&&e[i]===r[0]){let a=Math.min(n-i,r.length),o=1;for(;o<a&&e[i+o]===r[o];)++o;let c=t.get(r);if(o===r.length)t=c;else{let u=new Map;u.set(r.slice(o),c),t.set(e.slice(i,i+o),u),t.delete(r),t=u}i+=o;continue e}let s=new Map;return t.set(e.slice(i),s),s}return t},Dt=(t,e)=>{let[n,i]=K(t,e);if(n!==void 0){if(n.delete(w),n.size===0)qe(i);else if(n.size===1){let[s,r]=n.entries().next().value;Je(i,s,r)}}},qe=t=>{if(t.length===0)return;let[e,n]=ge(t);if(e.delete(n),e.size===0)qe(t.slice(0,-1));else if(e.size===1){let[i,s]=e.entries().next().value;i!==w&&Je(t.slice(0,-1),i,s)}},Je=(t,e,n)=>{if(t.length===0)return;let[i,s]=ge(t);i.set(s+e,n),i.delete(s)},ge=t=>t[t.length-1],me="or",He="and",Rt="and_not",O=class t{constructor(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');let n=e.autoVacuum==null||e.autoVacuum===!0?de:e.autoVacuum;this._options=G(y(y({},le),e),{autoVacuum:n,searchOptions:y(y({},Pe),e.searchOptions||{}),autoSuggestOptions:y(y({},kt),e.autoSuggestOptions||{})}),this._index=new V,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=pe,this.addFields(this._options.fields)}add(e){let{extractField:n,stringifyField:i,tokenize:s,processTerm:r,fields:a,idField:o}=this._options,c=n(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));if(this._idToShortId.has(c))throw new Error("MiniSearch: duplicate ID ".concat(c));let u=this.addDocumentId(c);this.saveStoredFields(u,e);for(let l of a){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 S of p)this.addTerm(f,u,S);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:a}=e.reduce(({chunk:o,promise:c},u,l)=>(o.push(u),(l+1)%i===0?{chunk:[],promise:c.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(o))}:{chunk:o,promise:c}),s);return a.then(()=>this.addAll(r))}remove(e){let{tokenize:n,processTerm:i,extractField:s,stringifyField:r,fields:a,idField:o}=this._options,c=s(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));let u=this._idToShortId.get(c);if(u==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(c,": it is not in the index"));for(let l of a){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 S of p)this.removeTerm(f,u,S);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 V,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 ".concat(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=pe,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||fe.batchSize,r=e.batchWait||fe.batchWait,a=1;for(let[o,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(o).size===0&&this._index.delete(o),a%s===0&&await new Promise(u=>setTimeout(u,r)),a+=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||de.minDirtCount,i=i||de.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=y(y({},i),n),r=this.executeQuery(e,n),a=[];for(let[o,{score:c,terms:u,match:l}]of r){let h=u.length||1,d={id:this._documentIds.get(o),score:c*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(o)),(s.filter==null||s.filter(d))&&a.push(d)}return e===t.wildcard&&s.boostDocument==null||a.sort(Ne),a}autoSuggest(e,n={}){n=y(y({},this._options.autoSuggestOptions),n);let i=new Map;for(let{score:r,terms:a}of this.search(e,n)){let o=a.join(" "),c=i.get(o);c!=null?(c.score+=r,c.count+=1):i.set(o,{score:r,terms:a,count:1})}let s=[];for(let[r,{score:a,terms:o,count:c}]of i)s.push({suggestion:r,terms:o,score:a/c});return s.sort(Ne),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(le.hasOwnProperty(e))return ue(le,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))}static loadJS(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=J(s),c._fieldLength=J(r),c._storedFields=J(a);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];o===1&&(f=f.ds),h.set(parseInt(d,10),J(f))}c._index.set(u,h)}return c}static async loadJSAsync(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=await H(s),c._fieldLength=await H(r),c._storedFields=await H(a);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];o===1&&(g=g.ds),d.set(parseInt(f,10),await H(g))}++u%1e3===0&&await Ke(0),c._index.set(l,d)}return c}static instantiateMiniSearch(e,n){let{documentCount:i,nextId:s,fieldIds:r,averageFieldLength:a,dirtCount:o,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=a,u._dirtCount=o||0,u._index=new V,u}executeQuery(e,n={}){if(e===t.wildcard)return this.executeWildcardQuery(n);if(typeof e!="string"){let d=G(y(y({},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,a=y(y({tokenize:i,processTerm:s},r),n),{tokenize:o,processTerm:c}=a,h=o(e).flatMap(d=>c(d)).filter(d=>!!d).map(Nt(a)).map(d=>this.executeQuerySpec(d,a));return this.combineResults(h,a.combineWith)}executeQuerySpec(e,n){let i=y(y({},this._options.searchOptions),n),s=(i.fields||this._options.fields).reduce((m,p)=>G(y({},m),{[p]:ue(i.boost,p)||1}),{}),{boostDocument:r,weights:a,maxFuzzy:o,bm25:c}=i,{fuzzy:u,prefix:l}=y(y({},Pe.weights),a),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(o,Math.round(e.term.length*m)):m;p&&(g=this._index.fuzzyGet(e.term,p))}if(f)for(let[m,p]of f){let S=m.length-e.term.length;if(!S)continue;g==null||g.delete(m);let v=l*m.length/(m.length+.3*S);this.termResults(e.term,m,v,e.termBoost,p,s,r,c,d)}if(g)for(let m of g.keys()){let[p,S]=g.get(m);if(!S)continue;let v=u*m.length/(m.length+S);this.termResults(e.term,m,v,e.termBoost,p,s,r,c,d)}return d}executeWildcardQuery(e){let n=new Map,i=y(y({},this._options.searchOptions),e);for(let[s,r]of this._documentIds){let a=i.boostDocument?i.boostDocument(r,"",this._storedFields.get(s)):1;n.set(s,{score:a,terms:[],match:{}})}return n}combineResults(e,n=me){if(e.length===0)return new Map;let i=n.toLowerCase(),s=Vt[i];if(!s)throw new Error("Invalid combination operator: ".concat(n));return e.reduce(s)||new Map}toJSON(){let e=[];for(let[n,i]of this._index){let s={};for(let[r,a]of i)s[r]=Object.fromEntries(a);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,a,o,c,u=new Map){if(r==null)return u;for(let l of Object.keys(a)){let h=a[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 S=o?o(this._documentIds.get(p),n,this._storedFields.get(p)):1;if(!S)continue;let v=f.get(p),re=this._fieldLength.get(p)[d],oe=Bt(v,g,this._documentCount,re,m,c),$=i*s*h*S*oe,z=u.get(p);if(z){z.score+=$,Wt(z.terms,e);let D=ue(z.match,n);D?D.push(l):z.match[n]=[l]}else u.set(p,{score:$,terms:[e],match:{[n]:[l]}})}}return u}addTerm(e,n,i){let s=this._index.fetch(i,ke),r=s.get(e);if(r==null)r=new Map,r.set(n,1),s.set(e,r);else{let a=r.get(n);r.set(n,(a||0)+1)}}removeTerm(e,n,i){if(!this._index.has(i)){this.warnDocumentChanged(n,e,i);return}let s=this._index.fetch(i,ke),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 ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(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 o=(this._avgFieldLength[n]||0)*i+s;this._avgFieldLength[n]=o/(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 a of i){let o=s(n,a);o!==void 0&&(r[a]=o)}}};O.wildcard=Symbol("*");var ue=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,Vt={[me]:(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:a}=e.get(n);i.score=i.score+s,i.match=Object.assign(i.match,a),Be(i.terms,r)}}return t},[He]:(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:a,match:o}=e.get(i);Be(s.terms,a),n.set(i,{score:s.score+r,terms:s.terms,match:Object.assign(s.match,o)})}return n},[Rt]:(t,e)=>{for(let n of e.keys())t.delete(n);return t}},Pt={k:1.2,b:.7,d:.5},Bt=(t,e,n,i,s,r)=>{let{k:a,b:o,d:c}=r;return Math.log(1+(n-e+.5)/(e+.5))*(c+t*(a+1)/(t+a*(1-o+o*i/s)))},Nt=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,a=typeof t.boostTerm=="function"?t.boostTerm(e,n,i):1;return{term:e,fuzzy:s,prefix:r,termBoost:a}},le={idField:"id",extractField:(t,e)=>t[e],stringifyField:(t,e)=>t.toString(),tokenize:t=>t.split(Ut),processTerm:t=>t.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(t,e)=>{typeof(console==null?void 0:console[t])=="function"&&console[t](e)},autoVacuum:!0},Pe={combineWith:me,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Pt},kt={combineWith:He,prefix:(t,e,n)=>e===n.length-1},fe={batchSize:1e3,batchWait:10},pe={minDirtFactor:.1,minDirtCount:20},de=y(y({},fe),pe),Wt=(t,e)=>{t.includes(e)||t.push(e)},Be=(t,e)=>{for(let n of e)t.includes(n)||t.push(n)},Ne=({score:t},{score:e})=>e-t,ke=()=>new Map,J=t=>{let e=new Map;for(let n of Object.keys(t))e.set(parseInt(n,10),t[n]);return e},H=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 Ke(0);return e},Ke=t=>new Promise(e=>setTimeout(e,t)),Ut=new RegExp("[\\n\\r\\p{Z}\\p{P}]+","u");var At=Lt(zt(),1);import{z as b}from"zod";var U,se,Mt,Ot=class{constructor(e){ae(this,se);q(this,"mapData");q(this,"indexes");q(this,"ready");ae(this,U);this.mapData=e,this.indexes=Pi(e),this.ready=this.populate(),Me(this,U,Le(Fe(this,se,Mt).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==null||n.removeAll(),r.push(n.addAllAsync(s.getByType("enterprise-location")))),i&&(i==null||i.removeAll(),r.push(i.addAllAsync(s.getByType("enterprise-category")))),Promise.all(r)}async search(e,n={}){var c,u;await this.ready,Bi.parse(n);let i=(0,At.default)({},n,Vi),s=this.indexes.places.search(e,{fields:Object.keys(i.places.fields).filter(l=>i.places.fields[l])});i.places.limit&&(s=s.slice(0,i.places.limit));let r=(c=this.indexes.enterpriseLocations)==null?void 0:c.search(e,{fields:Object.keys(i.enterpriseLocations.fields).filter(l=>i.enterpriseLocations.fields[l])});r&&i.enterpriseLocations.limit&&(r=r.slice(0,i.enterpriseLocations.limit));let a=(u=this.indexes.enterpriseCategories)==null?void 0:u.search(e,{fields:Object.keys(i.enterpriseCategories.fields).filter(l=>i.enterpriseCategories.fields[l])});a&&i.enterpriseCategories.limit&&(a=a.slice(0,i.enterpriseCategories.limit));let o=Ri(this.mapData,{placesResult:s,locationsResult:r,categoriesResult:a});return Ae(this,U).call(this,e),o}async suggest(e,n={}){await this.ready,Ni.parse(n);let i=[],{places:{enabled:s=!0}={},enterpriseLocations:{enabled:r=!0}={}}=n;r&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(c=>i.push(c)),s&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(c=>i.push(c));let a=new Map;i.forEach(c=>{let u=a.get(c.suggestion);(!u||c.score>u.score)&&a.set(c.suggestion,c)});let o=Array.from(a.values());return o.sort((c,u)=>u.score-c.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:o.map(c=>c.suggestion)}),o}};U=new WeakMap,se=new WeakSet,Mt=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ri(t,{placesResult:e,locationsResult:n,categoriesResult:i}){let s=e.reduce((o,{id:c,match:u,score:l,__type:h})=>{let d=t.getById(h,c);return d!=null&&!Ee.is(d)&&!je.is(d)&&!De.is(d)&&!Re.is(d)&&!Ve.is(d)&&o.push({type:d.__type,match:u,score:l,item:d}),o},[]),r;if(n){r=[];for(let{id:o,match:c,score:u}of n){let l=t.getById("enterprise-location",o);l&&r.push({type:l.__type,match:c,score:u,item:l})}}let a;if(i){a=[];for(let{id:o,match:c,score:u}of i){let l=t.getById("enterprise-category",o);l&&a.push({type:l.__type,match:c,score:u,item:l})}}return{places:s,enterpriseLocations:r,enterpriseCategories:a}}var Vi={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function Ce(t){return t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Pi(t){let e=new O({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(a,o)=>{let c=a[o];return typeof c=="string"?Ce(c):a[o]},processTerm:a=>ki.has(a)?"":a.toLowerCase()}),n=t.getByType("enterprise-location"),i;n&&(i=new O({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(a,o)=>Array.isArray(a[o])?a[o].join(" "):typeof a[o]=="string"?Ce(a[o]):a[o]}));let s=t.getByType("enterprise-category"),r;return s&&(r=new O({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(a,o){return o==="locations.name"?a.locations.reduce((u,l)=>u+" ".concat(Ct," ")+l.name,"")+" ".concat(Ct):typeof a[o]=="string"?Ce(a[o]):a[o]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:r,enterpriseLocations:i,places:e}}var Bi=b.object({places:b.object({fields:b.object({name:b.boolean().optional(),description:b.boolean().optional()}).optional(),limit:b.number().positive().optional()}).optional(),enterpriseCategories:b.object({fields:b.object({name:b.boolean().optional(),description:b.boolean().optional(),"locations.name":b.boolean().optional()}).optional(),limit:b.number().positive().optional()}).optional(),enterpriseLocations:b.object({fields:b.object({name:b.boolean().optional(),tags:b.boolean().optional(),description:b.boolean().optional()}).optional(),limit:b.number().positive().optional()}).optional()}),Ni=b.object({places:b.object({enabled:b.boolean().optional()}).optional(),enterpriseLocations:b.object({enabled:b.boolean().optional()}).optional()}),ki=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),Ct="";export{Ot as InternalSearch,Ce as removeAccents};
|
|
1
|
+
import{b as Ee,o as je,p as De,q as Re,r as Ve}from"./chunk-D53OXR7Z.js";import{t as Le}from"./chunk-CJ52KBIE.js";import"./chunk-RJF4TTOJ.js";import{a as M}from"./chunk-6SFEDLKY.js";import{a as y,b as G,f as Ft,h as Lt,i as q,j as Ae,k as ae,l as Me,m as Fe}from"./chunk-5W2UDR4H.js";var zt=Ft((P,L)=>{M();var $t=200,rt="__lodash_hash_undefined__",Gt=800,qt=16,ot=9007199254740991,at="[object Arguments]",Jt="[object Array]",Ht="[object AsyncFunction]",Kt="[object Boolean]",Qt="[object Date]",Yt="[object Error]",ct="[object Function]",Zt="[object GeneratorFunction]",Xt="[object Map]",en="[object Number]",tn="[object Null]",ut="[object Object]",nn="[object Proxy]",sn="[object RegExp]",rn="[object Set]",on="[object String]",an="[object Undefined]",cn="[object WeakMap]",un="[object ArrayBuffer]",ln="[object DataView]",dn="[object Float32Array]",hn="[object Float64Array]",fn="[object Int8Array]",pn="[object Int16Array]",gn="[object Int32Array]",mn="[object Uint8Array]",_n="[object Uint8ClampedArray]",yn="[object Uint16Array]",bn="[object Uint32Array]",wn=/[\\^$.*+?()[\]{}|]/g,Sn=/^\[object .+?Constructor\]$/,vn=/^(?:0|[1-9]\d*)$/,_={};_[dn]=_[hn]=_[fn]=_[pn]=_[gn]=_[mn]=_[_n]=_[yn]=_[bn]=!0;_[at]=_[Jt]=_[un]=_[Kt]=_[ln]=_[Qt]=_[Yt]=_[ct]=_[Xt]=_[en]=_[ut]=_[sn]=_[rn]=_[on]=_[cn]=!1;var lt=typeof global=="object"&&global&&global.Object===Object&&global,xn=typeof self=="object"&&self&&self.Object===Object&&self,k=lt||xn||Function("return this")(),dt=typeof P=="object"&&P&&!P.nodeType&&P,B=dt&&typeof L=="object"&&L&&!L.nodeType&&L,ht=B&&B.exports===dt,_e=ht&<.process,Qe=function(){try{var t=B&&B.require&&B.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),Ye=Qe&&Qe.isTypedArray;function ft(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 In(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Tn(t){return function(e){return t(e)}}function zn(t,e){return t==null?void 0:t[e]}function On(t,e){return function(n){return t(e(n))}}var Cn=Array.prototype,An=Function.prototype,Z=Object.prototype,ye=k["__core-js_shared__"],X=An.toString,I=Z.hasOwnProperty,Ze=function(){var t=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),pt=Z.toString,Mn=X.call(Object),Fn=RegExp("^"+X.call(I).replace(wn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Q=ht?k.Buffer:void 0,Xe=k.Symbol,et=k.Uint8Array,tt=Q?Q.allocUnsafe:void 0,gt=On(Object.getPrototypeOf,Object),nt=Object.create,Ln=Z.propertyIsEnumerable,En=Cn.splice,C=Xe?Xe.toStringTag:void 0,Y=function(){try{var t=Te(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),jn=Q?Q.isBuffer:void 0,it=Math.max,Dn=Date.now,mt=Te(k,"Map"),N=Te(Object,"create"),Rn=function(){function t(){}return function(e){if(!x(e))return{};if(nt)return nt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function A(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 Vn(){this.__data__=N?N(null):{},this.size=0}function Pn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Bn(t){var e=this.__data__;if(N){var n=e[t];return n===rt?void 0:n}return I.call(e,t)?e[t]:void 0}function Nn(t){var e=this.__data__;return N?e[t]!==void 0:I.call(e,t)}function kn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=N&&e===void 0?rt:e,this}A.prototype.clear=Vn;A.prototype.delete=Pn;A.prototype.get=Bn;A.prototype.has=Nn;A.prototype.set=kn;function T(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 Wn(){this.__data__=[],this.size=0}function Un(t){var e=this.__data__,n=ee(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():En.call(e,n,1),--this.size,!0}function $n(t){var e=this.__data__,n=ee(e,t);return n<0?void 0:e[n][1]}function Gn(t){return ee(this.__data__,t)>-1}function qn(t,e){var n=this.__data__,i=ee(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}T.prototype.clear=Wn;T.prototype.delete=Un;T.prototype.get=$n;T.prototype.has=Gn;T.prototype.set=qn;function E(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 Jn(){this.size=0,this.__data__={hash:new A,map:new(mt||T),string:new A}}function Hn(t){var e=ne(this,t).delete(t);return this.size-=e?1:0,e}function Kn(t){return ne(this,t).get(t)}function Qn(t){return ne(this,t).has(t)}function Yn(t,e){var n=ne(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}E.prototype.clear=Jn;E.prototype.delete=Hn;E.prototype.get=Kn;E.prototype.has=Qn;E.prototype.set=Yn;function j(t){var e=this.__data__=new T(t);this.size=e.size}function Zn(){this.__data__=new T,this.size=0}function Xn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function ei(t){return this.__data__.get(t)}function ti(t){return this.__data__.has(t)}function ni(t,e){var n=this.__data__;if(n instanceof T){var i=n.__data__;if(!mt||i.length<$t-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new E(i)}return n.set(t,e),this.size=n.size,this}j.prototype.clear=Zn;j.prototype.delete=Xn;j.prototype.get=ei;j.prototype.has=ti;j.prototype.set=ni;function ii(t,e){var n=ve(t),i=!n&&Se(t),s=!n&&!i&&St(t),r=!n&&!i&&!s&&xt(t),a=n||i||s||r,o=a?In(t.length,String):[],c=o.length;for(var u in t)(e||I.call(t,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||bt(u,c)))&&o.push(u);return o}function be(t,e,n){(n!==void 0&&!ie(t[e],n)||n===void 0&&!(e in t))&&xe(t,e,n)}function si(t,e,n){var i=t[e];(!(I.call(t,e)&&ie(i,n))||n===void 0&&!(e in t))&&xe(t,e,n)}function ee(t,e){for(var n=t.length;n--;)if(ie(t[n][0],e))return n;return-1}function xe(t,e,n){e=="__proto__"&&Y?Y(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var ri=_i();function te(t){return t==null?t===void 0?an:tn:C&&C in Object(t)?yi(t):Ii(t)}function st(t){return W(t)&&te(t)==at}function oi(t){if(!x(t)||vi(t))return!1;var e=Oe(t)?Fn:Sn;return e.test(Ci(t))}function ai(t){return W(t)&&vt(t.length)&&!!_[te(t)]}function ci(t){if(!x(t))return xi(t);var e=wt(t),n=[];for(var i in t)i=="constructor"&&(e||!I.call(t,i))||n.push(i);return n}function Ie(t,e,n,i,s){t!==e&&ri(e,function(r,a){if(s||(s=new j),x(r))ui(t,e,a,n,Ie,i,s);else{var o=i?i(we(t,a),r,a+"",t,e,s):void 0;o===void 0&&(o=r),be(t,a,o)}},It)}function ui(t,e,n,i,s,r,a){var o=we(t,n),c=we(e,n),u=a.get(c);if(u){be(t,n,u);return}var l=r?r(o,c,n+"",t,e,a):void 0,h=l===void 0;if(h){var d=ve(c),f=!d&&St(c),g=!d&&!f&&xt(c);l=c,d||f||g?ve(o)?l=o:Ai(o)?l=pi(o):f?(h=!1,l=di(c,!0)):g?(h=!1,l=fi(c,!0)):l=[]:Mi(c)||Se(c)?(l=o,Se(o)?l=Fi(o):(!x(o)||Oe(o))&&(l=bi(c))):h=!1}h&&(a.set(c,l),s(l,c,i,r,a),a.delete(c)),be(t,n,l)}function _t(t,e){return zi(Ti(t,e,Tt),t+"")}var li=Y?function(t,e){return Y(t,"toString",{configurable:!0,enumerable:!1,value:ji(e),writable:!0})}:Tt;function di(t,e){if(e)return t.slice();var n=t.length,i=tt?tt(n):new t.constructor(n);return t.copy(i),i}function hi(t){var e=new t.constructor(t.byteLength);return new et(e).set(new et(t)),e}function fi(t,e){var n=e?hi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function pi(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function gi(t,e,n,i){var s=!n;n||(n={});for(var r=-1,a=e.length;++r<a;){var o=e[r],c=i?i(n[o],t[o],o,n,t):void 0;c===void 0&&(c=t[o]),s?xe(n,o,c):si(n,o,c)}return n}function mi(t){return _t(function(e,n){var i=-1,s=n.length,r=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(s--,r):void 0,a&&wi(n[0],n[1],a)&&(r=s<3?void 0:r,s=1),e=Object(e);++i<s;){var o=n[i];o&&t(e,o,i,r)}return e})}function _i(t){return function(e,n,i){for(var s=-1,r=Object(e),a=i(e),o=a.length;o--;){var c=a[t?o:++s];if(n(r[c],c,r)===!1)break}return e}}function yt(t,e,n,i,s,r){return x(t)&&x(e)&&(r.set(e,t),Ie(t,e,void 0,yt,r),r.delete(e)),t}function ne(t,e){var n=t.__data__;return Si(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Te(t,e){var n=zn(t,e);return oi(n)?n:void 0}function yi(t){var e=I.call(t,C),n=t[C];try{t[C]=void 0;var i=!0}catch(r){}var s=pt.call(t);return i&&(e?t[C]=n:delete t[C]),s}function bi(t){return typeof t.constructor=="function"&&!wt(t)?Rn(gt(t)):{}}function bt(t,e){var n=typeof t;return e=e==null?ot:e,!!e&&(n=="number"||n!="symbol"&&vn.test(t))&&t>-1&&t%1==0&&t<e}function wi(t,e,n){if(!x(n))return!1;var i=typeof e;return(i=="number"?ze(n)&&bt(e,n.length):i=="string"&&e in n)?ie(n[e],t):!1}function Si(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function vi(t){return!!Ze&&Ze in t}function wt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Z;return t===n}function xi(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Ii(t){return pt.call(t)}function Ti(t,e,n){return e=it(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=it(i.length-e,0),a=Array(r);++s<r;)a[s]=i[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=i[s];return o[e]=n(a),ft(t,this,o)}}function we(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var zi=Oi(li);function Oi(t){var e=0,n=0;return function(){var i=Dn(),s=qt-(i-n);if(n=i,s>0){if(++e>=Gt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ci(t){if(t!=null){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function ie(t,e){return t===e||t!==t&&e!==e}var Se=st(function(){return arguments}())?st:function(t){return W(t)&&I.call(t,"callee")&&!Ln.call(t,"callee")},ve=Array.isArray;function ze(t){return t!=null&&vt(t.length)&&!Oe(t)}function Ai(t){return W(t)&&ze(t)}var St=jn||Di;function Oe(t){if(!x(t))return!1;var e=te(t);return e==ct||e==Zt||e==Ht||e==nn}function vt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ot}function x(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function W(t){return t!=null&&typeof t=="object"}function Mi(t){if(!W(t)||te(t)!=ut)return!1;var e=gt(t);if(e===null)return!0;var n=I.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&X.call(n)==Mn}var xt=Ye?Tn(Ye):ai;function Fi(t){return gi(t,It(t))}var Li=_t(function(t){return t.push(void 0,yt),ft(Ei,void 0,t)});function It(t){return ze(t)?ii(t,!0):ci(t)}var Ei=mi(function(t,e,n,i){Ie(t,e,n,i)});function ji(t){return function(){return t}}function Tt(t){return t}function Di(){return!1}L.exports=Li});M();M();var Et="ENTRIES",Ue="KEYS",$e="VALUES",w="",R=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)===w)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!==w).join("")}value(){return F(this._path).node.get(w)}result(){switch(this._type){case $e:return this.value();case Ue:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},F=t=>t[t.length-1],jt=(t,e,n)=>{let i=new Map;if(e===void 0)return i;let s=e.length+1,r=s+n,a=new Uint8Array(r*s).fill(n+1);for(let o=0;o<s;++o)a[o]=o;for(let o=1;o<r;++o)a[o*s]=o;return Ge(t,e,n,i,a,1,s,""),i},Ge=(t,e,n,i,s,r,a,o)=>{let c=r*a;e:for(let u of t.keys())if(u===w){let l=s[c-1];l<=n&&i.set(o,[t.get(u),l])}else{let l=r;for(let h=0;h<u.length;++h,++l){let d=u[h],f=a*l,g=f-a,m=s[f],p=Math.max(0,l-n-1),S=Math.min(a-1,l+n);for(let v=p;v<S;++v){let re=d!==e[v],oe=s[g+v]+ +re,$=s[g+v+1]+1,z=s[f+v]+1,D=s[f+v+1]=Math.min(oe,$,z);D<m&&(m=D)}if(m>n)continue e}Ge(t.get(u),e,n,i,s,l,a,o+u)}},V=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]=K(this._tree,e.slice(this._prefix.length));if(n===void 0){let[s,r]=ge(i);for(let a of s.keys())if(a!==w&&a.startsWith(r)){let o=new Map;return o.set(a.slice(r.length),s.get(a)),new t(o,e)}}return new t(n,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Dt(this._tree,e)}entries(){return new R(this,Et)}forEach(e){for(let[n,i]of this)e(n,i,this)}fuzzyGet(e,n){return jt(this._tree,e,n)}get(e){let n=he(this._tree,e);return n!==void 0?n.get(w):void 0}has(e){let n=he(this._tree,e);return n!==void 0&&n.has(w)}keys(){return new R(this,Ue)}set(e,n){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,ce(this._tree,e).set(w,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=ce(this._tree,e);return i.set(w,n(i.get(w))),this}fetch(e,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=ce(this._tree,e),s=i.get(w);return s===void 0&&i.set(w,s=n()),s}values(){return new R(this,$e)}[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))}},K=(t,e,n=[])=>{if(e.length===0||t==null)return[t,n];for(let i of t.keys())if(i!==w&&e.startsWith(i))return n.push([t,i]),K(t.get(i),e.slice(i.length),n);return n.push([t,e]),K(void 0,"",n)},he=(t,e)=>{if(e.length===0||t==null)return t;for(let n of t.keys())if(n!==w&&e.startsWith(n))return he(t.get(n),e.slice(n.length))},ce=(t,e)=>{let n=e.length;e:for(let i=0;t&&i<n;){for(let r of t.keys())if(r!==w&&e[i]===r[0]){let a=Math.min(n-i,r.length),o=1;for(;o<a&&e[i+o]===r[o];)++o;let c=t.get(r);if(o===r.length)t=c;else{let u=new Map;u.set(r.slice(o),c),t.set(e.slice(i,i+o),u),t.delete(r),t=u}i+=o;continue e}let s=new Map;return t.set(e.slice(i),s),s}return t},Dt=(t,e)=>{let[n,i]=K(t,e);if(n!==void 0){if(n.delete(w),n.size===0)qe(i);else if(n.size===1){let[s,r]=n.entries().next().value;Je(i,s,r)}}},qe=t=>{if(t.length===0)return;let[e,n]=ge(t);if(e.delete(n),e.size===0)qe(t.slice(0,-1));else if(e.size===1){let[i,s]=e.entries().next().value;i!==w&&Je(t.slice(0,-1),i,s)}},Je=(t,e,n)=>{if(t.length===0)return;let[i,s]=ge(t);i.set(s+e,n),i.delete(s)},ge=t=>t[t.length-1],me="or",He="and",Rt="and_not",O=class t{constructor(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');let n=e.autoVacuum==null||e.autoVacuum===!0?de:e.autoVacuum;this._options=G(y(y({},le),e),{autoVacuum:n,searchOptions:y(y({},Pe),e.searchOptions||{}),autoSuggestOptions:y(y({},kt),e.autoSuggestOptions||{})}),this._index=new V,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=pe,this.addFields(this._options.fields)}add(e){let{extractField:n,stringifyField:i,tokenize:s,processTerm:r,fields:a,idField:o}=this._options,c=n(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));if(this._idToShortId.has(c))throw new Error("MiniSearch: duplicate ID ".concat(c));let u=this.addDocumentId(c);this.saveStoredFields(u,e);for(let l of a){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 S of p)this.addTerm(f,u,S);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:a}=e.reduce(({chunk:o,promise:c},u,l)=>(o.push(u),(l+1)%i===0?{chunk:[],promise:c.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(o))}:{chunk:o,promise:c}),s);return a.then(()=>this.addAll(r))}remove(e){let{tokenize:n,processTerm:i,extractField:s,stringifyField:r,fields:a,idField:o}=this._options,c=s(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));let u=this._idToShortId.get(c);if(u==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(c,": it is not in the index"));for(let l of a){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 S of p)this.removeTerm(f,u,S);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 V,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 ".concat(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=pe,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||fe.batchSize,r=e.batchWait||fe.batchWait,a=1;for(let[o,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(o).size===0&&this._index.delete(o),a%s===0&&await new Promise(u=>setTimeout(u,r)),a+=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||de.minDirtCount,i=i||de.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=y(y({},i),n),r=this.executeQuery(e,n),a=[];for(let[o,{score:c,terms:u,match:l}]of r){let h=u.length||1,d={id:this._documentIds.get(o),score:c*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(o)),(s.filter==null||s.filter(d))&&a.push(d)}return e===t.wildcard&&s.boostDocument==null||a.sort(Ne),a}autoSuggest(e,n={}){n=y(y({},this._options.autoSuggestOptions),n);let i=new Map;for(let{score:r,terms:a}of this.search(e,n)){let o=a.join(" "),c=i.get(o);c!=null?(c.score+=r,c.count+=1):i.set(o,{score:r,terms:a,count:1})}let s=[];for(let[r,{score:a,terms:o,count:c}]of i)s.push({suggestion:r,terms:o,score:a/c});return s.sort(Ne),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(le.hasOwnProperty(e))return ue(le,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))}static loadJS(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=J(s),c._fieldLength=J(r),c._storedFields=J(a);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];o===1&&(f=f.ds),h.set(parseInt(d,10),J(f))}c._index.set(u,h)}return c}static async loadJSAsync(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=await H(s),c._fieldLength=await H(r),c._storedFields=await H(a);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];o===1&&(g=g.ds),d.set(parseInt(f,10),await H(g))}++u%1e3===0&&await Ke(0),c._index.set(l,d)}return c}static instantiateMiniSearch(e,n){let{documentCount:i,nextId:s,fieldIds:r,averageFieldLength:a,dirtCount:o,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=a,u._dirtCount=o||0,u._index=new V,u}executeQuery(e,n={}){if(e===t.wildcard)return this.executeWildcardQuery(n);if(typeof e!="string"){let d=G(y(y({},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,a=y(y({tokenize:i,processTerm:s},r),n),{tokenize:o,processTerm:c}=a,h=o(e).flatMap(d=>c(d)).filter(d=>!!d).map(Nt(a)).map(d=>this.executeQuerySpec(d,a));return this.combineResults(h,a.combineWith)}executeQuerySpec(e,n){let i=y(y({},this._options.searchOptions),n),s=(i.fields||this._options.fields).reduce((m,p)=>G(y({},m),{[p]:ue(i.boost,p)||1}),{}),{boostDocument:r,weights:a,maxFuzzy:o,bm25:c}=i,{fuzzy:u,prefix:l}=y(y({},Pe.weights),a),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(o,Math.round(e.term.length*m)):m;p&&(g=this._index.fuzzyGet(e.term,p))}if(f)for(let[m,p]of f){let S=m.length-e.term.length;if(!S)continue;g==null||g.delete(m);let v=l*m.length/(m.length+.3*S);this.termResults(e.term,m,v,e.termBoost,p,s,r,c,d)}if(g)for(let m of g.keys()){let[p,S]=g.get(m);if(!S)continue;let v=u*m.length/(m.length+S);this.termResults(e.term,m,v,e.termBoost,p,s,r,c,d)}return d}executeWildcardQuery(e){let n=new Map,i=y(y({},this._options.searchOptions),e);for(let[s,r]of this._documentIds){let a=i.boostDocument?i.boostDocument(r,"",this._storedFields.get(s)):1;n.set(s,{score:a,terms:[],match:{}})}return n}combineResults(e,n=me){if(e.length===0)return new Map;let i=n.toLowerCase(),s=Vt[i];if(!s)throw new Error("Invalid combination operator: ".concat(n));return e.reduce(s)||new Map}toJSON(){let e=[];for(let[n,i]of this._index){let s={};for(let[r,a]of i)s[r]=Object.fromEntries(a);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,a,o,c,u=new Map){if(r==null)return u;for(let l of Object.keys(a)){let h=a[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 S=o?o(this._documentIds.get(p),n,this._storedFields.get(p)):1;if(!S)continue;let v=f.get(p),re=this._fieldLength.get(p)[d],oe=Bt(v,g,this._documentCount,re,m,c),$=i*s*h*S*oe,z=u.get(p);if(z){z.score+=$,Wt(z.terms,e);let D=ue(z.match,n);D?D.push(l):z.match[n]=[l]}else u.set(p,{score:$,terms:[e],match:{[n]:[l]}})}}return u}addTerm(e,n,i){let s=this._index.fetch(i,ke),r=s.get(e);if(r==null)r=new Map,r.set(n,1),s.set(e,r);else{let a=r.get(n);r.set(n,(a||0)+1)}}removeTerm(e,n,i){if(!this._index.has(i)){this.warnDocumentChanged(n,e,i);return}let s=this._index.fetch(i,ke),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 ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(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 o=(this._avgFieldLength[n]||0)*i+s;this._avgFieldLength[n]=o/(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 a of i){let o=s(n,a);o!==void 0&&(r[a]=o)}}};O.wildcard=Symbol("*");var ue=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,Vt={[me]:(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:a}=e.get(n);i.score=i.score+s,i.match=Object.assign(i.match,a),Be(i.terms,r)}}return t},[He]:(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:a,match:o}=e.get(i);Be(s.terms,a),n.set(i,{score:s.score+r,terms:s.terms,match:Object.assign(s.match,o)})}return n},[Rt]:(t,e)=>{for(let n of e.keys())t.delete(n);return t}},Pt={k:1.2,b:.7,d:.5},Bt=(t,e,n,i,s,r)=>{let{k:a,b:o,d:c}=r;return Math.log(1+(n-e+.5)/(e+.5))*(c+t*(a+1)/(t+a*(1-o+o*i/s)))},Nt=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,a=typeof t.boostTerm=="function"?t.boostTerm(e,n,i):1;return{term:e,fuzzy:s,prefix:r,termBoost:a}},le={idField:"id",extractField:(t,e)=>t[e],stringifyField:(t,e)=>t.toString(),tokenize:t=>t.split(Ut),processTerm:t=>t.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(t,e)=>{typeof(console==null?void 0:console[t])=="function"&&console[t](e)},autoVacuum:!0},Pe={combineWith:me,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Pt},kt={combineWith:He,prefix:(t,e,n)=>e===n.length-1},fe={batchSize:1e3,batchWait:10},pe={minDirtFactor:.1,minDirtCount:20},de=y(y({},fe),pe),Wt=(t,e)=>{t.includes(e)||t.push(e)},Be=(t,e)=>{for(let n of e)t.includes(n)||t.push(n)},Ne=({score:t},{score:e})=>e-t,ke=()=>new Map,J=t=>{let e=new Map;for(let n of Object.keys(t))e.set(parseInt(n,10),t[n]);return e},H=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 Ke(0);return e},Ke=t=>new Promise(e=>setTimeout(e,t)),Ut=new RegExp("[\\n\\r\\p{Z}\\p{P}]+","u");var At=Lt(zt(),1);import{z as b}from"zod";var U,se,Mt,Ot=class{constructor(e){ae(this,se);q(this,"mapData");q(this,"indexes");q(this,"ready");ae(this,U);this.mapData=e,this.indexes=Pi(e),this.ready=this.populate(),Me(this,U,Le(Fe(this,se,Mt).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==null||n.removeAll(),r.push(n.addAllAsync(s.getByType("enterprise-location")))),i&&(i==null||i.removeAll(),r.push(i.addAllAsync(s.getByType("enterprise-category")))),Promise.all(r)}async search(e,n={}){var c,u;await this.ready,Bi.parse(n);let i=(0,At.default)({},n,Vi),s=this.indexes.places.search(e,{fields:Object.keys(i.places.fields).filter(l=>i.places.fields[l])});i.places.limit&&(s=s.slice(0,i.places.limit));let r=(c=this.indexes.enterpriseLocations)==null?void 0:c.search(e,{fields:Object.keys(i.enterpriseLocations.fields).filter(l=>i.enterpriseLocations.fields[l])});r&&i.enterpriseLocations.limit&&(r=r.slice(0,i.enterpriseLocations.limit));let a=(u=this.indexes.enterpriseCategories)==null?void 0:u.search(e,{fields:Object.keys(i.enterpriseCategories.fields).filter(l=>i.enterpriseCategories.fields[l])});a&&i.enterpriseCategories.limit&&(a=a.slice(0,i.enterpriseCategories.limit));let o=Ri(this.mapData,{placesResult:s,locationsResult:r,categoriesResult:a});return Ae(this,U).call(this,e),o}async suggest(e,n={}){await this.ready,Ni.parse(n);let i=[],{places:{enabled:s=!0}={},enterpriseLocations:{enabled:r=!0}={}}=n;r&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(c=>i.push(c)),s&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(c=>i.push(c));let a=new Map;i.forEach(c=>{let u=a.get(c.suggestion);(!u||c.score>u.score)&&a.set(c.suggestion,c)});let o=Array.from(a.values());return o.sort((c,u)=>u.score-c.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:o.map(c=>c.suggestion)}),o}};U=new WeakMap,se=new WeakSet,Mt=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ri(t,{placesResult:e,locationsResult:n,categoriesResult:i}){let s=e.reduce((o,{id:c,match:u,score:l,__type:h})=>{let d=t.getById(h,c);return d!=null&&!Ee.is(d)&&!je.is(d)&&!De.is(d)&&!Re.is(d)&&!Ve.is(d)&&o.push({type:d.__type,match:u,score:l,item:d}),o},[]),r;if(n){r=[];for(let{id:o,match:c,score:u}of n){let l=t.getById("enterprise-location",o);l&&r.push({type:l.__type,match:c,score:u,item:l})}}let a;if(i){a=[];for(let{id:o,match:c,score:u}of i){let l=t.getById("enterprise-category",o);l&&a.push({type:l.__type,match:c,score:u,item:l})}}return{places:s,enterpriseLocations:r,enterpriseCategories:a}}var Vi={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function Ce(t){return t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Pi(t){let e=new O({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(a,o)=>{let c=a[o];return typeof c=="string"?Ce(c):a[o]},processTerm:a=>ki.has(a)?"":a.toLowerCase()}),n=t.getByType("enterprise-location"),i;n&&(i=new O({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(a,o)=>Array.isArray(a[o])?a[o].join(" "):typeof a[o]=="string"?Ce(a[o]):a[o]}));let s=t.getByType("enterprise-category"),r;return s&&(r=new O({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(a,o){return o==="locations.name"?a.locations.reduce((u,l)=>u+" ".concat(Ct," ")+l.name,"")+" ".concat(Ct):typeof a[o]=="string"?Ce(a[o]):a[o]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:r,enterpriseLocations:i,places:e}}var Bi=b.object({places:b.object({fields:b.object({name:b.boolean().optional(),description:b.boolean().optional()}).optional(),limit:b.number().positive().optional()}).optional(),enterpriseCategories:b.object({fields:b.object({name:b.boolean().optional(),description:b.boolean().optional(),"locations.name":b.boolean().optional()}).optional(),limit:b.number().positive().optional()}).optional(),enterpriseLocations:b.object({fields:b.object({name:b.boolean().optional(),tags:b.boolean().optional(),description:b.boolean().optional()}).optional(),limit:b.number().positive().optional()}).optional()}),Ni=b.object({places:b.object({enabled:b.boolean().optional()}).optional(),enterpriseLocations:b.object({enabled:b.boolean().optional()}).optional()}),ki=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),Ct="";export{Ot as InternalSearch,Ce as removeAccents};
|