@omnic/widget-locations 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/widget.cjs.js +24 -24
- package/dist/lib/widget.esm.js +4008 -3877
- package/package.json +10 -10
package/dist/lib/widget.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),u=require("react"),dr=require("react-dom"),$i=require("react-dom/server");function tu(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const ce=tu(u),nu=tu(dr);function ia(t){return!!(t&&typeof t.then=="function")}function Hi(t,e){return ia(t)?Promise.resolve(t).then(e):e(t)}function Na(t){const e=(Array.isArray(t)?t:[t]).map(o=>`'${o}'`),n=e.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...e.slice(0,-2),n].join(", ")} option`}function qd(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function ru(t){if(typeof t=="string")return[t];if(Array.isArray(t))return t}function Ct(t){return ru(t)||[]}function Kd(t,e){return qd(e)?Ct(e==null?void 0:e[t]):Ct(e)}function ys(t){return Array.from(new Set(t))}function iu(t){return t&&t.replace(/\/+$/,"")}function Jd(t){if(typeof t=="string")return t;if(typeof(t==null?void 0:t.message)=="string")return t.message}const Yd=(t,e)=>fetch(t,e),ou=(t=Yd)=>(e,n)=>t(e,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.16.0"},n==null?void 0:n.headers)}));function on(t){let e=[];return Object.freeze({listen(n){const r=i=>{n(i)};return e.push(r),{unsubscribe(){e=e.filter(i=>r!==i)}}},emit(n){t()&&e.forEach(r=>r({value:n}))}})}function Xd(t,e,n){const r=new Set,i=new Set;function o(l){const c=new Set(e());i.forEach(f=>{(l===void 0||(l==null?void 0:l.findIndex(p=>c.has(p)||f.namespaces.has(p)))!==-1)&&f.fn({value:void 0})})}let s=[];function a(){if(s.length===0)return;const l=s;s=[],r.forEach(d=>{d({value:void 0})});let c=new Set;l.forEach(d=>{d===void 0?c=void 0:c!==void 0&&d.forEach(p=>c.add(p))});const f=c?Array.from(c.keys()):void 0;o(f)}return Object.freeze({emit(l,c){t()&&(s.push(l),c?setTimeout(a,0):a())},listen(l){return r.add(l),{unsubscribe:()=>{r.delete(l)}}},listenSome(l){const c={fn:d=>{l(d)},namespaces:new Set};i.add(c);const f={unsubscribe:()=>{i.delete(c)},subscribeNs:d=>(Ct(d).forEach(p=>c.namespaces.add(p)),d===void 0&&c.namespaces.add(n()),f)};return f}})}function Qd(t,e){let n=!0;function r(){return n}const i=Object.freeze({onPendingLanguageChange:on(r),onLanguageChange:on(r),onLoadingChange:on(r),onFetchingChange:on(r),onInitialLoaded:on(r),onRunningChange:on(r),onCacheChange:on(r),onUpdate:Xd(r,t,e),onPermanentChange:on(r),setEmitterActive(o){n=o},on:(o,s)=>{switch(o){case"pendingLanguage":return i.onPendingLanguageChange.listen(s);case"language":return i.onLanguageChange.listen(s);case"loading":return i.onLoadingChange.listen(s);case"fetching":return i.onFetchingChange.listen(s);case"initialLoad":return i.onInitialLoaded.listen(s);case"running":return i.onRunningChange.listen(s);case"cache":return i.onCacheChange.listen(s);case"update":return i.onUpdate.listen(s);case"permanentChange":return i.onPermanentChange.listen(s)}}});return i.onInitialLoaded.listen(()=>i.onUpdate.emit()),i.onLanguageChange.listen(()=>i.onUpdate.emit()),i.onCacheChange.listen(({value:o})=>i.onUpdate.emit([o.namespace],!0)),i}const su=t=>{const e=new Map;return Object.entries(t).forEach(([n,r])=>{if(r!=null){if(typeof r=="object"){su(r).forEach((i,o)=>{e.set(n+"."+o,i)});return}e.set(n,r)}}),e},Ar=t=>{const[e,...n]=t.split(":"),r=n.join(":");return{language:e,namespace:r||""}},qt=({language:t,namespace:e})=>e?`${t}:${e}`:t;function ep(t,e,n,r,i,o,s){const a=new Map,l=new Map;let c={},f=0;function d(h,w,S){const y=qt(h);l.set(y,{data:su(w),version:S}),t.emit(h)}function p(h){let w;if(!w){const S=c[qt(h)];typeof S=="function"&&(w=S())}return w||(w=e(h)),w}function v(h,w){var S;let y;return w&&(y=(S=n(h))===null||S===void 0?void 0:S.catch(()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),p(h)))),y||(y=p(h)),y}const g=Object.freeze({addStaticData(h){h&&(c=Object.assign(Object.assign({},c),h),Object.entries(h).forEach(([w,S])=>{if(typeof S!="function"){const y=Ar(w),b=l.get(w);(!b||b.version===0)&&d(y,S,0)}}))},invalidate(){a.clear(),f+=1},addRecord(h,w){d(h,w,f)},exists(h,w=!1){const S=l.get(qt(h));return S&&w?S.version===f:!!S},getRecord(h){var w;return(w=l.get(qt(r(h))))===null||w===void 0?void 0:w.data},getTranslation(h,w){var S;return(S=l.get(qt(h)))===null||S===void 0?void 0:S.data.get(w)},getTranslationNs(h,w,S){var y;for(const b of h)for(const O of w){const L=(y=l.get(qt({language:O,namespace:b})))===null||y===void 0?void 0:y.data.get(S);if(L!=null)return[b]}return ys(h)},getTranslationFallback(h,w,S){var y;for(const b of h)for(const O of w){const L=(y=l.get(qt({language:O,namespace:b})))===null||y===void 0?void 0:y.data.get(S);if(L!=null)return L}},changeTranslation(h,w,S){var y;const b=(y=l.get(qt(h)))===null||y===void 0?void 0:y.data;b==null||b.set(w,S),t.emit(Object.assign(Object.assign({},h),{key:w}))},isFetching(h){if(i())return!0;if(h===void 0)return a.size>0;const w=Ct(h);return!!Array.from(a.keys()).find(S=>w.includes(Ar(S).namespace))},isLoading(h,w){const S=Ct(w);return!!(i()||Array.from(a.keys()).find(y=>{const b=Ar(y);return(!S.length||S.includes(b.namespace))&&!g.exists({namespace:b.namespace,language:h})}))},async loadRecords(h,w){const S=h.map(b=>{const O=r(b),L=qt(O),m=a.get(L);if(m)return{new:!1,promise:m,keyObject:O,cacheKey:L};const x=v(O,w)||Promise.resolve(void 0);return a.set(L,x),{new:!0,promise:x,keyObject:O,cacheKey:L}});o.notify(),s.notify();const y=await Promise.all(S.map(b=>b.promise));return S.forEach((b,O)=>{const L=a.get(b.cacheKey)!==b.promise;if(b.new&&!L){a.delete(b.cacheKey);const m=y[O];m?g.addRecord(b.keyObject,m):g.getRecord(b.keyObject)||g.addRecord(b.keyObject,{})}}),o.notify(),s.notify(),S.map(b=>g.getRecord(b.keyObject))},getAllRecords(){return Array.from(l.entries()).map(([w,S])=>Object.assign(Object.assign({},Ar(w)),{data:S.data}))}});return g}function au(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}const tp={tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},bs="invalid",np="https://app.tolgee.io",rp=({key:t})=>t,ip={defaultNs:"",observerOptions:tp,observerType:"invisible",onFormatError:bs,apiUrl:np,fetch:ou(),onTranslationMissing:rp},ws=(...t)=>{let e={};return t.forEach(n=>{e=Object.assign(Object.assign(Object.assign({},e),n),{observerOptions:Object.assign(Object.assign({},e.observerOptions),n==null?void 0:n.observerOptions)})}),e};function Ba(t,e){const n=ws(ip,e==null?void 0:e.initialOptions,t);return n.apiUrl=iu(n.apiUrl),t!=null&&t.fetch&&(n.fetch=ou(t.fetch)),{initialOptions:n,activeNamespaces:(e==null?void 0:e.activeNamespaces)||new Map,language:e==null?void 0:e.language,pendingLanguage:e==null?void 0:e.language,isInitialLoading:!1,isRunning:!1}}function op(t,e,n,r,i,o,s,a){const l={ui:void 0},c={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},f=async({keysAndDefaults:_,event:P})=>{var j;const V=_.map(({key:$,ns:G,defaultValue:z})=>({key:$,defaultValue:z,fallbackNamespaces:r(G),namespace:i({key:$,ns:G})[0],translation:o({key:$,ns:G})}));(j=c.ui)===null||j===void 0||j.handleElementClick(V,P)},d=(_,P)=>{var j;return((j=c.observer)===null||j===void 0?void 0:j.findPositions(_,P))||[]};function p(_){const P=o({key:_.key,ns:_.ns});return M.formatTranslation(Object.assign(Object.assign({},_),{translation:P,formatEnabled:!0}))}function v(){return{fetch:e().fetch}}function g(_){c.observer=_==null?void 0:_()}function h(){return!!c.observer}function w(_){_&&c.formatters.push(_)}function S(_){c.finalFormatter=_}function y(_){l.ui=_}function b(){return!!l.ui}function O(_){c.languageStorage=_}function L(_){c.languageDetector=_}function m(){if(!c.languageDetector)return;const _=n();return c.languageDetector.getLanguage(Object.assign({availableLanguages:_},v()))}function x(_){_&&c.backends.push(_)}function C(_){c.devBackend=_}function R(_,P){const j=Object.freeze({setFinalFormatter:S,addFormatter:w,setObserver:g,hasObserver:h,setUi:y,hasUi:b,setDevBackend:C,addBackend:x,setLanguageDetector:L,setLanguageStorage:O});P(_,j)}const M=Object.freeze({addPlugin:R,run(){var _,P;const{apiKey:j,apiUrl:V,projectId:$,observerOptions:G}=e();c.ui=(_=l.ui)===null||_===void 0?void 0:_.call(l,{apiKey:j,apiUrl:V,projectId:$,highlight:M.highlight,changeTranslation:s,findPositions:d,onPermanentChange:a}),(P=c.observer)===null||P===void 0||P.run({mouseHighlight:!0,options:G,translate:p,onClick:f})},stop(){var _;c.ui=void 0,(_=c.observer)===null||_===void 0||_.stop()},getLanguageStorage(){return c.languageStorage},getInitialLanguage(){var _;const P=n(),j=(_=c.languageStorage)===null||_===void 0?void 0:_.getLanguage(v());return Hi(j,V=>(!P||P.includes(V))&&V?V:m())},setStoredLanguage(_){var P;(P=c.languageStorage)===null||P===void 0||P.setLanguage(_,v())},getDevBackend(){return c.devBackend},getBackendRecord:({language:_,namespace:P})=>{for(const j of c.backends){const V=j.getRecord(Object.assign({language:_,namespace:P},v()));if(ia(V))return V==null?void 0:V.catch($=>(console.error($),{}));if(V!==void 0)return V}},getBackendDevRecord:({language:_,namespace:P})=>{var j;const{apiKey:V,apiUrl:$,projectId:G}=e();return(j=c.devBackend)===null||j===void 0?void 0:j.getRecord(Object.assign({apiKey:V,apiUrl:$,projectId:G,language:_,namespace:P},v()))},getLanguageDetector(){return c.languageDetector},retranslate(){var _;(_=c.observer)===null||_===void 0||_.retranslate()},highlight:(_,P)=>{var j,V;return((V=(j=c.observer)===null||j===void 0?void 0:j.highlight)===null||V===void 0?void 0:V.call(j,_,P))||{unhighlight(){}}},unwrap(_){var P;return c.observer?(P=c.observer)===null||P===void 0?void 0:P.unwrap(_):{text:_,keys:[]}},wrap(_){var P;return c.observer?(P=c.observer)===null||P===void 0?void 0:P.wrap(_):_.translation},hasDevBackend(){return!!M.getDevBackend()},formatTranslation(_){var P,{formatEnabled:j}=_,V=au(_,["formatEnabled"]);const{key:$,translation:G,defaultValue:z,noWrap:W,params:D,ns:k,orEmpty:A}=V,T=G??z;let N="";G==null&&(N=e().onTranslationMissing(V));let U=T??(A?"":N);const Z=t(),I=j||!(!((P=c.observer)===null||P===void 0)&&P.outputNotFormattable),K=ee=>c.observer&&!W?c.observer.wrap({key:$,translation:ee,defaultValue:z,params:D,ns:k}):ee;U=K(U);try{if(T&&Z&&I)for(const ee of c.formatters)U=ee.format({translation:U,language:Z,params:D});c.finalFormatter&&T&&Z&&I&&(U=c.finalFormatter.format({translation:U,language:Z,params:D}))}catch(ee){console.error(ee);const q=Jd(ee)||bs,se=e().onFormatError,de=typeof se;de==="string"?U=se:de==="function"?U=se(q,V):U=bs,U=K(U)}return U}});return M}const Ua=(t,e,n)=>{let r=t;return Object.freeze({init(i){r=i},notify(){const i=e();r!==i&&n(i),r=i}})};function sp(t,e,n){let r=Ba(),i;const o=Object.freeze({init(s){r=Ba(s,r)},isRunning(){return r.isRunning},setRunning(s){r.isRunning!==s&&(r.isRunning=s,n.emit(s))},isInitialLoading(){return r.isInitialLoading},setInitialLoading(s){r.isInitialLoading=s},getLanguage(){return r.language||r.initialOptions.language},setLanguage(s){r.language!==s&&(r.language=s,t.emit(s))},getPendingLanguage(){return r.pendingLanguage||o.getLanguage()},setPendingLanguage(s){r.pendingLanguage!==s&&(r.pendingLanguage=s,e.emit(s))},getInitialOptions(){return Object.assign(Object.assign({},r.initialOptions),i)},addActiveNs(s){Ct(s).forEach(l=>{const c=r.activeNamespaces.get(l);c!==void 0?r.activeNamespaces.set(l,c+1):r.activeNamespaces.set(l,1)})},removeActiveNs(s){Ct(s).forEach(l=>{const c=r.activeNamespaces.get(l);c!==void 0&&c>1?r.activeNamespaces.set(l,c-1):r.activeNamespaces.delete(l)})},getRequiredNamespaces(){return ys([...r.initialOptions.ns||[r.initialOptions.defaultNs],...Ct(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()])},getFallbackLangs(s){const a=s||o.getLanguage();return a?ys([a,...Kd(a,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs(){return Ct(r.initialOptions.fallbackNs)},getDefaultNs(s){return s===void 0?r.initialOptions.defaultNs:s},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const s=Object.keys(r.initialOptions.staticData).map(a=>Ar(a).language);return Array.from(new Set(s))}},withDefaultNs(s){return{namespace:s.namespace===void 0?o.getInitialOptions().defaultNs:s.namespace,language:s.language}},overrideCredentials(s){s?i=Object.assign(Object.assign({},s),{apiUrl:iu(s.apiUrl)}):i=void 0}});return o}function ap(t){var{ns:e,noWrap:n,orEmpty:r,params:i,language:o}=t,s=au(t,["ns","noWrap","orEmpty","params","language"]);return Object.assign(Object.assign({},{ns:e,noWrap:n,orEmpty:r,language:o}),{params:Object.assign({},s)})}const lu=(t,...e)=>{let n={},r;return typeof t=="object"?n=t:(n.key=t,typeof e[0]=="string"?(n.defaultValue=e[0],r=e[1]):typeof e[0]=="object"&&(r=e[0])),r&&(n=Object.assign(Object.assign({},ap(r)),n)),n};function lp({options:t}){const e=Qd(l,c),n=Ua(!1,()=>s.isFetching(),e.onFetchingChange.emit),r=Ua(!1,()=>m.isLoading(),e.onLoadingChange.emit),i=sp(e.onLanguageChange,e.onPendingLanguageChange,e.onRunningChange),o=op(i.getLanguage,i.getInitialOptions,i.getAvailableLanguages,f,S,y,p,v),s=ep(e.onCacheChange,o.getBackendRecord,o.getBackendDevRecord,i.withDefaultNs,i.isInitialLoading,n,r);t&&g(t);let a;e.onUpdate.listen(()=>{i.isRunning()&&o.retranslate()});function l(){return i.getFallbackNs()}function c(x){return i.getDefaultNs(x)}function f(x){return[...Ct(c(x)),...l()]}function d(x){return[...Ct(x??c()),...i.getRequiredNamespaces()]}function p(x,C,R){const M=i.withDefaultNs(x),_=s.getTranslation(M,C);return s.changeTranslation(M,C,R),{revert(){s.changeTranslation(M,C,_)}}}function v(x){e.onPermanentChange.emit({key:x.key,namespace:x.namespace})}function g(x){i.init(x),s.addStaticData(i.getInitialOptions().staticData)}function h(x,C){const R=i.getFallbackLangs(x),M=d(C),_=[];return R.forEach(P=>{M.forEach(j=>{s.exists({language:P,namespace:j},!0)||_.push({language:P,namespace:j})})}),_}function w(x,C){const R=h(x,C);if(R.length)return Hi(m.loadRecords(R),()=>{})}function S({key:x,ns:C}){const R=i.getFallbackLangs(),M=f(C??void 0);return s.getTranslationNs(M,R,x)}function y({key:x,ns:C,language:R}){const M=f(C??void 0),_=i.getFallbackLangs(R);return s.getTranslationFallback(M,_,x)}function b(){const x=Hi(O(),()=>w());if(ia(x))return i.setInitialLoading(!0),n.notify(),r.notify(),Promise.resolve(x).then(()=>{i.setInitialLoading(!1),n.notify(),r.notify(),e.onInitialLoaded.emit()});e.onInitialLoaded.emit()}function O(){if(i.getLanguage())return;const C=o.getInitialLanguage();return Hi(C,R=>{const M=R||i.getInitialOptions().defaultLanguage;M&&i.setLanguage(M)})}function L(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!i.getAvailableLanguages())throw new Error(Na("availableLanguages"));if(!i.getLanguage()&&!i.getInitialOptions().defaultLanguage)throw new Error(Na(["defaultLanguage","language"]))}const m=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),i),o),s),{init:g,getTranslation:y,changeTranslation:p,getTranslationNs:S,getDefaultAndFallbackNs:f,async changeLanguage(x){i.getPendingLanguage()===x&&i.getLanguage()===x||(i.setPendingLanguage(x),i.isRunning()&&await w(x),x===i.getPendingLanguage()&&(i.setLanguage(x),o.setStoredLanguage(x)))},async addActiveNs(x,C){C||i.addActiveNs(x),i.isRunning()&&await w(void 0,x)},loadRecords(x){return s.loadRecords(x,m.isDev())},async loadRecord(x){return(await m.loadRecords([x]))[0]},isLoading(x){return s.isLoading(i.getLanguage(),x)},isLoaded(x){const C=i.getLanguage();if(!C)return!1;const R=i.getFallbackLangs(C),M=d(x),_=[];return R.forEach(P=>{M.forEach(j=>{s.exists({language:P,namespace:j})||_.push({language:P,namespace:j})})}),_.length===0},t:(...x)=>{const C=lu(...x),R=y(C);return o.formatTranslation(Object.assign(Object.assign({},C),{translation:R}))},isDev(){return!!(i.getInitialOptions().apiKey&&i.getInitialOptions().apiUrl)},run(){return L(),i.isRunning()||(i.setRunning(!0),o.run(),a=b()),Promise.resolve(a)},stop(){i.isRunning()&&(o.stop(),i.setRunning(!1))}}));return m}function cp(t){const e=lp({options:t});e.isDev()&&e.invalidate();function n(i){const o=e.isRunning();o&&e.stop(),i(),e.isDev()&&e.invalidate(),o&&e.run()}const r=Object.freeze({on:e.on,onNsUpdate:e.onUpdate.listenSome,setEmitterActive:e.setEmitterActive,getLanguage:e.getLanguage,getPendingLanguage:e.getPendingLanguage,changeLanguage:e.changeLanguage,changeTranslation:e.changeTranslation,addActiveNs:e.addActiveNs,removeActiveNs:e.removeActiveNs,loadRecords:e.loadRecords,loadRecord:e.loadRecord,addStaticData:e.addStaticData,getRecord:e.getRecord,getAllRecords:e.getAllRecords,isLoaded:e.isLoaded,isInitialLoading:e.isInitialLoading,isLoading:e.isLoading,isFetching:e.isFetching,isRunning:e.isRunning,run:e.run,stop:e.stop,t:e.t,highlight:e.highlight,getInitialOptions:e.getInitialOptions,isDev:e.isDev,wrap:e.wrap,unwrap:e.unwrap,overrideCredentials(i){n(()=>e.overrideCredentials(i))},addPlugin(i){i&&n(()=>e.addPlugin(r,i))},updateOptions(i){i&&n(()=>e.init(i))}});return r}const up=()=>{const t={plugins:[],options:{}},e=Object.freeze({use(n){return t.plugins.push(n),e},updateDefaults(n){return t.options=ws(t.options,n),e},init(n){const r=cp(ws(t.options,n));return t.plugins.forEach(r.addPlugin),r}});return e},cu=0,Ss=1,fp=2;class dp extends Error{constructor(e,n,r){let i;e===cu?i="Empty parameter":e===Ss?i="Unexpected character":i="Unexpected end",super(`Tolgee parser: ${i} at ${n} in "${r}"`),this.code=e,this.index=n}}function Va(t){return/\s/.test(t)}const cn=0,Ls=1,Gi=2,Go=3,Wo=4,pp=new Set([Gi,Ls,cn]),Es="'",hp=new Set(["{","}",Es]),gp=t=>/[0-9a-zA-Z_]/.test(t);function vp(t){let e=cn,n="",r="",i="";const o=[],s=[];let a=0;function l(p){throw new dp(p,a,t)}const c=()=>{o.push(n),n=""},f=()=>{gp(i)||l(Ss),r+=i},d=()=>{r===""&&l(cu),s.push(r),r=""};for(a=0;a<t.length;a++)switch(i=t[a],e){case cn:i===Es?(n+=i,e=Ls):i==="{"?(c(),e=Go):(n+=i,e=cn);break;case Ls:hp.has(i)?(n=n.slice(0,-1)+i,e=Gi):(n+=i,e=cn);break;case Gi:i===Es?e=cn:(n+=i,e=Gi);break;case Go:i==="}"?(d(),e=cn):Va(i)?r!==""&&(d(),e=Wo):(f(),e=Go);break;case Wo:i=="}"?e=cn:Va(i)?e=Wo:l(Ss)}return pp.has(e)||l(fp),c(),[o,s]}function mp(t,e){const[n,r]=vp(t),i=[n[0]];for(let o=1;o<n.length;o++){const s=e==null?void 0:e[r[o-1]];if(s===void 0)throw new Error(`Missing parameter "${r[o-1]}" in "${t}"`);i.push(String(s)),i.push(n[o])}return i.join("")}function yp(){return{format:({translation:t,params:e})=>mp(t,e)}}const bp=()=>(t,e)=>(e.setFinalFormatter(yp()),t),wp="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Sp(t){const e=wp.indexOf(t);if(e===-1)throw new Error("Invalid character found: "+t);return e}function Lp(t){const e=new Uint8Array(t),n=e.length;let r="",i=Math.pow(2,16)-1;for(let o=0;o<n;o+=i)o+i>n&&(i=n-o),r+=String.fromCharCode.apply(null,e.subarray(o,o+i));return r}function Ep(t){t=t.toUpperCase();const e=t.length;let n=0,r=0,i=0;const o=new Uint8Array(e*5/8|0);for(let s=0;s<e;s++)r=r<<5|Sp(t[s]),n+=5,n>=8&&(o[i++]=r>>>n-8&255,n-=8);return Lp(o.buffer)}function xp(t){if(t)try{const[e,n]=t.split("_");if(e==="tgpak"){const[r]=Ep(n).split("_");return Number(r)}}catch{console.warn("Tolgee: Api key can't be parsed")}}function Cp(t){if(!t)return;const[e]=t.split("_");return e==="tgpak"?"tgpak":e==="tgpat"?"tgpat":"legacy"}function _p(){return{getRecord({apiUrl:t,apiKey:e,language:n,namespace:r,projectId:i,fetch:o}){var s;const a=(s=xp(e))!==null&&s!==void 0?s:i;let l=a!==void 0?`${t}/v2/projects/${a}/translations/${n}`:`${t}/v2/projects/translations/${n}`;if(r&&(l+=`?ns=${r}`),Cp(e)==="tgpat"&&i===void 0)throw new Error("You need to specify 'projectId' when using PAT key");return o(l,{headers:{"X-API-Key":e||"","Content-Type":"application/json"}}).then(c=>{if(c.ok)return c.json().then(f=>f[n]);throw new Error(c.statusText)})}}}const Op=()=>(t,e)=>(e.setDevBackend(_p()),t);function Mp(t,e){const n=r=>{var i,o;t.includes((i=r.data)===null||i===void 0?void 0:i.type)&&e((o=r.data)===null||o===void 0?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}function Pp({message:t,recievingMessage:e,data:n,attempts:r=1}){let i=!1;const o=()=>new Promise((a,l)=>{const c=Mp(e,d);window.postMessage({type:t,data:n},window.origin);const f=setTimeout(v,300);function d(g){clearTimeout(f),p(),a(g)}function p(){c.unsubscribe()}function v(){p(),l()}});return{cancel(){i=!0},promise:(async()=>{for(let a=0;a<r;a++){if(i)return new Promise(()=>{});try{return await o()}catch{continue}}if(!i)throw`Didn't recieve ${e.join(" or ")} in time.`;return new Promise(()=>{})})()}}function kp(){let t;async function e(n){t==null||t();const{cancel:r,promise:i}=Pp({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:n,attempts:4});return t=r,i}return{update:e}}const Rp="tolgee-in-context-tools.umd.min.js",Tp="@tolgee/in-context-tools",Ap="InContextTools",Dp="https://cdn.jsdelivr.net/npm";function Ip(t){return new Promise((e,n)=>{const r=document.createElement("script");r.src=t,r.addEventListener("load",()=>e()),r.addEventListener("error",i=>n(i.error)),document.body.appendChild(r)})}let Zo=null;function jp(t){return Zo||(Zo=Ip(`${Dp}/@tolgee/web@${t}/dist/${Rp}`).then(()=>window[Tp][Ap])),Zo}const uu="__tolgee_apiKey",fu="__tolgee_apiUrl";function Fa(){const t=sessionStorage.getItem(uu)||void 0,e=sessionStorage.getItem(fu)||void 0;if(!(!t||!e))return{apiKey:t,apiUrl:e}}function Np(){sessionStorage.removeItem(uu),sessionStorage.removeItem(fu)}function Bp(t){document.readyState!=="loading"?Promise.resolve().then(()=>{t()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",t)}let du=()=>t=>t;const Up=()=>{if(typeof window>"u")return!1;try{return typeof sessionStorage<"u"&&sessionStorage}catch(t){return console.error("sessionStorage not available",t),!1}};Up()&&(du=()=>t=>{const e=kp(),n=()=>({uiPresent:!0,uiVersion:void 0,mode:t.isDev()?"development":"production",config:{apiUrl:t.getInitialOptions().apiUrl||"",apiKey:t.getInitialOptions().apiKey||""}}),r=async()=>{const o=await jp("5.16.0");return s=>{const a=Fa();return s.addPlugin(o({credentials:a})),s}};return t.on("running",({value:o})=>{o&&Bp(()=>{e.update(n()).catch(Np)})}),Fa()&&r().then(o=>{t.addPlugin(o)}).catch(o=>{console.error("Tolgee: Failed to load in-context tools"),console.error(o)}),t});function Vp(){return up().use(du())}const Fp={useSuspense:!0};let qo;const pu=()=>(qo||(qo=u.createContext(void 0)),qo),zp=({tolgee:t,options:e,children:n,fallback:r})=>{const[i,o]=u.useState(!t.isLoaded());u.useEffect(()=>{t.run().catch(l=>{console.error(l)}).finally(()=>{o(!1)})},[t]);const s=Object.assign(Object.assign({},Fp),e),a=pu();return s.useSuspense?u.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:u.createElement(u.Suspense,{fallback:r||null},n)):u.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:n)};let $p;function Hp(){return $p}const hu=()=>{const t=pu(),e=u.useContext(t)||Hp();if(!e)throw new Error("Couldn't find tolgee instance, did you forgot to use `TolgeeProvider`?");return e},gu=()=>{const[t,e]=u.useState(0),n=u.useCallback(()=>{e(r=>r+1)},[e]);return{instance:t,rerender:n}},vu=(t,e)=>{const{tolgee:n,options:r}=hu(),i=ru(t),o=Ct(i).join(":"),s=Object.assign(Object.assign({},r),e),{rerender:a,instance:l}=gu(),c=u.useRef(),f=u.useRef([]);f.current=[];const d=g=>{var h;f.current.push(g),(h=c.current)===null||h===void 0||h.subscribeNs(g)},p=n.isLoaded(i);u.useEffect(()=>{const g=n.onNsUpdate(a);return c.current=g,g.subscribeNs(i),f.current.forEach(h=>{g.subscribeNs(h)}),()=>{g.unsubscribe()}},[o,n]),u.useEffect(()=>(n.addActiveNs(i),()=>n.removeActiveNs(i)),[o,n]);const v=u.useCallback(g=>{var h;const w=(h=g.ns)!==null&&h!==void 0?h:i==null?void 0:i[0];return d(w),n.t(Object.assign(Object.assign({},g),{ns:w}))},[n,l]);if(s.useSuspense&&!p)throw n.addActiveNs(i,!0);return{t:v,isLoading:!p}},jt=(t,e)=>{const{t:n,isLoading:r}=vu(t,e);return{t:u.useCallback((...o)=>{const s=lu(...o);return n(s)},[n]),isLoading:r}},Gp=t=>{if(!t)return;const e={};return Object.entries(t||{}).forEach(([n,r])=>{if(typeof r=="function")e[n]=i=>r(xs(i));else if(u.isValidElement(r)){const i=r;e[n]=o=>i.props.children===void 0&&(o!=null&&o.length)?u.cloneElement(i,{},xs(o)):u.cloneElement(i)}else e[n]=r}),e},xs=t=>Array.isArray(t)?u.Children.toArray(t):t,Wp=t=>{const e=t.keyName||t.children;e===void 0&&console.error("T component: keyName not defined");const n=t.defaultValue||(t.keyName?t.children:void 0),r=xs(t.t({key:e,params:Gp(t.params),defaultValue:n,noWrap:t.noWrap,ns:t.ns,language:t.language}));return u.createElement(u.Fragment,null,r)},An=t=>{const{t:e}=vu();return u.createElement(Wp,Object.assign({t:e},t))},Zp=t=>{const{tolgee:e}=hu(),{rerender:n}=gu();return u.useEffect(()=>{const r=t==null?void 0:t.map(i=>e.on(i,n));return()=>{r==null||r.forEach(i=>i.unsubscribe())}},[t==null?void 0:t.join(":")]),e};function Mo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qp=function(t,e,n,r,i,o,s,a){if(!t){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],f=0;l=new Error(e.replace(/%s/g,function(){return c[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},Kp=qp;const mn=Mo(Kp),Jp=Vp().use(Op()).use(bp()).init({language:"en",defaultNs:"common",ns:["common","courier_balloon","current_location","details_modal","header","location_aside","location_selector","receive_filter","send_filter","type_filter"],apiUrl:"https://tms.omnic.solutions",apiKey:"tgpak_gfpwi2dimy3domrsnezham3ugbvw24tfm5vwk3bqgntxa"});var mu={exports:{}};/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),u=require("react"),dr=require("react-dom"),$i=require("react-dom/server");function iu(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const ce=iu(u),ou=iu(dr);function Yd(t,e){return e.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in t)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(t)}function sa(t){return!!(t&&typeof t.then=="function")}function Hi(t,e){return sa(t)?Promise.resolve(t).then(e):e(t)}function Ua(t){const e=(Array.isArray(t)?t:[t]).map(o=>`'${o}'`),n=e.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...e.slice(0,-2),n].join(", ")} option`}function Xd(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function su(t){if(typeof t=="string")return[t];if(Array.isArray(t))return t}function Ct(t){return su(t)||[]}function Qd(t,e){return Xd(e)?Ct(e==null?void 0:e[t]):Ct(e)}function ws(t){return Array.from(new Set(t))}function au(t){return t&&t.replace(/\/+$/,"")}function ep(t){if(typeof t=="string")return t;if(typeof(t==null?void 0:t.message)=="string")return t.message}const tp=(t,e)=>fetch(t,e),lu=(t=tp)=>(e,n)=>t(e,Object.assign(Object.assign({},n),{headers:Object.assign({"X-Tolgee-SDK-Type":"JS","X-Tolgee-SDK-Version":"5.16.2"},n==null?void 0:n.headers)}));function on(t){let e=[];return Object.freeze({listen(n){const r=i=>{n(i)};return e.push(r),{unsubscribe(){e=e.filter(i=>r!==i)}}},emit(n){t()&&e.forEach(r=>r({value:n}))}})}function np(t,e,n){const r=new Set,i=new Set;function o(l){const c=new Set(e());i.forEach(f=>{(l===void 0||(l==null?void 0:l.findIndex(p=>c.has(p)||f.namespaces.has(p)))!==-1)&&f.fn({value:void 0})})}let s=[];function a(){if(s.length===0)return;const l=s;s=[],r.forEach(d=>{d({value:void 0})});let c=new Set;l.forEach(d=>{d===void 0?c=void 0:c!==void 0&&d.forEach(p=>c.add(p))});const f=c?Array.from(c.keys()):void 0;o(f)}return Object.freeze({emit(l,c){t()&&(s.push(l),c?setTimeout(a,0):a())},listen(l){return r.add(l),{unsubscribe:()=>{r.delete(l)}}},listenSome(l){const c={fn:d=>{l(d)},namespaces:new Set};i.add(c);const f={unsubscribe:()=>{i.delete(c)},subscribeNs:d=>(Ct(d).forEach(p=>c.namespaces.add(p)),d===void 0&&c.namespaces.add(n()),f)};return f}})}function rp(t,e){let n=!0;function r(){return n}const i=Object.freeze({onPendingLanguageChange:on(r),onLanguageChange:on(r),onLoadingChange:on(r),onFetchingChange:on(r),onInitialLoaded:on(r),onRunningChange:on(r),onCacheChange:on(r),onUpdate:np(r,t,e),onPermanentChange:on(r),setEmitterActive(o){n=o},on:(o,s)=>{switch(o){case"pendingLanguage":return i.onPendingLanguageChange.listen(s);case"language":return i.onLanguageChange.listen(s);case"loading":return i.onLoadingChange.listen(s);case"fetching":return i.onFetchingChange.listen(s);case"initialLoad":return i.onInitialLoaded.listen(s);case"running":return i.onRunningChange.listen(s);case"cache":return i.onCacheChange.listen(s);case"update":return i.onUpdate.listen(s);case"permanentChange":return i.onPermanentChange.listen(s)}}});return i.onInitialLoaded.listen(()=>i.onUpdate.emit()),i.onLanguageChange.listen(()=>i.onUpdate.emit()),i.onCacheChange.listen(({value:o})=>i.onUpdate.emit([o.namespace],!0)),i}const cu=t=>{const e=new Map;return Object.entries(t).forEach(([n,r])=>{if(r!=null){if(typeof r=="object"){cu(r).forEach((i,o)=>{e.set(n+"."+o,i)});return}e.set(n,r)}}),e},Ar=t=>{const[e,...n]=t.split(":"),r=n.join(":");return{language:e,namespace:r||""}},qt=({language:t,namespace:e})=>e?`${t}:${e}`:t;function ip(t,e,n,r,i,o,s){const a=new Map,l=new Map;let c={},f=0;function d(h,S,w){const y=qt(h);l.set(y,{data:cu(S),version:w}),t.emit(h)}function p(h){let S;if(!S){const w=c[qt(h)];typeof w=="function"&&(S=w())}return S||(S=e(h)),S}function m(h,S){var w;let y;return S&&(y=(w=n(h))===null||w===void 0?void 0:w.catch(()=>(console.warn("Tolgee: Failed to fetch data from dev backend"),p(h)))),y||(y=p(h)),y}const g=Object.freeze({addStaticData(h){h&&(c=Object.assign(Object.assign({},c),h),Object.entries(h).forEach(([S,w])=>{if(typeof w!="function"){const y=Ar(S),b=l.get(S);(!b||b.version===0)&&d(y,w,0)}}))},invalidate(){a.clear(),f+=1},addRecord(h,S){d(h,S,f)},exists(h,S=!1){const w=l.get(qt(h));return w&&S?w.version===f:!!w},getRecord(h){var S;return(S=l.get(qt(r(h))))===null||S===void 0?void 0:S.data},getTranslation(h,S){var w;return(w=l.get(qt(h)))===null||w===void 0?void 0:w.data.get(S)},getTranslationNs(h,S,w){var y;for(const b of h)for(const _ of S){const E=(y=l.get(qt({language:_,namespace:b})))===null||y===void 0?void 0:y.data.get(w);if(E!=null)return[b]}return ws(h)},getTranslationFallback(h,S,w){var y;for(const b of h)for(const _ of S){const E=(y=l.get(qt({language:_,namespace:b})))===null||y===void 0?void 0:y.data.get(w);if(E!=null)return E}},changeTranslation(h,S,w){var y;const b=(y=l.get(qt(h)))===null||y===void 0?void 0:y.data;b==null||b.set(S,w),t.emit(Object.assign(Object.assign({},h),{key:S}))},isFetching(h){if(i())return!0;if(h===void 0)return a.size>0;const S=Ct(h);return!!Array.from(a.keys()).find(w=>S.includes(Ar(w).namespace))},isLoading(h,S){const w=Ct(S);return!!(i()||Array.from(a.keys()).find(y=>{const b=Ar(y);return(!w.length||w.includes(b.namespace))&&!g.exists({namespace:b.namespace,language:h})}))},async loadRecords(h,S){const w=h.map(b=>{const _=r(b),E=qt(_),v=a.get(E);if(v)return{new:!1,promise:v,keyObject:_,cacheKey:E};const L=m(_,S)||Promise.resolve(void 0);return a.set(E,L),{new:!0,promise:L,keyObject:_,cacheKey:E}});o.notify(),s.notify();const y=await Promise.all(w.map(b=>b.promise));return w.forEach((b,_)=>{const E=a.get(b.cacheKey)!==b.promise;if(b.new&&!E){a.delete(b.cacheKey);const v=y[_];v?g.addRecord(b.keyObject,v):g.getRecord(b.keyObject)||g.addRecord(b.keyObject,{})}}),o.notify(),s.notify(),w.map(b=>g.getRecord(b.keyObject))},getAllRecords(){return Array.from(l.entries()).map(([S,w])=>Object.assign(Object.assign({},Ar(S)),{data:w.data}))}});return g}function uu(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}const op={tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},Ss="invalid",sp="https://app.tolgee.io",ap=({key:t})=>t,lp={defaultNs:"",observerOptions:op,observerType:"invisible",onFormatError:Ss,apiUrl:sp,fetch:lu(),onTranslationMissing:ap},Ls=(...t)=>{let e={};return t.forEach(n=>{e=Object.assign(Object.assign(Object.assign({},e),n),{observerOptions:Object.assign(Object.assign({},e.observerOptions),n==null?void 0:n.observerOptions)})}),e};function Va(t,e){const n=Ls(lp,e==null?void 0:e.initialOptions,t);return n.apiUrl=au(n.apiUrl),t!=null&&t.fetch&&(n.fetch=lu(t.fetch)),{initialOptions:n,activeNamespaces:(e==null?void 0:e.activeNamespaces)||new Map,language:e==null?void 0:e.language,pendingLanguage:e==null?void 0:e.language,isInitialLoading:!1,isRunning:!1}}function cp(t,e,n,r,i,o,s,a){const l={ui:void 0},c={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},f=async({keysAndDefaults:O,event:P})=>{var j;const U=O.map(({key:$,ns:G,defaultValue:z})=>({key:$,defaultValue:z,fallbackNamespaces:r(G),namespace:i({key:$,ns:G})[0],translation:o({key:$,ns:G})}));(j=c.ui)===null||j===void 0||j.handleElementClick(U,P)},d=(O,P)=>{var j;return((j=c.observer)===null||j===void 0?void 0:j.findPositions(O,P))||[]};function p(O){const P=o({key:O.key,ns:O.ns});return M.formatTranslation(Object.assign(Object.assign({},O),{translation:P,formatEnabled:!0}))}function m(){return{fetch:e().fetch}}function g(O){c.observer=O==null?void 0:O()}function h(){return!!c.observer}function S(O){O&&c.formatters.push(O)}function w(O){c.finalFormatter=O}function y(O){l.ui=O}function b(){return!!l.ui}function _(O){c.languageStorage=O}function E(O){c.languageDetector=O}function v(){if(!c.languageDetector)return;const O=n();return c.languageDetector.getLanguage(Object.assign({availableLanguages:O},m()))}function L(O){O&&c.backends.push(O)}function C(O){c.devBackend=O}function k(O,P){const j=Object.freeze({setFinalFormatter:w,addFormatter:S,setObserver:g,hasObserver:h,setUi:y,hasUi:b,setDevBackend:C,addBackend:L,setLanguageDetector:E,setLanguageStorage:_});P(O,j)}const M=Object.freeze({addPlugin:k,run(){var O,P;const{apiKey:j,apiUrl:U,projectId:$,observerOptions:G}=e();c.ui=(O=l.ui)===null||O===void 0?void 0:O.call(l,{apiKey:j,apiUrl:U,projectId:$,highlight:M.highlight,changeTranslation:s,findPositions:d,onPermanentChange:a}),(P=c.observer)===null||P===void 0||P.run({mouseHighlight:!0,options:G,translate:p,onClick:f})},stop(){var O;c.ui=void 0,(O=c.observer)===null||O===void 0||O.stop()},getLanguageStorage(){return c.languageStorage},getInitialLanguage(){var O;const P=n(),j=(O=c.languageStorage)===null||O===void 0?void 0:O.getLanguage(m());return Hi(j,U=>(!P||P.includes(U))&&U?U:v())},setStoredLanguage(O){var P;(P=c.languageStorage)===null||P===void 0||P.setLanguage(O,m())},getDevBackend(){return c.devBackend},getBackendRecord:({language:O,namespace:P})=>{for(const j of c.backends){const U=j.getRecord(Object.assign({language:O,namespace:P},m()));if(sa(U))return U==null?void 0:U.catch($=>(console.error($),{}));if(U!==void 0)return U}},getBackendDevRecord:({language:O,namespace:P})=>{var j;const{apiKey:U,apiUrl:$,projectId:G}=e();return(j=c.devBackend)===null||j===void 0?void 0:j.getRecord(Object.assign({apiKey:U,apiUrl:$,projectId:G,language:O,namespace:P},m()))},getLanguageDetector(){return c.languageDetector},retranslate(){var O;(O=c.observer)===null||O===void 0||O.retranslate()},highlight:(O,P)=>{var j,U;return((U=(j=c.observer)===null||j===void 0?void 0:j.highlight)===null||U===void 0?void 0:U.call(j,O,P))||{unhighlight(){}}},unwrap(O){var P;return c.observer?(P=c.observer)===null||P===void 0?void 0:P.unwrap(O):{text:O,keys:[]}},wrap(O){var P;return c.observer?(P=c.observer)===null||P===void 0?void 0:P.wrap(O):O.translation},hasDevBackend(){return!!M.getDevBackend()},formatTranslation(O){var P,{formatEnabled:j}=O,U=uu(O,["formatEnabled"]);const{key:$,translation:G,defaultValue:z,noWrap:W,params:D,ns:R,orEmpty:A}=U,T=G??z;let N="";G==null&&(N=e().onTranslationMissing(U));let V=T??(A?"":N);const Z=t(),I=j||!(!((P=c.observer)===null||P===void 0)&&P.outputNotFormattable),K=ee=>c.observer&&!W?c.observer.wrap({key:$,translation:ee,defaultValue:z,params:D,ns:R}):ee;V=K(V);try{if(T&&Z&&I)for(const ee of c.formatters)V=ee.format({translation:V,language:Z,params:D});c.finalFormatter&&T&&Z&&I&&(V=c.finalFormatter.format({translation:V,language:Z,params:D}))}catch(ee){console.error(ee);const q=ep(ee)||Ss,se=e().onFormatError,de=typeof se;de==="string"?V=se:de==="function"?V=se(q,U):V=Ss,V=K(V)}return V}});return M}const Fa=(t,e,n)=>{let r=t;return Object.freeze({init(i){r=i},notify(){const i=e();r!==i&&n(i),r=i}})};function up(t,e,n){let r=Va(),i;const o=Object.freeze({init(s){r=Va(s,r)},isRunning(){return r.isRunning},setRunning(s){r.isRunning!==s&&(r.isRunning=s,n.emit(s))},isInitialLoading(){return r.isInitialLoading},setInitialLoading(s){r.isInitialLoading=s},getLanguage(){return r.language||r.initialOptions.language},setLanguage(s){r.language!==s&&(r.language=s,t.emit(s))},getPendingLanguage(){return r.pendingLanguage||o.getLanguage()},setPendingLanguage(s){r.pendingLanguage!==s&&(r.pendingLanguage=s,e.emit(s))},getInitialOptions(){return Object.assign(Object.assign({},r.initialOptions),i)},addActiveNs(s){Ct(s).forEach(l=>{const c=r.activeNamespaces.get(l);c!==void 0?r.activeNamespaces.set(l,c+1):r.activeNamespaces.set(l,1)})},removeActiveNs(s){Ct(s).forEach(l=>{const c=r.activeNamespaces.get(l);c!==void 0&&c>1?r.activeNamespaces.set(l,c-1):r.activeNamespaces.delete(l)})},getRequiredNamespaces(){return ws([...r.initialOptions.ns||[r.initialOptions.defaultNs],...Ct(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()])},getFallbackLangs(s){const a=s||o.getLanguage();return a?ws([a,...Qd(a,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs(){return Ct(r.initialOptions.fallbackNs)},getDefaultNs(s){return s===void 0?r.initialOptions.defaultNs:s},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const s=Object.keys(r.initialOptions.staticData).map(a=>Ar(a).language);return Array.from(new Set(s))}},withDefaultNs(s){return{namespace:s.namespace===void 0?o.getInitialOptions().defaultNs:s.namespace,language:s.language}},overrideCredentials(s){s?i=Object.assign(Object.assign({},s),{apiUrl:au(s.apiUrl)}):i=void 0}});return o}function fp(t){var{ns:e,noWrap:n,orEmpty:r,params:i,language:o}=t,s=uu(t,["ns","noWrap","orEmpty","params","language"]);return Object.assign(Object.assign({},{ns:e,noWrap:n,orEmpty:r,language:o}),{params:Object.assign({},s)})}const fu=(t,...e)=>{let n={},r;return typeof t=="object"?n=t:(n.key=t,typeof e[0]=="string"?(n.defaultValue=e[0],r=e[1]):typeof e[0]=="object"&&(r=e[0])),r&&(n=Object.assign(Object.assign({},fp(r)),n)),n};function dp({options:t}){const e=rp(l,c),n=Fa(!1,()=>s.isFetching(),e.onFetchingChange.emit),r=Fa(!1,()=>v.isLoading(),e.onLoadingChange.emit),i=up(e.onLanguageChange,e.onPendingLanguageChange,e.onRunningChange),o=cp(i.getLanguage,i.getInitialOptions,i.getAvailableLanguages,f,w,y,p,m),s=ip(e.onCacheChange,o.getBackendRecord,o.getBackendDevRecord,i.withDefaultNs,i.isInitialLoading,n,r);t&&g(t);let a;e.onUpdate.listen(()=>{i.isRunning()&&o.retranslate()});function l(){return i.getFallbackNs()}function c(L){return i.getDefaultNs(L)}function f(L){return[...Ct(c(L)),...l()]}function d(L){return[...Ct(L??c()),...i.getRequiredNamespaces()]}function p(L,C,k){const M=i.withDefaultNs(L),O=s.getTranslation(M,C);return s.changeTranslation(M,C,k),{revert(){s.changeTranslation(M,C,O)}}}function m(L){e.onPermanentChange.emit({key:L.key,namespace:L.namespace})}function g(L){i.init(L),s.addStaticData(i.getInitialOptions().staticData)}function h(L,C){const k=i.getFallbackLangs(L),M=d(C),O=[];return k.forEach(P=>{M.forEach(j=>{s.exists({language:P,namespace:j},!0)||O.push({language:P,namespace:j})})}),O}function S(L,C){const k=h(L,C);if(k.length)return Hi(v.loadRecords(k),()=>{})}function w({key:L,ns:C}){const k=i.getFallbackLangs(),M=f(C??void 0);return s.getTranslationNs(M,k,L)}function y({key:L,ns:C,language:k}){const M=f(C??void 0),O=i.getFallbackLangs(k);return s.getTranslationFallback(M,O,L)}function b(){const L=Hi(_(),()=>S());if(sa(L))return i.setInitialLoading(!0),n.notify(),r.notify(),Promise.resolve(L).then(()=>{i.setInitialLoading(!1),n.notify(),r.notify(),e.onInitialLoaded.emit()});e.onInitialLoaded.emit()}function _(){if(i.getLanguage())return;const C=o.getInitialLanguage();return Hi(C,k=>{const M=k||i.getInitialOptions().defaultLanguage;M&&i.setLanguage(M)})}function E(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!i.getAvailableLanguages())throw new Error(Ua("availableLanguages"));if(!i.getLanguage()&&!i.getInitialOptions().defaultLanguage)throw new Error(Ua(["defaultLanguage","language"]))}const v=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),i),o),s),{init:g,getTranslation:y,changeTranslation:p,getTranslationNs:w,getDefaultAndFallbackNs:f,async changeLanguage(L){i.getPendingLanguage()===L&&i.getLanguage()===L||(i.setPendingLanguage(L),i.isRunning()&&await S(L),L===i.getPendingLanguage()&&(i.setLanguage(L),o.setStoredLanguage(L)))},async addActiveNs(L,C){C||i.addActiveNs(L),i.isRunning()&&await S(void 0,L)},loadRecords(L){return s.loadRecords(L,v.isDev())},async loadRecord(L){return(await v.loadRecords([L]))[0]},isLoading(L){return s.isLoading(i.getLanguage(),L)},isLoaded(L){const C=i.getLanguage();if(!C)return!1;const k=i.getFallbackLangs(C),M=d(L),O=[];return k.forEach(P=>{M.forEach(j=>{s.exists({language:P,namespace:j})||O.push({language:P,namespace:j})})}),O.length===0},t:(...L)=>{const C=fu(...L),k=y(C);return o.formatTranslation(Object.assign(Object.assign({},C),{translation:k}))},isDev(){return!!(i.getInitialOptions().apiKey&&i.getInitialOptions().apiUrl)},run(){return E(),i.isRunning()||(i.setRunning(!0),o.run(),a=b()),Promise.resolve(a)},stop(){i.isRunning()&&(o.stop(),i.setRunning(!1))}}));return v}function pp(t){const e=dp({options:t});e.isDev()&&e.invalidate();function n(i){const o=e.isRunning();o&&e.stop(),i(),e.isDev()&&e.invalidate(),o&&e.run()}const r=Object.freeze({on:e.on,onNsUpdate:e.onUpdate.listenSome,setEmitterActive:e.setEmitterActive,getLanguage:e.getLanguage,getPendingLanguage:e.getPendingLanguage,changeLanguage:e.changeLanguage,changeTranslation:e.changeTranslation,addActiveNs:e.addActiveNs,removeActiveNs:e.removeActiveNs,loadRecords:e.loadRecords,loadRecord:e.loadRecord,addStaticData:e.addStaticData,getRecord:e.getRecord,getAllRecords:e.getAllRecords,isLoaded:e.isLoaded,isInitialLoading:e.isInitialLoading,isLoading:e.isLoading,isFetching:e.isFetching,isRunning:e.isRunning,run:e.run,stop:e.stop,t:e.t,highlight:e.highlight,getInitialOptions:e.getInitialOptions,isDev:e.isDev,wrap:e.wrap,unwrap:e.unwrap,overrideCredentials(i){n(()=>e.overrideCredentials(i))},addPlugin(i){i&&n(()=>e.addPlugin(r,i))},updateOptions(i){i&&n(()=>e.init(i))}});return r}const hp=()=>{const t={plugins:[],options:{}},e=Object.freeze({use(n){return t.plugins.push(n),e},updateDefaults(n){return t.options=Ls(t.options,n),e},init(n){const r=pp(Ls(t.options,n));return t.plugins.forEach(r.addPlugin),r}});return e},du=0,Es=1,gp=2;class vp extends Error{constructor(e,n,r){let i;e===du?i="Empty parameter":e===Es?i="Unexpected character":i="Unexpected end",super(`Tolgee parser: ${i} at ${n} in "${r}"`),this.code=e,this.index=n}}function za(t){return/\s/.test(t)}const cn=0,xs=1,Gi=2,Go=3,Wo=4,mp=new Set([Gi,xs,cn]),Cs="'",yp=new Set(["{","}",Cs]),bp=t=>/[0-9a-zA-Z_]/.test(t);function wp(t){let e=cn,n="",r="",i="";const o=[],s=[];let a=0;function l(p){throw new vp(p,a,t)}const c=()=>{o.push(n),n=""},f=()=>{bp(i)||l(Es),r+=i},d=()=>{r===""&&l(du),s.push(r),r=""};for(a=0;a<t.length;a++)switch(i=t[a],e){case cn:i===Cs?(n+=i,e=xs):i==="{"?(c(),e=Go):(n+=i,e=cn);break;case xs:yp.has(i)?(n=n.slice(0,-1)+i,e=Gi):(n+=i,e=cn);break;case Gi:i===Cs?e=cn:(n+=i,e=Gi);break;case Go:i==="}"?(d(),e=cn):za(i)?r!==""&&(d(),e=Wo):(f(),e=Go);break;case Wo:i=="}"?e=cn:za(i)?e=Wo:l(Es)}return mp.has(e)||l(gp),c(),[o,s]}function Sp(t,e){const[n,r]=wp(t),i=[n[0]];for(let o=1;o<n.length;o++){const s=e==null?void 0:e[r[o-1]];if(s===void 0)throw new Error(`Missing parameter "${r[o-1]}" in "${t}"`);i.push(String(s)),i.push(n[o])}return i.join("")}function Lp(){return{format:({translation:t,params:e})=>Sp(t,e)}}const Ep=()=>(t,e)=>(e.setFinalFormatter(Lp()),t);var Zo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},$a={};(function(t){function e(w,y){var b;return w instanceof Buffer?b=w:b=Buffer.from(w.buffer,w.byteOffset,w.byteLength),b.toString(y)}var n=function(w){return Buffer.from(w)};function r(w){for(var y=0,b=Math.min(256*256,w.length+1),_=new Uint16Array(b),E=[],v=0;;){var L=y<w.length;if(!L||v>=b-1){var C=_.subarray(0,v),k=C;if(E.push(String.fromCharCode.apply(null,k)),!L)return E.join("");w=w.subarray(y),y=0,v=0}var M=w[y++];if(!(M&128))_[v++]=M;else if((M&224)===192){var O=w[y++]&63;_[v++]=(M&31)<<6|O}else if((M&240)===224){var O=w[y++]&63,P=w[y++]&63;_[v++]=(M&31)<<12|O<<6|P}else if((M&248)===240){var O=w[y++]&63,P=w[y++]&63,j=w[y++]&63,U=(M&7)<<18|O<<12|P<<6|j;U>65535&&(U-=65536,_[v++]=U>>>10&1023|55296,U=56320|U&1023),_[v++]=U}}}function i(w){for(var y=0,b=w.length,_=0,E=Math.max(32,b+(b>>>1)+7),v=new Uint8Array(E>>>3<<3);y<b;){var L=w.charCodeAt(y++);if(L>=55296&&L<=56319){if(y<b){var C=w.charCodeAt(y);(C&64512)===56320&&(++y,L=((L&1023)<<10)+(C&1023)+65536)}if(L>=55296&&L<=56319)continue}if(_+4>v.length){E+=8,E*=1+y/w.length*2,E=E>>>3<<3;var k=new Uint8Array(E);k.set(v),v=k}if(L&4294967168)if(!(L&4294965248))v[_++]=L>>>6&31|192;else if(!(L&4294901760))v[_++]=L>>>12&15|224,v[_++]=L>>>6&63|128;else if(!(L&4292870144))v[_++]=L>>>18&7|240,v[_++]=L>>>12&63|128,v[_++]=L>>>6&63|128;else continue;else{v[_++]=L;continue}v[_++]=L&63|128}return v.slice?v.slice(0,_):v.subarray(0,_)}var o="Failed to ",s=function(w,y,b){if(w)throw new Error("".concat(o).concat(y,": the '").concat(b,"' option is unsupported."))},a=typeof Buffer=="function"&&Buffer.from,l=a?n:i;function c(){this.encoding="utf-8"}c.prototype.encode=function(w,y){return s(y&&y.stream,"encode","stream"),l(w)};function f(w){var y;try{var b=new Blob([w],{type:"text/plain;charset=UTF-8"});y=URL.createObjectURL(b);var _=new XMLHttpRequest;return _.open("GET",y,!1),_.send(),_.responseText}finally{y&&URL.revokeObjectURL(y)}}var d=!a&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",p=["utf-8","utf8","unicode-1-1-utf-8"],m=r;a?m=e:d&&(m=function(w){try{return f(w)}catch{return r(w)}});var g="construct 'TextDecoder'",h="".concat(o," ").concat(g,": the ");function S(w,y){s(y&&y.fatal,g,"fatal"),w=w||"utf-8";var b;if(a?b=Buffer.isEncoding(w):b=p.indexOf(w.toLowerCase())!==-1,!b)throw new RangeError("".concat(h," encoding label provided ('").concat(w,"') is invalid."));this.encoding=w,this.fatal=!1,this.ignoreBOM=!1}S.prototype.decode=function(w,y){s(y&&y.stream,"decode","stream");var b;return w instanceof Uint8Array?b=w:w.buffer instanceof ArrayBuffer?b=new Uint8Array(w.buffer):b=new Uint8Array(w),m(b,this.encoding)},t.TextEncoder=t.TextEncoder||c,t.TextDecoder=t.TextDecoder||S})(typeof window<"u"?window:Zo);var xp=Yd({__proto__:null,default:$a},[$a]),qo;(qo=console.assert)===null||qo===void 0||qo.call(console,xp);const Cp="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function _p(t){const e=Cp.indexOf(t);if(e===-1)throw new Error("Invalid character found: "+t);return e}function Op(t){const e=new Uint8Array(t),n=e.length;let r="",i=Math.pow(2,16)-1;for(let o=0;o<n;o+=i)o+i>n&&(i=n-o),r+=String.fromCharCode.apply(null,e.subarray(o,o+i));return r}function Mp(t){t=t.toUpperCase();const e=t.length;let n=0,r=0,i=0;const o=new Uint8Array(e*5/8|0);for(let s=0;s<e;s++)r=r<<5|_p(t[s]),n+=5,n>=8&&(o[i++]=r>>>n-8&255,n-=8);return Op(o.buffer)}function Pp(t){if(t)try{const[e,n]=t.split("_");if(e==="tgpak"){const[r]=Mp(n).split("_");return Number(r)}}catch{console.warn("Tolgee: Api key can't be parsed")}}function kp(t){if(!t)return;const[e]=t.split("_");return e==="tgpak"?"tgpak":e==="tgpat"?"tgpat":"legacy"}function Rp(){return{getRecord({apiUrl:t,apiKey:e,language:n,namespace:r,projectId:i,fetch:o}){var s;const a=(s=Pp(e))!==null&&s!==void 0?s:i;let l=a!==void 0?`${t}/v2/projects/${a}/translations/${n}`:`${t}/v2/projects/translations/${n}`;if(r&&(l+=`?ns=${r}`),kp(e)==="tgpat"&&i===void 0)throw new Error("You need to specify 'projectId' when using PAT key");return o(l,{headers:{"X-API-Key":e||"","Content-Type":"application/json"}}).then(c=>{if(c.ok)return c.json().then(f=>f[n]);throw new Error(c.statusText)})}}}const Tp=()=>(t,e)=>(e.setDevBackend(Rp()),t);function Ap(t,e){const n=r=>{var i,o;t.includes((i=r.data)===null||i===void 0?void 0:i.type)&&e((o=r.data)===null||o===void 0?void 0:o.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}function Dp({message:t,recievingMessage:e,data:n,attempts:r=1}){let i=!1;const o=()=>new Promise((a,l)=>{const c=Ap(e,d);window.postMessage({type:t,data:n},window.origin);const f=setTimeout(m,300);function d(g){clearTimeout(f),p(),a(g)}function p(){c.unsubscribe()}function m(){p(),l()}});return{cancel(){i=!0},promise:(async()=>{for(let a=0;a<r;a++){if(i)return new Promise(()=>{});try{return await o()}catch{continue}}if(!i)throw`Didn't recieve ${e.join(" or ")} in time.`;return new Promise(()=>{})})()}}function Ip(){let t;async function e(n){t==null||t();const{cancel:r,promise:i}=Dp({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:n,attempts:4});return t=r,i}return{update:e}}const jp="tolgee-in-context-tools.umd.min.js",Np="@tolgee/in-context-tools",Bp="InContextTools",Up="https://cdn.jsdelivr.net/npm";function Vp(t){return new Promise((e,n)=>{const r=document.createElement("script");r.src=t,r.addEventListener("load",()=>e()),r.addEventListener("error",i=>n(i.error)),document.body.appendChild(r)})}let Ko=null;function Fp(t){return Ko||(Ko=Vp(`${Up}/@tolgee/web@${t}/dist/${jp}`).then(()=>window[Np][Bp])),Ko}const pu="__tolgee_apiKey",hu="__tolgee_apiUrl";function Ha(){const t=sessionStorage.getItem(pu)||void 0,e=sessionStorage.getItem(hu)||void 0;if(!(!t||!e))return{apiKey:t,apiUrl:e}}function zp(){sessionStorage.removeItem(pu),sessionStorage.removeItem(hu)}function $p(t){document.readyState!=="loading"?Promise.resolve().then(()=>{t()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",t)}let gu=()=>t=>t;const Hp=()=>{if(typeof window>"u")return!1;try{return typeof sessionStorage<"u"&&sessionStorage}catch(t){return console.error("sessionStorage not available",t),!1}};Hp()&&(gu=()=>t=>{const e=Ip(),n=()=>({uiPresent:!0,uiVersion:void 0,mode:t.isDev()?"development":"production",config:{apiUrl:t.getInitialOptions().apiUrl||"",apiKey:t.getInitialOptions().apiKey||""}}),r=async()=>{const o=await Fp("5.16.2");return s=>{const a=Ha();return s.addPlugin(o({credentials:a})),s}};return t.on("running",({value:o})=>{o&&$p(()=>{e.update(n()).catch(zp)})}),Ha()&&r().then(o=>{t.addPlugin(o)}).catch(o=>{console.error("Tolgee: Failed to load in-context tools"),console.error(o)}),t});function Gp(){return hp().use(gu())}const Wp={useSuspense:!0};let Jo;const vu=()=>(Jo||(Jo=u.createContext(void 0)),Jo),Zp=({tolgee:t,options:e,children:n,fallback:r})=>{const[i,o]=u.useState(!t.isLoaded());u.useEffect(()=>{t.run().catch(l=>{console.error(l)}).finally(()=>{o(!1)})},[t]);const s=Object.assign(Object.assign({},Wp),e),a=vu();return s.useSuspense?u.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:u.createElement(u.Suspense,{fallback:r||null},n)):u.createElement(a.Provider,{value:{tolgee:t,options:s}},i?r:n)};let qp;function Kp(){return qp}const Jp=()=>{const t=vu(),e=u.useContext(t)||Kp();if(!e)throw new Error("Couldn't find tolgee instance, did you forgot to use `TolgeeProvider`?");return e},Yp=()=>{const[t,e]=u.useState(0),n=u.useCallback(()=>{e(r=>r+1)},[e]);return{instance:t,rerender:n}},mu=(t,e)=>{const{tolgee:n,options:r}=Jp(),i=su(t),o=Ct(i).join(":"),s=Object.assign(Object.assign({},r),e),{rerender:a,instance:l}=Yp(),c=u.useRef(),f=u.useRef([]);f.current=[];const d=g=>{var h;f.current.push(g),(h=c.current)===null||h===void 0||h.subscribeNs(g)},p=n.isLoaded(i);u.useEffect(()=>{const g=n.onNsUpdate(a);return c.current=g,g.subscribeNs(i),f.current.forEach(h=>{g.subscribeNs(h)}),()=>{g.unsubscribe()}},[o,n]),u.useEffect(()=>(n.addActiveNs(i),()=>n.removeActiveNs(i)),[o,n]);const m=u.useCallback(g=>{var h;const S=(h=g.ns)!==null&&h!==void 0?h:i==null?void 0:i[0];return d(S),n.t(Object.assign(Object.assign({},g),{ns:S}))},[n,l]);if(s.useSuspense&&!p)throw n.addActiveNs(i,!0);return{t:m,isLoading:!p}},jt=(t,e)=>{const{t:n,isLoading:r}=mu(t,e);return{t:u.useCallback((...o)=>{const s=fu(...o);return n(s)},[n]),isLoading:r}},Xp=t=>{if(!t)return;const e={};return Object.entries(t||{}).forEach(([n,r])=>{if(typeof r=="function")e[n]=i=>r(_s(i));else if(u.isValidElement(r)){const i=r;e[n]=o=>i.props.children===void 0&&(o!=null&&o.length)?u.cloneElement(i,{},_s(o)):u.cloneElement(i)}else e[n]=r}),e},_s=t=>Array.isArray(t)?u.Children.toArray(t):t,Qp=t=>{const e=t.keyName||t.children;e===void 0&&console.error("T component: keyName not defined");const n=t.defaultValue||(t.keyName?t.children:void 0),r=_s(t.t({key:e,params:Xp(t.params),defaultValue:n,noWrap:t.noWrap,ns:t.ns,language:t.language}));return u.createElement(u.Fragment,null,r)},An=t=>{const{t:e}=mu();return u.createElement(Qp,Object.assign({t:e},t))};function Mo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var eh=function(t,e,n,r,i,o,s,a){if(!t){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],f=0;l=new Error(e.replace(/%s/g,function(){return c[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},th=eh;const mn=Mo(th),yu=Gp().use(Tp()).use(Ep()).init({language:"en",defaultNs:"common",ns:["common","courier_balloon","current_location","details_modal","header","location_aside","location_selector","receive_filter","send_filter","type_filter"],apiUrl:"https://tms.omnic.solutions",apiKey:"tgpak_gfpwi2dimy3domrsnezham3ugbvw24tfm5vwk3bqgntxa"});var bu={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var s=typeof o;if(s==="string"||s==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&r.push(a)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&r.push(l)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(
|
|
5
|
+
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var s=typeof o;if(s==="string"||s==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&r.push(a)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&r.push(l)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(bu);var nh=bu.exports;const be=Mo(nh);let vi;const rh=new Uint8Array(16);function ih(){if(!vi&&(vi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vi(rh)}const it=[];for(let t=0;t<256;++t)it.push((t+256).toString(16).slice(1));function oh(t,e=0){return it[t[e+0]]+it[t[e+1]]+it[t[e+2]]+it[t[e+3]]+"-"+it[t[e+4]]+it[t[e+5]]+"-"+it[t[e+6]]+it[t[e+7]]+"-"+it[t[e+8]]+it[t[e+9]]+"-"+it[t[e+10]]+it[t[e+11]]+it[t[e+12]]+it[t[e+13]]+it[t[e+14]]+it[t[e+15]]}const sh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ga={randomUUID:sh};function wu(t,e,n){if(Ga.randomUUID&&!e&&!t)return Ga.randomUUID();t=t||{};const r=t.random||(t.rng||ih)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return oh(r)}const Os=wu(),lo=wu(),Xt=[48,66],Yn=[58,80],aa=6,co=[49.3478969,14.0983344],Su="en",ah=["places","geocoding"],Mn={logo:"default",locale:Su,map:{provider:"google",center:co,initialZoom:aa}},Lu=u.createContext(Mn),st=()=>u.useContext(Lu),Wa=t=>{let e;const n=new Set,r=(l,c)=>{const f=typeof l=="function"?l(e):l;if(!Object.is(f,e)){const d=e;e=c??typeof f!="object"?f:Object.assign({},e,f),n.forEach(p=>p(e,d))}},i=()=>e,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return e=t(r,i,a),a},lh=t=>t?Wa(t):Wa;var Eu={exports:{}},xu={},Cu={exports:{}},_u={};/**
|
|
6
6
|
* @license React
|
|
7
7
|
* use-sync-external-store-shim.production.min.js
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var ir=u;function
|
|
13
|
+
*/var ir=u;function ch(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var uh=typeof Object.is=="function"?Object.is:ch,fh=ir.useState,dh=ir.useEffect,ph=ir.useLayoutEffect,hh=ir.useDebugValue;function gh(t,e){var n=e(),r=fh({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return ph(function(){i.value=n,i.getSnapshot=e,Yo(i)&&o({inst:i})},[t,n,e]),dh(function(){return Yo(i)&&o({inst:i}),t(function(){Yo(i)&&o({inst:i})})},[t]),hh(n),n}function Yo(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!uh(t,n)}catch{return!0}}function vh(t,e){return e()}var mh=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?vh:gh;_u.useSyncExternalStore=ir.useSyncExternalStore!==void 0?ir.useSyncExternalStore:mh;Cu.exports=_u;var yh=Cu.exports;/**
|
|
14
14
|
* @license React
|
|
15
15
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
16
16
|
*
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the MIT license found in the
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/var Po=u,
|
|
21
|
+
*/var Po=u,bh=yh;function wh(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Sh=typeof Object.is=="function"?Object.is:wh,Lh=bh.useSyncExternalStore,Eh=Po.useRef,xh=Po.useEffect,Ch=Po.useMemo,_h=Po.useDebugValue;xu.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=Eh(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Ch(function(){function l(m){if(!c){if(c=!0,f=m,m=r(m),i!==void 0&&s.hasValue){var g=s.value;if(i(g,m))return d=g}return d=m}if(g=d,Sh(f,m))return g;var h=r(m);return i!==void 0&&i(g,h)?g:(f=m,d=h)}var c=!1,f,d,p=n===void 0?null:n;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,n,r,i]);var a=Lh(t,o[0],o[1]);return xh(function(){s.hasValue=!0,s.value=a},[a]),_h(a),a};Eu.exports=xu;var Oh=Eu.exports;const Mh=Mo(Oh),{useDebugValue:Ph}=u,{useSyncExternalStoreWithSelector:kh}=Mh;function Rh(t,e=t.getState,n){const r=kh(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return Ph(r),r}const Za=t=>{const e=typeof t=="function"?lh(t):t,n=(r,i)=>Rh(e,r,i);return Object.assign(n,e),n},bn=t=>t?Za(t):Za,Th={map:null,mode:"self_pickup",bounds:null,blurred:!1,loaded:!1,loading:!0,detailsOpen:!1},Ou=t=>t.map,Ah=t=>t.mode,Dh=t=>t.bounds,Ih=t=>t.blurred,jh=t=>t.loaded,Nh=t=>t.loading,la=t=>t.detailsOpen,ye=bn()(t=>({...Th,setLoaded(){t({loaded:!0,loading:!1})},setMode(e){t({mode:e})},setBounds(e){t({bounds:e})},setDetailsOpen(e){t({detailsOpen:e})},setBlurred(e){t({blurred:e})},setMap(e){t({map:e})}})),Bh={location:null},ko=t=>t.location,Ze=bn()(t=>({...Bh,setDeliverPoint(e){t({location:e})}})),Uh="Spinner-module__loader__HX--ed",Vh={loader:Uh},ti=({className:t})=>x.jsx("div",{className:be(Vh.loader,t),children:"Loading..."}),Fh="Button-module__root__8NAnx6",zh="Button-module__primary__UsjvpK",$h="Button-module__secondary__VtNj8s",Hh="Button-module__loading__cIi2EH",Gh="Button-module__spinner__3Fk2sH",Lr={root:Fh,primary:zh,secondary:$h,loading:Hh,spinner:Gh},_t=({className:t,variant:e="primary",loading:n,children:r,...i})=>{const o=[Lr.root,t,Lr[e],{[Lr.loading]:n}];if(i.as==="link"){const{as:s,...a}=i;return x.jsxs("a",{className:be(o),...a,children:[!n&&r,n&&x.jsx(ti,{className:Lr.spinner})]})}if(i.as==="button"){const{as:s,...a}=i;return x.jsxs("button",{className:be(o),...a,children:[!n&&r,n&&x.jsx(ti,{className:Lr.spinner})]})}mn(!1,"Invalid button type")};_t.defaultProps={as:"button"};const Wh=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:123,height:32,fill:"none",viewBox:"0 0 123 32",...t},ce.createElement("path",{fill:"currentcolor",d:"M6.698 32a6.579 6.579 0 0 1-3.35-.889 6.718 6.718 0 0 1-2.443-2.4A6.285 6.285 0 0 1 0 25.422V6.578c0-1.215.302-2.311.905-3.29A6.718 6.718 0 0 1 3.35.889 6.579 6.579 0 0 1 6.698 0h19.188c1.207 0 2.308.296 3.304.889a6.72 6.72 0 0 1 2.444 2.4c.633.978.95 2.074.95 3.289v18.844a6.061 6.061 0 0 1-.95 3.29 6.72 6.72 0 0 1-2.444 2.4c-.996.592-2.097.888-3.304.888H6.698Zm.317-6.933h18.464V6.933H7.015v18.134ZM37.568 32V0h7.24l11.043 12.933L66.848 0h7.287v32h-7.06V10.533L55.85 23.69 44.582 10.578V32h-7.014Zm41.985 0V0h7.241l18.238 21.333V0h7.105v32h-7.241L86.568 10.578V32h-7.015Zm36.523 0V0H123v32h-6.924Z"})),Zh=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:192,height:20,fill:"none",viewBox:"0 0 192 20",...t},ce.createElement("path",{fill:"#000",d:"M4.1 20a3.966 3.966 0 0 1-2.05-.555 4.15 4.15 0 0 1-1.496-1.498A3.982 3.982 0 0 1 0 15.895V4.133c0-.758.185-1.442.554-2.052A4.15 4.15 0 0 1 2.05.583 3.966 3.966 0 0 1 4.1.028h11.743c.738 0 1.412.185 2.022.555A4.15 4.15 0 0 1 19.36 2.08c.388.61.582 1.294.582 2.052v11.762a3.83 3.83 0 0 1-.582 2.052 4.15 4.15 0 0 1-1.495 1.498c-.61.37-1.284.555-2.022.555H4.099Zm.193-4.327h11.3V4.355h-11.3v11.318ZM22.992 20V.028h4.432L34.182 8.1l6.73-8.072h4.46V20H41.05V6.602l-6.87 8.21-6.896-8.182V20h-4.293Zm25.696 0V.028h4.431l11.162 13.315V.028h4.348V20h-4.431L52.98 6.63V20h-4.294Zm22.352 0V.028h4.238V20H71.04Zm14.963 0V0h4.293v15.673h12.554V20H86.003Zm18.489 0V0h4.293v15.673h12.554V20h-16.847Zm18.717 0V4.133c0-.758.185-1.442.554-2.052a4.156 4.156 0 0 1 1.496-1.498 3.966 3.966 0 0 1 2.049-.555h11.716c.757 0 1.441.185 2.05.555.628.37 1.126.869 1.495 1.498.388.61.582 1.294.582 2.052V20h-4.348v-6.435h-11.301V20h-4.293Zm4.293-10.763h11.301V4.355h-11.301v4.882ZM146.307 20V.028h4.432l6.758 8.072 6.73-8.072h4.459V20h-4.32V6.602l-6.869 8.21L150.6 6.63V20h-4.293Zm25.751 0V4.133c0-.758.185-1.442.554-2.052a4.148 4.148 0 0 1 1.496-1.498 3.966 3.966 0 0 1 2.049-.555h11.716c.757 0 1.44.185 2.05.555.628.37 1.126.869 1.496 1.498A3.75 3.75 0 0 1 192 4.133V20h-4.348v-6.435h-11.301V20h-4.293Zm4.293-10.763h11.301V4.355h-11.301v4.882Z"})),qh="Header-module__root__HQYeJV",Kh="Header-module__nav__E5j1Pg",Jh="Header-module__navItem__9yWrFL",Yh="Header-module__logo__RE3idO",Dr={root:qh,nav:Kh,navItem:Jh,logo:Yh},Xh={llama:Zh,default:Wh},Qh=()=>{const{logo:t="default",hideLogo:e}=st();if(e)return null;const n=Xh[t];return x.jsx("div",{className:Dr.logo,children:x.jsx(n,{})})},eg=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:28,fill:"none",viewBox:"0 0 24 28",...t},ce.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M24 11.777C24 4.052 17.606 0 12 0S0 4.052 0 11.777C0 16.915 3.994 22.334 12 28c8.006-5.666 12-11.085 12-16.224ZM12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",clipRule:"evenodd"})),tg={place:null},Mu=t=>t.place,ng=t=>{var e,n;return(n=(e=t.place)==null?void 0:e.address_components)==null?void 0:n.find(r=>r.types.includes("locality"))},$t=bn(t=>({...tg,setPlace(e,n){var i,o,s;const r=ye.getState().map;t({place:e}),r&&((i=e==null?void 0:e.geometry)!=null&&i.viewport)?r.fitBounds(e.geometry.viewport):(o=e==null?void 0:e.geometry)!=null&&o.location&&(r==null||r.panTo((s=e.geometry)==null?void 0:s.location)),n!=null&&(r==null||r.setZoom(n))}})),rg={location:null},ig=t=>t.location,bt=bn()(t=>({...rg,setSelectedLocation(e){t({location:e})}})),og={open:!1},sg=t=>t.open,kn=bn(t=>({...og,toggle(e){t(n=>({open:e??!n.open}))}})),ag=()=>{kn.getState().toggle(!0),ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null)},lg="CurrentLocation-module__root__OP569R",cg="CurrentLocation-module__icon__tNWTkm",ug="CurrentLocation-module__text__r-F6NH",Xo={root:lg,icon:cg,text:ug},Pu=({className:t})=>{const{t:e}=jt("current_location"),n=$t(Mu),r=$t(ng);return x.jsxs("div",{className:be(Xo.root,t),onClick:ag,children:[x.jsx(eg,{className:Xo.icon}),x.jsxs("span",{className:Xo.text,children:[!n&&e("choose_from_map"),n&&`${(r==null?void 0:r.long_name)??n.formatted_address}`]})]})},fg=({className:t})=>{const{t:e}=jt("header"),{disableDelivery:n}=st(),r=ye(Ah),i=Ze(ko);u.useEffect(()=>{i?ye.getState().setMode("location_delivery"):ye.getState().setMode("self_pickup")},[i]);const o=()=>{Ze.getState().setDeliverPoint(null),ye.getState().setMode("self_pickup")},s=()=>{Ze.getState().setDeliverPoint(null),ye.getState().setMode("location_delivery")},a=r==="self_pickup",l=r==="location_delivery";return x.jsxs("div",{className:be(Dr.root,t),children:[x.jsx(Qh,{}),x.jsxs("nav",{className:Dr.nav,children:[!n&&x.jsx(_t,{as:"link",className:Dr.navItem,variant:a?"primary":"secondary",onClick:o,children:e("self_pickup")}),!n&&x.jsx(_t,{as:"link",className:Dr.navItem,variant:l?"primary":"secondary",onClick:s,children:e("courier_delivery")}),x.jsx(Pu,{})]})]})},dg=u.memo(fg),pg={open:!1},or=bn(t=>({...pg,toggle(e){ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null),t(n=>({open:e??!n.open}))}})),hg="Layout-module__root__ahSFBs",gg="Layout-module__headerHidden__ko0ZcT",vg="Layout-module__sidebarHidden__6hkiQL",mg="Layout-module__sidebarOpen__vFWl9b",mi={root:hg,headerHidden:gg,sidebarHidden:vg,sidebarOpen:mg},yg=({children:t})=>{const{hideHeader:e,hideFilters:n}=st(),r=or(i=>i.open);return x.jsx("div",{className:be(mi.root,{[mi.sidebarOpen]:r,[mi.headerHidden]:e,[mi.sidebarHidden]:n}),children:t})};var bg=wg()?u.useLayoutEffect:u.useEffect;function wg(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Sg(){var t=u.useState(Object.create(null)),e=t[1];return u.useCallback(function(){e(Object.create(null))},[])}var Lg=function(e){var n=e.children,r=e.type,i=r===void 0?"reach-portal":r,o=u.useRef(null),s=u.useRef(null),a=Sg();return bg(function(){if(o.current){var l=o.current.ownerDocument;return s.current=l==null?void 0:l.createElement(i),l.body.appendChild(s.current),a(),function(){s.current&&s.current.ownerDocument&&s.current.ownerDocument.body.removeChild(s.current)}}},[i,a]),s.current?dr.createPortal(n,s.current):u.createElement("span",{ref:o})};/*! *****************************************************************************
|
|
22
22
|
Copyright (c) Microsoft Corporation.
|
|
23
23
|
|
|
24
24
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -31,23 +31,23 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
31
31
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
32
32
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
33
33
|
PERFORMANCE OF THIS SOFTWARE.
|
|
34
|
-
***************************************************************************** */var H=function(){return H=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},H.apply(this,arguments)};function aa(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function me(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _e(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Ue(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var De;(function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"})(De||(De={}));var sr;(function(t){t.Parent="#_parent",t.Internal="#_internal"})(sr||(sr={}));var _s=De.Start,la=De.Stop,li=De.Raise,Ro=De.Send,Mu=De.Cancel,yg=De.NullEvent,ca=De.Assign;De.After;De.DoneState;var Pu=De.Log,bg=De.Init,Os=De.Invoke;De.ErrorExecution;var Ga=De.ErrorPlatform,wg=De.ErrorCustom,ku=De.Update,Sg=De.Choose,Lg=De.Pure,Ru=".",Wa={},Ms="xstate.guard",Eg="",yi;function ua(t,e,n){n===void 0&&(n=Ru);var r=Vr(t,n),i=Vr(e,n);return ke(i)?ke(r)?i===r:!1:ke(r)?r in i:Object.keys(r).every(function(o){return o in i?ua(r[o],i[o]):!1})}function Tu(t){try{return ke(t)||typeof t=="number"?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function Ps(t,e){try{return pr(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function xg(t){return typeof t=="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function Vr(t,e){if(xg(t))return t.value;if(pr(t))return uo(t);if(typeof t!="string")return t;var n=Ps(t,e);return uo(n)}function uo(t){if(t.length===1)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function Ir(t,e){for(var n={},r=Object.keys(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function Za(t,e,n){var r,i,o={};try{for(var s=me(Object.keys(t)),a=s.next();!a.done;a=s.next()){var l=a.value,c=t[l];n(c)&&(o[l]=e(c,l,t))}}catch(f){r={error:f}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}var Cg=function(t){return function(e){var n,r,i=e;try{for(var o=me(t),s=o.next();!s.done;s=o.next()){var a=s.value;i=i[a]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function _g(t,e){return function(n){var r,i,o=n;try{for(var s=me(t),a=s.next();!a.done;a=s.next()){var l=a.value;o=o[e][l]}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}}function Wi(t){if(!t)return[[]];if(ke(t))return[[t]];var e=He(Object.keys(t).map(function(n){var r=t[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Wi(t[n]).map(function(i){return[n].concat(i)})}));return e}function He(t){var e;return(e=[]).concat.apply(e,Ue([],_e(t),!1))}function Au(t){return pr(t)?t:[t]}function kt(t){return t===void 0?[]:Au(t)}function fo(t,e,n){var r,i;if(Oe(t))return t(e,n.data);var o={};try{for(var s=me(Object.keys(t)),a=s.next();!a.done;a=s.next()){var l=a.value,c=t[l];Oe(c)?o[l]=c(e,n.data):o[l]=c}}catch(f){r={error:f}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function Og(t){return/^(done|error)\./.test(t)}function qa(t){return!!(t instanceof Promise||t!==null&&(Oe(t)||typeof t=="object")&&Oe(t.then))}function Mg(t){return t!==null&&typeof t=="object"&&"transition"in t&&typeof t.transition=="function"}function Pg(t,e){var n,r,i=_e([[],[]],2),o=i[0],s=i[1];try{for(var a=me(t),l=a.next();!l.done;l=a.next()){var c=l.value;e(c)?o.push(c):s.push(c)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}function Du(t,e){return Ir(t.states,function(n,r){if(n){var i=(ke(e)?void 0:e[r])||(n?n.current:void 0);if(i)return{current:i,states:Du(n,i)}}})}function kg(t,e){return{current:e,states:Du(t,e)}}function Ka(t,e,n,r){var i=t&&n.reduce(function(o,s){var a,l,c=s.assignment,f={state:r,action:s,_event:e},d={};if(Oe(c))d=c(o,e.data,f);else try{for(var p=me(Object.keys(c)),v=p.next();!v.done;v=p.next()){var g=v.value,h=c[g];d[g]=Oe(h)?h(o,e.data,f):h}}catch(w){a={error:w}}finally{try{v&&!v.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}return Object.assign({},o,d)},t);return i}var Rg=function(){};function pr(t){return Array.isArray(t)}function Oe(t){return typeof t=="function"}function ke(t){return typeof t=="string"}function Iu(t,e){if(t)return ke(t)?{type:Ms,name:t,predicate:e?e[t]:void 0}:Oe(t)?{type:Ms,name:t.name,predicate:t}:t}function Tg(t){try{return"subscribe"in t&&Oe(t.subscribe)}catch{return!1}}var dn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();yi={},yi[dn]=function(){return this},yi[Symbol.observable]=function(){return this};function ar(t){return!!t&&"__xstatenode"in t}function Ag(t){return!!t&&typeof t.send=="function"}function To(t,e){return ke(t)||typeof t=="number"?H({type:t},e):t}function ot(t,e){if(!ke(t)&&"$$type"in t&&t.$$type==="scxml")return t;var n=To(t);return H({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function $n(t,e){var n=Au(e).map(function(r){return typeof r>"u"||typeof r=="string"||ar(r)?{target:r,event:t}:H(H({},r),{event:t})});return n}function Dg(t){if(!(t===void 0||t===Eg))return kt(t)}function ju(t,e,n,r,i){var o=t.options.guards,s={state:i,cond:e,_event:r};if(e.type===Ms)return((o==null?void 0:o[e.name])||e.predicate)(n,r.data,s);var a=o==null?void 0:o[e.type];if(!a)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return a(n,r.data,s)}function Nu(t){return typeof t=="string"?{type:t}:t}function Zi(t,e,n){var r=function(){},i=typeof t=="object",o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function bi(t,e){return"".concat(t,":invocation[").concat(e,"]")}function ks(t){return(t.type===li||t.type===Ro&&t.to===sr.Internal)&&typeof t.delay!="number"}var er=ot({type:bg});function Rs(t,e){return e&&e[t]||void 0}function ni(t,e){var n;if(ke(t)||typeof t=="number"){var r=Rs(t,e);Oe(r)?n={type:t,exec:r}:r?n=r:n={type:t,exec:void 0}}else if(Oe(t))n={type:t.name||t.toString(),exec:t};else{var r=Rs(t.type,e);if(Oe(r))n=H(H({},t),{exec:r});else if(r){var i=r.type||t.type;n=H(H(H({},r),t),{type:i})}else n=t}return n}var pn=function(t,e){if(!t)return[];var n=pr(t)?t:[t];return n.map(function(r){return ni(r,e)})};function fa(t){var e=ni(t);return H(H({id:ke(t)?t:e.id},e),{type:e.type})}function Ig(t,e){return{type:li,event:typeof t=="function"?t:To(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function jg(t,e,n,r){var i={_event:n},o=ot(Oe(t.event)?t.event(e,n.data,i):t.event),s;if(ke(t.delay)){var a=r&&r[t.delay];s=Oe(a)?a(e,n.data,i):a}else s=Oe(t.delay)?t.delay(e,n.data,i):t.delay;return H(H({},t),{type:li,_event:o,delay:s})}function Ng(t,e){return{to:e?e.to:void 0,type:Ro,event:Oe(t)?t:To(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:Oe(t)?t.name:Tu(t)}}function Bg(t,e,n,r){var i={_event:n},o=ot(Oe(t.event)?t.event(e,n.data,i):t.event),s;if(ke(t.delay)){var a=r&&r[t.delay];s=Oe(a)?a(e,n.data,i):a}else s=Oe(t.delay)?t.delay(e,n.data,i):t.delay;var l=Oe(t.to)?t.to(e,n.data,i):t.to;return H(H({},t),{to:l,_event:o,event:o.data,delay:s})}var Ug=function(t,e,n){return H(H({},t),{value:ke(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})},Vg=function(t){return{type:Mu,sendId:t}};function Fg(t){var e=fa(t);return{type:De.Start,activity:e,exec:void 0}}function zg(t){var e=Oe(t)?t:fa(t);return{type:De.Stop,activity:e,exec:void 0}}function $g(t,e,n){var r=Oe(t.activity)?t.activity(e,n.data):t.activity,i=typeof r=="string"?{id:r}:r,o={type:De.Stop,activity:i};return o}var Hg=function(t){return{type:ca,assignment:t}};function Gg(t,e){var n=e?"#".concat(e):"";return"".concat(De.After,"(").concat(t,")").concat(n)}function wi(t,e){var n="".concat(De.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function qi(t,e){var n="".concat(De.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function jr(t,e){var n="".concat(De.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}var Wg=function(t){var e,n,r=[];try{for(var i=me(t),o=i.next();!o.done;o=i.next())for(var s=o.value,a=0;a<s.actions.length;){if(s.actions[a].type===ca){r.push(s.actions[a]),s.actions.splice(a,1);continue}a++}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r};function po(t,e,n,r,i,o,s){s===void 0&&(s=!1);var a=s?[]:Wg(i),l=a.length?Ka(n,r,a,e):n,c=s?[n]:void 0,f=[];function d(g,h){var w;switch(h.type){case li:{var S=jg(h,l,r,t.options.delays);return o&&typeof S.delay=="number"&&o(S,l,r),S}case Ro:var y=Bg(h,l,r,t.options.delays);return o&&y.to!==sr.Internal&&(g==="entry"?f.push(y):o(y,l,r)),y;case Pu:{var b=Ug(h,l,r);return o==null||o(b,l,r),b}case Sg:{var O=h,L=(w=O.conds.find(function(G){var z=Iu(G.cond,t.options.guards);return!z||ju(t,z,l,r,o?void 0:e)}))===null||w===void 0?void 0:w.actions;if(!L)return[];var m=_e(po(t,e,l,r,[{type:g,actions:pn(kt(L),t.options.actions)}],o,s),2),x=m[0],C=m[1];return l=C,c==null||c.push(l),x}case Lg:{var L=h.get(l,r.data);if(!L)return[];var R=_e(po(t,e,l,r,[{type:g,actions:pn(kt(L),t.options.actions)}],o,s),2),M=R[0],_=R[1];return l=_,c==null||c.push(l),M}case la:{var b=$g(h,l,r);return o==null||o(b,n,r),b}case ca:{l=Ka(l,r,[h],o?void 0:e),c==null||c.push(l);break}default:var P=ni(h,t.options.actions),j=P.exec;if(o)o(P,l,r);else if(j&&c){var V=c.length-1,$=H(H({},P),{exec:function(G){for(var z=[],W=1;W<arguments.length;W++)z[W-1]=arguments[W];j.apply(void 0,Ue([c[V]],_e(z),!1))}});P=$}return P}}function p(g){var h,w,S=[];try{for(var y=me(g.actions),b=y.next();!b.done;b=y.next()){var O=b.value,L=d(g.type,O);L&&(S=S.concat(L))}}catch(m){h={error:m}}finally{try{b&&!b.done&&(w=y.return)&&w.call(y)}finally{if(h)throw h.error}}return f.forEach(function(m){o(m,l,r)}),f.length=0,S}var v=He(i.map(p));return[v,l]}var Ja=[],Jn=function(t,e){Ja.push(t);var n=e(t);return Ja.pop(),n};function Bu(t){var e;return e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}},e[dn]=function(){return this},e}function Zg(t,e,n,r){var i,o=Nu(t.src),s=(i=e==null?void 0:e.options.services)===null||i===void 0?void 0:i[o.type],a=t.data?fo(t.data,n,r):void 0,l=s?Uu(s,t.id,a):Bu(t.id);return l.meta=t,l}function Uu(t,e,n){var r=Bu(e);if(r.deferred=!0,ar(t)){var i=r.state=Jn(void 0,function(){return(n?t.withContext(n):t).initialState});r.getSnapshot=function(){return i}}return r}function qg(t){try{return typeof t.send=="function"}catch{return!1}}function Kg(t){return qg(t)&&"id"in t}function Jg(t){var e;return H((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e[dn]=function(){return this},e),t)}var ho=function(t){return t.type==="atomic"||t.type==="final"};function Vu(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function ri(t){return Vu(t).filter(function(e){return e.type!=="history"})}function Fu(t){var e=[t];return ho(t)?e:e.concat(He(ri(t).map(Fu)))}function Nr(t,e){var n,r,i,o,s,a,l,c,f=new Set(t),d=Ts(f),p=new Set(e);try{for(var v=me(p),g=v.next();!g.done;g=v.next())for(var h=g.value,w=h.parent;w&&!p.has(w);)p.add(w),w=w.parent}catch(R){n={error:R}}finally{try{g&&!g.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}var S=Ts(p);try{for(var y=me(p),b=y.next();!b.done;b=y.next()){var h=b.value;if(h.type==="compound"&&(!S.get(h)||!S.get(h).length))d.get(h)?d.get(h).forEach(function(M){return p.add(M)}):h.initialStateNodes.forEach(function(M){return p.add(M)});else if(h.type==="parallel")try{for(var O=(s=void 0,me(ri(h))),L=O.next();!L.done;L=O.next()){var m=L.value;p.has(m)||(p.add(m),d.get(m)?d.get(m).forEach(function(M){return p.add(M)}):m.initialStateNodes.forEach(function(M){return p.add(M)}))}}catch(M){s={error:M}}finally{try{L&&!L.done&&(a=O.return)&&a.call(O)}finally{if(s)throw s.error}}}}catch(R){i={error:R}}finally{try{b&&!b.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}try{for(var x=me(p),C=x.next();!C.done;C=x.next())for(var h=C.value,w=h.parent;w&&!p.has(w);)p.add(w),w=w.parent}catch(R){l={error:R}}finally{try{C&&!C.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}return p}function zu(t,e){var n=e.get(t);if(!n)return{};if(t.type==="compound"){var r=n[0];if(r){if(ho(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=zu(o,e)}),i}function Ts(t){var e,n,r=new Map;try{for(var i=me(t),o=i.next();!o.done;o=i.next()){var s=o.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function Yg(t,e){var n=Nr([t],e);return zu(t,Ts(n))}function Br(t,e){return Array.isArray(t)?t.some(function(n){return n===e}):t instanceof Set?t.has(e):!1}function Xg(t){return Ue([],_e(new Set(He(Ue([],_e(t.map(function(e){return e.ownEvents})),!1)))),!1)}function Ki(t,e){return e.type==="compound"?ri(e).some(function(n){return n.type==="final"&&Br(t,n)}):e.type==="parallel"?ri(e).every(function(n){return Ki(t,n)}):!1}function Qg(t){return t===void 0&&(t=[]),t.reduce(function(e,n){return n.meta!==void 0&&(e[n.id]=n.meta),e},{})}function Ya(t){return new Set(He(t.map(function(e){return e.tags})))}function $u(t,e){if(t===e)return!0;if(t===void 0||e===void 0)return!1;if(ke(t)||ke(e))return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(i){return $u(t[i],e[i])})}function ev(t){return typeof t!="object"||t===null?!1:"value"in t&&"_event"in t}function tv(t,e){var n=t.exec,r=H(H({},t),{exec:n!==void 0?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0});return r}var Lt=function(){function t(e){var n=this,r;this.actions=[],this.activities=Wa,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||Wa,this.meta=Qg(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=(r=Array.isArray(e.tags)?new Set(e.tags):e.tags)!==null&&r!==void 0?r:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return Xg(n.configuration)}})}return t.from=function(e,n){if(e instanceof t)return e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e;var r=er;return new t({value:e,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var r=er;return new t({value:e.value,context:n,_event:r,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(e,n){var r=this;if(e===void 0&&(e=this.value),n===void 0&&(n="."),ke(e))return[e];var i=Object.keys(e);return i.concat.apply(i,Ue([],_e(i.map(function(o){return r.toStrings(e[o],n).map(function(s){return o+n+s})})),!1))},t.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var n=e.tags;e.machine;var r=aa(e,["configuration","transitions","tags","machine"]);return H(H({},r),{tags:Array.from(n)})},t.prototype.matches=function(e){return ua(e,this.value)},t.prototype.hasTag=function(e){return this.tags.has(e)},t.prototype.can=function(e){var n;Rg(!!this.machine);var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,e);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},t}(),nv={deferEvents:!1},Xa=function(){function t(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=H(H({},nv),e)}return t.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents){this.schedule(e);return}this.process(e)}this.flushEvents()},t.prototype.schedule=function(e){if(!this.initialized||this.processingEvent){this.queue.push(e);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},t.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},t}(),Yo=new Map,rv=0,Er={bookId:function(){return"x:".concat(rv++)},register:function(t,e){return Yo.set(t,e),t},get:function(t){return Yo.get(t)},free:function(t){Yo.delete(t)}};function da(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function iv(){var t=da();if(t&&"__xstate__"in t)return t.__xstate__}function ov(t){if(da()){var e=iv();e&&e.register(t)}}function sv(t,e){e===void 0&&(e={});var n=t.initialState,r=new Set,i=[],o=!1,s=function(){if(!o){for(o=!0;i.length>0;){var c=i.shift();n=t.transition(n,c,l),r.forEach(function(f){return f.next(n)})}o=!1}},a=Jg({id:e.id,send:function(c){i.push(c),s()},getSnapshot:function(){return n},subscribe:function(c,f,d){var p=Zi(c,f,d);return r.add(p),p.next(n),{unsubscribe:function(){r.delete(p)}}}}),l={parent:e.parent,self:a,id:e.id||"anonymous",observers:r};return n=t.start?t.start(l):n,a}var av={sync:!1,autoForward:!1},et;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(et||(et={}));var lv=function(){function t(e,n){n===void 0&&(n=t.defaultOptions);var r=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=et.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(f,d){if(pr(f))return r.batch(f),r.state;var p=ot(To(f,d));if(r.status===et.Stopped)return r.state;if(r.status!==et.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(p.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
35
|
-
Event: `).concat(JSON.stringify(p.data)));return r.scheduler.schedule(function(){r.forward(p);var v=r._nextState(p);r.update(v,p)}),r._state},this.sendTo=function(f,d,p){var v=r.parent&&(d===sr.Parent||r.parent.id===d),g=v?r.parent:ke(d)?d===sr.Internal?r:r.children.get(d)||Er.get(d):Ag(d)?d:void 0;if(!g){if(!v)throw new Error("Unable to send event to child '".concat(d,"' from service '").concat(r.id,"'."));return}if("machine"in g){if(r.status!==et.Stopped||r.parent!==g||r.state.done){var h=H(H({},f),{name:f.name===wg?"".concat(jr(r.id)):f.name,origin:r.sessionId});!p&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([g,h]):g.send(h)}}else!p&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([g,f.data]):g.send(f.data)},this._exec=function(f,d,p,v){v===void 0&&(v=r.machine.options.actions);var g=f.exec||Rs(f.type,v),h=Oe(g)?g:g?g.exec:f.exec;if(h)try{return h(d,p.data,r.machine.config.predictableActionArguments?{action:f,_event:p}:{action:f,state:r.state,_event:p})}catch(V){throw r.parent&&r.parent.send({type:"xstate.error",data:V}),V}switch(f.type){case li:{var w=f;r.defer(w);break}case Ro:var S=f;if(typeof S.delay=="number"){r.defer(S);return}else S.to?r.sendTo(S._event,S.to,p===er):r.send(S._event);break;case Mu:r.cancel(f.sendId);break;case _s:{if(r.status!==et.Running)return;var y=f.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[y.id||y.type])break;if(y.type===De.Invoke){var b=Nu(y.src),O=r.machine.options.services?r.machine.options.services[b.type]:void 0,L=y.id,m=y.data,x="autoForward"in y?y.autoForward:!!y.forward;if(!O)return;var C=m?fo(m,d,p):void 0;if(typeof O=="string")return;var R=Oe(O)?O(d,p.data,{data:C,src:b,meta:y.meta}):O;if(!R)return;var M=void 0;ar(R)&&(R=C?R.withContext(C):R,M={autoForward:x}),r.spawn(R,L,M)}else r.spawnActivity(y);break}case la:{r.stopChild(f.activity.id);break}case Pu:var _=f,P=_.label,j=_.value;P?r.logger(P,j):r.logger(j);break}};var i=H(H({},t.defaultOptions),n),o=i.clock,s=i.logger,a=i.parent,l=i.id,c=l!==void 0?l:e.id;this.id=c,this.logger=s,this.clock=o,this.parent=a,this.options=i,this.scheduler=new Xa({deferEvents:this.options.deferEvents}),this.sessionId=Er.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Jn(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(e,n){var r,i;try{for(var o=me(e.actions),s=o.next();!s.done;s=o.next()){var a=s.value;this.exec(a,e,n)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.update=function(e,n){var r,i,o,s,a,l,c,f,d=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||n===er)&&this.options.execute)this.execute(this.state);else for(var p=void 0;p=this._outgoingQueue.shift();)p[0].send(p[1]);if(this.children.forEach(function(R){d.state.children[R.id]=R}),this.devTools&&this.devTools.send(n.data,e),e.event)try{for(var v=me(this.eventListeners),g=v.next();!g.done;g=v.next()){var h=g.value;h(e.event)}}catch(R){r={error:R}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}try{for(var w=me(this.listeners),S=w.next();!S.done;S=w.next()){var h=S.value;h(e,e.event)}}catch(R){o={error:R}}finally{try{S&&!S.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}try{for(var y=me(this.contextListeners),b=y.next();!b.done;b=y.next()){var O=b.value;O(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(R){a={error:R}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}if(this.state.done){var L=e.configuration.find(function(R){return R.type==="final"&&R.parent===d.machine}),m=L&&L.doneData?fo(L.doneData,e.context,n):void 0;this._doneEvent=qi(this.id,m);try{for(var x=me(this.doneListeners),C=x.next();!C.done;C=x.next()){var h=C.value;h(this._doneEvent)}}catch(R){c={error:R}}finally{try{C&&!C.done&&(f=x.return)&&f.call(x)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),Er.free(this.sessionId)}},t.prototype.onTransition=function(e){return this.listeners.add(e),this.status===et.Running&&e(this.state,this.state.event),this},t.prototype.subscribe=function(e,n,r){var i=this,o=Zi(e,n,r);this.listeners.add(o.next),this.status!==et.NotStarted&&o.next(this.state);var s=function(){i.doneListeners.delete(s),i.stopListeners.delete(s),o.complete()};return this.status===et.Stopped?o.complete():(this.onDone(s),this.onStop(s)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(s),i.stopListeners.delete(s)}}},t.prototype.onEvent=function(e){return this.eventListeners.add(e),this},t.prototype.onSend=function(e){return this.sendListeners.add(e),this},t.prototype.onChange=function(e){return this.contextListeners.add(e),this},t.prototype.onStop=function(e){return this.stopListeners.add(e),this},t.prototype.onDone=function(e){return this.status===et.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},t.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},t.prototype.start=function(e){var n=this;if(this.status===et.Running)return this;this.machine._init(),Er.register(this.sessionId,this),this.initialized=!0,this.status=et.Running;var r=e===void 0?this.initialState:Jn(this,function(){return ev(e)?n.machine.resolveState(e):n.machine.resolveState(Lt.from(e,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,er)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(e){Oe(e.stop)&&e.stop()}),this.children.clear()},t.prototype._stop=function(){var e,n,r,i,o,s,a,l,c,f;try{for(var d=me(this.listeners),p=d.next();!p.done;p=d.next()){var v=p.value;this.listeners.delete(v)}}catch(x){e={error:x}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}try{for(var g=me(this.stopListeners),h=g.next();!h.done;h=g.next()){var v=h.value;v(),this.stopListeners.delete(v)}}catch(x){r={error:x}}finally{try{h&&!h.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}try{for(var w=me(this.contextListeners),S=w.next();!S.done;S=w.next()){var v=S.value;this.contextListeners.delete(v)}}catch(x){o={error:x}}finally{try{S&&!S.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}try{for(var y=me(this.doneListeners),b=y.next();!b.done;b=y.next()){var v=b.value;this.doneListeners.delete(v)}}catch(x){a={error:x}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=et.Stopped,this._initialState=void 0;try{for(var O=me(Object.keys(this.delayedEventsMap)),L=O.next();!L.done;L=O.next()){var m=L.value;this.clock.clearTimeout(this.delayedEventsMap[m])}}catch(x){c={error:x}}finally{try{L&&!L.done&&(f=O.return)&&f.call(O)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new Xa({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var e=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r=ot({type:"xstate.stop"}),i=Jn(e,function(){var o=He(Ue([],_e(e.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return pn(f.onExit,e.machine.options.actions)})),s=_e(po(e.machine,e.state,e.state.context,r,[{type:"exit",actions:o}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),a=s[0],l=s[1],c=new Lt({value:e.state.value,context:l,_event:r,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:a.filter(function(f){return!ks(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return c.changed=!0,c});e.update(i,r),e._stopChildren(),Er.free(e.sessionId)}),this},t.prototype.batch=function(e){var n=this;if(!(this.status===et.NotStarted&&this.options.deferEvents)){if(this.status!==et.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,s=n.state,a=!1,l=[],c=function(v){var g=ot(v);n.forward(g),s=Jn(n,function(){return n.machine.transition(s,g,void 0,r||void 0)}),l.push.apply(l,Ue([],_e(n.machine.config.predictableActionArguments?s.actions:s.actions.map(function(h){return tv(h,s)})),!1)),a=a||!!s.changed};try{for(var f=me(e),d=f.next();!d.done;d=f.next()){var p=d.value;c(p)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}s.changed=a,s.actions=l,n.update(s,ot(e[e.length-1]))})}},t.prototype.sender=function(e){return this.send.bind(this,e)},t.prototype._nextState=function(e,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=ot(e);if(i.name.indexOf(Ga)===0&&!this.state.nextEvents.some(function(s){return s.indexOf(Ga)===0}))throw i.data.data;var o=Jn(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},t.prototype.nextState=function(e){return this._nextState(e,!1)},t.prototype.forward=function(e){var n,r;try{for(var i=me(this.forwardTo),o=i.next();!o.done;o=i.next()){var s=o.value,a=this.children.get(s);if(!a)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(s,"'."));a.send(e)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.defer=function(e){var n=this,r=this.clock.setTimeout(function(){"to"in e&&e.to?n.sendTo(e._event,e.to,!0):n.send(e._event)},e.delay);e.id&&(this.delayedEventsMap[e.id]=r)},t.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},t.prototype.exec=function(e,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(e,n.context,n._event,r)},t.prototype.removeChild=function(e){var n;this.children.delete(e),this.forwardTo.delete(e),(n=this.state)===null||n===void 0||delete n.children[e]},t.prototype.stopChild=function(e){var n=this.children.get(e);n&&(this.removeChild(e),Oe(n.stop)&&n.stop())},t.prototype.spawn=function(e,n,r){if(this.status!==et.Running)return Uu(e,n);if(qa(e))return this.spawnPromise(Promise.resolve(e),n);if(Oe(e))return this.spawnCallback(e,n);if(Kg(e))return this.spawnActor(e,n);if(Tg(e))return this.spawnObservable(e,n);if(ar(e))return this.spawnMachine(e,H(H({},r),{id:n}));if(Mg(e))return this.spawnBehavior(e,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof e,'".'))},t.prototype.spawnMachine=function(e,n){var r=this;n===void 0&&(n={});var i=new t(e,H(H({},this.options),{parent:this,id:n.id||e.id})),o=H(H({},av),n);o.sync&&i.onTransition(function(a){r.send(ku,{state:a,id:i.id})});var s=i;return this.children.set(i.id,s),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(a){r.removeChild(i.id),r.send(ot(a,{origin:i.id}))}).start(),s},t.prototype.spawnBehavior=function(e,n){var r=sv(e,{id:n,parent:this});return this.children.set(n,r),r},t.prototype.spawnPromise=function(e,n){var r,i=this,o=!1,s;e.then(function(l){o||(s=l,i.removeChild(n),i.send(ot(qi(n,l),{origin:n})))},function(l){if(!o){i.removeChild(n);var c=jr(n,l);try{i.send(ot(c,{origin:n}))}catch{i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var a=(r={id:n,send:function(){},subscribe:function(l,c,f){var d=Zi(l,c,f),p=!1;return e.then(function(v){p||(d.next(v),!p&&d.complete())},function(v){p||d.error(v)}),{unsubscribe:function(){return p=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},r[dn]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnCallback=function(e,n){var r,i=this,o=!1,s=new Set,a=new Set,l,c=function(p){l=p,a.forEach(function(v){return v(p)}),!o&&i.send(ot(p,{origin:n}))},f;try{f=e(c,function(p){s.add(p)})}catch(p){this.send(jr(n,p))}if(qa(f))return this.spawnPromise(f,n);var d=(r={id:n,send:function(p){return s.forEach(function(v){return v(p)})},subscribe:function(p){var v=Zi(p);return a.add(v.next),{unsubscribe:function(){a.delete(v.next)}}},stop:function(){o=!0,Oe(f)&&f()},toJSON:function(){return{id:n}},getSnapshot:function(){return l}},r[dn]=function(){return this},r);return this.children.set(n,d),d},t.prototype.spawnObservable=function(e,n){var r,i=this,o,s=e.subscribe(function(l){o=l,i.send(ot(l,{origin:n}))},function(l){i.removeChild(n),i.send(ot(jr(n,l),{origin:n}))},function(){i.removeChild(n),i.send(ot(qi(n),{origin:n}))}),a=(r={id:n,send:function(){},subscribe:function(l,c,f){return e.subscribe(l,c,f)},stop:function(){return s.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[dn]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnActor=function(e,n){return this.children.set(n,e),e},t.prototype.spawnActivity=function(e){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(n){var r=n(this.state.context,e);this.spawnEffect(e.id,r)}},t.prototype.spawnEffect=function(e,n){var r;this.children.set(e,(r={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},r[dn]=function(){return this},r))},t.prototype.attachDev=function(){var e=da();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(H(H({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:H({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}ov(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[dn]=function(){return this},t.prototype.getSnapshot=function(){return this.status===et.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,n){return setTimeout(e,n)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},t.interpret=Hu,t}();function Hu(t,e){var n=new lv(t,e);return n}function cv(t){if(typeof t=="string"){var e={type:t};return e.toString=function(){return t},e}return t}function Si(t){return H(H({type:Os},t),{toJSON:function(){t.onDone,t.onError;var e=aa(t,["onDone","onError"]);return H(H({},e),{type:Os,src:cv(t.src)})}})}var Li="",As="#",Xo="*",Hn={},Gn=function(t){return t[0]===As},uv=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},fv=function(){function t(e,n,r,i){r===void 0&&(r="context"in e?e.context:void 0);var o=this,s;this.config=e,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(uv(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:Ru),this.id=this.config.id||Ue([this.machine.key],_e(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(s=this.config.schema)!==null&&s!==void 0?s:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?Ir(this.config.states,function(c,f){var d,p=new t(c,{},void 0,{parent:o,key:f});return Object.assign(o.idMap,H((d={},d[p.id]=p,d),p.idMap)),p}):Hn;var a=0;function l(c){var f,d;c.order=a++;try{for(var p=me(Vu(c)),v=p.next();!v.done;v=p.next()){var g=v.value;l(g)}}catch(h){f={error:h}}finally{try{v&&!v.done&&(d=p.return)&&d.call(p)}finally{if(f)throw f.error}}}l(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var f=c.event;return f===Li}):Li in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=kt(this.config.entry||this.config.onEntry).map(function(c){return ni(c)}),this.onExit=kt(this.config.exit||this.config.onExit).map(function(c){return ni(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=kt(this.config.invoke).map(function(c,f){var d,p;if(ar(c)){var v=bi(o.id,f);return o.machine.options.services=H((d={},d[v]=c,d),o.machine.options.services),Si({src:v,id:v})}else if(ke(c.src)){var v=c.id||bi(o.id,f);return Si(H(H({},c),{id:v,src:c.src}))}else if(ar(c.src)||Oe(c.src)){var v=c.id||bi(o.id,f);return o.machine.options.services=H((p={},p[v]=c.src,p),o.machine.options.services),Si(H(H({id:v},c),{src:v}))}else{var g=c.src;return Si(H(H({id:bi(o.id,f)},c),{src:g}))}}),this.activities=kt(this.config.activities).concat(this.invoke).map(function(c){return fa(c)}),this.transition=this.transition.bind(this),this.tags=kt(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||Fu(this).forEach(function(e){return e.on})},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,s=r.guards,a=r.services,l=r.delays;return new t(this.config,{actions:H(H({},i),e.actions),activities:H(H({},o),e.activities),guards:H(H({},s),e.guards),services:H(H({},a),e.services),delays:H(H({},l),e.delays)},n??this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return Oe(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Ir(this.states,function(e){return e.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var n=e===Li,r=this.transitions.filter(function(i){var o=i.eventType===e;return n?o:o||i.eventType===Xo});return this.__cache.candidates[e]=r,r},t.prototype.getDelayedTransitions=function(){var e=this,n=this.config.after;if(!n)return[];var r=function(o,s){var a=Oe(o)?"".concat(e.id,":delay[").concat(s,"]"):o,l=Gg(a,e.id);return e.onEntry.push(Ng(l,{delay:o})),e.onExit.push(Vg(l)),l},i=pr(n)?n.map(function(o,s){var a=r(o.delay,s);return H(H({},o),{event:a})}):He(Object.keys(n).map(function(o,s){var a=n[o],l=ke(a)?{target:a}:a,c=isNaN(+o)?o:+o,f=r(c,s);return kt(l).map(function(d){return H(H({},d),{event:f,delay:c})})}));return i.map(function(o){var s=o.delay;return H(H({},e.formatTransition(o)),{delay:s})})},t.prototype.getStateNodes=function(e){var n,r=this;if(!e)return[];var i=e instanceof Lt?e.value:Vr(e,this.delimiter);if(ke(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var s=Object.keys(i),a=[this];return a.push.apply(a,Ue([],_e(He(s.map(function(l){return r.getStateNode(l).getStateNodes(i[l])}))),!1)),a},t.prototype.handles=function(e){var n=Tu(e);return this.events.includes(n)},t.prototype.resolveState=function(e){var n=e instanceof Lt?e:Lt.create(e),r=Array.from(Nr([],this.getStateNodes(n.value)));return new Lt(H(H({},n),{value:this.resolve(n.value),configuration:r,done:Ki(r,this),tags:Ya(r),machine:this.machine}))},t.prototype.transitionLeafNode=function(e,n,r){var i=this.getStateNode(e),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},t.prototype.transitionCompoundNode=function(e,n,r){var i=Object.keys(e),o=this.getStateNode(i[0]),s=o._transition(e[i[0]],n,r);return!s||!s.transitions.length?this.next(n,r):s},t.prototype.transitionParallelNode=function(e,n,r){var i,o,s={};try{for(var a=me(Object.keys(e)),l=a.next();!l.done;l=a.next()){var c=l.value,f=e[c];if(f){var d=this.getStateNode(c),p=d._transition(f,n,r);p&&(s[c]=p)}}}catch(S){i={error:S}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}var v=Object.keys(s).map(function(S){return s[S]}),g=He(v.map(function(S){return S.transitions})),h=v.some(function(S){return S.transitions.length>0});if(!h)return this.next(n,r);var w=He(Object.keys(s).map(function(S){return s[S].configuration}));return{transitions:g,exitSet:He(v.map(function(S){return S.exitSet})),configuration:w,source:n,actions:He(Object.keys(s).map(function(S){return s[S].actions}))}},t.prototype._transition=function(e,n,r){return ke(e)?this.transitionLeafNode(e,n,r):Object.keys(e).length===1?this.transitionCompoundNode(e,n,r):this.transitionParallelNode(e,n,r)},t.prototype.getTransitionData=function(e,n){return this._transition(e.value,e,ot(n))},t.prototype.next=function(e,n){var r,i,o=this,s=n.name,a=[],l=[],c;try{for(var f=me(this.getCandidates(s)),d=f.next();!d.done;d=f.next()){var p=d.value,v=p.cond,g=p.in,h=e.context,w=g?ke(g)&&Gn(g)?e.matches(Vr(this.getStateNodeById(g).path,this.delimiter)):ua(Vr(g,this.delimiter),Cg(this.path.slice(0,-2))(e.value)):!0,S=!1;try{S=!v||ju(this.machine,v,h,n,e)}catch(O){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,`':
|
|
36
|
-
`).concat(O.message))}if(S&&w){p.target!==void 0&&(l=p.target),a.push.apply(a,Ue([],_e(p.actions),!1)),c=p;break}}}catch(O){r={error:O}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}if(c){if(!l.length)return{transitions:[c],exitSet:[],configuration:e.value?[this]:[],source:e,actions:a};var y=He(l.map(function(O){return o.getRelativeStateNodes(O,e.historyValue)})),b=!!c.internal;return{transitions:[c],exitSet:b?[]:He(l.map(function(O){return o.getPotentiallyReenteringNodes(O)})),configuration:y,source:e,actions:a}}},t.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var n=[],r=this,i=e;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},t.prototype.getActions=function(e,n,r,i,o,s,a){var l,c,f,d,p=this,v=s?Nr([],this.getStateNodes(s.value)):[],g=new Set;try{for(var h=me(Array.from(e).sort(function(_,P){return _.order-P.order})),w=h.next();!w.done;w=h.next()){var S=w.value;(!Br(v,S)||Br(r.exitSet,S)||S.parent&&g.has(S.parent))&&g.add(S)}}catch(_){l={error:_}}finally{try{w&&!w.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}try{for(var y=me(v),b=y.next();!b.done;b=y.next()){var S=b.value;(!Br(e,S)||Br(r.exitSet,S.parent))&&r.exitSet.push(S)}}catch(_){f={error:_}}finally{try{b&&!b.done&&(d=y.return)&&d.call(y)}finally{if(f)throw f.error}}r.exitSet.sort(function(_,P){return P.order-_.order});var O=Array.from(g).sort(function(_,P){return _.order-P.order}),L=new Set(r.exitSet),m=He(O.map(function(_){var P=[];if(_.type!=="final")return P;var j=_.parent;if(!j.parent)return P;P.push(wi(_.id,_.doneData),wi(j.id,_.doneData?fo(_.doneData,i,o):void 0));var V=j.parent;return V.type==="parallel"&&ri(V).every(function($){return Ki(r.configuration,$)})&&P.push(wi(V.id)),P})),x=O.map(function(_){var P=_.onEntry,j=_.activities.map(function(V){return Fg(V)});return{type:"entry",actions:pn(a?Ue(Ue([],_e(P),!1),_e(j),!1):Ue(Ue([],_e(j),!1),_e(P),!1),p.machine.options.actions)}}).concat({type:"state_done",actions:m.map(function(_){return Ig(_)})}),C=Array.from(L).map(function(_){return{type:"exit",actions:pn(Ue(Ue([],_e(_.onExit),!1),_e(_.activities.map(function(P){return zg(P)})),!1),p.machine.options.actions)}}),R=C.concat({type:"transition",actions:pn(r.actions,this.machine.options.actions)}).concat(x);if(n){var M=pn(He(Ue([],_e(e),!1).sort(function(_,P){return P.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!ks(_)});return R.concat({type:"stop",actions:M})}return R},t.prototype.transition=function(e,n,r,i){e===void 0&&(e=this.initialState);var o=ot(n),s;if(e instanceof Lt)s=r===void 0?e:this.resolveState(Lt.from(e,r));else{var a=ke(e)?this.resolve(uo(this.getResolvedPath(e))):this.resolve(e),l=r??this.machine.context;s=this.resolveState(Lt.from(a,l))}if(this.strict&&!this.events.includes(o.name)&&!Og(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(s.value,s,o)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]},f=Nr([],this.getStateNodes(s.value)),d=c.configuration.length?Nr(f,c.configuration):f;return c.configuration=Ue([],_e(d),!1),this.resolveTransition(c,s,s.context,i,o)},t.prototype.resolveRaisedTransition=function(e,n,r,i){var o,s=e.actions;return e=this.transition(e,n,void 0,i),e._event=r,e.event=r.data,(o=e.actions).unshift.apply(o,Ue([],_e(s),!1)),e},t.prototype.resolveTransition=function(e,n,r,i,o){var s,a,l,c,f=this;o===void 0&&(o=er);var d=e.configuration,p=!n||e.transitions.length>0,v=p?e.configuration:n?n.configuration:[],g=Ki(v,this),h=p?Yg(this.machine,d):void 0,w=n?n.historyValue?n.historyValue:e.source?this.machine.historyValue(n.value):void 0:void 0,S=this.getActions(new Set(v),g,e,r,o,n,i),y=n?H({},n.activities):{};try{for(var b=me(S),O=b.next();!O.done;O=b.next()){var L=O.value;try{for(var m=(l=void 0,me(L.actions)),x=m.next();!x.done;x=m.next()){var C=x.value;C.type===_s?y[C.activity.id||C.activity.type]=C:C.type===la&&(y[C.activity.id||C.activity.type]=!1)}}catch(U){l={error:U}}finally{try{x&&!x.done&&(c=m.return)&&c.call(m)}finally{if(l)throw l.error}}}}catch(U){s={error:U}}finally{try{O&&!O.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}var R=_e(po(this,n,r,o,S,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),M=R[0],_=R[1],P=_e(Pg(M,ks),2),j=P[0],V=P[1],$=M.filter(function(U){var Z;return U.type===_s&&((Z=U.activity)===null||Z===void 0?void 0:Z.type)===Os}),G=$.reduce(function(U,Z){return U[Z.activity.id]=Zg(Z.activity,f.machine,_,o),U},n?H({},n.children):{}),z=new Lt({value:h||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:h?w?kg(w,h):void 0:n?n.historyValue:void 0,history:!h||e.source?n:void 0,actions:h?V:[],activities:h?y:n?n.activities:{},events:[],configuration:v,transitions:e.transitions,children:G,done:g,tags:Ya(v),machine:this}),W=r!==_;z.changed=o.name===ku||W;var D=z.history;D&&delete D.history;var k=!g&&(this._transient||d.some(function(U){return U._transient}));if(!p&&(!k||o.name===Li))return z;var A=z;if(!g)for(k&&(A=this.resolveRaisedTransition(A,{type:yg},o,i));j.length;){var T=j.shift();A=this.resolveRaisedTransition(A,T._event,o,i)}var N=A.changed||(D?!!A.actions.length||W||typeof D.value!=typeof A.value||!$u(A.value,D.value):void 0);return A.changed=N,A.history=D,A},t.prototype.getStateNode=function(e){if(Gn(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[e];if(!n)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return n},t.prototype.getStateNodeById=function(e){var n=Gn(e)?e.slice(As.length):e;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},t.prototype.getStateNodeByPath=function(e){if(typeof e=="string"&&Gn(e))try{return this.getStateNodeById(e.slice(1))}catch{}for(var n=Ps(e,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},t.prototype.resolve=function(e){var n,r=this;if(!e)return this.initialStateValue||Hn;switch(this.type){case"parallel":return Ir(this.initialStateValue,function(o,s){return o?r.getStateNode(s).resolve(e[s]||o):Hn});case"compound":if(ke(e)){var i=this.getStateNode(e);return i.type==="parallel"||i.type==="compound"?(n={},n[e]=i.initialStateValue,n):e}return Object.keys(e).length?Ir(e,function(o,s){return o?r.getStateNode(s).resolve(o):Hn}):this.initialStateValue||{};default:return e||Hn}},t.prototype.getResolvedPath=function(e){if(Gn(e)){var n=this.machine.idMap[e.slice(As.length)];if(!n)throw new Error("Unable to find state node '".concat(e,"'"));return n.path}return Ps(e,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Za(this.states,function(r){return r.initialStateValue||Hn},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=ho(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(e,n){this._init();var r=this.getStateNodes(e);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var e;if(this.type==="history"){var n=this.config;ke(n.target)?e=Gn(n.target)?uo(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:e=n.target}return e},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(e,n,r){return r===void 0&&(r=!0),r?e.type==="history"?e.resolveHistory(n):e.initialStateNodes:[e]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var e=this;if(ho(this))return[this];if(this.type==="compound"&&!this.initial)return[this];var n=Wi(this.initialStateValue);return He(n.map(function(r){return e.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var n=_e(e),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},t.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:Za(this.states,function(n,r){if(!e)return n.historyValue();var i=ke(e)?void 0:e[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},t.prototype.resolveHistory=function(e){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!e){var i=this.target;return i?He(Wi(i).map(function(s){return r.getFromRelativePath(s)})):r.initialStateNodes}var o=_g(r.path,"states")(e).current;return ke(o)?[r.getStateNode(o)]:He(Wi(o).map(function(s){return n.history==="deep"?r.getFromRelativePath(s):[r.states[s[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var e=this,n=He(Object.keys(this.states).map(function(r){return e.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var e,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,s=new Set(this.ownEvents);if(o)try{for(var a=me(Object.keys(o)),l=a.next();!l.done;l=a.next()){var c=l.value,f=o[c];if(f.states)try{for(var d=(r=void 0,me(f.events)),p=d.next();!p.done;p=d.next()){var v=p.value;s.add("".concat(v))}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}}catch(g){e={error:g}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(e){var n=this;if(e!==void 0)return e.map(function(r){if(!ke(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var s=n.parent.getStateNodeByPath(o);return s}catch(a){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
37
|
-
`).concat(a.message))}else return n.getStateNodeByPath(o)})},t.prototype.formatTransition=function(e){var n=this,r=Dg(e.target),i="internal"in e?e.internal:r?r.some(function(l){return ke(l)&&l[0]===n.delimiter}):!0,o=this.machine.options.guards,s=this.resolveTarget(r),a=H(H({},e),{actions:pn(kt(e.actions)),cond:Iu(e.cond,o),target:s,source:this,internal:i,eventType:e.event,toJSON:function(){return H(H({},a),{target:a.target?a.target.map(function(l){return"#".concat(l.id)}):void 0,source:"#".concat(n.id)})}});return a},t.prototype.formatTransitions=function(){var e,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,s=Xo,a=o[s],l=a===void 0?[]:a,c=aa(o,[typeof s=="symbol"?s:s+""]);i=He(Object.keys(c).map(function(y){var b=$n(y,c[y]);return b}).concat($n(Xo,l)))}var f=this.config.always?$n("",this.config.always):[],d=this.config.onDone?$n(String(wi(this.id)),this.config.onDone):[],p=He(this.invoke.map(function(y){var b=[];return y.onDone&&b.push.apply(b,Ue([],_e($n(String(qi(y.id)),y.onDone)),!1)),y.onError&&b.push.apply(b,Ue([],_e($n(String(jr(y.id)),y.onError)),!1)),b})),v=this.after,g=He(Ue(Ue(Ue(Ue([],_e(d),!1),_e(p),!1),_e(i),!1),_e(f),!1).map(function(y){return kt(y).map(function(b){return r.formatTransition(b)})}));try{for(var h=me(v),w=h.next();!w.done;w=h.next()){var S=w.value;g.push(S)}}catch(y){e={error:y}}finally{try{w&&!w.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}return g},t}();function dv(t,e,n){return n===void 0&&(n=t.context),new fv(t,e,n)}var pv=Hg,Ds;(function(t){t[t.Effect=1]="Effect",t[t.LayoutEffect=2]="LayoutEffect"})(Ds||(Ds={}));var Fr=u.useLayoutEffect;function Qa(t){var e=ce.useRef();return e.current||(e.current={v:t()}),e.current.v}var hv=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},gv=globalThis&&globalThis.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function vv(t,e){var n,r,i=hv([[],[]],2),o=i[0],s=i[1];try{for(var a=gv(t),l=a.next();!l.done;l=a.next()){var c=l.value;e(c)?o.push(c):s.push(c)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}var xr=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},el=globalThis&&globalThis.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function tl(t,e){var n=t.exec,r=n(e.context,e._event.data,{action:t,state:e,_event:e._event});r()}function mv(t){var e=u.useRef([]),n=u.useRef([]);Fr(function(){var r=t.subscribe(function(i){var o,s;if(i.actions.length){var a=i.actions.filter(function(d){return typeof d.exec=="function"&&"__effect"in d.exec}),l=xr(vv(a,function(d){return d.exec.__effect===Ds.Effect}),2),c=l[0],f=l[1];(o=e.current).push.apply(o,el([],xr(c.map(function(d){return[d,i]})),!1)),(s=n.current).push.apply(s,el([],xr(f.map(function(d){return[d,i]})),!1))}});return function(){r.unsubscribe()}},[]),Fr(function(){for(;n.current.length;){var r=xr(n.current.shift(),2),i=r[0],o=r[1];tl(i,o)}}),u.useEffect(function(){for(;e.current.length;){var r=xr(e.current.shift(),2),i=r[0],o=r[1];tl(i,o)}})}var zr=globalThis&&globalThis.__assign||function(){return zr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zr.apply(this,arguments)},yv=globalThis&&globalThis.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};globalThis&&globalThis.__read;function bv(t,e,n){if(typeof t=="object")return t;var r=function(){};return{next:t,error:e||r,complete:n||r}}function wv(t,e,n){e===void 0&&(e={});var r=Qa(function(){return typeof t=="function"?t():t}),i=e.context,o=e.guards,s=e.actions,a=e.activities,l=e.services,c=e.delays,f=e.state,d=yv(e,["context","guards","actions","activities","services","delays","state"]),p=Qa(function(){var v={context:i,guards:o,actions:s,activities:a,services:l,delays:c},g=r.withConfig(v,function(){return zr(zr({},r.context),i)});return Hu(g,zr({deferEvents:!0},d))});return Fr(function(){var v;return n&&(v=p.subscribe(bv(n))),function(){v==null||v.unsubscribe()}},[n]),Fr(function(){return p.start(f?Lt.create(f):void 0),function(){p.stop()}},[]),Fr(function(){Object.assign(p.machine.options.actions,s),Object.assign(p.machine.options.guards,o),Object.assign(p.machine.options.activities,a),Object.assign(p.machine.options.services,l),Object.assign(p.machine.options.delays,c)},[s,o,a,l,c]),mv(p),p}var Sv=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o};globalThis&&globalThis.__spreadArray;function Lv(t,e){e===void 0&&(e={});var n=u.useCallback(function(a){var l=a.changed===void 0&&Object.keys(a.children).length;(a.changed||l)&&s(a)},[]),r=wv(t,e,n),i=Sv(u.useState(function(){var a=r.machine.initialState;return e.state?Lt.create(e.state):a}),2),o=i[0],s=i[1];return[o,r.send,r]}function Ge(){return Ge=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ge.apply(this,arguments)}function tr(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}const he={arr:Array.isArray,obj:t=>Object.prototype.toString.call(t)==="[object Object]",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0,nul:t=>t===null,set:t=>t instanceof Set,map:t=>t instanceof Map,equ(t,e){if(typeof t!=typeof e)return!1;if(he.str(t)||he.num(t))return t===e;if(he.obj(t)&&he.obj(e)&&Object.keys(t).length+Object.keys(e).length===0)return!0;let n;for(n in t)if(!(n in e))return!1;for(n in e)if(t[n]!==e[n])return!1;return he.und(n)?t===e:!0}};function Ev(t,e){return e===void 0&&(e=!0),n=>(he.arr(n)?n:Object.keys(n)).reduce((r,i)=>{const o=e?i[0].toLowerCase()+i.substring(1):i;return r[o]=t(o),r},t)}function xv(){const t=u.useState(!1),e=t[1];return u.useCallback(()=>e(r=>!r),[])}function _n(t,e){return he.und(t)||he.nul(t)?e:t}function Ei(t){return he.und(t)?[]:he.arr(t)?t:[t]}function Xn(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return he.fun(t)?t(...n):t}function Cv(t){return t.to,t.from,t.config,t.onStart,t.onRest,t.onFrame,t.children,t.reset,t.reverse,t.force,t.immediate,t.delay,t.attach,t.destroyed,t.interpolateTo,t.ref,t.lazy,tr(t,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}function Qo(t){const e=Cv(t);if(he.und(e))return Ge({to:e},t);const n=Object.keys(t).reduce((r,i)=>he.und(e[i])?Ge({},r,{[i]:t[i]}):r,{});return Ge({to:e},n)}function _v(t,e){return e&&(he.fun(e)?e(t):he.obj(e)&&(e.current=t)),t}class Tt{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){this.children.length===0&&this.attach(),this.children.push(e)}removeChild(e){const n=this.children.indexOf(e);this.children.splice(n,1),this.children.length===0&&this.detach()}}class Is extends Tt{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach(e=>e instanceof Tt&&e.addChild(this)),this.detach=()=>this.payload.forEach(e=>e instanceof Tt&&e.removeChild(this))}}class Gu extends Tt{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach(e=>e instanceof Tt&&e.addChild(this)),this.detach=()=>Object.values(this.payload).forEach(e=>e instanceof Tt&&e.removeChild(this))}getValue(e){e===void 0&&(e=!1);const n={};for(const r in this.payload){const i=this.payload[r];e&&!(i instanceof Tt)||(n[r]=i instanceof Tt?i[e?"getAnimatedValue":"getValue"]():i)}return n}getAnimatedValue(){return this.getValue(!0)}}let pa;function Ov(t,e){pa={fn:t,transform:e}}let Wu;function Mv(t){Wu=t}let Zu=t=>typeof window<"u"?window.requestAnimationFrame(t):-1,go;function Pv(t){go=t}let qu=()=>Date.now(),kv=t=>t.current,Ku;function Rv(t){Ku=t}class Tv extends Gu{constructor(e,n){super(),this.update=void 0,this.payload=e.style?Ge({},e,{style:Ku(e.style)}):e,this.update=n,this.attach()}}const Av=t=>he.fun(t)&&!(t.prototype instanceof u.Component),Dv=t=>u.forwardRef((n,r)=>{const i=xv(),o=u.useRef(!0),s=u.useRef(null),a=u.useRef(null),l=u.useCallback(p=>{const v=s.current,g=()=>{let h=!1;a.current&&(h=pa.fn(a.current,s.current.getAnimatedValue())),(!a.current||h===!1)&&i()};s.current=new Tv(p,g),v&&v.detach()},[]);u.useEffect(()=>()=>{o.current=!1,s.current&&s.current.detach()},[]),u.useImperativeHandle(r,()=>kv(a)),l(n);const c=s.current.getValue();c.scrollTop,c.scrollLeft;const f=tr(c,["scrollTop","scrollLeft"]),d=Av(t)?void 0:p=>a.current=_v(p,r);return u.createElement(t,Ge({},f,{ref:d}))});let $r=!1;const Dn=new Set,Ju=()=>{if(!$r)return!1;let t=qu();for(let e of Dn){let n=!1;for(let r=0;r<e.configs.length;r++){let i=e.configs[r],o,s;for(let a=0;a<i.animatedValues.length;a++){let l=i.animatedValues[a];if(l.done)continue;let c=i.fromValues[a],f=i.toValues[a],d=l.lastPosition,p=f instanceof Tt,v=Array.isArray(i.initialVelocity)?i.initialVelocity[a]:i.initialVelocity;if(p&&(f=f.getValue()),i.immediate){l.setValue(f),l.done=!0;continue}if(typeof c=="string"||typeof f=="string"){l.setValue(f),l.done=!0;continue}if(i.duration!==void 0)d=c+i.easing((t-l.startTime)/i.duration)*(f-c),o=t>=l.startTime+i.duration;else if(i.decay)d=c+v/(1-.998)*(1-Math.exp(-(1-.998)*(t-l.startTime))),o=Math.abs(l.lastPosition-d)<.1,o&&(f=d);else{s=l.lastTime!==void 0?l.lastTime:t,v=l.lastVelocity!==void 0?l.lastVelocity:i.initialVelocity,t>s+64&&(s=t);let g=Math.floor(t-s);for(let y=0;y<g;++y){let b=-i.tension*(d-f),O=-i.friction*v,L=(b+O)/i.mass;v=v+L*1/1e3,d=d+v*1/1e3}let h=i.clamp&&i.tension!==0?c<f?d>f:d<f:!1,w=Math.abs(v)<=i.precision,S=i.tension!==0?Math.abs(f-d)<=i.precision:!0;o=h||w&&S,l.lastVelocity=v,l.lastTime=t}p&&!i.toValues[a].done&&(o=!1),o?(l.value!==f&&(d=f),l.done=!0):n=!0,l.setValue(d),l.lastPosition=d}e.props.onFrame&&(e.values[i.name]=i.interpolation.getValue())}e.props.onFrame&&e.props.onFrame(e.values),n||(Dn.delete(e),e.stop(!0))}return Dn.size?Zu(Ju):$r=!1,$r},Iv=t=>{Dn.has(t)||Dn.add(t),$r||($r=!0,Zu(Ju))},jv=t=>{Dn.has(t)&&Dn.delete(t)};function vo(t,e,n){if(typeof t=="function")return t;if(Array.isArray(t))return vo({range:t,output:e,extrapolate:n});if(go&&typeof t.output[0]=="string")return go(t);const r=t,i=r.output,o=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(c=>c);return c=>{const f=Bv(c,o);return Nv(c,o[f],o[f+1],i[f],i[f+1],l,s,a,r.map)}}function Nv(t,e,n,r,i,o,s,a,l){let c=l?l(t):t;if(c<e){if(s==="identity")return c;s==="clamp"&&(c=e)}if(c>n){if(a==="identity")return c;a==="clamp"&&(c=n)}return r===i?r:e===n?t<=e?r:i:(e===-1/0?c=-c:n===1/0?c=c-e:c=(c-e)/(n-e),c=o(c),r===-1/0?c=-c:i===1/0?c=c+r:c=c*(i-r)+r,c)}function Bv(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}class lr extends Is{constructor(e,n,r,i){super(),this.calc=void 0,this.payload=e instanceof Is&&!(e instanceof lr)?e.getPayload():Array.isArray(e)?e:[e],this.calc=vo(n,r,i)}getValue(){return this.calc(...this.payload.map(e=>e.getValue()))}updateConfig(e,n,r){this.calc=vo(e,n,r)}interpolate(e,n,r){return new lr(this,e,n,r)}}const Wn=(t,e,n)=>t&&new lr(t,e,n),Uv={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};function Yu(t,e){"update"in t?e.add(t):t.getChildren().forEach(n=>Yu(n,e))}class js extends Tt{constructor(e){var n;super(),n=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(r,i){i===void 0&&(i=!0),n.value=r,i&&n.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){this.animatedStyles.size===0&&Yu(this,this.animatedStyles),this.animatedStyles.forEach(e=>e.update())}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,n,r){return new lr(this,e,n,r)}}class Vv extends Is{constructor(e){super(),this.payload=e.map(n=>new js(n))}setValue(e,n){n===void 0&&(n=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((r,i)=>this.payload[i].setValue(r,n)):this.payload.forEach(r=>r.setValue(e,n))}getValue(){return this.payload.map(e=>e.getValue())}interpolate(e,n){return new lr(this,e,n)}}let Fv=0,zv=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=Fv++}update(e){if(!e)return this;const n=Qo(e),r=n.delay,i=r===void 0?0:r,o=n.to,s=tr(n,["delay","to"]);if(he.arr(o)||he.fun(o))this.queue.push(Ge({},s,{delay:i,to:o}));else if(o){let a={};Object.entries(o).forEach(l=>{let c=l[0],f=l[1];const d=Ge({to:{[c]:f},delay:Xn(i,c)},s),p=a[d.delay]&&a[d.delay].to;a[d.delay]=Ge({},a[d.delay],d,{to:Ge({},p,d.to)})}),this.queue=Object.values(a)}return this.queue=this.queue.sort((a,l)=>a.delay-l.delay),this.diff(s),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach(i=>{let o=i.from,s=o===void 0?{}:o,a=i.to,l=a===void 0?{}:a;he.obj(s)&&(this.merged=Ge({},s,this.merged)),he.obj(l)&&(this.merged=Ge({},this.merged,l))});const n=this.local=++this.guid,r=this.localQueue=this.queue;this.queue=[],r.forEach((i,o)=>{let s=i.delay,a=tr(i,["delay"]);const l=f=>{o===r.length-1&&n===this.guid&&f&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let c=he.arr(a.to)||he.fun(a.to);s?setTimeout(()=>{n===this.guid&&(c?this.runAsync(a,l):this.diff(a).start(l))},s):c?this.runAsync(a,l):this.diff(a).start(l)})}else he.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),Iv(this);return this}stop(e){return this.listeners.forEach(n=>n(e)),this.listeners=[],this}pause(e){return this.stop(!0),e&&jv(this),this}runAsync(e,n){var r=this;e.delay;let i=tr(e,["delay"]);const o=this.local;let s=Promise.resolve(void 0);if(he.arr(i.to))for(let a=0;a<i.to.length;a++){const l=a,c=Ge({},i,Qo(i.to[l]));he.arr(c.config)&&(c.config=c.config[l]),s=s.then(()=>{if(o===this.guid)return new Promise(f=>this.diff(c).start(f))})}else if(he.fun(i.to)){let a=0,l;s=s.then(()=>i.to(c=>{const f=Ge({},i,Qo(c));if(he.arr(f.config)&&(f.config=f.config[a]),a++,o===this.guid)return l=new Promise(d=>this.diff(f).start(d))},function(c){return c===void 0&&(c=!0),r.stop(c)}).then(()=>l))}s.then(n)}diff(e){this.props=Ge({},this.props,e);let n=this.props,r=n.from,i=r===void 0?{}:r,o=n.to,s=o===void 0?{}:o,a=n.config,l=a===void 0?{}:a,c=n.reverse,f=n.attach,d=n.reset,p=n.immediate;if(c){var v=[s,i];i=v[0],s=v[1]}this.merged=Ge({},i,this.merged,s),this.hasChanged=!1;let g=f&&f(this);if(this.animations=Object.entries(this.merged).reduce((h,w)=>{let S=w[0],y=w[1],b=h[S]||{};const O=he.num(y),L=he.str(y)&&!y.startsWith("#")&&!/\d/.test(y)&&!Wu[y],m=he.arr(y),x=!O&&!m&&!L;let C=he.und(i[S])?y:i[S],R=O||m||L?y:1,M=Xn(l,S);g&&(R=g.animations[S].parent);let _=b.parent,P=b.interpolation,j=Ei(g?R.getPayload():R),V,$=y;x&&($=go({range:[0,1],output:[y,y]})(1));let G=P&&P.getValue();const W=!he.und(_)&&b.animatedValues.some(T=>!T.done),D=!he.equ($,G),k=!he.equ($,b.previous),A=!he.equ(M,b.config);if(d||k&&D||A){if(O||L)_=P=b.parent||new js(C);else if(m)_=P=b.parent||new Vv(C);else if(x){let T=b.interpolation&&b.interpolation.calc(b.parent.value);T=T!==void 0&&!d?T:C,b.parent?(_=b.parent,_.setValue(0,!1)):_=new js(0);const N={output:[T,y]};b.interpolation?(P=b.interpolation,b.interpolation.updateConfig(N)):P=_.interpolate(N)}return j=Ei(g?R.getPayload():R),V=Ei(_.getPayload()),d&&!x&&_.setValue(C,!1),this.hasChanged=!0,V.forEach(T=>{T.startPosition=T.value,T.lastPosition=T.value,T.lastVelocity=W?T.lastVelocity:void 0,T.lastTime=W?T.lastTime:void 0,T.startTime=qu(),T.done=!1,T.animatedStyles.clear()}),Xn(p,S)&&_.setValue(x?R:y,!1),Ge({},h,{[S]:Ge({},b,{name:S,parent:_,interpolation:P,animatedValues:V,toValues:j,previous:$,config:M,fromValues:Ei(_.getValue()),immediate:Xn(p,S),initialVelocity:_n(M.velocity,0),clamp:_n(M.clamp,!1),precision:_n(M.precision,.01),tension:_n(M.tension,170),friction:_n(M.friction,26),mass:_n(M.mass,1),duration:M.duration,easing:_n(M.easing,T=>T),decay:M.decay})})}else return D?h:(x&&(_.setValue(1,!1),P.updateConfig({output:[$,$]})),_.done=!0,this.hasChanged=!0,Ge({},h,{[S]:Ge({},h[S],{previous:$})}))},this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let h in this.animations)this.interpolations[h]=this.animations[h].interpolation,this.values[h]=this.animations[h].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const $v=(t,e)=>{const n=u.useRef(!1),r=u.useRef(),i=he.fun(e),o=u.useMemo(()=>{r.current&&(r.current.map(d=>d.destroy()),r.current=void 0);let f;return[new Array(t).fill().map((d,p)=>{const v=new zv,g=i?Xn(e,p,v):e[p];return p===0&&(f=g.ref),v.update(g),f||v.start(),v}),f]},[t]),s=o[0],a=o[1];r.current=s,u.useImperativeHandle(a,()=>({start:()=>Promise.all(r.current.map(f=>new Promise(d=>f.start(d)))),stop:f=>r.current.forEach(d=>d.stop(f)),get controllers(){return r.current}}));const l=u.useMemo(()=>f=>r.current.map((d,p)=>{d.update(i?Xn(f,p,d):f[p]),a||d.start()}),[t]);u.useEffect(()=>{n.current?i||l(e):a||r.current.forEach(f=>f.start())}),u.useEffect(()=>(n.current=!0,()=>r.current.forEach(f=>f.destroy())),[]);const c=r.current.map(f=>f.getValues());return i?[c,l,f=>r.current.forEach(d=>d.pause(f))]:c},Hv=t=>{const e=he.fun(t),n=$v(1,e?t:[t]),r=n[0],i=n[1],o=n[2];return e?[r[0],i,o]:r};class Gv extends Gu{constructor(e){e===void 0&&(e={}),super(),e.transform&&!(e.transform instanceof Tt)&&(e=pa.transform(e)),this.payload=e}}const mo={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},At="[-+]?\\d*\\.?\\d+",yo=At+"%";function Ao(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Wv=new RegExp("rgb"+Ao(At,At,At)),Zv=new RegExp("rgba"+Ao(At,At,At,At)),qv=new RegExp("hsl"+Ao(At,yo,yo)),Kv=new RegExp("hsla"+Ao(At,yo,yo,At)),Jv=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Yv=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Xv=/^#([0-9a-fA-F]{6})$/,Qv=/^#([0-9a-fA-F]{8})$/;function em(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=Xv.exec(t))?parseInt(e[1]+"ff",16)>>>0:mo.hasOwnProperty(t)?mo[t]:(e=Wv.exec(t))?(Zn(e[1])<<24|Zn(e[2])<<16|Zn(e[3])<<8|255)>>>0:(e=Zv.exec(t))?(Zn(e[1])<<24|Zn(e[2])<<16|Zn(e[3])<<8|il(e[4]))>>>0:(e=Jv.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=Qv.exec(t))?parseInt(e[1],16)>>>0:(e=Yv.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=qv.exec(t))?(nl(rl(e[1]),xi(e[2]),xi(e[3]))|255)>>>0:(e=Kv.exec(t))?(nl(rl(e[1]),xi(e[2]),xi(e[3]))|il(e[4]))>>>0:null}function es(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function nl(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=es(i,r,t+1/3),s=es(i,r,t),a=es(i,r,t-1/3);return Math.round(o*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function Zn(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function rl(t){return(parseFloat(t)%360+360)%360/360}function il(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function xi(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function ol(t){let e=em(t);if(e===null)return t;e=e||0;let n=(e&4278190080)>>>24,r=(e&16711680)>>>16,i=(e&65280)>>>8,o=(e&255)/255;return`rgba(${n}, ${r}, ${i}, ${o})`}const Ci=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,tm=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,nm=new RegExp(`(${Object.keys(mo).join("|")})`,"g"),rm=t=>{const e=t.output.map(i=>i.replace(tm,ol)).map(i=>i.replace(nm,ol)),n=e[0].match(Ci).map(()=>[]);e.forEach(i=>{i.match(Ci).forEach((o,s)=>n[s].push(+o))});const r=e[0].match(Ci).map((i,o)=>vo(Ge({},t,{output:n[o]})));return i=>{let o=0;return e[0].replace(Ci,()=>r[o++](i)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(s,a,l,c,f)=>`rgba(${Math.round(a)}, ${Math.round(l)}, ${Math.round(c)}, ${f})`)}};let Hr={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const im=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),om=["Webkit","Ms","Moz","O"];Hr=Object.keys(Hr).reduce((t,e)=>(om.forEach(n=>t[im(n,e)]=t[e]),t),Hr);function sm(t,e,n){return e==null||typeof e=="boolean"||e===""?"":!n&&typeof e=="number"&&e!==0&&!(Hr.hasOwnProperty(t)&&Hr[t])?e+"px":(""+e).trim()}const sl={};Rv(t=>new Gv(t));Pv(rm);Mv(mo);Ov((t,e)=>{if(t.nodeType&&t.setAttribute!==void 0){const i=e.style,o=e.children,s=e.scrollTop,a=e.scrollLeft,l=tr(e,["style","children","scrollTop","scrollLeft"]),c=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter";s!==void 0&&(t.scrollTop=s),a!==void 0&&(t.scrollLeft=a),o!==void 0&&(t.textContent=o);for(let f in i)if(i.hasOwnProperty(f)){var n=f.indexOf("--")===0,r=sm(f,i[f],n);f==="float"&&(f="cssFloat"),n?t.style.setProperty(f,r):t.style[f]=r}for(let f in l){const d=c?f:sl[f]||(sl[f]=f.replace(/([A-Z])/g,p=>"-"+p.toLowerCase()));typeof t.getAttribute(d)<"u"&&t.setAttribute(d,l[f])}return}else return!1},t=>t);const am=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],lm=Ev(Dv,!1),cm=lm(am);function al(t,e){return t.map(function(n,r){return n+e[r]})}function Xu(t,e){return t.map(function(n,r){return n-e[r]})}function Ns(t){return Math.hypot.apply(Math,t)}function um(t,e,n){var r=Ns(e),i=r===0?0:1/r,o=n===0?0:1/n,s=o*r,a=e.map(function(f){return o*f}),l=e.map(function(f){return i*f}),c=Ns(t);return{velocities:a,velocity:s,distance:c,direction:l}}function Bs(t){return Math.sign?Math.sign(t):+(t>0)-+(t<0)||+t}function fm(t,e,n){return Math.max(e,Math.min(t,n))}function dm(t,e){return Math.pow(t,e*5)}function ll(t,e,n){return e===0||Math.abs(e)===1/0?dm(t,n):t*e*n/(e+n*t)}function Gr(t,e,n,r){return r===void 0&&(r=.15),r===0?fm(t,e,n):t<e?-ll(e-t,n-e,r)+e:t>n?+ll(t-n,n-e,r)+n:t}function cl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pm(t,e,n){return e&&cl(t.prototype,e),n&&cl(t,n),t}function dt(){return dt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},dt.apply(this,arguments)}function Qu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function hm(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function _i(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gm(t,e){if(t){if(typeof t=="string")return ul(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ul(t,e)}}function ul(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Do(t,e){var n;if(typeof Symbol>"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(n=gm(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
38
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=t[Symbol.iterator](),n.next.bind(n)}function ef(){}function tf(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.length===0?ef:e.length===1?e[0]:function(){for(var r,i=Do(e),o;!(o=i()).done;){var s=o.value;r=s.apply(this,arguments)||r}return r}}function hn(t,e){if(t===void 0){if(e===void 0)throw new Error("Must define fallback value if undefined is expected");t=e}return Array.isArray(t)?t:[t,t]}function Oi(t){if(typeof t=="function"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,n)}else return t}function ha(t,e){t===void 0&&(t={});for(var n={},r=0,i=Object.entries(e);r<i.length;r++){var o=i[r],s=o[0],a=o[1];switch(typeof a){case"function":n[s]=a.call(n,t[s],s,t);break;case"object":n[s]=ha(t[s],a);break;case"boolean":a&&(n[s]=t[s]);break}}return n}var vm=180,mm=.15,ym=.5,bm=60,wm={threshold:function(e){return e===void 0&&(e=0),hn(e)},rubberband:function(e){switch(e===void 0&&(e=0),e){case!0:return hn(mm);case!1:return hn(0);default:return hn(e)}},enabled:function(e){return e===void 0&&(e=!0),e},triggerAllEvents:function(e){return e===void 0&&(e=!1),e},initial:function(e){return e===void 0&&(e=0),typeof e=="function"?e:hn(e)}},nf=dt({},wm,{axis:!0,lockDirection:function(e){return e===void 0&&(e=!1),e},bounds:function(e){if(e===void 0&&(e={}),typeof e=="function")return function(d){return nf.bounds(e(d))};var n=e,r=n.left,i=r===void 0?-1/0:r,o=n.right,s=o===void 0?1/0:o,a=n.top,l=a===void 0?-1/0:a,c=n.bottom,f=c===void 0?1/0:c;return[[i,s],[l,f]]}}),Sm=typeof window<"u"&&window.document&&window.document.createElement,Lm={enabled:function(e){return e===void 0&&(e=!0),e},domTarget:!0,window:function(t){function e(n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return t===void 0&&(t=Sm?window:void 0),t}),eventOptions:function(e){var n=e===void 0?{}:e,r=n.passive,i=r===void 0?!0:r,o=n.capture,s=o===void 0?!1:o;return{passive:i,capture:s}}},Em=dt({},nf,{threshold:function(e,n,r){var i=r.filterTaps,o=i===void 0?!1:i,s=r.lockDirection,a=s===void 0?!1:s,l=r.axis,c=l===void 0?void 0:l,f=hn(e,o?3:a||c?1:0);return this.filterTaps=o||f[0]+f[1]>0,f},swipeVelocity:function(e){return e===void 0&&(e=ym),hn(e)},swipeDistance:function(e){return e===void 0&&(e=bm),hn(e)},delay:function(e){switch(e===void 0&&(e=0),e){case!0:return vm;case!1:return 0;default:return e}}});function xm(t){return t===void 0&&(t={}),ha(t,Lm)}function Cm(t){return t===void 0&&(t={}),ha(t,Em)}function _m(t){var e=t.domTarget,n=t.eventOptions,r=t.window,i=t.enabled,o=hm(t,["domTarget","eventOptions","window","enabled"]),s=xm({domTarget:e,eventOptions:n,window:r,enabled:i});return s.drag=Cm(o),s}function Cr(t){return dt({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:ef,canceled:!1,memo:void 0,args:void 0},t)}function rf(){var t={hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},e=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),n=Cr({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),r=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),i=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),o=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0});return{shared:t,drag:e,pinch:n,wheel:r,move:i,scroll:o}}var Pn=new Map,Om=function(){function t(n,r){var i=this;r===void 0&&(r=[]),this.controller=n,this.args=r,this.debounced=!0,this.setTimeout=function(o,s){var a;s===void 0&&(s=140),clearTimeout(i.controller.timeouts[i.stateKey]);for(var l=arguments.length,c=new Array(l>2?l-2:0),f=2;f<l;f++)c[f-2]=arguments[f];i.controller.timeouts[i.stateKey]=(a=window).setTimeout.apply(a,[o,s].concat(c))},this.clearTimeout=function(){clearTimeout(i.controller.timeouts[i.stateKey])},this.fireGestureHandler=function(o){if(o===void 0&&(o=!1),i.state._blocked)return i.debounced||(i.state._active=!1,i.clean()),null;if(!o&&!i.state.intentional&&!i.config.triggerAllEvents)return null;if(i.state.intentional){var s=i.state.active,a=i.state._active;i.state.active=a,i.state.first=a&&!s,i.state.last=s&&!a,i.controller.state.shared[i.ingKey]=a}var l=dt({},i.controller.state.shared,i.state,i.mapStateValues(i.state)),c=i.handler(l);return i.state.memo=c!==void 0?c:i.state.memo,i.state._active||i.clean(),l}}var e=t.prototype;return e.updateSharedState=function(r){Object.assign(this.controller.state.shared,r)},e.updateGestureState=function(r){Object.assign(this.state,r)},e.checkIntentionality=function(r,i){return{_intentional:r,_blocked:!1}},e.getMovement=function(r){var i=this.config,o=i.initial,s=i.bounds,a=i.rubberband,l=i.threshold,c=this.state,f=c._bounds,d=c._initial,p=c._active,v=c._intentional,g=c.lastOffset,h=c.movement,w=this.getInternalMovement(r,this.state),S=v[0]===!1?fl(w[0],l[0]):v[0],y=v[1]===!1?fl(w[1],l[1]):v[1],b=this.checkIntentionality([S,y],w);if(b._blocked)return dt({},b,{_movement:w,delta:[0,0]});var O=b._intentional,L=w,m,x;if(O[0]!==!1&&v[0]===!1&&(x=Oi(o,this.state),m=Oi(s,this.state),d[0]=x[0],f[0]=m[0]),O[1]!==!1&&v[1]===!1){var C,R;x=(C=x)!=null?C:Oi(o,this.state),m=(R=m)!=null?R:Oi(s,this.state),d[1]=x[1],f[1]=m[1]}var M=[O[0]!==!1?w[0]-O[0]:d[0],O[1]!==!1?w[1]-O[1]:d[1]],_=al(M,g),P=p?a:[0,0];return M=dl(f,al(M,d),P),dt({},b,{intentional:O[0]!==!1||O[1]!==!1,_initial:d,_movement:L,movement:M,values:r,offset:dl(f,_,P),delta:Xu(M,h)})},e.clean=function(){this.clearTimeout()},pm(t,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),t}();function fl(t,e){return Math.abs(t)>=e?Bs(t)*e:!1}function dl(t,e,n){var r=e[0],i=e[1],o=n[0],s=n[1],a=t[0],l=a[0],c=a[1],f=t[1],d=f[0],p=f[1];return[Gr(r,l,c,o),Gr(i,d,p,s)]}function ts(t,e,n){var r=t.state,i=t.args,o=e.timeStamp,s=e.type,a=r.values,l=n?0:o-r.startTime;return{_lastEventType:s,event:e,timeStamp:o,elapsedTime:l,args:i,previous:a}}function Mm(t,e,n){var r=t.state.offset,i=n.timeStamp;return dt({},rf()[t.stateKey],{_active:!0,values:e,initial:e,offset:r,lastOffset:r,startTime:i})}function Pm(t,e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.call.apply(t,[this,dt({},e,{event:n})].concat(i))}}var km=function(e){var n=this;this.classes=e,this.bind=function(){for(var r={},i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];for(var a=Do(n.classes),l;!(l=a()).done;){var c=l.value;new c(n,o).addBindings(r)}for(var f=0,d=Object.entries(n.nativeRefs);f<d.length;f++){var p=d[f],v=p[0],g=p[1];Us(r,v,Pm(g,dt({},n.state.shared,{args:o})))}return n.config.domTarget?Dm(n,r):Im(n,r)},this.effect=function(){return n.config.domTarget&&n.bind(),n.clean},this.clean=function(){var r=sf(n.config),i=n.config.eventOptions;r&&ci(r,of(n.domListeners),i),Object.values(n.timeouts).forEach(clearTimeout),Rm(n)},this.state=rf(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function Rm(t){var e=t.config,n=e.window,r=e.eventOptions,i=t.windowListeners;if(n){for(var o in i){var s=i[o];ci(n,s,r)}t.windowListeners={}}}function Tm(t,e){var n=t.config,r=t.windowListeners;n.window&&(ci(n.window,r[e],n.eventOptions),delete r[e])}function Am(t,e,n){var r=t.config,i=t.windowListeners;n===void 0&&(n=[]),r.window&&(ci(r.window,i[e],r.eventOptions),af(r.window,i[e]=n,r.eventOptions))}function Dm(t,e){var n=t.config,r=t.domListeners,i=sf(n);if(!i)throw new Error("domTarget must be defined");var o=n.eventOptions;ci(i,of(r),o);for(var s=0,a=Object.entries(e);s<a.length;s++){var l=a[s],c=l[0],f=l[1],d=c.slice(2).toLowerCase();r.push([d,tf.apply(void 0,f)])}af(i,r,o)}function Im(t,e){for(var n=t.config,r={},i=n.eventOptions.capture?"Capture":"",o=0,s=Object.entries(e);o<s.length;o++){var a=s[o],l=a[0],c=a[1],f=Array.isArray(c)?c:[c],d=l+i;r[d]=tf.apply(void 0,f)}return r}function of(t){return t===void 0&&(t=[]),t.splice(0,t.length)}function sf(t){var e=t.domTarget;return e&&"current"in e?e.current:e}function Us(t,e,n){t[e]||(t[e]=[]),t[e].push(n)}function af(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Do(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.addEventListener(s,a,n)}}function ci(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Do(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.removeEventListener(s,a,n)}}function jm(t,e,n){n===void 0&&(n={});var r=Bm(t),i=u.useMemo(function(){return new km(r)},[]);return i.config=e,i.handlers=t,i.nativeRefs=n,u.useEffect(i.effect,[]),i.config.domTarget?Nm:i.bind}function Nm(){}function Bm(t){var e=new Set;return t.drag&&e.add(Pn.get("drag")),t.wheel&&e.add(Pn.get("wheel")),t.scroll&&e.add(Pn.get("scroll")),t.move&&e.add(Pn.get("move")),t.pinch&&e.add(Pn.get("pinch")),t.hover&&e.add(Pn.get("hover")),e}var Um=function(t){Qu(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.getInternalMovement=function(i,o){return Xu(i,o.initial)},n.checkIntentionality=function(i,o){if(i[0]===!1&&i[1]===!1)return{_intentional:i,axis:this.state.axis};var s=o.map(Math.abs),a=s[0],l=s[1],c=this.state.axis||(a>l?"x":a<l?"y":void 0);return!this.config.axis&&!this.config.lockDirection?{_intentional:i,_blocked:!1,axis:c}:c?this.config.axis&&c!==this.config.axis?{_intentional:i,_blocked:!0,axis:c}:(i[c==="x"?1:0]=!1,{_intentional:i,_blocked:!1,axis:c}):{_intentional:[!1,!1],_blocked:!1,axis:c}},n.getKinematics=function(i,o){var s=this.getMovement(i);if(!s._blocked){var a=o.timeStamp-this.state.timeStamp;Object.assign(s,um(s.movement,s.delta,a))}return s},n.mapStateValues=function(i){return{xy:i.values,vxvy:i.velocities}},e}(Om);function lf(t){if("touches"in t){var e=t.targetTouches,n=t.changedTouches;return e.length>0?e:n}return null}function pl(t){var e="buttons"in t?t.buttons:0,n=lf(t),r=n&&n.length||0,i=r>0||e>0,o=t.shiftKey,s=t.altKey,a=t.metaKey,l=t.ctrlKey;return{touches:r,down:i,buttons:e,shiftKey:o,altKey:s,metaKey:a,ctrlKey:l}}function hl(t){var e=lf(t),n=e?e[0]:t,r=n.clientX,i=n.clientY;return[r,i]}var Vm=3,Fm=220,zm=function(t){Qu(e,t);function e(){var r;return r=t.apply(this,arguments)||this,r.ingKey="dragging",r.stateKey="drag",r.onDragStart=function(i){!r.enabled||r.state._active||(Am(r.controller,r.stateKey,[["pointermove",r.onDragChange],["pointerup",r.onDragEnd],["pointercancel",r.onDragEnd]]),r.updateGestureState({_pointerId:i.pointerId}),r.config.delay>0?(r.state._delayedEvent=!0,"persist"in i&&typeof i.persist=="function"&&i.persist(),r.setTimeout(r.startDrag.bind(_i(r)),r.config.delay,i)):r.startDrag(i))},r.onDragChange=function(i){if(!r.state.canceled&&i.pointerId===r.state._pointerId){if(!r.state._active){r.state._delayedEvent&&(r.clearTimeout(),r.startDrag(i));return}var o=pl(i);if(!o.down){r.onDragEnd(i);return}r.updateSharedState(o);var s=hl(i),a=r.getKinematics(s,i),l=ts(_i(r),i),c=r.state._isTap,f=Ns(a._movement);c&&f>=Vm&&(c=!1),r.updateGestureState(dt({},l,a,{_isTap:c})),r.fireGestureHandler()}},r.onDragEnd=function(i){if(i.pointerId===r.state._pointerId){r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0});var o=r.state._isTap,s=r.state.velocities,a=s[0],l=s[1],c=r.state.movement,f=c[0],d=c[1],p=r.state._intentional,v=p[0],g=p[1],h=r.config.swipeVelocity,w=h[0],S=h[1],y=r.config.swipeDistance,b=y[0],O=y[1],L=dt({},ts(_i(r),i),r.getMovement(r.state.values)),m=[0,0];L.elapsedTime<Fm&&(v!==!1&&Math.abs(a)>w&&Math.abs(f)>b&&(m[0]=Bs(a)),g!==!1&&Math.abs(l)>S&&Math.abs(d)>O&&(m[1]=Bs(l))),r.updateGestureState(dt({},L,{tap:o,swipe:m})),r.fireGestureHandler(o===!0)}},r.clean=function(){t.prototype.clean.call(_i(r)),r.state._delayedEvent=!1,Tm(r.controller,r.stateKey)},r.onCancel=function(){r.state.canceled||(r.updateGestureState({canceled:!0}),r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame(function(){return r.fireGestureHandler()}))},r.onClick=function(i){r.state._isTap||i.stopPropagation()},r}var n=e.prototype;return n.startDrag=function(i){var o=hl(i);this.updateSharedState(pl(i)),this.updateGestureState(dt({},Mm(this,o,i),ts(this,i,!0),{_pointerId:i.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(o)),this.fireGestureHandler()},n.addBindings=function(i){if(Us(i,"onPointerDown",this.onDragStart),this.config.filterTaps){var o=this.controller.config.eventOptions.capture?"onClick":"onClickCapture";Us(i,o,this.onClick)}},e}(Um);function $m(t,e){var n,r=[],i,o=!1;function s(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return o&&n===this&&e(l,r)||(i=t.apply(this,l),o=!0,n=this,r=l),i}return s}function Ji(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ji(t[r],e[r]))return!1;return!0}var o;if(typeof Map=="function"&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=t.entries();!(r=o.next()).done;)if(!Ji(r.value[1],e.get(r.value[0])))return!1;return!0}if(typeof Set=="function"&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(typeof Element<"u"&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!(i[r]==="_owner"&&t.$$typeof)&&!Ji(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}function Hm(t,e){try{return Ji(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}function Gm(t,e){e===void 0&&(e={}),Pn.set("drag",zm);var n=u.useRef();return n.current||(n.current=$m(_m,Hm)),jm({drag:t},n.current(e))}/*!
|
|
34
|
+
***************************************************************************** */var H=function(){return H=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},H.apply(this,arguments)};function ca(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function me(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _e(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Ue(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var De;(function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"})(De||(De={}));var sr;(function(t){t.Parent="#_parent",t.Internal="#_internal"})(sr||(sr={}));var Ms=De.Start,ua=De.Stop,li=De.Raise,Ro=De.Send,ku=De.Cancel,Eg=De.NullEvent,fa=De.Assign;De.After;De.DoneState;var Ru=De.Log,xg=De.Init,Ps=De.Invoke;De.ErrorExecution;var qa=De.ErrorPlatform,Cg=De.ErrorCustom,Tu=De.Update,_g=De.Choose,Og=De.Pure,Au=".",Ka={},ks="xstate.guard",Mg="",yi;function da(t,e,n){n===void 0&&(n=Au);var r=Vr(t,n),i=Vr(e,n);return ke(i)?ke(r)?i===r:!1:ke(r)?r in i:Object.keys(r).every(function(o){return o in i?da(r[o],i[o]):!1})}function Du(t){try{return ke(t)||typeof t=="number"?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function Rs(t,e){try{return pr(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function Pg(t){return typeof t=="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function Vr(t,e){if(Pg(t))return t.value;if(pr(t))return uo(t);if(typeof t!="string")return t;var n=Rs(t,e);return uo(n)}function uo(t){if(t.length===1)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function Ir(t,e){for(var n={},r=Object.keys(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function Ja(t,e,n){var r,i,o={};try{for(var s=me(Object.keys(t)),a=s.next();!a.done;a=s.next()){var l=a.value,c=t[l];n(c)&&(o[l]=e(c,l,t))}}catch(f){r={error:f}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}var kg=function(t){return function(e){var n,r,i=e;try{for(var o=me(t),s=o.next();!s.done;s=o.next()){var a=s.value;i=i[a]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function Rg(t,e){return function(n){var r,i,o=n;try{for(var s=me(t),a=s.next();!a.done;a=s.next()){var l=a.value;o=o[e][l]}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}}function Wi(t){if(!t)return[[]];if(ke(t))return[[t]];var e=He(Object.keys(t).map(function(n){var r=t[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Wi(t[n]).map(function(i){return[n].concat(i)})}));return e}function He(t){var e;return(e=[]).concat.apply(e,Ue([],_e(t),!1))}function Iu(t){return pr(t)?t:[t]}function kt(t){return t===void 0?[]:Iu(t)}function fo(t,e,n){var r,i;if(Oe(t))return t(e,n.data);var o={};try{for(var s=me(Object.keys(t)),a=s.next();!a.done;a=s.next()){var l=a.value,c=t[l];Oe(c)?o[l]=c(e,n.data):o[l]=c}}catch(f){r={error:f}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function Tg(t){return/^(done|error)\./.test(t)}function Ya(t){return!!(t instanceof Promise||t!==null&&(Oe(t)||typeof t=="object")&&Oe(t.then))}function Ag(t){return t!==null&&typeof t=="object"&&"transition"in t&&typeof t.transition=="function"}function Dg(t,e){var n,r,i=_e([[],[]],2),o=i[0],s=i[1];try{for(var a=me(t),l=a.next();!l.done;l=a.next()){var c=l.value;e(c)?o.push(c):s.push(c)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}function ju(t,e){return Ir(t.states,function(n,r){if(n){var i=(ke(e)?void 0:e[r])||(n?n.current:void 0);if(i)return{current:i,states:ju(n,i)}}})}function Ig(t,e){return{current:e,states:ju(t,e)}}function Xa(t,e,n,r){var i=t&&n.reduce(function(o,s){var a,l,c=s.assignment,f={state:r,action:s,_event:e},d={};if(Oe(c))d=c(o,e.data,f);else try{for(var p=me(Object.keys(c)),m=p.next();!m.done;m=p.next()){var g=m.value,h=c[g];d[g]=Oe(h)?h(o,e.data,f):h}}catch(S){a={error:S}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}return Object.assign({},o,d)},t);return i}var jg=function(){};function pr(t){return Array.isArray(t)}function Oe(t){return typeof t=="function"}function ke(t){return typeof t=="string"}function Nu(t,e){if(t)return ke(t)?{type:ks,name:t,predicate:e?e[t]:void 0}:Oe(t)?{type:ks,name:t.name,predicate:t}:t}function Ng(t){try{return"subscribe"in t&&Oe(t.subscribe)}catch{return!1}}var dn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();yi={},yi[dn]=function(){return this},yi[Symbol.observable]=function(){return this};function ar(t){return!!t&&"__xstatenode"in t}function Bg(t){return!!t&&typeof t.send=="function"}function To(t,e){return ke(t)||typeof t=="number"?H({type:t},e):t}function ot(t,e){if(!ke(t)&&"$$type"in t&&t.$$type==="scxml")return t;var n=To(t);return H({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function $n(t,e){var n=Iu(e).map(function(r){return typeof r>"u"||typeof r=="string"||ar(r)?{target:r,event:t}:H(H({},r),{event:t})});return n}function Ug(t){if(!(t===void 0||t===Mg))return kt(t)}function Bu(t,e,n,r,i){var o=t.options.guards,s={state:i,cond:e,_event:r};if(e.type===ks)return((o==null?void 0:o[e.name])||e.predicate)(n,r.data,s);var a=o==null?void 0:o[e.type];if(!a)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return a(n,r.data,s)}function Uu(t){return typeof t=="string"?{type:t}:t}function Zi(t,e,n){var r=function(){},i=typeof t=="object",o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function bi(t,e){return"".concat(t,":invocation[").concat(e,"]")}function Ts(t){return(t.type===li||t.type===Ro&&t.to===sr.Internal)&&typeof t.delay!="number"}var er=ot({type:xg});function As(t,e){return e&&e[t]||void 0}function ni(t,e){var n;if(ke(t)||typeof t=="number"){var r=As(t,e);Oe(r)?n={type:t,exec:r}:r?n=r:n={type:t,exec:void 0}}else if(Oe(t))n={type:t.name||t.toString(),exec:t};else{var r=As(t.type,e);if(Oe(r))n=H(H({},t),{exec:r});else if(r){var i=r.type||t.type;n=H(H(H({},r),t),{type:i})}else n=t}return n}var pn=function(t,e){if(!t)return[];var n=pr(t)?t:[t];return n.map(function(r){return ni(r,e)})};function pa(t){var e=ni(t);return H(H({id:ke(t)?t:e.id},e),{type:e.type})}function Vg(t,e){return{type:li,event:typeof t=="function"?t:To(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function Fg(t,e,n,r){var i={_event:n},o=ot(Oe(t.event)?t.event(e,n.data,i):t.event),s;if(ke(t.delay)){var a=r&&r[t.delay];s=Oe(a)?a(e,n.data,i):a}else s=Oe(t.delay)?t.delay(e,n.data,i):t.delay;return H(H({},t),{type:li,_event:o,delay:s})}function zg(t,e){return{to:e?e.to:void 0,type:Ro,event:Oe(t)?t:To(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:Oe(t)?t.name:Du(t)}}function $g(t,e,n,r){var i={_event:n},o=ot(Oe(t.event)?t.event(e,n.data,i):t.event),s;if(ke(t.delay)){var a=r&&r[t.delay];s=Oe(a)?a(e,n.data,i):a}else s=Oe(t.delay)?t.delay(e,n.data,i):t.delay;var l=Oe(t.to)?t.to(e,n.data,i):t.to;return H(H({},t),{to:l,_event:o,event:o.data,delay:s})}var Hg=function(t,e,n){return H(H({},t),{value:ke(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})},Gg=function(t){return{type:ku,sendId:t}};function Wg(t){var e=pa(t);return{type:De.Start,activity:e,exec:void 0}}function Zg(t){var e=Oe(t)?t:pa(t);return{type:De.Stop,activity:e,exec:void 0}}function qg(t,e,n){var r=Oe(t.activity)?t.activity(e,n.data):t.activity,i=typeof r=="string"?{id:r}:r,o={type:De.Stop,activity:i};return o}var Kg=function(t){return{type:fa,assignment:t}};function Jg(t,e){var n=e?"#".concat(e):"";return"".concat(De.After,"(").concat(t,")").concat(n)}function wi(t,e){var n="".concat(De.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function qi(t,e){var n="".concat(De.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function jr(t,e){var n="".concat(De.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}var Yg=function(t){var e,n,r=[];try{for(var i=me(t),o=i.next();!o.done;o=i.next())for(var s=o.value,a=0;a<s.actions.length;){if(s.actions[a].type===fa){r.push(s.actions[a]),s.actions.splice(a,1);continue}a++}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r};function po(t,e,n,r,i,o,s){s===void 0&&(s=!1);var a=s?[]:Yg(i),l=a.length?Xa(n,r,a,e):n,c=s?[n]:void 0,f=[];function d(g,h){var S;switch(h.type){case li:{var w=Fg(h,l,r,t.options.delays);return o&&typeof w.delay=="number"&&o(w,l,r),w}case Ro:var y=$g(h,l,r,t.options.delays);return o&&y.to!==sr.Internal&&(g==="entry"?f.push(y):o(y,l,r)),y;case Ru:{var b=Hg(h,l,r);return o==null||o(b,l,r),b}case _g:{var _=h,E=(S=_.conds.find(function(G){var z=Nu(G.cond,t.options.guards);return!z||Bu(t,z,l,r,o?void 0:e)}))===null||S===void 0?void 0:S.actions;if(!E)return[];var v=_e(po(t,e,l,r,[{type:g,actions:pn(kt(E),t.options.actions)}],o,s),2),L=v[0],C=v[1];return l=C,c==null||c.push(l),L}case Og:{var E=h.get(l,r.data);if(!E)return[];var k=_e(po(t,e,l,r,[{type:g,actions:pn(kt(E),t.options.actions)}],o,s),2),M=k[0],O=k[1];return l=O,c==null||c.push(l),M}case ua:{var b=qg(h,l,r);return o==null||o(b,n,r),b}case fa:{l=Xa(l,r,[h],o?void 0:e),c==null||c.push(l);break}default:var P=ni(h,t.options.actions),j=P.exec;if(o)o(P,l,r);else if(j&&c){var U=c.length-1,$=H(H({},P),{exec:function(G){for(var z=[],W=1;W<arguments.length;W++)z[W-1]=arguments[W];j.apply(void 0,Ue([c[U]],_e(z),!1))}});P=$}return P}}function p(g){var h,S,w=[];try{for(var y=me(g.actions),b=y.next();!b.done;b=y.next()){var _=b.value,E=d(g.type,_);E&&(w=w.concat(E))}}catch(v){h={error:v}}finally{try{b&&!b.done&&(S=y.return)&&S.call(y)}finally{if(h)throw h.error}}return f.forEach(function(v){o(v,l,r)}),f.length=0,w}var m=He(i.map(p));return[m,l]}var Qa=[],Jn=function(t,e){Qa.push(t);var n=e(t);return Qa.pop(),n};function Vu(t){var e;return e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}},e[dn]=function(){return this},e}function Xg(t,e,n,r){var i,o=Uu(t.src),s=(i=e==null?void 0:e.options.services)===null||i===void 0?void 0:i[o.type],a=t.data?fo(t.data,n,r):void 0,l=s?Fu(s,t.id,a):Vu(t.id);return l.meta=t,l}function Fu(t,e,n){var r=Vu(e);if(r.deferred=!0,ar(t)){var i=r.state=Jn(void 0,function(){return(n?t.withContext(n):t).initialState});r.getSnapshot=function(){return i}}return r}function Qg(t){try{return typeof t.send=="function"}catch{return!1}}function ev(t){return Qg(t)&&"id"in t}function tv(t){var e;return H((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e[dn]=function(){return this},e),t)}var ho=function(t){return t.type==="atomic"||t.type==="final"};function zu(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function ri(t){return zu(t).filter(function(e){return e.type!=="history"})}function $u(t){var e=[t];return ho(t)?e:e.concat(He(ri(t).map($u)))}function Nr(t,e){var n,r,i,o,s,a,l,c,f=new Set(t),d=Ds(f),p=new Set(e);try{for(var m=me(p),g=m.next();!g.done;g=m.next())for(var h=g.value,S=h.parent;S&&!p.has(S);)p.add(S),S=S.parent}catch(k){n={error:k}}finally{try{g&&!g.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}var w=Ds(p);try{for(var y=me(p),b=y.next();!b.done;b=y.next()){var h=b.value;if(h.type==="compound"&&(!w.get(h)||!w.get(h).length))d.get(h)?d.get(h).forEach(function(M){return p.add(M)}):h.initialStateNodes.forEach(function(M){return p.add(M)});else if(h.type==="parallel")try{for(var _=(s=void 0,me(ri(h))),E=_.next();!E.done;E=_.next()){var v=E.value;p.has(v)||(p.add(v),d.get(v)?d.get(v).forEach(function(M){return p.add(M)}):v.initialStateNodes.forEach(function(M){return p.add(M)}))}}catch(M){s={error:M}}finally{try{E&&!E.done&&(a=_.return)&&a.call(_)}finally{if(s)throw s.error}}}}catch(k){i={error:k}}finally{try{b&&!b.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}try{for(var L=me(p),C=L.next();!C.done;C=L.next())for(var h=C.value,S=h.parent;S&&!p.has(S);)p.add(S),S=S.parent}catch(k){l={error:k}}finally{try{C&&!C.done&&(c=L.return)&&c.call(L)}finally{if(l)throw l.error}}return p}function Hu(t,e){var n=e.get(t);if(!n)return{};if(t.type==="compound"){var r=n[0];if(r){if(ho(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=Hu(o,e)}),i}function Ds(t){var e,n,r=new Map;try{for(var i=me(t),o=i.next();!o.done;o=i.next()){var s=o.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function nv(t,e){var n=Nr([t],e);return Hu(t,Ds(n))}function Br(t,e){return Array.isArray(t)?t.some(function(n){return n===e}):t instanceof Set?t.has(e):!1}function rv(t){return Ue([],_e(new Set(He(Ue([],_e(t.map(function(e){return e.ownEvents})),!1)))),!1)}function Ki(t,e){return e.type==="compound"?ri(e).some(function(n){return n.type==="final"&&Br(t,n)}):e.type==="parallel"?ri(e).every(function(n){return Ki(t,n)}):!1}function iv(t){return t===void 0&&(t=[]),t.reduce(function(e,n){return n.meta!==void 0&&(e[n.id]=n.meta),e},{})}function el(t){return new Set(He(t.map(function(e){return e.tags})))}function Gu(t,e){if(t===e)return!0;if(t===void 0||e===void 0)return!1;if(ke(t)||ke(e))return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(i){return Gu(t[i],e[i])})}function ov(t){return typeof t!="object"||t===null?!1:"value"in t&&"_event"in t}function sv(t,e){var n=t.exec,r=H(H({},t),{exec:n!==void 0?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0});return r}var Lt=function(){function t(e){var n=this,r;this.actions=[],this.activities=Ka,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||Ka,this.meta=iv(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=(r=Array.isArray(e.tags)?new Set(e.tags):e.tags)!==null&&r!==void 0?r:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return rv(n.configuration)}})}return t.from=function(e,n){if(e instanceof t)return e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e;var r=er;return new t({value:e,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var r=er;return new t({value:e.value,context:n,_event:r,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(e,n){var r=this;if(e===void 0&&(e=this.value),n===void 0&&(n="."),ke(e))return[e];var i=Object.keys(e);return i.concat.apply(i,Ue([],_e(i.map(function(o){return r.toStrings(e[o],n).map(function(s){return o+n+s})})),!1))},t.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var n=e.tags;e.machine;var r=ca(e,["configuration","transitions","tags","machine"]);return H(H({},r),{tags:Array.from(n)})},t.prototype.matches=function(e){return da(e,this.value)},t.prototype.hasTag=function(e){return this.tags.has(e)},t.prototype.can=function(e){var n;jg(!!this.machine);var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,e);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},t}(),av={deferEvents:!1},tl=function(){function t(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=H(H({},av),e)}return t.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents){this.schedule(e);return}this.process(e)}this.flushEvents()},t.prototype.schedule=function(e){if(!this.initialized||this.processingEvent){this.queue.push(e);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},t.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},t}(),Qo=new Map,lv=0,Er={bookId:function(){return"x:".concat(lv++)},register:function(t,e){return Qo.set(t,e),t},get:function(t){return Qo.get(t)},free:function(t){Qo.delete(t)}};function ha(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function cv(){var t=ha();if(t&&"__xstate__"in t)return t.__xstate__}function uv(t){if(ha()){var e=cv();e&&e.register(t)}}function fv(t,e){e===void 0&&(e={});var n=t.initialState,r=new Set,i=[],o=!1,s=function(){if(!o){for(o=!0;i.length>0;){var c=i.shift();n=t.transition(n,c,l),r.forEach(function(f){return f.next(n)})}o=!1}},a=tv({id:e.id,send:function(c){i.push(c),s()},getSnapshot:function(){return n},subscribe:function(c,f,d){var p=Zi(c,f,d);return r.add(p),p.next(n),{unsubscribe:function(){r.delete(p)}}}}),l={parent:e.parent,self:a,id:e.id||"anonymous",observers:r};return n=t.start?t.start(l):n,a}var dv={sync:!1,autoForward:!1},et;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(et||(et={}));var pv=function(){function t(e,n){n===void 0&&(n=t.defaultOptions);var r=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=et.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(f,d){if(pr(f))return r.batch(f),r.state;var p=ot(To(f,d));if(r.status===et.Stopped)return r.state;if(r.status!==et.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(p.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
35
|
+
Event: `).concat(JSON.stringify(p.data)));return r.scheduler.schedule(function(){r.forward(p);var m=r._nextState(p);r.update(m,p)}),r._state},this.sendTo=function(f,d,p){var m=r.parent&&(d===sr.Parent||r.parent.id===d),g=m?r.parent:ke(d)?d===sr.Internal?r:r.children.get(d)||Er.get(d):Bg(d)?d:void 0;if(!g){if(!m)throw new Error("Unable to send event to child '".concat(d,"' from service '").concat(r.id,"'."));return}if("machine"in g){if(r.status!==et.Stopped||r.parent!==g||r.state.done){var h=H(H({},f),{name:f.name===Cg?"".concat(jr(r.id)):f.name,origin:r.sessionId});!p&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([g,h]):g.send(h)}}else!p&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([g,f.data]):g.send(f.data)},this._exec=function(f,d,p,m){m===void 0&&(m=r.machine.options.actions);var g=f.exec||As(f.type,m),h=Oe(g)?g:g?g.exec:f.exec;if(h)try{return h(d,p.data,r.machine.config.predictableActionArguments?{action:f,_event:p}:{action:f,state:r.state,_event:p})}catch(U){throw r.parent&&r.parent.send({type:"xstate.error",data:U}),U}switch(f.type){case li:{var S=f;r.defer(S);break}case Ro:var w=f;if(typeof w.delay=="number"){r.defer(w);return}else w.to?r.sendTo(w._event,w.to,p===er):r.send(w._event);break;case ku:r.cancel(f.sendId);break;case Ms:{if(r.status!==et.Running)return;var y=f.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[y.id||y.type])break;if(y.type===De.Invoke){var b=Uu(y.src),_=r.machine.options.services?r.machine.options.services[b.type]:void 0,E=y.id,v=y.data,L="autoForward"in y?y.autoForward:!!y.forward;if(!_)return;var C=v?fo(v,d,p):void 0;if(typeof _=="string")return;var k=Oe(_)?_(d,p.data,{data:C,src:b,meta:y.meta}):_;if(!k)return;var M=void 0;ar(k)&&(k=C?k.withContext(C):k,M={autoForward:L}),r.spawn(k,E,M)}else r.spawnActivity(y);break}case ua:{r.stopChild(f.activity.id);break}case Ru:var O=f,P=O.label,j=O.value;P?r.logger(P,j):r.logger(j);break}};var i=H(H({},t.defaultOptions),n),o=i.clock,s=i.logger,a=i.parent,l=i.id,c=l!==void 0?l:e.id;this.id=c,this.logger=s,this.clock=o,this.parent=a,this.options=i,this.scheduler=new tl({deferEvents:this.options.deferEvents}),this.sessionId=Er.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Jn(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(e,n){var r,i;try{for(var o=me(e.actions),s=o.next();!s.done;s=o.next()){var a=s.value;this.exec(a,e,n)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.update=function(e,n){var r,i,o,s,a,l,c,f,d=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||n===er)&&this.options.execute)this.execute(this.state);else for(var p=void 0;p=this._outgoingQueue.shift();)p[0].send(p[1]);if(this.children.forEach(function(k){d.state.children[k.id]=k}),this.devTools&&this.devTools.send(n.data,e),e.event)try{for(var m=me(this.eventListeners),g=m.next();!g.done;g=m.next()){var h=g.value;h(e.event)}}catch(k){r={error:k}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}try{for(var S=me(this.listeners),w=S.next();!w.done;w=S.next()){var h=w.value;h(e,e.event)}}catch(k){o={error:k}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(o)throw o.error}}try{for(var y=me(this.contextListeners),b=y.next();!b.done;b=y.next()){var _=b.value;_(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(k){a={error:k}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}if(this.state.done){var E=e.configuration.find(function(k){return k.type==="final"&&k.parent===d.machine}),v=E&&E.doneData?fo(E.doneData,e.context,n):void 0;this._doneEvent=qi(this.id,v);try{for(var L=me(this.doneListeners),C=L.next();!C.done;C=L.next()){var h=C.value;h(this._doneEvent)}}catch(k){c={error:k}}finally{try{C&&!C.done&&(f=L.return)&&f.call(L)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),Er.free(this.sessionId)}},t.prototype.onTransition=function(e){return this.listeners.add(e),this.status===et.Running&&e(this.state,this.state.event),this},t.prototype.subscribe=function(e,n,r){var i=this,o=Zi(e,n,r);this.listeners.add(o.next),this.status!==et.NotStarted&&o.next(this.state);var s=function(){i.doneListeners.delete(s),i.stopListeners.delete(s),o.complete()};return this.status===et.Stopped?o.complete():(this.onDone(s),this.onStop(s)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(s),i.stopListeners.delete(s)}}},t.prototype.onEvent=function(e){return this.eventListeners.add(e),this},t.prototype.onSend=function(e){return this.sendListeners.add(e),this},t.prototype.onChange=function(e){return this.contextListeners.add(e),this},t.prototype.onStop=function(e){return this.stopListeners.add(e),this},t.prototype.onDone=function(e){return this.status===et.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},t.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},t.prototype.start=function(e){var n=this;if(this.status===et.Running)return this;this.machine._init(),Er.register(this.sessionId,this),this.initialized=!0,this.status=et.Running;var r=e===void 0?this.initialState:Jn(this,function(){return ov(e)?n.machine.resolveState(e):n.machine.resolveState(Lt.from(e,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,er)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(e){Oe(e.stop)&&e.stop()}),this.children.clear()},t.prototype._stop=function(){var e,n,r,i,o,s,a,l,c,f;try{for(var d=me(this.listeners),p=d.next();!p.done;p=d.next()){var m=p.value;this.listeners.delete(m)}}catch(L){e={error:L}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}try{for(var g=me(this.stopListeners),h=g.next();!h.done;h=g.next()){var m=h.value;m(),this.stopListeners.delete(m)}}catch(L){r={error:L}}finally{try{h&&!h.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}try{for(var S=me(this.contextListeners),w=S.next();!w.done;w=S.next()){var m=w.value;this.contextListeners.delete(m)}}catch(L){o={error:L}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(o)throw o.error}}try{for(var y=me(this.doneListeners),b=y.next();!b.done;b=y.next()){var m=b.value;this.doneListeners.delete(m)}}catch(L){a={error:L}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=et.Stopped,this._initialState=void 0;try{for(var _=me(Object.keys(this.delayedEventsMap)),E=_.next();!E.done;E=_.next()){var v=E.value;this.clock.clearTimeout(this.delayedEventsMap[v])}}catch(L){c={error:L}}finally{try{E&&!E.done&&(f=_.return)&&f.call(_)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new tl({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var e=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r=ot({type:"xstate.stop"}),i=Jn(e,function(){var o=He(Ue([],_e(e.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return pn(f.onExit,e.machine.options.actions)})),s=_e(po(e.machine,e.state,e.state.context,r,[{type:"exit",actions:o}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),a=s[0],l=s[1],c=new Lt({value:e.state.value,context:l,_event:r,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:a.filter(function(f){return!Ts(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return c.changed=!0,c});e.update(i,r),e._stopChildren(),Er.free(e.sessionId)}),this},t.prototype.batch=function(e){var n=this;if(!(this.status===et.NotStarted&&this.options.deferEvents)){if(this.status!==et.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,s=n.state,a=!1,l=[],c=function(m){var g=ot(m);n.forward(g),s=Jn(n,function(){return n.machine.transition(s,g,void 0,r||void 0)}),l.push.apply(l,Ue([],_e(n.machine.config.predictableActionArguments?s.actions:s.actions.map(function(h){return sv(h,s)})),!1)),a=a||!!s.changed};try{for(var f=me(e),d=f.next();!d.done;d=f.next()){var p=d.value;c(p)}}catch(m){i={error:m}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}s.changed=a,s.actions=l,n.update(s,ot(e[e.length-1]))})}},t.prototype.sender=function(e){return this.send.bind(this,e)},t.prototype._nextState=function(e,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=ot(e);if(i.name.indexOf(qa)===0&&!this.state.nextEvents.some(function(s){return s.indexOf(qa)===0}))throw i.data.data;var o=Jn(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},t.prototype.nextState=function(e){return this._nextState(e,!1)},t.prototype.forward=function(e){var n,r;try{for(var i=me(this.forwardTo),o=i.next();!o.done;o=i.next()){var s=o.value,a=this.children.get(s);if(!a)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(s,"'."));a.send(e)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.defer=function(e){var n=this,r=this.clock.setTimeout(function(){"to"in e&&e.to?n.sendTo(e._event,e.to,!0):n.send(e._event)},e.delay);e.id&&(this.delayedEventsMap[e.id]=r)},t.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},t.prototype.exec=function(e,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(e,n.context,n._event,r)},t.prototype.removeChild=function(e){var n;this.children.delete(e),this.forwardTo.delete(e),(n=this.state)===null||n===void 0||delete n.children[e]},t.prototype.stopChild=function(e){var n=this.children.get(e);n&&(this.removeChild(e),Oe(n.stop)&&n.stop())},t.prototype.spawn=function(e,n,r){if(this.status!==et.Running)return Fu(e,n);if(Ya(e))return this.spawnPromise(Promise.resolve(e),n);if(Oe(e))return this.spawnCallback(e,n);if(ev(e))return this.spawnActor(e,n);if(Ng(e))return this.spawnObservable(e,n);if(ar(e))return this.spawnMachine(e,H(H({},r),{id:n}));if(Ag(e))return this.spawnBehavior(e,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof e,'".'))},t.prototype.spawnMachine=function(e,n){var r=this;n===void 0&&(n={});var i=new t(e,H(H({},this.options),{parent:this,id:n.id||e.id})),o=H(H({},dv),n);o.sync&&i.onTransition(function(a){r.send(Tu,{state:a,id:i.id})});var s=i;return this.children.set(i.id,s),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(a){r.removeChild(i.id),r.send(ot(a,{origin:i.id}))}).start(),s},t.prototype.spawnBehavior=function(e,n){var r=fv(e,{id:n,parent:this});return this.children.set(n,r),r},t.prototype.spawnPromise=function(e,n){var r,i=this,o=!1,s;e.then(function(l){o||(s=l,i.removeChild(n),i.send(ot(qi(n,l),{origin:n})))},function(l){if(!o){i.removeChild(n);var c=jr(n,l);try{i.send(ot(c,{origin:n}))}catch{i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var a=(r={id:n,send:function(){},subscribe:function(l,c,f){var d=Zi(l,c,f),p=!1;return e.then(function(m){p||(d.next(m),!p&&d.complete())},function(m){p||d.error(m)}),{unsubscribe:function(){return p=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},r[dn]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnCallback=function(e,n){var r,i=this,o=!1,s=new Set,a=new Set,l,c=function(p){l=p,a.forEach(function(m){return m(p)}),!o&&i.send(ot(p,{origin:n}))},f;try{f=e(c,function(p){s.add(p)})}catch(p){this.send(jr(n,p))}if(Ya(f))return this.spawnPromise(f,n);var d=(r={id:n,send:function(p){return s.forEach(function(m){return m(p)})},subscribe:function(p){var m=Zi(p);return a.add(m.next),{unsubscribe:function(){a.delete(m.next)}}},stop:function(){o=!0,Oe(f)&&f()},toJSON:function(){return{id:n}},getSnapshot:function(){return l}},r[dn]=function(){return this},r);return this.children.set(n,d),d},t.prototype.spawnObservable=function(e,n){var r,i=this,o,s=e.subscribe(function(l){o=l,i.send(ot(l,{origin:n}))},function(l){i.removeChild(n),i.send(ot(jr(n,l),{origin:n}))},function(){i.removeChild(n),i.send(ot(qi(n),{origin:n}))}),a=(r={id:n,send:function(){},subscribe:function(l,c,f){return e.subscribe(l,c,f)},stop:function(){return s.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[dn]=function(){return this},r);return this.children.set(n,a),a},t.prototype.spawnActor=function(e,n){return this.children.set(n,e),e},t.prototype.spawnActivity=function(e){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(n){var r=n(this.state.context,e);this.spawnEffect(e.id,r)}},t.prototype.spawnEffect=function(e,n){var r;this.children.set(e,(r={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},r[dn]=function(){return this},r))},t.prototype.attachDev=function(){var e=ha();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(H(H({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:H({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}uv(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[dn]=function(){return this},t.prototype.getSnapshot=function(){return this.status===et.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,n){return setTimeout(e,n)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},t.interpret=Wu,t}();function Wu(t,e){var n=new pv(t,e);return n}function hv(t){if(typeof t=="string"){var e={type:t};return e.toString=function(){return t},e}return t}function Si(t){return H(H({type:Ps},t),{toJSON:function(){t.onDone,t.onError;var e=ca(t,["onDone","onError"]);return H(H({},e),{type:Ps,src:hv(t.src)})}})}var Li="",Is="#",es="*",Hn={},Gn=function(t){return t[0]===Is},gv=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},vv=function(){function t(e,n,r,i){r===void 0&&(r="context"in e?e.context:void 0);var o=this,s;this.config=e,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(gv(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:Au),this.id=this.config.id||Ue([this.machine.key],_e(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(s=this.config.schema)!==null&&s!==void 0?s:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?Ir(this.config.states,function(c,f){var d,p=new t(c,{},void 0,{parent:o,key:f});return Object.assign(o.idMap,H((d={},d[p.id]=p,d),p.idMap)),p}):Hn;var a=0;function l(c){var f,d;c.order=a++;try{for(var p=me(zu(c)),m=p.next();!m.done;m=p.next()){var g=m.value;l(g)}}catch(h){f={error:h}}finally{try{m&&!m.done&&(d=p.return)&&d.call(p)}finally{if(f)throw f.error}}}l(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var f=c.event;return f===Li}):Li in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=kt(this.config.entry||this.config.onEntry).map(function(c){return ni(c)}),this.onExit=kt(this.config.exit||this.config.onExit).map(function(c){return ni(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=kt(this.config.invoke).map(function(c,f){var d,p;if(ar(c)){var m=bi(o.id,f);return o.machine.options.services=H((d={},d[m]=c,d),o.machine.options.services),Si({src:m,id:m})}else if(ke(c.src)){var m=c.id||bi(o.id,f);return Si(H(H({},c),{id:m,src:c.src}))}else if(ar(c.src)||Oe(c.src)){var m=c.id||bi(o.id,f);return o.machine.options.services=H((p={},p[m]=c.src,p),o.machine.options.services),Si(H(H({id:m},c),{src:m}))}else{var g=c.src;return Si(H(H({id:bi(o.id,f)},c),{src:g}))}}),this.activities=kt(this.config.activities).concat(this.invoke).map(function(c){return pa(c)}),this.transition=this.transition.bind(this),this.tags=kt(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||$u(this).forEach(function(e){return e.on})},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,s=r.guards,a=r.services,l=r.delays;return new t(this.config,{actions:H(H({},i),e.actions),activities:H(H({},o),e.activities),guards:H(H({},s),e.guards),services:H(H({},a),e.services),delays:H(H({},l),e.delays)},n??this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return Oe(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Ir(this.states,function(e){return e.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var n=e===Li,r=this.transitions.filter(function(i){var o=i.eventType===e;return n?o:o||i.eventType===es});return this.__cache.candidates[e]=r,r},t.prototype.getDelayedTransitions=function(){var e=this,n=this.config.after;if(!n)return[];var r=function(o,s){var a=Oe(o)?"".concat(e.id,":delay[").concat(s,"]"):o,l=Jg(a,e.id);return e.onEntry.push(zg(l,{delay:o})),e.onExit.push(Gg(l)),l},i=pr(n)?n.map(function(o,s){var a=r(o.delay,s);return H(H({},o),{event:a})}):He(Object.keys(n).map(function(o,s){var a=n[o],l=ke(a)?{target:a}:a,c=isNaN(+o)?o:+o,f=r(c,s);return kt(l).map(function(d){return H(H({},d),{event:f,delay:c})})}));return i.map(function(o){var s=o.delay;return H(H({},e.formatTransition(o)),{delay:s})})},t.prototype.getStateNodes=function(e){var n,r=this;if(!e)return[];var i=e instanceof Lt?e.value:Vr(e,this.delimiter);if(ke(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var s=Object.keys(i),a=[this];return a.push.apply(a,Ue([],_e(He(s.map(function(l){return r.getStateNode(l).getStateNodes(i[l])}))),!1)),a},t.prototype.handles=function(e){var n=Du(e);return this.events.includes(n)},t.prototype.resolveState=function(e){var n=e instanceof Lt?e:Lt.create(e),r=Array.from(Nr([],this.getStateNodes(n.value)));return new Lt(H(H({},n),{value:this.resolve(n.value),configuration:r,done:Ki(r,this),tags:el(r),machine:this.machine}))},t.prototype.transitionLeafNode=function(e,n,r){var i=this.getStateNode(e),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},t.prototype.transitionCompoundNode=function(e,n,r){var i=Object.keys(e),o=this.getStateNode(i[0]),s=o._transition(e[i[0]],n,r);return!s||!s.transitions.length?this.next(n,r):s},t.prototype.transitionParallelNode=function(e,n,r){var i,o,s={};try{for(var a=me(Object.keys(e)),l=a.next();!l.done;l=a.next()){var c=l.value,f=e[c];if(f){var d=this.getStateNode(c),p=d._transition(f,n,r);p&&(s[c]=p)}}}catch(w){i={error:w}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}var m=Object.keys(s).map(function(w){return s[w]}),g=He(m.map(function(w){return w.transitions})),h=m.some(function(w){return w.transitions.length>0});if(!h)return this.next(n,r);var S=He(Object.keys(s).map(function(w){return s[w].configuration}));return{transitions:g,exitSet:He(m.map(function(w){return w.exitSet})),configuration:S,source:n,actions:He(Object.keys(s).map(function(w){return s[w].actions}))}},t.prototype._transition=function(e,n,r){return ke(e)?this.transitionLeafNode(e,n,r):Object.keys(e).length===1?this.transitionCompoundNode(e,n,r):this.transitionParallelNode(e,n,r)},t.prototype.getTransitionData=function(e,n){return this._transition(e.value,e,ot(n))},t.prototype.next=function(e,n){var r,i,o=this,s=n.name,a=[],l=[],c;try{for(var f=me(this.getCandidates(s)),d=f.next();!d.done;d=f.next()){var p=d.value,m=p.cond,g=p.in,h=e.context,S=g?ke(g)&&Gn(g)?e.matches(Vr(this.getStateNodeById(g).path,this.delimiter)):da(Vr(g,this.delimiter),kg(this.path.slice(0,-2))(e.value)):!0,w=!1;try{w=!m||Bu(this.machine,m,h,n,e)}catch(_){throw new Error("Unable to evaluate guard '".concat(m.name||m.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,`':
|
|
36
|
+
`).concat(_.message))}if(w&&S){p.target!==void 0&&(l=p.target),a.push.apply(a,Ue([],_e(p.actions),!1)),c=p;break}}}catch(_){r={error:_}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}if(c){if(!l.length)return{transitions:[c],exitSet:[],configuration:e.value?[this]:[],source:e,actions:a};var y=He(l.map(function(_){return o.getRelativeStateNodes(_,e.historyValue)})),b=!!c.internal;return{transitions:[c],exitSet:b?[]:He(l.map(function(_){return o.getPotentiallyReenteringNodes(_)})),configuration:y,source:e,actions:a}}},t.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var n=[],r=this,i=e;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},t.prototype.getActions=function(e,n,r,i,o,s,a){var l,c,f,d,p=this,m=s?Nr([],this.getStateNodes(s.value)):[],g=new Set;try{for(var h=me(Array.from(e).sort(function(O,P){return O.order-P.order})),S=h.next();!S.done;S=h.next()){var w=S.value;(!Br(m,w)||Br(r.exitSet,w)||w.parent&&g.has(w.parent))&&g.add(w)}}catch(O){l={error:O}}finally{try{S&&!S.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}try{for(var y=me(m),b=y.next();!b.done;b=y.next()){var w=b.value;(!Br(e,w)||Br(r.exitSet,w.parent))&&r.exitSet.push(w)}}catch(O){f={error:O}}finally{try{b&&!b.done&&(d=y.return)&&d.call(y)}finally{if(f)throw f.error}}r.exitSet.sort(function(O,P){return P.order-O.order});var _=Array.from(g).sort(function(O,P){return O.order-P.order}),E=new Set(r.exitSet),v=He(_.map(function(O){var P=[];if(O.type!=="final")return P;var j=O.parent;if(!j.parent)return P;P.push(wi(O.id,O.doneData),wi(j.id,O.doneData?fo(O.doneData,i,o):void 0));var U=j.parent;return U.type==="parallel"&&ri(U).every(function($){return Ki(r.configuration,$)})&&P.push(wi(U.id)),P})),L=_.map(function(O){var P=O.onEntry,j=O.activities.map(function(U){return Wg(U)});return{type:"entry",actions:pn(a?Ue(Ue([],_e(P),!1),_e(j),!1):Ue(Ue([],_e(j),!1),_e(P),!1),p.machine.options.actions)}}).concat({type:"state_done",actions:v.map(function(O){return Vg(O)})}),C=Array.from(E).map(function(O){return{type:"exit",actions:pn(Ue(Ue([],_e(O.onExit),!1),_e(O.activities.map(function(P){return Zg(P)})),!1),p.machine.options.actions)}}),k=C.concat({type:"transition",actions:pn(r.actions,this.machine.options.actions)}).concat(L);if(n){var M=pn(He(Ue([],_e(e),!1).sort(function(O,P){return P.order-O.order}).map(function(O){return O.onExit})),this.machine.options.actions).filter(function(O){return!Ts(O)});return k.concat({type:"stop",actions:M})}return k},t.prototype.transition=function(e,n,r,i){e===void 0&&(e=this.initialState);var o=ot(n),s;if(e instanceof Lt)s=r===void 0?e:this.resolveState(Lt.from(e,r));else{var a=ke(e)?this.resolve(uo(this.getResolvedPath(e))):this.resolve(e),l=r??this.machine.context;s=this.resolveState(Lt.from(a,l))}if(this.strict&&!this.events.includes(o.name)&&!Tg(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(s.value,s,o)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]},f=Nr([],this.getStateNodes(s.value)),d=c.configuration.length?Nr(f,c.configuration):f;return c.configuration=Ue([],_e(d),!1),this.resolveTransition(c,s,s.context,i,o)},t.prototype.resolveRaisedTransition=function(e,n,r,i){var o,s=e.actions;return e=this.transition(e,n,void 0,i),e._event=r,e.event=r.data,(o=e.actions).unshift.apply(o,Ue([],_e(s),!1)),e},t.prototype.resolveTransition=function(e,n,r,i,o){var s,a,l,c,f=this;o===void 0&&(o=er);var d=e.configuration,p=!n||e.transitions.length>0,m=p?e.configuration:n?n.configuration:[],g=Ki(m,this),h=p?nv(this.machine,d):void 0,S=n?n.historyValue?n.historyValue:e.source?this.machine.historyValue(n.value):void 0:void 0,w=this.getActions(new Set(m),g,e,r,o,n,i),y=n?H({},n.activities):{};try{for(var b=me(w),_=b.next();!_.done;_=b.next()){var E=_.value;try{for(var v=(l=void 0,me(E.actions)),L=v.next();!L.done;L=v.next()){var C=L.value;C.type===Ms?y[C.activity.id||C.activity.type]=C:C.type===ua&&(y[C.activity.id||C.activity.type]=!1)}}catch(V){l={error:V}}finally{try{L&&!L.done&&(c=v.return)&&c.call(v)}finally{if(l)throw l.error}}}}catch(V){s={error:V}}finally{try{_&&!_.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}var k=_e(po(this,n,r,o,w,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),M=k[0],O=k[1],P=_e(Dg(M,Ts),2),j=P[0],U=P[1],$=M.filter(function(V){var Z;return V.type===Ms&&((Z=V.activity)===null||Z===void 0?void 0:Z.type)===Ps}),G=$.reduce(function(V,Z){return V[Z.activity.id]=Xg(Z.activity,f.machine,O,o),V},n?H({},n.children):{}),z=new Lt({value:h||n.value,context:O,_event:o,_sessionid:n?n._sessionid:null,historyValue:h?S?Ig(S,h):void 0:n?n.historyValue:void 0,history:!h||e.source?n:void 0,actions:h?U:[],activities:h?y:n?n.activities:{},events:[],configuration:m,transitions:e.transitions,children:G,done:g,tags:el(m),machine:this}),W=r!==O;z.changed=o.name===Tu||W;var D=z.history;D&&delete D.history;var R=!g&&(this._transient||d.some(function(V){return V._transient}));if(!p&&(!R||o.name===Li))return z;var A=z;if(!g)for(R&&(A=this.resolveRaisedTransition(A,{type:Eg},o,i));j.length;){var T=j.shift();A=this.resolveRaisedTransition(A,T._event,o,i)}var N=A.changed||(D?!!A.actions.length||W||typeof D.value!=typeof A.value||!Gu(A.value,D.value):void 0);return A.changed=N,A.history=D,A},t.prototype.getStateNode=function(e){if(Gn(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[e];if(!n)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return n},t.prototype.getStateNodeById=function(e){var n=Gn(e)?e.slice(Is.length):e;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},t.prototype.getStateNodeByPath=function(e){if(typeof e=="string"&&Gn(e))try{return this.getStateNodeById(e.slice(1))}catch{}for(var n=Rs(e,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},t.prototype.resolve=function(e){var n,r=this;if(!e)return this.initialStateValue||Hn;switch(this.type){case"parallel":return Ir(this.initialStateValue,function(o,s){return o?r.getStateNode(s).resolve(e[s]||o):Hn});case"compound":if(ke(e)){var i=this.getStateNode(e);return i.type==="parallel"||i.type==="compound"?(n={},n[e]=i.initialStateValue,n):e}return Object.keys(e).length?Ir(e,function(o,s){return o?r.getStateNode(s).resolve(o):Hn}):this.initialStateValue||{};default:return e||Hn}},t.prototype.getResolvedPath=function(e){if(Gn(e)){var n=this.machine.idMap[e.slice(Is.length)];if(!n)throw new Error("Unable to find state node '".concat(e,"'"));return n.path}return Rs(e,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Ja(this.states,function(r){return r.initialStateValue||Hn},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=ho(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(e,n){this._init();var r=this.getStateNodes(e);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var e;if(this.type==="history"){var n=this.config;ke(n.target)?e=Gn(n.target)?uo(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:e=n.target}return e},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(e,n,r){return r===void 0&&(r=!0),r?e.type==="history"?e.resolveHistory(n):e.initialStateNodes:[e]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var e=this;if(ho(this))return[this];if(this.type==="compound"&&!this.initial)return[this];var n=Wi(this.initialStateValue);return He(n.map(function(r){return e.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var n=_e(e),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},t.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:Ja(this.states,function(n,r){if(!e)return n.historyValue();var i=ke(e)?void 0:e[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},t.prototype.resolveHistory=function(e){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!e){var i=this.target;return i?He(Wi(i).map(function(s){return r.getFromRelativePath(s)})):r.initialStateNodes}var o=Rg(r.path,"states")(e).current;return ke(o)?[r.getStateNode(o)]:He(Wi(o).map(function(s){return n.history==="deep"?r.getFromRelativePath(s):[r.states[s[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var e=this,n=He(Object.keys(this.states).map(function(r){return e.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var e,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,s=new Set(this.ownEvents);if(o)try{for(var a=me(Object.keys(o)),l=a.next();!l.done;l=a.next()){var c=l.value,f=o[c];if(f.states)try{for(var d=(r=void 0,me(f.events)),p=d.next();!p.done;p=d.next()){var m=p.value;s.add("".concat(m))}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}}catch(g){e={error:g}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(e){var n=this;if(e!==void 0)return e.map(function(r){if(!ke(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var s=n.parent.getStateNodeByPath(o);return s}catch(a){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
37
|
+
`).concat(a.message))}else return n.getStateNodeByPath(o)})},t.prototype.formatTransition=function(e){var n=this,r=Ug(e.target),i="internal"in e?e.internal:r?r.some(function(l){return ke(l)&&l[0]===n.delimiter}):!0,o=this.machine.options.guards,s=this.resolveTarget(r),a=H(H({},e),{actions:pn(kt(e.actions)),cond:Nu(e.cond,o),target:s,source:this,internal:i,eventType:e.event,toJSON:function(){return H(H({},a),{target:a.target?a.target.map(function(l){return"#".concat(l.id)}):void 0,source:"#".concat(n.id)})}});return a},t.prototype.formatTransitions=function(){var e,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,s=es,a=o[s],l=a===void 0?[]:a,c=ca(o,[typeof s=="symbol"?s:s+""]);i=He(Object.keys(c).map(function(y){var b=$n(y,c[y]);return b}).concat($n(es,l)))}var f=this.config.always?$n("",this.config.always):[],d=this.config.onDone?$n(String(wi(this.id)),this.config.onDone):[],p=He(this.invoke.map(function(y){var b=[];return y.onDone&&b.push.apply(b,Ue([],_e($n(String(qi(y.id)),y.onDone)),!1)),y.onError&&b.push.apply(b,Ue([],_e($n(String(jr(y.id)),y.onError)),!1)),b})),m=this.after,g=He(Ue(Ue(Ue(Ue([],_e(d),!1),_e(p),!1),_e(i),!1),_e(f),!1).map(function(y){return kt(y).map(function(b){return r.formatTransition(b)})}));try{for(var h=me(m),S=h.next();!S.done;S=h.next()){var w=S.value;g.push(w)}}catch(y){e={error:y}}finally{try{S&&!S.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}return g},t}();function mv(t,e,n){return n===void 0&&(n=t.context),new vv(t,e,n)}var yv=Kg,js;(function(t){t[t.Effect=1]="Effect",t[t.LayoutEffect=2]="LayoutEffect"})(js||(js={}));var Fr=u.useLayoutEffect;function nl(t){var e=ce.useRef();return e.current||(e.current={v:t()}),e.current.v}var bv=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},wv=globalThis&&globalThis.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Sv(t,e){var n,r,i=bv([[],[]],2),o=i[0],s=i[1];try{for(var a=wv(t),l=a.next();!l.done;l=a.next()){var c=l.value;e(c)?o.push(c):s.push(c)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}var xr=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},rl=globalThis&&globalThis.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function il(t,e){var n=t.exec,r=n(e.context,e._event.data,{action:t,state:e,_event:e._event});r()}function Lv(t){var e=u.useRef([]),n=u.useRef([]);Fr(function(){var r=t.subscribe(function(i){var o,s;if(i.actions.length){var a=i.actions.filter(function(d){return typeof d.exec=="function"&&"__effect"in d.exec}),l=xr(Sv(a,function(d){return d.exec.__effect===js.Effect}),2),c=l[0],f=l[1];(o=e.current).push.apply(o,rl([],xr(c.map(function(d){return[d,i]})),!1)),(s=n.current).push.apply(s,rl([],xr(f.map(function(d){return[d,i]})),!1))}});return function(){r.unsubscribe()}},[]),Fr(function(){for(;n.current.length;){var r=xr(n.current.shift(),2),i=r[0],o=r[1];il(i,o)}}),u.useEffect(function(){for(;e.current.length;){var r=xr(e.current.shift(),2),i=r[0],o=r[1];il(i,o)}})}var zr=globalThis&&globalThis.__assign||function(){return zr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zr.apply(this,arguments)},Ev=globalThis&&globalThis.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};globalThis&&globalThis.__read;function xv(t,e,n){if(typeof t=="object")return t;var r=function(){};return{next:t,error:e||r,complete:n||r}}function Cv(t,e,n){e===void 0&&(e={});var r=nl(function(){return typeof t=="function"?t():t}),i=e.context,o=e.guards,s=e.actions,a=e.activities,l=e.services,c=e.delays,f=e.state,d=Ev(e,["context","guards","actions","activities","services","delays","state"]),p=nl(function(){var m={context:i,guards:o,actions:s,activities:a,services:l,delays:c},g=r.withConfig(m,function(){return zr(zr({},r.context),i)});return Wu(g,zr({deferEvents:!0},d))});return Fr(function(){var m;return n&&(m=p.subscribe(xv(n))),function(){m==null||m.unsubscribe()}},[n]),Fr(function(){return p.start(f?Lt.create(f):void 0),function(){p.stop()}},[]),Fr(function(){Object.assign(p.machine.options.actions,s),Object.assign(p.machine.options.guards,o),Object.assign(p.machine.options.activities,a),Object.assign(p.machine.options.services,l),Object.assign(p.machine.options.delays,c)},[s,o,a,l,c]),Lv(p),p}var _v=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o};globalThis&&globalThis.__spreadArray;function Ov(t,e){e===void 0&&(e={});var n=u.useCallback(function(a){var l=a.changed===void 0&&Object.keys(a.children).length;(a.changed||l)&&s(a)},[]),r=Cv(t,e,n),i=_v(u.useState(function(){var a=r.machine.initialState;return e.state?Lt.create(e.state):a}),2),o=i[0],s=i[1];return[o,r.send,r]}function Ge(){return Ge=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ge.apply(this,arguments)}function tr(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}const he={arr:Array.isArray,obj:t=>Object.prototype.toString.call(t)==="[object Object]",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0,nul:t=>t===null,set:t=>t instanceof Set,map:t=>t instanceof Map,equ(t,e){if(typeof t!=typeof e)return!1;if(he.str(t)||he.num(t))return t===e;if(he.obj(t)&&he.obj(e)&&Object.keys(t).length+Object.keys(e).length===0)return!0;let n;for(n in t)if(!(n in e))return!1;for(n in e)if(t[n]!==e[n])return!1;return he.und(n)?t===e:!0}};function Mv(t,e){return e===void 0&&(e=!0),n=>(he.arr(n)?n:Object.keys(n)).reduce((r,i)=>{const o=e?i[0].toLowerCase()+i.substring(1):i;return r[o]=t(o),r},t)}function Pv(){const t=u.useState(!1),e=t[1];return u.useCallback(()=>e(r=>!r),[])}function _n(t,e){return he.und(t)||he.nul(t)?e:t}function Ei(t){return he.und(t)?[]:he.arr(t)?t:[t]}function Xn(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return he.fun(t)?t(...n):t}function kv(t){return t.to,t.from,t.config,t.onStart,t.onRest,t.onFrame,t.children,t.reset,t.reverse,t.force,t.immediate,t.delay,t.attach,t.destroyed,t.interpolateTo,t.ref,t.lazy,tr(t,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}function ts(t){const e=kv(t);if(he.und(e))return Ge({to:e},t);const n=Object.keys(t).reduce((r,i)=>he.und(e[i])?Ge({},r,{[i]:t[i]}):r,{});return Ge({to:e},n)}function Rv(t,e){return e&&(he.fun(e)?e(t):he.obj(e)&&(e.current=t)),t}class Tt{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){this.children.length===0&&this.attach(),this.children.push(e)}removeChild(e){const n=this.children.indexOf(e);this.children.splice(n,1),this.children.length===0&&this.detach()}}class Ns extends Tt{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach(e=>e instanceof Tt&&e.addChild(this)),this.detach=()=>this.payload.forEach(e=>e instanceof Tt&&e.removeChild(this))}}class Zu extends Tt{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach(e=>e instanceof Tt&&e.addChild(this)),this.detach=()=>Object.values(this.payload).forEach(e=>e instanceof Tt&&e.removeChild(this))}getValue(e){e===void 0&&(e=!1);const n={};for(const r in this.payload){const i=this.payload[r];e&&!(i instanceof Tt)||(n[r]=i instanceof Tt?i[e?"getAnimatedValue":"getValue"]():i)}return n}getAnimatedValue(){return this.getValue(!0)}}let ga;function Tv(t,e){ga={fn:t,transform:e}}let qu;function Av(t){qu=t}let Ku=t=>typeof window<"u"?window.requestAnimationFrame(t):-1,go;function Dv(t){go=t}let Ju=()=>Date.now(),Iv=t=>t.current,Yu;function jv(t){Yu=t}class Nv extends Zu{constructor(e,n){super(),this.update=void 0,this.payload=e.style?Ge({},e,{style:Yu(e.style)}):e,this.update=n,this.attach()}}const Bv=t=>he.fun(t)&&!(t.prototype instanceof u.Component),Uv=t=>u.forwardRef((n,r)=>{const i=Pv(),o=u.useRef(!0),s=u.useRef(null),a=u.useRef(null),l=u.useCallback(p=>{const m=s.current,g=()=>{let h=!1;a.current&&(h=ga.fn(a.current,s.current.getAnimatedValue())),(!a.current||h===!1)&&i()};s.current=new Nv(p,g),m&&m.detach()},[]);u.useEffect(()=>()=>{o.current=!1,s.current&&s.current.detach()},[]),u.useImperativeHandle(r,()=>Iv(a)),l(n);const c=s.current.getValue();c.scrollTop,c.scrollLeft;const f=tr(c,["scrollTop","scrollLeft"]),d=Bv(t)?void 0:p=>a.current=Rv(p,r);return u.createElement(t,Ge({},f,{ref:d}))});let $r=!1;const Dn=new Set,Xu=()=>{if(!$r)return!1;let t=Ju();for(let e of Dn){let n=!1;for(let r=0;r<e.configs.length;r++){let i=e.configs[r],o,s;for(let a=0;a<i.animatedValues.length;a++){let l=i.animatedValues[a];if(l.done)continue;let c=i.fromValues[a],f=i.toValues[a],d=l.lastPosition,p=f instanceof Tt,m=Array.isArray(i.initialVelocity)?i.initialVelocity[a]:i.initialVelocity;if(p&&(f=f.getValue()),i.immediate){l.setValue(f),l.done=!0;continue}if(typeof c=="string"||typeof f=="string"){l.setValue(f),l.done=!0;continue}if(i.duration!==void 0)d=c+i.easing((t-l.startTime)/i.duration)*(f-c),o=t>=l.startTime+i.duration;else if(i.decay)d=c+m/(1-.998)*(1-Math.exp(-(1-.998)*(t-l.startTime))),o=Math.abs(l.lastPosition-d)<.1,o&&(f=d);else{s=l.lastTime!==void 0?l.lastTime:t,m=l.lastVelocity!==void 0?l.lastVelocity:i.initialVelocity,t>s+64&&(s=t);let g=Math.floor(t-s);for(let y=0;y<g;++y){let b=-i.tension*(d-f),_=-i.friction*m,E=(b+_)/i.mass;m=m+E*1/1e3,d=d+m*1/1e3}let h=i.clamp&&i.tension!==0?c<f?d>f:d<f:!1,S=Math.abs(m)<=i.precision,w=i.tension!==0?Math.abs(f-d)<=i.precision:!0;o=h||S&&w,l.lastVelocity=m,l.lastTime=t}p&&!i.toValues[a].done&&(o=!1),o?(l.value!==f&&(d=f),l.done=!0):n=!0,l.setValue(d),l.lastPosition=d}e.props.onFrame&&(e.values[i.name]=i.interpolation.getValue())}e.props.onFrame&&e.props.onFrame(e.values),n||(Dn.delete(e),e.stop(!0))}return Dn.size?Ku(Xu):$r=!1,$r},Vv=t=>{Dn.has(t)||Dn.add(t),$r||($r=!0,Ku(Xu))},Fv=t=>{Dn.has(t)&&Dn.delete(t)};function vo(t,e,n){if(typeof t=="function")return t;if(Array.isArray(t))return vo({range:t,output:e,extrapolate:n});if(go&&typeof t.output[0]=="string")return go(t);const r=t,i=r.output,o=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(c=>c);return c=>{const f=$v(c,o);return zv(c,o[f],o[f+1],i[f],i[f+1],l,s,a,r.map)}}function zv(t,e,n,r,i,o,s,a,l){let c=l?l(t):t;if(c<e){if(s==="identity")return c;s==="clamp"&&(c=e)}if(c>n){if(a==="identity")return c;a==="clamp"&&(c=n)}return r===i?r:e===n?t<=e?r:i:(e===-1/0?c=-c:n===1/0?c=c-e:c=(c-e)/(n-e),c=o(c),r===-1/0?c=-c:i===1/0?c=c+r:c=c*(i-r)+r,c)}function $v(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}class lr extends Ns{constructor(e,n,r,i){super(),this.calc=void 0,this.payload=e instanceof Ns&&!(e instanceof lr)?e.getPayload():Array.isArray(e)?e:[e],this.calc=vo(n,r,i)}getValue(){return this.calc(...this.payload.map(e=>e.getValue()))}updateConfig(e,n,r){this.calc=vo(e,n,r)}interpolate(e,n,r){return new lr(this,e,n,r)}}const Wn=(t,e,n)=>t&&new lr(t,e,n),Hv={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};function Qu(t,e){"update"in t?e.add(t):t.getChildren().forEach(n=>Qu(n,e))}class Bs extends Tt{constructor(e){var n;super(),n=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(r,i){i===void 0&&(i=!0),n.value=r,i&&n.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){this.animatedStyles.size===0&&Qu(this,this.animatedStyles),this.animatedStyles.forEach(e=>e.update())}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,n,r){return new lr(this,e,n,r)}}class Gv extends Ns{constructor(e){super(),this.payload=e.map(n=>new Bs(n))}setValue(e,n){n===void 0&&(n=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((r,i)=>this.payload[i].setValue(r,n)):this.payload.forEach(r=>r.setValue(e,n))}getValue(){return this.payload.map(e=>e.getValue())}interpolate(e,n){return new lr(this,e,n)}}let Wv=0,Zv=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=Wv++}update(e){if(!e)return this;const n=ts(e),r=n.delay,i=r===void 0?0:r,o=n.to,s=tr(n,["delay","to"]);if(he.arr(o)||he.fun(o))this.queue.push(Ge({},s,{delay:i,to:o}));else if(o){let a={};Object.entries(o).forEach(l=>{let c=l[0],f=l[1];const d=Ge({to:{[c]:f},delay:Xn(i,c)},s),p=a[d.delay]&&a[d.delay].to;a[d.delay]=Ge({},a[d.delay],d,{to:Ge({},p,d.to)})}),this.queue=Object.values(a)}return this.queue=this.queue.sort((a,l)=>a.delay-l.delay),this.diff(s),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach(i=>{let o=i.from,s=o===void 0?{}:o,a=i.to,l=a===void 0?{}:a;he.obj(s)&&(this.merged=Ge({},s,this.merged)),he.obj(l)&&(this.merged=Ge({},this.merged,l))});const n=this.local=++this.guid,r=this.localQueue=this.queue;this.queue=[],r.forEach((i,o)=>{let s=i.delay,a=tr(i,["delay"]);const l=f=>{o===r.length-1&&n===this.guid&&f&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let c=he.arr(a.to)||he.fun(a.to);s?setTimeout(()=>{n===this.guid&&(c?this.runAsync(a,l):this.diff(a).start(l))},s):c?this.runAsync(a,l):this.diff(a).start(l)})}else he.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),Vv(this);return this}stop(e){return this.listeners.forEach(n=>n(e)),this.listeners=[],this}pause(e){return this.stop(!0),e&&Fv(this),this}runAsync(e,n){var r=this;e.delay;let i=tr(e,["delay"]);const o=this.local;let s=Promise.resolve(void 0);if(he.arr(i.to))for(let a=0;a<i.to.length;a++){const l=a,c=Ge({},i,ts(i.to[l]));he.arr(c.config)&&(c.config=c.config[l]),s=s.then(()=>{if(o===this.guid)return new Promise(f=>this.diff(c).start(f))})}else if(he.fun(i.to)){let a=0,l;s=s.then(()=>i.to(c=>{const f=Ge({},i,ts(c));if(he.arr(f.config)&&(f.config=f.config[a]),a++,o===this.guid)return l=new Promise(d=>this.diff(f).start(d))},function(c){return c===void 0&&(c=!0),r.stop(c)}).then(()=>l))}s.then(n)}diff(e){this.props=Ge({},this.props,e);let n=this.props,r=n.from,i=r===void 0?{}:r,o=n.to,s=o===void 0?{}:o,a=n.config,l=a===void 0?{}:a,c=n.reverse,f=n.attach,d=n.reset,p=n.immediate;if(c){var m=[s,i];i=m[0],s=m[1]}this.merged=Ge({},i,this.merged,s),this.hasChanged=!1;let g=f&&f(this);if(this.animations=Object.entries(this.merged).reduce((h,S)=>{let w=S[0],y=S[1],b=h[w]||{};const _=he.num(y),E=he.str(y)&&!y.startsWith("#")&&!/\d/.test(y)&&!qu[y],v=he.arr(y),L=!_&&!v&&!E;let C=he.und(i[w])?y:i[w],k=_||v||E?y:1,M=Xn(l,w);g&&(k=g.animations[w].parent);let O=b.parent,P=b.interpolation,j=Ei(g?k.getPayload():k),U,$=y;L&&($=go({range:[0,1],output:[y,y]})(1));let G=P&&P.getValue();const W=!he.und(O)&&b.animatedValues.some(T=>!T.done),D=!he.equ($,G),R=!he.equ($,b.previous),A=!he.equ(M,b.config);if(d||R&&D||A){if(_||E)O=P=b.parent||new Bs(C);else if(v)O=P=b.parent||new Gv(C);else if(L){let T=b.interpolation&&b.interpolation.calc(b.parent.value);T=T!==void 0&&!d?T:C,b.parent?(O=b.parent,O.setValue(0,!1)):O=new Bs(0);const N={output:[T,y]};b.interpolation?(P=b.interpolation,b.interpolation.updateConfig(N)):P=O.interpolate(N)}return j=Ei(g?k.getPayload():k),U=Ei(O.getPayload()),d&&!L&&O.setValue(C,!1),this.hasChanged=!0,U.forEach(T=>{T.startPosition=T.value,T.lastPosition=T.value,T.lastVelocity=W?T.lastVelocity:void 0,T.lastTime=W?T.lastTime:void 0,T.startTime=Ju(),T.done=!1,T.animatedStyles.clear()}),Xn(p,w)&&O.setValue(L?k:y,!1),Ge({},h,{[w]:Ge({},b,{name:w,parent:O,interpolation:P,animatedValues:U,toValues:j,previous:$,config:M,fromValues:Ei(O.getValue()),immediate:Xn(p,w),initialVelocity:_n(M.velocity,0),clamp:_n(M.clamp,!1),precision:_n(M.precision,.01),tension:_n(M.tension,170),friction:_n(M.friction,26),mass:_n(M.mass,1),duration:M.duration,easing:_n(M.easing,T=>T),decay:M.decay})})}else return D?h:(L&&(O.setValue(1,!1),P.updateConfig({output:[$,$]})),O.done=!0,this.hasChanged=!0,Ge({},h,{[w]:Ge({},h[w],{previous:$})}))},this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let h in this.animations)this.interpolations[h]=this.animations[h].interpolation,this.values[h]=this.animations[h].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const qv=(t,e)=>{const n=u.useRef(!1),r=u.useRef(),i=he.fun(e),o=u.useMemo(()=>{r.current&&(r.current.map(d=>d.destroy()),r.current=void 0);let f;return[new Array(t).fill().map((d,p)=>{const m=new Zv,g=i?Xn(e,p,m):e[p];return p===0&&(f=g.ref),m.update(g),f||m.start(),m}),f]},[t]),s=o[0],a=o[1];r.current=s,u.useImperativeHandle(a,()=>({start:()=>Promise.all(r.current.map(f=>new Promise(d=>f.start(d)))),stop:f=>r.current.forEach(d=>d.stop(f)),get controllers(){return r.current}}));const l=u.useMemo(()=>f=>r.current.map((d,p)=>{d.update(i?Xn(f,p,d):f[p]),a||d.start()}),[t]);u.useEffect(()=>{n.current?i||l(e):a||r.current.forEach(f=>f.start())}),u.useEffect(()=>(n.current=!0,()=>r.current.forEach(f=>f.destroy())),[]);const c=r.current.map(f=>f.getValues());return i?[c,l,f=>r.current.forEach(d=>d.pause(f))]:c},Kv=t=>{const e=he.fun(t),n=qv(1,e?t:[t]),r=n[0],i=n[1],o=n[2];return e?[r[0],i,o]:r};class Jv extends Zu{constructor(e){e===void 0&&(e={}),super(),e.transform&&!(e.transform instanceof Tt)&&(e=ga.transform(e)),this.payload=e}}const mo={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},At="[-+]?\\d*\\.?\\d+",yo=At+"%";function Ao(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Yv=new RegExp("rgb"+Ao(At,At,At)),Xv=new RegExp("rgba"+Ao(At,At,At,At)),Qv=new RegExp("hsl"+Ao(At,yo,yo)),em=new RegExp("hsla"+Ao(At,yo,yo,At)),tm=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nm=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,rm=/^#([0-9a-fA-F]{6})$/,im=/^#([0-9a-fA-F]{8})$/;function om(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=rm.exec(t))?parseInt(e[1]+"ff",16)>>>0:mo.hasOwnProperty(t)?mo[t]:(e=Yv.exec(t))?(Zn(e[1])<<24|Zn(e[2])<<16|Zn(e[3])<<8|255)>>>0:(e=Xv.exec(t))?(Zn(e[1])<<24|Zn(e[2])<<16|Zn(e[3])<<8|al(e[4]))>>>0:(e=tm.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=im.exec(t))?parseInt(e[1],16)>>>0:(e=nm.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=Qv.exec(t))?(ol(sl(e[1]),xi(e[2]),xi(e[3]))|255)>>>0:(e=em.exec(t))?(ol(sl(e[1]),xi(e[2]),xi(e[3]))|al(e[4]))>>>0:null}function ns(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ol(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=ns(i,r,t+1/3),s=ns(i,r,t),a=ns(i,r,t-1/3);return Math.round(o*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function Zn(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function sl(t){return(parseFloat(t)%360+360)%360/360}function al(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function xi(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function ll(t){let e=om(t);if(e===null)return t;e=e||0;let n=(e&4278190080)>>>24,r=(e&16711680)>>>16,i=(e&65280)>>>8,o=(e&255)/255;return`rgba(${n}, ${r}, ${i}, ${o})`}const Ci=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,sm=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,am=new RegExp(`(${Object.keys(mo).join("|")})`,"g"),lm=t=>{const e=t.output.map(i=>i.replace(sm,ll)).map(i=>i.replace(am,ll)),n=e[0].match(Ci).map(()=>[]);e.forEach(i=>{i.match(Ci).forEach((o,s)=>n[s].push(+o))});const r=e[0].match(Ci).map((i,o)=>vo(Ge({},t,{output:n[o]})));return i=>{let o=0;return e[0].replace(Ci,()=>r[o++](i)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(s,a,l,c,f)=>`rgba(${Math.round(a)}, ${Math.round(l)}, ${Math.round(c)}, ${f})`)}};let Hr={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const cm=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),um=["Webkit","Ms","Moz","O"];Hr=Object.keys(Hr).reduce((t,e)=>(um.forEach(n=>t[cm(n,e)]=t[e]),t),Hr);function fm(t,e,n){return e==null||typeof e=="boolean"||e===""?"":!n&&typeof e=="number"&&e!==0&&!(Hr.hasOwnProperty(t)&&Hr[t])?e+"px":(""+e).trim()}const cl={};jv(t=>new Jv(t));Dv(lm);Av(mo);Tv((t,e)=>{if(t.nodeType&&t.setAttribute!==void 0){const i=e.style,o=e.children,s=e.scrollTop,a=e.scrollLeft,l=tr(e,["style","children","scrollTop","scrollLeft"]),c=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter";s!==void 0&&(t.scrollTop=s),a!==void 0&&(t.scrollLeft=a),o!==void 0&&(t.textContent=o);for(let f in i)if(i.hasOwnProperty(f)){var n=f.indexOf("--")===0,r=fm(f,i[f],n);f==="float"&&(f="cssFloat"),n?t.style.setProperty(f,r):t.style[f]=r}for(let f in l){const d=c?f:cl[f]||(cl[f]=f.replace(/([A-Z])/g,p=>"-"+p.toLowerCase()));typeof t.getAttribute(d)<"u"&&t.setAttribute(d,l[f])}return}else return!1},t=>t);const dm=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],pm=Mv(Uv,!1),hm=pm(dm);function ul(t,e){return t.map(function(n,r){return n+e[r]})}function ef(t,e){return t.map(function(n,r){return n-e[r]})}function Us(t){return Math.hypot.apply(Math,t)}function gm(t,e,n){var r=Us(e),i=r===0?0:1/r,o=n===0?0:1/n,s=o*r,a=e.map(function(f){return o*f}),l=e.map(function(f){return i*f}),c=Us(t);return{velocities:a,velocity:s,distance:c,direction:l}}function Vs(t){return Math.sign?Math.sign(t):+(t>0)-+(t<0)||+t}function vm(t,e,n){return Math.max(e,Math.min(t,n))}function mm(t,e){return Math.pow(t,e*5)}function fl(t,e,n){return e===0||Math.abs(e)===1/0?mm(t,n):t*e*n/(e+n*t)}function Gr(t,e,n,r){return r===void 0&&(r=.15),r===0?vm(t,e,n):t<e?-fl(e-t,n-e,r)+e:t>n?+fl(t-n,n-e,r)+n:t}function dl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ym(t,e,n){return e&&dl(t.prototype,e),n&&dl(t,n),t}function dt(){return dt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},dt.apply(this,arguments)}function tf(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function bm(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function _i(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wm(t,e){if(t){if(typeof t=="string")return pl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pl(t,e)}}function pl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Do(t,e){var n;if(typeof Symbol>"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(n=wm(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
38
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=t[Symbol.iterator](),n.next.bind(n)}function nf(){}function rf(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.length===0?nf:e.length===1?e[0]:function(){for(var r,i=Do(e),o;!(o=i()).done;){var s=o.value;r=s.apply(this,arguments)||r}return r}}function hn(t,e){if(t===void 0){if(e===void 0)throw new Error("Must define fallback value if undefined is expected");t=e}return Array.isArray(t)?t:[t,t]}function Oi(t){if(typeof t=="function"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,n)}else return t}function va(t,e){t===void 0&&(t={});for(var n={},r=0,i=Object.entries(e);r<i.length;r++){var o=i[r],s=o[0],a=o[1];switch(typeof a){case"function":n[s]=a.call(n,t[s],s,t);break;case"object":n[s]=va(t[s],a);break;case"boolean":a&&(n[s]=t[s]);break}}return n}var Sm=180,Lm=.15,Em=.5,xm=60,Cm={threshold:function(e){return e===void 0&&(e=0),hn(e)},rubberband:function(e){switch(e===void 0&&(e=0),e){case!0:return hn(Lm);case!1:return hn(0);default:return hn(e)}},enabled:function(e){return e===void 0&&(e=!0),e},triggerAllEvents:function(e){return e===void 0&&(e=!1),e},initial:function(e){return e===void 0&&(e=0),typeof e=="function"?e:hn(e)}},of=dt({},Cm,{axis:!0,lockDirection:function(e){return e===void 0&&(e=!1),e},bounds:function(e){if(e===void 0&&(e={}),typeof e=="function")return function(d){return of.bounds(e(d))};var n=e,r=n.left,i=r===void 0?-1/0:r,o=n.right,s=o===void 0?1/0:o,a=n.top,l=a===void 0?-1/0:a,c=n.bottom,f=c===void 0?1/0:c;return[[i,s],[l,f]]}}),_m=typeof window<"u"&&window.document&&window.document.createElement,Om={enabled:function(e){return e===void 0&&(e=!0),e},domTarget:!0,window:function(t){function e(n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return t===void 0&&(t=_m?window:void 0),t}),eventOptions:function(e){var n=e===void 0?{}:e,r=n.passive,i=r===void 0?!0:r,o=n.capture,s=o===void 0?!1:o;return{passive:i,capture:s}}},Mm=dt({},of,{threshold:function(e,n,r){var i=r.filterTaps,o=i===void 0?!1:i,s=r.lockDirection,a=s===void 0?!1:s,l=r.axis,c=l===void 0?void 0:l,f=hn(e,o?3:a||c?1:0);return this.filterTaps=o||f[0]+f[1]>0,f},swipeVelocity:function(e){return e===void 0&&(e=Em),hn(e)},swipeDistance:function(e){return e===void 0&&(e=xm),hn(e)},delay:function(e){switch(e===void 0&&(e=0),e){case!0:return Sm;case!1:return 0;default:return e}}});function Pm(t){return t===void 0&&(t={}),va(t,Om)}function km(t){return t===void 0&&(t={}),va(t,Mm)}function Rm(t){var e=t.domTarget,n=t.eventOptions,r=t.window,i=t.enabled,o=bm(t,["domTarget","eventOptions","window","enabled"]),s=Pm({domTarget:e,eventOptions:n,window:r,enabled:i});return s.drag=km(o),s}function Cr(t){return dt({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:nf,canceled:!1,memo:void 0,args:void 0},t)}function sf(){var t={hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},e=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),n=Cr({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),r=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),i=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),o=Cr({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0});return{shared:t,drag:e,pinch:n,wheel:r,move:i,scroll:o}}var Pn=new Map,Tm=function(){function t(n,r){var i=this;r===void 0&&(r=[]),this.controller=n,this.args=r,this.debounced=!0,this.setTimeout=function(o,s){var a;s===void 0&&(s=140),clearTimeout(i.controller.timeouts[i.stateKey]);for(var l=arguments.length,c=new Array(l>2?l-2:0),f=2;f<l;f++)c[f-2]=arguments[f];i.controller.timeouts[i.stateKey]=(a=window).setTimeout.apply(a,[o,s].concat(c))},this.clearTimeout=function(){clearTimeout(i.controller.timeouts[i.stateKey])},this.fireGestureHandler=function(o){if(o===void 0&&(o=!1),i.state._blocked)return i.debounced||(i.state._active=!1,i.clean()),null;if(!o&&!i.state.intentional&&!i.config.triggerAllEvents)return null;if(i.state.intentional){var s=i.state.active,a=i.state._active;i.state.active=a,i.state.first=a&&!s,i.state.last=s&&!a,i.controller.state.shared[i.ingKey]=a}var l=dt({},i.controller.state.shared,i.state,i.mapStateValues(i.state)),c=i.handler(l);return i.state.memo=c!==void 0?c:i.state.memo,i.state._active||i.clean(),l}}var e=t.prototype;return e.updateSharedState=function(r){Object.assign(this.controller.state.shared,r)},e.updateGestureState=function(r){Object.assign(this.state,r)},e.checkIntentionality=function(r,i){return{_intentional:r,_blocked:!1}},e.getMovement=function(r){var i=this.config,o=i.initial,s=i.bounds,a=i.rubberband,l=i.threshold,c=this.state,f=c._bounds,d=c._initial,p=c._active,m=c._intentional,g=c.lastOffset,h=c.movement,S=this.getInternalMovement(r,this.state),w=m[0]===!1?hl(S[0],l[0]):m[0],y=m[1]===!1?hl(S[1],l[1]):m[1],b=this.checkIntentionality([w,y],S);if(b._blocked)return dt({},b,{_movement:S,delta:[0,0]});var _=b._intentional,E=S,v,L;if(_[0]!==!1&&m[0]===!1&&(L=Oi(o,this.state),v=Oi(s,this.state),d[0]=L[0],f[0]=v[0]),_[1]!==!1&&m[1]===!1){var C,k;L=(C=L)!=null?C:Oi(o,this.state),v=(k=v)!=null?k:Oi(s,this.state),d[1]=L[1],f[1]=v[1]}var M=[_[0]!==!1?S[0]-_[0]:d[0],_[1]!==!1?S[1]-_[1]:d[1]],O=ul(M,g),P=p?a:[0,0];return M=gl(f,ul(M,d),P),dt({},b,{intentional:_[0]!==!1||_[1]!==!1,_initial:d,_movement:E,movement:M,values:r,offset:gl(f,O,P),delta:ef(M,h)})},e.clean=function(){this.clearTimeout()},ym(t,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),t}();function hl(t,e){return Math.abs(t)>=e?Vs(t)*e:!1}function gl(t,e,n){var r=e[0],i=e[1],o=n[0],s=n[1],a=t[0],l=a[0],c=a[1],f=t[1],d=f[0],p=f[1];return[Gr(r,l,c,o),Gr(i,d,p,s)]}function rs(t,e,n){var r=t.state,i=t.args,o=e.timeStamp,s=e.type,a=r.values,l=n?0:o-r.startTime;return{_lastEventType:s,event:e,timeStamp:o,elapsedTime:l,args:i,previous:a}}function Am(t,e,n){var r=t.state.offset,i=n.timeStamp;return dt({},sf()[t.stateKey],{_active:!0,values:e,initial:e,offset:r,lastOffset:r,startTime:i})}function Dm(t,e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.call.apply(t,[this,dt({},e,{event:n})].concat(i))}}var Im=function(e){var n=this;this.classes=e,this.bind=function(){for(var r={},i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];for(var a=Do(n.classes),l;!(l=a()).done;){var c=l.value;new c(n,o).addBindings(r)}for(var f=0,d=Object.entries(n.nativeRefs);f<d.length;f++){var p=d[f],m=p[0],g=p[1];Fs(r,m,Dm(g,dt({},n.state.shared,{args:o})))}return n.config.domTarget?Um(n,r):Vm(n,r)},this.effect=function(){return n.config.domTarget&&n.bind(),n.clean},this.clean=function(){var r=lf(n.config),i=n.config.eventOptions;r&&ci(r,af(n.domListeners),i),Object.values(n.timeouts).forEach(clearTimeout),jm(n)},this.state=sf(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function jm(t){var e=t.config,n=e.window,r=e.eventOptions,i=t.windowListeners;if(n){for(var o in i){var s=i[o];ci(n,s,r)}t.windowListeners={}}}function Nm(t,e){var n=t.config,r=t.windowListeners;n.window&&(ci(n.window,r[e],n.eventOptions),delete r[e])}function Bm(t,e,n){var r=t.config,i=t.windowListeners;n===void 0&&(n=[]),r.window&&(ci(r.window,i[e],r.eventOptions),cf(r.window,i[e]=n,r.eventOptions))}function Um(t,e){var n=t.config,r=t.domListeners,i=lf(n);if(!i)throw new Error("domTarget must be defined");var o=n.eventOptions;ci(i,af(r),o);for(var s=0,a=Object.entries(e);s<a.length;s++){var l=a[s],c=l[0],f=l[1],d=c.slice(2).toLowerCase();r.push([d,rf.apply(void 0,f)])}cf(i,r,o)}function Vm(t,e){for(var n=t.config,r={},i=n.eventOptions.capture?"Capture":"",o=0,s=Object.entries(e);o<s.length;o++){var a=s[o],l=a[0],c=a[1],f=Array.isArray(c)?c:[c],d=l+i;r[d]=rf.apply(void 0,f)}return r}function af(t){return t===void 0&&(t=[]),t.splice(0,t.length)}function lf(t){var e=t.domTarget;return e&&"current"in e?e.current:e}function Fs(t,e,n){t[e]||(t[e]=[]),t[e].push(n)}function cf(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Do(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.addEventListener(s,a,n)}}function ci(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={});for(var r=Do(e),i;!(i=r()).done;){var o=i.value,s=o[0],a=o[1];t.removeEventListener(s,a,n)}}function Fm(t,e,n){n===void 0&&(n={});var r=$m(t),i=u.useMemo(function(){return new Im(r)},[]);return i.config=e,i.handlers=t,i.nativeRefs=n,u.useEffect(i.effect,[]),i.config.domTarget?zm:i.bind}function zm(){}function $m(t){var e=new Set;return t.drag&&e.add(Pn.get("drag")),t.wheel&&e.add(Pn.get("wheel")),t.scroll&&e.add(Pn.get("scroll")),t.move&&e.add(Pn.get("move")),t.pinch&&e.add(Pn.get("pinch")),t.hover&&e.add(Pn.get("hover")),e}var Hm=function(t){tf(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.getInternalMovement=function(i,o){return ef(i,o.initial)},n.checkIntentionality=function(i,o){if(i[0]===!1&&i[1]===!1)return{_intentional:i,axis:this.state.axis};var s=o.map(Math.abs),a=s[0],l=s[1],c=this.state.axis||(a>l?"x":a<l?"y":void 0);return!this.config.axis&&!this.config.lockDirection?{_intentional:i,_blocked:!1,axis:c}:c?this.config.axis&&c!==this.config.axis?{_intentional:i,_blocked:!0,axis:c}:(i[c==="x"?1:0]=!1,{_intentional:i,_blocked:!1,axis:c}):{_intentional:[!1,!1],_blocked:!1,axis:c}},n.getKinematics=function(i,o){var s=this.getMovement(i);if(!s._blocked){var a=o.timeStamp-this.state.timeStamp;Object.assign(s,gm(s.movement,s.delta,a))}return s},n.mapStateValues=function(i){return{xy:i.values,vxvy:i.velocities}},e}(Tm);function uf(t){if("touches"in t){var e=t.targetTouches,n=t.changedTouches;return e.length>0?e:n}return null}function vl(t){var e="buttons"in t?t.buttons:0,n=uf(t),r=n&&n.length||0,i=r>0||e>0,o=t.shiftKey,s=t.altKey,a=t.metaKey,l=t.ctrlKey;return{touches:r,down:i,buttons:e,shiftKey:o,altKey:s,metaKey:a,ctrlKey:l}}function ml(t){var e=uf(t),n=e?e[0]:t,r=n.clientX,i=n.clientY;return[r,i]}var Gm=3,Wm=220,Zm=function(t){tf(e,t);function e(){var r;return r=t.apply(this,arguments)||this,r.ingKey="dragging",r.stateKey="drag",r.onDragStart=function(i){!r.enabled||r.state._active||(Bm(r.controller,r.stateKey,[["pointermove",r.onDragChange],["pointerup",r.onDragEnd],["pointercancel",r.onDragEnd]]),r.updateGestureState({_pointerId:i.pointerId}),r.config.delay>0?(r.state._delayedEvent=!0,"persist"in i&&typeof i.persist=="function"&&i.persist(),r.setTimeout(r.startDrag.bind(_i(r)),r.config.delay,i)):r.startDrag(i))},r.onDragChange=function(i){if(!r.state.canceled&&i.pointerId===r.state._pointerId){if(!r.state._active){r.state._delayedEvent&&(r.clearTimeout(),r.startDrag(i));return}var o=vl(i);if(!o.down){r.onDragEnd(i);return}r.updateSharedState(o);var s=ml(i),a=r.getKinematics(s,i),l=rs(_i(r),i),c=r.state._isTap,f=Us(a._movement);c&&f>=Gm&&(c=!1),r.updateGestureState(dt({},l,a,{_isTap:c})),r.fireGestureHandler()}},r.onDragEnd=function(i){if(i.pointerId===r.state._pointerId){r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0});var o=r.state._isTap,s=r.state.velocities,a=s[0],l=s[1],c=r.state.movement,f=c[0],d=c[1],p=r.state._intentional,m=p[0],g=p[1],h=r.config.swipeVelocity,S=h[0],w=h[1],y=r.config.swipeDistance,b=y[0],_=y[1],E=dt({},rs(_i(r),i),r.getMovement(r.state.values)),v=[0,0];E.elapsedTime<Wm&&(m!==!1&&Math.abs(a)>S&&Math.abs(f)>b&&(v[0]=Vs(a)),g!==!1&&Math.abs(l)>w&&Math.abs(d)>_&&(v[1]=Vs(l))),r.updateGestureState(dt({},E,{tap:o,swipe:v})),r.fireGestureHandler(o===!0)}},r.clean=function(){t.prototype.clean.call(_i(r)),r.state._delayedEvent=!1,Nm(r.controller,r.stateKey)},r.onCancel=function(){r.state.canceled||(r.updateGestureState({canceled:!0}),r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame(function(){return r.fireGestureHandler()}))},r.onClick=function(i){r.state._isTap||i.stopPropagation()},r}var n=e.prototype;return n.startDrag=function(i){var o=ml(i);this.updateSharedState(vl(i)),this.updateGestureState(dt({},Am(this,o,i),rs(this,i,!0),{_pointerId:i.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(o)),this.fireGestureHandler()},n.addBindings=function(i){if(Fs(i,"onPointerDown",this.onDragStart),this.config.filterTaps){var o=this.controller.config.eventOptions.capture?"onClick":"onClickCapture";Fs(i,o,this.onClick)}},e}(Hm);function qm(t,e){var n,r=[],i,o=!1;function s(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return o&&n===this&&e(l,r)||(i=t.apply(this,l),o=!0,n=this,r=l),i}return s}function Ji(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ji(t[r],e[r]))return!1;return!0}var o;if(typeof Map=="function"&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=t.entries();!(r=o.next()).done;)if(!Ji(r.value[1],e.get(r.value[0])))return!1;return!0}if(typeof Set=="function"&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(typeof Element<"u"&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!(i[r]==="_owner"&&t.$$typeof)&&!Ji(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}function Km(t,e){try{return Ji(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}function Jm(t,e){e===void 0&&(e={}),Pn.set("drag",Zm);var n=u.useRef();return n.current||(n.current=qm(Rm,Km)),Fm({drag:t},n.current(e))}/*!
|
|
39
39
|
* tabbable 5.3.3
|
|
40
40
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
41
|
-
*/var
|
|
41
|
+
*/var ff=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],bo=ff.join(","),df=typeof Element>"u",Nn=df?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,zs=!df&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},pf=function(e,n,r){var i=Array.prototype.slice.apply(e.querySelectorAll(bo));return n&&Nn.call(e,bo)&&i.unshift(e),i=i.filter(r),i},hf=function t(e,n,r){for(var i=[],o=Array.from(e);o.length;){var s=o.shift();if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=t(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scope:s,candidates:c})}else{var f=Nn.call(s,bo);f&&r.filter(s)&&(n||!e.includes(s))&&i.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!r.shadowRootFilter||r.shadowRootFilter(s);if(d&&p){var m=t(d===!0?s.children:d.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scope:s,candidates:m})}else o.unshift.apply(o,s.children)}}return i},gf=function(e,n){return e.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},Ym=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},vf=function(e){return e.tagName==="INPUT"},Xm=function(e){return vf(e)&&e.type==="hidden"},Qm=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},ey=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},ty=function(e){if(!e.name)return!0;var n=e.form||zs(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=ey(i,e.form);return!o||o===e},ny=function(e){return vf(e)&&e.type==="radio"},ry=function(e){return ny(e)&&!ty(e)},yl=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},iy=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var o=Nn.call(e,"details>summary:first-of-type"),s=o?e.parentElement:e;if(Nn.call(s,"details:not([open]) *"))return!0;var a=zs(e).host,l=(a==null?void 0:a.ownerDocument.contains(a))||e.ownerDocument.contains(e);if(!r||r==="full"){if(typeof i=="function"){for(var c=e;e;){var f=e.parentElement,d=zs(e);if(f&&!f.shadowRoot&&i(f)===!0)return yl(e);e.assignedSlot?e=e.assignedSlot:!f&&d!==e.ownerDocument?e=d.host:e=f}e=c}if(l)return!e.getClientRects().length}else if(r==="non-zero-area")return yl(e);return!1},oy=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Nn.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},wo=function(e,n){return!(n.disabled||Xm(n)||iy(n,e)||Qm(n)||oy(n))},$s=function(e,n){return!(ry(n)||gf(n)<0||!wo(e,n))},sy=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ay=function t(e){var n=[],r=[];return e.forEach(function(i,o){var s=!!i.scope,a=s?i.scope:i,l=gf(a,s),c=s?t(i.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:c})}),r.sort(Ym).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ly=function(e,n){n=n||{};var r;return n.getShadowRoot?r=hf([e],n.includeContainer,{filter:$s.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sy}):r=pf(e,n.includeContainer,$s.bind(null,n)),ay(r)},cy=function(e,n){n=n||{};var r;return n.getShadowRoot?r=hf([e],n.includeContainer,{filter:wo.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=pf(e,n.includeContainer,wo.bind(null,n)),r},Mi=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Nn.call(e,bo)===!1?!1:$s(n,e)},uy=ff.concat("iframe").join(","),is=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Nn.call(e,uy)===!1?!1:wo(n,e)};/*!
|
|
42
42
|
* focus-trap 6.9.4
|
|
43
43
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
44
|
-
*/function vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ml(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?vl(Object(n),!0).forEach(function(r){sy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yl=function(){var t=[];return{activateTrap:function(n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}}}(),ay=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},ly=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},cy=function(e){return e.key==="Tab"||e.keyCode===9},bl=function(e){return setTimeout(e,0)},wl=function(e,n){var r=-1;return e.every(function(i,o){return n(i)?(r=o,!1):!0}),r},_r=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},Pi=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},uy=function(e,n){var r=(n==null?void 0:n.document)||document,i=ml({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s,a=function(m,x,C){return m&&m[x]!==void 0?m[x]:i[C||x]},l=function(m){return o.containerGroups.findIndex(function(x){var C=x.container,R=x.tabbableNodes;return C.contains(m)||R.find(function(M){return M===m})})},c=function(m){var x=i[m];if(typeof x=="function"){for(var C=arguments.length,R=new Array(C>1?C-1:0),M=1;M<C;M++)R[M-1]=arguments[M];x=x.apply(void 0,R)}if(x===!0&&(x=void 0),!x){if(x===void 0||x===!1)return x;throw new Error("`".concat(m,"` was specified but was not a node, or did not return a node"))}var _=x;if(typeof x=="string"&&(_=r.querySelector(x),!_))throw new Error("`".concat(m,"` as selector refers to no known node"));return _},f=function(){var m=c("initialFocus");if(m===!1)return!1;if(m===void 0)if(l(r.activeElement)>=0)m=r.activeElement;else{var x=o.tabbableGroups[0],C=x&&x.firstTabbableNode;m=C||c("fallbackFocus")}if(!m)throw new Error("Your focus-trap needs to have at least one focusable element");return m},d=function(){if(o.containerGroups=o.containers.map(function(m){var x=ry(m,i.tabbableOptions),C=iy(m,i.tabbableOptions);return{container:m,tabbableNodes:x,focusableNodes:C,firstTabbableNode:x.length>0?x[0]:null,lastTabbableNode:x.length>0?x[x.length-1]:null,nextTabbableNode:function(M){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,P=C.findIndex(function(j){return j===M});if(!(P<0))return _?C.slice(P+1).find(function(j){return Mi(j,i.tabbableOptions)}):C.slice(0,P).reverse().find(function(j){return Mi(j,i.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(m){return m.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},p=function L(m){if(m!==!1&&m!==r.activeElement){if(!m||!m.focus){L(f());return}m.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=m,ay(m)&&m.select()}},v=function(m){var x=c("setReturnFocus",m);return x||(x===!1?!1:m)},g=function(m){var x=Pi(m);if(!(l(x)>=0)){if(_r(i.clickOutsideDeactivates,m)){s.deactivate({returnFocus:i.returnFocusOnDeactivate&&!ns(x,i.tabbableOptions)});return}_r(i.allowOutsideClick,m)||m.preventDefault()}},h=function(m){var x=Pi(m),C=l(x)>=0;C||x instanceof Document?C&&(o.mostRecentlyFocusedNode=x):(m.stopImmediatePropagation(),p(o.mostRecentlyFocusedNode||f()))},w=function(m){var x=Pi(m);d();var C=null;if(o.tabbableGroups.length>0){var R=l(x),M=R>=0?o.containerGroups[R]:void 0;if(R<0)m.shiftKey?C=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:C=o.tabbableGroups[0].firstTabbableNode;else if(m.shiftKey){var _=wl(o.tabbableGroups,function(z){var W=z.firstTabbableNode;return x===W});if(_<0&&(M.container===x||ns(x,i.tabbableOptions)&&!Mi(x,i.tabbableOptions)&&!M.nextTabbableNode(x,!1))&&(_=R),_>=0){var P=_===0?o.tabbableGroups.length-1:_-1,j=o.tabbableGroups[P];C=j.lastTabbableNode}}else{var V=wl(o.tabbableGroups,function(z){var W=z.lastTabbableNode;return x===W});if(V<0&&(M.container===x||ns(x,i.tabbableOptions)&&!Mi(x,i.tabbableOptions)&&!M.nextTabbableNode(x))&&(V=R),V>=0){var $=V===o.tabbableGroups.length-1?0:V+1,G=o.tabbableGroups[$];C=G.firstTabbableNode}}}else C=c("fallbackFocus");C&&(m.preventDefault(),p(C))},S=function(m){if(ly(m)&&_r(i.escapeDeactivates,m)!==!1){m.preventDefault(),s.deactivate();return}if(cy(m)){w(m);return}},y=function(m){var x=Pi(m);l(x)>=0||_r(i.clickOutsideDeactivates,m)||_r(i.allowOutsideClick,m)||(m.preventDefault(),m.stopImmediatePropagation())},b=function(){if(o.active)return yl.activateTrap(s),o.delayInitialFocusTimer=i.delayInitialFocus?bl(function(){p(f())}):p(f()),r.addEventListener("focusin",h,!0),r.addEventListener("mousedown",g,{capture:!0,passive:!1}),r.addEventListener("touchstart",g,{capture:!0,passive:!1}),r.addEventListener("click",y,{capture:!0,passive:!1}),r.addEventListener("keydown",S,{capture:!0,passive:!1}),s},O=function(){if(o.active)return r.removeEventListener("focusin",h,!0),r.removeEventListener("mousedown",g,!0),r.removeEventListener("touchstart",g,!0),r.removeEventListener("click",y,!0),r.removeEventListener("keydown",S,!0),s};return s={get active(){return o.active},get paused(){return o.paused},activate:function(m){if(o.active)return this;var x=a(m,"onActivate"),C=a(m,"onPostActivate"),R=a(m,"checkCanFocusTrap");R||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,x&&x();var M=function(){R&&d(),b(),C&&C()};return R?(R(o.containers.concat()).then(M,M),this):(M(),this)},deactivate:function(m){if(!o.active)return this;var x=ml({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},m);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,O(),o.active=!1,o.paused=!1,yl.deactivateTrap(s);var C=a(x,"onDeactivate"),R=a(x,"onPostDeactivate"),M=a(x,"checkCanReturnFocus"),_=a(x,"returnFocus","returnFocusOnDeactivate");C&&C();var P=function(){bl(function(){_&&p(v(o.nodeFocusedBeforeActivation)),R&&R()})};return _&&M?(M(v(o.nodeFocusedBeforeActivation)).then(P,P),this):(P(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,O(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,d(),b(),this)},updateContainerElements:function(m){var x=[].concat(m).filter(Boolean);return o.containers=x.map(function(C){return typeof C=="string"?r.querySelector(C):C}),o.active&&d(),this}},s.updateContainerElements(e),s};function fy(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}else return Array.from(t)}var ga=!1;if(typeof window<"u"){var Sl={get passive(){ga=!0}};window.addEventListener("testPassive",null,Sl),window.removeEventListener("testPassive",null,Sl)}var gf=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),gn=[],So=!1,vf=-1,Wr=void 0,Zr=void 0,mf=function(e){return gn.some(function(n){return!!(n.options.allowTouchMove&&n.options.allowTouchMove(e))})},Lo=function(e){var n=e||window.event;return mf(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},dy=function(e){if(Zr===void 0){var n=!!e&&e.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;n&&r>0&&(Zr=document.body.style.paddingRight,document.body.style.paddingRight=r+"px")}Wr===void 0&&(Wr=document.body.style.overflow,document.body.style.overflow="hidden")},py=function(){Zr!==void 0&&(document.body.style.paddingRight=Zr,Zr=void 0),Wr!==void 0&&(document.body.style.overflow=Wr,Wr=void 0)},hy=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},gy=function(e,n){var r=e.targetTouches[0].clientY-vf;return mf(e.target)?!1:n&&n.scrollTop===0&&r>0||hy(n)&&r<0?Lo(e):(e.stopPropagation(),!0)},vy=function(e,n){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!gn.some(function(i){return i.targetElement===e})){var r={targetElement:e,options:n||{}};gn=[].concat(fy(gn),[r]),gf?(e.ontouchstart=function(i){i.targetTouches.length===1&&(vf=i.targetTouches[0].clientY)},e.ontouchmove=function(i){i.targetTouches.length===1&&gy(i,e)},So||(document.addEventListener("touchmove",Lo,ga?{passive:!1}:void 0),So=!0)):dy(n)}},my=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}gn=gn.filter(function(n){return n.targetElement!==e}),gf?(e.ontouchstart=null,e.ontouchmove=null,So&&gn.length===0&&(document.removeEventListener("touchmove",Lo,ga?{passive:!1}:void 0),So=!1)):gn.length||py()},In=[],yy=function(){return In.some(function(t){return t.activeTargets.length>0})},by=function(){return In.some(function(t){return t.skippedTargets.length>0})},Ll="ResizeObserver loop completed with undelivered notifications.",wy=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Ll}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Ll),window.dispatchEvent(t)},ii;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ii||(ii={}));var jn=function(t){return Object.freeze(t)},Sy=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,jn(this)}return t}(),yf=function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,jn(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,o=e.right,s=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:r,top:i,right:o,bottom:s,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),va=function(t){return t instanceof SVGElement&&"getBBox"in t},bf=function(t){if(va(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},El=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Ly=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},qr=typeof window<"u"?window:{},ki=new WeakMap,xl=/auto|scroll/,Ey=/^tb|vertical/,xy=/msie|trident/i.test(qr.navigator&&qr.navigator.userAgent),Bt=function(t){return parseFloat(t||"0")},nr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Sy((n?e:t)||0,(n?t:e)||0)},Cl=jn({devicePixelContentBoxSize:nr(),borderBoxSize:nr(),contentBoxSize:nr(),contentRect:new yf(0,0,0,0)}),wf=function(t,e){if(e===void 0&&(e=!1),ki.has(t)&&!e)return ki.get(t);if(bf(t))return ki.set(t,Cl),Cl;var n=getComputedStyle(t),r=va(t)&&t.ownerSVGElement&&t.getBBox(),i=!xy&&n.boxSizing==="border-box",o=Ey.test(n.writingMode||""),s=!r&&xl.test(n.overflowY||""),a=!r&&xl.test(n.overflowX||""),l=r?0:Bt(n.paddingTop),c=r?0:Bt(n.paddingRight),f=r?0:Bt(n.paddingBottom),d=r?0:Bt(n.paddingLeft),p=r?0:Bt(n.borderTopWidth),v=r?0:Bt(n.borderRightWidth),g=r?0:Bt(n.borderBottomWidth),h=r?0:Bt(n.borderLeftWidth),w=d+c,S=l+f,y=h+v,b=p+g,O=a?t.offsetHeight-b-t.clientHeight:0,L=s?t.offsetWidth-y-t.clientWidth:0,m=i?w+y:0,x=i?S+b:0,C=r?r.width:Bt(n.width)-m-L,R=r?r.height:Bt(n.height)-x-O,M=C+w+L+y,_=R+S+O+b,P=jn({devicePixelContentBoxSize:nr(Math.round(C*devicePixelRatio),Math.round(R*devicePixelRatio),o),borderBoxSize:nr(M,_,o),contentBoxSize:nr(C,R,o),contentRect:new yf(d,l,C,R)});return ki.set(t,P),P},Sf=function(t,e,n){var r=wf(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case ii.DEVICE_PIXEL_CONTENT_BOX:return s;case ii.BORDER_BOX:return i;default:return o}},Cy=function(){function t(e){var n=wf(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=jn([n.borderBoxSize]),this.contentBoxSize=jn([n.contentBoxSize]),this.devicePixelContentBoxSize=jn([n.devicePixelContentBoxSize])}return t}(),Lf=function(t){if(bf(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},_y=function(){var t=1/0,e=[];In.forEach(function(s){if(s.activeTargets.length!==0){var a=[];s.activeTargets.forEach(function(c){var f=new Cy(c.target),d=Lf(c.target);a.push(f),c.lastReportedSize=Sf(c.target,c.observedBox),d<t&&(t=d)}),e.push(function(){s.callback.call(s.observer,a,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},_l=function(t){In.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(Lf(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},Oy=function(){var t=0;for(_l(t);yy();)t=_y(),_l(t);return by()&&wy(),t>0},rs,Ef=[],My=function(){return Ef.splice(0).forEach(function(t){return t()})},Py=function(t){if(!rs){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return My()}).observe(n,r),rs=function(){n.textContent="".concat(e?e--:e++)}}Ef.push(t),rs()},ky=function(t){Py(function(){requestAnimationFrame(t)})},Yi=0,Ry=function(){return!!Yi},Ty=250,Ay={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ol=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ml=function(t){return t===void 0&&(t=0),Date.now()+t},is=!1,Dy=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Ty),!is){is=!0;var r=Ml(e);ky(function(){var i=!1;try{i=Oy()}finally{if(is=!1,e=r-Ml(),!Ry())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Ay)};document.body?n():qr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ol.forEach(function(n){return qr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Ol.forEach(function(n){return qr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),zs=new Dy,Pl=function(t){!Yi&&t>0&&zs.start(),Yi+=t,!Yi&&zs.stop()},Iy=function(t){return!va(t)&&!Ly(t)&&getComputedStyle(t).display==="inline"},jy=function(){function t(e,n){this.target=e,this.observedBox=n||ii.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Sf(this.target,this.observedBox,!0);return Iy(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),Ny=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),Ri=new WeakMap,kl=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ti=function(){function t(){}return t.connect=function(e,n){var r=new Ny(e,n);Ri.set(e,r)},t.observe=function(e,n,r){var i=Ri.get(e),o=i.observationTargets.length===0;kl(i.observationTargets,n)<0&&(o&&In.push(i),i.observationTargets.push(new jy(n,r&&r.box)),Pl(1),zs.schedule())},t.unobserve=function(e,n){var r=Ri.get(e),i=kl(r.observationTargets,n),o=r.observationTargets.length===1;i>=0&&(o&&In.splice(In.indexOf(r),1),r.observationTargets.splice(i,1),Pl(-1))},t.disconnect=function(e){var n=this,r=Ri.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),By=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ti.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!El(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ti.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!El(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ti.unobserve(this,e)},t.prototype.disconnect=function(){Ti.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function ut(){return ut=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ut.apply(this,arguments)}function Xi(t,e){if(t==null)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}var Kr=typeof window<"u"?u.useLayoutEffect:u.useEffect;function Or(t,e,n){return e=(e=+e)==e?e:0,n=(n=+n)==n?n:0,(t=+t)==t&&(t=(t=t<=n?t:n)>=e?t:e),t}function Ai(t){var e=Math.round(t);if(Number.isNaN(t))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return e}var Uy={box:"border-box"};function os(t,e){var n=e.label,r=e.enabled,i=e.resizeSourceRef,o=u.useState(0),s=o[0],a=o[1];u.useDebugValue(n+": "+s);var l=u.useCallback(function(c){a(c[0].borderBoxSize[0].blockSize),i.current="element"},[i]);return Kr(function(){if(t.current&&r){var c=new By(l);return c.observe(t.current,Uy),function(){c.disconnect()}}},[t,l,r]),r?s:0}function ct(t){return t===void 0&&(t=1e3),new Promise(function(e){return setTimeout(e,t)})}var Rl={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},Tl={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},Vy=dv({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:ut({},Rl,Tl)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:ut({},Rl,Tl)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:ut({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[pv({y:function(t,e){return e.payload.y},velocity:function(t,e){return e.payload.velocity},snapSource:function(t,e){var n=e.payload.source;return n===void 0?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(t,e){},onSnapCancel:function(t,e){},onResizeCancel:function(t,e){},onCloseCancel:function(t,e){},onOpenEnd:function(t,e){},onSnapEnd:function(t,e){},onRezizeEnd:function(t,e){}},services:{onSnapStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onSnapEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},renderVisuallyHidden:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},activate:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},deactivate:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},openSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},openImmediately:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},snapSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},resizeSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},closeSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}}},guards:{initiallyClosed:function(t){return t.initialState==="CLOSED"},initiallyOpen:function(t){return t.initialState==="OPEN"}}}),Fy=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],zy=["velocity"],$y=["onRest","config"],xf=Uv.default,Hy=xf.tension,Di=xf.friction,Gy=u.forwardRef(function(t,e){var n=t.children,r=t.sibling,i=t.className,o=t.footer,s=t.header,a=t.open,l=t.initialState,c=t.lastSnapRef,f=t.initialFocusRef,d=t.onDismiss,p=t.maxHeight,v=t.defaultSnap,g=v===void 0?Zy:v,h=t.snapPoints,w=h===void 0?qy:h,S=t.blocking,y=S===void 0||S,b=t.scrollLocking,O=b===void 0||b,L=t.style,m=t.onSpringStart,x=t.onSpringCancel,C=t.onSpringEnd,R=t.reserveScrollBarGap,M=R===void 0?y:R,_=t.expandOnContentDrag,P=_!==void 0&&_,j=Xi(t,Fy),V=function(){var F=u.useState(!1),te=F[0],J=F[1],pe=u.useState({}),Te=pe[0],xe=pe[1],Ae=u.useCallback(function(Pe){return xe(function(Be){var ae;return ut({},Be,((ae={})[Pe]=!1,ae))}),function(){xe(function(Be){var ae;return ut({},Be,((ae={})[Pe]=!0,ae))})}},[]);return u.useEffect(function(){var Pe=Object.values(Te);Pe.length!==0&&Pe.every(Boolean)&&J(!0)},[Te]),{ready:te,registerReady:Ae}}(),$=V.ready,G=V.registerReady,z=u.useRef(!1),W=u.useRef(m),D=u.useRef(x),k=u.useRef(C);u.useEffect(function(){W.current=m,D.current=x,k.current=C},[x,m,C]);var A,T,N=Hv(function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}}),U=N[0],Z=N[1],I=u.useRef(null),K=u.useRef(null),ee=u.useRef(null),q=u.useRef(null),se=u.useRef(null),de=u.useRef(null),ue=u.useRef(0),Le=u.useRef(),Fe=u.useRef(!1),we=(A=u.useMemo(function(){return typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null},[]),T=u.useRef(A==null?void 0:A.matches),u.useDebugValue(T.current?"reduce":"no-preference"),u.useEffect(function(){var F=function(te){T.current=te.matches};return A==null||A.addListener(F),function(){return A==null?void 0:A.removeListener(F)}},[A]),T),Ee=function(F){var te=F.targetRef,J=F.enabled,pe=F.reserveScrollBarGap,Te=u.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return u.useDebugValue(J?"Enabled":"Disabled"),u.useEffect(function(){if(!J)return Te.current.deactivate(),void(Te.current={activate:function(){},deactivate:function(){}});var xe=te.current,Ae=!1;Te.current={activate:function(){Ae||(Ae=!0,vy(xe,{allowTouchMove:function(Pe){return Pe.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:pe}))},deactivate:function(){Ae&&(Ae=!1,my(xe))}}},[J,te,pe]),Te}({targetRef:K,enabled:$&&O,reserveScrollBarGap:M}),Ie=function(F){var te=F.targetRef,J=F.enabled,pe=u.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return u.useDebugValue(J?"Enabled":"Disabled"),u.useEffect(function(){if(!J)return pe.current.deactivate(),void(pe.current={activate:function(){},deactivate:function(){}});var Te=te.current,xe=!1,Ae=[],Pe=[];pe.current={activate:function(){if(!xe){xe=!0;var Be=Te.parentNode;document.querySelectorAll("body > *").forEach(function(ae){if(ae!==Be){var ve=ae.getAttribute("aria-hidden");ve!==null&&ve!=="false"||(Ae.push(ve),Pe.push(ae),ae.setAttribute("aria-hidden","true"))}})}},deactivate:function(){xe&&(xe=!1,Pe.forEach(function(Be,ae){var ve=Ae[ae];ve===null?Be.removeAttribute("aria-hidden"):Be.setAttribute("aria-hidden",ve)}),Ae=[],Pe=[])}}},[te,J]),pe}({targetRef:I,enabled:$&&y}),Me=function(F){var te=F.targetRef,J=F.fallbackRef,pe=F.initialFocusRef,Te=F.enabled,xe=u.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return u.useDebugValue(Te?"Enabled":"Disabled"),u.useEffect(function(){if(!Te)return xe.current.deactivate(),void(xe.current={activate:function(){},deactivate:function(){}});var Ae=J.current,Pe=uy(te.current,{onActivate:void 0,initialFocus:pe?function(){return(pe==null?void 0:pe.current)||Ae}:void 0,fallbackFocus:Ae,escapeDeactivates:!1,clickOutsideDeactivates:!1}),Be=!1;xe.current={activate:function(){try{return Be?Promise.resolve():(Be=!0,Promise.resolve(Pe.activate()).then(function(){return Promise.resolve(new Promise(function(ae){return setTimeout(function(){return ae(void 0)},0)})).then(function(){})}))}catch(ae){return Promise.reject(ae)}},deactivate:function(){Be&&(Be=!1,Pe.deactivate())}}},[Te,J,pe,te]),xe}({targetRef:I,fallbackRef:de,initialFocusRef:f||void 0,enabled:$&&y&&f!==!1}),Re=function(F){var te=F.getSnapPoints,J=F.heightRef,pe=F.lastSnapRef,Te=F.ready,xe=function(Ke){var ht=Ke.contentRef,gt=Ke.controlledMaxHeight,Qe=Ke.footerEnabled,Nt=Ke.footerRef,Pt=Ke.headerEnabled,vt=Ke.headerRef,tn=Ke.registerReady,Zt=Ke.resizeSourceRef,vr=u.useMemo(function(){return tn("contentHeight")},[tn]),mr=function(nn,Ln,En){var xn=u.useMemo(function(){return Ln("maxHeight")},[Ln]),Cn=u.useState(function(){return Ai(nn)||typeof window<"u"?window.innerHeight:0}),wr=Cn[0],Sr=Cn[1],rn=wr>0,ne=u.useRef(0);return u.useDebugValue(nn?"controlled":"auto"),u.useEffect(function(){rn&&xn()},[rn,xn]),Kr(function(){if(nn)return Sr(Ai(nn)),void(En.current="maxheightprop");var ja=function(){ne.current||(ne.current=requestAnimationFrame(function(){Sr(window.innerHeight),En.current="window",ne.current=0}))};return window.addEventListener("resize",ja),Sr(window.innerHeight),En.current="window",xn(),function(){window.removeEventListener("resize",ja),cancelAnimationFrame(ne.current)}},[nn,xn,En]),wr}(gt,tn,Zt),Fn=os(vt,{label:"headerHeight",enabled:Pt,resizeSourceRef:Zt}),yr=os(ht,{label:"contentHeight",enabled:!0,resizeSourceRef:Zt}),zn=os(Nt,{label:"footerHeight",enabled:Qe,resizeSourceRef:Zt}),Sn=Math.min(mr-Fn-zn,yr)+Fn+zn;u.useDebugValue("minHeight: "+Sn);var br=yr>0;return u.useEffect(function(){br&&vr()},[br,vr]),{maxHeight:mr,minHeight:Sn,headerHeight:Fn,footerHeight:zn}}({contentRef:F.contentRef,controlledMaxHeight:F.controlledMaxHeight,footerEnabled:F.footerEnabled,footerRef:F.footerRef,headerEnabled:F.headerEnabled,headerRef:F.headerRef,registerReady:F.registerReady,resizeSourceRef:F.resizeSourceRef}),Ae=xe.maxHeight,Pe=xe.minHeight,Be=xe.headerHeight,ae=xe.footerHeight,ve=function(Ke,ht){var gt=[].concat(Ke).map(Ai).reduce(function(vt,tn){return vt.add(Or(tn,0,ht)),vt},new Set),Qe=Array.from(gt),Nt=Math.min.apply(Math,Qe);if(Number.isNaN(Nt))throw new TypeError("minSnap is NaN");var Pt=Math.max.apply(Math,Qe);if(Number.isNaN(Pt))throw new TypeError("maxSnap is NaN");return{snapPoints:Qe,minSnap:Nt,maxSnap:Pt}}(Te?te({height:J.current,footerHeight:ae,headerHeight:Be,minHeight:Pe,maxHeight:Ae}):[0],Ae),ft=ve.snapPoints,Wt=ve.minSnap,lt=ve.maxSnap;return u.useDebugValue("minSnap: "+Wt+", maxSnap:"+lt),{minSnap:Wt,maxSnap:lt,findSnap:function(Ke){var ht=Ai(typeof Ke=="function"?Ke({footerHeight:ae,headerHeight:Be,height:J.current,minHeight:Pe,maxHeight:Ae,snapPoints:ft,lastSnap:pe.current}):Ke);return ft.reduce(function(gt,Qe){return Math.abs(Qe-ht)<Math.abs(gt-ht)?Qe:gt},Wt)},maxHeight:Ae}}({contentRef:ee,controlledMaxHeight:p,footerEnabled:!!o,footerRef:se,getSnapPoints:w,headerEnabled:s!==!1,headerRef:q,heightRef:ue,lastSnapRef:c,ready:$,registerReady:G,resizeSourceRef:Le}),re=Re.minSnap,ie=Re.maxSnap,ze=Re.maxHeight,Ye=Re.findSnap,Y=u.useRef(ze),$e=u.useRef(re),Ne=u.useRef(ie),pt=u.useRef(Ye),at=u.useRef(0);Kr(function(){Y.current=ze,Ne.current=ie,$e.current=re,pt.current=Ye,at.current=Ye(g)},[Ye,g,ze,ie,re]);var oe=u.useCallback(function(F){var te=F.onRest,J=F.config,pe=(J=J===void 0?{}:J).velocity,Te=pe===void 0?1:pe,xe=Xi(J,zy),Ae=Xi(F,$y);return new Promise(function(Pe){return Z(ut({},Ae,{config:ut({velocity:Te},xe,{mass:1,tension:Hy,friction:Math.max(Di,Di+(Di-Di*Te))}),onRest:function(){var Be=[].slice.call(arguments);Pe.apply(void 0,Be),te==null||te.apply(void 0,Be)}}))})},[Z]),wn=Lv(Vy,{devTools:!1,actions:{onOpenCancel:u.useCallback(function(){return D.current==null?void 0:D.current({type:"OPEN"})},[]),onSnapCancel:u.useCallback(function(F){return D.current==null?void 0:D.current({type:"SNAP",source:F.snapSource})},[]),onCloseCancel:u.useCallback(function(){return D.current==null?void 0:D.current({type:"CLOSE"})},[]),onResizeCancel:u.useCallback(function(){return D.current==null?void 0:D.current({type:"RESIZE",source:Le.current})},[]),onOpenEnd:u.useCallback(function(){return k.current==null?void 0:k.current({type:"OPEN"})},[]),onSnapEnd:u.useCallback(function(F,te){return k.current==null?void 0:k.current({type:"SNAP",source:F.snapSource})},[]),onResizeEnd:u.useCallback(function(){return k.current==null?void 0:k.current({type:"RESIZE",source:Le.current})},[])},context:{initialState:l},services:{onSnapStart:u.useCallback(function(F,te){try{return Promise.resolve(W.current==null?void 0:W.current({type:"SNAP",source:te.payload.source||"custom"}))}catch(J){return Promise.reject(J)}},[]),onOpenStart:u.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"OPEN"}))}catch(F){return Promise.reject(F)}},[]),onCloseStart:u.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"CLOSE"}))}catch(F){return Promise.reject(F)}},[]),onResizeStart:u.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"RESIZE",source:Le.current}))}catch(F){return Promise.reject(F)}},[]),onSnapEnd:u.useCallback(function(F,te){try{return Promise.resolve(k.current==null?void 0:k.current({type:"SNAP",source:F.snapSource}))}catch(J){return Promise.reject(J)}},[]),onOpenEnd:u.useCallback(function(){try{return Promise.resolve(k.current==null?void 0:k.current({type:"OPEN"}))}catch(F){return Promise.reject(F)}},[]),onCloseEnd:u.useCallback(function(){try{return Promise.resolve(k.current==null?void 0:k.current({type:"CLOSE"}))}catch(F){return Promise.reject(F)}},[]),onResizeEnd:u.useCallback(function(){try{return Promise.resolve(k.current==null?void 0:k.current({type:"RESIZE",source:Le.current}))}catch(F){return Promise.reject(F)}},[]),renderVisuallyHidden:u.useCallback(function(F,te){try{return Promise.resolve(oe({y:at.current,ready:0,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:!0})).then(function(){})}catch(J){return Promise.reject(J)}},[oe]),activate:u.useCallback(function(F,te){try{return z.current=!0,Promise.resolve(Promise.all([Ee.current.activate(),Me.current.activate(),Ie.current.activate()])).then(function(){})}catch(J){return Promise.reject(J)}},[Ie,Me,Ee]),deactivate:u.useCallback(function(){try{return Ee.current.deactivate(),Me.current.deactivate(),Ie.current.deactivate(),z.current=!1,Promise.resolve()}catch(F){return Promise.reject(F)}},[Ie,Me,Ee]),openImmediately:u.useCallback(function(){try{return ue.current=at.current,Promise.resolve(oe({y:at.current,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:!0})).then(function(){})}catch(F){return Promise.reject(F)}},[oe]),openSmoothly:u.useCallback(function(){try{return Promise.resolve(oe({y:0,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:!0})).then(function(){return ue.current=at.current,Promise.resolve(oe({y:at.current,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:we.current})).then(function(){})})}catch(F){return Promise.reject(F)}},[oe,we]),snapSmoothly:u.useCallback(function(F,te){try{var J=pt.current(F.y);return ue.current=J,c.current=J,Promise.resolve(oe({y:J,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:$e.current,immediate:we.current,config:{velocity:F.velocity}})).then(function(){})}catch(pe){return Promise.reject(pe)}},[oe,c,we]),resizeSmoothly:u.useCallback(function(){try{var F=pt.current(ue.current);return ue.current=F,c.current=F,Promise.resolve(oe({y:F,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:$e.current,immediate:Le.current!=="element"||we.current})).then(function(){})}catch(te){return Promise.reject(te)}},[oe,c,we]),closeSmoothly:u.useCallback(function(F,te){try{return oe({minSnap:ue.current,immediate:!0}),ue.current=0,Promise.resolve(oe({y:0,maxHeight:Y.current,maxSnap:Ne.current,immediate:we.current})).then(function(){return Promise.resolve(oe({ready:0,immediate:!0})).then(function(){})})}catch(J){return Promise.reject(J)}},[oe,we])}}),hi=wn[0],Mt=wn[1];u.useEffect(function(){$&&Mt(a?"OPEN":"CLOSE")},[a,Mt,$]),Kr(function(){(ze||ie||re)&&Mt("RESIZE")},[ze,ie,re,Mt]),u.useEffect(function(){return function(){Ee.current.deactivate(),Me.current.deactivate(),Ie.current.deactivate()}},[Ie,Me,Ee]),u.useImperativeHandle(e,function(){return{snapTo:function(F,te){var J=te===void 0?{}:te,pe=J.velocity,Te=pe===void 0?1:pe,xe=J.source,Ae=xe===void 0?"custom":xe;Mt("SNAP",{payload:{y:pt.current(F),velocity:Te,source:Ae}})},get height(){return ue.current}}},[Mt]),u.useEffect(function(){var F=K.current,te=function(pe){Fe.current&&pe.preventDefault()},J=function(pe){F.scrollTop<0&&(requestAnimationFrame(function(){F.style.overflow="hidden",F.scrollTop=0,F.style.removeProperty("overflow")}),pe.preventDefault())};return P&&(F.addEventListener("scroll",te),F.addEventListener("touchmove",te),F.addEventListener("touchstart",J)),function(){F.removeEventListener("scroll",te),F.removeEventListener("touchmove",te),F.removeEventListener("touchstart",J)}},[P,K]);var Gt=Gm(function(F){var te=F.args,J=(te=te===void 0?[]:te)[0],pe=(J=J===void 0?{}:J).closeOnTap,Te=pe!==void 0&&pe,xe=J.isContentDragging,Ae=xe!==void 0&&xe,Pe=F.cancel,Be=F.direction[1],ae=F.down,ve=F.first,ft=F.last,Wt=F.memo,lt=Wt===void 0?U.y.getValue():Wt,Ke=F.tap,ht=F.velocity,gt=-1*F.movement[1];if(!z.current)return Pe(),lt;if(d&&Te&&Ke)return Pe(),setTimeout(function(){return d()},0),lt;if(Ke)return lt;var Qe=lt+gt,Nt=gt*ht,Pt=Math.max($e.current,Math.min(Ne.current,Qe+2*Nt));if(!ae&&d&&Be>0&&Qe+Nt<$e.current/2)return Pe(),d(),lt;var vt=ae?d||$e.current!==Ne.current?Gr(Qe,d?0:$e.current,Ne.current,.55):Qe<$e.current?Gr(Qe,$e.current,2*Ne.current,.55):Gr(Qe,$e.current/2,Ne.current,.55):Pt;return P&&Ae?(vt>=Ne.current&&(vt=Ne.current),lt===Ne.current&&K.current.scrollTop>0&&(vt=Ne.current),Fe.current=vt<Ne.current):Fe.current=!1,ve&&Mt("DRAG"),ft?(Mt("SNAP",{payload:{y:vt,velocity:ht>.05?ht:1,source:"dragging"}}),lt):(Z({y:vt,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:$e.current,immediate:!0,config:{velocity:ht}}),lt)},{filterTaps:!0});if(Number.isNaN(Ne.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN($e.current))throw new TypeError("minSnapRef is NaN!!");var gi=function(F){var te,J=F.spring,pe=Wn([J.y,J.maxHeight],function(ae,ve){return Math.round(Or(ve-ae,0,16))+"px"}),Te=Wn([J.y,J.minSnap,J.maxSnap],function(ae,ve,ft){return Or(ae,ve,ft)+"px"}),xe=Wn([J.y,J.minSnap,J.maxSnap],function(ae,ve,ft){return ae<ve?ve-ae+"px":ae>ft?ft-ae+"px":"0px"}),Ae=Wn([J.y,J.maxSnap],function(ae,ve){return ae>=ve?Math.ceil(ae-ve):0}),Pe=Wn([J.y,J.minSnap],function(ae,ve){if(!ve)return 0;var ft=Math.max(ve/2-45,0);return Or((ae-ft)*(1/(Math.min(ve/2+45,ve)-ft)+0),0,1)}),Be=Wn([J.y,J.minSnap],function(ae,ve){return ve?Or(ae/ve,0,1):0});return(te={})["--rsbs-content-opacity"]=Pe,te["--rsbs-backdrop-opacity"]=Be,te["--rsbs-antigap-scale-y"]=Ae,te["--rsbs-overlay-translate-y"]=xe,te["--rsbs-overlay-rounded"]=pe,te["--rsbs-overlay-h"]=Te,te}({spring:U});return u.createElement(cm.div,ut({},j,{"data-rsbs-root":!0,"data-rsbs-state":Wy.find(hi.matches),"data-rsbs-is-blocking":y,"data-rsbs-is-dismissable":!!d,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!o,className:i,ref:I,style:ut({},gi,L,{opacity:U.ready})}),r,y&&u.createElement("div",ut({key:"backdrop","data-rsbs-backdrop":!0},Gt({closeOnTap:!0}))),u.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:de,onKeyDown:function(F){F.key==="Escape"&&(F.stopPropagation(),d&&d())}},s!==!1&&u.createElement("div",ut({key:"header","data-rsbs-header":!0,ref:q},Gt()),s),u.createElement("div",ut({key:"scroll","data-rsbs-scroll":!0,ref:K},P?Gt({isContentDragging:!0}):{}),u.createElement("div",{"data-rsbs-content":!0,ref:ee},n)),o&&u.createElement("div",ut({key:"footer",ref:se,"data-rsbs-footer":!0},Gt()),o)))}),Wy=["closed","opening","open","closing","dragging","snapping","resizing"];function Zy(t){var e=t.lastSnap;return e??Math.min.apply(Math,t.snapPoints)}function qy(t){return t.minHeight}var Ky=["onSpringStart","onSpringEnd","skipInitialTransition"],Cf=u.forwardRef(function(t,e){var n=t.onSpringStart,r=t.onSpringEnd,i=t.skipInitialTransition,o=Xi(t,Ky),s=u.useState(!1),a=s[0],l=s[1],c=u.useRef(),f=u.useRef(null),d=u.useRef(i&&o.open?"OPEN":"CLOSED");Kr(function(){if(o.open)return cancelAnimationFrame(c.current),l(!0),function(){d.current="CLOSED"}},[o.open]);var p=u.useCallback(function(g){return Promise.resolve(n==null?void 0:n(g)).then(function(){g.type==="OPEN"&&cancelAnimationFrame(c.current)})},[n]),v=u.useCallback(function(g){return Promise.resolve(r==null?void 0:r(g)).then(function(){g.type==="CLOSE"&&(c.current=requestAnimationFrame(function(){return l(!1)}))})},[r]);return a?u.createElement(mg,{"data-rsbs-portal":!0},u.createElement(Gy,ut({},o,{lastSnapRef:f,ref:e,initialState:d.current,onSpringStart:p,onSpringEnd:v}))):null});const Jy=t=>{const[e,n]=t.split(":");return Number(e)*60+Number(n)},Yy=t=>{const e=Math.floor(t/60),n=t%60;return`${e<10?`0${e}`:e}:${n<10?`0${n}`:n}`},Xy=(t,e)=>[[t[0]-e,t[0]+e],[t[1]-e,t[1]+e]];function _f(t,e){return function(){return t.apply(e,arguments)}}const{toString:Qy}=Object.prototype,{getPrototypeOf:ma}=Object,Io=(t=>e=>{const n=Qy.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ht=t=>(t=t.toLowerCase(),e=>Io(e)===t),jo=t=>e=>typeof e===t,{isArray:hr}=Array,oi=jo("undefined");function e0(t){return t!==null&&!oi(t)&&t.constructor!==null&&!oi(t.constructor)&&Ot(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Of=Ht("ArrayBuffer");function t0(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Of(t.buffer),e}const n0=jo("string"),Ot=jo("function"),Mf=jo("number"),No=t=>t!==null&&typeof t=="object",r0=t=>t===!0||t===!1,Qi=t=>{if(Io(t)!=="object")return!1;const e=ma(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},i0=Ht("Date"),o0=Ht("File"),s0=Ht("Blob"),a0=Ht("FileList"),l0=t=>No(t)&&Ot(t.pipe),c0=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ot(t.append)&&((e=Io(t))==="formdata"||e==="object"&&Ot(t.toString)&&t.toString()==="[object FormData]"))},u0=Ht("URLSearchParams"),f0=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ui(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),hr(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function Pf(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const kf=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Rf=t=>!oi(t)&&t!==kf;function $s(){const{caseless:t}=Rf(this)&&this||{},e={},n=(r,i)=>{const o=t&&Pf(e,i)||i;Qi(e[o])&&Qi(r)?e[o]=$s(e[o],r):Qi(r)?e[o]=$s({},r):hr(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ui(arguments[r],n);return e}const d0=(t,e,n,{allOwnKeys:r}={})=>(ui(e,(i,o)=>{n&&Ot(i)?t[o]=_f(i,n):t[o]=i},{allOwnKeys:r}),t),p0=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),h0=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},g0=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&ma(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},v0=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},m0=t=>{if(!t)return null;if(hr(t))return t;let e=t.length;if(!Mf(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},y0=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ma(Uint8Array)),b0=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},w0=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},S0=Ht("HTMLFormElement"),L0=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Al=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),E0=Ht("RegExp"),Tf=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ui(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},x0=t=>{Tf(t,(e,n)=>{if(Ot(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Ot(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},C0=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return hr(t)?r(t):r(String(t).split(e)),n},_0=()=>{},O0=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ss="abcdefghijklmnopqrstuvwxyz",Dl="0123456789",Af={DIGIT:Dl,ALPHA:ss,ALPHA_DIGIT:ss+ss.toUpperCase()+Dl},M0=(t=16,e=Af.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function P0(t){return!!(t&&Ot(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const k0=t=>{const e=new Array(10),n=(r,i)=>{if(No(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=hr(r)?[]:{};return ui(r,(s,a)=>{const l=n(s,i+1);!oi(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},R0=Ht("AsyncFunction"),T0=t=>t&&(No(t)||Ot(t))&&Ot(t.then)&&Ot(t.catch),B={isArray:hr,isArrayBuffer:Of,isBuffer:e0,isFormData:c0,isArrayBufferView:t0,isString:n0,isNumber:Mf,isBoolean:r0,isObject:No,isPlainObject:Qi,isUndefined:oi,isDate:i0,isFile:o0,isBlob:s0,isRegExp:E0,isFunction:Ot,isStream:l0,isURLSearchParams:u0,isTypedArray:y0,isFileList:a0,forEach:ui,merge:$s,extend:d0,trim:f0,stripBOM:p0,inherits:h0,toFlatObject:g0,kindOf:Io,kindOfTest:Ht,endsWith:v0,toArray:m0,forEachEntry:b0,matchAll:w0,isHTMLForm:S0,hasOwnProperty:Al,hasOwnProp:Al,reduceDescriptors:Tf,freezeMethods:x0,toObjectSet:C0,toCamelCase:L0,noop:_0,toFiniteNumber:O0,findKey:Pf,global:kf,isContextDefined:Rf,ALPHABET:Af,generateString:M0,isSpecCompliantForm:P0,toJSONObject:k0,isAsyncFn:R0,isThenable:T0};function Se(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}B.inherits(Se,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Df=Se.prototype,If={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{If[t]={value:t}});Object.defineProperties(Se,If);Object.defineProperty(Df,"isAxiosError",{value:!0});Se.from=(t,e,n,r,i,o)=>{const s=Object.create(Df);return B.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Se.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const A0=null;function Hs(t){return B.isPlainObject(t)||B.isArray(t)}function jf(t){return B.endsWith(t,"[]")?t.slice(0,-2):t}function Il(t,e,n){return t?t.concat(e).map(function(i,o){return i=jf(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function D0(t){return B.isArray(t)&&!t.some(Hs)}const I0=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});function Bo(t,e,n){if(!B.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,w){return!B.isUndefined(w[h])});const r=n.metaTokens,i=n.visitor||f,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(i))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(B.isDate(g))return g.toISOString();if(!l&&B.isBlob(g))throw new Se("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(g)||B.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function f(g,h,w){let S=g;if(g&&!w&&typeof g=="object"){if(B.endsWith(h,"{}"))h=r?h:h.slice(0,-2),g=JSON.stringify(g);else if(B.isArray(g)&&D0(g)||(B.isFileList(g)||B.endsWith(h,"[]"))&&(S=B.toArray(g)))return h=jf(h),S.forEach(function(b,O){!(B.isUndefined(b)||b===null)&&e.append(s===!0?Il([h],O,o):s===null?h:h+"[]",c(b))}),!1}return Hs(g)?!0:(e.append(Il(w,h,o),c(g)),!1)}const d=[],p=Object.assign(I0,{defaultVisitor:f,convertValue:c,isVisitable:Hs});function v(g,h){if(!B.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(g),B.forEach(g,function(S,y){(!(B.isUndefined(S)||S===null)&&i.call(e,S,B.isString(y)?y.trim():y,h,p))===!0&&v(S,h?h.concat(y):[y])}),d.pop()}}if(!B.isObject(t))throw new TypeError("data must be an object");return v(t),e}function jl(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ya(t,e){this._pairs=[],t&&Bo(t,this,e)}const Nf=ya.prototype;Nf.append=function(e,n){this._pairs.push([e,n])};Nf.toString=function(e){const n=e?function(r){return e.call(this,r,jl)}:jl;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function j0(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bf(t,e,n){if(!e)return t;const r=n&&n.encode||j0,i=n&&n.serialize;let o;if(i?o=i(e,n):o=B.isURLSearchParams(e)?e.toString():new ya(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class N0{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Nl=N0,Uf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},B0=typeof URLSearchParams<"u"?URLSearchParams:ya,U0=typeof FormData<"u"?FormData:null,V0=typeof Blob<"u"?Blob:null,F0=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),z0=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Vt={isBrowser:!0,classes:{URLSearchParams:B0,FormData:U0,Blob:V0},isStandardBrowserEnv:F0,isStandardBrowserWebWorkerEnv:z0,protocols:["http","https","file","blob","url","data"]};function $0(t,e){return Bo(t,new Vt.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Vt.isNode&&B.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function H0(t){return B.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function G0(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function Vf(t){function e(n,r,i,o){let s=n[o++];const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&B.isArray(i)?i.length:s,l?(B.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!B.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&B.isArray(i[s])&&(i[s]=G0(i[s])),!a)}if(B.isFormData(t)&&B.isFunction(t.entries)){const n={};return B.forEachEntry(t,(r,i)=>{e(H0(r),i,n,0)}),n}return null}function W0(t,e,n){if(B.isString(t))try{return(e||JSON.parse)(t),B.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ba={transitional:Uf,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=B.isObject(e);if(o&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return i&&i?JSON.stringify(Vf(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $0(e,this.formSerializer).toString();if((a=B.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Bo(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),W0(e)):e}],transformResponse:[function(e){const n=this.transitional||ba.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&B.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?Se.from(a,Se.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vt.classes.FormData,Blob:Vt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],t=>{ba.headers[t]={}});const wa=ba,Z0=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),q0=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
45
|
-
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&
|
|
46
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[
|
|
47
|
-
`+o.map(
|
|
48
|
-
`):" "+Vl(o[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Gs};function cs(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new fi(null,t)}function Fl(t){return cs(t),t.headers=Qt.from(t.headers),t.data=ls.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),$f.getAdapter(t.adapter||wa.adapter)(t).then(function(r){return cs(t),r.data=ls.call(t,t.transformResponse,r),r.headers=Qt.from(r.headers),r},function(r){return Ff(r)||(cs(t),r&&r.response&&(r.response.data=ls.call(t,t.transformResponse,r.response),r.response.headers=Qt.from(r.response.headers))),Promise.reject(r)})}const zl=t=>t instanceof Qt?t.toJSON():t;function cr(t,e){e=e||{};const n={};function r(c,f,d){return B.isPlainObject(c)&&B.isPlainObject(f)?B.merge.call({caseless:d},c,f):B.isPlainObject(f)?B.merge({},f):B.isArray(f)?f.slice():f}function i(c,f,d){if(B.isUndefined(f)){if(!B.isUndefined(c))return r(void 0,c,d)}else return r(c,f,d)}function o(c,f){if(!B.isUndefined(f))return r(void 0,f)}function s(c,f){if(B.isUndefined(f)){if(!B.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,d){if(d in e)return r(c,f);if(d in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,f)=>i(zl(c),zl(f),!0)};return B.forEach(Object.keys(Object.assign({},t,e)),function(f){const d=l[f]||i,p=d(t[f],e[f],f);B.isUndefined(p)&&d!==a||(n[f]=p)}),n}const Hf="1.6.0",Sa={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Sa[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const $l={};Sa.transitional=function(e,n,r){function i(o,s){return"[Axios v"+Hf+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new Se(i(s," has been removed"+(n?" in "+n:"")),Se.ERR_DEPRECATED);return n&&!$l[s]&&($l[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function cb(t,e,n){if(typeof t!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new Se("option "+o+" must be "+l,Se.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Se("Unknown option "+o,Se.ERR_BAD_OPTION)}}const Ws={assertOptions:cb,validators:Sa},sn=Ws.validators;class Eo{constructor(e){this.defaults=e,this.interceptors={request:new Nl,response:new Nl}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=cr(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Ws.assertOptions(r,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},!1),i!=null&&(B.isFunction(i)?n.paramsSerializer={serialize:i}:Ws.assertOptions(i,{encode:sn.function,serialize:sn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&B.merge(o.common,o[n.method]);o&&B.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=Qt.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(l=l&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let f,d=0,p;if(!l){const g=[Fl.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),p=g.length,f=Promise.resolve(n);d<p;)f=f.then(g[d++],g[d++]);return f}p=a.length;let v=n;for(d=0;d<p;){const g=a[d++],h=a[d++];try{v=g(v)}catch(w){h.call(this,w);break}}try{f=Fl.call(this,v)}catch(g){return Promise.reject(g)}for(d=0,p=c.length;d<p;)f=f.then(c[d++],c[d++]);return f}getUri(e){e=cr(this.defaults,e);const n=zf(e.baseURL,e.url);return Bf(n,e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],function(e){Eo.prototype[e]=function(n,r){return this.request(cr(r||{},{method:e,url:n,data:(r||{}).data}))}});B.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(cr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Eo.prototype[e]=n(),Eo.prototype[e+"Form"]=n(!0)});const to=Eo;class La{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new fi(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new La(function(i){e=i}),cancel:e}}}const ub=La;function fb(t){return function(n){return t.apply(null,n)}}function db(t){return B.isObject(t)&&t.isAxiosError===!0}const Zs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Zs).forEach(([t,e])=>{Zs[e]=t});const pb=Zs;function Gf(t){const e=new to(t),n=_f(to.prototype.request,e);return B.extend(n,to.prototype,e,{allOwnKeys:!0}),B.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Gf(cr(t,i))},n}const Je=Gf(wa);Je.Axios=to;Je.CanceledError=fi;Je.CancelToken=ub;Je.isCancel=Ff;Je.VERSION=Hf;Je.toFormData=Bo;Je.AxiosError=Se;Je.Cancel=Je.CanceledError;Je.all=function(e){return Promise.all(e)};Je.spread=fb;Je.isAxiosError=db;Je.mergeConfig=cr;Je.AxiosHeaders=Qt;Je.formToJSON=t=>Vf(B.isHTMLForm(t)?new FormData(t):t);Je.getAdapter=$f.getAdapter;Je.HttpStatusCode=pb;Je.default=Je;const hb=Je,si=hb.create({baseURL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/"}),gb=512;var Kt=(t=>(t[t.All=0]="All",t[t.PickPoint=20]="PickPoint",t[t.PostOffice=30]="PostOffice",t))(Kt||{}),Dt=(t=>(t[t.PayByCash=0]="PayByCash",t[t.DressingRoom=1]="DressingRoom",t[t.CheckOrder=2]="CheckOrder",t))(Dt||{}),It=(t=>(t[t.Return=0]="Return",t[t.Payment=1]="Payment",t[t.Shipping=2]="Shipping",t))(It||{});const vb={[Dt.CheckOrder]:["is_check_order","is_delivery"],[Dt.DressingRoom]:["is_dressing_room","is_delivery"],[Dt.PayByCash]:["pay_by_cash","pay_by_card","is_delivery"]},mb={[It.Return]:["is_pickup"],[It.Shipping]:["is_pickup"],[It.Payment]:["pay_by_cash","pay_by_card","is_pickup"]};async function*qs({q:t,filter:e,bounds:n}={},{controller:r}={}){const i={status:30,page_size:gb};if(t&&(i.q=t),e!=null&&e.type&&(i.type=e.type),e!=null&&e.receive)for(const[l,c]of Object.entries(e==null?void 0:e.receive)){if(!c)continue;const f=vb[l];for(const d of f)i[d]=!0}if(e!=null&&e.send)for(const[l,c]of Object.entries(e==null?void 0:e.send)){if(!c)continue;const f=mb[l];for(const d of f)i[d]=!0}n&&(i.start_latitude=n[0][0],i.end_latitude=n[0][1],i.start_longitude=n[1][0],i.end_longitude=n[1][1]);let o=await si.get("/locations/points",{params:i,signal:r==null?void 0:r.signal}),s=o.data.data.num_pages,a=o.data.data.current_page;for(;a<s;){yield o,i.page=a+1;const l=await si.get("/locations/points",{params:i,signal:r==null?void 0:r.signal});o.data.data.results=[...o.data.data.results,...l.data.data.results],o=l,a=l.data.data.current_page,s=l.data.data.num_pages}return yield o,o}const Hl=[],Ks=(t,e,n)=>{var i;const r=new AbortController;return t&&((i=Hl.pop())==null||i.abort()),Hl.push(r),async o=>{const s={controller:r};if(!n){const l=await qs({filter:e},s).next();o(l.value.data);return}for await(const a of qs({filter:e,bounds:n},s))o(a.data)}},Wf=":root",Vo=(t,e)=>{var n;(n=document.querySelector(Wf))==null||n.style.setProperty(t,e)},Js=t=>{t.stopImmediatePropagation()};var Zf={},qf={exports:{}};(function(t){var e=function(n){var r=Object.prototype,i=r.hasOwnProperty,o=Object.defineProperty||function(D,k,A){D[k]=A.value},s,a=typeof Symbol=="function"?Symbol:{},l=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function d(D,k,A){return Object.defineProperty(D,k,{value:A,enumerable:!0,configurable:!0,writable:!0}),D[k]}try{d({},"")}catch{d=function(k,A,T){return k[A]=T}}function p(D,k,A,T){var N=k&&k.prototype instanceof b?k:b,U=Object.create(N.prototype),Z=new G(T||[]);return o(U,"_invoke",{value:P(D,A,Z)}),U}n.wrap=p;function v(D,k,A){try{return{type:"normal",arg:D.call(k,A)}}catch(T){return{type:"throw",arg:T}}}var g="suspendedStart",h="suspendedYield",w="executing",S="completed",y={};function b(){}function O(){}function L(){}var m={};d(m,l,function(){return this});var x=Object.getPrototypeOf,C=x&&x(x(z([])));C&&C!==r&&i.call(C,l)&&(m=C);var R=L.prototype=b.prototype=Object.create(m);O.prototype=L,o(R,"constructor",{value:L,configurable:!0}),o(L,"constructor",{value:O,configurable:!0}),O.displayName=d(L,f,"GeneratorFunction");function M(D){["next","throw","return"].forEach(function(k){d(D,k,function(A){return this._invoke(k,A)})})}n.isGeneratorFunction=function(D){var k=typeof D=="function"&&D.constructor;return k?k===O||(k.displayName||k.name)==="GeneratorFunction":!1},n.mark=function(D){return Object.setPrototypeOf?Object.setPrototypeOf(D,L):(D.__proto__=L,d(D,f,"GeneratorFunction")),D.prototype=Object.create(R),D},n.awrap=function(D){return{__await:D}};function _(D,k){function A(U,Z,I,K){var ee=v(D[U],D,Z);if(ee.type==="throw")K(ee.arg);else{var q=ee.arg,se=q.value;return se&&typeof se=="object"&&i.call(se,"__await")?k.resolve(se.__await).then(function(de){A("next",de,I,K)},function(de){A("throw",de,I,K)}):k.resolve(se).then(function(de){q.value=de,I(q)},function(de){return A("throw",de,I,K)})}}var T;function N(U,Z){function I(){return new k(function(K,ee){A(U,Z,K,ee)})}return T=T?T.then(I,I):I()}o(this,"_invoke",{value:N})}M(_.prototype),d(_.prototype,c,function(){return this}),n.AsyncIterator=_,n.async=function(D,k,A,T,N){N===void 0&&(N=Promise);var U=new _(p(D,k,A,T),N);return n.isGeneratorFunction(k)?U:U.next().then(function(Z){return Z.done?Z.value:U.next()})};function P(D,k,A){var T=g;return function(U,Z){if(T===w)throw new Error("Generator is already running");if(T===S){if(U==="throw")throw Z;return W()}for(A.method=U,A.arg=Z;;){var I=A.delegate;if(I){var K=j(I,A);if(K){if(K===y)continue;return K}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(T===g)throw T=S,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);T=w;var ee=v(D,k,A);if(ee.type==="normal"){if(T=A.done?S:h,ee.arg===y)continue;return{value:ee.arg,done:A.done}}else ee.type==="throw"&&(T=S,A.method="throw",A.arg=ee.arg)}}}function j(D,k){var A=k.method,T=D.iterator[A];if(T===s)return k.delegate=null,A==="throw"&&D.iterator.return&&(k.method="return",k.arg=s,j(D,k),k.method==="throw")||A!=="return"&&(k.method="throw",k.arg=new TypeError("The iterator does not provide a '"+A+"' method")),y;var N=v(T,D.iterator,k.arg);if(N.type==="throw")return k.method="throw",k.arg=N.arg,k.delegate=null,y;var U=N.arg;if(!U)return k.method="throw",k.arg=new TypeError("iterator result is not an object"),k.delegate=null,y;if(U.done)k[D.resultName]=U.value,k.next=D.nextLoc,k.method!=="return"&&(k.method="next",k.arg=s);else return U;return k.delegate=null,y}M(R),d(R,f,"Generator"),d(R,l,function(){return this}),d(R,"toString",function(){return"[object Generator]"});function V(D){var k={tryLoc:D[0]};1 in D&&(k.catchLoc=D[1]),2 in D&&(k.finallyLoc=D[2],k.afterLoc=D[3]),this.tryEntries.push(k)}function $(D){var k=D.completion||{};k.type="normal",delete k.arg,D.completion=k}function G(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(V,this),this.reset(!0)}n.keys=function(D){var k=Object(D),A=[];for(var T in k)A.push(T);return A.reverse(),function N(){for(;A.length;){var U=A.pop();if(U in k)return N.value=U,N.done=!1,N}return N.done=!0,N}};function z(D){if(D){var k=D[l];if(k)return k.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length)){var A=-1,T=function N(){for(;++A<D.length;)if(i.call(D,A))return N.value=D[A],N.done=!1,N;return N.value=s,N.done=!0,N};return T.next=T}}return{next:W}}n.values=z;function W(){return{value:s,done:!0}}return G.prototype={constructor:G,reset:function(D){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach($),!D)for(var k in this)k.charAt(0)==="t"&&i.call(this,k)&&!isNaN(+k.slice(1))&&(this[k]=s)},stop:function(){this.done=!0;var D=this.tryEntries[0],k=D.completion;if(k.type==="throw")throw k.arg;return this.rval},dispatchException:function(D){if(this.done)throw D;var k=this;function A(K,ee){return U.type="throw",U.arg=D,k.next=K,ee&&(k.method="next",k.arg=s),!!ee}for(var T=this.tryEntries.length-1;T>=0;--T){var N=this.tryEntries[T],U=N.completion;if(N.tryLoc==="root")return A("end");if(N.tryLoc<=this.prev){var Z=i.call(N,"catchLoc"),I=i.call(N,"finallyLoc");if(Z&&I){if(this.prev<N.catchLoc)return A(N.catchLoc,!0);if(this.prev<N.finallyLoc)return A(N.finallyLoc)}else if(Z){if(this.prev<N.catchLoc)return A(N.catchLoc,!0)}else if(I){if(this.prev<N.finallyLoc)return A(N.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(D,k){for(var A=this.tryEntries.length-1;A>=0;--A){var T=this.tryEntries[A];if(T.tryLoc<=this.prev&&i.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var N=T;break}}N&&(D==="break"||D==="continue")&&N.tryLoc<=k&&k<=N.finallyLoc&&(N=null);var U=N?N.completion:{};return U.type=D,U.arg=k,N?(this.method="next",this.next=N.finallyLoc,y):this.complete(U)},complete:function(D,k){if(D.type==="throw")throw D.arg;return D.type==="break"||D.type==="continue"?this.next=D.arg:D.type==="return"?(this.rval=this.arg=D.arg,this.method="return",this.next="end"):D.type==="normal"&&k&&(this.next=k),y},finish:function(D){for(var k=this.tryEntries.length-1;k>=0;--k){var A=this.tryEntries[k];if(A.finallyLoc===D)return this.complete(A.completion,A.afterLoc),$(A),y}},catch:function(D){for(var k=this.tryEntries.length-1;k>=0;--k){var A=this.tryEntries[k];if(A.tryLoc===D){var T=A.completion;if(T.type==="throw"){var N=T.arg;$(A)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(D,k,A){return this.delegate={iterator:z(D),resultName:k,nextLoc:A},this.method==="next"&&(this.arg=s),y}},n}(t.exports);try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})(qf);var yb=qf.exports;(function(t){var e=yb;function n(g,h,w,S,y,b,O){try{var L=g[b](O),m=L.value}catch(x){return void w(x)}L.done?h(m):Promise.resolve(m).then(S,y)}function r(g){return function(){var h=this,w=arguments;return new Promise(function(S,y){var b=g.apply(h,w);function O(m){n(b,S,y,O,L,"next",m)}function L(m){n(b,S,y,O,L,"throw",m)}O(void 0)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=!1,o=null,s="en",a=null,l=null,c="https://maps.googleapis.com/maps/api/geocode/json";function f(g){var h=arguments.length>1&&arguments[1]!==void 0&&arguments[1];i&&(h?console.warn(g):console.log(g))}function d(g){return p.apply(this,arguments)}function p(){return(p=r(e.mark(function g(h){var w,S;return e.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,fetch(h).catch(function(){return Promise.reject(new Error("Error fetching data"))});case 2:return w=y.sent,y.next=5,w.json().catch(function(){return f("Error parsing server response"),Promise.reject(new Error("Error parsing server response"))});case 5:if((S=y.sent).status!=="OK"){y.next=9;break}return f(S),y.abrupt("return",S);case 9:return f("".concat(S.error_message,`.
|
|
49
|
-
Server returned status code `).concat(
|
|
50
|
-
Server returned status code `).concat(S.status))));case 11:case"end":return y.stop()}},g)}))).apply(this,arguments)}var v={setApiKey:function(g){o=g},setLanguage:function(g){s=g},setRegion:function(g){a=g},setLocationType:function(g){l=g},enableDebug:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];i=g},fromLatLng:function(g,h,w,S,y,b){return r(e.mark(function O(){var L,m;return e.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(g&&h){x.next=3;break}return f("Provided coordinates are invalid",!0),x.abrupt("return",Promise.reject(new Error("Provided coordinates are invalid")));case 3:return L="".concat(g,",").concat(h),m="".concat(c,"?latlng=").concat(encodeURIComponent(L)),(w||o)&&(m+="&key=".concat(o=w||o)),(S||s)&&(m+="&language=".concat(s=S||s)),(y||a)&&(a=y||a,m+="®ion=".concat(encodeURIComponent(a))),(b||l)&&(l=b||l,m+="&location_type=".concat(encodeURIComponent(l))),x.abrupt("return",d(m));case 9:case"end":return x.stop()}},O)}))()},fromAddress:function(g,h,w,S){return r(e.mark(function y(){var b;return e.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(g){O.next=3;break}return f("Provided address is invalid",!0),O.abrupt("return",Promise.reject(new Error("Provided address is invalid")));case 3:return b="".concat(c,"?address=").concat(encodeURIComponent(g)),(h||o)&&(b+="&key=".concat(o=h||o)),(w||s)&&(b+="&language=".concat(s=w||s)),(S||a)&&(a=S||a,b+="®ion=".concat(encodeURIComponent(a))),O.abrupt("return",d(b));case 8:case"end":return O.stop()}},y)}))()}};t.default=v})(Zf);const xo=Mo(Zf),ur=async(t,e="ROOFTOP")=>{var i;xo.setLocationType(e);const n=await xo.fromLatLng(t[0].toString(),t[1].toString()),r=(i=n.results)==null?void 0:i.map(o=>{var l,c;const s=(l=o.geometry)==null?void 0:l.viewport,a=(c=o.geometry)==null?void 0:c.location;return{...o,geometry:{...o.geometry,viewport:new google.maps.LatLngBounds(s.southwest,s.northeast),location:new google.maps.LatLng(a)}}});return{...n,results:r}},Ea=(t,e)=>{if(!navigator.geolocation){e==null||e(new GeolocationPositionError),console.error("Geolocation is not supported by your browser");return}navigator.geolocation.getCurrentPosition(t,e,{maximumAge:6e4,timeout:5e3,enableHighAccuracy:!0})},Kf=t=>t.status===200,xa=t=>{const e=document.querySelector(Wf);return e?getComputedStyle(e).getPropertyValue(t):null},Jt=t=>{const e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)},xt=(t,e)=>t.replaceAll("currentColor",xa(e)||""),bb=t=>"comment"in t&&"address"in t&&"apartment_number"in t&&"delivery_time"in t,wb={points:[],error:!1,loaded:!1,loading:!1,reloading:!1},Jf=t=>t.points,Sb=t=>t.loaded,Ca=t=>t.loading,zt=bn()((t,e)=>({...wb,async loadNext(n,r){const i=e().reloading;t({error:!1,reloading:!0}),ye.getState().setBounds(n);let o=0;try{await Ks(i,r,n)(a=>{t(o===0?{points:a.data.results}:{points:[...e().points,...a.data.results]}),o++})}catch{t({error:!0})}finally{t({reloading:!1})}},async loadFirst(n){const r=e().loading,i=Ph(ye.getState());t({error:!1,loading:!0});let o=0;try{await Ks(r,n,i)(a=>{o>=1&&t({loading:!1,loaded:!0}),t(o===0?{points:a.data.results}:{points:[...e().points,...a.data.results]}),o++}),t({loading:!1,loaded:!0})}catch{t({error:!0,loading:!1})}finally{t({loading:!1})}}})),Lb={query:"",type:Kt.All,hours:["08:00","22:00"],send:{[It.Return]:!1,[It.Payment]:!1,[It.Shipping]:!1},receive:{[Dt.PayByCash]:!1,[Dt.CheckOrder]:!1,[Dt.DressingRoom]:!1}},Eb=t=>t.type,xb=t=>t.send,Cb=t=>t.receive,en=bn(t=>({...Lb,setFilter(e){ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null),t(e)}})),_b=()=>{u.useEffect(()=>{zt.getState().loadFirst();const t=en.subscribe(e=>{zt.getState().loadFirst(e)});return()=>{t()}},[])},Pr=".",_a=Symbol("target"),Yf=Symbol("unsubscribe");function Ys(t){return t instanceof Date||t instanceof Set||t instanceof Map||t instanceof WeakSet||t instanceof WeakMap||ArrayBuffer.isView(t)}function Ob(t){return(typeof t=="object"?t===null:typeof t!="function")||t instanceof RegExp}const Ut=Array.isArray;function Oa(t){return typeof t=="symbol"}const Et={after:(t,e)=>Ut(t)?t.slice(e.length):e===""?t:t.slice(e.length+1),concat:(t,e)=>Ut(t)?(t=[...t],e&&t.push(e),t):e&&e.toString!==void 0?(t!==""&&(t+=Pr),Oa(e)?t+e.toString():t+e):t,initial:t=>{if(Ut(t))return t.slice(0,-1);if(t==="")return t;const e=t.lastIndexOf(Pr);return e===-1?"":t.slice(0,e)},last:t=>{if(Ut(t))return t[t.length-1]||"";if(t==="")return t;const e=t.lastIndexOf(Pr);return e===-1?t:t.slice(e+1)},walk:(t,e)=>{if(Ut(t))for(const n of t)e(n);else if(t!==""){let n=0,r=t.indexOf(Pr);if(r===-1)e(t);else for(;n<t.length;)r===-1&&(r=t.length),e(t.slice(n,r)),n=r+1,r=t.indexOf(Pr,n)}},get(t,e){return this.walk(e,n=>{t&&(t=t[n])}),t}};function Mb(t){return typeof t=="object"&&typeof t.next=="function"}function Pb(t,e,n,r,i){const o=t.next;if(e.name==="entries")t.next=function(){const s=o.call(this);return s.done===!1&&(s.value[0]=i(s.value[0],e,s.value[0],r),s.value[1]=i(s.value[1],e,s.value[0],r)),s};else if(e.name==="values"){const s=n[_a].keys();t.next=function(){const a=o.call(this);return a.done===!1&&(a.value=i(a.value,e,s.next().value,r)),a}}else t.next=function(){const s=o.call(this);return s.done===!1&&(s.value=i(s.value,e,s.value,r)),s};return t}function Gl(t,e,n){return t.isUnsubscribed||e.ignoreSymbols&&Oa(n)||e.ignoreUnderscores&&n.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(n)}class kb{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){const n=this._getDescriptorCache();let r=n.get(e);return r===void 0&&(r={},n.set(e,r)),r}_getOwnPropertyDescriptor(e,n){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,n);const r=this._getProperties(e);let i=r[n];return i===void 0&&(i=Reflect.getOwnPropertyDescriptor(e,n),r[n]=i),i}getProxy(e,n,r,i){if(this.isUnsubscribed)return e;const o=e[i],s=o||e;this._pathCache.set(s,n);let a=this._proxyCache.get(s);return a===void 0&&(a=o===void 0?new Proxy(e,r):e,this._proxyCache.set(s,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,n){return!Object.is(e,Et.get(n,this.getPath(e)))}defineProperty(e,n,r){return Reflect.defineProperty(e,n,r)?(this.isUnsubscribed||(this._getProperties(e)[n]=r),!0):!1}setProperty(e,n,r,i,o){if(!this._equals(o,r)||!(n in e)){const s=this._getOwnPropertyDescriptor(e,n);return s!==void 0&&"set"in s?Reflect.set(e,n,r,i):Reflect.set(e,n,r)}return!0}deleteProperty(e,n,r){if(Reflect.deleteProperty(e,n)){if(!this.isUnsubscribed){const i=this._getDescriptorCache().get(e);i&&(delete i[n],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,n,r){const i=this._getOwnPropertyDescriptor(n,r);return e!==void 0&&i!==void 0&&Object.is(e.value,i.value)&&(e.writable||!1)===(i.writable||!1)&&(e.enumerable||!1)===(i.enumerable||!1)&&(e.configurable||!1)===(i.configurable||!1)&&e.get===i.get&&e.set===i.set}isGetInvariant(e,n){const r=this._getOwnPropertyDescriptor(e,n);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}}function Xs(t){return toString.call(t)==="[object Object]"}function Ii(){return!0}function qn(t,e){return t.length!==e.length||t.some((n,r)=>e[r]!==n)}const Xf=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Rb=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),Qf={push:Ii,pop:Ii,shift:Ii,unshift:Ii,copyWithin:qn,reverse:qn,sort:qn,splice:qn,flat:qn,fill:qn},Tb=new Set([...Xf,...Rb,...Object.keys(Qf)]);function ji(t,e){if(t.size!==e.size)return!0;for(const n of t)if(!e.has(n))return!0;return!1}const ed=["keys","values","entries"],td=new Set(["has","toString"]),nd={add:ji,clear:ji,delete:ji,forEach:ji},Ab=new Set([...td,...Object.keys(nd),...ed]);function Ni(t,e){if(t.size!==e.size)return!0;let n;for(const[r,i]of t)if(n=e.get(r),n!==i||n===void 0&&!e.has(r))return!0;return!1}const Db=new Set([...td,"get"]),rd={set:Ni,clear:Ni,delete:Ni,forEach:Ni},Ib=new Set([...Db,...Object.keys(rd),...ed]);class yn{constructor(e,n,r,i){this._path=n,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=i,this._changes=i?[]:null,this.clone=n===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return Xf.has(e)}_shallowClone(e){let n=e;if(Xs(e))n={...e};else if(Ut(e)||ArrayBuffer.isView(e))n=[...e];else if(e instanceof Date)n=new Date(e);else if(e instanceof Set)n=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){n=new Map;for(const[r,i]of e.entries())n.set(r,this._shallowClone(i))}return this._clonedCache.add(n),n}preferredThisArg(e,n,r,i){return e?(Ut(i)?this._onIsChanged=Qf[n]:i instanceof Set?this._onIsChanged=nd[n]:i instanceof Map&&(this._onIsChanged=rd[n]),i):r}update(e,n,r){const i=Et.after(e,this._path);if(n!=="length"){let o=this.clone;Et.walk(i,s=>{o&&o[s]&&(this._clonedCache.has(o[s])||(o[s]=this._shallowClone(o[s])),o=o[s])}),this._hasOnValidate&&this._changes.push({path:i,property:n,previous:r}),o&&o[n]&&(o[n]=r)}this._isChanged=!0}undo(e){let n;for(let r=this._changes.length-1;r!==-1;r--)n=this._changes[r],Et.get(e,n.path)[n.property]=n.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}}class Wl extends yn{static isHandledMethod(e){return Tb.has(e)}}class jb extends yn{undo(e){e.setTime(this.clone.getTime())}isChanged(e,n){return!n(this.clone.valueOf(),e.valueOf())}}class Zl extends yn{static isHandledMethod(e){return Ab.has(e)}undo(e){for(const n of this.clone)e.add(n);for(const n of e)this.clone.has(n)||e.delete(n)}}class ql extends yn{static isHandledMethod(e){return Ib.has(e)}undo(e){for(const[n,r]of this.clone.entries())e.set(n,r);for(const n of e.keys())this.clone.has(n)||e.delete(n)}}class Nb extends yn{constructor(e,n,r,i){super(void 0,n,r,i),this._arg1=r[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}}class Bb extends yn{constructor(e,n,r,i){super(void 0,n,r,i),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){const n=e.has(this._weakKey);this._weakHas&&!n?e.set(this._weakKey,this._weakValue):!this._weakHas&&n?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}}class Rn{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return Xs(e)||Ut(e)||Ys(e)}static isHandledMethod(e,n){return Xs(e)?yn.isHandledMethod(n):Ut(e)?Wl.isHandledMethod(n):e instanceof Set?Zl.isHandledMethod(n):e instanceof Map?ql.isHandledMethod(n):Ys(e)}get isCloning(){return this._stack.length>0}start(e,n,r){let i=yn;Ut(e)?i=Wl:e instanceof Date?i=jb:e instanceof Set?i=Zl:e instanceof Map?i=ql:e instanceof WeakSet?i=Nb:e instanceof WeakMap&&(i=Bb),this._stack.push(new i(e,n,r,this._hasOnValidate))}update(e,n,r){this._stack[this._stack.length-1].update(e,n,r)}preferredThisArg(e,n,r){const{name:i}=e,o=Rn.isHandledMethod(r,i);return this._stack[this._stack.length-1].preferredThisArg(o,i,n,r)}isChanged(e,n,r){return this._stack[this._stack.length-1].isChanged(e,n,r)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}}const Ub={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},Jr=(t,e,n={})=>{n={...Ub,...n};const r=Symbol("ProxyTarget"),{equals:i,isShallow:o,ignoreDetached:s,details:a}=n,l=new kb(i),c=typeof n.onValidate=="function",f=new Rn(c),d=(y,b,O,L,m)=>!c||f.isCloning||n.onValidate(Et.concat(l.getPath(y),b),O,L,m)===!0,p=(y,b,O,L)=>{!Gl(l,n,b)&&!(s&&l.isDetached(y,t))&&v(l.getPath(y),b,O,L)},v=(y,b,O,L,m)=>{f.isCloning?f.update(y,b,L):e(Et.concat(y,b),O,L,m)},g=y=>y&&(y[r]||y),h=(y,b,O,L)=>Ob(y)||O==="constructor"||o&&!Rn.isHandledMethod(b,O)||Gl(l,n,O)||l.isGetInvariant(b,O)||s&&l.isDetached(b,t)?y:(L===void 0&&(L=l.getPath(b)),l.getProxy(y,Et.concat(L,O),w,r)),w={get(y,b,O){if(Oa(b)){if(b===r||b===_a)return y;if(b===Yf&&!l.isUnsubscribed&&l.getPath(y).length===0)return l.unsubscribe(),y}const L=Ys(y)?Reflect.get(y,b):Reflect.get(y,b,O);return h(L,y,b)},set(y,b,O,L){O=g(O);const m=y[r]||y,x=m[b];if(i(x,O)&&b in y)return!0;const C=d(y,b,O,x);return C&&l.setProperty(m,b,O,L,x)?(p(y,b,y[b],x),!0):!C},defineProperty(y,b,O){if(!l.isSameDescriptor(O,y,b)){const L=y[b];d(y,b,O.value,L)&&l.defineProperty(y,b,O,L)&&p(y,b,O.value,L)}return!0},deleteProperty(y,b){if(!Reflect.has(y,b))return!0;const O=Reflect.get(y,b),L=d(y,b,void 0,O);return L&&l.deleteProperty(y,b,O)?(p(y,b,void 0,O),!0):!L},apply(y,b,O){const L=b[r]||b;if(l.isUnsubscribed)return Reflect.apply(y,L,O);if((a===!1||a!==!0&&!a.includes(y.name))&&Rn.isHandledType(L)){let m=Et.initial(l.getPath(y));const x=Rn.isHandledMethod(L,y.name);f.start(L,m,O);let C=Reflect.apply(y,f.preferredThisArg(y,b,L),x?O.map(_=>g(_)):O);const R=f.isChanged(L,i),M=f.stop();if(Rn.isHandledType(C)&&x&&(b instanceof Map&&y.name==="get"&&(m=Et.concat(m,O[0])),C=l.getProxy(C,m,w)),R){const _={name:y.name,args:O,result:C},P=f.isCloning?Et.initial(m):m,j=f.isCloning?Et.last(m):"";d(Et.get(t,P),j,L,M,_)?v(P,j,L,M,_):f.undo(L)}return(b instanceof Map||b instanceof Set)&&Mb(C)?Pb(C,y,b,m,h):C}return Reflect.apply(y,b,O)}},S=l.getProxy(t,n.pathAsArray?[]:"",w);return e=e.bind(S),c&&(n.onValidate=n.onValidate.bind(S)),S};Jr.target=t=>t&&t[_a]||t;Jr.unsubscribe=t=>t[Yf]||t;const Vb=t=>{const e=t??window.OMNIC_WIDGET_LOCATIONS_CONFIG,[n,r]=u.useState({...Mn,...e,map:{...Mn.map,...e==null?void 0:e.map},palette:{...Mn.palette,...e==null?void 0:e.palette}}),i=t&&!window.OMNIC_WIDGET_LOCATIONS_CONFIG,o=!t&&window.OMNIC_WIDGET_LOCATIONS_CONFIG;return u.useEffect(()=>{i&&r({...Mn,...t,map:{...Mn.map,...t.map},palette:{...Mn.palette,...t.palette}})},[t,i]),u.useEffect(()=>{if(o)return window.OMNIC_WIDGET_LOCATIONS_CONFIG=Jr(window.OMNIC_WIDGET_LOCATIONS_CONFIG,function(){const s=Jr.target(this);s.map&&(s.map={...s.map}),s.palette&&(s.palette={...s.palette}),r({...s})}),()=>{window.OMNIC_WIDGET_LOCATIONS_CONFIG&&Jr.unsubscribe(window.OMNIC_WIDGET_LOCATIONS_CONFIG)}},[o]),n},Fb=(t,e)=>{si.defaults.headers.get.Authorization=`INN ${t}`,e!=null&&e.baseURL&&(si.defaults.baseURL=e.baseURL)},zb="Overlay-module__root__y8tkGi",$b={root:zb},Ma=({children:t,className:e})=>E.jsx("div",{className:be($b.root,e),children:t});/*! *****************************************************************************
|
|
44
|
+
*/function bl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function wl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?bl(Object(n),!0).forEach(function(r){fy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function fy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Sl=function(){var t=[];return{activateTrap:function(n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}}}(),dy=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},py=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},hy=function(e){return e.key==="Tab"||e.keyCode===9},Ll=function(e){return setTimeout(e,0)},El=function(e,n){var r=-1;return e.every(function(i,o){return n(i)?(r=o,!1):!0}),r},_r=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},Pi=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},gy=function(e,n){var r=(n==null?void 0:n.document)||document,i=wl({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s,a=function(v,L,C){return v&&v[L]!==void 0?v[L]:i[C||L]},l=function(v){return o.containerGroups.findIndex(function(L){var C=L.container,k=L.tabbableNodes;return C.contains(v)||k.find(function(M){return M===v})})},c=function(v){var L=i[v];if(typeof L=="function"){for(var C=arguments.length,k=new Array(C>1?C-1:0),M=1;M<C;M++)k[M-1]=arguments[M];L=L.apply(void 0,k)}if(L===!0&&(L=void 0),!L){if(L===void 0||L===!1)return L;throw new Error("`".concat(v,"` was specified but was not a node, or did not return a node"))}var O=L;if(typeof L=="string"&&(O=r.querySelector(L),!O))throw new Error("`".concat(v,"` as selector refers to no known node"));return O},f=function(){var v=c("initialFocus");if(v===!1)return!1;if(v===void 0)if(l(r.activeElement)>=0)v=r.activeElement;else{var L=o.tabbableGroups[0],C=L&&L.firstTabbableNode;v=C||c("fallbackFocus")}if(!v)throw new Error("Your focus-trap needs to have at least one focusable element");return v},d=function(){if(o.containerGroups=o.containers.map(function(v){var L=ly(v,i.tabbableOptions),C=cy(v,i.tabbableOptions);return{container:v,tabbableNodes:L,focusableNodes:C,firstTabbableNode:L.length>0?L[0]:null,lastTabbableNode:L.length>0?L[L.length-1]:null,nextTabbableNode:function(M){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,P=C.findIndex(function(j){return j===M});if(!(P<0))return O?C.slice(P+1).find(function(j){return Mi(j,i.tabbableOptions)}):C.slice(0,P).reverse().find(function(j){return Mi(j,i.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(v){return v.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},p=function E(v){if(v!==!1&&v!==r.activeElement){if(!v||!v.focus){E(f());return}v.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=v,dy(v)&&v.select()}},m=function(v){var L=c("setReturnFocus",v);return L||(L===!1?!1:v)},g=function(v){var L=Pi(v);if(!(l(L)>=0)){if(_r(i.clickOutsideDeactivates,v)){s.deactivate({returnFocus:i.returnFocusOnDeactivate&&!is(L,i.tabbableOptions)});return}_r(i.allowOutsideClick,v)||v.preventDefault()}},h=function(v){var L=Pi(v),C=l(L)>=0;C||L instanceof Document?C&&(o.mostRecentlyFocusedNode=L):(v.stopImmediatePropagation(),p(o.mostRecentlyFocusedNode||f()))},S=function(v){var L=Pi(v);d();var C=null;if(o.tabbableGroups.length>0){var k=l(L),M=k>=0?o.containerGroups[k]:void 0;if(k<0)v.shiftKey?C=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:C=o.tabbableGroups[0].firstTabbableNode;else if(v.shiftKey){var O=El(o.tabbableGroups,function(z){var W=z.firstTabbableNode;return L===W});if(O<0&&(M.container===L||is(L,i.tabbableOptions)&&!Mi(L,i.tabbableOptions)&&!M.nextTabbableNode(L,!1))&&(O=k),O>=0){var P=O===0?o.tabbableGroups.length-1:O-1,j=o.tabbableGroups[P];C=j.lastTabbableNode}}else{var U=El(o.tabbableGroups,function(z){var W=z.lastTabbableNode;return L===W});if(U<0&&(M.container===L||is(L,i.tabbableOptions)&&!Mi(L,i.tabbableOptions)&&!M.nextTabbableNode(L))&&(U=k),U>=0){var $=U===o.tabbableGroups.length-1?0:U+1,G=o.tabbableGroups[$];C=G.firstTabbableNode}}}else C=c("fallbackFocus");C&&(v.preventDefault(),p(C))},w=function(v){if(py(v)&&_r(i.escapeDeactivates,v)!==!1){v.preventDefault(),s.deactivate();return}if(hy(v)){S(v);return}},y=function(v){var L=Pi(v);l(L)>=0||_r(i.clickOutsideDeactivates,v)||_r(i.allowOutsideClick,v)||(v.preventDefault(),v.stopImmediatePropagation())},b=function(){if(o.active)return Sl.activateTrap(s),o.delayInitialFocusTimer=i.delayInitialFocus?Ll(function(){p(f())}):p(f()),r.addEventListener("focusin",h,!0),r.addEventListener("mousedown",g,{capture:!0,passive:!1}),r.addEventListener("touchstart",g,{capture:!0,passive:!1}),r.addEventListener("click",y,{capture:!0,passive:!1}),r.addEventListener("keydown",w,{capture:!0,passive:!1}),s},_=function(){if(o.active)return r.removeEventListener("focusin",h,!0),r.removeEventListener("mousedown",g,!0),r.removeEventListener("touchstart",g,!0),r.removeEventListener("click",y,!0),r.removeEventListener("keydown",w,!0),s};return s={get active(){return o.active},get paused(){return o.paused},activate:function(v){if(o.active)return this;var L=a(v,"onActivate"),C=a(v,"onPostActivate"),k=a(v,"checkCanFocusTrap");k||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,L&&L();var M=function(){k&&d(),b(),C&&C()};return k?(k(o.containers.concat()).then(M,M),this):(M(),this)},deactivate:function(v){if(!o.active)return this;var L=wl({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},v);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,_(),o.active=!1,o.paused=!1,Sl.deactivateTrap(s);var C=a(L,"onDeactivate"),k=a(L,"onPostDeactivate"),M=a(L,"checkCanReturnFocus"),O=a(L,"returnFocus","returnFocusOnDeactivate");C&&C();var P=function(){Ll(function(){O&&p(m(o.nodeFocusedBeforeActivation)),k&&k()})};return O&&M?(M(m(o.nodeFocusedBeforeActivation)).then(P,P),this):(P(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,_(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,d(),b(),this)},updateContainerElements:function(v){var L=[].concat(v).filter(Boolean);return o.containers=L.map(function(C){return typeof C=="string"?r.querySelector(C):C}),o.active&&d(),this}},s.updateContainerElements(e),s};function vy(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}else return Array.from(t)}var ma=!1;if(typeof window<"u"){var xl={get passive(){ma=!0}};window.addEventListener("testPassive",null,xl),window.removeEventListener("testPassive",null,xl)}var mf=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),gn=[],So=!1,yf=-1,Wr=void 0,Zr=void 0,bf=function(e){return gn.some(function(n){return!!(n.options.allowTouchMove&&n.options.allowTouchMove(e))})},Lo=function(e){var n=e||window.event;return bf(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},my=function(e){if(Zr===void 0){var n=!!e&&e.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;n&&r>0&&(Zr=document.body.style.paddingRight,document.body.style.paddingRight=r+"px")}Wr===void 0&&(Wr=document.body.style.overflow,document.body.style.overflow="hidden")},yy=function(){Zr!==void 0&&(document.body.style.paddingRight=Zr,Zr=void 0),Wr!==void 0&&(document.body.style.overflow=Wr,Wr=void 0)},by=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},wy=function(e,n){var r=e.targetTouches[0].clientY-yf;return bf(e.target)?!1:n&&n.scrollTop===0&&r>0||by(n)&&r<0?Lo(e):(e.stopPropagation(),!0)},Sy=function(e,n){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!gn.some(function(i){return i.targetElement===e})){var r={targetElement:e,options:n||{}};gn=[].concat(vy(gn),[r]),mf?(e.ontouchstart=function(i){i.targetTouches.length===1&&(yf=i.targetTouches[0].clientY)},e.ontouchmove=function(i){i.targetTouches.length===1&&wy(i,e)},So||(document.addEventListener("touchmove",Lo,ma?{passive:!1}:void 0),So=!0)):my(n)}},Ly=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}gn=gn.filter(function(n){return n.targetElement!==e}),mf?(e.ontouchstart=null,e.ontouchmove=null,So&&gn.length===0&&(document.removeEventListener("touchmove",Lo,ma?{passive:!1}:void 0),So=!1)):gn.length||yy()},In=[],Ey=function(){return In.some(function(t){return t.activeTargets.length>0})},xy=function(){return In.some(function(t){return t.skippedTargets.length>0})},Cl="ResizeObserver loop completed with undelivered notifications.",Cy=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Cl}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Cl),window.dispatchEvent(t)},ii;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ii||(ii={}));var jn=function(t){return Object.freeze(t)},_y=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,jn(this)}return t}(),wf=function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,jn(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,o=e.right,s=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:r,top:i,right:o,bottom:s,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),ya=function(t){return t instanceof SVGElement&&"getBBox"in t},Sf=function(t){if(ya(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},_l=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Oy=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},qr=typeof window<"u"?window:{},ki=new WeakMap,Ol=/auto|scroll/,My=/^tb|vertical/,Py=/msie|trident/i.test(qr.navigator&&qr.navigator.userAgent),Bt=function(t){return parseFloat(t||"0")},nr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new _y((n?e:t)||0,(n?t:e)||0)},Ml=jn({devicePixelContentBoxSize:nr(),borderBoxSize:nr(),contentBoxSize:nr(),contentRect:new wf(0,0,0,0)}),Lf=function(t,e){if(e===void 0&&(e=!1),ki.has(t)&&!e)return ki.get(t);if(Sf(t))return ki.set(t,Ml),Ml;var n=getComputedStyle(t),r=ya(t)&&t.ownerSVGElement&&t.getBBox(),i=!Py&&n.boxSizing==="border-box",o=My.test(n.writingMode||""),s=!r&&Ol.test(n.overflowY||""),a=!r&&Ol.test(n.overflowX||""),l=r?0:Bt(n.paddingTop),c=r?0:Bt(n.paddingRight),f=r?0:Bt(n.paddingBottom),d=r?0:Bt(n.paddingLeft),p=r?0:Bt(n.borderTopWidth),m=r?0:Bt(n.borderRightWidth),g=r?0:Bt(n.borderBottomWidth),h=r?0:Bt(n.borderLeftWidth),S=d+c,w=l+f,y=h+m,b=p+g,_=a?t.offsetHeight-b-t.clientHeight:0,E=s?t.offsetWidth-y-t.clientWidth:0,v=i?S+y:0,L=i?w+b:0,C=r?r.width:Bt(n.width)-v-E,k=r?r.height:Bt(n.height)-L-_,M=C+S+E+y,O=k+w+_+b,P=jn({devicePixelContentBoxSize:nr(Math.round(C*devicePixelRatio),Math.round(k*devicePixelRatio),o),borderBoxSize:nr(M,O,o),contentBoxSize:nr(C,k,o),contentRect:new wf(d,l,C,k)});return ki.set(t,P),P},Ef=function(t,e,n){var r=Lf(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case ii.DEVICE_PIXEL_CONTENT_BOX:return s;case ii.BORDER_BOX:return i;default:return o}},ky=function(){function t(e){var n=Lf(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=jn([n.borderBoxSize]),this.contentBoxSize=jn([n.contentBoxSize]),this.devicePixelContentBoxSize=jn([n.devicePixelContentBoxSize])}return t}(),xf=function(t){if(Sf(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Ry=function(){var t=1/0,e=[];In.forEach(function(s){if(s.activeTargets.length!==0){var a=[];s.activeTargets.forEach(function(c){var f=new ky(c.target),d=xf(c.target);a.push(f),c.lastReportedSize=Ef(c.target,c.observedBox),d<t&&(t=d)}),e.push(function(){s.callback.call(s.observer,a,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},Pl=function(t){In.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(xf(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},Ty=function(){var t=0;for(Pl(t);Ey();)t=Ry(),Pl(t);return xy()&&Cy(),t>0},os,Cf=[],Ay=function(){return Cf.splice(0).forEach(function(t){return t()})},Dy=function(t){if(!os){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Ay()}).observe(n,r),os=function(){n.textContent="".concat(e?e--:e++)}}Cf.push(t),os()},Iy=function(t){Dy(function(){requestAnimationFrame(t)})},Yi=0,jy=function(){return!!Yi},Ny=250,By={attributes:!0,characterData:!0,childList:!0,subtree:!0},kl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Rl=function(t){return t===void 0&&(t=0),Date.now()+t},ss=!1,Uy=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Ny),!ss){ss=!0;var r=Rl(e);Iy(function(){var i=!1;try{i=Ty()}finally{if(ss=!1,e=r-Rl(),!jy())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,By)};document.body?n():qr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),kl.forEach(function(n){return qr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),kl.forEach(function(n){return qr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),Hs=new Uy,Tl=function(t){!Yi&&t>0&&Hs.start(),Yi+=t,!Yi&&Hs.stop()},Vy=function(t){return!ya(t)&&!Oy(t)&&getComputedStyle(t).display==="inline"},Fy=function(){function t(e,n){this.target=e,this.observedBox=n||ii.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Ef(this.target,this.observedBox,!0);return Vy(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),zy=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),Ri=new WeakMap,Al=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ti=function(){function t(){}return t.connect=function(e,n){var r=new zy(e,n);Ri.set(e,r)},t.observe=function(e,n,r){var i=Ri.get(e),o=i.observationTargets.length===0;Al(i.observationTargets,n)<0&&(o&&In.push(i),i.observationTargets.push(new Fy(n,r&&r.box)),Tl(1),Hs.schedule())},t.unobserve=function(e,n){var r=Ri.get(e),i=Al(r.observationTargets,n),o=r.observationTargets.length===1;i>=0&&(o&&In.splice(In.indexOf(r),1),r.observationTargets.splice(i,1),Tl(-1))},t.disconnect=function(e){var n=this,r=Ri.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),$y=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ti.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!_l(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ti.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!_l(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ti.unobserve(this,e)},t.prototype.disconnect=function(){Ti.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function ut(){return ut=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ut.apply(this,arguments)}function Xi(t,e){if(t==null)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}var Kr=typeof window<"u"?u.useLayoutEffect:u.useEffect;function Or(t,e,n){return e=(e=+e)==e?e:0,n=(n=+n)==n?n:0,(t=+t)==t&&(t=(t=t<=n?t:n)>=e?t:e),t}function Ai(t){var e=Math.round(t);if(Number.isNaN(t))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return e}var Hy={box:"border-box"};function as(t,e){var n=e.label,r=e.enabled,i=e.resizeSourceRef,o=u.useState(0),s=o[0],a=o[1];u.useDebugValue(n+": "+s);var l=u.useCallback(function(c){a(c[0].borderBoxSize[0].blockSize),i.current="element"},[i]);return Kr(function(){if(t.current&&r){var c=new $y(l);return c.observe(t.current,Hy),function(){c.disconnect()}}},[t,l,r]),r?s:0}function ct(t){return t===void 0&&(t=1e3),new Promise(function(e){return setTimeout(e,t)})}var Dl={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},Il={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},Gy=mv({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:ut({},Dl,Il)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:ut({},Dl,Il)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:ut({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[yv({y:function(t,e){return e.payload.y},velocity:function(t,e){return e.payload.velocity},snapSource:function(t,e){var n=e.payload.source;return n===void 0?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(t,e){},onSnapCancel:function(t,e){},onResizeCancel:function(t,e){},onCloseCancel:function(t,e){},onOpenEnd:function(t,e){},onSnapEnd:function(t,e){},onRezizeEnd:function(t,e){}},services:{onSnapStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeStart:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onSnapEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeEnd:function(){try{return Promise.resolve(ct()).then(function(){})}catch(t){return Promise.reject(t)}},renderVisuallyHidden:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},activate:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},deactivate:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},openSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},openImmediately:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},snapSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},resizeSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}},closeSmoothly:function(t,e){try{return Promise.resolve(ct()).then(function(){})}catch(n){return Promise.reject(n)}}},guards:{initiallyClosed:function(t){return t.initialState==="CLOSED"},initiallyOpen:function(t){return t.initialState==="OPEN"}}}),Wy=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],Zy=["velocity"],qy=["onRest","config"],_f=Hv.default,Ky=_f.tension,Di=_f.friction,Jy=u.forwardRef(function(t,e){var n=t.children,r=t.sibling,i=t.className,o=t.footer,s=t.header,a=t.open,l=t.initialState,c=t.lastSnapRef,f=t.initialFocusRef,d=t.onDismiss,p=t.maxHeight,m=t.defaultSnap,g=m===void 0?Xy:m,h=t.snapPoints,S=h===void 0?Qy:h,w=t.blocking,y=w===void 0||w,b=t.scrollLocking,_=b===void 0||b,E=t.style,v=t.onSpringStart,L=t.onSpringCancel,C=t.onSpringEnd,k=t.reserveScrollBarGap,M=k===void 0?y:k,O=t.expandOnContentDrag,P=O!==void 0&&O,j=Xi(t,Wy),U=function(){var F=u.useState(!1),te=F[0],J=F[1],pe=u.useState({}),Te=pe[0],xe=pe[1],Ae=u.useCallback(function(Pe){return xe(function(Be){var ae;return ut({},Be,((ae={})[Pe]=!1,ae))}),function(){xe(function(Be){var ae;return ut({},Be,((ae={})[Pe]=!0,ae))})}},[]);return u.useEffect(function(){var Pe=Object.values(Te);Pe.length!==0&&Pe.every(Boolean)&&J(!0)},[Te]),{ready:te,registerReady:Ae}}(),$=U.ready,G=U.registerReady,z=u.useRef(!1),W=u.useRef(v),D=u.useRef(L),R=u.useRef(C);u.useEffect(function(){W.current=v,D.current=L,R.current=C},[L,v,C]);var A,T,N=Kv(function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}}),V=N[0],Z=N[1],I=u.useRef(null),K=u.useRef(null),ee=u.useRef(null),q=u.useRef(null),se=u.useRef(null),de=u.useRef(null),ue=u.useRef(0),Le=u.useRef(),Fe=u.useRef(!1),we=(A=u.useMemo(function(){return typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null},[]),T=u.useRef(A==null?void 0:A.matches),u.useDebugValue(T.current?"reduce":"no-preference"),u.useEffect(function(){var F=function(te){T.current=te.matches};return A==null||A.addListener(F),function(){return A==null?void 0:A.removeListener(F)}},[A]),T),Ee=function(F){var te=F.targetRef,J=F.enabled,pe=F.reserveScrollBarGap,Te=u.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return u.useDebugValue(J?"Enabled":"Disabled"),u.useEffect(function(){if(!J)return Te.current.deactivate(),void(Te.current={activate:function(){},deactivate:function(){}});var xe=te.current,Ae=!1;Te.current={activate:function(){Ae||(Ae=!0,Sy(xe,{allowTouchMove:function(Pe){return Pe.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:pe}))},deactivate:function(){Ae&&(Ae=!1,Ly(xe))}}},[J,te,pe]),Te}({targetRef:K,enabled:$&&_,reserveScrollBarGap:M}),Ie=function(F){var te=F.targetRef,J=F.enabled,pe=u.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return u.useDebugValue(J?"Enabled":"Disabled"),u.useEffect(function(){if(!J)return pe.current.deactivate(),void(pe.current={activate:function(){},deactivate:function(){}});var Te=te.current,xe=!1,Ae=[],Pe=[];pe.current={activate:function(){if(!xe){xe=!0;var Be=Te.parentNode;document.querySelectorAll("body > *").forEach(function(ae){if(ae!==Be){var ve=ae.getAttribute("aria-hidden");ve!==null&&ve!=="false"||(Ae.push(ve),Pe.push(ae),ae.setAttribute("aria-hidden","true"))}})}},deactivate:function(){xe&&(xe=!1,Pe.forEach(function(Be,ae){var ve=Ae[ae];ve===null?Be.removeAttribute("aria-hidden"):Be.setAttribute("aria-hidden",ve)}),Ae=[],Pe=[])}}},[te,J]),pe}({targetRef:I,enabled:$&&y}),Me=function(F){var te=F.targetRef,J=F.fallbackRef,pe=F.initialFocusRef,Te=F.enabled,xe=u.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return u.useDebugValue(Te?"Enabled":"Disabled"),u.useEffect(function(){if(!Te)return xe.current.deactivate(),void(xe.current={activate:function(){},deactivate:function(){}});var Ae=J.current,Pe=gy(te.current,{onActivate:void 0,initialFocus:pe?function(){return(pe==null?void 0:pe.current)||Ae}:void 0,fallbackFocus:Ae,escapeDeactivates:!1,clickOutsideDeactivates:!1}),Be=!1;xe.current={activate:function(){try{return Be?Promise.resolve():(Be=!0,Promise.resolve(Pe.activate()).then(function(){return Promise.resolve(new Promise(function(ae){return setTimeout(function(){return ae(void 0)},0)})).then(function(){})}))}catch(ae){return Promise.reject(ae)}},deactivate:function(){Be&&(Be=!1,Pe.deactivate())}}},[Te,J,pe,te]),xe}({targetRef:I,fallbackRef:de,initialFocusRef:f||void 0,enabled:$&&y&&f!==!1}),Re=function(F){var te=F.getSnapPoints,J=F.heightRef,pe=F.lastSnapRef,Te=F.ready,xe=function(Ke){var ht=Ke.contentRef,gt=Ke.controlledMaxHeight,Qe=Ke.footerEnabled,Nt=Ke.footerRef,Pt=Ke.headerEnabled,vt=Ke.headerRef,tn=Ke.registerReady,Zt=Ke.resizeSourceRef,vr=u.useMemo(function(){return tn("contentHeight")},[tn]),mr=function(nn,Ln,En){var xn=u.useMemo(function(){return Ln("maxHeight")},[Ln]),Cn=u.useState(function(){return Ai(nn)||typeof window<"u"?window.innerHeight:0}),wr=Cn[0],Sr=Cn[1],rn=wr>0,ne=u.useRef(0);return u.useDebugValue(nn?"controlled":"auto"),u.useEffect(function(){rn&&xn()},[rn,xn]),Kr(function(){if(nn)return Sr(Ai(nn)),void(En.current="maxheightprop");var Ba=function(){ne.current||(ne.current=requestAnimationFrame(function(){Sr(window.innerHeight),En.current="window",ne.current=0}))};return window.addEventListener("resize",Ba),Sr(window.innerHeight),En.current="window",xn(),function(){window.removeEventListener("resize",Ba),cancelAnimationFrame(ne.current)}},[nn,xn,En]),wr}(gt,tn,Zt),Fn=as(vt,{label:"headerHeight",enabled:Pt,resizeSourceRef:Zt}),yr=as(ht,{label:"contentHeight",enabled:!0,resizeSourceRef:Zt}),zn=as(Nt,{label:"footerHeight",enabled:Qe,resizeSourceRef:Zt}),Sn=Math.min(mr-Fn-zn,yr)+Fn+zn;u.useDebugValue("minHeight: "+Sn);var br=yr>0;return u.useEffect(function(){br&&vr()},[br,vr]),{maxHeight:mr,minHeight:Sn,headerHeight:Fn,footerHeight:zn}}({contentRef:F.contentRef,controlledMaxHeight:F.controlledMaxHeight,footerEnabled:F.footerEnabled,footerRef:F.footerRef,headerEnabled:F.headerEnabled,headerRef:F.headerRef,registerReady:F.registerReady,resizeSourceRef:F.resizeSourceRef}),Ae=xe.maxHeight,Pe=xe.minHeight,Be=xe.headerHeight,ae=xe.footerHeight,ve=function(Ke,ht){var gt=[].concat(Ke).map(Ai).reduce(function(vt,tn){return vt.add(Or(tn,0,ht)),vt},new Set),Qe=Array.from(gt),Nt=Math.min.apply(Math,Qe);if(Number.isNaN(Nt))throw new TypeError("minSnap is NaN");var Pt=Math.max.apply(Math,Qe);if(Number.isNaN(Pt))throw new TypeError("maxSnap is NaN");return{snapPoints:Qe,minSnap:Nt,maxSnap:Pt}}(Te?te({height:J.current,footerHeight:ae,headerHeight:Be,minHeight:Pe,maxHeight:Ae}):[0],Ae),ft=ve.snapPoints,Wt=ve.minSnap,lt=ve.maxSnap;return u.useDebugValue("minSnap: "+Wt+", maxSnap:"+lt),{minSnap:Wt,maxSnap:lt,findSnap:function(Ke){var ht=Ai(typeof Ke=="function"?Ke({footerHeight:ae,headerHeight:Be,height:J.current,minHeight:Pe,maxHeight:Ae,snapPoints:ft,lastSnap:pe.current}):Ke);return ft.reduce(function(gt,Qe){return Math.abs(Qe-ht)<Math.abs(gt-ht)?Qe:gt},Wt)},maxHeight:Ae}}({contentRef:ee,controlledMaxHeight:p,footerEnabled:!!o,footerRef:se,getSnapPoints:S,headerEnabled:s!==!1,headerRef:q,heightRef:ue,lastSnapRef:c,ready:$,registerReady:G,resizeSourceRef:Le}),re=Re.minSnap,ie=Re.maxSnap,ze=Re.maxHeight,Ye=Re.findSnap,Y=u.useRef(ze),$e=u.useRef(re),Ne=u.useRef(ie),pt=u.useRef(Ye),at=u.useRef(0);Kr(function(){Y.current=ze,Ne.current=ie,$e.current=re,pt.current=Ye,at.current=Ye(g)},[Ye,g,ze,ie,re]);var oe=u.useCallback(function(F){var te=F.onRest,J=F.config,pe=(J=J===void 0?{}:J).velocity,Te=pe===void 0?1:pe,xe=Xi(J,Zy),Ae=Xi(F,qy);return new Promise(function(Pe){return Z(ut({},Ae,{config:ut({velocity:Te},xe,{mass:1,tension:Ky,friction:Math.max(Di,Di+(Di-Di*Te))}),onRest:function(){var Be=[].slice.call(arguments);Pe.apply(void 0,Be),te==null||te.apply(void 0,Be)}}))})},[Z]),wn=Ov(Gy,{devTools:!1,actions:{onOpenCancel:u.useCallback(function(){return D.current==null?void 0:D.current({type:"OPEN"})},[]),onSnapCancel:u.useCallback(function(F){return D.current==null?void 0:D.current({type:"SNAP",source:F.snapSource})},[]),onCloseCancel:u.useCallback(function(){return D.current==null?void 0:D.current({type:"CLOSE"})},[]),onResizeCancel:u.useCallback(function(){return D.current==null?void 0:D.current({type:"RESIZE",source:Le.current})},[]),onOpenEnd:u.useCallback(function(){return R.current==null?void 0:R.current({type:"OPEN"})},[]),onSnapEnd:u.useCallback(function(F,te){return R.current==null?void 0:R.current({type:"SNAP",source:F.snapSource})},[]),onResizeEnd:u.useCallback(function(){return R.current==null?void 0:R.current({type:"RESIZE",source:Le.current})},[])},context:{initialState:l},services:{onSnapStart:u.useCallback(function(F,te){try{return Promise.resolve(W.current==null?void 0:W.current({type:"SNAP",source:te.payload.source||"custom"}))}catch(J){return Promise.reject(J)}},[]),onOpenStart:u.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"OPEN"}))}catch(F){return Promise.reject(F)}},[]),onCloseStart:u.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"CLOSE"}))}catch(F){return Promise.reject(F)}},[]),onResizeStart:u.useCallback(function(){try{return Promise.resolve(W.current==null?void 0:W.current({type:"RESIZE",source:Le.current}))}catch(F){return Promise.reject(F)}},[]),onSnapEnd:u.useCallback(function(F,te){try{return Promise.resolve(R.current==null?void 0:R.current({type:"SNAP",source:F.snapSource}))}catch(J){return Promise.reject(J)}},[]),onOpenEnd:u.useCallback(function(){try{return Promise.resolve(R.current==null?void 0:R.current({type:"OPEN"}))}catch(F){return Promise.reject(F)}},[]),onCloseEnd:u.useCallback(function(){try{return Promise.resolve(R.current==null?void 0:R.current({type:"CLOSE"}))}catch(F){return Promise.reject(F)}},[]),onResizeEnd:u.useCallback(function(){try{return Promise.resolve(R.current==null?void 0:R.current({type:"RESIZE",source:Le.current}))}catch(F){return Promise.reject(F)}},[]),renderVisuallyHidden:u.useCallback(function(F,te){try{return Promise.resolve(oe({y:at.current,ready:0,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:!0})).then(function(){})}catch(J){return Promise.reject(J)}},[oe]),activate:u.useCallback(function(F,te){try{return z.current=!0,Promise.resolve(Promise.all([Ee.current.activate(),Me.current.activate(),Ie.current.activate()])).then(function(){})}catch(J){return Promise.reject(J)}},[Ie,Me,Ee]),deactivate:u.useCallback(function(){try{return Ee.current.deactivate(),Me.current.deactivate(),Ie.current.deactivate(),z.current=!1,Promise.resolve()}catch(F){return Promise.reject(F)}},[Ie,Me,Ee]),openImmediately:u.useCallback(function(){try{return ue.current=at.current,Promise.resolve(oe({y:at.current,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:!0})).then(function(){})}catch(F){return Promise.reject(F)}},[oe]),openSmoothly:u.useCallback(function(){try{return Promise.resolve(oe({y:0,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:!0})).then(function(){return ue.current=at.current,Promise.resolve(oe({y:at.current,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:at.current,immediate:we.current})).then(function(){})})}catch(F){return Promise.reject(F)}},[oe,we]),snapSmoothly:u.useCallback(function(F,te){try{var J=pt.current(F.y);return ue.current=J,c.current=J,Promise.resolve(oe({y:J,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:$e.current,immediate:we.current,config:{velocity:F.velocity}})).then(function(){})}catch(pe){return Promise.reject(pe)}},[oe,c,we]),resizeSmoothly:u.useCallback(function(){try{var F=pt.current(ue.current);return ue.current=F,c.current=F,Promise.resolve(oe({y:F,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:$e.current,immediate:Le.current!=="element"||we.current})).then(function(){})}catch(te){return Promise.reject(te)}},[oe,c,we]),closeSmoothly:u.useCallback(function(F,te){try{return oe({minSnap:ue.current,immediate:!0}),ue.current=0,Promise.resolve(oe({y:0,maxHeight:Y.current,maxSnap:Ne.current,immediate:we.current})).then(function(){return Promise.resolve(oe({ready:0,immediate:!0})).then(function(){})})}catch(J){return Promise.reject(J)}},[oe,we])}}),hi=wn[0],Mt=wn[1];u.useEffect(function(){$&&Mt(a?"OPEN":"CLOSE")},[a,Mt,$]),Kr(function(){(ze||ie||re)&&Mt("RESIZE")},[ze,ie,re,Mt]),u.useEffect(function(){return function(){Ee.current.deactivate(),Me.current.deactivate(),Ie.current.deactivate()}},[Ie,Me,Ee]),u.useImperativeHandle(e,function(){return{snapTo:function(F,te){var J=te===void 0?{}:te,pe=J.velocity,Te=pe===void 0?1:pe,xe=J.source,Ae=xe===void 0?"custom":xe;Mt("SNAP",{payload:{y:pt.current(F),velocity:Te,source:Ae}})},get height(){return ue.current}}},[Mt]),u.useEffect(function(){var F=K.current,te=function(pe){Fe.current&&pe.preventDefault()},J=function(pe){F.scrollTop<0&&(requestAnimationFrame(function(){F.style.overflow="hidden",F.scrollTop=0,F.style.removeProperty("overflow")}),pe.preventDefault())};return P&&(F.addEventListener("scroll",te),F.addEventListener("touchmove",te),F.addEventListener("touchstart",J)),function(){F.removeEventListener("scroll",te),F.removeEventListener("touchmove",te),F.removeEventListener("touchstart",J)}},[P,K]);var Gt=Jm(function(F){var te=F.args,J=(te=te===void 0?[]:te)[0],pe=(J=J===void 0?{}:J).closeOnTap,Te=pe!==void 0&&pe,xe=J.isContentDragging,Ae=xe!==void 0&&xe,Pe=F.cancel,Be=F.direction[1],ae=F.down,ve=F.first,ft=F.last,Wt=F.memo,lt=Wt===void 0?V.y.getValue():Wt,Ke=F.tap,ht=F.velocity,gt=-1*F.movement[1];if(!z.current)return Pe(),lt;if(d&&Te&&Ke)return Pe(),setTimeout(function(){return d()},0),lt;if(Ke)return lt;var Qe=lt+gt,Nt=gt*ht,Pt=Math.max($e.current,Math.min(Ne.current,Qe+2*Nt));if(!ae&&d&&Be>0&&Qe+Nt<$e.current/2)return Pe(),d(),lt;var vt=ae?d||$e.current!==Ne.current?Gr(Qe,d?0:$e.current,Ne.current,.55):Qe<$e.current?Gr(Qe,$e.current,2*Ne.current,.55):Gr(Qe,$e.current/2,Ne.current,.55):Pt;return P&&Ae?(vt>=Ne.current&&(vt=Ne.current),lt===Ne.current&&K.current.scrollTop>0&&(vt=Ne.current),Fe.current=vt<Ne.current):Fe.current=!1,ve&&Mt("DRAG"),ft?(Mt("SNAP",{payload:{y:vt,velocity:ht>.05?ht:1,source:"dragging"}}),lt):(Z({y:vt,ready:1,maxHeight:Y.current,maxSnap:Ne.current,minSnap:$e.current,immediate:!0,config:{velocity:ht}}),lt)},{filterTaps:!0});if(Number.isNaN(Ne.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN($e.current))throw new TypeError("minSnapRef is NaN!!");var gi=function(F){var te,J=F.spring,pe=Wn([J.y,J.maxHeight],function(ae,ve){return Math.round(Or(ve-ae,0,16))+"px"}),Te=Wn([J.y,J.minSnap,J.maxSnap],function(ae,ve,ft){return Or(ae,ve,ft)+"px"}),xe=Wn([J.y,J.minSnap,J.maxSnap],function(ae,ve,ft){return ae<ve?ve-ae+"px":ae>ft?ft-ae+"px":"0px"}),Ae=Wn([J.y,J.maxSnap],function(ae,ve){return ae>=ve?Math.ceil(ae-ve):0}),Pe=Wn([J.y,J.minSnap],function(ae,ve){if(!ve)return 0;var ft=Math.max(ve/2-45,0);return Or((ae-ft)*(1/(Math.min(ve/2+45,ve)-ft)+0),0,1)}),Be=Wn([J.y,J.minSnap],function(ae,ve){return ve?Or(ae/ve,0,1):0});return(te={})["--rsbs-content-opacity"]=Pe,te["--rsbs-backdrop-opacity"]=Be,te["--rsbs-antigap-scale-y"]=Ae,te["--rsbs-overlay-translate-y"]=xe,te["--rsbs-overlay-rounded"]=pe,te["--rsbs-overlay-h"]=Te,te}({spring:V});return u.createElement(hm.div,ut({},j,{"data-rsbs-root":!0,"data-rsbs-state":Yy.find(hi.matches),"data-rsbs-is-blocking":y,"data-rsbs-is-dismissable":!!d,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!o,className:i,ref:I,style:ut({},gi,E,{opacity:V.ready})}),r,y&&u.createElement("div",ut({key:"backdrop","data-rsbs-backdrop":!0},Gt({closeOnTap:!0}))),u.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:de,onKeyDown:function(F){F.key==="Escape"&&(F.stopPropagation(),d&&d())}},s!==!1&&u.createElement("div",ut({key:"header","data-rsbs-header":!0,ref:q},Gt()),s),u.createElement("div",ut({key:"scroll","data-rsbs-scroll":!0,ref:K},P?Gt({isContentDragging:!0}):{}),u.createElement("div",{"data-rsbs-content":!0,ref:ee},n)),o&&u.createElement("div",ut({key:"footer",ref:se,"data-rsbs-footer":!0},Gt()),o)))}),Yy=["closed","opening","open","closing","dragging","snapping","resizing"];function Xy(t){var e=t.lastSnap;return e??Math.min.apply(Math,t.snapPoints)}function Qy(t){return t.minHeight}var e0=["onSpringStart","onSpringEnd","skipInitialTransition"],Of=u.forwardRef(function(t,e){var n=t.onSpringStart,r=t.onSpringEnd,i=t.skipInitialTransition,o=Xi(t,e0),s=u.useState(!1),a=s[0],l=s[1],c=u.useRef(),f=u.useRef(null),d=u.useRef(i&&o.open?"OPEN":"CLOSED");Kr(function(){if(o.open)return cancelAnimationFrame(c.current),l(!0),function(){d.current="CLOSED"}},[o.open]);var p=u.useCallback(function(g){return Promise.resolve(n==null?void 0:n(g)).then(function(){g.type==="OPEN"&&cancelAnimationFrame(c.current)})},[n]),m=u.useCallback(function(g){return Promise.resolve(r==null?void 0:r(g)).then(function(){g.type==="CLOSE"&&(c.current=requestAnimationFrame(function(){return l(!1)}))})},[r]);return a?u.createElement(Lg,{"data-rsbs-portal":!0},u.createElement(Jy,ut({},o,{lastSnapRef:f,ref:e,initialState:d.current,onSpringStart:p,onSpringEnd:m}))):null});const t0=t=>{const[e,n]=t.split(":");return Number(e)*60+Number(n)},n0=t=>{const e=Math.floor(t/60),n=t%60;return`${e<10?`0${e}`:e}:${n<10?`0${n}`:n}`},r0=(t,e)=>[[t[0]-e,t[0]+e],[t[1]-e,t[1]+e]];function Mf(t,e){return function(){return t.apply(e,arguments)}}const{toString:i0}=Object.prototype,{getPrototypeOf:ba}=Object,Io=(t=>e=>{const n=i0.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ht=t=>(t=t.toLowerCase(),e=>Io(e)===t),jo=t=>e=>typeof e===t,{isArray:hr}=Array,oi=jo("undefined");function o0(t){return t!==null&&!oi(t)&&t.constructor!==null&&!oi(t.constructor)&&Ot(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Pf=Ht("ArrayBuffer");function s0(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Pf(t.buffer),e}const a0=jo("string"),Ot=jo("function"),kf=jo("number"),No=t=>t!==null&&typeof t=="object",l0=t=>t===!0||t===!1,Qi=t=>{if(Io(t)!=="object")return!1;const e=ba(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},c0=Ht("Date"),u0=Ht("File"),f0=Ht("Blob"),d0=Ht("FileList"),p0=t=>No(t)&&Ot(t.pipe),h0=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ot(t.append)&&((e=Io(t))==="formdata"||e==="object"&&Ot(t.toString)&&t.toString()==="[object FormData]"))},g0=Ht("URLSearchParams"),v0=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ui(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),hr(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function Rf(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Tf=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Af=t=>!oi(t)&&t!==Tf;function Gs(){const{caseless:t}=Af(this)&&this||{},e={},n=(r,i)=>{const o=t&&Rf(e,i)||i;Qi(e[o])&&Qi(r)?e[o]=Gs(e[o],r):Qi(r)?e[o]=Gs({},r):hr(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ui(arguments[r],n);return e}const m0=(t,e,n,{allOwnKeys:r}={})=>(ui(e,(i,o)=>{n&&Ot(i)?t[o]=Mf(i,n):t[o]=i},{allOwnKeys:r}),t),y0=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),b0=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},w0=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&ba(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},S0=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},L0=t=>{if(!t)return null;if(hr(t))return t;let e=t.length;if(!kf(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},E0=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ba(Uint8Array)),x0=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},C0=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},_0=Ht("HTMLFormElement"),O0=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),jl=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),M0=Ht("RegExp"),Df=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ui(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},P0=t=>{Df(t,(e,n)=>{if(Ot(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Ot(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},k0=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return hr(t)?r(t):r(String(t).split(e)),n},R0=()=>{},T0=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ls="abcdefghijklmnopqrstuvwxyz",Nl="0123456789",If={DIGIT:Nl,ALPHA:ls,ALPHA_DIGIT:ls+ls.toUpperCase()+Nl},A0=(t=16,e=If.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function D0(t){return!!(t&&Ot(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const I0=t=>{const e=new Array(10),n=(r,i)=>{if(No(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=hr(r)?[]:{};return ui(r,(s,a)=>{const l=n(s,i+1);!oi(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},j0=Ht("AsyncFunction"),N0=t=>t&&(No(t)||Ot(t))&&Ot(t.then)&&Ot(t.catch),B={isArray:hr,isArrayBuffer:Pf,isBuffer:o0,isFormData:h0,isArrayBufferView:s0,isString:a0,isNumber:kf,isBoolean:l0,isObject:No,isPlainObject:Qi,isUndefined:oi,isDate:c0,isFile:u0,isBlob:f0,isRegExp:M0,isFunction:Ot,isStream:p0,isURLSearchParams:g0,isTypedArray:E0,isFileList:d0,forEach:ui,merge:Gs,extend:m0,trim:v0,stripBOM:y0,inherits:b0,toFlatObject:w0,kindOf:Io,kindOfTest:Ht,endsWith:S0,toArray:L0,forEachEntry:x0,matchAll:C0,isHTMLForm:_0,hasOwnProperty:jl,hasOwnProp:jl,reduceDescriptors:Df,freezeMethods:P0,toObjectSet:k0,toCamelCase:O0,noop:R0,toFiniteNumber:T0,findKey:Rf,global:Tf,isContextDefined:Af,ALPHABET:If,generateString:A0,isSpecCompliantForm:D0,toJSONObject:I0,isAsyncFn:j0,isThenable:N0};function Se(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}B.inherits(Se,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jf=Se.prototype,Nf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Nf[t]={value:t}});Object.defineProperties(Se,Nf);Object.defineProperty(jf,"isAxiosError",{value:!0});Se.from=(t,e,n,r,i,o)=>{const s=Object.create(jf);return B.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Se.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const B0=null;function Ws(t){return B.isPlainObject(t)||B.isArray(t)}function Bf(t){return B.endsWith(t,"[]")?t.slice(0,-2):t}function Bl(t,e,n){return t?t.concat(e).map(function(i,o){return i=Bf(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function U0(t){return B.isArray(t)&&!t.some(Ws)}const V0=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});function Bo(t,e,n){if(!B.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,S){return!B.isUndefined(S[h])});const r=n.metaTokens,i=n.visitor||f,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(i))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(B.isDate(g))return g.toISOString();if(!l&&B.isBlob(g))throw new Se("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(g)||B.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function f(g,h,S){let w=g;if(g&&!S&&typeof g=="object"){if(B.endsWith(h,"{}"))h=r?h:h.slice(0,-2),g=JSON.stringify(g);else if(B.isArray(g)&&U0(g)||(B.isFileList(g)||B.endsWith(h,"[]"))&&(w=B.toArray(g)))return h=Bf(h),w.forEach(function(b,_){!(B.isUndefined(b)||b===null)&&e.append(s===!0?Bl([h],_,o):s===null?h:h+"[]",c(b))}),!1}return Ws(g)?!0:(e.append(Bl(S,h,o),c(g)),!1)}const d=[],p=Object.assign(V0,{defaultVisitor:f,convertValue:c,isVisitable:Ws});function m(g,h){if(!B.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(g),B.forEach(g,function(w,y){(!(B.isUndefined(w)||w===null)&&i.call(e,w,B.isString(y)?y.trim():y,h,p))===!0&&m(w,h?h.concat(y):[y])}),d.pop()}}if(!B.isObject(t))throw new TypeError("data must be an object");return m(t),e}function Ul(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function wa(t,e){this._pairs=[],t&&Bo(t,this,e)}const Uf=wa.prototype;Uf.append=function(e,n){this._pairs.push([e,n])};Uf.toString=function(e){const n=e?function(r){return e.call(this,r,Ul)}:Ul;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function F0(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vf(t,e,n){if(!e)return t;const r=n&&n.encode||F0,i=n&&n.serialize;let o;if(i?o=i(e,n):o=B.isURLSearchParams(e)?e.toString():new wa(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class z0{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Vl=z0,Ff={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$0=typeof URLSearchParams<"u"?URLSearchParams:wa,H0=typeof FormData<"u"?FormData:null,G0=typeof Blob<"u"?Blob:null,W0={isBrowser:!0,classes:{URLSearchParams:$0,FormData:H0,Blob:G0},protocols:["http","https","file","blob","url","data"]},zf=typeof window<"u"&&typeof document<"u",Z0=(t=>zf&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),q0=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),K0=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zf,hasStandardBrowserEnv:Z0,hasStandardBrowserWebWorkerEnv:q0},Symbol.toStringTag,{value:"Module"})),Vt={...K0,...W0};function J0(t,e){return Bo(t,new Vt.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Vt.isNode&&B.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Y0(t){return B.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function X0(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function $f(t){function e(n,r,i,o){let s=n[o++];const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&B.isArray(i)?i.length:s,l?(B.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!B.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&B.isArray(i[s])&&(i[s]=X0(i[s])),!a)}if(B.isFormData(t)&&B.isFunction(t.entries)){const n={};return B.forEachEntry(t,(r,i)=>{e(Y0(r),i,n,0)}),n}return null}function Q0(t,e,n){if(B.isString(t))try{return(e||JSON.parse)(t),B.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Sa={transitional:Ff,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=B.isObject(e);if(o&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return i&&i?JSON.stringify($f(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return J0(e,this.formSerializer).toString();if((a=B.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Bo(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Q0(e)):e}],transformResponse:[function(e){const n=this.transitional||Sa.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&B.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?Se.from(a,Se.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vt.classes.FormData,Blob:Vt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],t=>{Sa.headers[t]={}});const La=Sa,eb=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tb=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
45
|
+
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&eb[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Fl=Symbol("internals");function Mr(t){return t&&String(t).trim().toLowerCase()}function eo(t){return t===!1||t==null?t:B.isArray(t)?t.map(eo):String(t)}function nb(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const rb=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function cs(t,e,n,r,i){if(B.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!B.isString(e)){if(B.isString(r))return e.indexOf(r)!==-1;if(B.isRegExp(r))return r.test(e)}}function ib(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function ob(t,e){const n=B.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class Uo{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const f=Mr(l);if(!f)throw new Error("header name must be a non-empty string");const d=B.findKey(i,f);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=eo(a))}const s=(a,l)=>B.forEach(a,(c,f)=>o(c,f,l));return B.isPlainObject(e)||e instanceof this.constructor?s(e,n):B.isString(e)&&(e=e.trim())&&!rb(e)?s(tb(e),n):e!=null&&o(n,e,r),this}get(e,n){if(e=Mr(e),e){const r=B.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return nb(i);if(B.isFunction(n))return n.call(this,i,r);if(B.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Mr(e),e){const r=B.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||cs(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=Mr(s),s){const a=B.findKey(r,s);a&&(!n||cs(r,r[a],a,n))&&(delete r[a],i=!0)}}return B.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||cs(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return B.forEach(this,(i,o)=>{const s=B.findKey(r,o);if(s){n[s]=eo(i),delete n[o];return}const a=e?ib(o):String(o).trim();a!==o&&delete n[o],n[a]=eo(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return B.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&B.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
46
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Fl]=this[Fl]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Mr(s);r[a]||(ob(i,s),r[a]=!0)}return B.isArray(e)?e.forEach(o):o(e),this}}Uo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);B.reduceDescriptors(Uo.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});B.freezeMethods(Uo);const Qt=Uo;function us(t,e){const n=this||La,r=e||n,i=Qt.from(r.headers);let o=r.data;return B.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function Hf(t){return!!(t&&t.__CANCEL__)}function fi(t,e,n){Se.call(this,t??"canceled",Se.ERR_CANCELED,e,n),this.name="CanceledError"}B.inherits(fi,Se,{__CANCEL__:!0});function sb(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Se("Request failed with status code "+n.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const ab=Vt.hasStandardBrowserEnv?function(){return{write:function(n,r,i,o,s,a){const l=[];l.push(n+"="+encodeURIComponent(r)),B.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),B.isString(o)&&l.push("path="+o),B.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function lb(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function cb(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Gf(t,e){return t&&!lb(e)?cb(t,e):e}const ub=Vt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=B.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function fb(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function db(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),f=r[o];s||(s=c),n[i]=l,r[i]=c;let d=o,p=0;for(;d!==i;)p+=n[d++],d=d%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s<e)return;const m=f&&c-f;return m?Math.round(p*1e3/m):void 0}}function zl(t,e){let n=0;const r=db(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,l=r(a),c=o<=s;n=o;const f={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:i};f[e?"download":"upload"]=!0,t(f)}}const pb=typeof XMLHttpRequest<"u",hb=pb&&function(t){return new Promise(function(n,r){let i=t.data;const o=Qt.from(t.headers).normalize(),s=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}let c;if(B.isFormData(i)){if(Vt.hasStandardBrowserEnv||Vt.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((c=o.getContentType())!==!1){const[g,...h]=c?c.split(";").map(S=>S.trim()).filter(Boolean):[];o.setContentType([g||"multipart/form-data",...h].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(g+":"+h))}const d=Gf(t.baseURL,t.url);f.open(t.method.toUpperCase(),Vf(d,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function p(){if(!f)return;const g=Qt.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),S={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:g,config:t,request:f};sb(function(y){n(y),l()},function(y){r(y),l()},S),f=null}if("onloadend"in f?f.onloadend=p:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(p)},f.onabort=function(){f&&(r(new Se("Request aborted",Se.ECONNABORTED,t,f)),f=null)},f.onerror=function(){r(new Se("Network Error",Se.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const S=t.transitional||Ff;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),r(new Se(h,S.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,t,f)),f=null},Vt.hasStandardBrowserEnv){const g=ub(d)&&t.xsrfCookieName&&ab.read(t.xsrfCookieName);g&&o.set(t.xsrfHeaderName,g)}i===void 0&&o.setContentType(null),"setRequestHeader"in f&&B.forEach(o.toJSON(),function(h,S){f.setRequestHeader(S,h)}),B.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",zl(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",zl(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=g=>{f&&(r(!g||g.type?new fi(null,t,f):g),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const m=fb(d);if(m&&Vt.protocols.indexOf(m)===-1){r(new Se("Unsupported protocol "+m+":",Se.ERR_BAD_REQUEST,t));return}f.send(i||null)})},Zs={http:B0,xhr:hb};B.forEach(Zs,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const $l=t=>`- ${t}`,gb=t=>B.isFunction(t)||t===null||t===!1,Wf={getAdapter:t=>{t=B.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o<e;o++){n=t[o];let s;if(r=n,!gb(n)&&(r=Zs[(s=String(n)).toLowerCase()],r===void 0))throw new Se(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since :
|
|
47
|
+
`+o.map($l).join(`
|
|
48
|
+
`):" "+$l(o[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Zs};function fs(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new fi(null,t)}function Hl(t){return fs(t),t.headers=Qt.from(t.headers),t.data=us.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Wf.getAdapter(t.adapter||La.adapter)(t).then(function(r){return fs(t),r.data=us.call(t,t.transformResponse,r),r.headers=Qt.from(r.headers),r},function(r){return Hf(r)||(fs(t),r&&r.response&&(r.response.data=us.call(t,t.transformResponse,r.response),r.response.headers=Qt.from(r.response.headers))),Promise.reject(r)})}const Gl=t=>t instanceof Qt?t.toJSON():t;function cr(t,e){e=e||{};const n={};function r(c,f,d){return B.isPlainObject(c)&&B.isPlainObject(f)?B.merge.call({caseless:d},c,f):B.isPlainObject(f)?B.merge({},f):B.isArray(f)?f.slice():f}function i(c,f,d){if(B.isUndefined(f)){if(!B.isUndefined(c))return r(void 0,c,d)}else return r(c,f,d)}function o(c,f){if(!B.isUndefined(f))return r(void 0,f)}function s(c,f){if(B.isUndefined(f)){if(!B.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,d){if(d in e)return r(c,f);if(d in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,f)=>i(Gl(c),Gl(f),!0)};return B.forEach(Object.keys(Object.assign({},t,e)),function(f){const d=l[f]||i,p=d(t[f],e[f],f);B.isUndefined(p)&&d!==a||(n[f]=p)}),n}const Zf="1.6.1",Ea={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ea[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Wl={};Ea.transitional=function(e,n,r){function i(o,s){return"[Axios v"+Zf+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new Se(i(s," has been removed"+(n?" in "+n:"")),Se.ERR_DEPRECATED);return n&&!Wl[s]&&(Wl[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function vb(t,e,n){if(typeof t!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new Se("option "+o+" must be "+l,Se.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Se("Unknown option "+o,Se.ERR_BAD_OPTION)}}const qs={assertOptions:vb,validators:Ea},sn=qs.validators;class Eo{constructor(e){this.defaults=e,this.interceptors={request:new Vl,response:new Vl}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=cr(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&qs.assertOptions(r,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},!1),i!=null&&(B.isFunction(i)?n.paramsSerializer={serialize:i}:qs.assertOptions(i,{encode:sn.function,serialize:sn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&B.merge(o.common,o[n.method]);o&&B.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=Qt.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(l=l&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let f,d=0,p;if(!l){const g=[Hl.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),p=g.length,f=Promise.resolve(n);d<p;)f=f.then(g[d++],g[d++]);return f}p=a.length;let m=n;for(d=0;d<p;){const g=a[d++],h=a[d++];try{m=g(m)}catch(S){h.call(this,S);break}}try{f=Hl.call(this,m)}catch(g){return Promise.reject(g)}for(d=0,p=c.length;d<p;)f=f.then(c[d++],c[d++]);return f}getUri(e){e=cr(this.defaults,e);const n=Gf(e.baseURL,e.url);return Vf(n,e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],function(e){Eo.prototype[e]=function(n,r){return this.request(cr(r||{},{method:e,url:n,data:(r||{}).data}))}});B.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(cr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Eo.prototype[e]=n(),Eo.prototype[e+"Form"]=n(!0)});const to=Eo;class xa{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new fi(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new xa(function(i){e=i}),cancel:e}}}const mb=xa;function yb(t){return function(n){return t.apply(null,n)}}function bb(t){return B.isObject(t)&&t.isAxiosError===!0}const Ks={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ks).forEach(([t,e])=>{Ks[e]=t});const wb=Ks;function qf(t){const e=new to(t),n=Mf(to.prototype.request,e);return B.extend(n,to.prototype,e,{allOwnKeys:!0}),B.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return qf(cr(t,i))},n}const Je=qf(La);Je.Axios=to;Je.CanceledError=fi;Je.CancelToken=mb;Je.isCancel=Hf;Je.VERSION=Zf;Je.toFormData=Bo;Je.AxiosError=Se;Je.Cancel=Je.CanceledError;Je.all=function(e){return Promise.all(e)};Je.spread=yb;Je.isAxiosError=bb;Je.mergeConfig=cr;Je.AxiosHeaders=Qt;Je.formToJSON=t=>$f(B.isHTMLForm(t)?new FormData(t):t);Je.getAdapter=Wf.getAdapter;Je.HttpStatusCode=wb;Je.default=Je;const Sb=Je,si=Sb.create({baseURL:"https://ecomgate.omnic.solutions/api/1.0.0/type-1/public/"}),Lb=512;var Kt=(t=>(t[t.All=0]="All",t[t.PickPoint=20]="PickPoint",t[t.PostOffice=30]="PostOffice",t))(Kt||{}),Dt=(t=>(t[t.PayByCash=0]="PayByCash",t[t.DressingRoom=1]="DressingRoom",t[t.CheckOrder=2]="CheckOrder",t))(Dt||{}),It=(t=>(t[t.Return=0]="Return",t[t.Payment=1]="Payment",t[t.Shipping=2]="Shipping",t))(It||{});const Eb={[Dt.CheckOrder]:["is_check_order","is_delivery"],[Dt.DressingRoom]:["is_dressing_room","is_delivery"],[Dt.PayByCash]:["pay_by_cash","pay_by_card","is_delivery"]},xb={[It.Return]:["is_pickup"],[It.Shipping]:["is_pickup"],[It.Payment]:["pay_by_cash","pay_by_card","is_pickup"]};async function*Js({q:t,filter:e,bounds:n}={},{controller:r}={}){const i={status:30,page_size:Lb};if(t&&(i.q=t),e!=null&&e.type&&(i.type=e.type),e!=null&&e.receive)for(const[l,c]of Object.entries(e==null?void 0:e.receive)){if(!c)continue;const f=Eb[l];for(const d of f)i[d]=!0}if(e!=null&&e.send)for(const[l,c]of Object.entries(e==null?void 0:e.send)){if(!c)continue;const f=xb[l];for(const d of f)i[d]=!0}n&&(i.start_latitude=n[0][0],i.end_latitude=n[0][1],i.start_longitude=n[1][0],i.end_longitude=n[1][1]);let o=await si.get("/locations/points",{params:i,signal:r==null?void 0:r.signal}),s=o.data.data.num_pages,a=o.data.data.current_page;for(;a<s;){yield o,i.page=a+1;const l=await si.get("/locations/points",{params:i,signal:r==null?void 0:r.signal});o.data.data.results=[...o.data.data.results,...l.data.data.results],o=l,a=l.data.data.current_page,s=l.data.data.num_pages}return yield o,o}const Zl=[],Ys=(t,e,n)=>{var i;const r=new AbortController;return t&&((i=Zl.pop())==null||i.abort()),Zl.push(r),async o=>{const s={controller:r};if(!n){const l=await Js({filter:e},s).next();o(l.value.data);return}for await(const a of Js({filter:e,bounds:n},s))o(a.data)}},Kf=":root",Vo=(t,e)=>{var n;(n=document.querySelector(Kf))==null||n.style.setProperty(t,e)},Xs=t=>{t.stopImmediatePropagation()};var Jf={},Yf={exports:{}};(function(t){var e=function(n){var r=Object.prototype,i=r.hasOwnProperty,o=Object.defineProperty||function(D,R,A){D[R]=A.value},s,a=typeof Symbol=="function"?Symbol:{},l=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function d(D,R,A){return Object.defineProperty(D,R,{value:A,enumerable:!0,configurable:!0,writable:!0}),D[R]}try{d({},"")}catch{d=function(R,A,T){return R[A]=T}}function p(D,R,A,T){var N=R&&R.prototype instanceof b?R:b,V=Object.create(N.prototype),Z=new G(T||[]);return o(V,"_invoke",{value:P(D,A,Z)}),V}n.wrap=p;function m(D,R,A){try{return{type:"normal",arg:D.call(R,A)}}catch(T){return{type:"throw",arg:T}}}var g="suspendedStart",h="suspendedYield",S="executing",w="completed",y={};function b(){}function _(){}function E(){}var v={};d(v,l,function(){return this});var L=Object.getPrototypeOf,C=L&&L(L(z([])));C&&C!==r&&i.call(C,l)&&(v=C);var k=E.prototype=b.prototype=Object.create(v);_.prototype=E,o(k,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:_,configurable:!0}),_.displayName=d(E,f,"GeneratorFunction");function M(D){["next","throw","return"].forEach(function(R){d(D,R,function(A){return this._invoke(R,A)})})}n.isGeneratorFunction=function(D){var R=typeof D=="function"&&D.constructor;return R?R===_||(R.displayName||R.name)==="GeneratorFunction":!1},n.mark=function(D){return Object.setPrototypeOf?Object.setPrototypeOf(D,E):(D.__proto__=E,d(D,f,"GeneratorFunction")),D.prototype=Object.create(k),D},n.awrap=function(D){return{__await:D}};function O(D,R){function A(V,Z,I,K){var ee=m(D[V],D,Z);if(ee.type==="throw")K(ee.arg);else{var q=ee.arg,se=q.value;return se&&typeof se=="object"&&i.call(se,"__await")?R.resolve(se.__await).then(function(de){A("next",de,I,K)},function(de){A("throw",de,I,K)}):R.resolve(se).then(function(de){q.value=de,I(q)},function(de){return A("throw",de,I,K)})}}var T;function N(V,Z){function I(){return new R(function(K,ee){A(V,Z,K,ee)})}return T=T?T.then(I,I):I()}o(this,"_invoke",{value:N})}M(O.prototype),d(O.prototype,c,function(){return this}),n.AsyncIterator=O,n.async=function(D,R,A,T,N){N===void 0&&(N=Promise);var V=new O(p(D,R,A,T),N);return n.isGeneratorFunction(R)?V:V.next().then(function(Z){return Z.done?Z.value:V.next()})};function P(D,R,A){var T=g;return function(V,Z){if(T===S)throw new Error("Generator is already running");if(T===w){if(V==="throw")throw Z;return W()}for(A.method=V,A.arg=Z;;){var I=A.delegate;if(I){var K=j(I,A);if(K){if(K===y)continue;return K}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(T===g)throw T=w,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);T=S;var ee=m(D,R,A);if(ee.type==="normal"){if(T=A.done?w:h,ee.arg===y)continue;return{value:ee.arg,done:A.done}}else ee.type==="throw"&&(T=w,A.method="throw",A.arg=ee.arg)}}}function j(D,R){var A=R.method,T=D.iterator[A];if(T===s)return R.delegate=null,A==="throw"&&D.iterator.return&&(R.method="return",R.arg=s,j(D,R),R.method==="throw")||A!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+A+"' method")),y;var N=m(T,D.iterator,R.arg);if(N.type==="throw")return R.method="throw",R.arg=N.arg,R.delegate=null,y;var V=N.arg;if(!V)return R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,y;if(V.done)R[D.resultName]=V.value,R.next=D.nextLoc,R.method!=="return"&&(R.method="next",R.arg=s);else return V;return R.delegate=null,y}M(k),d(k,f,"Generator"),d(k,l,function(){return this}),d(k,"toString",function(){return"[object Generator]"});function U(D){var R={tryLoc:D[0]};1 in D&&(R.catchLoc=D[1]),2 in D&&(R.finallyLoc=D[2],R.afterLoc=D[3]),this.tryEntries.push(R)}function $(D){var R=D.completion||{};R.type="normal",delete R.arg,D.completion=R}function G(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(U,this),this.reset(!0)}n.keys=function(D){var R=Object(D),A=[];for(var T in R)A.push(T);return A.reverse(),function N(){for(;A.length;){var V=A.pop();if(V in R)return N.value=V,N.done=!1,N}return N.done=!0,N}};function z(D){if(D){var R=D[l];if(R)return R.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length)){var A=-1,T=function N(){for(;++A<D.length;)if(i.call(D,A))return N.value=D[A],N.done=!1,N;return N.value=s,N.done=!0,N};return T.next=T}}return{next:W}}n.values=z;function W(){return{value:s,done:!0}}return G.prototype={constructor:G,reset:function(D){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach($),!D)for(var R in this)R.charAt(0)==="t"&&i.call(this,R)&&!isNaN(+R.slice(1))&&(this[R]=s)},stop:function(){this.done=!0;var D=this.tryEntries[0],R=D.completion;if(R.type==="throw")throw R.arg;return this.rval},dispatchException:function(D){if(this.done)throw D;var R=this;function A(K,ee){return V.type="throw",V.arg=D,R.next=K,ee&&(R.method="next",R.arg=s),!!ee}for(var T=this.tryEntries.length-1;T>=0;--T){var N=this.tryEntries[T],V=N.completion;if(N.tryLoc==="root")return A("end");if(N.tryLoc<=this.prev){var Z=i.call(N,"catchLoc"),I=i.call(N,"finallyLoc");if(Z&&I){if(this.prev<N.catchLoc)return A(N.catchLoc,!0);if(this.prev<N.finallyLoc)return A(N.finallyLoc)}else if(Z){if(this.prev<N.catchLoc)return A(N.catchLoc,!0)}else if(I){if(this.prev<N.finallyLoc)return A(N.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(D,R){for(var A=this.tryEntries.length-1;A>=0;--A){var T=this.tryEntries[A];if(T.tryLoc<=this.prev&&i.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var N=T;break}}N&&(D==="break"||D==="continue")&&N.tryLoc<=R&&R<=N.finallyLoc&&(N=null);var V=N?N.completion:{};return V.type=D,V.arg=R,N?(this.method="next",this.next=N.finallyLoc,y):this.complete(V)},complete:function(D,R){if(D.type==="throw")throw D.arg;return D.type==="break"||D.type==="continue"?this.next=D.arg:D.type==="return"?(this.rval=this.arg=D.arg,this.method="return",this.next="end"):D.type==="normal"&&R&&(this.next=R),y},finish:function(D){for(var R=this.tryEntries.length-1;R>=0;--R){var A=this.tryEntries[R];if(A.finallyLoc===D)return this.complete(A.completion,A.afterLoc),$(A),y}},catch:function(D){for(var R=this.tryEntries.length-1;R>=0;--R){var A=this.tryEntries[R];if(A.tryLoc===D){var T=A.completion;if(T.type==="throw"){var N=T.arg;$(A)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(D,R,A){return this.delegate={iterator:z(D),resultName:R,nextLoc:A},this.method==="next"&&(this.arg=s),y}},n}(t.exports);try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})(Yf);var Cb=Yf.exports;(function(t){var e=Cb;function n(g,h,S,w,y,b,_){try{var E=g[b](_),v=E.value}catch(L){return void S(L)}E.done?h(v):Promise.resolve(v).then(w,y)}function r(g){return function(){var h=this,S=arguments;return new Promise(function(w,y){var b=g.apply(h,S);function _(v){n(b,w,y,_,E,"next",v)}function E(v){n(b,w,y,_,E,"throw",v)}_(void 0)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=!1,o=null,s="en",a=null,l=null,c="https://maps.googleapis.com/maps/api/geocode/json";function f(g){var h=arguments.length>1&&arguments[1]!==void 0&&arguments[1];i&&(h?console.warn(g):console.log(g))}function d(g){return p.apply(this,arguments)}function p(){return(p=r(e.mark(function g(h){var S,w;return e.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,fetch(h).catch(function(){return Promise.reject(new Error("Error fetching data"))});case 2:return S=y.sent,y.next=5,S.json().catch(function(){return f("Error parsing server response"),Promise.reject(new Error("Error parsing server response"))});case 5:if((w=y.sent).status!=="OK"){y.next=9;break}return f(w),y.abrupt("return",w);case 9:return f("".concat(w.error_message,`.
|
|
49
|
+
Server returned status code `).concat(w.status),!0),y.abrupt("return",Promise.reject(new Error("".concat(w.error_message,`.
|
|
50
|
+
Server returned status code `).concat(w.status))));case 11:case"end":return y.stop()}},g)}))).apply(this,arguments)}var m={setApiKey:function(g){o=g},setLanguage:function(g){s=g},setRegion:function(g){a=g},setLocationType:function(g){l=g},enableDebug:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];i=g},fromLatLng:function(g,h,S,w,y,b){return r(e.mark(function _(){var E,v;return e.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(g&&h){L.next=3;break}return f("Provided coordinates are invalid",!0),L.abrupt("return",Promise.reject(new Error("Provided coordinates are invalid")));case 3:return E="".concat(g,",").concat(h),v="".concat(c,"?latlng=").concat(encodeURIComponent(E)),(S||o)&&(v+="&key=".concat(o=S||o)),(w||s)&&(v+="&language=".concat(s=w||s)),(y||a)&&(a=y||a,v+="®ion=".concat(encodeURIComponent(a))),(b||l)&&(l=b||l,v+="&location_type=".concat(encodeURIComponent(l))),L.abrupt("return",d(v));case 9:case"end":return L.stop()}},_)}))()},fromAddress:function(g,h,S,w){return r(e.mark(function y(){var b;return e.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(g){_.next=3;break}return f("Provided address is invalid",!0),_.abrupt("return",Promise.reject(new Error("Provided address is invalid")));case 3:return b="".concat(c,"?address=").concat(encodeURIComponent(g)),(h||o)&&(b+="&key=".concat(o=h||o)),(S||s)&&(b+="&language=".concat(s=S||s)),(w||a)&&(a=w||a,b+="®ion=".concat(encodeURIComponent(a))),_.abrupt("return",d(b));case 8:case"end":return _.stop()}},y)}))()}};t.default=m})(Jf);const xo=Mo(Jf),ur=async(t,e="ROOFTOP")=>{var i;xo.setLocationType(e);const n=await xo.fromLatLng(t[0].toString(),t[1].toString()),r=(i=n.results)==null?void 0:i.map(o=>{var l,c;const s=(l=o.geometry)==null?void 0:l.viewport,a=(c=o.geometry)==null?void 0:c.location;return{...o,geometry:{...o.geometry,viewport:new google.maps.LatLngBounds(s.southwest,s.northeast),location:new google.maps.LatLng(a)}}});return{...n,results:r}},Ca=(t,e)=>{if(!navigator.geolocation){e==null||e(new GeolocationPositionError),console.error("Geolocation is not supported by your browser");return}navigator.geolocation.getCurrentPosition(t,e,{maximumAge:6e4,timeout:5e3,enableHighAccuracy:!0})},Xf=t=>t.status===200,_a=t=>{const e=document.querySelector(Kf);return e?getComputedStyle(e).getPropertyValue(t):null},Jt=t=>{const e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)},xt=(t,e)=>t.replaceAll("currentColor",_a(e)||""),_b=t=>"comment"in t&&"address"in t&&"apartment_number"in t&&"delivery_time"in t,Ob={points:[],error:!1,loaded:!1,loading:!1,reloading:!1},Qf=t=>t.points,Mb=t=>t.loaded,Oa=t=>t.loading,zt=bn()((t,e)=>({...Ob,async loadNext(n,r){const i=e().reloading;t({error:!1,reloading:!0}),ye.getState().setBounds(n);let o=0;try{await Ys(i,r,n)(a=>{t(o===0?{points:a.data.results}:{points:[...e().points,...a.data.results]}),o++})}catch{t({error:!0})}finally{t({reloading:!1})}},async loadFirst(n){const r=e().loading,i=Dh(ye.getState());t({error:!1,loading:!0});let o=0;try{await Ys(r,n,i)(a=>{o>=1&&t({loading:!1,loaded:!0}),t(o===0?{points:a.data.results}:{points:[...e().points,...a.data.results]}),o++}),t({loading:!1,loaded:!0})}catch{t({error:!0,loading:!1})}finally{t({loading:!1})}}})),Pb={query:"",type:Kt.All,hours:["08:00","22:00"],send:{[It.Return]:!1,[It.Payment]:!1,[It.Shipping]:!1},receive:{[Dt.PayByCash]:!1,[Dt.CheckOrder]:!1,[Dt.DressingRoom]:!1}},kb=t=>t.type,Rb=t=>t.send,Tb=t=>t.receive,en=bn(t=>({...Pb,setFilter(e){ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null),t(e)}})),Ab=()=>{u.useEffect(()=>{zt.getState().loadFirst();const t=en.subscribe(e=>{zt.getState().loadFirst(e)});return()=>{t()}},[])},Pr=".",Ma=Symbol("target"),ed=Symbol("unsubscribe");function Qs(t){return t instanceof Date||t instanceof Set||t instanceof Map||t instanceof WeakSet||t instanceof WeakMap||ArrayBuffer.isView(t)}function Db(t){return(typeof t=="object"?t===null:typeof t!="function")||t instanceof RegExp}const Ut=Array.isArray;function Pa(t){return typeof t=="symbol"}const Et={after:(t,e)=>Ut(t)?t.slice(e.length):e===""?t:t.slice(e.length+1),concat:(t,e)=>Ut(t)?(t=[...t],e&&t.push(e),t):e&&e.toString!==void 0?(t!==""&&(t+=Pr),Pa(e)?t+e.toString():t+e):t,initial:t=>{if(Ut(t))return t.slice(0,-1);if(t==="")return t;const e=t.lastIndexOf(Pr);return e===-1?"":t.slice(0,e)},last:t=>{if(Ut(t))return t[t.length-1]||"";if(t==="")return t;const e=t.lastIndexOf(Pr);return e===-1?t:t.slice(e+1)},walk:(t,e)=>{if(Ut(t))for(const n of t)e(n);else if(t!==""){let n=0,r=t.indexOf(Pr);if(r===-1)e(t);else for(;n<t.length;)r===-1&&(r=t.length),e(t.slice(n,r)),n=r+1,r=t.indexOf(Pr,n)}},get(t,e){return this.walk(e,n=>{t&&(t=t[n])}),t}};function Ib(t){return typeof t=="object"&&typeof t.next=="function"}function jb(t,e,n,r,i){const o=t.next;if(e.name==="entries")t.next=function(){const s=o.call(this);return s.done===!1&&(s.value[0]=i(s.value[0],e,s.value[0],r),s.value[1]=i(s.value[1],e,s.value[0],r)),s};else if(e.name==="values"){const s=n[Ma].keys();t.next=function(){const a=o.call(this);return a.done===!1&&(a.value=i(a.value,e,s.next().value,r)),a}}else t.next=function(){const s=o.call(this);return s.done===!1&&(s.value=i(s.value,e,s.value,r)),s};return t}function ql(t,e,n){return t.isUnsubscribed||e.ignoreSymbols&&Pa(n)||e.ignoreUnderscores&&n.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(n)}class Nb{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){const n=this._getDescriptorCache();let r=n.get(e);return r===void 0&&(r={},n.set(e,r)),r}_getOwnPropertyDescriptor(e,n){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,n);const r=this._getProperties(e);let i=r[n];return i===void 0&&(i=Reflect.getOwnPropertyDescriptor(e,n),r[n]=i),i}getProxy(e,n,r,i){if(this.isUnsubscribed)return e;const o=e[i],s=o||e;this._pathCache.set(s,n);let a=this._proxyCache.get(s);return a===void 0&&(a=o===void 0?new Proxy(e,r):e,this._proxyCache.set(s,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,n){return!Object.is(e,Et.get(n,this.getPath(e)))}defineProperty(e,n,r){return Reflect.defineProperty(e,n,r)?(this.isUnsubscribed||(this._getProperties(e)[n]=r),!0):!1}setProperty(e,n,r,i,o){if(!this._equals(o,r)||!(n in e)){const s=this._getOwnPropertyDescriptor(e,n);return s!==void 0&&"set"in s?Reflect.set(e,n,r,i):Reflect.set(e,n,r)}return!0}deleteProperty(e,n,r){if(Reflect.deleteProperty(e,n)){if(!this.isUnsubscribed){const i=this._getDescriptorCache().get(e);i&&(delete i[n],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(e,n,r){const i=this._getOwnPropertyDescriptor(n,r);return e!==void 0&&i!==void 0&&Object.is(e.value,i.value)&&(e.writable||!1)===(i.writable||!1)&&(e.enumerable||!1)===(i.enumerable||!1)&&(e.configurable||!1)===(i.configurable||!1)&&e.get===i.get&&e.set===i.set}isGetInvariant(e,n){const r=this._getOwnPropertyDescriptor(e,n);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}}function ea(t){return toString.call(t)==="[object Object]"}function Ii(){return!0}function qn(t,e){return t.length!==e.length||t.some((n,r)=>e[r]!==n)}const td=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Bb=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),nd={push:Ii,pop:Ii,shift:Ii,unshift:Ii,copyWithin:qn,reverse:qn,sort:qn,splice:qn,flat:qn,fill:qn},Ub=new Set([...td,...Bb,...Object.keys(nd)]);function ji(t,e){if(t.size!==e.size)return!0;for(const n of t)if(!e.has(n))return!0;return!1}const rd=["keys","values","entries"],id=new Set(["has","toString"]),od={add:ji,clear:ji,delete:ji,forEach:ji},Vb=new Set([...id,...Object.keys(od),...rd]);function Ni(t,e){if(t.size!==e.size)return!0;let n;for(const[r,i]of t)if(n=e.get(r),n!==i||n===void 0&&!e.has(r))return!0;return!1}const Fb=new Set([...id,"get"]),sd={set:Ni,clear:Ni,delete:Ni,forEach:Ni},zb=new Set([...Fb,...Object.keys(sd),...rd]);class yn{constructor(e,n,r,i){this._path=n,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=i,this._changes=i?[]:null,this.clone=n===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return td.has(e)}_shallowClone(e){let n=e;if(ea(e))n={...e};else if(Ut(e)||ArrayBuffer.isView(e))n=[...e];else if(e instanceof Date)n=new Date(e);else if(e instanceof Set)n=new Set([...e].map(r=>this._shallowClone(r)));else if(e instanceof Map){n=new Map;for(const[r,i]of e.entries())n.set(r,this._shallowClone(i))}return this._clonedCache.add(n),n}preferredThisArg(e,n,r,i){return e?(Ut(i)?this._onIsChanged=nd[n]:i instanceof Set?this._onIsChanged=od[n]:i instanceof Map&&(this._onIsChanged=sd[n]),i):r}update(e,n,r){const i=Et.after(e,this._path);if(n!=="length"){let o=this.clone;Et.walk(i,s=>{o&&o[s]&&(this._clonedCache.has(o[s])||(o[s]=this._shallowClone(o[s])),o=o[s])}),this._hasOnValidate&&this._changes.push({path:i,property:n,previous:r}),o&&o[n]&&(o[n]=r)}this._isChanged=!0}undo(e){let n;for(let r=this._changes.length-1;r!==-1;r--)n=this._changes[r],Et.get(e,n.path)[n.property]=n.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}}class Kl extends yn{static isHandledMethod(e){return Ub.has(e)}}class $b extends yn{undo(e){e.setTime(this.clone.getTime())}isChanged(e,n){return!n(this.clone.valueOf(),e.valueOf())}}class Jl extends yn{static isHandledMethod(e){return Vb.has(e)}undo(e){for(const n of this.clone)e.add(n);for(const n of e)this.clone.has(n)||e.delete(n)}}class Yl extends yn{static isHandledMethod(e){return zb.has(e)}undo(e){for(const[n,r]of this.clone.entries())e.set(n,r);for(const n of e.keys())this.clone.has(n)||e.delete(n)}}class Hb extends yn{constructor(e,n,r,i){super(void 0,n,r,i),this._arg1=r[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}}class Gb extends yn{constructor(e,n,r,i){super(void 0,n,r,i),this._weakKey=r[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){const n=e.has(this._weakKey);this._weakHas&&!n?e.set(this._weakKey,this._weakValue):!this._weakHas&&n?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}}class Rn{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return ea(e)||Ut(e)||Qs(e)}static isHandledMethod(e,n){return ea(e)?yn.isHandledMethod(n):Ut(e)?Kl.isHandledMethod(n):e instanceof Set?Jl.isHandledMethod(n):e instanceof Map?Yl.isHandledMethod(n):Qs(e)}get isCloning(){return this._stack.length>0}start(e,n,r){let i=yn;Ut(e)?i=Kl:e instanceof Date?i=$b:e instanceof Set?i=Jl:e instanceof Map?i=Yl:e instanceof WeakSet?i=Hb:e instanceof WeakMap&&(i=Gb),this._stack.push(new i(e,n,r,this._hasOnValidate))}update(e,n,r){this._stack[this._stack.length-1].update(e,n,r)}preferredThisArg(e,n,r){const{name:i}=e,o=Rn.isHandledMethod(r,i);return this._stack[this._stack.length-1].preferredThisArg(o,i,n,r)}isChanged(e,n,r){return this._stack[this._stack.length-1].isChanged(e,n,r)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}}const Wb={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},Jr=(t,e,n={})=>{n={...Wb,...n};const r=Symbol("ProxyTarget"),{equals:i,isShallow:o,ignoreDetached:s,details:a}=n,l=new Nb(i),c=typeof n.onValidate=="function",f=new Rn(c),d=(y,b,_,E,v)=>!c||f.isCloning||n.onValidate(Et.concat(l.getPath(y),b),_,E,v)===!0,p=(y,b,_,E)=>{!ql(l,n,b)&&!(s&&l.isDetached(y,t))&&m(l.getPath(y),b,_,E)},m=(y,b,_,E,v)=>{f.isCloning?f.update(y,b,E):e(Et.concat(y,b),_,E,v)},g=y=>y&&(y[r]||y),h=(y,b,_,E)=>Db(y)||_==="constructor"||o&&!Rn.isHandledMethod(b,_)||ql(l,n,_)||l.isGetInvariant(b,_)||s&&l.isDetached(b,t)?y:(E===void 0&&(E=l.getPath(b)),l.getProxy(y,Et.concat(E,_),S,r)),S={get(y,b,_){if(Pa(b)){if(b===r||b===Ma)return y;if(b===ed&&!l.isUnsubscribed&&l.getPath(y).length===0)return l.unsubscribe(),y}const E=Qs(y)?Reflect.get(y,b):Reflect.get(y,b,_);return h(E,y,b)},set(y,b,_,E){_=g(_);const v=y[r]||y,L=v[b];if(i(L,_)&&b in y)return!0;const C=d(y,b,_,L);return C&&l.setProperty(v,b,_,E,L)?(p(y,b,y[b],L),!0):!C},defineProperty(y,b,_){if(!l.isSameDescriptor(_,y,b)){const E=y[b];d(y,b,_.value,E)&&l.defineProperty(y,b,_,E)&&p(y,b,_.value,E)}return!0},deleteProperty(y,b){if(!Reflect.has(y,b))return!0;const _=Reflect.get(y,b),E=d(y,b,void 0,_);return E&&l.deleteProperty(y,b,_)?(p(y,b,void 0,_),!0):!E},apply(y,b,_){const E=b[r]||b;if(l.isUnsubscribed)return Reflect.apply(y,E,_);if((a===!1||a!==!0&&!a.includes(y.name))&&Rn.isHandledType(E)){let v=Et.initial(l.getPath(y));const L=Rn.isHandledMethod(E,y.name);f.start(E,v,_);let C=Reflect.apply(y,f.preferredThisArg(y,b,E),L?_.map(O=>g(O)):_);const k=f.isChanged(E,i),M=f.stop();if(Rn.isHandledType(C)&&L&&(b instanceof Map&&y.name==="get"&&(v=Et.concat(v,_[0])),C=l.getProxy(C,v,S)),k){const O={name:y.name,args:_,result:C},P=f.isCloning?Et.initial(v):v,j=f.isCloning?Et.last(v):"";d(Et.get(t,P),j,E,M,O)?m(P,j,E,M,O):f.undo(E)}return(b instanceof Map||b instanceof Set)&&Ib(C)?jb(C,y,b,v,h):C}return Reflect.apply(y,b,_)}},w=l.getProxy(t,n.pathAsArray?[]:"",S);return e=e.bind(w),c&&(n.onValidate=n.onValidate.bind(w)),w};Jr.target=t=>t&&t[Ma]||t;Jr.unsubscribe=t=>t[ed]||t;const Zb=t=>{const e=t??window.OMNIC_WIDGET_LOCATIONS_CONFIG,[n,r]=u.useState({...Mn,...e,map:{...Mn.map,...e==null?void 0:e.map},palette:{...Mn.palette,...e==null?void 0:e.palette}}),i=t&&!window.OMNIC_WIDGET_LOCATIONS_CONFIG,o=!t&&window.OMNIC_WIDGET_LOCATIONS_CONFIG;return u.useEffect(()=>{i&&r({...Mn,...t,map:{...Mn.map,...t.map},palette:{...Mn.palette,...t.palette}})},[t,i]),u.useEffect(()=>{if(o)return window.OMNIC_WIDGET_LOCATIONS_CONFIG=Jr(window.OMNIC_WIDGET_LOCATIONS_CONFIG,function(){const s=Jr.target(this);s.map&&(s.map={...s.map}),s.palette&&(s.palette={...s.palette}),r({...s})}),()=>{window.OMNIC_WIDGET_LOCATIONS_CONFIG&&Jr.unsubscribe(window.OMNIC_WIDGET_LOCATIONS_CONFIG)}},[o]),n},qb=(t,e)=>{si.defaults.headers.get.Authorization=`INN ${t}`,e!=null&&e.baseURL&&(si.defaults.baseURL=e.baseURL)},Kb="Overlay-module__root__y8tkGi",Jb={root:Kb},ka=({children:t,className:e})=>x.jsx("div",{className:be(Jb.root,e),children:t});/*! *****************************************************************************
|
|
51
51
|
Copyright (c) Microsoft Corporation.
|
|
52
52
|
|
|
53
53
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -60,15 +60,15 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
60
60
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
61
61
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
62
62
|
PERFORMANCE OF THIS SOFTWARE.
|
|
63
|
-
***************************************************************************** */var
|
|
63
|
+
***************************************************************************** */var ta=function(t,e){return ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},ta(t,e)};function je(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ta(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Q=function(){return Q=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Q.apply(this,arguments)};function Ra(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Yb(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{c(r.next(f))}catch(d){s(d)}}function l(f){try{c(r.throw(f))}catch(d){s(d)}}function c(f){f.done?o(f.value):i(f.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function Xb(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(f){return l([c,f])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(f){c=[6,f],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ad(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qb=function(t,e,n,r,i,o,s,a){if(!t){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],f=0;l=new Error(e.replace(/%s/g,function(){return c[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},ew=Qb,qe=ad(ew),le=u.createContext(null);function tw(){qe(!!u.useContext,"useGoogleMap is React hook and requires React version 16.8+");var t=u.useContext(le);return qe(!!t,"useGoogleMap needs a GoogleMap available up in the tree"),t}function nw(t,e,n){return Object.keys(t).reduce(function(i,o){return e(i,t[o],o)},n)}function rw(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function iw(t,e,n,r){var i={},o=function(s,a){var l=n[a];l!==e[a]&&(i[a]=l,s(r,l))};return rw(t,o),i}function ow(t,e,n){var r=nw(n,function(o,s,a){return typeof t[a]=="function"&&o.push(google.maps.event.addListener(e,s,t[a])),o},[]);return r}function sw(t){google.maps.event.removeListener(t)}function ge(t){t===void 0&&(t=[]),t.forEach(sw)}function fe(t){var e=t.updaterMap,n=t.eventMap,r=t.prevProps,i=t.nextProps,o=t.instance,s=ow(i,o,n);return iw(e,r,i,o),s}var Xl={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"},Ql={extraMapTypes:function(t,e){e.forEach(function(r,i){t.mapTypes.set(String(i),r)})},center:function(t,e){t.setCenter(e)},clickableIcons:function(t,e){t.setClickableIcons(e)},heading:function(t,e){t.setHeading(e)},mapTypeId:function(t,e){t.setMapTypeId(e)},options:function(t,e){t.setOptions(e)},streetView:function(t,e){t.setStreetView(e)},tilt:function(t,e){t.setTilt(e)},zoom:function(t,e){t.setZoom(e)}};function aw(t){var e=t.children,n=t.options,r=t.id,i=t.mapContainerStyle,o=t.mapContainerClassName,s=t.center,a=t.onClick,l=t.onDblClick,c=t.onDrag,f=t.onDragEnd,d=t.onDragStart,p=t.onMouseMove,m=t.onMouseOut,g=t.onMouseOver,h=t.onMouseDown,S=t.onMouseUp,w=t.onRightClick,y=t.onCenterChanged,b=t.onLoad,_=t.onUnmount,E=u.useState(null),v=E[0],L=E[1],C=u.useRef(null),k=u.useState(null),M=k[0],O=k[1],P=u.useState(null),j=P[0],U=P[1],$=u.useState(null),G=$[0],z=$[1],W=u.useState(null),D=W[0],R=W[1],A=u.useState(null),T=A[0],N=A[1],V=u.useState(null),Z=V[0],I=V[1],K=u.useState(null),ee=K[0],q=K[1],se=u.useState(null),de=se[0],ue=se[1],Le=u.useState(null),Fe=Le[0],we=Le[1],Ee=u.useState(null),Ie=Ee[0],Me=Ee[1],Re=u.useState(null),re=Re[0],ie=Re[1],ze=u.useState(null),Ye=ze[0],Y=ze[1];return u.useEffect(function(){n&&v!==null&&v.setOptions(n)},[v,n]),u.useEffect(function(){v!==null&&typeof s<"u"&&v.setCenter(s)},[v,s]),u.useEffect(function(){v&&l&&(j!==null&&google.maps.event.removeListener(j),U(google.maps.event.addListener(v,"dblclick",l)))},[l]),u.useEffect(function(){v&&f&&(G!==null&&google.maps.event.removeListener(G),z(google.maps.event.addListener(v,"dragend",f)))},[f]),u.useEffect(function(){v&&d&&(D!==null&&google.maps.event.removeListener(D),R(google.maps.event.addListener(v,"dragstart",d)))},[d]),u.useEffect(function(){v&&h&&(T!==null&&google.maps.event.removeListener(T),N(google.maps.event.addListener(v,"mousedown",h)))},[h]),u.useEffect(function(){v&&p&&(Z!==null&&google.maps.event.removeListener(Z),I(google.maps.event.addListener(v,"mousemove",p)))},[p]),u.useEffect(function(){v&&m&&(ee!==null&&google.maps.event.removeListener(ee),q(google.maps.event.addListener(v,"mouseout",m)))},[m]),u.useEffect(function(){v&&g&&(de!==null&&google.maps.event.removeListener(de),ue(google.maps.event.addListener(v,"mouseover",g)))},[g]),u.useEffect(function(){v&&S&&(Fe!==null&&google.maps.event.removeListener(Fe),we(google.maps.event.addListener(v,"mouseup",S)))},[S]),u.useEffect(function(){v&&w&&(Ie!==null&&google.maps.event.removeListener(Ie),Me(google.maps.event.addListener(v,"rightclick",w)))},[w]),u.useEffect(function(){v&&a&&(re!==null&&google.maps.event.removeListener(re),ie(google.maps.event.addListener(v,"click",a)))},[a]),u.useEffect(function(){v&&c&&(Ye!==null&&google.maps.event.removeListener(Ye),Y(google.maps.event.addListener(v,"drag",c)))},[c]),u.useEffect(function(){v&&y&&(M!==null&&google.maps.event.removeListener(M),O(google.maps.event.addListener(v,"center_changed",y)))},[a]),u.useEffect(function(){var $e=C.current===null?null:new google.maps.Map(C.current,n);return L($e),$e!==null&&b&&b($e),function(){$e!==null&&_&&_($e)}},[]),x.jsx("div",{id:r,ref:C,style:i,className:o,children:x.jsx(le.Provider,{value:v,children:v!==null?e:x.jsx(x.Fragment,{})})})}u.memo(aw);var lw=function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={map:null},n.registeredEvents=[],n.mapRef=null,n.getInstance=function(){return n.mapRef===null?null:new google.maps.Map(n.mapRef,n.props.options)},n.panTo=function(r){var i=n.getInstance();i&&i.panTo(r)},n.setMapCallback=function(){n.state.map!==null&&n.props.onLoad&&n.props.onLoad(n.state.map)},n.getRef=function(r){n.mapRef=r},n}return e.prototype.componentDidMount=function(){var n=this.getInstance();this.registeredEvents=fe({updaterMap:Ql,eventMap:Xl,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{map:n}},this.setMapCallback)},e.prototype.componentDidUpdate=function(n){this.state.map!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Ql,eventMap:Xl,prevProps:n,nextProps:this.props,instance:this.state.map}))},e.prototype.componentWillUnmount=function(){this.state.map!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),ge(this.registeredEvents))},e.prototype.render=function(){return x.jsx("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:x.jsx(le.Provider,{value:this.state.map,children:this.state.map!==null?this.props.children:x.jsx(x.Fragment,{})})})},e}(u.PureComponent),vn=typeof document<"u";function ld(t){var e=t.url,n=t.id,r=t.nonce;return vn?new Promise(function(o,s){var a=document.getElementById(n),l=window;if(a){var c=a.getAttribute("data-state");if(a.src===e&&c!=="error"){if(c==="ready")return o(n);var f=l.initMap,d=a.onerror;l.initMap=function(){f&&f(),o(n)},a.onerror=function(m){d&&d(m),s(m)};return}else a.remove()}var p=document.createElement("script");p.type="text/javascript",p.src=e,p.id=n,p.async=!0,p.nonce=r||"",p.onerror=function(g){p.setAttribute("data-state","error"),s(g)},l.initMap=function(){p.setAttribute("data-state","ready"),o(n)},document.head.appendChild(p)}).catch(function(i){throw console.error("injectScript error: ",i),i}):Promise.reject(new Error("document is undefined"))}function ec(t){var e=t.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:t.tagName.toLowerCase()==="style"&&t.styleSheet&&t.styleSheet.cssText&&t.styleSheet.cssText.replace(`\r
|
|
64
64
|
`,"").indexOf(".gm-style")===0?(t.styleSheet.cssText="",!0):t.tagName.toLowerCase()==="style"&&t.innerHTML&&t.innerHTML.replace(`\r
|
|
65
|
-
`,"").indexOf(".gm-style")===0?(t.innerHTML="",!0):t.tagName.toLowerCase()==="style"&&!t.styleSheet&&!t.innerHTML}function
|
|
65
|
+
`,"").indexOf(".gm-style")===0?(t.innerHTML="",!0):t.tagName.toLowerCase()==="style"&&!t.styleSheet&&!t.innerHTML}function Ta(){var t=document.getElementsByTagName("head")[0];if(t){var e=t.insertBefore.bind(t);t.insertBefore=function(i,o){return ec(i)||Reflect.apply(e,t,[i,o]),i};var n=t.appendChild.bind(t);t.appendChild=function(i){return ec(i)||Reflect.apply(n,t,[i]),i}}}function cd(t){var e=t.googleMapsApiKey,n=t.googleMapsClientId,r=t.version,i=r===void 0?"weekly":r,o=t.language,s=t.region,a=t.libraries,l=t.channel,c=t.mapIds,f=t.authReferrerPolicy,d=[];return qe(e&&n||!(e&&n),"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)):n&&d.push("client=".concat(n)),i&&d.push("v=".concat(i)),o&&d.push("language=".concat(o)),s&&d.push("region=".concat(s)),a&&a.length&&d.push("libraries=".concat(a.sort().join(","))),l&&d.push("channel=".concat(l)),c&&c.length&&d.push("map_ids=".concat(c.join(","))),f&&d.push("auth_referrer_policy=".concat(f)),d.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?".concat(d.join("&"))}var kr=!1;function ud(){return x.jsx("div",{children:"Loading..."})}var ai={id:"script-loader",version:"weekly"};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.check=u.createRef(),n.state={loaded:!1},n.cleanupCallback=function(){delete window.google.maps,n.injectScript()},n.isCleaningUp=function(){return Yb(n,void 0,void 0,function(){function r(i){if(!kr)i();else if(vn)var o=window.setInterval(function(){kr||(window.clearInterval(o),i())},1)}return Xb(this,function(i){return[2,new Promise(r)]})})},n.cleanup=function(){kr=!0;var r=document.getElementById(n.props.id);r&&r.parentNode&&r.parentNode.removeChild(r),Array.prototype.slice.call(document.getElementsByTagName("script")).filter(function(o){return typeof o.src=="string"&&o.src.includes("maps.googleapis")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(o){return o.href==="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("style")).filter(function(o){return o.innerText!==void 0&&o.innerText.length>0&&o.innerText.includes(".gm-")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)})},n.injectScript=function(){n.props.preventGoogleFontsLoading&&Ta(),qe(!!n.props.id,'LoadScript requires "id" prop to be a string: %s',n.props.id);var r={id:n.props.id,nonce:n.props.nonce,url:cd(n.props)};ld(r).then(function(){n.props.onLoad&&n.props.onLoad(),n.setState(function(){return{loaded:!0}})}).catch(function(i){n.props.onError&&n.props.onError(i),console.error(`
|
|
66
66
|
There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(n.props.googleMapsApiKey||"-",") or Client ID (").concat(n.props.googleMapsClientId||"-",`) to <LoadScript />
|
|
67
67
|
Otherwise it is a Network issue.
|
|
68
|
-
`))})},n}return e.prototype.componentDidMount=function(){if(vn){if(window.google&&window.google.maps&&!kr){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(r){console.error("Error at injecting script after cleaning up: ",r)})}},e.prototype.componentDidUpdate=function(n){this.props.libraries!==n.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"),vn&&n.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))},e.prototype.componentWillUnmount=function(){var n=this;if(vn){this.cleanup();var r=function(){n.check.current||(delete window.google,kr=!1)};window.setTimeout(r,1),this.props.onUnmount&&this.props.onUnmount()}},e.prototype.render=function(){return
|
|
68
|
+
`))})},n}return e.prototype.componentDidMount=function(){if(vn){if(window.google&&window.google.maps&&!kr){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(r){console.error("Error at injecting script after cleaning up: ",r)})}},e.prototype.componentDidUpdate=function(n){this.props.libraries!==n.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"),vn&&n.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))},e.prototype.componentWillUnmount=function(){var n=this;if(vn){this.cleanup();var r=function(){n.check.current||(delete window.google,kr=!1)};window.setTimeout(r,1),this.props.onUnmount&&this.props.onUnmount()}},e.prototype.render=function(){return x.jsxs(x.Fragment,{children:[x.jsx("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||x.jsx(ud,{})]})},e.defaultProps=ai,e})(u.PureComponent);var tc;function cw(t){var e=t.id,n=e===void 0?ai.id:e,r=t.version,i=r===void 0?ai.version:r,o=t.nonce,s=t.googleMapsApiKey,a=t.googleMapsClientId,l=t.language,c=t.region,f=t.libraries,d=t.preventGoogleFontsLoading,p=t.channel,m=t.mapIds,g=t.authReferrerPolicy,h=u.useRef(!1),S=u.useState(!1),w=S[0],y=S[1],b=u.useState(void 0),_=b[0],E=b[1];u.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]),u.useEffect(function(){vn&&d&&Ta()},[d]),u.useEffect(function(){w&&qe(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[w]);var v=cd({version:i,googleMapsApiKey:s,googleMapsClientId:a,language:l,region:c,libraries:f,channel:p,mapIds:m,authReferrerPolicy:g});u.useEffect(function(){if(!vn)return;function k(){h.current&&(y(!0),tc=v)}if(window.google&&window.google.maps&&tc===v){k();return}ld({id:n,url:v,nonce:o}).then(k).catch(function(O){h.current&&E(O),console.warn(`
|
|
69
69
|
There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(s||"-",") or Client ID (").concat(a||"-",`)
|
|
70
70
|
Otherwise it is a Network issue.
|
|
71
|
-
`)),console.error(
|
|
71
|
+
`)),console.error(O)})},[n,v,o]);var L=u.useRef();return u.useEffect(function(){L.current&&f!==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 static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),L.current=f},[f]),{isLoaded:w,loadError:_,url:v}}var uw=x.jsx(ud,{});function fw(t){var e=t.loadingElement,n=t.onLoad,r=t.onError,i=t.onUnmount,o=t.children,s=Ra(t,["loadingElement","onLoad","onError","onUnmount","children"]),a=cw(s),l=a.isLoaded,c=a.loadError;return u.useEffect(function(){l&&typeof n=="function"&&n()},[l,n]),u.useEffect(function(){c&&typeof r=="function"&&r(c)},[c,r]),u.useEffect(function(){return function(){i&&i()}},[i]),l?o:e||uw}u.memo(fw);/*! *****************************************************************************
|
|
72
72
|
Copyright (c) Microsoft Corporation.
|
|
73
73
|
|
|
74
74
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -81,7 +81,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
81
81
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
82
82
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
83
83
|
PERFORMANCE OF THIS SOFTWARE.
|
|
84
|
-
***************************************************************************** */function ow(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{c(r.next(f))}catch(d){s(d)}}function l(f){try{c(r.throw(f))}catch(d){s(d)}}function c(f){f.done?o(f.value):i(f.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}var sw=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const Ql="__googleMapsScriptId";var Qn;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(Qn||(Qn={}));class Tn{constructor({apiKey:e,authReferrerPolicy:n,channel:r,client:i,id:o=Ql,language:s,libraries:a=[],mapIds:l,nonce:c,region:f,retries:d=3,url:p="https://maps.googleapis.com/maps/api/js",version:v}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=n,this.channel=r,this.client=i,this.id=o||Ql,this.language=s,this.libraries=a,this.mapIds=l,this.nonce=c,this.region=f,this.retries=d,this.url=p,this.version=v,Tn.instance){if(!sw(this.options,Tn.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Tn.instance.options)}`);return Tn.instance}Tn.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?Qn.FAILURE:this.done?Qn.SUCCESS:this.loading?Qn.LOADING:Qn.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,n)=>{this.loadCallback(r=>{r?n(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,n;if(document.getElementById(this.id)){this.callback();return}const r={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};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((n=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||n===void 0)&&n.importLibrary||(o=>{let s,a,l,c="The Google Maps JavaScript API",f="google",d="importLibrary",p="__ib__",v=document,g=window;g=g[f]||(g[f]={});const h=g.maps||(g.maps={}),w=new Set,S=new URLSearchParams,y=()=>s||(s=new Promise((b,O)=>ow(this,void 0,void 0,function*(){var L;yield a=v.createElement("script"),a.id=this.id,S.set("libraries",[...w]+"");for(l in o)S.set(l.replace(/[A-Z]/g,m=>"_"+m[0].toLowerCase()),o[l]);S.set("callback",f+".maps."+p),a.src=this.url+"?"+S,h[p]=b,a.onerror=()=>s=O(Error(c+" could not load.")),a.nonce=this.nonce||((L=v.querySelector("script[nonce]"))===null||L===void 0?void 0:L.nonce)||"",v.head.append(a)})));h[d]?console.warn(c+" only loads once. Ignoring:",o):h[d]=(b,...O)=>w.add(b)&&y().then(()=>h[d](b,...O))})(r);const i=this.libraries.map(o=>this.importLibrary(o));i.length||i.push(this.importLibrary("core")),Promise.all(i).then(()=>this.callback(),o=>{const s=new ErrorEvent("error",{error:o});this.loadErrorCallback(s)})}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){const n=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${n} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},n)}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.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||(this.loading=!0,this.setScript())}}}var aw=["maps"];function lw(t){var e=t.id,n=e===void 0?ai.id:e,r=t.version,i=r===void 0?ai.version:r,o=t.nonce,s=t.googleMapsApiKey,a=t.language,l=t.region,c=t.libraries,f=c===void 0?aw:c,d=t.preventGoogleFontsLoading,p=t.mapIds,v=t.authReferrerPolicy,g=u.useRef(!1),h=u.useState(!1),w=h[0],S=h[1],y=u.useState(void 0),b=y[0],O=y[1];u.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]);var L=u.useMemo(function(){return new Tn({id:n,apiKey:s,version:i,libraries:f,language:a||"en",region:l||"US",mapIds:p||[],nonce:o||"",authReferrerPolicy:v||"origin"})},[n,s,i,f,a,l,p,o,v]);u.useEffect(function(){w||L.load().then(function(){g.current&&S(!0)}).catch(function(C){O(C)})},[]),u.useEffect(function(){vn&&d&&ka()},[d]);var m=u.useRef();return u.useEffect(function(){m.current&&f!==m.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"),m.current=f},[f]),{isLoaded:w,loadError:b}}var ec={},tc={options:function(t,e){t.setOptions(e)}};function cw(t){var e=t.options,n=t.onLoad,r=t.onUnmount,i=u.useContext(le),o=u.useState(null),s=o[0],a=o[1];return u.useEffect(function(){s!==null&&s.setMap(i)},[i]),u.useEffect(function(){e&&s!==null&&s.setOptions(e)},[s,e]),u.useEffect(function(){var l=new google.maps.TrafficLayer(Q(Q({},e||{}),{map:i}));return a(l),n&&n(l),function(){s!==null&&(r&&r(s),s.setMap(null))}},[]),null}u.memo(cw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={trafficLayer:null},n.setTrafficLayerCallback=function(){n.state.trafficLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.trafficLayer)},n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=new google.maps.TrafficLayer(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:tc,eventMap:ec,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{trafficLayer:n}},this.setTrafficLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.trafficLayer!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:tc,eventMap:ec,prevProps:n,nextProps:this.props,instance:this.state.trafficLayer}))},e.prototype.componentWillUnmount=function(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),ge(this.registeredEvents),this.state.trafficLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);function uw(t){var e=t.onLoad,n=t.onUnmount,r=u.useContext(le),i=u.useState(null),o=i[0],s=i[1];return u.useEffect(function(){o!==null&&o.setMap(r)},[r]),u.useEffect(function(){var a=new google.maps.BicyclingLayer;return s(a),a.setMap(r),e&&e(a),function(){a!==null&&(n&&n(a),a.setMap(null))}},[]),null}u.memo(uw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={bicyclingLayer:null},n.setBicyclingLayerCallback=function(){n.state.bicyclingLayer!==null&&(n.state.bicyclingLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.bicyclingLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.BicyclingLayer;this.setState(function(){return{bicyclingLayer:n}},this.setBicyclingLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);function fw(t){var e=t.onLoad,n=t.onUnmount,r=u.useContext(le),i=u.useState(null),o=i[0],s=i[1];return u.useEffect(function(){o!==null&&o.setMap(r)},[r]),u.useEffect(function(){var a=new google.maps.TransitLayer;return s(a),a.setMap(r),e&&e(a),function(){o!==null&&(n&&n(o),o.setMap(null))}},[]),null}u.memo(fw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={transitLayer:null},n.setTransitLayerCallback=function(){n.state.transitLayer!==null&&(n.state.transitLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.transitLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:n}},this.setTransitLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var nc={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},rc={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}};function dw(t){var e=t.options,n=t.drawingMode,r=t.onCircleComplete,i=t.onMarkerComplete,o=t.onOverlayComplete,s=t.onPolygonComplete,a=t.onPolylineComplete,l=t.onRectangleComplete,c=t.onLoad,f=t.onUnmount,d=u.useContext(le),p=u.useState(null),v=p[0],g=p[1],h=u.useState(null),w=h[0],S=h[1],y=u.useState(null),b=y[0],O=y[1],L=u.useState(null),m=L[0],x=L[1],C=u.useState(null),R=C[0],M=C[1],_=u.useState(null),P=_[0],j=_[1],V=u.useState(null),$=V[0],G=V[1];return u.useEffect(function(){v!==null&&v.setMap(d)},[d]),u.useEffect(function(){e&&v!==null&&v.setOptions(e)},[v,e]),u.useEffect(function(){n&&v!==null&&v.setDrawingMode(n)},[v,n]),u.useEffect(function(){v&&r&&(w!==null&&google.maps.event.removeListener(w),S(google.maps.event.addListener(v,"circlecomplete",r)))},[v,r]),u.useEffect(function(){v&&i&&(b!==null&&google.maps.event.removeListener(b),O(google.maps.event.addListener(v,"markercomplete",i)))},[v,i]),u.useEffect(function(){v&&o&&(m!==null&&google.maps.event.removeListener(m),x(google.maps.event.addListener(v,"overlaycomplete",o)))},[v,o]),u.useEffect(function(){v&&s&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(v,"polygoncomplete",s)))},[v,s]),u.useEffect(function(){v&&a&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(v,"polylinecomplete",a)))},[v,a]),u.useEffect(function(){v&&l&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(v,"rectanglecomplete",l)))},[v,l]),u.useEffect(function(){qe(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var z=new google.maps.drawing.DrawingManager(Q(Q({},e||{}),{map:d}));return n&&z.setDrawingMode(n),r&&S(google.maps.event.addListener(z,"circlecomplete",r)),i&&O(google.maps.event.addListener(z,"markercomplete",i)),o&&x(google.maps.event.addListener(z,"overlaycomplete",o)),s&&M(google.maps.event.addListener(z,"polygoncomplete",s)),a&&j(google.maps.event.addListener(z,"polylinecomplete",a)),l&&G(google.maps.event.addListener(z,"rectanglecomplete",l)),g(z),c&&c(z),function(){v!==null&&(w&&google.maps.event.removeListener(w),b&&google.maps.event.removeListener(b),m&&google.maps.event.removeListener(m),R&&google.maps.event.removeListener(R),P&&google.maps.event.removeListener(P),$&&google.maps.event.removeListener($),f&&f(v),v.setMap(null))}},[]),null}u.memo(dw);(function(t){je(e,t);function e(n){var r=t.call(this,n)||this;return r.registeredEvents=[],r.state={drawingManager:null},r.setDrawingManagerCallback=function(){r.state.drawingManager!==null&&r.props.onLoad&&r.props.onLoad(r.state.drawingManager)},qe(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),r}return e.prototype.componentDidMount=function(){var n=new google.maps.drawing.DrawingManager(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:rc,eventMap:nc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{drawingManager:n}},this.setDrawingManagerCallback)},e.prototype.componentDidUpdate=function(n){this.state.drawingManager!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:rc,eventMap:nc,prevProps:n,nextProps:this.props,instance:this.state.drawingManager}))},e.prototype.componentWillUnmount=function(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),ge(this.registeredEvents),this.state.drawingManager.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var ic={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"},oc={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},Co={};function pw(t){var e=t.position,n=t.options,r=t.clusterer,i=t.noClustererRedraw,o=t.children,s=t.draggable,a=t.visible,l=t.animation,c=t.clickable,f=t.cursor,d=t.icon,p=t.label,v=t.opacity,g=t.shape,h=t.title,w=t.zIndex,S=t.onClick,y=t.onDblClick,b=t.onDrag,O=t.onDragEnd,L=t.onDragStart,m=t.onMouseOut,x=t.onMouseOver,C=t.onMouseUp,R=t.onMouseDown,M=t.onRightClick,_=t.onClickableChanged,P=t.onCursorChanged,j=t.onAnimationChanged,V=t.onDraggableChanged,$=t.onFlatChanged,G=t.onIconChanged,z=t.onPositionChanged,W=t.onShapeChanged,D=t.onTitleChanged,k=t.onVisibleChanged,A=t.onZindexChanged,T=t.onLoad,N=t.onUnmount,U=u.useContext(le),Z=u.useState(null),I=Z[0],K=Z[1],ee=u.useState(null),q=ee[0],se=ee[1],de=u.useState(null),ue=de[0],Le=de[1],Fe=u.useState(null),we=Fe[0],Ee=Fe[1],Ie=u.useState(null),Me=Ie[0],Re=Ie[1],re=u.useState(null),ie=re[0],ze=re[1],Ye=u.useState(null),Y=Ye[0],$e=Ye[1],Ne=u.useState(null),pt=Ne[0],at=Ne[1],oe=u.useState(null),wn=oe[0],hi=oe[1],Mt=u.useState(null),Gt=Mt[0],gi=Mt[1],F=u.useState(null),te=F[0],J=F[1],pe=u.useState(null),Te=pe[0],xe=pe[1],Ae=u.useState(null),Pe=Ae[0],Be=Ae[1],ae=u.useState(null),ve=ae[0],ft=ae[1],Wt=u.useState(null),lt=Wt[0],Ke=Wt[1],ht=u.useState(null),gt=ht[0],Qe=ht[1],Nt=u.useState(null),Pt=Nt[0],vt=Nt[1],tn=u.useState(null),Zt=tn[0],vr=tn[1],mr=u.useState(null),Fn=mr[0],yr=mr[1],zn=u.useState(null),Sn=zn[0],br=zn[1],nn=u.useState(null),Ln=nn[0],En=nn[1],xn=u.useState(null),Cn=xn[0],wr=xn[1];u.useEffect(function(){I!==null&&I.setMap(U)},[U]),u.useEffect(function(){typeof n<"u"&&I!==null&&I.setOptions(n)},[I,n]),u.useEffect(function(){typeof s<"u"&&I!==null&&I.setDraggable(s)},[I,s]),u.useEffect(function(){e&&I!==null&&I.setPosition(e)},[I,e]),u.useEffect(function(){typeof a<"u"&&I!==null&&I.setVisible(a)},[I,a]),u.useEffect(function(){I==null||I.setAnimation(l)},[I,l]),u.useEffect(function(){I&&y&&(q!==null&&google.maps.event.removeListener(q),se(google.maps.event.addListener(I,"dblclick",y)))},[y]),u.useEffect(function(){I&&O&&(ue!==null&&google.maps.event.removeListener(ue),Le(google.maps.event.addListener(I,"dragend",O)))},[O]),u.useEffect(function(){I&&L&&(we!==null&&google.maps.event.removeListener(we),Ee(google.maps.event.addListener(I,"dragstart",L)))},[L]),u.useEffect(function(){I&&R&&(Me!==null&&google.maps.event.removeListener(Me),Re(google.maps.event.addListener(I,"mousedown",R)))},[R]),u.useEffect(function(){I&&m&&(ie!==null&&google.maps.event.removeListener(ie),ze(google.maps.event.addListener(I,"mouseout",m)))},[m]),u.useEffect(function(){I&&x&&(Y!==null&&google.maps.event.removeListener(Y),$e(google.maps.event.addListener(I,"mouseover",x)))},[x]),u.useEffect(function(){I&&C&&(pt!==null&&google.maps.event.removeListener(pt),at(google.maps.event.addListener(I,"mouseup",C)))},[C]),u.useEffect(function(){I&&M&&(wn!==null&&google.maps.event.removeListener(wn),hi(google.maps.event.addListener(I,"rightclick",M)))},[M]),u.useEffect(function(){I&&S&&(Gt!==null&&google.maps.event.removeListener(Gt),gi(google.maps.event.addListener(I,"click",S)))},[S]),u.useEffect(function(){I&&b&&(te!==null&&google.maps.event.removeListener(te),J(google.maps.event.addListener(I,"drag",b)))},[b]),u.useEffect(function(){I&&_&&(Te!==null&&google.maps.event.removeListener(Te),xe(google.maps.event.addListener(I,"clickable_changed",_)))},[_]),u.useEffect(function(){I&&P&&(Pe!==null&&google.maps.event.removeListener(Pe),Be(google.maps.event.addListener(I,"cursor_changed",P)))},[P]),u.useEffect(function(){I&&j&&(ve!==null&&google.maps.event.removeListener(ve),ft(google.maps.event.addListener(I,"animation_changed",j)))},[j]),u.useEffect(function(){I&&V&&(lt!==null&&google.maps.event.removeListener(lt),Ke(google.maps.event.addListener(I,"draggable_changed",V)))},[V]),u.useEffect(function(){I&&$&&(gt!==null&&google.maps.event.removeListener(gt),Qe(google.maps.event.addListener(I,"flat_changed",$)))},[$]),u.useEffect(function(){I&&G&&(Pt!==null&&google.maps.event.removeListener(Pt),vt(google.maps.event.addListener(I,"icon_changed",G)))},[G]),u.useEffect(function(){I&&z&&(Zt!==null&&google.maps.event.removeListener(Zt),vr(google.maps.event.addListener(I,"position_changed",z)))},[z]),u.useEffect(function(){I&&W&&(Fn!==null&&google.maps.event.removeListener(Fn),yr(google.maps.event.addListener(I,"shape_changed",W)))},[W]),u.useEffect(function(){I&&D&&(Sn!==null&&google.maps.event.removeListener(Sn),br(google.maps.event.addListener(I,"title_changed",D)))},[D]),u.useEffect(function(){I&&k&&(Ln!==null&&google.maps.event.removeListener(Ln),En(google.maps.event.addListener(I,"visible_changed",k)))},[k]),u.useEffect(function(){I&&A&&(Cn!==null&&google.maps.event.removeListener(Cn),wr(google.maps.event.addListener(I,"zindex_changed",A)))},[A]),u.useEffect(function(){var rn=Q(Q(Q({},n||Co),r?Co:{map:U}),{position:e}),ne=new google.maps.Marker(rn);return r?r.addMarker(ne,!!i):ne.setMap(U),e&&ne.setPosition(e),typeof a<"u"&&ne.setVisible(a),typeof s<"u"&&ne.setDraggable(s),typeof c<"u"&&ne.setClickable(c),typeof f=="string"&&ne.setCursor(f),d&&ne.setIcon(d),typeof p<"u"&&ne.setLabel(p),typeof v<"u"&&ne.setOpacity(v),g&&ne.setShape(g),typeof h=="string"&&ne.setTitle(h),typeof w=="number"&&ne.setZIndex(w),y&&se(google.maps.event.addListener(ne,"dblclick",y)),O&&Le(google.maps.event.addListener(ne,"dragend",O)),L&&Ee(google.maps.event.addListener(ne,"dragstart",L)),R&&Re(google.maps.event.addListener(ne,"mousedown",R)),m&&ze(google.maps.event.addListener(ne,"mouseout",m)),x&&$e(google.maps.event.addListener(ne,"mouseover",x)),C&&at(google.maps.event.addListener(ne,"mouseup",C)),M&&hi(google.maps.event.addListener(ne,"rightclick",M)),S&&gi(google.maps.event.addListener(ne,"click",S)),b&&J(google.maps.event.addListener(ne,"drag",b)),_&&xe(google.maps.event.addListener(ne,"clickable_changed",_)),P&&Be(google.maps.event.addListener(ne,"cursor_changed",P)),j&&ft(google.maps.event.addListener(ne,"animation_changed",j)),V&&Ke(google.maps.event.addListener(ne,"draggable_changed",V)),$&&Qe(google.maps.event.addListener(ne,"flat_changed",$)),G&&vt(google.maps.event.addListener(ne,"icon_changed",G)),z&&vr(google.maps.event.addListener(ne,"position_changed",z)),W&&yr(google.maps.event.addListener(ne,"shape_changed",W)),D&&br(google.maps.event.addListener(ne,"title_changed",D)),k&&En(google.maps.event.addListener(ne,"visible_changed",k)),A&&wr(google.maps.event.addListener(ne,"zindex_changed",A)),K(ne),T&&T(ne),function(){q!==null&&google.maps.event.removeListener(q),ue!==null&&google.maps.event.removeListener(ue),we!==null&&google.maps.event.removeListener(we),Me!==null&&google.maps.event.removeListener(Me),ie!==null&&google.maps.event.removeListener(ie),Y!==null&&google.maps.event.removeListener(Y),pt!==null&&google.maps.event.removeListener(pt),wn!==null&&google.maps.event.removeListener(wn),Gt!==null&&google.maps.event.removeListener(Gt),Te!==null&&google.maps.event.removeListener(Te),Pe!==null&&google.maps.event.removeListener(Pe),ve!==null&&google.maps.event.removeListener(ve),lt!==null&&google.maps.event.removeListener(lt),gt!==null&&google.maps.event.removeListener(gt),Pt!==null&&google.maps.event.removeListener(Pt),Zt!==null&&google.maps.event.removeListener(Zt),Sn!==null&&google.maps.event.removeListener(Sn),Ln!==null&&google.maps.event.removeListener(Ln),Cn!==null&&google.maps.event.removeListener(Cn),N&&N(ne),r?r.removeMarker(ne,!!i):ne&&ne.setMap(null)}},[]);var Sr=u.useMemo(function(){return o?u.Children.map(o,function(rn){if(!u.isValidElement(rn))return rn;var ne=rn;return u.cloneElement(ne,{anchor:I})}):null},[o,I]);return E.jsx(E.Fragment,{children:Sr})||null}u.memo(pw);var ld=function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=Q(Q(Q({},this.props.options||Co),this.props.clusterer?Co:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(n),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=fe({updaterMap:oc,eventMap:ic,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},e.prototype.componentDidUpdate=function(n){this.marker&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:oc,eventMap:ic,prevProps:n,nextProps:this.props,instance:this.marker}))},e.prototype.componentWillUnmount=function(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),ge(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))},e.prototype.render=function(){var n=this,r=null;return this.props.children&&(r=u.Children.map(this.props.children,function(i){if(!u.isValidElement(i))return i;var o=i;return u.cloneElement(o,{anchor:n.marker})})),r||null},e.contextType=le,e}(u.PureComponent),hw=function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,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 t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var r=n.getMaxZoom(),i=this.cluster.getBounds(),o=n.getMap();o!==null&&"fitBounds"in o&&o.fitBounds(i),this.timeOut=window.setTimeout(function(){var s=n.getMap();if(s!==null){"fitBounds"in s&&s.fitBounds(i);var a=s.getZoom()||0;r!==null&&a>r&&s.setZoom(r+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.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 n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_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))},t.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)},t.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"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,r,i,o,s;if(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(" "),c=parseInt(((e=l[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),f=parseInt(((n=l[1])===null||n===void 0?void 0:n.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(f,"px; left: ").concat(c,"px")),this.cluster.getClusterer().enableRetinaIcons||(p.style.clip="rect(-".concat(f,"px, -").concat(c+this.width,"px, -").concat(f+this.height,", -").concat(c,")"));var v=document.createElement("div");v.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")),!((r=this.sums)===null||r===void 0)&&r.text&&(v.innerText="".concat((i=this.sums)===null||i===void 0?void 0:i.text)),!((o=this.sums)===null||o===void 0)&&o.html&&(v.innerHTML="".concat((s=this.sums)===null||s===void 0?void 0:s.html)),this.div.innerHTML="",this.div.appendChild(p),this.div.appendChild(v),this.div.title=a,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),r=n[Math.min(n.length-1,Math.max(0,e.index-1))];r&&(this.url=r.url,this.height=r.height,this.width=r.width,r.className&&(this.className="".concat(this.clusterClassName," ").concat(r.className)),this.anchorText=r.anchorText||[0,0],this.anchorIcon=r.anchorIcon||[this.height/2,this.width/2],this.textColor=r.textColor||"black",this.textSize=r.textSize||11,this.textDecoration=r.textDecoration||"none",this.fontWeight=r.fontWeight||"bold",this.fontStyle=r.fontStyle||"normal",this.fontFamily=r.fontFamily||"Arial,sans-serif",this.backgroundPosition=r.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t}(),gw=function(){function t(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 hw(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 t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),r=0,i=n;r<i.length;r++){var o=i[r],s=o.getPosition();s&&e.extend(s)}return e},t.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},t.prototype.addMarker=function(e){var n;if(this.isMarkerAlreadyAdded(e))return!1;if(this.center){if(this.averageCenter){var r=e.getPosition();if(r){var i=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(i-1)+r.lat())/i,(this.center.lng()*(i-1)+r.lng())/i),this.calculateBounds()}}}else{var r=e.getPosition();r&&(this.center=r,this.calculateBounds())}e.isAdded=!0,this.markers.push(e);var o=this.markers.length,s=this.markerClusterer.getMaxZoom(),a=(n=this.map)===null||n===void 0?void 0:n.getZoom();if(s!==null&&typeof a<"u"&&a>s)e.getMap()!==this.map&&e.setMap(this.map);else if(o<this.minClusterSize)e.getMap()!==this.map&&e.setMap(this.map);else if(o===this.minClusterSize)for(var l=0,c=this.markers;l<c.length;l++){var f=c[l];f.setMap(null)}else e.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(e){if(this.bounds!==null){var n=e.getPosition();if(n)return this.bounds.contains(n)}return!1},t.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},t.prototype.updateIcon=function(){var e,n=this.markers.length,r=this.markerClusterer.getMaxZoom(),i=(e=this.map)===null||e===void 0?void 0:e.getZoom();if(r!==null&&typeof i<"u"&&i>r){this.clusterIcon.hide();return}if(n<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()},t.prototype.isMarkerAlreadyAdded=function(e){if(this.markers.includes)return this.markers.includes(e);for(var n=0;n<this.markers.length;n++)if(e===this.markers[n])return!0;return!1},t}();function vw(t,e){var n=t.length,r=n.toString().length,i=Math.min(r,e);return{text:n.toString(),index:i,title:""}}var mw=2e3,yw=500,bw="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",ww="png",Sw=[53,56,66,78,90],Lw="cluster",cd=function(){function t(e,n,r){n===void 0&&(n=[]),r===void 0&&(r={}),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.createClusters=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(t,google.maps.OverlayView),this.markers=[],this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=r.gridSize||60,this.minClusterSize=r.minimumClusterSize||2,this.maxZoom=r.maxZoom||null,this.styles=r.styles||[],this.title=r.title||"",this.zoomOnClick=!0,r.zoomOnClick!==void 0&&(this.zoomOnClick=r.zoomOnClick),this.averageCenter=!1,r.averageCenter!==void 0&&(this.averageCenter=r.averageCenter),this.ignoreHidden=!1,r.ignoreHidden!==void 0&&(this.ignoreHidden=r.ignoreHidden),this.enableRetinaIcons=!1,r.enableRetinaIcons!==void 0&&(this.enableRetinaIcons=r.enableRetinaIcons),this.imagePath=r.imagePath||bw,this.imageExtension=r.imageExtension||ww,this.imageSizes=r.imageSizes||Sw,this.calculator=r.calculator||vw,this.batchSize=r.batchSize||mw,this.batchSizeIE=r.batchSizeIE||yw,this.clusterClass=r.clusterClass||Lw,navigator.userAgent.toLowerCase().indexOf("msie")!==-1&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(n,!0),this.setMap(e)}return t.prototype.onZoomChanged=function(){var e,n;this.resetViewport(!1),(((e=this.getMap())===null||e===void 0?void 0:e.getZoom())===(this.get("minZoom")||0)||((n=this.getMap())===null||n===void 0?void 0:n.getZoom())===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")},t.prototype.onIdle=function(){this.redraw()},t.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)])},t.prototype.onRemove=function(){for(var e=0,n=this.markers;e<n.length;e++){var r=n[e];r.getMap()!==this.activeMap&&r.setMap(this.activeMap)}for(var i=0,o=this.clusters;i<o.length;i++){var s=o[i];s.remove()}this.clusters=[];for(var a=0,l=this.listeners;a<l.length;a++){var c=l[a];google.maps.event.removeListener(c)}this.listeners=[],this.activeMap=null,this.ready=!1},t.prototype.draw=function(){},t.prototype.getMap=function(){return null},t.prototype.getPanes=function(){return null},t.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}}},t.prototype.setMap=function(){},t.prototype.addListener=function(){return{remove:function(){}}},t.prototype.bindTo=function(){},t.prototype.get=function(){},t.prototype.notify=function(){},t.prototype.set=function(){},t.prototype.setValues=function(){},t.prototype.unbind=function(){},t.prototype.unbindAll=function(){},t.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})},t.prototype.fitMapToMarkers=function(){for(var e=this.getMarkers(),n=new google.maps.LatLngBounds,r=0,i=e;r<i.length;r++){var o=i[r],s=o.getPosition();s&&n.extend(s)}var a=this.getMap();a!==null&&"fitBounds"in a&&a.fitBounds(n)},t.prototype.getGridSize=function(){return this.gridSize},t.prototype.setGridSize=function(e){this.gridSize=e},t.prototype.getMinimumClusterSize=function(){return this.minClusterSize},t.prototype.setMinimumClusterSize=function(e){this.minClusterSize=e},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.setMaxZoom=function(e){this.maxZoom=e},t.prototype.getStyles=function(){return this.styles},t.prototype.setStyles=function(e){this.styles=e},t.prototype.getTitle=function(){return this.title},t.prototype.setTitle=function(e){this.title=e},t.prototype.getZoomOnClick=function(){return this.zoomOnClick},t.prototype.setZoomOnClick=function(e){this.zoomOnClick=e},t.prototype.getAverageCenter=function(){return this.averageCenter},t.prototype.setAverageCenter=function(e){this.averageCenter=e},t.prototype.getIgnoreHidden=function(){return this.ignoreHidden},t.prototype.setIgnoreHidden=function(e){this.ignoreHidden=e},t.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},t.prototype.setEnableRetinaIcons=function(e){this.enableRetinaIcons=e},t.prototype.getImageExtension=function(){return this.imageExtension},t.prototype.setImageExtension=function(e){this.imageExtension=e},t.prototype.getImagePath=function(){return this.imagePath},t.prototype.setImagePath=function(e){this.imagePath=e},t.prototype.getImageSizes=function(){return this.imageSizes},t.prototype.setImageSizes=function(e){this.imageSizes=e},t.prototype.getCalculator=function(){return this.calculator},t.prototype.setCalculator=function(e){this.calculator=e},t.prototype.getBatchSizeIE=function(){return this.batchSizeIE},t.prototype.setBatchSizeIE=function(e){this.batchSizeIE=e},t.prototype.getClusterClass=function(){return this.clusterClass},t.prototype.setClusterClass=function(e){this.clusterClass=e},t.prototype.getMarkers=function(){return this.markers},t.prototype.getTotalMarkers=function(){return this.markers.length},t.prototype.getClusters=function(){return this.clusters},t.prototype.getTotalClusters=function(){return this.clusters.length},t.prototype.addMarker=function(e,n){this.pushMarkerTo(e),n||this.redraw()},t.prototype.addMarkers=function(e,n){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];i&&this.pushMarkerTo(i)}n||this.redraw()},t.prototype.pushMarkerTo=function(e){var n=this;e.getDraggable()&&google.maps.event.addListener(e,"dragend",function(){n.ready&&(e.isAdded=!1,n.repaint())}),e.isAdded=!1,this.markers.push(e)},t.prototype.removeMarker_=function(e){var n=-1;if(this.markers.indexOf)n=this.markers.indexOf(e);else for(var r=0;r<this.markers.length;r++)if(e===this.markers[r]){n=r;break}return n===-1?!1:(e.setMap(null),this.markers.splice(n,1),!0)},t.prototype.removeMarker=function(e,n){var r=this.removeMarker_(e);return!n&&r&&this.repaint(),r},t.prototype.removeMarkers=function(e,n){for(var r=!1,i=0,o=e;i<o.length;i++){var s=o[i];r=r||this.removeMarker_(s)}return!n&&r&&this.repaint(),r},t.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]},t.prototype.repaint=function(){var e=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout(function(){for(var r=0,i=e;r<i.length;r++){var o=i[r];o.remove()}},0)},t.prototype.getExtendedBounds=function(e){var n=this.getProjection(),r=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()));r!==null&&(r.x+=this.gridSize,r.y-=this.gridSize);var i=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()));if(i!==null&&(i.x-=this.gridSize,i.y+=this.gridSize),r!==null){var o=n.fromDivPixelToLatLng(r);o!==null&&e.extend(o)}if(i!==null){var s=n.fromDivPixelToLatLng(i);s!==null&&e.extend(s)}return e},t.prototype.redraw=function(){this.createClusters(0)},t.prototype.resetViewport=function(e){for(var n=0,r=this.clusters;n<r.length;n++){var i=r[n];i.remove()}this.clusters=[];for(var o=0,s=this.markers;o<s.length;o++){var a=s[o];a.isAdded=!1,e&&a.setMap(null)}},t.prototype.distanceBetweenPoints=function(e,n){var r=6371,i=(n.lat()-e.lat())*Math.PI/180,o=(n.lng()-e.lng())*Math.PI/180,s=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(n.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return r*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))},t.prototype.isMarkerInBounds=function(e,n){var r=e.getPosition();return r?n.contains(r):!1},t.prototype.addToClosestCluster=function(e){for(var n,r=4e4,i=null,o=0,s=this.clusters;o<s.length;o++){var a=s[o];n=a;var l=n.getCenter(),c=e.getPosition();if(l&&c){var f=this.distanceBetweenPoints(l,c);f<r&&(r=f,i=n)}}i&&i.isMarkerInClusterBounds(e)?i.addMarker(e):(n=new gw(this),n.addMarker(e),this.clusters.push(n))},t.prototype.createClusters=function(e){var n=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 r=this.getMap(),i=r!==null&&("getBounds"in r)?r.getBounds():null,o=(r==null?void 0:r.getZoom())||0,s=o>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(s),l=Math.min(e+this.batchSize,this.markers.length),c=e;c<l;c++){var f=this.markers[c];f&&!f.isAdded&&this.isMarkerInBounds(f,a)&&(!this.ignoreHidden||this.ignoreHidden&&f.getVisible())&&this.addToClosestCluster(f)}if(l<this.markers.length)this.timerRefStatic=window.setTimeout(function(){n.createClusters(l)},0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);for(var d=0,p=this.clusters;d<p.length;d++){var v=p[d];v.updateIcon()}}}},t.prototype.extend=function(e,n){return(function(i){for(var o in i.prototype){var s=o;this.prototype[s]=i.prototype[s]}return this}).apply(e,[n])},t}(),St={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},Ce={averageCenter:function(t,e){t.setAverageCenter(e)},batchSizeIE:function(t,e){t.setBatchSizeIE(e)},calculator:function(t,e){t.setCalculator(e)},clusterClass:function(t,e){t.setClusterClass(e)},enableRetinaIcons:function(t,e){t.setEnableRetinaIcons(e)},gridSize:function(t,e){t.setGridSize(e)},ignoreHidden:function(t,e){t.setIgnoreHidden(e)},imageExtension:function(t,e){t.setImageExtension(e)},imagePath:function(t,e){t.setImagePath(e)},imageSizes:function(t,e){t.setImageSizes(e)},maxZoom:function(t,e){t.setMaxZoom(e)},minimumClusterSize:function(t,e){t.setMinimumClusterSize(e)},styles:function(t,e){t.setStyles(e)},title:function(t,e){t.setTitle(e)},zoomOnClick:function(t,e){t.setZoomOnClick(e)}},Ew={};function xw(t){var e=t.children,n=t.options,r=t.averageCenter,i=t.batchSizeIE,o=t.calculator,s=t.clusterClass,a=t.enableRetinaIcons,l=t.gridSize,c=t.ignoreHidden,f=t.imageExtension,d=t.imagePath,p=t.imageSizes,v=t.maxZoom,g=t.minimumClusterSize,h=t.styles,w=t.title,S=t.zoomOnClick,y=t.onClick,b=t.onClusteringBegin,O=t.onClusteringEnd,L=t.onMouseOver,m=t.onMouseOut,x=t.onLoad,C=t.onUnmount,R=u.useState(null),M=R[0],_=R[1],P=u.useContext(le),j=u.useState(null),V=j[0],$=j[1],G=u.useState(null),z=G[0],W=G[1],D=u.useState(null),k=D[0],A=D[1],T=u.useState(null),N=T[0],U=T[1],Z=u.useState(null),I=Z[0],K=Z[1];return u.useEffect(function(){M&&m&&(N!==null&&google.maps.event.removeListener(N),U(google.maps.event.addListener(M,St.onMouseOut,m)))},[m]),u.useEffect(function(){M&&L&&(I!==null&&google.maps.event.removeListener(I),K(google.maps.event.addListener(M,St.onMouseOver,L)))},[L]),u.useEffect(function(){M&&y&&(V!==null&&google.maps.event.removeListener(V),$(google.maps.event.addListener(M,St.onClick,y)))},[y]),u.useEffect(function(){M&&b&&(z!==null&&google.maps.event.removeListener(z),W(google.maps.event.addListener(M,St.onClusteringBegin,b)))},[b]),u.useEffect(function(){M&&O&&(k!==null&&google.maps.event.removeListener(k),W(google.maps.event.addListener(M,St.onClusteringEnd,O)))},[O]),u.useEffect(function(){typeof r<"u"&&M!==null&&Ce.averageCenter(M,r)},[M,r]),u.useEffect(function(){typeof i<"u"&&M!==null&&Ce.batchSizeIE(M,i)},[M,i]),u.useEffect(function(){typeof o<"u"&&M!==null&&Ce.calculator(M,o)},[M,o]),u.useEffect(function(){typeof s<"u"&&M!==null&&Ce.clusterClass(M,s)},[M,s]),u.useEffect(function(){typeof a<"u"&&M!==null&&Ce.enableRetinaIcons(M,a)},[M,a]),u.useEffect(function(){typeof l<"u"&&M!==null&&Ce.gridSize(M,l)},[M,l]),u.useEffect(function(){typeof c<"u"&&M!==null&&Ce.ignoreHidden(M,c)},[M,c]),u.useEffect(function(){typeof f<"u"&&M!==null&&Ce.imageExtension(M,f)},[M,f]),u.useEffect(function(){typeof d<"u"&&M!==null&&Ce.imagePath(M,d)},[M,d]),u.useEffect(function(){typeof p<"u"&&M!==null&&Ce.imageSizes(M,p)},[M,p]),u.useEffect(function(){typeof v<"u"&&M!==null&&Ce.maxZoom(M,v)},[M,v]),u.useEffect(function(){typeof g<"u"&&M!==null&&Ce.minimumClusterSize(M,g)},[M,g]),u.useEffect(function(){typeof h<"u"&&M!==null&&Ce.styles(M,h)},[M,h]),u.useEffect(function(){typeof w<"u"&&M!==null&&Ce.title(M,w)},[M,w]),u.useEffect(function(){typeof S<"u"&&M!==null&&Ce.zoomOnClick(M,S)},[M,S]),u.useEffect(function(){if(P){var ee=Q({},n||Ew),q=new cd(P,[],ee);return r&&Ce.averageCenter(q,r),i&&Ce.batchSizeIE(q,i),o&&Ce.calculator(q,o),s&&Ce.clusterClass(q,s),a&&Ce.enableRetinaIcons(q,a),l&&Ce.gridSize(q,l),c&&Ce.ignoreHidden(q,c),f&&Ce.imageExtension(q,f),d&&Ce.imagePath(q,d),p&&Ce.imageSizes(q,p),v&&Ce.maxZoom(q,v),g&&Ce.minimumClusterSize(q,g),h&&Ce.styles(q,h),w&&Ce.title(q,w),S&&Ce.zoomOnClick(q,S),m&&U(google.maps.event.addListener(q,St.onMouseOut,m)),L&&K(google.maps.event.addListener(q,St.onMouseOver,L)),y&&$(google.maps.event.addListener(q,St.onClick,y)),b&&W(google.maps.event.addListener(q,St.onClusteringBegin,b)),O&&A(google.maps.event.addListener(q,St.onClusteringEnd,O)),_(q),x&&x(q),function(){N!==null&&google.maps.event.removeListener(N),I!==null&&google.maps.event.removeListener(I),V!==null&&google.maps.event.removeListener(V),z!==null&&google.maps.event.removeListener(z),k!==null&&google.maps.event.removeListener(k),C&&C(q)}}},[]),M!==null&&e(M)||null}u.memo(xw);var Cw=function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={markerClusterer:null},n.setClustererCallback=function(){n.state.markerClusterer!==null&&n.props.onLoad&&n.props.onLoad(n.state.markerClusterer)},n}return e.prototype.componentDidMount=function(){if(this.context){var n=new cd(this.context,[],this.props.options);this.registeredEvents=fe({updaterMap:Ce,eventMap:St,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{markerClusterer:n}},this.setClustererCallback)}},e.prototype.componentDidUpdate=function(n){this.state.markerClusterer&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Ce,eventMap:St,prevProps:n,nextProps:this.props,instance:this.state.markerClusterer}))},e.prototype.componentWillUnmount=function(){this.state.markerClusterer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),ge(this.registeredEvents),this.state.markerClusterer.setMap(null))},e.prototype.render=function(){return this.state.markerClusterer!==null?this.props.children(this.state.markerClusterer):null},e.contextType=le,e}(u.PureComponent);function sc(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}var ud=function(){function t(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.bind(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(t,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 t.prototype.createInfoBoxDiv=function(){var e=this,n=function(c){c.returnValue=!1,c.preventDefault&&c.preventDefault(),e.enableEventPropagation||sc(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 r=this.getPanes();if(r!==null&&r[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 o=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],s=0,a=o;s<a.length;s++){var l=a[s];this.eventListeners.push(google.maps.event.addListener(this.div,l,sc))}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",n),google.maps.event.trigger(this,"domready")}},t.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},t.prototype.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&this.closeBoxURL!==""?google.maps.event.addListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},t.prototype.closeClickHandler=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(this,"closeclick"),this.close()},t.prototype.getCloseClickHandler=function(){return this.closeClickHandler},t.prototype.panBox=function(e){if(this.div&&!e){var n=this.getMap();if(n instanceof google.maps.Map){var r=0,i=0,o=n.getBounds();o&&!o.contains(this.position)&&n.setCenter(this.position);var s=n.getDiv(),a=s.offsetWidth,l=s.offsetHeight,c=this.pixelOffset.width,f=this.pixelOffset.height,d=this.div.offsetWidth,p=this.div.offsetHeight,v=this.infoBoxClearance.width,g=this.infoBoxClearance.height,h=this.getProjection(),w=h.fromLatLngToContainerPixel(this.position);w!==null&&(w.x<-c+v?r=w.x+c-v:w.x+d+c+v>a&&(r=w.x+d+c+v-a),this.alignBottom?w.y<-f+g+p?i=w.y+f-g-p:w.y+f+g>l&&(i=w.y+f+g-l):w.y<-f+g?i=w.y+f-g:w.y+p+f+g>l&&(i=w.y+p+f+g-l)),r===0&&i===0||n.panBy(r,i)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var r=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+r*100+')"',this.div.style.filter="alpha(opacity="+r*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")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,r=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.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},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.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()},t.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")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var r=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var i=n.getPosition();r.setPosition(i)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){r.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e<n.length;e++){var r=n[e];google.maps.event.removeListener(r)}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)},t.prototype.extend=function(e,n){return(function(i){for(var o in i.prototype)Object.prototype.hasOwnProperty.call(this,o)||(this.prototype[o]=i.prototype[o]);return this}).apply(e,[n])},t}(),ac={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},lc={options:function(t,e){t.setOptions(e)},position:function(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},_w={};function Ow(t){var e=t.children,n=t.anchor,r=t.options,i=t.position,o=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,c=t.onPositionChanged,f=t.onZindexChanged,d=t.onLoad,p=t.onUnmount,v=u.useContext(le),g=u.useState(null),h=g[0],w=g[1],S=u.useState(null),y=S[0],b=S[1],O=u.useState(null),L=O[0],m=O[1],x=u.useState(null),C=x[0],R=x[1],M=u.useState(null),_=M[0],P=M[1],j=u.useState(null),V=j[0],$=j[1],G=u.useRef(null);return u.useEffect(function(){v&&h!==null&&(h.close(),n?h.open(v,n):h.getPosition()&&h.open(v))},[v,h,n]),u.useEffect(function(){r&&h!==null&&h.setOptions(r)},[h,r]),u.useEffect(function(){if(i&&h!==null){var z=i instanceof google.maps.LatLng?i:new google.maps.LatLng(i.lat,i.lng);h.setPosition(z)}},[i]),u.useEffect(function(){typeof o=="number"&&h!==null&&h.setZIndex(o)},[o]),u.useEffect(function(){h&&s&&(y!==null&&google.maps.event.removeListener(y),b(google.maps.event.addListener(h,"closeclick",s)))},[s]),u.useEffect(function(){h&&a&&(L!==null&&google.maps.event.removeListener(L),m(google.maps.event.addListener(h,"domready",a)))},[a]),u.useEffect(function(){h&&l&&(C!==null&&google.maps.event.removeListener(C),R(google.maps.event.addListener(h,"content_changed",l)))},[l]),u.useEffect(function(){h&&c&&(_!==null&&google.maps.event.removeListener(_),P(google.maps.event.addListener(h,"position_changed",c)))},[c]),u.useEffect(function(){h&&f&&(V!==null&&google.maps.event.removeListener(V),$(google.maps.event.addListener(h,"zindex_changed",f)))},[f]),u.useEffect(function(){if(v){var z=r||_w,W=z.position,D=Pa(z,["position"]),k=void 0;W&&!(W instanceof google.maps.LatLng)&&(k=new google.maps.LatLng(W.lat,W.lng));var A=new ud(Q(Q({},D),k?{position:k}:{}));G.current=document.createElement("div"),w(A),s&&b(google.maps.event.addListener(A,"closeclick",s)),a&&m(google.maps.event.addListener(A,"domready",a)),l&&R(google.maps.event.addListener(A,"content_changed",l)),c&&P(google.maps.event.addListener(A,"position_changed",c)),f&&$(google.maps.event.addListener(A,"zindex_changed",f)),A.setContent(G.current),n?A.open(v,n):A.getPosition()?A.open(v):qe(!1,"You must provide either an anchor or a position prop for <InfoBox>."),d&&d(A)}return function(){h!==null&&(y&&google.maps.event.removeListener(y),C&&google.maps.event.removeListener(C),L&&google.maps.event.removeListener(L),_&&google.maps.event.removeListener(_),V&&google.maps.event.removeListener(V),p&&p(h),h.close())}},[]),G.current?dr.createPortal(u.Children.only(e),G.current):null}u.memo(Ow);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoBox:null},n.open=function(r,i){i?n.context!==null&&r.open(n.context,i):r.getPosition()?n.context!==null&&r.open(n.context):qe(!1,"You must provide either an anchor or a position prop for <InfoBox>.")},n.setInfoBoxCallback=function(){n.state.infoBox!==null&&n.containerElement!==null&&(n.state.infoBox.setContent(n.containerElement),n.open(n.state.infoBox,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoBox))},n}return e.prototype.componentDidMount=function(){var n=this.props.options||{},r=n.position,i=Pa(n,["position"]),o;r&&!(r instanceof google.maps.LatLng)&&(o=new google.maps.LatLng(r.lat,r.lng));var s=new ud(Q(Q({},i),o?{position:o}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=fe({updaterMap:lc,eventMap:ac,prevProps:{},nextProps:this.props,instance:s}),this.setState({infoBox:s},this.setInfoBoxCallback)},e.prototype.componentDidUpdate=function(n){var r=this.state.infoBox;r!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:lc,eventMap:ac,prevProps:n,nextProps:this.props,instance:r}))},e.prototype.componentWillUnmount=function(){var n=this.props.onUnmount,r=this.state.infoBox;r!==null&&(n&&n(r),ge(this.registeredEvents),r.close())},e.prototype.render=function(){return this.containerElement?dr.createPortal(u.Children.only(this.props.children),this.containerElement):null},e.contextType=le,e})(u.PureComponent);var Mw=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},cc=id(Mw);const uc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],us=1,Rr=8;class Ra{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const i=r>>4;if(i!==us)throw new Error(`Got v${i} data when expected v${us}.`);const o=uc[r&15];if(!o)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new Ra(a,s,o,e)}constructor(e,n=64,r=Float64Array,i){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=uc.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,Rr,e),this.coords=new this.ArrayType(this.data,Rr+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Rr+s+a+l),this.ids=new this.IndexArrayType(this.data,Rr,e),this.coords=new this.ArrayType(this.data,Rr+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(us<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=n,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return ea(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,r,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,l=[0,o.length-1,0],c=[];for(;l.length;){const f=l.pop()||0,d=l.pop()||0,p=l.pop()||0;if(d-p<=a){for(let w=p;w<=d;w++){const S=s[2*w],y=s[2*w+1];S>=e&&S<=r&&y>=n&&y<=i&&c.push(o[w])}continue}const v=p+d>>1,g=s[2*v],h=s[2*v+1];g>=e&&g<=r&&h>=n&&h<=i&&c.push(o[v]),(f===0?e<=g:n<=h)&&(l.push(p),l.push(v-1),l.push(1-f)),(f===0?r>=g:i>=h)&&(l.push(v+1),l.push(d),l.push(1-f))}return c}within(e,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:s}=this,a=[0,i.length-1,0],l=[],c=r*r;for(;a.length;){const f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let w=p;w<=d;w++)fc(o[2*w],o[2*w+1],e,n)<=c&&l.push(i[w]);continue}const v=p+d>>1,g=o[2*v],h=o[2*v+1];fc(g,h,e,n)<=c&&l.push(i[v]),(f===0?e-r<=g:n-r<=h)&&(a.push(p),a.push(v-1),a.push(1-f)),(f===0?e+r>=g:n+r>=h)&&(a.push(v+1),a.push(d),a.push(1-f))}return l}}function ea(t,e,n,r,i,o){if(i-r<=n)return;const s=r+i>>1;fd(t,e,s,r,i,o),ea(t,e,n,r,s-1,1-o),ea(t,e,n,s+1,i,1-o)}function fd(t,e,n,r,i,o){for(;i>r;){if(i-r>600){const c=i-r+1,f=n-r+1,d=Math.log(c),p=.5*Math.exp(2*d/3),v=.5*Math.sqrt(d*p*(c-p)/c)*(f-c/2<0?-1:1),g=Math.max(r,Math.floor(n-f*p/c+v)),h=Math.min(i,Math.floor(n+(c-f)*p/c+v));fd(t,e,n,g,h,o)}const s=e[2*n+o];let a=r,l=i;for(Tr(t,e,r,n),e[2*i+o]>s&&Tr(t,e,r,i);a<l;){for(Tr(t,e,a,l),a++,l--;e[2*a+o]<s;)a++;for(;e[2*l+o]>s;)l--}e[2*r+o]===s?Tr(t,e,r,l):(l++,Tr(t,e,l,i)),l<=n&&(r=l+1),n<=l&&(i=l-1)}}function Tr(t,e,n,r){fs(t,n,r),fs(e,2*n,2*r),fs(e,2*n+1,2*r+1)}function fs(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function fc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}const Pw={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},dc=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),On=2,fn=3,ds=4,un=5,dd=6;class kw{constructor(e){this.options=Object.assign(Object.create(Pw),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:r,maxZoom:i}=this.options;n&&console.time("total time");const o=`prepare ${e.length} points`;n&&console.time(o),this.points=e;const s=[];for(let l=0;l<e.length;l++){const c=e[l];if(!c.geometry)continue;const[f,d]=c.geometry.coordinates,p=dc(Bi(f)),v=dc(Ui(d));s.push(p,v,1/0,l,-1,1),this.options.reduce&&s.push(0)}let a=this.trees[i+1]=this._createTree(s);n&&console.timeEnd(o);for(let l=i;l>=r;l--){const c=+Date.now();a=this.trees[l]=this._createTree(this._cluster(a,l)),n&&console.log("z%d: %d clusters in %dms",l,a.numItems,+Date.now()-c)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let r=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const d=this.getClusters([r,i,180,s],n),p=this.getClusters([-180,i,o,s],n);return d.concat(p)}const a=this.trees[this._limitZoom(n)],l=a.range(Bi(r),Ui(s),Bi(o),Ui(i)),c=a.data,f=[];for(const d of l){const p=this.stride*d;f.push(c[p+un]>1?pc(c,p,this.clusterProps):this.points[c[p+fn]])}return f}getChildren(e){const n=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(i);const s=o.data;if(n*this.stride>=s.length)throw new Error(i);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=s[n*this.stride],c=s[n*this.stride+1],f=o.within(l,c,a),d=[];for(const p of f){const v=p*this.stride;s[v+ds]===e&&d.push(s[v+un]>1?pc(s,v,this.clusterProps):this.points[s[v+fn]])}if(d.length===0)throw new Error(i);return d}getLeaves(e,n,r){n=n||10,r=r||0;const i=[];return this._appendLeaves(i,e,n,r,0),i}getTile(e,n,r){const i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:s,radius:a}=this.options,l=a/s,c=(r-l)/o,f=(r+1+l)/o,d={features:[]};return this._addTileFeatures(i.range((n-l)/o,c,(n+1+l)/o,f),i.data,n,r,o,d),n===0&&this._addTileFeatures(i.range(1-l/o,c,1,f),i.data,o,r,o,d),n===o-1&&this._addTileFeatures(i.range(0,c,l/o,f),i.data,-1,r,o,d),d.features.length?d:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const r=this.getChildren(e);if(n++,r.length!==1)break;e=r[0].properties.cluster_id}return n}_appendLeaves(e,n,r,i,o){const s=this.getChildren(n);for(const a of s){const l=a.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(e,l.cluster_id,r,i,o):o<i?o++:e.push(a),e.length===r)break}return o}_createTree(e){const n=new Ra(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)n.add(e[r],e[r+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,n,r,i,o,s){for(const a of e){const l=a*this.stride,c=n[l+un]>1;let f,d,p;if(c)f=pd(n,l,this.clusterProps),d=n[l],p=n[l+1];else{const h=this.points[n[l+fn]];f=h.properties;const[w,S]=h.geometry.coordinates;d=Bi(w),p=Ui(S)}const v={type:1,geometry:[[Math.round(this.options.extent*(d*o-r)),Math.round(this.options.extent*(p*o-i))]],tags:f};let g;c||this.options.generateId?g=n[l+fn]:g=this.points[n[l+fn]].id,g!==void 0&&(v.id=g),s.features.push(v)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:r,extent:i,reduce:o,minPoints:s}=this.options,a=r/(i*Math.pow(2,n)),l=e.data,c=[],f=this.stride;for(let d=0;d<l.length;d+=f){if(l[d+On]<=n)continue;l[d+On]=n;const p=l[d],v=l[d+1],g=e.within(l[d],l[d+1],a),h=l[d+un];let w=h;for(const S of g){const y=S*f;l[y+On]>n&&(w+=l[y+un])}if(w>h&&w>=s){let S=p*h,y=v*h,b,O=-1;const L=((d/f|0)<<5)+(n+1)+this.points.length;for(const m of g){const x=m*f;if(l[x+On]<=n)continue;l[x+On]=n;const C=l[x+un];S+=l[x]*C,y+=l[x+1]*C,l[x+ds]=L,o&&(b||(b=this._map(l,d,!0),O=this.clusterProps.length,this.clusterProps.push(b)),o(b,this._map(l,x)))}l[d+ds]=L,c.push(S/w,y/w,1/0,L,-1,w),o&&c.push(O)}else{for(let S=0;S<f;S++)c.push(l[d+S]);if(w>1)for(const S of g){const y=S*f;if(!(l[y+On]<=n)){l[y+On]=n;for(let b=0;b<f;b++)c.push(l[y+b])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,r){if(e[n+un]>1){const s=this.clusterProps[e[n+dd]];return r?Object.assign({},s):s}const i=this.points[e[n+fn]].properties,o=this.options.map(i);return r&&o===i?Object.assign({},o):o}}function pc(t,e,n){return{type:"Feature",id:t[e+fn],properties:pd(t,e,n),geometry:{type:"Point",coordinates:[Rw(t[e]),Tw(t[e+1])]}}}function pd(t,e,n){const r=t[e+un],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=t[e+dd],s=o===-1?{}:Object.assign({},n[o]);return Object.assign(s,{cluster:!0,cluster_id:t[e+fn],point_count:r,point_count_abbreviated:i})}function Bi(t){return t/360+.5}function Ui(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Rw(t){return(t-.5)*360}function Tw(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! *****************************************************************************
|
|
84
|
+
***************************************************************************** */function dw(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{c(r.next(f))}catch(d){s(d)}}function l(f){try{c(r.throw(f))}catch(d){s(d)}}function c(f){f.done?o(f.value):i(f.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}var pw=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const nc="__googleMapsScriptId";var Qn;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(Qn||(Qn={}));class Tn{constructor({apiKey:e,authReferrerPolicy:n,channel:r,client:i,id:o=nc,language:s,libraries:a=[],mapIds:l,nonce:c,region:f,retries:d=3,url:p="https://maps.googleapis.com/maps/api/js",version:m}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=n,this.channel=r,this.client=i,this.id=o||nc,this.language=s,this.libraries=a,this.mapIds=l,this.nonce=c,this.region=f,this.retries=d,this.url=p,this.version=m,Tn.instance){if(!pw(this.options,Tn.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Tn.instance.options)}`);return Tn.instance}Tn.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?Qn.FAILURE:this.done?Qn.SUCCESS:this.loading?Qn.LOADING:Qn.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,n)=>{this.loadCallback(r=>{r?n(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,n;if(document.getElementById(this.id)){this.callback();return}const r={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};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((n=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||n===void 0)&&n.importLibrary||(o=>{let s,a,l,c="The Google Maps JavaScript API",f="google",d="importLibrary",p="__ib__",m=document,g=window;g=g[f]||(g[f]={});const h=g.maps||(g.maps={}),S=new Set,w=new URLSearchParams,y=()=>s||(s=new Promise((b,_)=>dw(this,void 0,void 0,function*(){var E;yield a=m.createElement("script"),a.id=this.id,w.set("libraries",[...S]+"");for(l in o)w.set(l.replace(/[A-Z]/g,v=>"_"+v[0].toLowerCase()),o[l]);w.set("callback",f+".maps."+p),a.src=this.url+"?"+w,h[p]=b,a.onerror=()=>s=_(Error(c+" could not load.")),a.nonce=this.nonce||((E=m.querySelector("script[nonce]"))===null||E===void 0?void 0:E.nonce)||"",m.head.append(a)})));h[d]?console.warn(c+" only loads once. Ignoring:",o):h[d]=(b,..._)=>S.add(b)&&y().then(()=>h[d](b,..._))})(r);const i=this.libraries.map(o=>this.importLibrary(o));i.length||i.push(this.importLibrary("core")),Promise.all(i).then(()=>this.callback(),o=>{const s=new ErrorEvent("error",{error:o});this.loadErrorCallback(s)})}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){const n=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${n} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},n)}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.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||(this.loading=!0,this.setScript())}}}var hw=["maps"];function gw(t){var e=t.id,n=e===void 0?ai.id:e,r=t.version,i=r===void 0?ai.version:r,o=t.nonce,s=t.googleMapsApiKey,a=t.language,l=t.region,c=t.libraries,f=c===void 0?hw:c,d=t.preventGoogleFontsLoading,p=t.mapIds,m=t.authReferrerPolicy,g=u.useRef(!1),h=u.useState(!1),S=h[0],w=h[1],y=u.useState(void 0),b=y[0],_=y[1];u.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]);var E=u.useMemo(function(){return new Tn({id:n,apiKey:s,version:i,libraries:f,language:a||"en",region:l||"US",mapIds:p||[],nonce:o||"",authReferrerPolicy:m||"origin"})},[n,s,i,f,a,l,p,o,m]);u.useEffect(function(){S||E.load().then(function(){g.current&&w(!0)}).catch(function(C){_(C)})},[]),u.useEffect(function(){vn&&d&&Ta()},[d]);var v=u.useRef();return u.useEffect(function(){v.current&&f!==v.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"),v.current=f},[f]),{isLoaded:S,loadError:b}}var rc={},ic={options:function(t,e){t.setOptions(e)}};function vw(t){var e=t.options,n=t.onLoad,r=t.onUnmount,i=u.useContext(le),o=u.useState(null),s=o[0],a=o[1];return u.useEffect(function(){s!==null&&s.setMap(i)},[i]),u.useEffect(function(){e&&s!==null&&s.setOptions(e)},[s,e]),u.useEffect(function(){var l=new google.maps.TrafficLayer(Q(Q({},e||{}),{map:i}));return a(l),n&&n(l),function(){s!==null&&(r&&r(s),s.setMap(null))}},[]),null}u.memo(vw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={trafficLayer:null},n.setTrafficLayerCallback=function(){n.state.trafficLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.trafficLayer)},n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=new google.maps.TrafficLayer(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:ic,eventMap:rc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{trafficLayer:n}},this.setTrafficLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.trafficLayer!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:ic,eventMap:rc,prevProps:n,nextProps:this.props,instance:this.state.trafficLayer}))},e.prototype.componentWillUnmount=function(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),ge(this.registeredEvents),this.state.trafficLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);function mw(t){var e=t.onLoad,n=t.onUnmount,r=u.useContext(le),i=u.useState(null),o=i[0],s=i[1];return u.useEffect(function(){o!==null&&o.setMap(r)},[r]),u.useEffect(function(){var a=new google.maps.BicyclingLayer;return s(a),a.setMap(r),e&&e(a),function(){a!==null&&(n&&n(a),a.setMap(null))}},[]),null}u.memo(mw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={bicyclingLayer:null},n.setBicyclingLayerCallback=function(){n.state.bicyclingLayer!==null&&(n.state.bicyclingLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.bicyclingLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.BicyclingLayer;this.setState(function(){return{bicyclingLayer:n}},this.setBicyclingLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);function yw(t){var e=t.onLoad,n=t.onUnmount,r=u.useContext(le),i=u.useState(null),o=i[0],s=i[1];return u.useEffect(function(){o!==null&&o.setMap(r)},[r]),u.useEffect(function(){var a=new google.maps.TransitLayer;return s(a),a.setMap(r),e&&e(a),function(){o!==null&&(n&&n(o),o.setMap(null))}},[]),null}u.memo(yw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={transitLayer:null},n.setTransitLayerCallback=function(){n.state.transitLayer!==null&&(n.state.transitLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.transitLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:n}},this.setTransitLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var oc={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},sc={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}};function bw(t){var e=t.options,n=t.drawingMode,r=t.onCircleComplete,i=t.onMarkerComplete,o=t.onOverlayComplete,s=t.onPolygonComplete,a=t.onPolylineComplete,l=t.onRectangleComplete,c=t.onLoad,f=t.onUnmount,d=u.useContext(le),p=u.useState(null),m=p[0],g=p[1],h=u.useState(null),S=h[0],w=h[1],y=u.useState(null),b=y[0],_=y[1],E=u.useState(null),v=E[0],L=E[1],C=u.useState(null),k=C[0],M=C[1],O=u.useState(null),P=O[0],j=O[1],U=u.useState(null),$=U[0],G=U[1];return u.useEffect(function(){m!==null&&m.setMap(d)},[d]),u.useEffect(function(){e&&m!==null&&m.setOptions(e)},[m,e]),u.useEffect(function(){n&&m!==null&&m.setDrawingMode(n)},[m,n]),u.useEffect(function(){m&&r&&(S!==null&&google.maps.event.removeListener(S),w(google.maps.event.addListener(m,"circlecomplete",r)))},[m,r]),u.useEffect(function(){m&&i&&(b!==null&&google.maps.event.removeListener(b),_(google.maps.event.addListener(m,"markercomplete",i)))},[m,i]),u.useEffect(function(){m&&o&&(v!==null&&google.maps.event.removeListener(v),L(google.maps.event.addListener(m,"overlaycomplete",o)))},[m,o]),u.useEffect(function(){m&&s&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(m,"polygoncomplete",s)))},[m,s]),u.useEffect(function(){m&&a&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(m,"polylinecomplete",a)))},[m,a]),u.useEffect(function(){m&&l&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(m,"rectanglecomplete",l)))},[m,l]),u.useEffect(function(){qe(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var z=new google.maps.drawing.DrawingManager(Q(Q({},e||{}),{map:d}));return n&&z.setDrawingMode(n),r&&w(google.maps.event.addListener(z,"circlecomplete",r)),i&&_(google.maps.event.addListener(z,"markercomplete",i)),o&&L(google.maps.event.addListener(z,"overlaycomplete",o)),s&&M(google.maps.event.addListener(z,"polygoncomplete",s)),a&&j(google.maps.event.addListener(z,"polylinecomplete",a)),l&&G(google.maps.event.addListener(z,"rectanglecomplete",l)),g(z),c&&c(z),function(){m!==null&&(S&&google.maps.event.removeListener(S),b&&google.maps.event.removeListener(b),v&&google.maps.event.removeListener(v),k&&google.maps.event.removeListener(k),P&&google.maps.event.removeListener(P),$&&google.maps.event.removeListener($),f&&f(m),m.setMap(null))}},[]),null}u.memo(bw);(function(t){je(e,t);function e(n){var r=t.call(this,n)||this;return r.registeredEvents=[],r.state={drawingManager:null},r.setDrawingManagerCallback=function(){r.state.drawingManager!==null&&r.props.onLoad&&r.props.onLoad(r.state.drawingManager)},qe(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),r}return e.prototype.componentDidMount=function(){var n=new google.maps.drawing.DrawingManager(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:sc,eventMap:oc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{drawingManager:n}},this.setDrawingManagerCallback)},e.prototype.componentDidUpdate=function(n){this.state.drawingManager!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:sc,eventMap:oc,prevProps:n,nextProps:this.props,instance:this.state.drawingManager}))},e.prototype.componentWillUnmount=function(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),ge(this.registeredEvents),this.state.drawingManager.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var ac={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"},lc={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},Co={};function ww(t){var e=t.position,n=t.options,r=t.clusterer,i=t.noClustererRedraw,o=t.children,s=t.draggable,a=t.visible,l=t.animation,c=t.clickable,f=t.cursor,d=t.icon,p=t.label,m=t.opacity,g=t.shape,h=t.title,S=t.zIndex,w=t.onClick,y=t.onDblClick,b=t.onDrag,_=t.onDragEnd,E=t.onDragStart,v=t.onMouseOut,L=t.onMouseOver,C=t.onMouseUp,k=t.onMouseDown,M=t.onRightClick,O=t.onClickableChanged,P=t.onCursorChanged,j=t.onAnimationChanged,U=t.onDraggableChanged,$=t.onFlatChanged,G=t.onIconChanged,z=t.onPositionChanged,W=t.onShapeChanged,D=t.onTitleChanged,R=t.onVisibleChanged,A=t.onZindexChanged,T=t.onLoad,N=t.onUnmount,V=u.useContext(le),Z=u.useState(null),I=Z[0],K=Z[1],ee=u.useState(null),q=ee[0],se=ee[1],de=u.useState(null),ue=de[0],Le=de[1],Fe=u.useState(null),we=Fe[0],Ee=Fe[1],Ie=u.useState(null),Me=Ie[0],Re=Ie[1],re=u.useState(null),ie=re[0],ze=re[1],Ye=u.useState(null),Y=Ye[0],$e=Ye[1],Ne=u.useState(null),pt=Ne[0],at=Ne[1],oe=u.useState(null),wn=oe[0],hi=oe[1],Mt=u.useState(null),Gt=Mt[0],gi=Mt[1],F=u.useState(null),te=F[0],J=F[1],pe=u.useState(null),Te=pe[0],xe=pe[1],Ae=u.useState(null),Pe=Ae[0],Be=Ae[1],ae=u.useState(null),ve=ae[0],ft=ae[1],Wt=u.useState(null),lt=Wt[0],Ke=Wt[1],ht=u.useState(null),gt=ht[0],Qe=ht[1],Nt=u.useState(null),Pt=Nt[0],vt=Nt[1],tn=u.useState(null),Zt=tn[0],vr=tn[1],mr=u.useState(null),Fn=mr[0],yr=mr[1],zn=u.useState(null),Sn=zn[0],br=zn[1],nn=u.useState(null),Ln=nn[0],En=nn[1],xn=u.useState(null),Cn=xn[0],wr=xn[1];u.useEffect(function(){I!==null&&I.setMap(V)},[V]),u.useEffect(function(){typeof n<"u"&&I!==null&&I.setOptions(n)},[I,n]),u.useEffect(function(){typeof s<"u"&&I!==null&&I.setDraggable(s)},[I,s]),u.useEffect(function(){e&&I!==null&&I.setPosition(e)},[I,e]),u.useEffect(function(){typeof a<"u"&&I!==null&&I.setVisible(a)},[I,a]),u.useEffect(function(){I==null||I.setAnimation(l)},[I,l]),u.useEffect(function(){I&&y&&(q!==null&&google.maps.event.removeListener(q),se(google.maps.event.addListener(I,"dblclick",y)))},[y]),u.useEffect(function(){I&&_&&(ue!==null&&google.maps.event.removeListener(ue),Le(google.maps.event.addListener(I,"dragend",_)))},[_]),u.useEffect(function(){I&&E&&(we!==null&&google.maps.event.removeListener(we),Ee(google.maps.event.addListener(I,"dragstart",E)))},[E]),u.useEffect(function(){I&&k&&(Me!==null&&google.maps.event.removeListener(Me),Re(google.maps.event.addListener(I,"mousedown",k)))},[k]),u.useEffect(function(){I&&v&&(ie!==null&&google.maps.event.removeListener(ie),ze(google.maps.event.addListener(I,"mouseout",v)))},[v]),u.useEffect(function(){I&&L&&(Y!==null&&google.maps.event.removeListener(Y),$e(google.maps.event.addListener(I,"mouseover",L)))},[L]),u.useEffect(function(){I&&C&&(pt!==null&&google.maps.event.removeListener(pt),at(google.maps.event.addListener(I,"mouseup",C)))},[C]),u.useEffect(function(){I&&M&&(wn!==null&&google.maps.event.removeListener(wn),hi(google.maps.event.addListener(I,"rightclick",M)))},[M]),u.useEffect(function(){I&&w&&(Gt!==null&&google.maps.event.removeListener(Gt),gi(google.maps.event.addListener(I,"click",w)))},[w]),u.useEffect(function(){I&&b&&(te!==null&&google.maps.event.removeListener(te),J(google.maps.event.addListener(I,"drag",b)))},[b]),u.useEffect(function(){I&&O&&(Te!==null&&google.maps.event.removeListener(Te),xe(google.maps.event.addListener(I,"clickable_changed",O)))},[O]),u.useEffect(function(){I&&P&&(Pe!==null&&google.maps.event.removeListener(Pe),Be(google.maps.event.addListener(I,"cursor_changed",P)))},[P]),u.useEffect(function(){I&&j&&(ve!==null&&google.maps.event.removeListener(ve),ft(google.maps.event.addListener(I,"animation_changed",j)))},[j]),u.useEffect(function(){I&&U&&(lt!==null&&google.maps.event.removeListener(lt),Ke(google.maps.event.addListener(I,"draggable_changed",U)))},[U]),u.useEffect(function(){I&&$&&(gt!==null&&google.maps.event.removeListener(gt),Qe(google.maps.event.addListener(I,"flat_changed",$)))},[$]),u.useEffect(function(){I&&G&&(Pt!==null&&google.maps.event.removeListener(Pt),vt(google.maps.event.addListener(I,"icon_changed",G)))},[G]),u.useEffect(function(){I&&z&&(Zt!==null&&google.maps.event.removeListener(Zt),vr(google.maps.event.addListener(I,"position_changed",z)))},[z]),u.useEffect(function(){I&&W&&(Fn!==null&&google.maps.event.removeListener(Fn),yr(google.maps.event.addListener(I,"shape_changed",W)))},[W]),u.useEffect(function(){I&&D&&(Sn!==null&&google.maps.event.removeListener(Sn),br(google.maps.event.addListener(I,"title_changed",D)))},[D]),u.useEffect(function(){I&&R&&(Ln!==null&&google.maps.event.removeListener(Ln),En(google.maps.event.addListener(I,"visible_changed",R)))},[R]),u.useEffect(function(){I&&A&&(Cn!==null&&google.maps.event.removeListener(Cn),wr(google.maps.event.addListener(I,"zindex_changed",A)))},[A]),u.useEffect(function(){var rn=Q(Q(Q({},n||Co),r?Co:{map:V}),{position:e}),ne=new google.maps.Marker(rn);return r?r.addMarker(ne,!!i):ne.setMap(V),e&&ne.setPosition(e),typeof a<"u"&&ne.setVisible(a),typeof s<"u"&&ne.setDraggable(s),typeof c<"u"&&ne.setClickable(c),typeof f=="string"&&ne.setCursor(f),d&&ne.setIcon(d),typeof p<"u"&&ne.setLabel(p),typeof m<"u"&&ne.setOpacity(m),g&&ne.setShape(g),typeof h=="string"&&ne.setTitle(h),typeof S=="number"&&ne.setZIndex(S),y&&se(google.maps.event.addListener(ne,"dblclick",y)),_&&Le(google.maps.event.addListener(ne,"dragend",_)),E&&Ee(google.maps.event.addListener(ne,"dragstart",E)),k&&Re(google.maps.event.addListener(ne,"mousedown",k)),v&&ze(google.maps.event.addListener(ne,"mouseout",v)),L&&$e(google.maps.event.addListener(ne,"mouseover",L)),C&&at(google.maps.event.addListener(ne,"mouseup",C)),M&&hi(google.maps.event.addListener(ne,"rightclick",M)),w&&gi(google.maps.event.addListener(ne,"click",w)),b&&J(google.maps.event.addListener(ne,"drag",b)),O&&xe(google.maps.event.addListener(ne,"clickable_changed",O)),P&&Be(google.maps.event.addListener(ne,"cursor_changed",P)),j&&ft(google.maps.event.addListener(ne,"animation_changed",j)),U&&Ke(google.maps.event.addListener(ne,"draggable_changed",U)),$&&Qe(google.maps.event.addListener(ne,"flat_changed",$)),G&&vt(google.maps.event.addListener(ne,"icon_changed",G)),z&&vr(google.maps.event.addListener(ne,"position_changed",z)),W&&yr(google.maps.event.addListener(ne,"shape_changed",W)),D&&br(google.maps.event.addListener(ne,"title_changed",D)),R&&En(google.maps.event.addListener(ne,"visible_changed",R)),A&&wr(google.maps.event.addListener(ne,"zindex_changed",A)),K(ne),T&&T(ne),function(){q!==null&&google.maps.event.removeListener(q),ue!==null&&google.maps.event.removeListener(ue),we!==null&&google.maps.event.removeListener(we),Me!==null&&google.maps.event.removeListener(Me),ie!==null&&google.maps.event.removeListener(ie),Y!==null&&google.maps.event.removeListener(Y),pt!==null&&google.maps.event.removeListener(pt),wn!==null&&google.maps.event.removeListener(wn),Gt!==null&&google.maps.event.removeListener(Gt),Te!==null&&google.maps.event.removeListener(Te),Pe!==null&&google.maps.event.removeListener(Pe),ve!==null&&google.maps.event.removeListener(ve),lt!==null&&google.maps.event.removeListener(lt),gt!==null&&google.maps.event.removeListener(gt),Pt!==null&&google.maps.event.removeListener(Pt),Zt!==null&&google.maps.event.removeListener(Zt),Sn!==null&&google.maps.event.removeListener(Sn),Ln!==null&&google.maps.event.removeListener(Ln),Cn!==null&&google.maps.event.removeListener(Cn),N&&N(ne),r?r.removeMarker(ne,!!i):ne&&ne.setMap(null)}},[]);var Sr=u.useMemo(function(){return o?u.Children.map(o,function(rn){if(!u.isValidElement(rn))return rn;var ne=rn;return u.cloneElement(ne,{anchor:I})}):null},[o,I]);return x.jsx(x.Fragment,{children:Sr})||null}u.memo(ww);var fd=function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=Q(Q(Q({},this.props.options||Co),this.props.clusterer?Co:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(n),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=fe({updaterMap:lc,eventMap:ac,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},e.prototype.componentDidUpdate=function(n){this.marker&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:lc,eventMap:ac,prevProps:n,nextProps:this.props,instance:this.marker}))},e.prototype.componentWillUnmount=function(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),ge(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))},e.prototype.render=function(){var n=this,r=null;return this.props.children&&(r=u.Children.map(this.props.children,function(i){if(!u.isValidElement(i))return i;var o=i;return u.cloneElement(o,{anchor:n.marker})})),r||null},e.contextType=le,e}(u.PureComponent),Sw=function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,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 t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var r=n.getMaxZoom(),i=this.cluster.getBounds(),o=n.getMap();o!==null&&"fitBounds"in o&&o.fitBounds(i),this.timeOut=window.setTimeout(function(){var s=n.getMap();if(s!==null){"fitBounds"in s&&s.fitBounds(i);var a=s.getZoom()||0;r!==null&&a>r&&s.setZoom(r+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.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 n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_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))},t.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)},t.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"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,r,i,o,s;if(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(" "),c=parseInt(((e=l[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),f=parseInt(((n=l[1])===null||n===void 0?void 0:n.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(f,"px; left: ").concat(c,"px")),this.cluster.getClusterer().enableRetinaIcons||(p.style.clip="rect(-".concat(f,"px, -").concat(c+this.width,"px, -").concat(f+this.height,", -").concat(c,")"));var m=document.createElement("div");m.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")),!((r=this.sums)===null||r===void 0)&&r.text&&(m.innerText="".concat((i=this.sums)===null||i===void 0?void 0:i.text)),!((o=this.sums)===null||o===void 0)&&o.html&&(m.innerHTML="".concat((s=this.sums)===null||s===void 0?void 0:s.html)),this.div.innerHTML="",this.div.appendChild(p),this.div.appendChild(m),this.div.title=a,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),r=n[Math.min(n.length-1,Math.max(0,e.index-1))];r&&(this.url=r.url,this.height=r.height,this.width=r.width,r.className&&(this.className="".concat(this.clusterClassName," ").concat(r.className)),this.anchorText=r.anchorText||[0,0],this.anchorIcon=r.anchorIcon||[this.height/2,this.width/2],this.textColor=r.textColor||"black",this.textSize=r.textSize||11,this.textDecoration=r.textDecoration||"none",this.fontWeight=r.fontWeight||"bold",this.fontStyle=r.fontStyle||"normal",this.fontFamily=r.fontFamily||"Arial,sans-serif",this.backgroundPosition=r.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t}(),Lw=function(){function t(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 Sw(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 t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),r=0,i=n;r<i.length;r++){var o=i[r],s=o.getPosition();s&&e.extend(s)}return e},t.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},t.prototype.addMarker=function(e){var n;if(this.isMarkerAlreadyAdded(e))return!1;if(this.center){if(this.averageCenter){var r=e.getPosition();if(r){var i=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(i-1)+r.lat())/i,(this.center.lng()*(i-1)+r.lng())/i),this.calculateBounds()}}}else{var r=e.getPosition();r&&(this.center=r,this.calculateBounds())}e.isAdded=!0,this.markers.push(e);var o=this.markers.length,s=this.markerClusterer.getMaxZoom(),a=(n=this.map)===null||n===void 0?void 0:n.getZoom();if(s!==null&&typeof a<"u"&&a>s)e.getMap()!==this.map&&e.setMap(this.map);else if(o<this.minClusterSize)e.getMap()!==this.map&&e.setMap(this.map);else if(o===this.minClusterSize)for(var l=0,c=this.markers;l<c.length;l++){var f=c[l];f.setMap(null)}else e.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(e){if(this.bounds!==null){var n=e.getPosition();if(n)return this.bounds.contains(n)}return!1},t.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},t.prototype.updateIcon=function(){var e,n=this.markers.length,r=this.markerClusterer.getMaxZoom(),i=(e=this.map)===null||e===void 0?void 0:e.getZoom();if(r!==null&&typeof i<"u"&&i>r){this.clusterIcon.hide();return}if(n<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()},t.prototype.isMarkerAlreadyAdded=function(e){if(this.markers.includes)return this.markers.includes(e);for(var n=0;n<this.markers.length;n++)if(e===this.markers[n])return!0;return!1},t}();function Ew(t,e){var n=t.length,r=n.toString().length,i=Math.min(r,e);return{text:n.toString(),index:i,title:""}}var xw=2e3,Cw=500,_w="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",Ow="png",Mw=[53,56,66,78,90],Pw="cluster",dd=function(){function t(e,n,r){n===void 0&&(n=[]),r===void 0&&(r={}),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.createClusters=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(t,google.maps.OverlayView),this.markers=[],this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=r.gridSize||60,this.minClusterSize=r.minimumClusterSize||2,this.maxZoom=r.maxZoom||null,this.styles=r.styles||[],this.title=r.title||"",this.zoomOnClick=!0,r.zoomOnClick!==void 0&&(this.zoomOnClick=r.zoomOnClick),this.averageCenter=!1,r.averageCenter!==void 0&&(this.averageCenter=r.averageCenter),this.ignoreHidden=!1,r.ignoreHidden!==void 0&&(this.ignoreHidden=r.ignoreHidden),this.enableRetinaIcons=!1,r.enableRetinaIcons!==void 0&&(this.enableRetinaIcons=r.enableRetinaIcons),this.imagePath=r.imagePath||_w,this.imageExtension=r.imageExtension||Ow,this.imageSizes=r.imageSizes||Mw,this.calculator=r.calculator||Ew,this.batchSize=r.batchSize||xw,this.batchSizeIE=r.batchSizeIE||Cw,this.clusterClass=r.clusterClass||Pw,navigator.userAgent.toLowerCase().indexOf("msie")!==-1&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(n,!0),this.setMap(e)}return t.prototype.onZoomChanged=function(){var e,n;this.resetViewport(!1),(((e=this.getMap())===null||e===void 0?void 0:e.getZoom())===(this.get("minZoom")||0)||((n=this.getMap())===null||n===void 0?void 0:n.getZoom())===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")},t.prototype.onIdle=function(){this.redraw()},t.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)])},t.prototype.onRemove=function(){for(var e=0,n=this.markers;e<n.length;e++){var r=n[e];r.getMap()!==this.activeMap&&r.setMap(this.activeMap)}for(var i=0,o=this.clusters;i<o.length;i++){var s=o[i];s.remove()}this.clusters=[];for(var a=0,l=this.listeners;a<l.length;a++){var c=l[a];google.maps.event.removeListener(c)}this.listeners=[],this.activeMap=null,this.ready=!1},t.prototype.draw=function(){},t.prototype.getMap=function(){return null},t.prototype.getPanes=function(){return null},t.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}}},t.prototype.setMap=function(){},t.prototype.addListener=function(){return{remove:function(){}}},t.prototype.bindTo=function(){},t.prototype.get=function(){},t.prototype.notify=function(){},t.prototype.set=function(){},t.prototype.setValues=function(){},t.prototype.unbind=function(){},t.prototype.unbindAll=function(){},t.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})},t.prototype.fitMapToMarkers=function(){for(var e=this.getMarkers(),n=new google.maps.LatLngBounds,r=0,i=e;r<i.length;r++){var o=i[r],s=o.getPosition();s&&n.extend(s)}var a=this.getMap();a!==null&&"fitBounds"in a&&a.fitBounds(n)},t.prototype.getGridSize=function(){return this.gridSize},t.prototype.setGridSize=function(e){this.gridSize=e},t.prototype.getMinimumClusterSize=function(){return this.minClusterSize},t.prototype.setMinimumClusterSize=function(e){this.minClusterSize=e},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.setMaxZoom=function(e){this.maxZoom=e},t.prototype.getStyles=function(){return this.styles},t.prototype.setStyles=function(e){this.styles=e},t.prototype.getTitle=function(){return this.title},t.prototype.setTitle=function(e){this.title=e},t.prototype.getZoomOnClick=function(){return this.zoomOnClick},t.prototype.setZoomOnClick=function(e){this.zoomOnClick=e},t.prototype.getAverageCenter=function(){return this.averageCenter},t.prototype.setAverageCenter=function(e){this.averageCenter=e},t.prototype.getIgnoreHidden=function(){return this.ignoreHidden},t.prototype.setIgnoreHidden=function(e){this.ignoreHidden=e},t.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},t.prototype.setEnableRetinaIcons=function(e){this.enableRetinaIcons=e},t.prototype.getImageExtension=function(){return this.imageExtension},t.prototype.setImageExtension=function(e){this.imageExtension=e},t.prototype.getImagePath=function(){return this.imagePath},t.prototype.setImagePath=function(e){this.imagePath=e},t.prototype.getImageSizes=function(){return this.imageSizes},t.prototype.setImageSizes=function(e){this.imageSizes=e},t.prototype.getCalculator=function(){return this.calculator},t.prototype.setCalculator=function(e){this.calculator=e},t.prototype.getBatchSizeIE=function(){return this.batchSizeIE},t.prototype.setBatchSizeIE=function(e){this.batchSizeIE=e},t.prototype.getClusterClass=function(){return this.clusterClass},t.prototype.setClusterClass=function(e){this.clusterClass=e},t.prototype.getMarkers=function(){return this.markers},t.prototype.getTotalMarkers=function(){return this.markers.length},t.prototype.getClusters=function(){return this.clusters},t.prototype.getTotalClusters=function(){return this.clusters.length},t.prototype.addMarker=function(e,n){this.pushMarkerTo(e),n||this.redraw()},t.prototype.addMarkers=function(e,n){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];i&&this.pushMarkerTo(i)}n||this.redraw()},t.prototype.pushMarkerTo=function(e){var n=this;e.getDraggable()&&google.maps.event.addListener(e,"dragend",function(){n.ready&&(e.isAdded=!1,n.repaint())}),e.isAdded=!1,this.markers.push(e)},t.prototype.removeMarker_=function(e){var n=-1;if(this.markers.indexOf)n=this.markers.indexOf(e);else for(var r=0;r<this.markers.length;r++)if(e===this.markers[r]){n=r;break}return n===-1?!1:(e.setMap(null),this.markers.splice(n,1),!0)},t.prototype.removeMarker=function(e,n){var r=this.removeMarker_(e);return!n&&r&&this.repaint(),r},t.prototype.removeMarkers=function(e,n){for(var r=!1,i=0,o=e;i<o.length;i++){var s=o[i];r=r||this.removeMarker_(s)}return!n&&r&&this.repaint(),r},t.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]},t.prototype.repaint=function(){var e=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout(function(){for(var r=0,i=e;r<i.length;r++){var o=i[r];o.remove()}},0)},t.prototype.getExtendedBounds=function(e){var n=this.getProjection(),r=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()));r!==null&&(r.x+=this.gridSize,r.y-=this.gridSize);var i=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()));if(i!==null&&(i.x-=this.gridSize,i.y+=this.gridSize),r!==null){var o=n.fromDivPixelToLatLng(r);o!==null&&e.extend(o)}if(i!==null){var s=n.fromDivPixelToLatLng(i);s!==null&&e.extend(s)}return e},t.prototype.redraw=function(){this.createClusters(0)},t.prototype.resetViewport=function(e){for(var n=0,r=this.clusters;n<r.length;n++){var i=r[n];i.remove()}this.clusters=[];for(var o=0,s=this.markers;o<s.length;o++){var a=s[o];a.isAdded=!1,e&&a.setMap(null)}},t.prototype.distanceBetweenPoints=function(e,n){var r=6371,i=(n.lat()-e.lat())*Math.PI/180,o=(n.lng()-e.lng())*Math.PI/180,s=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(n.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return r*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))},t.prototype.isMarkerInBounds=function(e,n){var r=e.getPosition();return r?n.contains(r):!1},t.prototype.addToClosestCluster=function(e){for(var n,r=4e4,i=null,o=0,s=this.clusters;o<s.length;o++){var a=s[o];n=a;var l=n.getCenter(),c=e.getPosition();if(l&&c){var f=this.distanceBetweenPoints(l,c);f<r&&(r=f,i=n)}}i&&i.isMarkerInClusterBounds(e)?i.addMarker(e):(n=new Lw(this),n.addMarker(e),this.clusters.push(n))},t.prototype.createClusters=function(e){var n=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 r=this.getMap(),i=r!==null&&("getBounds"in r)?r.getBounds():null,o=(r==null?void 0:r.getZoom())||0,s=o>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(s),l=Math.min(e+this.batchSize,this.markers.length),c=e;c<l;c++){var f=this.markers[c];f&&!f.isAdded&&this.isMarkerInBounds(f,a)&&(!this.ignoreHidden||this.ignoreHidden&&f.getVisible())&&this.addToClosestCluster(f)}if(l<this.markers.length)this.timerRefStatic=window.setTimeout(function(){n.createClusters(l)},0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);for(var d=0,p=this.clusters;d<p.length;d++){var m=p[d];m.updateIcon()}}}},t.prototype.extend=function(e,n){return(function(i){for(var o in i.prototype){var s=o;this.prototype[s]=i.prototype[s]}return this}).apply(e,[n])},t}(),St={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},Ce={averageCenter:function(t,e){t.setAverageCenter(e)},batchSizeIE:function(t,e){t.setBatchSizeIE(e)},calculator:function(t,e){t.setCalculator(e)},clusterClass:function(t,e){t.setClusterClass(e)},enableRetinaIcons:function(t,e){t.setEnableRetinaIcons(e)},gridSize:function(t,e){t.setGridSize(e)},ignoreHidden:function(t,e){t.setIgnoreHidden(e)},imageExtension:function(t,e){t.setImageExtension(e)},imagePath:function(t,e){t.setImagePath(e)},imageSizes:function(t,e){t.setImageSizes(e)},maxZoom:function(t,e){t.setMaxZoom(e)},minimumClusterSize:function(t,e){t.setMinimumClusterSize(e)},styles:function(t,e){t.setStyles(e)},title:function(t,e){t.setTitle(e)},zoomOnClick:function(t,e){t.setZoomOnClick(e)}},kw={};function Rw(t){var e=t.children,n=t.options,r=t.averageCenter,i=t.batchSizeIE,o=t.calculator,s=t.clusterClass,a=t.enableRetinaIcons,l=t.gridSize,c=t.ignoreHidden,f=t.imageExtension,d=t.imagePath,p=t.imageSizes,m=t.maxZoom,g=t.minimumClusterSize,h=t.styles,S=t.title,w=t.zoomOnClick,y=t.onClick,b=t.onClusteringBegin,_=t.onClusteringEnd,E=t.onMouseOver,v=t.onMouseOut,L=t.onLoad,C=t.onUnmount,k=u.useState(null),M=k[0],O=k[1],P=u.useContext(le),j=u.useState(null),U=j[0],$=j[1],G=u.useState(null),z=G[0],W=G[1],D=u.useState(null),R=D[0],A=D[1],T=u.useState(null),N=T[0],V=T[1],Z=u.useState(null),I=Z[0],K=Z[1];return u.useEffect(function(){M&&v&&(N!==null&&google.maps.event.removeListener(N),V(google.maps.event.addListener(M,St.onMouseOut,v)))},[v]),u.useEffect(function(){M&&E&&(I!==null&&google.maps.event.removeListener(I),K(google.maps.event.addListener(M,St.onMouseOver,E)))},[E]),u.useEffect(function(){M&&y&&(U!==null&&google.maps.event.removeListener(U),$(google.maps.event.addListener(M,St.onClick,y)))},[y]),u.useEffect(function(){M&&b&&(z!==null&&google.maps.event.removeListener(z),W(google.maps.event.addListener(M,St.onClusteringBegin,b)))},[b]),u.useEffect(function(){M&&_&&(R!==null&&google.maps.event.removeListener(R),W(google.maps.event.addListener(M,St.onClusteringEnd,_)))},[_]),u.useEffect(function(){typeof r<"u"&&M!==null&&Ce.averageCenter(M,r)},[M,r]),u.useEffect(function(){typeof i<"u"&&M!==null&&Ce.batchSizeIE(M,i)},[M,i]),u.useEffect(function(){typeof o<"u"&&M!==null&&Ce.calculator(M,o)},[M,o]),u.useEffect(function(){typeof s<"u"&&M!==null&&Ce.clusterClass(M,s)},[M,s]),u.useEffect(function(){typeof a<"u"&&M!==null&&Ce.enableRetinaIcons(M,a)},[M,a]),u.useEffect(function(){typeof l<"u"&&M!==null&&Ce.gridSize(M,l)},[M,l]),u.useEffect(function(){typeof c<"u"&&M!==null&&Ce.ignoreHidden(M,c)},[M,c]),u.useEffect(function(){typeof f<"u"&&M!==null&&Ce.imageExtension(M,f)},[M,f]),u.useEffect(function(){typeof d<"u"&&M!==null&&Ce.imagePath(M,d)},[M,d]),u.useEffect(function(){typeof p<"u"&&M!==null&&Ce.imageSizes(M,p)},[M,p]),u.useEffect(function(){typeof m<"u"&&M!==null&&Ce.maxZoom(M,m)},[M,m]),u.useEffect(function(){typeof g<"u"&&M!==null&&Ce.minimumClusterSize(M,g)},[M,g]),u.useEffect(function(){typeof h<"u"&&M!==null&&Ce.styles(M,h)},[M,h]),u.useEffect(function(){typeof S<"u"&&M!==null&&Ce.title(M,S)},[M,S]),u.useEffect(function(){typeof w<"u"&&M!==null&&Ce.zoomOnClick(M,w)},[M,w]),u.useEffect(function(){if(P){var ee=Q({},n||kw),q=new dd(P,[],ee);return r&&Ce.averageCenter(q,r),i&&Ce.batchSizeIE(q,i),o&&Ce.calculator(q,o),s&&Ce.clusterClass(q,s),a&&Ce.enableRetinaIcons(q,a),l&&Ce.gridSize(q,l),c&&Ce.ignoreHidden(q,c),f&&Ce.imageExtension(q,f),d&&Ce.imagePath(q,d),p&&Ce.imageSizes(q,p),m&&Ce.maxZoom(q,m),g&&Ce.minimumClusterSize(q,g),h&&Ce.styles(q,h),S&&Ce.title(q,S),w&&Ce.zoomOnClick(q,w),v&&V(google.maps.event.addListener(q,St.onMouseOut,v)),E&&K(google.maps.event.addListener(q,St.onMouseOver,E)),y&&$(google.maps.event.addListener(q,St.onClick,y)),b&&W(google.maps.event.addListener(q,St.onClusteringBegin,b)),_&&A(google.maps.event.addListener(q,St.onClusteringEnd,_)),O(q),L&&L(q),function(){N!==null&&google.maps.event.removeListener(N),I!==null&&google.maps.event.removeListener(I),U!==null&&google.maps.event.removeListener(U),z!==null&&google.maps.event.removeListener(z),R!==null&&google.maps.event.removeListener(R),C&&C(q)}}},[]),M!==null&&e(M)||null}u.memo(Rw);var Tw=function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={markerClusterer:null},n.setClustererCallback=function(){n.state.markerClusterer!==null&&n.props.onLoad&&n.props.onLoad(n.state.markerClusterer)},n}return e.prototype.componentDidMount=function(){if(this.context){var n=new dd(this.context,[],this.props.options);this.registeredEvents=fe({updaterMap:Ce,eventMap:St,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{markerClusterer:n}},this.setClustererCallback)}},e.prototype.componentDidUpdate=function(n){this.state.markerClusterer&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Ce,eventMap:St,prevProps:n,nextProps:this.props,instance:this.state.markerClusterer}))},e.prototype.componentWillUnmount=function(){this.state.markerClusterer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),ge(this.registeredEvents),this.state.markerClusterer.setMap(null))},e.prototype.render=function(){return this.state.markerClusterer!==null?this.props.children(this.state.markerClusterer):null},e.contextType=le,e}(u.PureComponent);function cc(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}var pd=function(){function t(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.bind(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(t,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 t.prototype.createInfoBoxDiv=function(){var e=this,n=function(c){c.returnValue=!1,c.preventDefault&&c.preventDefault(),e.enableEventPropagation||cc(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 r=this.getPanes();if(r!==null&&r[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 o=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],s=0,a=o;s<a.length;s++){var l=a[s];this.eventListeners.push(google.maps.event.addListener(this.div,l,cc))}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",n),google.maps.event.trigger(this,"domready")}},t.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},t.prototype.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&this.closeBoxURL!==""?google.maps.event.addListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},t.prototype.closeClickHandler=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(this,"closeclick"),this.close()},t.prototype.getCloseClickHandler=function(){return this.closeClickHandler},t.prototype.panBox=function(e){if(this.div&&!e){var n=this.getMap();if(n instanceof google.maps.Map){var r=0,i=0,o=n.getBounds();o&&!o.contains(this.position)&&n.setCenter(this.position);var s=n.getDiv(),a=s.offsetWidth,l=s.offsetHeight,c=this.pixelOffset.width,f=this.pixelOffset.height,d=this.div.offsetWidth,p=this.div.offsetHeight,m=this.infoBoxClearance.width,g=this.infoBoxClearance.height,h=this.getProjection(),S=h.fromLatLngToContainerPixel(this.position);S!==null&&(S.x<-c+m?r=S.x+c-m:S.x+d+c+m>a&&(r=S.x+d+c+m-a),this.alignBottom?S.y<-f+g+p?i=S.y+f-g-p:S.y+f+g>l&&(i=S.y+f+g-l):S.y<-f+g?i=S.y+f-g:S.y+p+f+g>l&&(i=S.y+p+f+g-l)),r===0&&i===0||n.panBy(r,i)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var r=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+r*100+')"',this.div.style.filter="alpha(opacity="+r*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")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,r=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.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},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.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()},t.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")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var r=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var i=n.getPosition();r.setPosition(i)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){r.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e<n.length;e++){var r=n[e];google.maps.event.removeListener(r)}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)},t.prototype.extend=function(e,n){return(function(i){for(var o in i.prototype)Object.prototype.hasOwnProperty.call(this,o)||(this.prototype[o]=i.prototype[o]);return this}).apply(e,[n])},t}(),uc={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},fc={options:function(t,e){t.setOptions(e)},position:function(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},Aw={};function Dw(t){var e=t.children,n=t.anchor,r=t.options,i=t.position,o=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,c=t.onPositionChanged,f=t.onZindexChanged,d=t.onLoad,p=t.onUnmount,m=u.useContext(le),g=u.useState(null),h=g[0],S=g[1],w=u.useState(null),y=w[0],b=w[1],_=u.useState(null),E=_[0],v=_[1],L=u.useState(null),C=L[0],k=L[1],M=u.useState(null),O=M[0],P=M[1],j=u.useState(null),U=j[0],$=j[1],G=u.useRef(null);return u.useEffect(function(){m&&h!==null&&(h.close(),n?h.open(m,n):h.getPosition()&&h.open(m))},[m,h,n]),u.useEffect(function(){r&&h!==null&&h.setOptions(r)},[h,r]),u.useEffect(function(){if(i&&h!==null){var z=i instanceof google.maps.LatLng?i:new google.maps.LatLng(i.lat,i.lng);h.setPosition(z)}},[i]),u.useEffect(function(){typeof o=="number"&&h!==null&&h.setZIndex(o)},[o]),u.useEffect(function(){h&&s&&(y!==null&&google.maps.event.removeListener(y),b(google.maps.event.addListener(h,"closeclick",s)))},[s]),u.useEffect(function(){h&&a&&(E!==null&&google.maps.event.removeListener(E),v(google.maps.event.addListener(h,"domready",a)))},[a]),u.useEffect(function(){h&&l&&(C!==null&&google.maps.event.removeListener(C),k(google.maps.event.addListener(h,"content_changed",l)))},[l]),u.useEffect(function(){h&&c&&(O!==null&&google.maps.event.removeListener(O),P(google.maps.event.addListener(h,"position_changed",c)))},[c]),u.useEffect(function(){h&&f&&(U!==null&&google.maps.event.removeListener(U),$(google.maps.event.addListener(h,"zindex_changed",f)))},[f]),u.useEffect(function(){if(m){var z=r||Aw,W=z.position,D=Ra(z,["position"]),R=void 0;W&&!(W instanceof google.maps.LatLng)&&(R=new google.maps.LatLng(W.lat,W.lng));var A=new pd(Q(Q({},D),R?{position:R}:{}));G.current=document.createElement("div"),S(A),s&&b(google.maps.event.addListener(A,"closeclick",s)),a&&v(google.maps.event.addListener(A,"domready",a)),l&&k(google.maps.event.addListener(A,"content_changed",l)),c&&P(google.maps.event.addListener(A,"position_changed",c)),f&&$(google.maps.event.addListener(A,"zindex_changed",f)),A.setContent(G.current),n?A.open(m,n):A.getPosition()?A.open(m):qe(!1,"You must provide either an anchor or a position prop for <InfoBox>."),d&&d(A)}return function(){h!==null&&(y&&google.maps.event.removeListener(y),C&&google.maps.event.removeListener(C),E&&google.maps.event.removeListener(E),O&&google.maps.event.removeListener(O),U&&google.maps.event.removeListener(U),p&&p(h),h.close())}},[]),G.current?dr.createPortal(u.Children.only(e),G.current):null}u.memo(Dw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoBox:null},n.open=function(r,i){i?n.context!==null&&r.open(n.context,i):r.getPosition()?n.context!==null&&r.open(n.context):qe(!1,"You must provide either an anchor or a position prop for <InfoBox>.")},n.setInfoBoxCallback=function(){n.state.infoBox!==null&&n.containerElement!==null&&(n.state.infoBox.setContent(n.containerElement),n.open(n.state.infoBox,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoBox))},n}return e.prototype.componentDidMount=function(){var n=this.props.options||{},r=n.position,i=Ra(n,["position"]),o;r&&!(r instanceof google.maps.LatLng)&&(o=new google.maps.LatLng(r.lat,r.lng));var s=new pd(Q(Q({},i),o?{position:o}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=fe({updaterMap:fc,eventMap:uc,prevProps:{},nextProps:this.props,instance:s}),this.setState({infoBox:s},this.setInfoBoxCallback)},e.prototype.componentDidUpdate=function(n){var r=this.state.infoBox;r!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:fc,eventMap:uc,prevProps:n,nextProps:this.props,instance:r}))},e.prototype.componentWillUnmount=function(){var n=this.props.onUnmount,r=this.state.infoBox;r!==null&&(n&&n(r),ge(this.registeredEvents),r.close())},e.prototype.render=function(){return this.containerElement?dr.createPortal(u.Children.only(this.props.children),this.containerElement):null},e.contextType=le,e})(u.PureComponent);var Iw=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},dc=ad(Iw);const pc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ds=1,Rr=8;class Aa{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const i=r>>4;if(i!==ds)throw new Error(`Got v${i} data when expected v${ds}.`);const o=pc[r&15];if(!o)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new Aa(a,s,o,e)}constructor(e,n=64,r=Float64Array,i){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=pc.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,Rr,e),this.coords=new this.ArrayType(this.data,Rr+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Rr+s+a+l),this.ids=new this.IndexArrayType(this.data,Rr,e),this.coords=new this.ArrayType(this.data,Rr+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ds<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=n,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return na(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,r,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,l=[0,o.length-1,0],c=[];for(;l.length;){const f=l.pop()||0,d=l.pop()||0,p=l.pop()||0;if(d-p<=a){for(let S=p;S<=d;S++){const w=s[2*S],y=s[2*S+1];w>=e&&w<=r&&y>=n&&y<=i&&c.push(o[S])}continue}const m=p+d>>1,g=s[2*m],h=s[2*m+1];g>=e&&g<=r&&h>=n&&h<=i&&c.push(o[m]),(f===0?e<=g:n<=h)&&(l.push(p),l.push(m-1),l.push(1-f)),(f===0?r>=g:i>=h)&&(l.push(m+1),l.push(d),l.push(1-f))}return c}within(e,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:s}=this,a=[0,i.length-1,0],l=[],c=r*r;for(;a.length;){const f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let S=p;S<=d;S++)hc(o[2*S],o[2*S+1],e,n)<=c&&l.push(i[S]);continue}const m=p+d>>1,g=o[2*m],h=o[2*m+1];hc(g,h,e,n)<=c&&l.push(i[m]),(f===0?e-r<=g:n-r<=h)&&(a.push(p),a.push(m-1),a.push(1-f)),(f===0?e+r>=g:n+r>=h)&&(a.push(m+1),a.push(d),a.push(1-f))}return l}}function na(t,e,n,r,i,o){if(i-r<=n)return;const s=r+i>>1;hd(t,e,s,r,i,o),na(t,e,n,r,s-1,1-o),na(t,e,n,s+1,i,1-o)}function hd(t,e,n,r,i,o){for(;i>r;){if(i-r>600){const c=i-r+1,f=n-r+1,d=Math.log(c),p=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*p*(c-p)/c)*(f-c/2<0?-1:1),g=Math.max(r,Math.floor(n-f*p/c+m)),h=Math.min(i,Math.floor(n+(c-f)*p/c+m));hd(t,e,n,g,h,o)}const s=e[2*n+o];let a=r,l=i;for(Tr(t,e,r,n),e[2*i+o]>s&&Tr(t,e,r,i);a<l;){for(Tr(t,e,a,l),a++,l--;e[2*a+o]<s;)a++;for(;e[2*l+o]>s;)l--}e[2*r+o]===s?Tr(t,e,r,l):(l++,Tr(t,e,l,i)),l<=n&&(r=l+1),n<=l&&(i=l-1)}}function Tr(t,e,n,r){ps(t,n,r),ps(e,2*n,2*r),ps(e,2*n+1,2*r+1)}function ps(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function hc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}const jw={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},gc=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),On=2,fn=3,hs=4,un=5,gd=6;class Nw{constructor(e){this.options=Object.assign(Object.create(jw),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:r,maxZoom:i}=this.options;n&&console.time("total time");const o=`prepare ${e.length} points`;n&&console.time(o),this.points=e;const s=[];for(let l=0;l<e.length;l++){const c=e[l];if(!c.geometry)continue;const[f,d]=c.geometry.coordinates,p=gc(Bi(f)),m=gc(Ui(d));s.push(p,m,1/0,l,-1,1),this.options.reduce&&s.push(0)}let a=this.trees[i+1]=this._createTree(s);n&&console.timeEnd(o);for(let l=i;l>=r;l--){const c=+Date.now();a=this.trees[l]=this._createTree(this._cluster(a,l)),n&&console.log("z%d: %d clusters in %dms",l,a.numItems,+Date.now()-c)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let r=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const d=this.getClusters([r,i,180,s],n),p=this.getClusters([-180,i,o,s],n);return d.concat(p)}const a=this.trees[this._limitZoom(n)],l=a.range(Bi(r),Ui(s),Bi(o),Ui(i)),c=a.data,f=[];for(const d of l){const p=this.stride*d;f.push(c[p+un]>1?vc(c,p,this.clusterProps):this.points[c[p+fn]])}return f}getChildren(e){const n=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(i);const s=o.data;if(n*this.stride>=s.length)throw new Error(i);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=s[n*this.stride],c=s[n*this.stride+1],f=o.within(l,c,a),d=[];for(const p of f){const m=p*this.stride;s[m+hs]===e&&d.push(s[m+un]>1?vc(s,m,this.clusterProps):this.points[s[m+fn]])}if(d.length===0)throw new Error(i);return d}getLeaves(e,n,r){n=n||10,r=r||0;const i=[];return this._appendLeaves(i,e,n,r,0),i}getTile(e,n,r){const i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:s,radius:a}=this.options,l=a/s,c=(r-l)/o,f=(r+1+l)/o,d={features:[]};return this._addTileFeatures(i.range((n-l)/o,c,(n+1+l)/o,f),i.data,n,r,o,d),n===0&&this._addTileFeatures(i.range(1-l/o,c,1,f),i.data,o,r,o,d),n===o-1&&this._addTileFeatures(i.range(0,c,l/o,f),i.data,-1,r,o,d),d.features.length?d:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const r=this.getChildren(e);if(n++,r.length!==1)break;e=r[0].properties.cluster_id}return n}_appendLeaves(e,n,r,i,o){const s=this.getChildren(n);for(const a of s){const l=a.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(e,l.cluster_id,r,i,o):o<i?o++:e.push(a),e.length===r)break}return o}_createTree(e){const n=new Aa(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)n.add(e[r],e[r+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,n,r,i,o,s){for(const a of e){const l=a*this.stride,c=n[l+un]>1;let f,d,p;if(c)f=vd(n,l,this.clusterProps),d=n[l],p=n[l+1];else{const h=this.points[n[l+fn]];f=h.properties;const[S,w]=h.geometry.coordinates;d=Bi(S),p=Ui(w)}const m={type:1,geometry:[[Math.round(this.options.extent*(d*o-r)),Math.round(this.options.extent*(p*o-i))]],tags:f};let g;c||this.options.generateId?g=n[l+fn]:g=this.points[n[l+fn]].id,g!==void 0&&(m.id=g),s.features.push(m)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:r,extent:i,reduce:o,minPoints:s}=this.options,a=r/(i*Math.pow(2,n)),l=e.data,c=[],f=this.stride;for(let d=0;d<l.length;d+=f){if(l[d+On]<=n)continue;l[d+On]=n;const p=l[d],m=l[d+1],g=e.within(l[d],l[d+1],a),h=l[d+un];let S=h;for(const w of g){const y=w*f;l[y+On]>n&&(S+=l[y+un])}if(S>h&&S>=s){let w=p*h,y=m*h,b,_=-1;const E=((d/f|0)<<5)+(n+1)+this.points.length;for(const v of g){const L=v*f;if(l[L+On]<=n)continue;l[L+On]=n;const C=l[L+un];w+=l[L]*C,y+=l[L+1]*C,l[L+hs]=E,o&&(b||(b=this._map(l,d,!0),_=this.clusterProps.length,this.clusterProps.push(b)),o(b,this._map(l,L)))}l[d+hs]=E,c.push(w/S,y/S,1/0,E,-1,S),o&&c.push(_)}else{for(let w=0;w<f;w++)c.push(l[d+w]);if(S>1)for(const w of g){const y=w*f;if(!(l[y+On]<=n)){l[y+On]=n;for(let b=0;b<f;b++)c.push(l[y+b])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,r){if(e[n+un]>1){const s=this.clusterProps[e[n+gd]];return r?Object.assign({},s):s}const i=this.points[e[n+fn]].properties,o=this.options.map(i);return r&&o===i?Object.assign({},o):o}}function vc(t,e,n){return{type:"Feature",id:t[e+fn],properties:vd(t,e,n),geometry:{type:"Point",coordinates:[Bw(t[e]),Uw(t[e+1])]}}}function vd(t,e,n){const r=t[e+un],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=t[e+gd],s=o===-1?{}:Object.assign({},n[o]);return Object.assign(s,{cluster:!0,cluster_id:t[e+fn],point_count:r,point_count_abbreviated:i})}function Bi(t){return t/360+.5}function Ui(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Bw(t){return(t-.5)*360}function Uw(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! *****************************************************************************
|
|
85
85
|
Copyright (c) Microsoft Corporation.
|
|
86
86
|
|
|
87
87
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -94,9 +94,9 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
94
94
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
95
95
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
96
96
|
PERFORMANCE OF THIS SOFTWARE.
|
|
97
|
-
***************************************************************************** */function
|
|
97
|
+
***************************************************************************** */function Vw(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}class wt{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,n){this.isAdvancedMarker(e)?e.map=n:e.setMap(n)}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 ra{constructor({markers:e,position:n}){this.markers=e,n&&(n instanceof google.maps.LatLng?this._position=n:this._position=new google.maps.LatLng(n))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const n of this.markers)e.extend(wt.getPosition(n));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>wt.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(wt.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class Fw{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return zw(e)}}const zw=t=>t.map(n=>new ra({position:wt.getPosition(n),markers:[n]}));class $w extends Fw{constructor(e){var{maxZoom:n,radius:r=60}=e,i=Vw(e,["maxZoom","radius"]);super({maxZoom:n}),this.state={zoom:-1},this.superCluster=new Nw(Object.assign({maxZoom:this.maxZoom,radius:r},i))}calculate(e){let n=!1;const r={zoom:e.map.getZoom()};if(!dc(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const i=this.markers.map(o=>{const s=wt.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:o}}});this.superCluster.load(i)}return n||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(n=!dc(this.state,r)),this.state=r,n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,n]},properties:r}){if(r.cluster)return new ra({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:n,lng:e}});const i=r.marker;return new ra({markers:[i],position:wt.getPosition(i)})}}class Hw{constructor(e,n){this.markers={sum:e.length};const r=n.map(o=>o.count),i=r.reduce((o,s)=>o+s,0);this.clusters={count:n.length,markers:{mean:i/n.length,sum:i,min:Math.min(...r),max:Math.max(...r)}}}}class Gw{render({count:e,position:n},r,i){const s=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
98
98
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
99
99
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
100
100
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
101
101
|
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
|
|
102
|
-
</svg>`,a=`Cluster of ${e} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+e;if(wt.isAdvancedMarkerAvailable(i)){const f=document.createElement("div");f.innerHTML=s;const d=f.firstElementChild;d.setAttribute("transform","translate(0 25)");const p={map:i,position:n,zIndex:l,title:a,content:d};return new google.maps.marker.AdvancedMarkerElement(p)}const c={position:n,zIndex:l,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(c)}}function Uw(t,e){for(let n in e.prototype)t.prototype[n]=e.prototype[n]}class Ta{constructor(){Uw(Ta,google.maps.OverlayView)}}var Yr;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(Yr||(Yr={}));const Vw=(t,e,n)=>{n.fitBounds(e.bounds)};class Fw extends Ta{constructor({map:e,markers:n=[],algorithmOptions:r={},algorithm:i=new jw(r),renderer:o=new Bw,onClusterClick:s=Vw}){super(),this.markers=[...n],this.clusters=[],this.algorithm=i,this.renderer=o,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(r=>{this.addMarker(r,!0)}),n||this.render()}removeMarker(e,n){const r=this.markers.indexOf(e);return r===-1?!1:(wt.setMap(e,null),this.markers.splice(r,1),n||this.render(),!0)}removeMarkers(e,n){let r=!1;return e.forEach(i=>{r=this.removeMarker(i,!0)||r}),r&&!n&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,Yr.CLUSTERING_BEGIN,this);const{clusters:n,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const i=new Set;for(const s of n)s.markers.length==1&&i.add(s.markers[0]);const o=[];for(const s of this.clusters)s.marker!=null&&(s.markers.length==1?i.has(s.marker)||wt.setMap(s.marker,null):o.push(s.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>o.forEach(s=>wt.setMap(s,null)))}google.maps.event.trigger(this,Yr.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=>wt.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new Nw(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,n),r.markers.forEach(i=>wt.setMap(i,null)),this.onClusterClick&&r.marker.addListener("click",i=>{google.maps.event.trigger(this,Yr.CLUSTER_CLICK,r),this.onClusterClick(i,r,n)})),wt.setMap(r.marker,n)})}}function zw(t){var e=qb(),n=u.useState(null),r=n[0],i=n[1];return u.useEffect(function(){if(e&&r===null){var o=new Fw(Q(Q({},t),{map:e}));i(o)}},[e]),r}function $w(t){var e=t.children,n=t.options,r=zw(n);return r!==null?e(r):null}u.memo($w);var hc={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},gc={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}};function Hw(t){var e=t.children,n=t.anchor,r=t.options,i=t.position,o=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,c=t.onPositionChanged,f=t.onZindexChanged,d=t.onLoad,p=t.onUnmount,v=u.useContext(le),g=u.useState(null),h=g[0],w=g[1],S=u.useState(null),y=S[0],b=S[1],O=u.useState(null),L=O[0],m=O[1],x=u.useState(null),C=x[0],R=x[1],M=u.useState(null),_=M[0],P=M[1],j=u.useState(null),V=j[0],$=j[1],G=u.useRef(null);return u.useEffect(function(){h!==null&&(h.close(),n?h.open(v,n):h.getPosition()&&h.open(v))},[v,h,n]),u.useEffect(function(){r&&h!==null&&h.setOptions(r)},[h,r]),u.useEffect(function(){i&&h!==null&&h.setPosition(i)},[i]),u.useEffect(function(){typeof o=="number"&&h!==null&&h.setZIndex(o)},[o]),u.useEffect(function(){h&&s&&(y!==null&&google.maps.event.removeListener(y),b(google.maps.event.addListener(h,"closeclick",s)))},[s]),u.useEffect(function(){h&&a&&(L!==null&&google.maps.event.removeListener(L),m(google.maps.event.addListener(h,"domready",a)))},[a]),u.useEffect(function(){h&&l&&(C!==null&&google.maps.event.removeListener(C),R(google.maps.event.addListener(h,"content_changed",l)))},[l]),u.useEffect(function(){h&&c&&(_!==null&&google.maps.event.removeListener(_),P(google.maps.event.addListener(h,"position_changed",c)))},[c]),u.useEffect(function(){h&&f&&(V!==null&&google.maps.event.removeListener(V),$(google.maps.event.addListener(h,"zindex_changed",f)))},[f]),u.useEffect(function(){var z=new google.maps.InfoWindow(Q({},r||{}));return w(z),G.current=document.createElement("div"),s&&b(google.maps.event.addListener(z,"closeclick",s)),a&&m(google.maps.event.addListener(z,"domready",a)),l&&R(google.maps.event.addListener(z,"content_changed",l)),c&&P(google.maps.event.addListener(z,"position_changed",c)),f&&$(google.maps.event.addListener(z,"zindex_changed",f)),z.setContent(G.current),i&&z.setPosition(i),o&&z.setZIndex(o),n?z.open(v,n):z.getPosition()?z.open(v):qe(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>."),d&&d(z),function(){y&&google.maps.event.removeListener(y),C&&google.maps.event.removeListener(C),L&&google.maps.event.removeListener(L),_&&google.maps.event.removeListener(_),V&&google.maps.event.removeListener(V),p&&p(z),z.close()}},[]),G.current?dr.createPortal(u.Children.only(e),G.current):null}u.memo(Hw);var hd=function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoWindow:null},n.open=function(r,i){i?r.open(n.context,i):r.getPosition()?r.open(n.context):qe(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>.")},n.setInfoWindowCallback=function(){n.state.infoWindow!==null&&n.containerElement!==null&&(n.state.infoWindow.setContent(n.containerElement),n.open(n.state.infoWindow,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoWindow))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.InfoWindow(Q({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=fe({updaterMap:gc,eventMap:hc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{infoWindow:n}},this.setInfoWindowCallback)},e.prototype.componentDidUpdate=function(n){this.state.infoWindow!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:gc,eventMap:hc,prevProps:n,nextProps:this.props,instance:this.state.infoWindow}))},e.prototype.componentWillUnmount=function(){this.state.infoWindow!==null&&(ge(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())},e.prototype.render=function(){return this.containerElement?dr.createPortal(u.Children.only(this.props.children),this.containerElement):null},e.contextType=le,e}(u.PureComponent),vc={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},mc={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},Gw={};function Ww(t){var e=t.options,n=t.draggable,r=t.editable,i=t.visible,o=t.path,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,f=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,v=t.onMouseUp,g=t.onRightClick,h=t.onClick,w=t.onDrag,S=t.onLoad,y=t.onUnmount,b=u.useContext(le),O=u.useState(null),L=O[0],m=O[1],x=u.useState(null),C=x[0],R=x[1],M=u.useState(null),_=M[0],P=M[1],j=u.useState(null),V=j[0],$=j[1],G=u.useState(null),z=G[0],W=G[1],D=u.useState(null),k=D[0],A=D[1],T=u.useState(null),N=T[0],U=T[1],Z=u.useState(null),I=Z[0],K=Z[1],ee=u.useState(null),q=ee[0],se=ee[1],de=u.useState(null),ue=de[0],Le=de[1],Fe=u.useState(null),we=Fe[0],Ee=Fe[1],Ie=u.useState(null),Me=Ie[0],Re=Ie[1];return u.useEffect(function(){L!==null&&L.setMap(b)},[b]),u.useEffect(function(){typeof e<"u"&&L!==null&&L.setOptions(e)},[L,e]),u.useEffect(function(){typeof n<"u"&&L!==null&&L.setDraggable(n)},[L,n]),u.useEffect(function(){typeof r<"u"&&L!==null&&L.setEditable(r)},[L,r]),u.useEffect(function(){typeof i<"u"&&L!==null&&L.setVisible(i)},[L,i]),u.useEffect(function(){typeof o<"u"&&L!==null&&L.setPath(o)},[L,o]),u.useEffect(function(){L&&s&&(C!==null&&google.maps.event.removeListener(C),R(google.maps.event.addListener(L,"dblclick",s)))},[s]),u.useEffect(function(){L&&a&&(_!==null&&google.maps.event.removeListener(_),P(google.maps.event.addListener(L,"dragend",a)))},[a]),u.useEffect(function(){L&&l&&(V!==null&&google.maps.event.removeListener(V),$(google.maps.event.addListener(L,"dragstart",l)))},[l]),u.useEffect(function(){L&&c&&(z!==null&&google.maps.event.removeListener(z),W(google.maps.event.addListener(L,"mousedown",c)))},[c]),u.useEffect(function(){L&&f&&(k!==null&&google.maps.event.removeListener(k),A(google.maps.event.addListener(L,"mousemove",f)))},[f]),u.useEffect(function(){L&&d&&(N!==null&&google.maps.event.removeListener(N),U(google.maps.event.addListener(L,"mouseout",d)))},[d]),u.useEffect(function(){L&&p&&(I!==null&&google.maps.event.removeListener(I),K(google.maps.event.addListener(L,"mouseover",p)))},[p]),u.useEffect(function(){L&&v&&(q!==null&&google.maps.event.removeListener(q),se(google.maps.event.addListener(L,"mouseup",v)))},[v]),u.useEffect(function(){L&&g&&(ue!==null&&google.maps.event.removeListener(ue),Le(google.maps.event.addListener(L,"rightclick",g)))},[g]),u.useEffect(function(){L&&h&&(we!==null&&google.maps.event.removeListener(we),Ee(google.maps.event.addListener(L,"click",h)))},[h]),u.useEffect(function(){L&&w&&(Me!==null&&google.maps.event.removeListener(Me),Re(google.maps.event.addListener(L,"drag",w)))},[w]),u.useEffect(function(){var re=new google.maps.Polyline(Q(Q({},e||Gw),{map:b}));return o&&re.setPath(o),typeof i<"u"&&re.setVisible(i),typeof r<"u"&&re.setEditable(r),typeof n<"u"&&re.setDraggable(n),s&&R(google.maps.event.addListener(re,"dblclick",s)),a&&P(google.maps.event.addListener(re,"dragend",a)),l&&$(google.maps.event.addListener(re,"dragstart",l)),c&&W(google.maps.event.addListener(re,"mousedown",c)),f&&A(google.maps.event.addListener(re,"mousemove",f)),d&&U(google.maps.event.addListener(re,"mouseout",d)),p&&K(google.maps.event.addListener(re,"mouseover",p)),v&&se(google.maps.event.addListener(re,"mouseup",v)),g&&Le(google.maps.event.addListener(re,"rightclick",g)),h&&Ee(google.maps.event.addListener(re,"click",h)),w&&Re(google.maps.event.addListener(re,"drag",w)),m(re),S&&S(re),function(){C!==null&&google.maps.event.removeListener(C),_!==null&&google.maps.event.removeListener(_),V!==null&&google.maps.event.removeListener(V),z!==null&&google.maps.event.removeListener(z),k!==null&&google.maps.event.removeListener(k),N!==null&&google.maps.event.removeListener(N),I!==null&&google.maps.event.removeListener(I),q!==null&&google.maps.event.removeListener(q),ue!==null&&google.maps.event.removeListener(ue),we!==null&&google.maps.event.removeListener(we),y&&y(re),re.setMap(null)}},[]),null}u.memo(Ww);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polyline:null},n.setPolylineCallback=function(){n.state.polyline!==null&&n.props.onLoad&&n.props.onLoad(n.state.polyline)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polyline(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:mc,eventMap:vc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polyline:n}},this.setPolylineCallback)},e.prototype.componentDidUpdate=function(n){this.state.polyline!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:mc,eventMap:vc,prevProps:n,nextProps:this.props,instance:this.state.polyline}))},e.prototype.componentWillUnmount=function(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),ge(this.registeredEvents),this.state.polyline.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var yc={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},bc={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}};function Zw(t){var e=t.options,n=t.draggable,r=t.editable,i=t.visible,o=t.path,s=t.paths,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,f=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,v=t.onMouseOver,g=t.onMouseUp,h=t.onRightClick,w=t.onClick,S=t.onDrag,y=t.onLoad,b=t.onUnmount,O=u.useContext(le),L=u.useState(null),m=L[0],x=L[1],C=u.useState(null),R=C[0],M=C[1],_=u.useState(null),P=_[0],j=_[1],V=u.useState(null),$=V[0],G=V[1],z=u.useState(null),W=z[0],D=z[1],k=u.useState(null),A=k[0],T=k[1],N=u.useState(null),U=N[0],Z=N[1],I=u.useState(null),K=I[0],ee=I[1],q=u.useState(null),se=q[0],de=q[1],ue=u.useState(null),Le=ue[0],Fe=ue[1],we=u.useState(null),Ee=we[0],Ie=we[1],Me=u.useState(null),Re=Me[0],re=Me[1];return u.useEffect(function(){m!==null&&m.setMap(O)},[O]),u.useEffect(function(){typeof e<"u"&&m!==null&&m.setOptions(e)},[m,e]),u.useEffect(function(){typeof n<"u"&&m!==null&&m.setDraggable(n)},[m,n]),u.useEffect(function(){typeof r<"u"&&m!==null&&m.setEditable(r)},[m,r]),u.useEffect(function(){typeof i<"u"&&m!==null&&m.setVisible(i)},[m,i]),u.useEffect(function(){typeof o<"u"&&m!==null&&m.setPath(o)},[m,o]),u.useEffect(function(){typeof s<"u"&&m!==null&&m.setPaths(s)},[m,s]),u.useEffect(function(){m&&a&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(m,"dblclick",a)))},[a]),u.useEffect(function(){m&&l&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(m,"dragend",l)))},[l]),u.useEffect(function(){m&&c&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(m,"dragstart",c)))},[c]),u.useEffect(function(){m&&f&&(W!==null&&google.maps.event.removeListener(W),D(google.maps.event.addListener(m,"mousedown",f)))},[f]),u.useEffect(function(){m&&d&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(m,"mousemove",d)))},[d]),u.useEffect(function(){m&&p&&(U!==null&&google.maps.event.removeListener(U),Z(google.maps.event.addListener(m,"mouseout",p)))},[p]),u.useEffect(function(){m&&v&&(K!==null&&google.maps.event.removeListener(K),ee(google.maps.event.addListener(m,"mouseover",v)))},[v]),u.useEffect(function(){m&&g&&(se!==null&&google.maps.event.removeListener(se),de(google.maps.event.addListener(m,"mouseup",g)))},[g]),u.useEffect(function(){m&&h&&(Le!==null&&google.maps.event.removeListener(Le),Fe(google.maps.event.addListener(m,"rightclick",h)))},[h]),u.useEffect(function(){m&&w&&(Ee!==null&&google.maps.event.removeListener(Ee),Ie(google.maps.event.addListener(m,"click",w)))},[w]),u.useEffect(function(){m&&S&&(Re!==null&&google.maps.event.removeListener(Re),re(google.maps.event.addListener(m,"drag",S)))},[S]),u.useEffect(function(){var ie=new google.maps.Polygon(Q(Q({},e||{}),{map:O}));return o&&ie.setPath(o),s&&ie.setPaths(s),typeof i<"u"&&ie.setVisible(i),typeof r<"u"&&ie.setEditable(r),typeof n<"u"&&ie.setDraggable(n),a&&M(google.maps.event.addListener(ie,"dblclick",a)),l&&j(google.maps.event.addListener(ie,"dragend",l)),c&&G(google.maps.event.addListener(ie,"dragstart",c)),f&&D(google.maps.event.addListener(ie,"mousedown",f)),d&&T(google.maps.event.addListener(ie,"mousemove",d)),p&&Z(google.maps.event.addListener(ie,"mouseout",p)),v&&ee(google.maps.event.addListener(ie,"mouseover",v)),g&&de(google.maps.event.addListener(ie,"mouseup",g)),h&&Fe(google.maps.event.addListener(ie,"rightclick",h)),w&&Ie(google.maps.event.addListener(ie,"click",w)),S&&re(google.maps.event.addListener(ie,"drag",S)),x(ie),y&&y(ie),function(){R!==null&&google.maps.event.removeListener(R),P!==null&&google.maps.event.removeListener(P),$!==null&&google.maps.event.removeListener($),W!==null&&google.maps.event.removeListener(W),A!==null&&google.maps.event.removeListener(A),U!==null&&google.maps.event.removeListener(U),K!==null&&google.maps.event.removeListener(K),se!==null&&google.maps.event.removeListener(se),Le!==null&&google.maps.event.removeListener(Le),Ee!==null&&google.maps.event.removeListener(Ee),b&&b(ie),ie.setMap(null)}},[]),null}u.memo(Zw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polygon:null},n.setPolygonCallback=function(){n.state.polygon!==null&&n.props.onLoad&&n.props.onLoad(n.state.polygon)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polygon(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:bc,eventMap:yc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polygon:n}},this.setPolygonCallback)},e.prototype.componentDidUpdate=function(n){this.state.polygon!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:bc,eventMap:yc,prevProps:n,nextProps:this.props,instance:this.state.polygon}))},e.prototype.componentWillUnmount=function(){this.state.polygon!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),ge(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var wc={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"},Sc={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}};function qw(t){var e=t.options,n=t.bounds,r=t.draggable,i=t.editable,o=t.visible,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,f=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,v=t.onMouseUp,g=t.onRightClick,h=t.onClick,w=t.onDrag,S=t.onBoundsChanged,y=t.onLoad,b=t.onUnmount,O=u.useContext(le),L=u.useState(null),m=L[0],x=L[1],C=u.useState(null),R=C[0],M=C[1],_=u.useState(null),P=_[0],j=_[1],V=u.useState(null),$=V[0],G=V[1],z=u.useState(null),W=z[0],D=z[1],k=u.useState(null),A=k[0],T=k[1],N=u.useState(null),U=N[0],Z=N[1],I=u.useState(null),K=I[0],ee=I[1],q=u.useState(null),se=q[0],de=q[1],ue=u.useState(null),Le=ue[0],Fe=ue[1],we=u.useState(null),Ee=we[0],Ie=we[1],Me=u.useState(null),Re=Me[0],re=Me[1],ie=u.useState(null),ze=ie[0],Ye=ie[1];return u.useEffect(function(){m!==null&&m.setMap(O)},[O]),u.useEffect(function(){typeof e<"u"&&m!==null&&m.setOptions(e)},[m,e]),u.useEffect(function(){typeof r<"u"&&m!==null&&m.setDraggable(r)},[m,r]),u.useEffect(function(){typeof i<"u"&&m!==null&&m.setEditable(i)},[m,i]),u.useEffect(function(){typeof o<"u"&&m!==null&&m.setVisible(o)},[m,o]),u.useEffect(function(){typeof n<"u"&&m!==null&&m.setBounds(n)},[m,n]),u.useEffect(function(){m&&s&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(m,"dblclick",s)))},[s]),u.useEffect(function(){m&&a&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(m,"dragend",a)))},[a]),u.useEffect(function(){m&&l&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(m,"dragstart",l)))},[l]),u.useEffect(function(){m&&c&&(W!==null&&google.maps.event.removeListener(W),D(google.maps.event.addListener(m,"mousedown",c)))},[c]),u.useEffect(function(){m&&f&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(m,"mousemove",f)))},[f]),u.useEffect(function(){m&&d&&(U!==null&&google.maps.event.removeListener(U),Z(google.maps.event.addListener(m,"mouseout",d)))},[d]),u.useEffect(function(){m&&p&&(K!==null&&google.maps.event.removeListener(K),ee(google.maps.event.addListener(m,"mouseover",p)))},[p]),u.useEffect(function(){m&&v&&(se!==null&&google.maps.event.removeListener(se),de(google.maps.event.addListener(m,"mouseup",v)))},[v]),u.useEffect(function(){m&&g&&(Le!==null&&google.maps.event.removeListener(Le),Fe(google.maps.event.addListener(m,"rightclick",g)))},[g]),u.useEffect(function(){m&&h&&(Ee!==null&&google.maps.event.removeListener(Ee),Ie(google.maps.event.addListener(m,"click",h)))},[h]),u.useEffect(function(){m&&w&&(Re!==null&&google.maps.event.removeListener(Re),re(google.maps.event.addListener(m,"drag",w)))},[w]),u.useEffect(function(){m&&S&&(ze!==null&&google.maps.event.removeListener(ze),Ye(google.maps.event.addListener(m,"bounds_changed",S)))},[S]),u.useEffect(function(){var Y=new google.maps.Rectangle(Q(Q({},e||{}),{map:O}));return typeof o<"u"&&Y.setVisible(o),typeof i<"u"&&Y.setEditable(i),typeof r<"u"&&Y.setDraggable(r),typeof n<"u"&&Y.setBounds(n),s&&M(google.maps.event.addListener(Y,"dblclick",s)),a&&j(google.maps.event.addListener(Y,"dragend",a)),l&&G(google.maps.event.addListener(Y,"dragstart",l)),c&&D(google.maps.event.addListener(Y,"mousedown",c)),f&&T(google.maps.event.addListener(Y,"mousemove",f)),d&&Z(google.maps.event.addListener(Y,"mouseout",d)),p&&ee(google.maps.event.addListener(Y,"mouseover",p)),v&&de(google.maps.event.addListener(Y,"mouseup",v)),g&&Fe(google.maps.event.addListener(Y,"rightclick",g)),h&&Ie(google.maps.event.addListener(Y,"click",h)),w&&re(google.maps.event.addListener(Y,"drag",w)),S&&Ye(google.maps.event.addListener(Y,"bounds_changed",S)),x(Y),y&&y(Y),function(){R!==null&&google.maps.event.removeListener(R),P!==null&&google.maps.event.removeListener(P),$!==null&&google.maps.event.removeListener($),W!==null&&google.maps.event.removeListener(W),A!==null&&google.maps.event.removeListener(A),U!==null&&google.maps.event.removeListener(U),K!==null&&google.maps.event.removeListener(K),se!==null&&google.maps.event.removeListener(se),Le!==null&&google.maps.event.removeListener(Le),Ee!==null&&google.maps.event.removeListener(Ee),Re!==null&&google.maps.event.removeListener(Re),ze!==null&&google.maps.event.removeListener(ze),b&&b(Y),Y.setMap(null)}},[]),null}u.memo(qw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={rectangle:null},n.setRectangleCallback=function(){n.state.rectangle!==null&&n.props.onLoad&&n.props.onLoad(n.state.rectangle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Rectangle(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:Sc,eventMap:wc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{rectangle:n}},this.setRectangleCallback)},e.prototype.componentDidUpdate=function(n){this.state.rectangle!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Sc,eventMap:wc,prevProps:n,nextProps:this.props,instance:this.state.rectangle}))},e.prototype.componentWillUnmount=function(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),ge(this.registeredEvents),this.state.rectangle.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Lc={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"},Ec={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},Kw={};function Jw(t){var e=t.options,n=t.center,r=t.radius,i=t.draggable,o=t.editable,s=t.visible,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,f=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,v=t.onMouseOver,g=t.onMouseUp,h=t.onRightClick,w=t.onClick,S=t.onDrag,y=t.onCenterChanged,b=t.onRadiusChanged,O=t.onLoad,L=t.onUnmount,m=u.useContext(le),x=u.useState(null),C=x[0],R=x[1],M=u.useState(null),_=M[0],P=M[1],j=u.useState(null),V=j[0],$=j[1],G=u.useState(null),z=G[0],W=G[1],D=u.useState(null),k=D[0],A=D[1],T=u.useState(null),N=T[0],U=T[1],Z=u.useState(null),I=Z[0],K=Z[1],ee=u.useState(null),q=ee[0],se=ee[1],de=u.useState(null),ue=de[0],Le=de[1],Fe=u.useState(null),we=Fe[0],Ee=Fe[1],Ie=u.useState(null),Me=Ie[0],Re=Ie[1],re=u.useState(null),ie=re[0],ze=re[1],Ye=u.useState(null),Y=Ye[0],$e=Ye[1],Ne=u.useState(null),pt=Ne[0],at=Ne[1];return u.useEffect(function(){C!==null&&C.setMap(m)},[m]),u.useEffect(function(){typeof e<"u"&&C!==null&&C.setOptions(e)},[C,e]),u.useEffect(function(){typeof i<"u"&&C!==null&&C.setDraggable(i)},[C,i]),u.useEffect(function(){typeof o<"u"&&C!==null&&C.setEditable(o)},[C,o]),u.useEffect(function(){typeof s<"u"&&C!==null&&C.setVisible(s)},[C,s]),u.useEffect(function(){typeof r=="number"&&C!==null&&C.setRadius(r)},[C,r]),u.useEffect(function(){typeof n<"u"&&C!==null&&C.setCenter(n)},[C,n]),u.useEffect(function(){C&&a&&(_!==null&&google.maps.event.removeListener(_),P(google.maps.event.addListener(C,"dblclick",a)))},[a]),u.useEffect(function(){C&&l&&(V!==null&&google.maps.event.removeListener(V),$(google.maps.event.addListener(C,"dragend",l)))},[l]),u.useEffect(function(){C&&c&&(z!==null&&google.maps.event.removeListener(z),W(google.maps.event.addListener(C,"dragstart",c)))},[c]),u.useEffect(function(){C&&f&&(k!==null&&google.maps.event.removeListener(k),A(google.maps.event.addListener(C,"mousedown",f)))},[f]),u.useEffect(function(){C&&d&&(N!==null&&google.maps.event.removeListener(N),U(google.maps.event.addListener(C,"mousemove",d)))},[d]),u.useEffect(function(){C&&p&&(I!==null&&google.maps.event.removeListener(I),K(google.maps.event.addListener(C,"mouseout",p)))},[p]),u.useEffect(function(){C&&v&&(q!==null&&google.maps.event.removeListener(q),se(google.maps.event.addListener(C,"mouseover",v)))},[v]),u.useEffect(function(){C&&g&&(ue!==null&&google.maps.event.removeListener(ue),Le(google.maps.event.addListener(C,"mouseup",g)))},[g]),u.useEffect(function(){C&&h&&(we!==null&&google.maps.event.removeListener(we),Ee(google.maps.event.addListener(C,"rightclick",h)))},[h]),u.useEffect(function(){C&&w&&(Me!==null&&google.maps.event.removeListener(Me),Re(google.maps.event.addListener(C,"click",w)))},[w]),u.useEffect(function(){C&&S&&(ie!==null&&google.maps.event.removeListener(ie),ze(google.maps.event.addListener(C,"drag",S)))},[S]),u.useEffect(function(){C&&y&&(Y!==null&&google.maps.event.removeListener(Y),$e(google.maps.event.addListener(C,"center_changed",y)))},[w]),u.useEffect(function(){C&&b&&(pt!==null&&google.maps.event.removeListener(pt),at(google.maps.event.addListener(C,"radius_changed",b)))},[b]),u.useEffect(function(){var oe=new google.maps.Circle(Q(Q({},e||Kw),{map:m}));return typeof r=="number"&&oe.setRadius(r),typeof n<"u"&&oe.setCenter(n),typeof r=="number"&&oe.setRadius(r),typeof s<"u"&&oe.setVisible(s),typeof o<"u"&&oe.setEditable(o),typeof i<"u"&&oe.setDraggable(i),a&&P(google.maps.event.addListener(oe,"dblclick",a)),l&&$(google.maps.event.addListener(oe,"dragend",l)),c&&W(google.maps.event.addListener(oe,"dragstart",c)),f&&A(google.maps.event.addListener(oe,"mousedown",f)),d&&U(google.maps.event.addListener(oe,"mousemove",d)),p&&K(google.maps.event.addListener(oe,"mouseout",p)),v&&se(google.maps.event.addListener(oe,"mouseover",v)),g&&Le(google.maps.event.addListener(oe,"mouseup",g)),h&&Ee(google.maps.event.addListener(oe,"rightclick",h)),w&&Re(google.maps.event.addListener(oe,"click",w)),S&&ze(google.maps.event.addListener(oe,"drag",S)),y&&$e(google.maps.event.addListener(oe,"center_changed",y)),b&&at(google.maps.event.addListener(oe,"radius_changed",b)),R(oe),O&&O(oe),function(){_!==null&&google.maps.event.removeListener(_),V!==null&&google.maps.event.removeListener(V),z!==null&&google.maps.event.removeListener(z),k!==null&&google.maps.event.removeListener(k),N!==null&&google.maps.event.removeListener(N),I!==null&&google.maps.event.removeListener(I),q!==null&&google.maps.event.removeListener(q),ue!==null&&google.maps.event.removeListener(ue),we!==null&&google.maps.event.removeListener(we),Me!==null&&google.maps.event.removeListener(Me),Y!==null&&google.maps.event.removeListener(Y),pt!==null&&google.maps.event.removeListener(pt),L&&L(oe),oe.setMap(null)}},[]),null}u.memo(Jw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={circle:null},n.setCircleCallback=function(){n.state.circle!==null&&n.props.onLoad&&n.props.onLoad(n.state.circle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Circle(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:Ec,eventMap:Lc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{circle:n}},this.setCircleCallback)},e.prototype.componentDidUpdate=function(n){this.state.circle!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Ec,eventMap:Lc,prevProps:n,nextProps:this.props,instance:this.state.circle}))},e.prototype.componentWillUnmount=function(){var n;this.state.circle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),ge(this.registeredEvents),(n=this.state.circle)===null||n===void 0||n.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var xc={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},Cc={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,r){t.loadGeoJson(e,n,r)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}};function Yw(t){var e=t.options,n=t.onClick,r=t.onDblClick,i=t.onMouseDown,o=t.onMouseMove,s=t.onMouseOut,a=t.onMouseOver,l=t.onMouseUp,c=t.onRightClick,f=t.onAddFeature,d=t.onRemoveFeature,p=t.onRemoveProperty,v=t.onSetGeometry,g=t.onSetProperty,h=t.onLoad,w=t.onUnmount,S=u.useContext(le),y=u.useState(null),b=y[0],O=y[1],L=u.useState(null),m=L[0],x=L[1],C=u.useState(null),R=C[0],M=C[1],_=u.useState(null),P=_[0],j=_[1],V=u.useState(null),$=V[0],G=V[1],z=u.useState(null),W=z[0],D=z[1],k=u.useState(null),A=k[0],T=k[1],N=u.useState(null),U=N[0],Z=N[1],I=u.useState(null),K=I[0],ee=I[1],q=u.useState(null),se=q[0],de=q[1],ue=u.useState(null),Le=ue[0],Fe=ue[1],we=u.useState(null),Ee=we[0],Ie=we[1],Me=u.useState(null),Re=Me[0],re=Me[1],ie=u.useState(null),ze=ie[0],Ye=ie[1];return u.useEffect(function(){b!==null&&b.setMap(S)},[S]),u.useEffect(function(){b&&r&&(m!==null&&google.maps.event.removeListener(m),x(google.maps.event.addListener(b,"dblclick",r)))},[r]),u.useEffect(function(){b&&i&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(b,"mousedown",i)))},[i]),u.useEffect(function(){b&&o&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(b,"mousemove",o)))},[o]),u.useEffect(function(){b&&s&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(b,"mouseout",s)))},[s]),u.useEffect(function(){b&&a&&(W!==null&&google.maps.event.removeListener(W),D(google.maps.event.addListener(b,"mouseover",a)))},[a]),u.useEffect(function(){b&&l&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(b,"mouseup",l)))},[l]),u.useEffect(function(){b&&c&&(U!==null&&google.maps.event.removeListener(U),Z(google.maps.event.addListener(b,"rightclick",c)))},[c]),u.useEffect(function(){b&&n&&(K!==null&&google.maps.event.removeListener(K),ee(google.maps.event.addListener(b,"click",n)))},[n]),u.useEffect(function(){b&&f&&(se!==null&&google.maps.event.removeListener(se),de(google.maps.event.addListener(b,"addfeature",f)))},[f]),u.useEffect(function(){b&&d&&(Le!==null&&google.maps.event.removeListener(Le),Fe(google.maps.event.addListener(b,"removefeature",d)))},[d]),u.useEffect(function(){b&&p&&(Ee!==null&&google.maps.event.removeListener(Ee),Ie(google.maps.event.addListener(b,"removeproperty",p)))},[p]),u.useEffect(function(){b&&v&&(Re!==null&&google.maps.event.removeListener(Re),re(google.maps.event.addListener(b,"setgeometry",v)))},[v]),u.useEffect(function(){b&&g&&(ze!==null&&google.maps.event.removeListener(ze),Ye(google.maps.event.addListener(b,"setproperty",g)))},[g]),u.useEffect(function(){if(S!==null){var Y=new google.maps.Data(Q(Q({},e||{}),{map:S}));r&&x(google.maps.event.addListener(Y,"dblclick",r)),i&&M(google.maps.event.addListener(Y,"mousedown",i)),o&&j(google.maps.event.addListener(Y,"mousemove",o)),s&&G(google.maps.event.addListener(Y,"mouseout",s)),a&&D(google.maps.event.addListener(Y,"mouseover",a)),l&&T(google.maps.event.addListener(Y,"mouseup",l)),c&&Z(google.maps.event.addListener(Y,"rightclick",c)),n&&ee(google.maps.event.addListener(Y,"click",n)),f&&de(google.maps.event.addListener(Y,"addfeature",f)),d&&Fe(google.maps.event.addListener(Y,"removefeature",d)),p&&Ie(google.maps.event.addListener(Y,"removeproperty",p)),v&&re(google.maps.event.addListener(Y,"setgeometry",v)),g&&Ye(google.maps.event.addListener(Y,"setproperty",g)),O(Y),h&&h(Y)}return function(){b&&(m!==null&&google.maps.event.removeListener(m),R!==null&&google.maps.event.removeListener(R),P!==null&&google.maps.event.removeListener(P),$!==null&&google.maps.event.removeListener($),W!==null&&google.maps.event.removeListener(W),A!==null&&google.maps.event.removeListener(A),U!==null&&google.maps.event.removeListener(U),K!==null&&google.maps.event.removeListener(K),se!==null&&google.maps.event.removeListener(se),Le!==null&&google.maps.event.removeListener(Le),Ee!==null&&google.maps.event.removeListener(Ee),Re!==null&&google.maps.event.removeListener(Re),ze!==null&&google.maps.event.removeListener(ze),w&&w(b),b.setMap(null))}},[]),null}u.memo(Yw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={data:null},n.setDataCallback=function(){n.state.data!==null&&n.props.onLoad&&n.props.onLoad(n.state.data)},n}return e.prototype.componentDidMount=function(){if(this.context!==null){var n=new google.maps.Data(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:Cc,eventMap:xc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{data:n}},this.setDataCallback)}},e.prototype.componentDidUpdate=function(n){this.state.data!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Cc,eventMap:xc,prevProps:n,nextProps:this.props,instance:this.state.data}))},e.prototype.componentWillUnmount=function(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),ge(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var _c={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},Oc={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={kmlLayer:null},n.setKmlLayerCallback=function(){n.state.kmlLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.kmlLayer)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.KmlLayer(Q(Q({},this.props.options),{map:this.context}));this.registeredEvents=fe({updaterMap:Oc,eventMap:_c,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{kmlLayer:n}},this.setKmlLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.kmlLayer!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Oc,eventMap:_c,prevProps:n,nextProps:this.props,instance:this.state.kmlLayer}))},e.prototype.componentWillUnmount=function(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),ge(this.registeredEvents),this.state.kmlLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);function gd(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function Xw(t,e){return new e(t.lat,t.lng)}function Qw(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function eS(t,e,n){return t instanceof e?t:n(t,e)}function tS(t,e,n){return t instanceof e?t:n(t,e)}function nS(t,e,n){var r=t&&t.fromLatLngToDivPixel(n.getNorthEast()),i=t&&t.fromLatLngToDivPixel(n.getSouthWest());return r&&i?{left:"".concat(i.x+e.x,"px"),top:"".concat(r.y+e.y,"px"),width:"".concat(r.x-i.x-e.x,"px"),height:"".concat(i.y-r.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function rS(t,e,n){var r=t&&t.fromLatLngToDivPixel(n);if(r){var i=r.x,o=r.y;return{left:"".concat(i+e.x,"px"),top:"".concat(o+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function vd(t,e,n,r){return n!==void 0?nS(t,e,tS(n,google.maps.LatLngBounds,Qw)):rS(t,e,eS(r,google.maps.LatLng,Xw))}function iS(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function oS(t,e,n,r,i){var o=function(s){je(a,s);function a(l,c,f,d){var p=s.call(this)||this;return p.container=l,p.pane=c,p.position=f,p.bounds=d,p}return a.prototype.onAdd=function(){var l,c=(l=this.getPanes())===null||l===void 0?void 0:l[this.pane];c==null||c.appendChild(this.container)},a.prototype.draw=function(){for(var l=this.getProjection(),c=Q({},this.container?gd(this.container,i):{x:0,y:0}),f=vd(l,c,this.bounds,this.position),d=0,p=Object.entries(f);d<p.length;d++){var v=p[d],g=v[0],h=v[1];this.container.style[g]=h}},a.prototype.onRemove=function(){this.container.parentNode!==null&&this.container.parentNode.removeChild(this.container)},a}(google.maps.OverlayView);return new o(t,e,n,r)}function Mc(t){if(!t)return"";var e=t instanceof google.maps.LatLng?t:new google.maps.LatLng(t.lat,t.lng);return e+""}function Pc(t){if(!t)return"";var e=t instanceof google.maps.LatLngBounds?t:new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west));return e+""}function sS(t){var e=t.position,n=t.bounds,r=t.mapPaneName,i=t.zIndex,o=t.onLoad,s=t.onUnmount,a=t.getPixelPositionOffset,l=t.children,c=u.useContext(le),f=u.useMemo(function(){var p=document.createElement("div");return p.style.position="absolute",p},[]),d=u.useMemo(function(){return oS(f,r,e,n,a)},[f,r,e,n]);return u.useEffect(function(){return o==null||o(d),d==null||d.setMap(c),function(){s==null||s(d),d==null||d.setMap(null)}},[c,d]),u.useEffect(function(){f.style.zIndex="".concat(i)},[i,f]),nu.createPortal(l,f)}u.memo(sS);(function(t){je(e,t);function e(n){var r=t.call(this,n)||this;r.state={paneEl:null,containerStyle:{position:"absolute"}},r.updatePane=function(){var o=r.props.mapPaneName,s=r.overlayView.getPanes();qe(!!o,"OverlayView requires props.mapPaneName but got %s",o),s?r.setState({paneEl:s[o]}):r.setState({paneEl:null})},r.onAdd=function(){var o,s;r.updatePane(),(s=(o=r.props).onLoad)===null||s===void 0||s.call(o,r.overlayView)},r.onPositionElement=function(){var o,s=r.overlayView.getProjection(),a=Q({x:0,y:0},r.containerRef.current?gd(r.containerRef.current,r.props.getPixelPositionOffset):{}),l=vd(s,a,r.props.bounds,r.props.position),c=(o=r.state.containerStyle,o.left),f=o.top,d=o.width,p=o.height;iS(l,{left:c,top:f,width:d,height:p})||r.setState({containerStyle:{top:l.top||0,left:l.left||0,width:l.width||0,height:l.height||0,position:"absolute"}})},r.draw=function(){r.onPositionElement()},r.onRemove=function(){var o,s;r.setState(function(){return{paneEl:null}}),(s=(o=r.props).onUnmount)===null||s===void 0||s.call(o,r.overlayView)},r.containerRef=u.createRef();var i=new google.maps.OverlayView;return i.onAdd=r.onAdd,i.draw=r.draw,i.onRemove=r.onRemove,r.overlayView=i,r}return e.prototype.componentDidMount=function(){this.overlayView.setMap(this.context)},e.prototype.componentDidUpdate=function(n){var r=Mc(n.position),i=Mc(this.props.position),o=Pc(n.bounds),s=Pc(this.props.bounds);(r!==i||o!==s)&&this.overlayView.draw(),n.mapPaneName!==this.props.mapPaneName&&this.updatePane()},e.prototype.componentWillUnmount=function(){this.overlayView.setMap(null)},e.prototype.render=function(){var n=this.state.paneEl;return n?nu.createPortal(E.jsx("div",{ref:this.containerRef,style:this.state.containerStyle,children:u.Children.only(this.props.children)}),n):null},e.FLOAT_PANE="floatPane",e.MAP_PANE="mapPane",e.MARKER_LAYER="markerLayer",e.OVERLAY_LAYER="overlayLayer",e.OVERLAY_MOUSE_TARGET="overlayMouseTarget",e.contextType=le,e})(u.PureComponent);function aS(){}var kc={onDblClick:"dblclick",onClick:"click"},Rc={opacity:function(t,e){t.setOpacity(e)}};function lS(t){var e=t.url,n=t.bounds,r=t.options,i=t.visible,o=u.useContext(le),s=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east)),a=u.useMemo(function(){var l=new google.maps.GroundOverlay(e,s,Q({},r));return l},[]);return u.useEffect(function(){a!==null&&a.setMap(o)},[o]),u.useEffect(function(){typeof e<"u"&&a!==null&&(a.set("url",e),a.setMap(o))},[a,e]),u.useEffect(function(){typeof i<"u"&&a!==null&&a.setOpacity(i?1:0)},[a,i]),u.useEffect(function(){var l=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east));typeof n<"u"&&a!==null&&(a.set("bounds",l),a.setMap(o))},[a,n]),null}u.memo(lS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={groundOverlay:null},n.setGroundOverlayCallback=function(){n.state.groundOverlay!==null&&n.props.onLoad&&n.props.onLoad(n.state.groundOverlay)},n}return e.prototype.componentDidMount=function(){qe(!!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 n=new google.maps.GroundOverlay(this.props.url,this.props.bounds,Q(Q({},this.props.options),{map:this.context}));this.registeredEvents=fe({updaterMap:Rc,eventMap:kc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{groundOverlay:n}},this.setGroundOverlayCallback)},e.prototype.componentDidUpdate=function(n){this.state.groundOverlay!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Rc,eventMap:kc,prevProps:n,nextProps:this.props,instance:this.state.groundOverlay}))},e.prototype.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},e.prototype.render=function(){return null},e.defaultProps={onLoad:aS},e.contextType=le,e})(u.PureComponent);var Tc={},Ac={data:function(t,e){t.setData(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)}};function cS(t){var e=t.data,n=t.onLoad,r=t.onUnmount,i=t.options,o=u.useContext(le),s=u.useState(null),a=s[0],l=s[1];return u.useEffect(function(){google.maps.visualization||qe(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)},[]),u.useEffect(function(){qe(!!e,"data property is required in HeatmapLayer %s",e)},[e]),u.useEffect(function(){a!==null&&a.setMap(o)},[o]),u.useEffect(function(){i&&a!==null&&a.setOptions(i)},[a,i]),u.useEffect(function(){var c=new google.maps.visualization.HeatmapLayer(Q(Q({},i||{}),{data:e,map:o}));return l(c),n&&n(c),function(){a!==null&&(r&&r(a),a.setMap(null))}},[]),null}u.memo(cS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={heatmapLayer:null},n.setHeatmapLayerCallback=function(){n.state.heatmapLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.heatmapLayer)},n}return e.prototype.componentDidMount=function(){qe(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to <LoadScript />? %s',google.maps.visualization),qe(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var n=new google.maps.visualization.HeatmapLayer(Q(Q({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=fe({updaterMap:Ac,eventMap:Tc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{heatmapLayer:n}},this.setHeatmapLayerCallback)},e.prototype.componentDidUpdate=function(n){ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Ac,eventMap:Tc,prevProps:n,nextProps:this.props,instance:this.state.heatmapLayer})},e.prototype.componentWillUnmount=function(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),ge(this.registeredEvents),this.state.heatmapLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Dc={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},Ic={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={streetViewPanorama:null},n.setStreetViewPanoramaCallback=function(){n.state.streetViewPanorama!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewPanorama)},n}return e.prototype.componentDidMount=function(){var n,r,i=(r=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&r!==void 0?r:null;this.registeredEvents=fe({updaterMap:Ic,eventMap:Dc,prevProps:{},nextProps:this.props,instance:i}),this.setState(function(){return{streetViewPanorama:i}},this.setStreetViewPanoramaCallback)},e.prototype.componentDidUpdate=function(n){this.state.streetViewPanorama!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Ic,eventMap:Dc,prevProps:n,nextProps:this.props,instance:this.state.streetViewPanorama}))},e.prototype.componentWillUnmount=function(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),ge(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={streetViewService:null},n.setStreetViewServiceCallback=function(){n.state.streetViewService!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewService)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:n}},this.setStreetViewServiceCallback)},e.prototype.componentWillUnmount=function(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={directionsService:null},n.setDirectionsServiceCallback=function(){n.state.directionsService!==null&&n.props.onLoad&&n.props.onLoad(n.state.directionsService)},n}return e.prototype.componentDidMount=function(){qe(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var n=new google.maps.DirectionsService;this.setState(function(){return{directionsService:n}},this.setDirectionsServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.directionsService!==null&&this.state.directionsService.route(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.directionsService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},e.prototype.render=function(){return null},e})(u.PureComponent);var jc={onDirectionsChanged:"directions_changed"},Nc={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={directionsRenderer:null},n.setDirectionsRendererCallback=function(){n.state.directionsRenderer!==null&&(n.state.directionsRenderer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.directionsRenderer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=fe({updaterMap:Nc,eventMap:jc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{directionsRenderer:n}},this.setDirectionsRendererCallback)},e.prototype.componentDidUpdate=function(n){this.state.directionsRenderer!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Nc,eventMap:jc,prevProps:n,nextProps:this.props,instance:this.state.directionsRenderer}))},e.prototype.componentWillUnmount=function(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),ge(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},e.prototype.render=function(){return E.jsx(E.Fragment,{})},e.contextType=le,e})(u.PureComponent);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={distanceMatrixService:null},n.setDistanceMatrixServiceCallback=function(){n.state.distanceMatrixService!==null&&n.props.onLoad&&n.props.onLoad(n.state.distanceMatrixService)},n}return e.prototype.componentDidMount=function(){qe(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var n=new google.maps.DistanceMatrixService;this.setState(function(){return{distanceMatrixService:n}},this.setDistanceMatrixServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.distanceMatrixService!==null&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.distanceMatrixService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},e.prototype.render=function(){return null},e})(u.PureComponent);var Bc={onPlacesChanged:"places_changed"},Uc={bounds:function(t,e){t.setBounds(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=u.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){n.state.searchBox!==null&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}return e.prototype.componentDidMount=function(){if(qe(!!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 n=this.containerElement.current.querySelector("input");if(n!==null){var r=new google.maps.places.SearchBox(n,this.props.options);this.registeredEvents=fe({updaterMap:Uc,eventMap:Bc,prevProps:{},nextProps:this.props,instance:r}),this.setState(function(){return{searchBox:r}},this.setSearchBoxCallback)}}},e.prototype.componentDidUpdate=function(n){this.state.searchBox!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Uc,eventMap:Bc,prevProps:n,nextProps:this.props,instance:this.state.searchBox}))},e.prototype.componentWillUnmount=function(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),ge(this.registeredEvents))},e.prototype.render=function(){return E.jsx("div",{ref:this.containerElement,children:u.Children.only(this.props.children)})},e.contextType=le,e})(u.PureComponent);var Vc={onPlaceChanged:"place_changed"},Fc={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=u.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){n.state.autocomplete!==null&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}return e.prototype.componentDidMount=function(){var n;qe(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places);var r=(n=this.containerElement.current)===null||n===void 0?void 0:n.querySelector("input");if(r){var i=new google.maps.places.Autocomplete(r,this.props.options);this.registeredEvents=fe({updaterMap:Fc,eventMap:Vc,prevProps:{},nextProps:this.props,instance:i}),this.setState(function(){return{autocomplete:i}},this.setAutocompleteCallback)}},e.prototype.componentDidUpdate=function(n){ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Fc,eventMap:Vc,prevProps:n,nextProps:this.props,instance:this.state.autocomplete})},e.prototype.componentWillUnmount=function(){this.state.autocomplete!==null&&ge(this.registeredEvents)},e.prototype.render=function(){return E.jsx("div",{ref:this.containerElement,className:this.props.className,children:u.Children.only(this.props.children)})},e.defaultProps={className:""},e.contextType=le,e})(u.PureComponent);const uS={clickableIcons:!1,disableDefaultUI:!0,minZoom:4,maxZoom:20,restriction:{strictBounds:!0,latLngBounds:{north:85,south:-85,west:-179,east:179}}},md={optimized:!0},fS="MapGoogle-module__root__iB2RTt",dS="MapGoogle-module__hideUI__zGYpjY",pS="MapGoogle-module__mapContainer__qTVsu4",hS="MapGoogle-module__balloon__nNM3fV",gS="MapGoogle-module__details__MuhoyT",vS="MapGoogle-module__cluster__KIS2sn",mS="MapGoogle-module__overlay__z03Yoa",yS="MapGoogle-module__mapControl__Iu3xc4",bS="MapGoogle-module__geolocationControl__cwYVsw",wS="MapGoogle-module__bottomSheet__ql8eoC",SS="MapGoogle-module__locationViewContent__LYJkkK",LS="MapGoogle-module__locationViewHeader__hzc7Ip",ES="MapGoogle-module__deliveryDetailsViewContent__1FevKl",xS="MapGoogle-module__deliveryDetailsViewHeader__VRF5b3",CS="MapGoogle-module__sheetSubmit__pjGRS0",Xe={root:fS,hideUI:dS,mapContainer:pS,balloon:hS,details:gS,cluster:vS,overlay:mS,mapControl:yS,geolocationControl:bS,bottomSheet:wS,locationViewContent:SS,locationViewHeader:LS,deliveryDetailsViewContent:ES,deliveryDetailsViewHeader:xS,sheetSubmit:CS},_S=({children:t,className:e,onLoad:n,onIdle:r,onUnmount:i})=>{const{map:o,disableDelivery:s,hideMapUI:a}=st(),l=u.useMemo(()=>{var f,d;return{lat:((f=o==null?void 0:o.center)==null?void 0:f[0])??co[0],lng:((d=o==null?void 0:o.center)==null?void 0:d[1])??co[1]}},[o==null?void 0:o.center]),c=u.useCallback(async f=>{var v;const{latLng:d}=f;if(!d||s)return;ye.getState().setDetailsOpen(!1),bt.getState().setSelectedLocation(null);const p=[d.lat(),d.lng()];try{const g=await ur(p),h=(v=g==null?void 0:g.results)==null?void 0:v[0],w=h==null?void 0:h.formatted_address;$t.getState().setPlace(h),mn(w,"Address is not defined"),Ze.getState().setDeliverPoint({address:w,coords:p})}catch{Ze.getState().setDeliverPoint({address:null,coords:p})}},[s]);return E.jsx(tw,{zoom:o==null?void 0:o.initialZoom,center:l,options:uS,mapContainerClassName:be(Xe.root,e,{[Xe.hideUI]:a}),onLoad:n,onIdle:r,onUnmount:i,onClick:c,children:t})},OS='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z" style="mix-blend-mode:darken"/><g filter="url(#b)"><path fill="currentColor" fill-rule="evenodd" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z" clip-rule="evenodd"/></g><g fill="#fff"><path fill-rule="evenodd" d="M15.878 16.411c0-.34.273-.617.61-.617h15.024c.337 0 .61.276.61.617v10.103H15.878V16.41Zm1.22.617v8.253h13.803v-8.253H17.1Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M15.878 25.28h16.244v9.155c0 .864-.694 1.565-1.55 1.565H17.428c-.855 0-1.55-.7-1.55-1.565V25.28Zm1.22 1.234v7.92a.33.33 0 0 0 .33.333h13.145a.33.33 0 0 0 .328-.332v-7.921H17.1ZM14 13.565c0-.864.694-1.565 1.55-1.565h16.9c.856 0 1.55.7 1.55 1.565v1.898c0 .864-.694 1.565-1.55 1.565h-16.9c-.856 0-1.55-.701-1.55-1.565v-1.898Zm1.55-.332a.33.33 0 0 0-.33.332v1.898a.33.33 0 0 0 .33.332h16.9a.33.33 0 0 0 .33-.332v-1.898a.33.33 0 0 0-.33-.332h-16.9Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M20.573 24c0-1.912 1.535-3.462 3.427-3.462 1.893 0 3.428 1.55 3.428 3.462v1.872a.639.639 0 0 1-.636.642H21.21a.639.639 0 0 1-.636-.642V24ZM24 21.77A2.218 2.218 0 0 0 21.794 24v1.28h4.413V24c0-1.231-.988-2.23-2.207-2.23Z" clip-rule="evenodd"/><path d="m26.765 29.18-2.724-1.376a.093.093 0 0 0-.083 0l-2.724 1.376a.094.094 0 0 0-.051.084v2.752c0 .036.02.069.05.084l2.725 1.376a.09.09 0 0 0 .042.01.09.09 0 0 0 .041-.01l2.724-1.376a.094.094 0 0 0 .051-.084v-2.751a.095.095 0 0 0-.05-.085ZM24 27.994l2.624 1.326-1.26.637-2.525-1.378 1.16-.585Zm0 2.651-2.625-1.325 1.261-.637 2.524 1.377-1.16.585Zm-2.631-1.118 2.538 1.282v2.431l-2.538-1.282v-2.431Zm2.723 3.713V30.81l2.538-1.282v2.432l-2.538 1.281Z"/><path fill-rule="evenodd" d="M26.892 28.926a.38.38 0 0 1 .206.339v2.751a.379.379 0 0 1-.207.339l-2.723 1.375a.369.369 0 0 1-.338 0l-2.722-1.375a.379.379 0 0 1-.208-.339v-2.752c0-.142.079-.274.207-.339l2.727-1.377a.373.373 0 0 1 .33 0l.002.002 2.726 1.376ZM21.233 32.1a.094.094 0 0 1-.05-.084v-2.752c0-.035.019-.068.05-.084l2.724-1.376a.093.093 0 0 1 .084 0l2.724 1.376a.095.095 0 0 1 .05.085v2.751c0 .035-.019.068-.05.084l-2.724 1.376a.09.09 0 0 1-.042.01.09.09 0 0 1-.042-.01L21.233 32.1Zm5.397-.141v-2.432l-2.538 1.282v2.431l2.538-1.281Zm-.282-.176v-1.796l-1.974.998v1.795l1.974-.997Zm-2.442-.974-2.538-1.282v2.431l2.538 1.282V30.81Zm-2.256-.822 1.974.998v1.795l-1.974-.998v-1.795Zm2.349.658 1.16-.585-2.524-1.377-1.26.637 2.624 1.325Zm.55-.595-.55.277-1.995-1.008.626-.316 1.918 1.047Zm.814-.094 1.26-.636L24 27.994l-1.16.585 2.524 1.377Zm.005-.32-1.918-1.047.549-.277 1.995 1.008-.627.316Z" clip-rule="evenodd"/></g><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_958_9661"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_958_9661" result="shape"/></filter></defs></svg>',MS='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z" style="mix-blend-mode:darken"/><g filter="url(#b)"><path fill="currentColor" fill-opacity=".8" fill-rule="evenodd" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z" clip-rule="evenodd"/></g><path fill="#fff" fill-rule="evenodd" d="M36.503 33.501V19.625a3 3 0 0 0-1.583-2.645l-9.502-5.091a3 3 0 0 0-2.834 0l-9.501 5.091a3 3 0 0 0-1.583 2.645V33.5a3 3 0 0 0 3 3h19.003a3 3 0 0 0 3-3Zm-7.752 1h4.752a1 1 0 0 0 1-1V19.625a1 1 0 0 0-.528-.882l-9.501-5.091a1 1 0 0 0-.945 0l-9.501 5.091a1 1 0 0 0-.528.882V33.5a1 1 0 0 0 1 1h4.75a2.516 2.516 0 0 1-.05-.5V23.747a2.5 2.5 0 0 1 2.5-2.5h4.602a2.5 2.5 0 0 1 2.5 2.5V34c0 .172-.018.339-.05.5Zm-2.434 0a.5.5 0 0 0 .485-.5V23.747a.5.5 0 0 0-.5-.5H21.7a.5.5 0 0 0-.5.5V34a.5.5 0 0 0 .484.5h4.632Z" clip-rule="evenodd"/><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_1068_16960"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_1068_16960" result="shape"/></filter></defs></svg>',PS='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z"/><g fill-rule="evenodd" clip-rule="evenodd" filter="url(#b)"><path fill="currentColor" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z"/><path fill="#fff" d="M33.913 12H14.087A2.087 2.087 0 0 0 12 14.087v19.826c0 1.153.934 2.087 2.087 2.087h19.826A2.087 2.087 0 0 0 36 33.913V14.087A2.087 2.087 0 0 0 33.913 12Zm-20.348 2.087c0-.288.234-.522.522-.522h7.826v4.07h-8.348v-3.548Zm9.913 9.13v-9.652h4.696v9.652h-4.696Zm4.696 1.566h-4.696v9.652h4.696v-9.652Zm1.565 9.652h4.174a.523.523 0 0 0 .522-.522v-9.13h-4.696v9.652Zm0-11.218v-9.652h4.174c.288 0 .522.234.522.522v9.13h-4.696ZM21.913 19.2v4.017h-8.348V19.2h8.348Zm0 9.6v-4.017h-8.348V28.8h8.348Zm-8.348 1.565h8.348v4.07h-7.826a.522.522 0 0 1-.522-.522v-3.548Z"/></g><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop stop-color="#1D3665"/><stop offset="1" stop-color="#1D3665" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_2412_6054"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_2412_6054" result="shape"/></filter></defs></svg>',Rt={PinPvz:OS,PinHome:MS,PinLocker:PS},yd=28,bd=({open:t,children:e,hideFooter:n,minSnapHeight:r,submitDisabled:i,submitLoading:o,onSubmitClick:s,...a})=>E.jsx(Cf,{open:t,expandOnContentDrag:!0,initialFocusRef:!1,defaultSnap:({snapPoints:l})=>Math.min(...l),snapPoints:({headerHeight:l,minHeight:c,footerHeight:f,maxHeight:d})=>[r==null?c:l+f+r,d-yd],footer:n?null:E.jsx(_t,{disabled:i,loading:o,variant:"primary",className:Xe.sheetSubmit,onClick:s,children:E.jsx(An,{keyName:"choose",ns:"common"})}),sibling:E.jsx("div",{"data-rsbs-backdrop":"true",onClick:l=>{var c;l.stopPropagation(),l.preventDefault(),(c=a.onDismiss)==null||c.call(a)}}),blocking:!1,children:E.jsx("div",{className:Xe.bottomSheet,children:e})}),wd=({isSelectedPoint:t})=>{const e=ye(sa),[n,r]=u.useState(!0);return u.useEffect(()=>{r(t?!e:!0)},[e,t]),n},Sd=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:42,height:42,fill:"none",viewBox:"0 0 42 42",...t},ce.createElement("rect",{width:42,height:42,fill:"#fff",rx:21}),ce.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M31.003 28V17.766a3 3 0 0 0-1.579-2.643l-7.003-3.765a3 3 0 0 0-2.842 0l-7.003 3.765a3 3 0 0 0-1.58 2.643V28a3 3 0 0 0 3 3h14.008a3 3 0 0 0 3-3Zm-5.919 1h2.92a1 1 0 0 0 1-1V17.766a1 1 0 0 0-.527-.881l-7.003-3.766a1 1 0 0 0-.948 0l-7.003 3.766a1 1 0 0 0-.527.88v10.237a1 1 0 0 0 1 1h2.92a2.513 2.513 0 0 1-.05-.5v-7.606a2.5 2.5 0 0 1 2.5-2.5h3.268a2.5 2.5 0 0 1 2.5 2.5V28.5c0 .171-.017.338-.05.5Zm-2.426 0a.5.5 0 0 0 .476-.499v-7.606a.5.5 0 0 0-.5-.5h-3.269a.5.5 0 0 0-.5.5V28.5a.5.5 0 0 0 .476.5h3.317Z",clipRule:"evenodd"}),ce.createElement("rect",{width:41,height:41,x:.5,y:.5,stroke:"#1D3665",strokeOpacity:.1,rx:20.5})),kS=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},ce.createElement("g",{clipPath:"url(#a)"},ce.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M17.071 3.071a1.25 1.25 0 0 0-1.768 0L10 8.375 4.697 3.07a1.25 1.25 0 1 0-1.768 1.77l5.303 5.303-5.303 5.303a1.25 1.25 0 0 0 1.768 1.768L10 11.91l5.303 5.303a1.25 1.25 0 1 0 1.768-1.768l-5.303-5.303L17.07 4.84a1.25 1.25 0 0 0 0-1.768Z",clipRule:"evenodd"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"a"},ce.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})))),RS="CloseButton-module__root__233rOd",TS="CloseButton-module__absolutePositionVariant__MMkQ0-",AS="CloseButton-module__relativePositionVariant__fdYFY4",zc={root:RS,absolutePositionVariant:TS,relativePositionVariant:AS},di=({position:t="absolute",className:e,...n})=>E.jsx("div",{...n,className:be(zc.root,e,zc[`${t}PositionVariant`]),children:E.jsx(kS,{})}),DS="DeliveryBalloon-module__root__c9I8i1",IS="DeliveryBalloon-module__details__ti2Tdy",jS="DeliveryBalloon-module__header__qKggbq",NS="DeliveryBalloon-module__title__fDmbsU",BS="DeliveryBalloon-module__description__5-12RZ",US="DeliveryBalloon-module__actions__MWT995",VS="DeliveryBalloon-module__errorVariant__meU-B7",FS="DeliveryBalloon-module__logo__YNN-Vi",an={root:DS,details:IS,header:jS,title:NS,description:BS,actions:US,errorVariant:VS,logo:FS},na=({SSR:t,variant:e,address:n,className:r,hideDetails:i,hasCloseButton:o,onDetails:s,onClose:a})=>{const l=e==="error",c=e==="default",f=t?"{ courier_balloon.title }":E.jsx(An,{keyName:"title",ns:"courier_balloon"}),d=t?"{ courier_balloon.error_title }":E.jsx(An,{keyName:"error_title",ns:"courier_balloon"}),p=t?"{ courier_balloon.error_description }":E.jsx(An,{keyName:"error_description",ns:"courier_balloon"});return E.jsxs("div",{className:be(an.root,r,an[`${e}Variant`]),children:[E.jsxs("div",{className:an.header,children:[E.jsx(Sd,{className:an.logo}),E.jsx("span",{className:an.title,children:l?d:f}),o&&E.jsx(di,{onClick:a})]}),E.jsx("div",{className:an.description,children:l?p:n||"{{ properties.address }}"}),c&&!i&&E.jsx("div",{className:an.actions,children:E.jsx(_t,{id:lo,as:"button",variant:"primary",className:an.details,onClick:s,children:t?"{ details }":E.jsx(An,{keyName:"details",ns:"common"})})})]})},zS="Chip-module__root__A1duWr",$S="Chip-module__active__PmXa7K",$c={root:zS,active:$S},Hc=({active:t,children:e,className:n,...r})=>E.jsx("div",{...r,className:be($c.root,n,{[$c.active]:t}),children:e}),HS="TextArea-module__root__l-RDfr",GS={root:HS},Gc=u.forwardRef(({className:t,inputRef:e,onChange:n,onBlur:r,onFocus:i,...o},s)=>{const a=u.useRef(null);u.useImperativeHandle(s,()=>({focus:()=>{var c,f;(c=a.current)==null||c.focus(),i&&i({target:{value:(f=a.current)==null?void 0:f.value}})},blur:()=>{var c,f;(c=a.current)==null||c.blur(),r&&r({target:{value:(f=a.current)==null?void 0:f.value}})},setValue:c=>{n&&n({target:{value:c}}),a.current&&(a.current.value=c)}}),[r,n,i]);const l=Dd(e,a);return E.jsx("textarea",{...o,ref:l,className:be(GS.root,t),onBlur:r,onFocus:i,onChange:n})}),WS=({set:t})=>(e,n)=>{let r={...e};switch(n.type){case"SET_COMMENT":{r={...e,comment:n.payload};break}case"SET_DELIVERY_TIME":{r={...e,delivery_time:n.payload};break}case"SET_APARTMENT_NUMBER":{r={...e,apartment_number:n.payload};break}}return t==null||t(r),r},Ld=t=>{const{delivery_time:e,apartment_number:n}=t;return!!e&&!!n},ZS="DeliveryDetailsView-module__title__9op9De",qS="DeliveryDetailsView-module__logo__FHhzI0",KS="DeliveryDetailsView-module__header__zT3NCJ",JS="DeliveryDetailsView-module__content__BWg5hx",YS="DeliveryDetailsView-module__section__XSwSmI",XS="DeliveryDetailsView-module__chips__9GPIxJ",QS="DeliveryDetailsView-module__actions__xulMTc",eL="DeliveryDetailsView-module__submit__v9jVsD",tL="DeliveryDetailsView-module__actionsHidden__yu2ivZ",nL="DeliveryDetailsView-module__commentSection__lnUmS0",rL="DeliveryDetailsView-module__comment__ZwRY1z",mt={title:ZS,logo:qS,header:KS,content:JS,section:YS,chips:XS,actions:QS,submit:eL,actionsHidden:tL,commentSection:nL,comment:rL},iL=u.forwardRef(({classes:t,location:e,hideActions:n,onClose:r,onChange:i,onSubmit:o},s)=>{const{inputs:a,locale:l}=st(),{t:c}=jt(["details_modal","courier_balloon","common"]),f=u.useMemo(()=>WS({set:i}),[i]),[d,p]=u.useState(!1),[v,g]=u.useReducer(f,{comment:"",delivery_time:"",apartment_number:"",...e}),h=u.useCallback(async()=>{p(!0);try{mn(e.address,"Address is required");const m=await Zd({address:e.address,algorithm:10,service:10,language:l||bu});if(!Kf(m))return;const x=m==null?void 0:m.data.data,C={...v,address:x};return o==null||o(C),C}finally{p(!1)}},[l,e.address,o,v]);u.useImperativeHandle(s,()=>({submit:h}),[h]);const w=m=>()=>{g({payload:m,type:"SET_DELIVERY_TIME"})},S=m=>{g({payload:m.target.value,type:"SET_APARTMENT_NUMBER"})},y=m=>{g({payload:m.target.value,type:"SET_COMMENT"})},b=Ld(v),O=_o(a==null?void 0:a.apartment),L=_o(a==null?void 0:a.comment);return E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:be(mt.header,t==null?void 0:t.header),children:[E.jsx(di,{onClick:r}),E.jsxs("div",{className:mt.title,children:[E.jsx(Sd,{className:mt.logo}),E.jsx("span",{children:c("title",{ns:"courier_balloon"})})]})]}),E.jsxs("div",{className:be(mt.content,t==null?void 0:t.content),children:[E.jsxs("section",{className:mt.section,children:[E.jsxs("label",{children:[c("address"),":"]}),E.jsx("p",{children:e.address})]}),E.jsxs("section",{className:mt.section,children:[E.jsxs("label",{children:[c("delivery_time"),":"]}),E.jsxs("div",{className:mt.chips,children:[E.jsx(Hc,{active:v.delivery_time==="8:00-13:00",onClick:w("8:00-13:00"),children:"8:00 - 13:00"}),E.jsx(Hc,{active:v.delivery_time==="14:00-22:00",onClick:w("14:00-22:00"),children:"14:00 - 22:00"})]})]}),E.jsxs("section",{className:mt.section,children:[E.jsxs("label",{children:[c("apartment_number"),":"]}),E.jsx(Gc,{...O,rows:1,onChange:S})]}),E.jsxs("section",{className:be(mt.section,mt.commentSection),children:[E.jsxs("label",{children:[c("comment"),":"]}),E.jsx(Gc,{...L,className:mt.comment,onChange:y})]})]}),E.jsx("div",{className:be(mt.actions,{[mt.actionsHidden]:n}),children:E.jsx(_t,{loading:d,disabled:!b||d,variant:"primary",className:mt.submit,onClick:h,children:c("choose",{ns:"common"})})})]})}),Ed=u.memo(iL),oL={header:Xe.deliveryDetailsViewHeader,content:Xe.deliveryDetailsViewContent},sL=({hideDetails:t,point:e,setOpenDetails:n,setDeliveryPoint:r,onPointClick:i})=>{const o=wd({isSelectedPoint:!0}),s=u.useRef(null),[a,l]=u.useState(!1),[c,f]=u.useState({...e,comment:"",delivery_time:"",apartment_number:""});u.useEffect(()=>{f({...e,comment:"",delivery_time:"",apartment_number:""})},[e]);const[d,p]=u.useState(null),v=pi("screenSm"),g=u.useMemo(()=>({lat:c.coords[0],lng:c.coords[1]}),[c.coords]),h=()=>{n==null||n(!0)},w=()=>{r==null||r(null)},S=u.useMemo(()=>({url:Jt(xt(Rt.PinHome,"--owl-color-success")),scaledSize:new google.maps.Size(...Xt)}),[]),y=async()=>{var m;try{l(!0);const x=await((m=s.current)==null?void 0:m.submit());if(!x)return;i==null||i(x),n==null||n(!1),r==null||r(null)}finally{l(!1)}},b=E.jsx(na,{...c,hideDetails:t,hasCloseButton:v,variant:c.address?"default":"error",className:Xe.balloon,onDetails:h,onClose:w}),O=Ld(c),L=o&&!!(d!=null&&d.getVisible());return E.jsxs(ld,{noClustererRedraw:!0,icon:S,position:g,options:md,onLoad:p,children:[v&&E.jsxs(bd,{minSnapHeight:c.address?200:void 0,submitDisabled:!O||a,submitLoading:a,hideFooter:!c.address,open:L,onDismiss:w,onSubmitClick:y,children:[c.address&&E.jsx(Ed,{ref:s,classes:oL,hideActions:!0,location:e,onChange:f,onClose:w}),!c.address&&b]}),!v&&L&&E.jsx(hd,{onCloseClick:w,children:b})]})},xd=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:26,height:8,fill:"none",viewBox:"0 0 26 8",...t},ce.createElement("g",{fill:"#000"},ce.createElement("path",{d:"M1.416 7.5c-.255 0-.491-.065-.708-.194A1.445 1.445 0 0 1 0 6.06V1.94A1.445 1.445 0 0 1 .708.695C.925.564 1.16.5 1.416.5h4.056c.255 0 .488.065.698.194.217.13.39.305.517.525.134.214.2.454.2.72V6.06c0 .26-.066.5-.2.72-.128.22-.3.395-.517.525-.21.13-.443.194-.698.194H1.416Zm.067-1.517h3.903V2.017H1.483v3.966ZM7.941 7.5v-7h1.53l2.335 2.83L14.13.5h1.54v7h-1.493V2.804l-2.372 2.878-2.382-2.868V7.5H7.94ZM16.816 7.5v-7h1.53l3.856 4.667V.5h1.502v7h-1.53l-3.875-4.686V7.5h-1.483ZM24.536 7.5v-7H26v7h-1.464Z"}))),Cd=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:26,height:14,fill:"none",viewBox:"0 0 26 14",...t},ce.createElement("g",{fill:"#000"},ce.createElement("path",{d:"M0 13.252V8.346h1.053v3.844h3.08v1.062H0ZM4.535 13.252V8.346h1.053v3.844h3.08v1.062H4.535ZM9.126 13.252V9.36a1.02 1.02 0 0 1 .503-.87.973.973 0 0 1 .503-.137h2.874a.95.95 0 0 1 .502.136c.154.09.277.213.367.367.095.15.143.318.143.504v3.892H12.95v-1.58H10.18v1.58H9.126Zm1.053-2.64h2.772V9.413H10.18v1.197ZM14.792 13.252v-4.9h1.087l1.658 1.98 1.65-1.98h1.094v4.9h-1.06V9.965l-1.684 2.014-1.692-2.007v3.28h-1.053ZM21.108 13.252V9.36a1.018 1.018 0 0 1 .503-.87.973.973 0 0 1 .503-.137h2.874a.95.95 0 0 1 .503.136c.153.09.276.213.366.367A.92.92 0 0 1 26 9.36v3.892h-1.067v-1.58h-2.771v1.58h-1.054Zm1.053-2.64h2.772V9.413h-2.771v1.197ZM1.005 5.648a.973.973 0 0 1-.502-.137A1.018 1.018 0 0 1 0 4.641V1.756a1.018 1.018 0 0 1 .503-.87.973.973 0 0 1 .502-.137h2.881c.181 0 .347.045.496.136.154.09.276.213.367.367a.92.92 0 0 1 .143.504V4.64c0 .181-.048.349-.143.503-.09.154-.213.277-.367.367a.937.937 0 0 1-.496.137h-2.88Zm.048-1.062h2.772V1.81H1.053v2.776ZM5.64 5.648v-4.9h1.087l1.657 1.98 1.651-1.98h1.094v4.9h-1.06V2.36L8.384 4.375 6.693 2.368v3.28H5.64ZM11.943 5.648v-4.9h1.087l2.738 3.267V.749h1.066v4.899h-1.087l-2.751-3.28v3.28h-1.053ZM17.425 5.648v-4.9h1.04v4.9h-1.04Z"}))),aL="LocationView-module__title__QP69kD",lL="LocationView-module__logo__nlPQaG",cL="LocationView-module__header__9DDuVU",uL="LocationView-module__content__Se2TSy",fL="LocationView-module__section__9m1x1v",dL="LocationView-module__chips__6j-ZAh",pL="LocationView-module__services__rwbp2x",hL="LocationView-module__images__zfnQMA",gL="LocationView-module__image__JKvt9J",vL="LocationView-module__actions__AGih3C",mL="LocationView-module__actionsHidden__DBV1vj",yL="LocationView-module__submit__6mD2w-",bL="LocationView-module__scheduleItem__snTLMb",rt={title:aL,logo:lL,header:cL,content:uL,section:fL,chips:dL,services:pL,images:hL,image:gL,actions:vL,actionsHidden:mL,submit:yL,scheduleItem:bL},wL={default:xd,llama:Cd},SL=({location:t,hideActions:e,classes:n,onClose:r,onSubmit:i})=>{const{t:o}=jt(["details_modal","common"]),{logo:s="default"}=st(),a=wL[s];return E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:be(rt.header,n==null?void 0:n.header),children:[E.jsx(di,{onClick:r}),E.jsxs("div",{className:rt.title,children:[E.jsx("div",{className:rt.logo,children:E.jsx(a,{})}),E.jsx("span",{children:t.name})]})]}),E.jsxs("div",{className:be(rt.content,n==null?void 0:n.content),children:[E.jsxs("section",{className:rt.section,children:[E.jsxs("label",{children:[o("address"),":"]}),E.jsx("p",{children:t.location.full_address})]}),t.schedule.length>0&&E.jsxs("section",{className:rt.section,children:[E.jsxs("label",{children:[o("schedule"),":"]}),t.schedule.map((l,c)=>E.jsx("p",{className:rt.scheduleItem,children:l},c))]}),(t.pay_by_card||t.pay_by_card)&&E.jsxs("section",{className:rt.section,children:[E.jsxs("label",{children:[o("payment_method"),":"]}),E.jsxs("div",{className:rt.chips,children:[t.pay_by_cash&&o("pay_by_cash"),t.pay_by_card&&t.pay_by_cash&&", ",t.pay_by_card&&o("pay_by_card")]})]}),E.jsxs("section",{className:rt.section,children:[E.jsxs("label",{children:[o("services"),":"]}),E.jsxs("div",{className:rt.services,children:[t.is_pickup&&E.jsx("span",{children:o("is_pickup")}),t.is_delivery&&E.jsx("span",{children:o("is_delivery")}),t.is_dressing_room&&E.jsx("span",{children:o("is_dressing_room")}),t.is_check_order&&E.jsx("span",{children:o("is_check_order")})]})]}),E.jsxs("section",{className:rt.section,children:[E.jsxs("label",{children:[o("location"),":"]}),E.jsx("p",{children:t.location_name})]}),t.images.length>0&&E.jsx("section",{className:rt.images,children:t.images.map(l=>E.jsx("img",{src:l,alt:t.name,className:rt.image},l))})]}),E.jsx("div",{className:be(rt.actions,{[rt.actionsHidden]:e}),children:E.jsx(_t,{variant:"primary",className:rt.submit,onClick:i,children:o("choose",{ns:"common"})})})]})},_d=u.memo(SL),LL=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...t},ce.createElement("path",{fill:"currentcolor",d:"M12.5 8c0 .287-.108.573-.324.792l-6.789 6.88a1.095 1.095 0 0 1-1.563 0 1.131 1.131 0 0 1 0-1.585L9.83 8 3.824 1.913a1.131 1.131 0 0 1 0-1.585 1.095 1.095 0 0 1 1.564 0l6.789 6.88c.215.219.323.505.323.792Z"})),EL="LocationBalloon-module__root__D5p9cL",xL="LocationBalloon-module__submit__Ri5JaR",CL="LocationBalloon-module__details__6et6aX",_L="LocationBalloon-module__icon__U-zpx7",OL="LocationBalloon-module__header__LCvDj0",ML="LocationBalloon-module__title__octhrc",PL="LocationBalloon-module__description__r7vFbw",kL="LocationBalloon-module__actions__-jdejn",ln={root:EL,submit:xL,details:CL,icon:_L,header:OL,title:ML,description:PL,actions:kL},RL={default:xd,llama:Cd},Od=({SSR:t,name:e,location:n,onSubmit:r,className:i,onDetails:o,hideDetails:s,location_name:a})=>{const{logo:l="default"}=st(),c=RL[l];return E.jsxs("div",{className:be(ln.root,i),children:[E.jsxs("div",{className:ln.header,children:[E.jsx("div",{className:ln.icon,children:E.jsx(c,{})}),E.jsx("span",{className:ln.title,children:e||"{{ properties.point.name }}"})]}),E.jsxs("div",{className:ln.description,children:[(n==null?void 0:n.full_address)||"{{ properties.point.location.full_address }}",","," ",a||"{{ properties.point.location_name }}"]}),E.jsxs("div",{className:ln.actions,children:[E.jsx(_t,{id:Cs,variant:"primary",className:ln.submit,onClick:r,children:t?"{ choose }":E.jsx(An,{keyName:"choose",ns:"common"})}),!s&&E.jsxs(_t,{id:lo,as:"link",variant:"primary",className:ln.details,onClick:o,children:[t?"{ details }":E.jsx(An,{keyName:"details",ns:"common"}),E.jsx(LL,{})]})]})]})},TL={header:Xe.locationViewHeader,content:Xe.locationViewContent},AL=({point:t,clusterer:e,hideDetails:n,onPointClick:r,selectedPoint:i,setOpenDetails:o,onPointSelected:s})=>{const a=pi("screenSm"),[l,c]=u.useState(null),f=()=>{o==null||o(!1),s==null||s(t)},d=()=>{s==null||s(null)},p=()=>{o==null||o(!0),s==null||s(t)},v=()=>{r==null||r(t),o==null||o(!1),s==null||s(null)},g=(i==null?void 0:i.uid)===t.uid,h=g?Yn:Xt,w=wd({isSelectedPoint:g}),S=u.useMemo(()=>{let O;switch(!0){case(t.type===30&&!g):{O=xt(Rt.PinLocker,"--owl-color-primary");break}case(t.type!==30&&!g):{O=xt(Rt.PinPvz,"--owl-color-grey-80");break}case(t.type===30&&g):{O=xt(Rt.PinLocker,"--owl-color-success");break}case(t.type!==30&&g):{O=xt(Rt.PinPvz,"--owl-color-black");break}}return mn(O,"Icon url is not defined"),{scaledSize:new google.maps.Size(...h),url:Jt(O)}},[g,h,t.type]),y=u.useMemo(()=>({lat:t.location.latitude,lng:t.location.longitude}),[t.location.latitude,t.location.longitude]),b=g&&w&&!!(l!=null&&l.getVisible());return E.jsxs(ld,{noClustererRedraw:!0,icon:S,position:y,clusterer:e,options:md,onLoad:c,onClick:f,children:[a&&E.jsx(bd,{minSnapHeight:200,open:b,onDismiss:d,onSubmitClick:v,children:E.jsx(_d,{classes:TL,hideActions:!0,location:t,onClose:d})}),b&&!a&&E.jsx(hd,{onCloseClick:d,children:E.jsx(Od,{...t,hideDetails:n,className:Xe.balloon,onSubmit:v,onDetails:p})})]},t.uid)},DL=({points:t,hideDetails:e,selectedPoint:n,onOpenDetails:r,onPointClick:i,onPointSelected:o})=>E.jsx(Cw,{clusterClass:Xe.cluster,onClusteringEnd:()=>{setTimeout(()=>{const s=document.getElementsByClassName(Xe.cluster);for(const a of s)a.addEventListener("touchstart",Js,{passive:!0})},100)},onUnmount:()=>{const s=document.getElementsByClassName(Xe.cluster);for(const a of s)a.removeEventListener("touchstart",Js)},children:s=>E.jsx(u.Fragment,{children:t.map(a=>E.jsx(AL,{point:a,clusterer:s,hideDetails:e,selectedPoint:n,setOpenDetails:r,onPointClick:i,onPointSelected:o},a.uid))})}),IL=u.memo(DL),jL=({onOpenDetails:t,onPointClick:e,onPointSelected:n})=>{const{locale:r,hideDetails:i}=st(),o=zt(Jf),s=bt(c=>c.location),a=$t(_u),l=JSON.stringify([o.length,r,a==null?void 0:a.place_id]);return E.jsx(IL,{points:o,hideDetails:i,selectedPoint:s,onOpenDetails:t,onPointClick:e,onPointSelected:n},l)},NL=u.memo(jL),BL=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},ce.createElement("rect",{width:2,height:20,x:9,fill:"#fff",rx:1}),ce.createElement("rect",{width:2,height:20,x:20,y:9,fill:"#fff",rx:1,transform:"rotate(90 20 9)"}),ce.createElement("circle",{cx:10,cy:10,r:8,fill:"#fff"}),ce.createElement("circle",{cx:10,cy:10,r:6,fill:"currentcolor"}),ce.createElement("circle",{cx:10,cy:10,r:4,fill:"#fff"})),UL=t=>{const e=document.createElement("div"),n=document.createElement("div");e.classList.add(Xe.mapControl),n.classList.add(Xe.mapControl),e.innerHTML="+",n.innerHTML="—",t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(n),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r+1)}),n.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r-1)})},VL=t=>{const e=document.createElement("div");e.classList.add(Xe.mapControl),e.classList.add(Xe.geolocationControl),e.innerHTML=$i.renderToString(E.jsx(BL,{})),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{Ea(async n=>{var a;const{latitude:r,longitude:i}=n.coords,s=await ur([r,i]);$t.getState().setPlace((a=s.results)==null?void 0:a[0])})})},FL=({className:t})=>{const e=en(),n=ye(Cu),r=ye(Th),i=zt(Ca),o=Ze(ko),{hideMapControls:s,hideDetails:a,disableGeolocation:l,onPointClick:c}=st(),f=u.useCallback(g=>{ye.getState().setMap(g),s||(UL(g),l||VL(g))},[l,s]),d=u.useCallback(()=>{ye.getState().setMap(null)},[]),p=u.useCallback(()=>{if(!n)return;const g=n==null?void 0:n.getBounds();g&&zt.getState().loadNext([[g.getSouthWest().lat(),g.getNorthEast().lat()],[g.getSouthWest().lng(),g.getNorthEast().lng()]],e)},[e,n]),v=u.useCallback(async g=>{var S;if(Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(g),!g)return;const h=[g.location.latitude,g.location.longitude],w=await ur(h);$t.getState().setPlace((S=w.results)==null?void 0:S[0])},[]);return E.jsxs("div",{className:be(Xe.mapContainer,t),children:[E.jsxs(_S,{onIdle:p,onLoad:f,onUnmount:d,children:[o&&E.jsx(sL,{hideDetails:a,point:o,onPointClick:c,setOpenDetails:ye.getState().setDetailsOpen,setDeliveryPoint:Ze.getState().setDeliverPoint}),E.jsx(NL,{onPointClick:c,onOpenDetails:ye.getState().setDetailsOpen,onPointSelected:v})]}),(i||r)&&E.jsx(Ma,{className:Xe.overlay,children:E.jsx(ti,{})})]})},zL=u.memo(FL);function Bn(){return Bn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Bn.apply(this,arguments)}const Md=(t,e)=>{const n={};for(const r in t)e.indexOf(r)===-1&&(n[r]=t[r]);return n},Pd=u.createContext(null),Fo=u.createContext(null),kd=t=>e=>u.createElement(Fo.Consumer,null,n=>u.createElement(t,Bn({parent:n},e))),$L=(t=[])=>{const[e,n]=u.useState(!1),r=u.useRef(t),i=(()=>{const s=u.useContext(Pd);if(s===null)throw new Error("Couldn't find Yandex.Maps API in the context. Make sure that hook useYMaps is inside <YMaps /> provider");return s})(),o=i.getApi();return u.useEffect(()=>{i.load().then(()=>Promise.all(r.current.map(i.loadModule))).then(()=>n(!0))},[]),e&&o?o:null},HL=()=>{},GL=["onLoad","onError","modules","apiLoader"];function Aa(t,e=!1,n=[]){return r=>{const{width:i,height:o,modules:s=[],onLoad:a=HL}=r,l=$L(n.concat(s)),c=!e||!!l,f=Md(r,GL);return u.useEffect(()=>l?a(l):void 0,[l]),c?u.createElement(t,Bn({ymaps:l},f)):u.createElement("div",{style:{width:i,height:o}})}}const WL=typeof window<"u",Wc={lang:"ru_RU",load:"",ns:"",mode:"release"},ZL=t=>{const{version:e="2.1",enterprise:n=!1,query:r={lang:"ru_RU",load:"",ns:""},preload:i=!1,children:o}=t,s=u.useRef((a=>{const{query:l=Wc}=a,c=Date.now().toString(32),f=l.ns||"",d="__yandex-maps-api-onload__$$"+c,p="__yandex-maps-api-onerror__$$"+c,v=WL?window:{},g={};let h;const w=()=>f?v[f]:h,S=()=>{delete v[d],delete v[p]};return{load:()=>{if(w())return Promise.resolve(h);if(g[f])return g[f];const y={onload:d,onerror:p,...Wc,...l},b=Object.keys(y).map(L=>`${L}=${y[L]}`).join("&"),O=[`https://${a.enterprise?"enterprise.":""}api-maps.yandex.ru`,a.version,"?"+b].join("/");return g[f]=new Promise((L,m)=>{v[d]=x=>{S(),x.ready(()=>{h=x,L(x)})},v[p]=x=>{S(),m(x)},(x=>new Promise((C,R)=>{const M=document.createElement("script");M.type="text/javascript",M.onload=C,M.onerror=R,M.src=x,M.async=!0,document.head.appendChild(M)}))(O).catch(v[p])}),g[f]},getApi:w,loadModule:y=>new Promise((b,O)=>{h.modules.require(y).done(L=>{L.forEach(m=>{((x,C,R,M=!1)=>{const _=typeof C=="string"?C.split("."):C.slice();let P,j=x;for(;_.length>1;)P=_.shift(),j[P]||(j[P]={}),j=j[P];const V=_[0];j[V]=M===!0&&j[V]||R})(h,y,m,!0)}),b(h)},O)})}})({version:e,enterprise:n,query:r,preload:i}));return u.useEffect(()=>{i&&s.current.load()},[s.current]),u.createElement(Pd.Provider,{value:s.current},o)},Zc=/^on(?=[A-Z])/;function Ve(t){return Object.keys(t).reduce((e,n)=>{if(Zc.test(n)){const r=n.replace(Zc,"").toLowerCase();e._events[r]=t[n]}else e[n]=t[n];return e},{_events:{}})}function Un(t,e,n){typeof n=="function"&&t.events.add(e,n)}function Vn(t,e,n){typeof n=="function"&&t.events.remove(e,n)}function gr(t,e,n){Object.keys(Object.assign({},e,n)).forEach(r=>{e[r]!==n[r]&&(Vn(t,r,e[r]),Un(t,r,n[r]))})}const Rd=t=>"default"+t.charAt(0).toUpperCase()+t.slice(1);function tt(t,e){return t[e]!==void 0||t[Rd(e)]===void 0}function X(t,e,n){return(tt(t,e)?t[e]:t[Rd(e)])||n}function nt(t,e,n=null){if(t!==e){if(t&&("current"in t?t.current=null:typeof t=="function"&&t(null)),!e)return;"current"in e?e.current=n:typeof e=="function"&&e(n)}}function Td(t){const{width:e,height:n,style:r,className:i}=t;return r!==void 0||i!==void 0?Object.assign({},r&&{style:r},i&&{className:i}):{style:{width:e,height:n}}}class qL extends u.Component{constructor(e){super(e),this.state={error:null,errorInfo:null}}componentDidCatch(e,n){const{onError:r=()=>{}}=this.props;r(e),this.setState({error:e,errorInfo:n})}render(){return this.state.error?null:this.props.children}}const Da=t=>({onError:e,...n})=>u.createElement(qL,{onError:e},u.createElement(t,n));class Xr extends u.Component{constructor(){super(),this.instance=null,this.state={instance:null},this._parentElement=null,this._getRef=e=>{this._parentElement=e}}componentDidMount(){this.instance=Xr.mountObject(this._parentElement,this.props.ymaps.Map,this.props),this.setState({instance:this.instance})}componentDidUpdate(e){this.instance!==null&&Xr.updateObject(this.instance,e,this.props)}componentWillUnmount(){Xr.unmountObject(this.instance,this.props)}render(){const e=Td(this.props),n=Ve(this.props),r=Md(n,["_events","state","defaultState","options","defaultOptions","instanceRef","ymaps","children","width","height","style","className"]);return u.createElement(Fo.Provider,{value:this.state.instance},u.createElement("div",Bn({ref:this._getRef},e,r),this.props.children))}static mountObject(e,n,r){const{instanceRef:i,_events:o}=Ve(r),s=new n(e,X(r,"state"),X(r,"options"));return Object.keys(o).forEach(a=>Un(s,a,o[a])),nt(null,i,s),s}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"state")){const l=X(n,"state",{}),c=X(r,"state",{});l.type!==c.type&&e.setType(c.type),l.behaviors!==c.behaviors&&(l.behaviors&&e.behaviors.disable(l.behaviors),c.behaviors&&e.behaviors.enable(c.behaviors)),c.zoom&&l.zoom!==c.zoom&&e.setZoom(c.zoom),c.center&&l.center!==c.center&&e.setCenter(c.center),c.bounds&&l.bounds!==c.bounds&&e.setBounds(c.bounds)}if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options",{});l!==c&&e.options.set(c)}X(n,"width")===X(r,"width")&&X(n,"height")===X(r,"height")||e.container.fitToViewport(),gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,_events:i}=Ve(n);e!==null&&(Object.keys(i).forEach(o=>Vn(e,o,i[o])),e.destroy(),nt(r))}}const Ad=Da(Aa(Xr,!0,["Map"]));Ad.defaultProps={width:320,height:240};class no extends u.Component{constructor(){super(),this.state={instance:null},this._parentElement=null,this._getRef=e=>{this._parentElement=e}}componentDidMount(){this._mounted=!0,this.props.ymaps.panorama.isSupported()&&no.mountObject(this._parentElement,this.props.ymaps.panorama,this.props).then(e=>this._mounted&&this.setState({instance:e}))}componentDidUpdate(e){this.state.instance!==null&&no.updateObject(this.state.instance,e,this.props)}componentWillUnmount(){this._mounted=!1,no.unmountObject(this.state.instance,this.props)}render(){const e=Td(this.props);return u.createElement("div",Bn({ref:this._getRef},e))}static mountObject(e,n,r){const{instanceRef:i,_events:o}=Ve(r),s=X(r,"point"),a=X(r,"locateOptions"),l=X(r,"options");return new Promise((c,f)=>{n.locate(s,a).done(d=>{if(d.length>0){const p=new n.Player(e,d[0],l);nt(null,i,p),Object.keys(o).forEach(v=>Un(p,v,o[v])),c(p)}},f)})}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}if(tt(r,"point")){const l=X(r,"point"),c=X(n,"point"),f=X(r,"locateOptions");l!==c&&e.moveTo(l,f)}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,_events:i}=Ve(n);e!==null&&(Object.keys(i).forEach(o=>Vn(e,o,i[o])),nt(r))}}class ro extends u.Component{constructor(){super(),this.state={instance:null},this.instance=null}componentDidMount(){const e=ro.mountControl(this.props.ymaps.control[this.props.name],this.props);this.instance=e,this.setState({instance:e})}componentDidUpdate(e){this.instance!==null&&ro.updateControl(this.instance,e,this.props)}componentWillUnmount(){ro.unmountControl(this.instance,this.props)}render(){return u.createElement(Fo.Provider,{value:this.state.instance},this.props.children)}static mountControl(e,n){const{instanceRef:r,parent:i,lazy:o,_events:s}=Ve(n),a=new e({data:X(n,"data"),options:X(n,"options"),state:X(n,"state"),mapTypes:X(n,"mapTypes"),lazy:o});if(Object.keys(s).forEach(l=>Un(a,l,s[l])),i&&i.controls&&typeof i.controls.add=="function")i.controls.add(a);else{if(!i||!i.add||typeof i.add!="function")throw new Error(`No parent found to mount ${n.name}`);i.add(a)}return nt(null,r,a),a}static updateControl(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}if(tt(r,"data")){const l=X(n,"data"),c=X(r,"data");l!==c&&e.data.set(c)}if(tt(r,"state")){const l=X(n,"state"),c=X(r,"state");l!==c&&e.state.set(c)}if(tt(r,"mapTypes")){const l=X(n,"mapTypes"),c=X(r,"mapTypes");l!==c&&(e.removeAllMapTypes(),c.forEach(f=>e.addMapType(f)))}gr(e,s,i),nt(a,o,e)}static unmountControl(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.controls&&typeof i.controls.remove=="function"?i.controls.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}class io extends u.Component{constructor(){super(),this.state={instance:null},this.instance=null}componentDidMount(){const e=io.mountObject(this.props.ymaps.Clusterer,this.props);this.instance=e,this.setState({instance:e})}componentDidUpdate(e){this.state.instance!==null&&io.updateObject(this.instance,e,this.props)}componentWillUnmount(){io.unmountObject(this.instance,this.props)}render(){return u.createElement(Fo.Provider,{value:this.state.instance},this.props.children)}static mountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n),s=new e(X(n,"options"));if(Object.keys(o).forEach(a=>Un(s,a,o[a])),i.geoObjects&&typeof i.geoObjects.add=="function")i.geoObjects.add(s);else{if(!i.add||typeof i.add!="function")throw new Error("No parent found to mount Clusterer");i.add(s)}return nt(null,r,s),s}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.geoObjects&&typeof i.geoObjects.remove=="function"?i.geoObjects.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}class Qr extends u.Component{constructor(){super(),this.state={instance:null}}componentDidMount(){const e=Qr.mountObject(this.props.ymaps.ObjectManager,this.props);this.instance=e,this.setState({instance:e})}componentDidUpdate(e){this.instance!==null&&Qr.updateObject(this.instance,e,this.props)}componentWillUnmount(){Qr.unmountObject(this.instance,this.props)}render(){return null}static mountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n),s=X(n,"options",{}),a=X(n,"features",{}),l=X(n,"filter",null),c=X(n,"objects",{}),f=X(n,"clusters",{}),d=new e(s);if(d.add(a||[]),d.setFilter(l),d.objects.options.set(c),d.clusters.options.set(f),Object.keys(o).forEach(p=>Un(d,p,o[p])),i.geoObjects&&typeof i.geoObjects.add=="function")i.geoObjects.add(d);else{if(!i.add||typeof i.add!="function")throw new Error("No parent found to mount ObjectManager");i.add(d)}return nt(null,r,d),d}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}if(tt(r,"objects")){const l=X(n,"objects"),c=X(r,"objects");l!==c&&e.objects.options.set(c)}if(tt(r,"clusters")){const l=X(n,"clusters"),c=X(r,"clusters");l!==c&&e.clusters.options.set(c)}if(tt(r,"filter")){const l=X(n,"filter"),c=X(r,"filter");l!==c&&e.setFilter(c)}if(tt(r,"features")){const l=X(n,"features"),c=X(r,"features");l!==c&&(e.remove(l),e.add(c))}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.geoObjects&&typeof i.geoObjects.remove=="function"?i.geoObjects.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}var KL=Da(kd(Aa(Qr,!0,["ObjectManager"])));class ei extends u.Component{constructor(){super(),this.state={instance:null},this.instance=null}componentDidMount(){const{name:e,ymaps:n,dangerZone:r}=this.props,i=ei.mountObject(r&&typeof r.modifyConstructor=="function"?r.modifyConstructor(n[e]):n[e],this.props);this.instance=i,this.setState({instance:i})}componentDidUpdate(e){this.instance!==null&&ei.updateObject(this.instance,e,this.props)}componentWillUnmount(){ei.unmountObject(this.instance,this.props)}render(){return null}static mountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n),s=new e(X(n,"geometry"),X(n,"properties"),X(n,"options"));if(Object.keys(o).forEach(a=>Un(s,a,o[a])),i&&i.geoObjects&&typeof i.geoObjects.add=="function")i.geoObjects.add(s);else{if(!i||!i.add||typeof i.add!="function")throw new Error(`No parent found to mount ${n.name}`);i.add(s)}return nt(null,r,s),s}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"geometry")){const l=X(n,"geometry",{}),c=X(r,"geometry",{});Array.isArray(c)&&c!==l?Array.isArray(c[0])&&typeof c[1]=="number"?(e.geometry.setCoordinates(c[0]),e.geometry.setRadius(c[1])):e.geometry.setCoordinates(c):typeof c=="object"&&(c.coordinates!==l.coordinates&&e.geometry.setCoordinates(c.coordinates),c.radius!==l.radius&&e.geometry.setRadius(c.radius))}if(tt(r,"properties")){const l=X(n,"properties"),c=X(r,"properties");l!==c&&e.properties.set(c)}if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.geoObjects&&typeof i.geoObjects.remove=="function"?i.geoObjects.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}var qc=Da(kd(Aa(t=>u.createElement(ei,Bn({},t,{name:"Placemark"})),!0,["Placemark"])));const Kc=(t,e,n)=>t==null?void 0:t.map(r=>{var i;return{id:r.uid,type:"Feature",properties:{point:r},geometry:{type:"Point",coordinates:[r.location.latitude,r.location.longitude]},options:{hideIconOnBalloonOpen:!1,preset:oo(r.type),balloonOffset:[0,-Yn[1]],balloonContentLayout:(i=e==null?void 0:e.templateLayoutFactory)==null?void 0:i.createClass(n)}}}),oo=(t,e)=>t===30?`custom#pin-locker${e?`__${e}`:""}`:`custom#pin-pvz${e?`__${e}`:""}`,Ur=t=>[-(t[0]/2),-t[1]],JL={en:"en_US",ru:"ru_RU"},YL={load:"suggest",apikey:"5298a725-4baa-457a-a2a7-c3abac81db20"},XL=["templateLayoutFactory","option.presetStorage","geocode"],QL=["objectManager.addon.objectsBalloon"],Jc=["geoObject.addon.balloon"],eE={yandexMapDisablePoiInteractivity:!1},tE={clusterize:!0},Yc={iconImageSize:Xt,iconLayout:"default#image",hideIconOnBalloonOpen:!1,balloonOffset:[0,-Xt[1]],iconImageOffset:Ur(Xt)},nE="MapYandex-module__root__r3kDJ8",rE="MapYandex-module__overlay__f7UGYS",iE="MapYandex-module__details__E3bDvL",ps={root:nE,overlay:rE,details:iE},oE=({className:t})=>{const{t:e}=jt(["courier_balloon","common"]),n=u.useRef(),r=u.useRef(null),{map:i,locale:o,disableDelivery:s,hideDetails:a,hideMapUI:l,onPointClick:c}=st(),[f,d]=u.useState(null),[p,v]=u.useState([]),[g,h]=u.useState(tE),w=en(),S=zt(Jf),y=zt(Ca),b=Ze(ko),O=bt(T=>T.location),L=u.useRef([]),m=u.useMemo(()=>$i.renderToString(E.jsx(Od,{SSR:!0,hideDetails:a})).replace("{ choose }",e("choose")).replace("{ details }",e("details")),[e,o,a]),x=u.useMemo(()=>$i.renderToString(E.jsx(na,{SSR:!0,variant:"default",hideDetails:a})).replace("{ details }",e("details",{ns:"common"})).replace("{ courier_balloon.title }",e("title")),[e,o,a]),C=u.useMemo(()=>$i.renderToString(E.jsx(na,{SSR:!0,variant:"error",hideDetails:a})).replace("{ courier_balloon.error_title }",e("error_title")).replace("{ courier_balloon.error_description }",e("error_description")),[e,o,a]),R=u.useMemo(()=>({zoom:(i==null?void 0:i.initialZoom)??oa,center:(i==null?void 0:i.center)??co,behaviors:["default","scrollZoom"]}),[i==null?void 0:i.center,i==null?void 0:i.initialZoom]);u.useEffect(()=>{var T,N;(N=n.current)==null||N.events.fire("boundschange",{newBounds:(T=n.current)==null?void 0:T.getBounds()})},[f]),u.useEffect(()=>{var N;if(!f||!r.current)return;for(const U of L.current)U.id!==(O==null?void 0:O.uid)&&((N=r.current)==null||N.remove(U));const T=Kc(S,f,m);L.current=T,r.current.add(T)},[m,f,S,O==null?void 0:O.uid]);const M=u.useCallback(T=>{const N=T.get("newBounds");zt.getState().loadNext([[N[0][0],N[1][0]],[N[0][1],N[1][1]]],w)},[w]),_=u.useRef(O),P=u.useCallback(T=>{var N,U,Z,I;d(T),ye.getState().setLoaded(),(N=T==null?void 0:T.option)==null||N.presetStorage.add("custom#pin-locker",{iconImageSize:Xt,iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinLocker,"--owl-color-primary")),iconImageOffset:Ur(Xt)}),(U=T==null?void 0:T.option)==null||U.presetStorage.add("custom#pin-locker__active",{iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinLocker,"--owl-color-success")),iconImageSize:Yn,iconImageOffset:Ur(Yn)}),(Z=T==null?void 0:T.option)==null||Z.presetStorage.add("custom#pin-pvz",{iconImageSize:Xt,iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinPvz,"--owl-color-grey-80")),iconImageOffset:Ur(Xt)}),(I=T==null?void 0:T.option)==null||I.presetStorage.add("custom#pin-pvz__active",{iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinPvz,"--owl-color-black")),iconImageSize:Yn,iconImageOffset:Ur(Yn)}),h(K=>({...K,clusterIconColor:xa("--owl-color-primary")})),v(Kc(S,T,m))},[m,S]),j=u.useCallback(()=>{ye.getState().setDetailsOpen(!0)},[]),V=u.useCallback(()=>{var T;_.current&&(c==null||c(_.current),ye.getState().setDetailsOpen(!1),bt.getState().setSelectedLocation(null),Ze.getState().setDeliverPoint(null),(T=n.current)==null||T.balloon.close())},[c]),$=u.useCallback(()=>{var T,N;(T=document.getElementById(lo))==null||T.addEventListener("click",j),(N=document.getElementById(Cs))==null||N.addEventListener("click",V)},[V,j]),G=u.useCallback(T=>{var U,Z,I,K,ee,q;const N=T.get("objectId");((U=_.current)==null?void 0:U.uid)===N&&((K=r.current)==null||K.objects.setObjectOptions((Z=_.current)==null?void 0:Z.uid,{preset:oo((I=_.current)==null?void 0:I.type)}),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null),Ze.getState().setDeliverPoint(null),_.current=null),(ee=document.getElementById(lo))==null||ee.removeEventListener("click",j),(q=document.getElementById(Cs))==null||q.removeEventListener("click",V)},[V,j]),z=u.useCallback(T=>{var I,K,ee,q;const N=T.get("objectId"),U=(K=(I=r.current)==null?void 0:I.objects)==null?void 0:K.getById(N);if(!U)return;const Z=U.properties.point;ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(Z),(ee=r.current)==null||ee.objects.each(se=>{var ue;const de=se;(ue=r.current)==null||ue.objects.setObjectOptions(de.id,{preset:oo(de.properties.point.type)})}),(q=r.current)==null||q.objects.setObjectOptions(N,{preset:oo(Z.type,"active")}),_.current=Z},[]),W=u.useCallback(async T=>{if(!f||s)return;const N=T.get("coords"),{geoObjects:U}=await f.geocode(N),Z=U.get(0),I=Z.getAddressLine(),K=Z.properties.get("metaDataProperty.GeocoderMetaData.precision",{});if(bt.getState().setSelectedLocation(null),K!=="exact"){Ze.getState().setDeliverPoint({coords:N,address:null});return}Ze.getState().setDeliverPoint({coords:N,address:I})},[s,f]),D=u.useMemo(()=>{var T;return{...Yc,iconImageHref:Jt(xt(Rt.PinHome,"--owl-color-success")),balloonContentLayout:(T=f==null?void 0:f.templateLayoutFactory)==null?void 0:T.createClass(x)}},[x,f==null?void 0:f.templateLayoutFactory]),k=u.useMemo(()=>{var T;return{...Yc,iconImageHref:Jt(xt(Rt.PinHome,"--owl-color-success")),balloonContentLayout:(T=f==null?void 0:f.templateLayoutFactory)==null?void 0:T.createClass(C)}},[C,f==null?void 0:f.templateLayoutFactory]),A=u.useCallback(T=>{var N,U,Z,I,K;(N=T==null?void 0:T.balloon)==null||N.open(),(Z=(U=T==null?void 0:T.balloon)==null?void 0:U.events)==null||Z.add("open",$),(K=(I=T==null?void 0:T.balloon)==null?void 0:I.events)==null||K.add("close",G)},[G,$]);return E.jsxs("div",{className:be(ps.root,t,{[ps.hideUI]:l}),children:[E.jsx(ZL,{query:{...YL,lang:JL[o??"ru"]},children:E.jsxs(Ad,{width:"100%",height:"100%",state:R,instanceRef:n,options:eE,modules:XL,onLoad:P,onClick:W,onBoundsChange:M,children:[(b==null?void 0:b.address)&&E.jsx(qc,{properties:b,modules:Jc,geometry:b.coords,options:D,instanceRef:A},JSON.stringify(b.coords)),b&&!b.address&&E.jsx(qc,{modules:Jc,geometry:b.coords,instanceRef:A,options:k},JSON.stringify(b.coords)),E.jsx(KL,{features:p,instanceRef:r,modules:QL,options:g,onClick:z,onBalloonOpen:$,onBalloonClose:G})]})},o),y&&E.jsx(Ma,{className:ps.overlay,children:E.jsx(ti,{})})]})},sE=u.memo(oE),aE=t=>({google:zL,yandex:sE})[t];function Dd(...t){return u.useCallback(e=>{for(const n of t)typeof n=="function"?n(e):n&&typeof n=="object"&&(n.current=e)},t)}const _o=t=>{const e=u.useCallback(()=>{var n;(n=t==null?void 0:t.onClick)==null||n.call(t,t.name)},[t]);return{ref:t==null?void 0:t.ref,name:t==null?void 0:t.name,onClick:e}},lE=()=>{throw new Error("useMediaQuery is a client-only hook")};function cE(t){const e=u.useCallback(r=>{const i=window.matchMedia(t);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),n=()=>window.matchMedia(t).matches;return u.useSyncExternalStore(e,n,lE)}const uE="768px",fE="1024px",dE="1280px",pE="1536px",hE={screenSm:uE,screenMd:fE,screenLg:dE,screenXl:pE};function pi(t){return cE(`(max-width: calc(${hE[t]} - 1px))`)}const gE=(t,e,n)=>{const{disableGeolocation:r}=n??{},i=ye(Cu);u.useEffect(()=>{i&&ye.getState().setLoaded()},[i]);const o=t[0],s=t[1];u.useEffect(()=>{if(!i)return;const a=[o,s],l=async()=>{var f;const c=await ur(a,"GEOMETRIC_CENTER");$t.getState().setPlace((f=c.results)==null?void 0:f[0],oa)};if(r){l();return}Ea(async c=>{var v;const{latitude:f,longitude:d}=c.coords,p=await ur([f,d],"GEOMETRIC_CENTER");$t.getState().setPlace((v=p.results)==null?void 0:v[0])},()=>l())},[o,s,i,e,r])},vE=t=>{const e=Zp(["language"]);u.useEffect(()=>{t&&(e.changeLanguage(t),xo.setLanguage(t))},[t,e])},mE=t=>{u.useEffect(()=>{if(t){const e=Object.keys(t);for(const n of e){const r=t[n];r&&Vo(`--owl-color-${n}`,r)}}},[t])},yE=t=>{u.useEffect(()=>{t&&t!==void 0&&Vo("--owl-button-radius",`${t}px`)},[t])},bE=t=>{u.useEffect(()=>{t&&t!==void 0&&Vo("--owl-font",t)},[t])},wE=t=>{const e=t==="selector";u.useEffect(()=>{e&&kn.getState().toggle(!0)},[e])},SE="Separator-module__root__buxoVg",LE={root:SE},hs=({className:t,...e})=>E.jsx("hr",{className:be(LE.root,t),...e}),EE="Sidebar-module__root__hxXudu",xE="Sidebar-module__closeButton__8k-Ph3",CE="Sidebar-module__open__qMGUBV",_E="Sidebar-module__header__Eu-wRc",OE="Sidebar-module__typeFilter__-lxVdY",ME="Sidebar-module__separator__XDb6rs",PE="Sidebar-module__withRightPadding__knvmuY",kE="Sidebar-module__sheetContent__4iWeTf",RE="Sidebar-module__doneButton__chvXVP",Yt={root:EE,closeButton:xE,open:CE,header:_E,typeFilter:OE,separator:ME,withRightPadding:PE,sheetContent:kE,doneButton:RE},TE=()=>{const{t}=jt("common"),e=pi("screenSm"),n=or(i=>i.toggle),r=()=>{n(!1)};return E.jsxs("div",{className:Yt.header,children:[e&&E.jsx("div",{className:Yt.doneButton,onClick:r,children:t("done")}),!e&&E.jsx(di,{className:Yt.closeButton,onClick:r})]})},AE="TypeFilter-module__root__FEaBBU",DE="TypeFilter-module__button__RYOzBQ",Vi={root:AE,button:DE},IE=({value:t,onChange:e,className:n})=>{const{t:r}=jt("type_filter"),i=o=>()=>e==null?void 0:e(o);return E.jsxs("div",{className:be(Vi.root,n),children:[E.jsx(_t,{className:Vi.button,variant:t===Kt.All?"primary":"secondary",onClick:i(Kt.All),children:r("all")}),E.jsx(_t,{className:Vi.button,variant:t===Kt.PostOffice?"primary":"secondary",onClick:i(Kt.PostOffice),children:r("post_office")}),E.jsx(_t,{className:Vi.button,variant:t===Kt.PickPoint?"primary":"secondary",onClick:i(Kt.PickPoint),children:r("pick_point")})]})},jE=({className:t,onChange:e})=>{const n=en(Eb);return E.jsx(IE,{value:n,className:t,onChange:e})},NE=u.memo(jE),BE="Radio-module__root__FMbfCi",UE="Radio-module__label__-LLJSR",Xc={root:BE,label:UE},VE=({label:t,className:e,labelProps:n={},...r})=>{const{className:i,...o}=n;return E.jsxs("label",{className:be(Xc.label,i),...o,children:[E.jsx("input",{type:"radio",className:be(Xc.root,e),...r}),t]})},rr=t=>E.jsx(VE,{...t,type:"checkbox"}),FE="RadioGroup-module__root__wNjmrq",zE="RadioGroup-module__body__n4Ho0-",$E="RadioGroup-module__legend__ECksBN",gs={root:FE,body:zE,legend:$E},Id=({label:t,value:e,onChange:n,children:r,className:i,...o})=>E.jsxs("div",{className:be(gs.root,i),...o,children:[t&&E.jsx("span",{className:gs.legend,children:t}),E.jsx("div",{className:gs.body,children:u.Children.map(r,s=>u.isValidElement(s)?u.cloneElement(s,{checked:!!(e!=null&&e[s.props.value]),onChange:a=>n==null?void 0:n({...e,[a.target.value]:a.target.checked})}):null)})]}),HE=({className:t,onChange:e})=>{const{t:n}=jt("send_filter"),r=en(xb);return E.jsxs(Id,{className:t,value:r,label:n("title"),onChange:e,children:[E.jsx(rr,{name:"send",value:It.Return,label:n("sending_returns")}),E.jsx(rr,{name:"send",value:It.Shipping,label:n("shipping")}),E.jsx(rr,{name:"send",value:It.Payment,label:n("payment")})]})},GE=u.memo(HE),WE=({className:t,onChange:e})=>{const{t:n}=jt("receive_filter"),r=en(Cb);return E.jsxs(Id,{value:r,label:n("title"),onChange:e,className:t,children:[E.jsx(rr,{name:"receive",value:Dt.DressingRoom,label:n("dressing_room")}),E.jsx(rr,{name:"receive",value:Dt.CheckOrder,label:n("check_order")}),E.jsx(rr,{name:"receive",value:Dt.PayByCash,label:n("pay_by_cash")})]})},ZE=u.memo(WE);const qE=({className:t})=>{const e=pi("screenSm"),n=or(l=>l.open),r=u.useCallback(l=>en.getState().setFilter({type:l}),[]),i=u.useCallback(l=>en.getState().setFilter({send:l}),[]),o=u.useCallback(l=>en.getState().setFilter({receive:l}),[]),s=u.useCallback(()=>or.getState().toggle(!1),[]),a=E.jsxs(E.Fragment,{children:[E.jsx(TE,{}),E.jsxs("div",{className:Yt.withRightPadding,children:[E.jsx(NE,{className:Yt.typeFilter,onChange:r}),E.jsx(hs,{className:Yt.separator}),E.jsx(ZE,{onChange:o}),E.jsx(hs,{}),E.jsx(GE,{onChange:i}),E.jsx(hs,{})]})]});return e?E.jsx(Cf,{initialFocusRef:!1,open:n,snapPoints:({maxHeight:l})=>l-yd,onDismiss:s,children:E.jsx("div",{className:Yt.sheetContent,children:a})}):E.jsx("div",{className:be(Yt.root,t,{[Yt.open]:n}),children:a})},KE=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:60,height:40,fill:"none",viewBox:"0 0 60 40",...t},ce.createElement("path",{d:"M0 0h52a8 8 0 0 1 8 8v24a8 8 0 0 1-8 8H0V0Z"}),ce.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.5,d:"M32.093 10h13.814c1.151 0 2.093.91 2.093 2.02v2.223c0 .808-.523 1.818-1.047 2.324l-4.5 3.839c-.627.505-1.046 1.515-1.046 2.323v4.344c0 .607-.419 1.415-.942 1.718L39 29.7c-1.36.808-3.244-.101-3.244-1.717v-5.355c0-.707-.419-1.616-.837-2.121l-3.977-4.041c-.523-.506-.942-1.415-.942-2.02V12.12c0-1.21.942-2.12 2.093-2.12Z"})),JE=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",viewBox:"0 0 28 28",...t},ce.createElement("rect",{width:28,height:28,fill:"#333",rx:4}),ce.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.165 7h9.67c.806 0 1.465.636 1.465 1.414V9.97c0 .566-.366 1.273-.733 1.627l-3.15 2.687c-.44.353-.732 1.06-.732 1.627v3.04c0 .425-.293.99-.66 1.203L14 20.79c-.952.566-2.271-.07-2.271-1.202V15.84c0-.495-.293-1.132-.586-1.485l-2.784-2.83c-.366-.353-.659-.99-.659-1.413V8.485C7.7 7.636 8.36 7 9.165 7Z"})),YE="MapContainer-module__root__nze9pB",XE="MapContainer-module__mapWrapper__twRo4C",QE="MapContainer-module__wrapperBlurred__U-Ohae",e1="MapContainer-module__locationSelector__lEiSKq",t1="MapContainer-module__filterButton__jIRGu9",n1="MapContainer-module__sidebarOpen__sUhaH-",r1="MapContainer-module__filterIcon__-2Qd2d",i1="MapContainer-module__details__sAP6T2",Ft={root:YE,mapWrapper:XE,wrapperBlurred:QE,locationSelector:e1,filterButton:t1,sidebarOpen:n1,filterIcon:r1,details:i1},o1=()=>{const t=or(i=>i.open),e=or(i=>i.toggle),n=pi("screenSm"),r=()=>{e(!0)};return E.jsxs("div",{className:be(Ft.filterButton,{[Ft.sidebarOpen]:t}),onClick:n?void 0:r,children:[n&&E.jsx(Ou,{}),n?E.jsx(JE,{className:Ft.filterIcon,onClick:r}):E.jsx(KE,{className:Ft.filterIcon})]})};var jd={},zo={},Nd={exports:{}},s1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",a1=s1,l1=a1;function Bd(){}function Ud(){}Ud.resetWarningCache=Bd;var c1=function(){function t(r,i,o,s,a,l){if(l!==l1){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Ud,resetWarningCache:Bd};return n.PropTypes=n,n};Nd.exports=c1();var u1=Nd.exports,$o={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.loadGoogleMapScript=fr.isBrowser=void 0;var Vd=typeof window<"u"&&window.document;fr.isBrowser=Vd;var f1=function(e,n){if(!Vd||typeof google<"u"&&google.maps&&google.maps.api)return Promise.resolve();var r=document.querySelectorAll('script[src*="'.concat(e,'"]'));if(r&&r.length)return new Promise(function(s){if(typeof google<"u")return s();r[0].addEventListener("load",function(){return s()})});var i=new URL(n);i.searchParams.set("callback","__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__");var o=document.createElement("script");return o.src=i.toString(),new Promise(function(s){window.__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__=s,document.body.appendChild(o)})};fr.loadGoogleMapScript=f1;var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.GOOGLE_MAP_SCRIPT_BASE_URL=void 0;var d1="https://maps.googleapis.com/maps/api/js";Ho.GOOGLE_MAP_SCRIPT_BASE_URL=d1;function so(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?so=function(n){return typeof n}:so=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},so(t)}Object.defineProperty($o,"__esModule",{value:!0});$o.default=y1;var yt=h1(u),vs=fr,p1=Ho;function Fd(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Fd=function(i){return i?n:e})(t)}function h1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||so(t)!=="object"&&typeof t!="function")return{default:t};var n=Fd(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function Qc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function eu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Qc(Object(n),!0).forEach(function(r){g1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qc(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function g1(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v1(t,e){if(t==null)return{};var n=m1(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function m1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function y1(t){var e=t.ref,n=t.onPlaceSelected,r=t.apiKey,i=t.libraries,o=i===void 0?"places":i,s=t.inputAutocompleteValue,a=s===void 0?"new-password":s,l=t.options;l=l===void 0?{}:l;var c=l.types,f=c===void 0?["(cities)"]:c,d=l.componentRestrictions,p=l.fields,v=p===void 0?["address_components","geometry.location","place_id","formatted_address"]:p,g=l.bounds,h=v1(l,["types","componentRestrictions","fields","bounds"]),w=t.googleMapsScriptBaseUrl,S=w===void 0?p1.GOOGLE_MAP_SCRIPT_BASE_URL:w,y=t.language,b=(0,yt.useRef)(null),O=(0,yt.useRef)(null),L=(0,yt.useRef)(null),m=(0,yt.useRef)(null),x=y?"&language=".concat(y):"",C="".concat(S,"?libraries=").concat(o,"&key=").concat(r).concat(x),R=(0,yt.useCallback)(function(){return(0,vs.loadGoogleMapScript)(S,C)},[S,C]);return(0,yt.useEffect)(function(){var M=eu(eu({},h),{},{fields:v,types:f,bounds:g});if(d&&(M.componentRestrictions=d),!(L.current||!b.current||!vs.isBrowser)){e&&!e.current&&(e.current=b.current);var _=function(){var j;if(typeof google>"u")return console.error("Google has not been found. Make sure your provide apiKey prop.");if(!((j=google.maps)!==null&&j!==void 0&&j.places))return console.error("Google maps places API must be loaded.");if(!b.current instanceof HTMLInputElement)return console.error("Input ref must be HTMLInputElement.");L.current=new google.maps.places.Autocomplete(b.current,M),L.current&&(O.current=L.current.addListener("place_changed",function(){n&&L&&L.current&&n(L.current.getPlace(),b.current,L.current)}))};return r?R().then(function(){return _()}):_(),function(){return O.current?O.current.remove():void 0}}},[]),(0,yt.useEffect)(function(){var M;!(yt.default!==null&&yt.default!==void 0&&(M=yt.default.version)!==null&&M!==void 0&&M.startsWith("18"))&&vs.isBrowser&&window.MutationObserver&&b.current&&b.current instanceof HTMLInputElement&&(m.current=new MutationObserver(function(){m.current.disconnect(),b.current&&(b.current.autocomplete=a)}),m.current.observe(b.current,{attributes:!0,attributeFilter:["autocomplete"]}))},[a]),(0,yt.useEffect)(function(){L.current&&L.current.setFields(v)},[v]),(0,yt.useEffect)(function(){L.current&&L.current.setBounds(g)},[g]),(0,yt.useEffect)(function(){L.current&&L.current.setComponentRestrictions(d)},[d]),(0,yt.useEffect)(function(){L.current&&L.current.setOptions(h)},[h]),{ref:b,autocompleteRef:L}}function ao(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ao=function(n){return typeof n}:ao=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ao(t)}Object.defineProperty(zo,"__esModule",{value:!0});zo.default=void 0;var ra=w1(u),We=zd(u1),b1=zd($o);function zd(t){return t&&t.__esModule?t:{default:t}}function $d(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return($d=function(i){return i?n:e})(t)}function w1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||ao(t)!=="object"&&typeof t!="function")return{default:t};var n=$d(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function Oo(){return Oo=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Oo.apply(this,arguments)}function S1(t,e){if(t==null)return{};var n=L1(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function L1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Hd(t){var e=t.onPlaceSelected,n=t.apiKey,r=t.libraries,i=t.inputAutocompleteValue,o=t.options,s=t.googleMapsScriptBaseUrl,a=t.refProp,l=t.language,c=S1(t,["onPlaceSelected","apiKey","libraries","inputAutocompleteValue","options","googleMapsScriptBaseUrl","refProp","language"]),f=(0,b1.default)({ref:a,googleMapsScriptBaseUrl:s,onPlaceSelected:e,apiKey:n,libraries:r,inputAutocompleteValue:i,options:o,language:l}),d=f.ref;return ra.default.createElement("input",Oo({ref:d},c))}Hd.propTypes={apiKey:We.default.string,libraries:We.default.arrayOf(We.default.string),ref:We.default.oneOfType([We.default.func,We.default.shape({current:We.default.any})]),googleMapsScriptBaseUrl:We.default.string,onPlaceSelected:We.default.func,inputAutocompleteValue:We.default.string,options:We.default.shape({componentRestrictions:We.default.object,bounds:We.default.object,location:We.default.object,offset:We.default.number,origin:We.default.object,radius:We.default.number,sessionToken:We.default.object,types:We.default.arrayOf(We.default.string)}),language:We.default.string};var E1=(0,ra.forwardRef)(function(t,e){return ra.default.createElement(Hd,Oo({},t,{refProp:e}))});zo.default=E1;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"usePlacesWidget",{enumerable:!0,get:function(){return n.default}});var e=r(zo),n=r($o);function r(i){return i&&i.__esModule?i:{default:i}}})(jd);var Gd=jd;const x1=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},ce.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M14.617 16.032a9 9 0 1 1 1.414-1.414l3.676 3.675a1 1 0 0 1-1.414 1.414l-3.676-3.675ZM2 9a7 7 0 1 1 12.04 4.858 1.005 1.005 0 0 0-.182.182A7 7 0 0 1 2 9Z",clipRule:"evenodd"})),C1="Input-module__root__4cwtKq",_1="Input-module__endAdornment__Tv4vyT",O1="Input-module__input__qeMAQB",M1="Input-module__startAdornment__4bXzn1",P1="Input-module__label__N2eUZ2",k1="Input-module__inputContainer__Ticemx",Kn={root:C1,endAdornment:_1,input:O1,startAdornment:M1,label:P1,inputContainer:k1},Wd=u.forwardRef(({label:t,className:e,startAdornment:n,endAdornment:r,onChange:i,onBlur:o,inputRef:s,...a},l)=>{const c=u.useRef(null);u.useImperativeHandle(l,()=>({focus:()=>{var d;(d=c.current)==null||d.focus()},blur:()=>{var d;(d=c.current)==null||d.blur()},setValue:d=>{if(i){i({target:{value:d}});return}if(o){o({target:{value:d}});return}c.current&&(c.current.value=d)}}),[o,i]);const f=Dd(s,c);return E.jsxs("label",{className:be(Kn.root,e),children:[t&&E.jsx("span",{className:Kn.label,children:t}),E.jsxs("div",{className:Kn.inputContainer,children:[n&&E.jsx("div",{className:Kn.startAdornment,children:n}),E.jsx("input",{...a,ref:f,className:Kn.input,onChange:i,onBlur:o}),r&&E.jsx("div",{className:Kn.endAdornment,children:r})]})]})}),R1=({className:t})=>{const{t:e}=jt("location_selector"),{country:n,inputs:r,onLocationSelect:i}=st(),[o,s]=u.useState(""),[a,l]=u.useState(!1),c=[],f=n?{componentRestrictions:{country:n},types:c}:{types:c},d=y=>{$t.getState().setPlace(y),i==null||i(y)},{ref:p}=Gd.usePlacesWidget({libraries:["places"],options:f,onPlaceSelected:d,inputAutocompleteValue:o}),v=y=>{a&&ye.getState().setBlurred(!!y.target.value),s(y.target.value)},g=()=>{o&&ye.getState().setBlurred(!0),ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null),l(!0)},h=()=>{ye.getState().setBlurred(!1),l(!1)},w=y=>{y.key==="Enter"&&y.preventDefault()},S=_o(r==null?void 0:r.address);return E.jsx(Wd,{...S,inputRef:p,value:o,className:t,endAdornment:E.jsx(x1,{}),placeholder:e("placeholder"),onChange:v,onFocus:g,onBlur:h,onKeyDown:w})},T1=({className:t})=>ye(Rh)?E.jsx(R1,{className:t}):null,A1=u.memo(T1),D1="DeliveryDetailsModal-module__root__lnsoXP",I1={root:D1},j1=({onClose:t,onSubmit:e,location:n,className:r})=>E.jsx("div",{className:be(I1.root,r),children:E.jsx(Ed,{location:n,onClose:t,onSubmit:e})}),N1="LocationDetailsModal-module__root__AzUydF",B1={root:N1},U1=({onClose:t,onSubmit:e,location:n,className:r})=>{const i=()=>{e==null||e(n)};return E.jsx("div",{className:be(B1.root,r),children:E.jsx(_d,{location:n,onClose:t,onSubmit:i})})},V1=()=>{const{onPointClick:t}=st(),e=ye(sa),n=bt(Qh),r=Ze(ko),i=u.useCallback(()=>{ye.getState().setDetailsOpen(!1)},[]),o=u.useCallback(s=>{t==null||t(s),ye.getState().setDetailsOpen(!1),bt.getState().setSelectedLocation(null),Ze.getState().setDeliverPoint(null)},[t]);return E.jsxs(E.Fragment,{children:[(r==null?void 0:r.address)&&e&&E.jsx(j1,{location:r,className:Ft.details,onClose:i,onSubmit:o}),n&&e&&E.jsx(U1,{location:n,className:Ft.details,onClose:i,onSubmit:o})]})},F1=({className:t,children:e})=>{const{hideFilters:n,hideSearchInput:r}=st(),i=ye(kh),o=ye(sa);return E.jsxs("div",{className:be(Ft.root,t),children:[!r&&!o&&E.jsx(A1,{className:Ft.locationSelector}),!n&&E.jsx(o1,{}),E.jsx("div",{className:be(Ft.mapWrapper,{[Ft.wrapperBlurred]:i}),children:e}),E.jsx(V1,{})]})},z1=u.memo(F1),$1="Aside-module__root__JSqCyF",H1="Aside-module__open__t8OMLZ",G1="Aside-module__overlay__0UAvMb",W1="Aside-module__container__KJNP0t",Fi={root:$1,open:H1,overlay:G1,container:W1},Z1=({open:t,children:e,className:n})=>E.jsxs("div",{className:be(Fi.root,n,{[Fi.open]:t}),children:[E.jsx("div",{className:Fi.overlay}),E.jsx("div",{className:Fi.container,children:e})]}),q1="LocationAside-module__submit__hx8LTK",K1="LocationAside-module__container__KEGf9s",J1="LocationAside-module__selector__ogsvtz",Y1="LocationAside-module__label__-FWqoq",X1="LocationAside-module__header__qmaQaV",Q1="LocationAside-module__close__bklFI7",zi={submit:q1,container:K1,selector:J1,label:Y1,header:X1,close:Q1},ex=u.forwardRef((t,e)=>{const{t:n}=jt(["location_aside","common"]),r=kn(tg),{country:i,inputs:o,hideCloseButtonOnLocationScreen:s,onLocationSelect:a,onCloseLocationSelector:l}=st(),c=u.useRef(null),[f,d]=u.useState("");u.useImperativeHandle(e,()=>({open:()=>kn.getState().toggle(!0),close:()=>kn.getState().toggle(!1)}),[]);const p=y=>{kn.getState().toggle(!1),$t.getState().setPlace(y),a==null||a(y),y!=null&&y.formatted_address&&d(y==null?void 0:y.formatted_address)},v=()=>{kn.getState().toggle(!1),l==null||l()},g=i?{componentRestrictions:{country:i}}:void 0,h=y=>{d(y.target.value)},{ref:w}=Gd.usePlacesWidget({libraries:["places"],options:g,onPlaceSelected:p,apiKey:"AIzaSyBEboFjQh8dJQlWwWZy-2Zzmw7Dsr6-NiA",inputAutocompleteValue:f}),S=_o(o==null?void 0:o.city);return E.jsx(Z1,{open:r,children:E.jsx("div",{ref:c,className:zi.container,children:E.jsxs("div",{className:zi.selector,children:[E.jsxs("div",{className:zi.header,children:[E.jsx("div",{className:zi.label,children:n("choose_city")}),!s&&E.jsx(di,{position:"relative",onClick:v})]}),E.jsx(Wd,{...S,inputRef:w,value:f,placeholder:n("placeholder"),onChange:h})]})})})}),tx=u.memo(ex),Ia=()=>E.jsx(Ma,{children:E.jsx(ti,{})}),nx=({children:t})=>{const{locale:e}=st(),n=u.useRef(e),{isLoaded:r}=lw({language:n.current,libraries:nh,googleMapsApiKey:"AIzaSyBEboFjQh8dJQlWwWZy-2Zzmw7Dsr6-NiA"});return r?E.jsx(E.Fragment,{children:t}):E.jsx(Ia,{})},rx=({children:t})=>{const{map:e,disableGeolocation:n}=st();return mn(e==null?void 0:e.center,"Map center is required"),mn(e==null?void 0:e.initialZoom,"Map initial zoom is required"),gE(e.center,e.initialZoom,{disableGeolocation:n}),E.jsx(E.Fragment,{children:t})},ix=({children:t})=>{const{font:e,palette:n,radius:r,locale:i,startScreen:o}=st();return bE(e),vE(i),mE(n),yE(r),wE(o),E.jsx(E.Fragment,{children:t})},ox=({children:t})=>{const e=zt(Sb);return zt(Ca)&&!e?E.jsx(Ia,{}):E.jsx(E.Fragment,{children:t})};xo.setApiKey("AIzaSyBEboFjQh8dJQlWwWZy-2Zzmw7Dsr6-NiA");const sx="App-module__map__rW7rX2",ax="App-module__sidebar__qEl7HV",lx="App-module__header__gAG5Pr",ms={map:sx,sidebar:ax,header:lx},cx=({config:t,options:e})=>{const n=Vb(t),{map:r,hideHeader:i,hideFilters:o,INN:s}=n;mn(s,"INN is required"),Fb(s,e),mn(r==null?void 0:r.provider,"Map provider is required");const a=aE(r.provider);return _b(),E.jsx(zp,{tolgee:Jp,fallback:E.jsx(Ia,{}),children:E.jsx(wu.Provider,{value:n,children:E.jsx(nx,{children:E.jsx(rx,{children:E.jsx(ix,{children:E.jsx(ox,{children:E.jsxs(pg,{children:[!i&&E.jsx(ag,{className:ms.header}),!o&&E.jsx(qE,{className:ms.sidebar}),E.jsx(z1,{className:ms.map,children:E.jsx(a,{})}),E.jsx(tx,{})]})})})})})})})},Zd=async t=>si.request({baseURL:"https://api.geo-data.omnic.solutions/api/1.0/",method:"POST",url:"normalize/address",data:t,headers:{Authorization:"Token 9877f9631b2e30570cc1c5aa8c740b0c912efe99a8b6c45c21cf4bd394adc7e9"}});exports.EReceiveFilter=Dt;exports.ESendFilter=It;exports.ETypeFilter=Kt;exports.Widget=cx;exports.createPointsIterator=Ks;exports.fetchPointsRequest=qs;exports.fromHoursMinutesToMinutes=Jy;exports.fromMinutesToHoursMinutes=Yy;exports.getAddressFromLatLng=ur;exports.getBoundsFromPoint=Xy;exports.getCurrentPosition=Ea;exports.getNormalizedAddress=Zd;exports.getPropertyValue=xa;exports.isDeliveryPoint=bb;exports.isHttpSuccess=Kf;exports.replaceSvgCurrentColor=xt;exports.setWidgetCSSProperty=Vo;exports.stopImmediatePropagation=Js;exports.svgStringToBase64URL=Jt;
|
|
102
|
+
</svg>`,a=`Cluster of ${e} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+e;if(wt.isAdvancedMarkerAvailable(i)){const f=document.createElement("div");f.innerHTML=s;const d=f.firstElementChild;d.setAttribute("transform","translate(0 25)");const p={map:i,position:n,zIndex:l,title:a,content:d};return new google.maps.marker.AdvancedMarkerElement(p)}const c={position:n,zIndex:l,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(c)}}function Ww(t,e){for(let n in e.prototype)t.prototype[n]=e.prototype[n]}class Da{constructor(){Ww(Da,google.maps.OverlayView)}}var Yr;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(Yr||(Yr={}));const Zw=(t,e,n)=>{n.fitBounds(e.bounds)};class qw extends Da{constructor({map:e,markers:n=[],algorithmOptions:r={},algorithm:i=new $w(r),renderer:o=new Gw,onClusterClick:s=Zw}){super(),this.markers=[...n],this.clusters=[],this.algorithm=i,this.renderer=o,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(r=>{this.addMarker(r,!0)}),n||this.render()}removeMarker(e,n){const r=this.markers.indexOf(e);return r===-1?!1:(wt.setMap(e,null),this.markers.splice(r,1),n||this.render(),!0)}removeMarkers(e,n){let r=!1;return e.forEach(i=>{r=this.removeMarker(i,!0)||r}),r&&!n&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,Yr.CLUSTERING_BEGIN,this);const{clusters:n,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const i=new Set;for(const s of n)s.markers.length==1&&i.add(s.markers[0]);const o=[];for(const s of this.clusters)s.marker!=null&&(s.markers.length==1?i.has(s.marker)||wt.setMap(s.marker,null):o.push(s.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>o.forEach(s=>wt.setMap(s,null)))}google.maps.event.trigger(this,Yr.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=>wt.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new Hw(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,n),r.markers.forEach(i=>wt.setMap(i,null)),this.onClusterClick&&r.marker.addListener("click",i=>{google.maps.event.trigger(this,Yr.CLUSTER_CLICK,r),this.onClusterClick(i,r,n)})),wt.setMap(r.marker,n)})}}function Kw(t){var e=tw(),n=u.useState(null),r=n[0],i=n[1];return u.useEffect(function(){if(e&&r===null){var o=new qw(Q(Q({},t),{map:e}));i(o)}},[e]),r}function Jw(t){var e=t.children,n=t.options,r=Kw(n);return r!==null?e(r):null}u.memo(Jw);var mc={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},yc={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}};function Yw(t){var e=t.children,n=t.anchor,r=t.options,i=t.position,o=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,c=t.onPositionChanged,f=t.onZindexChanged,d=t.onLoad,p=t.onUnmount,m=u.useContext(le),g=u.useState(null),h=g[0],S=g[1],w=u.useState(null),y=w[0],b=w[1],_=u.useState(null),E=_[0],v=_[1],L=u.useState(null),C=L[0],k=L[1],M=u.useState(null),O=M[0],P=M[1],j=u.useState(null),U=j[0],$=j[1],G=u.useRef(null);return u.useEffect(function(){h!==null&&(h.close(),n?h.open(m,n):h.getPosition()&&h.open(m))},[m,h,n]),u.useEffect(function(){r&&h!==null&&h.setOptions(r)},[h,r]),u.useEffect(function(){i&&h!==null&&h.setPosition(i)},[i]),u.useEffect(function(){typeof o=="number"&&h!==null&&h.setZIndex(o)},[o]),u.useEffect(function(){h&&s&&(y!==null&&google.maps.event.removeListener(y),b(google.maps.event.addListener(h,"closeclick",s)))},[s]),u.useEffect(function(){h&&a&&(E!==null&&google.maps.event.removeListener(E),v(google.maps.event.addListener(h,"domready",a)))},[a]),u.useEffect(function(){h&&l&&(C!==null&&google.maps.event.removeListener(C),k(google.maps.event.addListener(h,"content_changed",l)))},[l]),u.useEffect(function(){h&&c&&(O!==null&&google.maps.event.removeListener(O),P(google.maps.event.addListener(h,"position_changed",c)))},[c]),u.useEffect(function(){h&&f&&(U!==null&&google.maps.event.removeListener(U),$(google.maps.event.addListener(h,"zindex_changed",f)))},[f]),u.useEffect(function(){var z=new google.maps.InfoWindow(Q({},r||{}));return S(z),G.current=document.createElement("div"),s&&b(google.maps.event.addListener(z,"closeclick",s)),a&&v(google.maps.event.addListener(z,"domready",a)),l&&k(google.maps.event.addListener(z,"content_changed",l)),c&&P(google.maps.event.addListener(z,"position_changed",c)),f&&$(google.maps.event.addListener(z,"zindex_changed",f)),z.setContent(G.current),i&&z.setPosition(i),o&&z.setZIndex(o),n?z.open(m,n):z.getPosition()?z.open(m):qe(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>."),d&&d(z),function(){y&&google.maps.event.removeListener(y),C&&google.maps.event.removeListener(C),E&&google.maps.event.removeListener(E),O&&google.maps.event.removeListener(O),U&&google.maps.event.removeListener(U),p&&p(z),z.close()}},[]),G.current?dr.createPortal(u.Children.only(e),G.current):null}u.memo(Yw);var md=function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoWindow:null},n.open=function(r,i){i?r.open(n.context,i):r.getPosition()?r.open(n.context):qe(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>.")},n.setInfoWindowCallback=function(){n.state.infoWindow!==null&&n.containerElement!==null&&(n.state.infoWindow.setContent(n.containerElement),n.open(n.state.infoWindow,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoWindow))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.InfoWindow(Q({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=fe({updaterMap:yc,eventMap:mc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{infoWindow:n}},this.setInfoWindowCallback)},e.prototype.componentDidUpdate=function(n){this.state.infoWindow!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:yc,eventMap:mc,prevProps:n,nextProps:this.props,instance:this.state.infoWindow}))},e.prototype.componentWillUnmount=function(){this.state.infoWindow!==null&&(ge(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())},e.prototype.render=function(){return this.containerElement?dr.createPortal(u.Children.only(this.props.children),this.containerElement):null},e.contextType=le,e}(u.PureComponent),bc={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},wc={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},Xw={};function Qw(t){var e=t.options,n=t.draggable,r=t.editable,i=t.visible,o=t.path,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,f=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,m=t.onMouseUp,g=t.onRightClick,h=t.onClick,S=t.onDrag,w=t.onLoad,y=t.onUnmount,b=u.useContext(le),_=u.useState(null),E=_[0],v=_[1],L=u.useState(null),C=L[0],k=L[1],M=u.useState(null),O=M[0],P=M[1],j=u.useState(null),U=j[0],$=j[1],G=u.useState(null),z=G[0],W=G[1],D=u.useState(null),R=D[0],A=D[1],T=u.useState(null),N=T[0],V=T[1],Z=u.useState(null),I=Z[0],K=Z[1],ee=u.useState(null),q=ee[0],se=ee[1],de=u.useState(null),ue=de[0],Le=de[1],Fe=u.useState(null),we=Fe[0],Ee=Fe[1],Ie=u.useState(null),Me=Ie[0],Re=Ie[1];return u.useEffect(function(){E!==null&&E.setMap(b)},[b]),u.useEffect(function(){typeof e<"u"&&E!==null&&E.setOptions(e)},[E,e]),u.useEffect(function(){typeof n<"u"&&E!==null&&E.setDraggable(n)},[E,n]),u.useEffect(function(){typeof r<"u"&&E!==null&&E.setEditable(r)},[E,r]),u.useEffect(function(){typeof i<"u"&&E!==null&&E.setVisible(i)},[E,i]),u.useEffect(function(){typeof o<"u"&&E!==null&&E.setPath(o)},[E,o]),u.useEffect(function(){E&&s&&(C!==null&&google.maps.event.removeListener(C),k(google.maps.event.addListener(E,"dblclick",s)))},[s]),u.useEffect(function(){E&&a&&(O!==null&&google.maps.event.removeListener(O),P(google.maps.event.addListener(E,"dragend",a)))},[a]),u.useEffect(function(){E&&l&&(U!==null&&google.maps.event.removeListener(U),$(google.maps.event.addListener(E,"dragstart",l)))},[l]),u.useEffect(function(){E&&c&&(z!==null&&google.maps.event.removeListener(z),W(google.maps.event.addListener(E,"mousedown",c)))},[c]),u.useEffect(function(){E&&f&&(R!==null&&google.maps.event.removeListener(R),A(google.maps.event.addListener(E,"mousemove",f)))},[f]),u.useEffect(function(){E&&d&&(N!==null&&google.maps.event.removeListener(N),V(google.maps.event.addListener(E,"mouseout",d)))},[d]),u.useEffect(function(){E&&p&&(I!==null&&google.maps.event.removeListener(I),K(google.maps.event.addListener(E,"mouseover",p)))},[p]),u.useEffect(function(){E&&m&&(q!==null&&google.maps.event.removeListener(q),se(google.maps.event.addListener(E,"mouseup",m)))},[m]),u.useEffect(function(){E&&g&&(ue!==null&&google.maps.event.removeListener(ue),Le(google.maps.event.addListener(E,"rightclick",g)))},[g]),u.useEffect(function(){E&&h&&(we!==null&&google.maps.event.removeListener(we),Ee(google.maps.event.addListener(E,"click",h)))},[h]),u.useEffect(function(){E&&S&&(Me!==null&&google.maps.event.removeListener(Me),Re(google.maps.event.addListener(E,"drag",S)))},[S]),u.useEffect(function(){var re=new google.maps.Polyline(Q(Q({},e||Xw),{map:b}));return o&&re.setPath(o),typeof i<"u"&&re.setVisible(i),typeof r<"u"&&re.setEditable(r),typeof n<"u"&&re.setDraggable(n),s&&k(google.maps.event.addListener(re,"dblclick",s)),a&&P(google.maps.event.addListener(re,"dragend",a)),l&&$(google.maps.event.addListener(re,"dragstart",l)),c&&W(google.maps.event.addListener(re,"mousedown",c)),f&&A(google.maps.event.addListener(re,"mousemove",f)),d&&V(google.maps.event.addListener(re,"mouseout",d)),p&&K(google.maps.event.addListener(re,"mouseover",p)),m&&se(google.maps.event.addListener(re,"mouseup",m)),g&&Le(google.maps.event.addListener(re,"rightclick",g)),h&&Ee(google.maps.event.addListener(re,"click",h)),S&&Re(google.maps.event.addListener(re,"drag",S)),v(re),w&&w(re),function(){C!==null&&google.maps.event.removeListener(C),O!==null&&google.maps.event.removeListener(O),U!==null&&google.maps.event.removeListener(U),z!==null&&google.maps.event.removeListener(z),R!==null&&google.maps.event.removeListener(R),N!==null&&google.maps.event.removeListener(N),I!==null&&google.maps.event.removeListener(I),q!==null&&google.maps.event.removeListener(q),ue!==null&&google.maps.event.removeListener(ue),we!==null&&google.maps.event.removeListener(we),y&&y(re),re.setMap(null)}},[]),null}u.memo(Qw);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polyline:null},n.setPolylineCallback=function(){n.state.polyline!==null&&n.props.onLoad&&n.props.onLoad(n.state.polyline)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polyline(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:wc,eventMap:bc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polyline:n}},this.setPolylineCallback)},e.prototype.componentDidUpdate=function(n){this.state.polyline!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:wc,eventMap:bc,prevProps:n,nextProps:this.props,instance:this.state.polyline}))},e.prototype.componentWillUnmount=function(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),ge(this.registeredEvents),this.state.polyline.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Sc={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Lc={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}};function eS(t){var e=t.options,n=t.draggable,r=t.editable,i=t.visible,o=t.path,s=t.paths,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,f=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,m=t.onMouseOver,g=t.onMouseUp,h=t.onRightClick,S=t.onClick,w=t.onDrag,y=t.onLoad,b=t.onUnmount,_=u.useContext(le),E=u.useState(null),v=E[0],L=E[1],C=u.useState(null),k=C[0],M=C[1],O=u.useState(null),P=O[0],j=O[1],U=u.useState(null),$=U[0],G=U[1],z=u.useState(null),W=z[0],D=z[1],R=u.useState(null),A=R[0],T=R[1],N=u.useState(null),V=N[0],Z=N[1],I=u.useState(null),K=I[0],ee=I[1],q=u.useState(null),se=q[0],de=q[1],ue=u.useState(null),Le=ue[0],Fe=ue[1],we=u.useState(null),Ee=we[0],Ie=we[1],Me=u.useState(null),Re=Me[0],re=Me[1];return u.useEffect(function(){v!==null&&v.setMap(_)},[_]),u.useEffect(function(){typeof e<"u"&&v!==null&&v.setOptions(e)},[v,e]),u.useEffect(function(){typeof n<"u"&&v!==null&&v.setDraggable(n)},[v,n]),u.useEffect(function(){typeof r<"u"&&v!==null&&v.setEditable(r)},[v,r]),u.useEffect(function(){typeof i<"u"&&v!==null&&v.setVisible(i)},[v,i]),u.useEffect(function(){typeof o<"u"&&v!==null&&v.setPath(o)},[v,o]),u.useEffect(function(){typeof s<"u"&&v!==null&&v.setPaths(s)},[v,s]),u.useEffect(function(){v&&a&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(v,"dblclick",a)))},[a]),u.useEffect(function(){v&&l&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(v,"dragend",l)))},[l]),u.useEffect(function(){v&&c&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(v,"dragstart",c)))},[c]),u.useEffect(function(){v&&f&&(W!==null&&google.maps.event.removeListener(W),D(google.maps.event.addListener(v,"mousedown",f)))},[f]),u.useEffect(function(){v&&d&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(v,"mousemove",d)))},[d]),u.useEffect(function(){v&&p&&(V!==null&&google.maps.event.removeListener(V),Z(google.maps.event.addListener(v,"mouseout",p)))},[p]),u.useEffect(function(){v&&m&&(K!==null&&google.maps.event.removeListener(K),ee(google.maps.event.addListener(v,"mouseover",m)))},[m]),u.useEffect(function(){v&&g&&(se!==null&&google.maps.event.removeListener(se),de(google.maps.event.addListener(v,"mouseup",g)))},[g]),u.useEffect(function(){v&&h&&(Le!==null&&google.maps.event.removeListener(Le),Fe(google.maps.event.addListener(v,"rightclick",h)))},[h]),u.useEffect(function(){v&&S&&(Ee!==null&&google.maps.event.removeListener(Ee),Ie(google.maps.event.addListener(v,"click",S)))},[S]),u.useEffect(function(){v&&w&&(Re!==null&&google.maps.event.removeListener(Re),re(google.maps.event.addListener(v,"drag",w)))},[w]),u.useEffect(function(){var ie=new google.maps.Polygon(Q(Q({},e||{}),{map:_}));return o&&ie.setPath(o),s&&ie.setPaths(s),typeof i<"u"&&ie.setVisible(i),typeof r<"u"&&ie.setEditable(r),typeof n<"u"&&ie.setDraggable(n),a&&M(google.maps.event.addListener(ie,"dblclick",a)),l&&j(google.maps.event.addListener(ie,"dragend",l)),c&&G(google.maps.event.addListener(ie,"dragstart",c)),f&&D(google.maps.event.addListener(ie,"mousedown",f)),d&&T(google.maps.event.addListener(ie,"mousemove",d)),p&&Z(google.maps.event.addListener(ie,"mouseout",p)),m&&ee(google.maps.event.addListener(ie,"mouseover",m)),g&&de(google.maps.event.addListener(ie,"mouseup",g)),h&&Fe(google.maps.event.addListener(ie,"rightclick",h)),S&&Ie(google.maps.event.addListener(ie,"click",S)),w&&re(google.maps.event.addListener(ie,"drag",w)),L(ie),y&&y(ie),function(){k!==null&&google.maps.event.removeListener(k),P!==null&&google.maps.event.removeListener(P),$!==null&&google.maps.event.removeListener($),W!==null&&google.maps.event.removeListener(W),A!==null&&google.maps.event.removeListener(A),V!==null&&google.maps.event.removeListener(V),K!==null&&google.maps.event.removeListener(K),se!==null&&google.maps.event.removeListener(se),Le!==null&&google.maps.event.removeListener(Le),Ee!==null&&google.maps.event.removeListener(Ee),b&&b(ie),ie.setMap(null)}},[]),null}u.memo(eS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polygon:null},n.setPolygonCallback=function(){n.state.polygon!==null&&n.props.onLoad&&n.props.onLoad(n.state.polygon)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polygon(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:Lc,eventMap:Sc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polygon:n}},this.setPolygonCallback)},e.prototype.componentDidUpdate=function(n){this.state.polygon!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Lc,eventMap:Sc,prevProps:n,nextProps:this.props,instance:this.state.polygon}))},e.prototype.componentWillUnmount=function(){this.state.polygon!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),ge(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Ec={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"},xc={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}};function tS(t){var e=t.options,n=t.bounds,r=t.draggable,i=t.editable,o=t.visible,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,f=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,m=t.onMouseUp,g=t.onRightClick,h=t.onClick,S=t.onDrag,w=t.onBoundsChanged,y=t.onLoad,b=t.onUnmount,_=u.useContext(le),E=u.useState(null),v=E[0],L=E[1],C=u.useState(null),k=C[0],M=C[1],O=u.useState(null),P=O[0],j=O[1],U=u.useState(null),$=U[0],G=U[1],z=u.useState(null),W=z[0],D=z[1],R=u.useState(null),A=R[0],T=R[1],N=u.useState(null),V=N[0],Z=N[1],I=u.useState(null),K=I[0],ee=I[1],q=u.useState(null),se=q[0],de=q[1],ue=u.useState(null),Le=ue[0],Fe=ue[1],we=u.useState(null),Ee=we[0],Ie=we[1],Me=u.useState(null),Re=Me[0],re=Me[1],ie=u.useState(null),ze=ie[0],Ye=ie[1];return u.useEffect(function(){v!==null&&v.setMap(_)},[_]),u.useEffect(function(){typeof e<"u"&&v!==null&&v.setOptions(e)},[v,e]),u.useEffect(function(){typeof r<"u"&&v!==null&&v.setDraggable(r)},[v,r]),u.useEffect(function(){typeof i<"u"&&v!==null&&v.setEditable(i)},[v,i]),u.useEffect(function(){typeof o<"u"&&v!==null&&v.setVisible(o)},[v,o]),u.useEffect(function(){typeof n<"u"&&v!==null&&v.setBounds(n)},[v,n]),u.useEffect(function(){v&&s&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(v,"dblclick",s)))},[s]),u.useEffect(function(){v&&a&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(v,"dragend",a)))},[a]),u.useEffect(function(){v&&l&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(v,"dragstart",l)))},[l]),u.useEffect(function(){v&&c&&(W!==null&&google.maps.event.removeListener(W),D(google.maps.event.addListener(v,"mousedown",c)))},[c]),u.useEffect(function(){v&&f&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(v,"mousemove",f)))},[f]),u.useEffect(function(){v&&d&&(V!==null&&google.maps.event.removeListener(V),Z(google.maps.event.addListener(v,"mouseout",d)))},[d]),u.useEffect(function(){v&&p&&(K!==null&&google.maps.event.removeListener(K),ee(google.maps.event.addListener(v,"mouseover",p)))},[p]),u.useEffect(function(){v&&m&&(se!==null&&google.maps.event.removeListener(se),de(google.maps.event.addListener(v,"mouseup",m)))},[m]),u.useEffect(function(){v&&g&&(Le!==null&&google.maps.event.removeListener(Le),Fe(google.maps.event.addListener(v,"rightclick",g)))},[g]),u.useEffect(function(){v&&h&&(Ee!==null&&google.maps.event.removeListener(Ee),Ie(google.maps.event.addListener(v,"click",h)))},[h]),u.useEffect(function(){v&&S&&(Re!==null&&google.maps.event.removeListener(Re),re(google.maps.event.addListener(v,"drag",S)))},[S]),u.useEffect(function(){v&&w&&(ze!==null&&google.maps.event.removeListener(ze),Ye(google.maps.event.addListener(v,"bounds_changed",w)))},[w]),u.useEffect(function(){var Y=new google.maps.Rectangle(Q(Q({},e||{}),{map:_}));return typeof o<"u"&&Y.setVisible(o),typeof i<"u"&&Y.setEditable(i),typeof r<"u"&&Y.setDraggable(r),typeof n<"u"&&Y.setBounds(n),s&&M(google.maps.event.addListener(Y,"dblclick",s)),a&&j(google.maps.event.addListener(Y,"dragend",a)),l&&G(google.maps.event.addListener(Y,"dragstart",l)),c&&D(google.maps.event.addListener(Y,"mousedown",c)),f&&T(google.maps.event.addListener(Y,"mousemove",f)),d&&Z(google.maps.event.addListener(Y,"mouseout",d)),p&&ee(google.maps.event.addListener(Y,"mouseover",p)),m&&de(google.maps.event.addListener(Y,"mouseup",m)),g&&Fe(google.maps.event.addListener(Y,"rightclick",g)),h&&Ie(google.maps.event.addListener(Y,"click",h)),S&&re(google.maps.event.addListener(Y,"drag",S)),w&&Ye(google.maps.event.addListener(Y,"bounds_changed",w)),L(Y),y&&y(Y),function(){k!==null&&google.maps.event.removeListener(k),P!==null&&google.maps.event.removeListener(P),$!==null&&google.maps.event.removeListener($),W!==null&&google.maps.event.removeListener(W),A!==null&&google.maps.event.removeListener(A),V!==null&&google.maps.event.removeListener(V),K!==null&&google.maps.event.removeListener(K),se!==null&&google.maps.event.removeListener(se),Le!==null&&google.maps.event.removeListener(Le),Ee!==null&&google.maps.event.removeListener(Ee),Re!==null&&google.maps.event.removeListener(Re),ze!==null&&google.maps.event.removeListener(ze),b&&b(Y),Y.setMap(null)}},[]),null}u.memo(tS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={rectangle:null},n.setRectangleCallback=function(){n.state.rectangle!==null&&n.props.onLoad&&n.props.onLoad(n.state.rectangle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Rectangle(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:xc,eventMap:Ec,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{rectangle:n}},this.setRectangleCallback)},e.prototype.componentDidUpdate=function(n){this.state.rectangle!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:xc,eventMap:Ec,prevProps:n,nextProps:this.props,instance:this.state.rectangle}))},e.prototype.componentWillUnmount=function(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),ge(this.registeredEvents),this.state.rectangle.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Cc={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"},_c={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},nS={};function rS(t){var e=t.options,n=t.center,r=t.radius,i=t.draggable,o=t.editable,s=t.visible,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,f=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,m=t.onMouseOver,g=t.onMouseUp,h=t.onRightClick,S=t.onClick,w=t.onDrag,y=t.onCenterChanged,b=t.onRadiusChanged,_=t.onLoad,E=t.onUnmount,v=u.useContext(le),L=u.useState(null),C=L[0],k=L[1],M=u.useState(null),O=M[0],P=M[1],j=u.useState(null),U=j[0],$=j[1],G=u.useState(null),z=G[0],W=G[1],D=u.useState(null),R=D[0],A=D[1],T=u.useState(null),N=T[0],V=T[1],Z=u.useState(null),I=Z[0],K=Z[1],ee=u.useState(null),q=ee[0],se=ee[1],de=u.useState(null),ue=de[0],Le=de[1],Fe=u.useState(null),we=Fe[0],Ee=Fe[1],Ie=u.useState(null),Me=Ie[0],Re=Ie[1],re=u.useState(null),ie=re[0],ze=re[1],Ye=u.useState(null),Y=Ye[0],$e=Ye[1],Ne=u.useState(null),pt=Ne[0],at=Ne[1];return u.useEffect(function(){C!==null&&C.setMap(v)},[v]),u.useEffect(function(){typeof e<"u"&&C!==null&&C.setOptions(e)},[C,e]),u.useEffect(function(){typeof i<"u"&&C!==null&&C.setDraggable(i)},[C,i]),u.useEffect(function(){typeof o<"u"&&C!==null&&C.setEditable(o)},[C,o]),u.useEffect(function(){typeof s<"u"&&C!==null&&C.setVisible(s)},[C,s]),u.useEffect(function(){typeof r=="number"&&C!==null&&C.setRadius(r)},[C,r]),u.useEffect(function(){typeof n<"u"&&C!==null&&C.setCenter(n)},[C,n]),u.useEffect(function(){C&&a&&(O!==null&&google.maps.event.removeListener(O),P(google.maps.event.addListener(C,"dblclick",a)))},[a]),u.useEffect(function(){C&&l&&(U!==null&&google.maps.event.removeListener(U),$(google.maps.event.addListener(C,"dragend",l)))},[l]),u.useEffect(function(){C&&c&&(z!==null&&google.maps.event.removeListener(z),W(google.maps.event.addListener(C,"dragstart",c)))},[c]),u.useEffect(function(){C&&f&&(R!==null&&google.maps.event.removeListener(R),A(google.maps.event.addListener(C,"mousedown",f)))},[f]),u.useEffect(function(){C&&d&&(N!==null&&google.maps.event.removeListener(N),V(google.maps.event.addListener(C,"mousemove",d)))},[d]),u.useEffect(function(){C&&p&&(I!==null&&google.maps.event.removeListener(I),K(google.maps.event.addListener(C,"mouseout",p)))},[p]),u.useEffect(function(){C&&m&&(q!==null&&google.maps.event.removeListener(q),se(google.maps.event.addListener(C,"mouseover",m)))},[m]),u.useEffect(function(){C&&g&&(ue!==null&&google.maps.event.removeListener(ue),Le(google.maps.event.addListener(C,"mouseup",g)))},[g]),u.useEffect(function(){C&&h&&(we!==null&&google.maps.event.removeListener(we),Ee(google.maps.event.addListener(C,"rightclick",h)))},[h]),u.useEffect(function(){C&&S&&(Me!==null&&google.maps.event.removeListener(Me),Re(google.maps.event.addListener(C,"click",S)))},[S]),u.useEffect(function(){C&&w&&(ie!==null&&google.maps.event.removeListener(ie),ze(google.maps.event.addListener(C,"drag",w)))},[w]),u.useEffect(function(){C&&y&&(Y!==null&&google.maps.event.removeListener(Y),$e(google.maps.event.addListener(C,"center_changed",y)))},[S]),u.useEffect(function(){C&&b&&(pt!==null&&google.maps.event.removeListener(pt),at(google.maps.event.addListener(C,"radius_changed",b)))},[b]),u.useEffect(function(){var oe=new google.maps.Circle(Q(Q({},e||nS),{map:v}));return typeof r=="number"&&oe.setRadius(r),typeof n<"u"&&oe.setCenter(n),typeof r=="number"&&oe.setRadius(r),typeof s<"u"&&oe.setVisible(s),typeof o<"u"&&oe.setEditable(o),typeof i<"u"&&oe.setDraggable(i),a&&P(google.maps.event.addListener(oe,"dblclick",a)),l&&$(google.maps.event.addListener(oe,"dragend",l)),c&&W(google.maps.event.addListener(oe,"dragstart",c)),f&&A(google.maps.event.addListener(oe,"mousedown",f)),d&&V(google.maps.event.addListener(oe,"mousemove",d)),p&&K(google.maps.event.addListener(oe,"mouseout",p)),m&&se(google.maps.event.addListener(oe,"mouseover",m)),g&&Le(google.maps.event.addListener(oe,"mouseup",g)),h&&Ee(google.maps.event.addListener(oe,"rightclick",h)),S&&Re(google.maps.event.addListener(oe,"click",S)),w&&ze(google.maps.event.addListener(oe,"drag",w)),y&&$e(google.maps.event.addListener(oe,"center_changed",y)),b&&at(google.maps.event.addListener(oe,"radius_changed",b)),k(oe),_&&_(oe),function(){O!==null&&google.maps.event.removeListener(O),U!==null&&google.maps.event.removeListener(U),z!==null&&google.maps.event.removeListener(z),R!==null&&google.maps.event.removeListener(R),N!==null&&google.maps.event.removeListener(N),I!==null&&google.maps.event.removeListener(I),q!==null&&google.maps.event.removeListener(q),ue!==null&&google.maps.event.removeListener(ue),we!==null&&google.maps.event.removeListener(we),Me!==null&&google.maps.event.removeListener(Me),Y!==null&&google.maps.event.removeListener(Y),pt!==null&&google.maps.event.removeListener(pt),E&&E(oe),oe.setMap(null)}},[]),null}u.memo(rS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={circle:null},n.setCircleCallback=function(){n.state.circle!==null&&n.props.onLoad&&n.props.onLoad(n.state.circle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Circle(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:_c,eventMap:Cc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{circle:n}},this.setCircleCallback)},e.prototype.componentDidUpdate=function(n){this.state.circle!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:_c,eventMap:Cc,prevProps:n,nextProps:this.props,instance:this.state.circle}))},e.prototype.componentWillUnmount=function(){var n;this.state.circle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),ge(this.registeredEvents),(n=this.state.circle)===null||n===void 0||n.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Oc={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},Mc={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,r){t.loadGeoJson(e,n,r)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}};function iS(t){var e=t.options,n=t.onClick,r=t.onDblClick,i=t.onMouseDown,o=t.onMouseMove,s=t.onMouseOut,a=t.onMouseOver,l=t.onMouseUp,c=t.onRightClick,f=t.onAddFeature,d=t.onRemoveFeature,p=t.onRemoveProperty,m=t.onSetGeometry,g=t.onSetProperty,h=t.onLoad,S=t.onUnmount,w=u.useContext(le),y=u.useState(null),b=y[0],_=y[1],E=u.useState(null),v=E[0],L=E[1],C=u.useState(null),k=C[0],M=C[1],O=u.useState(null),P=O[0],j=O[1],U=u.useState(null),$=U[0],G=U[1],z=u.useState(null),W=z[0],D=z[1],R=u.useState(null),A=R[0],T=R[1],N=u.useState(null),V=N[0],Z=N[1],I=u.useState(null),K=I[0],ee=I[1],q=u.useState(null),se=q[0],de=q[1],ue=u.useState(null),Le=ue[0],Fe=ue[1],we=u.useState(null),Ee=we[0],Ie=we[1],Me=u.useState(null),Re=Me[0],re=Me[1],ie=u.useState(null),ze=ie[0],Ye=ie[1];return u.useEffect(function(){b!==null&&b.setMap(w)},[w]),u.useEffect(function(){b&&r&&(v!==null&&google.maps.event.removeListener(v),L(google.maps.event.addListener(b,"dblclick",r)))},[r]),u.useEffect(function(){b&&i&&(k!==null&&google.maps.event.removeListener(k),M(google.maps.event.addListener(b,"mousedown",i)))},[i]),u.useEffect(function(){b&&o&&(P!==null&&google.maps.event.removeListener(P),j(google.maps.event.addListener(b,"mousemove",o)))},[o]),u.useEffect(function(){b&&s&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(b,"mouseout",s)))},[s]),u.useEffect(function(){b&&a&&(W!==null&&google.maps.event.removeListener(W),D(google.maps.event.addListener(b,"mouseover",a)))},[a]),u.useEffect(function(){b&&l&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(b,"mouseup",l)))},[l]),u.useEffect(function(){b&&c&&(V!==null&&google.maps.event.removeListener(V),Z(google.maps.event.addListener(b,"rightclick",c)))},[c]),u.useEffect(function(){b&&n&&(K!==null&&google.maps.event.removeListener(K),ee(google.maps.event.addListener(b,"click",n)))},[n]),u.useEffect(function(){b&&f&&(se!==null&&google.maps.event.removeListener(se),de(google.maps.event.addListener(b,"addfeature",f)))},[f]),u.useEffect(function(){b&&d&&(Le!==null&&google.maps.event.removeListener(Le),Fe(google.maps.event.addListener(b,"removefeature",d)))},[d]),u.useEffect(function(){b&&p&&(Ee!==null&&google.maps.event.removeListener(Ee),Ie(google.maps.event.addListener(b,"removeproperty",p)))},[p]),u.useEffect(function(){b&&m&&(Re!==null&&google.maps.event.removeListener(Re),re(google.maps.event.addListener(b,"setgeometry",m)))},[m]),u.useEffect(function(){b&&g&&(ze!==null&&google.maps.event.removeListener(ze),Ye(google.maps.event.addListener(b,"setproperty",g)))},[g]),u.useEffect(function(){if(w!==null){var Y=new google.maps.Data(Q(Q({},e||{}),{map:w}));r&&L(google.maps.event.addListener(Y,"dblclick",r)),i&&M(google.maps.event.addListener(Y,"mousedown",i)),o&&j(google.maps.event.addListener(Y,"mousemove",o)),s&&G(google.maps.event.addListener(Y,"mouseout",s)),a&&D(google.maps.event.addListener(Y,"mouseover",a)),l&&T(google.maps.event.addListener(Y,"mouseup",l)),c&&Z(google.maps.event.addListener(Y,"rightclick",c)),n&&ee(google.maps.event.addListener(Y,"click",n)),f&&de(google.maps.event.addListener(Y,"addfeature",f)),d&&Fe(google.maps.event.addListener(Y,"removefeature",d)),p&&Ie(google.maps.event.addListener(Y,"removeproperty",p)),m&&re(google.maps.event.addListener(Y,"setgeometry",m)),g&&Ye(google.maps.event.addListener(Y,"setproperty",g)),_(Y),h&&h(Y)}return function(){b&&(v!==null&&google.maps.event.removeListener(v),k!==null&&google.maps.event.removeListener(k),P!==null&&google.maps.event.removeListener(P),$!==null&&google.maps.event.removeListener($),W!==null&&google.maps.event.removeListener(W),A!==null&&google.maps.event.removeListener(A),V!==null&&google.maps.event.removeListener(V),K!==null&&google.maps.event.removeListener(K),se!==null&&google.maps.event.removeListener(se),Le!==null&&google.maps.event.removeListener(Le),Ee!==null&&google.maps.event.removeListener(Ee),Re!==null&&google.maps.event.removeListener(Re),ze!==null&&google.maps.event.removeListener(ze),S&&S(b),b.setMap(null))}},[]),null}u.memo(iS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={data:null},n.setDataCallback=function(){n.state.data!==null&&n.props.onLoad&&n.props.onLoad(n.state.data)},n}return e.prototype.componentDidMount=function(){if(this.context!==null){var n=new google.maps.Data(Q(Q({},this.props.options||{}),{map:this.context}));this.registeredEvents=fe({updaterMap:Mc,eventMap:Oc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{data:n}},this.setDataCallback)}},e.prototype.componentDidUpdate=function(n){this.state.data!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Mc,eventMap:Oc,prevProps:n,nextProps:this.props,instance:this.state.data}))},e.prototype.componentWillUnmount=function(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),ge(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Pc={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},kc={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={kmlLayer:null},n.setKmlLayerCallback=function(){n.state.kmlLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.kmlLayer)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.KmlLayer(Q(Q({},this.props.options),{map:this.context}));this.registeredEvents=fe({updaterMap:kc,eventMap:Pc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{kmlLayer:n}},this.setKmlLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.kmlLayer!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:kc,eventMap:Pc,prevProps:n,nextProps:this.props,instance:this.state.kmlLayer}))},e.prototype.componentWillUnmount=function(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),ge(this.registeredEvents),this.state.kmlLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);function yd(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function oS(t,e){return new e(t.lat,t.lng)}function sS(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function aS(t,e,n){return t instanceof e?t:n(t,e)}function lS(t,e,n){return t instanceof e?t:n(t,e)}function cS(t,e,n){var r=t&&t.fromLatLngToDivPixel(n.getNorthEast()),i=t&&t.fromLatLngToDivPixel(n.getSouthWest());return r&&i?{left:"".concat(i.x+e.x,"px"),top:"".concat(r.y+e.y,"px"),width:"".concat(r.x-i.x-e.x,"px"),height:"".concat(i.y-r.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function uS(t,e,n){var r=t&&t.fromLatLngToDivPixel(n);if(r){var i=r.x,o=r.y;return{left:"".concat(i+e.x,"px"),top:"".concat(o+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function bd(t,e,n,r){return n!==void 0?cS(t,e,lS(n,google.maps.LatLngBounds,sS)):uS(t,e,aS(r,google.maps.LatLng,oS))}function fS(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function dS(t,e,n,r,i){var o=function(s){je(a,s);function a(l,c,f,d){var p=s.call(this)||this;return p.container=l,p.pane=c,p.position=f,p.bounds=d,p}return a.prototype.onAdd=function(){var l,c=(l=this.getPanes())===null||l===void 0?void 0:l[this.pane];c==null||c.appendChild(this.container)},a.prototype.draw=function(){for(var l=this.getProjection(),c=Q({},this.container?yd(this.container,i):{x:0,y:0}),f=bd(l,c,this.bounds,this.position),d=0,p=Object.entries(f);d<p.length;d++){var m=p[d],g=m[0],h=m[1];this.container.style[g]=h}},a.prototype.onRemove=function(){this.container.parentNode!==null&&this.container.parentNode.removeChild(this.container)},a}(google.maps.OverlayView);return new o(t,e,n,r)}function Rc(t){if(!t)return"";var e=t instanceof google.maps.LatLng?t:new google.maps.LatLng(t.lat,t.lng);return e+""}function Tc(t){if(!t)return"";var e=t instanceof google.maps.LatLngBounds?t:new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west));return e+""}function pS(t){var e=t.position,n=t.bounds,r=t.mapPaneName,i=t.zIndex,o=t.onLoad,s=t.onUnmount,a=t.getPixelPositionOffset,l=t.children,c=u.useContext(le),f=u.useMemo(function(){var p=document.createElement("div");return p.style.position="absolute",p},[]),d=u.useMemo(function(){return dS(f,r,e,n,a)},[f,r,e,n]);return u.useEffect(function(){return o==null||o(d),d==null||d.setMap(c),function(){s==null||s(d),d==null||d.setMap(null)}},[c,d]),u.useEffect(function(){f.style.zIndex="".concat(i)},[i,f]),ou.createPortal(l,f)}u.memo(pS);(function(t){je(e,t);function e(n){var r=t.call(this,n)||this;r.state={paneEl:null,containerStyle:{position:"absolute"}},r.updatePane=function(){var o=r.props.mapPaneName,s=r.overlayView.getPanes();qe(!!o,"OverlayView requires props.mapPaneName but got %s",o),s?r.setState({paneEl:s[o]}):r.setState({paneEl:null})},r.onAdd=function(){var o,s;r.updatePane(),(s=(o=r.props).onLoad)===null||s===void 0||s.call(o,r.overlayView)},r.onPositionElement=function(){var o,s=r.overlayView.getProjection(),a=Q({x:0,y:0},r.containerRef.current?yd(r.containerRef.current,r.props.getPixelPositionOffset):{}),l=bd(s,a,r.props.bounds,r.props.position),c=(o=r.state.containerStyle,o.left),f=o.top,d=o.width,p=o.height;fS(l,{left:c,top:f,width:d,height:p})||r.setState({containerStyle:{top:l.top||0,left:l.left||0,width:l.width||0,height:l.height||0,position:"absolute"}})},r.draw=function(){r.onPositionElement()},r.onRemove=function(){var o,s;r.setState(function(){return{paneEl:null}}),(s=(o=r.props).onUnmount)===null||s===void 0||s.call(o,r.overlayView)},r.containerRef=u.createRef();var i=new google.maps.OverlayView;return i.onAdd=r.onAdd,i.draw=r.draw,i.onRemove=r.onRemove,r.overlayView=i,r}return e.prototype.componentDidMount=function(){this.overlayView.setMap(this.context)},e.prototype.componentDidUpdate=function(n){var r=Rc(n.position),i=Rc(this.props.position),o=Tc(n.bounds),s=Tc(this.props.bounds);(r!==i||o!==s)&&this.overlayView.draw(),n.mapPaneName!==this.props.mapPaneName&&this.updatePane()},e.prototype.componentWillUnmount=function(){this.overlayView.setMap(null)},e.prototype.render=function(){var n=this.state.paneEl;return n?ou.createPortal(x.jsx("div",{ref:this.containerRef,style:this.state.containerStyle,children:u.Children.only(this.props.children)}),n):null},e.FLOAT_PANE="floatPane",e.MAP_PANE="mapPane",e.MARKER_LAYER="markerLayer",e.OVERLAY_LAYER="overlayLayer",e.OVERLAY_MOUSE_TARGET="overlayMouseTarget",e.contextType=le,e})(u.PureComponent);function hS(){}var Ac={onDblClick:"dblclick",onClick:"click"},Dc={opacity:function(t,e){t.setOpacity(e)}};function gS(t){var e=t.url,n=t.bounds,r=t.options,i=t.visible,o=u.useContext(le),s=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east)),a=u.useMemo(function(){var l=new google.maps.GroundOverlay(e,s,Q({},r));return l},[]);return u.useEffect(function(){a!==null&&a.setMap(o)},[o]),u.useEffect(function(){typeof e<"u"&&a!==null&&(a.set("url",e),a.setMap(o))},[a,e]),u.useEffect(function(){typeof i<"u"&&a!==null&&a.setOpacity(i?1:0)},[a,i]),u.useEffect(function(){var l=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east));typeof n<"u"&&a!==null&&(a.set("bounds",l),a.setMap(o))},[a,n]),null}u.memo(gS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={groundOverlay:null},n.setGroundOverlayCallback=function(){n.state.groundOverlay!==null&&n.props.onLoad&&n.props.onLoad(n.state.groundOverlay)},n}return e.prototype.componentDidMount=function(){qe(!!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 n=new google.maps.GroundOverlay(this.props.url,this.props.bounds,Q(Q({},this.props.options),{map:this.context}));this.registeredEvents=fe({updaterMap:Dc,eventMap:Ac,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{groundOverlay:n}},this.setGroundOverlayCallback)},e.prototype.componentDidUpdate=function(n){this.state.groundOverlay!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Dc,eventMap:Ac,prevProps:n,nextProps:this.props,instance:this.state.groundOverlay}))},e.prototype.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},e.prototype.render=function(){return null},e.defaultProps={onLoad:hS},e.contextType=le,e})(u.PureComponent);var Ic={},jc={data:function(t,e){t.setData(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)}};function vS(t){var e=t.data,n=t.onLoad,r=t.onUnmount,i=t.options,o=u.useContext(le),s=u.useState(null),a=s[0],l=s[1];return u.useEffect(function(){google.maps.visualization||qe(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)},[]),u.useEffect(function(){qe(!!e,"data property is required in HeatmapLayer %s",e)},[e]),u.useEffect(function(){a!==null&&a.setMap(o)},[o]),u.useEffect(function(){i&&a!==null&&a.setOptions(i)},[a,i]),u.useEffect(function(){var c=new google.maps.visualization.HeatmapLayer(Q(Q({},i||{}),{data:e,map:o}));return l(c),n&&n(c),function(){a!==null&&(r&&r(a),a.setMap(null))}},[]),null}u.memo(vS);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={heatmapLayer:null},n.setHeatmapLayerCallback=function(){n.state.heatmapLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.heatmapLayer)},n}return e.prototype.componentDidMount=function(){qe(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to <LoadScript />? %s',google.maps.visualization),qe(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var n=new google.maps.visualization.HeatmapLayer(Q(Q({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=fe({updaterMap:jc,eventMap:Ic,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{heatmapLayer:n}},this.setHeatmapLayerCallback)},e.prototype.componentDidUpdate=function(n){ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:jc,eventMap:Ic,prevProps:n,nextProps:this.props,instance:this.state.heatmapLayer})},e.prototype.componentWillUnmount=function(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),ge(this.registeredEvents),this.state.heatmapLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);var Nc={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},Bc={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={streetViewPanorama:null},n.setStreetViewPanoramaCallback=function(){n.state.streetViewPanorama!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewPanorama)},n}return e.prototype.componentDidMount=function(){var n,r,i=(r=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&r!==void 0?r:null;this.registeredEvents=fe({updaterMap:Bc,eventMap:Nc,prevProps:{},nextProps:this.props,instance:i}),this.setState(function(){return{streetViewPanorama:i}},this.setStreetViewPanoramaCallback)},e.prototype.componentDidUpdate=function(n){this.state.streetViewPanorama!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Bc,eventMap:Nc,prevProps:n,nextProps:this.props,instance:this.state.streetViewPanorama}))},e.prototype.componentWillUnmount=function(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),ge(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={streetViewService:null},n.setStreetViewServiceCallback=function(){n.state.streetViewService!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewService)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:n}},this.setStreetViewServiceCallback)},e.prototype.componentWillUnmount=function(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},e.prototype.render=function(){return null},e.contextType=le,e})(u.PureComponent);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={directionsService:null},n.setDirectionsServiceCallback=function(){n.state.directionsService!==null&&n.props.onLoad&&n.props.onLoad(n.state.directionsService)},n}return e.prototype.componentDidMount=function(){qe(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var n=new google.maps.DirectionsService;this.setState(function(){return{directionsService:n}},this.setDirectionsServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.directionsService!==null&&this.state.directionsService.route(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.directionsService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},e.prototype.render=function(){return null},e})(u.PureComponent);var Uc={onDirectionsChanged:"directions_changed"},Vc={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={directionsRenderer:null},n.setDirectionsRendererCallback=function(){n.state.directionsRenderer!==null&&(n.state.directionsRenderer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.directionsRenderer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=fe({updaterMap:Vc,eventMap:Uc,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{directionsRenderer:n}},this.setDirectionsRendererCallback)},e.prototype.componentDidUpdate=function(n){this.state.directionsRenderer!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Vc,eventMap:Uc,prevProps:n,nextProps:this.props,instance:this.state.directionsRenderer}))},e.prototype.componentWillUnmount=function(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),ge(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},e.prototype.render=function(){return x.jsx(x.Fragment,{})},e.contextType=le,e})(u.PureComponent);(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={distanceMatrixService:null},n.setDistanceMatrixServiceCallback=function(){n.state.distanceMatrixService!==null&&n.props.onLoad&&n.props.onLoad(n.state.distanceMatrixService)},n}return e.prototype.componentDidMount=function(){qe(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var n=new google.maps.DistanceMatrixService;this.setState(function(){return{distanceMatrixService:n}},this.setDistanceMatrixServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.distanceMatrixService!==null&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.distanceMatrixService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},e.prototype.render=function(){return null},e})(u.PureComponent);var Fc={onPlacesChanged:"places_changed"},zc={bounds:function(t,e){t.setBounds(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=u.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){n.state.searchBox!==null&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}return e.prototype.componentDidMount=function(){if(qe(!!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 n=this.containerElement.current.querySelector("input");if(n!==null){var r=new google.maps.places.SearchBox(n,this.props.options);this.registeredEvents=fe({updaterMap:zc,eventMap:Fc,prevProps:{},nextProps:this.props,instance:r}),this.setState(function(){return{searchBox:r}},this.setSearchBoxCallback)}}},e.prototype.componentDidUpdate=function(n){this.state.searchBox!==null&&(ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:zc,eventMap:Fc,prevProps:n,nextProps:this.props,instance:this.state.searchBox}))},e.prototype.componentWillUnmount=function(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),ge(this.registeredEvents))},e.prototype.render=function(){return x.jsx("div",{ref:this.containerElement,children:u.Children.only(this.props.children)})},e.contextType=le,e})(u.PureComponent);var $c={onPlaceChanged:"place_changed"},Hc={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}};(function(t){je(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=u.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){n.state.autocomplete!==null&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}return e.prototype.componentDidMount=function(){var n;qe(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places);var r=(n=this.containerElement.current)===null||n===void 0?void 0:n.querySelector("input");if(r){var i=new google.maps.places.Autocomplete(r,this.props.options);this.registeredEvents=fe({updaterMap:Hc,eventMap:$c,prevProps:{},nextProps:this.props,instance:i}),this.setState(function(){return{autocomplete:i}},this.setAutocompleteCallback)}},e.prototype.componentDidUpdate=function(n){ge(this.registeredEvents),this.registeredEvents=fe({updaterMap:Hc,eventMap:$c,prevProps:n,nextProps:this.props,instance:this.state.autocomplete})},e.prototype.componentWillUnmount=function(){this.state.autocomplete!==null&&ge(this.registeredEvents)},e.prototype.render=function(){return x.jsx("div",{ref:this.containerElement,className:this.props.className,children:u.Children.only(this.props.children)})},e.defaultProps={className:""},e.contextType=le,e})(u.PureComponent);const mS={clickableIcons:!1,disableDefaultUI:!0,minZoom:4,maxZoom:20,restriction:{strictBounds:!0,latLngBounds:{north:85,south:-85,west:-179,east:179}}},wd={optimized:!0},yS="MapGoogle-module__root__iB2RTt",bS="MapGoogle-module__hideUI__zGYpjY",wS="MapGoogle-module__mapContainer__qTVsu4",SS="MapGoogle-module__balloon__nNM3fV",LS="MapGoogle-module__details__MuhoyT",ES="MapGoogle-module__cluster__KIS2sn",xS="MapGoogle-module__overlay__z03Yoa",CS="MapGoogle-module__mapControl__Iu3xc4",_S="MapGoogle-module__geolocationControl__cwYVsw",OS="MapGoogle-module__bottomSheet__ql8eoC",MS="MapGoogle-module__locationViewContent__LYJkkK",PS="MapGoogle-module__locationViewHeader__hzc7Ip",kS="MapGoogle-module__deliveryDetailsViewContent__1FevKl",RS="MapGoogle-module__deliveryDetailsViewHeader__VRF5b3",TS="MapGoogle-module__sheetSubmit__pjGRS0",Xe={root:yS,hideUI:bS,mapContainer:wS,balloon:SS,details:LS,cluster:ES,overlay:xS,mapControl:CS,geolocationControl:_S,bottomSheet:OS,locationViewContent:MS,locationViewHeader:PS,deliveryDetailsViewContent:kS,deliveryDetailsViewHeader:RS,sheetSubmit:TS},AS=({children:t,className:e,onLoad:n,onIdle:r,onUnmount:i})=>{const{map:o,disableDelivery:s,hideMapUI:a}=st(),l=u.useMemo(()=>{var f,d;return{lat:((f=o==null?void 0:o.center)==null?void 0:f[0])??co[0],lng:((d=o==null?void 0:o.center)==null?void 0:d[1])??co[1]}},[o==null?void 0:o.center]),c=u.useCallback(async f=>{var m;const{latLng:d}=f;if(!d||s)return;ye.getState().setDetailsOpen(!1),bt.getState().setSelectedLocation(null);const p=[d.lat(),d.lng()];try{const g=await ur(p),h=(m=g==null?void 0:g.results)==null?void 0:m[0],S=h==null?void 0:h.formatted_address;$t.getState().setPlace(h),mn(S,"Address is not defined"),Ze.getState().setDeliverPoint({address:S,coords:p})}catch{Ze.getState().setDeliverPoint({address:null,coords:p})}},[s]);return x.jsx(lw,{zoom:o==null?void 0:o.initialZoom,center:l,options:mS,mapContainerClassName:be(Xe.root,e,{[Xe.hideUI]:a}),onLoad:n,onIdle:r,onUnmount:i,onClick:c,children:t})},DS='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z" style="mix-blend-mode:darken"/><g filter="url(#b)"><path fill="currentColor" fill-rule="evenodd" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z" clip-rule="evenodd"/></g><g fill="#fff"><path fill-rule="evenodd" d="M15.878 16.411c0-.34.273-.617.61-.617h15.024c.337 0 .61.276.61.617v10.103H15.878V16.41Zm1.22.617v8.253h13.803v-8.253H17.1Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M15.878 25.28h16.244v9.155c0 .864-.694 1.565-1.55 1.565H17.428c-.855 0-1.55-.7-1.55-1.565V25.28Zm1.22 1.234v7.92a.33.33 0 0 0 .33.333h13.145a.33.33 0 0 0 .328-.332v-7.921H17.1ZM14 13.565c0-.864.694-1.565 1.55-1.565h16.9c.856 0 1.55.7 1.55 1.565v1.898c0 .864-.694 1.565-1.55 1.565h-16.9c-.856 0-1.55-.701-1.55-1.565v-1.898Zm1.55-.332a.33.33 0 0 0-.33.332v1.898a.33.33 0 0 0 .33.332h16.9a.33.33 0 0 0 .33-.332v-1.898a.33.33 0 0 0-.33-.332h-16.9Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M20.573 24c0-1.912 1.535-3.462 3.427-3.462 1.893 0 3.428 1.55 3.428 3.462v1.872a.639.639 0 0 1-.636.642H21.21a.639.639 0 0 1-.636-.642V24ZM24 21.77A2.218 2.218 0 0 0 21.794 24v1.28h4.413V24c0-1.231-.988-2.23-2.207-2.23Z" clip-rule="evenodd"/><path d="m26.765 29.18-2.724-1.376a.093.093 0 0 0-.083 0l-2.724 1.376a.094.094 0 0 0-.051.084v2.752c0 .036.02.069.05.084l2.725 1.376a.09.09 0 0 0 .042.01.09.09 0 0 0 .041-.01l2.724-1.376a.094.094 0 0 0 .051-.084v-2.751a.095.095 0 0 0-.05-.085ZM24 27.994l2.624 1.326-1.26.637-2.525-1.378 1.16-.585Zm0 2.651-2.625-1.325 1.261-.637 2.524 1.377-1.16.585Zm-2.631-1.118 2.538 1.282v2.431l-2.538-1.282v-2.431Zm2.723 3.713V30.81l2.538-1.282v2.432l-2.538 1.281Z"/><path fill-rule="evenodd" d="M26.892 28.926a.38.38 0 0 1 .206.339v2.751a.379.379 0 0 1-.207.339l-2.723 1.375a.369.369 0 0 1-.338 0l-2.722-1.375a.379.379 0 0 1-.208-.339v-2.752c0-.142.079-.274.207-.339l2.727-1.377a.373.373 0 0 1 .33 0l.002.002 2.726 1.376ZM21.233 32.1a.094.094 0 0 1-.05-.084v-2.752c0-.035.019-.068.05-.084l2.724-1.376a.093.093 0 0 1 .084 0l2.724 1.376a.095.095 0 0 1 .05.085v2.751c0 .035-.019.068-.05.084l-2.724 1.376a.09.09 0 0 1-.042.01.09.09 0 0 1-.042-.01L21.233 32.1Zm5.397-.141v-2.432l-2.538 1.282v2.431l2.538-1.281Zm-.282-.176v-1.796l-1.974.998v1.795l1.974-.997Zm-2.442-.974-2.538-1.282v2.431l2.538 1.282V30.81Zm-2.256-.822 1.974.998v1.795l-1.974-.998v-1.795Zm2.349.658 1.16-.585-2.524-1.377-1.26.637 2.624 1.325Zm.55-.595-.55.277-1.995-1.008.626-.316 1.918 1.047Zm.814-.094 1.26-.636L24 27.994l-1.16.585 2.524 1.377Zm.005-.32-1.918-1.047.549-.277 1.995 1.008-.627.316Z" clip-rule="evenodd"/></g><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_958_9661"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_958_9661" result="shape"/></filter></defs></svg>',IS='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z" style="mix-blend-mode:darken"/><g filter="url(#b)"><path fill="currentColor" fill-opacity=".8" fill-rule="evenodd" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z" clip-rule="evenodd"/></g><path fill="#fff" fill-rule="evenodd" d="M36.503 33.501V19.625a3 3 0 0 0-1.583-2.645l-9.502-5.091a3 3 0 0 0-2.834 0l-9.501 5.091a3 3 0 0 0-1.583 2.645V33.5a3 3 0 0 0 3 3h19.003a3 3 0 0 0 3-3Zm-7.752 1h4.752a1 1 0 0 0 1-1V19.625a1 1 0 0 0-.528-.882l-9.501-5.091a1 1 0 0 0-.945 0l-9.501 5.091a1 1 0 0 0-.528.882V33.5a1 1 0 0 0 1 1h4.75a2.516 2.516 0 0 1-.05-.5V23.747a2.5 2.5 0 0 1 2.5-2.5h4.602a2.5 2.5 0 0 1 2.5 2.5V34c0 .172-.018.339-.05.5Zm-2.434 0a.5.5 0 0 0 .485-.5V23.747a.5.5 0 0 0-.5-.5H21.7a.5.5 0 0 0-.5.5V34a.5.5 0 0 0 .484.5h4.632Z" clip-rule="evenodd"/><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_1068_16960"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_1068_16960" result="shape"/></filter></defs></svg>',jS='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="66" fill="none" viewBox="0 0 48 66"><path fill="url(#a)" fill-opacity=".4" d="M23.999 66C35.045 66 44 63.314 44 60s-8.955-6-20.001-6C12.955 54 4 56.686 4 60s8.955 6 19.999 6Z"/><g fill-rule="evenodd" clip-rule="evenodd" filter="url(#b)"><path fill="currentColor" d="M24 0c11.211 0 24 8.288 24 24.088C48 34.6 40.011 48.411 24 60 7.989 48.41 0 34.6 0 24.088 0 8.288 12.789 0 24 0Z"/><path fill="#fff" d="M33.913 12H14.087A2.087 2.087 0 0 0 12 14.087v19.826c0 1.153.934 2.087 2.087 2.087h19.826A2.087 2.087 0 0 0 36 33.913V14.087A2.087 2.087 0 0 0 33.913 12Zm-20.348 2.087c0-.288.234-.522.522-.522h7.826v4.07h-8.348v-3.548Zm9.913 9.13v-9.652h4.696v9.652h-4.696Zm4.696 1.566h-4.696v9.652h4.696v-9.652Zm1.565 9.652h4.174a.523.523 0 0 0 .522-.522v-9.13h-4.696v9.652Zm0-11.218v-9.652h4.174c.288 0 .522.234.522.522v9.13h-4.696ZM21.913 19.2v4.017h-8.348V19.2h8.348Zm0 9.6v-4.017h-8.348V28.8h8.348Zm-8.348 1.565h8.348v4.07h-7.826a.522.522 0 0 1-.522-.522v-3.548Z"/></g><defs><radialGradient id="a" cx="0" cy="0" r="1" gradientTransform="matrix(0 6 -20 0 24 60)" gradientUnits="userSpaceOnUse"><stop stop-color="#1D3665"/><stop offset="1" stop-color="#1D3665" stop-opacity="0"/></radialGradient><filter id="b" width="56" height="68" x="-4" y="-4" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feGaussianBlur in="BackgroundImageFix" stdDeviation="2"/><feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_2412_6054"/><feBlend in="SourceGraphic" in2="effect1_backgroundBlur_2412_6054" result="shape"/></filter></defs></svg>',Rt={PinPvz:DS,PinHome:IS,PinLocker:jS},Sd=28,Ld=({open:t,children:e,hideFooter:n,minSnapHeight:r,submitDisabled:i,submitLoading:o,onSubmitClick:s,...a})=>x.jsx(Of,{open:t,expandOnContentDrag:!0,initialFocusRef:!1,defaultSnap:({snapPoints:l})=>Math.min(...l),snapPoints:({headerHeight:l,minHeight:c,footerHeight:f,maxHeight:d})=>[r==null?c:l+f+r,d-Sd],footer:n?null:x.jsx(_t,{disabled:i,loading:o,variant:"primary",className:Xe.sheetSubmit,onClick:s,children:x.jsx(An,{keyName:"choose",ns:"common"})}),sibling:x.jsx("div",{"data-rsbs-backdrop":"true",onClick:l=>{var c;l.stopPropagation(),l.preventDefault(),(c=a.onDismiss)==null||c.call(a)}}),blocking:!1,children:x.jsx("div",{className:Xe.bottomSheet,children:e})}),Ed=({isSelectedPoint:t})=>{const e=ye(la),[n,r]=u.useState(!0);return u.useEffect(()=>{r(t?!e:!0)},[e,t]),n},xd=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:42,height:42,fill:"none",viewBox:"0 0 42 42",...t},ce.createElement("rect",{width:42,height:42,fill:"#fff",rx:21}),ce.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M31.003 28V17.766a3 3 0 0 0-1.579-2.643l-7.003-3.765a3 3 0 0 0-2.842 0l-7.003 3.765a3 3 0 0 0-1.58 2.643V28a3 3 0 0 0 3 3h14.008a3 3 0 0 0 3-3Zm-5.919 1h2.92a1 1 0 0 0 1-1V17.766a1 1 0 0 0-.527-.881l-7.003-3.766a1 1 0 0 0-.948 0l-7.003 3.766a1 1 0 0 0-.527.88v10.237a1 1 0 0 0 1 1h2.92a2.513 2.513 0 0 1-.05-.5v-7.606a2.5 2.5 0 0 1 2.5-2.5h3.268a2.5 2.5 0 0 1 2.5 2.5V28.5c0 .171-.017.338-.05.5Zm-2.426 0a.5.5 0 0 0 .476-.499v-7.606a.5.5 0 0 0-.5-.5h-3.269a.5.5 0 0 0-.5.5V28.5a.5.5 0 0 0 .476.5h3.317Z",clipRule:"evenodd"}),ce.createElement("rect",{width:41,height:41,x:.5,y:.5,stroke:"#1D3665",strokeOpacity:.1,rx:20.5})),NS=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},ce.createElement("g",{clipPath:"url(#a)"},ce.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M17.071 3.071a1.25 1.25 0 0 0-1.768 0L10 8.375 4.697 3.07a1.25 1.25 0 1 0-1.768 1.77l5.303 5.303-5.303 5.303a1.25 1.25 0 0 0 1.768 1.768L10 11.91l5.303 5.303a1.25 1.25 0 1 0 1.768-1.768l-5.303-5.303L17.07 4.84a1.25 1.25 0 0 0 0-1.768Z",clipRule:"evenodd"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"a"},ce.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})))),BS="CloseButton-module__root__233rOd",US="CloseButton-module__absolutePositionVariant__MMkQ0-",VS="CloseButton-module__relativePositionVariant__fdYFY4",Gc={root:BS,absolutePositionVariant:US,relativePositionVariant:VS},di=({position:t="absolute",className:e,...n})=>x.jsx("div",{...n,className:be(Gc.root,e,Gc[`${t}PositionVariant`]),children:x.jsx(NS,{})}),FS="DeliveryBalloon-module__root__c9I8i1",zS="DeliveryBalloon-module__details__ti2Tdy",$S="DeliveryBalloon-module__header__qKggbq",HS="DeliveryBalloon-module__title__fDmbsU",GS="DeliveryBalloon-module__description__5-12RZ",WS="DeliveryBalloon-module__actions__MWT995",ZS="DeliveryBalloon-module__errorVariant__meU-B7",qS="DeliveryBalloon-module__logo__YNN-Vi",an={root:FS,details:zS,header:$S,title:HS,description:GS,actions:WS,errorVariant:ZS,logo:qS},ia=({SSR:t,variant:e,address:n,className:r,hideDetails:i,hasCloseButton:o,onDetails:s,onClose:a})=>{const l=e==="error",c=e==="default",f=t?"{ courier_balloon.title }":x.jsx(An,{keyName:"title",ns:"courier_balloon"}),d=t?"{ courier_balloon.error_title }":x.jsx(An,{keyName:"error_title",ns:"courier_balloon"}),p=t?"{ courier_balloon.error_description }":x.jsx(An,{keyName:"error_description",ns:"courier_balloon"});return x.jsxs("div",{className:be(an.root,r,an[`${e}Variant`]),children:[x.jsxs("div",{className:an.header,children:[x.jsx(xd,{className:an.logo}),x.jsx("span",{className:an.title,children:l?d:f}),o&&x.jsx(di,{onClick:a})]}),x.jsx("div",{className:an.description,children:l?p:n||"{{ properties.address }}"}),c&&!i&&x.jsx("div",{className:an.actions,children:x.jsx(_t,{id:lo,as:"button",variant:"primary",className:an.details,onClick:s,children:t?"{ details }":x.jsx(An,{keyName:"details",ns:"common"})})})]})},KS="Chip-module__root__A1duWr",JS="Chip-module__active__PmXa7K",Wc={root:KS,active:JS},Zc=({active:t,children:e,className:n,...r})=>x.jsx("div",{...r,className:be(Wc.root,n,{[Wc.active]:t}),children:e}),YS="TextArea-module__root__l-RDfr",XS={root:YS},qc=u.forwardRef(({className:t,inputRef:e,onChange:n,onBlur:r,onFocus:i,...o},s)=>{const a=u.useRef(null);u.useImperativeHandle(s,()=>({focus:()=>{var c,f;(c=a.current)==null||c.focus(),i&&i({target:{value:(f=a.current)==null?void 0:f.value}})},blur:()=>{var c,f;(c=a.current)==null||c.blur(),r&&r({target:{value:(f=a.current)==null?void 0:f.value}})},setValue:c=>{n&&n({target:{value:c}}),a.current&&(a.current.value=c)}}),[r,n,i]);const l=Nd(e,a);return x.jsx("textarea",{...o,ref:l,className:be(XS.root,t),onBlur:r,onFocus:i,onChange:n})}),QS=({set:t})=>(e,n)=>{let r={...e};switch(n.type){case"SET_COMMENT":{r={...e,comment:n.payload};break}case"SET_DELIVERY_TIME":{r={...e,delivery_time:n.payload};break}case"SET_APARTMENT_NUMBER":{r={...e,apartment_number:n.payload};break}}return t==null||t(r),r},Cd=t=>{const{delivery_time:e,apartment_number:n}=t;return!!e&&!!n},eL="DeliveryDetailsView-module__title__9op9De",tL="DeliveryDetailsView-module__logo__FHhzI0",nL="DeliveryDetailsView-module__header__zT3NCJ",rL="DeliveryDetailsView-module__content__BWg5hx",iL="DeliveryDetailsView-module__section__XSwSmI",oL="DeliveryDetailsView-module__chips__9GPIxJ",sL="DeliveryDetailsView-module__actions__xulMTc",aL="DeliveryDetailsView-module__submit__v9jVsD",lL="DeliveryDetailsView-module__actionsHidden__yu2ivZ",cL="DeliveryDetailsView-module__commentSection__lnUmS0",uL="DeliveryDetailsView-module__comment__ZwRY1z",mt={title:eL,logo:tL,header:nL,content:rL,section:iL,chips:oL,actions:sL,submit:aL,actionsHidden:lL,commentSection:cL,comment:uL},fL=u.forwardRef(({classes:t,location:e,hideActions:n,onClose:r,onChange:i,onSubmit:o},s)=>{const{inputs:a,locale:l}=st(),{t:c}=jt(["details_modal","courier_balloon","common"]),f=u.useMemo(()=>QS({set:i}),[i]),[d,p]=u.useState(!1),[m,g]=u.useReducer(f,{comment:"",delivery_time:"",apartment_number:"",...e}),h=u.useCallback(async()=>{p(!0);try{mn(e.address,"Address is required");const v=await Jd({address:e.address,algorithm:10,service:10,language:l||Su});if(!Xf(v))return;const L=v==null?void 0:v.data.data,C={...m,address:L};return o==null||o(C),C}finally{p(!1)}},[l,e.address,o,m]);u.useImperativeHandle(s,()=>({submit:h}),[h]);const S=v=>()=>{g({payload:v,type:"SET_DELIVERY_TIME"})},w=v=>{g({payload:v.target.value,type:"SET_APARTMENT_NUMBER"})},y=v=>{g({payload:v.target.value,type:"SET_COMMENT"})},b=Cd(m),_=_o(a==null?void 0:a.apartment),E=_o(a==null?void 0:a.comment);return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:be(mt.header,t==null?void 0:t.header),children:[x.jsx(di,{onClick:r}),x.jsxs("div",{className:mt.title,children:[x.jsx(xd,{className:mt.logo}),x.jsx("span",{children:c("title",{ns:"courier_balloon"})})]})]}),x.jsxs("div",{className:be(mt.content,t==null?void 0:t.content),children:[x.jsxs("section",{className:mt.section,children:[x.jsxs("label",{children:[c("address"),":"]}),x.jsx("p",{children:e.address})]}),x.jsxs("section",{className:mt.section,children:[x.jsxs("label",{children:[c("delivery_time"),":"]}),x.jsxs("div",{className:mt.chips,children:[x.jsx(Zc,{active:m.delivery_time==="8:00-13:00",onClick:S("8:00-13:00"),children:"8:00 - 13:00"}),x.jsx(Zc,{active:m.delivery_time==="14:00-22:00",onClick:S("14:00-22:00"),children:"14:00 - 22:00"})]})]}),x.jsxs("section",{className:mt.section,children:[x.jsxs("label",{children:[c("apartment_number"),":"]}),x.jsx(qc,{..._,rows:1,onChange:w})]}),x.jsxs("section",{className:be(mt.section,mt.commentSection),children:[x.jsxs("label",{children:[c("comment"),":"]}),x.jsx(qc,{...E,className:mt.comment,onChange:y})]})]}),x.jsx("div",{className:be(mt.actions,{[mt.actionsHidden]:n}),children:x.jsx(_t,{loading:d,disabled:!b||d,variant:"primary",className:mt.submit,onClick:h,children:c("choose",{ns:"common"})})})]})}),_d=u.memo(fL),dL={header:Xe.deliveryDetailsViewHeader,content:Xe.deliveryDetailsViewContent},pL=({hideDetails:t,point:e,setOpenDetails:n,setDeliveryPoint:r,onPointClick:i})=>{const o=Ed({isSelectedPoint:!0}),s=u.useRef(null),[a,l]=u.useState(!1),[c,f]=u.useState({...e,comment:"",delivery_time:"",apartment_number:""});u.useEffect(()=>{f({...e,comment:"",delivery_time:"",apartment_number:""})},[e]);const[d,p]=u.useState(null),m=pi("screenSm"),g=u.useMemo(()=>({lat:c.coords[0],lng:c.coords[1]}),[c.coords]),h=()=>{n==null||n(!0)},S=()=>{r==null||r(null)},w=u.useMemo(()=>({url:Jt(xt(Rt.PinHome,"--owl-color-success")),scaledSize:new google.maps.Size(...Xt)}),[]),y=async()=>{var v;try{l(!0);const L=await((v=s.current)==null?void 0:v.submit());if(!L)return;i==null||i(L),n==null||n(!1),r==null||r(null)}finally{l(!1)}},b=x.jsx(ia,{...c,hideDetails:t,hasCloseButton:m,variant:c.address?"default":"error",className:Xe.balloon,onDetails:h,onClose:S}),_=Cd(c),E=o&&!!(d!=null&&d.getVisible());return x.jsxs(fd,{noClustererRedraw:!0,icon:w,position:g,options:wd,onLoad:p,children:[m&&x.jsxs(Ld,{minSnapHeight:c.address?200:void 0,submitDisabled:!_||a,submitLoading:a,hideFooter:!c.address,open:E,onDismiss:S,onSubmitClick:y,children:[c.address&&x.jsx(_d,{ref:s,classes:dL,hideActions:!0,location:e,onChange:f,onClose:S}),!c.address&&b]}),!m&&E&&x.jsx(md,{onCloseClick:S,children:b})]})},Od=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:26,height:8,fill:"none",viewBox:"0 0 26 8",...t},ce.createElement("g",{fill:"#000"},ce.createElement("path",{d:"M1.416 7.5c-.255 0-.491-.065-.708-.194A1.445 1.445 0 0 1 0 6.06V1.94A1.445 1.445 0 0 1 .708.695C.925.564 1.16.5 1.416.5h4.056c.255 0 .488.065.698.194.217.13.39.305.517.525.134.214.2.454.2.72V6.06c0 .26-.066.5-.2.72-.128.22-.3.395-.517.525-.21.13-.443.194-.698.194H1.416Zm.067-1.517h3.903V2.017H1.483v3.966ZM7.941 7.5v-7h1.53l2.335 2.83L14.13.5h1.54v7h-1.493V2.804l-2.372 2.878-2.382-2.868V7.5H7.94ZM16.816 7.5v-7h1.53l3.856 4.667V.5h1.502v7h-1.53l-3.875-4.686V7.5h-1.483ZM24.536 7.5v-7H26v7h-1.464Z"}))),Md=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:26,height:14,fill:"none",viewBox:"0 0 26 14",...t},ce.createElement("g",{fill:"#000"},ce.createElement("path",{d:"M0 13.252V8.346h1.053v3.844h3.08v1.062H0ZM4.535 13.252V8.346h1.053v3.844h3.08v1.062H4.535ZM9.126 13.252V9.36a1.02 1.02 0 0 1 .503-.87.973.973 0 0 1 .503-.137h2.874a.95.95 0 0 1 .502.136c.154.09.277.213.367.367.095.15.143.318.143.504v3.892H12.95v-1.58H10.18v1.58H9.126Zm1.053-2.64h2.772V9.413H10.18v1.197ZM14.792 13.252v-4.9h1.087l1.658 1.98 1.65-1.98h1.094v4.9h-1.06V9.965l-1.684 2.014-1.692-2.007v3.28h-1.053ZM21.108 13.252V9.36a1.018 1.018 0 0 1 .503-.87.973.973 0 0 1 .503-.137h2.874a.95.95 0 0 1 .503.136c.153.09.276.213.366.367A.92.92 0 0 1 26 9.36v3.892h-1.067v-1.58h-2.771v1.58h-1.054Zm1.053-2.64h2.772V9.413h-2.771v1.197ZM1.005 5.648a.973.973 0 0 1-.502-.137A1.018 1.018 0 0 1 0 4.641V1.756a1.018 1.018 0 0 1 .503-.87.973.973 0 0 1 .502-.137h2.881c.181 0 .347.045.496.136.154.09.276.213.367.367a.92.92 0 0 1 .143.504V4.64c0 .181-.048.349-.143.503-.09.154-.213.277-.367.367a.937.937 0 0 1-.496.137h-2.88Zm.048-1.062h2.772V1.81H1.053v2.776ZM5.64 5.648v-4.9h1.087l1.657 1.98 1.651-1.98h1.094v4.9h-1.06V2.36L8.384 4.375 6.693 2.368v3.28H5.64ZM11.943 5.648v-4.9h1.087l2.738 3.267V.749h1.066v4.899h-1.087l-2.751-3.28v3.28h-1.053ZM17.425 5.648v-4.9h1.04v4.9h-1.04Z"}))),hL="LocationView-module__title__QP69kD",gL="LocationView-module__logo__nlPQaG",vL="LocationView-module__header__9DDuVU",mL="LocationView-module__content__Se2TSy",yL="LocationView-module__section__9m1x1v",bL="LocationView-module__chips__6j-ZAh",wL="LocationView-module__services__rwbp2x",SL="LocationView-module__images__zfnQMA",LL="LocationView-module__image__JKvt9J",EL="LocationView-module__actions__AGih3C",xL="LocationView-module__actionsHidden__DBV1vj",CL="LocationView-module__submit__6mD2w-",_L="LocationView-module__scheduleItem__snTLMb",rt={title:hL,logo:gL,header:vL,content:mL,section:yL,chips:bL,services:wL,images:SL,image:LL,actions:EL,actionsHidden:xL,submit:CL,scheduleItem:_L},OL={default:Od,llama:Md},ML=({location:t,hideActions:e,classes:n,onClose:r,onSubmit:i})=>{const{t:o}=jt(["details_modal","common"]),{logo:s="default"}=st(),a=OL[s];return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:be(rt.header,n==null?void 0:n.header),children:[x.jsx(di,{onClick:r}),x.jsxs("div",{className:rt.title,children:[x.jsx("div",{className:rt.logo,children:x.jsx(a,{})}),x.jsx("span",{children:t.name})]})]}),x.jsxs("div",{className:be(rt.content,n==null?void 0:n.content),children:[x.jsxs("section",{className:rt.section,children:[x.jsxs("label",{children:[o("address"),":"]}),x.jsx("p",{children:t.location.full_address})]}),t.schedule.length>0&&x.jsxs("section",{className:rt.section,children:[x.jsxs("label",{children:[o("schedule"),":"]}),t.schedule.map((l,c)=>x.jsx("p",{className:rt.scheduleItem,children:l},c))]}),(t.pay_by_card||t.pay_by_card)&&x.jsxs("section",{className:rt.section,children:[x.jsxs("label",{children:[o("payment_method"),":"]}),x.jsxs("div",{className:rt.chips,children:[t.pay_by_cash&&o("pay_by_cash"),t.pay_by_card&&t.pay_by_cash&&", ",t.pay_by_card&&o("pay_by_card")]})]}),x.jsxs("section",{className:rt.section,children:[x.jsxs("label",{children:[o("services"),":"]}),x.jsxs("div",{className:rt.services,children:[t.is_pickup&&x.jsx("span",{children:o("is_pickup")}),t.is_delivery&&x.jsx("span",{children:o("is_delivery")}),t.is_dressing_room&&x.jsx("span",{children:o("is_dressing_room")}),t.is_check_order&&x.jsx("span",{children:o("is_check_order")})]})]}),x.jsxs("section",{className:rt.section,children:[x.jsxs("label",{children:[o("location"),":"]}),x.jsx("p",{children:t.location_name})]}),t.images.length>0&&x.jsx("section",{className:rt.images,children:t.images.map(l=>x.jsx("img",{src:l,alt:t.name,className:rt.image},l))})]}),x.jsx("div",{className:be(rt.actions,{[rt.actionsHidden]:e}),children:x.jsx(_t,{variant:"primary",className:rt.submit,onClick:i,children:o("choose",{ns:"common"})})})]})},Pd=u.memo(ML),PL=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...t},ce.createElement("path",{fill:"currentcolor",d:"M12.5 8c0 .287-.108.573-.324.792l-6.789 6.88a1.095 1.095 0 0 1-1.563 0 1.131 1.131 0 0 1 0-1.585L9.83 8 3.824 1.913a1.131 1.131 0 0 1 0-1.585 1.095 1.095 0 0 1 1.564 0l6.789 6.88c.215.219.323.505.323.792Z"})),kL="LocationBalloon-module__root__D5p9cL",RL="LocationBalloon-module__submit__Ri5JaR",TL="LocationBalloon-module__details__6et6aX",AL="LocationBalloon-module__icon__U-zpx7",DL="LocationBalloon-module__header__LCvDj0",IL="LocationBalloon-module__title__octhrc",jL="LocationBalloon-module__description__r7vFbw",NL="LocationBalloon-module__actions__-jdejn",ln={root:kL,submit:RL,details:TL,icon:AL,header:DL,title:IL,description:jL,actions:NL},BL={default:Od,llama:Md},kd=({SSR:t,name:e,location:n,onSubmit:r,className:i,onDetails:o,hideDetails:s,location_name:a})=>{const{logo:l="default"}=st(),c=BL[l];return x.jsxs("div",{className:be(ln.root,i),children:[x.jsxs("div",{className:ln.header,children:[x.jsx("div",{className:ln.icon,children:x.jsx(c,{})}),x.jsx("span",{className:ln.title,children:e||"{{ properties.point.name }}"})]}),x.jsxs("div",{className:ln.description,children:[(n==null?void 0:n.full_address)||"{{ properties.point.location.full_address }}",","," ",a||"{{ properties.point.location_name }}"]}),x.jsxs("div",{className:ln.actions,children:[x.jsx(_t,{id:Os,variant:"primary",className:ln.submit,onClick:r,children:t?"{ choose }":x.jsx(An,{keyName:"choose",ns:"common"})}),!s&&x.jsxs(_t,{id:lo,as:"link",variant:"primary",className:ln.details,onClick:o,children:[t?"{ details }":x.jsx(An,{keyName:"details",ns:"common"}),x.jsx(PL,{})]})]})]})},UL={header:Xe.locationViewHeader,content:Xe.locationViewContent},VL=({point:t,clusterer:e,hideDetails:n,onPointClick:r,selectedPoint:i,setOpenDetails:o,onPointSelected:s})=>{const a=pi("screenSm"),[l,c]=u.useState(null),f=()=>{o==null||o(!1),s==null||s(t)},d=()=>{s==null||s(null)},p=()=>{o==null||o(!0),s==null||s(t)},m=()=>{r==null||r(t),o==null||o(!1),s==null||s(null)},g=(i==null?void 0:i.uid)===t.uid,h=g?Yn:Xt,S=Ed({isSelectedPoint:g}),w=u.useMemo(()=>{let _;switch(!0){case(t.type===30&&!g):{_=xt(Rt.PinLocker,"--owl-color-primary");break}case(t.type!==30&&!g):{_=xt(Rt.PinPvz,"--owl-color-grey-80");break}case(t.type===30&&g):{_=xt(Rt.PinLocker,"--owl-color-success");break}case(t.type!==30&&g):{_=xt(Rt.PinPvz,"--owl-color-black");break}}return mn(_,"Icon url is not defined"),{scaledSize:new google.maps.Size(...h),url:Jt(_)}},[g,h,t.type]),y=u.useMemo(()=>({lat:t.location.latitude,lng:t.location.longitude}),[t.location.latitude,t.location.longitude]),b=g&&S&&!!(l!=null&&l.getVisible());return x.jsxs(fd,{noClustererRedraw:!0,icon:w,position:y,clusterer:e,options:wd,onLoad:c,onClick:f,children:[a&&x.jsx(Ld,{minSnapHeight:200,open:b,onDismiss:d,onSubmitClick:m,children:x.jsx(Pd,{classes:UL,hideActions:!0,location:t,onClose:d})}),b&&!a&&x.jsx(md,{onCloseClick:d,children:x.jsx(kd,{...t,hideDetails:n,className:Xe.balloon,onSubmit:m,onDetails:p})})]},t.uid)},FL=({points:t,hideDetails:e,selectedPoint:n,onOpenDetails:r,onPointClick:i,onPointSelected:o})=>x.jsx(Tw,{clusterClass:Xe.cluster,onClusteringEnd:()=>{setTimeout(()=>{const s=document.getElementsByClassName(Xe.cluster);for(const a of s)a.addEventListener("touchstart",Xs,{passive:!0})},100)},onUnmount:()=>{const s=document.getElementsByClassName(Xe.cluster);for(const a of s)a.removeEventListener("touchstart",Xs)},children:s=>x.jsx(u.Fragment,{children:t.map(a=>x.jsx(VL,{point:a,clusterer:s,hideDetails:e,selectedPoint:n,setOpenDetails:r,onPointClick:i,onPointSelected:o},a.uid))})}),zL=u.memo(FL),$L=({onOpenDetails:t,onPointClick:e,onPointSelected:n})=>{const{locale:r,hideDetails:i}=st(),o=zt(Qf),s=bt(c=>c.location),a=$t(Mu),l=JSON.stringify([o.length,r,a==null?void 0:a.place_id]);return x.jsx(zL,{points:o,hideDetails:i,selectedPoint:s,onOpenDetails:t,onPointClick:e,onPointSelected:n},l)},HL=u.memo($L),GL=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},ce.createElement("rect",{width:2,height:20,x:9,fill:"#fff",rx:1}),ce.createElement("rect",{width:2,height:20,x:20,y:9,fill:"#fff",rx:1,transform:"rotate(90 20 9)"}),ce.createElement("circle",{cx:10,cy:10,r:8,fill:"#fff"}),ce.createElement("circle",{cx:10,cy:10,r:6,fill:"currentcolor"}),ce.createElement("circle",{cx:10,cy:10,r:4,fill:"#fff"})),WL=t=>{const e=document.createElement("div"),n=document.createElement("div");e.classList.add(Xe.mapControl),n.classList.add(Xe.mapControl),e.innerHTML="+",n.innerHTML="—",t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(n),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r+1)}),n.addEventListener("click",()=>{const r=t.getZoom()||0;return t.setZoom(r-1)})},ZL=t=>{const e=document.createElement("div");e.classList.add(Xe.mapControl),e.classList.add(Xe.geolocationControl),e.innerHTML=$i.renderToString(x.jsx(GL,{})),t.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e),e.addEventListener("click",()=>{Ca(async n=>{var a;const{latitude:r,longitude:i}=n.coords,s=await ur([r,i]);$t.getState().setPlace((a=s.results)==null?void 0:a[0])})})},qL=({className:t})=>{const e=en(),n=ye(Ou),r=ye(Nh),i=zt(Oa),o=Ze(ko),{hideMapControls:s,hideDetails:a,disableGeolocation:l,onPointClick:c}=st(),f=u.useCallback(g=>{ye.getState().setMap(g),s||(WL(g),l||ZL(g))},[l,s]),d=u.useCallback(()=>{ye.getState().setMap(null)},[]),p=u.useCallback(()=>{if(!n)return;const g=n==null?void 0:n.getBounds();g&&zt.getState().loadNext([[g.getSouthWest().lat(),g.getNorthEast().lat()],[g.getSouthWest().lng(),g.getNorthEast().lng()]],e)},[e,n]),m=u.useCallback(async g=>{var w;if(Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(g),!g)return;const h=[g.location.latitude,g.location.longitude],S=await ur(h);$t.getState().setPlace((w=S.results)==null?void 0:w[0])},[]);return x.jsxs("div",{className:be(Xe.mapContainer,t),children:[x.jsxs(AS,{onIdle:p,onLoad:f,onUnmount:d,children:[o&&x.jsx(pL,{hideDetails:a,point:o,onPointClick:c,setOpenDetails:ye.getState().setDetailsOpen,setDeliveryPoint:Ze.getState().setDeliverPoint}),x.jsx(HL,{onPointClick:c,onOpenDetails:ye.getState().setDetailsOpen,onPointSelected:m})]}),(i||r)&&x.jsx(ka,{className:Xe.overlay,children:x.jsx(ti,{})})]})},KL=u.memo(qL);function Bn(){return Bn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Bn.apply(this,arguments)}const Rd=(t,e)=>{const n={};for(const r in t)e.indexOf(r)===-1&&(n[r]=t[r]);return n},Td=u.createContext(null),Fo=u.createContext(null),Ad=t=>e=>u.createElement(Fo.Consumer,null,n=>u.createElement(t,Bn({parent:n},e))),JL=(t=[])=>{const[e,n]=u.useState(!1),r=u.useRef(t),i=(()=>{const s=u.useContext(Td);if(s===null)throw new Error("Couldn't find Yandex.Maps API in the context. Make sure that hook useYMaps is inside <YMaps /> provider");return s})(),o=i.getApi();return u.useEffect(()=>{i.load().then(()=>Promise.all(r.current.map(i.loadModule))).then(()=>n(!0))},[]),e&&o?o:null},YL=()=>{},XL=["onLoad","onError","modules","apiLoader"];function Ia(t,e=!1,n=[]){return r=>{const{width:i,height:o,modules:s=[],onLoad:a=YL}=r,l=JL(n.concat(s)),c=!e||!!l,f=Rd(r,XL);return u.useEffect(()=>l?a(l):void 0,[l]),c?u.createElement(t,Bn({ymaps:l},f)):u.createElement("div",{style:{width:i,height:o}})}}const QL=typeof window<"u",Kc={lang:"ru_RU",load:"",ns:"",mode:"release"},e1=t=>{const{version:e="2.1",enterprise:n=!1,query:r={lang:"ru_RU",load:"",ns:""},preload:i=!1,children:o}=t,s=u.useRef((a=>{const{query:l=Kc}=a,c=Date.now().toString(32),f=l.ns||"",d="__yandex-maps-api-onload__$$"+c,p="__yandex-maps-api-onerror__$$"+c,m=QL?window:{},g={};let h;const S=()=>f?m[f]:h,w=()=>{delete m[d],delete m[p]};return{load:()=>{if(S())return Promise.resolve(h);if(g[f])return g[f];const y={onload:d,onerror:p,...Kc,...l},b=Object.keys(y).map(E=>`${E}=${y[E]}`).join("&"),_=[`https://${a.enterprise?"enterprise.":""}api-maps.yandex.ru`,a.version,"?"+b].join("/");return g[f]=new Promise((E,v)=>{m[d]=L=>{w(),L.ready(()=>{h=L,E(L)})},m[p]=L=>{w(),v(L)},(L=>new Promise((C,k)=>{const M=document.createElement("script");M.type="text/javascript",M.onload=C,M.onerror=k,M.src=L,M.async=!0,document.head.appendChild(M)}))(_).catch(m[p])}),g[f]},getApi:S,loadModule:y=>new Promise((b,_)=>{h.modules.require(y).done(E=>{E.forEach(v=>{((L,C,k,M=!1)=>{const O=typeof C=="string"?C.split("."):C.slice();let P,j=L;for(;O.length>1;)P=O.shift(),j[P]||(j[P]={}),j=j[P];const U=O[0];j[U]=M===!0&&j[U]||k})(h,y,v,!0)}),b(h)},_)})}})({version:e,enterprise:n,query:r,preload:i}));return u.useEffect(()=>{i&&s.current.load()},[s.current]),u.createElement(Td.Provider,{value:s.current},o)},Jc=/^on(?=[A-Z])/;function Ve(t){return Object.keys(t).reduce((e,n)=>{if(Jc.test(n)){const r=n.replace(Jc,"").toLowerCase();e._events[r]=t[n]}else e[n]=t[n];return e},{_events:{}})}function Un(t,e,n){typeof n=="function"&&t.events.add(e,n)}function Vn(t,e,n){typeof n=="function"&&t.events.remove(e,n)}function gr(t,e,n){Object.keys(Object.assign({},e,n)).forEach(r=>{e[r]!==n[r]&&(Vn(t,r,e[r]),Un(t,r,n[r]))})}const Dd=t=>"default"+t.charAt(0).toUpperCase()+t.slice(1);function tt(t,e){return t[e]!==void 0||t[Dd(e)]===void 0}function X(t,e,n){return(tt(t,e)?t[e]:t[Dd(e)])||n}function nt(t,e,n=null){if(t!==e){if(t&&("current"in t?t.current=null:typeof t=="function"&&t(null)),!e)return;"current"in e?e.current=n:typeof e=="function"&&e(n)}}function Id(t){const{width:e,height:n,style:r,className:i}=t;return r!==void 0||i!==void 0?Object.assign({},r&&{style:r},i&&{className:i}):{style:{width:e,height:n}}}class t1 extends u.Component{constructor(e){super(e),this.state={error:null,errorInfo:null}}componentDidCatch(e,n){const{onError:r=()=>{}}=this.props;r(e),this.setState({error:e,errorInfo:n})}render(){return this.state.error?null:this.props.children}}const ja=t=>({onError:e,...n})=>u.createElement(t1,{onError:e},u.createElement(t,n));class Xr extends u.Component{constructor(){super(),this.instance=null,this.state={instance:null},this._parentElement=null,this._getRef=e=>{this._parentElement=e}}componentDidMount(){this.instance=Xr.mountObject(this._parentElement,this.props.ymaps.Map,this.props),this.setState({instance:this.instance})}componentDidUpdate(e){this.instance!==null&&Xr.updateObject(this.instance,e,this.props)}componentWillUnmount(){Xr.unmountObject(this.instance,this.props)}render(){const e=Id(this.props),n=Ve(this.props),r=Rd(n,["_events","state","defaultState","options","defaultOptions","instanceRef","ymaps","children","width","height","style","className"]);return u.createElement(Fo.Provider,{value:this.state.instance},u.createElement("div",Bn({ref:this._getRef},e,r),this.props.children))}static mountObject(e,n,r){const{instanceRef:i,_events:o}=Ve(r),s=new n(e,X(r,"state"),X(r,"options"));return Object.keys(o).forEach(a=>Un(s,a,o[a])),nt(null,i,s),s}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"state")){const l=X(n,"state",{}),c=X(r,"state",{});l.type!==c.type&&e.setType(c.type),l.behaviors!==c.behaviors&&(l.behaviors&&e.behaviors.disable(l.behaviors),c.behaviors&&e.behaviors.enable(c.behaviors)),c.zoom&&l.zoom!==c.zoom&&e.setZoom(c.zoom),c.center&&l.center!==c.center&&e.setCenter(c.center),c.bounds&&l.bounds!==c.bounds&&e.setBounds(c.bounds)}if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options",{});l!==c&&e.options.set(c)}X(n,"width")===X(r,"width")&&X(n,"height")===X(r,"height")||e.container.fitToViewport(),gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,_events:i}=Ve(n);e!==null&&(Object.keys(i).forEach(o=>Vn(e,o,i[o])),e.destroy(),nt(r))}}const jd=ja(Ia(Xr,!0,["Map"]));jd.defaultProps={width:320,height:240};class no extends u.Component{constructor(){super(),this.state={instance:null},this._parentElement=null,this._getRef=e=>{this._parentElement=e}}componentDidMount(){this._mounted=!0,this.props.ymaps.panorama.isSupported()&&no.mountObject(this._parentElement,this.props.ymaps.panorama,this.props).then(e=>this._mounted&&this.setState({instance:e}))}componentDidUpdate(e){this.state.instance!==null&&no.updateObject(this.state.instance,e,this.props)}componentWillUnmount(){this._mounted=!1,no.unmountObject(this.state.instance,this.props)}render(){const e=Id(this.props);return u.createElement("div",Bn({ref:this._getRef},e))}static mountObject(e,n,r){const{instanceRef:i,_events:o}=Ve(r),s=X(r,"point"),a=X(r,"locateOptions"),l=X(r,"options");return new Promise((c,f)=>{n.locate(s,a).done(d=>{if(d.length>0){const p=new n.Player(e,d[0],l);nt(null,i,p),Object.keys(o).forEach(m=>Un(p,m,o[m])),c(p)}},f)})}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}if(tt(r,"point")){const l=X(r,"point"),c=X(n,"point"),f=X(r,"locateOptions");l!==c&&e.moveTo(l,f)}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,_events:i}=Ve(n);e!==null&&(Object.keys(i).forEach(o=>Vn(e,o,i[o])),nt(r))}}class ro extends u.Component{constructor(){super(),this.state={instance:null},this.instance=null}componentDidMount(){const e=ro.mountControl(this.props.ymaps.control[this.props.name],this.props);this.instance=e,this.setState({instance:e})}componentDidUpdate(e){this.instance!==null&&ro.updateControl(this.instance,e,this.props)}componentWillUnmount(){ro.unmountControl(this.instance,this.props)}render(){return u.createElement(Fo.Provider,{value:this.state.instance},this.props.children)}static mountControl(e,n){const{instanceRef:r,parent:i,lazy:o,_events:s}=Ve(n),a=new e({data:X(n,"data"),options:X(n,"options"),state:X(n,"state"),mapTypes:X(n,"mapTypes"),lazy:o});if(Object.keys(s).forEach(l=>Un(a,l,s[l])),i&&i.controls&&typeof i.controls.add=="function")i.controls.add(a);else{if(!i||!i.add||typeof i.add!="function")throw new Error(`No parent found to mount ${n.name}`);i.add(a)}return nt(null,r,a),a}static updateControl(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}if(tt(r,"data")){const l=X(n,"data"),c=X(r,"data");l!==c&&e.data.set(c)}if(tt(r,"state")){const l=X(n,"state"),c=X(r,"state");l!==c&&e.state.set(c)}if(tt(r,"mapTypes")){const l=X(n,"mapTypes"),c=X(r,"mapTypes");l!==c&&(e.removeAllMapTypes(),c.forEach(f=>e.addMapType(f)))}gr(e,s,i),nt(a,o,e)}static unmountControl(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.controls&&typeof i.controls.remove=="function"?i.controls.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}class io extends u.Component{constructor(){super(),this.state={instance:null},this.instance=null}componentDidMount(){const e=io.mountObject(this.props.ymaps.Clusterer,this.props);this.instance=e,this.setState({instance:e})}componentDidUpdate(e){this.state.instance!==null&&io.updateObject(this.instance,e,this.props)}componentWillUnmount(){io.unmountObject(this.instance,this.props)}render(){return u.createElement(Fo.Provider,{value:this.state.instance},this.props.children)}static mountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n),s=new e(X(n,"options"));if(Object.keys(o).forEach(a=>Un(s,a,o[a])),i.geoObjects&&typeof i.geoObjects.add=="function")i.geoObjects.add(s);else{if(!i.add||typeof i.add!="function")throw new Error("No parent found to mount Clusterer");i.add(s)}return nt(null,r,s),s}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.geoObjects&&typeof i.geoObjects.remove=="function"?i.geoObjects.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}class Qr extends u.Component{constructor(){super(),this.state={instance:null}}componentDidMount(){const e=Qr.mountObject(this.props.ymaps.ObjectManager,this.props);this.instance=e,this.setState({instance:e})}componentDidUpdate(e){this.instance!==null&&Qr.updateObject(this.instance,e,this.props)}componentWillUnmount(){Qr.unmountObject(this.instance,this.props)}render(){return null}static mountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n),s=X(n,"options",{}),a=X(n,"features",{}),l=X(n,"filter",null),c=X(n,"objects",{}),f=X(n,"clusters",{}),d=new e(s);if(d.add(a||[]),d.setFilter(l),d.objects.options.set(c),d.clusters.options.set(f),Object.keys(o).forEach(p=>Un(d,p,o[p])),i.geoObjects&&typeof i.geoObjects.add=="function")i.geoObjects.add(d);else{if(!i.add||typeof i.add!="function")throw new Error("No parent found to mount ObjectManager");i.add(d)}return nt(null,r,d),d}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}if(tt(r,"objects")){const l=X(n,"objects"),c=X(r,"objects");l!==c&&e.objects.options.set(c)}if(tt(r,"clusters")){const l=X(n,"clusters"),c=X(r,"clusters");l!==c&&e.clusters.options.set(c)}if(tt(r,"filter")){const l=X(n,"filter"),c=X(r,"filter");l!==c&&e.setFilter(c)}if(tt(r,"features")){const l=X(n,"features"),c=X(r,"features");l!==c&&(e.remove(l),e.add(c))}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.geoObjects&&typeof i.geoObjects.remove=="function"?i.geoObjects.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}var n1=ja(Ad(Ia(Qr,!0,["ObjectManager"])));class ei extends u.Component{constructor(){super(),this.state={instance:null},this.instance=null}componentDidMount(){const{name:e,ymaps:n,dangerZone:r}=this.props,i=ei.mountObject(r&&typeof r.modifyConstructor=="function"?r.modifyConstructor(n[e]):n[e],this.props);this.instance=i,this.setState({instance:i})}componentDidUpdate(e){this.instance!==null&&ei.updateObject(this.instance,e,this.props)}componentWillUnmount(){ei.unmountObject(this.instance,this.props)}render(){return null}static mountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n),s=new e(X(n,"geometry"),X(n,"properties"),X(n,"options"));if(Object.keys(o).forEach(a=>Un(s,a,o[a])),i&&i.geoObjects&&typeof i.geoObjects.add=="function")i.geoObjects.add(s);else{if(!i||!i.add||typeof i.add!="function")throw new Error(`No parent found to mount ${n.name}`);i.add(s)}return nt(null,r,s),s}static updateObject(e,n,r){const{_events:i,instanceRef:o}=Ve(r),{_events:s,instanceRef:a}=Ve(n);if(tt(r,"geometry")){const l=X(n,"geometry",{}),c=X(r,"geometry",{});Array.isArray(c)&&c!==l?Array.isArray(c[0])&&typeof c[1]=="number"?(e.geometry.setCoordinates(c[0]),e.geometry.setRadius(c[1])):e.geometry.setCoordinates(c):typeof c=="object"&&(c.coordinates!==l.coordinates&&e.geometry.setCoordinates(c.coordinates),c.radius!==l.radius&&e.geometry.setRadius(c.radius))}if(tt(r,"properties")){const l=X(n,"properties"),c=X(r,"properties");l!==c&&e.properties.set(c)}if(tt(r,"options")){const l=X(n,"options"),c=X(r,"options");l!==c&&e.options.set(c)}gr(e,s,i),nt(a,o,e)}static unmountObject(e,n){const{instanceRef:r,parent:i,_events:o}=Ve(n);e!==null&&(Object.keys(o).forEach(s=>Vn(e,s,o[s])),i.geoObjects&&typeof i.geoObjects.remove=="function"?i.geoObjects.remove(e):i.remove&&typeof i.remove=="function"&&i.remove(e),nt(r))}}var Yc=ja(Ad(Ia(t=>u.createElement(ei,Bn({},t,{name:"Placemark"})),!0,["Placemark"])));const Xc=(t,e,n)=>t==null?void 0:t.map(r=>{var i;return{id:r.uid,type:"Feature",properties:{point:r},geometry:{type:"Point",coordinates:[r.location.latitude,r.location.longitude]},options:{hideIconOnBalloonOpen:!1,preset:oo(r.type),balloonOffset:[0,-Yn[1]],balloonContentLayout:(i=e==null?void 0:e.templateLayoutFactory)==null?void 0:i.createClass(n)}}}),oo=(t,e)=>t===30?`custom#pin-locker${e?`__${e}`:""}`:`custom#pin-pvz${e?`__${e}`:""}`,Ur=t=>[-(t[0]/2),-t[1]],r1={en:"en_US",ru:"ru_RU"},i1={load:"suggest",apikey:"5298a725-4baa-457a-a2a7-c3abac81db20"},o1=["templateLayoutFactory","option.presetStorage","geocode"],s1=["objectManager.addon.objectsBalloon"],Qc=["geoObject.addon.balloon"],a1={yandexMapDisablePoiInteractivity:!1},l1={clusterize:!0},eu={iconImageSize:Xt,iconLayout:"default#image",hideIconOnBalloonOpen:!1,balloonOffset:[0,-Xt[1]],iconImageOffset:Ur(Xt)},c1="MapYandex-module__root__r3kDJ8",u1="MapYandex-module__overlay__f7UGYS",f1="MapYandex-module__details__E3bDvL",gs={root:c1,overlay:u1,details:f1},d1=({className:t})=>{const{t:e}=jt(["courier_balloon","common"]),n=u.useRef(),r=u.useRef(null),{map:i,locale:o,disableDelivery:s,hideDetails:a,hideMapUI:l,onPointClick:c}=st(),[f,d]=u.useState(null),[p,m]=u.useState([]),[g,h]=u.useState(l1),S=en(),w=zt(Qf),y=zt(Oa),b=Ze(ko),_=bt(T=>T.location),E=u.useRef([]),v=u.useMemo(()=>$i.renderToString(x.jsx(kd,{SSR:!0,hideDetails:a})).replace("{ choose }",e("choose")).replace("{ details }",e("details")),[e,o,a]),L=u.useMemo(()=>$i.renderToString(x.jsx(ia,{SSR:!0,variant:"default",hideDetails:a})).replace("{ details }",e("details",{ns:"common"})).replace("{ courier_balloon.title }",e("title")),[e,o,a]),C=u.useMemo(()=>$i.renderToString(x.jsx(ia,{SSR:!0,variant:"error",hideDetails:a})).replace("{ courier_balloon.error_title }",e("error_title")).replace("{ courier_balloon.error_description }",e("error_description")),[e,o,a]),k=u.useMemo(()=>({zoom:(i==null?void 0:i.initialZoom)??aa,center:(i==null?void 0:i.center)??co,behaviors:["default","scrollZoom"]}),[i==null?void 0:i.center,i==null?void 0:i.initialZoom]);u.useEffect(()=>{var T,N;(N=n.current)==null||N.events.fire("boundschange",{newBounds:(T=n.current)==null?void 0:T.getBounds()})},[f]),u.useEffect(()=>{var N;if(!f||!r.current)return;for(const V of E.current)V.id!==(_==null?void 0:_.uid)&&((N=r.current)==null||N.remove(V));const T=Xc(w,f,v);E.current=T,r.current.add(T)},[v,f,w,_==null?void 0:_.uid]);const M=u.useCallback(T=>{const N=T.get("newBounds");zt.getState().loadNext([[N[0][0],N[1][0]],[N[0][1],N[1][1]]],S)},[S]),O=u.useRef(_),P=u.useCallback(T=>{var N,V,Z,I;d(T),ye.getState().setLoaded(),(N=T==null?void 0:T.option)==null||N.presetStorage.add("custom#pin-locker",{iconImageSize:Xt,iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinLocker,"--owl-color-primary")),iconImageOffset:Ur(Xt)}),(V=T==null?void 0:T.option)==null||V.presetStorage.add("custom#pin-locker__active",{iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinLocker,"--owl-color-success")),iconImageSize:Yn,iconImageOffset:Ur(Yn)}),(Z=T==null?void 0:T.option)==null||Z.presetStorage.add("custom#pin-pvz",{iconImageSize:Xt,iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinPvz,"--owl-color-grey-80")),iconImageOffset:Ur(Xt)}),(I=T==null?void 0:T.option)==null||I.presetStorage.add("custom#pin-pvz__active",{iconLayout:"default#image",iconImageHref:Jt(xt(Rt.PinPvz,"--owl-color-black")),iconImageSize:Yn,iconImageOffset:Ur(Yn)}),h(K=>({...K,clusterIconColor:_a("--owl-color-primary")})),m(Xc(w,T,v))},[v,w]),j=u.useCallback(()=>{ye.getState().setDetailsOpen(!0)},[]),U=u.useCallback(()=>{var T;O.current&&(c==null||c(O.current),ye.getState().setDetailsOpen(!1),bt.getState().setSelectedLocation(null),Ze.getState().setDeliverPoint(null),(T=n.current)==null||T.balloon.close())},[c]),$=u.useCallback(()=>{var T,N;(T=document.getElementById(lo))==null||T.addEventListener("click",j),(N=document.getElementById(Os))==null||N.addEventListener("click",U)},[U,j]),G=u.useCallback(T=>{var V,Z,I,K,ee,q;const N=T.get("objectId");((V=O.current)==null?void 0:V.uid)===N&&((K=r.current)==null||K.objects.setObjectOptions((Z=O.current)==null?void 0:Z.uid,{preset:oo((I=O.current)==null?void 0:I.type)}),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null),Ze.getState().setDeliverPoint(null),O.current=null),(ee=document.getElementById(lo))==null||ee.removeEventListener("click",j),(q=document.getElementById(Os))==null||q.removeEventListener("click",U)},[U,j]),z=u.useCallback(T=>{var I,K,ee,q;const N=T.get("objectId"),V=(K=(I=r.current)==null?void 0:I.objects)==null?void 0:K.getById(N);if(!V)return;const Z=V.properties.point;ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(Z),(ee=r.current)==null||ee.objects.each(se=>{var ue;const de=se;(ue=r.current)==null||ue.objects.setObjectOptions(de.id,{preset:oo(de.properties.point.type)})}),(q=r.current)==null||q.objects.setObjectOptions(N,{preset:oo(Z.type,"active")}),O.current=Z},[]),W=u.useCallback(async T=>{if(!f||s)return;const N=T.get("coords"),{geoObjects:V}=await f.geocode(N),Z=V.get(0),I=Z.getAddressLine(),K=Z.properties.get("metaDataProperty.GeocoderMetaData.precision",{});if(bt.getState().setSelectedLocation(null),K!=="exact"){Ze.getState().setDeliverPoint({coords:N,address:null});return}Ze.getState().setDeliverPoint({coords:N,address:I})},[s,f]),D=u.useMemo(()=>{var T;return{...eu,iconImageHref:Jt(xt(Rt.PinHome,"--owl-color-success")),balloonContentLayout:(T=f==null?void 0:f.templateLayoutFactory)==null?void 0:T.createClass(L)}},[L,f==null?void 0:f.templateLayoutFactory]),R=u.useMemo(()=>{var T;return{...eu,iconImageHref:Jt(xt(Rt.PinHome,"--owl-color-success")),balloonContentLayout:(T=f==null?void 0:f.templateLayoutFactory)==null?void 0:T.createClass(C)}},[C,f==null?void 0:f.templateLayoutFactory]),A=u.useCallback(T=>{var N,V,Z,I,K;(N=T==null?void 0:T.balloon)==null||N.open(),(Z=(V=T==null?void 0:T.balloon)==null?void 0:V.events)==null||Z.add("open",$),(K=(I=T==null?void 0:T.balloon)==null?void 0:I.events)==null||K.add("close",G)},[G,$]);return x.jsxs("div",{className:be(gs.root,t,{[gs.hideUI]:l}),children:[x.jsx(e1,{query:{...i1,lang:r1[o??"ru"]},children:x.jsxs(jd,{width:"100%",height:"100%",state:k,instanceRef:n,options:a1,modules:o1,onLoad:P,onClick:W,onBoundsChange:M,children:[(b==null?void 0:b.address)&&x.jsx(Yc,{properties:b,modules:Qc,geometry:b.coords,options:D,instanceRef:A},JSON.stringify(b.coords)),b&&!b.address&&x.jsx(Yc,{modules:Qc,geometry:b.coords,instanceRef:A,options:R},JSON.stringify(b.coords)),x.jsx(n1,{features:p,instanceRef:r,modules:s1,options:g,onClick:z,onBalloonOpen:$,onBalloonClose:G})]})},o),y&&x.jsx(ka,{className:gs.overlay,children:x.jsx(ti,{})})]})},p1=u.memo(d1),h1=t=>({google:KL,yandex:p1})[t];function Nd(...t){return u.useCallback(e=>{for(const n of t)typeof n=="function"?n(e):n&&typeof n=="object"&&(n.current=e)},t)}const _o=t=>{const e=u.useCallback(()=>{var n;(n=t==null?void 0:t.onClick)==null||n.call(t,t.name)},[t]);return{ref:t==null?void 0:t.ref,name:t==null?void 0:t.name,onClick:e}},g1=()=>{throw new Error("useMediaQuery is a client-only hook")};function v1(t){const e=u.useCallback(r=>{const i=window.matchMedia(t);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),n=()=>window.matchMedia(t).matches;return u.useSyncExternalStore(e,n,g1)}const m1="768px",y1="1024px",b1="1280px",w1="1536px",S1={screenSm:m1,screenMd:y1,screenLg:b1,screenXl:w1};function pi(t){return v1(`(max-width: calc(${S1[t]} - 1px))`)}const L1=(t,e,n)=>{const{disableGeolocation:r}=n??{},i=ye(Ou);u.useEffect(()=>{i&&ye.getState().setLoaded()},[i]);const o=t[0],s=t[1];u.useEffect(()=>{if(!i)return;const a=[o,s],l=async()=>{var f;const c=await ur(a,"GEOMETRIC_CENTER");$t.getState().setPlace((f=c.results)==null?void 0:f[0],aa)};if(r){l();return}Ca(async c=>{var m;const{latitude:f,longitude:d}=c.coords,p=await ur([f,d],"GEOMETRIC_CENTER");$t.getState().setPlace((m=p.results)==null?void 0:m[0])},()=>l())},[o,s,i,e,r])},E1=t=>{u.useEffect(()=>{t&&(yu.changeLanguage(t),xo.setLanguage(t))},[t])},x1=t=>{u.useEffect(()=>{if(t){const e=Object.keys(t);for(const n of e){const r=t[n];r&&Vo(`--owl-color-${n}`,r)}}},[t])},C1=t=>{u.useEffect(()=>{t&&t!==void 0&&Vo("--owl-button-radius",`${t}px`)},[t])},_1=t=>{u.useEffect(()=>{t&&t!==void 0&&Vo("--owl-font",t)},[t])},O1=t=>{const e=t==="selector";u.useEffect(()=>{e&&kn.getState().toggle(!0)},[e])},M1="Separator-module__root__buxoVg",P1={root:M1},vs=({className:t,...e})=>x.jsx("hr",{className:be(P1.root,t),...e}),k1="Sidebar-module__root__hxXudu",R1="Sidebar-module__closeButton__8k-Ph3",T1="Sidebar-module__open__qMGUBV",A1="Sidebar-module__header__Eu-wRc",D1="Sidebar-module__typeFilter__-lxVdY",I1="Sidebar-module__separator__XDb6rs",j1="Sidebar-module__withRightPadding__knvmuY",N1="Sidebar-module__sheetContent__4iWeTf",B1="Sidebar-module__doneButton__chvXVP",Yt={root:k1,closeButton:R1,open:T1,header:A1,typeFilter:D1,separator:I1,withRightPadding:j1,sheetContent:N1,doneButton:B1},U1=()=>{const{t}=jt("common"),e=pi("screenSm"),n=or(i=>i.toggle),r=()=>{n(!1)};return x.jsxs("div",{className:Yt.header,children:[e&&x.jsx("div",{className:Yt.doneButton,onClick:r,children:t("done")}),!e&&x.jsx(di,{className:Yt.closeButton,onClick:r})]})},V1="TypeFilter-module__root__FEaBBU",F1="TypeFilter-module__button__RYOzBQ",Vi={root:V1,button:F1},z1=({value:t,onChange:e,className:n})=>{const{t:r}=jt("type_filter"),i=o=>()=>e==null?void 0:e(o);return x.jsxs("div",{className:be(Vi.root,n),children:[x.jsx(_t,{className:Vi.button,variant:t===Kt.All?"primary":"secondary",onClick:i(Kt.All),children:r("all")}),x.jsx(_t,{className:Vi.button,variant:t===Kt.PostOffice?"primary":"secondary",onClick:i(Kt.PostOffice),children:r("post_office")}),x.jsx(_t,{className:Vi.button,variant:t===Kt.PickPoint?"primary":"secondary",onClick:i(Kt.PickPoint),children:r("pick_point")})]})},$1=({className:t,onChange:e})=>{const n=en(kb);return x.jsx(z1,{value:n,className:t,onChange:e})},H1=u.memo($1),G1="Radio-module__root__FMbfCi",W1="Radio-module__label__-LLJSR",tu={root:G1,label:W1},Z1=({label:t,className:e,labelProps:n={},...r})=>{const{className:i,...o}=n;return x.jsxs("label",{className:be(tu.label,i),...o,children:[x.jsx("input",{type:"radio",className:be(tu.root,e),...r}),t]})},rr=t=>x.jsx(Z1,{...t,type:"checkbox"}),q1="RadioGroup-module__root__wNjmrq",K1="RadioGroup-module__body__n4Ho0-",J1="RadioGroup-module__legend__ECksBN",ms={root:q1,body:K1,legend:J1},Bd=({label:t,value:e,onChange:n,children:r,className:i,...o})=>x.jsxs("div",{className:be(ms.root,i),...o,children:[t&&x.jsx("span",{className:ms.legend,children:t}),x.jsx("div",{className:ms.body,children:u.Children.map(r,s=>u.isValidElement(s)?u.cloneElement(s,{checked:!!(e!=null&&e[s.props.value]),onChange:a=>n==null?void 0:n({...e,[a.target.value]:a.target.checked})}):null)})]}),Y1=({className:t,onChange:e})=>{const{t:n}=jt("send_filter"),r=en(Rb);return x.jsxs(Bd,{className:t,value:r,label:n("title"),onChange:e,children:[x.jsx(rr,{name:"send",value:It.Return,label:n("sending_returns")}),x.jsx(rr,{name:"send",value:It.Shipping,label:n("shipping")}),x.jsx(rr,{name:"send",value:It.Payment,label:n("payment")})]})},X1=u.memo(Y1),Q1=({className:t,onChange:e})=>{const{t:n}=jt("receive_filter"),r=en(Tb);return x.jsxs(Bd,{value:r,label:n("title"),onChange:e,className:t,children:[x.jsx(rr,{name:"receive",value:Dt.DressingRoom,label:n("dressing_room")}),x.jsx(rr,{name:"receive",value:Dt.CheckOrder,label:n("check_order")}),x.jsx(rr,{name:"receive",value:Dt.PayByCash,label:n("pay_by_cash")})]})},eE=u.memo(Q1);const tE=({className:t})=>{const e=pi("screenSm"),n=or(l=>l.open),r=u.useCallback(l=>en.getState().setFilter({type:l}),[]),i=u.useCallback(l=>en.getState().setFilter({send:l}),[]),o=u.useCallback(l=>en.getState().setFilter({receive:l}),[]),s=u.useCallback(()=>or.getState().toggle(!1),[]),a=x.jsxs(x.Fragment,{children:[x.jsx(U1,{}),x.jsxs("div",{className:Yt.withRightPadding,children:[x.jsx(H1,{className:Yt.typeFilter,onChange:r}),x.jsx(vs,{className:Yt.separator}),x.jsx(eE,{onChange:o}),x.jsx(vs,{}),x.jsx(X1,{onChange:i}),x.jsx(vs,{})]})]});return e?x.jsx(Of,{initialFocusRef:!1,open:n,snapPoints:({maxHeight:l})=>l-Sd,onDismiss:s,children:x.jsx("div",{className:Yt.sheetContent,children:a})}):x.jsx("div",{className:be(Yt.root,t,{[Yt.open]:n}),children:a})},nE=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:60,height:40,fill:"none",viewBox:"0 0 60 40",...t},ce.createElement("path",{d:"M0 0h52a8 8 0 0 1 8 8v24a8 8 0 0 1-8 8H0V0Z"}),ce.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.5,d:"M32.093 10h13.814c1.151 0 2.093.91 2.093 2.02v2.223c0 .808-.523 1.818-1.047 2.324l-4.5 3.839c-.627.505-1.046 1.515-1.046 2.323v4.344c0 .607-.419 1.415-.942 1.718L39 29.7c-1.36.808-3.244-.101-3.244-1.717v-5.355c0-.707-.419-1.616-.837-2.121l-3.977-4.041c-.523-.506-.942-1.415-.942-2.02V12.12c0-1.21.942-2.12 2.093-2.12Z"})),rE=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",viewBox:"0 0 28 28",...t},ce.createElement("rect",{width:28,height:28,fill:"#333",rx:4}),ce.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.165 7h9.67c.806 0 1.465.636 1.465 1.414V9.97c0 .566-.366 1.273-.733 1.627l-3.15 2.687c-.44.353-.732 1.06-.732 1.627v3.04c0 .425-.293.99-.66 1.203L14 20.79c-.952.566-2.271-.07-2.271-1.202V15.84c0-.495-.293-1.132-.586-1.485l-2.784-2.83c-.366-.353-.659-.99-.659-1.413V8.485C7.7 7.636 8.36 7 9.165 7Z"})),iE="MapContainer-module__root__nze9pB",oE="MapContainer-module__mapWrapper__twRo4C",sE="MapContainer-module__wrapperBlurred__U-Ohae",aE="MapContainer-module__locationSelector__lEiSKq",lE="MapContainer-module__filterButton__jIRGu9",cE="MapContainer-module__sidebarOpen__sUhaH-",uE="MapContainer-module__filterIcon__-2Qd2d",fE="MapContainer-module__details__sAP6T2",Ft={root:iE,mapWrapper:oE,wrapperBlurred:sE,locationSelector:aE,filterButton:lE,sidebarOpen:cE,filterIcon:uE,details:fE},dE=()=>{const t=or(i=>i.open),e=or(i=>i.toggle),n=pi("screenSm"),r=()=>{e(!0)};return x.jsxs("div",{className:be(Ft.filterButton,{[Ft.sidebarOpen]:t}),onClick:n?void 0:r,children:[n&&x.jsx(Pu,{}),n?x.jsx(rE,{className:Ft.filterIcon,onClick:r}):x.jsx(nE,{className:Ft.filterIcon})]})};var Ud={},zo={},Vd={exports:{}},pE="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",hE=pE,gE=hE;function Fd(){}function zd(){}zd.resetWarningCache=Fd;var vE=function(){function t(r,i,o,s,a,l){if(l!==gE){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:zd,resetWarningCache:Fd};return n.PropTypes=n,n};Vd.exports=vE();var mE=Vd.exports,$o={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.loadGoogleMapScript=fr.isBrowser=void 0;var $d=typeof window<"u"&&window.document;fr.isBrowser=$d;var yE=function(e,n){if(!$d||typeof google<"u"&&google.maps&&google.maps.api)return Promise.resolve();var r=document.querySelectorAll('script[src*="'.concat(e,'"]'));if(r&&r.length)return new Promise(function(s){if(typeof google<"u")return s();r[0].addEventListener("load",function(){return s()})});var i=new URL(n);i.searchParams.set("callback","__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__");var o=document.createElement("script");return o.src=i.toString(),new Promise(function(s){window.__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__=s,document.body.appendChild(o)})};fr.loadGoogleMapScript=yE;var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.GOOGLE_MAP_SCRIPT_BASE_URL=void 0;var bE="https://maps.googleapis.com/maps/api/js";Ho.GOOGLE_MAP_SCRIPT_BASE_URL=bE;function so(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?so=function(n){return typeof n}:so=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},so(t)}Object.defineProperty($o,"__esModule",{value:!0});$o.default=CE;var yt=SE(u),ys=fr,wE=Ho;function Hd(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Hd=function(i){return i?n:e})(t)}function SE(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||so(t)!=="object"&&typeof t!="function")return{default:t};var n=Hd(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function nu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ru(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?nu(Object(n),!0).forEach(function(r){LE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function LE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EE(t,e){if(t==null)return{};var n=xE(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xE(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function CE(t){var e=t.ref,n=t.onPlaceSelected,r=t.apiKey,i=t.libraries,o=i===void 0?"places":i,s=t.inputAutocompleteValue,a=s===void 0?"new-password":s,l=t.options;l=l===void 0?{}:l;var c=l.types,f=c===void 0?["(cities)"]:c,d=l.componentRestrictions,p=l.fields,m=p===void 0?["address_components","geometry.location","place_id","formatted_address"]:p,g=l.bounds,h=EE(l,["types","componentRestrictions","fields","bounds"]),S=t.googleMapsScriptBaseUrl,w=S===void 0?wE.GOOGLE_MAP_SCRIPT_BASE_URL:S,y=t.language,b=(0,yt.useRef)(null),_=(0,yt.useRef)(null),E=(0,yt.useRef)(null),v=(0,yt.useRef)(null),L=y?"&language=".concat(y):"",C="".concat(w,"?libraries=").concat(o,"&key=").concat(r).concat(L),k=(0,yt.useCallback)(function(){return(0,ys.loadGoogleMapScript)(w,C)},[w,C]);return(0,yt.useEffect)(function(){var M=ru(ru({},h),{},{fields:m,types:f,bounds:g});if(d&&(M.componentRestrictions=d),!(E.current||!b.current||!ys.isBrowser)){e&&!e.current&&(e.current=b.current);var O=function(){var j;if(typeof google>"u")return console.error("Google has not been found. Make sure your provide apiKey prop.");if(!((j=google.maps)!==null&&j!==void 0&&j.places))return console.error("Google maps places API must be loaded.");if(!b.current instanceof HTMLInputElement)return console.error("Input ref must be HTMLInputElement.");E.current=new google.maps.places.Autocomplete(b.current,M),E.current&&(_.current=E.current.addListener("place_changed",function(){n&&E&&E.current&&n(E.current.getPlace(),b.current,E.current)}))};return r?k().then(function(){return O()}):O(),function(){return _.current?_.current.remove():void 0}}},[]),(0,yt.useEffect)(function(){var M;!(yt.default!==null&&yt.default!==void 0&&(M=yt.default.version)!==null&&M!==void 0&&M.startsWith("18"))&&ys.isBrowser&&window.MutationObserver&&b.current&&b.current instanceof HTMLInputElement&&(v.current=new MutationObserver(function(){v.current.disconnect(),b.current&&(b.current.autocomplete=a)}),v.current.observe(b.current,{attributes:!0,attributeFilter:["autocomplete"]}))},[a]),(0,yt.useEffect)(function(){E.current&&E.current.setFields(m)},[m]),(0,yt.useEffect)(function(){E.current&&E.current.setBounds(g)},[g]),(0,yt.useEffect)(function(){E.current&&E.current.setComponentRestrictions(d)},[d]),(0,yt.useEffect)(function(){E.current&&E.current.setOptions(h)},[h]),{ref:b,autocompleteRef:E}}function ao(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ao=function(n){return typeof n}:ao=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ao(t)}Object.defineProperty(zo,"__esModule",{value:!0});zo.default=void 0;var oa=OE(u),We=Gd(mE),_E=Gd($o);function Gd(t){return t&&t.__esModule?t:{default:t}}function Wd(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Wd=function(i){return i?n:e})(t)}function OE(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||ao(t)!=="object"&&typeof t!="function")return{default:t};var n=Wd(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function Oo(){return Oo=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Oo.apply(this,arguments)}function ME(t,e){if(t==null)return{};var n=PE(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function PE(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Zd(t){var e=t.onPlaceSelected,n=t.apiKey,r=t.libraries,i=t.inputAutocompleteValue,o=t.options,s=t.googleMapsScriptBaseUrl,a=t.refProp,l=t.language,c=ME(t,["onPlaceSelected","apiKey","libraries","inputAutocompleteValue","options","googleMapsScriptBaseUrl","refProp","language"]),f=(0,_E.default)({ref:a,googleMapsScriptBaseUrl:s,onPlaceSelected:e,apiKey:n,libraries:r,inputAutocompleteValue:i,options:o,language:l}),d=f.ref;return oa.default.createElement("input",Oo({ref:d},c))}Zd.propTypes={apiKey:We.default.string,libraries:We.default.arrayOf(We.default.string),ref:We.default.oneOfType([We.default.func,We.default.shape({current:We.default.any})]),googleMapsScriptBaseUrl:We.default.string,onPlaceSelected:We.default.func,inputAutocompleteValue:We.default.string,options:We.default.shape({componentRestrictions:We.default.object,bounds:We.default.object,location:We.default.object,offset:We.default.number,origin:We.default.object,radius:We.default.number,sessionToken:We.default.object,types:We.default.arrayOf(We.default.string)}),language:We.default.string};var kE=(0,oa.forwardRef)(function(t,e){return oa.default.createElement(Zd,Oo({},t,{refProp:e}))});zo.default=kE;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"usePlacesWidget",{enumerable:!0,get:function(){return n.default}});var e=r(zo),n=r($o);function r(i){return i&&i.__esModule?i:{default:i}}})(Ud);var qd=Ud;const RE=t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",viewBox:"0 0 20 20",...t},ce.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M14.617 16.032a9 9 0 1 1 1.414-1.414l3.676 3.675a1 1 0 0 1-1.414 1.414l-3.676-3.675ZM2 9a7 7 0 1 1 12.04 4.858 1.005 1.005 0 0 0-.182.182A7 7 0 0 1 2 9Z",clipRule:"evenodd"})),TE="Input-module__root__4cwtKq",AE="Input-module__endAdornment__Tv4vyT",DE="Input-module__input__qeMAQB",IE="Input-module__startAdornment__4bXzn1",jE="Input-module__label__N2eUZ2",NE="Input-module__inputContainer__Ticemx",Kn={root:TE,endAdornment:AE,input:DE,startAdornment:IE,label:jE,inputContainer:NE},Kd=u.forwardRef(({label:t,className:e,startAdornment:n,endAdornment:r,onChange:i,onBlur:o,inputRef:s,...a},l)=>{const c=u.useRef(null);u.useImperativeHandle(l,()=>({focus:()=>{var d;(d=c.current)==null||d.focus()},blur:()=>{var d;(d=c.current)==null||d.blur()},setValue:d=>{if(i){i({target:{value:d}});return}if(o){o({target:{value:d}});return}c.current&&(c.current.value=d)}}),[o,i]);const f=Nd(s,c);return x.jsxs("label",{className:be(Kn.root,e),children:[t&&x.jsx("span",{className:Kn.label,children:t}),x.jsxs("div",{className:Kn.inputContainer,children:[n&&x.jsx("div",{className:Kn.startAdornment,children:n}),x.jsx("input",{...a,ref:f,className:Kn.input,onChange:i,onBlur:o}),r&&x.jsx("div",{className:Kn.endAdornment,children:r})]})]})}),BE=({className:t})=>{const{t:e}=jt("location_selector"),{country:n,inputs:r,onLocationSelect:i}=st(),[o,s]=u.useState(""),[a,l]=u.useState(!1),c=[],f=n?{componentRestrictions:{country:n},types:c}:{types:c},d=y=>{$t.getState().setPlace(y),i==null||i(y)},{ref:p}=qd.usePlacesWidget({libraries:["places"],options:f,onPlaceSelected:d,inputAutocompleteValue:o}),m=y=>{a&&ye.getState().setBlurred(!!y.target.value),s(y.target.value)},g=()=>{o&&ye.getState().setBlurred(!0),ye.getState().setDetailsOpen(!1),Ze.getState().setDeliverPoint(null),bt.getState().setSelectedLocation(null),l(!0)},h=()=>{ye.getState().setBlurred(!1),l(!1)},S=y=>{y.key==="Enter"&&y.preventDefault()},w=_o(r==null?void 0:r.address);return x.jsx(Kd,{...w,inputRef:p,value:o,className:t,endAdornment:x.jsx(RE,{}),placeholder:e("placeholder"),onChange:m,onFocus:g,onBlur:h,onKeyDown:S})},UE=({className:t})=>ye(jh)?x.jsx(BE,{className:t}):null,VE=u.memo(UE),FE="DeliveryDetailsModal-module__root__lnsoXP",zE={root:FE},$E=({onClose:t,onSubmit:e,location:n,className:r})=>x.jsx("div",{className:be(zE.root,r),children:x.jsx(_d,{location:n,onClose:t,onSubmit:e})}),HE="LocationDetailsModal-module__root__AzUydF",GE={root:HE},WE=({onClose:t,onSubmit:e,location:n,className:r})=>{const i=()=>{e==null||e(n)};return x.jsx("div",{className:be(GE.root,r),children:x.jsx(Pd,{location:n,onClose:t,onSubmit:i})})},ZE=()=>{const{onPointClick:t}=st(),e=ye(la),n=bt(ig),r=Ze(ko),i=u.useCallback(()=>{ye.getState().setDetailsOpen(!1)},[]),o=u.useCallback(s=>{t==null||t(s),ye.getState().setDetailsOpen(!1),bt.getState().setSelectedLocation(null),Ze.getState().setDeliverPoint(null)},[t]);return x.jsxs(x.Fragment,{children:[(r==null?void 0:r.address)&&e&&x.jsx($E,{location:r,className:Ft.details,onClose:i,onSubmit:o}),n&&e&&x.jsx(WE,{location:n,className:Ft.details,onClose:i,onSubmit:o})]})},qE=({className:t,children:e})=>{const{hideFilters:n,hideSearchInput:r}=st(),i=ye(Ih),o=ye(la);return x.jsxs("div",{className:be(Ft.root,t),children:[!r&&!o&&x.jsx(VE,{className:Ft.locationSelector}),!n&&x.jsx(dE,{}),x.jsx("div",{className:be(Ft.mapWrapper,{[Ft.wrapperBlurred]:i}),children:e}),x.jsx(ZE,{})]})},KE=u.memo(qE),JE="Aside-module__root__JSqCyF",YE="Aside-module__open__t8OMLZ",XE="Aside-module__overlay__0UAvMb",QE="Aside-module__container__KJNP0t",Fi={root:JE,open:YE,overlay:XE,container:QE},ex=({open:t,children:e,className:n})=>x.jsxs("div",{className:be(Fi.root,n,{[Fi.open]:t}),children:[x.jsx("div",{className:Fi.overlay}),x.jsx("div",{className:Fi.container,children:e})]}),tx="LocationAside-module__submit__hx8LTK",nx="LocationAside-module__container__KEGf9s",rx="LocationAside-module__selector__ogsvtz",ix="LocationAside-module__label__-FWqoq",ox="LocationAside-module__header__qmaQaV",sx="LocationAside-module__close__bklFI7",zi={submit:tx,container:nx,selector:rx,label:ix,header:ox,close:sx},ax=u.forwardRef((t,e)=>{const{t:n}=jt(["location_aside","common"]),r=kn(sg),{country:i,inputs:o,hideCloseButtonOnLocationScreen:s,onLocationSelect:a,onCloseLocationSelector:l}=st(),c=u.useRef(null),[f,d]=u.useState("");u.useImperativeHandle(e,()=>({open:()=>kn.getState().toggle(!0),close:()=>kn.getState().toggle(!1)}),[]);const p=y=>{kn.getState().toggle(!1),$t.getState().setPlace(y),a==null||a(y),y!=null&&y.formatted_address&&d(y==null?void 0:y.formatted_address)},m=()=>{kn.getState().toggle(!1),l==null||l()},g=i?{componentRestrictions:{country:i}}:void 0,h=y=>{d(y.target.value)},{ref:S}=qd.usePlacesWidget({libraries:["places"],options:g,onPlaceSelected:p,apiKey:"AIzaSyBEboFjQh8dJQlWwWZy-2Zzmw7Dsr6-NiA",inputAutocompleteValue:f}),w=_o(o==null?void 0:o.city);return x.jsx(ex,{open:r,children:x.jsx("div",{ref:c,className:zi.container,children:x.jsxs("div",{className:zi.selector,children:[x.jsxs("div",{className:zi.header,children:[x.jsx("div",{className:zi.label,children:n("choose_city")}),!s&&x.jsx(di,{position:"relative",onClick:m})]}),x.jsx(Kd,{...w,inputRef:S,value:f,placeholder:n("placeholder"),onChange:h})]})})})}),lx=u.memo(ax),Na=()=>x.jsx(ka,{children:x.jsx(ti,{})}),cx=({children:t})=>{const{locale:e}=st(),n=u.useRef(e),{isLoaded:r}=gw({language:n.current,libraries:ah,googleMapsApiKey:"AIzaSyBEboFjQh8dJQlWwWZy-2Zzmw7Dsr6-NiA"});return r?x.jsx(x.Fragment,{children:t}):x.jsx(Na,{})},ux=({children:t})=>{const{map:e,disableGeolocation:n}=st();return mn(e==null?void 0:e.center,"Map center is required"),mn(e==null?void 0:e.initialZoom,"Map initial zoom is required"),L1(e.center,e.initialZoom,{disableGeolocation:n}),x.jsx(x.Fragment,{children:t})},fx=({children:t})=>{const{font:e,palette:n,radius:r,locale:i,startScreen:o}=st();return _1(e),E1(i),x1(n),C1(r),O1(o),x.jsx(x.Fragment,{children:t})},dx=({children:t})=>{const e=zt(Mb);return zt(Oa)&&!e?x.jsx(Na,{}):x.jsx(x.Fragment,{children:t})};xo.setApiKey("AIzaSyBEboFjQh8dJQlWwWZy-2Zzmw7Dsr6-NiA");const px="App-module__map__rW7rX2",hx="App-module__sidebar__qEl7HV",gx="App-module__header__gAG5Pr",bs={map:px,sidebar:hx,header:gx},vx=({config:t,options:e})=>{const n=Zb(t),{map:r,hideHeader:i,hideFilters:o,INN:s}=n;mn(s,"INN is required"),qb(s,e),mn(r==null?void 0:r.provider,"Map provider is required");const a=h1(r.provider);return Ab(),x.jsx(Lu.Provider,{value:n,children:x.jsx(ux,{children:x.jsx(fx,{children:x.jsx(Zp,{tolgee:yu,fallback:x.jsx(Na,{}),children:x.jsx(cx,{children:x.jsx(dx,{children:x.jsxs(yg,{children:[!i&&x.jsx(dg,{className:bs.header}),!o&&x.jsx(tE,{className:bs.sidebar}),x.jsx(KE,{className:bs.map,children:x.jsx(a,{})}),x.jsx(lx,{})]})})})})})})})},Jd=async t=>si.request({baseURL:"https://api.geo-data.omnic.solutions/api/1.0/",method:"POST",url:"normalize/address",data:t,headers:{Authorization:"Token 9877f9631b2e30570cc1c5aa8c740b0c912efe99a8b6c45c21cf4bd394adc7e9"}});exports.EReceiveFilter=Dt;exports.ESendFilter=It;exports.ETypeFilter=Kt;exports.Widget=vx;exports.createPointsIterator=Ys;exports.fetchPointsRequest=Js;exports.fromHoursMinutesToMinutes=t0;exports.fromMinutesToHoursMinutes=n0;exports.getAddressFromLatLng=ur;exports.getBoundsFromPoint=r0;exports.getCurrentPosition=Ca;exports.getNormalizedAddress=Jd;exports.getPropertyValue=_a;exports.isDeliveryPoint=_b;exports.isHttpSuccess=Xf;exports.replaceSvgCurrentColor=xt;exports.setWidgetCSSProperty=Vo;exports.stopImmediatePropagation=Xs;exports.svgStringToBase64URL=Jt;
|