1import R,{createContext as Bs,useContext as oe,useState as y,useRef as he,useEffect as g,useMemo as Ue,PureComponent as se,Children as ve,isValidElement as $s,cloneElement as Fs,memo as le,createRef as jt,useCallback as rn}from"react";import*as zs from"react-dom";import pi,{createPortal as yt}from"react-dom";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=t(i);fetch(i.href,r)}})();var Vs,on=pi;Vs=on.createRoot,on.hydrateRoot;const _=n=>typeof n=="string",Ie=()=>{let n,e;const t=new Promise((s,i)=>{n=s,e=i});return t.resolve=n,t.reject=e,t},an=n=>n==null?"":""+n,gi=(n,e,t)=>{n.forEach(s=>{e[s]&&(t[s]=e[s])})},hi=/###/g,ln=n=>n&&n.indexOf("###")>-1?n.replace(hi,"."):n,un=n=>!n||_(n),Ne=(n,e,t)=>{const s=_(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(un(n))return{};const r=ln(s[i]);!n[r]&&t&&(n[r]=new t),Object.prototype.hasOwnProperty.call(n,r)?n=n[r]:n={},++i}return un(n)?{}:{obj:n,k:ln(s[i])}},cn=(n,e,t)=>{const{obj:s,k:i}=Ne(n,e,Object);if(s!==void 0||e.length===1){s[i]=t;return}let r=e[e.length-1],o=e.slice(0,e.length-1),a=Ne(n,o,Object);for(;a.obj===void 0&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=Ne(n,o,Object),a&&a.obj&&typeof a.obj[`${a.k}.${r}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=t},fi=(n,e,t,s)=>{const{obj:i,k:r}=Ne(n,e,Object);i[r]=i[r]||[],i[r].push(t)},rt=(n,e)=>{const{obj:t,k:s}=Ne(n,e);if(t)return t[s]},mi=(n,e,t)=>{const s=rt(n,t);return s!==void 0?s:rt(e,t)},Hs=(n,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in n?_(n[s])||n[s]instanceof String||_(e[s])||e[s]instanceof String?t&&(n[s]=e[s]):Hs(n[s],e[s],t):n[s]=e[s]);return n},Me=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vi={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const yi=n=>_(n)?n.replace(/[&<>"'\/]/g,e=>vi[e]):n;class Li{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const bi=[" ",",","?","!",";"],Ci=new Li(20),wi=(n,e,t)=>{e=e||"",t=t||"";const s=bi.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(s.length===0)return!0;const i=Ci.getRegExp(`(${s.map(o=>o==="?"?"\\?":o).join("|")})`);let r=!i.test(n);if(!r){const o=n.indexOf(t);o>0&&!i.test(n.substring(0,o))&&(r=!0)}return r},kt=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[e])return n[e];const s=e.split(t);let i=n;for(let r=0;r<s.length;){if(!i||typeof i!="object")return;let o,a="";for(let l=r;l<s.length;++l)if(l!==r&&(a+=t),a+=s[l],o=i[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<s.length-1)continue;r+=l-r+1;break}i=o}return i},ot=n=>n&&n.replace("_","-"),xi={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console&&console[n]&&console[n].apply(console,e)}};class at{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||xi,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,i){return i&&!this.debug?null:(_(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new at(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new at(this.logger,e)}}var fe=new at;class Lt{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(t)||0;this.observers[s].set(t,i+1)}),this}
1off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[a,l]=o;for(let u=0;u<l;u++)a(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,l]=o;for(let u=0;u<l;u++)a.apply(a,[e,...s])})}}class dn extends Lt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],s&&(Array.isArray(s)?a.push(...s):_(s)&&r?a.push(...s.split(r)):a.push(s)));const l=rt(this.data,a);return!l&&!t&&!s&&e.indexOf(".")>-1&&(e=a[0],t=a[1],s=a.slice(2).join(".")),l||!o||!_(s)?l:kt(this.data&&this.data[e]&&this.data[e][t],s,r)}addResource(e,t,s,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(a=e.split("."),i=t,t=a[1]),this.addNamespaces(t),cn(this.data,a,i),r.silent||this.emit("added",e,t,s,i)}addResources(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in s)(_(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,r){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),i=s,s=t,t=a[1]),this.addNamespaces(t);let l=rt(this.data,a)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?Hs(l,s,r):l={...l,...s},cn(this.data,a,l),o.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var Zs={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,s,i){return n.forEach(r=>{this.processors[r]&&(e=this.processors[r].process(e,t,s,i))}),e}};const pn={};class lt extends Lt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),gi(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
1i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=fe.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const s=this.resolve(e,t);return s&&s.res!==void 0}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const o=s&&e.indexOf(s)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!wi(e,s,i);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:_(r)?[r]:r};const u=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(u[0])>-1)&&(r=u.shift()),e=u.join(i)}return{key:e,namespaces:_(r)?[r]:r}}translate(e,t,s){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,r=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],u=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const L=t.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${L}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${L}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let p=d&&d.res;const f=d&&d.usedKey||o,h=d&&d.exactUsedKey||o,w=Object.prototype.toString.apply(p),m=["[object Number]","[object Function]","[object RegExp]"],E=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,P=!_(p)&&typeof p!="boolean"&&typeof p!="number";if(x&&p&&P&&m.indexOf(w)<0&&!(_(E)&&Array.isArray(p))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,p,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(d.res=L,d.usedParams=this.getUsedParamsDetails(t),d):L}if(r){const L=Array.isArray(p),v=L?[]:{},b=L?h:f;for(const S in p)if(Object.prototype.hasOwnProperty.call(p,S)){const k=`${b}${r}${S}`;v[S]=this.translate(k,{...t,joinArrays:!1,ns:a}),v[S]===k&&(v[S]=p[S])}p=v}}else if(x&&_(E)&&Array.isArray(p))p=p.join(E),p&&(p=this.extendTranslation(p,e,t,s));else{let L=!1,v=!1;const b=t.count!==void 0&&!_(t.count),S=lt.hasDefaultValue(t),k=b?this.pluralResolver.getSuffix(u,t.count,t):"",M=t.ordinal&&b?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",I=b&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),D=I&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${k}`]||t[`defaultValue${M}`]||t.defaultValue;!this.isValidLookup(p)&&S&&(L=!0,p=D),this.isValidLookup(p)||(v=!0,p=o);const W=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&v?void 0:p,T=S&&D!==p&&this.options.updateMissing;if(v||L||T){if(this.logger.log(T?"updateKey":"missingKey",u,l,o,T?D:p),r){const N=this.resolve(o,{...t,keySeparator:!1});N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let j=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let N=0;N<V.length;N++)j.push(V[N]);else this.options.saveMissingTo==="all"?j=this.languageUtils.toResolveHierarchy(t.lng||this.language):j.push(t.lng||this.language);const Q=(N,K,z)=>{const J=S&&z!==p?z:W;this.options.missingKeyHandler?this.options.missingKeyHandler(N,l,K,J,T,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(N,l,K,J,T,t),this.emit
1("missingKey",N,l,K,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?j.forEach(N=>{const K=this.pluralResolver.getSuffixes(N,t);I&&t[`defaultValue${this.options.pluralSeparator}zero`]&&K.indexOf(`${this.options.pluralSeparator}zero`)<0&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(z=>{Q([N],o+z,t[`defaultValue${z}`]||D)})}):Q(j,o,D))}p=this.extendTranslation(p,e,t,d,s),v&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${o}`),(v||L)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,L?p:void 0):p=this.options.parseMissingKeyHandler(p))}return i?(d.res=p,d.usedParams=this.getUsedParamsDetails(t),d):p}extendTranslation(e,t,s,i,r){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const u=_(e)&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const p=e.match(this.interpolator.nestingRegexp);c=p&&p.length}let d=s.replace&&!_(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,s.lng||this.language||i.usedLng,s),u){const p=e.match(this.interpolator.nestingRegexp),f=p&&p.length;c<f&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var p=arguments.length,f=new Array(p),h=0;h<p;h++)f[h]=arguments[h];return r&&r[0]===f[0]&&!s.context?(o.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`),null):o.translate(...f,t)},s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,l=_(a)?[a]:a;return e!=null&&l&&l.length&&s.applyPostProcessor!==!1&&(e=Zs.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,i,r,o,a;return _(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(l,t),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const p=t.count!==void 0&&!_(t.count),f=p&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),h=t.context!==void 0&&(_(t.context)||typeof t.context=="number")&&t.context!=="",w=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);d.forEach(m=>{this.isValidLookup(s)||(a=m,!pn[`${w[0]}-${m}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(pn[`${w[0]}-${m}`]=!0,this.logger.warn(`key "${i}" for languages "${w.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(E=>{if(this.isValidLookup(s))return;o=E;const x=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(x,c,E,m,t);else{let L;p&&(L=this.pluralResolver.getSuffix(E,t.count,t));const v=`${this.options.pluralSeparator}zero`,b=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(x.push(c+L),t.ordinal&&L.indexOf(b)===0&&x.push(c+L.replace(b,this.options.pluralSeparator)),f&&x.push(c+v)),h){const S=`${c}${this.options.contextSeparator}${t.context}`;x.push(S),p&&(x.push(S+L),t.ordinal&&L.indexOf(b)===0&&x.push(S+L.replace(b,this.options.pluralSeparator)),f&&x.push(S+v))}}let P;for(;P=x.pop();)this.isValidLookup(s)||(r=P,s=this.getResource(E,m,P,t))}))})}),{res:s,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!_(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const r of t)delete i[r]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}const Ct=n=>n.charAt(0).toUpperCase()+n.slice(1);class gn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fe.create("languageUtils")}getScriptPartFromCode(e){if(e=ot(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=ot(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(_(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(e)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(i=>i.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=Ct(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=Ct(s[1].toLowerCase())),t.indexOf(s[2].toLowerCase())>-1&&(s[2]=Ct(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(r=>{if(r===i)return r;if(!(r.indexOf("-")<0&&i.indexOf("-")<0)&&(r.indexOf("-")>0&&i.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===i||r.indexOf(i)===0&&i.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),_(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];
1return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return _(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):_(e)&&r(this.formatLanguageCode(e)),s.forEach(o=>{i.indexOf(o)<0&&r(this.formatLanguageCode(o))}),i}}let Mi=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Oi={1:n=>+(n>1),2:n=>+(n!=1),3:n=>0,4:n=>n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,5:n=>n==0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5,6:n=>n==1?0:n>=2&&n<=4?1:2,7:n=>n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,8:n=>n==1?0:n==2?1:n!=8&&n!=11?2:3,9:n=>+(n>=2),10:n=>n==1?0:n==2?1:n<7?2:n<11?3:4,11:n=>n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3,12:n=>+(n%10!=1||n%100==11),13:n=>+(n!==0),14:n=>n==1?0:n==2?1:n==3?2:3,15:n=>n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2,16:n=>n%10==1&&n%100!=11?0:n!==0?1:2,17:n=>n==1||n%10==1&&n%100!=11?0:1,18:n=>n==0?0:n==1?1:2,19:n=>n==1?0:n==0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3,20:n=>n==1?0:n==0||n%100>0&&n%100<20?1:2,21:n=>n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0,22:n=>n==1?0:n==2?1:(n<0||n>10)&&n%10==0?2:3};const Si=["v1","v2","v3"],Ei=["v4"],hn={zero:0,one:1,two:2,few:3,many:4,other:5},ki=()=>{const n={};return Mi.forEach(e=>{e.lngs.forEach(t=>{n[t]={numbers:e.nr,plurals:Oi[e.fc]}})}),n};class Pi{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=fe.create("pluralResolver"),(!this.options.compatibilityJSON||Ei.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=ki(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const s=ot(e==="dev"?"en":e),i=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let o;try{o=new Intl.PluralRules(s,{type:i})}catch{if(!e.match(/-|_/))return;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,t)}return this.pluralRulesCache[r]=o,o}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};
1return this.getSuffixes(e,s).map(i=>`${t}${i}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((i,r)=>hn[i]-hn[r]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):s.numbers.map(i=>this.getSuffix(e,i,t)):[]}getSuffix(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,s);return i?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:this.getSuffixRetroCompatible(i,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const s=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let i=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const r=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?r():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}
1shouldUseIntlApi(){return!Si.includes(this.options.compatibilityJSON)}}const fn=function(n,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=mi(n,e,t);return!r&&i&&_(t)&&(r=kt(n,t,s),r===void 0&&(r=kt(e,t,s))),r},wt=n=>n.replace(/\$/g,"$$$$");class Di{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=fe.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:r,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:p,nestingPrefixEscaped:f,nestingSuffix:h,nestingSuffixEscaped:w,nestingOptionsSeparator:m,maxReplaces:E,alwaysFormat:x}=e.interpolation;this.escape=t!==void 0?t:yi,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=r?Me(r):o||"{{",this.suffix=a?Me(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?Me(p):f||Me("$t("),this.nestingSuffix=h?Me(h):w||Me(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=E||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t&&t.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,s,i){let r,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=f=>{if(f.indexOf(this.formatSeparator)<0){const E=fn(t,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,s,{...i,...t,interpolationkey:f}):E}const h=f.split(this.formatSeparator),w=h.shift().trim(),m=h.join(this.formatSeparator).trim();return this.format(fn(t,l,w,this.options.keySeparator,this.options.ignoreJSONStructure),m,s,{...i,...t,interpolationkey:w})};this.resetRegExp();const c=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>wt(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?wt(this.escape(f)):wt(f)}].forEach(f=>{for(a=0;r=f.regex.exec(e);){const h=r[1].trim();if(o=u(h),o===void 0)if(typeof c=="function"){const m=c(e,r,i);o=_(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,h))o="";else if(d){o=r[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${e}`),o="";else!_(o)&&!this.useRawValueToEscape&&(o=an(o));const w=f.safeValue(o);if(e=e.replace(r[0],w),d?(f.regex.lastIndex+=o.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,r,o;const a=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let p=`{${d[1]}`;l=d[0],p=this.interpolate(p,o);const f=p.match(/'/g),h=p.match(/"/g);(f&&f.length%2===0&&!h||h.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),u&&(o={...u,...o})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,w),`${l}${c}${p}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...s},o=o.replace&&!_(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(r=t(a.call(this,i[1].trim(),o),o),r&&i[0]===e&&!_(r))return r;_(r)||(r=an(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),u&&(r=l.reduce((c,d)=>this.format(c,d,s.lng,{...s,interpolationkey:i[1].trim()}),r.trim())),e=e.replace(i[0],r),this.regexp.lastIndex=0}return e}}const Ii=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const s=n.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();t[c]||(t[c]=u),u==="false"&&(t[c]=!1),u==="true"&&(t[c]=!0),isNaN(u)||(t[c]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},Oe=n=>{const e={};return(t,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const o=s+JSON.stringify(r);let a=e[o];return a||(a=n(ot(s),i),e[o]=a),a(t)}};class Ri{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=fe.create("formatter"),this.options=e,this.formats={number:Oe((t,s)=>{const i=new Intl.NumberFormat(t,{...s});return r=>i.format(r)}),currency:Oe((t,s)=>{const i=new Intl.NumberFormat(t,{...s,style:"currency"});return r=>i.format(r)}),datetime:Oe((t,s)=>{const i=new Intl.DateTimeFormat(t,{...s});return r=>i.format(r)}),relativetime:Oe((t,s)=>{const i=new Intl.RelativeTimeFormat(t,{...s});return r=>i.format(r,s.range||"day")}),list:Oe((t,s)=>{const i=new Intl.ListFormat(t,{...s});return r=>i.format(r)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Oe(t)}
1format(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(a=>a.indexOf(")")>-1)){const a=r.findIndex(l=>l.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,a)].join(this.formatSeparator)}return r.reduce((a,l)=>{const{formatName:u,formatOptions:c}=Ii(l);if(this.formats[u]){let d=a;try{const p=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},f=p.locale||p.lng||i.locale||i.lng||s;d=this.formats[u](a,f,{...c,...i,...p})}catch(p){this.logger.warn(p)}return d}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}const Ti=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class ji extends Lt{constructor(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=fe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,i.backend,i)}queueLoad(e,t,s,i){const r={},o={},a={},l={};return e.forEach(u=>{let c=!0;t.forEach(d=>{const p=`${u}|${d}`;!s.reload&&this.store.hasResourceBundle(u,d)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,c=!1,o[p]===void 0&&(o[p]=!0),r[p]===void 0&&(r[p]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(a[u]=!0)}),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const i=e.split("|"),r=i[0],o=i[1];t&&this.emit("failedLoading",r,o,t),!t&&s&&this.store.addResourceBundle(r,o,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const a={};this.queue.forEach(l=>{fi(l.loaded,[r],o),Ti(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{a[u][d]===void 0&&(a[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:r,callback:o});return}this.readingCalls++;const a=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,i+1,r*2,o)},r);return}o(u,c)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(e,t,a)}prepareLoading(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();_(e)&&(e=this.languageUtils.toResolveHierarchy(e)),_(t)&&(t=[t]);const r=this.queueLoad(e,t,s,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=e.split("|"),i=s[0],r=s[1];this.read(i,r,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${r} for language ${i}`,a),this.loaded(e,o,a)})}saveMissing(e,t,s,i,r){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,t,s,i,l):c=u(e,t,s,i),c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}else u(e,t,s,i,a,l)}!e||!e[0]||this.store.addResource(e[0],t,s,i)}}}const mn=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),_(n[1])&&(e.defaultValue=n[1]),_(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),vn=n=>(_(n.ns)&&(n.ns=[n.ns]),_(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),_(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs&&n.supportedLngs.indexOf("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),n),tt=()=>{},Ni=n=>
1{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class _e extends Lt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=vn(e),this.services={},this.logger=fe,this.modules={external:[]},Ni(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(_(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=mn();this.options={...i,...this.options,...vn(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?fe.init(r(this.modules.logger),this.options):fe.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Ri);const d=new gn(this.options);this.store=new dn(this.options.resources,this.options);const p=this.services;p.logger=fe,p.resourceStore=this.store,p.languageUtils=d,p.pluralResolver=new Pi(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=r(c),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new Di(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new ji(r(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(f){for(var h=arguments.length,w=new Array(h>1?h-1:0),m=1;m<h;m++)w[m-1]=arguments[m];e.emit(f,...w)}),this.modules.languageDetector&&(p.languageDetector=r(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=r(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new lt(this.services,this.options),this.translator.on("*",function(f){for(var h=arguments.length,w=new Array(h>1?h-1:0),m=1;m<h;m++)w[m-1]=arguments[m];e.emit(f,...w)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,s||(s=tt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=function(){return e.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return e.store[c](...arguments),e}});const l=Ie(),u=()=>{const c=(d,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(p),s(d,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tt;const i=_(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],o=a=>{if(!a||a==="cimode")return;
1this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&r.indexOf(u)<0&&r.push(u)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(r,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(a)})}else s(null)}reloadResources(e,t,s){const i=Ie();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=tt),this.services.backendConnector.reload(e,t,r=>{i.resolve(),s(r)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Zs.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const i=Ie();this.emit("languageChanging",e);const r=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?(r(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return s.t(...arguments)}),t&&t(l,function(){return s.t(...arguments)})},a=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const u=_(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{o(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),i}getFixedT(e,t,s){var i=this;const r=function(o,a){let l;if(typeof a!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d<u;d++)c[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([o,a].concat(c))}else l={...a};l.lng=l.lng||r.lng,l.lngs=l.lngs||r.lngs,l.ns=l.ns||r.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||s||r.keyPrefix);const p=i.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(o)?f=o.map(h=>`${l.keyPrefix}${p}${h}`):f=l.keyPrefix?`${l.keyPrefix}${p}${o}`:o,i.t(f,l)};return _(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=s,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
1if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(s,e)&&(!i||o(r,e)))}loadNamespaces(e,t){const s=Ie();return this.options.ns?(_(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),t&&t(i)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=Ie();_(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return r.length?(this.options.preload=i.concat(r),this.loadResources(o=>{s.resolve(),t&&t(o)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new gn(mn());return t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new _e(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tt;const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},r=new _e(i);return(e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(a=>{r[a]=this[a]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s&&(r.store=new dn(this.store.data,i),r.services.resourceStore=r.store),r.translator=new lt(r.services,i),r.translator.on("*",function(a){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];r.emit(a,...u)}),r.init(i,t),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ue=_e.createInstance();ue.createInstance=_e.createInstance;ue.createInstance;ue.dir;ue.init;ue.loadResources;ue.reloadResources;ue.use;ue.changeLanguage;ue.getFixedT;ue.t;ue.exists;ue.setDefaultNamespace;ue.hasLoadedNamespace;ue.loadNamespaces;ue.loadLanguages;function Ai(){if(console&&console.warn){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];typeof e[0]=="string"&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const yn={};function Pt(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];typeof e[0]=="string"&&yn[e[0]]||(typeof e[0]=="string"&&(yn[e[0]]=new Date),Ai(...e))}const Ws=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}};function Ln(n,e,t){n.loadNamespaces(e,Ws(n,t))}function bn(n,e,t,s){typeof t=="string"&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,Ws(n,s))}function Ui(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=e.languages[0],i=e.options?e.options.fallbackLng:!1,r=e.languages[e.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const u=e.services.backendConnector.state[`${a}|${l}`];return u===-1||u===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(s,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(s,n)&&(!i||o(r,n)))}function _i(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};
1return!e.languages||!e.languages.length?(Pt("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,r)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,n))return!1}}):Ui(n,e,t)}const Bi=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,$i={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Fi=n=>$i[n],zi=n=>n.replace(Bi,Fi);let Dt={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:zi};function Vi(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dt={...Dt,...n}}function Hi(){return Dt}let Ks;function Zi(n){Ks=n}function Wi(){return Ks}const Ki={type:"3rdParty",init(n){Vi(n.options.react),Zi(n)}},Gi=Bs();class Ji{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const qi=(n,e)=>{const t=he();return g(()=>{t.current=n},[n,e]),t.current};function xe(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:t}=e,{i18n:s,defaultNS:i}=oe(Gi)||{},r=t||s||Wi();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new Ji),!r){Pt("You will need to pass in an i18next instance by using initReactI18next");const P=(v,b)=>typeof b=="string"?b:b&&typeof b=="object"&&typeof b.defaultValue=="string"?b.defaultValue:Array.isArray(v)?v[v.length-1]:v,L=[P,{},!1];return L.t=P,L.i18n={},L.ready=!1,L}r.options.react&&r.options.react.wait!==void 0&&Pt("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...Hi(),...r.options.react,...e},{useSuspense:a,keyPrefix:l}=o;let u=i||r.options&&r.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(u);const c=(r.isInitialized||r.initializedStoreOnce)&&u.every(P=>_i(P,r,o));function d(){return r.getFixedT(e.lng||null,o.nsMode==="fallback"?u:u[0],l)}const[p,f]=y(d);let h=u.join();e.lng&&(h=`${e.lng}${h}`);const w=qi(h),m=he(!0);g(()=>{const{bindI18n:P,bindI18nStore:L}=o;m.current=!0,!c&&!a&&(e.lng?bn(r,e.lng,u,()=>{m.current&&f(d)}):Ln(r,u,()=>{m.current&&f(d)})),c&&w&&w!==h&&m.current&&f(d);function v(){m.current&&f(d)}return P&&r&&r.on(P,v),L&&r&&r.store.on(L,v),()=>{m.current=!1,P&&r&&P.split(" ").forEach(b=>r.off(b,v)),L&&r&&L.split(" ").forEach(b=>r.store.off(b,v))}},[r,h]);const E=he(!0);g(()=>{m.current&&!E.current&&f(d),E.current=!1},[r,l]);const x=[p,r,c];if(x.t=p,x.i18n=r,x.ready=c,c||!c&&!a)return x;throw new Promise(P=>{e.lng?bn(r,e.lng,u,()=>P()):Ln(r,u,()=>P())})}const Yi={en:{translation:{findLocation:"Find a location",filtersLabel:"Filters",searchPlaceholder:"Enter city or postal code",search:"Search",clearSearch:"Clear search",loading:"Loading locations...",noResults:"No locations found. Try a different city or postal code.",showing_one:"Showing {{count}} location.",showing_other:"Showing {{count}} locations.",getDirections:"Get directions",viewDetails:"Location details",distanceAway:"{{distance}} km away",tabMap:"Map",tabList:"List",mapLoading:"Loading map...",mapLoadError:"Failed to load Google Maps.",mapConfigError:"Map is currently unavailable. Please try again later.",widgetError:"Something went wrong loading store locations. Please refresh the page.",storeTypes:{THRIFT_STORE:"Thrift Store",DONOR_WELCOME_CENTRE:"Donor Welcome Centre",DONATION_DROP_OFF_BIN:"Donor Drop Off Bin"},storeTypeBadges:{THRIFT_STORE:"Thrift Store",DONOR_WELCOME_CENTRE:"Donor Welcome Centre",DONATION_DROP_OFF_BIN:`Donor Drop Off Bin 2(clothing only)`}}
2},fr:{translation:{findLocation:"Trouver un emplacement",filtersLabel:"Filtres",searchPlaceholder:"Entrez une ville ou un code postal",search:"Rechercher",clearSearch:"Effacer la recherche",loading:"Chargement des emplacements...",noResults:"Aucun emplacement trouvé. Essayez une autre ville ou un code postal.",showing_one:"Affichage de {{count}} emplacement.",showing_other:"Affichage de {{count}} emplacements.",getDirections:"Itinéraire",viewDetails:"Détails de l'emplacement",distanceAway:"à{{distance}} km",tabMap:"Carte",tabList:"Liste",mapLoading:"Chargement de la carte...",mapLoadError:"Échec du chargement de Google Maps.",mapConfigError:"La carte est actuellement indisponible. Veuillez réessayer plus tard.",widgetError:"Une erreur s'est produite lors du chargement des emplacements. Veuillez actualiser la page.",storeTypes:{THRIFT_STORE:"Friperie",DONOR_WELCOME_CENTRE:"Centre d'accueil des dons",DONATION_DROP_OFF_BIN:"Bac de dépôt de dons"},storeTypeBadges:{THRIFT_STORE:"Friperie",DONOR_WELCOME_CENTRE:"Centre d'accueil des dons",DONATION_DROP_OFF_BIN:`Bac de dépôt de dons 3(vêtements seulement)`}}}};ue.use(Ki).init({resources:Yi,lng:typeof Liferay<"u"&&Liferay.ThemeDisplay?Liferay.ThemeDisplay.getLanguageId().split("_")[0]:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const Qi=({onSearch:n,initialValue:e=""})=>{const{t}=xe(),[s,i]=y(e),r=!!s,o=()=>n(s.trim()),a=()=>{i(""),n("")},l=c=>{const d=c.target.value;i(d),d||n("")},u=c=>{c.key==="Enter"&&o(),c.key==="Escape"&&a()};return R.createElement("div",{className:"slm-search"},R.createElement("div",{className:"slm-search__input-wrap"},R.createElement("input",{className:`slm-search__input${r?" slm-search__input--filled":""}`,type:"text",placeholder:t("searchPlaceholder"),"aria-label":t("searchPlaceholder"),value:s,onChange:l,onKeyDown:u}),r&&R.createElement("button",{className:"slm-search__clear",type:"button",onClick:a,"aria-label":t("clearSearch")||"Clear search"})),R.createElement("button",{className:"slm-search__btn",type:"button",onClick:o,"aria-label":t("search")},t("search")))},Xi={Orleans:"Orléans","New Westminster":"Nouveau-Westminster","St. Catharines":"Saint-Catharines","St. John's":"Saint-Jean"},er=n=>{const e=`${n.lat},${n.lng}`;if(!navigator.geolocation){window.open(`https://www.google.com/maps?q=${e}`,"_blank");return}navigator.geolocation.getCurrentPosition(t=>{const s=`${t.coords.latitude},${t.coords.longitude}`;window.open(`https://www.google.com/maps/dir/?api=1&origin=${s}&destination=${e}&travelmode=driving`,"_blank")},()=>{window.open(`https://www.google.com/maps?q=${e}`,"_blank")})},Gs=({store:n,isActive:e,onClick:t})=>{const{t:s,i18n:i}=xe(),r=i.language,o=r==="fr"?n.nameFr||n.nameEn||n.name:n.nameEn||n.name,a=r==="fr"?n.streetAddressFr||n.address||n.streetAddress:n.address||n.streetAddress,l=r==="fr"&&(n.cityFr||Xi[n.city])||n.city,u=r==="fr"&&n.detailsPageUrlFr||n.detailsPageUrl,c=n.types||[];return R.createElement("div",{className:`slm-store-card ${e?"slm-store-card--active":""}`,id:`store-${n.id}`,role:"button",tabIndex:0,"aria-pressed":e,onClick:()=>t(n),onKeyDown:d=>{d.target===d.currentTarget&&(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t(n))}},R.createElement("h3",{className:"slm-store-card__name"},o),R.createElement("p",{className:"slm-store-card__address"},a,R.createElement("br",null),l,", ",n.province," ",n.postalCode),typeof n.distanceKm=="number"&&R.createElement("p",{className:"slm-store-card__distance"},s("distanceAway",{distance:n.distanceKm.toFixed(1)})),R.createElement("div",{className:"slm-store-card__badges"},c.map(d=>R.createElement("span",{key:d,className:`slm-badge slm-badge--${d.toLowerCase().replace(/_/g,"-")}`},s(`storeTypeBadges.${d}`,{defaultValue:d})))),R.createElement("div",{className:"slm-store-card__actions"},R.createElement("button",{className:"slm-directions-btn",onClick:d=>{d.stopPropagation(),er(n)}},s("getDirections")),u&&R.createElement("a",{className:"slm-details-btn",href:u,onClick:d=>d.stopPropagation()},s("viewDetails"))))},tr=({stores:n,activeStoreId:e,onStoreClick:t,loading:s,hidden:i=!1})=>{const{t:r}=xe(),o=i?"slm-panel--hidden-mobile":"";return s?R.createElement("div",{className:`slm-list__loading ${o}`},r("loading")):n.length?R.createElement("div",{className:`slm-list ${o}`},R.createElement("p",{className:"slm-result-count"},r("showing",{count:n.length})),n.map(a=>R.createElement(Gs,{key:a.id,store:a,isActive:e===a.id,onClick:t}))):R.createElement("div",{className:`slm-list__empty ${o}`},r("noResults"))};
3var Js={exports:{}},bt={};/** 4 * @license React 5 * react-jsx-runtime.production.min.js 6 * 7 * Copyright (c) Facebook, Inc. and its affiliates. 8 * 9 * This source code is licensed under the MIT license found in the 10 * LICENSE file in the root directory of this source tree. 11 */var nr=R,sr=Symbol.for("react.element"),ir=Symbol.for("react.fragment"),rr=Object.prototype.hasOwnProperty,or=nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ar={key:!0,ref:!0,__self:!0,__source:!0};function qs(n,e,t){var s,i={},r=null,o=null;t!==void 0&&(r=""+t),e.key!==void 0&&(r=""+e.key),e.ref!==void 0&&(o=e.ref);for(s in e)rr.call(e,s)&&!ar.hasOwnProperty(s)&&(i[s]=e[s]);if(n&&n.defaultProps)for(s in e=n.defaultProps,e)i[s]===void 0&&(i[s]=e[s]);return{$$typeof:sr,type:n,key:r,ref:o,props:i,_owner:or.current}}bt.Fragment=ir;bt.jsx=qs;bt.jsxs=qs;Js.exports=bt;var ce=Js.exports;function Be(n){"@babel/helpers - typeof";return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(n)}function lr(n,e){if(Be(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var s=t.call(n,e);if(Be(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ur(n){var e=lr(n,"string");return Be(e)=="symbol"?e:e+""}function C(n,e,t){return(e=ur(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ys(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xt,Cn;function cr(){if(Cn)return xt;Cn=1;var n=function(t,s,i,r,o,a,l,u){if(!t){var c;if(s===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[i,r,o,a,l,u],p=0;c=new Error(s.replace(/%s/g,function(){return d[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};return xt=n,xt}var dr=cr(),ae=Ys(dr),F=Bs(null);function pr(){ae(!!oe,"useGoogleMap is React hook and requires React version 16.8+");var n=oe(F);return ae(!!n,"useGoogleMap needs a GoogleMap available up in the tree"),n}function gr(n,e,t){return Object.keys(n).reduce(function(i,r){return e(i,n[r],r)},t)}function hr(n,e){Object.keys(n).forEach(t=>e(n[t],t))}function fr(n,e,t,s){var i={},r=(o,a)=>{var l=t[a];l!==e[a]&&(i[a]=l,o(s,l))};return hr(n,r),i}function mr(n,e,t){var s=gr(t,function(r,o,a){return typeof n[a]=="function"&&r.push(google.maps.event.addListener(e,o,n[a])),r},[]);return s}function vr(n){google.maps.event.removeListener(n)}function G(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.forEach(vr)}function Z(n){var{updaterMap:e,eventMap:t,prevProps:s,nextProps:i,instance:r}=n,o=mr(i,r,t);return fr(e,s,i,r),o}var wn={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},xn={extraMapTypes(n,e){e.forEach(function(s,i){n.mapTypes.set(String(i),s)})},center(n,e){n.setCenter(e)},clickableIcons(n,e){n.setClickableIcons(e)},heading(n,e){n.setHeading(e)},mapTypeId(n,e){n.setMapTypeId(e)},options(n,e){n.setOptions(e)},streetView(n,e){n.setStreetView(e)},tilt(n,e){n.setTilt(e)},zoom(n,e){n.setZoom(e)}};function yr(n){var{children:e,options:t,id:s,mapContainerStyle:i,mapContainerClassName:r,center:o,onClick:a,onDblClick:l,onDrag:u,onDragEnd:c,onDragStart:d,onMouseMove:p,onMouseOut:f,onMouseOver:h,onMouseDown:w,onMouseUp:m,onRightClick:E,onCenterChanged:x,onLoad:P,onUnmount:L}=n,[v,b]=y(null),S=he(null),[k,M]=y(null),[I,D]=y(null),[B,W]=y(null),[T,j]=y(null),[V,Q]=y(null),[N,K]=y(null),[z,J]=y(null),[X,U]=y(null),[ee,O]=y(null),[ie,ne]=y(null),[H,re]=y(null),[A,q]=y(null);return g(()=>{t&&v!==null&&v.setOptions(t)},[v,t]),g(()=>{v!==null&&typeof o<"u"&&v.setCenter(o)},[v,o]),g(()=>{v&&l&&(I!==null&&google.maps.event.removeListener(I),D(google.maps.event.addListener(v,"dblclick",l)))},[l]),g(()=>{v&&c&&(B!==null&&google.maps.event.removeListener(B),W(google.maps.event.addListener(v,"dragend",c)))},[c]),g(()=>{v&&d&&(T!==null&&google.maps.event.removeListener(T),j(google.maps.event.addListener(v,"dragstart",d)))},[d]),g(()=>{v&&w&&(V!==null&&google.maps.event.removeListener(V),Q(google.maps.event.addListener(v,"mousedown",w)))},[w]),g(()=>{v&&p&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(v,"mousemove",p)))}
11,[p]),g(()=>{v&&f&&(z!==null&&google.maps.event.removeListener(z),J(google.maps.event.addListener(v,"mouseout",f)))},[f]),g(()=>{v&&h&&(X!==null&&google.maps.event.removeListener(X),U(google.maps.event.addListener(v,"mouseover",h)))},[h]),g(()=>{v&&m&&(ee!==null&&google.maps.event.removeListener(ee),O(google.maps.event.addListener(v,"mouseup",m)))},[m]),g(()=>{v&&E&&(ie!==null&&google.maps.event.removeListener(ie),ne(google.maps.event.addListener(v,"rightclick",E)))},[E]),g(()=>{v&&a&&(H!==null&&google.maps.event.removeListener(H),re(google.maps.event.addListener(v,"click",a)))},[a]),g(()=>{v&&u&&(A!==null&&google.maps.event.removeListener(A),q(google.maps.event.addListener(v,"drag",u)))},[u]),g(()=>{v&&x&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(v,"center_changed",x)))},[a]),g(()=>{var ge=S.current===null?null:new google.maps.Map(S.current,t);return b(ge),ge!==null&&P&&P(ge),()=>{ge!==null&&L&&L(ge)}},[]),ce.jsx("div",{id:s,ref:S,style:i,className:r,children:ce.jsx(F.Provider,{value:v,children:v!==null?e:null})})}le(yr);class Lr extends se{constructor(){super(...arguments),C(this,"state",{map:null}),C(this,"registeredEvents",[]),C(this,"mapRef",null),C(this,"getInstance",()=>this.mapRef===null?null:new google.maps.Map(this.mapRef,this.props.options)),C(this,"panTo",e=>{var t=this.getInstance();t&&t.panTo(e)}),C(this,"setMapCallback",()=>{this.state.map!==null&&this.props.onLoad&&this.props.onLoad(this.state.map)}),C(this,"getRef",e=>{this.mapRef=e})}componentDidMount(){var e=this.getInstance();this.registeredEvents=Z({updaterMap:xn,eventMap:wn,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{map:e}},this.setMapCallback)}componentDidUpdate(e){this.state.map!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:xn,eventMap:wn,prevProps:e,nextProps:this.props,instance:this.state.map}))}componentWillUnmount(){this.state.map!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),G(this.registeredEvents))}render(){return ce.jsx("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:ce.jsx(F.Provider,{value:this.state.map,children:this.state.map!==null?this.props.children:null})})}}function Mn(n,e,t,s,i,r,o){try{var a=n[r](o),l=a.value}catch(u){return void t(u)}a.done?e(l):Promise.resolve(l).then(s,i)}function Qs(n){return function(){var e=this,t=arguments;return new Promise(function(s,i){var r=n.apply(e,t);function o(l){Mn(r,s,i,o,a,"next",l)}function a(l){Mn(r,s,i,o,a,"throw",l)}o(void 0)})}}function Xs(n){var{googleMapsApiKey:e,googleMapsClientId:t,version:s="weekly",language:i,region:r,libraries:o,channel:a,mapIds:l,authReferrerPolicy:u,apiUrl:c="https://maps.googleapis.com"}=n,d=[];return ae(e&&t||!(e&&t),"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time."),e?d.push("key=".concat(e)):t&&d.push("client=".concat(t)),s&&d.push("v=".concat(s)),i&&d.push("language=".concat(i)),r&&d.push("region=".concat(r)),o&&o.length&&d.push("libraries=".concat(o.sort().join(","))),a&&d.push("channel=".concat(a)),l&&l.length&&d.push("map_ids=".concat(l.join(","))),u&&d.push("auth_referrer_policy=".concat(u)),d.push("loading=async"),d.push("callback=initMap"),"".concat(c,"/maps/api/js?").concat(d.join("&"))}var be=typeof document<"u";function ei(n){var{url:e,id:t,nonce:s}=n;return be?new Promise(function(r,o){var a=document.getElementById(t),l=window;if(a){var u=a.getAttribute("data-state");if(a.src===e&&u!=="error"){if(u==="ready")return r(t);var c=l.initMap,d=a.onerror;l.initMap=function(){c&&c(),r(t)},a.onerror=function(f){d&&d(f),o(f)};return}else a.remove()}var p=document.createElement("script");p.type="text/javascript",p.src=e,p.id=t,p.async=!0,p.nonce=s||"",p.onerror=function(h){p.setAttribute("data-state","error"),o(h)},l.initMap=function(){p.setAttribute("data-state","ready"),r(t)},document.head.appendChild(p)}).catch(i=>{throw console.error("injectScript error: ",i),i}):Promise.reject(new Error("document is undefined"))}function On(n){var e=n.href;return e&&(e.indexOf("https://fonts.googleapis.com/css?family=Roboto")===0||e.indexOf("https://fonts.googleapis.com/css?family=Google+Sans+Text")===0)?!0:n.tagName.toLowerCase()==="style"&&n.styleSheet&&n.styleSheet.cssText&&n.styleSheet.cssText.replace(`\r 12`,"").indexOf(".gm-style")===0?(n.styleSheet.cssText="",!0):n.tagName.toLowerCase()==="style"&&n.innerHTML&&n.innerHTML.replace(`\r 13`,"").indexOf(".gm-style")===0?(n.innerHTML="",!0):n.tagName.toLowerCase()==="style"&&!n.styleSheet&&!n.innerHTML}function Nt(){var n=document.getElementsByTagName("head")[0];if(n){var e=n.insertBefore.bind(n);n.insertBefore=function(i,r){return On(i)||Reflect.apply(e,n,[i,r]),i};var t=n.appendChild.bind(n);n.appendChild=function(i){return On(i)||Reflect.apply(t,n,[i]),i}}}var Re=!1;function ti(){return ce.jsx("div",{children:"Loading..."})}var $e={id:"script-loader",version:"weekly"};class br extends se{constructor(){super(...arguments),C(this,"check",null),C(this,"state",{loaded:!1}),C(this,"cleanupCallback",()=>{delete window.google.maps,this.injectScript()}),C(this,"isCleaningUp",Qs(function*(){function e(t){if(!Re)t();else if(be)var s=window.setInterval(function(){Re||(window.clearInterval(s),t())},1)}return new Promise(e)})),C(this,"cleanup",()=>{Re=!0;var e=document.getElementById(this.props.id);e&&e.parentNode&&e.parentNode.removeChild(e),Array.prototype.slice.call(document.getElementsByTagName("script")).filter(function(s){return typeof s.src=="string"&&s.src.includes("maps.googleapis")}
13).forEach(function(s){s.parentNode&&s.parentNode.removeChild(s)}),Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(s){return s.href==="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"}).forEach(function(s){s.parentNode&&s.parentNode.removeChild(s)}),Array.prototype.slice.call(document.getElementsByTagName("style")).filter(function(s){return s.innerText!==void 0&&s.innerText.length>0&&s.innerText.includes(".gm-")}).forEach(function(s){s.parentNode&&s.parentNode.removeChild(s)})}),C(this,"injectScript",()=>{this.props.preventGoogleFontsLoading&&Nt(),ae(!!this.props.id,'LoadScript requires "id" prop to be a string: %s',this.props.id);var e={id:this.props.id,nonce:this.props.nonce,url:Xs(this.props)};ei(e).then(()=>{this.props.onLoad&&this.props.onLoad(),this.setState(function(){return{loaded:!0}})}).catch(t=>{this.props.onError&&this.props.onError(t),console.error(` 14 There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(this.props.googleMapsApiKey||"-",") or Client ID (").concat(this.props.googleMapsClientId||"-",`) to <LoadScript /> 15 Otherwise it is a Network issue. 16 `))})}),C(this,"getRef",e=>{this.check=e})}componentDidMount(){if(be){if(window.google&&window.google.maps&&!Re){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(t){console.error("Error at injecting script after cleaning up: ",t)})}}componentDidUpdate(e){this.props.libraries!==e.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),be&&e.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))}componentWillUnmount(){if(be){this.cleanup();var e=()=>{this.check||(delete window.google,Re=!1)};window.setTimeout(e,1),this.props.onUnmount&&this.props.onUnmount()}}render(){return ce.jsxs(ce.Fragment,{children:[ce.jsx("div",{ref:this.getRef}),this.state.loaded?this.props.children:this.props.loadingElement||ce.jsx(ti,{})]})}}C(br,"defaultProps",$e);function Cr(n,e){if(n==null)return{};var t={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(e.includes(s))continue;t[s]=n[s]}return t}function At(n,e){if(n==null)return{};var t,s,i=Cr(n,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(s=0;s<r.length;s++)t=r[s],e.includes(t)||{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}var Sn;function wr(n){var{id:e=$e.id,version:t=$e.version,nonce:s,googleMapsApiKey:i,googleMapsClientId:r,language:o,region:a,libraries:l,preventGoogleFontsLoading:u,channel:c,mapIds:d,authReferrerPolicy:p,apiUrl:f="https://maps.googleapis.com"}=n,h=he(!1),[w,m]=y(!1),[E,x]=y(void 0);g(function(){return h.current=!0,()=>{h.current=!1}},[]),g(function(){be&&u&&Nt()},[u]),g(function(){w&&ae(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[w]);var P=Xs({version:t,googleMapsApiKey:i,googleMapsClientId:r,language:o,region:a,libraries:l,channel:c,mapIds:d,authReferrerPolicy:p,apiUrl:f});g(function(){if(!be)return;function b(){h.current&&(m(!0),Sn=P)}if(window.google&&window.google.maps&&Sn===P){b();return}ei({id:e,url:P,nonce:s}).then(b).catch(function(k){h.current&&x(k),console.warn(` 17 There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(i||"-",") or Client ID (").concat(r||"-",`) 18 Otherwise it is a Network issue. 19 `)),console.error(k)})},[e,P,s]);var L=he(void 0);return g(function(){L.current&&l!==L.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as
19static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),L.current=l},[l]),{isLoaded:w,loadError:E,url:P}}var xr=["loadingElement","onLoad","onError","onUnmount","children"],Mr=ce.jsx(ti,{});function Or(n){var{loadingElement:e,onLoad:t,onError:s,onUnmount:i,children:r}=n,o=At(n,xr),{isLoaded:a,loadError:l}=wr(o);return g(function(){a&&typeof t=="function"&&t()},[a,t]),g(function(){l&&typeof s=="function"&&s(l)},[l,s]),g(function(){return()=>{i&&i()}},[i]),a?r:e||Mr}le(Or);function Sr(n,e,t,s){function i(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(c){try{u(s.next(c))}catch(d){o(d)}}function l(c){try{u(s.throw(c))}catch(d){o(d)}}function u(c){c.done?r(c.value):i(c.value).then(a,l)}u((s=s.apply(n,[])).next())})}function Er(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var kr=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var s,i,r;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!n(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(r=Object.keys(e),s=r.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=s;i--!==0;){var o=r[i];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t},Pr=Er(kr),En="__googleMapsScriptId",Se;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(Se||(Se={}));class we{constructor(e){var{apiKey:t,authReferrerPolicy:s,channel:i,client:r,id:o=En,language:a,libraries:l=[],mapIds:u,nonce:c,region:d,retries:p=3,url:f="https://maps.googleapis.com/maps/api/js",version:h}=e;if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=s,this.channel=i,this.client=r,this.id=o||En,this.language=a,this.libraries=l,this.mapIds=u,this.nonce=c,this.region=d,this.retries=p,this.url=f,this.version=h,we.instance){if(!Pr(this.options,we.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(we.instance.options)));return we.instance}we.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?Se.FAILURE:this.done?Se.SUCCESS:this.loading?Se.LOADING:Se.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){var e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+="&key=".concat(this.apiKey)),this.channel&&(e+="&channel=".concat(this.channel)),this.client&&(e+="&client=".concat(this.client)),this.libraries.length>0&&(e+="&libraries=".concat(this.libraries.join(","))),this.language&&(e+="&language=".concat(this.language)),this.region&&(e+="®ion=".concat(this.region)),this.version&&(e+="&v=".concat(this.version)),this.mapIds&&(e+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(e+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),e}deleteScript(){var e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(s=>{s?t(s.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}var s={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};
19Object.keys(s).forEach(r=>!s[r]&&delete s[r]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(r=>{var o,a,l,u="The Google Maps JavaScript API",c="google",d="importLibrary",p="__ib__",f=document,h=window;h=h[c]||(h[c]={});var w=h.maps||(h.maps={}),m=new Set,E=new URLSearchParams,x=()=>o||(o=new Promise((P,L)=>Sr(this,void 0,void 0,function*(){var v;yield a=f.createElement("script"),a.id=this.id,E.set("libraries",[...m]+"");for(l in r)E.set(l.replace(/[A-Z]/g,b=>"_"+b[0].toLowerCase()),r[l]);E.set("callback",c+".maps."+p),a.src=this.url+"?"+E,w[p]=P,a.onerror=()=>o=L(Error(u+" could not load.")),a.nonce=this.nonce||((v=f.querySelector("script[nonce]"))===null||v===void 0?void 0:v.nonce)||"",f.head.append(a)})));w[d]?console.warn(u+" only loads once. Ignoring:",r):w[d]=function(P){for(var L=arguments.length,v=new Array(L>1?L-1:0),b=1;b<L;b++)v[b-1]=arguments[b];return m.add(P)&&x().then(()=>w[d](P,...v))}})(s);var i=this.libraries.map(r=>this.importLibrary(r));i.length||i.push(this.importLibrary("core")),Promise.all(i).then(()=>this.callback(),r=>{var o=new ErrorEvent("error",{error:r});this.loadErrorCallback(o)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){var t=this.errors.length*Math.pow(2,this.errors.length);console.error("Failed to load Google Maps script, retrying in ".concat(t," ms.")),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}var Dr=["maps"];function Ir(n){var{id:e=$e.id,version:t=$e.version,nonce:s,googleMapsApiKey:i,language:r,region:o,libraries:a=Dr,preventGoogleFontsLoading:l,mapIds:u,authReferrerPolicy:c}=n,d=he(!1),[p,f]=y(!1),[h,w]=y(void 0);g(function(){return d.current=!0,()=>{d.current=!1}},[]);var m=Ue(()=>new we({id:e,apiKey:i,version:t,libraries:a,language:r||"en",region:o||"US",mapIds:u||[],nonce:s||"",authReferrerPolicy:c||"origin"}),[e,i,t,a,r,o,u,s,c]);g(function(){p||m.load().then(()=>{d.current&&f(!0)}).catch(P=>{w(P)})},[]),g(()=>{be&&l&&Nt()},[l]);var E=he();return g(()=>{E.current&&a!==E.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),E.current=a},[a]),{isLoaded:p,loadError:h}}function kn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kn(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kn(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var Pn={},Dn={options(n,e){n.setOptions(e)}};function Rr(n){var{options:e,onLoad:t,onUnmount:s}=n,i=oe(F),[r,o]=y(null);return g(()=>{r!==null&&r.setMap(i)},[i]),g(()=>{e&&r!==null&&r.setOptions(e)},[r,e]),g(()=>{var a=new google.maps.TrafficLayer(ut(ut({},e),{},{map:i}));return o(a),t&&t(a),()=>{r!==null&&(s&&s(r),r.setMap(null))}},[]),null}le(Rr);class Tr extends se{constructor(){super(...arguments),C(this,"state",{trafficLayer:null}),C(this,"setTrafficLayerCallback",()=>{this.state.trafficLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.trafficLayer)}),C(this,"registeredEvents",[])}componentDidMount(){var e=new google.maps.TrafficLayer(ut(ut({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:Dn,eventMap:Pn,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{trafficLayer:e}},this.setTrafficLayerCallback)}componentDidUpdate(e){this.state.trafficLayer!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Dn,eventMap:Pn,prevProps:e,nextProps:this.props,instance:this.state.trafficLayer}))}componentWillUnmount(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),G(this.registeredEvents),this.state.trafficLayer.setMap(null))}render(){return null}}C(Tr,"contextType",F);function jr(n){var{onLoad:e,onUnmount:t}=n,s=oe(F),[i,r]=y(null);return g(()=>{i!==null&&i.setMap(s)},[s]),g(()=>{var o=new google.maps.BicyclingLayer;return r(o),o.setMap(s),e&&e(o),()=>{o!==null&&(t&&t(o),o.setMap(null))}},[]),null}le(jr);class Nr extends se{constructor(){super(...arguments),C(this,"state",{bicyclingLayer:null}),C(this,"setBicyclingLayerCallback",()=>{this.state.bicyclingLayer!==null&&(this.state.bicyclingLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.bicyclingLayer))})}componentDidMount(){var e=new google.maps.BicyclingLayer;this.setState(()=>({bicyclingLayer:e}),this.setBicyclingLayerCallback)}componentWillUnmount(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))}render(){return null}}C(Nr,"contextType",F);function Ar(n){var{onLoad:e,onUnmount:t}=n,s=oe(F),[i,r]=y(null);return g(()=>{i!==null&&i.setMap(s)},[s]),g(()=>{var o=new google.maps.TransitLayer;return r(o),o.setMap(s),e&&e(o),()=>{i!==null&&(t&&t(i),i.setMap(null))}},[]),null}le(Ar);class Ur extends se{constructor(){super(...arguments),C(this,"state",{transitLayer:null}),C(this,"setTransitLayerCallback",()=>{this.state.transitLayer!==null&&(this.state.transitLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.transitLayer))})}componentDidMount(){var e=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:e}},this.setTransitLayerCallback)}componentWillUnmount(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))}render(){return null}}C(Ur,"contextType",F);function In(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function ct(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
19e%2?In(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):In(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var Rn={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},Tn={drawingMode(n,e){n.setDrawingMode(e)},options(n,e){n.setOptions(e)}};function _r(n){var{options:e,drawingMode:t,onCircleComplete:s,onMarkerComplete:i,onOverlayComplete:r,onPolygonComplete:o,onPolylineComplete:a,onRectangleComplete:l,onLoad:u,onUnmount:c}=n,d=oe(F),[p,f]=y(null),[h,w]=y(null),[m,E]=y(null),[x,P]=y(null),[L,v]=y(null),[b,S]=y(null),[k,M]=y(null);return g(()=>{p!==null&&p.setMap(d)},[d]),g(()=>{e&&p!==null&&p.setOptions(e)},[p,e]),g(()=>{p!==null&&p.setDrawingMode(t??null)},[p,t]),g(()=>{p&&s&&(h!==null&&google.maps.event.removeListener(h),w(google.maps.event.addListener(p,"circlecomplete",s)))},[p,s]),g(()=>{p&&i&&(m!==null&&google.maps.event.removeListener(m),E(google.maps.event.addListener(p,"markercomplete",i)))},[p,i]),g(()=>{p&&r&&(x!==null&&google.maps.event.removeListener(x),P(google.maps.event.addListener(p,"overlaycomplete",r)))},[p,r]),g(()=>{p&&o&&(L!==null&&google.maps.event.removeListener(L),v(google.maps.event.addListener(p,"polygoncomplete",o)))},[p,o]),g(()=>{p&&a&&(b!==null&&google.maps.event.removeListener(b),S(google.maps.event.addListener(p,"polylinecomplete",a)))},[p,a]),g(()=>{p&&l&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(p,"rectanglecomplete",l)))},[p,l]),g(()=>{ae(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var I=new google.maps.drawing.DrawingManager(ct(ct({},e),{},{map:d}));return t&&I.setDrawingMode(t),s&&w(google.maps.event.addListener(I,"circlecomplete",s)),i&&E(google.maps.event.addListener(I,"markercomplete",i)),r&&P(google.maps.event.addListener(I,"overlaycomplete",r)),o&&v(google.maps.event.addListener(I,"polygoncomplete",o)),a&&S(google.maps.event.addListener(I,"polylinecomplete",a)),l&&M(google.maps.event.addListener(I,"rectanglecomplete",l)),f(I),u&&u(I),()=>{p!==null&&(h&&google.maps.event.removeListener(h),m&&google.maps.event.removeListener(m),x&&google.maps.event.removeListener(x),L&&google.maps.event.removeListener(L),b&&google.maps.event.removeListener(b),k&&google.maps.event.removeListener(k),c&&c(p),p.setMap(null))}},[]),null}le(_r);class Br extends se{constructor(e){super(e),C(this,"registeredEvents",[]),C(this,"state",{drawingManager:null}),C(this,"setDrawingManagerCallback",()=>{this.state.drawingManager!==null&&this.props.onLoad&&this.props.onLoad(this.state.drawingManager)}),ae(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing)}componentDidMount(){var e=new google.maps.drawing.DrawingManager(ct(ct({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:Tn,eventMap:Rn,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{drawingManager:e}},this.setDrawingManagerCallback)}componentDidUpdate(e){this.state.drawingManager!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Tn,eventMap:Rn,prevProps:e,nextProps:this.props,instance:this.state.drawingManager}))}componentWillUnmount(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),G(this.registeredEvents),this.state.drawingManager.setMap(null))}render(){return null}}C(Br,"contextType",F);function jn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function Ee(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jn(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jn(Object(t)).forEac
19h(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var Nn={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},An={animation(n,e){n.setAnimation(e)},clickable(n,e){n.setClickable(e)},cursor(n,e){n.setCursor(e)},draggable(n,e){n.setDraggable(e)},icon(n,e){n.setIcon(e)},label(n,e){n.setLabel(e)},map(n,e){n.setMap(e)},opacity(n,e){n.setOpacity(e)},options(n,e){n.setOptions(e)},position(n,e){n.setPosition(e)},shape(n,e){n.setShape(e)},title(n,e){n.setTitle(e)},visible(n,e){n.setVisible(e)},zIndex(n,e){n.setZIndex(e)}},dt={};function $r(n){var{position:e,options:t,clusterer:s,noClustererRedraw:i,children:r,draggable:o,visible:a,animation:l,clickable:u,cursor:c,icon:d,label:p,opacity:f,shape:h,title:w,zIndex:m,onClick:E,onDblClick:x,onDrag:P,onDragEnd:L,onDragStart:v,onMouseOut:b,onMouseOver:S,onMouseUp:k,onMouseDown:M,onRightClick:I,onClickableChanged:D,onCursorChanged:B,onAnimationChanged:W,onDraggableChanged:T,onFlatChanged:j,onIconChanged:V,onPositionChanged:Q,onShapeChanged:N,onTitleChanged:K,onVisibleChanged:z,onZindexChanged:J,onLoad:X,onUnmount:U}=n,ee=oe(F),[O,ie]=y(null),[ne,H]=y(null),[re,A]=y(null),[q,ge]=y(null),[me,Pe]=y(null),[te,Bt]=y(null),[Fe,$t]=y(null),[ze,Ft]=y(null),[Ve,zt]=y(null),[He,Vt]=y(null),[Ht,Zt]=y(null),[Ze,Wt]=y(null),[We,Kt]=y(null),[Ke,Gt]=y(null),[Ge,Jt]=y(null),[Je,qt]=y(null),[qe,Yt]=y(null),[Ye,Qt]=y(null),[Xt,en]=y(null),[Qe,tn]=y(null),[Xe,nn]=y(null),[et,sn]=y(null);g(()=>{O!==null&&O.setMap(ee)},[ee]),g(()=>{typeof t<"u"&&O!==null&&O.setOptions(t)},[O,t]),g(()=>{typeof o<"u"&&O!==null&&O.setDraggable(o)},[O,o]),g(()=>{e&&O!==null&&O.setPosition(e)},[O,e]),g(()=>{typeof a<"u"&&O!==null&&O.setVisible(a)},[O,a]),g(()=>{O==null||O.setAnimation(l)},[O,l]),g(()=>{O&&u!==void 0&&O.setClickable(u)},[O,u]),g(()=>{O&&c!==void 0&&O.setCursor(c)},[O,c]),g(()=>{O&&d!==void 0&&O.setIcon(d)},[O,d]),g(()=>{O&&p!==void 0&&O.setLabel(p)},[O,p]),g(()=>{O&&f!==void 0&&O.setOpacity(f)},[O,f]),g(()=>{O&&h!==void 0&&O.setShape(h)},[O,h]),g(()=>{O&&w!==void 0&&O.setTitle(w)},[O,w]),g(()=>{O&&m!==void 0&&O.setZIndex(m)},[O,m]),g(()=>{O&&x&&(ne!==null&&google.maps.event.removeListener(ne),H(google.maps.event.addListener(O,"dblclick",x)))},[x]),g(()=>{O&&L&&(re!==null&&google.maps.event.removeListener(re),A(google.maps.event.addListener(O,"dragend",L)))},[L]),g(()=>{O&&v&&(q!==null&&google.maps.event.removeListener(q),ge(google.maps.event.addListener(O,"dragstart",v)))},[v]),g(()=>{O&&M&&(me!==null&&google.maps.event.removeListener(me),Pe(google.maps.event.addListener(O,"mousedown",M)))},[M]),g(()=>{O&&b&&(te!==null&&google.maps.event.removeListener(te),Bt(google.maps.event.addListener(O,"mouseout",b)))},[b]),g(()=>{O&&S&&(Fe!==null&&google.maps.event.removeListener(Fe),$t(google.maps.event.addListener(O,"mouseover",S)))},[S]),g(()=>{O&&k&&(ze!==null&&google.maps.event.removeListener(ze),Ft(google.maps.event.addListener(O,"mouseup",k)))},[k]),g(()=>{O&&I&&(Ve!==null&&google.maps.event.removeListener(Ve),zt(google.maps.event.addListener(O,"rightclick",I)))},[I]),g(()=>{O&&E&&(He!==null&&google.maps.event.removeListener(He),Vt(google.maps.event.addListener(O,"click",E)))},[E]),g(()=>{O&&P&&(Ht!==null&&google.maps.event.removeListener(Ht),Zt(google.maps.event.addListener(O,"drag",P)))},[P]),g(()=>{O&&D&&(Ze!==null&&google.maps.event.removeListener(Ze),Wt(google.maps.event.addListener(O,"clickable_changed",D)))},[D]),g(()=>{O&&B&&(We!==null&&google.maps.event.removeListener(We),Kt(google.maps.event.addListener(O,"cursor_changed",B)))},[B]),g(()=>{O&&W&&(Ke!==null&&google.maps.event.removeListener(Ke),Gt(google.maps.event.addListener(O,"animation_changed",W)))},[W]),g(()=>{O&&T&&(Ge!==null&&google.maps.event.removeListener(Ge),Jt(google.maps.event.addListener(O,"draggable_changed",T)))},[T]),g(()=>{O&&j&&(Je!==null&&google.maps.event.removeListener(Je),qt(google.maps.event.addListener(O,"flat_changed",j)))},[j]),g(()=>{O&&V&&(qe!==null&&google.maps.event.removeListener(qe),Yt(google.maps.event.addListener(O,"icon_changed",V)))},[V]),g(()=>{O&&Q&&(Ye!==null&&google.maps.event.removeListener(Ye),Qt(google.maps.event.addListener(O,"position_changed",Q)))},[Q]),g(()=>{O&&N&&(Xt!==null&&google.maps.event.removeListener(Xt),en(google.maps.event.addListener(O,"shape_changed",N)))}
19,[N]),g(()=>{O&&K&&(Qe!==null&&google.maps.event.removeListener(Qe),tn(google.maps.event.addListener(O,"title_changed",K)))},[K]),g(()=>{O&&z&&(Xe!==null&&google.maps.event.removeListener(Xe),nn(google.maps.event.addListener(O,"visible_changed",z)))},[z]),g(()=>{O&&J&&(et!==null&&google.maps.event.removeListener(et),sn(google.maps.event.addListener(O,"zindex_changed",J)))},[J]),g(()=>{var De=Ee(Ee(Ee({},t||dt),s?dt:{map:ee}),{},{position:e}),$=new google.maps.Marker(De);return s?s.addMarker($,!!i):$.setMap(ee),e&&$.setPosition(e),typeof a<"u"&&$.setVisible(a),typeof o<"u"&&$.setDraggable(o),typeof u<"u"&&$.setClickable(u),typeof c=="string"&&$.setCursor(c),d&&$.setIcon(d),typeof p<"u"&&$.setLabel(p),typeof f<"u"&&$.setOpacity(f),h&&$.setShape(h),typeof w=="string"&&$.setTitle(w),typeof m=="number"&&$.setZIndex(m),x&&H(google.maps.event.addListener($,"dblclick",x)),L&&A(google.maps.event.addListener($,"dragend",L)),v&&ge(google.maps.event.addListener($,"dragstart",v)),M&&Pe(google.maps.event.addListener($,"mousedown",M)),b&&Bt(google.maps.event.addListener($,"mouseout",b)),S&&$t(google.maps.event.addListener($,"mouseover",S)),k&&Ft(google.maps.event.addListener($,"mouseup",k)),I&&zt(google.maps.event.addListener($,"rightclick",I)),E&&Vt(google.maps.event.addListener($,"click",E)),P&&Zt(google.maps.event.addListener($,"drag",P)),D&&Wt(google.maps.event.addListener($,"clickable_changed",D)),B&&Kt(google.maps.event.addListener($,"cursor_changed",B)),W&&Gt(google.maps.event.addListener($,"animation_changed",W)),T&&Jt(google.maps.event.addListener($,"draggable_changed",T)),j&&qt(google.maps.event.addListener($,"flat_changed",j)),V&&Yt(google.maps.event.addListener($,"icon_changed",V)),Q&&Qt(google.maps.event.addListener($,"position_changed",Q)),N&&en(google.maps.event.addListener($,"shape_changed",N)),K&&tn(google.maps.event.addListener($,"title_changed",K)),z&&nn(google.maps.event.addListener($,"visible_changed",z)),J&&sn(google.maps.event.addListener($,"zindex_changed",J)),ie($),X&&X($),()=>{ne!==null&&google.maps.event.removeListener(ne),re!==null&&google.maps.event.removeListener(re),q!==null&&google.maps.event.removeListener(q),me!==null&&google.maps.event.removeListener(me),te!==null&&google.maps.event.removeListener(te),Fe!==null&&google.maps.event.removeListener(Fe),ze!==null&&google.maps.event.removeListener(ze),Ve!==null&&google.maps.event.removeListener(Ve),He!==null&&google.maps.event.removeListener(He),Ze!==null&&google.maps.event.removeListener(Ze),We!==null&&google.maps.event.removeListener(We),Ke!==null&&google.maps.event.removeListener(Ke),Ge!==null&&google.maps.event.removeListener(Ge),Je!==null&&google.maps.event.removeListener(Je),qe!==null&&google.maps.event.removeListener(qe),Ye!==null&&google.maps.event.removeListener(Ye),Qe!==null&&google.maps.event.removeListener(Qe),Xe!==null&&google.maps.event.removeListener(Xe),et!==null&&google.maps.event.removeListener(et),U&&U($),s?s.removeMarker($,!!i):$&&$.setMap(null)}},[]);var di=Ue(()=>r?ve.map(r,De=>{if(!$s(De))return De;var $=De;return Fs($,{anchor:O})}):null,[r,O]);return ce.jsx(ce.Fragment,{children:di})||null}le($r);class It extends se{constructor(){super(...arguments),C(this,"registeredEvents",[])}componentDidMount(){var e=this;return Qs(function*(){var t=Ee(Ee(Ee({},e.props.options||dt),e.props.clusterer?dt:{map:e.context}),{},{position:e.props.position});e.marker=new google.maps.Marker(t),e.props.clusterer?e.props.clusterer.addMarker(e.marker,!!e.props.noClustererRedraw):e.marker.setMap(e.context),e.registeredEvents=Z({updaterMap:An,eventMap:Nn,prevProps:{},nextProps:e.props,instance:e.marker}),e.props.onLoad&&e.props.onLoad(e.marker)})()}componentDidUpdate(e){this.marker&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:An,eventMap:Nn,prevProps:e,nextProps:this.props,instance:this.marker}))}componentWillUnmount(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),G(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))}render(){var e=this.props.children?ve.map(this.props.children,t=>{if(!$s(t))return t;var s=t;return Fs(s,{anchor:this.marker})}):null;return e||null}}C(It,"contextType",F);var Fr=function(){function n(e,t){e.getClusterer().extend(n,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=t,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(e.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return n.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},n.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},n.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var t=this.cluster.getClusterer();if(google.maps.event.trigger(t,"click",this.cluster),google.maps.event.trigger(t,"clusterclick",this.cluster),t.getZoomOnClick()){var s=t.getMaxZoom(),i=this.cluster.getBounds(),r=t.getMap();r!==null&&"fitBounds"in r&&r.fitBounds(i),this.timeOut=window.setTimeout(function(){var o=t.getMap();if(o!==null){"fitBounds"in o&&o.fitBounds(i);var a=o.getZoom()||0;s!==null&&a>s&&o.setZoom(s+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},n.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},n.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},n.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),(e=this.getPanes())===null||e===void 0||e.overlayMouseTarget.appendChild(this.div);var t=this.getMap();t!==null&&(this.boundsChangedListener=google.maps.event.addListener(t,"boun
19ds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},n.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),this.boundsChangedListener!==null&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),this.timeOut!==null&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},n.prototype.draw=function(){if(this.visible&&this.div!==null&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=e!==null?"".concat(e.y,"px"):"0",this.div.style.left=e!==null?"".concat(e.x,"px"):"0"}},n.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},n.prototype.show=function(){var e,t,s,i,r,o;
19if(this.div&&this.center){var a=this.sums===null||typeof this.sums.title>"u"||this.sums.title===""?this.cluster.getClusterer().getTitle():this.sums.title,l=this.backgroundPosition.split(" "),u=parseInt(((e=l[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),c=parseInt(((t=l[1])===null||t===void 0?void 0:t.replace(/^\s+|\s+$/g,""))||"0",10),d=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(d!==null?"".concat(d.y,"px"):"0","; left: ").concat(d!==null?"".concat(d.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var p=document.createElement("img");p.alt=a,p.src=this.url,p.width=this.width,p.height=this.height,p.setAttribute("style","position: absolute; top: ".concat(c,"px; left: ").concat(u,"px")),this.cluster.getClusterer().enableRetinaIcons||(p.style.clip="rect(-".concat(c,"px, -").concat(u+this.width,"px, -").concat(c+this.height,", -").concat(u,")"));var f=document.createElement("div");f.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),!((s=this.sums)===null||s===void 0)&&s.text&&(f.innerText="".concat((i=this.sums)===null||i===void 0?void 0:i.text)),!((r=this.sums)===null||r===void 0)&&r.html&&(f.innerHTML="".concat((o=this.sums)===null||o===void 0?void 0:o.html)),this.div.innerHTML="",this.div.appendChild(p),this.div.appendChild(f),this.div.title=a,this.div.style.display=""}this.visible=!0},n.prototype.useStyle=function(e){this.sums=e;var t=this.cluster.getClusterer().getStyles(),s=t[Math.min(t.length-1,Math.max(0,e.index-1))];s&&(this.url=s.url,this.height=s.height,this.width=s.width,s.className&&(this.className="".concat(this.clusterClassName," ").concat(s.className)),this.anchorText=s.anch
19orText||[0,0],this.anchorIcon=s.anchorIcon||[this.height/2,this.width/2],this.textColor=s.textColor||"black",this.textSize=s.textSize||11,this.textDecoration=s.textDecoration||"none",this.fontWeight=s.fontWeight||"bold",this.fontStyle=s.fontStyle||"normal",this.fontFamily=s.fontFamily||"Arial,sans-serif",this.backgroundPosition=s.backgroundPosition||"0 0")},n.prototype.setCenter=function(e){this.center=e},n.prototype.getPosFromLatLng=function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return t!==null&&(t.x-=this.anchorIcon[1],t.y-=this.anchorIcon[0]),t},n}(),zr=function(){function n(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new Fr(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return n.prototype.getSize=function(){return this.markers.length},n.prototype.getMarkers=function(){return this.markers},n.prototype.getCenter=function(){return this.center},n.prototype.getMap=function(){return this.map},n.prototype.getClusterer=function(){return this.markerClusterer},n.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),t=this.getMarkers(),s=0,i=t;s<i.length;s++){var r=i[s],o=r.getPosition();o&&e.extend(o)}return e},n.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},n.prototype.addMarker=function(e){var t;if(this.isMarkerAlreadyAdded(e))return!1;if(this.center){if(this.averageCenter){var s=e.getPosition();if(s){var i=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(i-1)+s.lat())/i,(this.center.lng()*(i-1)+s.lng())/i),this.calculateBounds()}}}else{var s=e.getPosition();s&&(this.center=s,this.calculateBounds())}e.isAdded=!0,this.markers.push(e);var r=this.markers.length,o=this.markerClusterer.getMaxZoom(),a=(t=this.map)===null||t===void 0?void 0:t.getZoom();if(o!==null&&typeof a<"u"&&a>o)e.getMap()!==this.map&&e.setMap(this.map);else if(r<this.minClusterSize)e.getMap()!==this.map&&e.setMap(this.map);else if(r===this.minClusterSize)for(var l=0,u=this.markers;l<u.length;l++){var c=u[l];c.setMap(null)}else e.setMap(null);return!0},n.prototype.isMarkerInClusterBounds=function(e){if(this.bounds!==null){var t=e.getPosition();if(t)return this.bounds.contains(t)}return!1},n.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},n.prototype.updateIcon=function(){var e,t=this.markers.length,s=this.markerClusterer.getMaxZoom(),i=(e=this.map)===null||e===void 0?void 0:e.getZoom();if(s!==null&&typeof i<"u"&&i>s){this.clusterIcon.hide();return}if(t<this.minClusterSize){this.clusterIcon.hide();return}this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show()},n.prototype.isMarkerAlreadyAdded=function(e){if(this.markers.includes)return this.markers.includes(e);for(var t=0;t<this.markers.length;t++)if(e===this.markers[t])return!0;return!1},n}();function Vr(n,e){var t=n.length,s=t.toString().length,i=Math.min(s,e);return{text:t.toString(),index:i,title:""}}var Hr=2e3,Zr=500,Wr="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",Kr="png",Gr=[53,56,66,78,90],Jr="cluster",ni=function(){function n(e,t,s){t===void 0&&(t=[]),s===void 0&&(s={}),this.getMinimumClusterSize=this.getMinimumClusterSize.bind(this),this.setMinimumClusterSize=this.setMinimumClusterSize.bind(this),this.getEnableRetinaIcons=this.getEnableRetinaIcons.bind(this),this.setEnableRetinaIcons=this.setEnableRetinaIcons.bind(this),this.addToClosestCluster=this.addToClosestCluster.bind(this),this.getImageExtension=this.getImageExtension.bind(this),this.setImageExtension=this.setImageExtension.bind(this),this.getExtendedBounds=this.getExtendedBounds.bind(this),this.getAverageCenter=this.getAverageCenter.bind(this),this.setAverageCenter=this.setAverageCenter.bind(this),this.getTotalClusters=this.getTotalClusters.bind(this),this.fitMapToMarkers=this.fitMapToMarkers.bind(this),this.getIgnoreHidden=this.getIgnoreHidden.bind(this),this.setIgnoreHidden=this.setIgnoreHidden.bind(this),this.getClusterClass=this.getClusterClass.bind(this),this.setClusterClass=this.setClusterClass.bind(this),this.getTotalMarkers=this.getTotalMarkers.bind(this),this.getZoomOnClick=this.getZoomOnClick.bind(this),this.setZoomOnClick=this.setZoomOnClick.bind(this),this.getBatchSizeIE=this.getBatchSizeIE.bind(this),this.setBatchSizeIE=this.setBatchSizeIE.bind(this),this.createCluster
19s=this.createClusters.bind(this),this.onZoomChanged=this.onZoomChanged.bind(this),this.getImageSizes=this.getImageSizes.bind(this),this.setImageSizes=this.setImageSizes.bind(this),this.getCalculator=this.getCalculator.bind(this),this.setCalculator=this.setCalculator.bind(this),this.removeMarkers=this.removeMarkers.bind(this),this.resetViewport=this.resetViewport.bind(this),this.getImagePath=this.getImagePath.bind(this),this.setImagePath=this.setImagePath.bind(this),this.pushMarkerTo=this.pushMarkerTo.bind(this),this.removeMarker=this.removeMarker.bind(this),this.clearMarkers=this.clearMarkers.bind(this),this.setupStyles=this.setupStyles.bind(this),this.getGridSize=this.getGridSize.bind(this),this.setGridSize=this.setGridSize.bind(this),this.getClusters=this.getClusters.bind(this),this.getMaxZoom=this.getMaxZoom.bind(this),this.setMaxZoom=this.setMaxZoom.bind(this),this.getMarkers=this.getMarkers.bind(this),this.addMarkers=this.addMarkers.bind(this),this.getStyles=this.getStyles.bind(this),this.setStyles=this.setStyles.bind(this),this.addMarker=this.addMarker.bind(this),this.onRemove=this.onRemove.bind(this),this.getTitle=this.getTitle.bind(this),this.setTitle=this.setTitle.bind(this),this.repaint=this.repaint.bind(this),this.onIdle=this.onIdle.bind(this),this.redraw=this.redraw.bind(this),this.onAdd=this.onAdd.bind(this),this.draw=this.draw.bind(this),this.extend=this.extend.bind(this),this.extend(n,google.maps.OverlayView),this.markers=[],this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=s.gridSize||60,this.minClusterSize=s.minimumClusterSize||2,this.maxZoom=s.maxZoom||null,this.styles=s.styles||[],this.title=s.title||"",this.zoomOnClick=!0,s.zoomOnClick!==void 0&&(this.zoomOnClick=s.zoomOnClick),this.averageCenter=!1,s.averageCenter!==void 0&&(this.averageCenter=s.averageCenter),this.ignoreHidden=!1,s.ignoreHidden!==void 0&&(this.ignoreHidden=s.ignoreHidden),this.enableRetinaIcons=!1,s.enableRetinaIcons!==void 0&&(this.enableRetinaIcons=s.enableRetinaIcons),this.imagePath=s.imagePath||Wr,this.imageExtension=s.imageExtension||Kr,this.imageSizes=s.imageSizes||Gr,this.calculator=s.calculator||Vr,this.batchSize=s.batchSize||Hr,this.batchSizeIE=s.batchSizeIE||Zr,this.clusterClass=s.clusterClass||Jr,navigator.userAgent.toLowerCase().indexOf("msie")!==-1&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(t,!0),this.setMap(e)}return n.prototype.onZoomChanged=function(){var e,t;this.resetViewport(!1),(((e=this.getMap())===null||e===void 0?void 0:e.getZoom())===(this.get("minZoom")||0)||((t=this.getMap())===null||t===void 0?void 0:t.getZoom())===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")},n.prototype.onIdle=function(){this.redraw()},n.prototype.onAdd=function(){var e=this.getMap();this.activeMap=e,this.ready=!0,this.repaint(),e!==null&&(this.listeners=[google.maps.event.addListener(e,"zoom_changed",this.onZoomChanged),google.maps.event.addListener(e,"idle",this.onIdle)])},n.prototype.onRemove=function(){for(var e=0,t=this.markers;e<t.length;e++){var s=t[e];s.getMap()!==this.activeMap&&s.setMap(this.activeMap)}
19for(var i=0,r=this.clusters;i<r.length;i++){var o=r[i];o.remove()}this.clusters=[];for(var a=0,l=this.listeners;a<l.length;a++){var u=l[a];google.maps.event.removeListener(u)}this.listeners=[],this.activeMap=null,this.ready=!1},n.prototype.draw=function(){},n.prototype.getMap=function(){return null},n.prototype.getPanes=function(){return null},n.prototype.getProjection=function(){return{fromContainerPixelToLatLng:function(){return null},fromDivPixelToLatLng:function(){return null},fromLatLngToContainerPixel:function(){return null},fromLatLngToDivPixel:function(){return null},getVisibleRegion:function(){return null},getWorldWidth:function(){return 0}}},n.prototype.setMap=function(){},n.prototype.addListener=function(){return{remove:function(){}}},n.prototype.bindTo=function(){},n.prototype.get=function(){},n.prototype.notify=function(){},n.prototype.set=function(){},n.prototype.setValues=function(){},n.prototype.unbind=function(){},n.prototype.unbindAll=function(){},n.prototype.setupStyles=function(){if(!(this.styles.length>0))for(var e=0;e<this.imageSizes.length;e++)this.styles.push({url:"".concat(this.imagePath+(e+1),".").concat(this.imageExtension),height:this.imageSizes[e]||0,width:this.imageSizes[e]||0})},n.prototype.fitMapToMarkers=function(){for(var e=this.getMarkers(),t=new google.maps.LatLngBounds,s=0,i=e;s<i.length;s++){var r=i[s],o=r.getPosition();o&&t.extend(o)}var a=this.getMap();a!==null&&"fitBounds"in a&&a.fitBounds(t)},n.prototype.getGridSize=function(){return this.gridSize},n.prototype.setGridSize=function(e){this.gridSize=e},n.prototype.getMinimumClusterSize=function(){return this.minClusterSize},n.prototype.setMinimumClusterSize=function(e){this.minClusterSize=e},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.setMaxZoom=function(e){this.maxZoom=e},n.prototype.getStyles=function(){return this.styles},n.prototype.setStyles=function(e){this.styles=e},n.prototype.getTitle=function(){return this.title},n.prototype.setTitle=function(e){this.title=e},n.prototype.getZoomOnClick=function(){return this.zoomOnClick},n.prototype.setZoomOnClick=function(e){this.zoomOnClick=e},n.prototype.getAverageCenter=function(){return this.averageCenter},n.prototype.setAverageCenter=function(e){this.averageCenter=e},n.prototype.getIgnoreHidden=function(){return this.ignoreHidden},n.prototype.setIgnoreHidden=function(e){this.ignoreHidden=e},n.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},n.prototype.setEnableRetinaIcons=function(e){this.enableRetinaIcons=e},n.prototype.getImageExtension=function(){return this.imageExtension},n.prototype.setImageExtension=function(e){this.imageExtension=e},n.prototype.getImagePath=function(){return this.imagePath},n.prototype.setImagePath=function(e){this.imagePath=e},n.prototype.getImageSizes=function(){return this.imageSizes},n.prototype.setImageSizes=function(e){this.imageSizes=e},n.prototype.getCalculator=function(){return this.calculator},n.prototype.setCalculator=function(e){this.calculator=e},n.prototype.getBatchSizeIE=function(){return this.batchSizeIE},n.prototype.setBatchSizeIE=function(e){this.batchSizeIE=e},n.prototype.getClusterClass=function(){return this.clusterClass},n.prototype.setClusterClass=function(e){this.clusterClass=e},n.prototype.getMarkers=function(){return this.markers},n.prototype.getTotalMarkers=function(){return this.markers.length},n.prototype.getClusters=function(){return this.clusters},n.prototype.getTotalClusters=function(){return this.clusters.length},n.prototype.addMarker=function(e,t){this.pushMarkerTo(e),t||this.redraw()},n.prototype.addMarkers=function(e,t){for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var i=e[s];i&&this.pushMarkerTo(i)}t||this.redraw()},n.prototype.pushMarkerTo=function(e){var t=this;e.getDraggable()&&google.maps.event.addListener(e,"dragend",function(){t.ready&&(e.isAdded=!1,t.repaint())}),e.isAdded=!1,this.markers.push(e)},n.prototype.removeMarker_=function(e){var t=-1;if(this.markers.indexOf)t=this.markers.indexOf(e);else for(var s=0;s<this.markers.length;s++)if(e===this.markers[s]){t=s;break}return t===-1?!1:(e.setMap(null),this.markers.splice(t,1),!0)},n.prototype.removeMarker=function(e,t){var s=this.removeMarker_(e);return!t&&s&&this.repaint(),s},n.prototype.removeMarkers=function(e,t){for(var s=!1,i=0,r=e;i<r.length;i++){var o=r[i];s=s||this.removeMarker_(o)}return!t&&s&&this.repaint(),s},n.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]}
19,n.prototype.repaint=function(){var e=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout(function(){for(var s=0,i=e;s<i.length;s++){var r=i[s];r.remove()}},0)},n.prototype.getExtendedBounds=function(e){var t=this.getProjection(),s=t.fromLatLngToDivPixel(new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()));s!==null&&(s.x+=this.gridSize,s.y-=this.gridSize);var i=t.fromLatLngToDivPixel(new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()));if(i!==null&&(i.x-=this.gridSize,i.y+=this.gridSize),s!==null){var r=t.fromDivPixelToLatLng(s);r!==null&&e.extend(r)}if(i!==null){var o=t.fromDivPixelToLatLng(i);o!==null&&e.extend(o)}return e},n.prototype.redraw=function(){this.createClusters(0)},n.prototype.resetViewport=function(e){for(var t=0,s=this.clusters;t<s.length;t++){var i=s[t];i.remove()}this.clusters=[];for(var r=0,o=this.markers;r<o.length;r++){var a=o[r];a.isAdded=!1,e&&a.setMap(null)}},n.prototype.distanceBetweenPoints=function(e,t){var s=6371,i=(t.lat()-e.lat())*Math.PI/180,r=(t.lng()-e.lng())*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2);return s*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},n.prototype.isMarkerInBounds=function(e,t){var s=e.getPosition();return s?t.contains(s):!1},n.prototype.addToClosestCluster=function(e){for(var t,s=4e4,i=null,r=0,o=this.cluster
19s;r<o.length;r++){var a=o[r];t=a;var l=t.getCenter(),u=e.getPosition();if(l&&u){var c=this.distanceBetweenPoints(l,u);c<s&&(s=c,i=t)}}i&&i.isMarkerInClusterBounds(e)?i.addMarker(e):(t=new zr(this),t.addMarker(e),this.clusters.push(t))},n.prototype.createClusters=function(e){var t=this;if(this.ready){e===0&&(google.maps.event.trigger(this,"clusteringbegin",this),this.timerRefStatic!==null&&(window.clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var s=this.getMap(),i=s!==null&&("getBounds"in s)?s.getBounds():null,r=(s==null?void 0:s.getZoom())||0,o=r>3?new google.maps.LatLngBounds(i==null?void 0:i.getSouthWest(),i==null?void 0:i.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),a=this.getExtendedBounds(o),l=Math.min(e+this.batchSize,this.markers.length),u=e;u<l;u++){var c=this.markers[u];c&&!c.isAdded&&this.isMarkerInBounds(c,a)&&(!this.ignoreHidden||this.ignoreHidden&&c.getVisible())&&this.addToClosestCluster(c)}if(l<this.markers.length)this.timerRefStatic=window.setTimeout(function(){t.createClusters(l)},0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);
19for(var d=0,p=this.clusters;d<p.length;d++){var f=p[d];f.updateIcon()}}}},n.prototype.extend=function(e,t){return(function(i){for(var r in i.prototype){var o=r;this.prototype[o]=i.prototype[o]}return this}).apply(e,[t])},n}();function Un(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function qr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Un(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var pe={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},Y={averageCenter(n,e){n.setAverageCenter(e)},batchSizeIE(n,e){n.setBatchSizeIE(e)},calculator(n,e){n.setCalculator(e)},clusterClass(n,e){n.setClusterClass(e)},enableRetinaIcons(n,e){n.setEnableRetinaIcons(e)},gridSize(n,e){n.setGridSize(e)},ignoreHidden(n,e){n.setIgnoreHidden(e)},imageExtension(n,e){n.setImageExtension(e)},imagePath(n,e){n.setImagePath(e)},imageSizes(n,e){n.setImageSizes(e)},maxZoom(n,e){n.setMaxZoom(e)},minimumClusterSize(n,e){n.setMinimumClusterSize(e)},styles(n,e){n.setStyles(e)},title(n,e){n.setTitle(e)},zoomOnClick(n,e){n.setZoomOnClick(e)}},Yr={};function Qr(n){var{children:e,options:t,averageCenter:s,batchSizeIE:i,calculator:r,clusterClass:o,enableRetinaIcons:a,gridSize:l,ignoreHidden:u,imageExtension:c,imagePath:d,imageSizes:p,maxZoom:f,minimumClusterSize:h,styles:w,title:m,zoomOnClick:E,onClick:x,onClusteringBegin:P,onClusteringEnd:L,onMouseOver:v,onMouseOut:b,onLoad:S,onUnmount:k}=n,[M,I]=y(null),D=oe(F),[B,W]=y(null),[T,j]=y(null),[V,Q]=y(null),[N,K]=y(null),[z,J]=y(null);return g(()=>{M&&b&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(M,pe.onMouseOut,b)))},[b]),g(()=>{M&&v&&(z!==null&&google.maps.event.removeListener(z),J(google.maps.event.addListener(M,pe.onMouseOver,v)))},[v]),g(()=>{M&&x&&(B!==null&&google.maps.event.removeListener(B),W(google.maps.event.addListener(M,pe.onClick,x)))},[x]),g(()=>{M&&P&&(T!==null&&google.maps.event.removeListener(T),j(google.maps.event.addListener(M,pe.onClusteringBegin,P)))},[P]),g(()=>{M&&L&&(V!==null&&google.maps.event.removeListener(V),j(google.maps.event.addListener(M,pe.onClusteringEnd,L)))},[L]),g(()=>{typeof s<"u"&&M!==null&&Y.averageCenter(M,s)},[M,s]),g(()=>{typeof i<"u"&&M!==null&&Y.batchSizeIE(M,i)},[M,i]),g(()=>{typeof r<"u"&&M!==null&&Y.calculator(M,r)},[M,r]),g(()=>{typeof o<"u"&&M!==null&&Y.clusterClass(M,o)},[M,o]),g(()=>{typeof a<"u"&&M!==null&&Y.enableRetinaIcons(M,a)},[M,a]),g(()=>{typeof l<"u"&&M!==null&&Y.gridSize(M,l)},[M,l]),g(()=>{typeof u<"u"&&M!==null&&Y.ignoreHidden(M,u)},[M,u]),g(()=>{typeof c<"u"&&M!==null&&Y.imageExtension(M,c)},[M,c]),g(()=>{typeof d<"u"&&M!==null&&Y.imagePath(M,d)},[M,d]),g(()=>{typeof p<"u"&&M!==null&&Y.imageSizes(M,p)},[M,p]),g(()=>{typeof f<"u"&&M!==null&&Y.maxZoom(M,f)},[M,f]),g(()=>{typeof h<"u"&&M!==null&&Y.minimumClusterSize(M,h)},[M,h]),g(()=>{typeof w<"u"&&M!==null&&Y.styles(M,w)},[M,w]),g(()=>{typeof m<"u"&&M!==null&&Y.title(M,m)},[M,m]),g(()=>{typeof E<"u"&&M!==null&&Y.zoomOnClick(M,E)},[M,E]),g(()=>{if(D){var X=qr({},t||Yr),U=new ni(D,[],X);return s&&Y.averageCenter(U,s),i&&Y.batchSizeIE(U,i),r&&Y.calculator(U,r),o&&Y.clusterClass(U,o),a&&Y.enableRetinaIcons(U,a),l&&Y.gridSize(U,l),u&&Y.ignoreHidden(U,u),c&&Y.imageExtension(U,c),d&&Y.imagePath(U,d),p&&Y.imageSizes(U,p),f&&Y.maxZoom(U,f),h&&Y.minimumClusterSize(U,h),w&&Y.styles(U,w),m&&Y.title(U,m),E&&Y.zoomOnClick(U,E),b&&K(google.maps.event.addListener(U,pe.onMouseOut,b)),v&&J(google.maps.event.addListener(U,pe.onMouseOver,v)),x&&W(google.maps.event.addListener(U,pe.onClick,x)),P&&j(google.maps.event.addListener(U,pe.onClusteringBegin,P)),L&&Q(google.maps.event.addListener(U,pe.onClusteringEnd,L)),I(U),S&&S(U),()=>{N!==null&&google.maps.event.removeListener(N),z!==null&&google.maps.event.removeListener(z),B!==null&&google.maps.event.removeListener(B),T!==null&&google.maps.event.removeListener(T),V!==null&&google.maps.event.removeListener(V),k&&k(U)}}},[]),M!==null&&e(M)||null}le(Qr);class Xr extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{markerClusterer:null}),C(this,"setClustererCallback",()=>{this.state.markerClusterer!==null&&this.props.onLoad&&this.props.onLoad(this.state.markerClusterer)})}componentDidMount(){if(this.context){var e=new ni(this.context,[],this.props.options);this.registeredEvents=Z({updaterMap:Y,eventMap:pe,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({markerClusterer:e}),this.setClustererCallback)}}componentDidUpdate(e){this.state.markerClusterer&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Y,eventMap:pe,prevProps:e,nextProps:this.props,instance:this.state.markerClusterer}))}componentWillUnmount(){this.state.markerClusterer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),G(this.registeredEvents),this.state.markerClusterer.setMap(null))}render(){return this.state.markerClusterer!==null?this.props.children(this.state.markerClusterer):null}}C(Xr,"contextType",F);function _n(n){n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation()}var si=function(){function n(e){e===void 0&&(e={}),this.getCloseClickHandler=this.getCloseClickHandler.bind(this),this.closeClickHandler=this.closeClickHandler.bind(this),this.createInfoBoxDiv=this.createInfoBoxDiv.bind(this),this.addClickHandler=this.addClickHandler.bind(this),this.getCloseBoxImg=this.getCloseBoxImg.b
19ind(this),this.getBoxWidths=this.getBoxWidths.bind(this),this.setBoxStyle=this.setBoxStyle.bind(this),this.setPosition=this.setPosition.bind(this),this.getPosition=this.getPosition.bind(this),this.setOptions=this.setOptions.bind(this),this.setContent=this.setContent.bind(this),this.setVisible=this.setVisible.bind(this),this.getContent=this.getContent.bind(this),this.getVisible=this.getVisible.bind(this),this.setZIndex=this.setZIndex.bind(this),this.getZIndex=this.getZIndex.bind(this),this.onRemove=this.onRemove.bind(this),this.panBox=this.panBox.bind(this),this.extend=this.extend.bind(this),this.close=this.close.bind(this),this.draw=this.draw.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.open=this.open.bind(this),this.extend(n,google.maps.OverlayView),this.content=e.content||"",this.disableAutoPan=e.disableAutoPan||!1,this.maxWidth=e.maxWidth||0,this.pixelOffset=e.pixelOffset||new google.maps.Size(0,0),this.position=e.position||new google.maps.LatLng(0,0),this.zIndex=e.zIndex||null,this.boxClass=e.boxClass||"infoBox",this.boxStyle=e.boxStyle||{},this.closeBoxMargin=e.closeBoxMargin||"2px",this.closeBoxURL=e.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",e.closeBoxURL===""&&(this.closeBoxURL=""),this.infoBoxClearance=e.infoBoxClearance||new google.maps.Size(1,1),typeof e.visible>"u"&&(typeof e.isHidden>"u"?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return n.prototype.createInfoBoxDiv=function(){var e=this,t=function(c){c.returnValue=!1,c.preventDefault&&c.preventDefault(),e.enableEventPropagation||_n(c)};if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),typeof this.content=="string"?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var s=this.getPanes();if(s!==null&&s[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(this.maxWidth!==0&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var i=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-i.left-i.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var r=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],o=0,a=r;o<a.length;o++){var l=a[o];this.eventListeners.push(google.maps.event.addListener(this.div,l,_n))}this.eventListeners.push(google.maps.event.addListener(this.div,"mouseover",function(){e.div&&(e.div.style.cursor="default")}))}this.contextListener=google.maps.event.addListener(this.div,"contextmenu",t),google.maps.event.trigger(this,"domready")}},n.prototype.getCloseBoxImg=function(){var e="";return this.closeBoxURL!==""&&(e='<img alt=""',e+=' aria-hidden="true"',e+=" src='"+this.closeBoxURL+"'",e+=" align=right",e+=" style='",e+=" position: relative;",e+=" cursor: pointer;",e+=" margin: "+this.closeBoxMargin+";",e+="'>"),e},n.prototype.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&this.closeBoxURL!==""?google.maps.event.addListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},n.prototype.closeClickHandler=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(this,"closeclick"),this.close()},n.prototype.getCloseClickHandler=function(){return this.closeClickHandler},n.prototype.panBox=function(e){if(this.div&&!e){var t=this.getMap();if(t instanceof google.maps.Map){var s=0,i=0,r=t.getBounds();r&&!r.contains(this.position)&&t.setCenter(this.position);var o=t.getDiv(),a=o.offsetWidth,l=o.offsetHeight,u=this.pixelOffset.width,c=this.pixelOffset.height,d=this.div.offsetWidth,p=this.div.offsetHeight,f=this.infoBoxClearance.width,h=this.infoBoxClearance.height,w=this.getProjection(),m=w.fromLatLngToContainerPixel(this.position);m!==null&&(m.x<-u+f?s=m.x+u-f:m.x+d+u+f>a&&(s=m.x+d+u+f-a),this.alignBottom?m.y<-c+h+p?i=m.y+c-h-p:m.y+c+h>l&&(i=m.y+c+h-l):m.y<-c+h?i=m.y+c-h:m.y+p+c+h>l&&(i=m.y+p+c+h-l)),s===0&&i===0||t.panBy(s,i)}}},n.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.div.style[t]=e[t]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var s=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+s*100+')"',this.div.style.filter="alpha(opacity="+s*100+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",this.zIndex!==null&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},n.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var t=this.div.ownerDocument,s=t&&t.defaultView?t.defaultView.getComputedStyle(this.div,""):null;s&&(e.top=parseInt(s.borderTopWidth||"",10)||0,e.bottom=parseInt(s.borderBottomWidth||"",10)||0,e.left=parseInt(s.borderLeftWidth||"",10)||0,e.right=parseInt(s.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var i=this.div.currentStyle;i&&(e.top=parseInt(i.borderTopWidth||"",10)||0,e.bottom=parseInt(i.borderBottomWidth||"",10)||0,e.left=parseInt(i.borderLeftWidth||"",10)||0,e.right=parseInt(i.borderRightWidth||"",10)||0)}return e},n.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},n.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),t=e.fromLatLngToDivPixel(this.position);t!==null&&(this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},n.prototype.setOptions=function(e){e===void 0&&(e={}),typeof e.boxClass<"u"&&(this.boxClass=e.boxClass,this.setBoxStyle()),typeof e.boxStyle<"u"&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),typeof e.content<"u"&&this.setContent(e.content),typeof e.disableAutoPan<"u"&&(this.disableAutoPan=e.disableAutoPan),typeof e.maxWidth<"u"&&(this.maxWidth=e.maxWidth),typeof e.pixelOffset<"u"&&(this.pixelOffset=e.pixelOffset),typeof e.alignBottom<"u"&&(this.alignBottom=e.alignBottom),typeof e.position<"u"&&this.setPosition(e.position),typeof e.zIndex<"u"&&this.setZIndex(e.zIndex),typeof e.closeBoxMargin<"u"&&(this.closeBoxMargin=e.closeBoxMargin),typeof e.closeBoxURL<"u"&&(this.closeBoxURL=e.closeBoxURL),typeof e.infoBoxClearance<"u"&&(this.infoBoxClearance=e.infoBoxClearance),typeof e.isHidden<"u"&&(this.isHidden=e.isHidden),typeof e.visible<"u"&&(this.isHidden=!e.visible),typeof e.enableEventPropagation<"u"&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},n.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px",typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},n.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},n.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},n.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},n.prototype.getContent=function(){return this.content},n.prototype.getPosition=function(){return this.position},n.prototype.getZIndex=function(){return this.zIndex},n.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},n.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},n.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},n.prototype.open=function(e,t){var s=this;t&&(this.position=t.getPosition(),this.moveListener=google.maps.event.addListener(t,"position_changed",function(){var i=t.getPosition();s.setPosition(i)}),this.mapListener=google.maps.event.addListener(t,"map_changed",function(){s.setMap(t.map)})),this.setMap(e),this.div&&this.panBox()},n.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,t=this.eventListeners;e<t.length;e++){var s=t[e];google.maps.event.removeListener(s)}this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},n.prototype.extend=function(e,t){return(function(i){for(var r in i.prototype)Object.prototype.hasOwnProperty.call(this,r)||(this.prototype[r]=i.prototype[r]);return this}).apply(e,[t])},n}(),eo=["position"],to=["position"];function Bn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function pt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
19e%2?Bn(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bn(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var $n={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Fn={options(n,e){n.setOptions(e)},position(n,e){e instanceof google.maps.LatLng?n.setPosition(e):n.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible(n,e){n.setVisible(e)},zIndex(n,e){n.setZIndex(e)}},no={};function so(n){var{children:e,anchor:t,options:s,position:i,zIndex:r,onCloseClick:o,onDomReady:a,onContentChanged:l,onPositionChanged:u,onZindexChanged:c,onLoad:d,onUnmount:p}=n,f=oe(F),[h,w]=y(null),[m,E]=y(null),[x,P]=y(null),[L,v]=y(null),[b,S]=y(null),[k,M]=y(null),I=he(null);return g(()=>{f&&h!==null&&(h.close(),t?h.open(f,t):h.getPosition()&&h.open(f))},[f,h,t]),g(()=>{s&&h!==null&&h.setOptions(s)},[h,s]),g(()=>{if(i&&h!==null){var D=i instanceof google.maps.LatLng?i:new google.maps.LatLng(i.lat,i.lng);h.setPosition(D)}},[i]),g(()=>{typeof r=="number"&&h!==null&&h.setZIndex(r)},[r]),g(()=>{h&&o&&(m!==null&&google.maps.event.removeListener(m),E(google.maps.event.addListener(h,"closeclick",o)))},[o]),g(()=>{h&&a&&(x!==null&&google.maps.event.removeListener(x),P(google.maps.event.addListener(h,"domready",a)))},[a]),g(()=>{h&&l&&(L!==null&&google.maps.event.removeListener(L),v(google.maps.event.addListener(h,"content_changed",l)))},[l]),g(()=>{h&&u&&(b!==null&&google.maps.event.removeListener(b),S(google.maps.event.addListener(h,"position_changed",u)))},[u]),g(()=>{h&&c&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(h,"zindex_changed",c)))},[c]),g(()=>{if(f){var D=s||no,{position:B}=D,W=At(D,eo),T;B&&!(B instanceof google.maps.LatLng)&&(T=new google.maps.LatLng(B.lat,B.lng));var j=new si(pt(pt({},W),T?{position:T}:{}));I.current=document.createElement("div"),w(j),o&&E(google.maps.event.addListener(j,"closeclick",o)),a&&P(google.maps.event.addListener(j,"domready",a)),l&&v(google.maps.event.addListener(j,"content_changed",l)),u&&S(google.maps.event.addListener(j,"position_changed",u)),c&&M(google.maps.event.addListener(j,"zindex_changed",c)),j.setContent(I.current),t?j.open(f,t):j.getPosition()?j.open(f):ae(!1,"You must provide either an anchor or a position prop for <InfoBox>."),d&&d(j)}return()=>{h!==null&&(m&&google.maps.event.removeListener(m),L&&google.maps.event.removeListener(L),x&&google.maps.event.removeListener(x),b&&google.maps.event.removeListener(b),k&&google.maps.event.removeListener(k),p&&p(h),h.close())}},[]),I.current?yt(ve.only(e),I.current):null}le(so);class io extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"containerElement",null),C(this,"state",{infoBox:null}),C(this,"open",(e,t)=>{t?this.context!==null&&e.open(this.context,t):e.getPosition()?this.context!==null&&e.open(this.context):ae(!1,"You must provide either an anchor or a position prop for <InfoBox>.")}),C(this,"setInfoBoxCallback",()=>{this.state.infoBox!==null&&this.containerElement!==null&&(this.state.infoBox.setContent(this.containerElement),this.open(this.state.infoBox,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoBox))})}componentDidMount(){var e=this.props.options||{},{position:t}=e,s=At(e,to),i;t&&!(t instanceof google.maps.LatLng)&&(i=new google.maps.LatLng(t.lat,t.lng));var r=new si(pt(pt({},s),i?{position:i}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Z({updaterMap:Fn,eventMap:$n,prevProps:{},nextProps:this.props,instance:r}),this.setState({infoBox:r},this.setInfoBoxCallback)}componentDidUpdate(e){var{infoBox:t}=this.state;t!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Fn,eventMap:$n,prevProps:e,nextProps:this.props,instance:t}))}componentWillUnmount(){var{onUnmount:e}=this.props,{infoBox:t}=this.state;t!==null&&(e&&e(t),G(this.registeredEvents),t.close())}render(){return this.containerElement?yt(ve.only(this.props.children),this.containerElement):null}}C(io,"contextType",F);var Mt,zn;function ro(){return zn||(zn=1,Mt=function n(e,t){if(e===t)return!0;
19if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var s,i,r;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!n(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(r=Object.keys(e),s=r.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=s;i--!==0;){var o=r[i];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}),Mt}var oo=ro(),Vn=Ys(oo),Hn=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ot=1,Te=8;class Ut{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var[t,s]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");var i=s>>4;if(i!==Ot)throw new Error("Got v".concat(i," data when expected v").concat(Ot,"."));var r=Hn[s&15];if(!r)throw new Error("Unrecognized array type.");var[o]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new Ut(a,o,r,e)}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:64,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Float64Array,i=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;var r=Hn.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(r<0)throw new Error("Unexpected typed array class: ".concat(s,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,Te,e),this.coords=new this.ArrayType(this.data,Te+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Te+o+a+l),this.ids=new this.IndexArrayType(this.data,Te,e),this.coords=new this.ArrayType(this.data,Te+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Ot<<4)+r]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){var s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=t,s}finish(){var e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Rt(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,s,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:r,coords:o,nodeSize:a}=this,l=[0,r.length-1,0],u=[];l.length;){var c=l.pop()||0,d=l.pop()||0,p=l.pop()||0;if(d-p<=a){for(var f=p;f<=d;f++){var h=o[2*f],w=o[2*f+1];h>=e&&h<=s&&w>=t&&w<=i&&u.push(r[f])}continue}var m=p+d>>1,E=o[2*m],x=o[2*m+1];E>=e&&E<=s&&x>=t&&x<=i&&u.push(r[m]),(c===0?e<=E:t<=x)&&(l.push(p),l.push(m-1),l.push(1-c)),(c===0?s>=E:i>=x)&&(l.push(m+1),l.push(d),l.push(1-c))}return u}within(e,t,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:i,coords:r,nodeSize:o}=this,a=[0,i.length-1,0],l=[],u=s*s;a.length;){var c=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=o){for(var f=p;f<=d;f++)Zn(r[2*f],r[2*f+1],e,t)<=u&&l.push(i[f]);continue}var h=p+d>>1,w=r[2*h],m=r[2*h+1];Zn(w,m,e,t)<=u&&l.push(i[h]),(c===0?e-s<=w:t-s<=m)&&(a.push(p),a.push(h-1),a.push(1-c)),(c===0?e+s>=w:t+s>=m)&&(a.push(h+1),a.push(d),a.push(1-c))}return l}}function Rt(n,e,t,s,i,r){if(!(i-s<=t)){var o=s+i>>1;ii(n,e,o,s,i,r),Rt(n,e,t,s,o-1,1-r),Rt(n,e,t,o+1,i,1-r)}}function ii(n,e,t,s,i,r){for(;i>s;){if(i-s>600){var o=i-s+1,a=t-s+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(a-o/2<0?-1:1),d=Math.max(s,Math.floor(t-a*u/o+c)),p=Math.min(i,Math.floor(t+(o-a)*u/o+c));ii(n,e,t,d,p,r)}var f=e[2*t+r],h=s,w=i;for(je(n,e,s,t),e[2*i+r]>f&&je(n,e,s,i);h<w;){for(je(n,e,h,w),h++,w--;e[2*h+r]<f;)h++;for(;e[2*w+r]>f;)w--}e[2*s+r]===f?je(n,e,s,w):(w++,je(n,e,w,i)),w<=t&&(s=w+1),t<=w&&(i=w-1)}}function je(n,e,t,s){St(n,t,s),St(e,2*t,2*s),St(e,2*t+1,2*s+1)}function St(n,e,t){var s=n[e];n[e]=n[t],n[t]=s}function Zn(n,e,t,s){var i=n-t,r=e-s;return i*i+r*r}var ao={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},Wn=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),Ce=2,Le=3,Et=4,ye=5,ri=6;class lo{constructor(e){this.options=Object.assign(Object.create(ao),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){var{log:t,minZoom:s,maxZoom:i}=this.options;t&&console.time("total time");var r="prepare ".concat(e.length," points");t&&console.time(r),this.points=e;for(var o=[],a=0;a<e.length;a++){var l=e[a];if(l.geometry){var[u,c]=l.geometry.coordinates,d=Wn(nt(u)),p=Wn(st(c));o.push(d,p,1/0,a,-1,1),this.options.reduce&&o.push(0)}}var f=this.trees[i+1]=this._createTree(o);t&&console.timeEnd(r);for(var h=i;h>=s;h--){var w=+Date.now();f=this.trees[h]=this._createTree(this._cluster(f,h)),t&&console.log("z%d: %d clusters in %dms",h,f.numItems,+Date.now()-w)}return t&&console.timeEnd("total time"),this}getClusters(e,t){var s=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),r=e[2]===180?180:((e[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)s=-180,r=180;else if(s>r){var a=this.getClusters([s,i,180,o],t),l=this.getClusters([-180,i,r,o
19],t);return a.concat(l)}var u=this.trees[this._limitZoom(t)],c=u.range(nt(s),st(o),nt(r),st(i)),d=u.data,p=[];for(var f of c){var h=this.stride*f;p.push(d[h+ye]>1?Kn(d,h,this.clusterProps):this.points[d[h+Le]])}return p}getChildren(e){var t=this._getOriginId(e),s=this._getOriginZoom(e),i="No cluster with the specified id.",r=this.trees[s];if(!r)throw new Error(i);var o=r.data;if(t*this.stride>=o.length)throw new Error(i);var a=this.options.radius/(this.options.extent*Math.pow(2,s-1)),l=o[t*this.stride],u=o[t*this.stride+1],c=r.within(l,u,a),d=[];for(var p of c){var f=p*this.stride;o[f+Et]===e&&d.push(o[f+ye]>1?Kn(o,f,this.clusterProps):this.points[o[f+Le]])}if(d.length===0)throw new Error(i);return d}getLeaves(e,t,s){t=t||10,s=s||0;var i=[];return this._appendLeaves(i,e,t,s,0),i}getTile(e,t,s){var i=this.trees[this._limitZoom(e)],r=Math.pow(2,e),{extent:o,radius:a}=this.options,l=a/o,u=(s-l)/r,c=(s+1+l)/r,d={features:[]};return this._addTileFeatures(i.range((t-l)/r,u,(t+1+l)/r,c),i.data,t,s,r,d),t===0&&this._addTileFeatures(i.range(1-l/r,u,1,c),i.data,r,s,r,d),t===r-1&&this._addTileFeatures(i.range(0,u,l/r,c),i.data,-1,s,r,d),d.features.length?d:null}getClusterExpansionZoom(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var s=this.getChildren(e);if(t++,s.length!==1)break;e=s[0].properties.cluster_id}return t}_appendLeaves(e,t,s,i,r){var o=this.getChildren(t);for(var a of o){var l=a.properties;if(l&&l.cluster?r+l.point_count<=i?r+=l.point_count:r=this._appendLeaves(e,l.cluster_id,s,i,r):r<i?r++:e.push(a),e.length===s)break}return r}_createTree(e){for(var t=new Ut(e.length/this.stride|0,this.options.nodeSize,Float32Array),s=0;s<e.length;s+=this.stride)t.add(e[s],e[s+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,s,i,r,o){for(var a of e){var l=a*this.stride,u=t[l+ye]>1,c=void 0,d=void 0,p=void 0;if(u)c=oi(t,l,this.clusterProps),d=t[l],p=t[l+1];else{var f=this.points[t[l+Le]];c=f.properties;var[h,w]=f.geometry.coordinates;d=nt(h),p=st(w)}var m={type:1,geometry:[[Math.round(this.options.extent*(d*r-s)),Math.round(this.options.extent*(p*r-i))]],tags:c},E=void 0;u||this.options.generateId?E=t[l+Le]:E=this.points[t[l+Le]].id,E!==void 0&&(m.id=E),o.features.push(m)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){for(var{radius:s,extent:i,reduce:r,minPoints:o}=this.options,a=s/(i*Math.pow(2,t)),l=e.data,u=[],c=this.stride,d=0;d<l.length;d+=c)if(!(l[d+Ce]<=t)){l[d+Ce]=t;var p=l[d],f=l[d+1],h=e.within(l[d],l[d+1],a),w=l[d+ye],m=w;for(var E of h){var x=E*c;l[x+Ce]>t&&(m+=l[x+ye])}if(m>w&&m>=o){var P=p*w,L=f*w,v=void 0,b=-1,S=((d/c|0)<<5)+(t+1)+this.points.length;for(var k of h){var M=k*c;if(!(l[M+Ce]<=t)){l[M+Ce]=t;var I=l[M+ye];P+=l[M]*I,L+=l[M+1]*I,l[M+Et]=S,r&&(v||(v=this._map(l,d,!0),b=this.clusterProps.length,this.clusterProps.push(v)),r(v,this._map(l,M)))}}l[d+Et]=S,u.push(P/m,L/m,1/0,S,-1,m),r&&u.push(b)}else{for(var D=0;D<c;D++)u.push(l[d+D]);if(m>1)for(var B of h){var W=B*c;if(!(l[W+Ce]<=t)){l[W+Ce]=t;for(var T=0;T<c;T++)u.push(l[W+T])}}}}return u}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,s){if(e[t+ye]>1){var i=this.clusterProps[e[t+ri]];return s?Object.assign({},i):i}var r=this.points[e[t+Le]].properties,o=this.options.map(r);return s&&o===r?Object.assign({},o):o}}function Kn(n,e,t){return{type:"Feature",id:n[e+Le],properties:oi(n,e,t),geometry:{type:"Point",coordinates:[uo(n[e]),co(n[e+1])]}}}function oi(n,e,t){var s=n[e+ye],i=s>=1e4?"".concat(Math.round(s/1e3),"k"):s>=1e3?"".concat(Math.round(s/100)/10,"k"):s,r=n[e+ri],o=r===-1?{}:Object.assign({},t[r]);return Object.assign(o,{cluster:!0,cluster_id:n[e+Le],point_count:s,point_count_abbreviated:i})}function nt(n){return n/360+.5}function st(n){var e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function uo(n){return(n-.5)*360}function co(n){var e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! ***************************************************************************** 20Copyright (c) Microsoft Corporation. 21 22Permission to use, copy, modify, and/or distribute this software for any 23purpose with or without fee is hereby granted. 24 25THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 26REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 27AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 28INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 29LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 30OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 31PERFORMANCE OF THIS SOFTWARE. 32***************************************************************************** */function po(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)e.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(t[s[i]]=n[s[i]]);return t}class de{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class Tt{constructor(e){var{markers:t,position:s}=e;this.markers=t,s&&(s instanceof google.maps.LatLng?this._position=s:this._position=new google.maps.LatLng(s))}get bounds(){if(!(this.markers.length===0&&!this._position)){var e=new google.maps.LatLngBounds(this._position,this._position);for(var t of this.markers)e.extend(de.getPosition(t));return e}}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>de.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(de.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class go{constructor(e){var{maxZoom:t=16}=e;this.maxZoom=t}noop(e){var{markers:t}=e;return ho(t)}}var ho=n=>{var e=n.map(t=>new Tt({position:de.getPosition(t),markers:[t]}));return e};class fo extends go{constructor(e){var{maxZoom:t,radius:s=60}=e,i=po(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1}
32,this.superCluster=new lo(Object.assign({maxZoom:this.maxZoom,radius:s},i))}calculate(e){var t=!1,s={zoom:e.map.getZoom()};if(!Vn(e.markers,this.markers)){t=!0,this.markers=[...e.markers];var i=this.markers.map(r=>{var o=de.getPosition(r),a=[o.lng(),o.lat()];return{type:"Feature",geometry:{type:"Point",coordinates:a},properties:{marker:r}}});this.superCluster.load(i)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!Vn(this.state,s)),this.state=s,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster(e){var{map:t}=e;return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map(s=>this.transformCluster(s))}transformCluster(e){var{geometry:{coordinates:[t,s]},properties:i}=e;if(i.cluster)return new Tt({markers:this.superCluster.getLeaves(i.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:s,lng:t}});var r=i.marker;return new Tt({markers:[r],position:de.getPosition(r)})}}class mo{constructor(e,t){this.markers={sum:e.length};var s=t.map(r=>r.count),i=s.reduce((r,o)=>r+o,0);this.clusters={count:t.length,markers:{mean:i/t.length,sum:i,min:Math.min(...s),max:Math.max(...s)}}}}class vo{render(e,t,s){var{count:i,position:r}=e,o=i>Math.max(10,t.clusters.markers.mean)?"#ff0000":"#0000ff",a='<svg fill="'.concat(o,`" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50"> 33<circle cx="120" cy="120" opacity=".6" r="70" /> 34<circle cx="120" cy="120" opacity=".3" r="90" /> 35<circle cx="120" cy="120" opacity=".2" r="110" /> 36<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">`).concat(i,`</text> 37</svg>`),l="Cluster of ".concat(i," markers"),u=Number(google.maps.Marker.MAX_ZINDEX)+i;if(de.isAdvancedMarkerAvailable(s)){var c=new DOMParser,d=c.parseFromString(a,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");var p={map:s,position:r,zIndex:u,title:l,content:d};return new google.maps.marker.AdvancedMarkerElement(p)}var f={position:r,zIndex:u,title:l,icon:{url:"data:image/svg+xml;base64,".concat(btoa(a)),anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(f)}}function yo(n,e){for(var t in e.prototype)n.prototype[t]=e.prototype[t]}class _t{constructor(){yo(_t,google.maps.OverlayView)}}var Ae;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click"})(Ae||(Ae={}));var Lo=(n,e,t)=>{t.fitBounds(e.bounds)};class bo extends _t{constructor(e){var{map:t,markers:s=[],algorithmOptions:i={},algorithm:r=new fo(i),renderer:o=new vo,onClusterClick:a=Lo}=e;super(),this.markers=[...s],this.clusters=[],this.algorithm=r,this.renderer=o,this.onClusterClick=a,t&&this.setMap(t)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(s=>{this.addMarker(s,!0)}),t||this.render()}removeMarker(e,t){var s=this.markers.indexOf(e);return s===-1?!1:(de.setMap(e,null),this.markers.splice(s,1),t||this.render(),!0)}removeMarkers(e,t){var s=!1;return e.forEach(i=>{s=this.removeMarker(i,!0)||s}),s&&!t&&this.render(),s}clearMarkers(e){this.markers.length=0,e||this.render()}render(){var e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,Ae.CLUSTERING_BEGIN,this);var{clusters:t,changed:s}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(s||s==null){var i=new Set;for(var r of t)r.markers.length==1&&i.add(r.markers[0]);var o=[];for(var a of this.clusters)a.marker!=null&&(a.markers.length==1?i.has(a.marker)||de.setMap(a.marker,null):o.push(a.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(l=>de.setMap(l,null)))}google.maps.event.trigger(this,Ae.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>de.setMap(e,null)),this.clusters.forEach(e=>
37e.delete()),this.clusters=[]}renderClusters(){var e=new mo(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(s=>{s.markers.length===1?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,e,t),s.markers.forEach(i=>de.setMap(i,null)),this.onClusterClick&&s.marker.addListener("click",i=>{google.maps.event.trigger(this,Ae.CLUSTER_CLICK,s),this.onClusterClick(i,s,t)})),de.setMap(s.marker,t)})}}function Gn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function Jn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gn(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gn(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}function Co(n){var e=pr(),[t,s]=y(null);return g(()=>{if(e&&t===null){var i=new bo(Jn(Jn({},n),{},{map:e}));s(i)}},[e]),t}function wo(n){var{children:e,options:t}=n,s=Co(t);return s!==null?e(s):null}le(wo);var qn={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Yn={options(n,e){n.setOptions(e)},position(n,e){n.setPosition(e)},zIndex(n,e){n.setZIndex(e)}};function xo(n){var{children:e,anchor:t,options:s,position:i,zIndex:r,onCloseClick:o,onDomReady:a,onContentChanged:l,onPositionChanged:u,onZindexChanged:c,onLoad:d,onUnmount:p}=n,f=oe(F),[h,w]=y(null),[m,E]=y(null),[x,P]=y(null),[L,v]=y(null),[b,S]=y(null),[k,M]=y(null),I=he(null);return g(()=>{h!==null&&(h.close(),t?h.open(f,t):h.getPosition()&&h.open(f))},[f,h,t]),g(()=>{s&&h!==null&&h.setOptions(s)},[h,s]),g(()=>{i&&h!==null&&h.setPosition(i)},[i]),g(()=>{typeof r=="number"&&h!==null&&h.setZIndex(r)},[r]),g(()=>{h&&o&&(m!==null&&google.maps.event.removeListener(m),E(google.maps.event.addListener(h,"closeclick",o)))},[o]),g(()=>{h&&a&&(x!==null&&google.maps.event.removeListener(x),P(google.maps.event.addListener(h,"domready",a)))},[a]),g(()=>{h&&l&&(L!==null&&google.maps.event.removeListener(L),v(google.maps.event.addListener(h,"content_changed",l)))},[l]),g(()=>{h&&u&&(b!==null&&google.maps.event.removeListener(b),S(google.maps.event.addListener(h,"position_changed",u)))},[u]),g(()=>{h&&c&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(h,"zindex_changed",c)))},[c]),g(()=>{var D=new google.maps.InfoWindow(s);return w(D),I.current=document.createElement("div"),o&&E(google.maps.event.addListener(D,"closeclick",o)),a&&P(google.maps.event.addListener(D,"domready",a)),l&&v(google.maps.event.addListener(D,"content_changed",l)),u&&S(google.maps.event.addListener(D,"position_changed",u)),c&&M(google.maps.event.addListener(D,"zindex_changed",c)),D.setContent(I.current),i&&D.setPosition(i),r&&D.setZIndex(r),t?D.open(f,t):D.getPosition()?D.open(f):ae(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>."),d&&d(D),()=>{m&&google.maps.event.removeListener(m),L&&google.maps.event.removeListener(L),x&&google.maps.event.removeListener(x),b&&google.maps.event.removeListener(b),k&&google.maps.event.removeListener(k),p&&p(D),D.close()}},[]),I.current?yt(ve.only(e),I.current):null}le(xo);class Mo extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"containerElement",null),C(this,"state",{infoWindow:null}),C(this,"open",(e,t)=>{t?e.open(this.context,t):e.getPosition()?e.open(this.context):ae(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>.")}),C(this,"setInfoWindowCallback",()=>{this.state.infoWindow!==null&&this.containerElement!==null&&(this.state.infoWindow.setContent(this.containerElement),this.open(this.state.infoWindow,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoWindow))})}componentDidMount(){var e=new google.maps.InfoWindow(this.props.options);this.containerElement=document.createElement("div"),this.registeredEvents=Z({updaterMap:Yn,eventMap:qn,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({infoWindow:e}),this.setInfoWindowCallback)}componentDidUpdate(e){this.state.infoWindow!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Yn,eventMap:qn,prevProps:e,nextProps:this.props,instance:this.state.infoWindow}))}componentWillUnmount(){this.state.infoWindow!==null&&(G(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())}render(){return this.containerElement?yt(ve.only(this.props.children),this.containerElement):null}}C(Mo,"contextType",F);function Qn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function gt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
37e%2?Qn(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qn(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var Xn={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},es={draggable(n,e){n.setDraggable(e)},editable(n,e){n.setEditable(e)},map(n,e){n.setMap(e)},options(n,e){n.setOptions(e)},path(n,e){n.setPath(e)},visible(n,e){n.setVisible(e)}},Oo={};function So(n){var{options:e,draggable:t,editable:s,visible:i,path:r,onDblClick:o,onDragEnd:a,onDragStart:l,onMouseDown:u,onMouseMove:c,onMouseOut:d,onMouseOver:p,onMouseUp:f,onRightClick:h,onClick:w,onDrag:m,onLoad:E,onUnmount:x}=n,P=oe(F),[L,v]=y(null),[b,S]=y(null),[k,M]=y(null),[I,D]=y(null),[B,W]=y(null),[T,j]=y(null),[V,Q]=y(null),[N,K]=y(null),[z,J]=y(null),[X,U]=y(null),[ee,O]=y(null),[ie,ne]=y(null);return g(()=>{L!==null&&L.setMap(P)},[P]),g(()=>{typeof e<"u"&&L!==null&&L.setOptions(e)},[L,e]),g(()=>{typeof t<"u"&&L!==null&&L.setDraggable(t)},[L,t]),g(()=>{typeof s<"u"&&L!==null&&L.setEditable(s)},[L,s]),g(()=>{typeof i<"u"&&L!==null&&L.setVisible(i)},[L,i]),g(()=>{typeof r<"u"&&L!==null&&L.setPath(r)},[L,r]),g(()=>{L&&o&&(b!==null&&google.maps.event.removeListener(b),S(google.maps.event.addListener(L,"dblclick",o)))},[o]),g(()=>{L&&a&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(L,"dragend",a)))},[a]),g(()=>{L&&l&&(I!==null&&google.maps.event.removeListener(I),D(google.maps.event.addListener(L,"dragstart",l)))},[l]),g(()=>{L&&u&&(B!==null&&google.maps.event.removeListener(B),W(google.maps.event.addListener(L,"mousedown",u)))},[u]),g(()=>{L&&c&&(T!==null&&google.maps.event.removeListener(T),j(google.maps.event.addListener(L,"mousemove",c)))},[c]),g(()=>{L&&d&&(V!==null&&google.maps.event.removeListener(V),Q(google.maps.event.addListener(L,"mouseout",d)))},[d]),g(()=>{L&&p&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(L,"mouseover",p)))},[p]),g(()=>{L&&f&&(z!==null&&google.maps.event.removeListener(z),J(google.maps.event.addListener(L,"mouseup",f)))},[f]),g(()=>{L&&h&&(X!==null&&google.maps.event.removeListener(X),U(google.maps.event.addListener(L,"rightclick",h)))},[h]),g(()=>{L&&w&&(ee!==null&&google.maps.event.removeListener(ee),O(google.maps.event.addListener(L,"click",w)))},[w]),g(()=>{L&&m&&(ie!==null&&google.maps.event.removeListener(ie),ne(google.maps.event.addListener(L,"drag",m)))},[m]),g(()=>{var H=new google.maps.Polyline(gt(gt({},e||Oo),{},{map:P}));return r&&H.setPath(r),typeof i<"u"&&H.setVisible(i),typeof s<"u"&&H.setEditable(s),typeof t<"u"&&H.setDraggable(t),o&&S(google.maps.event.addListener(H,"dblclick",o)),a&&M(google.maps.event.addListener(H,"dragend",a)),l&&D(google.maps.event.addListener(H,"dragstart",l)),u&&W(google.maps.event.addListener(H,"mousedown",u)),c&&j(google.maps.event.addListener(H,"mousemove",c)),d&&Q(google.maps.event.addListener(H,"mouseout",d)),p&&K(google.maps.event.addListener(H,"mouseover",p)),f&&J(google.maps.event.addListener(H,"mouseup",f)),h&&U(google.maps.event.addListener(H,"rightclick",h)),w&&O(google.maps.event.addListener(H,"click",w)),m&&ne(google.maps.event.addListener(H,"drag",m)),v(H),E&&E(H),()=>{b!==null&&google.maps.event.removeListener(b),k!==null&&google.maps.event.removeListener(k),I!==null&&google.maps.event.removeListener(I),B!==null&&google.maps.event.removeListener(B),T!==null&&google.maps.event.removeListener(T),V!==null&&google.maps.event.removeListener(V),N!==null&&google.maps.event.removeListener(N),z!==null&&google.maps.event.removeListener(z),X!==null&&google.maps.event.removeListener(X),ee!==null&&google.maps.event.removeListener(ee),x&&x(H),H.setMap(null)}},[]),null}le(So);class Eo extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{polyline:null}),C(this,"setPolylineCallback",()=>{this.state.polyline!==null&&this.props.onLoad&&this.props.onLoad(this.state.polyline)})}componentDidMount(){var e=new google.maps.Polyline(gt(gt({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:es,eventMap:Xn,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{polyline:e}},this.setPolylineCallback)}componentDidUpdate(e){this.state.polyline!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:es,eventMap:Xn,prevProps:e,nextProps:this.props,instance:this.state.polyline}))}componentWillUnmount(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),G(this.registeredEvents),this.state.polyline.setMap(null))}render(){return null}}C(Eo,"contextType",F);function ts(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function ns(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
37e%2?ts(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ts(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var ss={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},is={draggable(n,e){n.setDraggable(e)},editable(n,e){n.setEditable(e)},map(n,e){n.setMap(e)},options(n,e){n.setOptions(e)},path(n,e){n.setPath(e)},paths(n,e){n.setPaths(e)},visible(n,e){n.setVisible(e)}};function ko(n){var{options:e,draggable:t,editable:s,visible:i,path:r,paths:o,onDblClick:a,onDragEnd:l,onDragStart:u,onMouseDown:c,onMouseMove:d,onMouseOut:p,onMouseOver:f,onMouseUp:h,onRightClick:w,onClick:m,onDrag:E,onLoad:x,onUnmount:P,onEdit:L}=n,v=oe(F),[b,S]=y(null),[k,M]=y(null),[I,D]=y(null),[B,W]=y(null),[T,j]=y(null),[V,Q]=y(null),[N,K]=y(null),[z,J]=y(null),[X,U]=y(null),[ee,O]=y(null),[ie,ne]=y(null),[H,re]=y(null);return g(()=>{b!==null&&b.setMap(v)},[v]),g(()=>{typeof e<"u"&&b!==null&&b.setOptions(e)},[b,e]),g(()=>{typeof t<"u"&&b!==null&&b.setDraggable(t)},[b,t]),g(()=>{typeof s<"u"&&b!==null&&b.setEditable(s)},[b,s]),g(()=>{typeof i<"u"&&b!==null&&b.setVisible(i)},[b,i]),g(()=>{typeof r<"u"&&b!==null&&b.setPath(r)},[b,r]),g(()=>{typeof o<"u"&&b!==null&&b.setPaths(o)},[b,o]),g(()=>{b&&typeof a=="function"&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(b,"dblclick",a)))},[a]),g(()=>{b&&(google.maps.event.addListener(b.getPath(),"insert_at",()=>{L==null||L(b)}),google.maps.event.addListener(b.getPath(),"set_at",()=>{L==null||L(b)}),google.maps.event.addListener(b.getPath(),"remove_at",()=>{L==null||L(b)}))},[b,L]),g(()=>{b&&typeof l=="function"&&(I!==null&&google.maps.event.removeListener(I),D(google.maps.event.addListener(b,"dragend",l)))},[l]),g(()=>{b&&typeof u=="function"&&(B!==null&&google.maps.event.removeListener(B),W(google.maps.event.addListener(b,"dragstart",u)))},[u]),g(()=>{b&&typeof c=="function"&&(T!==null&&google.maps.event.removeListener(T),j(google.maps.event.addListener(b,"mousedown",c)))},[c]),g(()=>{b&&typeof d=="function"&&(V!==null&&google.maps.event.removeListener(V),Q(google.maps.event.addListener(b,"mousemove",d)))},[d]),g(()=>{b&&typeof p=="function"&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(b,"mouseout",p)))},[p]),g(()=>{b&&typeof f=="function"&&(z!==null&&google.maps.event.removeListener(z),J(google.maps.event.addListener(b,"mouseover",f)))},[f]),g(()=>{b&&typeof h=="function"&&(X!==null&&google.maps.event.removeListener(X),U(google.maps.event.addListener(b,"mouseup",h)))},[h]),g(()=>{b&&typeof w=="function"&&(ee!==null&&google.maps.event.removeListener(ee),O(google.maps.event.addListener(b,"rightclick",w)))},[w]),g(()=>{b&&typeof m=="function"&&(ie!==null&&google.maps.event.removeListener(ie),ne(google.maps.event.addListener(b,"click",m)))},[m]),g(()=>{b&&typeof E=="function"&&(H!==null&&google.maps.event.removeListener(H),re(google.maps.event.addListener(b,"drag",E)))},[E]),g(()=>{var A=new google.maps.Polygon(ns(ns({},e),{},{map:v}));return r&&A.setPath(r),o&&A.setPaths(o),typeof i<"u"&&A.setVisible(i),typeof s<"u"&&A.setEditable(s),typeof t<"u"&&A.setDraggable(t),a&&M(google.maps.event.addListener(A,"dblclick",a)),l&&D(google.maps.event.addListener(A,"dragend",l)),u&&W(google.maps.event.addListener(A,"dragstart",u)),c&&j(google.maps.event.addListener(A,"mousedown",c)),d&&Q(google.maps.event.addListener(A,"mousemove",d)),p&&K(google.maps.event.addListener(A,"mouseout",p)),f&&J(google.maps.event.addListener(A,"mouseover",f)),h&&U(google.maps.event.addListener(A,"mouseup",h)),w&&O(google.maps.event.addListener(A,"rightclick",w)),m&&ne(google.maps.event.addListener(A,"click",m)),E&&re(google.maps.event.addListener(A,"drag",E)),S(A),x&&x(A),()=>{k!==null&&google.maps.event.removeListener(k),I!==null&&google.maps.event.removeListener(I),B!==null&&google.maps.event.removeListener(B),T!==null&&google.maps.event.removeListener(T),V!==null&&google.maps.event.removeListener(V),N!==null&&google.maps.event.removeListener(N),z!==null&&google.maps.event.removeListener(z),X!==null&&google.maps.event.removeListener(X),ee!==null&&google.maps.event.removeListener(ee),ie!==null&&google.maps.event.removeListener(ie),P&&P(A),A.setMap(null)}},[]),null}le(ko);class Po extends se{constructor(){super(...arguments),C(this,"registeredEvents",[])}componentDidMount(){var e=this.props.options||{};this.polygon=new google.maps.Polygon(e),this.polygon.setMap(this.context),this.registeredEvents=Z({updaterMap:is,eventMap:ss,prevProps:{},nextProps:this.props,instance:this.polygon}),this.props.onLoad&&this.props.onLoad(this.polygon)}componentDidUpdate(e){this.polygon&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:is,eventMap:ss,prevProps:e,nextProps:this.props,instance:this.polygon}))}componentWillUnmount(){this.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.polygon),G(this.registeredEvents),this.polygon&&this.polygon.setMap(null))}render(){return null}}C(Po,"contextType",F);function rs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function ht(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
37e%2?rs(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rs(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var os={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},as={bounds(n,e){n.setBounds(e)},draggable(n,e){n.setDraggable(e)},editable(n,e){n.setEditable(e)},map(n,e){n.setMap(e)},options(n,e){n.setOptions(e)},visible(n,e){n.setVisible(e)}};function Do(n){var{options:e,bounds:t,draggable:s,editable:i,visible:r,onDblClick:o,onDragEnd:a,onDragStart:l,onMouseDown:u,onMouseMove:c,onMouseOut:d,onMouseOver:p,onMouseUp:f,onRightClick:h,onClick:w,onDrag:m,onBoundsChanged:E,onLoad:x,onUnmount:P}=n,L=oe(F),[v,b]=y(null),[S,k]=y(null),[M,I]=y(null),[D,B]=y(null),[W,T]=y(null),[j,V]=y(null),[Q,N]=y(null),[K,z]=y(null),[J,X]=y(null),[U,ee]=y(null),[O,ie]=y(null),[ne,H]=y(null),[re,A]=y(null);return g(()=>{v!==null&&v.setMap(L)},[L]),g(()=>{typeof e<"u"&&v!==null&&v.setOptions(e)},[v,e]),g(()=>{typeof s<"u"&&v!==null&&v.setDraggable(s)},[v,s]),g(()=>{typeof i<"u"&&v!==null&&v.setEditable(i)},[v,i]),g(()=>{typeof r<"u"&&v!==null&&v.setVisible(r)},[v,r]),g(()=>{typeof t<"u"&&v!==null&&v.setBounds(t)},[v,t]),g(()=>{v&&o&&(S!==null&&google.maps.event.removeListener(S),k(google.maps.event.addListener(v,"dblclick",o)))},[o]),g(()=>{v&&a&&(M!==null&&google.maps.event.removeListener(M),I(google.maps.event.addListener(v,"dragend",a)))},[a]),g(()=>{v&&l&&(D!==null&&google.maps.event.removeListener(D),B(google.maps.event.addListener(v,"dragstart",l)))},[l]),g(()=>{v&&u&&(W!==null&&google.maps.event.removeListener(W),T(google.maps.event.addListener(v,"mousedown",u)))},[u]),g(()=>{v&&c&&(j!==null&&google.maps.event.removeListener(j),V(google.maps.event.addListener(v,"mousemove",c)))},[c]),g(()=>{v&&d&&(Q!==null&&google.maps.event.removeListener(Q),N(google.maps.event.addListener(v,"mouseout",d)))},[d]),g(()=>{v&&p&&(K!==null&&google.maps.event.removeListener(K),z(google.maps.event.addListener(v,"mouseover",p)))},[p]),g(()=>{v&&f&&(J!==null&&google.maps.event.removeListener(J),X(google.maps.event.addListener(v,"mouseup",f)))},[f]),g(()=>{v&&h&&(U!==null&&google.maps.event.removeListener(U),ee(google.maps.event.addListener(v,"rightclick",h)))},[h]),g(()=>{v&&w&&(O!==null&&google.maps.event.removeListener(O),ie(google.maps.event.addListener(v,"click",w)))},[w]),g(()=>{v&&m&&(ne!==null&&google.maps.event.removeListener(ne),H(google.maps.event.addListener(v,"drag",m)))},[m]),g(()=>{v&&E&&(re!==null&&google.maps.event.removeListener(re),A(google.maps.event.addListener(v,"bounds_changed",E)))},[E]),g(()=>{var q=new google.maps.Rectangle(ht(ht({},e),{},{map:L}));return typeof r<"u"&&q.setVisible(r),typeof i<"u"&&q.setEditable(i),typeof s<"u"&&q.setDraggable(s),typeof t<"u"&&q.setBounds(t),o&&k(google.maps.event.addListener(q,"dblclick",o)),a&&I(google.maps.event.addListener(q,"dragend",a)),l&&B(google.maps.event.addListener(q,"dragstart",l)),u&&T(google.maps.event.addListener(q,"mousedown",u)),c&&V(google.maps.event.addListener(q,"mousemove",c)),d&&N(google.maps.event.addListener(q,"mouseout",d)),p&&z(google.maps.event.addListener(q,"mouseover",p)),f&&X(google.maps.event.addListener(q,"mouseup",f)),h&&ee(google.maps.event.addListener(q,"rightclick",h)),w&&ie(google.maps.event.addListener(q,"click",w)),m&&H(google.maps.event.addListener(q,"drag",m)),E&&A(google.maps.event.addListener(q,"bounds_changed",E)),b(q),x&&x(q),()=>{S!==null&&google.maps.event.removeListener(S),M!==null&&google.maps.event.removeListener(M),D!==null&&google.maps.event.removeListener(D),W!==null&&google.maps.event.removeListener(W),j!==null&&google.maps.event.removeListener(j),Q!==null&&google.maps.event.removeListener(Q),K!==null&&google.maps.event.removeListener(K),J!==null&&google.maps.event.removeListener(J),U!==null&&google.maps.event.removeListener(U),O!==null&&google.maps.event.removeListener(O),ne!==null&&google.maps.event.removeListener(ne),re!==null&&google.maps.event.removeListener(re),P&&P(q),q.setMap(null)}},[]),null}le(Do);class Io extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{rectangle:null}),C(this,"setRectangleCallback",()=>{this.state.rectangle!==null&&this.props.onLoad&&this.props.onLoad(this.state.rectangle)})}componentDidMount(){var e=new google.maps.Rectangle(ht(ht({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:as,eventMap:os,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{rectangle:e}},this.setRectangleCallback)}componentDidUpdate(e){this.state.rectangle!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:as,eventMap:os,prevProps:e,nextProps:this.props,instance:this.state.rectangle}))}componentWillUnmount(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),G(this.registeredEvents),this.state.rectangle.setMap(null))}render(){return null}}C(Io,"contextType",F);function ls(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function ft(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
37e%2?ls(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ls(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var us={onCenterChanged:"center_changed",onRadiusChanged:"radius_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},cs={center(n,e){n.setCenter(e)},draggable(n,e){n.setDraggable(e)},editable(n,e){n.setEditable(e)},map(n,e){n.setMap(e)},options(n,e){n.setOptions(e)},radius(n,e){n.setRadius(e)},visible(n,e){n.setVisible(e)}},Ro={};function To(n){var{options:e,center:t,radius:s,draggable:i,editable:r,visible:o,onDblClick:a,onDragEnd:l,onDragStart:u,onMouseDown:c,onMouseMove:d,onMouseOut:p,onMouseOver:f,onMouseUp:h,onRightClick:w,onClick:m,onDrag:E,onCenterChanged:x,onRadiusChanged:P,onLoad:L,onUnmount:v}=n,b=oe(F),[S,k]=y(null),[M,I]=y(null),[D,B]=y(null),[W,T]=y(null),[j,V]=y(null),[Q,N]=y(null),[K,z]=y(null),[J,X]=y(null),[U,ee]=y(null),[O,ie]=y(null),[ne,H]=y(null),[re,A]=y(null),[q,ge]=y(null),[me,Pe]=y(null);return g(()=>{S!==null&&S.setMap(b)},[b]),g(()=>{typeof e<"u"&&S!==null&&S.setOptions(e)},[S,e]),g(()=>{typeof i<"u"&&S!==null&&S.setDraggable(i)},[S,i]),g(()=>{typeof r<"u"&&S!==null&&S.setEditable(r)},[S,r]),g(()=>{typeof o<"u"&&S!==null&&S.setVisible(o)},[S,o]),g(()=>{typeof s=="number"&&S!==null&&S.setRadius(s)},[S,s]),g(()=>{typeof t<"u"&&S!==null&&S.setCenter(t)},[S,t]),g(()=>{S&&a&&(M!==null&&google.maps.event.removeListener(M),I(google.maps.event.addListener(S,"dblclick",a)))},[a]),g(()=>{S&&l&&(D!==null&&google.maps.event.removeListener(D),B(google.maps.event.addListener(S,"dragend",l)))},[l]),g(()=>{S&&u&&(W!==null&&google.maps.event.removeListener(W),T(google.maps.event.addListener(S,"dragstart",u)))},[u]),g(()=>{S&&c&&(j!==null&&google.maps.event.removeListener(j),V(google.maps.event.addListener(S,"mousedown",c)))},[c]),g(()=>{S&&d&&(Q!==null&&google.maps.event.removeListener(Q),N(google.maps.event.addListener(S,"mousemove",d)))},[d]),g(()=>{S&&p&&(K!==null&&google.maps.event.removeListener(K),z(google.maps.event.addListener(S,"mouseout",p)))},[p]),g(()=>{S&&f&&(J!==null&&google.maps.event.removeListener(J),X(google.maps.event.addListener(S,"mouseover",f)))},[f]),g(()=>{S&&h&&(U!==null&&google.maps.event.removeListener(U),ee(google.maps.event.addListener(S,"mouseup",h)))},[h]),g(()=>{S&&w&&(O!==null&&google.maps.event.removeListener(O),ie(google.maps.event.addListener(S,"rightclick",w)))},[w]),g(()=>{S&&m&&(ne!==null&&google.maps.event.removeListener(ne),H(google.maps.event.addListener(S,"click",m)))},[m]),g(()=>{S&&E&&(re!==null&&google.maps.event.removeListener(re),A(google.maps.event.addListener(S,"drag",E)))},[E]),g(()=>{S&&x&&(q!==null&&google.maps.event.removeListener(q),ge(google.maps.event.addListener(S,"center_changed",x)))},[m]),g(()=>{S&&P&&(me!==null&&google.maps.event.removeListener(me),Pe(google.maps.event.addListener(S,"radius_changed",P)))},[P]),g(()=>{var te=new google.maps.Circle(ft(ft({},e||Ro),{},{map:b}));return typeof s=="number"&&te.setRadius(s),typeof t<"u"&&te.setCenter(t),typeof s=="number"&&te.setRadius(s),typeof o<"u"&&te.setVisible(o),typeof r<"u"&&te.setEditable(r),typeof i<"u"&&te.setDraggable(i),a&&I(google.maps.event.addListener(te,"dblclick",a)),l&&B(google.maps.event.addListener(te,"dragend",l)),u&&T(google.maps.event.addListener(te,"dragstart",u)),c&&V(google.maps.event.addListener(te,"mousedown",c)),d&&N(google.maps.event.addListener(te,"mousemove",d)),p&&z(google.maps.event.addListener(te,"mouseout",p)),f&&X(google.maps.event.addListener(te,"mouseover",f)),h&&ee(google.maps.event.addListener(te,"mouseup",h)),w&&ie(google.maps.event.addListener(te,"rightclick",w)),m&&H(google.maps.event.addListener(te,"click",m)),E&&A(google.maps.event.addListener(te,"drag",E)),x&&ge(google.maps.event.addListener(te,"center_changed",x)),P&&Pe(google.maps.event.addListener(te,"radius_changed",P)),k(te),L&&L(te),()=>{M!==null&&google.maps.event.removeListener(M),D!==null&&google.maps.event.removeListener(
37D),W!==null&&google.maps.event.removeListener(W),j!==null&&google.maps.event.removeListener(j),Q!==null&&google.maps.event.removeListener(Q),K!==null&&google.maps.event.removeListener(K),J!==null&&google.maps.event.removeListener(J),U!==null&&google.maps.event.removeListener(U),O!==null&&google.maps.event.removeListener(O),ne!==null&&google.maps.event.removeListener(ne),q!==null&&google.maps.event.removeListener(q),me!==null&&google.maps.event.removeListener(me),v&&v(te),te.setMap(null)}},[]),null}le(To);class jo extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{circle:null}),C(this,"setCircleCallback",()=>{this.state.circle!==null&&this.props.onLoad&&this.props.onLoad(this.state.circle)})}componentDidMount(){var e=new google.maps.Circle(ft(ft({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:cs,eventMap:us,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{circle:e}},this.setCircleCallback)}componentDidUpdate(e){this.state.circle!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:cs,eventMap:us,prevProps:e,nextProps:this.props,instance:this.state.circle}))}componentWillUnmount(){if(this.state.circle!==null){var e;this.props.onUnmount&&this.props.onUnmount(this.state.circle),G(this.registeredEvents),(e=this.state.circle)===null||e===void 0||e.setMap(null)}}render(){return null}}C(jo,"contextType",F);function ds(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function mt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ds(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ds(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var ps={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},gs={add(n,e){n.add(e)},addgeojson(n,e,t){n.addGeoJson(e,t)},contains(n,e){n.contains(e)},foreach(n,e){n.forEach(e)},loadgeojson(n,e,t,s){n.loadGeoJson(e,t,s)},overridestyle(n,e,t){n.overrideStyle(e,t)},remove(n,e){n.remove(e)},revertstyle(n,e){n.revertStyle(e)},controlposition(n,e){n.setControlPosition(e)},controls(n,e){n.setControls(e)},drawingmode(n,e){n.setDrawingMode(e)},map(n,e){n.setMap(e)},style(n,e){n.setStyle(e)},togeojson(n,e){n.toGeoJson(e)}};function No(n){var{options:e,onClick:t,onDblClick:s,onMouseDown:i,onMouseMove:r,onMouseOut:o,onMouseOver:a,onMouseUp:l,onRightClick:u,onAddFeature:c,onRemoveFeature:d,onRemoveProperty:p,onSetGeometry:f,onSetProperty:h,onLoad:w,onUnmount:m}=n,E=oe(F),[x,P]=y(null),[L,v]=y(null),[b,S]=y(null),[k,M]=y(null),[I,D]=y(null),[B,W]=y(null),[T,j]=y(null),[V,Q]=y(null),[N,K]=y(null),[z,J]=y(null),[X,U]=y(null),[ee,O]=y(null),[ie,ne]=y(null),[H,re]=y(null);return g(()=>{x!==null&&x.setMap(E)},[E]),g(()=>{x&&s&&(L!==null&&google.maps.event.removeListener(L),v(google.maps.event.addListener(x,"dblclick",s)))},[s]),g(()=>{x&&i&&(b!==null&&google.maps.event.removeListener(b),S(google.maps.event.addListener(x,"mousedown",i)))},[i]),g(()=>{x&&r&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(x,"mousemove",r)))},[r]),g(()=>{x&&o&&(I!==null&&google.maps.event.removeListener(I),D(google.maps.event.addListener(x,"mouseout",o)))},[o]),g(()=>{x&&a&&(B!==null&&google.maps.event.removeListener(B),W(google.maps.event.addListener(x,"mouseover",a)))},[a]),g(()=>{x&&l&&(T!==null&&google.maps.event.removeListener(T),j(google.maps.event.addListener(x,"mouseup",l)))},[l]),g(()=>{x&&u&&(V!==null&&google.maps.event.removeListener(V),Q(google.maps.event.addListener(x,"rightclick",u)))},[u]),g(()=>{x&&t&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(x,"click",t)))},[t]),g(()=>{x&&c&&(z!==null&&google.maps.event.removeListener(z),J(google.maps.event.addListener(x,"addfeature",c)))},[c]),g(()=>{x&&d&&(X!==null&&google.maps.event.removeListener(X),U(google.maps.event.addListener(x,"removefeature",d))
37)},[d]),g(()=>{x&&p&&(ee!==null&&google.maps.event.removeListener(ee),O(google.maps.event.addListener(x,"removeproperty",p)))},[p]),g(()=>{x&&f&&(ie!==null&&google.maps.event.removeListener(ie),ne(google.maps.event.addListener(x,"setgeometry",f)))},[f]),g(()=>{x&&h&&(H!==null&&google.maps.event.removeListener(H),re(google.maps.event.addListener(x,"setproperty",h)))},[h]),g(()=>{if(E!==null){var A=new google.maps.Data(mt(mt({},e),{},{map:E}));s&&v(google.maps.event.addListener(A,"dblclick",s)),i&&S(google.maps.event.addListener(A,"mousedown",i)),r&&M(google.maps.event.addListener(A,"mousemove",r)),o&&D(google.maps.event.addListener(A,"mouseout",o)),a&&W(google.maps.event.addListener(A,"mouseover",a)),l&&j(google.maps.event.addListener(A,"mouseup",l)),u&&Q(google.maps.event.addListener(A,"rightclick",u)),t&&K(google.maps.event.addListener(A,"click",t)),c&&J(google.maps.event.addListener(A,"addfeature",c)),d&&U(google.maps.event.addListener(A,"removefeature",d)),p&&O(google.maps.event.addListener(A,"removeproperty",p)),f&&ne(google.maps.event.addListener(A,"setgeometry",f)),h&&re(google.maps.event.addListener(A,"setproperty",h)),P(A),w&&w(A)}return()=>{x&&(L!==null&&google.maps.event.removeListener(L),b!==null&&google.maps.event.removeListener(b),k!==null&&google.maps.event.removeListener(k),I!==null&&google.maps.event.removeListener(I),B!==null&&google.maps.event.removeListener(B),T!==null&&google.maps.event.removeListener(T),V!==null&&google.maps.event.removeListener(V),N!==null&&google.maps.event.removeListener(N),z!==null&&google.maps.event.removeListener(z),X!==null&&google.maps.event.removeListener(X),ee!==null&&google.maps.event.removeListener(ee),ie!==null&&google.maps.event.removeListener(ie),H!==null&&google.maps.event.removeListener(H),m&&m(x),x.setMap(null))}},[]),null}le(No);class Ao extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{data:null}),C(this,"setDataCallback",()=>{this.state.data!==null&&this.props.onLoad&&this.props.onLoad(this.state.data)})}componentDidMount(){if(this.context!==null){var e=new google.maps.Data(mt(mt({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:gs,eventMap:ps,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({data:e}),this.setDataCallback)}}componentDidUpdate(e){this.state.data!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:gs,eventMap:ps,prevProps:e,nextProps:this.props,instance:this.state.data}))}componentWillUnmount(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),G(this.registeredEvents),this.state.data&&this.state.data.setMap(null))}render(){return null}}C(Ao,"contextType",F);function hs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function fs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hs(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hs(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var ms={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},vs={options(n,e){n.setOptions(e)},url(n,e){n.setUrl(e)},zIndex(n,e){n.setZIndex(e)}};class Uo extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{kmlLayer:null}),C(this,"setKmlLayerCallback",()=>{this.state.kmlLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.kmlLayer)})}componentDidMount(){var e=new google.maps.KmlLayer(fs(fs({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:vs,eventMap:ms,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{kmlLayer:e}},this.setKmlLayerCallback)}componentDidUpdate(e){this.state.kmlLayer!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:vs,eventMap:ms,prevProps:e,nextProps:this.props,instance:this.state.kmlLayer}))}componentWillUnmount(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),G(this.registeredEvents),this.state.kmlLayer.setMap(null))}render(){return null}}C(Uo,"contextType",F);function ai(n,e){return typeof e=="function"?e(n.offsetWidth,n.offsetHeight):{x:0,y:0}}function _o(n,e){return new e(n.lat,n.lng)}function Bo(n,e){return new e(new google.maps.LatLng(n.ne.lat,n.ne.lng),new google.maps.LatLng(n.sw.lat,n.sw.lng))}function $o(n,e,t){return n instanceof e?n:t(n,e)}function Fo(n,e,t){return n instanceof e?n:t(n,e)}function zo(n,e,t){var s=n&&n.fromLatLngToDivPixel(t.getNorthEast()),i=n&&n.fromLatLngToDivPixel(t.getSouthWest
37());return s&&i?{left:"".concat(i.x+e.x,"px"),top:"".concat(s.y+e.y,"px"),width:"".concat(s.x-i.x-e.x,"px"),height:"".concat(i.y-s.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function Vo(n,e,t){var s=n&&n.fromLatLngToDivPixel(t);if(s){var{x:i,y:r}=s;return{left:"".concat(i+e.x,"px"),top:"".concat(r+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function li(n,e,t,s){return t!==void 0?zo(n,e,Fo(t,google.maps.LatLngBounds,Bo)):Vo(n,e,$o(s,google.maps.LatLng,_o))}function Ho(n,e){return n.left===e.left&&n.top===e.top&&n.width===e.height&&n.height===e.height}function ys(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function Zo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ys(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ys(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}function Wo(n,e,t,s,i){class r extends google.maps.OverlayView{constructor(a,l,u,c){super(),this.container=a,this.pane=l,this.position=u,this.bounds=c}onAdd(){var a,l=(a=this.getPanes())===null||a===void 0?void 0:a[this.pane];l==null||l.appendChild(this.container)}draw(){var a=this.getProjection(),l=Zo({},this.container?ai(this.container,i):{x:0,y:0}),u=li(a,l,this.bounds,this.position);for(var[c,d]of Object.entries(u))this.container.style[c]=d}onRemove(){this.container.parentNode!==null&&this.container.parentNode.removeChild(this.container)}}return new r(n,e,t,s)}function Ls(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function Ko(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ls(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ls(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}function bs(n){if(!n)return"";var e=n instanceof google.maps.LatLng?n:new google.maps.LatLng(n.lat,n.lng);return e+""}function Cs(n){if(!n)return"";var e=n instanceof google.maps.LatLngBounds?n:new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.east),new google.maps.LatLng(n.north,n.west));return e+""}function Go(n){var{position:e,bounds:t,mapPaneName:s,zIndex:i,onLoad:r,onUnmount:o,getPixelPositionOffset:a,children:l}=n,u=oe(F),c=Ue(()=>{var p=document.createElement("div");return p.style.position="absolute",p},[]),d=Ue(()=>Wo(c,s,e,t,a),[c,s,e,t]);return g(()=>(r==null||r(d),d==null||d.setMap(u),()=>{o==null||o(d),d==null||d.setMap(null)}),[u,d]),g(()=>{c.style.zIndex="".concat(i)},[i,c]),zs.createPortal(l,c)}le(Go);class ke extends se{constructor(e){super(e),C(this,"state",{paneEl:null,containerStyle:{position:"absolute"}}),C(this,"updatePane",()=>{var s=this.props.mapPaneName,i=this.overlayView.getPanes();ae(!!s,"OverlayView requires props.mapPaneName but got %s",s),i?this.setState({paneEl:i[s]}):this.setState({paneEl:null})}),C(this,"onAdd",()=>{var s,i;this.updatePane(),(s=(i=this.props).onLoad)===null||s===void 0||s.call(i,this.overlayView)}),C(this,"onPositionElement",()=>{var s=this.overlayView.getProjection(),i=Ko({x:0,y:0},this.containerRef.current?ai(this.containerRef.current,this.props.getPixelPositionOffset):{}),r=li(s,i,this.props.bounds,this.props.position);if(!Ho(r,{left:this.state.containerStyle.left,top:this.state.containerStyle.top,width:this.state.containerStyle.width,height:this.state.containerStyle.height})){var o,a,l,u;this.setState({containerStyle:{top:(o=r.top)!==null&&o!==void 0?o:0,left:(a=r.left)!==null&&a!==void 0?a:0,width:(l=r.width)!==null&&l!==void 0?l:0,height:(u=r.height)!==null&&u!==void 0?u:0,position:"absolute"}})}}),C(this,"draw",()=>{this.onPositionElement()}),C(this,"onRemove",()=>{var s,i;this.setState(()=>({paneEl:null})),(s=(i=this.props).onUnmount)===null||s===void 0||s.call(i,this.overlayView)}
37),this.containerRef=jt();var t=new google.maps.OverlayView;t.onAdd=this.onAdd,t.draw=this.draw,t.onRemove=this.onRemove,this.overlayView=t}componentDidMount(){this.overlayView.setMap(this.context)}componentDidUpdate(e){var t=bs(e.position),s=bs(this.props.position),i=Cs(e.bounds),r=Cs(this.props.bounds);(t!==s||i!==r)&&this.overlayView.draw(),e.mapPaneName!==this.props.mapPaneName&&this.updatePane()}componentWillUnmount(){this.overlayView.setMap(null)}render(){var e=this.state.paneEl;return e?zs.createPortal(ce.jsx("div",{ref:this.containerRef,style:this.state.containerStyle,children:ve.only(this.props.children)}),e):null}}C(ke,"FLOAT_PANE","floatPane");C(ke,"MAP_PANE","mapPane");C(ke,"MARKER_LAYER","markerLayer");C(ke,"OVERLAY_LAYER","overlayLayer");C(ke,"OVERLAY_MOUSE_TARGET","overlayMouseTarget");C(ke,"contextType",F);function Jo(){}function ws(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function xs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ws(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ws(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var Ms={onDblClick:"dblclick",onClick:"click"},Os={opacity(n,e){n.setOpacity(e)}};function qo(n){var{url:e,bounds:t,options:s,visible:i}=n,r=oe(F),o=new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.west),new google.maps.LatLng(t.north,t.east)),a=Ue(()=>new google.maps.GroundOverlay(e,o,s),[]);return g(()=>{a!==null&&a.setMap(r)},[r]),g(()=>{typeof e<"u"&&a!==null&&(a.set("url",e),a.setMap(r))},[a,e]),g(()=>{typeof i<"u"&&a!==null&&a.setOpacity(i?1:0)},[a,i]),g(()=>{var l=new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.west),new google.maps.LatLng(t.north,t.east));typeof t<"u"&&a!==null&&(a.set("bounds",l),a.setMap(r))},[a,t]),null}le(qo);class ui extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{groundOverlay:null}),C(this,"setGroundOverlayCallback",()=>{this.state.groundOverlay!==null&&this.props.onLoad&&this.props.onLoad(this.state.groundOverlay)})}componentDidMount(){ae(!!this.props.url||!!this.props.bounds,"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655");var e=new google.maps.GroundOverlay(this.props.url,this.props.bounds,xs(xs({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:Os,eventMap:Ms,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{groundOverlay:e}},this.setGroundOverlayCallback)}componentDidUpdate(e){this.state.groundOverlay!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Os,eventMap:Ms,prevProps:e,nextProps:this.props,instance:this.state.groundOverlay}))}componentWillUnmount(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))}render(){return null}}C(ui,"defaultProps",{onLoad:Jo});C(ui,"contextType",F);function Ss(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,s)}return t}function vt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
37e%2?Ss(Object(t),!0).forEach(function(s){C(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ss(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}var Es={},ks={data(n,e){n.setData(e)},map(n,e){n.setMap(e)},options(n,e){n.setOptions(e)}};function Yo(n){var{data:e,onLoad:t,onUnmount:s,options:i}=n,r=oe(F),[o,a]=y(null);return g(()=>{google.maps.visualization||ae(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)},[]),g(()=>{ae(!!e,"data property is required in HeatmapLayer %s",e)},[e]),g(()=>{o!==null&&o.setMap(r)},[r]),g(()=>{i&&o!==null&&o.setOptions(i)},[o,i]),g(()=>{var l=new google.maps.visualization.HeatmapLayer(vt(vt({},i),{},{data:e,map:r}));return a(l),t&&t(l),()=>{o!==null&&(s&&s(o),o.setMap(null))}},[]),null}le(Yo);class Qo extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{heatmapLayer:null}),C(this,"setHeatmapLayerCallback",()=>{this.state.heatmapLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.heatmapLayer)})}componentDidMount(){ae(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to <LoadScript />? %s',google.maps.visualization),ae(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var e=new google.maps.visualization.HeatmapLayer(vt(vt({},this.props.options),{},{data:this.props.data,map:this.context}));this.registeredEvents=Z({updaterMap:ks,eventMap:Es,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{heatmapLayer:e}},this.setHeatmapLayerCallback)}componentDidUpdate(e){G(this.registeredEvents),this.registeredEvents=Z({updaterMap:ks,eventMap:Es,prevProps:e,nextProps:this.props,instance:this.state.heatmapLayer})}componentWillUnmount(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),G(this.registeredEvents),this.state.heatmapLayer.setMap(null))}render(){return null}}C(Qo,"contextType",F);var Ps={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},Ds={register(n,e,t){n.registerPanoProvider(e,t)},links(n,e){n.setLinks(e)},motionTracking(n,e){n.setMotionTracking(e)},options(n,e){n.setOptions(e)},pano(n,e){n.setPano(e)},position(n,e){n.setPosition(e)},pov(n,e){n.setPov(e)},visible(n,e){n.setVisible(e)},zoom(n,e){n.setZoom(e)}};class Xo extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{streetViewPanorama:null}),C(this,"setStreetViewPanoramaCallback",()=>{this.state.streetViewPanorama!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewPanorama)})}componentDidMount(){var e,t,s=(e=(t=this.context)===null||t===void 0?void 0:t.getStreetView())!==null&&e!==void 0?e:null;this.registeredEvents=Z({updaterMap:Ds,eventMap:Ps,prevProps:{},nextProps:this.props,instance:s}),this.setState(()=>({streetViewPanorama:s}),this.setStreetViewPanoramaCallback)}componentDidUpdate(e){this.state.streetViewPanorama!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Ds,eventMap:Ps,prevProps:e,nextProps:this.props,instance:this.state.streetViewPanorama}))}componentWillUnmount(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),G(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))}render(){return null}}C(Xo,"contextType",F);class ea extends se{constructor(){super(...arguments),C(this,"state",{streetViewService:null}),C(this,"setStreetViewServiceCallback",()=>{this.state.streetViewService!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewService)})}componentDidMount(){var e=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:e}},this.setStreetViewServiceCallback)}componentWillUnmount(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)}render(){return null}}C(ea,"contextType",F);var Is={onDirectionsChanged:"directions_changed"},Rs={directions(n,e){n.setDirections(e)},map(n,e){n.setMap(e)},options(n,e){n.setOptions(e)},panel(n,e){n.setPanel(e)},routeIndex(n,e){n.setRouteIndex(e)}};class ta extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"state",{directionsRenderer:null}),C(this,"setDirectionsRendererCallback",()=>{this.state.directionsRenderer!==null&&(this.state.directionsRenderer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.directionsRenderer))})}componentDidMount(){var e=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Z({updaterMap:Rs,eventMap:Is,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{directionsRenderer:e}},this.setDirectionsRendererCallback)}componentDidUpdate(e){this.state.directionsRenderer!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:Rs,eventMap:Is,prevProps:e,nextProps:this.props,instance:this.state.directionsRenderer}))}componentWillUnmount(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),G(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))}render(){return null}}C(ta,"contextType",F);var Ts={onPlacesChanged:"places_changed"},js={bounds(n,e){n.setBounds(e)}};
37class na extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"containerElement",jt()),C(this,"state",{searchBox:null}),C(this,"setSearchBoxCallback",()=>{this.state.searchBox!==null&&this.props.onLoad&&this.props.onLoad(this.state.searchBox)})}componentDidMount(){if(ae(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var e=this.containerElement.current.querySelector("input");if(e!==null){var t=new google.maps.places.SearchBox(e,this.props.options);this.registeredEvents=Z({updaterMap:js,eventMap:Ts,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{searchBox:t}},this.setSearchBoxCallback)}}}componentDidUpdate(e){this.state.searchBox!==null&&(G(this.registeredEvents),this.registeredEvents=Z({updaterMap:js,eventMap:Ts,prevProps:e,nextProps:this.props,instance:this.state.searchBox}))}componentWillUnmount(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),G(this.registeredEvents))}render(){return ce.jsx("div",{ref:this.containerElement,children:ve.only(this.props.children)})}}C(na,"contextType",F);var Ns={onPlaceChanged:"place_changed"},As={bounds(n,e){n.setBounds(e)},restrictions(n,e){n.setComponentRestrictions(e)},fields(n,e){n.setFields(e)},options(n,e){n.setOptions(e)},types(n,e){n.setTypes(e)}};class ci extends se{constructor(){super(...arguments),C(this,"registeredEvents",[]),C(this,"containerElement",jt()),C(this,"state",{autocomplete:null}),C(this,"setAutocompleteCallback",()=>{this.state.autocomplete!==null&&this.props.onLoad&&this.props.onLoad(this.state.autocomplete)})}componentDidMount(){var e;ae(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places);var t=(e=this.containerElement.current)===null||e===void 0?void 0:e.querySelector("input");if(t){var s=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=Z({updaterMap:As,eventMap:Ns,prevProps:{},nextProps:this.props,instance:s}),this.setState(()=>({autocomplete:s}),this.setAutocompleteCallback)}}componentDidUpdate(e){G(this.registeredEvents),this.registeredEvents=Z({updaterMap:As,eventMap:Ns,prevProps:e,nextProps:this.props,instance:this.state.autocomplete})}componentWillUnmount(){this.state.autocomplete!==null&&G(this.registeredEvents)}render(){return ce.jsx("div",{ref:this.containerElement,className:this.props.className,children:ve.only(this.props.children)})}}C(ci,"defaultProps",{className:""});C(ci,"contextType",F);const sa={width:"100%",height:"100%"},Us={lat:56,lng:-96},ia={path:"M 0,0 m -6,0 a 6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0",fillColor:"#4285F4",f
37illOpacity:1,strokeColor:"#ffffff",strokeWeight:2,scale:1.2},_s=16,ra=700,oa=({stores:n,activeStoreId:e,onMarkerClick:t,userLocation:s,query:i,apiKey:r})=>{const{t:o,i18n:a}=xe(),l=!r;g(()=>{l&&console.error('[tsa-thrift-store-location-mapper] Missing required "google-maps-api-key" attribute on the custom element.')},[l]);const{isLoaded:u,loadError:c}=Ir({googleMapsApiKey:r||"",language:a.language}),d=he(null),[p,f]=y(null),h=rn(m=>{d.current=m},[]);g(()=>{if(!e)return;f(e);const m=setTimeout(()=>f(null),ra);return()=>clearTimeout(m)},[e]);const w=rn(()=>{if(!(!d.current||!n.length))if(s)d.current.panTo(s),d.current.setZoom(10);else if(i)if(n.length===1)d.current.panTo({lat:n[0].lat,lng:n[0].lng}),d.current.setZoom(_s);else{const m=new window.google.maps.LatLngBounds;n.forEach(E=>m.extend({lat:E.lat,lng:E.lng})),d.current.fitBounds(m,{maxZoom:13})}else d.current.panTo(Us),d.current.setZoom(4)},[n,s,i]);return g(()=>{w()},[w]),g(()=>{if(!d.current)return;if(!e){w();return}const m=n.find(E=>E.id===e);m&&(d.current.panTo({lat:m.lat,lng:m.lng}),d.current.setZoom(_s))},[e,n,w]),R.createElement("div",{className:"slm-map"},l&&R.createElement("div",{className:"slm-map-error"},o("mapConfigError")),!l&&c&&R.createElement("div",{className:"slm-map-error"},o("mapLoadError")),!l&&!u&&!c&&R.createElement("div",{className:"slm-map-loading"},o("mapLoading")),!l&&u&&!c&&R.createElement(Lr,{mapContainerStyle:sa,center:Us,zoom:4,onLoad:h},n.map(m=>R.createElement(It,{key:m.id,position:{lat:m.lat,lng:m.lng},zIndex:m.id===e?1e3:1,animation:m.id===p?window.google.maps.Animation.BOUNCE:void 0,onClick:()=>t(m)})),s&&R.createElement(It,{position:s,icon:ia,title:"Your location",zIndex:999})))},aa=100,la=[{field:"thriftStore",labelKey:"THRIFT_STORE"},{field:"donorWelcomeCentre",labelKey:"DONOR_WELCOME_CENTRE"},{field:"donorDropOffBinClothingOnly",labelKey:"DONATION_DROP_OFF_BIN"}];function it(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/\s+/g,"")}function ua(n,e,t,s){const r=(t-n)*Math.PI/180,o=(s-e)*Math.PI/180,a=Math.sin(r/2)*Math.sin(r/2)+Math.cos(n*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 6371*2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function ca(n){var e,t,s,i,r,o,a,l,u;return{id:n.id,nameEn:((e=n.name_i18n)==null?void 0:e.en_CA)||n.name,nameFr:((t=n.name_i18n)==null?void 0:t.fr_CA)||n.name,address:((s=n.streetAddress_i18n)==null?void 0:s.en_CA)||n.streetAddress,streetAddressFr:((i=n.streetAddress_i18n)==null?void 0:i.fr_CA)||n.streetAddress,city:((r=n.city_i18n)==null?void 0:r.en_CA)||n.city,cityFr:((o=n.city_i18n)==null?void 0:o.fr_CA)||n.city,province:((a=n.province_i18n)==null?void 0:a.en_CA)||n.province,postalCode:n.postalCode,types:la.filter(c=>n[c.field]===!0).map(c=>c.labelKey),detailsPageUrl:((l=n.detailsPageURL_i18n)==null?void 0:l.en_CA)||n.detailsPageURL||"",detailsPageUrlFr:((u=n.detailsPageURL_i18n)==null?void 0:u.fr_CA)||n.detailsPageURL||"",lat:Number(n.latitude),lng:Number(n.longitude)}}function da(n){return Number.isFinite(n.lat)&&Number.isFinite(n.lng)}async function pa(n){var l;const t={Accept:"application/json","x-csrf-token":((l=window.Liferay)==null?void 0:l.authToken)||""},s=await fetch(`/o/c/locationses/scopes/${n}?restrictFields=actions&pageSize=200`,{headers:t});if(!s.ok)throw new Error(`Failed to load store locations (HTTP ${s.status})`);const r=((await s.json()).items||[]).map(ca),o=r.filter(da),a=r.length-o.length;return a>0&&console.error(`[tsa-thrift-store-location-mapper] Dropped ${a} store(s) with missing/invalid coordinates.`),o}function ga(n,e,t){const{i18n:s}=xe(),[i,r]=y([]),[o,a]=y([]),[l,u]=y(!0);return g(()=>{if(!t){console.error('[tsa-thrift-store-location-mapper] Missing required "site-id" attribute on the custom element.'),r([]),u(!1);return}let c=!1;return u(!0),pa(t).then(d=>{c||r(d)}).catch(d=>{console.error("[tsa-thrift-store-location-mapper] Failed to load stores:",d),c||r([])}).finally(()=>{c||u(!1)}),()=>{c=!0}},[t]),g(()=>{const c=it(n||"");let d;if(c){const p=s.language==="fr";d=i.filter(f=>!!(it(f.city).includes(c)||it(f.postalCode).includes(c)||p&&it(f.cityFr||"").includes(c)))}else if(e){const p=i.map(f=>({...f,distanceKm:ua(e.lat,e.lng,f.lat,f.lng)}));d=p.filter(f=>f.distanceKm<=aa),d.length||(d=p),d=d.sort((f,h)=>f.distanceKm-h.distanceKm)}else d=i;a(d)},[n,e,i,s.language]),{stores:o,loading:l}}const ha=["THRIFT_STORE","DONOR_WELCOME_CENTRE","DONATION_DROP_OFF_BIN"],fa=({siteId:n,googleMapsApiKey:e})=>{const{t}=xe(),[s,i]=y(()=>new URLSearchParams(window.location.search).get("q")||""),[r,o]=y(()=>{const k=new URLSearchParams(window.location.search).get("storeId");return k?Number(k):null}),[a,l]=y(null),[u,c]=y("list"),[d,p]=y(()=>{const k=new URLSearchParams(window.location.search).get("types");
37return k?k.split(",").filter(Boolean):[]}),[f,h]=y(null),{stores:w,loading:m}=ga(s,a,n),E=d.length?w.filter(k=>k.types.some(M=>d.includes(M))):w,x=f?E.findIndex(k=>k.id===f):-1,P=x>0?[E[x],...E.slice(0,x),...E.slice(x+1)]:E,L=k=>{p(M=>M.includes(k)?M.filter(I=>I!==k):[...M,k])};g(()=>{const k=new URLSearchParams;s&&k.set("q",s),d.length&&k.set("types",d.join(",")),r&&k.set("storeId",r);const M=k.toString();window.history.replaceState(null,"",M?`${window.location.pathname}?${M}`:window.location.pathname)},[s,d,r]),g(()=>{h(null)},[s,d]),g(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(k=>l({lat:k.coords.latitude,lng:k.coords.longitude}),()=>{})},[]);const v=k=>{if(k.id===r){o(null),h(null);return}o(k.id),!(window.innerWidth<768&&u==="map")&&c("list")};g(()=>{var k;r&&(window.innerWidth<768&&u==="map"||(k=document.getElementById(`store-${r}`))==null||k.scrollIntoView({behavior:"smooth",block:"nearest"}))},[r,P]);const b=k=>{if(k.id===r){o(null),h(null);return}h(k.id),v(k)},S=w.find(k=>k.id===r)||null;return R.createElement("div",{className:"slm-wrapper"},R.createElement("div",{className:"slm-header"},R.createElement("h2",{className:"slm-section-title"},t("findLocation")),R.createElement(Qi,{onSearch:i,initialValue:s}),R.createElement("div",{className:"slm-filters"},R.createElement("span",{className:"slm-filters__label"},t("filtersLabel")),R.createElement("div",{className:"slm-filters__options"},ha.map(k=>R.createElement("button",{key:k,className:`slm-filter-btn ${d.includes(k)?"slm-filter-btn--active":""}`,onClick:()=>L(k)},t(`storeTypes.${k}`)))))),R.createElement("div",{className:"slm-tabs"},R.createElement("button",{className:`slm-tab slm-tab--list ${u==="list"?"slm-tab--active":""}`,onClick:()=>c("list")},R.createElement("span",{className:"slm-tab__inner"},t("tabList")," (",P.length,")"),R.createElement("span",{className:"slm-tab__bar"})),R.createElement("button",{className:`slm-tab slm-tab--map ${u==="map"?"slm-tab--active":""}`,onClick:()=>c("map")},R.createElement("span",{className:"slm-tab__inner"},t("tabMap")),R.createElement("span",{className:"slm-tab__bar"}))),R.createElement("div",{className:"slm-split-view"},R.createElement("div",{className:`slm-list-panel ${u==="map"?"slm-list-panel--map-active":""}`},R.createElement(tr,{stores:P,activeStoreId:r,onStoreClick:v,loading:m})),R.createElement("div",{className:`slm-map-panel ${u!=="map"?"slm-panel--hidden-mobile":""}`},R.createElement(oa,{stores:P,activeStoreId:r,onMarkerClick:b,userLocation:a,query:s,apiKey:e})),S&&u==="map"&&R.createElement("div",{className:"slm-map-pin-card"},R.createElement(Gs,{store:S,isActive:!0,onClick:()=>{}}))))},ma=()=>{const{t:n}=xe();return R.createElement("div",{className:"slm-wrapper"},R.createElement("p",{className:"slm-error-boundary"},n("widgetError")))};class va extends R.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("[tsa-thrift-store-location-mapper] Unexpected error:",e,t.componentStack)}render(){return this.state.hasError?R.createElement(ma,null):this.props.children}}class ya extends HTMLElement{connectedCallback(){if(!this.root){const e=this.getAttribute("site-id"),t=this.getAttribute("google-maps-api-key");this.removeAttribute("google-maps-api-key"),this.root=Vs(this),this.root.render(R.createElement(va,null,R.createElement(fa,{siteId:e,googleMapsApiKey:t})))}}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null)}}customElements.get("tsa-thrift-store-location-mapper")||customElements.define("tsa-thrift-store-location-mapper",ya);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.