@local-logic/sdks-app 1.0.0-beta.52 → 1.0.0-beta.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/assets/{chevron_right.ec5f150c.js → chevron_right.f4a05ecb.js} +6 -6
  2. package/dist/assets/index.039c8af5.js +156 -0
  3. package/dist/assets/index.8143f5fa.js +183 -0
  4. package/dist/assets/{index.a0d0f2b6.js → index.bd887e31.js} +356 -314
  5. package/dist/index.html +1 -1
  6. package/dist/types/components/AnimateHeight/index.d.ts +10 -0
  7. package/dist/types/components/AnimateHeight/index.d.ts.map +1 -0
  8. package/dist/types/components/AnimateHeight/index.js +22 -0
  9. package/dist/types/components/AnimateHeight/index.js.map +1 -0
  10. package/dist/types/components/AnimateHeight/styles.d.ts +2 -0
  11. package/dist/types/components/AnimateHeight/styles.d.ts.map +1 -0
  12. package/dist/types/components/AnimateHeight/styles.js +6 -0
  13. package/dist/types/components/AnimateHeight/styles.js.map +1 -0
  14. package/dist/types/features/geocodes/index.d.ts +3 -0
  15. package/dist/types/features/geocodes/index.d.ts.map +1 -0
  16. package/dist/types/features/geocodes/index.js +3 -0
  17. package/dist/types/features/geocodes/index.js.map +1 -0
  18. package/dist/types/features/geocodes/keyFactory.d.ts +11 -0
  19. package/dist/types/features/geocodes/keyFactory.d.ts.map +1 -0
  20. package/dist/types/features/geocodes/keyFactory.js +5 -0
  21. package/dist/types/features/geocodes/keyFactory.js.map +1 -0
  22. package/dist/types/features/geocodes/types.d.ts +11 -0
  23. package/dist/types/features/geocodes/types.d.ts.map +1 -0
  24. package/dist/types/features/geocodes/types.js +2 -0
  25. package/dist/types/features/geocodes/types.js.map +1 -0
  26. package/dist/types/features/reverse-geocodes/index.d.ts +3 -0
  27. package/dist/types/features/reverse-geocodes/index.d.ts.map +1 -0
  28. package/dist/types/features/reverse-geocodes/index.js +3 -0
  29. package/dist/types/features/reverse-geocodes/index.js.map +1 -0
  30. package/dist/types/features/reverse-geocodes/keyFactory.d.ts +13 -0
  31. package/dist/types/features/reverse-geocodes/keyFactory.d.ts.map +1 -0
  32. package/dist/types/features/reverse-geocodes/keyFactory.js +5 -0
  33. package/dist/types/features/reverse-geocodes/keyFactory.js.map +1 -0
  34. package/dist/types/features/reverse-geocodes/types.d.ts +14 -0
  35. package/dist/types/features/reverse-geocodes/types.d.ts.map +1 -0
  36. package/dist/types/features/reverse-geocodes/types.js +2 -0
  37. package/dist/types/features/reverse-geocodes/types.js.map +1 -0
  38. package/dist/types/features/suggestions/index.d.ts +3 -0
  39. package/dist/types/features/suggestions/index.d.ts.map +1 -0
  40. package/dist/types/features/suggestions/index.js +3 -0
  41. package/dist/types/features/suggestions/index.js.map +1 -0
  42. package/dist/types/features/suggestions/keyFactory.d.ts +13 -0
  43. package/dist/types/features/suggestions/keyFactory.d.ts.map +1 -0
  44. package/dist/types/features/suggestions/keyFactory.js +5 -0
  45. package/dist/types/features/suggestions/keyFactory.js.map +1 -0
  46. package/dist/types/features/suggestions/types.d.ts +16 -0
  47. package/dist/types/features/suggestions/types.d.ts.map +1 -0
  48. package/dist/types/features/suggestions/types.js +2 -0
  49. package/dist/types/features/suggestions/types.js.map +1 -0
  50. package/dist/types/hooks/useOnEventOutside.d.ts +4 -0
  51. package/dist/types/hooks/useOnEventOutside.d.ts.map +1 -0
  52. package/dist/types/hooks/useOnEventOutside.js +14 -0
  53. package/dist/types/hooks/useOnEventOutside.js.map +1 -0
  54. package/dist/types/sdks/DataExplorer/components/Map/Search/index.d.ts +10 -0
  55. package/dist/types/sdks/DataExplorer/components/Map/Search/index.d.ts.map +1 -0
  56. package/dist/types/sdks/DataExplorer/components/Map/Search/index.js +50 -0
  57. package/dist/types/sdks/DataExplorer/components/Map/Search/index.js.map +1 -0
  58. package/dist/types/sdks/DataExplorer/components/Map/Search/styles.d.ts +6 -0
  59. package/dist/types/sdks/DataExplorer/components/Map/Search/styles.d.ts.map +1 -0
  60. package/dist/types/sdks/DataExplorer/components/Map/Search/styles.js +46 -0
  61. package/dist/types/sdks/DataExplorer/components/Map/Search/styles.js.map +1 -0
  62. package/dist/types/sdks/DataExplorer/components/Map/index.d.ts.map +1 -1
  63. package/dist/types/sdks/DataExplorer/components/Map/index.js +67 -28
  64. package/dist/types/sdks/DataExplorer/components/Map/index.js.map +1 -1
  65. package/dist/types/sdks/DataExplorer/components/Map/styles.d.ts +1 -0
  66. package/dist/types/sdks/DataExplorer/components/Map/styles.d.ts.map +1 -1
  67. package/dist/types/sdks/DataExplorer/components/Map/styles.js +22 -0
  68. package/dist/types/sdks/DataExplorer/components/Map/styles.js.map +1 -1
  69. package/dist/types/sdks/DataExplorer/features/useGeocodes.d.ts +3 -0
  70. package/dist/types/sdks/DataExplorer/features/useGeocodes.d.ts.map +1 -0
  71. package/dist/types/sdks/DataExplorer/features/useGeocodes.js +17 -0
  72. package/dist/types/sdks/DataExplorer/features/useGeocodes.js.map +1 -0
  73. package/dist/types/sdks/DataExplorer/features/useReverseGeocodes.d.ts +5 -0
  74. package/dist/types/sdks/DataExplorer/features/useReverseGeocodes.d.ts.map +1 -0
  75. package/dist/types/sdks/DataExplorer/features/useReverseGeocodes.js +23 -0
  76. package/dist/types/sdks/DataExplorer/features/useReverseGeocodes.js.map +1 -0
  77. package/dist/types/sdks/DataExplorer/features/useSuggestions.d.ts +3 -0
  78. package/dist/types/sdks/DataExplorer/features/useSuggestions.d.ts.map +1 -0
  79. package/dist/types/sdks/DataExplorer/features/useSuggestions.js +15 -0
  80. package/dist/types/sdks/DataExplorer/features/useSuggestions.js.map +1 -0
  81. package/package.json +3 -3
  82. package/dist/assets/index.1f109f78.js +0 -183
  83. package/dist/assets/index.3f82b283.js +0 -95
@@ -0,0 +1,156 @@
1
+ import{f as pa,b as da,i as ga,e as ma,S as ya,c as Me,u as be,a as va,s as wa,p as xa,g as Sa,h as _a,m as ba,N as Ea,P as Ra}from"./chevron_right.f4a05ecb.js";import{R as Ta,a as Yn,r as M,j as w,c as C,y as _,U as qn,d as D,n as zt,P as Ca,T as Aa,u as Ue,l as $e,_ as Oa,Q as pt,h as Kt,V as Wn,b as La,W as Fa,O as Ia,X as Ba,F as Xt,g as $n,Y as Da,Z as jn,a0 as Ne}from"./index.bd887e31.js";const Hn=Ta.createContext({}),Ee=()=>M.exports.useContext(Hn),ka=({children:l})=>{var c,S;const{sdkState:g}=Yn(),[p,m]=M.exports.useReducer((F,N)=>({...F,...N}),{location:{lat:((c=g.options)==null?void 0:c.lat)||43.661337,lng:((S=g.options)==null?void 0:S.lng)||-79.401903},scores:{checked:!1,include:[]},pois:{checked:!1,include:[],radius:5e3,limit:15},schools:{checked:!1,radius:5e3,limit:15},demographics:{checked:!1,radius:2500},profiles:{checked:!1}}),y=M.exports.useMemo(()=>({dataExplorerState:p,setDataExplorerState:m}),[p,m]);return w(Hn.Provider,{value:y,children:l})},Pa=C.div`
2
+ height: 100vh;
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: border-box;
6
+ background-color: ${_["--ll-color-background"]};
7
+ `,Ma=C(pa)`
8
+ overflow-y: auto;
9
+ padding: ${_["--ll-spacing-medium"]};
10
+ `,Na=qn({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Ua=qn({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),$a=C.div`
11
+ display: flex;
12
+ flex-direction: column;
13
+ `,ja=C.div`
14
+ height: 20px;
15
+ width: 20px;
16
+ border: 2px solid ${_["--ll-color-primary"]};
17
+ color: ${_["--ll-color-primary"]};
18
+ border-radius: 50%;
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ margin-right: ${_["--ll-spacing-small"]};
23
+ font-size: ${_["--ll-font-size-p"]};
24
+ `,Gt=C(da)`
25
+ all: unset;
26
+ flex: 1;
27
+ display: flex;
28
+ align-items: center;
29
+ font-family: ${_["--ll-font-family"]};
30
+ `,Ya=C.div`
31
+ display: flex;
32
+ justify-content: space-between;
33
+ align-items: center;
34
+ margin: ${_["--ll-spacing-x-small"]} 0;
35
+ `,qa=C(ga)`
36
+ background-color: ${_["--ll-color-surface"]};
37
+ position: relative;
38
+ z-index: 1;
39
+ overflow: hidden;
40
+ margin-left: calc(-1 * ${_["--ll-spacing-medium"]});
41
+ margin-right: calc(-1 * ${_["--ll-spacing-medium"]});
42
+
43
+ [data-state="open"] & {
44
+ animation: ${Na} 300ms cubic-bezier(0.87, 0, 0.13, 1);
45
+ }
46
+
47
+ [data-state="closed"] & {
48
+ animation: ${Ua} 300ms cubic-bezier(0.87, 0, 0.13, 1);
49
+ }
50
+ `,Wa=C.div`
51
+ padding: ${_["--ll-spacing-medium"]};
52
+ `,Ha=C.span`
53
+ margin-left: ${_["--ll-spacing-x-small"]};
54
+ ${Gt}[data-state=open] & {
55
+ transform: rotate(90deg);
56
+ } ;
57
+ `,Va=C.div`
58
+ display: flex;
59
+ `,Ja=({title:l,description:g,children:p,value:m,number:y})=>{const{dataExplorerState:c,setDataExplorerState:S}=Ee();return w(ma,{value:m,children:D($a,{children:[D(Ya,{children:[D(Gt,{children:[w(ja,{children:y}),w(zt,{variant:"h6",noMargin:!0,weight:"--ll-font-weight-medium",children:l})]}),D(Va,{children:["checked"in c[m]&&w(Ca,{checked:c[m].checked,onCheckedChange:F=>S({[m]:{...c[m],checked:F}})}),w(Gt,{children:w(Ha,{children:w(Aa,{SVGElement:ya,fill:_["--ll-color-on-background-variant1"]})})})]})]}),w(qa,{children:D(Wa,{children:[w(zt,{color:"--ll-color-on-background-variant1",children:g}),p]})})]})})};var _e={exports:{}};(function(l,g){(function(p,m){m(g)})(Me,function(p){var m;function y(){}y.prototype=Object.create(null);function c(){c.init.call(this)}c.EventEmitter=c,c.usingDomains=!1,c.prototype.domain=void 0,c.prototype._events=void 0,c.prototype._maxListeners=void 0,c.defaultMaxListeners=10,c.init=function(){this.domain=null,c.usingDomains&&m.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new y,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this};function S(t){return t._maxListeners===void 0?c.defaultMaxListeners:t._maxListeners}c.prototype.getMaxListeners=function(){return S(this)};function F(t,e,r){if(e)t.call(r);else for(var n=t.length,i=G(t,n),o=0;o<n;++o)i[o].call(r)}function N(t,e,r,n){if(e)t.call(r,n);else for(var i=t.length,o=G(t,i),s=0;s<i;++s)o[s].call(r,n)}function re(t,e,r,n,i){if(e)t.call(r,n,i);else for(var o=t.length,s=G(t,o),a=0;a<o;++a)s[a].call(r,n,i)}function j(t,e,r,n,i,o){if(e)t.call(r,n,i,o);else for(var s=t.length,a=G(t,s),f=0;f<s;++f)a[f].call(r,n,i,o)}function Y(t,e,r,n){if(e)t.apply(r,n);else for(var i=t.length,o=G(t,i),s=0;s<i;++s)o[s].apply(r,n)}c.prototype.emit=function(e){var r,n,i,o,s,a,f,h=e==="error";if(a=this._events,a)h=h&&a.error==null;else if(!h)return!1;if(f=this.domain,h){if(r=arguments[1],f)r||(r=new Error('Uncaught, unspecified "error" event')),r.domainEmitter=this,r.domain=f,r.domainThrown=!1,f.emit("error",r);else{if(r instanceof Error)throw r;var d=new Error('Uncaught, unspecified "error" event. ('+r+")");throw d.context=r,d}return!1}if(n=a[e],!n)return!1;var v=typeof n=="function";switch(i=arguments.length,i){case 1:F(n,v,this);break;case 2:N(n,v,this,arguments[1]);break;case 3:re(n,v,this,arguments[1],arguments[2]);break;case 4:j(n,v,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(i-1),s=1;s<i;s++)o[s-1]=arguments[s];Y(n,v,this,o)}return!0};function X(t,e,r,n){var i,o,s;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(o=t._events,o?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]):(o=t._events=new y,t._eventsCount=0),!s)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),!s.warned&&(i=S(t),i&&i>0&&s.length>i)){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,Q(a)}return t}function Q(t){typeof console.warn=="function"?console.warn(t):console.log(t)}c.prototype.addListener=function(e,r){return X(this,e,r,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(e,r){return X(this,e,r,!0)};function ne(t,e,r){var n=!1;function i(){t.removeListener(e,i),n||(n=!0,r.apply(t,arguments))}return i.listener=r,i}c.prototype.once=function(e,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,ne(this,e,r)),this},c.prototype.prependOnceListener=function(e,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,ne(this,e,r)),this},c.prototype.removeListener=function(e,r){var n,i,o,s,a;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(n=i[e],!n)return this;if(n===r||n.listener&&n.listener===r)--this._eventsCount===0?this._events=new y:(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length;s-- >0;)if(n[s]===r||n[s].listener&&n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount===0)return this._events=new y,this;delete i[e]}else A(n,o);i.removeListener&&this.emit("removeListener",e,a||r)}return this},c.prototype.removeAllListeners=function(e){var r,n;if(n=this._events,!n)return this;if(!n.removeListener)return arguments.length===0?(this._events=new y,this._eventsCount=0):n[e]&&(--this._eventsCount===0?this._events=new y:delete n[e]),this;if(arguments.length===0){for(var i=Object.keys(n),o=0,s;o<i.length;++o)s=i[o],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=new y,this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r)do this.removeListener(e,r[r.length-1]);while(r[0]);return this},c.prototype.listeners=function(e){var r,n,i=this._events;return i?(r=i[e],r?typeof r=="function"?n=[r.listener||r]:n=ge(r):n=[]):n=[],n},c.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):L.call(t,e)},c.prototype.listenerCount=L;function L(t){var e=this._events;if(e){var r=e[t];if(typeof r=="function")return 1;if(r)return r.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function A(t,e){for(var r=e,n=r+1,i=t.length;n<i;r+=1,n+=1)t[r]=t[n];t.pop()}function G(t,e){for(var r=new Array(e);e--;)r[e]=t[e];return r}function ge(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}var k=typeof Me!="undefined"?Me:typeof self!="undefined"?self:typeof window!="undefined"?window:{},W=[],P=[],U=typeof Uint8Array!="undefined"?Uint8Array:Array,I=!1;function q(){I=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)W[e]=t[e],P[t.charCodeAt(e)]=e;P["-".charCodeAt(0)]=62,P["_".charCodeAt(0)]=63}function ie(t){I||q();var e,r,n,i,o,s,a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[a-2]==="="?2:t[a-1]==="="?1:0,s=new U(a*3/4-o),n=o>0?a-4:a;var f=0;for(e=0,r=0;e<n;e+=4,r+=3)i=P[t.charCodeAt(e)]<<18|P[t.charCodeAt(e+1)]<<12|P[t.charCodeAt(e+2)]<<6|P[t.charCodeAt(e+3)],s[f++]=i>>16&255,s[f++]=i>>8&255,s[f++]=i&255;return o===2?(i=P[t.charCodeAt(e)]<<2|P[t.charCodeAt(e+1)]>>4,s[f++]=i&255):o===1&&(i=P[t.charCodeAt(e)]<<10|P[t.charCodeAt(e+1)]<<4|P[t.charCodeAt(e+2)]>>2,s[f++]=i>>8&255,s[f++]=i&255),s}function fe(t){return W[t>>18&63]+W[t>>12&63]+W[t>>6&63]+W[t&63]}function dt(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(fe(n));return i.join("")}function je(t){I||q();for(var e,r=t.length,n=r%3,i="",o=[],s=16383,a=0,f=r-n;a<f;a+=s)o.push(dt(t,a,a+s>f?f:a+s));return n===1?(e=t[r-1],i+=W[e>>2],i+=W[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=W[e>>10],i+=W[e>>4&63],i+=W[e<<2&63],i+="="),o.push(i),o.join("")}function Ye(t,e,r,n,i){var o,s,a=i*8-n-1,f=(1<<a)-1,h=f>>1,d=-7,v=r?i-1:0,R=r?-1:1,E=t[e+v];for(v+=R,o=E&(1<<-d)-1,E>>=-d,d+=a;d>0;o=o*256+t[e+v],v+=R,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+v],v+=R,d-=8);if(o===0)o=1-h;else{if(o===f)return s?NaN:(E?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-h}return(E?-1:1)*s*Math.pow(2,o-n)}function Qt(t,e,r,n,i,o){var s,a,f,h=o*8-i-1,d=(1<<h)-1,v=d>>1,R=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:o-1,te=n?1:-1,Pe=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+v>=1?e+=R/f:e+=R*Math.pow(2,1-v),e*f>=2&&(s++,f/=2),s+v>=d?(a=0,s=d):s+v>=1?(a=(e*f-1)*Math.pow(2,i),s=s+v):(a=e*Math.pow(2,v-1)*Math.pow(2,i),s=0));i>=8;t[r+E]=a&255,E+=te,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;t[r+E]=s&255,E+=te,s/=256,h-=8);t[r+E-te]|=Pe*128}var Xn={}.toString,Zt=Array.isArray||function(t){return Xn.call(t)=="[object Array]"},Qn=50;u.TYPED_ARRAY_SUPPORT=k.TYPED_ARRAY_SUPPORT!==void 0?k.TYPED_ARRAY_SUPPORT:!0;function gt(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function oe(t,e){if(gt()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=u.prototype):(t===null&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return mt(this,t)}return er(this,t,e,r)}u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t};function er(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?ti(t,e,r,n):typeof e=="string"?ei(t,e,r):ri(t,e)}u.from=function(t,e,r){return er(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function tr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Zn(t,e,r,n){return tr(e),e<=0?oe(t,e):r!==void 0?typeof n=="string"?oe(t,e).fill(r,n):oe(t,e).fill(r):oe(t,e)}u.alloc=function(t,e,r){return Zn(null,t,e,r)};function mt(t,e){if(tr(e),t=oe(t,e<0?0:vt(e)|0),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}u.allocUnsafe=function(t){return mt(null,t)},u.allocUnsafeSlow=function(t){return mt(null,t)};function ei(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=rr(e,r)|0;t=oe(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function yt(t,e){var r=e.length<0?0:vt(e.length)|0;t=oe(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function ti(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),u.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=u.prototype):t=yt(t,e),t}function ri(t,e){if(Z(e)){var r=vt(e.length)|0;return t=oe(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Si(e.length)?oe(t,0):yt(t,e);if(e.type==="Buffer"&&Zt(e.data))return yt(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function vt(t){if(t>=gt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+gt().toString(16)+" bytes");return t|0}u.isBuffer=hr;function Z(t){return!!(t!=null&&t._isBuffer)}u.compare=function(e,r){if(!Z(e)||!Z(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,r){if(!Zt(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=u.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!Z(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};function rr(t,e){if(Z(t))return t.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return He(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return cr(t).length;default:if(n)return He(t).length;e=(""+e).toLowerCase(),n=!0}}u.byteLength=rr;function ni(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return pi(this,e,r);case"utf8":case"utf-8":return sr(this,e,r);case"ascii":return ci(this,e,r);case"latin1":case"binary":return hi(this,e,r);case"base64":return fi(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return di(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function me(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)me(this,r,r+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)me(this,r,r+3),me(this,r+1,r+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)me(this,r,r+7),me(this,r+1,r+6),me(this,r+2,r+5),me(this,r+3,r+4);return this},u.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?sr(this,0,e):ni.apply(this,arguments)},u.prototype.equals=function(e){if(!Z(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:u.compare(this,e)===0},u.prototype.inspect=function(){var e="",r=Qn;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,r,n,i,o){if(!Z(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,a=n-r,f=Math.min(s,a),h=this.slice(i,o),d=e.slice(r,n),v=0;v<f;++v)if(h[v]!==d[v]){s=h[v],a=d[v];break}return s<a?-1:a<s?1:0};function nr(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=u.from(e,n)),Z(e))return e.length===0?-1:ir(t,e,r,n,i);if(typeof e=="number")return e=e&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):ir(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ir(t,e,r,n,i){var o=1,s=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}function f(E,te){return o===1?E[te]:E.readUInt16BE(te*o)}var h;if(i){var d=-1;for(h=r;h<s;h++)if(f(t,h)===f(e,d===-1?0:h-d)){if(d===-1&&(d=h),h-d+1===a)return d*o}else d!==-1&&(h-=h-d),d=-1}else for(r+a>s&&(r=s-a),h=r;h>=0;h--){for(var v=!0,R=0;R<a;R++)if(f(t,h+R)!==f(e,R)){v=!1;break}if(v)return h}return-1}u.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1},u.prototype.indexOf=function(e,r,n){return nr(this,e,r,n,!0)},u.prototype.lastIndexOf=function(e,r,n){return nr(this,e,r,n,!1)};function ii(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(s*2,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function oi(t,e,r,n){return Ve(He(e,t.length-r),t,r,n)}function or(t,e,r,n){return Ve(wi(e),t,r,n)}function si(t,e,r,n){return or(t,e,r,n)}function ai(t,e,r,n){return Ve(cr(e),t,r,n)}function ui(t,e,r,n){return Ve(xi(e,t.length-r),t,r,n)}u.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return ii(this,e,r,n);case"utf8":case"utf-8":return oi(this,e,r,n);case"ascii":return or(this,e,r,n);case"latin1":case"binary":return si(this,e,r,n);case"base64":return ai(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ui(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fi(t,e,r){return e===0&&r===t.length?je(t):je(t.slice(e,r))}function sr(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var f,h,d,v;switch(a){case 1:o<128&&(s=o);break;case 2:f=t[i+1],(f&192)===128&&(v=(o&31)<<6|f&63,v>127&&(s=v));break;case 3:f=t[i+1],h=t[i+2],(f&192)===128&&(h&192)===128&&(v=(o&15)<<12|(f&63)<<6|h&63,v>2047&&(v<55296||v>57343)&&(s=v));break;case 4:f=t[i+1],h=t[i+2],d=t[i+3],(f&192)===128&&(h&192)===128&&(d&192)===128&&(v=(o&15)<<18|(f&63)<<12|(h&63)<<6|d&63,v>65535&&v<1114112&&(s=v))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return li(n)}var ar=4096;function li(t){var e=t.length;if(e<=ar)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=ar));return r}function ci(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function hi(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function pi(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=vi(t[o]);return i}function di(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}u.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=u.prototype;else{var o=r-e;i=new u(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i};function O(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||O(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i},u.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||O(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i},u.prototype.readUInt8=function(e,r){return r||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,r){return r||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,r){return r||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,r){return r||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},u.prototype.readUInt32BE=function(e,r){return r||O(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||O(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i},u.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||O(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s},u.prototype.readInt8=function(e,r){return r||O(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},u.prototype.readInt16LE=function(e,r){r||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},u.prototype.readInt16BE=function(e,r){r||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},u.prototype.readInt32LE=function(e,r){return r||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,r){return r||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,r){return r||O(e,4,this.length),Ye(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,r){return r||O(e,4,this.length),Ye(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,r){return r||O(e,8,this.length),Ye(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,r){return r||O(e,8,this.length),Ye(this,e,!1,52,8)};function $(t,e,r,n,i,o){if(!Z(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;$(this,e,r,n,o,0)}var s=1,a=0;for(this[r]=e&255;++a<n&&(s*=256);)this[r+a]=e/s&255;return r+n},u.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;$(this,e,r,n,o,0)}var s=n-1,a=1;for(this[r+s]=e&255;--s>=0&&(a*=256);)this[r+s]=e/a&255;return r+n},u.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function qe(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):qe(this,e,r,!0),r+2},u.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):qe(this,e,r,!1),r+2};function We(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):We(this,e,r,!0),r+4},u.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):We(this,e,r,!1),r+4},u.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);$(this,e,r,n,o-1,-o)}var s=0,a=1,f=0;for(this[r]=e&255;++s<n&&(a*=256);)e<0&&f===0&&this[r+s-1]!==0&&(f=1),this[r+s]=(e/a>>0)-f&255;return r+n},u.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);$(this,e,r,n,o-1,-o)}var s=n-1,a=1,f=0;for(this[r+s]=e&255;--s>=0&&(a*=256);)e<0&&f===0&&this[r+s+1]!==0&&(f=1),this[r+s]=(e/a>>0)-f&255;return r+n},u.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1},u.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):qe(this,e,r,!0),r+2},u.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):qe(this,e,r,!1),r+2},u.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):We(this,e,r,!0),r+4},u.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||$(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):We(this,e,r,!1),r+4};function ur(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function fr(t,e,r,n,i){return i||ur(t,e,r,4),Qt(t,e,r,n,23,4),r+4}u.prototype.writeFloatLE=function(e,r,n){return fr(this,e,r,!0,n)},u.prototype.writeFloatBE=function(e,r,n){return fr(this,e,r,!1,n)};function lr(t,e,r,n,i){return i||ur(t,e,r,8),Qt(t,e,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(e,r,n){return lr(this,e,r,!0,n)},u.prototype.writeDoubleBE=function(e,r,n){return lr(this,e,r,!1,n)},u.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,s;if(this===e&&n<r&&r<i)for(s=o-1;s>=0;--s)e[s+r]=this[s+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o},u.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<n;++s)this[s]=e;else{var a=Z(e)?e:He(new u(e,i).toString()),f=a.length;for(s=0;s<n-r;++s)this[s+r]=a[s%f]}return this};var gi=/[^+\/0-9A-Za-z-_]/g;function mi(t){if(t=yi(t).replace(gi,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function yi(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function vi(t){return t<16?"0"+t.toString(16):t.toString(16)}function He(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function wi(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function xi(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function cr(t){return ie(mi(t))}function Ve(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Si(t){return t!==t}function hr(t){return t!=null&&(!!t._isBuffer||pr(t)||_i(t))}function pr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function _i(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&pr(t.slice(0,0))}function dr(){throw new Error("setTimeout has not been defined")}function gr(){throw new Error("clearTimeout has not been defined")}var le=dr,ce=gr;typeof k.setTimeout=="function"&&(le=setTimeout),typeof k.clearTimeout=="function"&&(ce=clearTimeout);function mr(t){if(le===setTimeout)return setTimeout(t,0);if((le===dr||!le)&&setTimeout)return le=setTimeout,setTimeout(t,0);try{return le(t,0)}catch{try{return le.call(null,t,0)}catch{return le.call(this,t,0)}}}function bi(t){if(ce===clearTimeout)return clearTimeout(t);if((ce===gr||!ce)&&clearTimeout)return ce=clearTimeout,clearTimeout(t);try{return ce(t)}catch{try{return ce.call(null,t)}catch{return ce.call(this,t)}}}var se=[],Re=!1,ye,Je=-1;function Ei(){!Re||!ye||(Re=!1,ye.length?se=ye.concat(se):Je=-1,se.length&&yr())}function yr(){if(!Re){var t=mr(Ei);Re=!0;for(var e=se.length;e;){for(ye=se,se=[];++Je<e;)ye&&ye[Je].run();Je=-1,e=se.length}ye=null,Re=!1,bi(t)}}function H(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];se.push(new vr(t,e)),se.length===1&&!Re&&mr(yr)}function vr(t,e){this.fun=t,this.array=e}vr.prototype.run=function(){this.fun.apply(null,this.array)};var Fe=k.performance||{};Fe.now||Fe.mozNow||Fe.msNow||Fe.oNow||Fe.webkitNow;var wt;typeof Object.create=="function"?wt=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:wt=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};var Te=wt,Ri=/%[sdj%]/g;function Ti(t){if(!Et(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(he(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(Ri,function(a){if(a==="%%")return"%";if(r>=i)return a;switch(a){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return a}}),s=n[r];r<i;s=n[++r])bt(s)||!Ie(s)?o+=" "+s:o+=" "+he(s);return o}function wr(t,e){if(pe(k.process))return function(){return wr(t,e).apply(this,arguments)};var r=!1;function n(){return r||(console.error(e),r=!0),t.apply(this,arguments)}return n}var ze={},xt;function Ci(t){if(pe(xt)&&(xt=""),t=t.toUpperCase(),!ze[t])if(new RegExp("\\b"+t+"\\b","i").test(xt)){var e=0;ze[t]=function(){var r=Ti.apply(null,arguments);console.error("%s %d: %s",t,e,r)}}else ze[t]=function(){};return ze[t]}function he(t,e){var r={seen:[],stylize:Oi};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),xr(e)?r.showHidden=e:e&&Pi(r,e),pe(r.showHidden)&&(r.showHidden=!1),pe(r.depth)&&(r.depth=2),pe(r.colors)&&(r.colors=!1),pe(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ai),Ge(r,t,r.depth)}he.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},he.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ai(t,e){var r=he.styles[e];return r?"\x1B["+he.colors[r][0]+"m"+t+"\x1B["+he.colors[r][1]+"m":t}function Oi(t,e){return t}function Li(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Ge(t,e,r){if(t.customInspect&&e&&Ct(e.inspect)&&e.inspect!==he&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Et(n)||(n=Ge(t,n,r)),n}var i=Fi(t,e);if(i)return i;var o=Object.keys(e),s=Li(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Tt(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return St(e);if(o.length===0){if(Ct(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(Rt(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Sr(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Tt(e))return St(e)}var f="",h=!1,d=["{","}"];if(Di(e)&&(h=!0,d=["[","]"]),Ct(e)){var v=e.name?": "+e.name:"";f=" [Function"+v+"]"}if(Rt(e)&&(f=" "+RegExp.prototype.toString.call(e)),Sr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),Tt(e)&&(f=" "+St(e)),o.length===0&&(!h||e.length==0))return d[0]+f+d[1];if(r<0)return Rt(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var R;return h?R=Ii(t,e,r,s,o):R=o.map(function(E){return _t(t,e,r,s,E,h)}),t.seen.pop(),Bi(R,f,d)}function Fi(t,e){if(pe(e))return t.stylize("undefined","undefined");if(Et(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(ki(e))return t.stylize(""+e,"number");if(xr(e))return t.stylize(""+e,"boolean");if(bt(e))return t.stylize("null","null")}function St(t){return"["+Error.prototype.toString.call(t)+"]"}function Ii(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)_r(e,String(s))?o.push(_t(t,e,r,n,String(s),!0)):o.push("");return i.forEach(function(f){f.match(/^\d+$/)||o.push(_t(t,e,r,n,f,!0))}),o}function _t(t,e,r,n,i,o){var s,a,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?a=t.stylize("[Getter/Setter]","special"):a=t.stylize("[Getter]","special"):f.set&&(a=t.stylize("[Setter]","special")),_r(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(f.value)<0?(bt(r)?a=Ge(t,f.value,null):a=Ge(t,f.value,r-1),a.indexOf(`
60
+ `)>-1&&(o?a=a.split(`
61
+ `).map(function(h){return" "+h}).join(`
62
+ `).substr(2):a=`
63
+ `+a.split(`
64
+ `).map(function(h){return" "+h}).join(`
65
+ `))):a=t.stylize("[Circular]","special")),pe(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function Bi(t,e,r){var n=t.reduce(function(i,o){return o.indexOf(`
66
+ `)>=0,i+o.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(e===""?"":e+`
67
+ `)+" "+t.join(`,
68
+ `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Di(t){return Array.isArray(t)}function xr(t){return typeof t=="boolean"}function bt(t){return t===null}function ki(t){return typeof t=="number"}function Et(t){return typeof t=="string"}function pe(t){return t===void 0}function Rt(t){return Ie(t)&&At(t)==="[object RegExp]"}function Ie(t){return typeof t=="object"&&t!==null}function Sr(t){return Ie(t)&&At(t)==="[object Date]"}function Tt(t){return Ie(t)&&(At(t)==="[object Error]"||t instanceof Error)}function Ct(t){return typeof t=="function"}function At(t){return Object.prototype.toString.call(t)}function Pi(t,e){if(!e||!Ie(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function _r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ve(){this.head=null,this.tail=null,this.length=0}ve.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},ve.prototype.unshift=function(t){var e={data:t,next:this.head};this.length===0&&(this.tail=e),this.head=e,++this.length},ve.prototype.shift=function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},ve.prototype.clear=function(){this.head=this.tail=null,this.length=0},ve.prototype.join=function(t){if(this.length===0)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},ve.prototype.concat=function(t){if(this.length===0)return u.alloc(0);if(this.length===1)return this.head.data;for(var e=u.allocUnsafe(t>>>0),r=this.head,n=0;r;)r.data.copy(e,n),n+=r.data.length,r=r.next;return e};var Mi=u.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ni(t){if(t&&!Mi(t))throw new Error("Unknown encoding: "+t)}function Be(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),Ni(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=$i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=ji;break;default:this.write=Ui;return}this.charBuffer=new u(6),this.charReceived=0,this.charLength=0}Be.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";t=t.slice(r,t.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=e.charCodeAt(e.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize,e="";continue}if(this.charReceived=this.charLength=0,t.length===0)return e;break}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),e+=t.toString(this.encoding,0,n);var n=e.length-1,i=e.charCodeAt(n);if(i>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},Be.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(e==1&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},Be.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e};function Ui(t){return t.toString(this.encoding)}function $i(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function ji(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}T.ReadableState=br;var b=Ci("stream");Te(T,c);function Yi(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function qi(t,e){return t.listeners(e).length}function br(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof V&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new ve,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new Be(t.encoding),this.encoding=t.encoding)}function T(t){if(!(this instanceof T))return new T(t);this._readableState=new br(t,this),this.readable=!0,t&&typeof t.read=="function"&&(this._read=t.read),c.call(this)}T.prototype.push=function(t,e){var r=this._readableState;return!r.objectMode&&typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=u.from(t,e),e="")),Er(this,r,t,e,!1)},T.prototype.unshift=function(t){var e=this._readableState;return Er(this,e,t,"",!0)},T.prototype.isPaused=function(){return this._readableState.flowing===!1};function Er(t,e,r,n,i){var o=Vi(e,r);if(o)t.emit("error",o);else if(r===null)e.reading=!1,Ji(t,e);else if(e.objectMode||r&&r.length>0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else{var f;e.decoder&&!i&&!n&&(r=e.decoder.write(r),f=!e.objectMode&&r.length===0),i||(e.reading=!1),f||(e.flowing&&e.length===0&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Ke(t))),zi(t,e)}else i||(e.reading=!1);return Wi(e)}function Wi(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}T.prototype.setEncoding=function(t){return this._readableState.decoder=new Be(t),this._readableState.encoding=t,this};var Rr=8388608;function Hi(t){return t>=Rr?t=Rr:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Tr(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Hi(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}T.prototype.read=function(t){b("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return b("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Lt(this):Ke(this),null;if(t=Tr(t,e),t===0&&e.ended)return e.length===0&&Lt(this),null;var n=e.needReadable;b("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,b("length less than watermark",n)),e.ended||e.reading?(n=!1,b("reading or ended",n)):n&&(b("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Tr(r,e)));var i;return t>0?i=Ar(t,e):i=null,i===null?(e.needReadable=!0,t=0):e.length-=t,e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Lt(this)),i!==null&&this.emit("data",i),i};function Vi(t,e){var r=null;return!hr(e)&&typeof e!="string"&&e!==null&&e!==void 0&&!t.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function Ji(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,Ke(t)}}function Ke(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(b("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?H(Cr,t):Cr(t))}function Cr(t){b("emit readable"),t.emit("readable"),Ot(t)}function zi(t,e){e.readingMore||(e.readingMore=!0,H(Gi,t,e))}function Gi(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(b("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}T.prototype._read=function(t){this.emit("error",new Error("not implemented"))},T.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,b("pipe count=%d opts=%j",n.pipesCount,e);var i=!e||e.end!==!1,o=i?a:d;n.endEmitted?H(o):r.once("end",o),t.on("unpipe",s);function s(Oe){b("onunpipe"),Oe===r&&d()}function a(){b("onend"),t.end()}var f=Ki(r);t.on("drain",f);var h=!1;function d(){b("cleanup"),t.removeListener("close",te),t.removeListener("finish",Pe),t.removeListener("drain",f),t.removeListener("error",E),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",d),r.removeListener("data",R),h=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f()}var v=!1;r.on("data",R);function R(Oe){b("ondata"),v=!1;var ha=t.write(Oe);ha===!1&&!v&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&Or(n.pipes,t)!==-1)&&!h&&(b("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,v=!0),r.pause())}function E(Oe){b("onerror",Oe),Jt(),t.removeListener("error",E),qi(t,"error")===0&&t.emit("error",Oe)}Yi(t,"error",E);function te(){t.removeListener("finish",Pe),Jt()}t.once("close",te);function Pe(){b("onfinish"),t.removeListener("close",te),Jt()}t.once("finish",Pe);function Jt(){b("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(b("pipe resume"),r.resume()),t};function Ki(t){return function(){var e=t._readableState;b("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&t.listeners("data").length&&(e.flowing=!0,Ot(t))}}T.prototype.unpipe=function(t){var e=this._readableState;if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=Or(e.pipes,t);return o===-1?this:(e.pipes.splice(o,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this),this)},T.prototype.on=function(t,e){var r=c.prototype.on.call(this,t,e);if(t==="data")this._readableState.flowing!==!1&&this.resume();else if(t==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&Ke(this):H(Xi,this))}return r},T.prototype.addListener=T.prototype.on;function Xi(t){b("readable nexttick read 0"),t.read(0)}T.prototype.resume=function(){var t=this._readableState;return t.flowing||(b("resume"),t.flowing=!0,Qi(this,t)),this};function Qi(t,e){e.resumeScheduled||(e.resumeScheduled=!0,H(Zi,t,e))}function Zi(t,e){e.reading||(b("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Ot(t),e.flowing&&!e.reading&&t.read(0)}T.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ot(t){var e=t._readableState;for(b("flow",e.flowing);e.flowing&&t.read()!==null;);}T.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;t.on("end",function(){if(b("wrapped end"),e.decoder&&!e.ended){var s=e.decoder.end();s&&s.length&&n.push(s)}n.push(null)}),t.on("data",function(s){if(b("wrapped data"),e.decoder&&(s=e.decoder.write(s)),!(e.objectMode&&s==null)&&!(!e.objectMode&&(!s||!s.length))){var a=n.push(s);a||(r=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(s){return function(){return t[s].apply(t,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return io(o,function(s){t.on(s,n.emit.bind(n,s))}),n._read=function(s){b("wrapped _read",s),r&&(r=!1,t.resume())},n},T._fromList=Ar;function Ar(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.head.data:r=e.buffer.concat(e.length),e.buffer.clear()):r=eo(t,e.buffer,e.decoder),r}function eo(t,e,r){var n;return t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):t===e.head.data.length?n=e.shift():n=r?to(t,e):ro(t,e),n}function to(t,e){var r=e.head,n=1,i=r.data;for(t-=i.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),t-=s,t===0){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}function ro(t,e){var r=u.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),t-=s,t===0){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}function Lt(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,H(no,e,t))}function no(t,e){!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function io(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r],r)}function Or(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}B.WritableState=Ft,Te(B,c);function oo(){}function so(t,e,r){this.chunk=t,this.encoding=e,this.callback=r,this.next=null}function Ft(t,e){Object.defineProperty(this,"buffer",{get:wr(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof V&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){po(e,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new kr(this)}Ft.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};function B(t){if(!(this instanceof B)&&!(this instanceof V))return new B(t);this._writableState=new Ft(t,this),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev)),c.call(this)}B.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function ao(t,e){var r=new Error("write after end");t.emit("error",r),H(e,r)}function uo(t,e,r,n){var i=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):!u.isBuffer(r)&&typeof r!="string"&&r!==void 0&&!e.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),H(n,o),i=!1),i}B.prototype.write=function(t,e,r){var n=this._writableState,i=!1;return typeof e=="function"&&(r=e,e=null),u.isBuffer(t)?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=oo),n.ended?ao(this,r):uo(this,n,t,r)&&(n.pendingcb++,i=lo(this,n,t,e,r)),i},B.prototype.cork=function(){var t=this._writableState;t.corked++},B.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.finished&&!t.bufferProcessing&&t.bufferedRequest&&Fr(this,t))},B.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function fo(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=u.from(e,r)),e}function lo(t,e,r,n,i){r=fo(e,r,n),u.isBuffer(r)&&(n="buffer");var o=e.objectMode?1:r.length;e.length+=o;var s=e.length<e.highWaterMark;if(s||(e.needDrain=!0),e.writing||e.corked){var a=e.lastBufferedRequest;e.lastBufferedRequest=new so(r,n,i),a?a.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else It(t,e,!1,o,r,n,i);return s}function It(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function co(t,e,r,n,i){--e.pendingcb,r?H(i,n):i(n),t._writableState.errorEmitted=!0,t.emit("error",n)}function ho(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function po(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(ho(r),e)co(t,r,n,e,i);else{var o=Ir(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Fr(t,r),n?H(Lr,t,r,o,i):Lr(t,r,o,i)}}function Lr(t,e,r,n){r||go(t,e),e.pendingcb--,n(),Dr(t,e)}function go(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Fr(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0;r;)i[s]=r,r=r.next,s+=1;It(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new kr(e)}else{for(;r;){var a=r.chunk,f=r.encoding,h=r.callback,d=e.objectMode?1:a.length;if(It(t,e,!1,d,a,f,h),r=r.next,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=r,e.bufferProcessing=!1}B.prototype._write=function(t,e,r){r(new Error("not implemented"))},B.prototype._writev=null,B.prototype.end=function(t,e,r){var n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),!n.ending&&!n.finished&&mo(this,n,r)};function Ir(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function Br(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function Dr(t,e){var r=Ir(e);return r&&(e.pendingcb===0?(Br(t,e),e.finished=!0,t.emit("finish")):Br(t,e)),r}function mo(t,e,r){e.ending=!0,Dr(t,e),r&&(e.finished?H(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function kr(t){var e=this;this.next=null,this.entry=null,this.finish=function(r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}Te(V,T);for(var Pr=Object.keys(B.prototype),Bt=0;Bt<Pr.length;Bt++){var Dt=Pr[Bt];V.prototype[Dt]||(V.prototype[Dt]=B.prototype[Dt])}function V(t){if(!(this instanceof V))return new V(t);T.call(this,t),B.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",yo)}function yo(){this.allowHalfOpen||this._writableState.ended||H(vo,this)}function vo(t){t.end()}Te(ee,V);function wo(t){this.afterTransform=function(e,r){return xo(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function xo(t,e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,r!=null&&t.push(r),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}function ee(t){if(!(this instanceof ee))return new ee(t);V.call(this,t),this._transformState=new wo(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(r){Mr(e,r)}):Mr(e)})}ee.prototype.push=function(t,e){return this._transformState.needTransform=!1,V.prototype.push.call(this,t,e)},ee.prototype._transform=function(t,e,r){throw new Error("Not implemented")},ee.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},ee.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};function Mr(t,e){if(e)return t.emit("error",e);var r=t._writableState,n=t._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}Te(De,ee);function De(t){if(!(this instanceof De))return new De(t);ee.call(this,t)}De.prototype._transform=function(t,e,r){r(null,t)},Te(J,c),J.Readable=T,J.Writable=B,J.Duplex=V,J.Transform=ee,J.PassThrough=De,J.Stream=J;function J(){c.call(this)}J.prototype.pipe=function(t,e){var r=this;function n(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",a));var o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function f(d){if(h(),c.listenerCount(this,"error")===0)throw d}r.on("error",f),t.on("error",f);function h(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t};function ae(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ae=function(e){return typeof e}:ae=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(t)}function Xe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Qe(t,e,r){return e&&Nr(t.prototype,e),r&&Nr(t,r),t}function Ze(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ur(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Ze(t,i,r[i])})}return t}function $r(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&kt(t,e)}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},et(t)}function kt(t,e){return kt=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},kt(t,e)}function So(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jr(t,e){return e&&(typeof e=="object"||typeof e=="function")?e:So(t)}function Yr(t){return Eo(t)||qr(t)||To()}function _o(t){return bo(t)||qr(t)||Ro()}function bo(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function Eo(t){if(Array.isArray(t))return t}function qr(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function Ro(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function To(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var tt;function Co(){if(typeof tt=="undefined"){var t=new ArrayBuffer(2),e=new Uint8Array(t),r=new Uint16Array(t);if(e[0]=1,e[1]=2,r[0]===258)tt="BE";else if(r[0]===513)tt="LE";else throw new Error("unable to figure out endianess")}return tt}function Ao(){return typeof k.location!="undefined"?k.location.hostname:""}function Oo(){return[]}function Lo(){return 0}function Fo(){return Number.MAX_VALUE}function Io(){return Number.MAX_VALUE}function Bo(){return[]}function Do(){return"Browser"}function ko(){return typeof k.navigator!="undefined"?k.navigator.appVersion:""}function Po(){}function Mo(){}function Wr(){return"/tmp"}var No=Wr,Uo=`
69
+ `,$o={EOL:Uo,tmpdir:No,tmpDir:Wr,networkInterfaces:Po,getNetworkInterfaces:Mo,release:ko,type:Do,cpus:Bo,totalmem:Io,freemem:Fo,uptime:Lo,loadavg:Oo,hostname:Ao,endianness:Co},rt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof Me!="undefined"?Me:typeof self!="undefined"?self:{},jo="Expected a function",Hr="__lodash_hash_undefined__",Vr=1/0,Yo="[object Function]",qo="[object GeneratorFunction]",Wo="[object Symbol]",Ho=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vo=/^\w*$/,Jo=/^\./,zo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Go=/[\\^$.*+?()[\]{}|]/g,Ko=/\\(\\)?/g,Xo=/^\[object .+?Constructor\]$/,Qo=typeof rt=="object"&&rt&&rt.Object===Object&&rt,Zo=typeof self=="object"&&self&&self.Object===Object&&self,Pt=Qo||Zo||Function("return this")();function es(t,e){return t==null?void 0:t[e]}function ts(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var rs=Array.prototype,ns=Function.prototype,Jr=Object.prototype,Mt=Pt["__core-js_shared__"],zr=function(){var t=/[^.]+$/.exec(Mt&&Mt.keys&&Mt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Gr=ns.toString,Nt=Jr.hasOwnProperty,Kr=Jr.toString,is=RegExp("^"+Gr.call(Nt).replace(Go,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xr=Pt.Symbol,os=rs.splice,ss=en(Pt,"Map"),ke=en(Object,"create"),Qr=Xr?Xr.prototype:void 0,Zr=Qr?Qr.toString:void 0;function we(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function as(){this.__data__=ke?ke(null):{}}function us(t){return this.has(t)&&delete this.__data__[t]}function fs(t){var e=this.__data__;if(ke){var r=e[t];return r===Hr?void 0:r}return Nt.call(e,t)?e[t]:void 0}function ls(t){var e=this.__data__;return ke?e[t]!==void 0:Nt.call(e,t)}function cs(t,e){var r=this.__data__;return r[t]=ke&&e===void 0?Hr:e,this}we.prototype.clear=as,we.prototype.delete=us,we.prototype.get=fs,we.prototype.has=ls,we.prototype.set=cs;function Ce(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function hs(){this.__data__=[]}function ps(t){var e=this.__data__,r=nt(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():os.call(e,r,1),!0}function ds(t){var e=this.__data__,r=nt(e,t);return r<0?void 0:e[r][1]}function gs(t){return nt(this.__data__,t)>-1}function ms(t,e){var r=this.__data__,n=nt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Ce.prototype.clear=hs,Ce.prototype.delete=ps,Ce.prototype.get=ds,Ce.prototype.has=gs,Ce.prototype.set=ms;function xe(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ys(){this.__data__={hash:new we,map:new(ss||Ce),string:new we}}function vs(t){return it(this,t).delete(t)}function ws(t){return it(this,t).get(t)}function xs(t){return it(this,t).has(t)}function Ss(t,e){return it(this,t).set(t,e),this}xe.prototype.clear=ys,xe.prototype.delete=vs,xe.prototype.get=ws,xe.prototype.has=xs,xe.prototype.set=Ss;function nt(t,e){for(var r=t.length;r--;)if(Is(t[r][0],e))return r;return-1}function _s(t,e){e=Ts(e,t)?[e]:Rs(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ls(e[r++])];return r&&r==n?t:void 0}function bs(t){if(!rn(t)||As(t))return!1;var e=Bs(t)||ts(t)?is:Xo;return e.test(Fs(t))}function Es(t){if(typeof t=="string")return t;if($t(t))return Zr?Zr.call(t):"";var e=t+"";return e=="0"&&1/t==-Vr?"-0":e}function Rs(t){return tn(t)?t:Os(t)}function it(t,e){var r=t.__data__;return Cs(e)?r[typeof e=="string"?"string":"hash"]:r.map}function en(t,e){var r=es(t,e);return bs(r)?r:void 0}function Ts(t,e){if(tn(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||$t(t)?!0:Vo.test(t)||!Ho.test(t)||e!=null&&t in Object(e)}function Cs(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function As(t){return!!zr&&zr in t}var Os=Ut(function(t){t=ks(t);var e=[];return Jo.test(t)&&e.push(""),t.replace(zo,function(r,n,i,o){e.push(i?o.replace(Ko,"$1"):n||r)}),e});function Ls(t){if(typeof t=="string"||$t(t))return t;var e=t+"";return e=="0"&&1/t==-Vr?"-0":e}function Fs(t){if(t!=null){try{return Gr.call(t)}catch{}try{return t+""}catch{}}return""}function Ut(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(jo);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Ut.Cache||xe),r}Ut.Cache=xe;function Is(t,e){return t===e||t!==t&&e!==e}var tn=Array.isArray;function Bs(t){var e=rn(t)?Kr.call(t):"";return e==Yo||e==qo}function rn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ds(t){return!!t&&typeof t=="object"}function $t(t){return typeof t=="symbol"||Ds(t)&&Kr.call(t)==Wo}function ks(t){return t==null?"":Es(t)}function Ps(t,e,r){var n=t==null?void 0:_s(t,e);return n===void 0?r:n}var jt=Ps;function Ms(t,e,r){return t[e]===void 0?r:t[e]}function nn(t,e,r){var n=Array.isArray(e)?e:e.split("."),i=Yr(n),o=i[0],s=i.slice(1);return Ur({},t,Ze({},o,n.length>1?nn(t[o]||{},s,r):r))}function on(t,e){var r=Array.isArray(e)?e:e.split("."),n=Yr(r),i=n[0],o=n.slice(1);return ae(t[i])!=="object"?t:r.length===1?Object.keys(t).filter(function(s){return s!==i}).reduce(function(s,a){return Object.assign(s,Ze({},a,t[a]))},{}):Object.keys(t).reduce(function(s,a){return Ur({},s,Ze({},a,a!==i?t[a]:on(t[i],o)))},{})}function Ns(t,e){try{return t.push.apply(t,_o(e)),t}catch{return t.concat(e)}}function Us(t,e){var r=!0;return t.reduce(function(n,i){return i==null&&(i=""),r?(r=!1,"".concat(i)):"".concat(n).concat(e).concat(i)},"")}var ue={getProp:Ms,setProp:nn,unsetProp:on,fastJoin:Us,flattenReducer:Ns},sn=ue.getProp,an=ue.fastJoin,$s=ue.flattenReducer,js=function(){function t(e){Xe(this,t),this.opts=this.preprocessOpts(e)}return Qe(t,[{key:"preprocessOpts",value:function(r){var n=Object.assign({},r);return n.transforms=Array.isArray(n.transforms)?n.transforms:n.transforms?[n.transforms]:[],n.delimiter=n.delimiter||",",n.eol=n.eol||$o.EOL,n.quote=typeof n.quote=="string"?n.quote:'"',n.escapedQuote=typeof n.escapedQuote=="string"?n.escapedQuote:"".concat(n.quote).concat(n.quote),n.header=n.header!==!1,n.includeEmptyRows=n.includeEmptyRows||!1,n.withBOM=n.withBOM||!1,n}},{key:"preprocessFieldsInfo",value:function(r){var n=this;return r.map(function(i){if(typeof i=="string")return{label:i,value:i.includes(".")||i.includes("[")?function(f){return jt(f,i,n.opts.defaultValue)}:function(f){return sn(f,i,n.opts.defaultValue)}};if(ae(i)==="object"){var o="default"in i?i.default:n.opts.defaultValue;if(typeof i.value=="string")return{label:i.label||i.value,value:i.value.includes(".")||i.value.includes("[")?function(f){return jt(f,i.value,o)}:function(f){return sn(f,i.value,o)}};if(typeof i.value=="function"){var s=i.label||i.value.name||"",a={label:s,default:o};return{label:s,value:function(h){var d=i.value(h,a);return d==null?o:d}}}}throw new Error("Invalid field info option. "+JSON.stringify(i))})}},{key:"getHeader",value:function(){var r=this;return an(this.opts.fields.map(function(n){return r.processValue(n.label)}),this.opts.delimiter)}},{key:"preprocessRow",value:function(r){return this.opts.transforms.reduce(function(n,i){return n.map(function(o){return i(o)}).reduce($s,[])},[r])}},{key:"processRow",value:function(r){var n=this;if(!!r){var i=this.opts.fields.map(function(o){return n.processCell(r,o)});if(!(!this.opts.includeEmptyRows&&i.every(function(o){return o===void 0})))return an(i,this.opts.delimiter)}}},{key:"processCell",value:function(r,n){return this.processValue(n.value(r))}},{key:"processValue",value:function(r){if(r!=null){var n=ae(r);if(n!=="boolean"&&n!=="number"&&n!=="string"){if(r=JSON.stringify(r),r===void 0)return;r[0]==='"'&&(r=r.replace(/^"(.+)"$/,"$1"))}return typeof r=="string"&&(this.opts.excelStrings?(r.includes(this.opts.quote)&&(r=r.replace(new RegExp(this.opts.quote,"g"),"".concat(this.opts.escapedQuote).concat(this.opts.escapedQuote))),r='"=""'.concat(r,'"""')):(r.includes(this.opts.quote)&&(r=r.replace(new RegExp(this.opts.quote,"g"),this.opts.escapedQuote)),r="".concat(this.opts.quote).concat(r).concat(this.opts.quote))),r}}}]),t}(),Yt=js,Ys=ue.fastJoin,qs=ue.flattenReducer,Ws=function(t){$r(e,t);function e(r){var n;return Xe(this,e),n=jr(this,et(e).call(this,r)),n.opts.fields&&(n.opts.fields=n.preprocessFieldsInfo(n.opts.fields)),n}return Qe(e,[{key:"parse",value:function(n){var i=this.preprocessData(n);this.opts.fields||(this.opts.fields=i.reduce(function(f,h){return Object.keys(h).forEach(function(d){f.includes(d)||f.push(d)}),f},[]),this.opts.fields=this.preprocessFieldsInfo(this.opts.fields));var o=this.opts.header?this.getHeader():"",s=this.processData(i),a=(this.opts.withBOM?"\uFEFF":"")+o+(o&&s?this.opts.eol:"")+s;return a}},{key:"preprocessData",value:function(n){var i=this,o=Array.isArray(n)?n:[n];if(!this.opts.fields&&(o.length===0||ae(o[0])!=="object"))throw new Error('Data should not be empty or the "fields" option should be included');return this.opts.transforms.length===0?o:o.map(function(s){return i.preprocessRow(s)}).reduce(qs,[])}},{key:"processData",value:function(n){var i=this;return Ys(n.map(function(o){return i.processRow(o)}).filter(function(o){return o}),this.opts.eol)}}]),e}(Yt),un=Ws,x={},fn=x.LEFT_BRACE=1,ot=x.RIGHT_BRACE=2,ln=x.LEFT_BRACKET=3,qt=x.RIGHT_BRACKET=4,st=x.COLON=5,at=x.COMMA=6,cn=x.TRUE=7,hn=x.FALSE=8,pn=x.NULL=9,ut=x.STRING=10,dn=x.NUMBER=11,Se=x.START=17,gn=x.STOP=18,mn=x.TRUE1=33,yn=x.TRUE2=34,vn=x.TRUE3=35,wn=x.FALSE1=49,xn=x.FALSE2=50,Sn=x.FALSE3=51,_n=x.FALSE4=52,bn=x.NULL1=65,En=x.NULL2=66,Rn=x.NULL3=67,Tn=x.NUMBER1=81,Wt=x.NUMBER3=83,K=x.STRING1=97,Cn=x.STRING2=98,An=x.STRING3=99,Hs=x.STRING4=100,Vs=x.STRING5=101,On=x.STRING6=102,Ae=x.VALUE=113,Ht=x.KEY=114,ft=x.OBJECT=129,lt=x.ARRAY=130,Js="\\".charCodeAt(0),zs="/".charCodeAt(0),Gs="\b".charCodeAt(0),Ks="\f".charCodeAt(0),Xs=`
70
+ `.charCodeAt(0),Qs="\r".charCodeAt(0),Zs=" ".charCodeAt(0),ct=64*1024;function de(){this.tState=Se,this.value=void 0,this.string=void 0,this.stringBuffer=u.alloc?u.alloc(ct):new u(ct),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=Ae,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new u(2),3:new u(3),4:new u(4)},this.offset=-1}de.toknam=function(t){for(var e=Object.keys(x),r=0,n=e.length;r<n;r++){var i=e[r];if(x[i]===t)return i}return t&&"0x"+t.toString(16)};var z=de.prototype;z.onError=function(t){throw t},z.charError=function(t,e){this.tState=gn,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(t[e]))+" at position "+e+" in state "+de.toknam(this.tState)))},z.appendStringChar=function(t){this.stringBufferOffset>=ct&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=t},z.appendStringBuf=function(t,e,r){var n=t.length;typeof e=="number"&&(typeof r=="number"?r<0?n=t.length-e+r:n=r-e:n=t.length-e),n<0&&(n=0),this.stringBufferOffset+n>ct&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),t.copy(this.stringBuffer,this.stringBufferOffset,e,r),this.stringBufferOffset+=n},z.write=function(t){typeof t=="string"&&(t=new u(t));for(var e,r=0,n=t.length;r<n;r++)if(this.tState===Se){if(e=t[r],this.offset++,e===123)this.onToken(fn,"{");else if(e===125)this.onToken(ot,"}");else if(e===91)this.onToken(ln,"[");else if(e===93)this.onToken(qt,"]");else if(e===58)this.onToken(st,":");else if(e===44)this.onToken(at,",");else if(e===116)this.tState=mn;else if(e===102)this.tState=wn;else if(e===110)this.tState=bn;else if(e===34)this.string="",this.stringBufferOffset=0,this.tState=K;else if(e===45)this.string="-",this.tState=Tn;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=Wt;else if(!(e===32||e===9||e===10||e===13))return this.charError(t,r)}else if(this.tState===K)if(e=t[r],this.bytes_remaining>0){for(var i=0;i<this.bytes_remaining;i++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+i]=t[i];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,r=r+i-1}else if(this.bytes_remaining===0&&e>=128){if(e<=193||e>244)return this.onError(new Error("Invalid UTF-8 character at position "+r+" in state "+de.toknam(this.tState)));if(e>=194&&e<=223&&(this.bytes_in_sequence=2),e>=224&&e<=239&&(this.bytes_in_sequence=3),e>=240&&e<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+r>t.length){for(var o=0;o<=t.length-1-r;o++)this.temp_buffs[this.bytes_in_sequence][o]=t[r+o];this.bytes_remaining=r+this.bytes_in_sequence-t.length,r=t.length-1}else this.appendStringBuf(t,r,r+this.bytes_in_sequence),r=r+this.bytes_in_sequence-1}else if(e===34)this.tState=Se,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(ut,this.string),this.offset+=u.byteLength(this.string,"utf8")+1,this.string=void 0;else if(e===92)this.tState=Cn;else if(e>=32)this.appendStringChar(e);else return this.charError(t,r);else if(this.tState===Cn)if(e=t[r],e===34)this.appendStringChar(e),this.tState=K;else if(e===92)this.appendStringChar(Js),this.tState=K;else if(e===47)this.appendStringChar(zs),this.tState=K;else if(e===98)this.appendStringChar(Gs),this.tState=K;else if(e===102)this.appendStringChar(Ks),this.tState=K;else if(e===110)this.appendStringChar(Xs),this.tState=K;else if(e===114)this.appendStringChar(Qs),this.tState=K;else if(e===116)this.appendStringChar(Zs),this.tState=K;else if(e===117)this.unicode="",this.tState=An;else return this.charError(t,r);else if(this.tState===An||this.tState===Hs||this.tState===Vs||this.tState===On)if(e=t[r],e>=48&&e<64||e>64&&e<=70||e>96&&e<=102){if(this.unicode+=String.fromCharCode(e),this.tState++===On){var s=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&s>=56320&&s<57343+1?(this.appendStringBuf(new u(String.fromCharCode(this.highSurrogate,s))),this.highSurrogate=void 0):this.highSurrogate===void 0&&s>=55296&&s<56319+1?this.highSurrogate=s:(this.highSurrogate!==void 0&&(this.appendStringBuf(new u(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new u(String.fromCharCode(s)))),this.tState=K}}else return this.charError(t,r);else if(this.tState===Tn||this.tState===Wt)switch(e=t[r],e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(e),this.tState=Wt;break;default:this.tState=Se;var a=Number(this.string);if(isNaN(a))return this.charError(t,r);this.string.match(/[0-9]+/)==this.string&&a.toString()!=this.string?this.onToken(ut,this.string):this.onToken(dn,a),this.offset+=this.string.length-1,this.string=void 0,r--;break}else if(this.tState===mn)if(t[r]===114)this.tState=yn;else return this.charError(t,r);else if(this.tState===yn)if(t[r]===117)this.tState=vn;else return this.charError(t,r);else if(this.tState===vn)if(t[r]===101)this.tState=Se,this.onToken(cn,!0),this.offset+=3;else return this.charError(t,r);else if(this.tState===wn)if(t[r]===97)this.tState=xn;else return this.charError(t,r);else if(this.tState===xn)if(t[r]===108)this.tState=Sn;else return this.charError(t,r);else if(this.tState===Sn)if(t[r]===115)this.tState=_n;else return this.charError(t,r);else if(this.tState===_n)if(t[r]===101)this.tState=Se,this.onToken(hn,!1),this.offset+=4;else return this.charError(t,r);else if(this.tState===bn)if(t[r]===117)this.tState=En;else return this.charError(t,r);else if(this.tState===En)if(t[r]===108)this.tState=Rn;else return this.charError(t,r);else if(this.tState===Rn)if(t[r]===108)this.tState=Se,this.onToken(pn,null),this.offset+=3;else return this.charError(t,r)},z.onToken=function(t,e){},z.parseError=function(t,e){this.tState=gn,this.onError(new Error("Unexpected "+de.toknam(t)+(e?"("+JSON.stringify(e)+")":"")+" in state "+de.toknam(this.state)))},z.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},z.pop=function(){var t=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(t),this.mode||(this.state=Ae)},z.emit=function(t){this.mode&&(this.state=at),this.onValue(t)},z.onValue=function(t){},z.onToken=function(t,e){if(this.state===Ae)if(t===ut||t===dn||t===cn||t===hn||t===pn)this.value&&(this.value[this.key]=e),this.emit(e);else if(t===fn)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=Ht,this.mode=ft;else if(t===ln)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=lt,this.state=Ae;else if(t===ot)if(this.mode===ft)this.pop();else return this.parseError(t,e);else if(t===qt)if(this.mode===lt)this.pop();else return this.parseError(t,e);else return this.parseError(t,e);else if(this.state===Ht)if(t===ut)this.key=e,this.state=st;else if(t===ot)this.pop();else return this.parseError(t,e);else if(this.state===st)if(t===st)this.state=Ae;else return this.parseError(t,e);else if(this.state===at)if(t===at)this.mode===lt?(this.key++,this.state=Ae):this.mode===ft&&(this.state=Ht);else if(t===qt&&this.mode===lt||t===ot&&this.mode===ft)this.pop();else return this.parseError(t,e);else return this.parseError(t,e)},de.C=x;var ht=de,ea=J.Transform,ta=function(t){$r(e,t);function e(r,n){var i;return Xe(this,e),i=jr(this,et(e).call(this,n)),Object.getOwnPropertyNames(Yt.prototype).forEach(function(o){return i[o]=Yt.prototype[o]}),i.opts=i.preprocessOpts(r),i._data="",i._hasWritten=!1,i._readableState.objectMode?i.initObjectModeParse():i.opts.ndjson?i.initNDJSONParse():i.initJSONParser(),i.opts.withBOM&&i.push("\uFEFF"),i.opts.fields&&(i.opts.fields=i.preprocessFieldsInfo(i.opts.fields),i.pushHeader()),i}return Qe(e,[{key:"initObjectModeParse",value:function(){var n=this;this.parser={write:function(o){n.pushLine(o)},getPendingData:function(){}}}},{key:"initNDJSONParse",value:function(){var n=this;this.parser={_data:"",write:function(o){this._data+=o.toString();var s=this._data.split(`
71
+ `).map(function(f){return f.trim()}).filter(function(f){return f!==""}),a=!1;s.forEach(function(f,h){try{n.pushLine(JSON.parse(f))}catch(d){h===s.length-1?a=!0:(d.message="Invalid JSON (".concat(f,")"),n.emit("error",d))}}),this._data=a?this._data.slice(this._data.lastIndexOf(`
72
+ `)):""},getPendingData:function(){return this._data}}}},{key:"initJSONParser",value:function(){var n=this;this.parser=new ht,this.parser.onValue=function(i){this.stack.length===this.depthToEmit&&n.pushLine(i)},this.parser._onToken=this.parser.onToken,this.parser.onToken=function(i,o){n.parser._onToken(i,o),this.stack.length===0&&!n.opts.fields&&this.mode!==ht.C.ARRAY&&this.mode!==ht.C.OBJECT&&this.onError(new Error('Data should not be empty or the "fields" option should be included')),this.stack.length===1&&(this.depthToEmit===void 0&&(this.depthToEmit=this.mode===ht.C.ARRAY?1:0),this.depthToEmit!==0&&this.stack.length===1&&(this.value=void 0))},this.parser.getPendingData=function(){return this.value},this.parser.onError=function(i){i.message.includes("Unexpected")&&(i.message="Invalid JSON (".concat(i.message,")")),n.emit("error",i)}}},{key:"_transform",value:function(n,i,o){this.parser.write(n),o()}},{key:"_flush",value:function(n){this.parser.getPendingData()&&n(new Error("Invalid data received from stdin",this.parser.getPendingData())),n()}},{key:"pushHeader",value:function(){if(this.opts.header){var n=this.getHeader();this.emit("header",n),this.push(n),this._hasWritten=!0}}},{key:"pushLine",value:function(n){var i=this,o=this.preprocessRow(n);this._hasWritten||(this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(Object.keys(o[0])),this.pushHeader()),o.forEach(function(s){var a=i.processRow(s,i.opts);a!==void 0&&(i.emit("line",a),i.push(i._hasWritten?i.opts.eol+a:a),i._hasWritten=!0)})}}]),e}(ea),Ln=ta,ra=J.Transform,na=ue.fastJoin,ia=function(){function t(e,r){Xe(this,t),this.input=new ra(r),this.input._read=function(){},this.transform=new Ln(e,r),this.processor=this.input.pipe(this.transform)}return Qe(t,[{key:"fromInput",value:function(r){if(this._input)throw new Error("Async parser already has an input.");return this._input=r,this.input=this._input.pipe(this.processor),this}},{key:"throughTransform",value:function(r){if(this._output)throw new Error("Can't add transforms once an output has been added.");return this.processor=this.processor.pipe(r),this}},{key:"toOutput",value:function(r){if(this._output)throw new Error("Async parser already has an output.");return this._output=r,this.processor=this.processor.pipe(r),this}},{key:"promise",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return new Promise(function(i,o){if(!n){r.processor.on("finish",function(){return i()}).on("error",function(a){return o(a)});return}var s=[];r.processor.on("data",function(a){return s.push(a.toString())}).on("finish",function(){return i(na(s,""))}).on("error",function(a){return o(a)})})}}]),t}(),Fn=ia;function oa(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.objects,r=e===void 0?!0:e,n=t.arrays,i=n===void 0?!1:n,o=t.separator,s=o===void 0?".":o;function a(f,h,d){return Object.keys(f).forEach(function(v){var R=d?"".concat(d).concat(s).concat(v):v,E=f[v];if(r&&ae(E)==="object"&&E!==null&&!Array.isArray(E)&&Object.prototype.toString.call(E.toJSON)!=="[object Function]"&&Object.keys(E).length){a(E,h,R);return}if(i&&Array.isArray(E)){a(E,h,R);return}h[R]=E}),h}return function(f){return a(f,{})}}var sa=oa,aa=ue.setProp,ua=ue.unsetProp,In=ue.flattenReducer;function Vt(t,e){return Object.keys(t).reduce(function(r,n){var i=e?"".concat(e,".").concat(n):n,o=t[n];return ae(o)==="object"&&o!==null&&!Array.isArray(o)&&Object.prototype.toString.call(o.toJSON)!=="[object Function]"&&Object.keys(o).length?r=r.concat(Vt(o,i)):Array.isArray(o)&&(r.push(i),r=r.concat(o.map(function(s){return Vt(s,i)}).reduce(In,[]).filter(function(s,a,f){return f.indexOf(s)!==a}))),r},[])}function fa(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.paths,r=e===void 0?void 0:e,n=t.blankOut,i=n===void 0?!1:n;function o(s,a){return s.map(function(f){var h=jt(f,a);return Array.isArray(h)?h.length?h.map(function(d,v){var R=i&&v>0?{}:f;return aa(R,a,d)}):ua(f,a):f}).reduce(In,[])}return r=Array.isArray(r)?r:r?[r]:void 0,function(s){return(r||Vt(s)).reduce(o,[s])}}var la=fa,Bn=J.Readable,Dn=un,kn=Fn,Pn=Ln,Mn=function(e,r){return new un(r).parse(e)},Nn=function(e,r,n){try{e instanceof Bn||(n=Object.assign({},n,{objectMode:!0}));var i=new Fn(r,n),o=i.promise();return Array.isArray(e)?(e.forEach(function(s){return i.input.push(s)}),i.input.push(null)):e instanceof Bn?i.fromInput(e):(i.input.push(e),i.input.push(null)),o}catch(s){return Promise.reject(s)}},Un={flatten:sa,unwind:la},ca={Parser:Dn,AsyncParser:kn,Transform:Pn,parse:Mn,parseAsync:Nn,transforms:Un};p.AsyncParser=kn,p.Parser=Dn,p.Transform=Pn,p.default=ca,p.parse=Mn,p.parseAsync=Nn,p.transforms=Un,Object.defineProperty(p,"__esModule",{value:!0})})})(_e,_e.exports);const Le=({data:l,fileName:g,fileType:p})=>{const m=`text/${p}`,y=new Blob([l],{type:m}),c=document.createElement("a");c.download=`${g}.${p}`,c.href=window.URL.createObjectURL(y);const S=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});c.dispatchEvent(S),c.remove()};function za({lat:l,lng:g,include:p,enabled:m}){const{client:y}=Ue(),c={lat:l,lng:g,geographyLevels:["10","30"],locationScoresRounding:!1,include:p};return be(va.list(c),async()=>y.getScores(c),{enabled:!!c&&m})}function Ga({lat:l,lng:g,enabled:p,limit:m,radius:y}){const{client:c}=Ue(),S={lat:l,lng:g,limit:m,radius:y};return be(wa.list(S),async()=>c.getSchools(S),{enabled:!!S&&p})}function Ka({lat:l,lng:g,enabled:p,include:m,limit:y,radius:c}){const{client:S}=Ue(),F={lat:l,lng:g,limit:y,radius:c,include:m};return be(xa.list(F),async()=>S.getPois(F),{enabled:!!F&&p})}const Vn={all:()=>["demographics"],list:l=>[...Vn.all(),l]};function Xa({lat:l,lng:g,enabled:p,radius:m}){const{client:y}=Ue(),c={lat:l,lng:g,radius:m};return be(Vn.list(c),async()=>y.getDemographics(c),{enabled:!!c&&p})}const Qa=C.div`
73
+ padding: ${_["--ll-spacing-medium"]};
74
+ display: flex;
75
+ background-color: ${_["--ll-color-surface"]};
76
+ box-shadow: ${_["--ll-shadow-medium"]};
77
+ justify-content: flex-end;
78
+ border-top: 1px solid ${_["--ll-color-border"]};
79
+ `,Za=C.div`
80
+ height: 40px;
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+ margin-right: ${_["--ll-spacing-medium"]};
85
+ `,Jn={all:()=>["profiles"],list:l=>[...Jn.all(),l]};function eu({lat:l,lng:g,enabled:p}){const{client:m}=Ue(),y={lat:l,lng:g};return be(Jn.list(y),async()=>m.getProfiles(y),{enabled:!!y&&p})}const tu=()=>{const{dataExplorerState:l}=Ee(),{translations:g}=$e(),{data:p,isFetching:m}=za({lat:l.location.lat,lng:l.location.lng,enabled:l.scores.checked,include:l.scores.include}),{data:y,isFetching:c}=Ka({lat:l.location.lat,lng:l.location.lng,enabled:l.pois.checked,include:l.pois.include,limit:l.pois.limit,radius:l.pois.radius}),{data:S,isFetching:F}=Ga({lat:l.location.lat,lng:l.location.lng,enabled:l.schools.checked,limit:l.pois.limit,radius:l.pois.radius}),{data:N,isFetching:re}=Xa({lat:l.location.lat,lng:l.location.lng,enabled:l.demographics.checked,radius:l.demographics.radius}),{data:j,isFetching:Y}=eu({lat:l.location.lat,lng:l.location.lng,enabled:l.profiles.checked}),X=M.exports.useMemo(()=>({...p&&l.scores.checked&&{scores:p},...y&&l.pois.checked&&{pois:y},...S&&l.schools.checked&&{schools:S},...N&&l.demographics.checked&&{demographics:N},...j&&l.profiles.checked&&{profiles:j}}),[y,p,S,j,N,l]),Q=m||c||F||re||Y,ne=U=>{U.preventDefault(),Le({data:JSON.stringify(X),fileName:"local-logic-data",fileType:"json"})},L=()=>{if(!p)return;((I,q)=>{const ie=Object.entries(I).map(([dt,je])=>({score:dt,...je})),fe=_e.exports.parse(ie);!fe||Le({data:fe,fileName:q,fileType:"csv"})})(p.location,"scores")},A=()=>{if(!y)return;const U=Object.entries(y).map(([q,ie])=>ie.map(fe=>({poi:q,...fe}))).flat(),I=_e.exports.parse(U);!I||Le({data:I,fileName:"pois",fileType:"csv"})},G=()=>{if(!S)return;const U=Object.entries(S).map(([q,ie])=>ie.map(fe=>({school:q,...fe}))).flat(),I=_e.exports.parse(U);!I||Le({data:I,fileName:"schools",fileType:"csv"})},ge=()=>{if(!N)return;const U=Object.entries(N).map(([q,ie])=>({demographic:q,...ie})),I=_e.exports.parse(U);!I||Le({data:I,fileName:"demographics",fileType:"csv"})},k=()=>{if(!j)return;const U=[j],I=["id","intro","name","profiles.character","profiles.housing","profiles.services","profiles.transport"],q=_e.exports.parse(U,{fields:I});!q||Le({data:q,fileName:"profiles",fileType:"csv"})},W=U=>{U.preventDefault(),L(),A(),G(),ge(),k()},P=Object.keys(X).length;return D(Qa,{children:[Q&&w(Za,{children:w(Oa,{})}),D(pt,{variant:"contained",onClick:ne,disabled:!Object.keys(X).length||Q,children:[g.EXPORT," JSON"]}),w(Kt,{spacing:"--ll-spacing-xx-small"}),D(pt,{variant:"contained",onClick:W,disabled:!P||Q,children:[g.EXPORT," CSV (",P,")"]})]})},ru=C(Wn.div)`
86
+ overflow: hidden;
87
+ `,nu=({transitionOpacity:l=!0,defaultHeight:g=0,open:p,children:m})=>{const[y,c]=Sa(),S={open:{height:c.height,opacity:1},closed:{height:g,opacity:l?0:1}};return w(ru,{variants:S,initial:p?"open":"closed",animate:p?"open":"closed",transition:{ease:"easeInOut"},children:w("div",{ref:y,children:m})})},iu=(l,g,p)=>{M.exports.useEffect(()=>{const m=y=>{l.current&&!l.current.contains(y.target)&&p()};return window.addEventListener(g,m),()=>window.removeEventListener(g,m)},[l])},zn={all:()=>["geocodes"],list:l=>[...zn.all(),l]},ou="https://geocoder.ls.hereapi.com/6.2/geocode.json?";function su(l){const g={locationid:l,country:"CAN,USA",apiKey:{}.VITE_HERE_API_KEY},p=()=>fetch(ou+new URLSearchParams(g)).then(m=>m.json()).then(m=>m.Response.View[0].Result[0]);return be(zn.list(g),p,{enabled:!!l})}const Gn={all:()=>["suggestions"],list:l=>[...Gn.all(),l]},au="https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?";function uu(l){const g={query:l,country:"CAN,USA",apiKey:{}.VITE_HERE_API_KEY},p=()=>fetch(au+new URLSearchParams(g)).then(m=>m.json());return be(Gn.list(g),p,{enabled:!!l.length})}const fu=C.div`
88
+ max-width: 300px;
89
+ position: relative;
90
+ `,lu=C.div`
91
+ position: absolute;
92
+ top: calc(100% + 6px);
93
+ width: 100%;
94
+ box-shadow: 0px 5px 8px -4px rgba(0, 0, 0, 0.5);
95
+ transform: translateY(-3px);
96
+ background-color: ${_["--ll-color-background"]};
97
+ border-radius:${_["--ll-border-radius-small"]};
98
+ z-index: 2;
99
+ `,Kn=C.button`
100
+ width: 100%;
101
+ border: none;
102
+ cursor: pointer;
103
+ text-align: left;
104
+ padding: ${_["--ll-spacing-medium"]} ${_["--ll-spacing-small"]};
105
+ background-color: var(--color-white);
106
+ margin: 0;
107
+
108
+ &:focus {
109
+ transform: translate3d(0, 0, 0);
110
+ }
111
+ `,cu=C.ul`
112
+ list-style-type: none;
113
+ padding: 0;
114
+ margin: 0;
115
+ `,hu=C.li`
116
+ &:last-child {
117
+ ${Kn} {
118
+ overflow: hidden;
119
+ border-radius: 0 0 ${_["--ll-border-radius-small"]} ${_["--ll-border-radius-small"]};
120
+ }
121
+ }
122
+
123
+ &:not(:last-child) {
124
+ }
125
+ `,pu=({onSearch:l})=>{const g=M.exports.useRef(null),[p,m]=M.exports.useState(""),[y,c]=M.exports.useState(""),{data:S,isLoading:F}=su(y),N=La(p,300),[re,j]=M.exports.useState(!0),{data:Y,isLoading:X}=uu(N);iu(g,"click",()=>j(!1)),M.exports.useEffect(()=>{!S||F||(l({longitude:S.Location.DisplayPosition.Longitude,latitude:S.Location.DisplayPosition.Latitude}),j(!1))},[S]);const Q=({locationId:L,label:A})=>{c(L),m(A)},ne=(L,A)=>L.split(new RegExp(`(${A})`,"gi")).map((ge,k)=>ge.toLowerCase()===A.toLowerCase()?w("strong",{children:ge},k):w("span",{children:ge},k));return D(fu,{ref:g,children:[w(Fa,{value:p,placeholder:"Search map...",onChange:L=>m(L.currentTarget.value),onFocus:()=>j(!0)}),w(lu,{children:w(nu,{open:re&&!!(Y!=null&&Y.suggestions.length),children:w(cu,{children:Y==null?void 0:Y.suggestions.map((L,A)=>w(hu,{children:w(Kn,{onClick:()=>Q(L),children:w(Wn.div,{animate:{y:[10,0],opacity:[0,1]},transition:{delay:(A+1)*.03,type:"spring",duration:.4},children:ne(L.label,p)})})},L.locationId))})})})]})},du=C.div`
126
+ height: 400px;
127
+ display: flex;
128
+ border: 2px solid ${_["--ll-color-on-background"]};
129
+ position: relative;
130
+ border-radius: ${_["--ll-border-radius-small"]};
131
+ overflow: hidden;
132
+ `,gu=C.div`
133
+ position: absolute;
134
+ color: ${_["--ll-color-on-background"]};
135
+ z-index: 1;
136
+ padding: ${_["--ll-spacing-xx-small"]} ${_["--ll-spacing-x-small"]};
137
+ font-family: ${_["--ll-font-family-mono"]};
138
+
139
+ &:after {
140
+ content: "";
141
+ position: absolute;
142
+ top: 0;
143
+ bottom: 0;
144
+ right: 0;
145
+ left: 0;
146
+ background-color: ${_["--ll-color-background"]};
147
+ opacity: 0.8;
148
+ z-index: -1;
149
+ }
150
+ `,mu=()=>{var X,Q,ne,L;const l=M.exports.useRef(),[g,p]=M.exports.useState(!0),{dataExplorerState:m,setDataExplorerState:y}=Ee(),{sdkState:c}=Yn(),[S,F]=M.exports.useState(!1),N=M.exports.useRef(),re=M.exports.useRef(!1),j=((Q=(X=c==null?void 0:c.globalOptions)==null?void 0:X.appearance)==null?void 0:Q.theme)==="night"?"basic-v2-dark":"600d69cb-288d-445e-9839-3dfe4d76b31a",Y={position:"absolute",top:"0",left:"0",height:"100%",width:"100%"};return D("div",{children:[w(pu,{onSearch:A=>{var G;y({location:{lat:A.latitude,lng:A.longitude}}),(G=l==null?void 0:l.current)==null||G.flyTo({center:[A.longitude,A.latitude],duration:2e3})}}),w(Kt,{vertical:!0,spacing:"--ll-spacing-small"}),D(du,{children:[g&&w(Ia,{height:"400px",width:"100%"}),D(_a,{ref:l,style:g?{visibility:"hidden",...Y}:Y,onLoad:()=>p(!1),mapLib:ba,mapStyle:`https://api.maptiler.com/maps/${j}/style.json?key=9jNGatuzs05Q1oNlctEs`,initialViewState:{longitude:(ne=c.options)==null?void 0:ne.lng,latitude:(L=c.options)==null?void 0:L.lat,zoom:10},onMouseDown:A=>{N.current=setTimeout(()=>{re.current||F(!0)},1e3)},onMouseUp:A=>{S&&y({location:{lat:A.lngLat.lat,lng:A.lngLat.lng}}),clearTimeout(N.current),F(!1)},onDragStart:()=>{re.current=!0},onDragEnd:()=>{re.current=!1},children:[w(gu,{children:D(zt,{noMargin:!0,family:"mono",children:["Lat:"," ",Math.round(m.location.lat*1e5)/1e5,", Lng:"," ",Math.round(m.location.lng*1e5)/1e5]})}),w(Ea,{showCompass:!0,style:{marginTop:16,marginRight:16}}),w(Ra,{marker:m.location})]})]})]})},yu=C.div`
151
+ margin: 2px;
152
+ display: inline-block;
153
+ `,vu=()=>{const{dataExplorerState:l,setDataExplorerState:g}=Ee(),p=Object.keys(Ba).filter(m=>Number.isNaN(Number(m)));return w(Xt,{children:p.map(m=>{const y=l.scores.include.includes(m);return w(yu,{children:w($n.Root,{options:{score:m,data:void 0},children:w(pt,{size:"small",variant:y?"contained":"outlined",onClick:()=>{if(y){g({scores:{...l.scores,include:l.scores.include.filter(c=>c!==m)}});return}g({scores:{...l.scores,include:[...l.scores.include,m]}})},children:w($n.Title,{options:{isRawText:!0}})})})},m)})})},wu=C.div`
154
+ margin: 2px;
155
+ display: inline-block;
156
+ `,xu=()=>{const{translations:l}=$e(),{dataExplorerState:g,setDataExplorerState:p}=Ee(),m=Object.keys(Da).filter(y=>Number.isNaN(Number(y)));return D(Xt,{children:[m.map(y=>{const c=g.pois.include.includes(y);return w(wu,{children:w(jn.Root,{options:{poi:y},children:w(pt,{size:"small",variant:c?"contained":"outlined",onClick:()=>{if(c){p({pois:{...g.pois,include:g.pois.include.filter(S=>S!==y)}});return}p({pois:{...g.pois,include:[...g.pois.include,y]}})},children:w(jn.Title,{options:{isRawText:!0}})})})},y)}),w(Ne,{showValue:!0,label:`${l.RADIUS} (m)`,min:100,max:25e3,step:100,value:[g.pois.radius],onValueChange:y=>{p({pois:{...g.pois,radius:y[0]}})}}),w(Ne,{showValue:!0,label:l.LIMIT,min:1,max:30,step:1,value:[g.pois.limit],onValueChange:y=>{p({pois:{...g.pois,limit:y[0]}})}})]})},Su=()=>{const{translations:l}=$e(),{dataExplorerState:g,setDataExplorerState:p}=Ee();return D(Xt,{children:[w(Ne,{showValue:!0,label:`${l.RADIUS} (m)`,min:100,max:25e3,step:100,value:[g.schools.radius],onValueChange:m=>{p({schools:{...g.schools,radius:m[0]}})}}),w(Ne,{showValue:!0,label:l.LIMIT,min:1,max:30,step:1,value:[g.schools.limit],onValueChange:m=>{p({schools:{...g.schools,limit:m[0]}})}})]})},_u=()=>{const{translations:l}=$e(),{dataExplorerState:g,setDataExplorerState:p}=Ee();return w(Ne,{showValue:!0,label:`${l.RADIUS} (m)`,min:500,max:5e3,step:100,value:[g.demographics.radius],onValueChange:m=>{p({demographics:{...g.demographics,radius:m[0]}})}})},Ru=()=>{const{translations:l}=$e(),g=[{title:l.LOCATION,description:l.LOCATION_TEXT,value:"location",number:1,children:w(mu,{})},{title:l.SCORES,description:l.SCORES_TEXT,value:"scores",number:2,children:w(vu,{})},{title:l.POIS,description:l.POIS_TEXT,value:"pois",number:3,children:w(xu,{})},{title:l.SCHOOLS,description:l.SCHOOLS_TEXT,value:"schools",number:4,children:w(Su,{})},{title:l.DEMOGRAPHICS,description:l.DEMOGRAPHICS_TEXT,value:"demographics",number:5,children:w(_u,{})},{title:l.PROFILES,description:l.PROFILES_TEXT,value:"profiles",number:6}];return w(ka,{children:D(Pa,{children:[w(Ma,{type:"single",defaultValue:"location",collapsible:!0,children:g.map(p=>w(Ja,{title:p.title,description:p.description,value:p.value,number:p.number,children:p.children},p.value))}),w(Kt,{vertical:!0}),w(tu,{})]})})};export{Ru as default};
@@ -0,0 +1,183 @@
1
+ import{c as W,u as dt,p as te,s as ee,M as xt,a as ne,$ as oe,b as ie,d as re,e as se,S as ae,f as ce,g as le,h as ue,m as de,N as pe,P as fe}from"./chevron_right.f4a05ecb.js";import{R as T,r as b,$ as Tt,j as a,s as F,i as Z,u as q,a as tt,b as pt,c as w,y as g,F as et,d as k,e as it,I as V,U as Ot,f as Et,O as nt,g as I,k as U,S as K,T as he,h as D,l as ge,m as Q,_ as me,n as ye,o as ve,p as xe}from"./index.bd887e31.js";const zt=T.createContext({}),O=()=>b.exports.useContext(zt),be=(t,e)=>{switch(e.type){case"CATEGORY":return{...t,activeCategory:e.value};case"SCORE":{const n=F.find(o=>e.value===""?o.value===t.activeCategory:o.scores.includes(e.value)).value;return{activeCategory:n,activeScoreByCategory:{...t.activeScoreByCategory,[n]:e.value}}}}},we=({children:t})=>{const[e,n]=b.exports.useState(!1),o=window.innerWidth<Tt.screenSizes.mobileL?{activeCategory:"commute",activeScoreByCategory:{commute:"pedestrian_friendly",amenities:"groceries",character:"vibrant",nature:"parks",education:"high_schools"}}:{activeCategory:"commute",activeScoreByCategory:{commute:"",amenities:"",character:"",nature:"",education:""}},[i,s]=b.exports.useReducer(be,o),[c,l]=b.exports.useState(),[r,u]=b.exports.useState(),{activeCategory:d}=i,p=i.activeScoreByCategory[d],h=v=>{s({type:"SCORE",value:v})},f=v=>{s({type:"CATEGORY",value:v})},m=b.exports.useMemo(()=>({activeScore:p,setActiveScore:h,activeCategory:d,setActiveCategory:f,activePOI:c,setActivePOI:l,hoveredPOI:r,setHoveredPOI:u,showMobileList:e,setShowMobileList:n}),[p,h,d,f,c,l,r,u,e,n]);return a(zt.Provider,{value:m,children:t})};function Rt(t,e,n){n===void 0&&(n={});var o={type:"Feature"};return(n.id===0||n.id)&&(o.id=n.id),n.bbox&&(o.bbox=n.bbox),o.properties=e||{},o.geometry=t,o}function bt(t,e,n){if(n===void 0&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!wt(t[0])||!wt(t[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:t};return Rt(o,e,n)}function Me(t,e,n){n===void 0&&(n={});var o={type:"MultiPoint",coordinates:t};return Rt(o,e,n)}function wt(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Ht(t,e,n){if(t!==null)for(var o,i,s,c,l,r,u,d=0,p=0,h,f=t.type,m=f==="FeatureCollection",v=f==="Feature",x=m?t.features.length:1,y=0;y<x;y++){u=m?t.features[y].geometry:v?t.geometry:t,h=u?u.type==="GeometryCollection":!1,l=h?u.geometries.length:1;for(var L=0;L<l;L++){var C=0,S=0;if(c=h?u.geometries[L]:u,c!==null){r=c.coordinates;var $=c.type;switch(d=n&&($==="Polygon"||$==="MultiPolygon")?1:0,$){case null:break;case"Point":if(e(r,p,y,C,S)===!1)return!1;p++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<r.length;o++){if(e(r[o],p,y,C,S)===!1)return!1;p++,$==="MultiPoint"&&C++}$==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<r.length;o++){for(i=0;i<r[o].length-d;i++){if(e(r[o][i],p,y,C,S)===!1)return!1;p++}$==="MultiLineString"&&C++,$==="Polygon"&&S++}$==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<r.length;o++){for(S=0,i=0;i<r[o].length;i++){for(s=0;s<r[o][i].length-d;s++){if(e(r[o][i][s],p,y,C,S)===!1)return!1;p++}S++}C++}break;case"GeometryCollection":for(o=0;o<c.geometries.length;o++)if(Ht(c.geometries[o],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ct(t){var e=[1/0,1/0,-1/0,-1/0];return Ht(t,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}ct.default=ct;var Ce="Expected a function",Mt=0/0,$e="[object Symbol]",Se=/^\s+|\s+$/g,Pe=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Le=/^0o[0-7]+$/i,Ie=parseInt,_e=typeof W=="object"&&W&&W.Object===Object&&W,Ae=typeof self=="object"&&self&&self.Object===Object&&self,Te=_e||Ae||Function("return this")(),Oe=Object.prototype,Ee=Oe.toString,ze=Math.max,Re=Math.min,rt=function(){return Te.Date.now()};function He(t,e,n){var o,i,s,c,l,r,u=0,d=!1,p=!1,h=!0;if(typeof t!="function")throw new TypeError(Ce);e=Ct(e)||0,lt(n)&&(d=!!n.leading,p="maxWait"in n,s=p?ze(Ct(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function f(M){var _=o,E=i;return o=i=void 0,u=M,c=t.apply(E,_),c}function m(M){return u=M,l=setTimeout(y,e),d?f(M):c}function v(M){var _=M-r,E=M-u,j=e-_;return p?Re(j,s-E):j}function x(M){var _=M-r,E=M-u;return r===void 0||_>=e||_<0||p&&E>=s}function y(){var M=rt();if(x(M))return L(M);l=setTimeout(y,v(M))}function L(M){return l=void 0,h&&o?f(M):(o=i=void 0,c)}function C(){l!==void 0&&clearTimeout(l),u=0,o=r=i=l=void 0}function S(){return l===void 0?c:L(rt())}function $(){var M=rt(),_=x(M);if(o=arguments,i=this,r=M,_){if(l===void 0)return m(r);if(p)return l=setTimeout(y,e),f(r)}return l===void 0&&(l=setTimeout(y,e)),c}return $.cancel=C,$.flush=S,$}function lt(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ze(t){return!!t&&typeof t=="object"}function Ve(t){return typeof t=="symbol"||Ze(t)&&Ee.call(t)==$e}function Ct(t){if(typeof t=="number")return t;if(Ve(t))return Mt;if(lt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=lt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Se,"");var n=ke.test(t);return n||Le.test(t)?Ie(t.slice(2),n?2:8):Pe.test(t)?Mt:+t}var je=He;const Ne=()=>{const[t,e]=b.exports.useState(!1);return b.exports.useLayoutEffect(()=>{const n=()=>{e(window.innerWidth<Tt.screenSizes.mobileL)};return window.addEventListener("resize",je(n,250)),n(),()=>window.removeEventListener("resize",n)},[]),t},Be=t=>b.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},b.exports.createElement("g",{clipPath:"url(#clip0_6_16062)"},b.exports.createElement("path",{d:"M3 13H5V11H3V13ZM3 17H5V15H3V17ZM3 9H5V7H3V9ZM7 13H21V11H7V13ZM7 17H21V15H7V17ZM7 7V9H21V7H7ZM3 13H5V11H3V13ZM3 17H5V15H3V17ZM3 9H5V7H3V9ZM7 13H21V11H7V13ZM7 17H21V15H7V17ZM7 7V9H21V7H7Z"}))),{scorePois:De}=Z.Constants;function Zt(){var l;const{client:t}=q(),{sdkState:e}=tt(),n=pt(e.options,250),{activeScore:o}=O(),i=o?De[o]:void 0,c={...b.exports.useMemo(()=>n!=null&&n.marker?n.marker:{lat:n==null?void 0:n.lat,lng:n==null?void 0:n.lng},[n]),limit:10,radius:2e3,include:i};return dt(te.list(c),async()=>t.getPois(c),{enabled:!!c&&!!((l=c.include)!=null&&l.length)&&!!c.lat&&!!c.lng})}function Vt(){const{client:t}=q(),{sdkState:e}=tt(),n=pt(e.options,250),i={...b.exports.useMemo(()=>n!=null&&n.marker?n.marker:{lat:n==null?void 0:n.lat,lng:n==null?void 0:n.lng},[n]),limit:10,radius:2e3};return dt(ee.list(i),async()=>t.getSchools(i),{enabled:!!i&&!!i.lat&&!!i.lng})}const jt=T.createContext({}),Nt=()=>b.exports.useContext(jt),Ge=({children:t,mapRef:e,mapPadding:n})=>a(jt.Provider,{value:{mapRef:e,mapPadding:n},children:t});function ut(t,e,n,o,i,s){if(i-o<=n)return;const c=o+i>>1;Bt(t,e,c,o,i,s%2),ut(t,e,n,o,c-1,s+1),ut(t,e,n,c+1,i,s+1)}function Bt(t,e,n,o,i,s){for(;i>o;){if(i-o>600){const u=i-o+1,d=n-o+1,p=Math.log(u),h=.5*Math.exp(2*p/3),f=.5*Math.sqrt(p*h*(u-h)/u)*(d-u/2<0?-1:1),m=Math.max(o,Math.floor(n-d*h/u+f)),v=Math.min(i,Math.floor(n+(u-d)*h/u+f));Bt(t,e,n,m,v,s)}const c=e[2*n+s];let l=o,r=i;for(B(t,e,o,n),e[2*i+s]>c&&B(t,e,o,i);l<r;){for(B(t,e,l,r),l++,r--;e[2*l+s]<c;)l++;for(;e[2*r+s]>c;)r--}e[2*o+s]===c?B(t,e,o,r):(r++,B(t,e,r,i)),r<=n&&(o=r+1),n<=r&&(i=r-1)}}function B(t,e,n,o){st(t,n,o),st(e,2*n,2*o),st(e,2*n+1,2*o+1)}function st(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function Fe(t,e,n,o,i,s,c){const l=[0,t.length-1,0],r=[];let u,d;for(;l.length;){const p=l.pop(),h=l.pop(),f=l.pop();if(h-f<=c){for(let x=f;x<=h;x++)u=e[2*x],d=e[2*x+1],u>=n&&u<=i&&d>=o&&d<=s&&r.push(t[x]);continue}const m=Math.floor((f+h)/2);u=e[2*m],d=e[2*m+1],u>=n&&u<=i&&d>=o&&d<=s&&r.push(t[m]);const v=(p+1)%2;(p===0?n<=u:o<=d)&&(l.push(f),l.push(m-1),l.push(v)),(p===0?i>=u:s>=d)&&(l.push(m+1),l.push(h),l.push(v))}return r}function We(t,e,n,o,i,s){const c=[0,t.length-1,0],l=[],r=i*i;for(;c.length;){const u=c.pop(),d=c.pop(),p=c.pop();if(d-p<=s){for(let x=p;x<=d;x++)$t(e[2*x],e[2*x+1],n,o)<=r&&l.push(t[x]);continue}const h=Math.floor((p+d)/2),f=e[2*h],m=e[2*h+1];$t(f,m,n,o)<=r&&l.push(t[h]);const v=(u+1)%2;(u===0?n-i<=f:o-i<=m)&&(c.push(p),c.push(h-1),c.push(v)),(u===0?n+i>=f:o+i>=m)&&(c.push(h+1),c.push(d),c.push(v))}return l}function $t(t,e,n,o){const i=t-n,s=e-o;return i*i+s*s}const Ue=t=>t[0],Ke=t=>t[1];class St{constructor(e,n=Ue,o=Ke,i=64,s=Float64Array){this.nodeSize=i,this.points=e;const c=e.length<65536?Uint16Array:Uint32Array,l=this.ids=new c(e.length),r=this.coords=new s(e.length*2);for(let u=0;u<e.length;u++)l[u]=u,r[2*u]=n(e[u]),r[2*u+1]=o(e[u]);ut(l,r,i,0,l.length-1,0)}range(e,n,o,i){return Fe(this.ids,this.coords,e,n,o,i,this.nodeSize)}within(e,n,o){return We(this.ids,this.coords,e,n,o,this.nodeSize)}}const Qe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},X=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1));class Ye{constructor(e){this.options=G(Object.create(Qe),e),this.trees=new Array(this.options.maxZoom+1)}load(e){const{log:n,minZoom:o,maxZoom:i,nodeSize:s}=this.options;n&&console.time("total time");const c=`prepare ${e.length} points`;n&&console.time(c),this.points=e;let l=[];for(let r=0;r<e.length;r++)!e[r].geometry||l.push(Xe(e[r],r));this.trees[i+1]=new St(l,kt,Lt,s,Float32Array),n&&console.timeEnd(c);for(let r=i;r>=o;r--){const u=+Date.now();l=this._cluster(l,r),this.trees[r]=new St(l,kt,Lt,s,Float32Array),n&&console.log("z%d: %d clusters in %dms",r,l.length,+Date.now()-u)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let o=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let s=e[2]===180?180:((e[2]+180)%360+360)%360-180;const c=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,s=180;else if(o>s){const d=this.getClusters([o,i,180,c],n),p=this.getClusters([-180,i,s,c],n);return d.concat(p)}const l=this.trees[this._limitZoom(n)],r=l.range(Y(o),J(c),Y(s),J(i)),u=[];for(const d of r){const p=l.points[d];u.push(p.numPoints?Pt(p):this.points[p.index])}return u}getChildren(e){const n=this._getOriginId(e),o=this._getOriginZoom(e),i="No cluster with the specified id.",s=this.trees[o];if(!s)throw new Error(i);const c=s.points[n];if(!c)throw new Error(i);const l=this.options.radius/(this.options.extent*Math.pow(2,o-1)),r=s.within(c.x,c.y,l),u=[];for(const d of r){const p=s.points[d];p.parentId===e&&u.push(p.numPoints?Pt(p):this.points[p.index])}if(u.length===0)throw new Error(i);return u}getLeaves(e,n,o){n=n||10,o=o||0;const i=[];return this._appendLeaves(i,e,n,o,0),i}getTile(e,n,o){const i=this.trees[this._limitZoom(e)],s=Math.pow(2,e),{extent:c,radius:l}=this.options,r=l/c,u=(o-r)/s,d=(o+1+r)/s,p={features:[]};return this._addTileFeatures(i.range((n-r)/s,u,(n+1+r)/s,d),i.points,n,o,s,p),n===0&&this._addTileFeatures(i.range(1-r/s,u,1,d),i.points,s,o,s,p),n===s-1&&this._addTileFeatures(i.range(0,u,r/s,d),i.points,-1,o,s,p),p.features.length?p:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const o=this.getChildren(e);if(n++,o.length!==1)break;e=o[0].properties.cluster_id}return n}_appendLeaves(e,n,o,i,s){const c=this.getChildren(n);for(const l of c){const r=l.properties;if(r&&r.cluster?s+r.point_count<=i?s+=r.point_count:s=this._appendLeaves(e,r.cluster_id,o,i,s):s<i?s++:e.push(l),e.length===o)break}return s}_addTileFeatures(e,n,o,i,s,c){for(const l of e){const r=n[l],u=r.numPoints;let d,p,h;if(u)d=Dt(r),p=r.x,h=r.y;else{const v=this.points[r.index];d=v.properties,p=Y(v.geometry.coordinates[0]),h=J(v.geometry.coordinates[1])}const f={type:1,geometry:[[Math.round(this.options.extent*(p*s-o)),Math.round(this.options.extent*(h*s-i))]],tags:d};let m;u?m=r.id:this.options.generateId?m=r.index:this.points[r.index].id&&(m=this.points[r.index].id),m!==void 0&&(f.id=m),c.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const o=[],{radius:i,extent:s,reduce:c,minPoints:l}=this.options,r=i/(s*Math.pow(2,n));for(let u=0;u<e.length;u++){const d=e[u];if(d.zoom<=n)continue;d.zoom=n;const p=this.trees[n+1],h=p.within(d.x,d.y,r),f=d.numPoints||1;let m=f;for(const v of h){const x=p.points[v];x.zoom>n&&(m+=x.numPoints||1)}if(m>f&&m>=l){let v=d.x*f,x=d.y*f,y=c&&f>1?this._map(d,!0):null;const L=(u<<5)+(n+1)+this.points.length;for(const C of h){const S=p.points[C];if(S.zoom<=n)continue;S.zoom=n;const $=S.numPoints||1;v+=S.x*$,x+=S.y*$,S.parentId=L,c&&(y||(y=this._map(d,!0)),c(y,this._map(S)))}d.parentId=L,o.push(Je(v/m,x/m,L,m,y))}else if(o.push(d),m>1)for(const v of h){const x=p.points[v];x.zoom<=n||(x.zoom=n,o.push(x))}}return o}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n){if(e.numPoints)return n?G({},e.properties):e.properties;const o=this.points[e.index].properties,i=this.options.map(o);return n&&i===o?G({},i):i}}function Je(t,e,n,o,i){return{x:X(t),y:X(e),zoom:1/0,id:n,parentId:-1,numPoints:o,properties:i}}function Xe(t,e){const[n,o]=t.geometry.coordinates;return{x:X(Y(n)),y:X(J(o)),zoom:1/0,index:e,parentId:-1}}function Pt(t){return{type:"Feature",id:t.id,properties:Dt(t),geometry:{type:"Point",coordinates:[qe(t.x),tn(t.y)]}}}function Dt(t){const e=t.numPoints,n=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function Y(t){return t/360+.5}function J(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function qe(t){return(t-.5)*360}function tn(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function G(t,e){for(const n in e)t[n]=e[n];return t}function kt(t){return t.x}function Lt(t){return t.y}var It=Object.prototype.hasOwnProperty;function _t(t,e,n){for(n of t.keys())if(H(n,e))return n}function H(t,e){var n,o,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((o=t.length)===e.length)for(;o--&&H(t[o],e[o]););return o===-1}if(n===Set){if(t.size!==e.size)return!1;for(o of t)if(i=o,i&&typeof i=="object"&&(i=_t(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(o of t)if(i=o[0],i&&typeof i=="object"&&(i=_t(e,i),!i)||!H(o[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((o=t.byteLength)===e.byteLength)for(;o--&&t.getInt8(o)===e.getInt8(o););return o===-1}if(ArrayBuffer.isView(t)){if((o=t.byteLength)===e.byteLength)for(;o--&&t[o]===e[o];);return o===-1}if(!n||typeof t=="object"){o=0;for(n in t)if(It.call(t,n)&&++o&&!It.call(e,n)||!(n in e)||!H(t[n],e[n]))return!1;return Object.keys(e).length===o}}return t!==t&&e!==e}function en(t){var e=b.exports.useRef(t),n=b.exports.useRef(0);return H(t,e.current)||(e.current=t,n.current+=1),b.exports.useMemo(function(){return e.current},[n.current])}function nn(t,e){return b.exports.useEffect(t,en(e))}var on=function(e){var n=e.points,o=e.bounds,i=e.zoom,s=e.options,c=b.exports.useRef(),l=b.exports.useRef(),r=b.exports.useState([]),u=r[0],d=r[1],p=Math.round(i);return nn(function(){(!c.current||!H(l.current,n)||!H(c.current.options,s))&&(c.current=new Ye(s),c.current.load(n)),o&&d(c.current.getClusters(o,p)),l.current=n},[n,o,p,s]),{clusters:u,supercluster:c.current}};const rn=w.div`
2
+ border-radius: 50%;
3
+ background: linear-gradient(
4
+ to top,
5
+ ${g["--ll-color-primary-variant1"]},
6
+ ${g["--ll-color-primary"]}
7
+ );
8
+ color: ${g["--ll-color-on-primary"]};
9
+ height: ${({diameter:t})=>t}px;
10
+ width: ${({diameter:t})=>t}px;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ line-height: 1;
15
+ font-family: ${g["--ll-font-family"]};
16
+ font-size: ${({diameter:t})=>t/2.5}px;
17
+ border: 2px solid #fff;
18
+ box-shadow: ${g["--ll-shadow-small"]};
19
+ cursor: default;
20
+ `,sn=({cluster:t,pointsCount:e,onClick:n})=>{const o=t.properties.point_count,i=20+o/e*25;return a(rn,{diameter:i,onClick:()=>n&&n(t),children:t.properties.point_count})};function an(t){return t.properties.cluster!==void 0}const Gt=T.memo(({rect:t,zoom:e,mapRef:n,points:o,isMobile:i,activePOI:s,hoveredPOI:c,isMapMoving:l,setActivePOI:r})=>{var h;const u=(h=n==null?void 0:n.current)==null?void 0:h.getMap().getBounds().toArray().flat(),{clusters:d,supercluster:p}=on({points:o,bounds:u,zoom:e,options:{radius:50,maxZoom:18}});return a(et,{children:d.map((f,m)=>{const[v,x]=f.geometry.coordinates;if(an(f))return a(xt,{latitude:x,longitude:v,children:a(sn,{cluster:f,pointsCount:o.length,onClick:()=>{var M;const $=Math.min(p.getClusterExpansionZoom(f.id),20);(M=n.current)==null||M.flyTo({zoom:$,center:[v,x],duration:1e3})}})},`cluster-${f.id}`);const{poi:y,type:L}=f.properties,C=s===y,S=c===y;return a(xt,{latitude:y.lat,longitude:y.lng,style:{zIndex:C?1:0},children:k(it.Root,{options:{type:L,poi:y,isOpen:l?!1:C,isHovered:S,side:"top",collisionPadding:i?{top:t.height+32,bottom:V*2,left:V*2,right:V*2}:{left:t.width+32,right:V*2,top:V*2,bottom:V*2}},onChange:$=>{$.type==="open-change"&&($.data?setTimeout(()=>{r(y)},0):C&&r(void 0))},children:[a(it.Marker,{}),a(it.Content,{})]})},`${y.name}-${y.lat}-${y.lng}-${m}`)})})});Gt.displayName="Markers";function ft(t){const{client:e}=q(),{sdkState:n}=tt(),o=pt(n.options,250),s={...b.exports.useMemo(()=>o!=null&&o.marker?o.marker:{lat:o==null?void 0:o.lat,lng:o==null?void 0:o.lng},[o]),geographyLevels:["10","30"],locationScoresRounding:!1,include:t};return dt(ne.list(s),async()=>e.getScores(s),{enabled:!!s})}const cn=w.div`
21
+ padding: ${g["--ll-spacing-small"]} ${g["--ll-spacing-medium"]};
22
+ background-color: ${g["--ll-color-surface"]};
23
+ display: flex;
24
+ flex-direction: column;
25
+ overflow: hidden;
26
+ flex: 1;
27
+ `,ln=w.div`
28
+ display: grid;
29
+ grid-template-columns: min-content 1fr;
30
+ grid-gap: ${g["--ll-spacing-medium"]};
31
+ margin-bottom: ${g["--ll-spacing-medium"]};
32
+ `,un=w.div`
33
+ overflow: auto;
34
+
35
+ &:not(:empty) {
36
+ margin-top: ${g["--ll-spacing-medium"]};
37
+ }
38
+ `,dn=Ot({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),pn=Ot({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),fn=w(oe)`
39
+ margin: 0;
40
+ `,Ft=w(ie)`
41
+ background: none;
42
+ border: none;
43
+ display: flex;
44
+ align-items: center;
45
+ width: 100%;
46
+ padding: ${g["--ll-spacing-x-small"]} 0;
47
+ `,hn=w(re)`
48
+ background-color: ${g["--ll-color-surface"]};
49
+ position: relative;
50
+ z-index: 1;
51
+ overflow: hidden;
52
+ margin-left: calc(-1 * ${g["--ll-spacing-medium"]});
53
+ margin-right: calc(-1 * ${g["--ll-spacing-medium"]});
54
+
55
+ [data-state="open"] & {
56
+ animation: ${dn} 300ms cubic-bezier(0.87, 0, 0.13, 1);
57
+ }
58
+
59
+ [data-state="closed"] & {
60
+ animation: ${pn} 300ms cubic-bezier(0.87, 0, 0.13, 1);
61
+ }
62
+ `,gn=w.div`
63
+ padding: ${g["--ll-spacing-medium"]};
64
+ `,mn=w.span`
65
+ ${Ft}[data-state=open] & {
66
+ transform: rotate(90deg);
67
+ } ;
68
+ `;w.div`
69
+ display: flex;
70
+ align-items: flex-start;
71
+ justify-content: space-between;
72
+ `;const ht=w.div`
73
+ margin: ${g["--ll-spacing-small"]} 0;
74
+ `,yn=w.div`
75
+ margin-top: ${g["--ll-spacing-large"]};
76
+
77
+ &:empty {
78
+ margin: 0;
79
+ }
80
+ `,Wt=T.memo(({result:t,poi:e})=>{const{activePOI:n,setActivePOI:o,hoveredPOI:i,setHoveredPOI:s}=O(),{mapRef:c,mapPadding:l}=Nt();return!t.data||!t.data[e]?null:a(Z.Content,{options:{value:e},children:a(Et.Root,{options:{type:"poi",data:t.data[e],activePOI:n,hoveredPOI:i},onChange:r=>{var u;if(r.type==="poi-click"){const d=r.data;o(d);const p=window.innerWidth-l.left,h=window.innerWidth/2,f=p/2+l.left-h;d&&((u=c.current)==null||u.flyTo({zoom:18,center:[d.lng,d.lat],duration:1e3,offset:[f,0]}))}r.type==="poi-hover"&&s(r.data)}})},e)});Wt.displayName="POI";const gt=T.memo(({include:t})=>{const e=Zt();return e.isLoading&&t.length?a(et,{children:[...Array(10)].map((n,o)=>a(ht,{children:a(nt,{height:"34px",width:"100%"})},o))}):e.data?k(Z.Root,{options:{include:t},children:[a(Z.Tabs,{}),t.map(n=>a(Wt,{poi:n,result:e},n))]}):null});gt.displayName="POIs";const Ut=({score:t})=>{const{data:e,isLoading:n}=Vt(),{activePOI:o,setActivePOI:i,hoveredPOI:s,setHoveredPOI:c}=O(),{mapRef:l,mapPadding:r}=Nt();return n?a(et,{children:[...Array(10)].map(u=>a(ht,{children:a(nt,{height:"34px",width:"100%"})},u))}):e?a(Et.Root,{options:{type:"school",data:e==null?void 0:e[t],activePOI:o,hoveredPOI:s},onChange:u=>{var d;if(u.type==="poi-click"){const p=u.data;i(p);const h=window.innerWidth-r.left,f=window.innerWidth/2,m=h/2+r.left-f;p&&((d=l.current)==null||d.easeTo({zoom:18,center:[p.lng,p.lat],duration:1e3,offset:[m,0]}))}u.type==="poi-hover"&&c(u.data)}}):null},{scorePois:At}=Z.Constants,vn=()=>{const{activeCategory:t,activeScore:e,showMobileList:n}=O(),o=F.find(l=>l.value===t),{data:i,isLoading:s}=ft(o.scores),c=l=>!n||!At[l].length?null:l==="high_schools"||l==="primary_schools"?a(Ut,{score:l}):a(gt,{include:At[l]});return e&&(i==null?void 0:i.location[e])?s?a("div",{children:"Loading"}):a(I.Root,{options:{score:e,data:i},children:k(cn,{children:[k(ln,{children:[a(I.Badge,{}),a(I.BarChart,{})]}),a(I.Description,{}),a(un,{children:c(e)})]})}):null},xn=w.div`
81
+ display: flex;
82
+ overflow-x: scroll;
83
+ padding: ${g["--ll-spacing-x-small"]} ${g["--ll-spacing-medium"]};
84
+ flex-shrink: 0;
85
+ position: relative;
86
+ `,bn=w.button`
87
+ position: relative;
88
+ display: flex;
89
+ flex-direction: column;
90
+ align-items: center;
91
+ background: none;
92
+ border: none;
93
+ min-width: 60px;
94
+ padding: 0;
95
+ margin: 0 8px;
96
+ flex-shrink: 0;
97
+
98
+ &:first-child {
99
+ margin-left: 0;
100
+ }
101
+
102
+ &:last-child {
103
+ margin-right: 0;
104
+ }
105
+ `,wn=w.div`
106
+ position: absolute;
107
+ top: -6px;
108
+ right: 4px;
109
+ border: 2px solid ${g["--ll-color-background"]};
110
+ border-radius: 6px;
111
+ `,Mn=w.div`
112
+ flex: 1;
113
+ display: flex;
114
+ align-items: center;
115
+ `,Cn=w.div`
116
+ margin: 0 2px;
117
+ `,$n=({category:t})=>{const{data:e,isLoading:n,isFetching:o}=ft(t.scores),{activeScore:i,setActiveScore:s,setActiveCategory:c,setShowMobileList:l}=O();return a(xn,{children:t.scores.map(r=>{const u=r===i,d=u?"--ll-color-primary":"--ll-color-disabled";return n||o?a(Cn,{children:a(nt,{height:"44px",width:"60px"})},r):a(I.Root,{options:{score:r,data:e},children:k(bn,{onClick:()=>{l(!1),c(t.value),s(r)},children:[a(I.Icon,{options:{color:d,height:28,width:28}}),a(Mn,{children:a(I.Title,{options:{variant:"caption1",color:d,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),a(wn,{children:a(I.Badge,{options:{variant:"small",isPrimary:u}})})]})},r)})})},Sn=w.div`
118
+ display: flex;
119
+ padding: ${g["--ll-spacing-x-small"]} ${g["--ll-spacing-medium"]} ${g["--ll-spacing-xx-small"]} ${g["--ll-spacing-medium"]};
120
+ `,Pn=w.div`
121
+ position: absolute;
122
+ top: 0;
123
+ left: 0;
124
+ right: 0;
125
+ bottom: ${({showMobileList:t})=>t&&0};
126
+ z-index: 3;
127
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
128
+ background-color: #fff;
129
+ overflow: hidden;
130
+ display: flex;
131
+ flex-direction: column;
132
+ background-color: ${g["--ll-color-background"]};
133
+ border: 1px solid ${g["--ll-color-border"]};
134
+ `,Kt=T.forwardRef(({showMobileList:t},e)=>{const{activeCategory:n,setActiveCategory:o}=O();return k(Pn,{ref:e,showMobileList:t,children:[a(Sn,{children:k(U.Root,{value:n,onValueChange:i=>o(i),children:[a(U.Trigger,{size:"large",children:a(K.Root,{options:{scoreCategory:n},children:a(K.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},n)}),a(U.Content,{children:F.map(i=>a(K.Root,{options:{scoreCategory:i.value},children:a(U.Item,{value:i.value,children:a(K.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},i.value))})]})}),a($n,{category:F.find(i=>i.value===n)}),a(vn,{})]})});Kt.displayName="MobileScores";const{scorePois:kn}=Z.Constants,Qt=T.memo(({score:t,isLoading:e,data:n})=>e?a(ht,{children:a(nt,{height:"34px",width:"100%"},t)}):a(se,{value:t,children:k(I.Root,{options:{score:t,data:n},children:[a(fn,{children:k(Ft,{children:[a(mn,{children:a(he,{SVGElement:ae,fill:g["--ll-color-on-background-variant1"]})}),a(D,{spacing:"--ll-spacing-small"}),a(I.Icon,{}),a(D,{spacing:"--ll-spacing-small"}),a(I.Title,{}),a(D,{}),a(I.Badge,{})]})}),a(hn,{children:k(gn,{children:[a(I.Description,{}),a(D,{vertical:!0,spacing:"--ll-spacing-small"}),a(I.BarChart,{}),a(yn,{children:t==="high_schools"||t==="primary_schools"?a(Ut,{score:t}):a(gt,{include:kn[t]})})]})})]})},t));Qt.displayName="Score";const Ln=w.div`
135
+ padding: ${g["--ll-spacing-small"]} ${g["--ll-spacing-medium"]};
136
+ `,In=w.div`
137
+ display: flex;
138
+ justify-content: space-between;
139
+ align-items: center;
140
+ `,Yt=T.memo(({data:t,isLoading:e,isFetching:n,tabContent:o})=>{const{translations:i}=ge();return k(Ln,{children:[k(In,{children:[a(Q.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),n&&!e&&a(me,{size:"small"})]}),a(D,{spacing:"--ll-spacing-small",vertical:!0}),!n&&!Object.keys((t==null?void 0:t.location)||{}).length&&a(ye,{color:"--ll-color-on-background-variant1",children:i.EMPTY_TEXT}),o.scores.map(s=>a(Qt,{score:s,data:t,isLoading:e},s))]})});Yt.displayName="ScoreCategory";const Jt=T.memo(({tabContent:t})=>{q();const{data:e,isLoading:n,isFetching:o}=ft(t.scores),{activeScore:i,setActiveScore:s}=O();return a(ce,{value:i,onValueChange:c=>{s(c)},type:"single",collapsible:!0,children:a(Yt,{data:e,isLoading:n,isFetching:o,tabContent:t})})});Jt.displayName="ScoreCategoryAccordion";const _n=w.div`
141
+ overflow-y: auto;
142
+ `,An=w.div`
143
+ position: absolute;
144
+ top: ${g["--ll-spacing-medium"]};
145
+ left: ${g["--ll-spacing-medium"]};
146
+ width: 360px;
147
+ max-height: calc(100% - 2 * ${g["--ll-spacing-medium"]});
148
+ z-index: 1;
149
+ border-radius: ${g["--ll-border-radius-medium"]};
150
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
151
+ background-color: #fff;
152
+ overflow: hidden;
153
+ display: flex;
154
+ flex-direction: column;
155
+ background-color: ${g["--ll-color-background"]};
156
+ border: 1px solid ${g["--ll-color-border"]};
157
+ `;w.div`
158
+ display: flex;
159
+ justify-content: center;
160
+ padding: ${g["--ll-spacing-small"]};
161
+ `;const Tn=w.div`
162
+ padding: ${g["--ll-spacing-x-small"]};
163
+ border-bottom: 1px solid ${g["--ll-color-border"]};
164
+ `,On=w.div`
165
+ display: flex;
166
+ justify-content: center;
167
+ padding: ${g["--ll-spacing-small"]};
168
+ background-color: ${g["--ll-color-background"]};
169
+ `,Xt=()=>a(On,{children:a(ve.Root,{})}),qt=T.forwardRef((t,e)=>{const{activeCategory:n,setActiveCategory:o,setShowMobileList:i}=O();return a(Q.Root,{options:{currentTab:n},onChange:s=>{o(s.data)},children:k(An,{ref:e,children:[a(Tn,{children:a(Q.Tabs,{})}),a(_n,{children:F.map(s=>a(Q.Content,{options:{value:s.value},children:a(Jt,{tabContent:s},s.value)},s.value))}),a(Xt,{})]})})});qt.displayName="DesktopScores";const En=w.div`
170
+ position: relative;
171
+ display: flex;
172
+ flex-direction: column;
173
+ height: 100vh;
174
+ `,zn=w.div`
175
+ position: absolute;
176
+ bottom: 86px;
177
+ right: 10px;
178
+ background-color: ${g["--ll-color-background"]};
179
+ z-index: 3;
180
+ border-radius: 50%;
181
+ `,Rn=w(xe)`
182
+ box-shadow: ${g["--ll-shadow-medium"]};
183
+ `,{scorePois:at}=Z.Constants,Hn=()=>{var E,j,mt;const{sdkState:t,setSdkState:e}=tt(),{activeScore:n,activePOI:o,setActivePOI:i,hoveredPOI:s,showMobileList:c,setShowMobileList:l}=O(),r=Ne(),u=Zt(),d=Vt(),p=((j=(E=t==null?void 0:t.globalOptions)==null?void 0:E.appearance)==null?void 0:j.theme)==="night"?"basic-v2-dark":"600d69cb-288d-445e-9839-3dfe4d76b31a",[h,f]=b.exports.useState(!1),m=b.exports.useMemo(()=>{var P;return(n==="high_schools"||n==="primary_schools")&&!d.isFetching?{[n]:((P=d==null?void 0:d.data)==null?void 0:P[n])||[]}:!(n&&at[n]&&at[n].length)&&!u.isFetching?{[n]:[]}:u.data},[u.data,d.data,n]),v=b.exports.useMemo(()=>m?Object.entries(m).map(([z,R])=>R.map(A=>bt([A.lng,A.lat],{poi:A,type:z}))).flat().filter((z,R,A)=>A.findIndex(ot=>["lat","lng","name"].every(N=>ot.properties.poi[N]===z.properties.poi[N]))===R):[],[m]),x=b.exports.useMemo(()=>{var z,R,A;const P=((z=t==null?void 0:t.options)==null?void 0:z.marker)&&bt([(R=t==null?void 0:t.options)==null?void 0:R.marker.lng,(A=t==null?void 0:t.options)==null?void 0:A.marker.lat]);return[...v,...P?[P]:[]]},[v,(mt=t==null?void 0:t.options)==null?void 0:mt.marker]),y=b.exports.useRef(),[L,C]=le(),S=b.exports.useMemo(()=>({top:25+C.height,bottom:25,left:25,right:25}),[C.height]),$=b.exports.useMemo(()=>({top:50,bottom:50,left:C.width+32+50,right:50}),[C.width]),M=r?S:$,_=P=>{e({...t,options:{...t.options,lat:P.viewState.latitude,lng:P.viewState.longitude,zoom:P.viewState.zoom,bearing:P.viewState.bearing,pitch:P.viewState.pitch}})};return b.exports.useEffect(()=>{var N,yt;if(!x.length||!((N=t.options)!=null&&N.marker))return;const P=Me(x.map(({geometry:vt})=>[vt.coordinates[1],vt.coordinates[0]])),[z,R,A,ot]=ct(P);(yt=y==null?void 0:y.current)==null||yt.fitBounds([[R,z],[ot,A]],{maxZoom:17,padding:M,duration:1e3})},[x,M]),t.options?a(Ge,{mapRef:y,mapPadding:M,children:k(En,{children:[k(ue,{ref:y,mapLib:de,latitude:t.options.lat,longitude:t.options.lng,zoom:t.options.zoom,pitch:t.options.pitch,bearing:t.options.bearing,style:{flex:1,width:"100vw"},mapStyle:`https://api.maptiler.com/maps/${p}/style.json?key=9jNGatuzs05Q1oNlctEs`,onMove:_,cooperativeGestures:t.options.cooperativeGestures,onMoveStart:()=>f(!0),onMoveEnd:()=>f(!1),children:[a(pe,{showCompass:!0,style:{marginTop:r?16+C.height:16,marginRight:16}}),t.options.marker&&a(fe,{marker:t.options.marker}),a(Gt,{rect:C,zoom:t.options.zoom,mapRef:y,points:v,isMobile:r,activePOI:o,hoveredPOI:s,isMapMoving:h,setActivePOI:i}),r?a(Kt,{ref:L,showMobileList:c}):a(qt,{ref:L})]}),r&&k(et,{children:[a(zn,{children:a(Rn,{size:"large",SVGElement:Be,onClick:()=>l(P=>!P),disabled:!(n&&!!at[n].length)})}),a(Xt,{})]})]})}):a("div",{children:"No options provided."})},jn=()=>a(we,{children:a(Hn,{})});export{jn as default};