@selfcommunity/react-core 0.7.0-alpha.9 → 0.7.0-mui7.18
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/lib/cjs/components/provider/SCLocaleProvider/index.d.ts +1 -1
- package/lib/cjs/components/provider/SCThemeProvider/index.d.ts +1 -1
- package/lib/cjs/components/router/index.d.ts +2 -2
- package/lib/cjs/constants/Preferences.d.ts +2 -0
- package/lib/cjs/constants/Preferences.js +7 -2
- package/lib/cjs/hooks/useFetchMenuFooter.d.ts +5 -0
- package/lib/cjs/hooks/useFetchMenuFooter.js +36 -0
- package/lib/cjs/hooks/useSCFeature.d.ts +22 -0
- package/lib/cjs/hooks/useSCFeature.js +38 -0
- package/lib/cjs/hooks/useSCFetchUsers.d.ts +3 -4
- package/lib/cjs/hooks/useSCFetchUsers.js +15 -44
- package/lib/cjs/hooks/useSCGoogleApiLoader.d.ts +1 -1
- package/lib/cjs/hooks/useSCGoogleApiLoader.js +4 -7
- package/lib/cjs/hooks/useSCPreference.d.ts +36 -0
- package/lib/cjs/hooks/useSCPreference.js +69 -0
- package/lib/cjs/hooks/useSCPreferencesAndFeaturesEnabled.d.ts +17 -0
- package/lib/cjs/hooks/useSCPreferencesAndFeaturesEnabled.js +35 -0
- package/lib/cjs/index.d.ts +5 -2
- package/lib/cjs/index.js +12 -3
- package/lib/cjs/utils/hooks/usePreviousValue.d.ts +1 -1
- package/lib/cjs/utils/hooks/usePreviousValue.js +1 -1
- package/lib/esm/components/provider/SCLocaleProvider/index.d.ts +1 -1
- package/lib/esm/components/provider/SCThemeProvider/index.d.ts +1 -1
- package/lib/esm/components/router/index.d.ts +2 -2
- package/lib/esm/constants/Preferences.d.ts +2 -0
- package/lib/esm/constants/Preferences.js +5 -0
- package/lib/esm/hooks/useFetchMenuFooter.d.ts +5 -0
- package/lib/esm/hooks/useFetchMenuFooter.js +33 -0
- package/lib/esm/hooks/useSCFeature.d.ts +22 -0
- package/lib/esm/hooks/useSCFeature.js +33 -0
- package/lib/esm/hooks/useSCFetchUsers.d.ts +3 -4
- package/lib/esm/hooks/useSCFetchUsers.js +16 -45
- package/lib/esm/hooks/useSCGoogleApiLoader.d.ts +1 -1
- package/lib/esm/hooks/useSCGoogleApiLoader.js +4 -7
- package/lib/esm/hooks/useSCPreference.d.ts +36 -0
- package/lib/esm/hooks/useSCPreference.js +65 -0
- package/lib/esm/hooks/useSCPreferencesAndFeaturesEnabled.d.ts +17 -0
- package/lib/esm/hooks/useSCPreferencesAndFeaturesEnabled.js +32 -0
- package/lib/esm/index.d.ts +5 -2
- package/lib/esm/index.js +5 -2
- package/lib/esm/utils/hooks/usePreviousValue.d.ts +1 -1
- package/lib/esm/utils/hooks/usePreviousValue.js +1 -1
- package/lib/umd/18.js +2 -0
- package/lib/umd/18.js.LICENSE.txt +3 -0
- package/lib/umd/react-core.js +1 -1
- package/lib/umd/react-core.js.LICENSE.txt +1 -1
- package/package.json +12 -12
- package/lib/cjs/hooks/useSCPreferenceEnabled.d.ts +0 -6
- package/lib/cjs/hooks/useSCPreferenceEnabled.js +0 -16
- package/lib/esm/hooks/useSCPreferenceEnabled.d.ts +0 -6
- package/lib/esm/hooks/useSCPreferenceEnabled.js +0 -13
- package/lib/umd/440.js +0 -2
- package/lib/umd/440.js.LICENSE.txt +0 -16
package/lib/umd/440.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 440.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunkSelfCommunityReactCore=self.webpackChunkSelfCommunityReactCore||[]).push([[440],{7871:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Autocomplete:()=>wn,BicyclingLayer:()=>V,BicyclingLayerF:()=>F,Circle:()=>Mt,CircleF:()=>xt,Data:()=>Rt,DataF:()=>Ot,DirectionsRenderer:()=>dn,DirectionsService:()=>cn,DistanceMatrixService:()=>hn,DrawingManager:()=>X,DrawingManagerF:()=>Y,FLOAT_PANE:()=>Nt,GoogleMap:()=>E,GoogleMapsMarkerClusterer:()=>it,GoogleMarkerClusterer:()=>st,GroundOverlay:()=>Qt,GroundOverlayF:()=>Xt,HeatmapLayer:()=>on,HeatmapLayerF:()=>nn,InfoBox:()=>be,InfoBoxF:()=>we,InfoWindow:()=>ut,InfoWindowF:()=>ct,KmlLayer:()=>Dt,LoadScript:()=>O,LoadScriptNext:()=>I,MAP_PANE:()=>zt,MARKER_LAYER:()=>Jt,MapContext:()=>g,Marker:()=>oe,MarkerClusterer:()=>he,MarkerClustererF:()=>de,MarkerF:()=>ne,OVERLAY_LAYER:()=>Ft,OVERLAY_MOUSE_TARGET:()=>Vt,OverlayView:()=>$t,OverlayViewF:()=>Gt,Polygon:()=>wt,PolygonF:()=>yt,Polyline:()=>ft,PolylineF:()=>gt,Rectangle:()=>Ct,RectangleF:()=>St,StandaloneSearchBox:()=>mn,StreetViewPanorama:()=>an,StreetViewService:()=>ln,TrafficLayer:()=>J,TrafficLayerF:()=>z,TransitLayer:()=>$,TransitLayerF:()=>G,useGoogleMap:()=>f,useJsApiLoader:()=>B,useLoadScript:()=>R});var o=n(5276),r=n(8156),i=n(7111),s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var l=function(){return l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},l.apply(this,arguments)};function c(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function u(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))}function p(e,t){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h=d((function(e,t,n,o,r,i,s,a){if(!e){var l;if(void 0===t)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,o,r,i,s,a],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}})),g=(0,r.createContext)(null);function f(){h(!!r.useContext,"useGoogleMap is React hook and requires React version 16.8+");var e=(0,r.useContext)(g);return h(!!e,"useGoogleMap needs a GoogleMap available up in the tree"),e}function m(e){google.maps.event.removeListener(e)}function v(e){void 0===e&&(e=[]),e.forEach(m)}function y(e){var t=e.updaterMap,n=e.eventMap,o=e.prevProps,r=e.nextProps,i=e.instance,s=function(e,t,n){var o,r,i,s=(o=n,r=function(n,o,r){return"function"==typeof e[r]&&n.push(google.maps.event.addListener(t,o,e[r])),n},i=[],Object.keys(o).reduce((function(e,t){return r(e,o[t],t)}),i));return s}(r,i,n);return function(e,t,n,o){var r,i,s={};r=e,i=function(e,r){var i=n[r];i!==t[r]&&(s[r]=i,e(o,i))},Object.keys(r).forEach((function(e){return i(r[e],e)}))}(t,o,r,i),s}var w={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"},b={extraMapTypes:function(e,t){t.forEach((function(t,n){e.mapTypes.set(String(n),t)}))},center:function(e,t){e.setCenter(t)},clickableIcons:function(e,t){e.setClickableIcons(t)},heading:function(e,t){e.setHeading(t)},mapTypeId:function(e,t){e.setMapTypeId(t)},options:function(e,t){e.setOptions(t)},streetView:function(e,t){e.setStreetView(t)},tilt:function(e,t){e.setTilt(t)},zoom:function(e,t){e.setZoom(t)}};(0,r.memo)((function(e){var t=e.children,n=e.options,i=e.id,s=e.mapContainerStyle,a=e.mapContainerClassName,l=e.center,c=e.onClick,u=e.onDblClick,p=e.onDrag,d=e.onDragEnd,h=e.onDragStart,f=e.onMouseMove,m=e.onMouseOut,v=e.onMouseOver,y=e.onMouseDown,w=e.onMouseUp,b=e.onRightClick,E=e.onCenterChanged,S=e.onLoad,C=e.onUnmount,L=(0,r.useState)(null),P=L[0],k=L[1],x=(0,r.useRef)(null),M=(0,r.useState)(null),_=M[0],A=M[1],O=(0,r.useState)(null),R=O[0],T=O[1],I=(0,r.useState)(null),D=I[0],H=I[1],U=(0,r.useState)(null),W=U[0],j=U[1],B=(0,r.useState)(null),K=B[0],N=B[1],z=(0,r.useState)(null),J=z[0],F=z[1],V=(0,r.useState)(null),G=V[0],$=V[1],Z=(0,r.useState)(null),q=Z[0],Y=Z[1],X=(0,r.useState)(null),Q=X[0],ee=X[1],te=(0,r.useState)(null),ne=te[0],oe=te[1],re=(0,r.useState)(null),ie=re[0],se=re[1],ae=(0,r.useState)(null),le=ae[0],ce=ae[1];return(0,r.useEffect)((function(){n&&null!==P&&P.setOptions(n)}),[P,n]),(0,r.useEffect)((function(){null!==P&&void 0!==l&&P.setCenter(l)}),[P,l]),(0,r.useEffect)((function(){P&&u&&(null!==R&&google.maps.event.removeListener(R),T(google.maps.event.addListener(P,"dblclick",u)))}),[u]),(0,r.useEffect)((function(){P&&d&&(null!==D&&google.maps.event.removeListener(D),H(google.maps.event.addListener(P,"dragend",d)))}),[d]),(0,r.useEffect)((function(){P&&h&&(null!==W&&google.maps.event.removeListener(W),j(google.maps.event.addListener(P,"dragstart",h)))}),[h]),(0,r.useEffect)((function(){P&&y&&(null!==K&&google.maps.event.removeListener(K),N(google.maps.event.addListener(P,"mousedown",y)))}),[y]),(0,r.useEffect)((function(){P&&f&&(null!==J&&google.maps.event.removeListener(J),F(google.maps.event.addListener(P,"mousemove",f)))}),[f]),(0,r.useEffect)((function(){P&&m&&(null!==G&&google.maps.event.removeListener(G),$(google.maps.event.addListener(P,"mouseout",m)))}),[m]),(0,r.useEffect)((function(){P&&v&&(null!==q&&google.maps.event.removeListener(q),Y(google.maps.event.addListener(P,"mouseover",v)))}),[v]),(0,r.useEffect)((function(){P&&w&&(null!==Q&&google.maps.event.removeListener(Q),ee(google.maps.event.addListener(P,"mouseup",w)))}),[w]),(0,r.useEffect)((function(){P&&b&&(null!==ne&&google.maps.event.removeListener(ne),oe(google.maps.event.addListener(P,"rightclick",b)))}),[b]),(0,r.useEffect)((function(){P&&c&&(null!==ie&&google.maps.event.removeListener(ie),se(google.maps.event.addListener(P,"click",c)))}),[c]),(0,r.useEffect)((function(){P&&p&&(null!==le&&google.maps.event.removeListener(le),ce(google.maps.event.addListener(P,"drag",p)))}),[p]),(0,r.useEffect)((function(){P&&E&&(null!==_&&google.maps.event.removeListener(_),A(google.maps.event.addListener(P,"center_changed",E)))}),[c]),(0,r.useEffect)((function(){var e=null===x.current?null:new google.maps.Map(x.current,n);return k(e),null!==e&&S&&S(e),function(){null!==e&&C&&C(e)}}),[]),(0,o.jsx)("div",{id:i,ref:x,style:s,className:a,children:(0,o.jsx)(g.Provider,{value:P,children:null!==P?t:null})})}));var E=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={map:null},t.registeredEvents=[],t.mapRef=null,t.getInstance=function(){return null===t.mapRef?null:new google.maps.Map(t.mapRef,t.props.options)},t.panTo=function(e){var n=t.getInstance();n&&n.panTo(e)},t.setMapCallback=function(){null!==t.state.map&&t.props.onLoad&&t.props.onLoad(t.state.map)},t.getRef=function(e){t.mapRef=e},t}return a(t,e),t.prototype.componentDidMount=function(){var e=this.getInstance();this.registeredEvents=y({updaterMap:b,eventMap:w,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{map:e}}),this.setMapCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.map&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:b,eventMap:w,prevProps:e,nextProps:this.props,instance:this.state.map}))},t.prototype.componentWillUnmount=function(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),v(this.registeredEvents))},t.prototype.render=function(){return(0,o.jsx)("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:(0,o.jsx)(g.Provider,{value:this.state.map,children:null!==this.state.map?this.props.children:null})})},t}(r.PureComponent),S="undefined"!=typeof document;function C(e){var t=e.url,n=e.id,o=e.nonce;return S?new Promise((function(e,r){var i=document.getElementById(n),s=window;if(i){var a=i.getAttribute("data-state");if(i.src===t&&"error"!==a){if("ready"===a)return e(n);var l=s.initMap,c=i.onerror;return s.initMap=function(){l&&l(),e(n)},void(i.onerror=function(e){c&&c(e),r(e)})}i.remove()}var u=document.createElement("script");u.type="text/javascript",u.src=t,u.id=n,u.async=!0,u.nonce=o||"",u.onerror=function(e){u.setAttribute("data-state","error"),r(e)},s.initMap=function(){u.setAttribute("data-state","ready"),e(n)},document.head.appendChild(u)})).catch((function(e){throw console.error("injectScript error: ",e),e})):Promise.reject(new Error("document is undefined"))}function L(e){var t=e.href;return!((!t||0!==t.indexOf("https://fonts.googleapis.com/css?family=Roboto")&&0!==t.indexOf("https://fonts.googleapis.com/css?family=Google+Sans+Text"))&&("style"===e.tagName.toLowerCase()&&e.styleSheet&&e.styleSheet.cssText&&0===e.styleSheet.cssText.replace("\r\n","").indexOf(".gm-style")?(e.styleSheet.cssText="",0):"style"===e.tagName.toLowerCase()&&e.innerHTML&&0===e.innerHTML.replace("\r\n","").indexOf(".gm-style")?(e.innerHTML="",0):"style"!==e.tagName.toLowerCase()||e.styleSheet||e.innerHTML))}function P(){var e=document.getElementsByTagName("head")[0];if(e){var t=e.insertBefore.bind(e);e.insertBefore=function(n,o){return L(n)||Reflect.apply(t,e,[n,o]),n};var n=e.appendChild.bind(e);e.appendChild=function(t){return L(t)||Reflect.apply(n,e,[t]),t}}}function k(e){var t=e.googleMapsApiKey,n=e.googleMapsClientId,o=e.version,r=void 0===o?"weekly":o,i=e.language,s=e.region,a=e.libraries,l=e.channel,c=e.mapIds,u=e.authReferrerPolicy,p=[];return h(t&&n||!(t&&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."),t?p.push("key=".concat(t)):n&&p.push("client=".concat(n)),r&&p.push("v=".concat(r)),i&&p.push("language=".concat(i)),s&&p.push("region=".concat(s)),a&&a.length&&p.push("libraries=".concat(a.sort().join(","))),l&&p.push("channel=".concat(l)),c&&c.length&&p.push("map_ids=".concat(c.join(","))),u&&p.push("auth_referrer_policy=".concat(u)),p.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?".concat(p.join("&"))}var x=!1;function M(){return(0,o.jsx)("div",{children:"Loading..."})}var _,A={id:"script-loader",version:"weekly"},O=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.check=(0,r.createRef)(),t.state={loaded:!1},t.cleanupCallback=function(){delete window.google.maps,t.injectScript()},t.isCleaningUp=function(){return u(t,void 0,void 0,(function(){function e(e){if(x){if(S)var t=window.setInterval((function(){x||(window.clearInterval(t),e())}),1)}else e()}return p(this,(function(t){return[2,new Promise(e)]}))}))},t.cleanup=function(){x=!0;var e=document.getElementById(t.props.id);e&&e.parentNode&&e.parentNode.removeChild(e),Array.prototype.slice.call(document.getElementsByTagName("script")).filter((function(e){return"string"==typeof e.src&&e.src.includes("maps.googleapis")})).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)})),Array.prototype.slice.call(document.getElementsByTagName("link")).filter((function(e){return"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"===e.href})).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)})),Array.prototype.slice.call(document.getElementsByTagName("style")).filter((function(e){return void 0!==e.innerText&&e.innerText.length>0&&e.innerText.includes(".gm-")})).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))},t.injectScript=function(){t.props.preventGoogleFontsLoading&&P(),h(!!t.props.id,'LoadScript requires "id" prop to be a string: %s',t.props.id),C({id:t.props.id,nonce:t.props.nonce,url:k(t.props)}).then((function(){t.props.onLoad&&t.props.onLoad(),t.setState((function(){return{loaded:!0}}))})).catch((function(e){t.props.onError&&t.props.onError(e),console.error("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (".concat(t.props.googleMapsApiKey||"-",") or Client ID (").concat(t.props.googleMapsClientId||"-",") to <LoadScript />\n Otherwise it is a Network issue.\n "))}))},t}return a(t,e),t.prototype.componentDidMount=function(){if(S){if(window.google&&window.google.maps&&!x)return void console.error("google api is already presented");this.isCleaningUp().then(this.injectScript).catch((function(e){console.error("Error at injecting script after cleaning up: ",e)}))}},t.prototype.componentDidUpdate=function(e){this.props.libraries!==e.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),S&&e.language!==this.props.language&&(this.cleanup(),this.setState((function(){return{loaded:!1}}),this.cleanupCallback))},t.prototype.componentWillUnmount=function(){var e=this;S&&(this.cleanup(),window.setTimeout((function(){e.check.current||(delete window.google,x=!1)}),1),this.props.onUnmount&&this.props.onUnmount())},t.prototype.render=function(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||(0,o.jsx)(M,{})]})},t.defaultProps=A,t}(r.PureComponent);function R(e){var t=e.id,n=void 0===t?A.id:t,o=e.version,i=void 0===o?A.version:o,s=e.nonce,a=e.googleMapsApiKey,l=e.googleMapsClientId,c=e.language,u=e.region,p=e.libraries,d=e.preventGoogleFontsLoading,g=e.channel,f=e.mapIds,m=e.authReferrerPolicy,v=(0,r.useRef)(!1),y=(0,r.useState)(!1),w=y[0],b=y[1],E=(0,r.useState)(void 0),L=E[0],x=E[1];(0,r.useEffect)((function(){return v.current=!0,function(){v.current=!1}}),[]),(0,r.useEffect)((function(){S&&d&&P()}),[d]),(0,r.useEffect)((function(){w&&h(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")}),[w]);var M=k({version:i,googleMapsApiKey:a,googleMapsClientId:l,language:c,region:u,libraries:p,channel:g,mapIds:f,authReferrerPolicy:m});(0,r.useEffect)((function(){function e(){v.current&&(b(!0),_=M)}S&&(window.google&&window.google.maps&&_===M?e():C({id:n,url:M,nonce:s}).then(e).catch((function(e){v.current&&x(e),console.warn("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (".concat(a||"-",") or Client ID (").concat(l||"-",")\n Otherwise it is a Network issue.\n ")),console.error(e)})))}),[n,M,s]);var O=(0,r.useRef)();return(0,r.useEffect)((function(){O.current&&p!==O.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"),O.current=p}),[p]),{isLoaded:w,loadError:L,url:M}}var T=(0,o.jsx)(M,{}),I=(0,r.memo)((function(e){var t=e.loadingElement,n=e.onLoad,o=e.onError,i=e.onUnmount,s=e.children,a=R(c(e,["loadingElement","onLoad","onError","onUnmount","children"])),l=a.isLoaded,u=a.loadError;return(0,r.useEffect)((function(){l&&"function"==typeof n&&n()}),[l,n]),(0,r.useEffect)((function(){u&&"function"==typeof o&&o(u)}),[u,o]),(0,r.useEffect)((function(){return function(){i&&i()}}),[i]),l?s:t||T}));var D=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var s=i[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n};const H="__googleMapsScriptId";var U;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(U||(U={}));class W{constructor({apiKey:e,authReferrerPolicy:t,channel:n,client:o,id:r=H,language:i,libraries:s=[],mapIds:a,nonce:l,region:c,retries:u=3,url:p="https://maps.googleapis.com/maps/api/js",version:d}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=n,this.client=o,this.id=r||H,this.language=i,this.libraries=s,this.mapIds=a,this.nonce=l,this.region=c,this.retries=u,this.url=p,this.version=d,W.instance){if(!D(this.options,W.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(W.instance.options)}`);return W.instance}W.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?U.FAILURE:this.done?U.SUCCESS:this.loading?U.LOADING:U.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,t)=>{this.loadCallback((n=>{n?t(n.error):e(window.google)}))}))}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id))return void this.callback();const n={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(n).forEach((e=>!n[e]&&delete n[e])),(null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.importLibrary)||(e=>{let t,n,o,r="The Google Maps JavaScript API",i="google",s="importLibrary",a="__ib__",l=document,c=window;c=c[i]||(c[i]={});const u=c.maps||(c.maps={}),p=new Set,d=new URLSearchParams,h=()=>t||(t=new Promise(((s,c)=>{return h=this,g=void 0,m=function*(){var h;for(o in yield n=l.createElement("script"),n.id=this.id,d.set("libraries",[...p]+""),e)d.set(o.replace(/[A-Z]/g,(e=>"_"+e[0].toLowerCase())),e[o]);d.set("callback",i+".maps."+a),n.src=this.url+"?"+d,u[a]=s,n.onerror=()=>t=c(Error(r+" could not load.")),n.nonce=this.nonce||(null===(h=l.querySelector("script[nonce]"))||void 0===h?void 0:h.nonce)||"",l.head.append(n)},new((f=void 0)||(f=Promise))((function(e,t){function n(e){try{r(m.next(e))}catch(e){t(e)}}function o(e){try{r(m.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof f?r:new f((function(e){e(r)}))).then(n,o)}r((m=m.apply(h,g||[])).next())}));var h,g,f,m})));u[s]?console.warn(r+" only loads once. Ignoring:",e):u[s]=(e,...t)=>p.add(e)&&h().then((()=>u[s](e,...t)))})(n);const o=this.libraries.map((e=>this.importLibrary(e)));o.length||o.push(this.importLibrary("core")),Promise.all(o).then((()=>this.callback()),(e=>{const t=new ErrorEvent("error",{error:e});this.loadErrorCallback(t)}))}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 e=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout((()=>{this.deleteScript(),this.setScript()}),e)}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)return 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."),void this.callback();this.loading||(this.loading=!0,this.setScript())}}}var j=["maps"];function B(e){var t=e.id,n=void 0===t?A.id:t,o=e.version,i=void 0===o?A.version:o,s=e.nonce,a=e.googleMapsApiKey,l=e.language,c=e.region,u=e.libraries,p=void 0===u?j:u,d=e.preventGoogleFontsLoading,h=e.mapIds,g=e.authReferrerPolicy,f=(0,r.useRef)(!1),m=(0,r.useState)(!1),v=m[0],y=m[1],w=(0,r.useState)(void 0),b=w[0],E=w[1];(0,r.useEffect)((function(){return f.current=!0,function(){f.current=!1}}),[]);var C=(0,r.useMemo)((function(){return new W({id:n,apiKey:a,version:i,libraries:p,language:l||"en",region:c||"US",mapIds:h||[],nonce:s||"",authReferrerPolicy:g||"origin"})}),[n,a,i,p,l,c,h,s,g]);(0,r.useEffect)((function(){v||C.load().then((function(){f.current&&y(!0)})).catch((function(e){E(e)}))}),[]),(0,r.useEffect)((function(){S&&d&&P()}),[d]);var L=(0,r.useRef)();return(0,r.useEffect)((function(){L.current&&p!==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=p}),[p]),{isLoaded:v,loadError:b}}var K={},N={options:function(e,t){e.setOptions(t)}},z=(0,r.memo)((function(e){var t=e.options,n=e.onLoad,o=e.onUnmount,i=(0,r.useContext)(g),s=(0,r.useState)(null),a=s[0],c=s[1];return(0,r.useEffect)((function(){null!==a&&a.setMap(i)}),[i]),(0,r.useEffect)((function(){t&&null!==a&&a.setOptions(t)}),[a,t]),(0,r.useEffect)((function(){var e=new google.maps.TrafficLayer(l(l({},t||{}),{map:i}));return c(e),n&&n(e),function(){null!==a&&(o&&o(a),a.setMap(null))}}),[]),null})),J=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={trafficLayer:null},t.setTrafficLayerCallback=function(){null!==t.state.trafficLayer&&t.props.onLoad&&t.props.onLoad(t.state.trafficLayer)},t.registeredEvents=[],t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.TrafficLayer(l(l({},this.props.options||{}),{map:this.context}));this.registeredEvents=y({updaterMap:N,eventMap:K,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{trafficLayer:e}}),this.setTrafficLayerCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.trafficLayer&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:N,eventMap:K,prevProps:e,nextProps:this.props,instance:this.state.trafficLayer}))},t.prototype.componentWillUnmount=function(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),v(this.registeredEvents),this.state.trafficLayer.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),F=(0,r.memo)((function(e){var t=e.onLoad,n=e.onUnmount,o=(0,r.useContext)(g),i=(0,r.useState)(null),s=i[0],a=i[1];return(0,r.useEffect)((function(){null!==s&&s.setMap(o)}),[o]),(0,r.useEffect)((function(){var e=new google.maps.BicyclingLayer;return a(e),e.setMap(o),t&&t(e),function(){null!==e&&(n&&n(e),e.setMap(null))}}),[]),null})),V=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={bicyclingLayer:null},t.setBicyclingLayerCallback=function(){null!==t.state.bicyclingLayer&&(t.state.bicyclingLayer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.bicyclingLayer))},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.BicyclingLayer;this.setState((function(){return{bicyclingLayer:e}}),this.setBicyclingLayerCallback)},t.prototype.componentWillUnmount=function(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),G=(0,r.memo)((function(e){var t=e.onLoad,n=e.onUnmount,o=(0,r.useContext)(g),i=(0,r.useState)(null),s=i[0],a=i[1];return(0,r.useEffect)((function(){null!==s&&s.setMap(o)}),[o]),(0,r.useEffect)((function(){var e=new google.maps.TransitLayer;return a(e),e.setMap(o),t&&t(e),function(){null!==s&&(n&&n(s),s.setMap(null))}}),[]),null})),$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={transitLayer:null},t.setTransitLayerCallback=function(){null!==t.state.transitLayer&&(t.state.transitLayer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.transitLayer))},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.TransitLayer;this.setState((function(){return{transitLayer:e}}),this.setTransitLayerCallback)},t.prototype.componentWillUnmount=function(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),Z={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},q={drawingMode:function(e,t){e.setDrawingMode(t)},options:function(e,t){e.setOptions(t)}},Y=(0,r.memo)((function(e){var t=e.options,n=e.drawingMode,o=e.onCircleComplete,i=e.onMarkerComplete,s=e.onOverlayComplete,a=e.onPolygonComplete,c=e.onPolylineComplete,u=e.onRectangleComplete,p=e.onLoad,d=e.onUnmount,f=(0,r.useContext)(g),m=(0,r.useState)(null),v=m[0],y=m[1],w=(0,r.useState)(null),b=w[0],E=w[1],S=(0,r.useState)(null),C=S[0],L=S[1],P=(0,r.useState)(null),k=P[0],x=P[1],M=(0,r.useState)(null),_=M[0],A=M[1],O=(0,r.useState)(null),R=O[0],T=O[1],I=(0,r.useState)(null),D=I[0],H=I[1];return(0,r.useEffect)((function(){null!==v&&v.setMap(f)}),[f]),(0,r.useEffect)((function(){t&&null!==v&&v.setOptions(t)}),[v,t]),(0,r.useEffect)((function(){null!==v&&v.setDrawingMode(null!=n?n:null)}),[v,n]),(0,r.useEffect)((function(){v&&o&&(null!==b&&google.maps.event.removeListener(b),E(google.maps.event.addListener(v,"circlecomplete",o)))}),[v,o]),(0,r.useEffect)((function(){v&&i&&(null!==C&&google.maps.event.removeListener(C),L(google.maps.event.addListener(v,"markercomplete",i)))}),[v,i]),(0,r.useEffect)((function(){v&&s&&(null!==k&&google.maps.event.removeListener(k),x(google.maps.event.addListener(v,"overlaycomplete",s)))}),[v,s]),(0,r.useEffect)((function(){v&&a&&(null!==_&&google.maps.event.removeListener(_),A(google.maps.event.addListener(v,"polygoncomplete",a)))}),[v,a]),(0,r.useEffect)((function(){v&&c&&(null!==R&&google.maps.event.removeListener(R),T(google.maps.event.addListener(v,"polylinecomplete",c)))}),[v,c]),(0,r.useEffect)((function(){v&&u&&(null!==D&&google.maps.event.removeListener(D),H(google.maps.event.addListener(v,"rectanglecomplete",u)))}),[v,u]),(0,r.useEffect)((function(){h(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var e=new google.maps.drawing.DrawingManager(l(l({},t||{}),{map:f}));return n&&e.setDrawingMode(n),o&&E(google.maps.event.addListener(e,"circlecomplete",o)),i&&L(google.maps.event.addListener(e,"markercomplete",i)),s&&x(google.maps.event.addListener(e,"overlaycomplete",s)),a&&A(google.maps.event.addListener(e,"polygoncomplete",a)),c&&T(google.maps.event.addListener(e,"polylinecomplete",c)),u&&H(google.maps.event.addListener(e,"rectanglecomplete",u)),y(e),p&&p(e),function(){null!==v&&(b&&google.maps.event.removeListener(b),C&&google.maps.event.removeListener(C),k&&google.maps.event.removeListener(k),_&&google.maps.event.removeListener(_),R&&google.maps.event.removeListener(R),D&&google.maps.event.removeListener(D),d&&d(v),v.setMap(null))}}),[]),null})),X=function(e){function t(t){var n=e.call(this,t)||this;return n.registeredEvents=[],n.state={drawingManager:null},n.setDrawingManagerCallback=function(){null!==n.state.drawingManager&&n.props.onLoad&&n.props.onLoad(n.state.drawingManager)},h(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),n}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.drawing.DrawingManager(l(l({},this.props.options||{}),{map:this.context}));this.registeredEvents=y({updaterMap:q,eventMap:Z,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{drawingManager:e}}),this.setDrawingManagerCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.drawingManager&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:q,eventMap:Z,prevProps:e,nextProps:this.props,instance:this.state.drawingManager}))},t.prototype.componentWillUnmount=function(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),v(this.registeredEvents),this.state.drawingManager.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),Q={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"},ee={animation:function(e,t){e.setAnimation(t)},clickable:function(e,t){e.setClickable(t)},cursor:function(e,t){e.setCursor(t)},draggable:function(e,t){e.setDraggable(t)},icon:function(e,t){e.setIcon(t)},label:function(e,t){e.setLabel(t)},map:function(e,t){e.setMap(t)},opacity:function(e,t){e.setOpacity(t)},options:function(e,t){e.setOptions(t)},position:function(e,t){e.setPosition(t)},shape:function(e,t){e.setShape(t)},title:function(e,t){e.setTitle(t)},visible:function(e,t){e.setVisible(t)},zIndex:function(e,t){e.setZIndex(t)}},te={},ne=(0,r.memo)((function(e){var t=e.position,n=e.options,i=e.clusterer,s=e.noClustererRedraw,a=e.children,c=e.draggable,u=e.visible,p=e.animation,d=e.clickable,h=e.cursor,f=e.icon,m=e.label,v=e.opacity,y=e.shape,w=e.title,b=e.zIndex,E=e.onClick,S=e.onDblClick,C=e.onDrag,L=e.onDragEnd,P=e.onDragStart,k=e.onMouseOut,x=e.onMouseOver,M=e.onMouseUp,_=e.onMouseDown,A=e.onRightClick,O=e.onClickableChanged,R=e.onCursorChanged,T=e.onAnimationChanged,I=e.onDraggableChanged,D=e.onFlatChanged,H=e.onIconChanged,U=e.onPositionChanged,W=e.onShapeChanged,j=e.onTitleChanged,B=e.onVisibleChanged,K=e.onZindexChanged,N=e.onLoad,z=e.onUnmount,J=(0,r.useContext)(g),F=(0,r.useState)(null),V=F[0],G=F[1],$=(0,r.useState)(null),Z=$[0],q=$[1],Y=(0,r.useState)(null),X=Y[0],Q=Y[1],ee=(0,r.useState)(null),ne=ee[0],oe=ee[1],re=(0,r.useState)(null),ie=re[0],se=re[1],ae=(0,r.useState)(null),le=ae[0],ce=ae[1],ue=(0,r.useState)(null),pe=ue[0],de=ue[1],he=(0,r.useState)(null),ge=he[0],fe=he[1],me=(0,r.useState)(null),ve=me[0],ye=me[1],we=(0,r.useState)(null),be=we[0],Ee=we[1],Se=(0,r.useState)(null),Ce=Se[0],Le=Se[1],Pe=(0,r.useState)(null),ke=Pe[0],xe=Pe[1],Me=(0,r.useState)(null),_e=Me[0],Ae=Me[1],Oe=(0,r.useState)(null),Re=Oe[0],Te=Oe[1],Ie=(0,r.useState)(null),De=Ie[0],He=Ie[1],Ue=(0,r.useState)(null),We=Ue[0],je=Ue[1],Be=(0,r.useState)(null),Ke=Be[0],Ne=Be[1],ze=(0,r.useState)(null),Je=ze[0],Fe=ze[1],Ve=(0,r.useState)(null),Ge=Ve[0],$e=Ve[1],Ze=(0,r.useState)(null),qe=Ze[0],Ye=Ze[1],Xe=(0,r.useState)(null),Qe=Xe[0],et=Xe[1],tt=(0,r.useState)(null),nt=tt[0],ot=tt[1];(0,r.useEffect)((function(){null!==V&&V.setMap(J)}),[J]),(0,r.useEffect)((function(){void 0!==n&&null!==V&&V.setOptions(n)}),[V,n]),(0,r.useEffect)((function(){void 0!==c&&null!==V&&V.setDraggable(c)}),[V,c]),(0,r.useEffect)((function(){t&&null!==V&&V.setPosition(t)}),[V,t]),(0,r.useEffect)((function(){void 0!==u&&null!==V&&V.setVisible(u)}),[V,u]),(0,r.useEffect)((function(){null==V||V.setAnimation(p)}),[V,p]),(0,r.useEffect)((function(){V&&void 0!==d&&V.setClickable(d)}),[V,d]),(0,r.useEffect)((function(){V&&void 0!==h&&V.setCursor(h)}),[V,h]),(0,r.useEffect)((function(){V&&void 0!==f&&V.setIcon(f)}),[V,f]),(0,r.useEffect)((function(){V&&void 0!==m&&V.setLabel(m)}),[V,m]),(0,r.useEffect)((function(){V&&void 0!==v&&V.setOpacity(v)}),[V,v]),(0,r.useEffect)((function(){V&&void 0!==y&&V.setShape(y)}),[V,y]),(0,r.useEffect)((function(){V&&void 0!==w&&V.setTitle(w)}),[V,w]),(0,r.useEffect)((function(){V&&void 0!==b&&V.setZIndex(b)}),[V,b]),(0,r.useEffect)((function(){V&&S&&(null!==Z&&google.maps.event.removeListener(Z),q(google.maps.event.addListener(V,"dblclick",S)))}),[S]),(0,r.useEffect)((function(){V&&L&&(null!==X&&google.maps.event.removeListener(X),Q(google.maps.event.addListener(V,"dragend",L)))}),[L]),(0,r.useEffect)((function(){V&&P&&(null!==ne&&google.maps.event.removeListener(ne),oe(google.maps.event.addListener(V,"dragstart",P)))}),[P]),(0,r.useEffect)((function(){V&&_&&(null!==ie&&google.maps.event.removeListener(ie),se(google.maps.event.addListener(V,"mousedown",_)))}),[_]),(0,r.useEffect)((function(){V&&k&&(null!==le&&google.maps.event.removeListener(le),ce(google.maps.event.addListener(V,"mouseout",k)))}),[k]),(0,r.useEffect)((function(){V&&x&&(null!==pe&&google.maps.event.removeListener(pe),de(google.maps.event.addListener(V,"mouseover",x)))}),[x]),(0,r.useEffect)((function(){V&&M&&(null!==ge&&google.maps.event.removeListener(ge),fe(google.maps.event.addListener(V,"mouseup",M)))}),[M]),(0,r.useEffect)((function(){V&&A&&(null!==ve&&google.maps.event.removeListener(ve),ye(google.maps.event.addListener(V,"rightclick",A)))}),[A]),(0,r.useEffect)((function(){V&&E&&(null!==be&&google.maps.event.removeListener(be),Ee(google.maps.event.addListener(V,"click",E)))}),[E]),(0,r.useEffect)((function(){V&&C&&(null!==Ce&&google.maps.event.removeListener(Ce),Le(google.maps.event.addListener(V,"drag",C)))}),[C]),(0,r.useEffect)((function(){V&&O&&(null!==ke&&google.maps.event.removeListener(ke),xe(google.maps.event.addListener(V,"clickable_changed",O)))}),[O]),(0,r.useEffect)((function(){V&&R&&(null!==_e&&google.maps.event.removeListener(_e),Ae(google.maps.event.addListener(V,"cursor_changed",R)))}),[R]),(0,r.useEffect)((function(){V&&T&&(null!==Re&&google.maps.event.removeListener(Re),Te(google.maps.event.addListener(V,"animation_changed",T)))}),[T]),(0,r.useEffect)((function(){V&&I&&(null!==De&&google.maps.event.removeListener(De),He(google.maps.event.addListener(V,"draggable_changed",I)))}),[I]),(0,r.useEffect)((function(){V&&D&&(null!==We&&google.maps.event.removeListener(We),je(google.maps.event.addListener(V,"flat_changed",D)))}),[D]),(0,r.useEffect)((function(){V&&H&&(null!==Ke&&google.maps.event.removeListener(Ke),Ne(google.maps.event.addListener(V,"icon_changed",H)))}),[H]),(0,r.useEffect)((function(){V&&U&&(null!==Je&&google.maps.event.removeListener(Je),Fe(google.maps.event.addListener(V,"position_changed",U)))}),[U]),(0,r.useEffect)((function(){V&&W&&(null!==Ge&&google.maps.event.removeListener(Ge),$e(google.maps.event.addListener(V,"shape_changed",W)))}),[W]),(0,r.useEffect)((function(){V&&j&&(null!==qe&&google.maps.event.removeListener(qe),Ye(google.maps.event.addListener(V,"title_changed",j)))}),[j]),(0,r.useEffect)((function(){V&&B&&(null!==Qe&&google.maps.event.removeListener(Qe),et(google.maps.event.addListener(V,"visible_changed",B)))}),[B]),(0,r.useEffect)((function(){V&&K&&(null!==nt&&google.maps.event.removeListener(nt),ot(google.maps.event.addListener(V,"zindex_changed",K)))}),[K]),(0,r.useEffect)((function(){var e=l(l(l({},n||te),i?te:{map:J}),{position:t}),o=new google.maps.Marker(e);return i?i.addMarker(o,!!s):o.setMap(J),t&&o.setPosition(t),void 0!==u&&o.setVisible(u),void 0!==c&&o.setDraggable(c),void 0!==d&&o.setClickable(d),"string"==typeof h&&o.setCursor(h),f&&o.setIcon(f),void 0!==m&&o.setLabel(m),void 0!==v&&o.setOpacity(v),y&&o.setShape(y),"string"==typeof w&&o.setTitle(w),"number"==typeof b&&o.setZIndex(b),S&&q(google.maps.event.addListener(o,"dblclick",S)),L&&Q(google.maps.event.addListener(o,"dragend",L)),P&&oe(google.maps.event.addListener(o,"dragstart",P)),_&&se(google.maps.event.addListener(o,"mousedown",_)),k&&ce(google.maps.event.addListener(o,"mouseout",k)),x&&de(google.maps.event.addListener(o,"mouseover",x)),M&&fe(google.maps.event.addListener(o,"mouseup",M)),A&&ye(google.maps.event.addListener(o,"rightclick",A)),E&&Ee(google.maps.event.addListener(o,"click",E)),C&&Le(google.maps.event.addListener(o,"drag",C)),O&&xe(google.maps.event.addListener(o,"clickable_changed",O)),R&&Ae(google.maps.event.addListener(o,"cursor_changed",R)),T&&Te(google.maps.event.addListener(o,"animation_changed",T)),I&&He(google.maps.event.addListener(o,"draggable_changed",I)),D&&je(google.maps.event.addListener(o,"flat_changed",D)),H&&Ne(google.maps.event.addListener(o,"icon_changed",H)),U&&Fe(google.maps.event.addListener(o,"position_changed",U)),W&&$e(google.maps.event.addListener(o,"shape_changed",W)),j&&Ye(google.maps.event.addListener(o,"title_changed",j)),B&&et(google.maps.event.addListener(o,"visible_changed",B)),K&&ot(google.maps.event.addListener(o,"zindex_changed",K)),G(o),N&&N(o),function(){null!==Z&&google.maps.event.removeListener(Z),null!==X&&google.maps.event.removeListener(X),null!==ne&&google.maps.event.removeListener(ne),null!==ie&&google.maps.event.removeListener(ie),null!==le&&google.maps.event.removeListener(le),null!==pe&&google.maps.event.removeListener(pe),null!==ge&&google.maps.event.removeListener(ge),null!==ve&&google.maps.event.removeListener(ve),null!==be&&google.maps.event.removeListener(be),null!==ke&&google.maps.event.removeListener(ke),null!==_e&&google.maps.event.removeListener(_e),null!==Re&&google.maps.event.removeListener(Re),null!==De&&google.maps.event.removeListener(De),null!==We&&google.maps.event.removeListener(We),null!==Ke&&google.maps.event.removeListener(Ke),null!==Je&&google.maps.event.removeListener(Je),null!==qe&&google.maps.event.removeListener(qe),null!==Qe&&google.maps.event.removeListener(Qe),null!==nt&&google.maps.event.removeListener(nt),z&&z(o),i?i.removeMarker(o,!!s):o&&o.setMap(null)}}),[]);var rt=(0,r.useMemo)((function(){return a?r.Children.map(a,(function(e){if(!(0,r.isValidElement)(e))return e;var t=e;return(0,r.cloneElement)(t,{anchor:V})})):null}),[a,V]);return(0,o.jsx)(o.Fragment,{children:rt})||null})),oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t}return a(t,e),t.prototype.componentDidMount=function(){var e=l(l(l({},this.props.options||te),this.props.clusterer?te:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(e),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=y({updaterMap:ee,eventMap:Q,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},t.prototype.componentDidUpdate=function(e){this.marker&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:ee,eventMap:Q,prevProps:e,nextProps:this.props,instance:this.marker}))},t.prototype.componentWillUnmount=function(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),v(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))},t.prototype.render=function(){var e=this,t=null;return this.props.children&&(t=r.Children.map(this.props.children,(function(t){if(!(0,r.isValidElement)(t))return t;var n=t;return(0,r.cloneElement)(n,{anchor:e.marker})}))),t||null},t.contextType=g,t}(r.PureComponent),re=function(){function e(t,n){t.getClusterer().extend(e,google.maps.OverlayView),this.cluster=t,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(t.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 e.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},e.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},e.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var t=this.cluster.getClusterer();if(google.maps.event.trigger(t,"click",this.cluster),google.maps.event.trigger(t,"clusterclick",this.cluster),t.getZoomOnClick()){var n=t.getMaxZoom(),o=this.cluster.getBounds(),r=t.getMap();null!==r&&"fitBounds"in r&&r.fitBounds(o),this.timeOut=window.setTimeout((function(){var e=t.getMap();if(null!==e){"fitBounds"in e&&e.fitBounds(o);var r=e.getZoom()||0;null!==n&&r>n&&e.setZoom(n+1)}}),100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},e.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},e.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},e.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),null===(e=this.getPanes())||void 0===e||e.overlayMouseTarget.appendChild(this.div);var t=this.getMap();null!==t&&(this.boundsChangedListener=google.maps.event.addListener(t,"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))},e.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),null!==this.boundsChangedListener&&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),null!==this.timeOut&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},e.prototype.draw=function(){if(this.visible&&null!==this.div&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=null!==e?"".concat(e.y,"px"):"0",this.div.style.left=null!==e?"".concat(e.x,"px"):"0"}},e.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},e.prototype.show=function(){var e,t,n,o,r,i;if(this.div&&this.center){var s=null===this.sums||void 0===this.sums.title||""===this.sums.title?this.cluster.getClusterer().getTitle():this.sums.title,a=this.backgroundPosition.split(" "),l=parseInt((null===(e=a[0])||void 0===e?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),c=parseInt((null===(t=a[1])||void 0===t?void 0:t.replace(/^\s+|\s+$/g,""))||"0",10),u=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(null!==u?"".concat(u.y,"px"):"0","; left: ").concat(null!==u?"".concat(u.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var p=document.createElement("img");p.alt=s,p.src=this.url,p.width=this.width,p.height=this.height,p.setAttribute("style","position: absolute; top: ".concat(c,"px; left: ").concat(l,"px")),this.cluster.getClusterer().enableRetinaIcons||(p.style.clip="rect(-".concat(c,"px, -").concat(l+this.width,"px, -").concat(c+this.height,", -").concat(l,")"));var d=document.createElement("div");d.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")),(null===(n=this.sums)||void 0===n?void 0:n.text)&&(d.innerText="".concat(null===(o=this.sums)||void 0===o?void 0:o.text)),(null===(r=this.sums)||void 0===r?void 0:r.html)&&(d.innerHTML="".concat(null===(i=this.sums)||void 0===i?void 0:i.html)),this.div.innerHTML="",this.div.appendChild(p),this.div.appendChild(d),this.div.title=s,this.div.style.display=""}this.visible=!0},e.prototype.useStyle=function(e){this.sums=e;var t=this.cluster.getClusterer().getStyles(),n=t[Math.min(t.length-1,Math.max(0,e.index-1))];n&&(this.url=n.url,this.height=n.height,this.width=n.width,n.className&&(this.className="".concat(this.clusterClassName," ").concat(n.className)),this.anchorText=n.anchorText||[0,0],this.anchorIcon=n.anchorIcon||[this.height/2,this.width/2],this.textColor=n.textColor||"black",this.textSize=n.textSize||11,this.textDecoration=n.textDecoration||"none",this.fontWeight=n.fontWeight||"bold",this.fontStyle=n.fontStyle||"normal",this.fontFamily=n.fontFamily||"Arial,sans-serif",this.backgroundPosition=n.backgroundPosition||"0 0")},e.prototype.setCenter=function(e){this.center=e},e.prototype.getPosFromLatLng=function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return null!==t&&(t.x-=this.anchorIcon[1],t.y-=this.anchorIcon[0]),t},e}(),ie=function(){function e(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 re(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 e.prototype.getSize=function(){return this.markers.length},e.prototype.getMarkers=function(){return this.markers},e.prototype.getCenter=function(){return this.center},e.prototype.getMap=function(){return this.map},e.prototype.getClusterer=function(){return this.markerClusterer},e.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),t=0,n=this.getMarkers();t<n.length;t++){var o=n[t].getPosition();o&&e.extend(o)}return e},e.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},e.prototype.addMarker=function(e){var t,n;if(this.isMarkerAlreadyAdded(e))return!1;if(this.center){if(this.averageCenter&&(n=e.getPosition())){var o=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(o-1)+n.lat())/o,(this.center.lng()*(o-1)+n.lng())/o),this.calculateBounds()}}else(n=e.getPosition())&&(this.center=n,this.calculateBounds());e.isAdded=!0,this.markers.push(e);var r=this.markers.length,i=this.markerClusterer.getMaxZoom(),s=null===(t=this.map)||void 0===t?void 0:t.getZoom();if(null!==i&&void 0!==s&&s>i)e.getMap()!==this.map&&e.setMap(this.map);else if(r<this.minClusterSize)e.getMap()!==this.map&&e.setMap(this.map);else if(r===this.minClusterSize)for(var a=0,l=this.markers;a<l.length;a++)l[a].setMap(null);else e.setMap(null);return!0},e.prototype.isMarkerInClusterBounds=function(e){if(null!==this.bounds){var t=e.getPosition();if(t)return this.bounds.contains(t)}return!1},e.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},e.prototype.updateIcon=function(){var e,t=this.markers.length,n=this.markerClusterer.getMaxZoom(),o=null===(e=this.map)||void 0===e?void 0:e.getZoom();null!==n&&void 0!==o&&o>n||t<this.minClusterSize?this.clusterIcon.hide():(this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show())},e.prototype.isMarkerAlreadyAdded=function(e){if(this.markers.includes)return this.markers.includes(e);for(var t=0;t<this.markers.length;t++)if(e===this.markers[t])return!0;return!1},e}();function se(e,t){var n=e.length,o=n.toString().length,r=Math.min(o,t);return{text:n.toString(),index:r,title:""}}var ae=[53,56,66,78,90],le=function(){function e(t,n,o){void 0===n&&(n=[]),void 0===o&&(o={}),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(e,google.maps.OverlayView),this.markers=[],this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=o.gridSize||60,this.minClusterSize=o.minimumClusterSize||2,this.maxZoom=o.maxZoom||null,this.styles=o.styles||[],this.title=o.title||"",this.zoomOnClick=!0,void 0!==o.zoomOnClick&&(this.zoomOnClick=o.zoomOnClick),this.averageCenter=!1,void 0!==o.averageCenter&&(this.averageCenter=o.averageCenter),this.ignoreHidden=!1,void 0!==o.ignoreHidden&&(this.ignoreHidden=o.ignoreHidden),this.enableRetinaIcons=!1,void 0!==o.enableRetinaIcons&&(this.enableRetinaIcons=o.enableRetinaIcons),this.imagePath=o.imagePath||"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",this.imageExtension=o.imageExtension||"png",this.imageSizes=o.imageSizes||ae,this.calculator=o.calculator||se,this.batchSize=o.batchSize||2e3,this.batchSizeIE=o.batchSizeIE||500,this.clusterClass=o.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(n,!0),this.setMap(t)}return e.prototype.onZoomChanged=function(){var e,t;this.resetViewport(!1),(null===(e=this.getMap())||void 0===e?void 0:e.getZoom())!==(this.get("minZoom")||0)&&(null===(t=this.getMap())||void 0===t?void 0:t.getZoom())!==this.get("maxZoom")||google.maps.event.trigger(this,"idle")},e.prototype.onIdle=function(){this.redraw()},e.prototype.onAdd=function(){var e=this.getMap();this.activeMap=e,this.ready=!0,this.repaint(),null!==e&&(this.listeners=[google.maps.event.addListener(e,"zoom_changed",this.onZoomChanged),google.maps.event.addListener(e,"idle",this.onIdle)])},e.prototype.onRemove=function(){for(var e=0,t=this.markers;e<t.length;e++){var n=t[e];n.getMap()!==this.activeMap&&n.setMap(this.activeMap)}for(var o=0,r=this.clusters;o<r.length;o++)r[o].remove();this.clusters=[];for(var i=0,s=this.listeners;i<s.length;i++){var a=s[i];google.maps.event.removeListener(a)}this.listeners=[],this.activeMap=null,this.ready=!1},e.prototype.draw=function(){},e.prototype.getMap=function(){return null},e.prototype.getPanes=function(){return null},e.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}}},e.prototype.setMap=function(){},e.prototype.addListener=function(){return{remove:function(){}}},e.prototype.bindTo=function(){},e.prototype.get=function(){},e.prototype.notify=function(){},e.prototype.set=function(){},e.prototype.setValues=function(){},e.prototype.unbind=function(){},e.prototype.unbindAll=function(){},e.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})},e.prototype.fitMapToMarkers=function(){for(var e=this.getMarkers(),t=new google.maps.LatLngBounds,n=0,o=e;n<o.length;n++){var r=o[n].getPosition();r&&t.extend(r)}var i=this.getMap();null!==i&&"fitBounds"in i&&i.fitBounds(t)},e.prototype.getGridSize=function(){return this.gridSize},e.prototype.setGridSize=function(e){this.gridSize=e},e.prototype.getMinimumClusterSize=function(){return this.minClusterSize},e.prototype.setMinimumClusterSize=function(e){this.minClusterSize=e},e.prototype.getMaxZoom=function(){return this.maxZoom},e.prototype.setMaxZoom=function(e){this.maxZoom=e},e.prototype.getStyles=function(){return this.styles},e.prototype.setStyles=function(e){this.styles=e},e.prototype.getTitle=function(){return this.title},e.prototype.setTitle=function(e){this.title=e},e.prototype.getZoomOnClick=function(){return this.zoomOnClick},e.prototype.setZoomOnClick=function(e){this.zoomOnClick=e},e.prototype.getAverageCenter=function(){return this.averageCenter},e.prototype.setAverageCenter=function(e){this.averageCenter=e},e.prototype.getIgnoreHidden=function(){return this.ignoreHidden},e.prototype.setIgnoreHidden=function(e){this.ignoreHidden=e},e.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},e.prototype.setEnableRetinaIcons=function(e){this.enableRetinaIcons=e},e.prototype.getImageExtension=function(){return this.imageExtension},e.prototype.setImageExtension=function(e){this.imageExtension=e},e.prototype.getImagePath=function(){return this.imagePath},e.prototype.setImagePath=function(e){this.imagePath=e},e.prototype.getImageSizes=function(){return this.imageSizes},e.prototype.setImageSizes=function(e){this.imageSizes=e},e.prototype.getCalculator=function(){return this.calculator},e.prototype.setCalculator=function(e){this.calculator=e},e.prototype.getBatchSizeIE=function(){return this.batchSizeIE},e.prototype.setBatchSizeIE=function(e){this.batchSizeIE=e},e.prototype.getClusterClass=function(){return this.clusterClass},e.prototype.setClusterClass=function(e){this.clusterClass=e},e.prototype.getMarkers=function(){return this.markers},e.prototype.getTotalMarkers=function(){return this.markers.length},e.prototype.getClusters=function(){return this.clusters},e.prototype.getTotalClusters=function(){return this.clusters.length},e.prototype.addMarker=function(e,t){this.pushMarkerTo(e),t||this.redraw()},e.prototype.addMarkers=function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=e[n];o&&this.pushMarkerTo(o)}t||this.redraw()},e.prototype.pushMarkerTo=function(e){var t=this;e.getDraggable()&&google.maps.event.addListener(e,"dragend",(function(){t.ready&&(e.isAdded=!1,t.repaint())})),e.isAdded=!1,this.markers.push(e)},e.prototype.removeMarker_=function(e){var t=-1;if(this.markers.indexOf)t=this.markers.indexOf(e);else for(var n=0;n<this.markers.length;n++)if(e===this.markers[n]){t=n;break}return-1!==t&&(e.setMap(null),this.markers.splice(t,1),!0)},e.prototype.removeMarker=function(e,t){var n=this.removeMarker_(e);return!t&&n&&this.repaint(),n},e.prototype.removeMarkers=function(e,t){for(var n=!1,o=0,r=e;o<r.length;o++){var i=r[o];n=n||this.removeMarker_(i)}return!t&&n&&this.repaint(),n},e.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]},e.prototype.repaint=function(){var e=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout((function(){for(var t=0,n=e;t<n.length;t++)n[t].remove()}),0)},e.prototype.getExtendedBounds=function(e){var t=this.getProjection(),n=t.fromLatLngToDivPixel(new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()));null!==n&&(n.x+=this.gridSize,n.y-=this.gridSize);var o=t.fromLatLngToDivPixel(new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()));if(null!==o&&(o.x-=this.gridSize,o.y+=this.gridSize),null!==n){var r=t.fromDivPixelToLatLng(n);null!==r&&e.extend(r)}if(null!==o){var i=t.fromDivPixelToLatLng(o);null!==i&&e.extend(i)}return e},e.prototype.redraw=function(){this.createClusters(0)},e.prototype.resetViewport=function(e){for(var t=0,n=this.clusters;t<n.length;t++)n[t].remove();this.clusters=[];for(var o=0,r=this.markers;o<r.length;o++){var i=r[o];i.isAdded=!1,e&&i.setMap(null)}},e.prototype.distanceBetweenPoints=function(e,t){var n=(t.lat()-e.lat())*Math.PI/180,o=(t.lng()-e.lng())*Math.PI/180,r=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r))*6371},e.prototype.isMarkerInBounds=function(e,t){var n=e.getPosition();return!!n&&t.contains(n)},e.prototype.addToClosestCluster=function(e){for(var t,n=4e4,o=null,r=0,i=this.clusters;r<i.length;r++){var s=(t=i[r]).getCenter(),a=e.getPosition();if(s&&a){var l=this.distanceBetweenPoints(s,a);l<n&&(n=l,o=t)}}o&&o.isMarkerInClusterBounds(e)?o.addMarker(e):((t=new ie(this)).addMarker(e),this.clusters.push(t))},e.prototype.createClusters=function(e){var t=this;if(this.ready){0===e&&(google.maps.event.trigger(this,"clusteringbegin",this),null!==this.timerRefStatic&&(window.clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var n=this.getMap(),o=(null!==n&&"getBounds"in n?n.getBounds():null),r=((null==n?void 0:n.getZoom())||0)>3?new google.maps.LatLngBounds(null==o?void 0:o.getSouthWest(),null==o?void 0:o.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),i=this.getExtendedBounds(r),s=Math.min(e+this.batchSize,this.markers.length),a=e;a<s;a++){var l=this.markers[a];l&&!l.isAdded&&this.isMarkerInBounds(l,i)&&(!this.ignoreHidden||this.ignoreHidden&&l.getVisible())&&this.addToClosestCluster(l)}if(s<this.markers.length)this.timerRefStatic=window.setTimeout((function(){t.createClusters(s)}),0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);for(var c=0,u=this.clusters;c<u.length;c++)u[c].updateIcon()}}},e.prototype.extend=function(e,t){return function(e){for(var t in e.prototype){var n=t;this.prototype[n]=e.prototype[n]}return this}.apply(e,[t])},e}(),ce={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},ue={averageCenter:function(e,t){e.setAverageCenter(t)},batchSizeIE:function(e,t){e.setBatchSizeIE(t)},calculator:function(e,t){e.setCalculator(t)},clusterClass:function(e,t){e.setClusterClass(t)},enableRetinaIcons:function(e,t){e.setEnableRetinaIcons(t)},gridSize:function(e,t){e.setGridSize(t)},ignoreHidden:function(e,t){e.setIgnoreHidden(t)},imageExtension:function(e,t){e.setImageExtension(t)},imagePath:function(e,t){e.setImagePath(t)},imageSizes:function(e,t){e.setImageSizes(t)},maxZoom:function(e,t){e.setMaxZoom(t)},minimumClusterSize:function(e,t){e.setMinimumClusterSize(t)},styles:function(e,t){e.setStyles(t)},title:function(e,t){e.setTitle(t)},zoomOnClick:function(e,t){e.setZoomOnClick(t)}},pe={},de=(0,r.memo)((function(e){var t=e.children,n=e.options,o=e.averageCenter,i=e.batchSizeIE,s=e.calculator,a=e.clusterClass,c=e.enableRetinaIcons,u=e.gridSize,p=e.ignoreHidden,d=e.imageExtension,h=e.imagePath,f=e.imageSizes,m=e.maxZoom,v=e.minimumClusterSize,y=e.styles,w=e.title,b=e.zoomOnClick,E=e.onClick,S=e.onClusteringBegin,C=e.onClusteringEnd,L=e.onMouseOver,P=e.onMouseOut,k=e.onLoad,x=e.onUnmount,M=(0,r.useState)(null),_=M[0],A=M[1],O=(0,r.useContext)(g),R=(0,r.useState)(null),T=R[0],I=R[1],D=(0,r.useState)(null),H=D[0],U=D[1],W=(0,r.useState)(null),j=W[0],B=W[1],K=(0,r.useState)(null),N=K[0],z=K[1],J=(0,r.useState)(null),F=J[0],V=J[1];return(0,r.useEffect)((function(){_&&P&&(null!==N&&google.maps.event.removeListener(N),z(google.maps.event.addListener(_,ce.onMouseOut,P)))}),[P]),(0,r.useEffect)((function(){_&&L&&(null!==F&&google.maps.event.removeListener(F),V(google.maps.event.addListener(_,ce.onMouseOver,L)))}),[L]),(0,r.useEffect)((function(){_&&E&&(null!==T&&google.maps.event.removeListener(T),I(google.maps.event.addListener(_,ce.onClick,E)))}),[E]),(0,r.useEffect)((function(){_&&S&&(null!==H&&google.maps.event.removeListener(H),U(google.maps.event.addListener(_,ce.onClusteringBegin,S)))}),[S]),(0,r.useEffect)((function(){_&&C&&(null!==j&&google.maps.event.removeListener(j),U(google.maps.event.addListener(_,ce.onClusteringEnd,C)))}),[C]),(0,r.useEffect)((function(){void 0!==o&&null!==_&&ue.averageCenter(_,o)}),[_,o]),(0,r.useEffect)((function(){void 0!==i&&null!==_&&ue.batchSizeIE(_,i)}),[_,i]),(0,r.useEffect)((function(){void 0!==s&&null!==_&&ue.calculator(_,s)}),[_,s]),(0,r.useEffect)((function(){void 0!==a&&null!==_&&ue.clusterClass(_,a)}),[_,a]),(0,r.useEffect)((function(){void 0!==c&&null!==_&&ue.enableRetinaIcons(_,c)}),[_,c]),(0,r.useEffect)((function(){void 0!==u&&null!==_&&ue.gridSize(_,u)}),[_,u]),(0,r.useEffect)((function(){void 0!==p&&null!==_&&ue.ignoreHidden(_,p)}),[_,p]),(0,r.useEffect)((function(){void 0!==d&&null!==_&&ue.imageExtension(_,d)}),[_,d]),(0,r.useEffect)((function(){void 0!==h&&null!==_&&ue.imagePath(_,h)}),[_,h]),(0,r.useEffect)((function(){void 0!==f&&null!==_&&ue.imageSizes(_,f)}),[_,f]),(0,r.useEffect)((function(){void 0!==m&&null!==_&&ue.maxZoom(_,m)}),[_,m]),(0,r.useEffect)((function(){void 0!==v&&null!==_&&ue.minimumClusterSize(_,v)}),[_,v]),(0,r.useEffect)((function(){void 0!==y&&null!==_&&ue.styles(_,y)}),[_,y]),(0,r.useEffect)((function(){void 0!==w&&null!==_&&ue.title(_,w)}),[_,w]),(0,r.useEffect)((function(){void 0!==b&&null!==_&&ue.zoomOnClick(_,b)}),[_,b]),(0,r.useEffect)((function(){if(O){var e=l({},n||pe),t=new le(O,[],e);return o&&ue.averageCenter(t,o),i&&ue.batchSizeIE(t,i),s&&ue.calculator(t,s),a&&ue.clusterClass(t,a),c&&ue.enableRetinaIcons(t,c),u&&ue.gridSize(t,u),p&&ue.ignoreHidden(t,p),d&&ue.imageExtension(t,d),h&&ue.imagePath(t,h),f&&ue.imageSizes(t,f),m&&ue.maxZoom(t,m),v&&ue.minimumClusterSize(t,v),y&&ue.styles(t,y),w&&ue.title(t,w),b&&ue.zoomOnClick(t,b),P&&z(google.maps.event.addListener(t,ce.onMouseOut,P)),L&&V(google.maps.event.addListener(t,ce.onMouseOver,L)),E&&I(google.maps.event.addListener(t,ce.onClick,E)),S&&U(google.maps.event.addListener(t,ce.onClusteringBegin,S)),C&&B(google.maps.event.addListener(t,ce.onClusteringEnd,C)),A(t),k&&k(t),function(){null!==N&&google.maps.event.removeListener(N),null!==F&&google.maps.event.removeListener(F),null!==T&&google.maps.event.removeListener(T),null!==H&&google.maps.event.removeListener(H),null!==j&&google.maps.event.removeListener(j),x&&x(t)}}}),[]),null!==_&&t(_)||null})),he=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={markerClusterer:null},t.setClustererCallback=function(){null!==t.state.markerClusterer&&t.props.onLoad&&t.props.onLoad(t.state.markerClusterer)},t}return a(t,e),t.prototype.componentDidMount=function(){if(this.context){var e=new le(this.context,[],this.props.options);this.registeredEvents=y({updaterMap:ue,eventMap:ce,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{markerClusterer:e}}),this.setClustererCallback)}},t.prototype.componentDidUpdate=function(e){this.state.markerClusterer&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:ue,eventMap:ce,prevProps:e,nextProps:this.props,instance:this.state.markerClusterer}))},t.prototype.componentWillUnmount=function(){null!==this.state.markerClusterer&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),v(this.registeredEvents),this.state.markerClusterer.setMap(null))},t.prototype.render=function(){return null!==this.state.markerClusterer?this.props.children(this.state.markerClusterer):null},t.contextType=g,t}(r.PureComponent);function ge(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}var fe=function(){function e(t){void 0===t&&(t={}),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(e,google.maps.OverlayView),this.content=t.content||"",this.disableAutoPan=t.disableAutoPan||!1,this.maxWidth=t.maxWidth||0,this.pixelOffset=t.pixelOffset||new google.maps.Size(0,0),this.position=t.position||new google.maps.LatLng(0,0),this.zIndex=t.zIndex||null,this.boxClass=t.boxClass||"infoBox",this.boxStyle=t.boxStyle||{},this.closeBoxMargin=t.closeBoxMargin||"2px",this.closeBoxURL=t.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===t.closeBoxURL&&(this.closeBoxURL=""),this.infoBoxClearance=t.infoBoxClearance||new google.maps.Size(1,1),void 0===t.visible&&(void 0===t.isHidden?t.visible=!0:t.visible=!t.isHidden),this.isHidden=!t.visible,this.alignBottom=t.alignBottom||!1,this.pane=t.pane||"floatPane",this.enableEventPropagation=t.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return e.prototype.createInfoBoxDiv=function(){var e=this;if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),"string"==typeof this.content?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var t=this.getPanes();if(null!==t&&t[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(0!==this.maxWidth&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var n=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-n.left-n.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var o=0,r=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"];o<r.length;o++){var i=r[o];this.eventListeners.push(google.maps.event.addListener(this.div,i,ge))}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",(function(t){t.returnValue=!1,t.preventDefault&&t.preventDefault(),e.enableEventPropagation||ge(t)})),google.maps.event.trigger(this,"domready")}},e.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},e.prototype.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&""!==this.closeBoxURL?google.maps.event.addListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},e.prototype.closeClickHandler=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(this,"closeclick"),this.close()},e.prototype.getCloseClickHandler=function(){return this.closeClickHandler},e.prototype.panBox=function(e){if(this.div&&!e){var t=this.getMap();if(t instanceof google.maps.Map){var n=0,o=0,r=t.getBounds();r&&!r.contains(this.position)&&t.setCenter(this.position);var i=t.getDiv(),s=i.offsetWidth,a=i.offsetHeight,l=this.pixelOffset.width,c=this.pixelOffset.height,u=this.div.offsetWidth,p=this.div.offsetHeight,d=this.infoBoxClearance.width,h=this.infoBoxClearance.height,g=this.getProjection().fromLatLngToContainerPixel(this.position);null!==g&&(g.x<-l+d?n=g.x+l-d:g.x+u+l+d>s&&(n=g.x+u+l+d-s),this.alignBottom?g.y<-c+h+p?o=g.y+c-h-p:g.y+c+h>a&&(o=g.y+c+h-a):g.y<-c+h?o=g.y+c-h:g.y+p+c+h>a&&(o=g.y+p+c+h-a)),0===n&&0===o||t.panBy(n,o)}}},e.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.div.style[t]=e[t]);if(this.div.style.webkitTransform="translateZ(0)",void 0!==this.div.style.opacity&&""!==this.div.style.opacity){var n=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*n+')"',this.div.style.filter="alpha(opacity="+100*n+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",null!==this.zIndex&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},e.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var t=this.div.ownerDocument,n=t&&t.defaultView?t.defaultView.getComputedStyle(this.div,""):null;n&&(e.top=parseInt(n.borderTopWidth||"",10)||0,e.bottom=parseInt(n.borderBottomWidth||"",10)||0,e.left=parseInt(n.borderLeftWidth||"",10)||0,e.right=parseInt(n.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var o=this.div.currentStyle;o&&(e.top=parseInt(o.borderTopWidth||"",10)||0,e.bottom=parseInt(o.borderBottomWidth||"",10)||0,e.left=parseInt(o.borderLeftWidth||"",10)||0,e.right=parseInt(o.borderRightWidth||"",10)||0)}return e},e.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},e.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection().fromLatLngToDivPixel(this.position);null!==e&&(this.div.style.left=e.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(e.y+this.pixelOffset.height)+"px":this.div.style.top=e.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},e.prototype.setOptions=function(e){void 0===e&&(e={}),void 0!==e.boxClass&&(this.boxClass=e.boxClass,this.setBoxStyle()),void 0!==e.boxStyle&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),void 0!==e.content&&this.setContent(e.content),void 0!==e.disableAutoPan&&(this.disableAutoPan=e.disableAutoPan),void 0!==e.maxWidth&&(this.maxWidth=e.maxWidth),void 0!==e.pixelOffset&&(this.pixelOffset=e.pixelOffset),void 0!==e.alignBottom&&(this.alignBottom=e.alignBottom),void 0!==e.position&&this.setPosition(e.position),void 0!==e.zIndex&&this.setZIndex(e.zIndex),void 0!==e.closeBoxMargin&&(this.closeBoxMargin=e.closeBoxMargin),void 0!==e.closeBoxURL&&(this.closeBoxURL=e.closeBoxURL),void 0!==e.infoBoxClearance&&(this.infoBoxClearance=e.infoBoxClearance),void 0!==e.isHidden&&(this.isHidden=e.isHidden),void 0!==e.visible&&(this.isHidden=!e.visible),void 0!==e.enableEventPropagation&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},e.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=""),"string"==typeof e?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","string"==typeof e?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},e.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},e.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},e.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},e.prototype.getContent=function(){return this.content},e.prototype.getPosition=function(){return this.position},e.prototype.getZIndex=function(){return this.zIndex},e.prototype.getVisible=function(){return null!=this.getMap()&&!this.isHidden},e.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},e.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},e.prototype.open=function(e,t){var n=this;t&&(this.position=t.getPosition(),this.moveListener=google.maps.event.addListener(t,"position_changed",(function(){var e=t.getPosition();n.setPosition(e)})),this.mapListener=google.maps.event.addListener(t,"map_changed",(function(){n.setMap(t.map)}))),this.setMap(e),this.div&&this.panBox()},e.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,t=this.eventListeners;e<t.length;e++){var n=t[e];google.maps.event.removeListener(n)}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)},e.prototype.extend=function(e,t){return function(e){for(var t in e.prototype)Object.prototype.hasOwnProperty.call(this,t)||(this.prototype[t]=e.prototype[t]);return this}.apply(e,[t])},e}(),me={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},ve={options:function(e,t){e.setOptions(t)},position:function(e,t){t instanceof google.maps.LatLng?e.setPosition(t):e.setPosition(new google.maps.LatLng(t.lat,t.lng))},visible:function(e,t){e.setVisible(t)},zIndex:function(e,t){e.setZIndex(t)}},ye={},we=(0,r.memo)((function(e){var t=e.children,n=e.anchor,o=e.options,s=e.position,a=e.zIndex,u=e.onCloseClick,p=e.onDomReady,d=e.onContentChanged,f=e.onPositionChanged,m=e.onZindexChanged,v=e.onLoad,y=e.onUnmount,w=(0,r.useContext)(g),b=(0,r.useState)(null),E=b[0],S=b[1],C=(0,r.useState)(null),L=C[0],P=C[1],k=(0,r.useState)(null),x=k[0],M=k[1],_=(0,r.useState)(null),A=_[0],O=_[1],R=(0,r.useState)(null),T=R[0],I=R[1],D=(0,r.useState)(null),H=D[0],U=D[1],W=(0,r.useRef)(null);return(0,r.useEffect)((function(){w&&null!==E&&(E.close(),n?E.open(w,n):E.getPosition()&&E.open(w))}),[w,E,n]),(0,r.useEffect)((function(){o&&null!==E&&E.setOptions(o)}),[E,o]),(0,r.useEffect)((function(){if(s&&null!==E){var e=s instanceof google.maps.LatLng?s:new google.maps.LatLng(s.lat,s.lng);E.setPosition(e)}}),[s]),(0,r.useEffect)((function(){"number"==typeof a&&null!==E&&E.setZIndex(a)}),[a]),(0,r.useEffect)((function(){E&&u&&(null!==L&&google.maps.event.removeListener(L),P(google.maps.event.addListener(E,"closeclick",u)))}),[u]),(0,r.useEffect)((function(){E&&p&&(null!==x&&google.maps.event.removeListener(x),M(google.maps.event.addListener(E,"domready",p)))}),[p]),(0,r.useEffect)((function(){E&&d&&(null!==A&&google.maps.event.removeListener(A),O(google.maps.event.addListener(E,"content_changed",d)))}),[d]),(0,r.useEffect)((function(){E&&f&&(null!==T&&google.maps.event.removeListener(T),I(google.maps.event.addListener(E,"position_changed",f)))}),[f]),(0,r.useEffect)((function(){E&&m&&(null!==H&&google.maps.event.removeListener(H),U(google.maps.event.addListener(E,"zindex_changed",m)))}),[m]),(0,r.useEffect)((function(){if(w){var e=o||ye,t=e.position,r=c(e,["position"]),i=void 0;!t||t instanceof google.maps.LatLng||(i=new google.maps.LatLng(t.lat,t.lng));var s=new fe(l(l({},r),i?{position:i}:{}));W.current=document.createElement("div"),S(s),u&&P(google.maps.event.addListener(s,"closeclick",u)),p&&M(google.maps.event.addListener(s,"domready",p)),d&&O(google.maps.event.addListener(s,"content_changed",d)),f&&I(google.maps.event.addListener(s,"position_changed",f)),m&&U(google.maps.event.addListener(s,"zindex_changed",m)),s.setContent(W.current),n?s.open(w,n):s.getPosition()?s.open(w):h(!1,"You must provide either an anchor or a position prop for <InfoBox>."),v&&v(s)}return function(){null!==E&&(L&&google.maps.event.removeListener(L),A&&google.maps.event.removeListener(A),x&&google.maps.event.removeListener(x),T&&google.maps.event.removeListener(T),H&&google.maps.event.removeListener(H),y&&y(E),E.close())}}),[]),W.current?(0,i.createPortal)(r.Children.only(t),W.current):null})),be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=null,t.state={infoBox:null},t.open=function(e,n){n?null!==t.context&&e.open(t.context,n):e.getPosition()?null!==t.context&&e.open(t.context):h(!1,"You must provide either an anchor or a position prop for <InfoBox>.")},t.setInfoBoxCallback=function(){null!==t.state.infoBox&&null!==t.containerElement&&(t.state.infoBox.setContent(t.containerElement),t.open(t.state.infoBox,t.props.anchor),t.props.onLoad&&t.props.onLoad(t.state.infoBox))},t}return a(t,e),t.prototype.componentDidMount=function(){var e,t=this.props.options||{},n=t.position,o=c(t,["position"]);!n||n instanceof google.maps.LatLng||(e=new google.maps.LatLng(n.lat,n.lng));var r=new fe(l(l({},o),e?{position:e}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=y({updaterMap:ve,eventMap:me,prevProps:{},nextProps:this.props,instance:r}),this.setState({infoBox:r},this.setInfoBoxCallback)},t.prototype.componentDidUpdate=function(e){var t=this.state.infoBox;null!==t&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:ve,eventMap:me,prevProps:e,nextProps:this.props,instance:t}))},t.prototype.componentWillUnmount=function(){var e=this.props.onUnmount,t=this.state.infoBox;null!==t&&(e&&e(t),v(this.registeredEvents),t.close())},t.prototype.render=function(){return this.containerElement?(0,i.createPortal)(r.Children.only(this.props.children),this.containerElement):null},t.contextType=g,t}(r.PureComponent),Ee=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var s=i[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n},Se=d(Ee);const Ce=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Le{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,n]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const o=n>>4;if(1!==o)throw new Error(`Got v${o} data when expected v1.`);const r=Ce[15&n];if(!r)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new Le(s,i,r,e)}constructor(e,t=64,n=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const r=Ce.indexOf(this.ArrayType),i=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-s%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${n}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+a,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+i+s+a),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+a,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+r]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Pe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:i,nodeSize:s}=this,a=[0,r.length-1,0],l=[];for(;a.length;){const c=a.pop()||0,u=a.pop()||0,p=a.pop()||0;if(u-p<=s){for(let s=p;s<=u;s++){const a=i[2*s],c=i[2*s+1];a>=e&&a<=n&&c>=t&&c<=o&&l.push(r[s])}continue}const d=p+u>>1,h=i[2*d],g=i[2*d+1];h>=e&&h<=n&&g>=t&&g<=o&&l.push(r[d]),(0===c?e<=h:t<=g)&&(a.push(p),a.push(d-1),a.push(1-c)),(0===c?n>=h:o>=g)&&(a.push(d+1),a.push(u),a.push(1-c))}return l}within(e,t,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:r,nodeSize:i}=this,s=[0,o.length-1,0],a=[],l=n*n;for(;s.length;){const c=s.pop()||0,u=s.pop()||0,p=s.pop()||0;if(u-p<=i){for(let n=p;n<=u;n++)_e(r[2*n],r[2*n+1],e,t)<=l&&a.push(o[n]);continue}const d=p+u>>1,h=r[2*d],g=r[2*d+1];_e(h,g,e,t)<=l&&a.push(o[d]),(0===c?e-n<=h:t-n<=g)&&(s.push(p),s.push(d-1),s.push(1-c)),(0===c?e+n>=h:t+n>=g)&&(s.push(d+1),s.push(u),s.push(1-c))}return a}}function Pe(e,t,n,o,r,i){if(r-o<=n)return;const s=o+r>>1;ke(e,t,s,o,r,i),Pe(e,t,n,o,s-1,1-i),Pe(e,t,n,s+1,r,1-i)}function ke(e,t,n,o,r,i){for(;r>o;){if(r-o>600){const s=r-o+1,a=n-o+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);ke(e,t,n,Math.max(o,Math.floor(n-a*c/s+u)),Math.min(r,Math.floor(n+(s-a)*c/s+u)),i)}const s=t[2*n+i];let a=o,l=r;for(xe(e,t,o,n),t[2*r+i]>s&&xe(e,t,o,r);a<l;){for(xe(e,t,a,l),a++,l--;t[2*a+i]<s;)a++;for(;t[2*l+i]>s;)l--}t[2*o+i]===s?xe(e,t,o,l):(l++,xe(e,t,l,r)),l<=n&&(o=l+1),n<=l&&(r=l-1)}}function xe(e,t,n,o){Me(e,n,o),Me(t,2*n,2*o),Me(t,2*n+1,2*o+1)}function Me(e,t,n){const o=e[t];e[t]=e[n],e[n]=o}function _e(e,t,n,o){const r=e-n,i=t-o;return r*r+i*i}const Ae={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},Oe=Math.fround||(Re=new Float32Array(1),e=>(Re[0]=+e,Re[0]));var Re;class Te{constructor(e){this.options=Object.assign(Object.create(Ae),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:n,maxZoom:o}=this.options;t&&console.time("total time");const r=`prepare ${e.length} points`;t&&console.time(r),this.points=e;const i=[];for(let t=0;t<e.length;t++){const n=e[t];if(!n.geometry)continue;const[o,r]=n.geometry.coordinates,s=Oe(He(o)),a=Oe(Ue(r));i.push(s,a,1/0,t,-1,1),this.options.reduce&&i.push(0)}let s=this.trees[o+1]=this._createTree(i);t&&console.timeEnd(r);for(let e=o;e>=n;e--){const n=+Date.now();s=this.trees[e]=this._createTree(this._cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,+Date.now()-n)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[1]));let r=180===e[2]?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,r=180;else if(n>r){const e=this.getClusters([n,o,180,i],t),s=this.getClusters([-180,o,r,i],t);return e.concat(s)}const s=this.trees[this._limitZoom(t)],a=s.range(He(n),Ue(i),He(r),Ue(o)),l=s.data,c=[];for(const e of a){const t=this.stride*e;c.push(l[t+5]>1?Ie(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){const t=this._getOriginId(e),n=this._getOriginZoom(e),o="No cluster with the specified id.",r=this.trees[n];if(!r)throw new Error(o);const i=r.data;if(t*this.stride>=i.length)throw new Error(o);const s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),a=i[t*this.stride],l=i[t*this.stride+1],c=r.within(a,l,s),u=[];for(const t of c){const n=t*this.stride;i[n+4]===e&&u.push(i[n+5]>1?Ie(i,n,this.clusterProps):this.points[i[n+3]])}if(0===u.length)throw new Error(o);return u}getLeaves(e,t,n){t=t||10,n=n||0;const o=[];return this._appendLeaves(o,e,t,n,0),o}getTile(e,t,n){const o=this.trees[this._limitZoom(e)],r=Math.pow(2,e),{extent:i,radius:s}=this.options,a=s/i,l=(n-a)/r,c=(n+1+a)/r,u={features:[]};return this._addTileFeatures(o.range((t-a)/r,l,(t+1+a)/r,c),o.data,t,n,r,u),0===t&&this._addTileFeatures(o.range(1-a/r,l,1,c),o.data,r,n,r,u),t===r-1&&this._addTileFeatures(o.range(0,l,a/r,c),o.data,-1,n,r,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,o,r){const i=this.getChildren(t);for(const t of i){const i=t.properties;if(i&&i.cluster?r+i.point_count<=o?r+=i.point_count:r=this._appendLeaves(e,i.cluster_id,n,o,r):r<o?r++:e.push(t),e.length===n)break}return r}_createTree(e){const t=new Le(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,o,r,i){for(const s of e){const e=s*this.stride,a=t[e+5]>1;let l,c,u;if(a)l=De(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const n=this.points[t[e+3]];l=n.properties;const[o,r]=n.geometry.coordinates;c=He(o),u=Ue(r)}const p={type:1,geometry:[[Math.round(this.options.extent*(c*r-n)),Math.round(this.options.extent*(u*r-o))]],tags:l};let d;d=a||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==d&&(p.id=d),i.features.push(p)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:n,extent:o,reduce:r,minPoints:i}=this.options,s=n/(o*Math.pow(2,t)),a=e.data,l=[],c=this.stride;for(let n=0;n<a.length;n+=c){if(a[n+2]<=t)continue;a[n+2]=t;const o=a[n],u=a[n+1],p=e.within(a[n],a[n+1],s),d=a[n+5];let h=d;for(const e of p){const n=e*c;a[n+2]>t&&(h+=a[n+5])}if(h>d&&h>=i){let e,i=o*d,s=u*d,g=-1;const f=((n/c|0)<<5)+(t+1)+this.points.length;for(const o of p){const l=o*c;if(a[l+2]<=t)continue;a[l+2]=t;const u=a[l+5];i+=a[l]*u,s+=a[l+1]*u,a[l+4]=f,r&&(e||(e=this._map(a,n,!0),g=this.clusterProps.length,this.clusterProps.push(e)),r(e,this._map(a,l)))}a[n+4]=f,l.push(i/h,s/h,1/0,f,-1,h),r&&l.push(g)}else{for(let e=0;e<c;e++)l.push(a[n+e]);if(h>1)for(const e of p){const n=e*c;if(!(a[n+2]<=t)){a[n+2]=t;for(let e=0;e<c;e++)l.push(a[n+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+5]>1){const o=this.clusterProps[e[t+6]];return n?Object.assign({},o):o}const o=this.points[e[t+3]].properties,r=this.options.map(o);return n&&r===o?Object.assign({},r):r}}function Ie(e,t,n){return{type:"Feature",id:e[t+3],properties:De(e,t,n),geometry:{type:"Point",coordinates:[(o=e[t],360*(o-.5)),We(e[t+1])]}};var o}function De(e,t,n){const o=e[t+5],r=o>=1e4?`${Math.round(o/1e3)}k`:o>=1e3?Math.round(o/100)/10+"k":o,i=e[t+6],s=-1===i?{}:Object.assign({},n[i]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:o,point_count_abbreviated:r})}function He(e){return e/360+.5}function Ue(e){const t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function We(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function je(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}class Be{static isAdvancedMarkerAvailable(e){return google.maps.marker&&!0===e.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return!!this.isAdvancedMarker(e)||e.getVisible()}}class Ke{constructor({markers:e,position:t}){this.markers=e,t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(0===this.markers.length&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(Be.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter((e=>Be.getVisible(e))).length}push(e){this.markers.push(e)}delete(){this.marker&&(Be.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const Ne=(e,t,n,o)=>{const r=ze(e.getBounds(),t,o);return n.filter((e=>r.contains(Be.getPosition(e))))},ze=(e,t,n)=>{const{northEast:o,southWest:r}=Ve(e,t),i=Ge({northEast:o,southWest:r},n);return $e(i,t)},Je=(e,t,n)=>{const o=ze(e,t,n),r=o.getNorthEast(),i=o.getSouthWest();return[i.lng(),i.lat(),r.lng(),r.lat()]},Fe=(e,t)=>{const n=(t.lat-e.lat)*Math.PI/180,o=(t.lng-e.lng)*Math.PI/180,r=Math.sin(n/2),i=Math.sin(o/2),s=r*r+Math.cos(e.lat*Math.PI/180)*Math.cos(t.lat*Math.PI/180)*i*i;return 2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))*6371},Ve=(e,t)=>({northEast:t.fromLatLngToDivPixel(e.getNorthEast()),southWest:t.fromLatLngToDivPixel(e.getSouthWest())}),Ge=({northEast:e,southWest:t},n)=>(e.x+=n,e.y-=n,t.x-=n,t.y+=n,{northEast:e,southWest:t}),$e=({northEast:e,southWest:t},n)=>{const o=n.fromDivPixelToLatLng(t),r=n.fromDivPixelToLatLng(e);return new google.maps.LatLngBounds(o,r)};class Ze{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return Ye(e)}}class qe extends Ze{constructor(e){var{viewportPadding:t=60}=e;super(je(e,["viewportPadding"])),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:n}){return t.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:Ne(t,n,e,this.viewportPadding),map:t,mapCanvasProjection:n})}}}const Ye=e=>e.map((e=>new Ke({position:Be.getPosition(e),markers:[e]})));class Xe extends Ze{constructor(e){var{maxZoom:t,radius:n=60}=e,o=je(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new Te(Object.assign({maxZoom:this.maxZoom,radius:n},o))}calculate(e){let t=!1;const n={zoom:e.map.getZoom()};if(!Se(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const n=this.markers.map((e=>{const t=Be.getPosition(e);return{type:"Feature",geometry:{type:"Point",coordinates:[t.lng(),t.lat()]},properties:{marker:e}}}));this.superCluster.load(n)}return t||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(t=!Se(this.state,n)),this.state=n,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map((e=>this.transformCluster(e)))}transformCluster({geometry:{coordinates:[e,t]},properties:n}){if(n.cluster)return new Ke({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map((e=>e.properties.marker)),position:{lat:t,lng:e}});const o=n.marker;return new Ke({markers:[o],position:Be.getPosition(o)})}}class Qe{constructor(e,t){this.markers={sum:e.length};const n=t.map((e=>e.count)),o=n.reduce(((e,t)=>e+t),0);this.clusters={count:t.length,markers:{mean:o/t.length,sum:o,min:Math.min(...n),max:Math.max(...n)}}}}class et{render({count:e,position:t},n,o){const r=`<svg fill="${e>Math.max(10,n.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<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>\n</svg>`,i=`Cluster of ${e} markers`,s=Number(google.maps.Marker.MAX_ZINDEX)+e;if(Be.isAdvancedMarkerAvailable(o)){const e=(new DOMParser).parseFromString(r,"image/svg+xml").documentElement;e.setAttribute("transform","translate(0 25)");const n={map:o,position:t,zIndex:s,title:i,content:e};return new google.maps.marker.AdvancedMarkerElement(n)}const a={position:t,zIndex:s,title:i,icon:{url:`data:image/svg+xml;base64,${btoa(r)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}}class tt{constructor(){!function(e,t){for(let n in t.prototype)e.prototype[n]=t.prototype[n]}(tt,google.maps.OverlayView)}}var nt;!function(e){e.CLUSTERING_BEGIN="clusteringbegin",e.CLUSTERING_END="clusteringend",e.CLUSTER_CLICK="click"}(nt||(nt={}));const ot=(e,t,n)=>{n.fitBounds(t.bounds)};class rt extends tt{constructor({map:e,markers:t=[],algorithmOptions:n={},algorithm:o=new Xe(n),renderer:r=new et,onClusterClick:i=ot}){super(),this.markers=[...t],this.clusters=[],this.algorithm=o,this.renderer=r,this.onClusterClick=i,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach((e=>{this.addMarker(e,!0)})),t||this.render()}removeMarker(e,t){const n=this.markers.indexOf(e);return-1!==n&&(Be.setMap(e,null),this.markers.splice(n,1),t||this.render(),!0)}removeMarkers(e,t){let n=!1;return e.forEach((e=>{n=this.removeMarker(e,!0)||n})),n&&!t&&this.render(),n}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,nt.CLUSTERING_BEGIN,this);const{clusters:t,changed:n}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(n||null==n){const e=new Set;for(const n of t)1==n.markers.length&&e.add(n.markers[0]);const n=[];for(const t of this.clusters)null!=t.marker&&(1==t.markers.length?e.has(t.marker)||Be.setMap(t.marker,null):n.push(t.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame((()=>n.forEach((e=>Be.setMap(e,null)))))}google.maps.event.trigger(this,nt.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=>Be.setMap(e,null))),this.clusters.forEach((e=>e.delete())),this.clusters=[]}renderClusters(){const e=new Qe(this.markers,this.clusters),t=this.getMap();this.clusters.forEach((n=>{1===n.markers.length?n.marker=n.markers[0]:(n.marker=this.renderer.render(n,e,t),n.markers.forEach((e=>Be.setMap(e,null))),this.onClusterClick&&n.marker.addListener("click",(e=>{google.maps.event.trigger(this,nt.CLUSTER_CLICK,n),this.onClusterClick(e,n,t)}))),Be.setMap(n.marker,t)}))}}var it=Object.freeze({__proto__:null,AbstractAlgorithm:Ze,AbstractViewportAlgorithm:qe,Cluster:Ke,ClusterStats:Qe,DefaultRenderer:et,GridAlgorithm:class extends qe{constructor(e){var{maxDistance:t=4e4,gridSize:n=40}=e;super(je(e,["maxDistance","gridSize"])),this.clusters=[],this.state={zoom:-1},this.maxDistance=t,this.gridSize=n}calculate({markers:e,map:t,mapCanvasProjection:n}){const o={zoom:t.getZoom()};let r=!1;return this.state.zoom>=this.maxZoom&&o.zoom>=this.maxZoom||(r=!Se(this.state,o)),this.state=o,t.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:r}:{clusters:this.cluster({markers:Ne(t,n,e,this.viewportPadding),map:t,mapCanvasProjection:n})}}cluster({markers:e,map:t,mapCanvasProjection:n}){return this.clusters=[],e.forEach((e=>{this.addToClosestCluster(e,t,n)})),this.clusters}addToClosestCluster(e,t,n){let o=this.maxDistance,r=null;for(let t=0;t<this.clusters.length;t++){const n=this.clusters[t],i=Fe(n.bounds.getCenter().toJSON(),Be.getPosition(e).toJSON());i<o&&(o=i,r=n)}if(r&&ze(r.bounds,n,this.gridSize).contains(Be.getPosition(e)))r.push(e);else{const t=new Ke({markers:[e]});this.clusters.push(t)}}},MarkerClusterer:rt,get MarkerClustererEvents(){return nt},MarkerUtils:Be,NoopAlgorithm:class extends Ze{constructor(e){super(je(e,[]))}calculate({markers:e,map:t,mapCanvasProjection:n}){return{clusters:this.cluster({markers:e,map:t,mapCanvasProjection:n}),changed:!1}}cluster(e){return this.noop(e)}},SuperClusterAlgorithm:Xe,SuperClusterViewportAlgorithm:class extends qe{constructor(e){var{maxZoom:t,radius:n=60,viewportPadding:o=60}=e,r=je(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:o}),this.superCluster=new Te(Object.assign({maxZoom:this.maxZoom,radius:n},r)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t={zoom:Math.round(e.map.getZoom()),view:Je(e.map.getBounds(),e.mapCanvasProjection,this.viewportPadding)};let n=!Se(this.state,t);if(!Se(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const t=this.markers.map((e=>{const t=Be.getPosition(e);return{type:"Feature",geometry:{type:"Point",coordinates:[t.lng(),t.lat()]},properties:{marker:e}}}));this.superCluster.load(t)}return n&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:n}}cluster({map:e,mapCanvasProjection:t}){const n={zoom:Math.round(e.getZoom()),view:Je(e.getBounds(),t,this.viewportPadding)};return this.superCluster.getClusters(n.view,n.zoom).map((e=>this.transformCluster(e)))}transformCluster({geometry:{coordinates:[e,t]},properties:n}){if(n.cluster)return new Ke({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map((e=>e.properties.marker)),position:{lat:t,lng:e}});const o=n.marker;return new Ke({markers:[o],position:Be.getPosition(o)})}},defaultOnClusterClickHandler:ot,distanceBetweenPoints:Fe,extendBoundsToPaddedViewport:ze,extendPixelBounds:Ge,filterMarkersToPaddedViewport:Ne,getPaddedViewport:Je,noop:Ye,pixelBoundsToLatLngBounds:$e}),st=(0,r.memo)((function(e){var t=e.children,n=function(e){var t=f(),n=(0,r.useState)(null),o=n[0],i=n[1];return(0,r.useEffect)((function(){if(t&&null===o){var n=new rt(l(l({},e),{map:t}));i(n)}}),[t]),o}(e.options);return null!==n?t(n):null})),at={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},lt={options:function(e,t){e.setOptions(t)},position:function(e,t){e.setPosition(t)},zIndex:function(e,t){e.setZIndex(t)}},ct=(0,r.memo)((function(e){var t=e.children,n=e.anchor,o=e.options,s=e.position,a=e.zIndex,c=e.onCloseClick,u=e.onDomReady,p=e.onContentChanged,d=e.onPositionChanged,f=e.onZindexChanged,m=e.onLoad,v=e.onUnmount,y=(0,r.useContext)(g),w=(0,r.useState)(null),b=w[0],E=w[1],S=(0,r.useState)(null),C=S[0],L=S[1],P=(0,r.useState)(null),k=P[0],x=P[1],M=(0,r.useState)(null),_=M[0],A=M[1],O=(0,r.useState)(null),R=O[0],T=O[1],I=(0,r.useState)(null),D=I[0],H=I[1],U=(0,r.useRef)(null);return(0,r.useEffect)((function(){null!==b&&(b.close(),n?b.open(y,n):b.getPosition()&&b.open(y))}),[y,b,n]),(0,r.useEffect)((function(){o&&null!==b&&b.setOptions(o)}),[b,o]),(0,r.useEffect)((function(){s&&null!==b&&b.setPosition(s)}),[s]),(0,r.useEffect)((function(){"number"==typeof a&&null!==b&&b.setZIndex(a)}),[a]),(0,r.useEffect)((function(){b&&c&&(null!==C&&google.maps.event.removeListener(C),L(google.maps.event.addListener(b,"closeclick",c)))}),[c]),(0,r.useEffect)((function(){b&&u&&(null!==k&&google.maps.event.removeListener(k),x(google.maps.event.addListener(b,"domready",u)))}),[u]),(0,r.useEffect)((function(){b&&p&&(null!==_&&google.maps.event.removeListener(_),A(google.maps.event.addListener(b,"content_changed",p)))}),[p]),(0,r.useEffect)((function(){b&&d&&(null!==R&&google.maps.event.removeListener(R),T(google.maps.event.addListener(b,"position_changed",d)))}),[d]),(0,r.useEffect)((function(){b&&f&&(null!==D&&google.maps.event.removeListener(D),H(google.maps.event.addListener(b,"zindex_changed",f)))}),[f]),(0,r.useEffect)((function(){var e=new google.maps.InfoWindow(l({},o||{}));return E(e),U.current=document.createElement("div"),c&&L(google.maps.event.addListener(e,"closeclick",c)),u&&x(google.maps.event.addListener(e,"domready",u)),p&&A(google.maps.event.addListener(e,"content_changed",p)),d&&T(google.maps.event.addListener(e,"position_changed",d)),f&&H(google.maps.event.addListener(e,"zindex_changed",f)),e.setContent(U.current),s&&e.setPosition(s),a&&e.setZIndex(a),n?e.open(y,n):e.getPosition()?e.open(y):h(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>."),m&&m(e),function(){C&&google.maps.event.removeListener(C),_&&google.maps.event.removeListener(_),k&&google.maps.event.removeListener(k),R&&google.maps.event.removeListener(R),D&&google.maps.event.removeListener(D),v&&v(e),e.close()}}),[]),U.current?(0,i.createPortal)(r.Children.only(t),U.current):null})),ut=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=null,t.state={infoWindow:null},t.open=function(e,n){n?e.open(t.context,n):e.getPosition()?e.open(t.context):h(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>.")},t.setInfoWindowCallback=function(){null!==t.state.infoWindow&&null!==t.containerElement&&(t.state.infoWindow.setContent(t.containerElement),t.open(t.state.infoWindow,t.props.anchor),t.props.onLoad&&t.props.onLoad(t.state.infoWindow))},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.InfoWindow(l({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=y({updaterMap:lt,eventMap:at,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{infoWindow:e}}),this.setInfoWindowCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.infoWindow&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:lt,eventMap:at,prevProps:e,nextProps:this.props,instance:this.state.infoWindow}))},t.prototype.componentWillUnmount=function(){null!==this.state.infoWindow&&(v(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())},t.prototype.render=function(){return this.containerElement?(0,i.createPortal)(r.Children.only(this.props.children),this.containerElement):null},t.contextType=g,t}(r.PureComponent),pt={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},dt={draggable:function(e,t){e.setDraggable(t)},editable:function(e,t){e.setEditable(t)},map:function(e,t){e.setMap(t)},options:function(e,t){e.setOptions(t)},path:function(e,t){e.setPath(t)},visible:function(e,t){e.setVisible(t)}},ht={},gt=(0,r.memo)((function(e){var t=e.options,n=e.draggable,o=e.editable,i=e.visible,s=e.path,a=e.onDblClick,c=e.onDragEnd,u=e.onDragStart,p=e.onMouseDown,d=e.onMouseMove,h=e.onMouseOut,f=e.onMouseOver,m=e.onMouseUp,v=e.onRightClick,y=e.onClick,w=e.onDrag,b=e.onLoad,E=e.onUnmount,S=(0,r.useContext)(g),C=(0,r.useState)(null),L=C[0],P=C[1],k=(0,r.useState)(null),x=k[0],M=k[1],_=(0,r.useState)(null),A=_[0],O=_[1],R=(0,r.useState)(null),T=R[0],I=R[1],D=(0,r.useState)(null),H=D[0],U=D[1],W=(0,r.useState)(null),j=W[0],B=W[1],K=(0,r.useState)(null),N=K[0],z=K[1],J=(0,r.useState)(null),F=J[0],V=J[1],G=(0,r.useState)(null),$=G[0],Z=G[1],q=(0,r.useState)(null),Y=q[0],X=q[1],Q=(0,r.useState)(null),ee=Q[0],te=Q[1],ne=(0,r.useState)(null),oe=ne[0],re=ne[1];return(0,r.useEffect)((function(){null!==L&&L.setMap(S)}),[S]),(0,r.useEffect)((function(){void 0!==t&&null!==L&&L.setOptions(t)}),[L,t]),(0,r.useEffect)((function(){void 0!==n&&null!==L&&L.setDraggable(n)}),[L,n]),(0,r.useEffect)((function(){void 0!==o&&null!==L&&L.setEditable(o)}),[L,o]),(0,r.useEffect)((function(){void 0!==i&&null!==L&&L.setVisible(i)}),[L,i]),(0,r.useEffect)((function(){void 0!==s&&null!==L&&L.setPath(s)}),[L,s]),(0,r.useEffect)((function(){L&&a&&(null!==x&&google.maps.event.removeListener(x),M(google.maps.event.addListener(L,"dblclick",a)))}),[a]),(0,r.useEffect)((function(){L&&c&&(null!==A&&google.maps.event.removeListener(A),O(google.maps.event.addListener(L,"dragend",c)))}),[c]),(0,r.useEffect)((function(){L&&u&&(null!==T&&google.maps.event.removeListener(T),I(google.maps.event.addListener(L,"dragstart",u)))}),[u]),(0,r.useEffect)((function(){L&&p&&(null!==H&&google.maps.event.removeListener(H),U(google.maps.event.addListener(L,"mousedown",p)))}),[p]),(0,r.useEffect)((function(){L&&d&&(null!==j&&google.maps.event.removeListener(j),B(google.maps.event.addListener(L,"mousemove",d)))}),[d]),(0,r.useEffect)((function(){L&&h&&(null!==N&&google.maps.event.removeListener(N),z(google.maps.event.addListener(L,"mouseout",h)))}),[h]),(0,r.useEffect)((function(){L&&f&&(null!==F&&google.maps.event.removeListener(F),V(google.maps.event.addListener(L,"mouseover",f)))}),[f]),(0,r.useEffect)((function(){L&&m&&(null!==$&&google.maps.event.removeListener($),Z(google.maps.event.addListener(L,"mouseup",m)))}),[m]),(0,r.useEffect)((function(){L&&v&&(null!==Y&&google.maps.event.removeListener(Y),X(google.maps.event.addListener(L,"rightclick",v)))}),[v]),(0,r.useEffect)((function(){L&&y&&(null!==ee&&google.maps.event.removeListener(ee),te(google.maps.event.addListener(L,"click",y)))}),[y]),(0,r.useEffect)((function(){L&&w&&(null!==oe&&google.maps.event.removeListener(oe),re(google.maps.event.addListener(L,"drag",w)))}),[w]),(0,r.useEffect)((function(){var e=new google.maps.Polyline(l(l({},t||ht),{map:S}));return s&&e.setPath(s),void 0!==i&&e.setVisible(i),void 0!==o&&e.setEditable(o),void 0!==n&&e.setDraggable(n),a&&M(google.maps.event.addListener(e,"dblclick",a)),c&&O(google.maps.event.addListener(e,"dragend",c)),u&&I(google.maps.event.addListener(e,"dragstart",u)),p&&U(google.maps.event.addListener(e,"mousedown",p)),d&&B(google.maps.event.addListener(e,"mousemove",d)),h&&z(google.maps.event.addListener(e,"mouseout",h)),f&&V(google.maps.event.addListener(e,"mouseover",f)),m&&Z(google.maps.event.addListener(e,"mouseup",m)),v&&X(google.maps.event.addListener(e,"rightclick",v)),y&&te(google.maps.event.addListener(e,"click",y)),w&&re(google.maps.event.addListener(e,"drag",w)),P(e),b&&b(e),function(){null!==x&&google.maps.event.removeListener(x),null!==A&&google.maps.event.removeListener(A),null!==T&&google.maps.event.removeListener(T),null!==H&&google.maps.event.removeListener(H),null!==j&&google.maps.event.removeListener(j),null!==N&&google.maps.event.removeListener(N),null!==F&&google.maps.event.removeListener(F),null!==$&&google.maps.event.removeListener($),null!==Y&&google.maps.event.removeListener(Y),null!==ee&&google.maps.event.removeListener(ee),E&&E(e),e.setMap(null)}}),[]),null})),ft=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={polyline:null},t.setPolylineCallback=function(){null!==t.state.polyline&&t.props.onLoad&&t.props.onLoad(t.state.polyline)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.Polyline(l(l({},this.props.options||{}),{map:this.context}));this.registeredEvents=y({updaterMap:dt,eventMap:pt,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{polyline:e}}),this.setPolylineCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.polyline&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:dt,eventMap:pt,prevProps:e,nextProps:this.props,instance:this.state.polyline}))},t.prototype.componentWillUnmount=function(){null!==this.state.polyline&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),v(this.registeredEvents),this.state.polyline.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),mt={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},vt={draggable:function(e,t){e.setDraggable(t)},editable:function(e,t){e.setEditable(t)},map:function(e,t){e.setMap(t)},options:function(e,t){e.setOptions(t)},path:function(e,t){e.setPath(t)},paths:function(e,t){e.setPaths(t)},visible:function(e,t){e.setVisible(t)}},yt=(0,r.memo)((function(e){var t=e.options,n=e.draggable,o=e.editable,i=e.visible,s=e.path,a=e.paths,c=e.onDblClick,u=e.onDragEnd,p=e.onDragStart,d=e.onMouseDown,h=e.onMouseMove,f=e.onMouseOut,m=e.onMouseOver,v=e.onMouseUp,y=e.onRightClick,w=e.onClick,b=e.onDrag,E=e.onLoad,S=e.onUnmount,C=e.onEdit,L=(0,r.useContext)(g),P=(0,r.useState)(null),k=P[0],x=P[1],M=(0,r.useState)(null),_=M[0],A=M[1],O=(0,r.useState)(null),R=O[0],T=O[1],I=(0,r.useState)(null),D=I[0],H=I[1],U=(0,r.useState)(null),W=U[0],j=U[1],B=(0,r.useState)(null),K=B[0],N=B[1],z=(0,r.useState)(null),J=z[0],F=z[1],V=(0,r.useState)(null),G=V[0],$=V[1],Z=(0,r.useState)(null),q=Z[0],Y=Z[1],X=(0,r.useState)(null),Q=X[0],ee=X[1],te=(0,r.useState)(null),ne=te[0],oe=te[1],re=(0,r.useState)(null),ie=re[0],se=re[1];return(0,r.useEffect)((function(){null!==k&&k.setMap(L)}),[L]),(0,r.useEffect)((function(){void 0!==t&&null!==k&&k.setOptions(t)}),[k,t]),(0,r.useEffect)((function(){void 0!==n&&null!==k&&k.setDraggable(n)}),[k,n]),(0,r.useEffect)((function(){void 0!==o&&null!==k&&k.setEditable(o)}),[k,o]),(0,r.useEffect)((function(){void 0!==i&&null!==k&&k.setVisible(i)}),[k,i]),(0,r.useEffect)((function(){void 0!==s&&null!==k&&k.setPath(s)}),[k,s]),(0,r.useEffect)((function(){void 0!==a&&null!==k&&k.setPaths(a)}),[k,a]),(0,r.useEffect)((function(){k&&c&&(null!==_&&google.maps.event.removeListener(_),A(google.maps.event.addListener(k,"dblclick",c)))}),[c]),(0,r.useEffect)((function(){k&&(google.maps.event.addListener(k.getPath(),"insert_at",(function(){null==C||C(k)})),google.maps.event.addListener(k.getPath(),"set_at",(function(){null==C||C(k)})))}),[k,C]),(0,r.useEffect)((function(){k&&u&&(null!==R&&google.maps.event.removeListener(R),T(google.maps.event.addListener(k,"dragend",u)))}),[u]),(0,r.useEffect)((function(){k&&p&&(null!==D&&google.maps.event.removeListener(D),H(google.maps.event.addListener(k,"dragstart",p)))}),[p]),(0,r.useEffect)((function(){k&&d&&(null!==W&&google.maps.event.removeListener(W),j(google.maps.event.addListener(k,"mousedown",d)))}),[d]),(0,r.useEffect)((function(){k&&h&&(null!==K&&google.maps.event.removeListener(K),N(google.maps.event.addListener(k,"mousemove",h)))}),[h]),(0,r.useEffect)((function(){k&&f&&(null!==J&&google.maps.event.removeListener(J),F(google.maps.event.addListener(k,"mouseout",f)))}),[f]),(0,r.useEffect)((function(){k&&m&&(null!==G&&google.maps.event.removeListener(G),$(google.maps.event.addListener(k,"mouseover",m)))}),[m]),(0,r.useEffect)((function(){k&&v&&(null!==q&&google.maps.event.removeListener(q),Y(google.maps.event.addListener(k,"mouseup",v)))}),[v]),(0,r.useEffect)((function(){k&&y&&(null!==Q&&google.maps.event.removeListener(Q),ee(google.maps.event.addListener(k,"rightclick",y)))}),[y]),(0,r.useEffect)((function(){k&&w&&(null!==ne&&google.maps.event.removeListener(ne),oe(google.maps.event.addListener(k,"click",w)))}),[w]),(0,r.useEffect)((function(){k&&b&&(null!==ie&&google.maps.event.removeListener(ie),se(google.maps.event.addListener(k,"drag",b)))}),[b]),(0,r.useEffect)((function(){var e=new google.maps.Polygon(l(l({},t||{}),{map:L}));return s&&e.setPath(s),a&&e.setPaths(a),void 0!==i&&e.setVisible(i),void 0!==o&&e.setEditable(o),void 0!==n&&e.setDraggable(n),c&&A(google.maps.event.addListener(e,"dblclick",c)),u&&T(google.maps.event.addListener(e,"dragend",u)),p&&H(google.maps.event.addListener(e,"dragstart",p)),d&&j(google.maps.event.addListener(e,"mousedown",d)),h&&N(google.maps.event.addListener(e,"mousemove",h)),f&&F(google.maps.event.addListener(e,"mouseout",f)),m&&$(google.maps.event.addListener(e,"mouseover",m)),v&&Y(google.maps.event.addListener(e,"mouseup",v)),y&&ee(google.maps.event.addListener(e,"rightclick",y)),w&&oe(google.maps.event.addListener(e,"click",w)),b&&se(google.maps.event.addListener(e,"drag",b)),x(e),E&&E(e),function(){null!==_&&google.maps.event.removeListener(_),null!==R&&google.maps.event.removeListener(R),null!==D&&google.maps.event.removeListener(D),null!==W&&google.maps.event.removeListener(W),null!==K&&google.maps.event.removeListener(K),null!==J&&google.maps.event.removeListener(J),null!==G&&google.maps.event.removeListener(G),null!==q&&google.maps.event.removeListener(q),null!==Q&&google.maps.event.removeListener(Q),null!==ne&&google.maps.event.removeListener(ne),S&&S(e),e.setMap(null)}}),[]),null})),wt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={polygon:null},t.setPolygonCallback=function(){null!==t.state.polygon&&t.props.onLoad&&t.props.onLoad(t.state.polygon)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.Polygon(l(l({},this.props.options||{}),{map:this.context}));this.registeredEvents=y({updaterMap:vt,eventMap:mt,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{polygon:e}}),this.setPolygonCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.polygon&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:vt,eventMap:mt,prevProps:e,nextProps:this.props,instance:this.state.polygon}))},t.prototype.componentWillUnmount=function(){null!==this.state.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),v(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),bt={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"},Et={bounds:function(e,t){e.setBounds(t)},draggable:function(e,t){e.setDraggable(t)},editable:function(e,t){e.setEditable(t)},map:function(e,t){e.setMap(t)},options:function(e,t){e.setOptions(t)},visible:function(e,t){e.setVisible(t)}},St=(0,r.memo)((function(e){var t=e.options,n=e.bounds,o=e.draggable,i=e.editable,s=e.visible,a=e.onDblClick,c=e.onDragEnd,u=e.onDragStart,p=e.onMouseDown,d=e.onMouseMove,h=e.onMouseOut,f=e.onMouseOver,m=e.onMouseUp,v=e.onRightClick,y=e.onClick,w=e.onDrag,b=e.onBoundsChanged,E=e.onLoad,S=e.onUnmount,C=(0,r.useContext)(g),L=(0,r.useState)(null),P=L[0],k=L[1],x=(0,r.useState)(null),M=x[0],_=x[1],A=(0,r.useState)(null),O=A[0],R=A[1],T=(0,r.useState)(null),I=T[0],D=T[1],H=(0,r.useState)(null),U=H[0],W=H[1],j=(0,r.useState)(null),B=j[0],K=j[1],N=(0,r.useState)(null),z=N[0],J=N[1],F=(0,r.useState)(null),V=F[0],G=F[1],$=(0,r.useState)(null),Z=$[0],q=$[1],Y=(0,r.useState)(null),X=Y[0],Q=Y[1],ee=(0,r.useState)(null),te=ee[0],ne=ee[1],oe=(0,r.useState)(null),re=oe[0],ie=oe[1],se=(0,r.useState)(null),ae=se[0],le=se[1];return(0,r.useEffect)((function(){null!==P&&P.setMap(C)}),[C]),(0,r.useEffect)((function(){void 0!==t&&null!==P&&P.setOptions(t)}),[P,t]),(0,r.useEffect)((function(){void 0!==o&&null!==P&&P.setDraggable(o)}),[P,o]),(0,r.useEffect)((function(){void 0!==i&&null!==P&&P.setEditable(i)}),[P,i]),(0,r.useEffect)((function(){void 0!==s&&null!==P&&P.setVisible(s)}),[P,s]),(0,r.useEffect)((function(){void 0!==n&&null!==P&&P.setBounds(n)}),[P,n]),(0,r.useEffect)((function(){P&&a&&(null!==M&&google.maps.event.removeListener(M),_(google.maps.event.addListener(P,"dblclick",a)))}),[a]),(0,r.useEffect)((function(){P&&c&&(null!==O&&google.maps.event.removeListener(O),R(google.maps.event.addListener(P,"dragend",c)))}),[c]),(0,r.useEffect)((function(){P&&u&&(null!==I&&google.maps.event.removeListener(I),D(google.maps.event.addListener(P,"dragstart",u)))}),[u]),(0,r.useEffect)((function(){P&&p&&(null!==U&&google.maps.event.removeListener(U),W(google.maps.event.addListener(P,"mousedown",p)))}),[p]),(0,r.useEffect)((function(){P&&d&&(null!==B&&google.maps.event.removeListener(B),K(google.maps.event.addListener(P,"mousemove",d)))}),[d]),(0,r.useEffect)((function(){P&&h&&(null!==z&&google.maps.event.removeListener(z),J(google.maps.event.addListener(P,"mouseout",h)))}),[h]),(0,r.useEffect)((function(){P&&f&&(null!==V&&google.maps.event.removeListener(V),G(google.maps.event.addListener(P,"mouseover",f)))}),[f]),(0,r.useEffect)((function(){P&&m&&(null!==Z&&google.maps.event.removeListener(Z),q(google.maps.event.addListener(P,"mouseup",m)))}),[m]),(0,r.useEffect)((function(){P&&v&&(null!==X&&google.maps.event.removeListener(X),Q(google.maps.event.addListener(P,"rightclick",v)))}),[v]),(0,r.useEffect)((function(){P&&y&&(null!==te&&google.maps.event.removeListener(te),ne(google.maps.event.addListener(P,"click",y)))}),[y]),(0,r.useEffect)((function(){P&&w&&(null!==re&&google.maps.event.removeListener(re),ie(google.maps.event.addListener(P,"drag",w)))}),[w]),(0,r.useEffect)((function(){P&&b&&(null!==ae&&google.maps.event.removeListener(ae),le(google.maps.event.addListener(P,"bounds_changed",b)))}),[b]),(0,r.useEffect)((function(){var e=new google.maps.Rectangle(l(l({},t||{}),{map:C}));return void 0!==s&&e.setVisible(s),void 0!==i&&e.setEditable(i),void 0!==o&&e.setDraggable(o),void 0!==n&&e.setBounds(n),a&&_(google.maps.event.addListener(e,"dblclick",a)),c&&R(google.maps.event.addListener(e,"dragend",c)),u&&D(google.maps.event.addListener(e,"dragstart",u)),p&&W(google.maps.event.addListener(e,"mousedown",p)),d&&K(google.maps.event.addListener(e,"mousemove",d)),h&&J(google.maps.event.addListener(e,"mouseout",h)),f&&G(google.maps.event.addListener(e,"mouseover",f)),m&&q(google.maps.event.addListener(e,"mouseup",m)),v&&Q(google.maps.event.addListener(e,"rightclick",v)),y&&ne(google.maps.event.addListener(e,"click",y)),w&&ie(google.maps.event.addListener(e,"drag",w)),b&&le(google.maps.event.addListener(e,"bounds_changed",b)),k(e),E&&E(e),function(){null!==M&&google.maps.event.removeListener(M),null!==O&&google.maps.event.removeListener(O),null!==I&&google.maps.event.removeListener(I),null!==U&&google.maps.event.removeListener(U),null!==B&&google.maps.event.removeListener(B),null!==z&&google.maps.event.removeListener(z),null!==V&&google.maps.event.removeListener(V),null!==Z&&google.maps.event.removeListener(Z),null!==X&&google.maps.event.removeListener(X),null!==te&&google.maps.event.removeListener(te),null!==re&&google.maps.event.removeListener(re),null!==ae&&google.maps.event.removeListener(ae),S&&S(e),e.setMap(null)}}),[]),null})),Ct=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={rectangle:null},t.setRectangleCallback=function(){null!==t.state.rectangle&&t.props.onLoad&&t.props.onLoad(t.state.rectangle)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.Rectangle(l(l({},this.props.options||{}),{map:this.context}));this.registeredEvents=y({updaterMap:Et,eventMap:bt,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{rectangle:e}}),this.setRectangleCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.rectangle&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:Et,eventMap:bt,prevProps:e,nextProps:this.props,instance:this.state.rectangle}))},t.prototype.componentWillUnmount=function(){null!==this.state.rectangle&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),v(this.registeredEvents),this.state.rectangle.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),Lt={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"},Pt={center:function(e,t){e.setCenter(t)},draggable:function(e,t){e.setDraggable(t)},editable:function(e,t){e.setEditable(t)},map:function(e,t){e.setMap(t)},options:function(e,t){e.setOptions(t)},radius:function(e,t){e.setRadius(t)},visible:function(e,t){e.setVisible(t)}},kt={},xt=(0,r.memo)((function(e){var t=e.options,n=e.center,o=e.radius,i=e.draggable,s=e.editable,a=e.visible,c=e.onDblClick,u=e.onDragEnd,p=e.onDragStart,d=e.onMouseDown,h=e.onMouseMove,f=e.onMouseOut,m=e.onMouseOver,v=e.onMouseUp,y=e.onRightClick,w=e.onClick,b=e.onDrag,E=e.onCenterChanged,S=e.onRadiusChanged,C=e.onLoad,L=e.onUnmount,P=(0,r.useContext)(g),k=(0,r.useState)(null),x=k[0],M=k[1],_=(0,r.useState)(null),A=_[0],O=_[1],R=(0,r.useState)(null),T=R[0],I=R[1],D=(0,r.useState)(null),H=D[0],U=D[1],W=(0,r.useState)(null),j=W[0],B=W[1],K=(0,r.useState)(null),N=K[0],z=K[1],J=(0,r.useState)(null),F=J[0],V=J[1],G=(0,r.useState)(null),$=G[0],Z=G[1],q=(0,r.useState)(null),Y=q[0],X=q[1],Q=(0,r.useState)(null),ee=Q[0],te=Q[1],ne=(0,r.useState)(null),oe=ne[0],re=ne[1],ie=(0,r.useState)(null),se=ie[0],ae=ie[1],le=(0,r.useState)(null),ce=le[0],ue=le[1],pe=(0,r.useState)(null),de=pe[0],he=pe[1];return(0,r.useEffect)((function(){null!==x&&x.setMap(P)}),[P]),(0,r.useEffect)((function(){void 0!==t&&null!==x&&x.setOptions(t)}),[x,t]),(0,r.useEffect)((function(){void 0!==i&&null!==x&&x.setDraggable(i)}),[x,i]),(0,r.useEffect)((function(){void 0!==s&&null!==x&&x.setEditable(s)}),[x,s]),(0,r.useEffect)((function(){void 0!==a&&null!==x&&x.setVisible(a)}),[x,a]),(0,r.useEffect)((function(){"number"==typeof o&&null!==x&&x.setRadius(o)}),[x,o]),(0,r.useEffect)((function(){void 0!==n&&null!==x&&x.setCenter(n)}),[x,n]),(0,r.useEffect)((function(){x&&c&&(null!==A&&google.maps.event.removeListener(A),O(google.maps.event.addListener(x,"dblclick",c)))}),[c]),(0,r.useEffect)((function(){x&&u&&(null!==T&&google.maps.event.removeListener(T),I(google.maps.event.addListener(x,"dragend",u)))}),[u]),(0,r.useEffect)((function(){x&&p&&(null!==H&&google.maps.event.removeListener(H),U(google.maps.event.addListener(x,"dragstart",p)))}),[p]),(0,r.useEffect)((function(){x&&d&&(null!==j&&google.maps.event.removeListener(j),B(google.maps.event.addListener(x,"mousedown",d)))}),[d]),(0,r.useEffect)((function(){x&&h&&(null!==N&&google.maps.event.removeListener(N),z(google.maps.event.addListener(x,"mousemove",h)))}),[h]),(0,r.useEffect)((function(){x&&f&&(null!==F&&google.maps.event.removeListener(F),V(google.maps.event.addListener(x,"mouseout",f)))}),[f]),(0,r.useEffect)((function(){x&&m&&(null!==$&&google.maps.event.removeListener($),Z(google.maps.event.addListener(x,"mouseover",m)))}),[m]),(0,r.useEffect)((function(){x&&v&&(null!==Y&&google.maps.event.removeListener(Y),X(google.maps.event.addListener(x,"mouseup",v)))}),[v]),(0,r.useEffect)((function(){x&&y&&(null!==ee&&google.maps.event.removeListener(ee),te(google.maps.event.addListener(x,"rightclick",y)))}),[y]),(0,r.useEffect)((function(){x&&w&&(null!==oe&&google.maps.event.removeListener(oe),re(google.maps.event.addListener(x,"click",w)))}),[w]),(0,r.useEffect)((function(){x&&b&&(null!==se&&google.maps.event.removeListener(se),ae(google.maps.event.addListener(x,"drag",b)))}),[b]),(0,r.useEffect)((function(){x&&E&&(null!==ce&&google.maps.event.removeListener(ce),ue(google.maps.event.addListener(x,"center_changed",E)))}),[w]),(0,r.useEffect)((function(){x&&S&&(null!==de&&google.maps.event.removeListener(de),he(google.maps.event.addListener(x,"radius_changed",S)))}),[S]),(0,r.useEffect)((function(){var e=new google.maps.Circle(l(l({},t||kt),{map:P}));return"number"==typeof o&&e.setRadius(o),void 0!==n&&e.setCenter(n),"number"==typeof o&&e.setRadius(o),void 0!==a&&e.setVisible(a),void 0!==s&&e.setEditable(s),void 0!==i&&e.setDraggable(i),c&&O(google.maps.event.addListener(e,"dblclick",c)),u&&I(google.maps.event.addListener(e,"dragend",u)),p&&U(google.maps.event.addListener(e,"dragstart",p)),d&&B(google.maps.event.addListener(e,"mousedown",d)),h&&z(google.maps.event.addListener(e,"mousemove",h)),f&&V(google.maps.event.addListener(e,"mouseout",f)),m&&Z(google.maps.event.addListener(e,"mouseover",m)),v&&X(google.maps.event.addListener(e,"mouseup",v)),y&&te(google.maps.event.addListener(e,"rightclick",y)),w&&re(google.maps.event.addListener(e,"click",w)),b&&ae(google.maps.event.addListener(e,"drag",b)),E&&ue(google.maps.event.addListener(e,"center_changed",E)),S&&he(google.maps.event.addListener(e,"radius_changed",S)),M(e),C&&C(e),function(){null!==A&&google.maps.event.removeListener(A),null!==T&&google.maps.event.removeListener(T),null!==H&&google.maps.event.removeListener(H),null!==j&&google.maps.event.removeListener(j),null!==N&&google.maps.event.removeListener(N),null!==F&&google.maps.event.removeListener(F),null!==$&&google.maps.event.removeListener($),null!==Y&&google.maps.event.removeListener(Y),null!==ee&&google.maps.event.removeListener(ee),null!==oe&&google.maps.event.removeListener(oe),null!==ce&&google.maps.event.removeListener(ce),null!==de&&google.maps.event.removeListener(de),L&&L(e),e.setMap(null)}}),[]),null})),Mt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={circle:null},t.setCircleCallback=function(){null!==t.state.circle&&t.props.onLoad&&t.props.onLoad(t.state.circle)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.Circle(l(l({},this.props.options||{}),{map:this.context}));this.registeredEvents=y({updaterMap:Pt,eventMap:Lt,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{circle:e}}),this.setCircleCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.circle&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:Pt,eventMap:Lt,prevProps:e,nextProps:this.props,instance:this.state.circle}))},t.prototype.componentWillUnmount=function(){var e;null!==this.state.circle&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),v(this.registeredEvents),null===(e=this.state.circle)||void 0===e||e.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),_t={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},At={add:function(e,t){e.add(t)},addgeojson:function(e,t,n){e.addGeoJson(t,n)},contains:function(e,t){e.contains(t)},foreach:function(e,t){e.forEach(t)},loadgeojson:function(e,t,n,o){e.loadGeoJson(t,n,o)},overridestyle:function(e,t,n){e.overrideStyle(t,n)},remove:function(e,t){e.remove(t)},revertstyle:function(e,t){e.revertStyle(t)},controlposition:function(e,t){e.setControlPosition(t)},controls:function(e,t){e.setControls(t)},drawingmode:function(e,t){e.setDrawingMode(t)},map:function(e,t){e.setMap(t)},style:function(e,t){e.setStyle(t)},togeojson:function(e,t){e.toGeoJson(t)}},Ot=(0,r.memo)((function(e){var t=e.options,n=e.onClick,o=e.onDblClick,i=e.onMouseDown,s=e.onMouseMove,a=e.onMouseOut,c=e.onMouseOver,u=e.onMouseUp,p=e.onRightClick,d=e.onAddFeature,h=e.onRemoveFeature,f=e.onRemoveProperty,m=e.onSetGeometry,v=e.onSetProperty,y=e.onLoad,w=e.onUnmount,b=(0,r.useContext)(g),E=(0,r.useState)(null),S=E[0],C=E[1],L=(0,r.useState)(null),P=L[0],k=L[1],x=(0,r.useState)(null),M=x[0],_=x[1],A=(0,r.useState)(null),O=A[0],R=A[1],T=(0,r.useState)(null),I=T[0],D=T[1],H=(0,r.useState)(null),U=H[0],W=H[1],j=(0,r.useState)(null),B=j[0],K=j[1],N=(0,r.useState)(null),z=N[0],J=N[1],F=(0,r.useState)(null),V=F[0],G=F[1],$=(0,r.useState)(null),Z=$[0],q=$[1],Y=(0,r.useState)(null),X=Y[0],Q=Y[1],ee=(0,r.useState)(null),te=ee[0],ne=ee[1],oe=(0,r.useState)(null),re=oe[0],ie=oe[1],se=(0,r.useState)(null),ae=se[0],le=se[1];return(0,r.useEffect)((function(){null!==S&&S.setMap(b)}),[b]),(0,r.useEffect)((function(){S&&o&&(null!==P&&google.maps.event.removeListener(P),k(google.maps.event.addListener(S,"dblclick",o)))}),[o]),(0,r.useEffect)((function(){S&&i&&(null!==M&&google.maps.event.removeListener(M),_(google.maps.event.addListener(S,"mousedown",i)))}),[i]),(0,r.useEffect)((function(){S&&s&&(null!==O&&google.maps.event.removeListener(O),R(google.maps.event.addListener(S,"mousemove",s)))}),[s]),(0,r.useEffect)((function(){S&&a&&(null!==I&&google.maps.event.removeListener(I),D(google.maps.event.addListener(S,"mouseout",a)))}),[a]),(0,r.useEffect)((function(){S&&c&&(null!==U&&google.maps.event.removeListener(U),W(google.maps.event.addListener(S,"mouseover",c)))}),[c]),(0,r.useEffect)((function(){S&&u&&(null!==B&&google.maps.event.removeListener(B),K(google.maps.event.addListener(S,"mouseup",u)))}),[u]),(0,r.useEffect)((function(){S&&p&&(null!==z&&google.maps.event.removeListener(z),J(google.maps.event.addListener(S,"rightclick",p)))}),[p]),(0,r.useEffect)((function(){S&&n&&(null!==V&&google.maps.event.removeListener(V),G(google.maps.event.addListener(S,"click",n)))}),[n]),(0,r.useEffect)((function(){S&&d&&(null!==Z&&google.maps.event.removeListener(Z),q(google.maps.event.addListener(S,"addfeature",d)))}),[d]),(0,r.useEffect)((function(){S&&h&&(null!==X&&google.maps.event.removeListener(X),Q(google.maps.event.addListener(S,"removefeature",h)))}),[h]),(0,r.useEffect)((function(){S&&f&&(null!==te&&google.maps.event.removeListener(te),ne(google.maps.event.addListener(S,"removeproperty",f)))}),[f]),(0,r.useEffect)((function(){S&&m&&(null!==re&&google.maps.event.removeListener(re),ie(google.maps.event.addListener(S,"setgeometry",m)))}),[m]),(0,r.useEffect)((function(){S&&v&&(null!==ae&&google.maps.event.removeListener(ae),le(google.maps.event.addListener(S,"setproperty",v)))}),[v]),(0,r.useEffect)((function(){if(null!==b){var e=new google.maps.Data(l(l({},t||{}),{map:b}));o&&k(google.maps.event.addListener(e,"dblclick",o)),i&&_(google.maps.event.addListener(e,"mousedown",i)),s&&R(google.maps.event.addListener(e,"mousemove",s)),a&&D(google.maps.event.addListener(e,"mouseout",a)),c&&W(google.maps.event.addListener(e,"mouseover",c)),u&&K(google.maps.event.addListener(e,"mouseup",u)),p&&J(google.maps.event.addListener(e,"rightclick",p)),n&&G(google.maps.event.addListener(e,"click",n)),d&&q(google.maps.event.addListener(e,"addfeature",d)),h&&Q(google.maps.event.addListener(e,"removefeature",h)),f&&ne(google.maps.event.addListener(e,"removeproperty",f)),m&&ie(google.maps.event.addListener(e,"setgeometry",m)),v&&le(google.maps.event.addListener(e,"setproperty",v)),C(e),y&&y(e)}return function(){S&&(null!==P&&google.maps.event.removeListener(P),null!==M&&google.maps.event.removeListener(M),null!==O&&google.maps.event.removeListener(O),null!==I&&google.maps.event.removeListener(I),null!==U&&google.maps.event.removeListener(U),null!==B&&google.maps.event.removeListener(B),null!==z&&google.maps.event.removeListener(z),null!==V&&google.maps.event.removeListener(V),null!==Z&&google.maps.event.removeListener(Z),null!==X&&google.maps.event.removeListener(X),null!==te&&google.maps.event.removeListener(te),null!==re&&google.maps.event.removeListener(re),null!==ae&&google.maps.event.removeListener(ae),w&&w(S),S.setMap(null))}}),[]),null})),Rt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={data:null},t.setDataCallback=function(){null!==t.state.data&&t.props.onLoad&&t.props.onLoad(t.state.data)},t}return a(t,e),t.prototype.componentDidMount=function(){if(null!==this.context){var e=new google.maps.Data(l(l({},this.props.options||{}),{map:this.context}));this.registeredEvents=y({updaterMap:At,eventMap:_t,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{data:e}}),this.setDataCallback)}},t.prototype.componentDidUpdate=function(e){null!==this.state.data&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:At,eventMap:_t,prevProps:e,nextProps:this.props,instance:this.state.data}))},t.prototype.componentWillUnmount=function(){null!==this.state.data&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),v(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),Tt={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},It={options:function(e,t){e.setOptions(t)},url:function(e,t){e.setUrl(t)},zIndex:function(e,t){e.setZIndex(t)}},Dt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={kmlLayer:null},t.setKmlLayerCallback=function(){null!==t.state.kmlLayer&&t.props.onLoad&&t.props.onLoad(t.state.kmlLayer)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.KmlLayer(l(l({},this.props.options),{map:this.context}));this.registeredEvents=y({updaterMap:It,eventMap:Tt,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{kmlLayer:e}}),this.setKmlLayerCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.kmlLayer&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:It,eventMap:Tt,prevProps:e,nextProps:this.props,instance:this.state.kmlLayer}))},t.prototype.componentWillUnmount=function(){null!==this.state.kmlLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),v(this.registeredEvents),this.state.kmlLayer.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent);function Ht(e,t){return"function"==typeof t?t(e.offsetWidth,e.offsetHeight):{x:0,y:0}}function Ut(e,t){return new t(e.lat,e.lng)}function Wt(e,t){return new t(new google.maps.LatLng(e.ne.lat,e.ne.lng),new google.maps.LatLng(e.sw.lat,e.sw.lng))}function jt(e,t,n,o){return void 0!==n?function(e,t,n){var o=e&&e.fromLatLngToDivPixel(n.getNorthEast()),r=e&&e.fromLatLngToDivPixel(n.getSouthWest());return o&&r?{left:"".concat(r.x+t.x,"px"),top:"".concat(o.y+t.y,"px"),width:"".concat(o.x-r.x-t.x,"px"),height:"".concat(r.y-o.y-t.y,"px")}:{left:"-9999px",top:"-9999px"}}(e,t,(r=n)instanceof(i=google.maps.LatLngBounds)?r:Wt(r,i)):function(e,t,n){var o=e&&e.fromLatLngToDivPixel(n);if(o){var r=o.x,i=o.y;return{left:"".concat(r+t.x,"px"),top:"".concat(i+t.y,"px")}}return{left:"-9999px",top:"-9999px"}}(e,t,function(e,t,n){return e instanceof t?e:n(e,t)}(o,google.maps.LatLng,Ut));var r,i}function Bt(e){return e?(e instanceof google.maps.LatLng?e:new google.maps.LatLng(e.lat,e.lng))+"":""}function Kt(e){return e?(e instanceof google.maps.LatLngBounds?e:new google.maps.LatLngBounds(new google.maps.LatLng(e.south,e.east),new google.maps.LatLng(e.north,e.west)))+"":""}var Nt="floatPane",zt="mapPane",Jt="markerLayer",Ft="overlayLayer",Vt="overlayMouseTarget",Gt=(0,r.memo)((function(e){var t=e.position,n=e.bounds,o=e.mapPaneName,s=e.zIndex,c=e.onLoad,u=e.onUnmount,p=e.getPixelPositionOffset,d=e.children,h=(0,r.useContext)(g),f=(0,r.useMemo)((function(){var e=document.createElement("div");return e.style.position="absolute",e}),[]),m=(0,r.useMemo)((function(){return function(e,t,n,o,r){var i=function(e){function t(t,n,o,r){var i=e.call(this)||this;return i.container=t,i.pane=n,i.position=o,i.bounds=r,i}return a(t,e),t.prototype.onAdd=function(){var e,t=null===(e=this.getPanes())||void 0===e?void 0:e[this.pane];null==t||t.appendChild(this.container)},t.prototype.draw=function(){for(var e=jt(this.getProjection(),l({},this.container?Ht(this.container,r):{x:0,y:0}),this.bounds,this.position),t=0,n=Object.entries(e);t<n.length;t++){var o=n[t],i=o[0],s=o[1];this.container.style[i]=s}},t.prototype.onRemove=function(){null!==this.container.parentNode&&this.container.parentNode.removeChild(this.container)},t}(google.maps.OverlayView);return new i(e,t,n,o)}(f,o,t,n,p)}),[f,o,t,n]);return(0,r.useEffect)((function(){return null==c||c(m),null==m||m.setMap(h),function(){null==u||u(m),null==m||m.setMap(null)}}),[h,m]),(0,r.useEffect)((function(){f.style.zIndex="".concat(s)}),[s,f]),i.createPortal(d,f)})),$t=function(e){function t(t){var n=e.call(this,t)||this;n.state={paneEl:null,containerStyle:{position:"absolute"}},n.updatePane=function(){var e=n.props.mapPaneName,t=n.overlayView.getPanes();h(!!e,"OverlayView requires props.mapPaneName but got %s",e),t?n.setState({paneEl:t[e]}):n.setState({paneEl:null})},n.onAdd=function(){var e,t;n.updatePane(),null===(t=(e=n.props).onLoad)||void 0===t||t.call(e,n.overlayView)},n.onPositionElement=function(){var e,t,o=jt(n.overlayView.getProjection(),l({x:0,y:0},n.containerRef.current?Ht(n.containerRef.current,n.props.getPixelPositionOffset):{}),n.props.bounds,n.props.position),r=n.state.containerStyle;t={left:r.left,top:r.top,width:r.width,height:r.height},((e=o).left!==t.left||e.top!==t.top||e.width!==t.height||e.height!==t.height)&&n.setState({containerStyle:{top:o.top||0,left:o.left||0,width:o.width||0,height:o.height||0,position:"absolute"}})},n.draw=function(){n.onPositionElement()},n.onRemove=function(){var e,t;n.setState((function(){return{paneEl:null}})),null===(t=(e=n.props).onUnmount)||void 0===t||t.call(e,n.overlayView)},n.containerRef=(0,r.createRef)();var o=new google.maps.OverlayView;return o.onAdd=n.onAdd,o.draw=n.draw,o.onRemove=n.onRemove,n.overlayView=o,n}return a(t,e),t.prototype.componentDidMount=function(){this.overlayView.setMap(this.context)},t.prototype.componentDidUpdate=function(e){var t=Bt(e.position),n=Bt(this.props.position),o=Kt(e.bounds),r=Kt(this.props.bounds);t===n&&o===r||this.overlayView.draw(),e.mapPaneName!==this.props.mapPaneName&&this.updatePane()},t.prototype.componentWillUnmount=function(){this.overlayView.setMap(null)},t.prototype.render=function(){var e=this.state.paneEl;return e?i.createPortal((0,o.jsx)("div",{ref:this.containerRef,style:this.state.containerStyle,children:r.Children.only(this.props.children)}),e):null},t.FLOAT_PANE="floatPane",t.MAP_PANE="mapPane",t.MARKER_LAYER="markerLayer",t.OVERLAY_LAYER="overlayLayer",t.OVERLAY_MOUSE_TARGET="overlayMouseTarget",t.contextType=g,t}(r.PureComponent);function Zt(){}var qt={onDblClick:"dblclick",onClick:"click"},Yt={opacity:function(e,t){e.setOpacity(t)}},Xt=(0,r.memo)((function(e){var t=e.url,n=e.bounds,o=e.options,i=e.visible,s=(0,r.useContext)(g),a=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east)),c=(0,r.useMemo)((function(){return new google.maps.GroundOverlay(t,a,l({},o))}),[]);return(0,r.useEffect)((function(){null!==c&&c.setMap(s)}),[s]),(0,r.useEffect)((function(){void 0!==t&&null!==c&&(c.set("url",t),c.setMap(s))}),[c,t]),(0,r.useEffect)((function(){void 0!==i&&null!==c&&c.setOpacity(i?1:0)}),[c,i]),(0,r.useEffect)((function(){var e=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east));void 0!==n&&null!==c&&(c.set("bounds",e),c.setMap(s))}),[c,n]),null})),Qt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={groundOverlay:null},t.setGroundOverlayCallback=function(){null!==t.state.groundOverlay&&t.props.onLoad&&t.props.onLoad(t.state.groundOverlay)},t}return a(t,e),t.prototype.componentDidMount=function(){h(!!this.props.url||!!this.props.bounds,"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655");var e=new google.maps.GroundOverlay(this.props.url,this.props.bounds,l(l({},this.props.options),{map:this.context}));this.registeredEvents=y({updaterMap:Yt,eventMap:qt,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{groundOverlay:e}}),this.setGroundOverlayCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.groundOverlay&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:Yt,eventMap:qt,prevProps:e,nextProps:this.props,instance:this.state.groundOverlay}))},t.prototype.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},t.prototype.render=function(){return null},t.defaultProps={onLoad:Zt},t.contextType=g,t}(r.PureComponent),en={},tn={data:function(e,t){e.setData(t)},map:function(e,t){e.setMap(t)},options:function(e,t){e.setOptions(t)}},nn=(0,r.memo)((function(e){var t=e.data,n=e.onLoad,o=e.onUnmount,i=e.options,s=(0,r.useContext)(g),a=(0,r.useState)(null),c=a[0],u=a[1];return(0,r.useEffect)((function(){google.maps.visualization||h(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)}),[]),(0,r.useEffect)((function(){h(!!t,"data property is required in HeatmapLayer %s",t)}),[t]),(0,r.useEffect)((function(){null!==c&&c.setMap(s)}),[s]),(0,r.useEffect)((function(){i&&null!==c&&c.setOptions(i)}),[c,i]),(0,r.useEffect)((function(){var e=new google.maps.visualization.HeatmapLayer(l(l({},i||{}),{data:t,map:s}));return u(e),n&&n(e),function(){null!==c&&(o&&o(c),c.setMap(null))}}),[]),null})),on=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={heatmapLayer:null},t.setHeatmapLayerCallback=function(){null!==t.state.heatmapLayer&&t.props.onLoad&&t.props.onLoad(t.state.heatmapLayer)},t}return a(t,e),t.prototype.componentDidMount=function(){h(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to <LoadScript />? %s',google.maps.visualization),h(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var e=new google.maps.visualization.HeatmapLayer(l(l({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=y({updaterMap:tn,eventMap:en,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{heatmapLayer:e}}),this.setHeatmapLayerCallback)},t.prototype.componentDidUpdate=function(e){v(this.registeredEvents),this.registeredEvents=y({updaterMap:tn,eventMap:en,prevProps:e,nextProps:this.props,instance:this.state.heatmapLayer})},t.prototype.componentWillUnmount=function(){null!==this.state.heatmapLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),v(this.registeredEvents),this.state.heatmapLayer.setMap(null))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),rn={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},sn={register:function(e,t,n){e.registerPanoProvider(t,n)},links:function(e,t){e.setLinks(t)},motionTracking:function(e,t){e.setMotionTracking(t)},options:function(e,t){e.setOptions(t)},pano:function(e,t){e.setPano(t)},position:function(e,t){e.setPosition(t)},pov:function(e,t){e.setPov(t)},visible:function(e,t){e.setVisible(t)},zoom:function(e,t){e.setZoom(t)}},an=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={streetViewPanorama:null},t.setStreetViewPanoramaCallback=function(){null!==t.state.streetViewPanorama&&t.props.onLoad&&t.props.onLoad(t.state.streetViewPanorama)},t}return a(t,e),t.prototype.componentDidMount=function(){var e,t,n=null!==(t=null===(e=this.context)||void 0===e?void 0:e.getStreetView())&&void 0!==t?t:null;this.registeredEvents=y({updaterMap:sn,eventMap:rn,prevProps:{},nextProps:this.props,instance:n}),this.setState((function(){return{streetViewPanorama:n}}),this.setStreetViewPanoramaCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.streetViewPanorama&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:sn,eventMap:rn,prevProps:e,nextProps:this.props,instance:this.state.streetViewPanorama}))},t.prototype.componentWillUnmount=function(){null!==this.state.streetViewPanorama&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),v(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),ln=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={streetViewService:null},t.setStreetViewServiceCallback=function(){null!==t.state.streetViewService&&t.props.onLoad&&t.props.onLoad(t.state.streetViewService)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.StreetViewService;this.setState((function(){return{streetViewService:e}}),this.setStreetViewServiceCallback)},t.prototype.componentWillUnmount=function(){null!==this.state.streetViewService&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},t.prototype.render=function(){return null},t.contextType=g,t}(r.PureComponent),cn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={directionsService:null},t.setDirectionsServiceCallback=function(){null!==t.state.directionsService&&t.props.onLoad&&t.props.onLoad(t.state.directionsService)},t}return a(t,e),t.prototype.componentDidMount=function(){h(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var e=new google.maps.DirectionsService;this.setState((function(){return{directionsService:e}}),this.setDirectionsServiceCallback)},t.prototype.componentDidUpdate=function(){null!==this.state.directionsService&&this.state.directionsService.route(this.props.options,this.props.callback)},t.prototype.componentWillUnmount=function(){null!==this.state.directionsService&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},t.prototype.render=function(){return null},t}(r.PureComponent),un={onDirectionsChanged:"directions_changed"},pn={directions:function(e,t){e.setDirections(t)},map:function(e,t){e.setMap(t)},options:function(e,t){e.setOptions(t)},panel:function(e,t){e.setPanel(t)},routeIndex:function(e,t){e.setRouteIndex(t)}},dn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.state={directionsRenderer:null},t.setDirectionsRendererCallback=function(){null!==t.state.directionsRenderer&&(t.state.directionsRenderer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.directionsRenderer))},t}return a(t,e),t.prototype.componentDidMount=function(){var e=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=y({updaterMap:pn,eventMap:un,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{directionsRenderer:e}}),this.setDirectionsRendererCallback)},t.prototype.componentDidUpdate=function(e){null!==this.state.directionsRenderer&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:pn,eventMap:un,prevProps:e,nextProps:this.props,instance:this.state.directionsRenderer}))},t.prototype.componentWillUnmount=function(){null!==this.state.directionsRenderer&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),v(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},t.prototype.render=function(){return(0,o.jsx)(o.Fragment,{})},t.contextType=g,t}(r.PureComponent),hn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={distanceMatrixService:null},t.setDistanceMatrixServiceCallback=function(){null!==t.state.distanceMatrixService&&t.props.onLoad&&t.props.onLoad(t.state.distanceMatrixService)},t}return a(t,e),t.prototype.componentDidMount=function(){h(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var e=new google.maps.DistanceMatrixService;this.setState((function(){return{distanceMatrixService:e}}),this.setDistanceMatrixServiceCallback)},t.prototype.componentDidUpdate=function(){null!==this.state.distanceMatrixService&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},t.prototype.componentWillUnmount=function(){null!==this.state.distanceMatrixService&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},t.prototype.render=function(){return null},t}(r.PureComponent),gn={onPlacesChanged:"places_changed"},fn={bounds:function(e,t){e.setBounds(t)}},mn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=(0,r.createRef)(),t.state={searchBox:null},t.setSearchBoxCallback=function(){null!==t.state.searchBox&&t.props.onLoad&&t.props.onLoad(t.state.searchBox)},t}return a(t,e),t.prototype.componentDidMount=function(){if(h(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places),null!==this.containerElement&&null!==this.containerElement.current){var e=this.containerElement.current.querySelector("input");if(null!==e){var t=new google.maps.places.SearchBox(e,this.props.options);this.registeredEvents=y({updaterMap:fn,eventMap:gn,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{searchBox:t}}),this.setSearchBoxCallback)}}},t.prototype.componentDidUpdate=function(e){null!==this.state.searchBox&&(v(this.registeredEvents),this.registeredEvents=y({updaterMap:fn,eventMap:gn,prevProps:e,nextProps:this.props,instance:this.state.searchBox}))},t.prototype.componentWillUnmount=function(){null!==this.state.searchBox&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),v(this.registeredEvents))},t.prototype.render=function(){return(0,o.jsx)("div",{ref:this.containerElement,children:r.Children.only(this.props.children)})},t.contextType=g,t}(r.PureComponent),vn={onPlaceChanged:"place_changed"},yn={bounds:function(e,t){e.setBounds(t)},restrictions:function(e,t){e.setComponentRestrictions(t)},fields:function(e,t){e.setFields(t)},options:function(e,t){e.setOptions(t)},types:function(e,t){e.setTypes(t)}},wn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=(0,r.createRef)(),t.state={autocomplete:null},t.setAutocompleteCallback=function(){null!==t.state.autocomplete&&t.props.onLoad&&t.props.onLoad(t.state.autocomplete)},t}return a(t,e),t.prototype.componentDidMount=function(){var e;h(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places);var t=null===(e=this.containerElement.current)||void 0===e?void 0:e.querySelector("input");if(t){var n=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=y({updaterMap:yn,eventMap:vn,prevProps:{},nextProps:this.props,instance:n}),this.setState((function(){return{autocomplete:n}}),this.setAutocompleteCallback)}},t.prototype.componentDidUpdate=function(e){v(this.registeredEvents),this.registeredEvents=y({updaterMap:yn,eventMap:vn,prevProps:e,nextProps:this.props,instance:this.state.autocomplete})},t.prototype.componentWillUnmount=function(){null!==this.state.autocomplete&&v(this.registeredEvents)},t.prototype.render=function(){return(0,o.jsx)("div",{ref:this.containerElement,className:this.props.className,children:r.Children.only(this.props.children)})},t.defaultProps={className:""},t.contextType=g,t}(r.PureComponent)},602:function(e){e.exports=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}return function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(o[a]=n.read(s,a),e===a)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},8641:function(e,t,n){e=n.nmd(e),function(n,o){"use strict";var r={};n.PubSub?(r=n.PubSub,console.warn("PubSub already loaded, using existing version")):(n.PubSub=r,function(e){var t={},n=-1;function o(e,t,n){try{e(t,n)}catch(e){setTimeout(function(e){return function(){throw e}}(e),0)}}function r(e,t,n){e(t,n)}function i(e,n,i,s){var a,l=t[n],c=s?r:o;if(Object.prototype.hasOwnProperty.call(t,n))for(a in l)Object.prototype.hasOwnProperty.call(l,a)&&c(l[a],e,i)}function s(e){var n=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,n)&&function(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}(t[n]))}function a(e,t,n,o){var r=function(e,t,n){return function(){var o=String(e),r=o.lastIndexOf(".");for(i(e,e,t,n);-1!==r;)r=(o=o.substr(0,r)).lastIndexOf("."),i(e,o,t,n);i(e,"*",t,n)}}(e="symbol"==typeof e?e.toString():e,t,o);return!!function(e){for(var t=String(e),n=s(t)||s("*"),o=t.lastIndexOf(".");!n&&-1!==o;)o=(t=t.substr(0,o)).lastIndexOf("."),n=s(t);return n}(e)&&(!0===n?r():setTimeout(r,0),!0)}e.publish=function(t,n){return a(t,n,!1,e.immediateExceptions)},e.publishSync=function(t,n){return a(t,n,!0,e.immediateExceptions)},e.subscribe=function(e,o){if("function"!=typeof o)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(t,e)||(t[e]={});var r="uid_"+String(++n);return t[e][r]=o,r},e.subscribeAll=function(t){return e.subscribe("*",t)},e.subscribeOnce=function(t,n){var o=e.subscribe(t,(function(){e.unsubscribe(o),n.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var n;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e)&&delete t[n]},e.countSubscriptions=function(e){var n,o,r=0;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e)){for(o in t[n])r++;break}return r},e.getSubscriptions=function(e){var n,o=[];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e)&&o.push(n);return o},e.unsubscribe=function(n){var o,r,i,s="string"==typeof n&&(Object.prototype.hasOwnProperty.call(t,n)||function(e){var n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e))return!0;return!1}(n)),a=!s&&"string"==typeof n,l="function"==typeof n,c=!1;if(!s){for(o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(r=t[o],a&&r[n]){delete r[n],c=n;break}if(l)for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&r[i]===n&&(delete r[i],c=!0)}return c}e.clearSubscriptions(n)}}(r)),void 0!==e&&e.exports&&(t=e.exports=r),t.PubSub=r,e.exports=t=r}("object"==typeof window&&window||this||n.g)},4537:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l,useDeepCompareEffectNoCheck:()=>c,useDeepCompareMemoize:()=>a});var o=n(8156),r=Object.prototype.hasOwnProperty;function i(e,t,n){for(n of e.keys())if(s(n,t))return n}function s(e,t){var n,o,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((o=e.length)===t.length)for(;o--&&s(e[o],t[o]););return-1===o}if(n===Set){if(e.size!==t.size)return!1;for(o of e){if((a=o)&&"object"==typeof a&&!(a=i(t,a)))return!1;if(!t.has(a))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(o of e){if((a=o[0])&&"object"==typeof a&&!(a=i(t,a)))return!1;if(!s(o[1],t.get(a)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return-1===o}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return-1===o}if(!n||"object"==typeof e){for(n in o=0,e){if(r.call(e,n)&&++o&&!r.call(t,n))return!1;if(!(n in t)||!s(e[n],t[n]))return!1}return Object.keys(t).length===o}}return e!=e&&t!=t}function a(e){var t=o.useRef(e),n=o.useRef(0);return s(e,t.current)||(t.current=e,n.current+=1),o.useMemo((function(){return t.current}),[n.current])}function l(e,t){return o.useEffect(e,a(t))}function c(e,t){return o.useEffect(e,a(t))}},7409:e=>{e.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"validateHTMLColorName",(function(){return s})),n.d(t,"validateHTMLColorSpecialName",(function(){return a})),n.d(t,"validateHTMLColorHex",(function(){return l})),n.d(t,"validateHTMLColorRgb",(function(){return f})),n.d(t,"validateHTMLColorHsl",(function(){return m})),n.d(t,"validateHTMLColorHwb",(function(){return v})),n.d(t,"validateHTMLColorLab",(function(){return y})),n.d(t,"validateHTMLColorLch",(function(){return w})),n.d(t,"validateHTMLColor",(function(){return b}));const o=e=>e&&"string"==typeof e,r=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenrod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","Goldenrod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenrodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquamarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenrod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],i=["currentColor","inherit","transparent"],s=e=>{let t=!1;return o(e)&&r.map((n=>(e.toLowerCase()===n.toLowerCase()&&(t=!0),null))),t},a=e=>{let t=!1;return o(e)&&i.map((n=>(e.toLowerCase()===n.toLowerCase()&&(t=!0),null))),t},l=e=>{if(o(e)){const t=/^#([\da-f]{3}){1,2}$|^#([\da-f]{4}){1,2}$/i;return e&&t.test(e)}return!1},c="(([\\d]{0,5})((\\.([\\d]{1,5}))?))",u=`(${c}%)`,p="(([0-9]|[1-9][0-9]|100)%)",d=`(${p}|(0?((\\.([\\d]{1,5}))?))|1)`,h=`([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?)([\\s]{1,5})(((${p}))|(0?((\\.([\\d]{1,5}))?))|1))?([\\s]{0,5})\\)`,g="(-?(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360)(deg)?)",f=e=>{if(o(e)){const t="([\\s]{0,5})([\\d]{1,5})%?([\\s]{0,5}),?",n="((([\\s]{0,5}),?([\\s]{0,5}))|(([\\s]{1,5})))",o=new RegExp(`^(rgb)a?\\(${t}${n}${t}${n}${t}${n}((\\/?([\\s]{0,5})(0?\\.?([\\d]{1,5})%?([\\s]{0,5}))?|1|0))?\\)$`);return e&&o.test(e)}return!1},m=e=>{if(o(e)){const t=new RegExp(`^(hsl)a?\\((([\\s]{0,5})(${g}|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)grad)|((([0-5])?\\.([\\d]{1,5})|6\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)|((0?((\\.([\\d]{1,5}))?)|1)turn))((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${p})((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${p})([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?|,?)([\\s]{0,5})(((${p}))|(0?((\\.([\\d]{1,5}))?))|1))?\\)$`);return e&&t.test(e)}return!1},v=e=>{if(o(e)){const t=new RegExp(`^(hwb\\(([\\s]{0,5})${g}([\\s]{1,5}))((0|${p})([\\s]{1,5}))((0|${p})${h}$`);return e&&t.test(e)}return!1},y=e=>{if(o(e)){const t="(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])((\\.([\\d]{1,5}))?)?|160))",n=new RegExp(`^(lab\\(([\\s]{0,5})${u}([\\s]{1,5})${t}([\\s]{1,5})${t}${h}$`);return e&&n.test(e)}return!1},w=e=>{if(o(e)){const t=new RegExp(`^lch\\((([\\s]{0,5})((([0-9]|[1-9][0-9])?((\\.([\\d]{1,5}))?)|100)(%)?)([\\s]{1,5})${""+c}([\\s]{1,5})((${g})|(0|${d})|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360))([\\s]{0,5})((\\/([\\s]{0,5})${d}))?)\\)$`);return e&&t.test(e)}return!1},b=e=>!!(e&&l(e)||f(e)||m(e)||v(e)||y(e)||w(e));t.default=e=>!!(e&&l(e)||s(e)||a(e)||f(e)||m(e)||v(e)||y(e)||w(e))}])},8792:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeImage=t.CacheStrategies=t.LruCache=t.LRUCache=t.LocalStorageDB=t.iOS=t.loadVersionBrowser=t.WSClient=t.sortByAttr=t.groupBy=t.arraysEqual=t.isInteger=t.isFunc=t.objectWithoutProperties=t.isObject=t.mergeDeep=t.Logger=t.handleOpenWindow=t.isClientSideRendering=t.getWindowHeight=t.getWindowWidth=t.getHighestSafeWindowContext=t.updateQueryStringParameter=t.getQueryStringParameter=t.urlB64ToUint8Array=t.appendURLSearchParams=t.getDomain=t.urlReplacer=t.isValidUrls=t.isValidUrl=t.slugify=t.random=t.fallbackCopyTextToClipboard=t.copyTextToClipboard=t.camelCase=t.stripHtml=t.isString=t.capitalize=void 0;const o=n(2970),r=n(3545);Object.defineProperty(t,"capitalize",{enumerable:!0,get:function(){return r.capitalize}}),Object.defineProperty(t,"isString",{enumerable:!0,get:function(){return r.isString}}),Object.defineProperty(t,"stripHtml",{enumerable:!0,get:function(){return r.stripHtml}}),Object.defineProperty(t,"camelCase",{enumerable:!0,get:function(){return r.camelCase}}),Object.defineProperty(t,"copyTextToClipboard",{enumerable:!0,get:function(){return r.copyTextToClipboard}}),Object.defineProperty(t,"fallbackCopyTextToClipboard",{enumerable:!0,get:function(){return r.fallbackCopyTextToClipboard}}),Object.defineProperty(t,"random",{enumerable:!0,get:function(){return r.random}}),Object.defineProperty(t,"slugify",{enumerable:!0,get:function(){return r.slugify}});const i=n(3424);Object.defineProperty(t,"isValidUrl",{enumerable:!0,get:function(){return i.isValidUrl}}),Object.defineProperty(t,"isValidUrls",{enumerable:!0,get:function(){return i.isValidUrls}}),Object.defineProperty(t,"urlReplacer",{enumerable:!0,get:function(){return i.urlReplacer}}),Object.defineProperty(t,"getDomain",{enumerable:!0,get:function(){return i.getDomain}}),Object.defineProperty(t,"appendURLSearchParams",{enumerable:!0,get:function(){return i.appendURLSearchParams}}),Object.defineProperty(t,"urlB64ToUint8Array",{enumerable:!0,get:function(){return i.urlB64ToUint8Array}}),Object.defineProperty(t,"getQueryStringParameter",{enumerable:!0,get:function(){return i.getQueryStringParameter}}),Object.defineProperty(t,"updateQueryStringParameter",{enumerable:!0,get:function(){return i.updateQueryStringParameter}});const s=n(6065);Object.defineProperty(t,"getHighestSafeWindowContext",{enumerable:!0,get:function(){return s.getHighestSafeWindowContext}}),Object.defineProperty(t,"getWindowWidth",{enumerable:!0,get:function(){return s.getWindowWidth}}),Object.defineProperty(t,"getWindowHeight",{enumerable:!0,get:function(){return s.getWindowHeight}}),Object.defineProperty(t,"isClientSideRendering",{enumerable:!0,get:function(){return s.isClientSideRendering}}),Object.defineProperty(t,"handleOpenWindow",{enumerable:!0,get:function(){return s.handleOpenWindow}});const a=n(7927);Object.defineProperty(t,"mergeDeep",{enumerable:!0,get:function(){return a.mergeDeep}}),Object.defineProperty(t,"isObject",{enumerable:!0,get:function(){return a.isObject}}),Object.defineProperty(t,"objectWithoutProperties",{enumerable:!0,get:function(){return a.objectWithoutProperties}}),Object.defineProperty(t,"isFunc",{enumerable:!0,get:function(){return a.isFunc}});const l=n(6465);Object.defineProperty(t,"isInteger",{enumerable:!0,get:function(){return l.isInteger}});const c=n(4337);Object.defineProperty(t,"arraysEqual",{enumerable:!0,get:function(){return c.arraysEqual}}),Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return c.groupBy}}),Object.defineProperty(t,"sortByAttr",{enumerable:!0,get:function(){return c.sortByAttr}});const u=n(2316);Object.defineProperty(t,"loadVersionBrowser",{enumerable:!0,get:function(){return u.loadVersionBrowser}}),Object.defineProperty(t,"iOS",{enumerable:!0,get:function(){return u.iOS}});const p=n(3520);Object.defineProperty(t,"LocalStorageDB",{enumerable:!0,get:function(){return p.LocalStorageDB}});const d=o.__importStar(n(1036));t.LRUCache=d.default,Object.defineProperty(t,"LruCache",{enumerable:!0,get:function(){return d.LruCache}}),Object.defineProperty(t,"CacheStrategies",{enumerable:!0,get:function(){return d.CacheStrategies}});const h=n(571);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return h.Logger}});const g=o.__importDefault(n(1174));t.WSClient=g.default;const f=n(9862);Object.defineProperty(t,"resizeImage",{enumerable:!0,get:function(){return f.resizeImage}})},4337:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortByAttr=t.groupBy=t.arraysEqual=void 0,t.arraysEqual=(e,t)=>{if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0},t.groupBy=(e,t)=>e.reduce((function(e,n){let o="function"==typeof t?t(n):n[t];return e.hasOwnProperty(o)||(e[o]=[]),e[o].push(n),e}),{}),t.sortByAttr=(e,t,n=!0)=>{if(!Array.isArray(e))return e;const o=n?(e,n)=>e[t]-n[t]:(e,n)=>n[t]-e[t];return e.sort(o)}},2316:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iOS=t.loadVersionBrowser=void 0,t.loadVersionBrowser=()=>{if("userAgentData"in navigator){const e=navigator.userAgentData;let t,n,o=null;for(let r=0;r<e.brands.length;r++){const i=e.brands[r].brand;if(n=e.brands[r].version,null!==i.match(/opera|chrome|edge|safari|firefox|msie|trident/i)){if(null===i.match(/chrome/i))return t=i.substr(i.indexOf(" ")+1),{name:t,version:n};o=n}}if(null!==o)return{name:"chrome",version:o}}let e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?(e=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"IE",version:e[1]||""}):"Chrome"===n[1]&&(e=t.match(/\bOPR\/(\d+)/),null!=e)?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})},t.iOS=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},1036:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CacheStrategies=t.LruCache=void 0;class n{constructor(e=1e4){this.values=new Map,this.maxEntries=e,this.ssr="undefined"==typeof window,this.ssr||(window.__viewSCCache=this.values)}get(e,t,n={noSsr:!0}){let o;return this.values.has(e)?(o=this.values.get(e),this.values.delete(e),this.values.set(e,o)):t&&(o=t,(!this.ssr||!n.noSsr)&&this.values.set(e,o)),o}set(e,t,n={noSsr:!0}){if(!this.ssr||!n.noSsr){if(this.values.size>=this.maxEntries){const e=this.values.keys().next().value;this.values.delete(e)}this.values.set(e,t)}}hasKey(e){return this.values.has(e)}delete(e){this.values.has(e)&&this.values.delete(e)}deleteKeys(e){e.forEach((e=>{this.values.has(e)&&this.values.delete(e)}))}deleteKeysWithPrefix(e){this.values.forEach(((t,n)=>{n.startsWith(e)&&this.values.delete(n)}))}clean(){this.values=new Map}evaluate(){console.log(this.values)}}var o;t.LruCache=n,(o=t.CacheStrategies||(t.CacheStrategies={})).CACHE_FIRST="Cache-first",o.NETWORK_ONLY="Network-only",o.STALE_WHILE_REVALIDATE="Stale-While-Revalidate";const r=new n;t.default=r},9862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeImage=void 0,t.resizeImage=e=>new Promise(((t,n)=>{const o=new FileReader;o.onload=e=>{let n=new Image;n.onload=function(e){let o=document.createElement("canvas"),r=1920,i=n.width,s=n.height;i>s?i>r&&(s*=r/i,i=r):s>r&&(i*=r/s,s=r),o.width=i,o.height=s,o.getContext("2d").drawImage(n,0,0,i,s),t((e=>{let t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);let n=e.split(",")[0].split(":")[1].split(";")[0],o=new Uint8Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);return new Blob([o],{type:n})})(o.toDataURL("image/jpeg")))},n.src=e.target.result},o.onerror=n,o.readAsDataURL(e)}))},3520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageDB=void 0,t.LocalStorageDB=class{static set(e,t){if(this.checkifSupport())try{window.localStorage.setItem(e,t)}catch(e){console.error(e)}else console.error("No support. Use a fallback such as browser cookies or store on the server.")}static get(e){try{let t=window.localStorage.getItem(e);return t&&"object"==typeof t?JSON.parse(t):t}catch(e){return null}}static getAll(){let e=[];for(let t=0;t<window.localStorage.length;t++){let n=localStorage.key(t);e.push(this.get(n))}return e}static remove(e){try{window.localStorage.removeItem(e),0==window.localStorage.length&&this.clearAll()}catch(e){console.error(e)}finally{this.get(e)&&(delete window.localStorage[e],0==window.localStorage.length&&this.clearAll())}}static clearAll(){try{window.localStorage.clear()}catch(e){console.error(e)}}static checkifSupport(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}}},571:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0,t.Logger=class{static info(e,t){console.info(`%c[${e}]`,"color:#008080",` ${t}`)}static warn(e,t){console.warn(`%c[${e}]`,"color:#008080",` ${t}`)}static error(e,t){console.error(`%c[${e}]`,"color:#008080",` ${t}`)}static log(e,t){console.log(`%c[${e}]`,"color:#008080",` ${t}`)}static debug(e,t){console.debug(`%c[${e}]`,"color:#008080",` ${t}`)}}},6465:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteger=void 0,t.isInteger=function(e){return!isNaN(e)&&parseInt(String(Number(e)))==e&&!isNaN(parseInt(String(e),10))}},7927:(e,t)=>{"use strict";function n(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.isFunc=t.objectWithoutProperties=t.mergeDeep=t.isObject=void 0,t.isObject=n,t.mergeDeep=function e(t,o){let r=Object.assign({},t);return n(t)&&n(o)&&Object.keys(o).forEach((i=>{n(o[i])?i in t?r[i]=e(t[i],o[i]):Object.assign(r,{[i]:o[i]}):Object.assign(r,{[i]:o[i]})})),r},t.objectWithoutProperties=function(e,t){let n=e?Object.assign({},e):null;return t.forEach((function(e){n&&e in n&&delete n[e]})),n},t.isFunc=function(e){return"function"==typeof e}},3545:(e,t)=>{"use strict";function n(e){let t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),document.body.removeChild(t),Promise.resolve()}catch(e){return document.body.removeChild(t),Promise.reject(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.slugify=t.copyTextToClipboard=t.fallbackCopyTextToClipboard=t.random=t.stripHtml=t.camelCase=t.capitalize=t.isString=void 0,t.isString=function(e){return"string"==typeof e||e instanceof String},t.capitalize=function(e){let t="",n=e.split(" ");for(let e=0;e<n.length;e++)t+=n[e].substring(0,1).toUpperCase()+n[e].substring(1,n[e].length);return t},t.camelCase=function(e){return e.toLowerCase().replace(/[-_]+/g," ").replace(/[^\w\s]/g,"").replace(/ (.)/g,(e=>e.toUpperCase())).replace(/ /g,"")},t.stripHtml=function(e){return e.replace(/<[^>]*>?/gm,"").trim()},t.random=function(){return(Math.random()+1).toString(36).substring(7)},t.fallbackCopyTextToClipboard=n,t.copyTextToClipboard=function(e){return navigator.clipboard?navigator.clipboard.writeText(e):n(e)},t.slugify=function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}},3424:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateQueryStringParameter=t.getQueryStringParameter=t.urlB64ToUint8Array=t.appendURLSearchParams=t.isValidUrls=t.isValidUrl=t.getDomain=t.urlReplacer=void 0,t.urlReplacer=e=>t=>function(e,t){const n=/\$\(([^)]+)?\)/g;let o=n.exec(e);for(;o;)e=e.replace(o[0],t[o[1]]),n.lastIndex=0,o=n.exec(e);return e}(e,t),t.getDomain=e=>{const t=e.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);return t&&t[1]?t[1]:""},t.isValidUrl=e=>/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?/.test(e),t.isValidUrls=(e,n)=>e.trim().split(n).every(t.isValidUrl),t.appendURLSearchParams=function(e,t){let n=e;if(t.length&&n){const e=Object.keys(t[0])[0];n+=(n.split("?")[1]?"&":"?")+`${e}=${t[0][e]}`,t.slice(1).map((e=>{const t=Object.keys(e)[0];n+=`&${t}=${e[t]}`}))}return n},t.urlB64ToUint8Array=e=>{const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),n=window.atob(t),o=new Uint8Array(n.length);for(let e=0;e<n.length;++e)o[e]=n.charCodeAt(e);return o},t.getQueryStringParameter=(e,t)=>e&&t?new URL(e).searchParams.get(t):null,t.updateQueryStringParameter=(e,t,n)=>{if(e&&t&&n){let o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),r=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+n+"$2"):e+r+t+"="+n}return e}},1174:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(e){this._attempts=1,this._heartbeatInterval=null,this._missedHeartbeats=0,this.isValidOptions(e)&&(this._cfg=Object.assign({},{heartbeatMsg:null,debug:!1,mustReconnect:!0},e),this.connect())}static getInstance(e){return this._instance=this._instance||new n(e),this._instance}connect(){try{if(this._ws&&(this.isConnecting()||this.isConnected()))return void(this._cfg.debug&&console.info("Websocket is connecting or already connected."));"function"==typeof this._cfg.connecting&&this._cfg.connecting(),this._cfg.debug&&console.info(`Connecting to ${this._cfg.uri} ...`),this._ws=new WebSocket(this._cfg.uri,this._cfg.protocols),this._ws.onopen=this.onOpen.bind(this),this._ws.onmessage=this.onMessage.bind(this),this._ws.onerror=this.onError.bind(this),this._ws.onclose=this.onClose.bind(this),this._timer=null}catch(e){console.error(e),this.tryToReconnect()}}isValidOptions(e){let t=!1;return e?(e.uri||(console.error("Invalid WSClient Uri options."),t=!0),e&&e.connecting&&"function"!=typeof e.connecting&&(console.error("Invalid WSClient connecting options."),t=!0),e&&e.connected&&"function"!=typeof e.connected&&(console.error("Invalid WSClient connected options."),t=!0),e&&e.receiveMessage&&"function"!=typeof e.receiveMessage&&(console.error("Invalid WSClient receiveMessage options."),t=!0),e&&e.disconnected&&"function"!=typeof e.disconnected&&(console.error("Invalid WSClient connecting options."),t=!0),e&&e.heartbeatMsg&&"string"!=typeof e.heartbeatMsg&&(console.error("Invalid WSClient heartbeatMsg options."),t=!0),e&&e.debug&&"boolean"!=typeof e.debug&&(console.error("Invalid WSClient debug options."),t=!0),!t):(console.error("Invalid WSClient options."),t)}tryToReconnect(){if(this._cfg.mustReconnect&&!this._timer){this._cfg.debug&&console.info("Reconnecting...");let e=this.generateInterval(this._attempts);this._timer=setTimeout(this.reconnect.bind(this),e)}}reconnect(){this._attempts++,this.connect()}sendHeartbeat(){try{if(this._missedHeartbeats++,this._missedHeartbeats>3)throw new Error("Too many missed heartbeats.");this._ws.send(this._cfg.heartbeatMsg)}catch(e){clearInterval(this._heartbeatInterval),this._heartbeatInterval=null,this._cfg.debug&&console.warn(`Closing connection. Reason: ${e.message}`),this.isClosing()||this.isClosed()||this.close()}}onOpen(){this._cfg.debug&&console.info("Connected!"),this._attempts=1,this._cfg.heartbeatMsg&&null===this._heartbeatInterval&&(this._missedHeartbeats=0,this._heartbeatInterval=setInterval(this.sendHeartbeat.bind(this),5e3)),"function"==typeof this._cfg.connected&&this._cfg.connected()}onClose(e){this._cfg.debug&&console.info("Connection closed!"),"function"==typeof this._cfg.disconnected&&this._cfg.disconnected(e),this.tryToReconnect()}onError(e){this._cfg.debug&&console.error("Websocket connection is broken!"),this._cfg.debug&&console.error(e)}onMessage(e){if(this._cfg.heartbeatMsg&&e.data===this._cfg.heartbeatMsg)this._missedHeartbeats=0;else if("function"==typeof this._cfg.receiveMessage)return this._cfg.receiveMessage(e.data)}generateInterval(e){let t=1e3*(Math.pow(2,e)-1);return t>3e4&&(t=3e4),Math.random()*t}sendMessage(e){this._ws&&this._ws.send(e)}getState(){return this._ws&&this._ws.readyState}isConnecting(){return this._ws&&0===this._ws.readyState}isConnected(){return this._ws&&1===this._ws.readyState}isClosing(){return this._ws&&2===this._ws.readyState}isClosed(){return this._ws&&3===this._ws.readyState}close(){clearInterval(this._heartbeatInterval),this._cfg.mustReconnect=!1,this.isClosing()&&this.isClosed()||(this._ws.close(),this._cfg.debug&&console.error("Websocket closed."))}}t.default=n},6065:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleOpenWindow=t.isClientSideRendering=t.getHighestSafeWindowContext=t.getWindowHeight=t.getWindowWidth=void 0,t.getWindowWidth=function(){return void 0!==n.g.window?n.g.window.innerWidth:0},t.getWindowHeight=function(){return void 0!==n.g.window?n.g.window.innerHeight:0},t.getHighestSafeWindowContext=function e(t=n.g.window.self){return t===n.g.window.top||(()=>{try{return n.g.window.location.hostname!==n.g.window.parent.location.hostname}catch(e){return!0}})()?t:e(t.parent)},t.isClientSideRendering=function(){return"undefined"!=typeof window},t.handleOpenWindow=(e,t="_blank")=>{if(e){const n=window.open(e,t);return n&&n.focus(),n}return null}},14:(e,t,n)=>{"use strict";function o(e,t){return function(){return e.apply(t,arguments)}}const{toString:r}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),e=>{const t=r.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const l=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e,{isArray:u}=Array,p=c("undefined"),d=l("ArrayBuffer"),h=c("string"),g=c("function"),f=c("number"),m=e=>null!==e&&"object"==typeof e,v=e=>{if("object"!==s(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=l("Date"),w=l("File"),b=l("Blob"),E=l("FileList"),S=l("URLSearchParams");function C(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,r;if("object"!=typeof e&&(e=[e]),u(e))for(o=0,r=e.length;o<r;o++)t.call(null,e[o],o,e);else{const r=n?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let s;for(o=0;o<i;o++)s=r[o],t.call(null,e[s],s,e)}}function L(e,t){t=t.toLowerCase();const n=Object.keys(e);let o,r=n.length;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,k=e=>!p(e)&&e!==P,x=(M="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>M&&e instanceof M);var M;const _=l("HTMLFormElement"),A=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),O=l("RegExp"),R=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};C(n,((n,r)=>{!1!==t(n,r,e)&&(o[r]=n)})),Object.defineProperties(e,o)},T="abcdefghijklmnopqrstuvwxyz",I="0123456789",D={DIGIT:I,ALPHA:T,ALPHA_DIGIT:T+T.toUpperCase()+I},H=l("AsyncFunction");var U={isArray:u,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=s(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:h,isNumber:f,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:v,isUndefined:p,isDate:y,isFile:w,isBlob:b,isRegExp:O,isFunction:g,isStream:e=>m(e)&&g(e.pipe),isURLSearchParams:S,isTypedArray:x,isFileList:E,forEach:C,merge:function e(){const{caseless:t}=k(this)&&this||{},n={},o=(o,r)=>{const i=t&&L(n,r)||r;v(n[i])&&v(o)?n[i]=e(n[i],o):v(o)?n[i]=e({},o):u(o)?n[i]=o.slice():n[i]=o};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&C(arguments[e],o);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(C(t,((t,r)=>{n&&g(t)?e[r]=o(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let r,s,a;const l={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)a=r[s],o&&!o(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!f(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:_,hasOwnProperty:A,hasOwnProp:A,reduceDescriptors:R,freezeMethods:e=>{R(e,((t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=e[n];g(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach((e=>{n[e]=!0}))};return u(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:L,global:P,isContextDefined:k,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let n="";const{length:o}=t;for(;e--;)n+=t[Math.random()*o|0];return n},isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,o)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const r=u(e)?[]:{};return C(e,((e,t)=>{const i=n(e,o+1);!p(i)&&(r[t]=i)})),t[o]=void 0,r}}return e};return n(e,0)},isAsyncFn:H,isThenable:e=>e&&(m(e)||g(e))&&g(e.then)&&g(e.catch)};function W(e,t,n,o,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r)}U.inherits(W,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:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const j=W.prototype,B={};function K(e){return U.isPlainObject(e)||U.isArray(e)}function N(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function z(e,t,n){return e?e.concat(t).map((function(e,t){return e=N(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["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((e=>{B[e]={value:e}})),Object.defineProperties(W,B),Object.defineProperty(j,"isAxiosError",{value:!0}),W.from=(e,t,n,o,r,i)=>{const s=Object.create(j);return U.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),W.call(s,e.message,t,n,o,r),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const J=U.toFlatObject(U,{},null,(function(e){return/^is[A-Z]/.test(e)}));function F(e,t,n){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!U.isUndefined(t[e])}))).metaTokens,r=n.visitor||c,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(r))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(U.isDate(e))return e.toISOString();if(!a&&U.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(e)||U.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,r){let a=e;if(e&&!r&&"object"==typeof e)if(U.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else if(U.isArray(e)&&function(e){return U.isArray(e)&&!e.some(K)}(e)||(U.isFileList(e)||U.endsWith(n,"[]"))&&(a=U.toArray(e)))return n=N(n),a.forEach((function(e,o){!U.isUndefined(e)&&null!==e&&t.append(!0===s?z([n],o,i):null===s?n:n+"[]",l(e))})),!1;return!!K(e)||(t.append(z(r,n,i),l(e)),!1)}const u=[],p=Object.assign(J,{defaultVisitor:c,convertValue:l,isVisitable:K});if(!U.isObject(e))throw new TypeError("data must be an object");return function e(n,o){if(!U.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+o.join("."));u.push(n),U.forEach(n,(function(n,i){!0===(!(U.isUndefined(n)||null===n)&&r.call(t,n,U.isString(i)?i.trim():i,o,p))&&e(n,o?o.concat(i):[i])})),u.pop()}}(e),t}function V(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function G(e,t){this._pairs=[],e&&F(e,this,t)}const $=G.prototype;function Z(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function q(e,t,n){if(!t)return e;const o=n&&n.encode||Z,r=n&&n.serialize;let i;if(i=r?r(t,n):U.isURLSearchParams(t)?t.toString():new G(t,n).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,V)}:V;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Y=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){U.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},X={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:G,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,n,o,r){let i=e[r++];const s=Number.isFinite(+i),a=r>=e.length;return i=!i&&U.isArray(o)?o.length:i,a?(U.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!s):(o[i]&&U.isObject(o[i])||(o[i]=[]),t(e,n,o[i],r)&&U.isArray(o[i])&&(o[i]=function(e){const t={},n=Object.keys(e);let o;const r=n.length;let i;for(o=0;o<r;o++)i=n[o],t[i]=e[i];return t}(o[i])),!s)}if(U.isFormData(e)&&U.isFunction(e.entries)){const n={};return U.forEachEntry(e,((e,o)=>{t(function(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),o,n,0)})),n}return null}const te={"Content-Type":void 0},ne={transitional:X,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,r=U.isObject(e);if(r&&U.isHTMLForm(e)&&(e=new FormData(e)),U.isFormData(e))return o&&o?JSON.stringify(ee(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return F(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){return Q.isNode&&U.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=U.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return F(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||o?(t.setContentType("application/json",!1),function(e,t,n){if(U.isString(e))try{return(0,JSON.parse)(e),U.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(e&&U.isString(e)&&(n&&!this.responseType||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};U.forEach(["delete","get","head"],(function(e){ne.headers[e]={}})),U.forEach(["post","put","patch"],(function(e){ne.headers[e]=U.merge(te)}));var oe=ne;const re=U.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"]),ie=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:U.isArray(e)?e.map(ae):String(e)}function le(e,t,n,o,r){return U.isFunction(o)?o.call(this,t,n):(r&&(t=n),U.isString(t)?U.isString(o)?-1!==t.indexOf(o):U.isRegExp(o)?o.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function r(e,t,n){const r=se(t);if(!r)throw new Error("header name must be a non-empty string");const i=U.findKey(o,r);(!i||void 0===o[i]||!0===n||void 0===n&&!1!==o[i])&&(o[i||t]=ae(e))}const i=(e,t)=>U.forEach(e,((e,n)=>r(e,n,t)));return U.isPlainObject(e)||e instanceof this.constructor?i(e,t):U.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?i((e=>{const t={};let n,o,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),o=e.substring(r+1).trim(),!n||t[n]&&re[n]||("set-cookie"===n?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)})),t})(e),t):null!=e&&r(t,e,n),this}get(e,t){if(e=se(e)){const n=U.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(U.isFunction(t))return t.call(this,e,n);if(U.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=U.findKey(this,e);return!(!n||void 0===this[n]||t&&!le(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function r(e){if(e=se(e)){const r=U.findKey(n,e);!r||t&&!le(0,n[r],r,t)||(delete n[r],o=!0)}}return U.isArray(e)?e.forEach(r):r(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const r=t[n];e&&!le(0,this[r],r,e,!0)||(delete this[r],o=!0)}return o}normalize(e){const t=this,n={};return U.forEach(this,((o,r)=>{const i=U.findKey(n,r);if(i)return t[i]=ae(o),void delete t[r];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(r):String(r).trim();s!==r&&delete t[r],t[s]=ae(o),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return U.forEach(this,((n,o)=>{null!=n&&!1!==n&&(t[o]=e&&U.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=se(e);t[o]||(function(e,t){const n=U.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,r){return this[o].call(this,t,e,n,r)},configurable:!0})}))}(n,e),t[o]=!0)}return U.isArray(e)?e.forEach(o):o(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.freezeMethods(ce.prototype),U.freezeMethods(ce);var ue=ce;function pe(e,t){const n=this||oe,o=t||n,r=ue.from(o.headers);let i=o.data;return U.forEach(e,(function(e){i=e.call(n,i,r.normalize(),t?t.status:void 0)})),r.normalize(),i}function de(e){return!(!e||!e.__CANCEL__)}function he(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}U.inherits(he,W,{__CANCEL__:!0});var ge=Q.isStandardBrowserEnv?{write:function(e,t,n,o,r,i){const s=[];s.push(e+"="+encodeURIComponent(t)),U.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),U.isString(o)&&s.push("path="+o),U.isString(r)&&s.push("domain="+r),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function fe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function o(n){let o=n;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=o(window.location.href),function(e){const t=U.isString(e)?o(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ve(e,t){let n=0;const o=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=o[s];r||(r=l),n[i]=a,o[i]=l;let u=s,p=0;for(;u!==i;)p+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),l-r<t)return;const d=c&&l-c;return d?Math.round(1e3*p/d):void 0}}(50,250);return r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,l=o(a);n=i;const c={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&i<=s?(s-i)/l:void 0,event:r};c[t?"download":"upload"]=!0,e(c)}}const ye={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let o=e.data;const r=ue.from(e.headers).normalize(),i=e.responseType;let s;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}U.isFormData(o)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";r.set("Authorization","Basic "+btoa(t+":"+n))}const c=fe(e.baseURL,e.url);function u(){if(!l)return;const o=ue.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:i&&"text"!==i&&"json"!==i?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:o,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),q(c,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=u:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(u)},l.onabort=function(){l&&(n(new W("Request aborted",W.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new W("Network Error",W.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const o=e.transitional||X;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new W(t,o.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,l)),l=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(c))&&e.xsrfCookieName&&ge.read(e.xsrfCookieName);t&&r.set(e.xsrfHeaderName,t)}void 0===o&&r.setContentType(null),"setRequestHeader"in l&&U.forEach(r.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),U.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),i&&"json"!==i&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(n(!t||t.type?new he(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);p&&-1===Q.protocols.indexOf(p)?n(new W("Unsupported protocol "+p+":",W.ERR_BAD_REQUEST,e)):l.send(o||null)}))}};U.forEach(ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function we(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function be(e){return we(e),e.headers=ue.from(e.headers),e.data=pe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=U.isArray(e)?e:[e];const{length:t}=e;let n,o;for(let r=0;r<t&&(n=e[r],!(o=U.isString(n)?ye[n.toLowerCase()]:n));r++);if(!o){if(!1===o)throw new W(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(U.hasOwnProp(ye,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!U.isFunction(o))throw new TypeError("adapter is not a function");return o})(e.adapter||oe.adapter)(e).then((function(t){return we(e),t.data=pe.call(e,e.transformResponse,t),t.headers=ue.from(t.headers),t}),(function(t){return de(t)||(we(e),t&&t.response&&(t.response.data=pe.call(e,e.transformResponse,t.response),t.response.headers=ue.from(t.response.headers))),Promise.reject(t)}))}const Ee=e=>e instanceof ue?e.toJSON():e;function Se(e,t){t=t||{};const n={};function o(e,t,n){return U.isPlainObject(e)&&U.isPlainObject(t)?U.merge.call({caseless:n},e,t):U.isPlainObject(t)?U.merge({},t):U.isArray(t)?t.slice():t}function r(e,t,n){return U.isUndefined(t)?U.isUndefined(e)?void 0:o(void 0,e,n):o(e,t,n)}function i(e,t){if(!U.isUndefined(t))return o(void 0,t)}function s(e,t){return U.isUndefined(t)?U.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function a(n,r,i){return i in t?o(n,r):i in e?o(void 0,n):void 0}const l={url:i,method:i,data:i,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:(e,t)=>r(Ee(e),Ee(t),!0)};return U.forEach(Object.keys(Object.assign({},e,t)),(function(o){const i=l[o]||r,s=i(e[o],t[o],o);U.isUndefined(s)&&i!==a||(n[o]=s)})),n}const Ce={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ce[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Le={};Ce.transitional=function(e,t,n){function o(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,i)=>{if(!1===e)throw new W(o(r," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!Le[r]&&(Le[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}};var Pe={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const i=o[r],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new W("option "+i+" must be "+n,W.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new W("Unknown option "+i,W.ERR_BAD_OPTION)}},validators:Ce};const ke=Pe.validators;class xe{constructor(e){this.defaults=e,this.interceptors={request:new Y,response:new Y}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Se(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:r}=t;let i;void 0!==n&&Pe.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=o&&(U.isFunction(o)?t.paramsSerializer={serialize:o}:Pe.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),i=r&&U.merge(r.common,r[t.method]),i&&U.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=ue.concat(i,r);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,p=0;if(!a){const e=[be.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);p<u;)c=c.then(e[p++],e[p++]);return c}u=s.length;let d=t;for(p=0;p<u;){const e=s[p++],t=s[p++];try{d=e(d)}catch(e){t.call(this,e);break}}try{c=be.call(this,d)}catch(e){return Promise.reject(e)}for(p=0,u=l.length;p<u;)c=c.then(l[p++],l[p++]);return c}getUri(e){return q(fe((e=Se(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}U.forEach(["delete","get","head","options"],(function(e){xe.prototype[e]=function(t,n){return this.request(Se(n||{},{method:e,url:t,data:(n||{}).data}))}})),U.forEach(["post","put","patch"],(function(e){function t(t){return function(n,o,r){return this.request(Se(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}xe.prototype[e]=t(),xe.prototype[e+"Form"]=t(!0)}));var Me=xe;class _e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e),t=e})).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e((function(e,o,r){n.reason||(n.reason=new he(e,o,r),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new _e((function(t){e=t})),cancel:e}}}var Ae=_e;const Oe={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(Oe).forEach((([e,t])=>{Oe[t]=e}));var Re=Oe;const Te=function e(t){const n=new Me(t),r=o(Me.prototype.request,n);return U.extend(r,Me.prototype,n,{allOwnKeys:!0}),U.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Se(t,n))},r}(oe);Te.Axios=Me,Te.CanceledError=he,Te.CancelToken=Ae,Te.isCancel=de,Te.VERSION="1.4.0",Te.toFormData=F,Te.AxiosError=W,Te.Cancel=Te.CanceledError,Te.all=function(e){return Promise.all(e)},Te.spread=function(e){return function(t){return e.apply(null,t)}},Te.isAxiosError=function(e){return U.isObject(e)&&!0===e.isAxiosError},Te.mergeConfig=Se,Te.AxiosHeaders=ue,Te.formToJSON=e=>ee(U.isHTMLForm(e)?new FormData(e):e),Te.HttpStatusCode=Re,Te.default=Te,e.exports=Te},1137:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CompactEncrypt:()=>Qe,CompactSign:()=>tt,EmbeddedJWK:()=>ut,EncryptJWT:()=>st,FlattenedEncrypt:()=>We,FlattenedSign:()=>et,GeneralEncrypt:()=>Be,GeneralSign:()=>ot,SignJWT:()=>it,UnsecuredJWT:()=>yt,base64url:()=>r,calculateJwkThumbprint:()=>lt,calculateJwkThumbprintUri:()=>ct,compactDecrypt:()=>Oe,compactVerify:()=>Je,createLocalJWKSet:()=>ft,createRemoteJWKSet:()=>vt,decodeJwt:()=>St,decodeProtectedHeader:()=>Et,errors:()=>o,exportJWK:()=>De,exportPKCS8:()=>Ie,exportSPKI:()=>Te,flattenedDecrypt:()=>Ae,flattenedVerify:()=>ze,generalDecrypt:()=>Re,generalVerify:()=>Fe,generateKeyPair:()=>Lt,generateSecret:()=>Pt,importJWK:()=>Pe,importPKCS8:()=>Le,importSPKI:()=>Se,importX509:()=>Ce,jwtDecrypt:()=>Xe,jwtVerify:()=>Ye});var o={};n.r(o),n.d(o,{JOSEAlgNotAllowed:()=>C,JOSEError:()=>b,JOSENotSupported:()=>L,JWEDecryptionFailed:()=>P,JWEInvalid:()=>k,JWKInvalid:()=>_,JWKSInvalid:()=>A,JWKSMultipleMatchingKeys:()=>R,JWKSNoMatchingKey:()=>O,JWKSTimeout:()=>T,JWSInvalid:()=>x,JWSSignatureVerificationFailed:()=>I,JWTClaimValidationFailed:()=>E,JWTExpired:()=>S,JWTInvalid:()=>M});var r={};n.r(r),n.d(r,{decode:()=>bt,encode:()=>wt});const i=crypto,s=e=>e instanceof CryptoKey,a=async(e,t)=>{const n=`SHA-${e.slice(-3)}`;return new Uint8Array(await i.subtle.digest(n,t))},l=new TextEncoder,c=new TextDecoder,u=2**32;function p(...e){const t=e.reduce(((e,{length:t})=>e+t),0),n=new Uint8Array(t);let o=0;return e.forEach((e=>{n.set(e,o),o+=e.length})),n}function d(e,t,n){if(t<0||t>=u)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],n)}function h(e){const t=Math.floor(e/u),n=e%u,o=new Uint8Array(8);return d(o,t,0),d(o,n,4),o}function g(e){const t=new Uint8Array(4);return d(t,e),t}function f(e){return p(g(e.length),e)}const m=e=>{let t=e;"string"==typeof t&&(t=l.encode(t));const n=[];for(let e=0;e<t.length;e+=32768)n.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(n.join(""))},v=e=>m(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),y=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},w=e=>{let t=e;t instanceof Uint8Array&&(t=c.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return y(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class b extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class E extends b{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",n="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=n}}class S extends b{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",n="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=n}}class C extends b{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class L extends b{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class P extends b{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class k extends b{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class x extends b{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class M extends b{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class _ extends b{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class A extends b{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class O extends b{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class R extends b{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class T extends b{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class I extends b{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}const D=i.getRandomValues.bind(i);function H(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new L(`Unsupported JWE Algorithm: ${e}`)}}const U=e=>D(new Uint8Array(H(e)>>3)),W=(e,t)=>{if(t.length<<3!==H(e))throw new k("Invalid Initialization Vector length")},j=(e,t)=>{const n=e.byteLength<<3;if(n!==t)throw new k(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)};function B(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function K(e,t){return e.name===t}function N(e){return parseInt(e.name.slice(4),10)}function z(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const n=t.pop();e+=`one of ${t.join(", ")}, or ${n}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function J(e,t,...n){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!K(e.algorithm,"AES-GCM"))throw B("AES-GCM");const n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw B(n,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!K(e.algorithm,"AES-KW"))throw B("AES-KW");const n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw B(n,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw B("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!K(e.algorithm,"PBKDF2"))throw B("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!K(e.algorithm,"RSA-OAEP"))throw B("RSA-OAEP");const n=parseInt(t.slice(9),10)||1;if(N(e.algorithm.hash)!==n)throw B(`SHA-${n}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}z(e,n)}function F(e,t,...n){if(n.length>2){const t=n.pop();e+=`one of type ${n.join(", ")}, or ${t}.`}else 2===n.length?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const V=(e,...t)=>F("Key must be ",e,...t);function G(e,t,...n){return F(`Key for the ${e} algorithm must be `,t,...n)}const $=e=>s(e),Z=["CryptoKey"],q=async(e,t,n,o,r,a)=>{if(!(s(t)||t instanceof Uint8Array))throw new TypeError(V(t,...Z,"Uint8Array"));switch(W(e,o),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&j(t,parseInt(e.slice(-3),10)),async function(e,t,n,o,r,s){if(!(t instanceof Uint8Array))throw new TypeError(V(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),l=await i.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await i.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=p(s,o,n,h(s.length<<3)),d=new Uint8Array((await i.subtle.sign("HMAC",c,u)).slice(0,a>>3));let g,f;try{g=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const n=e.length;let o=0,r=-1;for(;++r<n;)o|=e[r]^t[r];return 0===o})(r,d)}catch(e){}if(!g)throw new P;try{f=new Uint8Array(await i.subtle.decrypt({iv:o,name:"AES-CBC"},l,n))}catch(e){}if(!f)throw new P;return f}(e,t,n,o,r,a);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&j(t,parseInt(e.slice(1,4),10)),async function(e,t,n,o,r,s){let a;t instanceof Uint8Array?a=await i.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(J(t,e,"decrypt"),a=t);try{return new Uint8Array(await i.subtle.decrypt({additionalData:s,iv:o,name:"AES-GCM",tagLength:128},a,p(n,r)))}catch(e){throw new P}}(e,t,n,o,r,a);default:throw new L("Unsupported JWE Content Encryption Algorithm")}},Y=async()=>{throw new L('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},X=async()=>{throw new L('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Q=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let n;for(const e of t){const t=Object.keys(e);if(n&&0!==n.size)for(const e of t){if(n.has(e))return!1;n.add(e)}else n=new Set(t)}return!0};function ee(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const te=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ne(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function oe(e,t,n){if(s(e))return J(e,t,n),e;if(e instanceof Uint8Array)return i.subtle.importKey("raw",e,"AES-KW",!0,[n]);throw new TypeError(V(e,...Z,"Uint8Array"))}const re=async(e,t,n)=>{const o=await oe(t,e,"wrapKey");ne(o,e);const r=await i.subtle.importKey("raw",n,...te);return new Uint8Array(await i.subtle.wrapKey("raw",r,o,"AES-KW"))},ie=async(e,t,n)=>{const o=await oe(t,e,"unwrapKey");ne(o,e);const r=await i.subtle.unwrapKey("raw",n,o,"AES-KW",...te);return new Uint8Array(await i.subtle.exportKey("raw",r))};async function se(e,t,n,o,r=new Uint8Array(0),c=new Uint8Array(0)){if(!s(e))throw new TypeError(V(e,...Z));if(J(e,"ECDH"),!s(t))throw new TypeError(V(t,...Z));J(t,"ECDH","deriveBits");const u=p(f(l.encode(n)),f(r),f(c),g(o));let d;return d="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,async function(e,t,n){const o=Math.ceil((t>>3)/32),r=new Uint8Array(32*o);for(let t=0;t<o;t++){const o=new Uint8Array(4+e.length+n.length);o.set(g(t+1)),o.set(e,4),o.set(n,4+e.length),r.set(await a("sha256",o),32*t)}return r.slice(0,t>>3)}(new Uint8Array(await i.subtle.deriveBits({name:e.algorithm.name,public:e},t,d)),o,u)}function ae(e){if(!s(e))throw new TypeError(V(e,...Z));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function le(e,t,n,o){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new k("PBES2 Salt Input must be 8 or more octets")}(e);const r=function(e,t){return p(l.encode(e),new Uint8Array([0]),t)}(t,e),a=parseInt(t.slice(13,16),10),c={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:r},u={length:a,name:"AES-KW"},d=await function(e,t){if(e instanceof Uint8Array)return i.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(s(e))return J(e,t,"deriveBits","deriveKey"),e;throw new TypeError(V(e,...Z,"Uint8Array"))}(o,t);if(d.usages.includes("deriveBits"))return new Uint8Array(await i.subtle.deriveBits(c,d,a));if(d.usages.includes("deriveKey"))return i.subtle.deriveKey(c,d,u,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}function ce(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new L(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const ue=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if("number"!=typeof n||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function pe(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new L(`Unsupported JWE Algorithm: ${e}`)}}const de=e=>D(new Uint8Array(pe(e)>>3)),he=(e,t)=>`-----BEGIN ${t}-----\n${(e.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${t}-----`,ge=async(e,t,n)=>{if(!s(n))throw new TypeError(V(n,...Z));if(!n.extractable)throw new TypeError("CryptoKey is not extractable");if(n.type!==e)throw new TypeError(`key is not a ${e} key`);return he(m(new Uint8Array(await i.subtle.exportKey(t,n))),`${e.toUpperCase()} KEY`)},fe=(e,t,n=0)=>{0===n&&(t.unshift(t.length),t.unshift(6));let o=e.indexOf(t[0],n);if(-1===o)return!1;const r=e.subarray(o,o+t.length);return r.length===t.length&&(r.every(((e,n)=>e===t[n]))||fe(e,t,o+1))},me=e=>{switch(!0){case fe(e,[42,134,72,206,61,3,1,7]):return"P-256";case fe(e,[43,129,4,0,34]):return"P-384";case fe(e,[43,129,4,0,35]):return"P-521";case fe(e,[43,101,110]):return"X25519";case fe(e,[43,101,111]):return"X448";case fe(e,[43,101,112]):return"Ed25519";case fe(e,[43,101,113]):return"Ed448";default:throw new L("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},ve=async(e,t,n,o,r)=>{var s;let a,l;const c=new Uint8Array(atob(n.replace(e,"")).split("").map((e=>e.charCodeAt(0)))),u="spki"===t;switch(o){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${o.slice(-3)}`},l=u?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${o.slice(-3)}`},l=u?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(o.slice(-3),10)||1}`},l=u?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":a={name:"ECDSA",namedCurve:"P-256"},l=u?["verify"]:["sign"];break;case"ES384":a={name:"ECDSA",namedCurve:"P-384"},l=u?["verify"]:["sign"];break;case"ES512":a={name:"ECDSA",namedCurve:"P-521"},l=u?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=me(c);a=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},l=u?[]:["deriveBits"];break}case"EdDSA":a={name:me(c)},l=u?["verify"]:["sign"];break;default:throw new L('Invalid or unsupported "alg" (Algorithm) value')}return i.subtle.importKey(t,c,a,null!==(s=null==r?void 0:r.extractable)&&void 0!==s&&s,l)},ye=(e,t,n)=>ve(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,n);function we(e){let t=[],n=0;for(;n<e.length;){let o=be(e.subarray(n));t.push(o),n+=o.byteLength}return t}function be(e){let t=0,n=31&e[0];if(t++,31===n){for(n=0;e[t]>=128;)n=128*n+e[t]-128,t++;n=128*n+e[t]-128,t++}let o=0;if(e[t]<128)o=e[t],t++;else{if(128===o){for(o=0;0!==e[t+o]||0!==e[t+o+1];){if(o>e.byteLength)throw new TypeError("invalid indefinite form length");o++}const n=t+o+2;return{byteLength:n,contents:e.subarray(t,t+o),raw:e.subarray(0,n)}}{let n=127&e[t];t++,o=0;for(let r=0;r<n;r++)o=256*o+e[t],t++}}const r=t+o;return{byteLength:r,contents:e.subarray(t,r),raw:e.subarray(0,r)}}const Ee=async e=>{var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:o,keyUsages:r}=function(e){let t,n;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},n=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new L(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},n=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},n=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},n=["deriveBits"];break;default:throw new L('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new L('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new L('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new L('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new L('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),s=[o,null!==(t=e.ext)&&void 0!==t&&t,null!==(n=e.key_ops)&&void 0!==n?n:r];if("PBKDF2"===o.name)return i.subtle.importKey("raw",w(e.k),...s);const a={...e};return delete a.alg,delete a.use,i.subtle.importKey("jwk",a,...s)};async function Se(e,t,n){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return ye(e,t,n)}async function Ce(e,t,n){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return((e,t,n)=>{let o;try{o=function(e){const t=e.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),n=y(t);return he(function(e){const t=we(we(be(e).contents)[0].contents);return m(t[160===t[0].raw[0]?6:5].raw)}(n),"PUBLIC KEY")}(e)}catch(e){throw new TypeError("failed to parse the X.509 certificate",{cause:e})}return ye(o,t,n)})(e,t,n)}async function Le(e,t,n){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return((e,t,n)=>ve(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,n))(e,t,n)}async function Pe(e,t,n){var o;if(!ee(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=n||(n=!0!==e.ext),n?Ee({...e,alg:t,ext:null!==(o=e.ext)&&void 0!==o&&o}):w(e.k);case"RSA":if(void 0!==e.oth)throw new L('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Ee({...e,alg:t});default:throw new L('Unsupported "kty" (Key Type) Parameter value')}}const ke=(e,t,n)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!$(t))throw new TypeError(G(e,t,...Z,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Z.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,n)=>{if(!$(t))throw new TypeError(G(e,t,...Z));if("secret"===t.type)throw new TypeError(`${Z.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===n&&"public"===t.type)throw new TypeError(`${Z.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===n&&"public"===t.type)throw new TypeError(`${Z.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===n&&"private"===t.type)throw new TypeError(`${Z.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===n&&"private"===t.type)throw new TypeError(`${Z.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,n)},xe=async(e,t,n,o,r)=>{if(!(s(n)||n instanceof Uint8Array))throw new TypeError(V(n,...Z,"Uint8Array"));switch(W(e,o),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&j(n,parseInt(e.slice(-3),10)),async function(e,t,n,o,r){if(!(n instanceof Uint8Array))throw new TypeError(V(n,"Uint8Array"));const s=parseInt(e.slice(1,4),10),a=await i.subtle.importKey("raw",n.subarray(s>>3),"AES-CBC",!1,["encrypt"]),l=await i.subtle.importKey("raw",n.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await i.subtle.encrypt({iv:o,name:"AES-CBC"},a,t)),u=p(r,o,c,h(r.length<<3));return{ciphertext:c,tag:new Uint8Array((await i.subtle.sign("HMAC",l,u)).slice(0,s>>3))}}(e,t,n,o,r);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&j(n,parseInt(e.slice(1,4),10)),async function(e,t,n,o,r){let s;n instanceof Uint8Array?s=await i.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(J(n,e,"encrypt"),s=n);const a=new Uint8Array(await i.subtle.encrypt({additionalData:r,iv:o,name:"AES-GCM",tagLength:128},s,t)),l=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:l}}(e,t,n,o,r);default:throw new L("Unsupported JWE Content Encryption Algorithm")}},Me=function(e,t,n,o,r){if(void 0!==r.crit&&void 0===o.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;i=void 0!==n?new Map([...Object.entries(n),...t.entries()]):t;for(const t of o.crit){if(!i.has(t))throw new L(`Extension Header Parameter "${t}" is not recognized`);if(void 0===r[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(i.get(t)&&void 0===o[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(o.crit)},_e=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function Ae(e,t,n){var o;if(!ee(e))throw new k("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new k("JOSE Header missing");if("string"!=typeof e.iv)throw new k("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new k("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new k("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new k("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new k("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new k("JWE AAD incorrect type");if(void 0!==e.header&&!ee(e.header))throw new k("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!ee(e.unprotected))throw new k("JWE Per-Recipient Unprotected Header incorrect type");let r;if(e.protected)try{const t=w(e.protected);r=JSON.parse(c.decode(t))}catch(e){throw new k("JWE Protected Header is invalid")}if(!Q(r,e.header,e.unprotected))throw new k("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const a={...r,...e.header,...e.unprotected};if(Me(k,new Map,null==n?void 0:n.crit,r,a),void 0!==a.zip){if(!r||!r.zip)throw new k('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==a.zip)throw new L('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:u,enc:d}=a;if("string"!=typeof u||!u)throw new k("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof d||!d)throw new k("missing JWE Encryption Algorithm (enc) in JWE Header");const h=n&&_e("keyManagementAlgorithms",n.keyManagementAlgorithms),g=n&&_e("contentEncryptionAlgorithms",n.contentEncryptionAlgorithms);if(h&&!h.has(u))throw new C('"alg" (Algorithm) Header Parameter not allowed');if(g&&!g.has(d))throw new C('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=w(e.encrypted_key));let m,v=!1;"function"==typeof t&&(t=await t(r,e),v=!0);try{m=await async function(e,t,n,o,r){switch(ke(e,t,"decrypt"),e){case"dir":if(void 0!==n)throw new k("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==n)throw new k("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ee(o.epk))throw new k('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ae(t))throw new L("ECDH with the provided key is not allowed or not supported by your javascript runtime");const r=await Pe(o.epk,e);let i,s;if(void 0!==o.apu){if("string"!=typeof o.apu)throw new k('JOSE Header "apu" (Agreement PartyUInfo) invalid');i=w(o.apu)}if(void 0!==o.apv){if("string"!=typeof o.apv)throw new k('JOSE Header "apv" (Agreement PartyVInfo) invalid');s=w(o.apv)}const a=await se(r,t,"ECDH-ES"===e?o.enc:e,"ECDH-ES"===e?pe(o.enc):parseInt(e.slice(-5,-2),10),i,s);if("ECDH-ES"===e)return a;if(void 0===n)throw new k("JWE Encrypted Key missing");return ie(e.slice(-6),a,n)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===n)throw new k("JWE Encrypted Key missing");return(async(e,t,n)=>{if(!s(t))throw new TypeError(V(t,...Z));if(J(t,e,"decrypt","unwrapKey"),ue(e,t),t.usages.includes("decrypt"))return new Uint8Array(await i.subtle.decrypt(ce(e),t,n));if(t.usages.includes("unwrapKey")){const o=await i.subtle.unwrapKey("raw",n,t,ce(e),...te);return new Uint8Array(await i.subtle.exportKey("raw",o))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')})(e,t,n);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===n)throw new k("JWE Encrypted Key missing");if("number"!=typeof o.p2c)throw new k('JOSE Header "p2c" (PBES2 Count) missing or invalid');const i=(null==r?void 0:r.maxPBES2Count)||1e4;if(o.p2c>i)throw new k('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof o.p2s)throw new k('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return(async(e,t,n,o,r)=>{const i=await le(r,e,o,t);return ie(e.slice(-6),i,n)})(e,t,n,o.p2c,w(o.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===n)throw new k("JWE Encrypted Key missing");return ie(e,t,n);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===n)throw new k("JWE Encrypted Key missing");if("string"!=typeof o.iv)throw new k('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof o.tag)throw new k('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,n,o,r){const i=e.slice(0,7);return q(i,t,n,o,r,new Uint8Array(0))}(e,t,n,w(o.iv),w(o.tag));default:throw new L('Invalid or unsupported "alg" (JWE Algorithm) header value')}}(u,t,f,a,n)}catch(e){if(e instanceof TypeError||e instanceof k||e instanceof L)throw e;m=de(d)}const y=w(e.iv),b=w(e.tag),E=l.encode(null!==(o=e.protected)&&void 0!==o?o:"");let S;S=void 0!==e.aad?p(E,l.encode("."),l.encode(e.aad)):E;let P=await q(d,m,w(e.ciphertext),y,b,S);"DEF"===a.zip&&(P=await((null==n?void 0:n.inflateRaw)||Y)(P));const x={plaintext:P};return void 0!==e.protected&&(x.protectedHeader=r),void 0!==e.aad&&(x.additionalAuthenticatedData=w(e.aad)),void 0!==e.unprotected&&(x.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(x.unprotectedHeader=e.header),v?{...x,key:t}:x}async function Oe(e,t,n){if(e instanceof Uint8Array&&(e=c.decode(e)),"string"!=typeof e)throw new k("Compact JWE must be a string or Uint8Array");const{0:o,1:r,2:i,3:s,4:a,length:l}=e.split(".");if(5!==l)throw new k("Invalid Compact JWE");const u=await Ae({ciphertext:s,iv:i||void 0,protected:o||void 0,tag:a||void 0,encrypted_key:r||void 0},t,n),p={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...p,key:u.key}:p}async function Re(e,t,n){if(!ee(e))throw new k("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(ee))throw new k("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new k("JWE Recipients has no members");for(const o of e.recipients)try{return await Ae({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:o.encrypted_key,header:o.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,n)}catch(e){}throw new P}async function Te(e){return(e=>ge("public","spki",e))(e)}async function Ie(e){return(e=>ge("private","pkcs8",e))(e)}async function De(e){return(async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:v(e)};if(!s(e))throw new TypeError(V(e,...Z,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:n,alg:o,use:r,...a}=await i.subtle.exportKey("jwk",e);return a})(e)}const He=async function(e,t,n,o,r={}){let a,l,c;switch(ke(e,n,"encrypt"),e){case"dir":c=n;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ae(n))throw new L("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:u,apv:p}=r;let{epk:d}=r;d||(d=(await async function(e){if(!s(e))throw new TypeError(V(e,...Z));return i.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(n)).privateKey);const{x:h,y:g,crv:f,kty:m}=await De(d),y=await se(n,d,"ECDH-ES"===e?t:e,"ECDH-ES"===e?pe(t):parseInt(e.slice(-5,-2),10),u,p);if(l={epk:{x:h,crv:f,kty:m}},"EC"===m&&(l.epk.y=g),u&&(l.apu=v(u)),p&&(l.apv=v(p)),"ECDH-ES"===e){c=y;break}c=o||de(t);const w=e.slice(-6);a=await re(w,y,c);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":c=o||de(t),a=await(async(e,t,n)=>{if(!s(t))throw new TypeError(V(t,...Z));if(J(t,e,"encrypt","wrapKey"),ue(e,t),t.usages.includes("encrypt"))return new Uint8Array(await i.subtle.encrypt(ce(e),t,n));if(t.usages.includes("wrapKey")){const o=await i.subtle.importKey("raw",n,...te);return new Uint8Array(await i.subtle.wrapKey("raw",o,t,ce(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,n,c);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{c=o||de(t);const{p2c:i,p2s:s}=r;({encryptedKey:a,...l}=await(async(e,t,n,o=2048,r=D(new Uint8Array(16)))=>{const i=await le(r,e,o,t);return{encryptedKey:await re(e.slice(-6),i,n),p2c:o,p2s:v(r)}})(e,n,c,i,s));break}case"A128KW":case"A192KW":case"A256KW":c=o||de(t),a=await re(e,n,c);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{c=o||de(t);const{iv:i}=r;({encryptedKey:a,...l}=await async function(e,t,n,o){const r=e.slice(0,7);o||(o=U(r));const{ciphertext:i,tag:s}=await xe(r,n,t,o,new Uint8Array(0));return{encryptedKey:i,iv:v(o),tag:v(s)}}(e,n,c,i));break}default:throw new L('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:c,encryptedKey:a,parameters:l}},Ue=Symbol();class We{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new k("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Q(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new k("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Me(k,new Map,null==t?void 0:t.crit,this._protectedHeader,n),void 0!==n.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new k('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==n.zip)throw new L('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:o,enc:r}=n;if("string"!=typeof o||!o)throw new k('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof r||!r)throw new k('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let i,s,a,u,d,h,g;if("dir"===o){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===o&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let n;({cek:s,encryptedKey:i,parameters:n}=await He(o,r,e,this._cek,this._keyManagementParameters)),n&&(t&&Ue in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}if(this._iv||(this._iv=U(r)),u=this._protectedHeader?l.encode(v(JSON.stringify(this._protectedHeader))):l.encode(""),this._aad?(d=v(this._aad),a=p(u,l.encode("."),l.encode(d))):a=u,"DEF"===n.zip){const e=await((null==t?void 0:t.deflateRaw)||X)(this._plaintext);({ciphertext:h,tag:g}=await xe(r,e,s,this._iv,a))}else({ciphertext:h,tag:g}=await xe(r,this._plaintext,s,this._iv,a));const f={ciphertext:v(h),iv:v(this._iv),tag:v(g)};return i&&(f.encrypted_key=v(i)),d&&(f.aad=d),this._protectedHeader&&(f.protected=c.decode(u)),this._sharedUnprotectedHeader&&(f.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(f.header=this._unprotectedHeader),f}}class je{constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}class Be{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const n=new je(this,e,{crit:null==t?void 0:t.crit});return this._recipients.push(n),n}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(e){var t,n,o;if(!this._recipients.length)throw new k("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){const[t]=this._recipients,n=await new We(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e});let o={ciphertext:n.ciphertext,iv:n.iv,recipients:[{}],tag:n.tag};return n.aad&&(o.aad=n.aad),n.protected&&(o.protected=n.protected),n.unprotected&&(o.unprotected=n.unprotected),n.encrypted_key&&(o.recipients[0].encrypted_key=n.encrypted_key),n.header&&(o.recipients[0].header=n.header),o}let r;for(let e=0;e<this._recipients.length;e++){const t=this._recipients[e];if(!Q(this._protectedHeader,this._unprotectedHeader,t.unprotectedHeader))throw new k("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...t.unprotectedHeader},{alg:o}=n;if("string"!=typeof o||!o)throw new k('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===o||"ECDH-ES"===o)throw new k('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof n.enc||!n.enc)throw new k('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(r){if(r!==n.enc)throw new k('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else r=n.enc;if(Me(k,new Map,t.options.crit,this._protectedHeader,n),!(void 0===n.zip||this._protectedHeader&&this._protectedHeader.zip))throw new k('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const i=de(r);let s={ciphertext:"",iv:"",recipients:[],tag:""};for(let a=0;a<this._recipients.length;a++){const l=this._recipients[a],c={};s.recipients.push(c);const u={...this._protectedHeader,...this._unprotectedHeader,...l.unprotectedHeader}.alg.startsWith("PBES2")?2048+a:void 0;if(0===a){const t=await new We(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(i).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(l.unprotectedHeader).setKeyManagementParameters({p2c:u}).encrypt(l.key,{...l.options,...e,[Ue]:!0});s.ciphertext=t.ciphertext,s.iv=t.iv,s.tag=t.tag,t.aad&&(s.aad=t.aad),t.protected&&(s.protected=t.protected),t.unprotected&&(s.unprotected=t.unprotected),c.encrypted_key=t.encrypted_key,t.header&&(c.header=t.header);continue}const{encryptedKey:p,parameters:d}=await He((null===(t=l.unprotectedHeader)||void 0===t?void 0:t.alg)||(null===(n=this._protectedHeader)||void 0===n?void 0:n.alg)||(null===(o=this._unprotectedHeader)||void 0===o?void 0:o.alg),r,l.key,i,{p2c:u});c.encrypted_key=v(p),(l.unprotectedHeader||d)&&(c.header={...l.unprotectedHeader,...d})}return s}}function Ke(e,t){const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new L(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Ne(e,t,n){if(s(t))return function(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!K(e.algorithm,"HMAC"))throw B("HMAC");const n=parseInt(t.slice(2),10);if(N(e.algorithm.hash)!==n)throw B(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!K(e.algorithm,"RSASSA-PKCS1-v1_5"))throw B("RSASSA-PKCS1-v1_5");const n=parseInt(t.slice(2),10);if(N(e.algorithm.hash)!==n)throw B(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!K(e.algorithm,"RSA-PSS"))throw B("RSA-PSS");const n=parseInt(t.slice(2),10);if(N(e.algorithm.hash)!==n)throw B(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw B("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!K(e.algorithm,"ECDSA"))throw B("ECDSA");const n=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==n)throw B(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}z(e,n)}(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(V(t,...Z));return i.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(V(t,...Z,"Uint8Array"))}async function ze(e,t,n){var o;if(!ee(e))throw new x("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new x('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new x("JWS Protected Header incorrect type");if(void 0===e.payload)throw new x("JWS Payload missing");if("string"!=typeof e.signature)throw new x("JWS Signature missing or incorrect type");if(void 0!==e.header&&!ee(e.header))throw new x("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const t=w(e.protected);r=JSON.parse(c.decode(t))}catch(e){throw new x("JWS Protected Header is invalid")}if(!Q(r,e.header))throw new x("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const s={...r,...e.header};let a=!0;if(Me(x,new Map([["b64",!0]]),null==n?void 0:n.crit,r,s).has("b64")&&(a=r.b64,"boolean"!=typeof a))throw new x('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:u}=s;if("string"!=typeof u||!u)throw new x('JWS "alg" (Algorithm) Header Parameter missing or invalid');const d=n&&_e("algorithms",n.algorithms);if(d&&!d.has(u))throw new C('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new x("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new x("JWS Payload must be a string or an Uint8Array instance");let h=!1;"function"==typeof t&&(t=await t(r,e),h=!0),ke(u,t,"verify");const g=p(l.encode(null!==(o=e.protected)&&void 0!==o?o:""),l.encode("."),"string"==typeof e.payload?l.encode(e.payload):e.payload),f=w(e.signature);if(!await(async(e,t,n,o)=>{const r=await Ne(e,t,"verify");ue(e,r);const s=Ke(e,r.algorithm);try{return await i.subtle.verify(s,r,n,o)}catch(e){return!1}})(u,t,f,g))throw new I;let m;m=a?w(e.payload):"string"==typeof e.payload?l.encode(e.payload):e.payload;const v={payload:m};return void 0!==e.protected&&(v.protectedHeader=r),void 0!==e.header&&(v.unprotectedHeader=e.header),h?{...v,key:t}:v}async function Je(e,t,n){if(e instanceof Uint8Array&&(e=c.decode(e)),"string"!=typeof e)throw new x("Compact JWS must be a string or Uint8Array");const{0:o,1:r,2:i,length:s}=e.split(".");if(3!==s)throw new x("Invalid Compact JWS");const a=await ze({payload:r,protected:o,signature:i},t,n),l={payload:a.payload,protectedHeader:a.protectedHeader};return"function"==typeof t?{...l,key:a.key}:l}async function Fe(e,t,n){if(!ee(e))throw new x("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(ee))throw new x("JWS Signatures missing or incorrect type");for(const o of e.signatures)try{return await ze({header:o.header,payload:e.payload,protected:o.protected,signature:o.signature},t,n)}catch(e){}throw new I}const Ve=e=>Math.floor(e.getTime()/1e3),Ge=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,$e=e=>{const t=Ge.exec(e);if(!t)throw new TypeError("Invalid time period format");const n=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(n);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*n);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*n);case"day":case"days":case"d":return Math.round(86400*n);case"week":case"weeks":case"w":return Math.round(604800*n);default:return Math.round(31557600*n)}},Ze=e=>e.toLowerCase().replace(/^application\//,""),qe=(e,t,n={})=>{const{typ:o}=n;if(o&&("string"!=typeof e.typ||Ze(e.typ)!==Ze(o)))throw new E('unexpected "typ" JWT header value',"typ","check_failed");let r;try{r=JSON.parse(c.decode(t))}catch(e){}if(!ee(r))throw new M("JWT Claims Set must be a top-level JSON object");const{requiredClaims:i=[],issuer:s,subject:a,audience:l,maxTokenAge:u}=n;void 0!==u&&i.push("iat"),void 0!==l&&i.push("aud"),void 0!==a&&i.push("sub"),void 0!==s&&i.push("iss");for(const e of new Set(i.reverse()))if(!(e in r))throw new E(`missing required "${e}" claim`,e,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(r.iss))throw new E('unexpected "iss" claim value',"iss","check_failed");if(a&&r.sub!==a)throw new E('unexpected "sub" claim value',"sub","check_failed");if(l&&(d="string"==typeof l?[l]:l,!("string"==typeof(p=r.aud)?d.includes(p):Array.isArray(p)&&d.some(Set.prototype.has.bind(new Set(p))))))throw new E('unexpected "aud" claim value',"aud","check_failed");var p,d;let h;switch(typeof n.clockTolerance){case"string":h=$e(n.clockTolerance);break;case"number":h=n.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:g}=n,f=Ve(g||new Date);if((void 0!==r.iat||u)&&"number"!=typeof r.iat)throw new E('"iat" claim must be a number',"iat","invalid");if(void 0!==r.nbf){if("number"!=typeof r.nbf)throw new E('"nbf" claim must be a number',"nbf","invalid");if(r.nbf>f+h)throw new E('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==r.exp){if("number"!=typeof r.exp)throw new E('"exp" claim must be a number',"exp","invalid");if(r.exp<=f-h)throw new S('"exp" claim timestamp check failed',"exp","check_failed")}if(u){const e=f-r.iat;if(e-h>("number"==typeof u?u:$e(u)))throw new S('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-h)throw new E('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return r};async function Ye(e,t,n){var o;const r=await Je(e,t,n);if((null===(o=r.protectedHeader.crit)||void 0===o?void 0:o.includes("b64"))&&!1===r.protectedHeader.b64)throw new M("JWTs MUST NOT use unencoded payload");const i={payload:qe(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return"function"==typeof t?{...i,key:r.key}:i}async function Xe(e,t,n){const o=await Oe(e,t,n),r=qe(o.protectedHeader,o.plaintext,n),{protectedHeader:i}=o;if(void 0!==i.iss&&i.iss!==r.iss)throw new E('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==i.sub&&i.sub!==r.sub)throw new E('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==i.aud&&JSON.stringify(i.aud)!==JSON.stringify(r.aud))throw new E('replicated "aud" claim header parameter mismatch',"aud","mismatch");const s={payload:r,protectedHeader:i};return"function"==typeof t?{...s,key:o.key}:s}class Qe{constructor(e){this._flattened=new We(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const n=await this._flattened.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(".")}}class et{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new x("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Q(this._protectedHeader,this._unprotectedHeader))throw new x("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader};let o=!0;if(Me(x,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,n).has("b64")&&(o=this._protectedHeader.b64,"boolean"!=typeof o))throw new x('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:r}=n;if("string"!=typeof r||!r)throw new x('JWS "alg" (Algorithm) Header Parameter missing or invalid');ke(r,e,"sign");let s,a=this._payload;o&&(a=l.encode(v(a))),s=this._protectedHeader?l.encode(v(JSON.stringify(this._protectedHeader))):l.encode("");const u=p(s,l.encode("."),a),d=await(async(e,t,n)=>{const o=await Ne(e,t,"sign");ue(e,o);const r=await i.subtle.sign(Ke(e,o.algorithm),o,n);return new Uint8Array(r)})(r,e,u),h={signature:v(d),payload:""};return o&&(h.payload=c.decode(a)),this._unprotectedHeader&&(h.header=this._unprotectedHeader),this._protectedHeader&&(h.protected=c.decode(s)),h}}class tt{constructor(e){this._flattened=new et(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const n=await this._flattened.sign(e,t);if(void 0===n.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${n.protected}.${n.payload}.${n.signature}`}}class nt{constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class ot{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const n=new nt(this,e,t);return this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new x("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t<this._signatures.length;t++){const n=this._signatures[t],o=new et(this._payload);o.setProtectedHeader(n.protectedHeader),o.setUnprotectedHeader(n.unprotectedHeader);const{payload:r,...i}=await o.sign(n.key,n.options);if(0===t)e.payload=r;else if(e.payload!==r)throw new x("inconsistent use of JWS Unencoded Payload (RFC7797)");e.signatures.push(i)}return e}}class rt{constructor(e){if(!ee(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:Ve(new Date)+$e(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:Ve(new Date)+$e(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:Ve(new Date)}:{...this._payload,iat:e},this}}class it extends rt{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var n;const o=new tt(l.encode(JSON.stringify(this._payload)));if(o.setProtectedHeader(this._protectedHeader),Array.isArray(null===(n=this._protectedHeader)||void 0===n?void 0:n.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new M("JWTs MUST NOT use unencoded payload");return o.sign(e,t)}}class st extends rt{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){const n=new Qe(l.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),n.setProtectedHeader(this._protectedHeader),this._iv&&n.setInitializationVector(this._iv),this._cek&&n.setContentEncryptionKey(this._cek),this._keyManagementParameters&&n.setKeyManagementParameters(this._keyManagementParameters),n.encrypt(e,t)}}const at=(e,t)=>{if("string"!=typeof e||!e)throw new _(`${t} missing or invalid`)};async function lt(e,t){if(!ee(e))throw new TypeError("JWK must be an object");if(null!=t||(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let n;switch(e.kty){case"EC":at(e.crv,'"crv" (Curve) Parameter'),at(e.x,'"x" (X Coordinate) Parameter'),at(e.y,'"y" (Y Coordinate) Parameter'),n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":at(e.crv,'"crv" (Subtype of Key Pair) Parameter'),at(e.x,'"x" (Public Key) Parameter'),n={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":at(e.e,'"e" (Exponent) Parameter'),at(e.n,'"n" (Modulus) Parameter'),n={e:e.e,kty:e.kty,n:e.n};break;case"oct":at(e.k,'"k" (Key Value) Parameter'),n={k:e.k,kty:e.kty};break;default:throw new L('"kty" (Key Type) Parameter missing or unsupported')}const o=l.encode(JSON.stringify(n));return v(await a(t,o))}async function ct(e,t){null!=t||(t="sha256");const n=await lt(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${n}`}async function ut(e,t){const n={...e,...null==t?void 0:t.header};if(!ee(n.jwk))throw new x('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const o=await Pe({...n.jwk,ext:!0},n.alg,!0);if(o instanceof Uint8Array||"public"!==o.type)throw new x('"jwk" (JSON Web Key) Header Parameter must be a public key');return o}function pt(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(dt)}function dt(e){return ee(e)}class ht{constructor(e){if(this._cached=new WeakMap,!pt(e))throw new A("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:n,kid:o}={...e,...null==t?void 0:t.header},r=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new L('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=this._jwks.keys.filter((e=>{let t=r===e.kty;if(t&&"string"==typeof o&&(t=o===e.kid),t&&"string"==typeof e.alg&&(t=n===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===n&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(n){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t})),{0:s,length:a}=i;if(0===a)throw new O;if(1!==a){const e=new R,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of i)try{yield await gt(t,e,n)}catch(e){continue}},e}return gt(this._cached,s,n)}}async function gt(e,t,n){const o=e.get(t)||e.set(t,{}).get(t);if(void 0===o[n]){const e=await Pe({...t,ext:!0},n);if(e instanceof Uint8Array||"public"!==e.type)throw new A("JSON Web Key Set members must be public keys");o[n]=e}return o[n]}function ft(e){const t=new ht(e);return async function(e,n){return t.getKey(e,n)}}class mt extends ht{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(n){if(n instanceof O&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw n}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(async(e,t,n)=>{let o,r,i=!1;"function"==typeof AbortController&&(o=new AbortController,r=setTimeout((()=>{i=!0,o.abort()}),t));const s=await fetch(e.href,{signal:o?o.signal:void 0,redirect:"manual",headers:n.headers}).catch((e=>{if(i)throw new T;throw e}));if(void 0!==r&&clearTimeout(r),200!==s.status)throw new b("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await s.json()}catch(e){throw new b("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{if(!pt(e))throw new A("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function vt(e,t){const n=new mt(e,t);return async function(e,t){return n.getKey(e,t)}}class yt extends rt{encode(){return`${v(JSON.stringify({alg:"none"}))}.${v(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new M("Unsecured JWT must be a string");const{0:n,1:o,2:r,length:i}=e.split(".");if(3!==i||""!==r)throw new M("Invalid Unsecured JWT");let s;try{if(s=JSON.parse(c.decode(w(n))),"none"!==s.alg)throw new Error}catch(e){throw new M("Invalid Unsecured JWT")}return{payload:qe(s,w(o),t),header:s}}}const wt=v,bt=w;function Et(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(c.decode(bt(t)));if(!ee(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}function St(e){if("string"!=typeof e)throw new M("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:n}=e.split(".");if(5===n)throw new M("Only JWTs using Compact JWS serialization can be decoded");if(3!==n)throw new M("Invalid JWT");if(!t)throw new M("JWTs must contain a payload");let o,r;try{o=bt(t)}catch(e){throw new M("Failed to parse the base64url encoded payload")}try{r=JSON.parse(c.decode(o))}catch(e){throw new M("Failed to parse the decoded payload as JSON")}if(!ee(r))throw new M("Invalid JWT Claims Set");return r}function Ct(e){var t;const n=null!==(t=null==e?void 0:e.modulusLength)&&void 0!==t?t:2048;if("number"!=typeof n||n<2048)throw new L("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return n}async function Lt(e,t){return async function(e,t){var n,o,r;let s,a;switch(e){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ct(t)},a=["sign","verify"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ct(t)},a=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ct(t)},a=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},a=["sign","verify"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},a=["sign","verify"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},a=["sign","verify"];break;case"EdDSA":a=["sign","verify"];const r=null!==(n=null==t?void 0:t.crv)&&void 0!==n?n:"Ed25519";switch(r){case"Ed25519":case"Ed448":s={name:r};break;default:throw new L("Invalid or unsupported crv option provided")}break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{a=["deriveKey","deriveBits"];const e=null!==(o=null==t?void 0:t.crv)&&void 0!==o?o:"P-256";switch(e){case"P-256":case"P-384":case"P-521":s={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":s={name:e};break;default:throw new L("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new L('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return i.subtle.generateKey(s,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,a)}(e,t)}async function Pt(e,t){return async function(e,t){var n;let o,r,s;switch(e){case"HS256":case"HS384":case"HS512":o=parseInt(e.slice(-3),10),r={name:"HMAC",hash:`SHA-${o}`,length:o},s=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return o=parseInt(e.slice(-3),10),D(new Uint8Array(o>>3));case"A128KW":case"A192KW":case"A256KW":o=parseInt(e.slice(1,4),10),r={name:"AES-KW",length:o},s=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":o=parseInt(e.slice(1,4),10),r={name:"AES-GCM",length:o},s=["encrypt","decrypt"];break;default:throw new L('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return i.subtle.generateKey(r,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,s)}(e,t)}},2970:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>I,__assign:()=>i,__asyncDelegator:()=>P,__asyncGenerator:()=>L,__asyncValues:()=>k,__await:()=>C,__awaiter:()=>g,__classPrivateFieldGet:()=>O,__classPrivateFieldIn:()=>T,__classPrivateFieldSet:()=>R,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>H,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>r,__generator:()=>f,__importDefault:()=>A,__importStar:()=>_,__makeTemplateObject:()=>x,__metadata:()=>h,__param:()=>l,__propKey:()=>p,__read:()=>w,__rest:()=>s,__runInitializers:()=>u,__setFunctionName:()=>d,__spread:()=>b,__spreadArray:()=>S,__spreadArrays:()=>E,__values:()=>y,default:()=>U});var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function s(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){var r,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,n,s):r(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,o){t(n,o,e)}}function c(e,t,n,o,r,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?o.static?e:e.prototype:null,p=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),d=!1,h=n.length-1;h>=0;h--){var g={};for(var f in o)g[f]="access"===f?{}:o[f];for(var f in o.access)g.access[f]=o.access[f];g.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(p.get=a),(a=s(m.set))&&(p.set=a),(a=s(m.init))&&r.unshift(a)}else(a=s(m))&&("field"===l?r.unshift(a):p[c]=a)}u&&Object.defineProperty(u,o.name,p),d=!0}function u(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0}function p(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function g(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))}function f(e,t){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var m=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function v(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||m(t,e,n)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function E(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,r++)o[r]=i[s];return o}function S(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function L(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o;function s(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.push([e,t,n,o])>1||a(e,t)}))})}function a(e,t){try{(n=r[e](t)).value instanceof C?Promise.resolve(n.value.v).then(l,c):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function P(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:C(e[o](t)),done:!1}:r?r(t):t}:r}}function k(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=y(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,r,(t=e[n](t)).done,t.value)}))}}}function x(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&m(t,e,n);return M(t,e),t}function A(e){return e&&e.__esModule?e:{default:e}}function O(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function R(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function T(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function I(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=t[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=t[Symbol.dispose]}if("function"!=typeof o)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:o,async:n})}else n&&e.stack.push({async:!0});return t}var D="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var o=new Error(n);return o.name="SuppressedError",o.error=e,o.suppressed=t,o};function H(e){function t(t){e.error=e.hasError?new D(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var o=e.stack.pop();try{var r=o.dispose&&o.dispose.call(o.value);if(o.async)return Promise.resolve(r).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const U={__extends:r,__assign:i,__rest:s,__decorate:a,__param:l,__metadata:h,__awaiter:g,__generator:f,__createBinding:m,__exportStar:v,__values:y,__read:w,__spread:b,__spreadArrays:E,__spreadArray:S,__await:C,__asyncGenerator:L,__asyncDelegator:P,__asyncValues:k,__makeTemplateObject:x,__importStar:_,__importDefault:A,__classPrivateFieldGet:O,__classPrivateFieldSet:R,__classPrivateFieldIn:T,__addDisposableResource:I,__disposeResources:H}}}]);
|