@mappedin/mappedin-js 6.32.0 → 6.33.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.
@@ -1 +1 @@
1
- import{ta as je,ua as Pe,va as Ve,wa as Ne,x as De}from"./chunk-TWRTSPVQ.js";import"./chunk-J5TYCDYA.js";import{a as M,j as Re}from"./chunk-7B7J4IXM.js";import{b as Rt,d as Dt}from"./chunk-PWEV3AFA.js";var Tt=Rt((W,E)=>{M();var Ht=200,at="__lodash_hash_undefined__",qt=800,Kt=16,ct=9007199254740991,ut="[object Arguments]",Qt="[object Array]",Zt="[object AsyncFunction]",Yt="[object Boolean]",Xt="[object Date]",en="[object Error]",lt="[object Function]",tn="[object GeneratorFunction]",nn="[object Map]",sn="[object Number]",rn="[object Null]",dt="[object Object]",on="[object Proxy]",an="[object RegExp]",cn="[object Set]",un="[object String]",ln="[object Undefined]",dn="[object WeakMap]",fn="[object ArrayBuffer]",hn="[object DataView]",pn="[object Float32Array]",gn="[object Float64Array]",mn="[object Int8Array]",_n="[object Int16Array]",yn="[object Int32Array]",bn="[object Uint8Array]",Sn="[object Uint8ClampedArray]",wn="[object Uint16Array]",vn="[object Uint32Array]",xn=/[\\^$.*+?()[\]{}|]/g,zn=/^\[object .+?Constructor\]$/,On=/^(?:0|[1-9]\d*)$/,_={};_[pn]=_[gn]=_[mn]=_[_n]=_[yn]=_[bn]=_[Sn]=_[wn]=_[vn]=!0;_[ut]=_[Qt]=_[fn]=_[Yt]=_[hn]=_[Xt]=_[en]=_[lt]=_[nn]=_[sn]=_[dt]=_[an]=_[cn]=_[un]=_[dn]=!1;var ft=typeof global=="object"&&global&&global.Object===Object&&global,An=typeof self=="object"&&self&&self.Object===Object&&self,J=ft||An||Function("return this")(),ht=typeof W=="object"&&W&&!W.nodeType&&W,B=ht&&typeof E=="object"&&E&&!E.nodeType&&E,pt=B&&B.exports===ht,_e=pt&&ft.process,Ye=(function(){try{var t=B&&B.require&&B.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch{}})(),Xe=Ye&&Ye.isTypedArray;function gt(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 Fn(t,e){return t?.[e]}function Mn(t,e){return function(n){return t(e(n))}}var Cn=Array.prototype,En=Function.prototype,X=Object.prototype,ye=J["__core-js_shared__"],ee=En.toString,x=X.hasOwnProperty,et=(function(){var t=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),mt=X.toString,Ln=ee.call(Object),Rn=RegExp("^"+ee.call(x).replace(xn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=pt?J.Buffer:void 0,tt=J.Symbol,nt=J.Uint8Array,it=Z?Z.allocUnsafe:void 0,_t=Mn(Object.getPrototypeOf,Object),st=Object.create,Dn=X.propertyIsEnumerable,jn=Cn.splice,T=tt?tt.toStringTag:void 0,Y=(function(){try{var t=Oe(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Pn=Z?Z.isBuffer:void 0,rt=Math.max,Vn=Date.now,yt=Oe(J,"Map"),k=Oe(Object,"create"),Nn=(function(){function t(){}return function(e){if(!v(e))return{};if(st)return st(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function F(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__=k?k(null):{},this.size=0}function Bn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function kn(t){var e=this.__data__;if(k){var n=e[t];return n===at?void 0:n}return x.call(e,t)?e[t]:void 0}function Jn(t){var e=this.__data__;return k?e[t]!==void 0:x.call(e,t)}function Un(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=k&&e===void 0?at:e,this}F.prototype.clear=Wn;F.prototype.delete=Bn;F.prototype.get=kn;F.prototype.has=Jn;F.prototype.set=Un;function z(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 $n(){this.__data__=[],this.size=0}function Gn(t){var e=this.__data__,n=te(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():jn.call(e,n,1),--this.size,!0}function Hn(t){var e=this.__data__,n=te(e,t);return n<0?void 0:e[n][1]}function qn(t){return te(this.__data__,t)>-1}function Kn(t,e){var n=this.__data__,i=te(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}z.prototype.clear=$n;z.prototype.delete=Gn;z.prototype.get=Hn;z.prototype.has=qn;z.prototype.set=Kn;function L(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Qn(){this.size=0,this.__data__={hash:new F,map:new(yt||z),string:new F}}function Zn(t){var e=ie(this,t).delete(t);return this.size-=e?1:0,e}function Yn(t){return ie(this,t).get(t)}function Xn(t){return ie(this,t).has(t)}function ei(t,e){var n=ie(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}L.prototype.clear=Qn;L.prototype.delete=Zn;L.prototype.get=Yn;L.prototype.has=Xn;L.prototype.set=ei;function R(t){var e=this.__data__=new z(t);this.size=e.size}function ti(){this.__data__=new z,this.size=0}function ni(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function ii(t){return this.__data__.get(t)}function si(t){return this.__data__.has(t)}function ri(t,e){var n=this.__data__;if(n instanceof z){var i=n.__data__;if(!yt||i.length<Ht-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new L(i)}return n.set(t,e),this.size=n.size,this}R.prototype.clear=ti;R.prototype.delete=ni;R.prototype.get=ii;R.prototype.has=si;R.prototype.set=ri;function oi(t,e){var n=ve(t),i=!n&&we(t),s=!n&&!i&&xt(t),r=!n&&!i&&!s&&Ot(t),a=n||i||s||r,o=a?In(t.length,String):[],c=o.length;for(var u in t)(e||x.call(t,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||wt(u,c)))&&o.push(u);return o}function be(t,e,n){(n!==void 0&&!se(t[e],n)||n===void 0&&!(e in t))&&xe(t,e,n)}function ai(t,e,n){var i=t[e];(!(x.call(t,e)&&se(i,n))||n===void 0&&!(e in t))&&xe(t,e,n)}function te(t,e){for(var n=t.length;n--;)if(se(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 ci=Si();function ne(t){return t==null?t===void 0?ln:rn:T&&T in Object(t)?wi(t):Ii(t)}function ot(t){return U(t)&&ne(t)==ut}function ui(t){if(!v(t)||Oi(t))return!1;var e=Ie(t)?Rn:zn;return e.test(Ci(t))}function li(t){return U(t)&&zt(t.length)&&!!_[ne(t)]}function di(t){if(!v(t))return Ai(t);var e=vt(t),n=[];for(var i in t)i=="constructor"&&(e||!x.call(t,i))||n.push(i);return n}function ze(t,e,n,i,s){t!==e&&ci(e,function(r,a){if(s||(s=new R),v(r))fi(t,e,a,n,ze,i,s);else{var o=i?i(Se(t,a),r,a+"",t,e,s):void 0;o===void 0&&(o=r),be(t,a,o)}},At)}function fi(t,e,n,i,s,r,a){var o=Se(t,n),c=Se(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,d=l===void 0;if(d){var f=ve(c),h=!f&&xt(c),g=!f&&!h&&Ot(c);l=c,f||h||g?ve(o)?l=o:Ei(o)?l=_i(o):h?(d=!1,l=pi(c,!0)):g?(d=!1,l=mi(c,!0)):l=[]:Li(c)||we(c)?(l=o,we(o)?l=Ri(o):(!v(o)||Ie(o))&&(l=vi(c))):d=!1}d&&(a.set(c,l),s(l,c,i,r,a),a.delete(c)),be(t,n,l)}function bt(t,e){return Fi(Ti(t,e,It),t+"")}var hi=Y?function(t,e){return Y(t,"toString",{configurable:!0,enumerable:!1,value:Pi(e),writable:!0})}:It;function pi(t,e){if(e)return t.slice();var n=t.length,i=it?it(n):new t.constructor(n);return t.copy(i),i}function gi(t){var e=new t.constructor(t.byteLength);return new nt(e).set(new nt(t)),e}function mi(t,e){var n=e?gi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function _i(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function yi(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):ai(n,o,c)}return n}function bi(t){return bt(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&&xi(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 Si(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 St(t,e,n,i,s,r){return v(t)&&v(e)&&(r.set(e,t),ze(t,e,void 0,St,r),r.delete(e)),t}function ie(t,e){var n=t.__data__;return zi(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Oe(t,e){var n=Fn(t,e);return ui(n)?n:void 0}function wi(t){var e=x.call(t,T),n=t[T];try{t[T]=void 0;var i=!0}catch{}var s=mt.call(t);return i&&(e?t[T]=n:delete t[T]),s}function vi(t){return typeof t.constructor=="function"&&!vt(t)?Nn(_t(t)):{}}function wt(t,e){var n=typeof t;return e=e??ct,!!e&&(n=="number"||n!="symbol"&&On.test(t))&&t>-1&&t%1==0&&t<e}function xi(t,e,n){if(!v(n))return!1;var i=typeof e;return(i=="number"?Ae(n)&&wt(e,n.length):i=="string"&&e in n)?se(n[e],t):!1}function zi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Oi(t){return!!et&&et in t}function vt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||X;return t===n}function Ai(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Ii(t){return mt.call(t)}function Ti(t,e,n){return e=rt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=rt(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),gt(t,this,o)}}function Se(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Fi=Mi(hi);function Mi(t){var e=0,n=0;return function(){var i=Vn(),s=Kt-(i-n);if(n=i,s>0){if(++e>=qt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ci(t){if(t!=null){try{return ee.call(t)}catch{}try{return t+""}catch{}}return""}function se(t,e){return t===e||t!==t&&e!==e}var we=ot((function(){return arguments})())?ot:function(t){return U(t)&&x.call(t,"callee")&&!Dn.call(t,"callee")},ve=Array.isArray;function Ae(t){return t!=null&&zt(t.length)&&!Ie(t)}function Ei(t){return U(t)&&Ae(t)}var xt=Pn||Vi;function Ie(t){if(!v(t))return!1;var e=ne(t);return e==lt||e==tn||e==Zt||e==on}function zt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ct}function v(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function U(t){return t!=null&&typeof t=="object"}function Li(t){if(!U(t)||ne(t)!=dt)return!1;var e=_t(t);if(e===null)return!0;var n=x.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ee.call(n)==Ln}var Ot=Xe?Tn(Xe):li;function Ri(t){return yi(t,At(t))}var Di=bt(function(t){return t.push(void 0,St),gt(ji,void 0,t)});function At(t){return Ae(t)?oi(t,!0):di(t)}var ji=bi(function(t,e,n,i){ze(t,e,n,i)});function Pi(t){return function(){return t}}function It(t){return t}function Vi(){return!1}E.exports=Di});M();M();var jt="ENTRIES",$e="KEYS",Ge="VALUES";var V=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}=C(this._path);if(C(n)==="")return{done:!1,value:this.result()};let i=e.get(C(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=C(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>C(e)).filter(e=>e!=="").join("")}value(){return C(this._path).node.get("")}result(){switch(this._type){case Ge:return this.value();case $e:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},C=t=>t[t.length-1],Pt=(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 He(t,e,n,i,a,1,s,""),i},He=(t,e,n,i,s,r,a,o)=>{let c=r*a;e:for(let u of t.keys())if(u===""){let l=s[c-1];l<=n&&i.set(o,[t.get(u),l])}else{let l=r;for(let d=0;d<u.length;++d,++l){let f=u[d],h=a*l,g=h-a,m=s[h],p=Math.max(0,l-n-1),b=Math.min(a-1,l+n);for(let S=p;S<b;++S){let oe=f!==e[S],ae=s[g+S]+ +oe,H=s[g+S+1]+1,A=s[h+S]+1,P=s[h+S+1]=Math.min(ae,H,A);P<m&&(m=P)}if(m>n)continue e}He(t.get(u),e,n,i,s,l,a,o+u)}},N=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]=Q(this._tree,e.slice(this._prefix.length));if(n===void 0){let[s,r]=ge(i);for(let a of s.keys())if(a!==""&&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,Vt(this._tree,e)}entries(){return new V(this,jt)}forEach(e){for(let[n,i]of this)e(n,i,this)}fuzzyGet(e,n){return Pt(this._tree,e,n)}get(e){let n=fe(this._tree,e);return n!==void 0?n.get(""):void 0}has(e){let n=fe(this._tree,e);return n!==void 0&&n.has("")}keys(){return new V(this,$e)}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("",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("",n(i.get(""))),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("");return s===void 0&&i.set("",s=n()),s}values(){return new V(this,Ge)}[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))}},Q=(t,e,n=[])=>{if(e.length===0||t==null)return[t,n];for(let i of t.keys())if(i!==""&&e.startsWith(i))return n.push([t,i]),Q(t.get(i),e.slice(i.length),n);return n.push([t,e]),Q(void 0,"",n)},fe=(t,e)=>{if(e.length===0||t==null)return t;for(let n of t.keys())if(n!==""&&e.startsWith(n))return fe(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!==""&&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},Vt=(t,e)=>{let[n,i]=Q(t,e);if(n!==void 0){if(n.delete(""),n.size===0)qe(i);else if(n.size===1){let[s,r]=n.entries().next().value;Ke(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!==""&&Ke(t.slice(0,-1),i,s)}},Ke=(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",Qe="and",Nt="and_not",I=class t{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let n=e.autoVacuum==null||e.autoVacuum===!0?de:e.autoVacuum;this._options={...le,...e,autoVacuum:n,searchOptions:{...We,...e.searchOptions||{}},autoSuggestOptions:{...Ut,...e.autoSuggestOptions||{}}},this._index=new N,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 "${o}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let u=this.addDocumentId(c);this.saveStoredFields(u,e);for(let l of a){let d=n(e,l);if(d==null)continue;let f=s(i(d,l),l),h=this._fieldIds[l],g=new Set(f).size;this.addFieldLength(u,h,this._documentCount-1,g);for(let m of f){let p=r(m,l);if(Array.isArray(p))for(let b of p)this.addTerm(h,u,b);else p&&this.addTerm(h,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(d=>setTimeout(d,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 "${o}"`);let u=this._idToShortId.get(c);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let l of a){let d=s(e,l);if(d==null)continue;let f=n(r(d,l),l),h=this._fieldIds[l],g=new Set(f).size;this.removeFieldLength(u,h,this._documentCount,g);for(let m of f){let p=i(m,l);if(Array.isArray(p))for(let b of p)this.removeTerm(h,u,b);else p&&this.removeTerm(h,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 N,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let n=this._idToShortId.get(e);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((i,s)=>{this.removeFieldLength(n,s,this._documentCount,i)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:n,batchSize:i,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:i,batchWait:s},{minDirtCount:n,minDirtFactor:e})}discardAll(e){let n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let i of e)this.discard(i)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(e){let{idField:n,extractField:i}=this._options,s=i(e,n);this.discard(s),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let i=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=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||he.batchSize,r=e.batchWait||he.batchWait,a=1;for(let[o,c]of this._index){for(let[u,l]of c)for(let[d]of l)this._documentIds.has(d)||(l.size<=1?c.delete(u):l.delete(d));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={...i,...n},r=this.executeQuery(e,n),a=[];for(let[o,{score:c,terms:u,match:l}]of r){let d=u.length||1,f={id:this._documentIds.get(o),score:c*d,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(f,this._storedFields.get(o)),(s.filter==null||s.filter(f))&&a.push(f)}return e===t.wildcard&&s.boostDocument==null||a.sort(ke),a}autoSuggest(e,n={}){n={...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(ke),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 "${e}"`)}static loadJS(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=q(s),c._fieldLength=q(r),c._storedFields=q(a);for(let[u,l]of c._documentIds)c._idToShortId.set(l,u);for(let[u,l]of i){let d=new Map;for(let f of Object.keys(l)){let h=l[f];o===1&&(h=h.ds),d.set(parseInt(f,10),q(h))}c._index.set(u,d)}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 K(s),c._fieldLength=await K(r),c._storedFields=await K(a);for(let[l,d]of c._documentIds)c._idToShortId.set(d,l);let u=0;for(let[l,d]of i){let f=new Map;for(let h of Object.keys(d)){let g=d[h];o===1&&(g=g.ds),f.set(parseInt(h,10),await K(g))}++u%1e3===0&&await Ze(0),c._index.set(l,f)}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 N,u}executeQuery(e,n={}){if(e===t.wildcard)return this.executeWildcardQuery(n);if(typeof e!="string"){let f={...n,...e,queries:void 0},h=e.queries.map(g=>this.executeQuery(g,f));return this.combineResults(h,f.combineWith)}let{tokenize:i,processTerm:s,searchOptions:r}=this._options,a={tokenize:i,processTerm:s,...r,...n},{tokenize:o,processTerm:c}=a,d=o(e).flatMap(f=>c(f)).filter(f=>!!f).map(Jt(a)).map(f=>this.executeQuerySpec(f,a));return this.combineResults(d,a.combineWith)}executeQuerySpec(e,n){let i={...this._options.searchOptions,...n},s=(i.fields||this._options.fields).reduce((m,p)=>({...m,[p]:ue(i.boost,p)||1}),{}),{boostDocument:r,weights:a,maxFuzzy:o,bm25:c}=i,{fuzzy:u,prefix:l}={...We.weights,...a},d=this._index.get(e.term),f=this.termResults(e.term,e.term,1,e.termBoost,d,s,r,c),h,g;if(e.prefix&&(h=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(h)for(let[m,p]of h){let b=m.length-e.term.length;if(!b)continue;g?.delete(m);let S=l*m.length/(m.length+.3*b);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,f)}if(g)for(let m of g.keys()){let[p,b]=g.get(m);if(!b)continue;let S=u*m.length/(m.length+b);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,f)}return f}executeWildcardQuery(e){let n=new Map,i={...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=Wt[i];if(!s)throw new Error(`Invalid combination operator: ${n}`);return e.reduce(s)||new Map}toJSON(){let e=[];for(let[n,i]of this._index){let s={};for(let[r,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 d=a[l],f=this._fieldIds[l],h=r.get(f);if(h==null)continue;let g=h.size,m=this._avgFieldLength[f];for(let p of h.keys()){if(!this._documentIds.has(p)){this.removeTerm(f,p,n),g-=1;continue}let b=o?o(this._documentIds.get(p),n,this._storedFields.get(p)):1;if(!b)continue;let S=h.get(p),oe=this._fieldLength.get(p)[f],ae=kt(S,g,this._documentCount,oe,m,c),H=i*s*d*b*ae,A=u.get(p);if(A){A.score+=H,$t(A.terms,e);let P=ue(A.match,n);P?P.push(l):A.match[n]=[l]}else u.set(p,{score:H,terms:[e],match:{[n]:[l]}})}}return u}addTerm(e,n,i){let s=this._index.fetch(i,Je),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,Je),r=s.get(e);r==null||r.get(n)==null?this.warnDocumentChanged(n,e,i):r.get(n)<=1?r.size<=1?s.delete(e):r.delete(n):r.set(n,r.get(n)-1),this._index.get(i).size===0&&this._index.delete(i)}warnDocumentChanged(e,n,i){for(let s of Object.keys(this._fieldIds))if(this._fieldIds[s]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${i}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let n=this._nextId;return this._idToShortId.set(e,n),this._documentIds.set(n,e),this._documentCount+=1,this._nextId+=1,n}addFields(e){for(let n=0;n<e.length;n++)this._fieldIds[e[n]]=n}addFieldLength(e,n,i,s){let r=this._fieldLength.get(e);r==null&&this._fieldLength.set(e,r=[]),r[n]=s;let 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)}}};I.wildcard=Symbol("*");var ue=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,Wt={[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},[Qe]:(t,e)=>{let n=new Map;for(let i of e.keys()){let s=t.get(i);if(s==null)continue;let{score:r,terms: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},[Nt]:(t,e)=>{for(let n of e.keys())t.delete(n);return t}},Bt={k:1.2,b:.7,d:.5},kt=(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)))},Jt=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(Gt),processTerm:t=>t.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(t,e)=>{typeof console?.[t]=="function"&&console[t](e)},autoVacuum:!0},We={combineWith:me,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Bt},Ut={combineWith:Qe,prefix:(t,e,n)=>e===n.length-1},he={batchSize:1e3,batchWait:10},pe={minDirtFactor:.1,minDirtCount:20},de={...he,...pe},$t=(t,e)=>{t.includes(e)||t.push(e)},Be=(t,e)=>{for(let n of e)t.includes(n)||t.push(n)},ke=({score:t},{score:e})=>e-t,Je=()=>new Map,q=t=>{let e=new Map;for(let n of Object.keys(t))e.set(parseInt(n,10),t[n]);return e},K=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 Ze(0);return e},Ze=t=>new Promise(e=>setTimeout(e,t)),Gt=/[\n\r\p{Z}\p{P}]+/u;var Et=Dt(Tt(),1);import{z as y}from"zod";var Ft=class{mapData;indexes;ready;joinedWords;constructor(e,n=null){this.mapData=e,this.joinedWords=n,this.indexes=Hi(e,n),this.ready=this.populate(),this.#e=Re(this.#t.bind(this),2e3)}#e;async populate(){let{places:e,enterpriseLocations:n,enterpriseCategories:i}=this.indexes,s=this.mapData,r=[];return e.removeAll(),r=r.concat([e.addAllAsync(s.getByType("space")),e.addAllAsync(s.getByType("point-of-interest")),e.addAllAsync(s.getByType("object")),e.addAllAsync(s.getByType("connection")),e.addAllAsync(s.getByType("floor")),e.addAllAsync(s.getByType("door")),e.addAllAsync(s.getByType("annotation")),e.addAllAsync(s.getByType("area"))]),n&&(n?.removeAll(),r.push(n.addAllAsync(s.getByType("enterprise-location")))),i&&(i?.removeAll(),r.push(i.addAllAsync(s.getByType("enterprise-category")))),Promise.all(r)}async search(e,n={}){await this.ready,qi.parse(n);let i=(0,Et.default)({},n,ki),s=O(e),r=Fe(this.indexes.places,s,Te(i.places,this.joinedWords),Lt);i.places.limit&&(r=r.slice(0,i.places.limit));let a=this.indexes.enterpriseLocations?Fe(this.indexes.enterpriseLocations,s,Te(i.enterpriseLocations,this.joinedWords),re):void 0;a&&i.enterpriseLocations.limit&&(a=a.slice(0,i.enterpriseLocations.limit));let o=this.indexes.enterpriseCategories?Fe(this.indexes.enterpriseCategories,s,Te(i.enterpriseCategories,this.joinedWords),re):void 0;o&&i.enterpriseCategories.limit&&(o=o.slice(0,i.enterpriseCategories.limit));let c=Ni(this.mapData,{placesResult:r,locationsResult:a,categoriesResult:o}),u=c.places.length+(c.enterpriseLocations?.length??0)+(c.enterpriseCategories?.length??0);return this.#e(e,u),c}#t(e,n){this.mapData.Analytics.capture("$query-search",{query:e,resultCount:n})}async suggest(e,n={}){await this.ready,Ki.parse(n);let i=O(e),s=[],{places:{enabled:r=!0}={},enterpriseLocations:{enabled:a=!0}={}}=n;a&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(i,Le(n.enterpriseLocations,{fields:["name","tags"],combineWith:"AND",boost:{name:2,tags:1}})).forEach(u=>s.push(u)),r&&this.indexes.places.autoSuggest(i,Le(n.places,{fields:["name"],combineWith:"AND"})).forEach(u=>s.push(u));let o=new Map;s.forEach(u=>{let l=o.get(u.suggestion);(!l||u.score>l.score)&&o.set(u.suggestion,u)});let c=Array.from(o.values());return c.sort((u,l)=>l.score-u.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:c.map(u=>u.suggestion)}),c}};function Ni(t,{placesResult:e,locationsResult:n,categoriesResult:i}){let s=e.reduce((o,{id:c,match:u,score:l,__type:d})=>{let f=t.getById(d,c);return f!=null&&!De.is(f)&&!je.is(f)&&!Pe.is(f)&&!Ve.is(f)&&!Ne.is(f)&&o.push({type:f.__type,match:u,score:l,item:f}),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 D=.2,w="nameJoined",j="tagsJoined",Lt="AND",re="OR";function Te(t,e){let n={},i=[];for(let s in t.fields)t.fields[s]&&(i.push(s),e?.name&&s==="name"&&i.push(w),e?.tags&&s==="tags"&&i.push(j));return n.fields=i,Le(t,n),n}function Le(t,e){return t?.fuzzy!==void 0&&(e.fuzzy=t.fuzzy),t?.prefix!==void 0&&(e.prefix=t.prefix),e}function Fe(t,e,n,i){let s=n.fields;if(s===void 0||!Bi(s))return t.search(e,n);let r=[],a=[];for(let d=0;d<s.length;d++)s[d]===w||s[d]===j?a.push(s[d]):r.push(s[d]);let o=t.search(e,{...n,fields:r}),c=new Set;for(let d=0;d<o.length;d++)c.add(o[d].id);let u=t.search(e,{...n,fields:i==="AND"?s:a,filter:d=>!c.has(d.id)}),l=o.concat(u);return l.sort(Wi),l}var Wi=(t,e)=>e.score-t.score;function Bi(t){for(let e=0;e<t.length;e++)if(t[e]===w||t[e]===j)return!0;return!1}var ki={places:{fuzzy:D,prefix:!0,fields:{name:!0,description:!0}},enterpriseCategories:{fuzzy:D,prefix:!0,fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fuzzy:D,prefix:!0,fields:{name:!0,tags:!0,description:!0}}},Ji=/[\u0300-\u036f|'\u2018\u2019\u02bc\u00b4\uff07]/g;function O(t){return t.normalize("NFD").replace(Ji,"").toLowerCase()}var Ui=/[\n\r\p{Z}\p{P}]+/u,Me=t=>t.split(Ui),$i=/[\p{L}\p{N}][\p{L}\p{M}\p{N}]*/gu,Ce=2,Gi=1;function Mt(t,e){if(typeof t!="string")return"";let n=O(t).match($i);if(n===null)return"";let i="";for(let s=0;s<n.length-1;s++){let r=n[s];for(let a=2;a<=e&&s+a<=n.length;a++)r+=n[s+a-1],i=i===""?r:i+" "+r}return i}function Ee(t,e,n){let i=t;if(e===w)return Mt(i.name,n);if(e!==j)return;let s=i.tags;if(!Array.isArray(s))return"";let r="";for(let a=0;a<s.length;a++){let o=Mt(s[a],n);o!==""&&(r=r===""?o:r+" "+o)}return r}function Hi(t,e){let n=e?.name===!0,i=e?.tags===!0,s=e?.maxWords??2,r=["name","description"];n&&r.push(w);let a=new I({fields:r,storeFields:["id","__type"],searchOptions:{fuzzy:D,prefix:!0,boost:n?{name:2,[w]:Ce}:{name:2},combineWith:Lt},extractField:(d,f)=>Ee(d,f,s)??(typeof d[f]=="string"?O(d[f]):d[f]),processTerm:d=>Qi.has(d)?"":d.toLowerCase(),tokenize:Me}),o=t.getByType("enterprise-location"),c;if(o){let d=["name","tags","description"];n&&d.push(w),i&&d.push(j),c=new I({fields:d,storeFields:["id","__type"],searchOptions:{combineWith:re,prefix:!0,fuzzy:D,boost:{name:3,tags:2,description:1,...n?{[w]:Ce}:{},...i?{[j]:Gi}:{}}},extractField:(f,h)=>{let g=f[h];return Ee(f,h,s)??(Array.isArray(g)?g.map(m=>typeof m=="string"?O(m):m).join(" "):typeof g=="string"?O(g):g)},tokenize:Me})}let u=t.getByType("enterprise-category"),l;if(u){let d=["name","description","locations.name"];n&&d.push(w),l=new I({fields:d,storeFields:["id","__type"],extractField(f,h){return h==="locations.name"?f.locations.reduce((m,p)=>m+` ${Ct} `+(typeof p.name=="string"?O(p.name):p.name),"")+` ${Ct}`:Ee(f,h,s)??(typeof f[h]=="string"?O(f[h]):f[h])},searchOptions:{combineWith:re,prefix:!0,fuzzy:D,boost:n?{name:2,"locations.name":2,[w]:Ce}:{name:2,"locations.name":2}},tokenize:Me})}return{enterpriseCategories:l,enterpriseLocations:c,places:a}}var $=y.number().finite().nonnegative(),G=y.custom(t=>typeof t=="boolean"||typeof t=="function"),qi=y.object({places:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional(),enterpriseCategories:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional(),"locations.name":y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional(),enterpriseLocations:y.object({fields:y.object({name:y.boolean().optional(),tags:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional()}),Ki=y.object({places:y.object({enabled:y.boolean().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional(),enterpriseLocations:y.object({enabled:y.boolean().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional()}),Qi=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),Ct="";export{Ft as InternalSearch,O as removeAccents};
1
+ import{ta as je,ua as Pe,va as Ve,wa as Ne,x as De}from"./chunk-N3AVUTI4.js";import"./chunk-IMDMEZEU.js";import{a as M,j as Re}from"./chunk-XBKEAHSJ.js";import{b as Rt,d as Dt}from"./chunk-PWEV3AFA.js";var Tt=Rt((W,E)=>{M();var Ht=200,at="__lodash_hash_undefined__",qt=800,Kt=16,ct=9007199254740991,ut="[object Arguments]",Qt="[object Array]",Zt="[object AsyncFunction]",Yt="[object Boolean]",Xt="[object Date]",en="[object Error]",lt="[object Function]",tn="[object GeneratorFunction]",nn="[object Map]",sn="[object Number]",rn="[object Null]",dt="[object Object]",on="[object Proxy]",an="[object RegExp]",cn="[object Set]",un="[object String]",ln="[object Undefined]",dn="[object WeakMap]",fn="[object ArrayBuffer]",hn="[object DataView]",pn="[object Float32Array]",gn="[object Float64Array]",mn="[object Int8Array]",_n="[object Int16Array]",yn="[object Int32Array]",bn="[object Uint8Array]",Sn="[object Uint8ClampedArray]",wn="[object Uint16Array]",vn="[object Uint32Array]",xn=/[\\^$.*+?()[\]{}|]/g,zn=/^\[object .+?Constructor\]$/,On=/^(?:0|[1-9]\d*)$/,_={};_[pn]=_[gn]=_[mn]=_[_n]=_[yn]=_[bn]=_[Sn]=_[wn]=_[vn]=!0;_[ut]=_[Qt]=_[fn]=_[Yt]=_[hn]=_[Xt]=_[en]=_[lt]=_[nn]=_[sn]=_[dt]=_[an]=_[cn]=_[un]=_[dn]=!1;var ft=typeof global=="object"&&global&&global.Object===Object&&global,An=typeof self=="object"&&self&&self.Object===Object&&self,J=ft||An||Function("return this")(),ht=typeof W=="object"&&W&&!W.nodeType&&W,B=ht&&typeof E=="object"&&E&&!E.nodeType&&E,pt=B&&B.exports===ht,_e=pt&&ft.process,Ye=(function(){try{var t=B&&B.require&&B.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch{}})(),Xe=Ye&&Ye.isTypedArray;function gt(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 Fn(t,e){return t?.[e]}function Mn(t,e){return function(n){return t(e(n))}}var Cn=Array.prototype,En=Function.prototype,X=Object.prototype,ye=J["__core-js_shared__"],ee=En.toString,x=X.hasOwnProperty,et=(function(){var t=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),mt=X.toString,Ln=ee.call(Object),Rn=RegExp("^"+ee.call(x).replace(xn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=pt?J.Buffer:void 0,tt=J.Symbol,nt=J.Uint8Array,it=Z?Z.allocUnsafe:void 0,_t=Mn(Object.getPrototypeOf,Object),st=Object.create,Dn=X.propertyIsEnumerable,jn=Cn.splice,T=tt?tt.toStringTag:void 0,Y=(function(){try{var t=Oe(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Pn=Z?Z.isBuffer:void 0,rt=Math.max,Vn=Date.now,yt=Oe(J,"Map"),k=Oe(Object,"create"),Nn=(function(){function t(){}return function(e){if(!v(e))return{};if(st)return st(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function F(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__=k?k(null):{},this.size=0}function Bn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function kn(t){var e=this.__data__;if(k){var n=e[t];return n===at?void 0:n}return x.call(e,t)?e[t]:void 0}function Jn(t){var e=this.__data__;return k?e[t]!==void 0:x.call(e,t)}function Un(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=k&&e===void 0?at:e,this}F.prototype.clear=Wn;F.prototype.delete=Bn;F.prototype.get=kn;F.prototype.has=Jn;F.prototype.set=Un;function z(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 $n(){this.__data__=[],this.size=0}function Gn(t){var e=this.__data__,n=te(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():jn.call(e,n,1),--this.size,!0}function Hn(t){var e=this.__data__,n=te(e,t);return n<0?void 0:e[n][1]}function qn(t){return te(this.__data__,t)>-1}function Kn(t,e){var n=this.__data__,i=te(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}z.prototype.clear=$n;z.prototype.delete=Gn;z.prototype.get=Hn;z.prototype.has=qn;z.prototype.set=Kn;function L(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Qn(){this.size=0,this.__data__={hash:new F,map:new(yt||z),string:new F}}function Zn(t){var e=ie(this,t).delete(t);return this.size-=e?1:0,e}function Yn(t){return ie(this,t).get(t)}function Xn(t){return ie(this,t).has(t)}function ei(t,e){var n=ie(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}L.prototype.clear=Qn;L.prototype.delete=Zn;L.prototype.get=Yn;L.prototype.has=Xn;L.prototype.set=ei;function R(t){var e=this.__data__=new z(t);this.size=e.size}function ti(){this.__data__=new z,this.size=0}function ni(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function ii(t){return this.__data__.get(t)}function si(t){return this.__data__.has(t)}function ri(t,e){var n=this.__data__;if(n instanceof z){var i=n.__data__;if(!yt||i.length<Ht-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new L(i)}return n.set(t,e),this.size=n.size,this}R.prototype.clear=ti;R.prototype.delete=ni;R.prototype.get=ii;R.prototype.has=si;R.prototype.set=ri;function oi(t,e){var n=ve(t),i=!n&&we(t),s=!n&&!i&&xt(t),r=!n&&!i&&!s&&Ot(t),a=n||i||s||r,o=a?In(t.length,String):[],c=o.length;for(var u in t)(e||x.call(t,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||wt(u,c)))&&o.push(u);return o}function be(t,e,n){(n!==void 0&&!se(t[e],n)||n===void 0&&!(e in t))&&xe(t,e,n)}function ai(t,e,n){var i=t[e];(!(x.call(t,e)&&se(i,n))||n===void 0&&!(e in t))&&xe(t,e,n)}function te(t,e){for(var n=t.length;n--;)if(se(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 ci=Si();function ne(t){return t==null?t===void 0?ln:rn:T&&T in Object(t)?wi(t):Ii(t)}function ot(t){return U(t)&&ne(t)==ut}function ui(t){if(!v(t)||Oi(t))return!1;var e=Ie(t)?Rn:zn;return e.test(Ci(t))}function li(t){return U(t)&&zt(t.length)&&!!_[ne(t)]}function di(t){if(!v(t))return Ai(t);var e=vt(t),n=[];for(var i in t)i=="constructor"&&(e||!x.call(t,i))||n.push(i);return n}function ze(t,e,n,i,s){t!==e&&ci(e,function(r,a){if(s||(s=new R),v(r))fi(t,e,a,n,ze,i,s);else{var o=i?i(Se(t,a),r,a+"",t,e,s):void 0;o===void 0&&(o=r),be(t,a,o)}},At)}function fi(t,e,n,i,s,r,a){var o=Se(t,n),c=Se(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,d=l===void 0;if(d){var f=ve(c),h=!f&&xt(c),g=!f&&!h&&Ot(c);l=c,f||h||g?ve(o)?l=o:Ei(o)?l=_i(o):h?(d=!1,l=pi(c,!0)):g?(d=!1,l=mi(c,!0)):l=[]:Li(c)||we(c)?(l=o,we(o)?l=Ri(o):(!v(o)||Ie(o))&&(l=vi(c))):d=!1}d&&(a.set(c,l),s(l,c,i,r,a),a.delete(c)),be(t,n,l)}function bt(t,e){return Fi(Ti(t,e,It),t+"")}var hi=Y?function(t,e){return Y(t,"toString",{configurable:!0,enumerable:!1,value:Pi(e),writable:!0})}:It;function pi(t,e){if(e)return t.slice();var n=t.length,i=it?it(n):new t.constructor(n);return t.copy(i),i}function gi(t){var e=new t.constructor(t.byteLength);return new nt(e).set(new nt(t)),e}function mi(t,e){var n=e?gi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function _i(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function yi(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):ai(n,o,c)}return n}function bi(t){return bt(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&&xi(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 Si(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 St(t,e,n,i,s,r){return v(t)&&v(e)&&(r.set(e,t),ze(t,e,void 0,St,r),r.delete(e)),t}function ie(t,e){var n=t.__data__;return zi(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Oe(t,e){var n=Fn(t,e);return ui(n)?n:void 0}function wi(t){var e=x.call(t,T),n=t[T];try{t[T]=void 0;var i=!0}catch{}var s=mt.call(t);return i&&(e?t[T]=n:delete t[T]),s}function vi(t){return typeof t.constructor=="function"&&!vt(t)?Nn(_t(t)):{}}function wt(t,e){var n=typeof t;return e=e??ct,!!e&&(n=="number"||n!="symbol"&&On.test(t))&&t>-1&&t%1==0&&t<e}function xi(t,e,n){if(!v(n))return!1;var i=typeof e;return(i=="number"?Ae(n)&&wt(e,n.length):i=="string"&&e in n)?se(n[e],t):!1}function zi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Oi(t){return!!et&&et in t}function vt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||X;return t===n}function Ai(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Ii(t){return mt.call(t)}function Ti(t,e,n){return e=rt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=rt(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),gt(t,this,o)}}function Se(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Fi=Mi(hi);function Mi(t){var e=0,n=0;return function(){var i=Vn(),s=Kt-(i-n);if(n=i,s>0){if(++e>=qt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ci(t){if(t!=null){try{return ee.call(t)}catch{}try{return t+""}catch{}}return""}function se(t,e){return t===e||t!==t&&e!==e}var we=ot((function(){return arguments})())?ot:function(t){return U(t)&&x.call(t,"callee")&&!Dn.call(t,"callee")},ve=Array.isArray;function Ae(t){return t!=null&&zt(t.length)&&!Ie(t)}function Ei(t){return U(t)&&Ae(t)}var xt=Pn||Vi;function Ie(t){if(!v(t))return!1;var e=ne(t);return e==lt||e==tn||e==Zt||e==on}function zt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ct}function v(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function U(t){return t!=null&&typeof t=="object"}function Li(t){if(!U(t)||ne(t)!=dt)return!1;var e=_t(t);if(e===null)return!0;var n=x.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ee.call(n)==Ln}var Ot=Xe?Tn(Xe):li;function Ri(t){return yi(t,At(t))}var Di=bt(function(t){return t.push(void 0,St),gt(ji,void 0,t)});function At(t){return Ae(t)?oi(t,!0):di(t)}var ji=bi(function(t,e,n,i){ze(t,e,n,i)});function Pi(t){return function(){return t}}function It(t){return t}function Vi(){return!1}E.exports=Di});M();M();var jt="ENTRIES",$e="KEYS",Ge="VALUES";var V=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}=C(this._path);if(C(n)==="")return{done:!1,value:this.result()};let i=e.get(C(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=C(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>C(e)).filter(e=>e!=="").join("")}value(){return C(this._path).node.get("")}result(){switch(this._type){case Ge:return this.value();case $e:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},C=t=>t[t.length-1],Pt=(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 He(t,e,n,i,a,1,s,""),i},He=(t,e,n,i,s,r,a,o)=>{let c=r*a;e:for(let u of t.keys())if(u===""){let l=s[c-1];l<=n&&i.set(o,[t.get(u),l])}else{let l=r;for(let d=0;d<u.length;++d,++l){let f=u[d],h=a*l,g=h-a,m=s[h],p=Math.max(0,l-n-1),b=Math.min(a-1,l+n);for(let S=p;S<b;++S){let oe=f!==e[S],ae=s[g+S]+ +oe,H=s[g+S+1]+1,A=s[h+S]+1,P=s[h+S+1]=Math.min(ae,H,A);P<m&&(m=P)}if(m>n)continue e}He(t.get(u),e,n,i,s,l,a,o+u)}},N=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]=Q(this._tree,e.slice(this._prefix.length));if(n===void 0){let[s,r]=ge(i);for(let a of s.keys())if(a!==""&&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,Vt(this._tree,e)}entries(){return new V(this,jt)}forEach(e){for(let[n,i]of this)e(n,i,this)}fuzzyGet(e,n){return Pt(this._tree,e,n)}get(e){let n=fe(this._tree,e);return n!==void 0?n.get(""):void 0}has(e){let n=fe(this._tree,e);return n!==void 0&&n.has("")}keys(){return new V(this,$e)}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("",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("",n(i.get(""))),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("");return s===void 0&&i.set("",s=n()),s}values(){return new V(this,Ge)}[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))}},Q=(t,e,n=[])=>{if(e.length===0||t==null)return[t,n];for(let i of t.keys())if(i!==""&&e.startsWith(i))return n.push([t,i]),Q(t.get(i),e.slice(i.length),n);return n.push([t,e]),Q(void 0,"",n)},fe=(t,e)=>{if(e.length===0||t==null)return t;for(let n of t.keys())if(n!==""&&e.startsWith(n))return fe(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!==""&&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},Vt=(t,e)=>{let[n,i]=Q(t,e);if(n!==void 0){if(n.delete(""),n.size===0)qe(i);else if(n.size===1){let[s,r]=n.entries().next().value;Ke(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!==""&&Ke(t.slice(0,-1),i,s)}},Ke=(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",Qe="and",Nt="and_not",I=class t{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let n=e.autoVacuum==null||e.autoVacuum===!0?de:e.autoVacuum;this._options={...le,...e,autoVacuum:n,searchOptions:{...We,...e.searchOptions||{}},autoSuggestOptions:{...Ut,...e.autoSuggestOptions||{}}},this._index=new N,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 "${o}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let u=this.addDocumentId(c);this.saveStoredFields(u,e);for(let l of a){let d=n(e,l);if(d==null)continue;let f=s(i(d,l),l),h=this._fieldIds[l],g=new Set(f).size;this.addFieldLength(u,h,this._documentCount-1,g);for(let m of f){let p=r(m,l);if(Array.isArray(p))for(let b of p)this.addTerm(h,u,b);else p&&this.addTerm(h,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(d=>setTimeout(d,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 "${o}"`);let u=this._idToShortId.get(c);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let l of a){let d=s(e,l);if(d==null)continue;let f=n(r(d,l),l),h=this._fieldIds[l],g=new Set(f).size;this.removeFieldLength(u,h,this._documentCount,g);for(let m of f){let p=i(m,l);if(Array.isArray(p))for(let b of p)this.removeTerm(h,u,b);else p&&this.removeTerm(h,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 N,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let n=this._idToShortId.get(e);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((i,s)=>{this.removeFieldLength(n,s,this._documentCount,i)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:n,batchSize:i,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:i,batchWait:s},{minDirtCount:n,minDirtFactor:e})}discardAll(e){let n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let i of e)this.discard(i)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(e){let{idField:n,extractField:i}=this._options,s=i(e,n);this.discard(s),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let i=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=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||he.batchSize,r=e.batchWait||he.batchWait,a=1;for(let[o,c]of this._index){for(let[u,l]of c)for(let[d]of l)this._documentIds.has(d)||(l.size<=1?c.delete(u):l.delete(d));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={...i,...n},r=this.executeQuery(e,n),a=[];for(let[o,{score:c,terms:u,match:l}]of r){let d=u.length||1,f={id:this._documentIds.get(o),score:c*d,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(f,this._storedFields.get(o)),(s.filter==null||s.filter(f))&&a.push(f)}return e===t.wildcard&&s.boostDocument==null||a.sort(ke),a}autoSuggest(e,n={}){n={...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(ke),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 "${e}"`)}static loadJS(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=q(s),c._fieldLength=q(r),c._storedFields=q(a);for(let[u,l]of c._documentIds)c._idToShortId.set(l,u);for(let[u,l]of i){let d=new Map;for(let f of Object.keys(l)){let h=l[f];o===1&&(h=h.ds),d.set(parseInt(f,10),q(h))}c._index.set(u,d)}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 K(s),c._fieldLength=await K(r),c._storedFields=await K(a);for(let[l,d]of c._documentIds)c._idToShortId.set(d,l);let u=0;for(let[l,d]of i){let f=new Map;for(let h of Object.keys(d)){let g=d[h];o===1&&(g=g.ds),f.set(parseInt(h,10),await K(g))}++u%1e3===0&&await Ze(0),c._index.set(l,f)}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 N,u}executeQuery(e,n={}){if(e===t.wildcard)return this.executeWildcardQuery(n);if(typeof e!="string"){let f={...n,...e,queries:void 0},h=e.queries.map(g=>this.executeQuery(g,f));return this.combineResults(h,f.combineWith)}let{tokenize:i,processTerm:s,searchOptions:r}=this._options,a={tokenize:i,processTerm:s,...r,...n},{tokenize:o,processTerm:c}=a,d=o(e).flatMap(f=>c(f)).filter(f=>!!f).map(Jt(a)).map(f=>this.executeQuerySpec(f,a));return this.combineResults(d,a.combineWith)}executeQuerySpec(e,n){let i={...this._options.searchOptions,...n},s=(i.fields||this._options.fields).reduce((m,p)=>({...m,[p]:ue(i.boost,p)||1}),{}),{boostDocument:r,weights:a,maxFuzzy:o,bm25:c}=i,{fuzzy:u,prefix:l}={...We.weights,...a},d=this._index.get(e.term),f=this.termResults(e.term,e.term,1,e.termBoost,d,s,r,c),h,g;if(e.prefix&&(h=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(h)for(let[m,p]of h){let b=m.length-e.term.length;if(!b)continue;g?.delete(m);let S=l*m.length/(m.length+.3*b);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,f)}if(g)for(let m of g.keys()){let[p,b]=g.get(m);if(!b)continue;let S=u*m.length/(m.length+b);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,f)}return f}executeWildcardQuery(e){let n=new Map,i={...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=Wt[i];if(!s)throw new Error(`Invalid combination operator: ${n}`);return e.reduce(s)||new Map}toJSON(){let e=[];for(let[n,i]of this._index){let s={};for(let[r,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 d=a[l],f=this._fieldIds[l],h=r.get(f);if(h==null)continue;let g=h.size,m=this._avgFieldLength[f];for(let p of h.keys()){if(!this._documentIds.has(p)){this.removeTerm(f,p,n),g-=1;continue}let b=o?o(this._documentIds.get(p),n,this._storedFields.get(p)):1;if(!b)continue;let S=h.get(p),oe=this._fieldLength.get(p)[f],ae=kt(S,g,this._documentCount,oe,m,c),H=i*s*d*b*ae,A=u.get(p);if(A){A.score+=H,$t(A.terms,e);let P=ue(A.match,n);P?P.push(l):A.match[n]=[l]}else u.set(p,{score:H,terms:[e],match:{[n]:[l]}})}}return u}addTerm(e,n,i){let s=this._index.fetch(i,Je),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,Je),r=s.get(e);r==null||r.get(n)==null?this.warnDocumentChanged(n,e,i):r.get(n)<=1?r.size<=1?s.delete(e):r.delete(n):r.set(n,r.get(n)-1),this._index.get(i).size===0&&this._index.delete(i)}warnDocumentChanged(e,n,i){for(let s of Object.keys(this._fieldIds))if(this._fieldIds[s]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${i}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let n=this._nextId;return this._idToShortId.set(e,n),this._documentIds.set(n,e),this._documentCount+=1,this._nextId+=1,n}addFields(e){for(let n=0;n<e.length;n++)this._fieldIds[e[n]]=n}addFieldLength(e,n,i,s){let r=this._fieldLength.get(e);r==null&&this._fieldLength.set(e,r=[]),r[n]=s;let 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)}}};I.wildcard=Symbol("*");var ue=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,Wt={[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},[Qe]:(t,e)=>{let n=new Map;for(let i of e.keys()){let s=t.get(i);if(s==null)continue;let{score:r,terms: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},[Nt]:(t,e)=>{for(let n of e.keys())t.delete(n);return t}},Bt={k:1.2,b:.7,d:.5},kt=(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)))},Jt=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(Gt),processTerm:t=>t.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(t,e)=>{typeof console?.[t]=="function"&&console[t](e)},autoVacuum:!0},We={combineWith:me,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Bt},Ut={combineWith:Qe,prefix:(t,e,n)=>e===n.length-1},he={batchSize:1e3,batchWait:10},pe={minDirtFactor:.1,minDirtCount:20},de={...he,...pe},$t=(t,e)=>{t.includes(e)||t.push(e)},Be=(t,e)=>{for(let n of e)t.includes(n)||t.push(n)},ke=({score:t},{score:e})=>e-t,Je=()=>new Map,q=t=>{let e=new Map;for(let n of Object.keys(t))e.set(parseInt(n,10),t[n]);return e},K=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 Ze(0);return e},Ze=t=>new Promise(e=>setTimeout(e,t)),Gt=/[\n\r\p{Z}\p{P}]+/u;var Et=Dt(Tt(),1);import{z as y}from"zod";var Ft=class{mapData;indexes;ready;joinedWords;constructor(e,n=null){this.mapData=e,this.joinedWords=n,this.indexes=Hi(e,n),this.ready=this.populate(),this.#e=Re(this.#t.bind(this),2e3)}#e;async populate(){let{places:e,enterpriseLocations:n,enterpriseCategories:i}=this.indexes,s=this.mapData,r=[];return e.removeAll(),r=r.concat([e.addAllAsync(s.getByType("space")),e.addAllAsync(s.getByType("point-of-interest")),e.addAllAsync(s.getByType("object")),e.addAllAsync(s.getByType("connection")),e.addAllAsync(s.getByType("floor")),e.addAllAsync(s.getByType("door")),e.addAllAsync(s.getByType("annotation")),e.addAllAsync(s.getByType("area"))]),n&&(n?.removeAll(),r.push(n.addAllAsync(s.getByType("enterprise-location")))),i&&(i?.removeAll(),r.push(i.addAllAsync(s.getByType("enterprise-category")))),Promise.all(r)}async search(e,n={}){await this.ready,qi.parse(n);let i=(0,Et.default)({},n,ki),s=O(e),r=Fe(this.indexes.places,s,Te(i.places,this.joinedWords),Lt);i.places.limit&&(r=r.slice(0,i.places.limit));let a=this.indexes.enterpriseLocations?Fe(this.indexes.enterpriseLocations,s,Te(i.enterpriseLocations,this.joinedWords),re):void 0;a&&i.enterpriseLocations.limit&&(a=a.slice(0,i.enterpriseLocations.limit));let o=this.indexes.enterpriseCategories?Fe(this.indexes.enterpriseCategories,s,Te(i.enterpriseCategories,this.joinedWords),re):void 0;o&&i.enterpriseCategories.limit&&(o=o.slice(0,i.enterpriseCategories.limit));let c=Ni(this.mapData,{placesResult:r,locationsResult:a,categoriesResult:o}),u=c.places.length+(c.enterpriseLocations?.length??0)+(c.enterpriseCategories?.length??0);return this.#e(e,u),c}#t(e,n){this.mapData.Analytics.capture("$query-search",{query:e,resultCount:n})}async suggest(e,n={}){await this.ready,Ki.parse(n);let i=O(e),s=[],{places:{enabled:r=!0}={},enterpriseLocations:{enabled:a=!0}={}}=n;a&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(i,Le(n.enterpriseLocations,{fields:["name","tags"],combineWith:"AND",boost:{name:2,tags:1}})).forEach(u=>s.push(u)),r&&this.indexes.places.autoSuggest(i,Le(n.places,{fields:["name"],combineWith:"AND"})).forEach(u=>s.push(u));let o=new Map;s.forEach(u=>{let l=o.get(u.suggestion);(!l||u.score>l.score)&&o.set(u.suggestion,u)});let c=Array.from(o.values());return c.sort((u,l)=>l.score-u.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:c.map(u=>u.suggestion)}),c}};function Ni(t,{placesResult:e,locationsResult:n,categoriesResult:i}){let s=e.reduce((o,{id:c,match:u,score:l,__type:d})=>{let f=t.getById(d,c);return f!=null&&!De.is(f)&&!je.is(f)&&!Pe.is(f)&&!Ve.is(f)&&!Ne.is(f)&&o.push({type:f.__type,match:u,score:l,item:f}),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 D=.2,w="nameJoined",j="tagsJoined",Lt="AND",re="OR";function Te(t,e){let n={},i=[];for(let s in t.fields)t.fields[s]&&(i.push(s),e?.name&&s==="name"&&i.push(w),e?.tags&&s==="tags"&&i.push(j));return n.fields=i,Le(t,n),n}function Le(t,e){return t?.fuzzy!==void 0&&(e.fuzzy=t.fuzzy),t?.prefix!==void 0&&(e.prefix=t.prefix),e}function Fe(t,e,n,i){let s=n.fields;if(s===void 0||!Bi(s))return t.search(e,n);let r=[],a=[];for(let d=0;d<s.length;d++)s[d]===w||s[d]===j?a.push(s[d]):r.push(s[d]);let o=t.search(e,{...n,fields:r}),c=new Set;for(let d=0;d<o.length;d++)c.add(o[d].id);let u=t.search(e,{...n,fields:i==="AND"?s:a,filter:d=>!c.has(d.id)}),l=o.concat(u);return l.sort(Wi),l}var Wi=(t,e)=>e.score-t.score;function Bi(t){for(let e=0;e<t.length;e++)if(t[e]===w||t[e]===j)return!0;return!1}var ki={places:{fuzzy:D,prefix:!0,fields:{name:!0,description:!0}},enterpriseCategories:{fuzzy:D,prefix:!0,fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fuzzy:D,prefix:!0,fields:{name:!0,tags:!0,description:!0}}},Ji=/[\u0300-\u036f|'\u2018\u2019\u02bc\u00b4\uff07]/g;function O(t){return t.normalize("NFD").replace(Ji,"").toLowerCase()}var Ui=/[\n\r\p{Z}\p{P}]+/u,Me=t=>t.split(Ui),$i=/[\p{L}\p{N}][\p{L}\p{M}\p{N}]*/gu,Ce=2,Gi=1;function Mt(t,e){if(typeof t!="string")return"";let n=O(t).match($i);if(n===null)return"";let i="";for(let s=0;s<n.length-1;s++){let r=n[s];for(let a=2;a<=e&&s+a<=n.length;a++)r+=n[s+a-1],i=i===""?r:i+" "+r}return i}function Ee(t,e,n){let i=t;if(e===w)return Mt(i.name,n);if(e!==j)return;let s=i.tags;if(!Array.isArray(s))return"";let r="";for(let a=0;a<s.length;a++){let o=Mt(s[a],n);o!==""&&(r=r===""?o:r+" "+o)}return r}function Hi(t,e){let n=e?.name===!0,i=e?.tags===!0,s=e?.maxWords??2,r=["name","description"];n&&r.push(w);let a=new I({fields:r,storeFields:["id","__type"],searchOptions:{fuzzy:D,prefix:!0,boost:n?{name:2,[w]:Ce}:{name:2},combineWith:Lt},extractField:(d,f)=>Ee(d,f,s)??(typeof d[f]=="string"?O(d[f]):d[f]),processTerm:d=>Qi.has(d)?"":d.toLowerCase(),tokenize:Me}),o=t.getByType("enterprise-location"),c;if(o){let d=["name","tags","description"];n&&d.push(w),i&&d.push(j),c=new I({fields:d,storeFields:["id","__type"],searchOptions:{combineWith:re,prefix:!0,fuzzy:D,boost:{name:3,tags:2,description:1,...n?{[w]:Ce}:{},...i?{[j]:Gi}:{}}},extractField:(f,h)=>{let g=f[h];return Ee(f,h,s)??(Array.isArray(g)?g.map(m=>typeof m=="string"?O(m):m).join(" "):typeof g=="string"?O(g):g)},tokenize:Me})}let u=t.getByType("enterprise-category"),l;if(u){let d=["name","description","locations.name"];n&&d.push(w),l=new I({fields:d,storeFields:["id","__type"],extractField(f,h){return h==="locations.name"?f.locations.reduce((m,p)=>m+` ${Ct} `+(typeof p.name=="string"?O(p.name):p.name),"")+` ${Ct}`:Ee(f,h,s)??(typeof f[h]=="string"?O(f[h]):f[h])},searchOptions:{combineWith:re,prefix:!0,fuzzy:D,boost:n?{name:2,"locations.name":2,[w]:Ce}:{name:2,"locations.name":2}},tokenize:Me})}return{enterpriseCategories:l,enterpriseLocations:c,places:a}}var $=y.number().finite().nonnegative(),G=y.custom(t=>typeof t=="boolean"||typeof t=="function"),qi=y.object({places:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional(),enterpriseCategories:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional(),"locations.name":y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional(),enterpriseLocations:y.object({fields:y.object({name:y.boolean().optional(),tags:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional()}),Ki=y.object({places:y.object({enabled:y.boolean().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional(),enterpriseLocations:y.object({enabled:y.boolean().optional(),fuzzy:$.optional(),prefix:G.optional()}).optional()}),Qi=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),Ct="";export{Ft as InternalSearch,O as removeAccents};
@@ -1 +1 @@
1
- import{b as n,c as o,e as p,f as q,g as r,h as s,i as t,j as u,k as v,l as w}from"./chunk-PQ2OLSSS.js";import{B as i,E as j,ta as k,ua as l,y as h,zb as m}from"./chunk-SAPR7Z5M.js";import{z as b}from"./chunk-J5TYCDYA.js";import{a as c,t as d,u as e,v as f,w as g}from"./chunk-ZJEQSG7Y.js";import{j as a}from"./chunk-7B7J4IXM.js";import"./chunk-PWEV3AFA.js";export{n as ANIMATION_TWEENS,o as ATTRIBUTION_POSITIONS,d as COLLISION_WORKER_PATH,j as DEFAULT_PATH_SMOOTHING,e as MAPLIBRE_WORKER_PATH,h as MAPPEDIN_LAYER_ID,v as MapLibreOverlay,b as Navigator,p as PROJECT_BATCH_INPUT_STRIDE,q as PROJECT_BATCH_STRIDE,s as PROJECT_BEHIND_CAMERA,r as ProjectBatchFlags,t as RendererCore,i as STENCIL_REF,m as TEXT3D_STYLE_UPDATE_PROPS,f as collisionWorkerUrl,k as configureWorker,w as createRenderer,a as debounce,c as interpolate,u as mountSceneGraphVisualizer,l as preloadFont,g as setCollisionWorkerUrl};
1
+ import{b as n,c as o,e as p,f as q,g as r,h as s,i as t,j as u,k as v,l as w}from"./chunk-GTWQKKFE.js";import{Bb as m,C as i,F as j,ua as k,va as l,z as h}from"./chunk-DC7JFA2T.js";import{z as b}from"./chunk-IMDMEZEU.js";import{a as c,t as d,u as e,v as f,w as g}from"./chunk-TFGILZUF.js";import{j as a}from"./chunk-XBKEAHSJ.js";import"./chunk-PWEV3AFA.js";export{n as ANIMATION_TWEENS,o as ATTRIBUTION_POSITIONS,d as COLLISION_WORKER_PATH,j as DEFAULT_PATH_SMOOTHING,e as MAPLIBRE_WORKER_PATH,h as MAPPEDIN_LAYER_ID,v as MapLibreOverlay,b as Navigator,p as PROJECT_BATCH_INPUT_STRIDE,q as PROJECT_BATCH_STRIDE,s as PROJECT_BEHIND_CAMERA,r as ProjectBatchFlags,t as RendererCore,i as STENCIL_REF,m as TEXT3D_STYLE_UPDATE_PROPS,f as collisionWorkerUrl,k as configureWorker,w as createRenderer,a as debounce,c as interpolate,u as mountSceneGraphVisualizer,l as preloadFont,g as setCollisionWorkerUrl};
@@ -1 +1 @@
1
- import{P as k,ha as r,la as w,ma as y,na as Y,oa as S,pa as B,qa as b,ra as O}from"./chunk-SAPR7Z5M.js";import"./chunk-ZJEQSG7Y.js";import{a as A}from"./chunk-7B7J4IXM.js";import"./chunk-PWEV3AFA.js";A();import{MathUtils as P,Matrix4 as E,Vector3 as z}from"three";function H({useWorker:s=!0}){w({useWorker:s})}var u=new E,i=new z,I=new z(0,0,1);async function U(s,f,o,d){let n=f.feature.properties,t=new y;f.textMesh=t,t.text=n.text,t.anchorX="center",t.anchorY="middle",t.textAlign=n.align??"center",t.color=n.color??"black",t.fontSize=n.fontSize||20;let a=o.font??r.font;a?t.font=a:l?t.font=await l:t.font=await O(),t.outlineOpacity=o.outlineOpacity??r.outlineOpacity,t.outlineColor=o.outlineColor??r.outlineColor,t.outlineOffsetY=o.outlineOffsetY??r.outlineOffsetY,t.outlineOffsetX=o.outlineOffsetX??r.outlineOffsetX,t.outlineWidth=o.outlineWidth??r.outlineWidth,t.outlineBlur=o.outlineBlur??r.outlineBlur,t.strokeWidth=o.strokeWidth??r.strokeWidth,t.strokeColor=o.strokeColor??r.strokeColor,t.strokeOpacity=o.strokeOpacity??r.strokeOpacity;let p=d(f.feature.geometry.coordinates);t.position.copy(p),t.position.z=n.verticalOffset;let c=k(P.degToRad(-n.rotation));return t.rotation.z=c,t.userData={entityId:s.toString(),rotationZ:c},{text:t}}async function $(s,f,o,d){let n=f.feature.properties,{textArea:t}=n;if(!t)throw new Error("textArea is required");let a=o.margin??r.margin,[p,c,D,m]=Array.isArray(a)?a:[a,a,a,a],e=new y;e.text=n.content;let g=t.maxHeight-p-D,M=t.maxWidth-m-c;e.fontSize=Math.min(g,o.fontSize??r.fontSize),e.color=o.color??r.color,e.maxWidth=o.maxWidth??M,e.anchorX="center",e.anchorY="middle",e.textAlign="center";let W=o.font??r.font;W?e.font=W:l?e.font=await l:e.font=await O(),e.outlineOpacity=o.outlineOpacity??r.outlineOpacity,e.outlineColor=o.outlineColor??r.outlineColor,e.outlineOffsetY=o.outlineOffsetY??r.outlineOffsetY,e.outlineOffsetX=o.outlineOffsetX??r.outlineOffsetX,e.outlineWidth=o.outlineWidth??r.outlineWidth,e.outlineBlur=o.outlineBlur??r.outlineBlur,e.strokeWidth=o.strokeWidth??r.strokeWidth,e.strokeColor=o.strokeColor??r.strokeColor,e.strokeOpacity=o.strokeOpacity??r.strokeOpacity;let F=d(t.position,i);e.position.copy(F);let x=k(Math.PI/2-P.degToRad(t.rotation));e.rotation.z=x,e.userData={entityId:s.toString(),rotationZ:x};let T,h;try{h=(await B(e,M,g,e.fontSize*.2)).size}catch(X){throw e.dispose?.(),new Error(`Cannot fit text to area: entityId: ${f.polygonEntityId} ${X}`)}if(h)return u.identity(),i.set(0,0,1),u.makeRotationAxis(I,x),i.set(t.align==="near"?m+h[0]/2:t.maxWidth/2,0,0),i.applyMatrix4(u),e.position.x-=i.x,e.position.y-=i.y,f.textMesh=e,T&&(i.set(t.maxWidth/2,0,0),i.applyMatrix4(u),T.position.x-=i.x,T.position.y-=i.y),{text:e}}var l;function q(s){return l=S(s),l}export{Y as BatchedText,y as Text,H as configureTroikaTextBuilder,$ as createTroikaTextArea,U as createTroikaTextPoint,l as fontPreloadLoadPromise,q as preloadFont,b as syncText};
1
+ import{Q as k,ia as r,ma as w,na as y,oa as Y,pa as S,qa as B,ra as b,sa as O}from"./chunk-DC7JFA2T.js";import"./chunk-TFGILZUF.js";import{a as A}from"./chunk-XBKEAHSJ.js";import"./chunk-PWEV3AFA.js";A();import{MathUtils as P,Matrix4 as E,Vector3 as z}from"three";function H({useWorker:s=!0}){w({useWorker:s})}var u=new E,i=new z,I=new z(0,0,1);async function U(s,f,o,d){let n=f.feature.properties,t=new y;f.textMesh=t,t.text=n.text,t.anchorX="center",t.anchorY="middle",t.textAlign=n.align??"center",t.color=n.color??"black",t.fontSize=n.fontSize||20;let a=o.font??r.font;a?t.font=a:l?t.font=await l:t.font=await O(),t.outlineOpacity=o.outlineOpacity??r.outlineOpacity,t.outlineColor=o.outlineColor??r.outlineColor,t.outlineOffsetY=o.outlineOffsetY??r.outlineOffsetY,t.outlineOffsetX=o.outlineOffsetX??r.outlineOffsetX,t.outlineWidth=o.outlineWidth??r.outlineWidth,t.outlineBlur=o.outlineBlur??r.outlineBlur,t.strokeWidth=o.strokeWidth??r.strokeWidth,t.strokeColor=o.strokeColor??r.strokeColor,t.strokeOpacity=o.strokeOpacity??r.strokeOpacity;let p=d(f.feature.geometry.coordinates);t.position.copy(p),t.position.z=n.verticalOffset;let c=k(P.degToRad(-n.rotation));return t.rotation.z=c,t.userData={entityId:s.toString(),rotationZ:c},{text:t}}async function $(s,f,o,d){let n=f.feature.properties,{textArea:t}=n;if(!t)throw new Error("textArea is required");let a=o.margin??r.margin,[p,c,D,m]=Array.isArray(a)?a:[a,a,a,a],e=new y;e.text=n.content;let g=t.maxHeight-p-D,M=t.maxWidth-m-c;e.fontSize=Math.min(g,o.fontSize??r.fontSize),e.color=o.color??r.color,e.maxWidth=o.maxWidth??M,e.anchorX="center",e.anchorY="middle",e.textAlign="center";let W=o.font??r.font;W?e.font=W:l?e.font=await l:e.font=await O(),e.outlineOpacity=o.outlineOpacity??r.outlineOpacity,e.outlineColor=o.outlineColor??r.outlineColor,e.outlineOffsetY=o.outlineOffsetY??r.outlineOffsetY,e.outlineOffsetX=o.outlineOffsetX??r.outlineOffsetX,e.outlineWidth=o.outlineWidth??r.outlineWidth,e.outlineBlur=o.outlineBlur??r.outlineBlur,e.strokeWidth=o.strokeWidth??r.strokeWidth,e.strokeColor=o.strokeColor??r.strokeColor,e.strokeOpacity=o.strokeOpacity??r.strokeOpacity;let F=d(t.position,i);e.position.copy(F);let x=k(Math.PI/2-P.degToRad(t.rotation));e.rotation.z=x,e.userData={entityId:s.toString(),rotationZ:x};let T,h;try{h=(await B(e,M,g,e.fontSize*.2)).size}catch(X){throw e.dispose?.(),new Error(`Cannot fit text to area: entityId: ${f.polygonEntityId} ${X}`)}if(h)return u.identity(),i.set(0,0,1),u.makeRotationAxis(I,x),i.set(t.align==="near"?m+h[0]/2:t.maxWidth/2,0,0),i.applyMatrix4(u),e.position.x-=i.x,e.position.y-=i.y,f.textMesh=e,T&&(i.set(t.maxWidth/2,0,0),i.applyMatrix4(u),T.position.x-=i.x,T.position.y-=i.y),{text:e}}var l;function q(s){return l=S(s),l}export{Y as BatchedText,y as Text,H as configureTroikaTextBuilder,$ as createTroikaTextArea,U as createTroikaTextPoint,l as fontPreloadLoadPromise,q as preloadFont,b as syncText};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/mappedin-js",
3
- "version": "6.32.0",
3
+ "version": "6.33.0",
4
4
  "homepage": "https://developer.mappedin.com/",
5
5
  "private": false,
6
6
  "main": "lib/esm/index.js",
@@ -24,6 +24,10 @@
24
24
  "extends": "../../package.json"
25
25
  },
26
26
  "gitHead": "3759cdff03bdc957f3434681ad305ba3accb3e44",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/MappedIn/sdk.git"
30
+ },
27
31
  "scripts": {
28
32
  "rel:patch": "node scripts/release.mjs patch",
29
33
  "start": "INTERNAL=true pnpm build:start && concurrently \"node scripts/build.mjs --watchChanges\" \"INTERNAL=true node scripts/start.mjs\"",
@@ -1 +0,0 @@
1
- import{P as Ce,R as Ie,S as De,U as Le,V as Me,W as Oe,Y as ve,Z as B,_ as Ne,aa as ke,ba as Ge,w as D}from"./chunk-TWRTSPVQ.js";import{H as V,L as ce,M as ue,N as Fe,Q as we,W as fe,c as se,g as je,h as Ue,i as ze,j as Xe,q as de,r as w}from"./chunk-ZJEQSG7Y.js";import{a as S,b as g,g as U}from"./chunk-7B7J4IXM.js";S();import{z as He}from"zod";function Ye(e){try{let o=e.shape;if("type"in o){let t=o.type;if(t instanceof He.ZodOptional&&(t=t._def.innerType),"value"in t)return String(t.value);if(t instanceof He.ZodDefault&&"value"in t._def.innerType)return String(t._def.innerType.value)}return"unknown"}catch{return"unknown"}}function We(e){if(e.success)return{};let o={};for(let t of e.error.issues)if(t.path.length>0){let i=String(t.path[0]);o[i]||(o[i]=[]),o[i].push(t.message)}return o}function Be(e,o){let t=Object.entries(e);if(t.length>0){let i=t.map(([n,f])=>`${n}: ${f.join(", ")}`).join("; ");U.warn(`${t.length} invalid field(s) in ${o??"unknown"} state: [${i}]`)}}function Ve(e,o,t){if(t?.disableValidation)return o;if(o==null||typeof o!="object")return{};let i=e.safeParse(o);if(i.success){let s={};for(let d of Object.keys(o))d in i.data&&(s[d]=o[d]);return s}let n=We(i);t?.warn&&Be(n,Ye(e));let f={};for(let s of Object.keys(o))!(s in n)&&s in e.shape&&(f[s]=o[s]);return f}function _(e,o,t){if(t?.disableValidation)return o;let i=e.safeParse(o);if(i.success)return i.data;if(t?.warn===!0){let n=We(i);Be(n,Ye(e))}return o}S();import a from"zod";var $e="path",P={color:"#4b90e2",width:1,completeFraction:0,visible:!0,interactive:!1,verticalOffset:.1,xrayOpacity:.25,smoothingTension:de.tension,smoothingCornerRadius:de.cornerRadius,dashed:!1,dashDiscrete:!1,dashCornerRadius:0,endcapExtension:[.5,.5],billboarding:80},me={enabled:a.boolean().optional(),cornerRadius:a.number().min(0).max(1).default(P.dashCornerRadius)},Ze=a.union([a.object({mode:a.literal("length-scaling").optional(),length:a.number().min(0).max(1).default(.1),gap:a.number().min(0).max(1).default(.1),...me}),a.object({mode:a.literal("width-scaling").optional(),size:a.number().min(0).default(w.size),gapSize:a.number().min(0).default(w.gapSize),...me}),a.object({mode:a.literal("absolute"),meters:a.number().min(0).default(1),gapMeters:a.number().min(0).default(.5),...me})]),Se={__EXPERIMENTAL_DASH_CORNER_RADIUS:a.number().min(0).max(1).optional()},gt=a.discriminatedUnion("__EXPERIMENTAL_DASH_MODE",[a.object({__EXPERIMENTAL_DASH_MODE:a.literal("length-scaling"),__EXPERIMENTAL_DASH_LENGTH:a.number().min(0).max(1).optional(),__EXPERIMENTAL_DASH_GAP:a.number().min(0).max(1).optional(),...Se}),a.object({__EXPERIMENTAL_DASH_MODE:a.literal("width-scaling"),__EXPERIMENTAL_DASH_SIZE:a.number().min(0).optional(),__EXPERIMENTAL_GAP_SIZE:a.number().min(0).optional(),...Se}),a.object({__EXPERIMENTAL_DASH_MODE:a.literal("absolute"),__EXPERIMENTAL_DASH_METERS:a.number().min(0).optional(),__EXPERIMENTAL_GAP_METERS:a.number().min(0).optional(),...Se})]),be=a.object({type:a.literal($e).default($e),color:a.string().default(P.color),width:a.union([a.number(),a.string().regex(se),a.object({on:a.literal("zoom-level"),input:a.array(a.number()).nonempty(),output:a.union([a.array(a.number()).nonempty(),a.array(a.string().regex(se)).nonempty()]),easing:a.string().optional()})]),completeFraction:a.number().default(P.completeFraction),visible:a.boolean().default(P.visible),interactive:a.boolean().default(P.interactive),verticalOffset:a.number().default(P.verticalOffset),highlightStartFraction:a.number().default(0),highlightEndFraction:a.number().default(0),highlightColor:a.string().default("red"),highlightWidthMultiplier:a.number().default(1.1),highlightCompleteFraction:a.number().default(1),highlightDisplayArrowsOnPath:a.boolean().default(!1),xrayOpacity:a.number().min(0).max(1).default(P.xrayOpacity),travelledEndFraction:a.number().default(0),travelledColor:a.string().default("#999"),smoothing:a.object({tension:a.number().default(P.smoothingTension),cornerRadius:a.number().default(P.smoothingCornerRadius)}).optional(),dashed:a.boolean().default(P.dashed),dashDiscrete:a.boolean().default(P.dashDiscrete),dashCornerRadius:a.number().min(0).max(1).default(P.dashCornerRadius),dash:Ze.optional(),geometry:a.enum(["tube","ribbon"]).default("tube"),endcapExtension:a.tuple([a.number(),a.number()]).default(P.endcapExtension),billboarding:a.union([a.boolean(),a.number().min(0).max(90)]).default(P.billboarding),border:a.object({enabled:a.boolean(),color:a.custom(e=>typeof e=="string"),width:a.number().optional()}).optional(),xray:a.object({opacity:a.number().min(0).max(1).optional(),color:a.string().optional(),tint:a.number().min(0).max(1).optional(),dithering:a.number().min(0).optional()}).optional()}),_t={__EXPERIMENTAL_GEOMETRY:a.enum(["tube","ribbon"]).optional(),__EXPERIMENTAL_ENDCAP_EXTENSION:a.tuple([a.number(),a.number()]).optional(),__EXPERIMENTAL_BILLBOARDING:a.union([a.boolean(),a.number().min(0).max(90)]).optional(),__EXPERIMENTAL_BORDER:a.object({enabled:a.boolean(),color:a.custom(e=>typeof e=="string"),width:a.number().optional()}).optional(),__EXPERIMENTAL_SMOOTHING_TENSION:a.number().optional(),__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:a.number().optional(),__EXPERIMENTAL_XRAY_STYLE:a.object({opacity:a.number().min(0).max(1).optional(),color:a.string().optional(),tint:a.number().min(0).max(1).optional(),dithering:a.number().min(0).optional()}).optional(),__EXPERIMENTAL_DASH_OPTIONS:a.union([Ze,gt]).optional()},zt=be.omit({dashDiscrete:!0}).partial().extend(_t),Xt=a.strictObject(be.shape);function Ft(e){let{color:o,visible:t,interactive:i,width:n,verticalOffset:f,completeFraction:s,highlightStartFraction:d,highlightEndFraction:T,highlightColor:x,highlightWidthMultiplier:m,highlightCompleteFraction:c,highlightDisplayArrowsOnPath:b,travelledEndFraction:M,travelledColor:O,xrayOpacity:A,xrayStyle:R,smoothingTension:I,smoothingCornerRadius:j,dashed:p,dashDiscrete:h,dashCornerRadius:C,dashLength:Y,dashGap:W,dashRelativeToWidth:ne,dashSize:le,gapSize:pe,dashAbsolute:F,dashMeters:z,gapMeters:Ae,geometryType:St,endcapExtension:bt,billboarding:ht,border:Tt}=e,X={};A!==void 0&&(X.opacity=A),R?.color!==void 0&&(X.color=R.color),R?.tint!==void 0&&(X.tint=R.tint),R?.dithering!==void 0&&(X.dithering=R.dithering);let Et=Object.keys(X).length>0?X:void 0,yt={enabled:p,cornerRadius:C,...F?{mode:"absolute",meters:z,gapMeters:Ae}:ne?{mode:"width-scaling",size:le,gapSize:pe}:{mode:"length-scaling",length:Y,gap:W}};return _(be,{color:o,visible:t,interactive:i,width:n,verticalOffset:f,completeFraction:s,highlightStartFraction:d,highlightEndFraction:T,highlightColor:x,highlightWidthMultiplier:m,highlightCompleteFraction:c,highlightDisplayArrowsOnPath:b,travelledEndFraction:M,travelledColor:O,xrayOpacity:A,xray:Et,smoothing:{tension:I,cornerRadius:j},dashed:p,dashDiscrete:h,dashCornerRadius:C,dash:yt,geometry:St,endcapExtension:bt,billboarding:ht,border:Tt})}function xt(e,o){g.env.NODE_ENV!=="production"&&U.warn(`${e} takes precedence over deprecated ${o}`)}function wt(e){let o=e.geometry??e.__EXPERIMENTAL_GEOMETRY,t=e.endcapExtension??e.__EXPERIMENTAL_ENDCAP_EXTENSION,i=e.billboarding??e.__EXPERIMENTAL_BILLBOARDING,n=e.border??e.__EXPERIMENTAL_BORDER,f=e.smoothing,s=f?.tension??e.__EXPERIMENTAL_SMOOTHING_TENSION,d=f?.cornerRadius??e.__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS,T=e.xray,x=e.__EXPERIMENTAL_XRAY_STYLE,m=T??x,c=e.dash??e.__EXPERIMENTAL_DASH_OPTIONS,b=c?{enabled:c.enabled,mode:c.mode??c.__EXPERIMENTAL_DASH_MODE,length:c.length??c.__EXPERIMENTAL_DASH_LENGTH,gap:c.gap??c.__EXPERIMENTAL_DASH_GAP,size:c.size??c.__EXPERIMENTAL_DASH_SIZE,gapSize:c.gapSize??c.__EXPERIMENTAL_GAP_SIZE,meters:c.meters??c.__EXPERIMENTAL_DASH_METERS,gapMeters:c.gapMeters??c.__EXPERIMENTAL_GAP_METERS,cornerRadius:c.cornerRadius??c.__EXPERIMENTAL_DASH_CORNER_RADIUS}:void 0,M=typeof e.dashed=="boolean"?e.dashed:void 0,O=b?.enabled??M;b?.enabled!==void 0&&M!==void 0&&xt("dash.enabled","dashed");let A=o==="ribbon",R=t!==void 0&&(t[0]!==0||t[1]!==0)&&(t[0]!==P.endcapExtension[0]||t[1]!==P.endcapExtension[1]),I=i!==void 0&&i!==!1,j=n?.enabled===!0;!A&&(R||I||j)&&g.env.NODE_ENV!=="production"&&U.warn('Ribbon-only path options (endcapExtension, billboarding, border) have no effect with tube geometry. Set geometry: "ribbon" to apply them.'),b?.cornerRadius!==void 0&&!A&&g.env.NODE_ENV!=="production"&&U.warn("dash.cornerRadius has no effect on tube geometry");let p={};for(let h in e)if(h==="geometry"||h==="__EXPERIMENTAL_GEOMETRY")o!==void 0&&(p.geometryType=o);else if(h==="endcapExtension"||h==="__EXPERIMENTAL_ENDCAP_EXTENSION")t!==void 0&&(p.endcapExtension=t);else if(h==="billboarding"||h==="__EXPERIMENTAL_BILLBOARDING")i!==void 0&&(p.billboarding=i);else if(h==="border"||h==="__EXPERIMENTAL_BORDER")n!==void 0&&(p.border=n);else if(h==="smoothing"||h==="__EXPERIMENTAL_SMOOTHING_TENSION"||h==="__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS")s!==void 0&&(p.smoothingTension=s),d!==void 0&&(p.smoothingCornerRadius=d);else if(h==="dash"||h==="__EXPERIMENTAL_DASH_OPTIONS"){if(b){let C=O===!0?b.mode??"width-scaling":b.mode;C==="length-scaling"?(p.dashRelativeToWidth=!1,p.dashAbsolute=!1,b.length!==void 0&&(p.dashLength=b.length),b.gap!==void 0&&(p.dashGap=b.gap)):C==="width-scaling"?(p.dashRelativeToWidth=!0,p.dashAbsolute=!1,p.dashSize=b.size??w.size,p.gapSize=b.gapSize??w.gapSize):C==="absolute"&&(p.dashAbsolute=!0,p.dashRelativeToWidth=!1,b.meters!==void 0&&(p.dashMeters=b.meters),b.gapMeters!==void 0&&(p.gapMeters=b.gapMeters)),b.cornerRadius!==void 0&&(p.dashCornerRadius=b.cornerRadius)}}else if(h==="xray"||h==="__EXPERIMENTAL_XRAY_STYLE"){if(m){m.opacity!==void 0&&(p.xrayOpacity=m.opacity);let C={};m.color!==void 0&&(C.color=m.color),m.tint!==void 0&&(C.tint=m.tint),m.dithering!==void 0&&(C.dithering=m.dithering),Object.keys(C).length>0&&(p.xrayStyle=C)}}else h==="xrayOpacity"?m?.opacity===void 0&&(p[h]=e[h]):p[h]=e[h];return O!==void 0&&(p.dashed=O),p}S();import N from"zod";var Ke="doors",he=N.object({type:N.literal(Ke).default(Ke),color:N.string().default("#ffffff"),topColor:N.string().optional(),texture:N.object({url:N.string().optional()}).optional(),topTexture:N.object({url:N.string().optional()}).optional(),visible:N.boolean().default(!1),opacity:N.number().default(1)}),Vt=he.partial(),$t=N.strictObject(he.shape);function Zt(e,o){let{color:t,topColor:i,texture:n,topTexture:f,opacity:s}=e,d=o?.visible??!1;return _(he,{visible:d,color:t,topColor:i,opacity:s,texture:n?{url:n}:void 0,topTexture:f?{url:f}:void 0})}function Kt(e,o){let t={featureCollection:{},container:{}};return e.visible!==void 0&&(t.container.visible=e.visible),e.color&&(e.color==="initial"?t.featureCollection.color=o?.initialColor:t.featureCollection.color=e.color),e.topColor&&(e.topColor==="initial"?t.featureCollection.topColor=o?.initialTopColor:t.featureCollection.topColor=e.topColor),e.texture?.url!==void 0&&(t.featureCollection.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.featureCollection.topTexture=e.topTexture.url),e.opacity!==void 0&&(t.featureCollection.opacity=e.opacity),t}function Jt(e,o){let t={};return o==null||(e.color&&(e.color==="initial"?t.color=o.initialColor:t.color=e.color),e.topColor&&(e.topColor==="initial"?t.topColor=o.initialTopColor:t.topColor=e.topColor),e.visible!==void 0&&(t.visible=e.visible),e.texture?.url!==void 0&&(t.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.topTexture=e.topTexture.url),e.opacity!==void 0&&(t.opacity=e.opacity)),t}S();import{z as H}from"zod";var Je="facade",Te=H.object({type:H.literal(Je).default(Je),opacity:H.number().default(1),visible:H.boolean().default(!0)}),oo=Te.partial(),ao=H.strictObject(Te.shape);function ro(e){return _(Te,{opacity:e.opacity,visible:e.visible})}S();import{z as r}from"zod";var k="floor",qe=`${k}.footprint`,Qe=`${k}.geometry`,et=`${k}.labels`,tt=`${k}.markers`,ot=`${k}.images`,at=`${k}.occlusion`,rt=`${k}.paths`,it=`${k}.areas`,nt=`${k}.models`,$=r.object({type:r.literal(qe).default(qe),altitude:r.number().default(0),visible:r.boolean().default(!1),height:r.number().default(0),opacity:r.number().default(1),side:r.enum(["double","front","back"]).default("double"),color:r.string().default("#ffffff"),ceilingVisible:r.boolean().default(!0),basementMaskEnabled:r.boolean().default(!1),outline:r.boolean().default(!0),ceilingThickness:r.number().default(.2)}),uo=$.partial(),Z=r.object({type:r.literal(Qe).default(Qe),opacity:r.number().default(1),visible:r.boolean().default(!0),heightScale:r.number().default(1),maskId:r.number().nullable().default(null),maskEffect:r.enum(["hide","reveal"]).default("hide"),maskMode:r.enum(["mask","masked-object"]).default("mask"),maskEnabled:r.boolean().default(!1),effectStart:r.number().default(0),effectDistance:r.number().default(0),darkenAmount:r.number().default(0),darkenUseDepth:r.boolean().default(!0),desaturateAmount:r.number().default(0),desaturateUseDepth:r.boolean().default(!0),washOutAmount:r.number().default(0),washOutUseDepth:r.boolean().default(!1)}),fo=Z.partial(),K=r.object({type:r.literal(et).default(et),enabled:r.boolean().default(!0)}),mo=K.partial(),J=r.object({type:r.literal(tt).default(tt),enabled:r.boolean().default(!0)}),So=J.partial(),q=r.object({type:r.literal(ot).default(ot),visible:r.boolean().default(!0),collisionsEnabled:r.boolean().default(!1)}),bo=q.partial(),Q=r.object({type:r.literal(at).default(at),enabled:r.boolean().default(!0)}),ho=Q.partial(),ee=r.object({type:r.literal(rt).default(rt),visible:r.boolean().default(!0)}),To=ee.partial(),te=r.object({type:r.literal(k).default(k),visible:r.boolean().default(!1),altitude:r.number().default(0)}),oe=r.object({type:r.literal(it).default(it),visible:r.boolean().default(!0)}),Eo=oe.partial(),Rt=r.object({visible:r.boolean().default(!0)}),Pt=r.object({visible:r.boolean().default(!0)}),ae=r.object({visible:r.boolean().default(!0),geometryText:Rt.default({visible:!0}),floorText:Pt.default({visible:!0})}),yo=ae.partial(),re=r.object({type:r.literal(nt).default(nt),visible:r.boolean().default(!0)}),go=re.partial(),At=r.object({...te.shape,geometry:Z,labels:K,markers:J,images:q,footprint:$,occlusion:Q,paths:ee,areas:oe,text3d:ae,models:re}),_o=te.partial(),xo=r.object({...te.shape,geometry:Z.partial(),labels:K.partial(),markers:J.partial(),images:q.partial(),footprint:$.partial(),occlusion:Q.partial(),paths:ee.partial(),areas:oe.partial(),text3d:ae.partial(),models:re.partial()}).partial(),Ro=r.strictObject({...te.shape,geometry:r.strictObject(Z.shape),labels:r.strictObject(K.shape),markers:r.strictObject(J.shape),images:r.strictObject(q.shape),footprint:r.strictObject($.shape),occlusion:r.strictObject(Q.shape),paths:r.strictObject(ee.shape),areas:r.strictObject(oe.shape),text3d:r.strictObject(ae.shape),models:r.strictObject(re.shape)});function lt(e,o){let t=e?.getInternalState().geometry3DMap.get(o);if(t?.type!=="group-container")return!0;let i=t,n=e?.getSystems().text3DSystem;return n?.getBatchedText(i)?.visible??n?.getBatchVisible(i)??!0}function Po(e,o,t){if(!o){U.error("Floor is not defined. Cannot get floor state.");return}let i=o.layers.get(Ce),n=i?t?.getState(i.containerId):void 0,f=o.layers.get(Ie),s=o.layers.get(De),d=o.footprintObject?.getState(),T=o.layers.get(Le),x=T?t?.getState(T.containerId):void 0,m=o.layers.get(Oe),c=m?t?.getState(m.containerId):void 0,b=!1;if(i?.layers)for(let F of i.layers.values()){let z=t?.getState(F);if(z?.children?.[0]){b=t?.getState(z.children[0])?.enableImageCollisions??!1;break}}let M=o.layers.get(ve),O=M?t?.getState(M.containerId):void 0,A=o.layers.get(Me),R=A?t?.getState(A.containerId):void 0,I=o.layers.get(B),j=I?t?.getState(I.containerId):void 0,p=!0,h=!0,C=!0,Y=!0;for(let[,F]of i.layers){let z=t?.getState(F);z?.maskId||(p=!1),z?.maskEffect||(h=!1),z?.maskMode||(C=!1),z?.maskEnabled||(Y=!1)}let W=o.layers.get(Ne),ne=W?t?.getState(W.containerId):void 0,le=lt(t,ke(o.id)),pe=lt(t,Ge(o.id));return _(At,{geometry:{opacity:n?.opacity,visible:n?.visible,maskId:p,maskEffect:h,maskMode:C,maskEnabled:Y},labels:{enabled:f?.visible},markers:{enabled:s?.visible},footprint:{altitude:d?.altitude,visible:d?.visible,height:d?.height,opacity:d?.opacity,side:d?.side,color:d?.color,ceilingVisible:d?.ceilingVisible,basementMaskEnabled:d?.basementMaskEnabled,outline:d?.outline,ceilingThickness:d?.ceilingThickness},images:{visible:c?.visible,collisionsEnabled:b},occlusion:{enabled:x?.visible},paths:{visible:O?.visible},areas:{visible:R?.visible},text3d:{visible:ne?.visible,geometryText:{visible:le},floorText:{visible:pe}},models:{visible:j?.visible},visible:e.visible,altitude:e.altitude})}S();import{z as u}from"zod";var pt="geometry",Ee=u.object({type:u.literal(pt).default(pt),visible:u.boolean().default(!0),color:u.union([u.string(),u.literal("initial")]).default("#ffffff"),topColor:u.union([u.string(),u.literal("initial")]).optional(),hoverColor:u.union([u.string(),u.literal("initial")]).optional(),interactive:u.union([u.boolean(),u.literal("pass-through")]).default(!1),opacity:u.number().default(1),height:u.number().default(0),slopeBearing:u.number().min(0).max(360).default(0),slopeFactor:u.number().min(-1).max(1).default(0),slopeEnabled:u.boolean().default(!1),altitude:u.number().default(0),texture:u.object({url:u.string()}).optional(),topTexture:u.object({url:u.string()}).optional(),flipImageToFaceCamera:u.boolean().default(!1),enableImageCollisions:u.boolean().default(!1),borderVisible:u.boolean().default(!1),borderColor:u.string().optional(),borderWidth:u.number().optional()}),Lo=Ee.partial(),Mo=u.strictObject(Ee.shape);function Oo(e){let{altitude:o,interactive:t,hoverColor:i,color:n,visible:f,opacity:s,height:d,slope:T,slopeEnabled:x,texture:m,topTexture:c,flipImageToFaceCamera:b,enableImageCollisions:M,topColor:O,borderVisible:A,borderColor:R,borderWidth:I}=e;return _(Ee,{interactive:t,hoverColor:i,color:n,visible:f,opacity:s,height:d,slopeBearing:T?.bearing??0,slopeFactor:T?.factor??0,slopeEnabled:x??!1,texture:m?{url:e.texture}:void 0,topTexture:c?{url:c}:void 0,flipImageToFaceCamera:b,enableImageCollisions:M,topColor:O,altitude:o,borderVisible:A,borderColor:R,borderWidth:I})}function vo(e,o){let t={};return o==null||(e.color&&(e.color==="initial"?t.color=o.initialColor:t.color=e.color),e.topColor&&(e.topColor==="initial"?t.topColor=o.initialTopColor:t.topColor=e.topColor),e.visible!==void 0&&(t.visible=e.visible),e.texture?.url!==void 0&&(t.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(t.hoverColor=e.hoverColor),e.interactive!==void 0&&(t.interactive=e.interactive),e.height!==void 0&&(t.height=e.height),(e.slopeBearing!==void 0||e.slopeFactor!==void 0)&&(t.slope={bearing:e.slopeBearing??o.slope?.bearing??0,factor:e.slopeFactor??o.slope?.factor??0}),e.slopeEnabled!==void 0&&(t.slopeEnabled=e.slopeEnabled),e.opacity!==void 0&&(t.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(t.flipImageToFaceCamera=e.flipImageToFaceCamera),e.enableImageCollisions!==void 0&&(t.enableImageCollisions=e.enableImageCollisions),e.altitude!==void 0&&(t.altitude=e.altitude),e.borderVisible!==void 0&&(t.borderVisible=e.borderVisible),e.borderColor!==void 0&&(t.borderColor=e.borderColor),e.borderWidth!==void 0&&(t.borderWidth=e.borderWidth)),t}S();import v from"zod";var ye="label",Ct=v.object({type:v.literal(ye).default(ye),text:v.string(),rank:v.custom(e=>V.safeParse(e).success||e==="initial"),appearance:v.custom(e=>Fe.safeParse(e).success),interactive:v.boolean().default(!1),enabled:v.boolean().default(!0),textPlacement:v.union([v.enum(ce),v.array(v.enum(ce))]).default(ue),occlude:v.boolean().default(!0)}),Uo=Ct.partial();function zo(e){let{text:o,enabled:t,options:i}=e;return{type:ye,text:o??"",appearance:we(i?.appearance??{}),rank:i?.rank??"medium",enabled:t??!0,interactive:i?.interactive??!1,textPlacement:i?.textPlacement??ue,occlude:i?.occlude??!0}}function Xo(e,o){let t={options:{}};if(!t.options)throw new Error("options should exist");return e.text&&(t.text=e.text),e.appearance&&(t.options.appearance=e.appearance),e.textPlacement&&(t.options.textPlacement=e.textPlacement),e.rank!=null&&(e.rank==="initial"?t.options.rank=o.initialRank||2:t.options.rank=e.rank),e.enabled!==void 0&&(t.enabled=e.enabled),e.interactive!==void 0&&(t.options.interactive=e.interactive),e.occlude!==void 0&&(t.options.occlude=e.occlude),e.enabled!==void 0&&(t.enabled=e.enabled),t}S();import E from"zod";var ge="marker",It=E.object({type:E.literal(ge).default(ge),rank:E.custom(e=>V.safeParse(e).success||e==="initial"),placement:E.union([E.enum(fe),E.array(E.enum(fe))]).optional(),interactive:E.union([E.boolean(),E.literal("pointer-events-auto")]).default(!1),dynamicResize:E.boolean().default(!0),enabled:E.boolean().default(!0),zIndex:E.number().optional(),lowPriorityPin:E.object({enabled:E.boolean().optional(),size:E.number().positive().optional(),color:E.string().optional()}).optional(),element:E.custom(e=>e instanceof HTMLElement,{error:"Must be an HTMLElement instance"}),contentHTML:E.string(),occlude:E.boolean().default(!0),animated:E.boolean().default(!0)}),Bo=It.omit({element:!0}).partial();function Vo(e,o){let t=o?.target?o.target.anchorTarget:void 0,{enabled:i,placement:n,element:f,dynamicResize:s,contentHTML:d,options:T,position:x,parent:m}=e,c=typeof m=="object"?m.id:m;return t==null&&(t=new D({latitude:x?.[1]??0,longitude:x?.[0]??0,floorId:c?.toString()})),{type:ge,rank:T?.rank??"medium",interactive:T?.interactive??!1,enabled:i??!0,element:f,placement:n??[],zIndex:T?.zIndex,dynamicResize:s??!0,lowPriorityPin:T?.lowPriorityPin,contentHTML:d??"",occlude:T?.occlude??!0,animated:T?.animated??!0}}function $o(e,o){let t={};return t.options={},e.rank!=null&&(e.rank==="initial"?t.options.rank=o.initialRank||2:t.options.rank=e.rank),e.dynamicResize!=null&&(t.options.dynamicResize=e.dynamicResize),e.enabled!=null&&(t.enabled=e.enabled),e.interactive!=null&&(t.options.interactive=e.interactive),e.enabled!=null&&(t.enabled=e.enabled),e.contentHTML!=null&&(t.contentHTML=e.contentHTML),e.placement!=null&&(t.placement=e.placement),e.occlude!=null&&(t.options.occlude=e.occlude),"zIndex"in e&&(t.options.zIndex=e.zIndex),e.animated!=null&&(t.options.animated=e.animated),t}S();import{z as y}from"zod";var st="shape",_e=y.object({type:y.literal(st).default(st),visible:y.boolean().default(!0),altitude:y.number().default(0),color:y.string().default("#ffffff"),hoverColor:y.string().optional(),height:y.number().default(0),opacity:y.number().default(1),interactive:y.union([y.boolean(),y.literal("pass-through")]).default(!1),bevel:y.object({enabled:y.boolean().optional(),thickness:y.number().optional(),size:y.number().optional(),offset:y.number().optional(),segments:y.number().optional()}).optional(),visibleThroughGeometry:y.boolean().default(!1),position:y.custom(e=>D.is(e))}),Dt=_e.partial(),ta=y.strictObject(_e.shape);function oa(e){let{children:o,bevel:t,position:i}=e;if(o==null||o.length<1){U.error(`Expected at least one child for Shape (${e.id}). Cannot get shape state.`);return}let{color:n,hoverColor:f,opacity:s,interactive:d,height:T,visible:x,altitude:m,visibleThroughGeometry:c}=e;return _(_e,{altitude:m,visible:x,color:n,hoverColor:f,height:T,opacity:s,interactive:d,bevel:t,visibleThroughGeometry:c,position:new D({latitude:i[1],longitude:i[0],verticalOffset:m??0})})}function aa(e){let o=Ve(Dt,e,{warn:!0}),t={};return o.visible!==void 0&&(t.visible=o.visible),o.altitude!==void 0&&(t.altitude=o.altitude),o.color!==void 0&&(t.color=o.color),o.hoverColor!==void 0&&(t.hoverColor=o.hoverColor),o.opacity!==void 0&&(t.opacity=o.opacity),o.height!==void 0&&(t.height=o.height),o.interactive!==void 0&&(t.interactive=o.interactive),o.bevel!==void 0&&(t.bevel={enabled:o.bevel.enabled||!1,thickness:o.bevel.thickness,size:o.bevel.size,offset:o.bevel.offset,segments:o.bevel.segments}),o.visibleThroughGeometry!==void 0&&(t.visibleThroughGeometry=o.visibleThroughGeometry),o.position!==void 0&&(t.position=[o.position.longitude,o.position.latitude],t.altitude=o.position.verticalOffset),{mergedShapeState:t}}S();var na=["visible","altitude","opacity","interactive","preloadGeometry","focusable"];function la(e,o){let t=e,i={};for(let n of o)t[n]!==void 0&&(i[n]=t[n]);return i}function pa(e,o){let t=e,i=o,n=0;for(let f in t){let s=t[f];if(s!==void 0){if(typeof s=="object"&&s!==null||typeof s=="function"||i[f]!==s)return!1;n++}}return n>0}S();import ie from"zod";var dt="text3d",ct=ie.object({type:ie.literal(dt).default(dt),position:ie.custom(e=>e instanceof D,{error:"Must be a Coordinate instance"})}),ut=ze.extend({...ct.shape}),Sa=Xe.extend({...ct.shape}).partial(),ba=ie.strictObject(ut.shape);function ha(e){let{position:o,type:t,...i}=e;return{...i,...o?{position:[o.longitude,o.latitude,o.verticalOffset]}:{}}}function Ta(e){let{position:o,visible:t,color:i,flipToFaceCamera:n,font:f,fontSize:s,outlineColor:d,outlineOpacity:T,outlineBlur:x,outlineWidth:m,outlineOffsetX:c,outlineOffsetY:b,strokeWidth:M,strokeOpacity:O,strokeColor:A,fillOpacity:R,hoverColor:I,rotation:j,content:p}=e;return _(ut,{position:new D({latitude:o?.[1]??0,longitude:o?.[0]??0}),visible:t,color:i,flipToFaceCamera:n,font:f,fontSize:s,outlineColor:d,outlineOpacity:T,outlineBlur:x,outlineWidth:m,outlineOffsetX:c,outlineOffsetY:b,strokeWidth:M,strokeOpacity:O,strokeColor:A,fillOpacity:R,hoverColor:I,rotation:j,content:p})}S();import L from"zod";var ft="walls",xe=L.object({type:L.literal(ft).default(ft),color:L.string().default("#ffffff"),topColor:L.string().optional(),texture:L.object({url:L.string()}).or(L.undefined()),topTexture:L.object({url:L.string()}).or(L.undefined()),visible:L.boolean().default(!0),height:L.number().default(0),opacity:L.number().default(1)}),xa=xe.partial(),Ra=L.strictObject(xe.shape);function Pa(e){let{color:o,topColor:t,texture:i,topTexture:n,visible:f,height:s,opacity:d}=e;return _(xe,{visible:f,color:o,topColor:t,texture:i?{url:i}:void 0,topTexture:n?{url:n}:void 0,height:s,opacity:d})}function Aa(e,o){let t={};return o==null||(e.color&&(e.color==="initial"?t.color=o.initialColor:t.color=e.color),e.topColor&&(e.topColor==="initial"?t.topColor=o.initialTopColor:t.topColor=e.topColor),e.visible!==void 0&&(t.visible=e.visible),e.texture?.url!==void 0&&(t.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.topTexture=e.topTexture.url),e.height!==void 0&&(t.height=e.height),e.opacity!==void 0&&(t.opacity=e.opacity)),t}S();import{z as G}from"zod";var Re="image3d",Lt=G.object({type:G.literal(Re).default(Re),visible:G.boolean().default(!0),opacity:G.number().min(0).max(1).default(1),position:G.custom(e=>e instanceof D,{error:"Must be a Coordinate instance"}),width:G.number().default(1),height:G.number().default(1),rotation:G.number().default(0),verticalOffset:G.number().default(0),flipImagesToFaceCamera:G.boolean().default(!1),interactive:G.boolean().default(!1)}),Ma=Lt.partial();function Oa(e){let{position:o,flipImagesToFaceCamera:t,type:i,...n}=e;return{...n,...o?{position:[o.longitude,o.latitude]}:{},...t!=null?{flipImageToFaceCamera:t}:{}}}function va(e){let{position:o}=e;return{type:Re,visible:e.visible??!0,opacity:e.opacity??1,position:new D({latitude:o?.[1]??0,longitude:o?.[0]??0,verticalOffset:o?.[2]}),width:e.width??1,height:e.height??1,rotation:e.rotation??0,verticalOffset:e.verticalOffset??0,flipImagesToFaceCamera:e.flipImageToFaceCamera??!1,interactive:e.interactive??!1}}S();import{z as l}from"zod";var mt="model",Pe=je.extend({type:l.literal(mt).default(mt),color:l.string().optional(),position:l.custom(e=>D.is(e),{error:"Expected a Coordinate"}),visible:l.boolean().default(!0),rotation:l.tuple([l.number(),l.number(),l.number()]).default([0,0,0]),scale:l.tuple([l.number(),l.number(),l.number()]).default([1,1,1]),verticalOffset:l.number().default(0),opacity:l.number().default(1),material:l.record(l.string(),Ue).optional(),interactive:l.boolean().default(!1),clippingPlaneZOffset:l.custom(e=>typeof e=="number"&&!Number.isNaN(e),{message:"Must be a valid number (including Infinity)"}).default(1/0),clippingPlaneTopColor:l.string().default("#E67B5B"),clippingPlaneTopVisible:l.boolean().default(!0),castShadow:l.boolean().default(!0),receiveShadow:l.boolean().default(!0),clippingEnabled:l.boolean().default(!1)}),Fa=Pe.extend({scale:l.union([l.number(),l.tuple([l.number(),l.number(),l.number()])]),rotation:l.union([l.number(),l.tuple([l.number(),l.number(),l.number()])])}).omit({castShadow:!0,receiveShadow:!0,clippingEnabled:!0}).partial(),wa=l.strictObject(Pe.shape);function Ha(e){let{color:o,position:t,rotation:i,scale:n,visible:f,interactive:s,opacity:d,material:T,verticalOffset:x,parent:m,clippingPlaneZOffset:c,clippingPlaneTopColor:b,clippingPlaneTopVisible:M,castShadow:O,receiveShadow:A,clippingEnabled:R}=e,I=typeof m=="object"?m?.id?.toString():m?.toString(),j=`${B}-`,p=I?.startsWith(j)?I.slice(j.length):I;return _(Pe,{color:o,position:new D({latitude:t?.[1]??0,longitude:t?.[0]??0,verticalOffset:t?.[2],floorId:p}),rotation:i,scale:n,visible:f,interactive:s,opacity:d,material:T,verticalOffset:x,clippingPlaneZOffset:c,clippingPlaneTopColor:b,clippingPlaneTopVisible:M,castShadow:O,receiveShadow:A,clippingEnabled:R})}S();export{Ve as a,zt as b,Ft as c,wt as d,Vt as e,Zt as f,Kt as g,Jt as h,oo as i,ro as j,$ as k,fo as l,mo as m,So as n,bo as o,ho as p,To as q,Eo as r,yo as s,go as t,_o as u,Po as v,Lo as w,Oo as x,vo as y,ye as z,Uo as A,zo as B,Xo as C,ge as D,Bo as E,Vo as F,$o as G,Dt as H,oa as I,aa as J,na as K,la as L,pa as M,Sa as N,ha as O,Ta as P,xa as Q,Pa as R,Aa as S,Ma as T,Oa as U,va as V,Fa as W,Ha as X};