@local-logic/sdks-app 1.7.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/assets/{index-legacy.9e6e31fb.js → index-legacy.5b5c89be.js} +1 -1
  2. package/dist/assets/{index-legacy.8a8cb342.js → index-legacy.6f7be327.js} +1 -1
  3. package/dist/assets/index-legacy.873d2f5f.js +1 -0
  4. package/dist/assets/{index-legacy.93d69255.js → index-legacy.8b48df8f.js} +1 -1
  5. package/dist/assets/index-legacy.a2e5122a.js +23 -0
  6. package/dist/assets/{index-legacy.46f64d17.js → index-legacy.b4a1ea09.js} +1 -1
  7. package/dist/assets/index-legacy.e333988e.js +106 -0
  8. package/dist/assets/index.1b34a15d.js +35 -0
  9. package/dist/assets/index.24661964.js +247 -0
  10. package/dist/assets/index.3039bacf.js +161 -0
  11. package/dist/assets/index.3eec99ca.js +1318 -0
  12. package/dist/assets/index.77b51154.js +1 -0
  13. package/dist/assets/index.aae000f4.js +1 -0
  14. package/dist/assets/{index.fb08bd56.js → index.d89a7cee.js} +1 -1
  15. package/dist/assets/polyfills-legacy.db2bc606.js +1 -0
  16. package/dist/assets/{useIsMobile-legacy.cb5792f6.js → useIsMobile-legacy.7fb572d8.js} +1 -1
  17. package/dist/assets/{useIsMobile.8a6bbdf7.js → useIsMobile.b5e8d9ad.js} +1 -1
  18. package/dist/assets/{useQuery-legacy.9e74d2d1.js → useQuery-legacy.7e93cb2c.js} +1 -1
  19. package/dist/assets/useQuery.19a6ca1c.js +9 -0
  20. package/dist/index.html +3 -3
  21. package/dist/types/context/languageProvider/data-explorer/locales/en/index.d.ts.map +1 -1
  22. package/dist/types/context/languageProvider/data-explorer/locales/en/index.js +2 -0
  23. package/dist/types/context/languageProvider/data-explorer/locales/en/index.js.map +1 -1
  24. package/dist/types/context/languageProvider/data-explorer/locales/fr/index.d.ts.map +1 -1
  25. package/dist/types/context/languageProvider/data-explorer/locales/fr/index.js +2 -0
  26. package/dist/types/context/languageProvider/data-explorer/locales/fr/index.js.map +1 -1
  27. package/dist/types/context/languageProvider/data-explorer/types.d.ts +2 -2
  28. package/dist/types/context/languageProvider/data-explorer/types.d.ts.map +1 -1
  29. package/dist/types/context/languageProvider/index.d.ts +2 -2
  30. package/dist/types/context/languageProvider/index.d.ts.map +1 -1
  31. package/dist/types/features/calculateRoute/useCommute.js +2 -2
  32. package/dist/types/features/calculateRoute/useCommute.js.map +1 -1
  33. package/dist/types/features/reverse-geocodes/useReverseGeocodes.js +2 -2
  34. package/dist/types/features/reverse-geocodes/useReverseGeocodes.js.map +1 -1
  35. package/dist/types/main.d.ts +1 -1
  36. package/dist/types/main.d.ts.map +1 -1
  37. package/dist/types/main.js +2 -13
  38. package/dist/types/main.js.map +1 -1
  39. package/dist/types/sdks/DataExplorer/components/Table/index.d.ts +4 -0
  40. package/dist/types/sdks/DataExplorer/components/Table/index.d.ts.map +1 -0
  41. package/dist/types/sdks/DataExplorer/components/Table/index.js +65 -0
  42. package/dist/types/sdks/DataExplorer/components/Table/index.js.map +1 -0
  43. package/dist/types/sdks/DataExplorer/components/Table/styles.d.ts +6 -0
  44. package/dist/types/sdks/DataExplorer/components/Table/styles.d.ts.map +1 -0
  45. package/dist/types/sdks/DataExplorer/components/Table/styles.js +27 -0
  46. package/dist/types/sdks/DataExplorer/components/Table/styles.js.map +1 -0
  47. package/dist/types/sdks/DataExplorer/context.d.ts +3 -0
  48. package/dist/types/sdks/DataExplorer/context.d.ts.map +1 -1
  49. package/dist/types/sdks/DataExplorer/context.js +3 -0
  50. package/dist/types/sdks/DataExplorer/context.js.map +1 -1
  51. package/dist/types/sdks/DataExplorer/index.d.ts.map +1 -1
  52. package/dist/types/sdks/DataExplorer/index.js +8 -0
  53. package/dist/types/sdks/DataExplorer/index.js.map +1 -1
  54. package/dist/types/sdks/Demographics/components/Content/Household/index.d.ts.map +1 -1
  55. package/dist/types/sdks/Demographics/components/Content/Household/index.js +2 -1
  56. package/dist/types/sdks/Demographics/components/Content/Household/index.js.map +1 -1
  57. package/dist/types/sdks/Demographics/components/Content/Household/styles.d.ts +3 -0
  58. package/dist/types/sdks/Demographics/components/Content/Household/styles.d.ts.map +1 -0
  59. package/dist/types/sdks/Demographics/components/Content/Household/styles.js +19 -0
  60. package/dist/types/sdks/Demographics/components/Content/Household/styles.js.map +1 -0
  61. package/dist/types/sdks/Demographics/components/Content/Housing/index.d.ts.map +1 -1
  62. package/dist/types/sdks/Demographics/components/Content/Housing/index.js +10 -7
  63. package/dist/types/sdks/Demographics/components/Content/Housing/index.js.map +1 -1
  64. package/dist/types/sdks/Demographics/components/Content/Housing/styles.d.ts +3 -0
  65. package/dist/types/sdks/Demographics/components/Content/Housing/styles.d.ts.map +1 -0
  66. package/dist/types/sdks/Demographics/components/Content/Housing/styles.js +12 -0
  67. package/dist/types/sdks/Demographics/components/Content/Housing/styles.js.map +1 -0
  68. package/dist/types/sdks/Demographics/components/Content/Languages/index.d.ts +3 -0
  69. package/dist/types/sdks/Demographics/components/Content/Languages/index.d.ts.map +1 -0
  70. package/dist/types/sdks/Demographics/components/Content/Languages/index.js +14 -0
  71. package/dist/types/sdks/Demographics/components/Content/Languages/index.js.map +1 -0
  72. package/dist/types/sdks/Demographics/components/Content/index.d.ts.map +1 -1
  73. package/dist/types/sdks/Demographics/components/Content/index.js +3 -0
  74. package/dist/types/sdks/Demographics/components/Content/index.js.map +1 -1
  75. package/dist/types/sdks/Demographics/components/Content/styles.js +1 -1
  76. package/dist/types/sdks/Demographics/components/Content/styles.js.map +1 -1
  77. package/dist/types/sdks/Demographics/context.d.ts +3 -0
  78. package/dist/types/sdks/Demographics/context.d.ts.map +1 -1
  79. package/dist/types/sdks/Demographics/context.js.map +1 -1
  80. package/dist/types/sdks/Demographics/styles.d.ts.map +1 -1
  81. package/dist/types/sdks/Demographics/styles.js +0 -1
  82. package/dist/types/sdks/Demographics/styles.js.map +1 -1
  83. package/dist/types/utils/errorTracker/index.d.ts +23 -0
  84. package/dist/types/utils/errorTracker/index.d.ts.map +1 -0
  85. package/dist/types/utils/errorTracker/index.js +100 -0
  86. package/dist/types/utils/errorTracker/index.js.map +1 -0
  87. package/package.json +5 -4
  88. package/dist/assets/index-legacy.02b7ed30.js +0 -1
  89. package/dist/assets/index-legacy.0500abfa.js +0 -106
  90. package/dist/assets/index-legacy.4d0178fa.js +0 -1
  91. package/dist/assets/index.3e70a7fa.js +0 -28
  92. package/dist/assets/index.414e070d.js +0 -1374
  93. package/dist/assets/index.630bec89.js +0 -120
  94. package/dist/assets/index.693f2772.js +0 -247
  95. package/dist/assets/index.d464e7cf.js +0 -1
  96. package/dist/assets/index.e63e2d64.js +0 -1
  97. package/dist/assets/polyfills-legacy.147ba02d.js +0 -1
  98. package/dist/assets/useQuery.fe83c221.js +0 -9
@@ -1,247 +0,0 @@
1
- import{M as Gt,d as tt,p as we,s as be,a as jt,b as Me,$ as $e,c as Se,e as Le,f as ke,S as Pe,g as Ee,h as Ae,i as _e,A as Re,u as Ie,j as Te,m as ze,k as Oe,N as Ze,P as Pt}from"./index.fb08bd56.js";import{R as T,r as m,c as Ut,j as a,O as q,n as Ct,u as D,a as xt,N as W,s as x,m as De,_ as p,b as Ve,d as st,C as He,w as mt,I as j,e as L,W as ut,K as N,i as dt,F as Q,f as E,q as X,g as O,h as J,k as Bt,Z as Ft,X as ft,G as Kt,V as G,Y as et,l as Ne,o as K,p as Ge,t as Wt,U as je}from"./index.414e070d.js";import{u as vt}from"./useIsMobile.8a6bbdf7.js";import{u as at}from"./useQuery.fe83c221.js";const Yt=T.createContext({}),A=()=>m.exports.useContext(Yt),Ue=(e,t)=>{switch(t.type){case"CATEGORY":return{...e,activeCategory:t.value};case"SCORE":{const o=q.find(n=>t.value===""?n.value===e.activeCategory:n.scores.includes(t.value)).value;return{activeCategory:o,activeScoreByCategory:{...e.activeScoreByCategory,[o]:t.value}}}}},Be=({children:e})=>{const t=window.innerWidth<Ut.screenSizes.tablet?{activeCategory:"commute",activeScoreByCategory:{commute:"transit_friendly",amenities:"groceries",character:"quiet",nature:"parks",education:"primary_schools"}}:{activeCategory:"commute",activeScoreByCategory:{commute:"",amenities:"",character:"",nature:"",education:""}},[o,n]=m.exports.useReducer(Ue,t),[r,s]=m.exports.useState(),[i,c]=m.exports.useState(),[l,u]=m.exports.useState(),[d,h]=m.exports.useState(),[g,f]=m.exports.useState(),[y,M]=m.exports.useState(!1),{activeCategory:C}=o,$=o.activeScoreByCategory[C],b=v=>{n({type:"SCORE",value:v})},w=v=>{n({type:"CATEGORY",value:v})},S=m.exports.useMemo(()=>({activeScore:$,setActiveScore:b,activeCategory:C,setActiveCategory:w,activePOI:r,setActivePOI:s,hoveredPOI:i,setHoveredPOI:c,commuteGeojson:l,setCommuteGeojson:u,destination:g,setDestination:f,showCommuteCalculator:y,setShowCommuteCalculator:M,schoolCatchment:d,setSchoolCatchment:h}),[$,b,C,w,r,s,i,c,l,u,g,f,y,M,d,h]);return a(Yt.Provider,{value:S,children:e})};function rt(e,t){if(!e)throw new Error(t)}let Fe=0;function Ke(e,t,o){if(e.style&&e.style._loaded){const n={...o};return delete n.id,delete n.children,e.addSource(t,n),e.getSource(t)}return null}function We(e,t,o){rt(t.id===o.id,"source id changed"),rt(t.type===o.type,"source type changed");let n="",r=0;for(const i in t)i!=="children"&&i!=="id"&&!tt(o[i],t[i])&&(n=i,r++);if(!r)return;const s=t.type;if(s==="geojson")e.setData(t.data);else if(s==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((s==="canvas"||s==="video")&&r===1&&n==="coordinates")e.setCoordinates(t.coordinates);else if(s==="vector"&&"setUrl"in e)switch(n){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles);break}else console.warn(`Unable to update <Source> prop: ${n}`)}function Et(e){const t=m.exports.useContext(Gt).map.getMap(),o=m.exports.useRef(e),[,n]=m.exports.useState(0),r=m.exports.useMemo(()=>e.id||`jsx-source-${Fe++}`,[]);m.exports.useEffect(()=>{if(t){const i=()=>n(c=>c+1);return t.on("styledata",i),i(),()=>{var c;if(t.off("styledata",i),t.style&&t.style._loaded&&t.getSource(r)){const l=(c=t.getStyle())===null||c===void 0?void 0:c.layers;if(l)for(const u of l)u.source===r&&t.removeLayer(u.id);t.removeSource(r)}}}},[t]);let s=t&&t.style&&t.getSource(r);return s?We(s,e,o.current):s=Ke(t,r,e),o.current=e,s&&m.exports.Children.map(e.children,i=>i&&m.exports.cloneElement(i,{source:r}))||null}function Ye(e,t,o,n){if(rt(o.id===n.id,"layer id changed"),rt(o.type===n.type,"layer type changed"),o.type==="custom"||n.type==="custom")return;const{layout:r={},paint:s={},filter:i,minzoom:c,maxzoom:l,beforeId:u}=o;if(u!==n.beforeId&&e.moveLayer(t,u),r!==n.layout){const d=n.layout||{};for(const h in r)tt(r[h],d[h])||e.setLayoutProperty(t,h,r[h]);for(const h in d)r.hasOwnProperty(h)||e.setLayoutProperty(t,h,void 0)}if(s!==n.paint){const d=n.paint||{};for(const h in s)tt(s[h],d[h])||e.setPaintProperty(t,h,s[h]);for(const h in d)s.hasOwnProperty(h)||e.setPaintProperty(t,h,void 0)}tt(i,n.filter)||e.setFilter(t,i),(c!==n.minzoom||l!==n.maxzoom)&&e.setLayerZoomRange(t,c,l)}function qe(e,t,o){if(e.style&&e.style._loaded&&(!("source"in o)||e.getSource(o.source))){const n={...o,id:t};delete n.beforeId,e.addLayer(n,o.beforeId)}}let Qe=0;function At(e){const t=m.exports.useContext(Gt).map.getMap(),o=m.exports.useRef(e),[,n]=m.exports.useState(0),r=m.exports.useMemo(()=>e.id||`jsx-layer-${Qe++}`,[]);if(m.exports.useEffect(()=>{if(t){const i=()=>n(c=>c+1);return t.on("styledata",i),i(),()=>{t.off("styledata",i),t.style&&t.style._loaded&&t.getLayer(r)&&t.removeLayer(r)}}},[t]),t&&t.style&&t.getLayer(r))try{Ye(t,r,e,o.current)}catch(i){console.warn(i)}else qe(t,r,e);return o.current=e,null}function qt(e,t,o){o===void 0&&(o={});var n={type:"Feature"};return(o.id===0||o.id)&&(n.id=o.id),o.bbox&&(n.bbox=o.bbox),n.properties=t||{},n.geometry=e,n}function ht(e,t,o){if(o===void 0&&(o={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!_t(e[0])||!_t(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return qt(n,t,o)}function Xe(e,t,o){o===void 0&&(o={});var n={type:"MultiPoint",coordinates:e};return qt(n,t,o)}function _t(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function Qt(e,t,o){if(e!==null)for(var n,r,s,i,c,l,u,d=0,h=0,g,f=e.type,y=f==="FeatureCollection",M=f==="Feature",C=y?e.features.length:1,$=0;$<C;$++){u=y?e.features[$].geometry:M?e.geometry:e,g=u?u.type==="GeometryCollection":!1,c=g?u.geometries.length:1;for(var b=0;b<c;b++){var w=0,S=0;if(i=g?u.geometries[b]:u,i!==null){l=i.coordinates;var v=i.type;switch(d=o&&(v==="Polygon"||v==="MultiPolygon")?1:0,v){case null:break;case"Point":if(t(l,h,$,w,S)===!1)return!1;h++,w++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],h,$,w,S)===!1)return!1;h++,v==="MultiPoint"&&w++}v==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(r=0;r<l[n].length-d;r++){if(t(l[n][r],h,$,w,S)===!1)return!1;h++}v==="MultiLineString"&&w++,v==="Polygon"&&S++}v==="Polygon"&&w++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(S=0,r=0;r<l[n].length;r++){for(s=0;s<l[n][r].length-d;s++){if(t(l[n][r][s],h,$,w,S)===!1)return!1;h++}S++}w++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(Qt(i.geometries[n],t,o)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function gt(e){var t=[1/0,1/0,-1/0,-1/0];return Qt(e,function(o){t[0]>o[0]&&(t[0]=o[0]),t[1]>o[1]&&(t[1]=o[1]),t[2]<o[0]&&(t[2]=o[0]),t[3]<o[1]&&(t[3]=o[1])}),t}gt.default=gt;function Xt(){var c;const{client:e}=Ct(),{sdkState:t}=D(),o=xt(t.options,250),{activeScore:n}=A(),r=n?W[n]:void 0,i={...m.exports.useMemo(()=>o!=null&&o.marker?o.marker:{lat:o==null?void 0:o.lat,lng:o==null?void 0:o.lng},[o]),limit:10,radius:2e3,include:r};return at(we.list(i),async()=>e.getPois(i),{enabled:!!i&&!!((c=i.include)!=null&&c.length)&&!!i.lat&&!!i.lng})}function Jt(){const{client:e}=Ct(),{sdkState:t}=D(),o=xt(t.options,250),{activeScore:n}=A(),r=n==="high_schools"||n==="primary_schools",i={...m.exports.useMemo(()=>o!=null&&o.marker?o.marker:{lat:o==null?void 0:o.lat,lng:o==null?void 0:o.lng},[o]),limit:10,radius:2e3,include_catchments:!1};return at(be.list(i),async()=>e.getSchools(i),{enabled:!!i&&!!i.lat&&!!i.lng&&r})}const te=T.createContext({}),ee=()=>m.exports.useContext(te),Je=({children:e,mapRef:t,mapPadding:o})=>a(te.Provider,{value:{mapRef:t,mapPadding:o},children:e});function yt(e,t,o,n,r,s){if(r-n<=o)return;const i=n+r>>1;oe(e,t,i,n,r,s%2),yt(e,t,o,n,i-1,s+1),yt(e,t,o,i+1,r,s+1)}function oe(e,t,o,n,r,s){for(;r>n;){if(r-n>600){const u=r-n+1,d=o-n+1,h=Math.log(u),g=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*g*(u-g)/u)*(d-u/2<0?-1:1),y=Math.max(n,Math.floor(o-d*g/u+f)),M=Math.min(r,Math.floor(o+(u-d)*g/u+f));oe(e,t,o,y,M,s)}const i=t[2*o+s];let c=n,l=r;for(F(e,t,n,o),t[2*r+s]>i&&F(e,t,n,r);c<l;){for(F(e,t,c,l),c++,l--;t[2*c+s]<i;)c++;for(;t[2*l+s]>i;)l--}t[2*n+s]===i?F(e,t,n,l):(l++,F(e,t,l,r)),l<=o&&(n=l+1),o<=l&&(r=l-1)}}function F(e,t,o,n){pt(e,o,n),pt(t,2*o,2*n),pt(t,2*o+1,2*n+1)}function pt(e,t,o){const n=e[t];e[t]=e[o],e[o]=n}function to(e,t,o,n,r,s,i){const c=[0,e.length-1,0],l=[];let u,d;for(;c.length;){const h=c.pop(),g=c.pop(),f=c.pop();if(g-f<=i){for(let C=f;C<=g;C++)u=t[2*C],d=t[2*C+1],u>=o&&u<=r&&d>=n&&d<=s&&l.push(e[C]);continue}const y=Math.floor((f+g)/2);u=t[2*y],d=t[2*y+1],u>=o&&u<=r&&d>=n&&d<=s&&l.push(e[y]);const M=(h+1)%2;(h===0?o<=u:n<=d)&&(c.push(f),c.push(y-1),c.push(M)),(h===0?r>=u:s>=d)&&(c.push(y+1),c.push(g),c.push(M))}return l}function eo(e,t,o,n,r,s){const i=[0,e.length-1,0],c=[],l=r*r;for(;i.length;){const u=i.pop(),d=i.pop(),h=i.pop();if(d-h<=s){for(let C=h;C<=d;C++)Rt(t[2*C],t[2*C+1],o,n)<=l&&c.push(e[C]);continue}const g=Math.floor((h+d)/2),f=t[2*g],y=t[2*g+1];Rt(f,y,o,n)<=l&&c.push(e[g]);const M=(u+1)%2;(u===0?o-r<=f:n-r<=y)&&(i.push(h),i.push(g-1),i.push(M)),(u===0?o+r>=f:n+r>=y)&&(i.push(g+1),i.push(d),i.push(M))}return c}function Rt(e,t,o,n){const r=e-o,s=t-n;return r*r+s*s}const oo=e=>e[0],no=e=>e[1];class It{constructor(t,o=oo,n=no,r=64,s=Float64Array){this.nodeSize=r,this.points=t;const i=t.length<65536?Uint16Array:Uint32Array,c=this.ids=new i(t.length),l=this.coords=new s(t.length*2);for(let u=0;u<t.length;u++)c[u]=u,l[2*u]=o(t[u]),l[2*u+1]=n(t[u]);yt(c,l,r,0,c.length-1,0)}range(t,o,n,r){return to(this.ids,this.coords,t,o,n,r,this.nodeSize)}within(t,o,n){return eo(this.ids,this.coords,t,o,n,this.nodeSize)}}const ro={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},it=Math.fround||(e=>t=>(e[0]=+t,e[0]))(new Float32Array(1));class io{constructor(t){this.options=Y(Object.create(ro),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:o,minZoom:n,maxZoom:r,nodeSize:s}=this.options;o&&console.time("total time");const i=`prepare ${t.length} points`;o&&console.time(i),this.points=t;let c=[];for(let l=0;l<t.length;l++)!t[l].geometry||c.push(ao(t[l],l));this.trees[r+1]=new It(c,zt,Ot,s,Float32Array),o&&console.timeEnd(i);for(let l=r;l>=n;l--){const u=+Date.now();c=this._cluster(c,l),this.trees[l]=new It(c,zt,Ot,s,Float32Array),o&&console.log("z%d: %d clusters in %dms",l,c.length,+Date.now()-u)}return o&&console.timeEnd("total time"),this}getClusters(t,o){let n=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let s=t[2]===180?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,s=180;else if(n>s){const d=this.getClusters([n,r,180,i],o),h=this.getClusters([-180,r,s,i],o);return d.concat(h)}const c=this.trees[this._limitZoom(o)],l=c.range(ot(n),nt(i),ot(s),nt(r)),u=[];for(const d of l){const h=c.points[d];u.push(h.numPoints?Tt(h):this.points[h.index])}return u}getChildren(t){const o=this._getOriginId(t),n=this._getOriginZoom(t),r="No cluster with the specified id.",s=this.trees[n];if(!s)throw new Error(r);const i=s.points[o];if(!i)throw new Error(r);const c=this.options.radius/(this.options.extent*Math.pow(2,n-1)),l=s.within(i.x,i.y,c),u=[];for(const d of l){const h=s.points[d];h.parentId===t&&u.push(h.numPoints?Tt(h):this.points[h.index])}if(u.length===0)throw new Error(r);return u}getLeaves(t,o,n){o=o||10,n=n||0;const r=[];return this._appendLeaves(r,t,o,n,0),r}getTile(t,o,n){const r=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:i,radius:c}=this.options,l=c/i,u=(n-l)/s,d=(n+1+l)/s,h={features:[]};return this._addTileFeatures(r.range((o-l)/s,u,(o+1+l)/s,d),r.points,o,n,s,h),o===0&&this._addTileFeatures(r.range(1-l/s,u,1,d),r.points,s,n,s,h),o===s-1&&this._addTileFeatures(r.range(0,u,l/s,d),r.points,-1,n,s,h),h.features.length?h:null}getClusterExpansionZoom(t){let o=this._getOriginZoom(t)-1;for(;o<=this.options.maxZoom;){const n=this.getChildren(t);if(o++,n.length!==1)break;t=n[0].properties.cluster_id}return o}_appendLeaves(t,o,n,r,s){const i=this.getChildren(o);for(const c of i){const l=c.properties;if(l&&l.cluster?s+l.point_count<=r?s+=l.point_count:s=this._appendLeaves(t,l.cluster_id,n,r,s):s<r?s++:t.push(c),t.length===n)break}return s}_addTileFeatures(t,o,n,r,s,i){for(const c of t){const l=o[c],u=l.numPoints;let d,h,g;if(u)d=ne(l),h=l.x,g=l.y;else{const M=this.points[l.index];d=M.properties,h=ot(M.geometry.coordinates[0]),g=nt(M.geometry.coordinates[1])}const f={type:1,geometry:[[Math.round(this.options.extent*(h*s-n)),Math.round(this.options.extent*(g*s-r))]],tags:d};let y;u?y=l.id:this.options.generateId?y=l.index:this.points[l.index].id&&(y=this.points[l.index].id),y!==void 0&&(f.id=y),i.features.push(f)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,o){const n=[],{radius:r,extent:s,reduce:i,minPoints:c}=this.options,l=r/(s*Math.pow(2,o));for(let u=0;u<t.length;u++){const d=t[u];if(d.zoom<=o)continue;d.zoom=o;const h=this.trees[o+1],g=h.within(d.x,d.y,l),f=d.numPoints||1;let y=f;for(const M of g){const C=h.points[M];C.zoom>o&&(y+=C.numPoints||1)}if(y>f&&y>=c){let M=d.x*f,C=d.y*f,$=i&&f>1?this._map(d,!0):null;const b=(u<<5)+(o+1)+this.points.length;for(const w of g){const S=h.points[w];if(S.zoom<=o)continue;S.zoom=o;const v=S.numPoints||1;M+=S.x*v,C+=S.y*v,S.parentId=b,i&&($||($=this._map(d,!0)),i($,this._map(S)))}d.parentId=b,n.push(so(M/y,C/y,b,y,$))}else if(n.push(d),y>1)for(const M of g){const C=h.points[M];C.zoom<=o||(C.zoom=o,n.push(C))}}return n}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,o){if(t.numPoints)return o?Y({},t.properties):t.properties;const n=this.points[t.index].properties,r=this.options.map(n);return o&&r===n?Y({},r):r}}function so(e,t,o,n,r){return{x:it(e),y:it(t),zoom:1/0,id:o,parentId:-1,numPoints:n,properties:r}}function ao(e,t){const[o,n]=e.geometry.coordinates;return{x:it(ot(o)),y:it(nt(n)),zoom:1/0,index:t,parentId:-1}}function Tt(e){return{type:"Feature",id:e.id,properties:ne(e),geometry:{type:"Point",coordinates:[lo(e.x),co(e.y)]}}}function ne(e){const t=e.numPoints,o=t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${Math.round(t/100)/10}k`:t;return Y(Y({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:o})}function ot(e){return e/360+.5}function nt(e){const t=Math.sin(e*Math.PI/180),o=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return o<0?0:o>1?1:o}function lo(e){return(e-.5)*360}function co(e){const t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function Y(e,t){for(const o in t)e[o]=t[o];return e}function zt(e){return e.x}function Ot(e){return e.y}var Zt=Object.prototype.hasOwnProperty;function Dt(e,t,o){for(o of e.keys())if(V(o,t))return o}function V(e,t){var o,n,r;if(e===t)return!0;if(e&&t&&(o=e.constructor)===t.constructor){if(o===Date)return e.getTime()===t.getTime();if(o===RegExp)return e.toString()===t.toString();if(o===Array){if((n=e.length)===t.length)for(;n--&&V(e[n],t[n]););return n===-1}if(o===Set){if(e.size!==t.size)return!1;for(n of e)if(r=n,r&&typeof r=="object"&&(r=Dt(t,r),!r)||!t.has(r))return!1;return!0}if(o===Map){if(e.size!==t.size)return!1;for(n of e)if(r=n[0],r&&typeof r=="object"&&(r=Dt(t,r),!r)||!V(n[1],t.get(r)))return!1;return!0}if(o===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(o===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(!o||typeof e=="object"){n=0;for(o in e)if(Zt.call(e,o)&&++n&&!Zt.call(t,o)||!(o in t)||!V(e[o],t[o]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function uo(e){var t=m.exports.useRef(e),o=m.exports.useRef(0);return V(e,t.current)||(t.current=e,o.current+=1),m.exports.useMemo(function(){return t.current},[o.current])}function ho(e,t){return m.exports.useEffect(e,uo(t))}var po=function(t){var o=t.points,n=t.bounds,r=t.zoom,s=t.options,i=m.exports.useRef(),c=m.exports.useRef(),l=m.exports.useState([]),u=l[0],d=l[1],h=Math.round(r);return ho(function(){(!i.current||!V(c.current,o)||!V(i.current.options,s))&&(i.current=new io(s),i.current.load(o)),n&&d(i.current.getClusters(n,h)),c.current=o},[o,n,h,s]),{clusters:u,supercluster:i.current}};const mo=x(De.div)`
2
- border-radius: 50%;
3
- background: linear-gradient(
4
- to top,
5
- ${p["--ll-color-primary-variant1"]},
6
- ${p["--ll-color-primary"]}
7
- );
8
- color: ${p["--ll-color-on-primary"]};
9
- height: ${({diameter:e})=>e}px;
10
- width: ${({diameter:e})=>e}px;
11
- display: flex;
12
- justify-content: center;
13
- align-items: center;
14
- line-height: 1;
15
- font-family: ${p["--ll-font-family"]};
16
- font-size: ${({diameter:e})=>e/2.5}px;
17
- border: 2px solid #fff;
18
- box-shadow: ${p["--ll-shadow-small"]};
19
- cursor: default;
20
- `,fo=x.ul`
21
- list-style: none;
22
- padding: 0;
23
- margin: 0;
24
- `,go=x.li`
25
- font-family: ${p["--ll-font-family"]};
26
- padding: ${p["--ll-spacing-x-small"]};
27
- background-color: ${p["--ll-color-background"]};
28
- border-radius: ${p["--ll-border-radius-small"]};
29
- border: 1px solid ${p["--ll-color-border"]};
30
- cursor: default;
31
-
32
- &:not(:last-child) {
33
- margin-bottom: ${p["--ll-spacing-xx-small"]};
34
- }
35
-
36
- &:hover {
37
- background-color: ${p["--ll-color-surface"]};
38
- }
39
- `,re={all:()=>["commute-calculator"],list:e=>[...re.all(),e]},yo="https://router.hereapi.com/v8/routes?";function ie({transportMode:e,origin:t,destination:o,isOpen:n}){const r={return:"polyline,summary,typicalDuration",transportMode:e,origin:t,destination:`${o==null?void 0:o.lat},${o==null?void 0:o.lng}`,apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"},s=()=>fetch(yo+new URLSearchParams(r)).then(i=>i.json()).then(i=>i.routes.length>0&&i.routes[0].sections.length>0?i.routes[0].sections[0]:[]).catch(i=>{Ve(i)});return at(re.list(r),s,{enabled:!!r&&!!o&&!!t&&n})}const se=({poi:e,poiType:t,rect:o,activePOI:n,hoveredPOI:r,isMapMoving:s,setActivePOI:i,isMobile:c})=>{var v,P,U,z;const[l,u]=m.exports.useState(!1),d=r===e,h=["rapid_transit_stations"],{translations:g}=st(),{sdkState:f}=D(),{setCommuteGeojson:y,setDestination:M,setShowCommuteCalculator:C,setSchoolCatchment:$}=A(),{data:b}=ie({destination:{lat:e.lat,lng:e.lng},transportMode:"pedestrian",origin:`${(P=(v=f==null?void 0:f.options)==null?void 0:v.marker)==null?void 0:P.lat},${(z=(U=f==null?void 0:f.options)==null?void 0:U.marker)==null?void 0:z.lng}`,isOpen:l});m.exports.useEffect(()=>{if(u(n===e),n===e){const R=t==="high_schools"||t==="primary_schools"?"school":"poi";He.poi.isSchool(e,R)&&(e==null?void 0:e.catchments)&&Object.keys((e==null?void 0:e.catchments)||[]).length>0&&$(mt.formatGeometry.formatGeometry(e.catchments[0].geometry))}},[n,e]);const w=m.exports.useMemo(()=>{if(!(b!=null&&b.summary)||!l)return null;const R=Math.floor(b.summary.typicalDuration/60/60),H=Math.floor(b.summary.typicalDuration/60%60);return R===0?`${H} ${j.pluralize(g.MINUTE,H)}`:`${R} ${j.pluralize(g.HOUR,R)} ${H} ${j.pluralize(g.MINUTE,H)}`},[b,l]),S=()=>{!(b!=null&&b.summary)||!l||(M({label:e.name,lat:e.lat,lng:e.lng}),y(mt.polyline.decode(b.polyline)),C(!0),u(!1))};return a(jt,{latitude:e.lat,longitude:e.lng,style:{zIndex:l?1:0},children:L(ut.Root,{options:{type:t,poi:e,isOpen:s?!1:l,isHovered:d,side:"top",size:h.includes(t)?"medium":"small",collisionPadding:c?{top:o.height+32,bottom:N*2,left:N*2,right:N*2}:{left:o.width+32,right:N*2,top:N*2,bottom:N*2},walkingTime:w,calculateRoute:S},onChange:R=>{R.type==="open-change"&&(R.data?setTimeout(()=>{i(e)},0):l&&(i(void 0),$()))},children:[a(ut.Marker,{}),a(ut.Content,{})]})})},Co={default:{scale:1},hovered:{scale:1.2}},Vt=17,xo=({cluster:e,supercluster:t,pointsCount:o,onClick:n,zoom:r,activePOI:s,hoveredPOI:i,setActivePOI:c,rect:l,isMobile:u,isMapMoving:d})=>{const[h,g]=m.exports.useState(!1),y=20+e.properties.point_count/o*25,M=()=>{if(r>Vt){g(!0);return}n&&n(e)},C=w=>{r<=Vt||g(w)},$=m.exports.useMemo(()=>t==null?void 0:t.getChildren(e.id).map(w=>w.properties).filter(w=>!!w),[t,e]),b=$==null?void 0:$.find(w=>!!s&&w.poi===s);return b?a(se,{rect:l,poi:b.poi,poiType:b.type,isMobile:u,activePOI:s,hoveredPOI:i,isMapMoving:d,setActivePOI:c}):L(dt.Root,{open:d?!1:h,onOpenChange:C,children:[a(dt.Trigger,{children:a(mo,{diameter:y,onClick:M,variants:Co,animate:h?"hovered":"default",whileHover:{scale:1.2},transition:Ut.transitions.default,children:e.properties.point_count})}),a(dt.Content,{side:"top",children:a(fo,{children:$==null?void 0:$.map((w,S)=>{var v;return a(go,{onClick:()=>c(w.poi),children:(v=w.poi)==null?void 0:v.name},S)})})})]})};function vo(e){return e.properties.cluster!==void 0}const ae=T.memo(({rect:e,zoom:t,mapRef:o,points:n,isMobile:r,activePOI:s,hoveredPOI:i,isMapMoving:c,setActivePOI:l})=>{var g;const u=(g=o==null?void 0:o.current)==null?void 0:g.getMap().getBounds().toArray().flat(),{clusters:d,supercluster:h}=po({points:n,bounds:u,zoom:t,options:{radius:50,maxZoom:30}});return a(Q,{children:d.map((f,y)=>{const[M,C]=f.geometry.coordinates;return vo(f)?a(jt,{latitude:C,longitude:M,children:a(xo,{rect:e,zoom:t,cluster:f,supercluster:h,pointsCount:n.length,activePOI:s,setActivePOI:l,isMobile:r,isMapMoving:c,hoveredPOI:i,onClick:()=>{var b;const $=Math.min(h.getClusterExpansionZoom(f.id),20);(b=o.current)==null||b.flyTo({zoom:$,center:[M,C],duration:1e3,essential:!0})}})},`cluster-${f.id}`):a(se,{rect:e,poi:f.properties.poi,poiType:f.properties.type,isMobile:r,activePOI:s,hoveredPOI:i,isMapMoving:c,setActivePOI:l},y)})})});ae.displayName="Markers";const le=e=>m.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},m.exports.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9C9.5 7.62 10.62 6.5 12 6.5C13.38 6.5 14.5 7.62 14.5 9C14.5 10.38 13.38 11.5 12 11.5Z"})),ce=e=>m.exports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.exports.createElement("path",{d:"M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"}));function wt(e){const{client:t}=Ct(),{sdkState:o}=D(),n=xt(o.options,250),s={...m.exports.useMemo(()=>n!=null&&n.marker?n.marker:{lat:n==null?void 0:n.lat,lng:n==null?void 0:n.lng},[n]),geographyLevels:["20","30"],locationScoresRounding:!1,include:e};return at(Me.list(s),async()=>t.getScores(s),{enabled:!!s})}const wo=x.div`
40
- padding: ${p["--ll-spacing-small"]} ${p["--ll-spacing-medium"]};
41
- background-color: ${p["--ll-color-surface"]};
42
- display: flex;
43
- flex-direction: column;
44
- overflow: hidden;
45
- flex: 1;
46
- `,bo=x.div`
47
- display: grid;
48
- grid-template-columns: min-content 1fr;
49
- grid-gap: ${p["--ll-spacing-medium"]};
50
- margin-bottom: ${p["--ll-spacing-medium"]};
51
- `,Mo=()=>{var i,c;const{sdkState:e}=D(),{activeCategory:t,activeScore:o}=A(),n=q.find(l=>l.value===t),{data:r,isLoading:s}=wt(n.scores);return o&&(r==null?void 0:r.location[o])?s?a("div",{children:"Loading"}):a(E.Root,{options:{score:o,scoresData:r},children:L(wo,{children:[L(bo,{children:[a(E.Badge,{}),a(E.BarChart,{options:{renderNeighbourhoodAvg:!1,locationIcon:((c=(i=e.options)==null?void 0:i.marker)==null?void 0:c.icon)==="pin"?le:ce}})]}),a(E.Description,{})]})}):null},$o=x.div`
52
- display: flex;
53
- overflow-x: scroll;
54
- padding: ${p["--ll-spacing-x-small"]} ${p["--ll-spacing-medium"]};
55
- flex-shrink: 0;
56
- position: relative;
57
- `,So=x.button`
58
- position: relative;
59
- display: flex;
60
- flex-direction: column;
61
- align-items: center;
62
- background: none;
63
- border: none;
64
- min-width: 60px;
65
- padding: 0;
66
- margin: 0 8px;
67
- flex-shrink: 0;
68
-
69
- &:first-child {
70
- margin-left: 0;
71
- }
72
-
73
- &:last-child {
74
- margin-right: 0;
75
- }
76
- `,Lo=x.div`
77
- position: absolute;
78
- top: -6px;
79
- right: 4px;
80
- border: 2px solid ${p["--ll-color-background"]};
81
- border-radius: 6px;
82
- `,ko=x.div`
83
- flex: 1;
84
- display: flex;
85
- align-items: center;
86
- `,Po=x.div`
87
- margin: 0 2px;
88
- `,Eo=({category:e})=>{const{data:t,isLoading:o,isFetching:n}=wt(e.scores),{activeScore:r,setActiveScore:s,setActiveCategory:i}=A();return a($o,{children:e.scores.map(c=>{const l=c===r,u=l?"--ll-color-primary":"--ll-color-disabled";return o||n?a(Po,{children:a(X,{height:"44px",width:"60px"})},c):a(E.Root,{options:{score:c,scoresData:t},children:L(So,{onClick:()=>{i(e.value),s(c)},children:[a(E.Icon,{options:{color:u,height:28,width:28}}),a(ko,{children:a(E.Title,{options:{variant:"caption1",color:u,lineClamp:1,noMargin:!0,weight:"--ll-font-weight-bold"}})}),a(Lo,{children:a(E.Badge,{options:{variant:"small",isPrimary:l}})})]})},c)})})},Ao=x.div`
89
- display: flex;
90
- padding: ${p["--ll-spacing-x-small"]} ${p["--ll-spacing-medium"]}
91
- ${p["--ll-spacing-xx-small"]} ${p["--ll-spacing-medium"]};
92
- `,_o=x.div`
93
- position: absolute;
94
- top: 0;
95
- left: 0;
96
- right: 0;
97
- z-index: 3;
98
- box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
99
- overflow: hidden;
100
- display: flex;
101
- flex-direction: column;
102
- background-color: ${p["--ll-color-background"]};
103
- border: 1px solid ${p["--ll-color-border"]};
104
- `,ue=T.forwardRef((e,t)=>{const{activeCategory:o,setActiveCategory:n}=A();return L(_o,{ref:t,children:[a(Ao,{children:L(O.Root,{value:o,onValueChange:r=>n(r),children:[a(O.Trigger,{size:"large",children:a(J.Root,{options:{scoreCategory:o},children:a(J.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},o)}),a(O.Content,{children:q.map(r=>a(J.Root,{options:{scoreCategory:r.value},children:a(O.Item,{value:r.value,children:a(J.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},r.value))})]})}),a(Eo,{category:q.find(r=>r.value===o)}),a(Mo,{})]})});ue.displayName="MobileScores";const Ro=Bt({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Io=Bt({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),To=x($e)`
105
- margin: 0;
106
- z-index: 1;
107
- position: relative;
108
- margin: 0 calc(-1 * ${p["--ll-spacing-medium"]});
109
- padding: 0 ${p["--ll-spacing-medium"]};
110
-
111
- &:hover {
112
- background-color: ${p["--ll-color-surface"]};
113
- box-shadow: ${p["--ll-shadow-small"]};
114
- }
115
- `,de=x(Se)`
116
- background: none;
117
- border: none;
118
- display: flex;
119
- align-items: center;
120
- width: 100%;
121
- padding: ${p["--ll-spacing-x-small"]} 0;
122
- `,zo=x(Le)`
123
- background-color: ${p["--ll-color-surface"]};
124
- position: relative;
125
- overflow: hidden;
126
- margin-left: calc(-1 * ${p["--ll-spacing-medium"]});
127
- margin-right: calc(-1 * ${p["--ll-spacing-medium"]});
128
-
129
- [data-state="open"] & {
130
- /* TODO: Re-implement this once StyledComponents is fixed. https://locallogic.atlassian.net/browse/LL22-1107 */
131
- /* animation: ${Ro} 300ms cubic-bezier(0.87, 0, 0.13, 1); */
132
- visibility: visible;
133
- }
134
-
135
- [data-state="closed"] & {
136
- /* TODO: Re-implement this once StyledComponents is fixed. https://locallogic.atlassian.net/browse/LL22-1107 */
137
- /* animation: ${Io} 300ms cubic-bezier(0.87, 0, 0.13, 1); */
138
- visibility: hidden;
139
- }
140
- `,Oo=x.div`
141
- padding: ${p["--ll-spacing-medium"]};
142
- border-top: 1px solid ${p["--ll-color-border"]};
143
- border-bottom: 1px solid ${p["--ll-color-border"]};
144
- `,Zo=x.span`
145
- ${de}[data-state=open] & {
146
- transform: rotate(90deg);
147
- } ;
148
- `;x.div`
149
- display: flex;
150
- align-items: flex-start;
151
- justify-content: space-between;
152
- `;const bt=x.div`
153
- margin: ${p["--ll-spacing-small"]} 0;
154
- `,Do=x.div`
155
- margin-top: ${p["--ll-spacing-large"]};
156
- &:empty {
157
- margin: 0;
158
- }
159
- `,Vo=({score:e})=>{const{data:t,isLoading:o}=Jt(),{activePOI:n,setActivePOI:r,hoveredPOI:s,setHoveredPOI:i}=A(),{mapRef:c,mapPadding:l}=ee();return o?a(Q,{children:[...Array(10)].map((u,d)=>a(bt,{children:a(X,{height:"34px",width:"100%"})},d))}):t?a(Ft.Root,{options:{type:"school",data:t==null?void 0:t[e],activePOI:n,hoveredPOI:s},onChange:u=>{var d;if(u.type==="poi-click"){const h=u.data;r(h);const g=window.innerWidth-l.left,f=window.innerWidth/2,y=g/2+l.left-f;h&&((d=c.current)==null||d.easeTo({zoom:18,center:[h.lng,h.lat],duration:1e3,offset:[y,0]}))}u.type==="poi-hover"&&i(u.data)}}):null},he=T.memo(({result:e,poi:t})=>{const{activePOI:o,setActivePOI:n,hoveredPOI:r,setHoveredPOI:s}=A(),{mapRef:i,mapPadding:c}=ee();return!e.data||!e.data[t]?null:a(ft.Content,{options:{value:t},children:a(Ft.Root,{options:{type:"poi",data:e.data[t],activePOI:o,hoveredPOI:r},onChange:l=>{var u;if(l.type==="poi-click"){const d=l.data;n(d);const h=window.innerWidth-c.left,g=window.innerWidth/2,f=h/2+c.left-g;d&&((u=i.current)==null||u.flyTo({zoom:18,center:[d.lng,d.lat],duration:1e3,offset:[f,0],essential:!0}))}l.type==="poi-hover"&&s(l.data)}})},t)});he.displayName="POI";const pe=T.memo(({include:e})=>{const t=Xt(),o=e==null?void 0:e.filter(n=>{var r;return(((r=t==null?void 0:t.data)==null?void 0:r[n])||[]).length>0});return t.isLoading&&o.length?a(Q,{children:[...Array(10)].map((n,r)=>a(bt,{children:a(X,{height:"34px",width:"100%"})},r))}):t.data?L(ft.Root,{options:{include:o},children:[a(ft.Tabs,{}),o.map(n=>a(he,{poi:n,result:t},n))]}):null});pe.displayName="POIs";const me=T.memo(({score:e,isLoading:t,scoresData:o})=>{var i,c;const{sdkState:n}=D(),{activeScore:r}=A(),s=e===r;return t?a(bt,{children:a(X,{height:"34px",width:"100%"},e)}):o!=null&&o.location[e]?a(ke,{value:e,children:L(E.Root,{options:{score:e,scoresData:o},children:[a(To,{children:L(de,{children:[a(Zo,{children:a(Kt,{SVGElement:Pe,fill:p["--ll-color-on-background-variant1"]})}),a(G,{spacing:"--ll-spacing-small"}),a(E.Icon,{}),a(G,{spacing:"--ll-spacing-small"}),a(E.Title,{}),a(G,{}),a(E.Badge,{options:{isPrimary:s}})]})}),a(zo,{children:L(Oo,{children:[a(E.Description,{}),a(G,{vertical:!0,spacing:"--ll-spacing-small"}),a(E.BarChart,{options:{renderNeighbourhoodAvg:!1,locationIcon:((c=(i=n.options)==null?void 0:i.marker)==null?void 0:c.icon)==="pin"?le:ce}}),a(Do,{children:e==="high_schools"||e==="primary_schools"?a(Vo,{score:e}):a(pe,{include:W[e]})})]})})]})},e):null});me.displayName="Score";const Ho=x.div`
160
- padding: ${p["--ll-spacing-small"]} ${p["--ll-spacing-medium"]};
161
- `,No=x.div`
162
- display: flex;
163
- justify-content: space-between;
164
- align-items: center;
165
- `,fe=T.memo(({tabContent:e})=>{const{data:t,isLoading:o,isFetching:n}=wt(e.scores),{translations:r}=st();return L(Ho,{children:[L(No,{children:[a(et.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),n&&!o&&a(Ne,{size:"small"})]}),a(G,{spacing:"--ll-spacing-small",vertical:!0}),!n&&!Object.keys((t==null?void 0:t.location)||{}).length&&a(K,{color:"--ll-color-on-background-variant1",children:r.EMPTY_TEXT}),e.scores.map(s=>a(me,{score:s,isLoading:o,scoresData:t},s))]})});fe.displayName="ScoreCategory";const ge=T.memo(({tabContent:e})=>{const{activeScore:t,setActiveScore:o}=A();return m.exports.useEffect(()=>{o(e.scores[0])},[]),a(Ee,{value:t,onValueChange:n=>{o(n)},type:"single",collapsible:!0,children:a(fe,{tabContent:e})})});ge.displayName="ScoreCategoryAccordion";const Go=x.div`
166
- overflow-y: auto;
167
- `,jo=x.div`
168
- position: absolute;
169
- top: ${p["--ll-spacing-medium"]};
170
- left: ${p["--ll-spacing-medium"]};
171
- width: 360px;
172
- max-height: calc(100% - 2 * ${p["--ll-spacing-medium"]});
173
- z-index: 1;
174
- border-radius: ${p["--ll-border-radius-medium"]};
175
- box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
176
- background-color: #fff;
177
- overflow: hidden;
178
- display: flex;
179
- flex-direction: column;
180
- background-color: ${p["--ll-color-background"]};
181
- border: 1px solid ${p["--ll-color-border"]};
182
- `;x.div`
183
- display: flex;
184
- justify-content: center;
185
- padding: ${p["--ll-spacing-small"]};
186
- `;const Uo=x.div`
187
- padding: ${p["--ll-spacing-xx-small"]};
188
- border-bottom: 1px solid ${p["--ll-color-border"]};
189
- `,Bo=x.div`
190
- display: flex;
191
- justify-content: center;
192
- padding: ${p["--ll-spacing-small"]};
193
- background-color: ${p["--ll-color-background"]};
194
- `,ye=()=>a(Bo,{children:a(Ge.Root,{})}),Ce=T.forwardRef((e,t)=>{const{activeCategory:o,setActiveCategory:n}=A();return a(et.Root,{options:{currentTab:o},onChange:r=>{n(r.data)},children:L(jo,{ref:t,children:[a(Uo,{children:a(et.Tabs,{})}),a(Go,{children:q.map(r=>a(et.Content,{options:{value:r.value},children:a(ge,{tabContent:r},r.value)},r.value))}),a(ye,{})]})})});Ce.displayName="DesktopScores";const Fo=x.div`
195
- position: relative;
196
- display: flex;
197
- flex-direction: column;
198
- height: 100vh;
199
- `,Ht=e=>m.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},m.exports.createElement("path",{d:"M22.4275 10.5938L13.4175 1.58383C12.6675 0.833834 11.3475 0.823834 10.5875 1.58383L1.58745 10.5838C0.807453 11.3638 0.807453 12.6238 1.58745 13.4038L10.5875 22.4038C10.9775 22.7938 11.4875 22.9838 11.9975 22.9838C12.5075 22.9838 13.0175 22.7938 13.4075 22.4038L22.3975 13.4138C23.1875 12.6538 23.1975 11.3938 22.4275 10.5938ZM12.0075 20.9938L3.00745 11.9938L12.0075 2.99383L21.0075 11.9938L12.0075 20.9938ZM7.99745 11.0038V15.0038H9.99745V12.0038H13.9975V14.5038L17.4975 11.0038L13.9975 7.50383V10.0038H8.99745C8.44745 10.0038 7.99745 10.4538 7.99745 11.0038Z"})),Ko=e=>m.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},m.exports.createElement("path",{d:"M13.5 5.5C14.6 5.5 15.5 4.6 15.5 3.5C15.5 2.4 14.6 1.5 13.5 1.5C12.4 1.5 11.5 2.4 11.5 3.5C11.5 4.6 12.4 5.5 13.5 5.5ZM9.8 8.9L7 23H9.1L10.9 15L13 17V23H15V15.5L12.9 13.5L13.5 10.5C14.8 12 16.8 13 19 13V11C17.1 11 15.5 10 14.7 8.6L13.7 7C13.14 6.11 12.02 5.75 11.05 6.16L6 8.3V13H8V9.6L9.8 8.9Z"})),Wo=e=>m.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},m.exports.createElement("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5H6.5C5.84 5 5.29 5.42 5.08 6.01L3 12V20C3 20.55 3.45 21 4 21H5C5.55 21 6 20.55 6 20V19H18V20C18 20.55 18.45 21 19 21H20C20.55 21 21 20.55 21 20V12L18.92 6.01ZM6.85 7H17.14L18.22 10.11H5.77L6.85 7ZM19 17H5V12H19V17Z"}),m.exports.createElement("path",{d:"M7.5 16C8.32843 16 9 15.3284 9 14.5C9 13.6716 8.32843 13 7.5 13C6.67157 13 6 13.6716 6 14.5C6 15.3284 6.67157 16 7.5 16Z"}),m.exports.createElement("path",{d:"M16.5 16C17.3284 16 18 15.3284 18 14.5C18 13.6716 17.3284 13 16.5 13C15.6716 13 15 13.6716 15 14.5C15 15.3284 15.6716 16 16.5 16Z"})),Yo=e=>m.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},m.exports.createElement("path",{d:"M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10s10-4.47,10-10S17.53,2,12,2z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59 L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59z"})),qo=x.div`
200
- max-height: calc(100% - 2 * ${p["--ll-spacing-medium"]});
201
- border-radius: ${p["--ll-border-radius-medium"]};
202
- box-shadow: ${p["--ll-shadow-small"]};
203
- background-color: ${p["--ll-color-background"]};
204
- border: 1px solid ${p["--ll-color-border"]};
205
- padding: ${p["--ll-spacing-x-small"]};
206
- `,Qo=x.div`
207
- display: flex;
208
- justify-content: space-between;
209
- align-items: end;
210
-
211
- ${Ae} {
212
- // Adjust if text of commute transport mode changes
213
- width: 52%;
214
- margin-right: ${p["--ll-spacing-x-small"]};
215
- }
216
- `,Nt=x.div`
217
- background-color: ${p["--ll-color-surface"]};
218
- padding: ${p["--ll-spacing-x-small"]} ${p["--ll-spacing-small"]} 0;
219
- border-radius: ${p["--ll-border-radius-medium"]};
220
- `,Xo=x(Wt)`
221
- position: absolute;
222
- right: ${p["--ll-spacing-xx-small"]};
223
- top: ${p["--ll-spacing-xx-small"]};
224
- `,xe=({className:e,onClose:t})=>{var $,b,w,S;const{sdkState:o}=D(),{setCommuteGeojson:n,destination:r,setDestination:s}=A(),[i,c]=m.exports.useState("pedestrian"),l=vt(),{translations:u}=st(),{data:d,isFetching:h,isFetched:g}=ie({destination:r,transportMode:i,origin:`${(b=($=o==null?void 0:o.options)==null?void 0:$.marker)==null?void 0:b.lat},${(S=(w=o==null?void 0:o.options)==null?void 0:w.marker)==null?void 0:S.lng}`,isOpen:!0});m.exports.useEffect(()=>{!(d!=null&&d.summary)||n(mt.polyline.decode(d.polyline))},[d]);const f={pedestrian:[u.WALKING,Ko],car:[u.DRIVING,Wo]},y=m.exports.useMemo(()=>{if(!(d!=null&&d.summary))return null;const v=Math.floor(d.summary.typicalDuration/60/60),P=Math.floor(d.summary.typicalDuration/60%60);return v===0?`${P} ${j.pluralize(u.MINUTE,P)}`:`${v} ${j.pluralize(u.HOUR,v)} ${P} ${j.pluralize(u.MINUTE,P)}`},[d]),M=m.exports.useMemo(()=>{if(!(d!=null&&d.summary))return null;const v=Math.floor(d.summary.length/1e3);return v===0?`${d.summary.length} m`:`${v} km`},[d]),C=()=>h?a(X,{height:"70.4px",width:"100%"}):d!=null&&d.summary?L(Nt,{children:[a(K,{variant:"h5",children:y}),L(K,{children:[M," \u2013 ",u.FAST_ROUTE]})]}):L(Nt,{children:[a(K,{variant:"h5",children:u.NO_ROUTE}),a(K,{children:u.TRY_SUGGESTION})]});return L(qo,{className:e,children:[a(Xo,{size:"medium",color:"neutral",onClick:t,SVGElement:Yo}),L(Qo,{children:[a(_e,{label:u.CALCULATE_COMMUTE,placeholder:(r==null?void 0:r.label)||u.SEARCH_MAP,renderListAbove:l,renderListAbovePosition:30,onSearch:v=>{s({lat:v.latitude,lng:v.longitude})}}),a(O.Root,{value:i,onValueChange:v=>{c(v)},children:L(O.Trigger,{children:[a(Kt,{SVGElement:f[i][1],fill:p["--ll-color-on-background-variant1"],width:16}),f[i][0],L(O.Content,{children:[a(O.Item,{value:"car",children:u.DRIVING}),a(O.Item,{value:"pedestrian",children:u.WALKING})]})]})})]}),(g||h)&&L(Q,{children:[a(G,{vertical:!0,spacing:"--ll-spacing-x-small"}),a(Re,{open:!!d,children:C()})]})]})},Jo=x.div`
225
- position: absolute;
226
- bottom: 0;
227
- right: 0;
228
- left: 0;
229
- z-index: 3;
230
- `,tn=x.div`
231
- position: absolute;
232
- top: ${p["--ll-spacing-medium"]};
233
- right: ${p["--ll-spacing-medium"]};
234
- z-index: 3;
235
- max-width: 356px;
236
- `,en=x(Wt)`
237
- box-shadow: ${p["--ll-shadow-medium"]};
238
- position: absolute;
239
- bottom: ${p["--ll-spacing-medium"]};
240
- right: ${p["--ll-spacing-medium"]};
241
- `,on=x(xe)``,nn=x(xe)`
242
- border-radius: ${p["--ll-border-radius-small"]}
243
- ${p["--ll-border-radius-small"]} 0 0;
244
- border: 0;
245
- `,rn=x(je)`
246
- box-shadow: ${p["--ll-shadow-small"]};
247
- `,sn=()=>{const{setCommuteGeojson:e,setDestination:t,showCommuteCalculator:o,setShowCommuteCalculator:n}=A(),{translations:r}=st(),s=vt(),i=()=>{t(void 0),e(void 0),n(!1)},c=()=>{n(!0)};return s?a(Q,{children:o?a(Jo,{children:a(nn,{onClose:i})}):a(en,{size:"large",SVGElement:Ht,onClick:c})}):a(tn,{children:o?a(on,{onClose:i}):a(rn,{onClick:c,startAdornment:a(Ht,{}),children:r.CALCULATE_COMMUTE})})},an=()=>{var Mt,$t,St;const{sdkState:e,setSdkState:t}=D(),{activeScore:o,activePOI:n,setActivePOI:r,hoveredPOI:s,commuteGeojson:i,destination:c,schoolCatchment:l}=A(),u=vt(),d=Xt(),h=Jt(),g=(($t=(Mt=e==null?void 0:e.globalOptions)==null?void 0:Mt.appearance)==null?void 0:$t.theme)==="night"?"dd191599-2a92-49fc-9a33-e12391753ad5":"600d69cb-288d-445e-9839-3dfe4d76b31a",y={id:"point",type:"line",paint:{"line-width":6,"line-color":getComputedStyle(document.documentElement).getPropertyValue("--ll-color-link")}},C={id:"school",type:"line",source:"schoolCatchment",paint:{"line-width":3,"line-color":getComputedStyle(document.documentElement).getPropertyValue("--ll-color-on-background")}},[$,b]=m.exports.useState(!1),w=m.exports.useMemo(()=>{var k,_;return(o==="high_schools"||o==="primary_schools")&&!h.isFetching?{[o]:((k=h==null?void 0:h.data)==null?void 0:k[o])||[]}:!(W&&o&&W[o]&&((_=W[o])==null?void 0:_.length))&&!d.isFetching?{[o]:[]}:d.data},[d.data,h.data,o]),S=m.exports.useMemo(()=>w?Object.entries(w).map(([_,Z])=>Z.map(I=>ht([I.lng,I.lat],{poi:I,type:_}))).flat().filter((_,Z,I)=>I.findIndex(ct=>["lat","lng","name"].every(B=>ct.properties.poi[B]===_.properties.poi[B]))===Z):[],[w]),v=m.exports.useMemo(()=>{var _,Z,I;const k=((_=e==null?void 0:e.options)==null?void 0:_.marker)&&ht([(Z=e==null?void 0:e.options)==null?void 0:Z.marker.lng,(I=e==null?void 0:e.options)==null?void 0:I.marker.lat]);return[...S,...k?[k]:[],...c?[ht([c==null?void 0:c.lng,c==null?void 0:c.lat])]:[]]},[S,(St=e==null?void 0:e.options)==null?void 0:St.marker,c]),P=m.exports.useRef(),[U,z]=Ie(),R=m.exports.useMemo(()=>({top:25+z.height,bottom:25,left:25,right:25}),[z.height]),H=m.exports.useMemo(()=>({top:50,bottom:50,left:z.width+32+50,right:50}),[z.width]),lt=u?R:H,ve=k=>{t({...e,options:{...e.options,lat:k.viewState.latitude,lng:k.viewState.longitude,zoom:k.viewState.zoom,bearing:k.viewState.bearing,pitch:k.viewState.pitch}})};return m.exports.useEffect(()=>{var B,Lt;if(!v.length||!((B=e.options)!=null&&B.marker))return;const k=Xe(v.map(({geometry:kt})=>[kt.coordinates[1],kt.coordinates[0]])),[_,Z,I,ct]=gt(k);(Lt=P==null?void 0:P.current)==null||Lt.fitBounds([[Z,_],[ct,I]],{maxZoom:17,padding:lt,duration:1e3})},[v,lt,l]),e.options?a(Je,{mapRef:P,mapPadding:lt,children:L(Fo,{children:[L(Te,{ref:P,mapLib:ze,latitude:e.options.lat,longitude:e.options.lng,zoom:e.options.zoom,pitch:e.options.pitch,bearing:e.options.bearing,style:{flex:1,width:"100vw"},mapStyle:`https://api.maptiler.com/maps/${g}/style.json?key=9jNGatuzs05Q1oNlctEs`,onMove:ve,cooperativeGestures:e.options.cooperativeGestures,onMoveStart:()=>b(!0),onMoveEnd:()=>b(!1),attributionControl:!1,children:[a(Oe,{compact:!0,position:u?"bottom-left":"bottom-right"}),a(Ze,{position:u?"top-right":"bottom-right",showCompass:!0,style:{marginTop:u?16+z.height:16,marginRight:16}}),e.options.marker&&a(Pt,{marker:e.options.marker}),a(ae,{rect:z,zoom:e.options.zoom,mapRef:P,points:S,isMobile:u,activePOI:n,hoveredPOI:s,isMapMoving:$,setActivePOI:r}),u?a(ue,{ref:U}):a(Ce,{ref:U}),a(sn,{}),c&&a(Pt,{marker:{icon:"pin",...c}}),i&&a(Et,{type:"geojson",data:i,children:a(At,{...y})}),l&&a(Et,{type:"geojson",data:l,children:a(At,{...C})})]}),u&&a(ye,{})]})}):a("div",{children:"No options provided."})},hn=()=>a(Be,{children:a(an,{})});export{hn as default};
@@ -1 +0,0 @@
1
- const o={RADIUS:"Radius",LIMIT:"Limit",EXPORT:"Export",SEARCH_MAP:"Search map..."},i={LOCATION:"Location",SCORES:"Scores",POIS:"Points of interest",SCHOOLS:"Schools",DEMOGRAPHICS:"Demographics",PROFILES:"Profiles"},t={LOCATION_TEXT:"Set the location for your data query. Long-press on the map to move the pin.",SCORES_TEXT:"Configure Local Logic Scores for your specified location.",POIS_TEXT:"Configure Local Logic Points of Interest (POIs) for your specified location.",SCHOOLS_TEXT:"Configure Local Logic Schools for your specified location.",DEMOGRAPHICS_TEXT:"Configure Local Logic Demographics for your specified location.",PROFILES_TEXT:"Local Profiles returns qualitative and localized information for your specified location."},e={...o,...i,...t};export{e as translations};
@@ -1 +0,0 @@
1
- const e={RADIUS:"Rayon",LIMIT:"Limite",EXPORT:"Exporter",SEARCH_MAP:"Recherchez..."},o={LOCATION:"Emplacement",SCORES:"Scores",POIS:"Points d'inter\xEAt",SCHOOLS:"\xC9coles",DEMOGRAPHICS:"D\xE9mographie",PROFILES:"Profils"},r={LOCATION_TEXT:"Sp\xE9cifiez l'emplacement pour votre requ\xEAte. Appuyez longtemps sur la carte pour bouger le curseur.",SCORES_TEXT:"Configurez les Scores Local Logic pour l'emplacement d\xE9sir\xE9.",POIS_TEXT:"Configurez les Points d'Inter\xEAt Local Logic pour l'emplacement d\xE9sir\xE9.",SCHOOLS_TEXT:"Configurez les \xC9coles Local Logic pour l'emplacement d\xE9sir\xE9.",DEMOGRAPHICS_TEXT:"Configurez les D\xE9mographiques Local Logic pour l'emplacement d\xE9sir\xE9.",PROFILES_TEXT:"Les Profils Locaux retournent des donn\xE9es qualitatives et localis\xE9es pour l'emplacement desir\xE9."},s={...e,...o,...r};export{s as translations};