power-compass 0.0.1-alpha.1 → 0.0.1-alpha.2

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.
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react`);async function u(e,t,n,r){let i=new URL(`${e}/${t}/${n}`,window.location.origin);i.search=new URLSearchParams(r).toString(),console.debug(`Fetching data from backend:`,i.toString());let a=t=>{if(t.ok)return t.json();throw Error(`${e} reponse error: ${t.statusText}`)};return fetch(i.toString(),{cache:`default`}).then(a).catch(()=>fetch(i.toString(),{cache:`force-cache`}).then(a)).catch(t=>{throw console.debug(`Failed to fetch from ${e}:`,t),t})}async function d(e,t,n={}){try{return{items:await u(e,t,`menu`,n)}}catch(e){return{items:[],error:{message:e instanceof Error?e.message:String(e)}}}}const f=(0,l.createContext)(void 0),p={flatten(e,t){return e.map(({items:e,...n})=>{let r={parent:t,...n};return e?this.flatten(e,r):r}).flat()},trim(e){return e.filter(e=>e.url||e.items||e.modal)}};function m(e,t){return Object.keys(t).reduce((e,t)=>p[t](e),e)}var h=[],g={tagged(e,t){return e.filter(e=>{var n;return(n=e.tags)==null?void 0:n.includes(t)})}};function _(e,t){return Object.keys(t).reduce((e,n)=>g[n](e,t[n]),e)}function v(e={}){return new Promise(t=>{let n=h.map(e=>Promise.resolve(e));Promise.all(n).then(e=>e.filter(Boolean)).then(t=>_(t,e)).then(e=>t({items:e})).catch(e=>t({items:[],error:{message:e instanceof Error?e.message:String(e)}}))})}async function y(e){typeof e==`function`?h.push(e()):h.push(e)}function b(e){return e.sort((e,t)=>((e==null?void 0:e.gravity)||0)-((t==null?void 0:t.gravity)||0)||e.label.localeCompare(t.label))}function x({filters:e={},backends:t,contextId:n,...r}){let[i,a]=(0,l.useState)([]),[o,s]=(0,l.useState)(!1),c=(0,l.useContext)(f),u=t||(c==null?void 0:c.backends)||[],p=n||(c==null?void 0:c.contextId);if(!p)throw Error(`contextId is required`);return(0,l.useEffect)(()=>{s(!0);let t=[...u.map(t=>d(t,p.toString(),e)),v(e)];Promise.all(t).then(e=>m(e.filter(e=>!e.error).flatMap(e=>e.items),r)).then(b).then(a).finally(()=>s(!1))},[]),{items:i,loading:o}}var S=(e,t)=>{try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return t}},C=(e,t)=>{try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){console.debug(e)}};const w=(e,t)=>{let[n,r]=(0,l.useState)(()=>S(e,t)),i=t=>{r(t),C(e,t)};return[n,i,()=>i(t)]};function T({contextId:e}){let[t,n]=w(`notification_center.notifications`,[]),[r,i]=(0,l.useState)(!0),[a,o]=(0,l.useState)(null);return(0,l.useEffect)(()=>{if(!e){i(!1);return}(async()=>{try{i(!0),o(null),n((await u(`compass`,String(e),`notifications`,{})).map(e=>e.notifications).flat().map(e=>({...e,createdAt:e.date||e.createdAt})))}catch(e){o(e instanceof Error?e:Error(`Unknown error`))}finally{i(!1)}})()},[e,n]),{notifications:t,loading:r,error:a}}var E=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),D=o(((e,t)=>{var n=E(),r=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(r)return r(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}()})),O=o(((e,t)=>{function n(){}t.exports=n})),k=o(((e,t)=>{var n=D(),r=O(),i=4294967295;function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=i,this.__views__=[]}a.prototype=n(r.prototype),a.prototype.constructor=a,t.exports=a})),ee=o(((e,t)=>{var n=D(),r=O();function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=n(r.prototype),i.prototype.constructor=i,t.exports=i})),A=o(((e,t)=>{t.exports=Array.isArray})),j=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),te=o(((e,t)=>{function n(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=n})),ne=o(((e,t)=>{var n=k(),r=ee(),i=te();function a(e){if(e instanceof n)return e.clone();var t=new r(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}t.exports=a})),re=o(((e,t)=>{var n=k(),r=ee(),i=O(),a=A(),o=j(),s=ne(),c=Object.prototype.hasOwnProperty;function l(e){if(o(e)&&!a(e)&&!(e instanceof n)){if(e instanceof r)return e;if(c.call(e,`__wrapped__`))return s(e)}return new r(e)}l.prototype=i.prototype,l.prototype.constructor=l,t.exports=l})),ie=o(((e,t)=>{var n=re();function r(e){var t=n(e);return t.__chain__=!0,t}t.exports=r})),ae=o(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),oe=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),M=o(((e,t)=>{var n=oe(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),N=o(((e,t)=>{t.exports=M().Symbol})),se=o(((e,t)=>{var n=N(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch(e){}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),ce=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),P=o(((e,t)=>{var n=N(),r=se(),i=ce(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),le=o(((e,t)=>{var n=P(),r=j(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),ue=o(((e,t)=>{var n=le(),r=j(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),de=o(((e,t)=>{var n=N(),r=ue(),i=A(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),fe=o(((e,t)=>{var n=ae(),r=de();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||(a=r),s||(s=[]);++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),pe=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),F=o(((e,t)=>{var n=P(),r=j(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),me=o(((e,t)=>{var n=A(),r=F(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),he=o(((e,t)=>{var n=P(),r=E(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),ge=o(((e,t)=>{t.exports=M()[`__core-js_shared__`]})),_e=o(((e,t)=>{var n=ge(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),ve=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch(e){}try{return e+``}catch(e){}}return``}t.exports=r})),ye=o(((e,t)=>{var n=he(),r=_e(),i=E(),a=ve(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),be=o(((e,t)=>{function n(e,t){return e==null?void 0:e[t]}t.exports=n})),I=o(((e,t)=>{var n=ye(),r=be();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),L=o(((e,t)=>{t.exports=I()(Object,`create`)})),xe=o(((e,t)=>{var n=L();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Se=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Ce=o(((e,t)=>{var n=L(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),we=o(((e,t)=>{var n=L(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Te=o(((e,t)=>{var n=L(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Ee=o(((e,t)=>{var n=xe(),r=Se(),i=Ce(),a=we(),o=Te();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),De=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Oe=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),R=o(((e,t)=>{var n=Oe();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),ke=o(((e,t)=>{var n=R(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Ae=o(((e,t)=>{var n=R();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),je=o(((e,t)=>{var n=R();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Me=o(((e,t)=>{var n=R();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),z=o(((e,t)=>{var n=De(),r=ke(),i=Ae(),a=je(),o=Me();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Ne=o(((e,t)=>{t.exports=I()(M(),`Map`)})),Pe=o(((e,t)=>{var n=Ee(),r=z(),i=Ne();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Fe=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),B=o(((e,t)=>{var n=Fe();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Ie=o(((e,t)=>{var n=B();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Le=o(((e,t)=>{var n=B();function r(e){return n(this,e).get(e)}t.exports=r})),Re=o(((e,t)=>{var n=B();function r(e){return n(this,e).has(e)}t.exports=r})),ze=o(((e,t)=>{var n=B();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Be=o(((e,t)=>{var n=Pe(),r=Ie(),i=Le(),a=Re(),o=ze();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Ve=o(((e,t)=>{var n=Be(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),He=o(((e,t)=>{var n=Ve(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Ue=o(((e,t)=>{var n=He(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),We=o(((e,t)=>{var n=N(),r=pe(),i=A(),a=F(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Ge=o(((e,t)=>{var n=We();function r(e){return e==null?``:n(e)}t.exports=r})),Ke=o(((e,t)=>{var n=A(),r=me(),i=Ue(),a=Ge();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),V=o(((e,t)=>{var n=F(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),qe=o(((e,t)=>{var n=Ke(),r=V();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Je=o(((e,t)=>{var n=z();function r(){this.__data__=new n,this.size=0}t.exports=r})),Ye=o(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),Xe=o(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),Ze=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Qe=o(((e,t)=>{var n=z(),r=Ne(),i=Be(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),$e=o(((e,t)=>{var n=z(),r=Je(),i=Ye(),a=Xe(),o=Ze(),s=Qe();function c(e){this.size=(this.__data__=new n(e)).size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),et=o(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),tt=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),nt=o(((e,t)=>{var n=Be(),r=et(),i=tt();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),rt=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),it=o(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),at=o(((e,t)=>{var n=nt(),r=rt(),i=it(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),ot=o(((e,t)=>{t.exports=M().Uint8Array})),st=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),ct=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),lt=o(((e,t)=>{var n=N(),r=ot(),i=Oe(),a=at(),o=st(),s=ct(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||(E=s),e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),ut=o(((e,t)=>{var n=ae(),r=A();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),dt=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),ft=o(((e,t)=>{function n(){return[]}t.exports=n})),pt=o(((e,t)=>{var n=dt(),r=ft(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),mt=o(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),ht=o(((e,t)=>{function n(){return!1}t.exports=n})),gt=o(((e,t)=>{var n=M(),r=ht(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),_t=o(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t=t==null?n:t,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),vt=o(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),yt=o(((e,t)=>{var n=P(),r=vt(),i=j(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function ee(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=ee})),bt=o(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),xt=o(((e,t)=>{var n=oe(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch(e){}}()})),St=o(((e,t)=>{var n=yt(),r=bt(),i=xt(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),Ct=o(((e,t)=>{var n=mt(),r=ue(),i=A(),a=gt(),o=_t(),s=St(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),wt=o(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),Tt=o(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Et=o(((e,t)=>{t.exports=Tt()(Object.keys,Object)})),Dt=o(((e,t)=>{var n=wt(),r=Et(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),H=o(((e,t)=>{var n=he(),r=vt();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),Ot=o(((e,t)=>{var n=Ct(),r=Dt(),i=H();function a(e){return i(e)?n(e):r(e)}t.exports=a})),kt=o(((e,t)=>{var n=ut(),r=pt(),i=Ot();function a(e){return n(e,i,r)}t.exports=a})),At=o(((e,t)=>{var n=kt(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||(_=p==`constructor`)}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),jt=o(((e,t)=>{t.exports=I()(M(),`DataView`)})),Mt=o(((e,t)=>{t.exports=I()(M(),`Promise`)})),Nt=o(((e,t)=>{t.exports=I()(M(),`Set`)})),Pt=o(((e,t)=>{t.exports=I()(M(),`WeakMap`)})),Ft=o(((e,t)=>{var n=jt(),r=Ne(),i=Mt(),a=Nt(),o=Pt(),s=P(),c=ve(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),It=o(((e,t)=>{var n=$e(),r=at(),i=lt(),a=At(),o=Ft(),s=A(),c=gt(),l=St(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||(v=new n),y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||(v=new n),_(O,k,h,g,v)}}return T?(v||(v=new n),a(e,t,h,g,_,v)):!1}t.exports=h})),Lt=o(((e,t)=>{var n=It(),r=j();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),Rt=o(((e,t)=>{var n=$e(),r=Lt(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),zt=o(((e,t)=>{var n=E();function r(e){return e===e&&!n(e)}t.exports=r})),Bt=o(((e,t)=>{var n=zt(),r=Ot();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),Vt=o(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),Ht=o(((e,t)=>{var n=Rt(),r=Bt(),i=Vt();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Ut=o(((e,t)=>{var n=qe();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),Wt=o(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Gt=o(((e,t)=>{var n=Ke(),r=ue(),i=A(),a=_t(),o=vt(),s=V();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),Kt=o(((e,t)=>{var n=Wt(),r=Gt();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),qt=o(((e,t)=>{var n=Lt(),r=Ut(),i=Kt(),a=me(),o=zt(),s=Vt(),c=V(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),U=o(((e,t)=>{function n(e){return e}t.exports=n})),Jt=o(((e,t)=>{function n(e){return function(t){return t==null?void 0:t[e]}}t.exports=n})),Yt=o(((e,t)=>{var n=qe();function r(e){return function(t){return n(t,e)}}t.exports=r})),Xt=o(((e,t)=>{var n=Jt(),r=Yt(),i=me(),a=V();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),Zt=o(((e,t)=>{var n=Ht(),r=qt(),i=U(),a=A(),o=Xt();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Qt=o(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),$t=o(((e,t)=>{t.exports=Qt()()})),en=o(((e,t)=>{var n=$t(),r=Ot();function i(e,t){return e&&n(e,t,r)}t.exports=i})),tn=o(((e,t)=>{var n=H();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),nn=o(((e,t)=>{var n=en();t.exports=tn()(n)})),rn=o(((e,t)=>{var n=nn(),r=H();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),an=o(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),on=o(((e,t)=>{var n=F();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),sn=o(((e,t)=>{var n=on();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),cn=o(((e,t)=>{var n=pe(),r=qe(),i=Zt(),a=rn(),o=an(),s=bt(),c=sn(),l=U(),u=A();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),ln=o(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),un=o(((e,t)=>{var n=ln(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),dn=o(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),fn=o(((e,t)=>{var n=I();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch(e){}}()})),pn=o(((e,t)=>{var n=dn(),r=fn(),i=U();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),mn=o(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),hn=o(((e,t)=>{var n=pn();t.exports=mn()(n)})),gn=o(((e,t)=>{var n=U(),r=un(),i=hn();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),_n=o(((e,t)=>{var n=Oe(),r=H(),i=_t(),a=E();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),vn=o(((e,t)=>{var n=fe(),r=cn(),i=gn(),a=_n();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})})),yn=c(vn(),1),bn=c(ie(),1);function W(e){return Array.isArray?Array.isArray(e):kn(e)===`[object Array]`}var xn=1/0;function Sn(e){if(typeof e==`string`)return e;let t=e+``;return t==`0`&&1/e==-xn?`-0`:t}function Cn(e){return e==null?``:Sn(e)}function G(e){return typeof e==`string`}function wn(e){return typeof e==`number`}function Tn(e){return e===!0||e===!1||Dn(e)&&kn(e)==`[object Boolean]`}function En(e){return typeof e==`object`}function Dn(e){return En(e)&&e!==null}function K(e){return e!=null}function On(e){return!e.trim().length}function kn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var An=`Incorrect 'index' type`,jn=e=>`Invalid value for key ${e}`,Mn=e=>`Pattern length exceeds max of ${e}.`,Nn=e=>`Missing ${e} property in key`,Pn=e=>`Property 'weight' in key '${e}' must be a positive integer`,Fn=Object.prototype.hasOwnProperty,In=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=Ln(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Ln(e){let t=null,n=null,r=null,i=1,a=null;if(G(e)||W(e))r=e,t=Rn(e),n=zn(e);else{if(!Fn.call(e,`name`))throw Error(Nn(`name`));let o=e.name;if(r=o,Fn.call(e,`weight`)&&(i=e.weight,i<=0))throw Error(Pn(o));t=Rn(o),n=zn(o),a=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:a}}function Rn(e){return W(e)?e:e.split(`.`)}function zn(e){return W(e)?e.join(`.`):e}function Bn(e,t){let n=[],r=!1,i=(e,t,a)=>{if(K(e))if(!t[a])n.push(e);else{let o=e[t[a]];if(!K(o))return;if(a===t.length-1&&(G(o)||wn(o)||Tn(o)))n.push(Cn(o));else if(W(o)){r=!0;for(let e=0,n=o.length;e<n;e+=1)i(o[e],t,a+1)}else t.length&&i(o,t,a+1)}};return i(e,G(t)?t.split(`.`):t,0),r?n:n[0]}var Vn={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Hn={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Un={location:0,threshold:.6,distance:100},Wn={useExtendedSearch:!1,getFn:Bn,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},q={...Hn,...Vn,...Un,...Wn},Gn=/[^ ]+/g;function Kn(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=t.match(Gn).length;if(n.has(i))return n.get(i);let a=1/i**(.5*e),o=parseFloat(Math.round(a*r)/r);return n.set(i,o),o},clear(){n.clear()}}}var qn=class{constructor({getFn:e=q.getFn,fieldNormWeight:t=q.fieldNormWeight}={}){this.norm=Kn(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,G(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();G(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)--this.records[t].i}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!K(e)||On(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(e,t){let n={i:t,$:{}};this.keys.forEach((t,r)=>{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);if(K(i)){if(W(i)){let e=[],t=[{nestedArrIndex:-1,value:i}];for(;t.length;){let{nestedArrIndex:n,value:r}=t.pop();if(K(r))if(G(r)&&!On(r)){let t={v:r,i:n,n:this.norm.get(r)};e.push(t)}else W(r)&&r.forEach((e,n)=>{t.push({nestedArrIndex:n,value:e})})}n.$[r]=e}else if(G(i)&&!On(i)){let e={v:i,n:this.norm.get(i)};n.$[r]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function Jn(e,t,{getFn:n=q.getFn,fieldNormWeight:r=q.fieldNormWeight}={}){let i=new qn({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(Ln)),i.setSources(t),i.create(),i}function Yn(e,{getFn:t=q.getFn,fieldNormWeight:n=q.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new qn({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function J(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=q.distance,ignoreLocation:a=q.ignoreLocation}={}){let o=t/e.length;if(a)return o;let s=Math.abs(r-n);return i?o+s/i:s?1:o}function Xn(e=[],t=q.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}var Y=32;function Zn(e,t,n,{location:r=q.location,distance:i=q.distance,threshold:a=q.threshold,findAllMatches:o=q.findAllMatches,minMatchCharLength:s=q.minMatchCharLength,includeMatches:c=q.includeMatches,ignoreLocation:l=q.ignoreLocation}={}){if(t.length>Y)throw Error(Mn(Y));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=s>1||c,g=h?Array(d):[],_;for(;(_=e.indexOf(t,m))>-1;){let e=J(t,{currentLocation:_,expectedLocation:f,distance:i,ignoreLocation:l});if(p=Math.min(e,p),m=_+u,h){let e=0;for(;e<u;)g[_+e]=1,e+=1}}m=-1;let v=[],y=1,b=u+d,x=1<<u-1;for(let r=0;r<u;r+=1){let a=0,s=b;for(;a<s;)J(t,{errors:r,currentLocation:f+s,expectedLocation:f,distance:i,ignoreLocation:l})<=p?a=s:b=s,s=Math.floor((b-a)/2+a);b=s;let c=Math.max(1,f-s+1),_=o?d:Math.min(f+s,d)+u,S=Array(_+2);S[_+1]=(1<<r)-1;for(let a=_;a>=c;--a){let o=a-1,s=n[e.charAt(o)];if(h&&(g[o]=+!!s),S[a]=(S[a+1]<<1|1)&s,r&&(S[a]|=(v[a+1]|v[a])<<1|1|v[a+1]),S[a]&x&&(y=J(t,{errors:r,currentLocation:o,expectedLocation:f,distance:i,ignoreLocation:l}),y<=p)){if(p=y,m=o,m<=f)break;c=Math.max(1,2*f-m)}}if(J(t,{errors:r+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:l})>p)break;v=S}let S={isMatch:m>=0,score:Math.max(.001,y)};if(h){let e=Xn(g,s);e.length?c&&(S.indices=e):S.isMatch=!1}return S}function Qn(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var X=String.prototype.normalize?(e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``)):(e=>e),$n=class{constructor(e,{location:t=q.location,threshold:n=q.threshold,distance:r=q.distance,includeMatches:i=q.includeMatches,findAllMatches:a=q.findAllMatches,minMatchCharLength:o=q.minMatchCharLength,isCaseSensitive:s=q.isCaseSensitive,ignoreDiacritics:c=q.ignoreDiacritics,ignoreLocation:l=q.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?X(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:Qn(e),startIndex:t})},d=this.pattern.length;if(d>Y){let e=0,t=d%Y,n=d-t;for(;e<n;)u(this.pattern.substr(e,Y),e),e+=Y;if(t){let e=d-Y;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?X(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=Zn(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&(u=[...u,...g])});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=u),p}},Z=class{constructor(e){this.pattern=e}static isMultiMatch(e){return er(e,this.multiRegex)}static isSingleMatch(e){return er(e,this.singleRegex)}search(){}};function er(e,t){let n=e.match(t);return n?n[1]:null}var tr=class extends Z{constructor(e){super(e)}static get type(){return`exact`}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},nr=class extends Z{constructor(e){super(e)}static get type(){return`inverse-exact`}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=e.indexOf(this.pattern)===-1;return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},rr=class extends Z{constructor(e){super(e)}static get type(){return`prefix-exact`}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},ir=class extends Z{constructor(e){super(e)}static get type(){return`inverse-prefix-exact`}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},ar=class extends Z{constructor(e){super(e)}static get type(){return`suffix-exact`}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},or=class extends Z{constructor(e){super(e)}static get type(){return`inverse-suffix-exact`}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},sr=class extends Z{constructor(e,{location:t=q.location,threshold:n=q.threshold,distance:r=q.distance,includeMatches:i=q.includeMatches,findAllMatches:a=q.findAllMatches,minMatchCharLength:o=q.minMatchCharLength,isCaseSensitive:s=q.isCaseSensitive,ignoreDiacritics:c=q.ignoreDiacritics,ignoreLocation:l=q.ignoreLocation}={}){super(e),this._bitapSearch=new $n(e,{location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l})}static get type(){return`fuzzy`}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},cr=class extends Z{constructor(e){super(e)}static get type(){return`include`}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,n,r=[],i=this.pattern.length;for(;(n=e.indexOf(this.pattern,t))>-1;)t=n+i,r.push([n,t-1]);let a=!!r.length;return{isMatch:a,score:a?0:1,indices:r}}},lr=[tr,cr,rr,ir,or,ar,nr,sr],ur=lr.length,dr=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fr=`|`;function pr(e,t={}){return e.split(fr).map(e=>{let n=e.trim().split(dr).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<ur;){let e=lr[o],n=e.isMultiMatch(i);n&&(r.push(new e(n,t)),a=!0)}if(!a)for(o=-1;++o<ur;){let e=lr[o],n=e.isSingleMatch(i);if(n){r.push(new e(n,t));break}}}return r})}var mr=new Set([sr.type,cr.type]),hr=class{constructor(e,{isCaseSensitive:t=q.isCaseSensitive,ignoreDiacritics:n=q.ignoreDiacritics,includeMatches:r=q.includeMatches,minMatchCharLength:i=q.minMatchCharLength,ignoreLocation:a=q.ignoreLocation,findAllMatches:o=q.findAllMatches,location:s=q.location,threshold:c=q.threshold,distance:l=q.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?X(e):e,this.pattern=e,this.query=pr(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?X(e):e;let a=0,o=[],s=0;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:c,indices:l,score:u}=r.search(e);if(c){if(a+=1,s+=u,n){let e=r.constructor.type;mr.has(e)?o=[...o,...l]:o.push(l)}}else{s=0,a=0,o.length=0;break}}if(a){let e={isMatch:!0,score:s/a};return n&&(e.indices=o),e}}return{isMatch:!1,score:1}}},gr=[];function _r(...e){gr.push(...e)}function vr(e,t){for(let n=0,r=gr.length;n<r;n+=1){let r=gr[n];if(r.condition(e,t))return new r(e,t)}return new $n(e,t)}var Q={AND:`$and`,OR:`$or`},yr={PATH:`$path`,PATTERN:`$val`},br=e=>!!(e[Q.AND]||e[Q.OR]),xr=e=>!!e[yr.PATH],Sr=e=>!W(e)&&En(e)&&!br(e),Cr=e=>({[Q.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function wr(e,t,{auto:n=!0}={}){let r=e=>{let i=Object.keys(e),a=xr(e);if(!a&&i.length>1&&!br(e))return r(Cr(e));if(Sr(e)){let r=a?e[yr.PATH]:i[0],o=a?e[yr.PATTERN]:e[r];if(!G(o))throw Error(jn(r));let s={keyId:zn(r),pattern:o};return n&&(s.searcher=vr(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];W(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return br(e)||(e=Cr(e)),r(e)}function Tr(e,{ignoreFieldNorm:t=q.ignoreFieldNorm}){e.forEach(e=>{let n=1;e.matches.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),e.score=n})}function Er(e,t){let n=e.matches;t.matches=[],K(n)&&n.forEach(e=>{if(!K(e.indices)||!e.indices.length)return;let{indices:n,value:r}=e,i={indices:n,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function Dr(e,t){t.score=e.score}function Or(e,t,{includeMatches:n=q.includeMatches,includeScore:r=q.includeScore}={}){let i=[];return n&&i.push(Er),r&&i.push(Dr),e.map(e=>{let{idx:n}=e,r={item:t[n],refIndex:n};return i.length&&i.forEach(t=>{t(e,r)}),r})}var $=class{constructor(e,t={},n){this.options={...q,...t},this.options.useExtendedSearch,this._keyStore=new In(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof qn))throw Error(An);this._myIndex=t||Jn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){K(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let n=0,r=this._docs.length;n<r;n+=1){let i=this._docs[n];e(i,n)&&(this.removeAt(n),--n,--r,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:n,includeScore:r,shouldSort:i,sortFn:a,ignoreFieldNorm:o}=this.options,s=G(e)?G(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Tr(s,{ignoreFieldNorm:o}),i&&s.sort(a),wn(t)&&t>-1&&(s=s.slice(0,t)),Or(s,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){let t=vr(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:e,i:n,n:i})=>{if(!K(e))return;let{isMatch:a,score:o,indices:s}=t.searchIn(e);a&&r.push({item:e,idx:n,matches:[{score:o,value:e,norm:i,indices:s}]})}),r}_searchLogical(e){let t=wr(e,this.options),n=(e,t,r)=>{if(!e.children){let{keyId:n,searcher:i}=e,a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i});return a&&a.length?[{idx:r,item:t,matches:a}]:[]}let i=[];for(let a=0,o=e.children.length;a<o;a+=1){let o=e.children[a],s=n(o,t,r);if(s.length)i.push(...s);else if(e.operator===Q.AND)return[]}return i},r=this._myIndex.records,i={},a=[];return r.forEach(({$:e,i:r})=>{if(K(e)){let o=n(t,e,r);o.length&&(i[r]||(i[r]={idx:r,item:e,matches:[]},a.push(i[r])),o.forEach(({matches:e})=>{i[r].matches.push(...e)}))}}),a}_searchObjectList(e){let t=vr(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach(({$:e,i:r})=>{if(!K(e))return;let a=[];n.forEach((n,r)=>{a.push(...this._findMatches({key:n,value:e[r],searcher:t}))}),a.length&&i.push({idx:r,item:e,matches:a})}),i}_findMatches({key:e,value:t,searcher:n}){if(!K(t))return[];let r=[];if(W(t))t.forEach(({v:t,i,n:a})=>{if(!K(t))return;let{isMatch:o,score:s,indices:c}=n.searchIn(t);o&&r.push({score:s,key:e,value:t,idx:i,norm:a,indices:c})});else{let{v:i,n:a}=t,{isMatch:o,score:s,indices:c}=n.searchIn(i);o&&r.push({score:s,key:e,value:i,norm:a,indices:c})}return r}};$.version=`7.1.0`,$.createIndex=Jn,$.parseIndex=Yn,$.config=q,$.parseQuery=wr,_r(hr);var kr=10,Ar={includeScore:!0,shouldSort:!0},jr={keys:[{name:`label`,weight:.6},{name:`category`,weight:.3},{name:`tag`,weight:1}],matchAllTokens:!0,maxPatternLength:16,minMatchCharLength:3,threshold:.4,tokenize:!0};function Mr(e,t,n){return(0,bn.default)(new $(t,{...jr,...n.searchOptions,...Ar}).search(e)).map(({item:e,score:t})=>({item:e,score:t,source:n})).take(n.maxEntries||kr).value()}function Nr(e){return(0,bn.default)(e).sortBy(`entries[0].score`).partition(({source:e})=>e.insertSourceAtIndex===void 0).value()}function Pr(e){let[t,n]=Nr(e);return(0,yn.default)(n,`source.insertSourceAtIndex`).reduce((e,t)=>[...e.slice(0,t.source.insertSourceAtIndex),t,...e.slice(t.source.insertSourceAtIndex)],t)}function Fr(e,t,n,r){let i=t.map(t=>t.fetch(e,n).then(n=>{let i={source:t,entries:Mr(e,n,t)};return r==null||r.call(null,i),i},e=>(console.debug(`Failed to search on source: ${t.label}`,e),{source:t,entries:[]})));return Promise.all(i)}var Ir=c(Ut(),1);async function Lr(e,t,n,r){if(!n||n.length<3||!e||!t)return null;try{let i=await fetch(`/compass/${e}/search/${t}?q=${encodeURIComponent(n)}`,{signal:r==null?void 0:r.signal});if(!i.ok)return console.debug(`Failed to fetch ${t} search results:`,i),null;let a=await i.json();return{label:a.label||t,searchOptions:a.search_options||{threshold:.2},fetch:()=>Promise.resolve(a.results||[]),display:{label:e=>{var t;return(t=e.label)==null?``:t},category:e=>{var t;return(t=e.category)==null?``:t},tag:e=>{var t;return(t=e.tag)==null?``:t}},open:e=>e.requires_confirmation&&e.data&&!window.confirm(e.data)?null:e.url}}catch(e){return e.name!==`AbortError`&&console.debug(`Error creating compass ${t} source:`,e),null}}async function Rr(e,t){try{var n;let r=await fetch(`/compass/${e}/search/providers`,{signal:t==null?void 0:t.signal});return r.ok?((n=(await r.json()).providers)==null?void 0:n.map(e=>e.name))||[]:(console.debug(`Failed to fetch providers:`,r.status),[])}catch(e){return e.name!==`AbortError`&&console.debug(`Error fetching available providers:`,e),[]}}async function zr(e,t,n){if(!t||t.length<3||!e)return[];try{let r=await Rr(e,n);if(!r.length)return console.debug(`No providers available`),[];console.debug(`Found ${r.length} providers:`,r);let i=r.map(r=>Lr(e,r,t,n)),a=(await Promise.all(i)).filter(e=>e!==null);return console.debug(`Successfully created ${a.length}/${r.length} sources`),a}catch(e){return e.name!==`AbortError`&&console.debug(`Error creating compass individual sources:`,e),[]}}function Br(e,t){return!e||!e.length||!t?[]:e.map(e=>({fetch:async n=>{try{let n=await d(e,t);if(n.error)return[];let r=[];return n.items.forEach(e=>{let t=e.label,n=e.icon;e.url&&r.push({label:e.label,url:e.url,category:t,icon:n}),e.items&&Array.isArray(e.items)&&e.items.forEach(e=>{r.push({label:e.label,url:e.url,category:t,icon:e.icon||n})})}),r}catch(e){return[]}},display:{label:e=>e.label,category:e=>e.category,tag:()=>``},open:({url:e,label:t})=>{let n=new URL(e,document.location.href);return n.searchParams.append(`mt`,t),n.toString()},searchOptions:{threshold:.2},maxEntries:20,insertSourceAtIndex:0}))}function Vr(e){let[t,n]=(0,l.useState)([]),[r,i]=(0,l.useState)(!1),[a,o]=(0,l.useState)(!1),s=(0,l.useContext)(f),c=s==null?void 0:s.backends,u=s==null?void 0:s.contextId,d=(0,l.useRef)(void 0),p=(0,l.useCallback)(()=>{i(!1),o(!0)},[]),m=(0,l.useMemo)(()=>u&&c?Br(c,u.toString()):[],[u,c]),h=(0,l.useCallback)(e=>{e.entries.length>0&&n(t=>Pr([e,...t.filter(t=>t.source.label!==e.source.label)]))},[]);return(0,l.useEffect)(()=>{(async()=>{var t;if(!e||e.length<3){n([]),i(!1),o(!1);return}(t=d.current)==null||t.abort(),d.current=new AbortController,o(!1),n([]),i(!0);try{await Fr(e,[...await zr(u,e,d.current),...m],d.current,h)}catch(e){e.name!==`AbortError`&&console.debug(`Search failed:`,e)}finally{p()}})()},[e,u,c,m,h,p]),[t,r,a]}exports.Compass=f,exports.createMenuItem=y,exports.fetchBackend=u,exports.useCompassMenu=x,exports.useNotificationCenter=T,exports.useSearch=Vr;
@@ -0,0 +1 @@
1
+ export {}