3 lines
723 KiB
JavaScript
3 lines
723 KiB
JavaScript
/*! For license information please see main.cdb3f2d7.js.LICENSE.txt */
|
|
(()=>{var e={789(e){"use strict";var t=function(e){return function(e){return!!e&&"object"===typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,n){return e.concat(t).map(function(e){return i(e,n)})}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function s(e,t){try{return t in e}catch(n){return!1}}function a(e,t,n){var r={};return n.isMergeableObject(e)&&o(e).forEach(function(t){r[t]=i(e[t],n)}),o(t).forEach(function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"===typeof n?n:l}(o,n)(e[o],t[o],n):r[o]=i(t[o],n))}),r}function l(e,n,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||t,o.cloneUnlessOtherwiseSpecified=i;var s=Array.isArray(n);return s===Array.isArray(e)?s?o.arrayMerge(e,n,o):a(e,n,o):i(n,o)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return l(e,n,t)},{})};var c=l;e.exports=c},260(e,t){!function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,n=this._zoom;if(e.__parent)for(;t.__parent._zoom>=n;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var n,i=this._featureGroup,r=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress,l=e.length,c=0,u=!0;if(this._map){var d=(new Date).getTime(),h=L.bind(function(){var p=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();c<l&&!(o&&c%200===0&&(new Date).getTime()-p>s);c++)if((n=e[c])instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(n,e),l=e.length;else if(n.getLatLng){if(!this.hasLayer(n)&&(this._addLayer(n,this._maxZoom),t||this.fire("layeradd",{layer:n}),n.__parent&&2===n.__parent.getChildCount())){var f=n.__parent.getAllChildMarkers(),m=f[0]===n?f[1]:f[0];i.removeLayer(m)}}else r.addLayer(n),t||this.fire("layeradd",{layer:n});a&&a(c,l,(new Date).getTime()-d),c===l?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(h,this.options.chunkDelay)},this);h()}else for(var p=this._needsClustering;c<l;c++)(n=e[c])instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(n,e),l=e.length):n.getLatLng?this.hasLayer(n)||p.push(n):r.addLayer(n);return this},removeLayers:function(e){var t,n,i=e.length,r=this._featureGroup,o=this._nonPointGroup,s=!0;if(!this._map){for(t=0;t<i;t++)(n=e[t])instanceof L.LayerGroup?(s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(n,e),i=e.length):(this._arraySplice(this._needsClustering,n),o.removeLayer(n),this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),l=i;for(t=0;t<l;t++)(n=a[t])instanceof L.LayerGroup?(this._extractNonGroupLayers(n,a),l=a.length):this._unspiderfyLayer(n)}for(t=0;t<i;t++)(n=e[t])instanceof L.LayerGroup?(s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(n,e),i=e.length):n.__parent?(this._removeLayer(n,!0,!0),this.fire("layerremove",{layer:n}),r.hasLayer(n)&&(r.removeLayer(n),n.clusterShow&&n.clusterShow())):(o.removeLayer(n),this.fire("layerremove",{layer:n}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var n,i,r,o=this._needsClustering.slice(),s=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(o),i=o.length-1;i>=0;i--){for(n=!0,r=s.length-1;r>=0;r--)if(s[r].layer===o[i]){n=!1;break}n&&e.call(t,o[i])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(n){L.stamp(n)===e&&(t=n)}),t},hasLayer:function(e){if(!e)return!1;var t,n=this._needsClustering;for(t=n.length-1;t>=0;t--)if(n[t]===e)return!0;for(t=(n=this._needsRemoving).length-1;t>=0;t--)if(n[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var n=this._map;"function"!==typeof t&&(t=function(){});var i=function(){!n.hasLayer(e)&&!n.hasLayer(e.__parent)||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),n.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",i,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",i,this),this.on("animationend",i,this),e.__parent.zoomToBounds())},onAdd:function(e){var t,n,i;if(this._map=e,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,n=this._needsRemoving.length;t<n;t++)(i=this._needsRemoving[t]).newlatlng=i.layer._latlng,i.layer._latlng=i.latlng;for(t=0,n=this._needsRemoving.length;t<n;t++)i=this._needsRemoving[t],this._removeLayer(i.layer,!0),i.layer._latlng=i.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),n=this._needsClustering,this._needsClustering=[],this.addLayers(n,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var n=e.length-1;n>=0;n--)if(e[n]===t)return e.splice(n,1),!0},_removeFromGridUnclustered:function(e,t){for(var n=this._map,i=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&i[t].removeObject(e,n.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,n){e._latlng=t,this.removeLayer(e),e._latlng=n,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,n){var i=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var l,c=e.__parent,u=c._markers;for(this._arraySplice(u,e);c&&(c._childCount--,c._boundsNeedUpdate=!0,!(c._zoom<a));)t&&c._childCount<=1?(l=c._markers[0]===e?c._markers[1]:c._markers[0],i[c._zoom].removeObject(c,s.project(c._cLatLng,c._zoom)),r[c._zoom].addObject(l,s.project(l.getLatLng(),c._zoom)),this._arraySplice(c.__parent._childClusters,c),c.__parent._markers.push(l),l.__parent=c.__parent,c._icon&&(o.removeLayer(c),n||o.addLayer(l))):c._iconNeedsUpdate=!0,c=c.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,n){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,n)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),n=" marker-cluster-";return n+=t<10?"small":t<100?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+n,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,n=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(t||i||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),n&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,n=t;if("clusterkeypress"!==e.type||!e.originalEvent||13===e.originalEvent.keyCode){for(;1===n._childClusters.length;)n=n._childClusters[0];n._zoom===this._maxZoom&&n._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,i=this.options.spiderfyOnEveryZoom,r=this._map;(e||n||i)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),n=this.options.maxClusterRadius,i=n;"function"!==typeof n&&(i=function(){return n}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(i(r)),this._gridUnclustered[r]=new L.DistanceGrid(i(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var n,i,r=this._gridClusters,o=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=s;t--){n=this._map.project(e.getLatLng(),t);var a=r[t].getNearObject(n);if(a)return a._addChild(e),void(e.__parent=a);if(a=o[t].getNearObject(n)){var l=a.__parent;l&&this._removeLayer(a,!1);var c=new this._markerCluster(this,t,a,e);r[t].addObject(c,this._map.project(c._cLatLng,t)),a.__parent=c,e.__parent=c;var u=c;for(i=t-1;i>l._zoom;i--)u=new this._markerCluster(this,i,u),r[i].addObject(u,this._map.project(a.getLatLng(),i));return l._addChild(u),void this._removeFromGridUnclustered(a,t)}o[t].addObject(e,n)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var n=t.getAllChildMarkers();this._featureGroup.removeLayer(n[0]),this._featureGroup.removeLayer(n[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var n,i=e.getLayers(),r=0;for(t=t||[];r<i.length;r++)(n=i[r])instanceof L.LayerGroup?this._extractNonGroupLayers(n,t):t.push(n);return t},_overrideMarkerIcon:function(e){return e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var n,i=this._getExpandedVisibleBounds(),r=this._featureGroup,o=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(i,e,o,function(o){var s,a=o._latlng,l=o._markers;for(i.contains(a)||(a=null),o._isSingleParent()&&e+1===t?(r.removeLayer(o),o._recursivelyAddChildrenToMap(null,t,i)):(o.clusterHide(),o._recursivelyAddChildrenToMap(a,t,i)),n=l.length-1;n>=0;n--)s=l[n],i.contains(s._latlng)||r.removeLayer(s)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,t),r.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(i,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,e,o,function(e){r.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var n=this,i=this._featureGroup;i.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){i.removeLayer(e),e.clusterShow(),n._animationEnd()})):(this._forceLayout(),n._animationStart(),n._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,n){var i=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(i,r,t+1,n);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(i,n),this._enqueue(function(){if(1===e._childCount){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(i,n,r,function(e){e._recursivelyRemoveChildrenFromMap(i,r,t+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var n=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,n,i){L.Marker.prototype.initialize.call(this,n?n._cLatLng||n.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,n&&this._addChild(n),i&&this._addChild(i)},getAllChildMarkers:function(e,t){e=e||[];for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n].getAllChildMarkers(e,t);for(var i=this._markers.length-1;i>=0;i--)t&&this._markers[i].__dragStart||e.push(this._markers[i]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,n=this._childClusters.slice(),i=this._group._map,r=i.getBoundsZoom(this._bounds),o=this._zoom+1,s=i.getZoom();n.length>0&&r>o;){o++;var a=[];for(t=0;t<n.length;t++)a=a.concat(n[t]._childClusters);n=a}r>o?this._group._map.setView(this._latlng,o):r<=s?this._group._map.setView(this._latlng,s+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,n,i,r=this._markers,o=this._childClusters,s=0,a=0,l=this._childCount;if(0!==l){for(this._resetBounds(),e=0;e<r.length;e++)n=r[e]._latlng,this._bounds.extend(n),s+=n.lat,a+=n.lng;for(e=0;e<o.length;e++)(t=o[e])._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),n=t._wLatLng,i=t._childCount,s+=n.lat*i,a+=n.lng*i;this._latlng=this._wLatLng=new L.LatLng(s/l,a/l),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,n){this._recursively(e,this._group._map.getMinZoom(),n-1,function(e){var n,i,r=e._markers;for(n=r.length-1;n>=0;n--)(i=r[n])._icon&&(i._setPos(t),i.clusterHide())},function(e){var n,i,r=e._childClusters;for(n=r.length-1;n>=0;n--)(i=r[n])._icon&&(i._setPos(t),i.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,n,i){this._recursively(e,i,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),n),r._isSingleParent()&&n-1===i?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,n)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,n){this._recursively(n,this._group._map.getMinZoom()-1,t,function(i){if(t!==i._zoom)for(var r=i._markers.length-1;r>=0;r--){var o=i._markers[r];n.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),i._group._featureGroup.addLayer(o))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var n=this._markers[t];n._backupLatlng&&(n.setLatLng(n._backupLatlng),delete n._backupLatlng)}if(e-1===this._zoom)for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,n,i){var r,o;this._recursively(e,t-1,n-1,function(e){for(o=e._markers.length-1;o>=0;o--)r=e._markers[o],i&&i.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(e){for(o=e._childClusters.length-1;o>=0;o--)r=e._childClusters[o],i&&i.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,n,i,r){var o,s,a=this._childClusters,l=this._zoom;if(t<=l&&(i&&i(this),r&&l===n&&r(this)),l<t||l<n)for(o=a.length-1;o>=0;o--)(s=a[o])._boundsNeedUpdate&&s._recalculateBounds(),e.intersects(s._bounds)&&s._recursively(e,t,n,i,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var n=this._getCoord(t.x),i=this._getCoord(t.y),r=this._grid,o=r[i]=r[i]||{},s=o[n]=o[n]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,s.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var n,i,r=this._getCoord(t.x),o=this._getCoord(t.y),s=this._grid,a=s[o]=s[o]||{},l=a[r]=a[r]||[];for(delete this._objectPoint[L.Util.stamp(e)],n=0,i=l.length;n<i;n++)if(l[n]===e)return l.splice(n,1),1===i&&delete a[r],!0},eachObject:function(e,t){var n,i,r,o,s,a,l=this._grid;for(n in l)for(i in s=l[n])for(r=0,o=(a=s[i]).length;r<o;r++)e.call(t,a[r])&&(r--,o--)},getNearObject:function(e){var t,n,i,r,o,s,a,l,c=this._getCoord(e.x),u=this._getCoord(e.y),d=this._objectPoint,h=this._sqCellSize,p=null;for(t=u-1;t<=u+1;t++)if(r=this._grid[t])for(n=c-1;n<=c+1;n++)if(o=r[n])for(i=0,s=o.length;i<s;i++)a=o[i],((l=this._sqDist(d[L.Util.stamp(a)],e))<h||l<=h&&null===p)&&(h=l,p=a);return p},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}},L.QuickHull={getDistant:function(e,t){var n=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+n*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var n,i,r,o=0,s=null,a=[];for(n=t.length-1;n>=0;n--)i=t[n],(r=this.getDistant(i,e))>0&&(a.push(i),r>o&&(o=r,s=i));return{maxPoint:s,newPoints:a}},buildConvexHull:function(e,t){var n=[],i=this.findMostDistantPointFromBaseLine(e,t);return i.maxPoint?n=(n=n.concat(this.buildConvexHull([e[0],i.maxPoint],i.newPoints))).concat(this.buildConvexHull([i.maxPoint,e[1]],i.newPoints)):[e[0]]},getConvexHull:function(e){var t,n=!1,i=!1,r=!1,o=!1,s=null,a=null,l=null,c=null,u=null,d=null;for(t=e.length-1;t>=0;t--){var h=e[t];(!1===n||h.lat>n)&&(s=h,n=h.lat),(!1===i||h.lat<i)&&(a=h,i=h.lat),(!1===r||h.lng>r)&&(l=h,r=h.lng),(!1===o||h.lng<o)&&(c=h,o=h.lng)}return i!==n?(d=a,u=s):(d=c,u=l),[].concat(this.buildConvexHull([d,u],e),this.buildConvexHull([u,d],e))}},L.MarkerCluster.include({getConvexHull:function(){var e,t,n=this.getAllChildMarkers(),i=[];for(t=n.length-1;t>=0;t--)e=n[t].getLatLng(),i.push(e);return L.QuickHull.getConvexHull(i)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),n=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?e=this._group.options.spiderfyShapePositions(t.length,n):t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,n):(n.y+=10,e=this._generatePointsCircle(t.length,n)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var n,i,r=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,o=this._2PI/e,s=[];for(r=Math.max(r,35),s.length=e,n=0;n<e;n++)i=this._circleStartAngle+n*o,s[n]=new L.Point(t.x+r*Math.cos(i),t.y+r*Math.sin(i))._round();return s},_generatePointsSpiral:function(e,t){var n,i=this._group.options.spiderfyDistanceMultiplier,r=i*this._spiralLengthStart,o=i*this._spiralFootSeparation,s=i*this._spiralLengthFactor*this._2PI,a=0,l=[];for(l.length=e,n=e;n>=0;n--)n<e&&(l[n]=new L.Point(t.x+r*Math.cos(a),t.y+r*Math.sin(a))._round()),r+=s/(a+=o/r+5e-4*n);return l},_noanimationUnspiderfy:function(){var e,t,n=this._group,i=n._map,r=n._featureGroup,o=this.getAllChildMarkers(null,!0);for(n._ignoreMove=!0,this.setOpacity(1),t=o.length-1;t>=0;t--)e=o[t],r.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(i.removeLayer(e._spiderLeg),delete e._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:o}),n._ignoreMove=!1,n._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var n,i,r,o,s=this._group,a=s._map,l=s._featureGroup,c=this._group.options.spiderLegPolylineOptions;for(s._ignoreMove=!0,n=0;n<e.length;n++)o=a.layerPointToLatLng(t[n]),i=e[n],r=new L.Polyline([this._latlng,o],c),a.addLayer(r),i._spiderLeg=r,i._preSpiderfyLatlng=i._latlng,i.setLatLng(o),i.setZIndexOffset&&i.setZIndexOffset(1e6),l.addLayer(i);this.setOpacity(.3),s._ignoreMove=!1,s.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var n,i,r,o,s,a,l=this,c=this._group,u=c._map,d=c._featureGroup,h=this._latlng,p=u.latLngToLayerPoint(h),f=L.Path.SVG,m=L.extend({},this._group.options.spiderLegPolylineOptions),g=m.opacity;for(void 0===g&&(g=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),f?(m.opacity=0,m.className=(m.className||"")+" leaflet-cluster-spider-leg"):m.opacity=g,c._ignoreMove=!0,n=0;n<e.length;n++)i=e[n],a=u.layerPointToLatLng(t[n]),r=new L.Polyline([h,a],m),u.addLayer(r),i._spiderLeg=r,f&&(s=(o=r._path).getTotalLength()+.1,o.style.strokeDasharray=s,o.style.strokeDashoffset=s),i.setZIndexOffset&&i.setZIndexOffset(1e6),i.clusterHide&&i.clusterHide(),d.addLayer(i),i._setPos&&i._setPos(p);for(c._forceLayout(),c._animationStart(),n=e.length-1;n>=0;n--)a=u.layerPointToLatLng(t[n]),(i=e[n])._preSpiderfyLatlng=i._latlng,i.setLatLng(a),i.clusterShow&&i.clusterShow(),f&&((o=(r=i._spiderLeg)._path).style.strokeDashoffset=0,r.setStyle({opacity:g}));this.setOpacity(.3),c._ignoreMove=!1,setTimeout(function(){c._animationEnd(),c.fire("spiderfied",{cluster:l,markers:e})},200)},_animationUnspiderfy:function(e){var t,n,i,r,o,s,a=this,l=this._group,c=l._map,u=l._featureGroup,d=e?c._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):c.latLngToLayerPoint(this._latlng),h=this.getAllChildMarkers(null,!0),p=L.Path.SVG;for(l._ignoreMove=!0,l._animationStart(),this.setOpacity(1),n=h.length-1;n>=0;n--)(t=h[n])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,s=!0,t._setPos&&(t._setPos(d),s=!1),t.clusterHide&&(t.clusterHide(),s=!1),s&&u.removeLayer(t),p&&(o=(r=(i=t._spiderLeg)._path).getTotalLength()+.1,r.style.strokeDashoffset=o,i.setStyle({opacity:0})));l._ignoreMove=!1,setTimeout(function(){var e=0;for(n=h.length-1;n>=0;n--)(t=h[n])._spiderLeg&&e++;for(n=h.length-1;n>=0;n--)(t=h[n])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),c.removeLayer(t._spiderLeg),delete t._spiderLeg);l._animationEnd(),l.fire("unspiderfied",{cluster:a,markers:h})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,n;for(t in e)for(n=e[t].__parent;n;)n._iconNeedsUpdate=!0,n=n.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,n;for(t in e)n=e[t],this.hasLayer(n)&&n.setIcon(this._overrideMarkerIcon(n))}}),L.Marker.include({refreshIconOptions:function(e,t){var n=this.options.icon;return L.setOptions(n,e),this.setIcon(n),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=n,Object.defineProperty(e,"__esModule",{value:!0})}(t)},228(e,t){!function(e){"use strict";var t="1.9.4";function n(e){var t,n,i,r;for(n=1,i=arguments.length;n<i;n++)for(t in r=arguments[n])e[t]=r[t];return e}var i=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}();function r(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var i=n.call(arguments,2);return function(){return e.apply(t,i.length?i.concat(n.call(arguments)):arguments)}}var o=0;function s(e){return"_leaflet_id"in e||(e._leaflet_id=++o),e._leaflet_id}function a(e,t,n){var i,r,o,s;return s=function(){i=!1,r&&(o.apply(n,r),r=!1)},o=function(){i?r=arguments:(e.apply(n,arguments),setTimeout(s,t),i=!0)},o}function l(e,t,n){var i=t[1],r=t[0],o=i-r;return e===i&&n?e:((e-r)%o+o)%o+r}function c(){return!1}function u(e,t){if(!1===t)return e;var n=Math.pow(10,void 0===t?6:t);return Math.round(e*n)/n}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function h(e){return d(e).split(/\s+/)}function p(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?i(e.options):{}),t)e.options[n]=t[n];return e.options}function f(e,t,n){var i=[];for(var r in e)i.push(encodeURIComponent(n?r.toUpperCase():r)+"="+encodeURIComponent(e[r]));return(t&&-1!==t.indexOf("?")?"&":"?")+i.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function g(e,t){return e.replace(m,function(e,n){var i=t[n];if(void 0===i)throw new Error("No value provided for variable "+e);return"function"===typeof i&&(i=i(t)),i})}var v=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function y(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var x=0;function w(e){var t=+new Date,n=Math.max(0,16-(t-x));return x=t+n,window.setTimeout(e,n)}var k=window.requestAnimationFrame||b("RequestAnimationFrame")||w,S=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function C(e,t,n){if(!n||k!==w)return k.call(window,r(e,t));e.call(t)}function E(e){e&&S.call(window,e)}var P={__proto__:null,extend:n,create:i,bind:r,get lastId(){return o},stamp:s,throttle:a,wrapNum:l,falseFn:c,formatNum:u,trim:d,splitWords:h,setOptions:p,getParamString:f,template:g,isArray:v,indexOf:y,emptyImageUrl:_,requestFn:k,cancelFn:S,requestAnimFrame:C,cancelAnimFrame:E};function T(){}function j(e){if("undefined"!==typeof L&&L&&L.Mixin){e=v(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}T.extend=function(e){var t=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},r=t.__super__=this.prototype,o=i(r);for(var s in o.constructor=t,t.prototype=o,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(t[s]=this[s]);return e.statics&&n(t,e.statics),e.includes&&(j(e.includes),n.apply(null,[o].concat(e.includes))),n(o,e),delete o.statics,delete o.includes,o.options&&(o.options=r.options?i(r.options):{},n(o.options,e.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){r.callInitHooks&&r.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=o._initHooks.length;e<t;e++)o._initHooks[e].call(this)}},t},T.include=function(e){var t=this.prototype.options;return n(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},T.mergeOptions=function(e){return n(this.prototype.options,e),this},T.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n="function"===typeof e?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var N={on:function(e,t,n){if("object"===typeof e)for(var i in e)this._on(i,e[i],t);else for(var r=0,o=(e=h(e)).length;r<o;r++)this._on(e[r],t,n);return this},off:function(e,t,n){if(arguments.length)if("object"===typeof e)for(var i in e)this._off(i,e[i],t);else{e=h(e);for(var r=1===arguments.length,o=0,s=e.length;o<s;o++)r?this._off(e[o]):this._off(e[o],t,n)}else delete this._events;return this},_on:function(e,t,n,i){if("function"===typeof t){if(!1===this._listens(e,t,n)){n===this&&(n=void 0);var r={fn:t,ctx:n};i&&(r.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(r)}}else console.warn("wrong listener type: "+typeof t)},_off:function(e,t,n){var i,r,o;if(this._events&&(i=this._events[e]))if(1!==arguments.length)if("function"===typeof t){var s=this._listens(e,t,n);if(!1!==s){var a=i[s];this._firingCount&&(a.fn=c,this._events[e]=i=i.slice()),i.splice(s,1)}}else console.warn("wrong listener type: "+typeof t);else{if(this._firingCount)for(r=0,o=i.length;r<o;r++)i[r].fn=c;delete this._events[e]}},fire:function(e,t,i){if(!this.listens(e,i))return this;var r=n({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var o=this._events[e];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,a=o.length;s<a;s++){var l=o[s],c=l.fn;l.once&&this.off(e,c,l.ctx),c.call(l.ctx||this,r)}this._firingCount--}}return i&&this._propagateEvent(r),this},listens:function(e,t,n,i){"string"!==typeof e&&console.warn('"string" type argument expected');var r=t;"function"!==typeof t&&(i=!!t,r=void 0,n=void 0);var o=this._events&&this._events[e];if(o&&o.length&&!1!==this._listens(e,r,n))return!0;if(i)for(var s in this._eventParents)if(this._eventParents[s].listens(e,t,n,i))return!0;return!1},_listens:function(e,t,n){if(!this._events)return!1;var i=this._events[e]||[];if(!t)return!!i.length;n===this&&(n=void 0);for(var r=0,o=i.length;r<o;r++)if(i[r].fn===t&&i[r].ctx===n)return r;return!1},once:function(e,t,n){if("object"===typeof e)for(var i in e)this._on(i,e[i],t,!0);else for(var r=0,o=(e=h(e)).length;r<o;r++)this._on(e[r],t,n,!0);return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[s(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[s(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,n({layer:e.target,propagatedFrom:e.target},e),!0)}};N.addEventListener=N.on,N.removeEventListener=N.clearAllEventListeners=N.off,N.addOneTimeEventListener=N.once,N.fireEvent=N.fire,N.hasEventListeners=N.listens;var O=T.extend(N);function M(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var A=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};function R(e,t,n){return e instanceof M?e:v(e)?new M(e[0],e[1]):void 0===e||null===e?e:"object"===typeof e&&"x"in e&&"y"in e?new M(e.x,e.y):new M(e,t,n)}function I(e,t){if(e)for(var n=t?[e,t]:e,i=0,r=n.length;i<r;i++)this.extend(n[i])}function z(e,t){return!e||e instanceof I?e:new I(e,t)}function B(e,t){if(e)for(var n=t?[e,t]:e,i=0,r=n.length;i<r;i++)this.extend(n[i])}function D(e,t){return e instanceof B?e:new B(e,t)}function F(e,t,n){if(isNaN(e)||isNaN(t))throw new Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=+e,this.lng=+t,void 0!==n&&(this.alt=+n)}function U(e,t,n){return e instanceof F?e:v(e)&&"object"!==typeof e[0]?3===e.length?new F(e[0],e[1],e[2]):2===e.length?new F(e[0],e[1]):null:void 0===e||null===e?e:"object"===typeof e&&"lat"in e?new F(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new F(e,t,n)}M.prototype={clone:function(){return new M(this.x,this.y)},add:function(e){return this.clone()._add(R(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(R(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new M(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new M(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=A(this.x),this.y=A(this.y),this},distanceTo:function(e){var t=(e=R(e)).x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return(e=R(e)).x===this.x&&e.y===this.y},contains:function(e){return e=R(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},I.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof M||"number"===typeof e[0]||"x"in e)t=n=R(e);else if(t=(e=z(e)).min,n=e.max,!t||!n)return this;return this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=t.clone(),this.max=n.clone()),this},getCenter:function(e){return R((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return R(this.min.x,this.max.y)},getTopRight:function(){return R(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return(e="number"===typeof e[0]||e instanceof M?R(e):z(e))instanceof I?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=z(e);var t=this.min,n=this.max,i=e.min,r=e.max,o=r.x>=t.x&&i.x<=n.x,s=r.y>=t.y&&i.y<=n.y;return o&&s},overlaps:function(e){e=z(e);var t=this.min,n=this.max,i=e.min,r=e.max,o=r.x>t.x&&i.x<n.x,s=r.y>t.y&&i.y<n.y;return o&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(e){var t=this.min,n=this.max,i=Math.abs(t.x-n.x)*e,r=Math.abs(t.y-n.y)*e;return z(R(t.x-i,t.y-r),R(n.x+i,n.y+r))},equals:function(e){return!!e&&(e=z(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight()))}},B.prototype={extend:function(e){var t,n,i=this._southWest,r=this._northEast;if(e instanceof F)t=e,n=e;else{if(!(e instanceof B))return e?this.extend(U(e)||D(e)):this;if(t=e._southWest,n=e._northEast,!t||!n)return this}return i||r?(i.lat=Math.min(t.lat,i.lat),i.lng=Math.min(t.lng,i.lng),r.lat=Math.max(n.lat,r.lat),r.lng=Math.max(n.lng,r.lng)):(this._southWest=new F(t.lat,t.lng),this._northEast=new F(n.lat,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,i=Math.abs(t.lat-n.lat)*e,r=Math.abs(t.lng-n.lng)*e;return new B(new F(t.lat-i,t.lng-r),new F(n.lat+i,n.lng+r))},getCenter:function(){return new F((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new F(this.getNorth(),this.getWest())},getSouthEast:function(){return new F(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"===typeof e[0]||e instanceof F||"lat"in e?U(e):D(e);var t,n,i=this._southWest,r=this._northEast;return e instanceof B?(t=e.getSouthWest(),n=e.getNorthEast()):t=n=e,t.lat>=i.lat&&n.lat<=r.lat&&t.lng>=i.lng&&n.lng<=r.lng},intersects:function(e){e=D(e);var t=this._southWest,n=this._northEast,i=e.getSouthWest(),r=e.getNorthEast(),o=r.lat>=t.lat&&i.lat<=n.lat,s=r.lng>=t.lng&&i.lng<=n.lng;return o&&s},overlaps:function(e){e=D(e);var t=this._southWest,n=this._northEast,i=e.getSouthWest(),r=e.getNorthEast(),o=r.lat>t.lat&&i.lat<n.lat,s=r.lng>t.lng&&i.lng<n.lng;return o&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,t){return!!e&&(e=D(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t))},isValid:function(){return!(!this._southWest||!this._northEast)}},F.prototype={equals:function(e,t){return!!e&&(e=U(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(void 0===t?1e-9:t))},toString:function(e){return"LatLng("+u(this.lat,e)+", "+u(this.lng,e)+")"},distanceTo:function(e){return V.distance(this,U(e))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return D([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new F(this.lat,this.lng,this.alt)}};var q={latLngToPoint:function(e,t){var n=this.projection.project(e),i=this.scale(t);return this.transformation._transform(n,i)},pointToLatLng:function(e,t){var n=this.scale(t),i=this.transformation.untransform(e,n);return this.projection.unproject(i)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new I(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?l(e.lng,this.wrapLng,!0):e.lng;return new F(this.wrapLat?l(e.lat,this.wrapLat,!0):e.lat,t,e.alt)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),i=t.lat-n.lat,r=t.lng-n.lng;if(0===i&&0===r)return e;var o=e.getSouthWest(),s=e.getNorthEast();return new B(new F(o.lat-i,o.lng-r),new F(s.lat-i,s.lng-r))}},V=n({},q,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,i=e.lat*n,r=t.lat*n,o=Math.sin((t.lat-e.lat)*n/2),s=Math.sin((t.lng-e.lng)*n/2),a=o*o+Math.cos(i)*Math.cos(r)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),W=6378137,H={R:W,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,i=Math.max(Math.min(n,e.lat),-n),r=Math.sin(i*t);return new M(this.R*e.lng*t,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(e){var t=180/Math.PI;return new F((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:function(){var e=W*Math.PI;return new I([-e,-e],[e,e])}()};function Z(e,t,n,i){if(v(e))return this._a=e[0],this._b=e[1],this._c=e[2],void(this._d=e[3]);this._a=e,this._b=t,this._c=n,this._d=i}function G(e,t,n,i){return new Z(e,t,n,i)}Z.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new M((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};var Q=n({},V,{code:"EPSG:3857",projection:H,transformation:function(){var e=.5/(Math.PI*H.R);return G(e,.5,-e,.5)}()}),Y=n({},Q,{code:"EPSG:900913"});function K(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function $(e,t){var n,i,r,o,s,a,l="";for(n=0,r=e.length;n<r;n++){for(i=0,o=(s=e[n]).length;i<o;i++)l+=(i?"L":"M")+(a=s[i]).x+" "+a.y;l+=t?Ie.svg?"z":"x":""}return l||"M0 0"}var X=document.documentElement.style,J="ActiveXObject"in window,ee=J&&!document.addEventListener,te="msLaunchUri"in navigator&&!("documentMode"in document),ne=Re("webkit"),ie=Re("android"),re=Re("android 2")||Re("android 3"),oe=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),se=ie&&Re("Google")&&oe<537&&!("AudioNode"in window),ae=!!window.opera,le=!te&&Re("chrome"),ce=Re("gecko")&&!ne&&!ae&&!J,ue=!le&&Re("safari"),de=Re("phantom"),he="OTransition"in X,pe=0===navigator.platform.indexOf("Win"),fe=J&&"transition"in X,me="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!re,ge="MozPerspective"in X,ve=!window.L_DISABLE_3D&&(fe||me||ge)&&!he&&!de,ye="undefined"!==typeof orientation||Re("mobile"),_e=ye&&ne,be=ye&&me,xe=!window.PointerEvent&&window.MSPointerEvent,we=!(!window.PointerEvent&&!xe),ke="ontouchstart"in window||!!window.TouchEvent,Se=!window.L_NO_TOUCH&&(ke||we),Ce=ye&&ae,Le=ye&&ce,Ee=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Pe=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",c,t),window.removeEventListener("testPassiveEventSupport",c,t)}catch(n){}return e}(),Te=!!document.createElement("canvas").getContext,je=!(!document.createElementNS||!K("svg").createSVGRect),Ne=!!je&&function(){var e=document.createElement("div");return e.innerHTML="<svg/>","http://www.w3.org/2000/svg"===(e.firstChild&&e.firstChild.namespaceURI)}(),Oe=!je&&function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"===typeof t.adj}catch(n){return!1}}(),Me=0===navigator.platform.indexOf("Mac"),Ae=0===navigator.platform.indexOf("Linux");function Re(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Ie={ie:J,ielt9:ee,edge:te,webkit:ne,android:ie,android23:re,androidStock:se,opera:ae,chrome:le,gecko:ce,safari:ue,phantom:de,opera12:he,win:pe,ie3d:fe,webkit3d:me,gecko3d:ge,any3d:ve,mobile:ye,mobileWebkit:_e,mobileWebkit3d:be,msPointer:xe,pointer:we,touch:Se,touchNative:ke,mobileOpera:Ce,mobileGecko:Le,retina:Ee,passiveEvents:Pe,canvas:Te,svg:je,vml:Oe,inlineSvg:Ne,mac:Me,linux:Ae},ze=Ie.msPointer?"MSPointerDown":"pointerdown",Be=Ie.msPointer?"MSPointerMove":"pointermove",De=Ie.msPointer?"MSPointerUp":"pointerup",Fe=Ie.msPointer?"MSPointerCancel":"pointercancel",Ue={touchstart:ze,touchmove:Be,touchend:De,touchcancel:Fe},qe={touchstart:Xe,touchmove:$e,touchend:$e,touchcancel:$e},Ve={},We=!1;function He(e,t,n){return"touchstart"===t&&Ke(),qe[t]?(n=qe[t].bind(this,n),e.addEventListener(Ue[t],n,!1),n):(console.warn("wrong event specified:",t),c)}function Ze(e,t,n){Ue[t]?e.removeEventListener(Ue[t],n,!1):console.warn("wrong event specified:",t)}function Ge(e){Ve[e.pointerId]=e}function Qe(e){Ve[e.pointerId]&&(Ve[e.pointerId]=e)}function Ye(e){delete Ve[e.pointerId]}function Ke(){We||(document.addEventListener(ze,Ge,!0),document.addEventListener(Be,Qe,!0),document.addEventListener(De,Ye,!0),document.addEventListener(Fe,Ye,!0),We=!0)}function $e(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in t.touches=[],Ve)t.touches.push(Ve[n]);t.changedTouches=[t],e(t)}}function Xe(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Gt(t),$e(e,t)}function Je(e){var t,n,i={};for(n in e)t=e[n],i[n]=t&&t.bind?t.bind(e):t;return e=i,i.type="dblclick",i.detail=2,i.isTrusted=!1,i._simulated=!0,i}var et=200;function tt(e,t){e.addEventListener("dblclick",t);var n,i=0;function r(e){if(1===e.detail){if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var r=Yt(e);if(!r.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})||r.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement})){var o=Date.now();o-i<=et?2===++n&&t(Je(e)):n=1,i=o}}}else n=e.detail}return e.addEventListener("click",r),{dblclick:t,simDblclick:r}}function nt(e,t){e.removeEventListener("dblclick",t.dblclick),e.removeEventListener("click",t.simDblclick)}var it,rt,ot,st,at,lt=Ct(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ct=Ct(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ut="webkitTransition"===ct||"OTransition"===ct?ct+"End":"transitionend";function dt(e){return"string"===typeof e?document.getElementById(e):e}function ht(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(e,null);n=i?i[t]:null}return"auto"===n?null:n}function pt(e,t,n){var i=document.createElement(e);return i.className=t||"",n&&n.appendChild(i),i}function ft(e){var t=e.parentNode;t&&t.removeChild(e)}function mt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function gt(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function vt(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function yt(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=wt(e);return n.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function _t(e,t){if(void 0!==e.classList)for(var n=h(t),i=0,r=n.length;i<r;i++)e.classList.add(n[i]);else if(!yt(e,t)){var o=wt(e);xt(e,(o?o+" ":"")+t)}}function bt(e,t){void 0!==e.classList?e.classList.remove(t):xt(e,d((" "+wt(e)+" ").replace(" "+t+" "," ")))}function xt(e,t){void 0===e.className.baseVal?e.className=t:e.className.baseVal=t}function wt(e){return e.correspondingElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function kt(e,t){"opacity"in e.style?e.style.opacity=t:"filter"in e.style&&St(e,t)}function St(e,t){var n=!1,i="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(i)}catch(r){if(1===t)return}t=Math.round(100*t),n?(n.Enabled=100!==t,n.Opacity=t):e.style.filter+=" progid:"+i+"(opacity="+t+")"}function Ct(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function Lt(e,t,n){var i=t||new M(0,0);e.style[lt]=(Ie.ie3d?"translate("+i.x+"px,"+i.y+"px)":"translate3d("+i.x+"px,"+i.y+"px,0)")+(n?" scale("+n+")":"")}function Et(e,t){e._leaflet_pos=t,Ie.any3d?Lt(e,t):(e.style.left=t.x+"px",e.style.top=t.y+"px")}function Pt(e){return e._leaflet_pos||new M(0,0)}if("onselectstart"in document)it=function(){zt(window,"selectstart",Gt)},rt=function(){Dt(window,"selectstart",Gt)};else{var Tt=Ct(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);it=function(){if(Tt){var e=document.documentElement.style;ot=e[Tt],e[Tt]="none"}},rt=function(){Tt&&(document.documentElement.style[Tt]=ot,ot=void 0)}}function jt(){zt(window,"dragstart",Gt)}function Nt(){Dt(window,"dragstart",Gt)}function Ot(e){for(;-1===e.tabIndex;)e=e.parentNode;e.style&&(Mt(),st=e,at=e.style.outlineStyle,e.style.outlineStyle="none",zt(window,"keydown",Mt))}function Mt(){st&&(st.style.outlineStyle=at,st=void 0,at=void 0,Dt(window,"keydown",Mt))}function At(e){do{e=e.parentNode}while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body);return e}function Rt(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var It={__proto__:null,TRANSFORM:lt,TRANSITION:ct,TRANSITION_END:ut,get:dt,getStyle:ht,create:pt,remove:ft,empty:mt,toFront:gt,toBack:vt,hasClass:yt,addClass:_t,removeClass:bt,setClass:xt,getClass:wt,setOpacity:kt,testProp:Ct,setTransform:Lt,setPosition:Et,getPosition:Pt,get disableTextSelection(){return it},get enableTextSelection(){return rt},disableImageDrag:jt,enableImageDrag:Nt,preventOutline:Ot,restoreOutline:Mt,getSizedParentNode:At,getScale:Rt};function zt(e,t,n,i){if(t&&"object"===typeof t)for(var r in t)qt(e,r,t[r],n);else for(var o=0,s=(t=h(t)).length;o<s;o++)qt(e,t[o],n,i);return this}var Bt="_leaflet_events";function Dt(e,t,n,i){if(1===arguments.length)Ft(e),delete e[Bt];else if(t&&"object"===typeof t)for(var r in t)Vt(e,r,t[r],n);else if(t=h(t),2===arguments.length)Ft(e,function(e){return-1!==y(t,e)});else for(var o=0,s=t.length;o<s;o++)Vt(e,t[o],n,i);return this}function Ft(e,t){for(var n in e[Bt]){var i=n.split(/\d/)[0];t&&!t(i)||Vt(e,i,null,null,n)}}var Ut={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function qt(e,t,n,i){var r=t+s(n)+(i?"_"+s(i):"");if(e[Bt]&&e[Bt][r])return this;var o=function(t){return n.call(i||e,t||window.event)},a=o;!Ie.touchNative&&Ie.pointer&&0===t.indexOf("touch")?o=He(e,t,o):Ie.touch&&"dblclick"===t?o=tt(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ut[t]||t,o,!!Ie.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(o=function(t){t=t||window.event,Jt(e,t)&&a(t)},e.addEventListener(Ut[t],o,!1)):e.addEventListener(t,a,!1):e.attachEvent("on"+t,o),e[Bt]=e[Bt]||{},e[Bt][r]=o}function Vt(e,t,n,i,r){r=r||t+s(n)+(i?"_"+s(i):"");var o=e[Bt]&&e[Bt][r];if(!o)return this;!Ie.touchNative&&Ie.pointer&&0===t.indexOf("touch")?Ze(e,t,o):Ie.touch&&"dblclick"===t?nt(e,o):"removeEventListener"in e?e.removeEventListener(Ut[t]||t,o,!1):e.detachEvent("on"+t,o),e[Bt][r]=null}function Wt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function Ht(e){return qt(e,"wheel",Wt),this}function Zt(e){return zt(e,"mousedown touchstart dblclick contextmenu",Wt),e._leaflet_disable_click=!0,this}function Gt(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function Qt(e){return Gt(e),Wt(e),this}function Yt(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function Kt(e,t){if(!t)return new M(e.clientX,e.clientY);var n=Rt(t),i=n.boundingClientRect;return new M((e.clientX-i.left)/n.x-t.clientLeft,(e.clientY-i.top)/n.y-t.clientTop)}var $t=Ie.linux&&Ie.chrome?window.devicePixelRatio:Ie.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Xt(e){return Ie.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/$t:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}function Jt(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(i){return!1}return n!==e}var en={__proto__:null,on:zt,off:Dt,stopPropagation:Wt,disableScrollPropagation:Ht,disableClickPropagation:Zt,preventDefault:Gt,stop:Qt,getPropagationPath:Yt,getMousePosition:Kt,getWheelDelta:Xt,isExternalTarget:Jt,addListener:zt,removeListener:Dt},tn=O.extend({run:function(e,t,n,i){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Pt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=1e3*this._duration;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),Et(this._el,n),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),nn=O.extend({options:{crs:Q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=p(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom)),t.center&&void 0!==t.zoom&&this.setView(U(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ct&&Ie.any3d&&!Ie.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),zt(this._proxy,ut,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,i){return t=void 0===t?this._zoom:this._limitZoom(t),e=this._limitCenter(U(e),t,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,i.zoom):this._tryAnimatedPan(e,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,i.pan&&i.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e=e||(Ie.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e=e||(Ie.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var i=this.getZoomScale(t),r=this.getSize().divideBy(2),o=(e instanceof M?e:this.latLngToContainerPoint(e)).subtract(r).multiplyBy(1-1/i),s=this.containerPointToLatLng(r.add(o));return this.setView(s,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t=t||{},e=e.getBounds?e.getBounds():D(e);var n=R(t.paddingTopLeft||t.padding||[0,0]),i=R(t.paddingBottomRight||t.padding||[0,0]),r=this.getBoundsZoom(e,!1,n.add(i));if((r="number"===typeof t.maxZoom?Math.min(t.maxZoom,r):r)===1/0)return{center:e.getCenter(),zoom:r};var o=i.subtract(n).divideBy(2),s=this.project(e.getSouthWest(),r),a=this.project(e.getNorthEast(),r);return{center:this.unproject(s.add(a).divideBy(2).add(o),r),zoom:r}},fitBounds:function(e,t){if(!(e=D(e)).isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(t=t||{},!(e=R(e).round()).x&&!e.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new tn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){_t(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,t,n){if(!1===(n=n||{}).animate||!Ie.any3d)return this.setView(e,t,n);this._stop();var i=this.project(this.getCenter()),r=this.project(e),o=this.getSize(),s=this._zoom;e=U(e),t=void 0===t?s:t;var a=Math.max(o.x,o.y),l=a*this.getZoomScale(s,t),c=r.distanceTo(i)||1,u=1.42,d=u*u;function h(e){var t=(l*l-a*a+(e?-1:1)*d*d*c*c)/(2*(e?l:a)*d*c),n=Math.sqrt(t*t+1)-t;return n<1e-9?-18:Math.log(n)}function p(e){return(Math.exp(e)-Math.exp(-e))/2}function f(e){return(Math.exp(e)+Math.exp(-e))/2}function m(e){return p(e)/f(e)}var g=h(0);function v(e){return a*(f(g)/f(g+u*e))}function y(e){return a*(f(g)*m(g+u*e)-p(g))/d}function _(e){return 1-Math.pow(1-e,1.5)}var b=Date.now(),x=(h(1)-g)/u,w=n.duration?1e3*n.duration:1e3*x*.8;function k(){var n=(Date.now()-b)/w,o=_(n)*x;n<=1?(this._flyToFrame=C(k,this),this._move(this.unproject(i.add(r.subtract(i).multiplyBy(y(o)/c)),s),this.getScaleZoom(a/v(o),s),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),k.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return e=D(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,D(e));return n.equals(i)||this.panTo(i,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=R((t=t||{}).paddingTopLeft||t.padding||[0,0]),i=R(t.paddingBottomRight||t.padding||[0,0]),r=this.project(this.getCenter()),o=this.project(e),s=this.getPixelBounds(),a=z([s.min.add(n),s.max.subtract(i)]),l=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var c=o.subtract(a.getCenter()),u=a.extend(o).getSize().subtract(l);r.x+=c.x<0?-u.x:u.x,r.y+=c.y<0?-u.y:u.y,this.panTo(this.unproject(r),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=n({animate:!1,pan:!0},!0===e?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=t.divideBy(2).round(),s=i.divideBy(2).round(),a=o.subtract(s);return a.x||a.y?(e.animate&&e.pan?this.panBy(a):(e.pan&&this._rawPanBy(a),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:t,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=n({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=r(this._handleGeolocationResponse,this),i=r(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,i,e):navigator.geolocation.getCurrentPosition(t,i,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new F(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),i=this._locateOptions;if(i.setView){var r=this.getBoundsZoom(n);this.setView(t,i.maxZoom?Math.min(r,i.maxZoom):r)}var o={latlng:t,bounds:n,timestamp:e.timestamp};for(var s in e.coords)"number"===typeof e.coords[s]&&(o[s]=e.coords[s]);this.fire("locationfound",o)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ft(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)ft(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=pt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new B(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=D(e),n=R(n||[0,0]);var i=this.getZoom()||0,r=this.getMinZoom(),o=this.getMaxZoom(),s=e.getNorthWest(),a=e.getSouthEast(),l=this.getSize().subtract(n),c=z(this.project(a,i),this.project(s,i)).getSize(),u=Ie.any3d?this.options.zoomSnap:1,d=l.x/c.x,h=l.y/c.y,p=t?Math.max(d,h):Math.min(d,h);return i=this.getScaleZoom(p,i),u&&(i=Math.round(i/(u/100))*(u/100),i=t?Math.ceil(i/u)*u:Math.floor(i/u)*u),Math.max(r,Math.min(o,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new M(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new I(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"===typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var i=n.zoom(e*n.scale(t));return isNaN(i)?1/0:i},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(U(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(R(e),t)},layerPointToLatLng:function(e){var t=R(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(U(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(U(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(D(e))},distance:function(e,t){return this.options.crs.distance(U(e),U(t))},containerPointToLayerPoint:function(e){return R(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return R(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(R(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(U(e)))},mouseEventToContainerPoint:function(e){return Kt(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=dt(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");zt(t,"scroll",this._onScroll,this),this._containerId=s(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ie.any3d,_t(e,"leaflet-container"+(Ie.touch?" leaflet-touch":"")+(Ie.retina?" leaflet-retina":"")+(Ie.ielt9?" leaflet-oldie":"")+(Ie.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=ht(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Et(this._mapPane,new M(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_t(e.markerPane,"leaflet-zoom-hide"),_t(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,n){Et(this._mapPane,new M(0,0));var i=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var r=this._zoom!==t;this._moveStart(r,n)._move(e,t)._moveEnd(r),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n,i){void 0===t&&(t=this._zoom);var r=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),i?n&&n.pinch&&this.fire("zoom",n):((r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Et(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[s(this._container)]=this;var t=e?Dt:zt;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),Ie.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=C(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,i=[],r="mouseout"===t||"mouseover"===t,o=e.target||e.srcElement,a=!1;o;){if((n=this._targets[s(o)])&&("click"===t||"preclick"===t)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(t,!0)){if(r&&!Jt(o,e))break;if(i.push(n),r)break}if(o===this._container)break;o=o.parentNode}return i.length||a||r||!this.listens(t,!0)||(i=[this]),i},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isClickDisabled(t))){var n=e.type;"mousedown"===n&&Ot(t),this._fireDOMEvent(e,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,t,i){if("click"===e.type){var r=n({},e);r.type="preclick",this._fireDOMEvent(r,r.type,i)}var o=this._findEventTargets(e,t);if(i){for(var s=[],a=0;a<i.length;a++)i[a].listens(t,!0)&&s.push(i[a]);o=s.concat(o)}if(o.length){"contextmenu"===t&&Gt(e);var l=o[0],c={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var u=l.getLatLng&&(!l._radius||l._radius<=10);c.containerPoint=u?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(e),c.layerPoint=this.containerPointToLayerPoint(c.containerPoint),c.latlng=u?l.getLatLng():this.layerPointToLatLng(c.layerPoint)}for(a=0;a<o.length;a++)if(o[a].fire(t,c,!0),c.originalEvent._stopped||!1===o[a].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,t))return}},_draggableMoved:function(e){return(e=e.dragging&&e.dragging.enabled()?e:this).dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on("load",e,t),this},_getMapPanePos:function(){return Pt(this._mapPane)||new M(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&void 0!==t?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var i=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(i)},_latLngBoundsToNewLayerBounds:function(e,t,n){var i=this._getNewPixelOrigin(n,t);return z([this.project(e.getSouthWest(),t)._subtract(i),this.project(e.getNorthWest(),t)._subtract(i),this.project(e.getSouthEast(),t)._subtract(i),this.project(e.getNorthEast(),t)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var i=this.project(e,t),r=this.getSize().divideBy(2),o=new I(i.subtract(r),i.add(r)),s=this._getBoundsOffset(o,n,t);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?e:this.unproject(i.add(s),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),i=new I(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(i,t))},_getBoundsOffset:function(e,t,n){var i=z(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),r=i.min.subtract(e.min),o=i.max.subtract(e.max);return new M(this._rebound(r.x,-o.x),this._rebound(r.y,-o.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),i=Ie.any3d?this.options.zoomSnap:1;return i&&(e=Math.round(e/i)*i),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){bt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(n))&&(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=pt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(e){var t=lt,n=this._proxy.style[t];Lt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ft(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Lt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(t),r=this._getCenterOffset(e)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(r))&&(C(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,_t(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:i}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&bt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function rn(e,t){return new nn(e,t)}var on=T.extend({options:{position:"topright"},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),i=e._controlCorners[n];return _t(t,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(t,i.firstChild):i.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ft(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),sn=function(e){return new on(e)};nn.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=pt("div",t+"control-container",this._container);function i(i,r){var o=t+i+" "+t+r;e[i+r]=pt("div",o,n)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)ft(this._controlCorners[e]);ft(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var an=on.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,i){return n<i?-1:i<n?1:0}},initialize:function(e,t,n){for(var i in p(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[i],i);for(i in t)this._addLayer(t[i],i,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return on.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var t=this._getLayer(s(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){_t(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(_t(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):bt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return bt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=pt("div",e),n=this.options.collapsed;t.setAttribute("aria-haspopup",!0),Zt(t),Ht(t);var i=this._section=pt("section",e+"-list");n&&(this._map.on("click",this.collapse,this),zt(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var r=this._layersLink=pt("a",e+"-toggle",t);r.href="#",r.title="Layers",r.setAttribute("role","button"),zt(r,{keydown:function(e){13===e.keyCode&&this._expandSafely()},click:function(e){Gt(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=pt("div",e+"-base",i),this._separator=pt("div",e+"-separator",i),this._overlaysList=pt("div",e+"-overlays",i),t.appendChild(i)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&s(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(r(function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;mt(this._baseLayersList),mt(this._overlaysList),this._layerControlInputs=[];var e,t,n,i,r=0;for(n=0;n<this._layers.length;n++)i=this._layers[n],this._addItem(i),t=t||i.overlay,e=e||!i.overlay,r+=i.overlay?0:1;return this.options.hideSingleBase&&(e=e&&r>1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(s(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(e){var t,n=document.createElement("label"),i=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=i):t=this._createRadioElement("leaflet-base-layers_"+s(this),i),this._layerControlInputs.push(t),t.layerId=s(e.layer),zt(t,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+e.name;var o=document.createElement("span");return n.appendChild(o),o.appendChild(t),o.appendChild(r),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e,t,n=this._layerControlInputs,i=[],r=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)e=n[o],t=this._getLayer(e.layerId).layer,e.checked?i.push(t):e.checked||r.push(t);for(o=0;o<r.length;o++)this._map.hasLayer(r[o])&&this._map.removeLayer(r[o]);for(o=0;o<i.length;o++)this._map.hasLayer(i[o])||this._map.addLayer(i[o]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e,t,n=this._layerControlInputs,i=this._map.getZoom(),r=n.length-1;r>=0;r--)e=n[r],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&i<t.options.minZoom||void 0!==t.options.maxZoom&&i>t.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,zt(e,"click",Gt),this.expand();var t=this;setTimeout(function(){Dt(e,"click",Gt),t._preventClick=!1})}}),ln=function(e,t,n){return new an(e,t,n)},cn=on.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=pt("div",t+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,i,r){var o=pt("a",n,i);return o.innerHTML=e,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),Zt(o),zt(o,"click",Qt),zt(o,"click",r,this),zt(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";bt(this._zoomInButton,t),bt(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(_t(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(_t(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});nn.mergeOptions({zoomControl:!0}),nn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new cn,this.addControl(this.zoomControl))});var un=function(e){return new cn(e)},dn=on.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",n=pt("div",t),i=this.options;return this._addScales(i,t+"-line",n),e.on(i.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=pt("div",t,n)),e.imperial&&(this._iScale=pt("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t,n,i,r=3.2808399*e;r>5280?(t=r/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(i=this._getRoundNum(r),this._updateScale(this._iScale,i+" ft",i/r))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),hn=function(e){return new dn(e)},pn='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',fn=on.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ie.inlineSvg?pn+" ":"")+"Leaflet</a>"},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=pt("div","leaflet-control-attribution"),Zt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});nn.mergeOptions({attributionControl:!0}),nn.addInitHook(function(){this.options.attributionControl&&(new fn).addTo(this)});var mn=function(e){return new fn(e)};on.Layers=an,on.Zoom=cn,on.Scale=dn,on.Attribution=fn,sn.layers=ln,sn.zoom=un,sn.scale=hn,sn.attribution=mn;var gn=T.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});gn.addTo=function(e,t){return e.addHandler(t,this),this};var vn={Events:N},yn=Ie.touch?"touchstart mousedown":"mousedown",_n=O.extend({options:{clickTolerance:3},initialize:function(e,t,n,i){p(this,i),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(zt(this._dragStartTarget,yn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_n._dragging===this&&this.finishDrag(!0),Dt(this._dragStartTarget,yn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!yt(this._element,"leaflet-zoom-anim")))if(e.touches&&1!==e.touches.length)_n._dragging===this&&this.finishDrag();else if(!(_n._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches)&&(_n._dragging=this,this._preventOutline&&Ot(this._element),jt(),it(),!this._moving)){this.fire("down");var t=e.touches?e.touches[0]:e,n=At(this._element);this._startPoint=new M(t.clientX,t.clientY),this._startPos=Pt(this._element),this._parentScale=Rt(n);var i="mousedown"===e.type;zt(document,i?"mousemove":"touchmove",this._onMove,this),zt(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(e){if(this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new M(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,Gt(e),this._moved||(this.fire("dragstart"),this._moved=!0,_t(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_t(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition()))}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),Et(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){bt(document.body,"leaflet-dragging"),this._lastTarget&&(bt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Dt(document,"mousemove touchmove",this._onMove,this),Dt(document,"mouseup touchend touchcancel",this._onUp,this),Nt(),rt();var t=this._moved&&this._moving;this._moving=!1,_n._dragging=!1,t&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function bn(e,t,n){var i,r,o,s,a,l,c,u,d,h=[1,4,2,8];for(r=0,c=e.length;r<c;r++)e[r]._code=Mn(e[r],t);for(s=0;s<4;s++){for(u=h[s],i=[],r=0,o=(c=e.length)-1;r<c;o=r++)a=e[r],l=e[o],a._code&u?l._code&u||((d=On(l,a,u,t,n))._code=Mn(d,t),i.push(d)):(l._code&u&&((d=On(l,a,u,t,n))._code=Mn(d,t),i.push(d)),i.push(a));e=i}return e}function xn(e,t){var n,i,r,o,s,a,l,c,u;if(!e||0===e.length)throw new Error("latlngs not passed");In(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var d=U([0,0]),h=D(e);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(d=wn(e));var p=e.length,f=[];for(n=0;n<p;n++){var m=U(e[n]);f.push(t.project(U([m.lat-d.lat,m.lng-d.lng])))}for(a=l=c=0,n=0,i=p-1;n<p;i=n++)r=f[n],o=f[i],s=r.y*o.x-o.y*r.x,l+=(r.x+o.x)*s,c+=(r.y+o.y)*s,a+=3*s;u=0===a?f[0]:[l/a,c/a];var g=t.unproject(R(u));return U([g.lat+d.lat,g.lng+d.lng])}function wn(e){for(var t=0,n=0,i=0,r=0;r<e.length;r++){var o=U(e[r]);t+=o.lat,n+=o.lng,i++}return U([t/i,n/i])}var kn,Sn={__proto__:null,clipPolygon:bn,polygonCenter:xn,centroid:wn};function Cn(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=Pn(e=jn(e,n),n)}function Ln(e,t,n){return Math.sqrt(Rn(e,t,n,!0))}function En(e,t,n){return Rn(e,t,n)}function Pn(e,t){var n=e.length,i=new(typeof Uint8Array!==void 0+""?Uint8Array:Array)(n);i[0]=i[n-1]=1,Tn(e,i,t,0,n-1);var r,o=[];for(r=0;r<n;r++)i[r]&&o.push(e[r]);return o}function Tn(e,t,n,i,r){var o,s,a,l=0;for(s=i+1;s<=r-1;s++)(a=Rn(e[s],e[i],e[r],!0))>l&&(o=s,l=a);l>n&&(t[o]=1,Tn(e,t,n,i,o),Tn(e,t,n,o,r))}function jn(e,t){for(var n=[e[0]],i=1,r=0,o=e.length;i<o;i++)An(e[i],e[r])>t&&(n.push(e[i]),r=i);return r<o-1&&n.push(e[o-1]),n}function Nn(e,t,n,i,r){var o,s,a,l=i?kn:Mn(e,n),c=Mn(t,n);for(kn=c;;){if(!(l|c))return[e,t];if(l&c)return!1;a=Mn(s=On(e,t,o=l||c,n,r),n),o===l?(e=s,l=a):(t=s,c=a)}}function On(e,t,n,i,r){var o,s,a=t.x-e.x,l=t.y-e.y,c=i.min,u=i.max;return 8&n?(o=e.x+a*(u.y-e.y)/l,s=u.y):4&n?(o=e.x+a*(c.y-e.y)/l,s=c.y):2&n?(o=u.x,s=e.y+l*(u.x-e.x)/a):1&n&&(o=c.x,s=e.y+l*(c.x-e.x)/a),new M(o,s,r)}function Mn(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function An(e,t){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}function Rn(e,t,n,i){var r,o=t.x,s=t.y,a=n.x-o,l=n.y-s,c=a*a+l*l;return c>0&&((r=((e.x-o)*a+(e.y-s)*l)/c)>1?(o=n.x,s=n.y):r>0&&(o+=a*r,s+=l*r)),a=e.x-o,l=e.y-s,i?a*a+l*l:new M(o,s)}function In(e){return!v(e[0])||"object"!==typeof e[0][0]&&"undefined"!==typeof e[0][0]}function zn(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),In(e)}function Bn(e,t){var n,i,r,o,s,a,l,c;if(!e||0===e.length)throw new Error("latlngs not passed");In(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var u=U([0,0]),d=D(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(u=wn(e));var h=e.length,p=[];for(n=0;n<h;n++){var f=U(e[n]);p.push(t.project(U([f.lat-u.lat,f.lng-u.lng])))}for(n=0,i=0;n<h-1;n++)i+=p[n].distanceTo(p[n+1])/2;if(0===i)c=p[0];else for(n=0,o=0;n<h-1;n++)if(s=p[n],a=p[n+1],(o+=r=s.distanceTo(a))>i){l=(o-i)/r,c=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var m=t.unproject(R(c));return U([m.lat+u.lat,m.lng+u.lng])}var Dn={__proto__:null,simplify:Cn,pointToSegmentDistance:Ln,closestPointOnSegment:En,clipSegment:Nn,_getEdgeIntersection:On,_getBitCode:Mn,_sqClosestPointOnSegment:Rn,isFlat:In,_flat:zn,polylineCenter:Bn},Fn={project:function(e){return new M(e.lng,e.lat)},unproject:function(e){return new F(e.y,e.x)},bounds:new I([-180,-90],[180,90])},Un={R:6378137,R_MINOR:6356752.314245179,bounds:new I([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,i=e.lat*t,r=this.R_MINOR/n,o=Math.sqrt(1-r*r),s=o*Math.sin(i),a=Math.tan(Math.PI/4-i/2)/Math.pow((1-s)/(1+s),o/2);return i=-n*Math.log(Math.max(a,1e-10)),new M(e.lng*t*n,i)},unproject:function(e){for(var t,n=180/Math.PI,i=this.R,r=this.R_MINOR/i,o=Math.sqrt(1-r*r),s=Math.exp(-e.y/i),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)t=o*Math.sin(a),t=Math.pow((1-t)/(1+t),o/2),a+=c=Math.PI/2-2*Math.atan(s*t)-a;return new F(a*n,e.x*n/i)}},qn={__proto__:null,LonLat:Fn,Mercator:Un,SphericalMercator:H},Vn=n({},V,{code:"EPSG:3395",projection:Un,transformation:function(){var e=.5/(Math.PI*Un.R);return G(e,.5,-e,.5)}()}),Wn=n({},V,{code:"EPSG:4326",projection:Fn,transformation:G(1/180,1,-1/180,.5)}),Hn=n({},q,{projection:Fn,transformation:G(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,i=t.lat-e.lat;return Math.sqrt(n*n+i*i)},infinite:!0});q.Earth=V,q.EPSG3395=Vn,q.EPSG3857=Q,q.EPSG900913=Y,q.EPSG4326=Wn,q.Simple=Hn;var Zn=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[s(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[s(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",function(){t.off(n,this)},this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});nn.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=s(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=s(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return s(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){for(var t=0,n=(e=e?v(e)?e:[e]:[]).length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){isNaN(e.options.maxZoom)&&isNaN(e.options.minZoom)||(this._zoomBoundLayers[s(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=s(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var i in this._zoomBoundLayers){var r=this._zoomBoundLayers[i].options;e=void 0===r.minZoom?e:Math.min(e,r.minZoom),t=void 0===r.maxZoom?t:Math.max(t,r.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Gn=Zn.extend({initialize:function(e,t){var n,i;if(p(this,t),this._layers={},e)for(n=0,i=e.length;n<i;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return("number"===typeof e?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t,n,i=Array.prototype.slice.call(arguments,1);for(t in this._layers)(n=this._layers[t])[e]&&n[e].apply(n,i);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return s(e)}}),Qn=function(e,t){return new Gn(e,t)},Yn=Gn.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),Gn.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),Gn.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new B;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),Kn=function(e,t){return new Yn(e,t)},$n=T.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){p(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if("icon"===e)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(n,t&&"IMG"===t.tagName?t:null);return this._setIconStyles(i,e),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i},_setIconStyles:function(e,t){var n=this.options,i=n[t+"Size"];"number"===typeof i&&(i=[i,i]);var r=R(i),o=R("shadow"===t&&n.shadowAnchor||n.iconAnchor||r&&r.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+(n.className||""),o&&(e.style.marginLeft=-o.x+"px",e.style.marginTop=-o.y+"px"),r&&(e.style.width=r.x+"px",e.style.height=r.y+"px")},_createImg:function(e,t){return(t=t||document.createElement("img")).src=e,t},_getIconUrl:function(e){return Ie.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}});function Xn(e){return new $n(e)}var Jn=$n.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return"string"!==typeof Jn.imagePath&&(Jn.imagePath=this._detectIconPath()),(this.options.imagePath||Jn.imagePath)+$n.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,n){var i=t.exec(e);return i&&i[n]};return(e=t(e,/^url\((['"])?(.+)\1\)$/,2))&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=pt("div","leaflet-default-icon-path",document.body),t=ht(e,"background-image")||ht(e,"backgroundImage");if(document.body.removeChild(e),t=this._stripUrl(t))return t;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),ei=gn.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new _n(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_t(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&bt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,i=this._marker.options.autoPanSpeed,r=this._marker.options.autoPanPadding,o=Pt(t._icon),s=n.getPixelBounds(),a=n.getPixelOrigin(),l=z(s.min._subtract(a).add(r),s.max._subtract(a).subtract(r));if(!l.contains(o)){var c=R((Math.max(l.max.x,o.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,o.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,o.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,o.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(i);n.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),Et(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=C(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(E(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,i=Pt(t._icon),r=t._map.layerPointToLatLng(i);n&&Et(n,i),t._latlng=r,e.latlng=r,e.oldLatLng=this._oldLatLng,t.fire("move",e).fire("drag",e)},_onDragEnd:function(e){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),ti=Zn.extend({options:{icon:new Jn,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){p(this,t),this._latlng=U(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=U(e),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=e.icon.createIcon(this._icon),i=!1;n!==this._icon&&(this._icon&&this._removeIcon(),i=!0,e.title&&(n.title=e.title),"IMG"===n.tagName&&(n.alt=e.alt||"")),_t(n,t),e.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&zt(n,"focus",this._panOnFocus,this);var r=e.icon.createShadow(this._shadow),o=!1;r!==this._shadow&&(this._removeShadow(),o=!0),r&&(_t(r,t),r.alt=""),this._shadow=r,e.opacity<1&&this._updateOpacity(),i&&this.getPane().appendChild(this._icon),this._initInteraction(),r&&o&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Dt(this._icon,"focus",this._panOnFocus,this),ft(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ft(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&Et(this._icon,e),this._shadow&&Et(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(_t(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),ei)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new ei(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&kt(this._icon,e),this._shadow&&kt(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?R(t.iconSize):R(0,0),i=t.iconAnchor?R(t.iconAnchor):R(0,0);e.panInside(this._latlng,{paddingTopLeft:i,paddingBottomRight:n.subtract(i)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function ni(e,t){return new ti(e,t)}var ii=Zn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return p(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ri=ii.extend({options:{fill:!0,radius:10},initialize:function(e,t){p(this,t),this._latlng=U(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=U(e),this.redraw(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return ii.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),i=[e+n,t+n];this._pxBounds=new I(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function oi(e,t){return new ri(e,t)}var si=ri.extend({initialize:function(e,t,i){if("number"===typeof t&&(t=n({},i,{radius:t})),p(this,t),this._latlng=U(e),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:ii.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,i=n.options.crs;if(i.distance===V.distance){var r=Math.PI/180,o=this._mRadius/V.R/r,s=n.project([t+o,e]),a=n.project([t-o,e]),l=s.add(a).divideBy(2),c=n.unproject(l).lat,u=Math.acos((Math.cos(o*r)-Math.sin(t*r)*Math.sin(c*r))/(Math.cos(t*r)*Math.cos(c*r)))/r;(isNaN(u)||0===u)&&(u=o/Math.cos(Math.PI/180*t)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(u)?0:l.x-n.project([c,e-u]).x,this._radiusY=l.y-s.y}else{var d=i.unproject(i.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(d).x}this._updateBounds()}});function ai(e,t,n){return new si(e,t,n)}var li=ii.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){p(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t,n,i=1/0,r=null,o=Rn,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,u=l.length;c<u;c++){var d=o(e,t=l[c-1],n=l[c],!0);d<i&&(i=d,r=o(e,t,n))}return r&&(r.distance=Math.sqrt(i)),r},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Bn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=U(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new B,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return In(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=In(e),i=0,r=e.length;i<r;i++)n?(t[i]=U(e[i]),this._bounds.extend(t[i])):t[i]=this._convertLatLngs(e[i]);return t},_project:function(){var e=new I;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new M(e,e);this._rawPxBounds&&(this._pxBounds=new I([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var i,r,o=e[0]instanceof F,s=e.length;if(o){for(r=[],i=0;i<s;i++)r[i]=this._map.latLngToLayerPoint(e[i]),n.extend(r[i]);t.push(r)}else for(i=0;i<s;i++)this._projectLatlngs(e[i],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else{var t,n,i,r,o,s,a,l=this._parts;for(t=0,i=0,r=this._rings.length;t<r;t++)for(n=0,o=(a=this._rings[t]).length;n<o-1;n++)(s=Nn(a[n],a[n+1],e,n,!0))&&(l[i]=l[i]||[],l[i].push(s[0]),s[1]===a[n+1]&&n!==o-2||(l[i].push(s[1]),i++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,i=e.length;n<i;n++)e[n]=Cn(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,i,r,o,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,o=this._parts.length;n<o;n++)for(i=0,r=(s=(a=this._parts[n]).length)-1;i<s;r=i++)if((t||0!==i)&&Ln(e,a[r],a[i])<=l)return!0;return!1}});function ci(e,t){return new li(e,t)}li._flat=zn;var ui=li.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return xn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=li.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof F&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){li.prototype._setLatLngs.call(this,e),In(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return In(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new M(t,t);if(e=new I(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var i,r=0,o=this._rings.length;r<o;r++)(i=bn(this._rings[r],e,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t,n,i,r,o,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(r=0,a=this._parts.length;r<a;r++)for(o=0,s=(l=(t=this._parts[r]).length)-1;o<l;s=o++)n=t[o],i=t[s],n.y>e.y!==i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(c=!c);return c||li.prototype._containsPoint.call(this,e,!0)}});function di(e,t){return new ui(e,t)}var hi=Yn.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,i,r=v(e)?e:e.features;if(r){for(t=0,n=r.length;t<n;t++)((i=r[t]).geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}var o=this.options;if(o.filter&&!o.filter(e))return this;var s=pi(e,o);return s?(s.feature=bi(e),s.defaultOptions=s.options,this.resetStyle(s),o.onEachFeature&&o.onEachFeature(e,s),this.addLayer(s)):this},resetStyle:function(e){return void 0===e?this.eachLayer(this.resetStyle,this):(e.options=n({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){e.setStyle&&("function"===typeof t&&(t=t(e.feature)),e.setStyle(t))}});function pi(e,t){var n,i,r,o,s="Feature"===e.type?e.geometry:e,a=s?s.coordinates:null,l=[],c=t&&t.pointToLayer,u=t&&t.coordsToLatLng||mi;if(!a&&!s)return null;switch(s.type){case"Point":return fi(c,e,n=u(a),t);case"MultiPoint":for(r=0,o=a.length;r<o;r++)n=u(a[r]),l.push(fi(c,e,n,t));return new Yn(l);case"LineString":case"MultiLineString":return i=gi(a,"LineString"===s.type?0:1,u),new li(i,t);case"Polygon":case"MultiPolygon":return i=gi(a,"Polygon"===s.type?1:2,u),new ui(i,t);case"GeometryCollection":for(r=0,o=s.geometries.length;r<o;r++){var d=pi({geometry:s.geometries[r],type:"Feature",properties:e.properties},t);d&&l.push(d)}return new Yn(l);case"FeatureCollection":for(r=0,o=s.features.length;r<o;r++){var h=pi(s.features[r],t);h&&l.push(h)}return new Yn(l);default:throw new Error("Invalid GeoJSON object.")}}function fi(e,t,n,i){return e?e(t,n):new ti(n,i&&i.markersInheritOptions&&i)}function mi(e){return new F(e[1],e[0],e[2])}function gi(e,t,n){for(var i,r=[],o=0,s=e.length;o<s;o++)i=t?gi(e[o],t-1,n):(n||mi)(e[o]),r.push(i);return r}function vi(e,t){return void 0!==(e=U(e)).alt?[u(e.lng,t),u(e.lat,t),u(e.alt,t)]:[u(e.lng,t),u(e.lat,t)]}function yi(e,t,n,i){for(var r=[],o=0,s=e.length;o<s;o++)r.push(t?yi(e[o],In(e[o])?0:t-1,n,i):vi(e[o],i));return!t&&n&&r.length>0&&r.push(r[0].slice()),r}function _i(e,t){return e.feature?n({},e.feature,{geometry:t}):bi(t)}function bi(e){return"Feature"===e.type||"FeatureCollection"===e.type?e:{type:"Feature",properties:{},geometry:e}}var xi={toGeoJSON:function(e){return _i(this,{type:"Point",coordinates:vi(this.getLatLng(),e)})}};function wi(e,t){return new hi(e,t)}ti.include(xi),si.include(xi),ri.include(xi),li.include({toGeoJSON:function(e){var t=!In(this._latlngs);return _i(this,{type:(t?"Multi":"")+"LineString",coordinates:yi(this._latlngs,t?1:0,!1,e)})}}),ui.include({toGeoJSON:function(e){var t=!In(this._latlngs),n=t&&!In(this._latlngs[0]),i=yi(this._latlngs,n?2:t?1:0,!0,e);return t||(i=[i]),_i(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Gn.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),_i(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(e);var n="GeometryCollection"===t,i=[];return this.eachLayer(function(t){if(t.toGeoJSON){var r=t.toGeoJSON(e);if(n)i.push(r.geometry);else{var o=bi(r);"FeatureCollection"===o.type?i.push.apply(i,o.features):i.push(o)}}}),n?_i(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});var ki=wi,Si=Zn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,t,n){this._url=e,this._bounds=D(t),p(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_t(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ft(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&>(this._image),this},bringToBack:function(){return this._map&&vt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=D(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e="IMG"===this._url.tagName,t=this._image=e?this._url:pt("img");_t(t,"leaflet-image-layer"),this._zoomAnimated&&_t(t,"leaflet-zoom-animated"),this.options.className&&_t(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onload=r(this.fire,this,"load"),t.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e?this._url=t.src:(t.src=this._url,t.alt=this.options.alt)},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Lt(this._image,n,t)},_reset:function(){var e=this._image,t=new I(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();Et(e,t.min),e.style.width=n.x+"px",e.style.height=n.y+"px"},_updateOpacity:function(){kt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Ci=function(e,t,n){return new Si(e,t,n)},Li=Si.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e="VIDEO"===this._url.tagName,t=this._image=e?this._url:pt("video");if(_t(t,"leaflet-image-layer"),this._zoomAnimated&&_t(t,"leaflet-zoom-animated"),this.options.className&&_t(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onloadeddata=r(this.fire,this,"load"),e){for(var n=t.getElementsByTagName("source"),i=[],o=0;o<n.length;o++)i.push(n[o].src);this._url=n.length>0?i:[t.src]}else{v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=pt("source");a.src=this._url[s],t.appendChild(a)}}}});function Ei(e,t,n){return new Li(e,t,n)}var Pi=Si.extend({_initImage:function(){var e=this._image=this._url;_t(e,"leaflet-image-layer"),this._zoomAnimated&&_t(e,"leaflet-zoom-animated"),this.options.className&&_t(e,this.options.className),e.onselectstart=c,e.onmousemove=c}});function Ti(e,t,n){return new Pi(e,t,n)}var ji=Zn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,t){e&&(e instanceof F||v(e))?(this._latlng=U(e),p(this,t)):(p(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return(e=arguments.length?e:this._source._map).hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&kt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&kt(this._container,1),this.bringToFront(),this.options.interactive&&(_t(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(kt(this._container,0),this._removeTimeout=setTimeout(r(ft,void 0,this._container),200)):ft(this._container),this.options.interactive&&(bt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=U(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&>(this._container),this},bringToBack:function(){return this._map&&vt(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof Yn){t=null;var n=this._source._layers;for(var i in n)if(n[i]._map){t=n[i];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else{if(!t.getBounds)throw new Error("Unable to get source layer LatLng.");e=t.getBounds().getCenter()}return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t="function"===typeof this._content?this._content(this._source||this):this._content;if("string"===typeof t)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=R(this.options.offset),n=this._getAnchor();this._zoomAnimated?Et(this._container,e.add(n)):t=t.add(e).add(n);var i=this._containerBottom=-t.y,r=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=i+"px",this._container.style.left=r+"px"}},_getAnchor:function(){return[0,0]}});nn.include({_initOverlay:function(e,t,n,i){var r=t;return r instanceof e||(r=new e(i).setContent(t)),n&&r.setLatLng(n),r}}),Zn.include({_initOverlay:function(e,t,n,i){var r=n;return r instanceof e?(p(r,i),r._source=this):(r=t&&!i?t:new e(i,this)).setContent(n),r}});var Ni=ji.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return!(e=arguments.length?e:this._source._map).hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,ji.prototype.openOn.call(this,e)},onAdd:function(e){ji.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ii||this._source.on("preclick",Wt))},onRemove:function(e){ji.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ii||this._source.off("preclick",Wt))},getEvents:function(){var e=ji.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",t=this._container=pt("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=pt("div",e+"-content-wrapper",t);if(this._contentNode=pt("div",e+"-content",n),Zt(t),Ht(this._contentNode),zt(t,"contextmenu",Wt),this._tipContainer=pt("div",e+"-tip-container",t),this._tip=pt("div",e+"-tip",this._tipContainer),this.options.closeButton){var i=this._closeButton=pt("a",e+"-close-button",t);i.setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">×</span>',zt(i,"click",function(e){Gt(e),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+"px",t.whiteSpace="",t.height="";var i=e.offsetHeight,r=this.options.maxHeight,o="leaflet-popup-scrolled";r&&i>r?(t.height=r+"px",_t(e,o)):bt(e,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();Et(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var e=this._map,t=parseInt(ht(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,i=this._containerWidth,r=new M(this._containerLeft,-n-this._containerBottom);r._add(Pt(this._container));var o=e.layerPointToContainerPoint(r),s=R(this.options.autoPanPadding),a=R(this.options.autoPanPaddingTopLeft||s),l=R(this.options.autoPanPaddingBottomRight||s),c=e.getSize(),u=0,d=0;o.x+i+l.x>c.x&&(u=o.x+i-c.x+l.x),o.x-u-a.x<0&&(u=o.x-a.x),o.y+n+l.y>c.y&&(d=o.y+n-c.y+l.y),o.y-d-a.y<0&&(d=o.y-a.y),(u||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([u,d]))}},_getAnchor:function(){return R(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Oi=function(e,t){return new Ni(e,t)};nn.mergeOptions({closePopupOnClick:!0}),nn.include({openPopup:function(e,t,n){return this._initOverlay(Ni,e,t,n).openOn(this),this},closePopup:function(e){return(e=arguments.length?e:this._popup)&&e.close(),this}}),Zn.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Ni,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Yn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){Qt(e);var t=e.layer||e.target;this._popup._source!==t||t instanceof ii?(this._popup._source=t,this.openPopup(e.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var Mi=ji.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){ji.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){ji.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=ji.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=pt("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,i=this._map,r=this._container,o=i.latLngToContainerPoint(i.getCenter()),s=i.layerPointToContainerPoint(e),a=this.options.direction,l=r.offsetWidth,c=r.offsetHeight,u=R(this.options.offset),d=this._getAnchor();"top"===a?(t=l/2,n=c):"bottom"===a?(t=l/2,n=0):"center"===a?(t=l/2,n=c/2):"right"===a?(t=0,n=c/2):"left"===a?(t=l,n=c/2):s.x<o.x?(a="right",t=0,n=c/2):(a="left",t=l+2*(u.x+d.x),n=c/2),e=e.subtract(R(t,n,!0)).add(u).add(d),bt(r,"leaflet-tooltip-right"),bt(r,"leaflet-tooltip-left"),bt(r,"leaflet-tooltip-top"),bt(r,"leaflet-tooltip-bottom"),_t(r,"leaflet-tooltip-"+a),Et(r,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&kt(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return R(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Ai=function(e,t){return new Mi(e,t)};nn.include({openTooltip:function(e,t,n){return this._initOverlay(Mi,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),Zn.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Mi,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(e||!this._tooltipHandlersAdded){var t=e?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[t](n),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Yn||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t="function"===typeof e.getElement&&e.getElement();t&&(zt(t,"focus",function(){this._tooltip._source=e,this.openTooltip()},this),zt(t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t="function"===typeof e.getElement&&e.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once("moveend",function(){t._openOnceFlag=!1,t._openTooltip(e)})}else this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)},_moveTooltip:function(e){var t,n,i=e.latlng;this._tooltip.options.sticky&&e.originalEvent&&(t=this._map.mouseEventToContainerPoint(e.originalEvent),n=this._map.containerPointToLayerPoint(t),i=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(i)}});var Ri=$n.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var t=e&&"DIV"===e.tagName?e:document.createElement("div"),n=this.options;if(n.html instanceof Element?(mt(t),t.appendChild(n.html)):t.innerHTML=!1!==n.html?n.html:"",n.bgPos){var i=R(n.bgPos);t.style.backgroundPosition=-i.x+"px "+-i.y+"px"}return this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});function Ii(e){return new Ri(e)}$n.Default=Jn;var zi=Zn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ie.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){p(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),ft(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(gt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(vt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof M?e:new M(e,e)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t,n=this.getPane().children,i=-e(-1/0,1/0),r=0,o=n.length;r<o;r++)t=n[r].style.zIndex,n[r]!==this._container&&t&&(i=e(i,+t));isFinite(i)&&(this.options.zIndex=i+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ie.ielt9){kt(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var i in this._tiles){var r=this._tiles[i];if(r.current&&r.loaded){var o=Math.min(1,(e-r.loaded)/200);kt(r.el,o),o<1?t=!0:(r.active?n=!0:this._onOpaqueTile(r),r.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(E(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=pt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(void 0!==e){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(ft(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var i=this._levels[e],r=this._map;return i||((i=this._levels[e]={}).el=pt("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=t,i.origin=r.project(r.unproject(r.getPixelOrigin()),e).round(),i.zoom=e,this._setZoomTransform(i,r.getCenter(),r.getZoom()),c(i.el.offsetWidth),this._onCreateLevel(i)),this._level=i,i}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(e in this._tiles)(t=this._tiles[e]).retain=t.current;for(e in this._tiles)if((t=this._tiles[e]).current&&!t.active){var i=t.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)ft(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,i){var r=Math.floor(e/2),o=Math.floor(t/2),s=n-1,a=new M(+r,+o);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>i&&this._retainParent(r,o,s,i))},_retainChildren:function(e,t,n,i){for(var r=2*e;r<2*e+2;r++)for(var o=2*t;o<2*t+2;o++){var s=new M(r,o);s.z=n+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1<i&&this._retainChildren(r,o,n+1,i))}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return void 0!==t.minNativeZoom&&e<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,i){var r=Math.round(t);r=void 0!==this.options.maxZoom&&r>this.options.maxZoom||void 0!==this.options.minZoom&&r<this.options.minZoom?void 0:this._clampZoom(r);var o=this.options.updateWhenZooming&&r!==this._tileZoom;i&&!o||(this._tileZoom=r,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==r&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var i=this._map.getZoomScale(n,e.zoom),r=e.origin.multiplyBy(i).subtract(this._map._getNewPixelOrigin(t,n)).round();Ie.any3d?Lt(e.el,r,i):Et(e.el,r)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),i=this._tileZoom,r=this._map.getPixelWorldBounds(this._tileZoom);r&&(this._globalTileRange=this._pxBoundsToTileRange(r)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],i).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],i).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],i).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],i).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),i=t.getZoomScale(n,this._tileZoom),r=t.project(e,this._tileZoom).floor(),o=t.getSize().divideBy(2*i);return new I(r.subtract(o),r.add(o))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(void 0===e&&(e=t.getCenter()),void 0!==this._tileZoom){var i=this._getTiledPixelBounds(e),r=this._pxBoundsToTileRange(i),o=r.getCenter(),s=[],a=this.options.keepBuffer,l=new I(r.getBottomLeft().subtract([a,-a]),r.getTopRight().add([a,-a]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var u=this._tiles[c].coords;u.z===this._tileZoom&&l.contains(new M(u.x,u.y))||(this._tiles[c].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(e,n);else{for(var d=r.min.y;d<=r.max.y;d++)for(var h=r.min.x;h<=r.max.x;h++){var p=new M(h,d);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:s.push(p)}}if(s.sort(function(e,t){return e.distanceTo(o)-t.distanceTo(o)}),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(h=0;h<s.length;h++)this._addTile(s[h],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(e);return D(this.options.bounds).overlaps(i)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),i=e.scaleBy(n),r=i.add(n);return[t.unproject(i,e.z),t.unproject(r,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new B(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new M(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(ft(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){_t(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=c,e.onmousemove=c,Ie.ielt9&&this.options.opacity<1&&kt(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),i=this._tileCoordsToKey(e),o=this.createTile(this._wrapCoords(e),r(this._tileReady,this,e));this._initTile(o),this.createTile.length<2&&C(r(this._tileReady,this,e,null,o)),Et(o,n),this._tiles[i]={el:o,coords:e,current:!0},t.appendChild(o),this.fire("tileloadstart",{tile:o,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var i=this._tileCoordsToKey(e);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(kt(n.el,0),E(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(_t(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ie.ielt9||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new M(this._wrapX?l(e.x,this._wrapX):e.x,this._wrapY?l(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new I(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Bi(e){return new zi(e)}var Di=zi.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=p(this,t)).detectRetina&&Ie.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"===typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return zt(n,"load",r(this._tileOnLoad,this,t,n)),zt(n,"error",r(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"===typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:Ie.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=i),t["-y"]=i}return g(this._url,n(t,this.options))},_tileOnLoad:function(e,t){Ie.ielt9?setTimeout(r(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var i=this.options.errorTileUrl;i&&t.getAttribute("src")!==i&&(t.src=i),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=c,t.onerror=c,!t.complete)){t.src=_;var n=this._tiles[e].coords;ft(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",_),zi.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==_))return zi.prototype._tileReady.call(this,e,t,n)}});function Fi(e,t){return new Di(e,t)}var Ui=Di.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var i=n({},this.defaultWmsParams);for(var r in t)r in this.options||(i[r]=t[r]);var o=(t=p(this,t)).detectRetina&&Ie.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,Di.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,i=z(n.project(t[0]),n.project(t[1])),r=i.min,o=i.max,s=(this._wmsVersion>=1.3&&this._crs===Wn?[r.y,r.x,o.y,o.x]:[r.x,r.y,o.x,o.y]).join(","),a=Di.prototype.getTileUrl.call(this,e);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(e,t){return n(this.wmsParams,e),t||this.redraw(),this}});function qi(e,t){return new Ui(e,t)}Di.WMS=Ui,Fi.wms=qi;var Vi=Zn.extend({options:{padding:.1},initialize:function(e){p(this,e),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),_t(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,t),o=i.multiplyBy(-n).add(r).subtract(this._map._getNewPixelOrigin(e,t));Ie.any3d?Lt(this._container,o,n):Et(this._container,o)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new I(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wi=Vi.extend({options:{tolerance:0},getEvents:function(){var e=Vi.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Vi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");zt(e,"mousemove",this._onMouseMove,this),zt(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),zt(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,ft(this._container),Dt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Vi.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),i=Ie.retina?2:1;Et(t,e.min),t.width=i*n.x,t.height=i*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",Ie.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){Vi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[s(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,i=t.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete e._order,delete this._layers[s(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"===typeof e.options.dashArray){var t,n,i=e.options.dashArray.split(/[, ]+/),r=[];for(n=0;n<i.length;n++){if(t=Number(i[n]),isNaN(t))return;r.push(t)}e.options._dashArray=r}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new I,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var i=this._drawFirst;i;i=i.next)e=i.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,i,r,o,s=e._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),n=0;n<a;n++){for(i=0,r=s[n].length;i<r;i++)o=s[n][i],l[i?"lineTo":"moveTo"](o.x,o.y);t&&l.closePath()}this._fillStroke(l,e)}}},_updateCircle:function(e){if(this._drawing&&!e._empty()){var t=e._point,n=this._ctx,i=Math.max(Math.round(e._radius),1),r=(Math.max(Math.round(e._radiusY),1)||i)/i;1!==r&&(n.save(),n.scale(1,r)),n.beginPath(),n.arc(t.x,t.y/r,i,0,2*Math.PI,!1),1!==r&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t,n,i=this._map.mouseEventToLayerPoint(e),r=this._drawFirst;r;r=r.next)(t=r.layer).options.interactive&&t._containsPoint(i)&&("click"!==e.type&&"preclick"!==e.type||!this._map._draggableMoved(t))&&(n=t);this._fireEvent(!!n&&[n],e)},_onMouseMove:function(e){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(bt(this._container,"leaflet-interactive"),this._fireEvent([t],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,i,o=this._drawFirst;o;o=o.next)(n=o.layer).options.interactive&&n._containsPoint(t)&&(i=n);i!==this._hoveredLayer&&(this._handleMouseOut(e),i&&(_t(this._container,"leaflet-interactive"),this._fireEvent([i],e,"mouseover"),this._hoveredLayer=i)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],e),this._mouseHoverThrottled=!0,setTimeout(r(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,i=t.prev;n&&(n.prev=i,i?i.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e))}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,i=t.prev;i&&(i.next=n,n?n.prev=i:i&&(this._drawLast=i),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e))}}});function Hi(e){return Ie.canvas?new Wi(e):null}var Zi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Gi={_initContainer:function(){this._container=pt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Vi.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=Zi("shape");_t(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=Zi("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;ft(t),e.removeInteractiveTarget(t),delete this._layers[s(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,i=e.options,r=e._container;r.stroked=!!i.stroke,r.filled=!!i.fill,i.stroke?(t||(t=e._stroke=Zi("stroke")),r.appendChild(t),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,i.dashArray?t.dashStyle=v(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=i.lineCap.replace("butt","flat"),t.joinstyle=i.lineJoin):t&&(r.removeChild(t),e._stroke=null),i.fill?(n||(n=e._fill=Zi("fill")),r.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(r.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),i=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+i+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){gt(e._container)},_bringToBack:function(e){vt(e._container)}},Qi=Ie.vml?Zi:K,Yi=Vi.extend({_initContainer:function(){this._container=Qi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Qi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ft(this._container),Dt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Vi.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),Et(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=Qi("path");e.options.className&&_t(t,e.options.className),e.options.interactive&&_t(t,"leaflet-interactive"),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){ft(e._path),e.removeInteractiveTarget(e._path),delete this._layers[s(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,$(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),i="a"+n+","+(Math.max(Math.round(e._radiusY),1)||n)+" 0 1,0 ",r=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(e,r)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){gt(e._path)},_bringToBack:function(e){vt(e._path)}});function Ki(e){return Ie.svg||Ie.vml?new Yi(e):null}Ie.vml&&Yi.include(Gi),nn.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Hi(e)||Ki(e)}});var $i=ui.extend({initialize:function(e,t){ui.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=D(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Xi(e,t){return new $i(e,t)}Yi.create=Qi,Yi.pointsToPath=$,hi.geometryToLayer=pi,hi.coordsToLatLng=mi,hi.coordsToLatLngs=gi,hi.latLngToCoords=vi,hi.latLngsToCoords=yi,hi.getFeature=_i,hi.asFeature=bi,nn.mergeOptions({boxZoom:!0});var Ji=gn.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){zt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Dt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ft(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),it(),jt(),this._startPoint=this._map.mouseEventToContainerPoint(e),zt(document,{contextmenu:Qt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=pt("div","leaflet-zoom-box",this._container),_t(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new I(this._point,this._startPoint),n=t.getSize();Et(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(ft(this._box),bt(this._container,"leaflet-crosshair")),rt(),Nt(),Dt(document,{contextmenu:Qt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var t=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});nn.addInitHook("addHandler","boxZoom",Ji),nn.mergeOptions({doubleClickZoom:!0});var er=gn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),i=t.options.zoomDelta,r=e.originalEvent.shiftKey?n-i:n+i;"center"===t.options.doubleClickZoom?t.setZoom(r):t.setZoomAround(e.containerPoint,r)}});nn.addInitHook("addHandler","doubleClickZoom",er),nn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var tr=gn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new _n(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}_t(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){bt(this._map._container,"leaflet-grab"),bt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=D(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,r=(i-t+n)%e+t-n,o=(i+t+n)%e-t-n,s=Math.abs(r+n)<Math.abs(o+n)?r:o;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(e){var t=this._map,n=t.options,i=!n.inertia||e.noInertia||this._times.length<2;if(t.fire("dragend",e),i)t.fire("moveend");else{this._prunePositions(+new Date);var r=this._lastPos.subtract(this._positions[0]),o=(this._lastTime-this._times[0])/1e3,s=n.easeLinearity,a=r.multiplyBy(s/o),l=a.distanceTo([0,0]),c=Math.min(n.inertiaMaxSpeed,l),u=a.multiplyBy(c/l),d=c/(n.inertiaDeceleration*s),h=u.multiplyBy(-d/2).round();h.x||h.y?(h=t._limitOffset(h,t.options.maxBounds),C(function(){t.panBy(h,{duration:d,easeLinearity:s,noMoveStart:!0,animate:!0})})):t.fire("moveend")}}});nn.addInitHook("addHandler","dragging",tr),nn.mergeOptions({keyboard:!0,keyboardPanDelta:80});var nr=gn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),zt(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Dt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,i=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(i,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var t,n,i=this._panKeys={},r=this.keyCodes;for(t=0,n=r.left.length;t<n;t++)i[r.left[t]]=[-1*e,0];for(t=0,n=r.right.length;t<n;t++)i[r.right[t]]=[e,0];for(t=0,n=r.down.length;t<n;t++)i[r.down[t]]=[0,e];for(t=0,n=r.up.length;t<n;t++)i[r.up[t]]=[0,-1*e]},_setZoomDelta:function(e){var t,n,i=this._zoomKeys={},r=this.keyCodes;for(t=0,n=r.zoomIn.length;t<n;t++)i[r.zoomIn[t]]=e;for(t=0,n=r.zoomOut.length;t<n;t++)i[r.zoomOut[t]]=-e},_addHooks:function(){zt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Dt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t,n=e.keyCode,i=this._map;if(n in this._panKeys){if(!i._panAnim||!i._panAnim._inProgress)if(t=this._panKeys[n],e.shiftKey&&(t=R(t).multiplyBy(3)),i.options.maxBounds&&(t=i._limitOffset(R(t),i.options.maxBounds)),i.options.worldCopyJump){var r=i.wrapLatLng(i.unproject(i.project(i.getCenter()).add(t)));i.panTo(r)}else i.panBy(t)}else if(n in this._zoomKeys)i.setZoom(i.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!i._popup||!i._popup.options.closeOnEscapeKey)return;i.closePopup()}Qt(e)}}});nn.addInitHook("addHandler","keyboard",nr),nn.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var ir=gn.extend({addHooks:function(){zt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Dt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var t=Xt(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var i=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),i),Qt(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var i=this._delta/(4*this._map.options.wheelPxPerZoomLevel),r=4*Math.log(2/(1+Math.exp(-Math.abs(i))))/Math.LN2,o=n?Math.ceil(r/n)*n:r,s=e._limitZoom(t+(this._delta>0?o:-o))-t;this._delta=0,this._startTime=null,s&&("center"===e.options.scrollWheelZoom?e.setZoom(t+s):e.setZoomAround(this._lastMousePos,t+s))}});nn.addInitHook("addHandler","scrollWheelZoom",ir);var rr=600;nn.mergeOptions({tapHold:Ie.touchNative&&Ie.safari&&Ie.mobile,tapTolerance:15});var or=gn.extend({addHooks:function(){zt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Dt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new M(t.clientX,t.clientY),this._holdTimeout=setTimeout(r(function(){this._cancel(),this._isTapValid()&&(zt(document,"touchend",Gt),zt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))},this),rr),zt(document,"touchend touchcancel contextmenu",this._cancel,this),zt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Dt(document,"touchend",Gt),Dt(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Dt(document,"touchend touchcancel contextmenu",this._cancel,this),Dt(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new M(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});nn.addInitHook("addHandler","tapHold",or),nn.mergeOptions({touchZoom:Ie.touch,bounceAtZoomLimits:!0});var sr=gn.extend({addHooks:function(){_t(this._map._container,"leaflet-touch-zoom"),zt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){bt(this._map._container,"leaflet-touch-zoom"),Dt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),i=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),zt(document,"touchmove",this._onTouchMove,this),zt(document,"touchend touchcancel",this._onTouchEnd,this),Gt(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),i=t.mouseEventToContainerPoint(e.touches[1]),o=n.distanceTo(i)/this._startDist;if(this._zoom=t.getScaleZoom(o,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&o<1||this._zoom>t.getMaxZoom()&&o>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),E(this._animRequest);var a=r(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=C(a,this,!0),Gt(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,E(this._animRequest),Dt(document,"touchmove",this._onTouchMove,this),Dt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});nn.addInitHook("addHandler","touchZoom",sr),nn.BoxZoom=Ji,nn.DoubleClickZoom=er,nn.Drag=tr,nn.Keyboard=nr,nn.ScrollWheelZoom=ir,nn.TapHold=or,nn.TouchZoom=sr,e.Bounds=I,e.Browser=Ie,e.CRS=q,e.Canvas=Wi,e.Circle=si,e.CircleMarker=ri,e.Class=T,e.Control=on,e.DivIcon=Ri,e.DivOverlay=ji,e.DomEvent=en,e.DomUtil=It,e.Draggable=_n,e.Evented=O,e.FeatureGroup=Yn,e.GeoJSON=hi,e.GridLayer=zi,e.Handler=gn,e.Icon=$n,e.ImageOverlay=Si,e.LatLng=F,e.LatLngBounds=B,e.Layer=Zn,e.LayerGroup=Gn,e.LineUtil=Dn,e.Map=nn,e.Marker=ti,e.Mixin=vn,e.Path=ii,e.Point=M,e.PolyUtil=Sn,e.Polygon=ui,e.Polyline=li,e.Popup=Ni,e.PosAnimation=tn,e.Projection=qn,e.Rectangle=$i,e.Renderer=Vi,e.SVG=Yi,e.SVGOverlay=Pi,e.TileLayer=Di,e.Tooltip=Mi,e.Transformation=Z,e.Util=P,e.VideoOverlay=Li,e.bind=r,e.bounds=z,e.canvas=Hi,e.circle=ai,e.circleMarker=oi,e.control=sn,e.divIcon=Ii,e.extend=n,e.featureGroup=Kn,e.geoJSON=wi,e.geoJson=ki,e.gridLayer=Bi,e.icon=Xn,e.imageOverlay=Ci,e.latLng=U,e.latLngBounds=D,e.layerGroup=Qn,e.map=rn,e.marker=ni,e.point=R,e.polygon=di,e.polyline=ci,e.popup=Oi,e.rectangle=Xi,e.setOptions=p,e.stamp=s,e.svg=Ki,e.svgOverlay=Ti,e.tileLayer=Fi,e.tooltip=Ai,e.transformation=G,e.version=t,e.videoOverlay=Ei;var ar=window.L;e.noConflict=function(){return window.L=ar,this},window.L=e}(t)},497(e,t,n){"use strict";var i=n(218);function r(){}function o(){}o.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,o,s){if(s!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:r};return n.PropTypes=n,n}},173(e,t,n){e.exports=n(497)()},218(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},730(e,t,n){"use strict";var i=n(43),r=n(853);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(a[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function m(e,t,n,i,r,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){g[e]=new m(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){g[e]=new m(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){g[e]=new m(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){g[e]=new m(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){g[e]=new m(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function _(e,t,n,i){var r=g.hasOwnProperty(t)?g[t]:null;(null!==r?0!==r.type:i||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,i){if(null===t||"undefined"===typeof t||function(e,t,n,i){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!i&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,i))return!0;if(i)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,r,i)&&(n=null),i||null===r?function(e){return!!d.call(f,e)||!d.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=null===n?3!==r.type&&"":n:(t=r.attributeName,i=r.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(r=r.type)||4===r&&!0===n?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)}),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)});var b=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=Symbol.for("react.element"),w=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),E=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),O=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var M=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var A=Symbol.iterator;function R(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=A&&e[A]||e["@@iterator"])?e:null}var I,z=Object.assign;function B(e){if(void 0===I)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||""}return"\n"+I+e}var D=!1;function F(e,t){if(!e||D)return"";D=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var i=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){i=c}e.call(t.prototype)}else{try{throw Error()}catch(c){i=c}e()}}catch(c){if(c&&i&&"string"===typeof c.stack){for(var r=c.stack.split("\n"),o=i.stack.split("\n"),s=r.length-1,a=o.length-1;1<=s&&0<=a&&r[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(r[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||r[s]!==o[a]){var l="\n"+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=s&&0<=a);break}}}finally{D=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?B(e):""}function U(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return e=F(e.type,!1);case 11:return e=F(e.type.render,!1);case 1:return e=F(e.type,!0);default:return""}}function q(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case k:return"Fragment";case w:return"Portal";case C:return"Profiler";case S:return"StrictMode";case T:return"Suspense";case j:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case E:return(e.displayName||"Context")+".Consumer";case L:return(e._context.displayName||"Context")+".Provider";case P:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case N:return null!==(t=e.displayName||null)?t:q(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return q(e(t))}catch(n){}}return null}function V(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function W(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function H(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Z(e){e._valueTracker||(e._valueTracker=function(e){var t=H(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=H(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}function Q(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Y(e,t){var n=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function K(e,t){var n=null==t.defaultValue?"":t.defaultValue,i=null!=t.checked?t.checked:t.defaultChecked;n=W(null!=t.value?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function $(e,t){null!=(t=t.checked)&&_(e,"checked",t,!1)}function X(e,t){$(e,t);var n=W(t.value),i=t.type;if(null!=n)"number"===i?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===i||"reset"===i)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,W(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!("submit"!==i&&"reset"!==i||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&Q(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+W(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function ie(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return z({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function re(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(te(n)){if(1<n.length)throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:W(n)}}function oe(e,t){var n=W(t.value),i=W(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=i&&(e.defaultValue=""+i)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,de=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,i){MSApp.execUnsafeLocalFunction(function(){return ue(e,t)})}:ue);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var i=0===n.indexOf("--"),r=me(n,t[n],i);"float"===n&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}Object.keys(pe).forEach(function(e){fe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]})});var ve=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62))}}function _e(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function xe(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var we=null,ke=null,Se=null;function Ce(e){if(e=_r(e)){if("function"!==typeof we)throw Error(o(280));var t=e.stateNode;t&&(t=xr(t),we(e.stateNode,e.type,t))}}function Le(e){ke?Se?Se.push(e):Se=[e]:ke=e}function Ee(){if(ke){var e=ke,t=Se;if(Se=ke=null,Ce(e),t)for(e=0;e<t.length;e++)Ce(t[e])}}function Pe(e,t){return e(t)}function Te(){}var je=!1;function Ne(e,t,n){if(je)return e(t,n);je=!0;try{return Pe(e,t,n)}finally{je=!1,(null!==ke||null!==Se)&&(Te(),Ee())}}function Oe(e,t){var n=e.stateNode;if(null===n)return null;var i=xr(n);if(null===i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(o(231,t,typeof n));return n}var Me=!1;if(u)try{var Ae={};Object.defineProperty(Ae,"passive",{get:function(){Me=!0}}),window.addEventListener("test",Ae,Ae),window.removeEventListener("test",Ae,Ae)}catch(ue){Me=!1}function Re(e,t,n,i,r,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Ie=!1,ze=null,Be=!1,De=null,Fe={onError:function(e){Ie=!0,ze=e}};function Ue(e,t,n,i,r,o,s,a,l){Ie=!1,ze=null,Re.apply(Fe,arguments)}function qe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ve(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function We(e){if(qe(e)!==e)throw Error(o(188))}function He(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=qe(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return We(r),e;if(s===i)return We(r),t;s=s.sibling}throw Error(o(188))}if(n.return!==i.return)n=r,i=s;else{for(var a=!1,l=r.child;l;){if(l===n){a=!0,n=r,i=s;break}if(l===i){a=!0,i=r,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,i=r;break}if(l===i){a=!0,i=s,n=r;break}l=l.sibling}if(!a)throw Error(o(189))}}if(n.alternate!==i)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e))?Ze(e):null}function Ze(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ze(e);if(null!==t)return t;e=e.sibling}return null}var Ge=r.unstable_scheduleCallback,Qe=r.unstable_cancelCallback,Ye=r.unstable_shouldYield,Ke=r.unstable_requestPaint,$e=r.unstable_now,Xe=r.unstable_getCurrentPriorityLevel,Je=r.unstable_ImmediatePriority,et=r.unstable_UserBlockingPriority,tt=r.unstable_NormalPriority,nt=r.unstable_LowPriority,it=r.unstable_IdlePriority,rt=null,ot=null;var st=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(at(e)/lt|0)|0},at=Math.log,lt=Math.LN2;var ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var i=0,r=e.suspendedLanes,o=e.pingedLanes,s=268435455&n;if(0!==s){var a=s&~r;0!==a?i=dt(a):0!==(o&=s)&&(i=dt(o))}else 0!==(s=n&~r)?i=dt(s):0!==o&&(i=dt(o));if(0===i)return 0;if(0!==t&&t!==i&&0===(t&r)&&((r=i&-i)>=(o=t&-t)||16===r&&0!==(4194240&o)))return t;if(0!==(4&i)&&(i|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=i;0<t;)r=1<<(n=31-st(t)),i|=e[n],t&=~r;return i}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=n}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-st(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}var _t=0;function bt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var xt,wt,kt,St,Ct,Lt=!1,Et=[],Pt=null,Tt=null,jt=null,Nt=new Map,Ot=new Map,Mt=[],At="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Rt(e,t){switch(e){case"focusin":case"focusout":Pt=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":jt=null;break;case"pointerover":case"pointerout":Nt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ot.delete(t.pointerId)}}function It(e,t,n,i,r,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},null!==t&&(null!==(t=_r(t))&&wt(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function zt(e){var t=yr(e.target);if(null!==t){var n=qe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ve(n)))return e.blockedOn=t,void Ct(e.priority,function(){kt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Bt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=_r(n))&&wt(t),e.blockedOn=n,!1;var i=new(n=e.nativeEvent).constructor(n.type,n);be=i,n.target.dispatchEvent(i),be=null,t.shift()}return!0}function Dt(e,t,n){Bt(e)&&n.delete(t)}function Ft(){Lt=!1,null!==Pt&&Bt(Pt)&&(Pt=null),null!==Tt&&Bt(Tt)&&(Tt=null),null!==jt&&Bt(jt)&&(jt=null),Nt.forEach(Dt),Ot.forEach(Dt)}function Ut(e,t){e.blockedOn===t&&(e.blockedOn=null,Lt||(Lt=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ft)))}function qt(e){function t(t){return Ut(t,e)}if(0<Et.length){Ut(Et[0],e);for(var n=1;n<Et.length;n++){var i=Et[n];i.blockedOn===e&&(i.blockedOn=null)}}for(null!==Pt&&Ut(Pt,e),null!==Tt&&Ut(Tt,e),null!==jt&&Ut(jt,e),Nt.forEach(t),Ot.forEach(t),n=0;n<Mt.length;n++)(i=Mt[n]).blockedOn===e&&(i.blockedOn=null);for(;0<Mt.length&&null===(n=Mt[0]).blockedOn;)zt(n),null===n.blockedOn&&Mt.shift()}var Vt=b.ReactCurrentBatchConfig,Wt=!0;function Ht(e,t,n,i){var r=_t,o=Vt.transition;Vt.transition=null;try{_t=1,Gt(e,t,n,i)}finally{_t=r,Vt.transition=o}}function Zt(e,t,n,i){var r=_t,o=Vt.transition;Vt.transition=null;try{_t=4,Gt(e,t,n,i)}finally{_t=r,Vt.transition=o}}function Gt(e,t,n,i){if(Wt){var r=Yt(e,t,n,i);if(null===r)Wi(e,t,i,Qt,n),Rt(e,i);else if(function(e,t,n,i,r){switch(t){case"focusin":return Pt=It(Pt,e,t,n,i,r),!0;case"dragenter":return Tt=It(Tt,e,t,n,i,r),!0;case"mouseover":return jt=It(jt,e,t,n,i,r),!0;case"pointerover":var o=r.pointerId;return Nt.set(o,It(Nt.get(o)||null,e,t,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Ot.set(o,It(Ot.get(o)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i))i.stopPropagation();else if(Rt(e,i),4&t&&-1<At.indexOf(e)){for(;null!==r;){var o=_r(r);if(null!==o&&xt(o),null===(o=Yt(e,t,n,i))&&Wi(e,t,i,Qt,n),o===r)break;r=o}null!==r&&i.stopPropagation()}else Wi(e,t,i,null,n)}}var Qt=null;function Yt(e,t,n,i){if(Qt=null,null!==(e=yr(e=xe(i))))if(null===(t=qe(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ve(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Qt=e,null}function Kt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case Je:return 1;case et:return 4;case tt:case nt:return 16;case it:return 536870912;default:return 16}default:return 16}}var $t=null,Xt=null,Jt=null;function en(){if(Jt)return Jt;var e,t,n=Xt,i=n.length,r="value"in $t?$t.value:$t.textContent,o=r.length;for(e=0;e<i&&n[e]===r[e];e++);var s=i-e;for(t=1;t<=s&&n[i-t]===r[o-t];t++);return Jt=r.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,i,r,o){for(var s in this._reactName=t,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(r):r[s]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var sn,an,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},un=on(cn),dn=z({},cn,{view:0,detail:0}),hn=on(dn),pn=z({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(sn=e.screenX-ln.screenX,an=e.screenY-ln.screenY):an=sn=0,ln=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:an}}),fn=on(pn),mn=on(z({},pn,{dataTransfer:0})),gn=on(z({},dn,{relatedTarget:0})),vn=on(z({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),yn=z({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_n=on(yn),bn=on(z({},cn,{data:0})),xn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},kn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=kn[e])&&!!t[e]}function Cn(){return Sn}var Ln=z({},dn,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),En=on(Ln),Pn=on(z({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tn=on(z({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),jn=on(z({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nn=z({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),On=on(Nn),Mn=[9,13,27,32],An=u&&"CompositionEvent"in window,Rn=null;u&&"documentMode"in document&&(Rn=document.documentMode);var In=u&&"TextEvent"in window&&!Rn,zn=u&&(!An||Rn&&8<Rn&&11>=Rn),Bn=String.fromCharCode(32),Dn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Un(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var qn=!1;var Vn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function Hn(e,t,n,i){Le(i),0<(t=Zi(t,"onChange")).length&&(n=new un("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Zn=null,Gn=null;function Qn(e){Bi(e,0)}function Yn(e){if(G(br(e)))return e}function Kn(e,t){if("change"===e)return t}var $n=!1;if(u){var Xn;if(u){var Jn="oninput"in document;if(!Jn){var ei=document.createElement("div");ei.setAttribute("oninput","return;"),Jn="function"===typeof ei.oninput}Xn=Jn}else Xn=!1;$n=Xn&&(!document.documentMode||9<document.documentMode)}function ti(){Zn&&(Zn.detachEvent("onpropertychange",ni),Gn=Zn=null)}function ni(e){if("value"===e.propertyName&&Yn(Gn)){var t=[];Hn(t,Gn,e,xe(e)),Ne(Qn,t)}}function ii(e,t,n){"focusin"===e?(ti(),Gn=n,(Zn=t).attachEvent("onpropertychange",ni)):"focusout"===e&&ti()}function ri(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yn(Gn)}function oi(e,t){if("click"===e)return Yn(t)}function si(e,t){if("input"===e||"change"===e)return Yn(t)}var ai="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function li(e,t){if(ai(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!d.call(t,r)||!ai(e[r],t[r]))return!1}return!0}function ci(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ui(e,t){var n,i=ci(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=ci(i)}}function di(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?di(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hi(){for(var e=window,t=Q();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(i){n=!1}if(!n)break;t=Q((e=t.contentWindow).document)}return t}function pi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function fi(e){var t=hi(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&di(n.ownerDocument.documentElement,n)){if(null!==i&&pi(n))if(t=i.start,void 0===(e=i.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var r=n.textContent.length,o=Math.min(i.start,r);i=void 0===i.end?o:Math.min(i.end,r),!e.extend&&o>i&&(r=i,i=o,o=r),r=ui(n,o);var s=ui(n,i);r&&s&&(1!==e.rangeCount||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(r.node,r.offset),e.removeAllRanges(),o>i?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mi=u&&"documentMode"in document&&11>=document.documentMode,gi=null,vi=null,yi=null,_i=!1;function bi(e,t,n){var i=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;_i||null==gi||gi!==Q(i)||("selectionStart"in(i=gi)&&pi(i)?i={start:i.selectionStart,end:i.selectionEnd}:i={anchorNode:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset},yi&&li(yi,i)||(yi=i,0<(i=Zi(vi,"onSelect")).length&&(t=new un("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=gi)))}function xi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var wi={animationend:xi("Animation","AnimationEnd"),animationiteration:xi("Animation","AnimationIteration"),animationstart:xi("Animation","AnimationStart"),transitionend:xi("Transition","TransitionEnd")},ki={},Si={};function Ci(e){if(ki[e])return ki[e];if(!wi[e])return e;var t,n=wi[e];for(t in n)if(n.hasOwnProperty(t)&&t in Si)return ki[e]=n[t];return e}u&&(Si=document.createElement("div").style,"AnimationEvent"in window||(delete wi.animationend.animation,delete wi.animationiteration.animation,delete wi.animationstart.animation),"TransitionEvent"in window||delete wi.transitionend.transition);var Li=Ci("animationend"),Ei=Ci("animationiteration"),Pi=Ci("animationstart"),Ti=Ci("transitionend"),ji=new Map,Ni="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Oi(e,t){ji.set(e,t),l(t,[e])}for(var Mi=0;Mi<Ni.length;Mi++){var Ai=Ni[Mi];Oi(Ai.toLowerCase(),"on"+(Ai[0].toUpperCase()+Ai.slice(1)))}Oi(Li,"onAnimationEnd"),Oi(Ei,"onAnimationIteration"),Oi(Pi,"onAnimationStart"),Oi("dblclick","onDoubleClick"),Oi("focusin","onFocus"),Oi("focusout","onBlur"),Oi(Ti,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ri="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ii=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ri));function zi(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,i,r,s,a,l,c){if(Ue.apply(this,arguments),Ie){if(!Ie)throw Error(o(198));var u=ze;Ie=!1,ze=null,Be||(Be=!0,De=u)}}(i,t,void 0,e),e.currentTarget=null}function Bi(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var s=i.length-1;0<=s;s--){var a=i[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&r.isPropagationStopped())break e;zi(r,a,c),o=l}else for(s=0;s<i.length;s++){if(l=(a=i[s]).instance,c=a.currentTarget,a=a.listener,l!==o&&r.isPropagationStopped())break e;zi(r,a,c),o=l}}}if(Be)throw e=De,Be=!1,De=null,e}function Di(e,t){var n=t[mr];void 0===n&&(n=t[mr]=new Set);var i=e+"__bubble";n.has(i)||(Vi(t,e,2,!1),n.add(i))}function Fi(e,t,n){var i=0;t&&(i|=4),Vi(n,e,i,t)}var Ui="_reactListening"+Math.random().toString(36).slice(2);function qi(e){if(!e[Ui]){e[Ui]=!0,s.forEach(function(t){"selectionchange"!==t&&(Ii.has(t)||Fi(t,!1,e),Fi(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Ui]||(t[Ui]=!0,Fi("selectionchange",!1,t))}}function Vi(e,t,n,i){switch(Kt(t)){case 1:var r=Ht;break;case 4:r=Zt;break;default:r=Gt}n=r.bind(null,t,n,e),r=void 0,!Me||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),i?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Wi(e,t,n,i,r){var o=i;if(0===(1&t)&&0===(2&t)&&null!==i)e:for(;;){if(null===i)return;var s=i.tag;if(3===s||4===s){var a=i.stateNode.containerInfo;if(a===r||8===a.nodeType&&a.parentNode===r)break;if(4===s)for(s=i.return;null!==s;){var l=s.tag;if((3===l||4===l)&&((l=s.stateNode.containerInfo)===r||8===l.nodeType&&l.parentNode===r))return;s=s.return}for(;null!==a;){if(null===(s=yr(a)))return;if(5===(l=s.tag)||6===l){i=o=s;continue e}a=a.parentNode}}i=i.return}Ne(function(){var i=o,r=xe(n),s=[];e:{var a=ji.get(e);if(void 0!==a){var l=un,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=En;break;case"focusin":c="focus",l=gn;break;case"focusout":c="blur",l=gn;break;case"beforeblur":case"afterblur":l=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Tn;break;case Li:case Ei:case Pi:l=vn;break;case Ti:l=jn;break;case"scroll":l=hn;break;case"wheel":l=On;break;case"copy":case"cut":case"paste":l=_n;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Pn}var u=0!==(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,f=i;null!==f;){var m=(p=f).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==h&&(null!=(m=Oe(f,h))&&u.push(Hi(f,m,p)))),d)break;f=f.return}0<u.length&&(a=new l(a,c,null,n,r),s.push({event:a,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===be||!(c=n.relatedTarget||n.fromElement)||!yr(c)&&!c[fr])&&(l||a)&&(a=r.window===r?r:(a=r.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=i,null!==(c=(c=n.relatedTarget||n.toElement)?yr(c):null)&&(c!==(d=qe(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=i),l!==c)){if(u=fn,m="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=Pn,m="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==l?a:br(l),p=null==c?a:br(c),(a=new u(m,f+"leave",l,n,r)).target=d,a.relatedTarget=p,m=null,yr(r)===i&&((u=new u(h,f+"enter",c,n,r)).target=p,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(h=c,f=0,p=u=l;p;p=Gi(p))f++;for(p=0,m=h;m;m=Gi(m))p++;for(;0<f-p;)u=Gi(u),f--;for(;0<p-f;)h=Gi(h),p--;for(;f--;){if(u===h||null!==h&&u===h.alternate)break e;u=Gi(u),h=Gi(h)}u=null}else u=null;null!==l&&Qi(s,a,l,u,!1),null!==c&&null!==d&&Qi(s,d,c,u,!0)}if("select"===(l=(a=i?br(i):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var g=Kn;else if(Wn(a))if($n)g=si;else{g=ri;var v=ii}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(g=oi);switch(g&&(g=g(e,i))?Hn(s,g,n,r):(v&&v(e,a,i),"focusout"===e&&(v=a._wrapperState)&&v.controlled&&"number"===a.type&&ee(a,"number",a.value)),v=i?br(i):window,e){case"focusin":(Wn(v)||"true"===v.contentEditable)&&(gi=v,vi=i,yi=null);break;case"focusout":yi=vi=gi=null;break;case"mousedown":_i=!0;break;case"contextmenu":case"mouseup":case"dragend":_i=!1,bi(s,n,r);break;case"selectionchange":if(mi)break;case"keydown":case"keyup":bi(s,n,r)}var y;if(An)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else qn?Fn(e,n)&&(_="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(_="onCompositionStart");_&&(zn&&"ko"!==n.locale&&(qn||"onCompositionStart"!==_?"onCompositionEnd"===_&&qn&&(y=en()):(Xt="value"in($t=r)?$t.value:$t.textContent,qn=!0)),0<(v=Zi(i,_)).length&&(_=new bn(_,e,null,n,r),s.push({event:_,listeners:v}),y?_.data=y:null!==(y=Un(n))&&(_.data=y))),(y=In?function(e,t){switch(e){case"compositionend":return Un(t);case"keypress":return 32!==t.which?null:(Dn=!0,Bn);case"textInput":return(e=t.data)===Bn&&Dn?null:e;default:return null}}(e,n):function(e,t){if(qn)return"compositionend"===e||!An&&Fn(e,t)?(e=en(),Jt=Xt=$t=null,qn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(i=Zi(i,"onBeforeInput")).length&&(r=new bn("onBeforeInput","beforeinput",null,n,r),s.push({event:r,listeners:i}),r.data=y))}Bi(s,t)})}function Hi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zi(e,t){for(var n=t+"Capture",i=[];null!==e;){var r=e,o=r.stateNode;5===r.tag&&null!==o&&(r=o,null!=(o=Oe(e,n))&&i.unshift(Hi(e,o,r)),null!=(o=Oe(e,t))&&i.push(Hi(e,o,r))),e=e.return}return i}function Gi(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Qi(e,t,n,i,r){for(var o=t._reactName,s=[];null!==n&&n!==i;){var a=n,l=a.alternate,c=a.stateNode;if(null!==l&&l===i)break;5===a.tag&&null!==c&&(a=c,r?null!=(l=Oe(n,o))&&s.unshift(Hi(n,l,a)):r||null!=(l=Oe(n,o))&&s.push(Hi(n,l,a))),n=n.return}0!==s.length&&e.push({event:t,listeners:s})}var Yi=/\r\n?/g,Ki=/\u0000|\uFFFD/g;function $i(e){return("string"===typeof e?e:""+e).replace(Yi,"\n").replace(Ki,"")}function Xi(e,t,n){if(t=$i(t),$i(e)!==t&&n)throw Error(o(425))}function Ji(){}var er=null,tr=null;function nr(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ir="function"===typeof setTimeout?setTimeout:void 0,rr="function"===typeof clearTimeout?clearTimeout:void 0,or="function"===typeof Promise?Promise:void 0,sr="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof or?function(e){return or.resolve(null).then(e).catch(ar)}:ir;function ar(e){setTimeout(function(){throw e})}function lr(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===i)return e.removeChild(r),void qt(t);i--}else"$"!==n&&"$?"!==n&&"$!"!==n||i++;n=r}while(n);qt(t)}function cr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ur(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var dr=Math.random().toString(36).slice(2),hr="__reactFiber$"+dr,pr="__reactProps$"+dr,fr="__reactContainer$"+dr,mr="__reactEvents$"+dr,gr="__reactListeners$"+dr,vr="__reactHandles$"+dr;function yr(e){var t=e[hr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fr]||n[hr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ur(e);null!==e;){if(n=e[hr])return n;e=ur(e)}return t}n=(e=n).parentNode}return null}function _r(e){return!(e=e[hr]||e[fr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function br(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function xr(e){return e[pr]||null}var wr=[],kr=-1;function Sr(e){return{current:e}}function Cr(e){0>kr||(e.current=wr[kr],wr[kr]=null,kr--)}function Lr(e,t){kr++,wr[kr]=e.current,e.current=t}var Er={},Pr=Sr(Er),Tr=Sr(!1),jr=Er;function Nr(e,t){var n=e.type.contextTypes;if(!n)return Er;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r,o={};for(r in n)o[r]=t[r];return i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Or(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Mr(){Cr(Tr),Cr(Pr)}function Ar(e,t,n){if(Pr.current!==Er)throw Error(o(168));Lr(Pr,t),Lr(Tr,n)}function Rr(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,"function"!==typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in t))throw Error(o(108,V(e)||"Unknown",r));return z({},n,i)}function Ir(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Er,jr=Pr.current,Lr(Pr,e),Lr(Tr,Tr.current),!0}function zr(e,t,n){var i=e.stateNode;if(!i)throw Error(o(169));n?(e=Rr(e,t,jr),i.__reactInternalMemoizedMergedChildContext=e,Cr(Tr),Cr(Pr),Lr(Pr,e)):Cr(Tr),Lr(Tr,n)}var Br=null,Dr=!1,Fr=!1;function Ur(e){null===Br?Br=[e]:Br.push(e)}function qr(){if(!Fr&&null!==Br){Fr=!0;var e=0,t=_t;try{var n=Br;for(_t=1;e<n.length;e++){var i=n[e];do{i=i(!0)}while(null!==i)}Br=null,Dr=!1}catch(r){throw null!==Br&&(Br=Br.slice(e+1)),Ge(Je,qr),r}finally{_t=t,Fr=!1}}return null}var Vr=[],Wr=0,Hr=null,Zr=0,Gr=[],Qr=0,Yr=null,Kr=1,$r="";function Xr(e,t){Vr[Wr++]=Zr,Vr[Wr++]=Hr,Hr=e,Zr=t}function Jr(e,t,n){Gr[Qr++]=Kr,Gr[Qr++]=$r,Gr[Qr++]=Yr,Yr=e;var i=Kr;e=$r;var r=32-st(i)-1;i&=~(1<<r),n+=1;var o=32-st(t)+r;if(30<o){var s=r-r%5;o=(i&(1<<s)-1).toString(32),i>>=s,r-=s,Kr=1<<32-st(t)+r|n<<r|i,$r=o+e}else Kr=1<<o|n<<r|i,$r=e}function eo(e){null!==e.return&&(Xr(e,1),Jr(e,1,0))}function to(e){for(;e===Hr;)Hr=Vr[--Wr],Vr[Wr]=null,Zr=Vr[--Wr],Vr[Wr]=null;for(;e===Yr;)Yr=Gr[--Qr],Gr[Qr]=null,$r=Gr[--Qr],Gr[Qr]=null,Kr=Gr[--Qr],Gr[Qr]=null}var no=null,io=null,ro=!1,oo=null;function so(e,t){var n=jc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ao(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,no=e,io=cr(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,no=e,io=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Yr?{id:Kr,overflow:$r}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=jc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,no=e,io=null,!0);default:return!1}}function lo(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function co(e){if(ro){var t=io;if(t){var n=t;if(!ao(e,t)){if(lo(e))throw Error(o(418));t=cr(n.nextSibling);var i=no;t&&ao(e,t)?so(i,n):(e.flags=-4097&e.flags|2,ro=!1,no=e)}}else{if(lo(e))throw Error(o(418));e.flags=-4097&e.flags|2,ro=!1,no=e}}}function uo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;no=e}function ho(e){if(e!==no)return!1;if(!ro)return uo(e),ro=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!nr(e.type,e.memoizedProps)),t&&(t=io)){if(lo(e))throw po(),Error(o(418));for(;t;)so(e,t),t=cr(t.nextSibling)}if(uo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){io=cr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}io=null}}else io=no?cr(e.stateNode.nextSibling):null;return!0}function po(){for(var e=io;e;)e=cr(e.nextSibling)}function fo(){io=no=null,ro=!1}function mo(e){null===oo?oo=[e]:oo.push(e)}var go=b.ReactCurrentBatchConfig;function vo(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var i=n.stateNode}if(!i)throw Error(o(147,e));var r=i,s=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=r.refs;null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!==typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function yo(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function _o(e){return(0,e._init)(e._payload)}function bo(e){function t(t,n){if(e){var i=t.deletions;null===i?(t.deletions=[n],t.flags|=16):i.push(n)}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function r(e,t){return(e=Oc(e,t)).index=0,e.sibling=null,e}function s(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags|=2,n):i:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,i){return null===t||6!==t.tag?((t=Ic(n,e.mode,i)).return=e,t):((t=r(t,n)).return=e,t)}function c(e,t,n,i){var o=n.type;return o===k?d(e,t,n.props.children,i,n.key):null!==t&&(t.elementType===o||"object"===typeof o&&null!==o&&o.$$typeof===O&&_o(o)===t.type)?((i=r(t,n.props)).ref=vo(e,t,n),i.return=e,i):((i=Mc(n.type,n.key,n.props,null,e.mode,i)).ref=vo(e,t,n),i.return=e,i)}function u(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=zc(n,e.mode,i)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function d(e,t,n,i,o){return null===t||7!==t.tag?((t=Ac(n,e.mode,i,o)).return=e,t):((t=r(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Ic(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case x:return(n=Mc(t.type,t.key,t.props,null,e.mode,n)).ref=vo(e,null,t),n.return=e,n;case w:return(t=zc(t,e.mode,n)).return=e,t;case O:return h(e,(0,t._init)(t._payload),n)}if(te(t)||R(t))return(t=Ac(t,e.mode,n,null)).return=e,t;yo(e,t)}return null}function p(e,t,n,i){var r=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==r?null:l(e,t,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case x:return n.key===r?c(e,t,n,i):null;case w:return n.key===r?u(e,t,n,i):null;case O:return p(e,t,(r=n._init)(n._payload),i)}if(te(n)||R(n))return null!==r?null:d(e,t,n,i,null);yo(e,n)}return null}function f(e,t,n,i,r){if("string"===typeof i&&""!==i||"number"===typeof i)return l(t,e=e.get(n)||null,""+i,r);if("object"===typeof i&&null!==i){switch(i.$$typeof){case x:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r);case w:return u(t,e=e.get(null===i.key?n:i.key)||null,i,r);case O:return f(e,t,n,(0,i._init)(i._payload),r)}if(te(i)||R(i))return d(t,e=e.get(n)||null,i,r,null);yo(t,i)}return null}function m(r,o,a,l){for(var c=null,u=null,d=o,m=o=0,g=null;null!==d&&m<a.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var v=p(r,d,a[m],l);if(null===v){null===d&&(d=g);break}e&&d&&null===v.alternate&&t(r,d),o=s(v,o,m),null===u?c=v:u.sibling=v,u=v,d=g}if(m===a.length)return n(r,d),ro&&Xr(r,m),c;if(null===d){for(;m<a.length;m++)null!==(d=h(r,a[m],l))&&(o=s(d,o,m),null===u?c=d:u.sibling=d,u=d);return ro&&Xr(r,m),c}for(d=i(r,d);m<a.length;m++)null!==(g=f(d,r,m,a[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),o=s(g,o,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),ro&&Xr(r,m),c}function g(r,a,l,c){var u=R(l);if("function"!==typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,m=a,g=a=0,v=null,y=l.next();null!==m&&!y.done;g++,y=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var _=p(r,m,y.value,c);if(null===_){null===m&&(m=v);break}e&&m&&null===_.alternate&&t(r,m),a=s(_,a,g),null===d?u=_:d.sibling=_,d=_,m=v}if(y.done)return n(r,m),ro&&Xr(r,g),u;if(null===m){for(;!y.done;g++,y=l.next())null!==(y=h(r,y.value,c))&&(a=s(y,a,g),null===d?u=y:d.sibling=y,d=y);return ro&&Xr(r,g),u}for(m=i(r,m);!y.done;g++,y=l.next())null!==(y=f(m,r,g,y.value,c))&&(e&&null!==y.alternate&&m.delete(null===y.key?g:y.key),a=s(y,a,g),null===d?u=y:d.sibling=y,d=y);return e&&m.forEach(function(e){return t(r,e)}),ro&&Xr(r,g),u}return function e(i,o,s,l){if("object"===typeof s&&null!==s&&s.type===k&&null===s.key&&(s=s.props.children),"object"===typeof s&&null!==s){switch(s.$$typeof){case x:e:{for(var c=s.key,u=o;null!==u;){if(u.key===c){if((c=s.type)===k){if(7===u.tag){n(i,u.sibling),(o=r(u,s.props.children)).return=i,i=o;break e}}else if(u.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===O&&_o(c)===u.type){n(i,u.sibling),(o=r(u,s.props)).ref=vo(i,u,s),o.return=i,i=o;break e}n(i,u);break}t(i,u),u=u.sibling}s.type===k?((o=Ac(s.props.children,i.mode,l,s.key)).return=i,i=o):((l=Mc(s.type,s.key,s.props,null,i.mode,l)).ref=vo(i,o,s),l.return=i,i=l)}return a(i);case w:e:{for(u=s.key;null!==o;){if(o.key===u){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){n(i,o.sibling),(o=r(o,s.children||[])).return=i,i=o;break e}n(i,o);break}t(i,o),o=o.sibling}(o=zc(s,i.mode,l)).return=i,i=o}return a(i);case O:return e(i,o,(u=s._init)(s._payload),l)}if(te(s))return m(i,o,s,l);if(R(s))return g(i,o,s,l);yo(i,s)}return"string"===typeof s&&""!==s||"number"===typeof s?(s=""+s,null!==o&&6===o.tag?(n(i,o.sibling),(o=r(o,s)).return=i,i=o):(n(i,o),(o=Ic(s,i.mode,l)).return=i,i=o),a(i)):n(i,o)}}var xo=bo(!0),wo=bo(!1),ko=Sr(null),So=null,Co=null,Lo=null;function Eo(){Lo=Co=So=null}function Po(e){var t=ko.current;Cr(ko),e._currentValue=t}function To(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function jo(e,t){So=e,Lo=Co=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(_a=!0),e.firstContext=null)}function No(e){var t=e._currentValue;if(Lo!==e)if(e={context:e,memoizedValue:t,next:null},null===Co){if(null===So)throw Error(o(308));Co=e,So.dependencies={lanes:0,firstContext:e}}else Co=Co.next=e;return t}var Oo=null;function Mo(e){null===Oo?Oo=[e]:Oo.push(e)}function Ao(e,t,n,i){var r=t.interleaved;return null===r?(n.next=n,Mo(t)):(n.next=r.next,r.next=n),t.interleaved=n,Ro(e,i)}function Ro(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Io=!1;function zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Do(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fo(e,t,n){var i=e.updateQueue;if(null===i)return null;if(i=i.shared,0!==(2&El)){var r=i.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),i.pending=t,Ro(e,n)}return null===(r=i.interleaved)?(t.next=t,Mo(i)):(t.next=r.next,r.next=t),i.interleaved=t,Ro(e,n)}function Uo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,yt(e,n)}}function qo(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?r=o=s:o=o.next=s,n=n.next}while(null!==n);null===o?r=o=t:o=o.next=t}else r=o=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vo(e,t,n,i){var r=e.updateQueue;Io=!1;var o=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(null!==a){r.shared.pending=null;var l=a,c=l.next;l.next=null,null===s?o=c:s.next=c,s=l;var u=e.alternate;null!==u&&((a=(u=u.updateQueue).lastBaseUpdate)!==s&&(null===a?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(null!==o){var d=r.baseState;for(s=0,u=c=l=null,a=o;;){var h=a.lane,p=a.eventTime;if((i&h)===h){null!==u&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,m=a;switch(h=t,p=n,m.tag){case 1:if("function"===typeof(f=m.payload)){d=f.call(p,d,h);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(h="function"===typeof(f=m.payload)?f.call(p,d,h):f)||void 0===h)break e;d=z({},d,h);break e;case 2:Io=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(h=r.effects)?r.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,s|=h;if(null===(a=a.next)){if(null===(a=r.shared.pending))break;a=(h=a).next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}if(null===u&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,null!==(t=r.shared.interleaved)){r=t;do{s|=r.lane,r=r.next}while(r!==t)}else null===o&&(r.shared.lanes=0);Rl|=s,e.lanes=s,e.memoizedState=d}}function Wo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],r=i.callback;if(null!==r){if(i.callback=null,i=n,"function"!==typeof r)throw Error(o(191,r));r.call(i)}}}var Ho={},Zo=Sr(Ho),Go=Sr(Ho),Qo=Sr(Ho);function Yo(e){if(e===Ho)throw Error(o(174));return e}function Ko(e,t){switch(Lr(Qo,t),Lr(Go,e),Lr(Zo,Ho),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Cr(Zo),Lr(Zo,t)}function $o(){Cr(Zo),Cr(Go),Cr(Qo)}function Xo(e){Yo(Qo.current);var t=Yo(Zo.current),n=le(t,e.type);t!==n&&(Lr(Go,e),Lr(Zo,n))}function Jo(e){Go.current===e&&(Cr(Zo),Cr(Go))}var es=Sr(0);function ts(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ns=[];function is(){for(var e=0;e<ns.length;e++)ns[e]._workInProgressVersionPrimary=null;ns.length=0}var rs=b.ReactCurrentDispatcher,os=b.ReactCurrentBatchConfig,ss=0,as=null,ls=null,cs=null,us=!1,ds=!1,hs=0,ps=0;function fs(){throw Error(o(321))}function ms(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ai(e[n],t[n]))return!1;return!0}function gs(e,t,n,i,r,s){if(ss=s,as=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rs.current=null===e||null===e.memoizedState?Js:ea,e=n(i,r),ds){s=0;do{if(ds=!1,hs=0,25<=s)throw Error(o(301));s+=1,cs=ls=null,t.updateQueue=null,rs.current=ta,e=n(i,r)}while(ds)}if(rs.current=Xs,t=null!==ls&&null!==ls.next,ss=0,cs=ls=as=null,us=!1,t)throw Error(o(300));return e}function vs(){var e=0!==hs;return hs=0,e}function ys(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===cs?as.memoizedState=cs=e:cs=cs.next=e,cs}function _s(){if(null===ls){var e=as.alternate;e=null!==e?e.memoizedState:null}else e=ls.next;var t=null===cs?as.memoizedState:cs.next;if(null!==t)cs=t,ls=e;else{if(null===e)throw Error(o(310));e={memoizedState:(ls=e).memoizedState,baseState:ls.baseState,baseQueue:ls.baseQueue,queue:ls.queue,next:null},null===cs?as.memoizedState=cs=e:cs=cs.next=e}return cs}function bs(e,t){return"function"===typeof t?t(e):t}function xs(e){var t=_s(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var i=ls,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var a=r.next;r.next=s.next,s.next=a}i.baseQueue=r=s,n.pending=null}if(null!==r){s=r.next,i=i.baseState;var l=a=null,c=null,u=s;do{var d=u.lane;if((ss&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,a=i):c=c.next=h,as.lanes|=d,Rl|=d}u=u.next}while(null!==u&&u!==s);null===c?a=i:c.next=l,ai(i,t.memoizedState)||(_a=!0),t.memoizedState=i,t.baseState=a,t.baseQueue=c,n.lastRenderedState=i}if(null!==(e=n.interleaved)){r=e;do{s=r.lane,as.lanes|=s,Rl|=s,r=r.next}while(r!==e)}else null===r&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ws(e){var t=_s(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,s=t.memoizedState;if(null!==r){n.pending=null;var a=r=r.next;do{s=e(s,a.action),a=a.next}while(a!==r);ai(s,t.memoizedState)||(_a=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,i]}function ks(){}function Ss(e,t){var n=as,i=_s(),r=t(),s=!ai(i.memoizedState,r);if(s&&(i.memoizedState=r,_a=!0),i=i.queue,Is(Es.bind(null,n,i,e),[e]),i.getSnapshot!==t||s||null!==cs&&1&cs.memoizedState.tag){if(n.flags|=2048,Ns(9,Ls.bind(null,n,i,r,t),void 0,null),null===Pl)throw Error(o(349));0!==(30&ss)||Cs(n,t,r)}return r}function Cs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=as.updateQueue)?(t={lastEffect:null,stores:null},as.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ls(e,t,n,i){t.value=n,t.getSnapshot=i,Ps(t)&&Ts(e)}function Es(e,t,n){return n(function(){Ps(t)&&Ts(e)})}function Ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ai(e,n)}catch(i){return!0}}function Ts(e){var t=Ro(e,1);null!==t&&tc(t,e,1,-1)}function js(e){var t=ys();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:e},t.queue=e,e=e.dispatch=Qs.bind(null,as,e),[t.memoizedState,e]}function Ns(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},null===(t=as.updateQueue)?(t={lastEffect:null,stores:null},as.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Os(){return _s().memoizedState}function Ms(e,t,n,i){var r=ys();as.flags|=e,r.memoizedState=Ns(1|t,n,void 0,void 0===i?null:i)}function As(e,t,n,i){var r=_s();i=void 0===i?null:i;var o=void 0;if(null!==ls){var s=ls.memoizedState;if(o=s.destroy,null!==i&&ms(i,s.deps))return void(r.memoizedState=Ns(t,n,o,i))}as.flags|=e,r.memoizedState=Ns(1|t,n,o,i)}function Rs(e,t){return Ms(8390656,8,e,t)}function Is(e,t){return As(2048,8,e,t)}function zs(e,t){return As(4,2,e,t)}function Bs(e,t){return As(4,4,e,t)}function Ds(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Fs(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,As(4,4,Ds.bind(null,t,e),n)}function Us(){}function qs(e,t){var n=_s();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&ms(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Vs(e,t){var n=_s();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&ms(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function Ws(e,t,n){return 0===(21&ss)?(e.baseState&&(e.baseState=!1,_a=!0),e.memoizedState=n):(ai(n,t)||(n=mt(),as.lanes|=n,Rl|=n,e.baseState=!0),t)}function Hs(e,t){var n=_t;_t=0!==n&&4>n?n:4,e(!0);var i=os.transition;os.transition={};try{e(!1),t()}finally{_t=n,os.transition=i}}function Zs(){return _s().memoizedState}function Gs(e,t,n){var i=ec(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Ys(e))Ks(t,n);else if(null!==(n=Ao(e,t,n,i))){tc(n,e,i,Jl()),$s(n,t,i)}}function Qs(e,t,n){var i=ec(e),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ys(e))Ks(t,r);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=o(s,n);if(r.hasEagerState=!0,r.eagerState=a,ai(a,s)){var l=t.interleaved;return null===l?(r.next=r,Mo(t)):(r.next=l.next,l.next=r),void(t.interleaved=r)}}catch(c){}null!==(n=Ao(e,t,r,i))&&(tc(n,e,i,r=Jl()),$s(n,t,i))}}function Ys(e){var t=e.alternate;return e===as||null!==t&&t===as}function Ks(e,t){ds=us=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $s(e,t,n){if(0!==(4194240&n)){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,yt(e,n)}}var Xs={readContext:No,useCallback:fs,useContext:fs,useEffect:fs,useImperativeHandle:fs,useInsertionEffect:fs,useLayoutEffect:fs,useMemo:fs,useReducer:fs,useRef:fs,useState:fs,useDebugValue:fs,useDeferredValue:fs,useTransition:fs,useMutableSource:fs,useSyncExternalStore:fs,useId:fs,unstable_isNewReconciler:!1},Js={readContext:No,useCallback:function(e,t){return ys().memoizedState=[e,void 0===t?null:t],e},useContext:No,useEffect:Rs,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ms(4194308,4,Ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ms(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ms(4,2,e,t)},useMemo:function(e,t){var n=ys();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=ys();return t=void 0!==n?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Gs.bind(null,as,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},ys().memoizedState=e},useState:js,useDebugValue:Us,useDeferredValue:function(e){return ys().memoizedState=e},useTransition:function(){var e=js(!1),t=e[0];return e=Hs.bind(null,e[1]),ys().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=as,r=ys();if(ro){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===Pl)throw Error(o(349));0!==(30&ss)||Cs(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,Rs(Es.bind(null,i,s,e),[e]),i.flags|=2048,Ns(9,Ls.bind(null,i,s,n,t),void 0,null),n},useId:function(){var e=ys(),t=Pl.identifierPrefix;if(ro){var n=$r;t=":"+t+"R"+(n=(Kr&~(1<<32-st(Kr)-1)).toString(32)+n),0<(n=hs++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ps++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ea={readContext:No,useCallback:qs,useContext:No,useEffect:Is,useImperativeHandle:Fs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Vs,useReducer:xs,useRef:Os,useState:function(){return xs(bs)},useDebugValue:Us,useDeferredValue:function(e){return Ws(_s(),ls.memoizedState,e)},useTransition:function(){return[xs(bs)[0],_s().memoizedState]},useMutableSource:ks,useSyncExternalStore:Ss,useId:Zs,unstable_isNewReconciler:!1},ta={readContext:No,useCallback:qs,useContext:No,useEffect:Is,useImperativeHandle:Fs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Vs,useReducer:ws,useRef:Os,useState:function(){return ws(bs)},useDebugValue:Us,useDeferredValue:function(e){var t=_s();return null===ls?t.memoizedState=e:Ws(t,ls.memoizedState,e)},useTransition:function(){return[ws(bs)[0],_s().memoizedState]},useMutableSource:ks,useSyncExternalStore:Ss,useId:Zs,unstable_isNewReconciler:!1};function na(e,t){if(e&&e.defaultProps){for(var n in t=z({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function ia(e,t,n,i){n=null===(n=n(i,t=e.memoizedState))||void 0===n?t:z({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ra={isMounted:function(e){return!!(e=e._reactInternals)&&qe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Jl(),r=ec(e),o=Do(i,r);o.payload=t,void 0!==n&&null!==n&&(o.callback=n),null!==(t=Fo(e,o,r))&&(tc(t,e,r,i),Uo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Jl(),r=ec(e),o=Do(i,r);o.tag=1,o.payload=t,void 0!==n&&null!==n&&(o.callback=n),null!==(t=Fo(e,o,r))&&(tc(t,e,r,i),Uo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Jl(),i=ec(e),r=Do(n,i);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),null!==(t=Fo(e,r,i))&&(tc(t,e,i,n),Uo(t,e,i))}};function oa(e,t,n,i,r,o,s){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,o,s):!t.prototype||!t.prototype.isPureReactComponent||(!li(n,i)||!li(r,o))}function sa(e,t,n){var i=!1,r=Er,o=t.contextType;return"object"===typeof o&&null!==o?o=No(o):(r=Or(t)?jr:Pr.current,o=(i=null!==(i=t.contextTypes)&&void 0!==i)?Nr(e,r):Er),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ra,e.stateNode=t,t._reactInternals=e,i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=o),t}function aa(e,t,n,i){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&ra.enqueueReplaceState(t,t.state,null)}function la(e,t,n,i){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},zo(e);var o=t.contextType;"object"===typeof o&&null!==o?r.context=No(o):(o=Or(t)?jr:Pr.current,r.context=Nr(e,o)),r.state=e.memoizedState,"function"===typeof(o=t.getDerivedStateFromProps)&&(ia(e,t,o,n),r.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof r.getSnapshotBeforeUpdate||"function"!==typeof r.UNSAFE_componentWillMount&&"function"!==typeof r.componentWillMount||(t=r.state,"function"===typeof r.componentWillMount&&r.componentWillMount(),"function"===typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),t!==r.state&&ra.enqueueReplaceState(r,r.state,null),Vo(e,n,r,i),r.state=e.memoizedState),"function"===typeof r.componentDidMount&&(e.flags|=4194308)}function ca(e,t){try{var n="",i=t;do{n+=U(i),i=i.return}while(i);var r=n}catch(o){r="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:r,digest:null}}function ua(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function da(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ha="function"===typeof WeakMap?WeakMap:Map;function pa(e,t,n){(n=Do(-1,n)).tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Vl||(Vl=!0,Wl=i),da(0,t)},n}function fa(e,t,n){(n=Do(-1,n)).tag=3;var i=e.type.getDerivedStateFromError;if("function"===typeof i){var r=t.value;n.payload=function(){return i(r)},n.callback=function(){da(0,t)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){da(0,t),"function"!==typeof i&&(null===Hl?Hl=new Set([this]):Hl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ma(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new ha;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(r.add(n),e=Sc.bind(null,e,t,n),t.then(e,e))}function ga(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function va(e,t,n,i,r){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Do(-1,1)).tag=2,Fo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=r,e)}var ya=b.ReactCurrentOwner,_a=!1;function ba(e,t,n,i){t.child=null===e?wo(t,null,n,i):xo(t,e.child,n,i)}function xa(e,t,n,i,r){n=n.render;var o=t.ref;return jo(t,r),i=gs(e,t,n,i,o,r),n=vs(),null===e||_a?(ro&&n&&eo(t),t.flags|=1,ba(e,t,i,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Va(e,t,r))}function wa(e,t,n,i,r){if(null===e){var o=n.type;return"function"!==typeof o||Nc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Mc(n.type,null,i,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,ka(e,t,o,i,r))}if(o=e.child,0===(e.lanes&r)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:li)(s,i)&&e.ref===t.ref)return Va(e,t,r)}return t.flags|=1,(e=Oc(o,i)).ref=t.ref,e.return=t,t.child=e}function ka(e,t,n,i,r){if(null!==e){var o=e.memoizedProps;if(li(o,i)&&e.ref===t.ref){if(_a=!1,t.pendingProps=i=o,0===(e.lanes&r))return t.lanes=e.lanes,Va(e,t,r);0!==(131072&e.flags)&&(_a=!0)}}return La(e,t,n,i,r)}function Sa(e,t,n){var i=t.pendingProps,r=i.children,o=null!==e?e.memoizedState:null;if("hidden"===i.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lr(Ol,Nl),Nl|=n;else{if(0===(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Lr(Ol,Nl),Nl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==o?o.baseLanes:n,Lr(Ol,Nl),Nl|=i}else null!==o?(i=o.baseLanes|n,t.memoizedState=null):i=n,Lr(Ol,Nl),Nl|=i;return ba(e,t,r,n),t.child}function Ca(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function La(e,t,n,i,r){var o=Or(n)?jr:Pr.current;return o=Nr(t,o),jo(t,r),n=gs(e,t,n,i,o,r),i=vs(),null===e||_a?(ro&&i&&eo(t),t.flags|=1,ba(e,t,n,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Va(e,t,r))}function Ea(e,t,n,i,r){if(Or(n)){var o=!0;Ir(t)}else o=!1;if(jo(t,r),null===t.stateNode)qa(e,t),sa(t,n,i),la(t,n,i,r),i=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;"object"===typeof c&&null!==c?c=No(c):c=Nr(t,c=Or(n)?jr:Pr.current);var u=n.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof s.getSnapshotBeforeUpdate;d||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==i||l!==c)&&aa(t,s,i,c),Io=!1;var h=t.memoizedState;s.state=h,Vo(t,i,s,r),l=t.memoizedState,a!==i||h!==l||Tr.current||Io?("function"===typeof u&&(ia(t,n,u,i),l=t.memoizedState),(a=Io||oa(t,n,a,i,h,l,c))?(d||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4194308)):("function"===typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),s.props=i,s.state=l,s.context=c,i=a):("function"===typeof s.componentDidMount&&(t.flags|=4194308),i=!1)}else{s=t.stateNode,Bo(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:na(t.type,a),s.props=c,d=t.pendingProps,h=s.context,"object"===typeof(l=n.contextType)&&null!==l?l=No(l):l=Nr(t,l=Or(n)?jr:Pr.current);var p=n.getDerivedStateFromProps;(u="function"===typeof p||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==d||h!==l)&&aa(t,s,i,l),Io=!1,h=t.memoizedState,s.state=h,Vo(t,i,s,r);var f=t.memoizedState;a!==d||h!==f||Tr.current||Io?("function"===typeof p&&(ia(t,n,p,i),f=t.memoizedState),(c=Io||oa(t,n,c,i,h,f,l)||!1)?(u||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(i,f,l),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(i,f,l)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=f),s.props=i,s.state=f,s.context=l,i=c):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return Pa(e,t,n,i,o,r)}function Pa(e,t,n,i,r,o){Ca(e,t);var s=0!==(128&t.flags);if(!i&&!s)return r&&zr(t,n,!1),Va(e,t,o);i=t.stateNode,ya.current=t;var a=s&&"function"!==typeof n.getDerivedStateFromError?null:i.render();return t.flags|=1,null!==e&&s?(t.child=xo(t,e.child,null,o),t.child=xo(t,null,a,o)):ba(e,t,a,o),t.memoizedState=i.state,r&&zr(t,n,!0),t.child}function Ta(e){var t=e.stateNode;t.pendingContext?Ar(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ar(0,t.context,!1),Ko(e,t.containerInfo)}function ja(e,t,n,i,r){return fo(),mo(r),t.flags|=256,ba(e,t,n,i),t.child}var Na,Oa,Ma,Aa={dehydrated:null,treeContext:null,retryLane:0};function Ra(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ia(e,t,n){var i,r=t.pendingProps,s=es.current,a=!1,l=0!==(128&t.flags);if((i=l)||(i=(null===e||null!==e.memoizedState)&&0!==(2&s)),i?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),Lr(es,1&s),null===e)return co(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=r.children,e=r.fallback,a?(r=t.mode,a=t.child,l={mode:"hidden",children:l},0===(1&r)&&null!==a?(a.childLanes=0,a.pendingProps=l):a=Rc(l,r,0,null),e=Ac(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ra(n),t.memoizedState=Aa,e):za(t,l));if(null!==(s=e.memoizedState)&&null!==(i=s.dehydrated))return function(e,t,n,i,r,s,a){if(n)return 256&t.flags?(t.flags&=-257,Ba(e,t,a,i=ua(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,r=t.mode,i=Rc({mode:"visible",children:i.children},r,0,null),(s=Ac(s,r,a,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!==(1&t.mode)&&xo(t,e.child,null,a),t.child.memoizedState=Ra(a),t.memoizedState=Aa,s);if(0===(1&t.mode))return Ba(e,t,a,null);if("$!"===r.data){if(i=r.nextSibling&&r.nextSibling.dataset)var l=i.dgst;return i=l,Ba(e,t,a,i=ua(s=Error(o(419)),i,void 0))}if(l=0!==(a&e.childLanes),_a||l){if(null!==(i=Pl)){switch(a&-a){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!==(r&(i.suspendedLanes|a))?0:r)&&r!==s.retryLane&&(s.retryLane=r,Ro(e,r),tc(i,e,r,-1))}return fc(),Ba(e,t,a,i=ua(Error(o(421))))}return"$?"===r.data?(t.flags|=128,t.child=e.child,t=Lc.bind(null,e),r._reactRetry=t,null):(e=s.treeContext,io=cr(r.nextSibling),no=t,ro=!0,oo=null,null!==e&&(Gr[Qr++]=Kr,Gr[Qr++]=$r,Gr[Qr++]=Yr,Kr=e.id,$r=e.overflow,Yr=t),t=za(t,i.children),t.flags|=4096,t)}(e,t,l,r,i,s,n);if(a){a=r.fallback,l=t.mode,i=(s=e.child).sibling;var c={mode:"hidden",children:r.children};return 0===(1&l)&&t.child!==s?((r=t.child).childLanes=0,r.pendingProps=c,t.deletions=null):(r=Oc(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==i?a=Oc(i,a):(a=Ac(a,l,n,null)).flags|=2,a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,l=null===(l=e.child.memoizedState)?Ra(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=Aa,r}return e=(a=e.child).sibling,r=Oc(a,{mode:"visible",children:r.children}),0===(1&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function za(e,t){return(t=Rc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ba(e,t,n,i){return null!==i&&mo(i),xo(t,e.child,null,n),(e=za(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Da(e,t,n){e.lanes|=t;var i=e.alternate;null!==i&&(i.lanes|=t),To(e.return,t,n)}function Fa(e,t,n,i,r){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=r)}function Ua(e,t,n){var i=t.pendingProps,r=i.revealOrder,o=i.tail;if(ba(e,t,i.children,n),0!==(2&(i=es.current)))i=1&i|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Da(e,n,t);else if(19===e.tag)Da(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Lr(es,i),0===(1&t.mode))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===ts(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Fa(t,!1,r,n,o);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===ts(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Fa(t,!0,n,null,o);break;case"together":Fa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qa(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Va(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Rl|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Oc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Oc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Wa(e,t){if(!ro)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Ha(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=14680064&r.subtreeFlags,i|=14680064&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Za(e,t,n){var i=t.pendingProps;switch(to(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ha(t),null;case 1:case 17:return Or(t.type)&&Mr(),Ha(t),null;case 3:return i=t.stateNode,$o(),Cr(Tr),Cr(Pr),is(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(ho(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==oo&&(oc(oo),oo=null))),Ha(t),null;case 5:Jo(t);var r=Yo(Qo.current);if(n=t.type,null!==e&&null!=t.stateNode)Oa(e,t,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(null===t.stateNode)throw Error(o(166));return Ha(t),null}if(e=Yo(Zo.current),ho(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[hr]=t,i[pr]=s,e=0!==(1&t.mode),n){case"dialog":Di("cancel",i),Di("close",i);break;case"iframe":case"object":case"embed":Di("load",i);break;case"video":case"audio":for(r=0;r<Ri.length;r++)Di(Ri[r],i);break;case"source":Di("error",i);break;case"img":case"image":case"link":Di("error",i),Di("load",i);break;case"details":Di("toggle",i);break;case"input":K(i,s),Di("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Di("invalid",i);break;case"textarea":re(i,s),Di("invalid",i)}for(var l in ye(n,s),r=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"===typeof c?i.textContent!==c&&(!0!==s.suppressHydrationWarning&&Xi(i.textContent,c,e),r=["children",c]):"number"===typeof c&&i.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Xi(i.textContent,c,e),r=["children",""+c]):a.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Di("scroll",i)}switch(n){case"input":Z(i),J(i,s,!0);break;case"textarea":Z(i),se(i);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(i.onclick=Ji)}i=r,t.updateQueue=i,null!==i&&(t.flags|=4)}else{l=9===r.nodeType?r:r.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ae(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof i.is?e=l.createElement(n,{is:i.is}):(e=l.createElement(n),"select"===n&&(l=e,i.multiple?l.multiple=!0:i.size&&(l.size=i.size))):e=l.createElementNS(e,n),e[hr]=t,e[pr]=i,Na(e,t),t.stateNode=e;e:{switch(l=_e(n,i),n){case"dialog":Di("cancel",e),Di("close",e),r=i;break;case"iframe":case"object":case"embed":Di("load",e),r=i;break;case"video":case"audio":for(r=0;r<Ri.length;r++)Di(Ri[r],e);r=i;break;case"source":Di("error",e),r=i;break;case"img":case"image":case"link":Di("error",e),Di("load",e),r=i;break;case"details":Di("toggle",e),r=i;break;case"input":K(e,i),r=Y(e,i),Di("invalid",e);break;case"option":default:r=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},r=z({},i,{value:void 0}),Di("invalid",e);break;case"textarea":re(e,i),r=ie(e,i),Di("invalid",e)}for(s in ye(n,r),c=r)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?ge(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&de(e,u):"children"===s?"string"===typeof u?("textarea"!==n||""!==u)&&he(e,u):"number"===typeof u&&he(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(a.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Di("scroll",e):null!=u&&_(e,s,u,l))}switch(n){case"input":Z(e),J(e,i,!1);break;case"textarea":Z(e),se(e);break;case"option":null!=i.value&&e.setAttribute("value",""+W(i.value));break;case"select":e.multiple=!!i.multiple,null!=(s=i.value)?ne(e,!!i.multiple,s,!1):null!=i.defaultValue&&ne(e,!!i.multiple,i.defaultValue,!0);break;default:"function"===typeof r.onClick&&(e.onclick=Ji)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ha(t),null;case 6:if(e&&null!=t.stateNode)Ma(0,t,e.memoizedProps,i);else{if("string"!==typeof i&&null===t.stateNode)throw Error(o(166));if(n=Yo(Qo.current),Yo(Zo.current),ho(t)){if(i=t.stateNode,n=t.memoizedProps,i[hr]=t,(s=i.nodeValue!==n)&&null!==(e=no))switch(e.tag){case 3:Xi(i.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xi(i.nodeValue,n,0!==(1&e.mode))}s&&(t.flags|=4)}else(i=(9===n.nodeType?n:n.ownerDocument).createTextNode(i))[hr]=t,t.stateNode=i}return Ha(t),null;case 13:if(Cr(es),i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ro&&null!==io&&0!==(1&t.mode)&&0===(128&t.flags))po(),fo(),t.flags|=98560,s=!1;else if(s=ho(t),null!==i&&null!==i.dehydrated){if(null===e){if(!s)throw Error(o(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(o(317));s[hr]=t}else fo(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ha(t),s=!1}else null!==oo&&(oc(oo),oo=null),s=!0;if(!s)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((i=null!==i)!==(null!==e&&null!==e.memoizedState)&&i&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&es.current)?0===Ml&&(Ml=3):fc())),null!==t.updateQueue&&(t.flags|=4),Ha(t),null);case 4:return $o(),null===e&&qi(t.stateNode.containerInfo),Ha(t),null;case 10:return Po(t.type._context),Ha(t),null;case 19:if(Cr(es),null===(s=t.memoizedState))return Ha(t),null;if(i=0!==(128&t.flags),null===(l=s.rendering))if(i)Wa(s,!1);else{if(0!==Ml||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ts(e))){for(t.flags|=128,Wa(s,!1),null!==(i=l.updateQueue)&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;null!==n;)e=i,(s=n).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Lr(es,1&es.current|2),t.child}e=e.sibling}null!==s.tail&&$e()>Ul&&(t.flags|=128,i=!0,Wa(s,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=ts(l))){if(t.flags|=128,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Wa(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!ro)return Ha(t),null}else 2*$e()-s.renderingStartTime>Ul&&1073741824!==n&&(t.flags|=128,i=!0,Wa(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=s.last)?n.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=$e(),t.sibling=null,n=es.current,Lr(es,i?1&n|2:1&n),t):(Ha(t),null);case 22:case 23:return uc(),i=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==i&&(t.flags|=8192),i&&0!==(1&t.mode)?0!==(1073741824&Nl)&&(Ha(t),6&t.subtreeFlags&&(t.flags|=8192)):Ha(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Ga(e,t){switch(to(t),t.tag){case 1:return Or(t.type)&&Mr(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return $o(),Cr(Tr),Cr(Pr),is(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Jo(t),null;case 13:if(Cr(es),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));fo()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Cr(es),null;case 4:return $o(),null;case 10:return Po(t.type._context),null;case 22:case 23:return uc(),null;default:return null}}Na=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Oa=function(e,t,n,i){var r=e.memoizedProps;if(r!==i){e=t.stateNode,Yo(Zo.current);var o,s=null;switch(n){case"input":r=Y(e,r),i=Y(e,i),s=[];break;case"select":r=z({},r,{value:void 0}),i=z({},i,{value:void 0}),s=[];break;case"textarea":r=ie(e,r),i=ie(e,i),s=[];break;default:"function"!==typeof r.onClick&&"function"===typeof i.onClick&&(e.onclick=Ji)}for(u in ye(n,i),n=null,r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&null!=r[u])if("style"===u){var l=r[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(a.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in i){var c=i[u];if(l=null!=r?r[u]:void 0,i.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!==typeof c&&"number"!==typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(a.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Di("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},Ma=function(e,t,n,i){n!==i&&(t.flags|=4)};var Qa=!1,Ya=!1,Ka="function"===typeof WeakSet?WeakSet:Set,$a=null;function Xa(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(i){kc(e,t,i)}else n.current=null}function Ja(e,t,n){try{n()}catch(i){kc(e,t,i)}}var el=!1;function tl(e,t,n){var i=t.updateQueue;if(null!==(i=null!==i?i.lastEffect:null)){var r=i=i.next;do{if((r.tag&e)===e){var o=r.destroy;r.destroy=void 0,void 0!==o&&Ja(t,n,o)}r=r.next}while(r!==i)}}function nl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function il(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function rl(e){var t=e.alternate;null!==t&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[hr],delete t[pr],delete t[mr],delete t[gr],delete t[vr])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ol(e){return 5===e.tag||3===e.tag||4===e.tag}function sl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function al(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Ji));else if(4!==i&&null!==(e=e.child))for(al(e,t,n),e=e.sibling;null!==e;)al(e,t,n),e=e.sibling}function ll(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==i&&null!==(e=e.child))for(ll(e,t,n),e=e.sibling;null!==e;)ll(e,t,n),e=e.sibling}var cl=null,ul=!1;function dl(e,t,n){for(n=n.child;null!==n;)hl(e,t,n),n=n.sibling}function hl(e,t,n){if(ot&&"function"===typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(rt,n)}catch(a){}switch(n.tag){case 5:Ya||Xa(n,t);case 6:var i=cl,r=ul;cl=null,dl(e,t,n),ul=r,null!==(cl=i)&&(ul?(e=cl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):cl.removeChild(n.stateNode));break;case 18:null!==cl&&(ul?(e=cl,n=n.stateNode,8===e.nodeType?lr(e.parentNode,n):1===e.nodeType&&lr(e,n),qt(e)):lr(cl,n.stateNode));break;case 4:i=cl,r=ul,cl=n.stateNode.containerInfo,ul=!0,dl(e,t,n),cl=i,ul=r;break;case 0:case 11:case 14:case 15:if(!Ya&&(null!==(i=n.updateQueue)&&null!==(i=i.lastEffect))){r=i=i.next;do{var o=r,s=o.destroy;o=o.tag,void 0!==s&&(0!==(2&o)||0!==(4&o))&&Ja(n,t,s),r=r.next}while(r!==i)}dl(e,t,n);break;case 1:if(!Ya&&(Xa(n,t),"function"===typeof(i=n.stateNode).componentWillUnmount))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){kc(n,t,a)}dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:1&n.mode?(Ya=(i=Ya)||null!==n.memoizedState,dl(e,t,n),Ya=i):dl(e,t,n);break;default:dl(e,t,n)}}function pl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ka),t.forEach(function(t){var i=Ec.bind(null,e,t);n.has(t)||(n.add(t),t.then(i,i))})}}function fl(e,t){var n=t.deletions;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];try{var s=e,a=t,l=a;e:for(;null!==l;){switch(l.tag){case 5:cl=l.stateNode,ul=!1;break e;case 3:case 4:cl=l.stateNode.containerInfo,ul=!0;break e}l=l.return}if(null===cl)throw Error(o(160));hl(s,a,r),cl=null,ul=!1;var c=r.alternate;null!==c&&(c.return=null),r.return=null}catch(u){kc(r,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ml(t,e),t=t.sibling}function ml(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(fl(t,e),gl(e),4&i){try{tl(3,e,e.return),nl(3,e)}catch(g){kc(e,e.return,g)}try{tl(5,e,e.return)}catch(g){kc(e,e.return,g)}}break;case 1:fl(t,e),gl(e),512&i&&null!==n&&Xa(n,n.return);break;case 5:if(fl(t,e),gl(e),512&i&&null!==n&&Xa(n,n.return),32&e.flags){var r=e.stateNode;try{he(r,"")}catch(g){kc(e,e.return,g)}}if(4&i&&null!=(r=e.stateNode)){var s=e.memoizedProps,a=null!==n?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===s.type&&null!=s.name&&$(r,s),_e(l,a);var u=_e(l,s);for(a=0;a<c.length;a+=2){var d=c[a],h=c[a+1];"style"===d?ge(r,h):"dangerouslySetInnerHTML"===d?de(r,h):"children"===d?he(r,h):_(r,d,h,u)}switch(l){case"input":X(r,s);break;case"textarea":oe(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var f=s.value;null!=f?ne(r,!!s.multiple,f,!1):p!==!!s.multiple&&(null!=s.defaultValue?ne(r,!!s.multiple,s.defaultValue,!0):ne(r,!!s.multiple,s.multiple?[]:"",!1))}r[pr]=s}catch(g){kc(e,e.return,g)}}break;case 6:if(fl(t,e),gl(e),4&i){if(null===e.stateNode)throw Error(o(162));r=e.stateNode,s=e.memoizedProps;try{r.nodeValue=s}catch(g){kc(e,e.return,g)}}break;case 3:if(fl(t,e),gl(e),4&i&&null!==n&&n.memoizedState.isDehydrated)try{qt(t.containerInfo)}catch(g){kc(e,e.return,g)}break;case 4:default:fl(t,e),gl(e);break;case 13:fl(t,e),gl(e),8192&(r=e.child).flags&&(s=null!==r.memoizedState,r.stateNode.isHidden=s,!s||null!==r.alternate&&null!==r.alternate.memoizedState||(Fl=$e())),4&i&&pl(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Ya=(u=Ya)||d,fl(t,e),Ya=u):fl(t,e),gl(e),8192&i){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!==(1&e.mode))for($a=e,d=e.child;null!==d;){for(h=$a=d;null!==$a;){switch(f=(p=$a).child,p.tag){case 0:case 11:case 14:case 15:tl(4,p,p.return);break;case 1:Xa(p,p.return);var m=p.stateNode;if("function"===typeof m.componentWillUnmount){i=p,n=p.return;try{t=i,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){kc(i,n,g)}}break;case 5:Xa(p,p.return);break;case 22:if(null!==p.memoizedState){bl(h);continue}}null!==f?(f.return=p,$a=f):bl(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{r=h.stateNode,u?"function"===typeof(s=r.style).setProperty?s.setProperty("display","none","important"):s.display="none":(l=h.stateNode,a=void 0!==(c=h.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=me("display",a))}catch(g){kc(e,e.return,g)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(g){kc(e,e.return,g)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:fl(t,e),gl(e),4&i&&pl(e);case 21:}}function gl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(ol(n)){var i=n;break e}n=n.return}throw Error(o(160))}switch(i.tag){case 5:var r=i.stateNode;32&i.flags&&(he(r,""),i.flags&=-33),ll(e,sl(e),r);break;case 3:case 4:var s=i.stateNode.containerInfo;al(e,sl(e),s);break;default:throw Error(o(161))}}catch(a){kc(e,e.return,a)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function vl(e,t,n){$a=e,yl(e,t,n)}function yl(e,t,n){for(var i=0!==(1&e.mode);null!==$a;){var r=$a,o=r.child;if(22===r.tag&&i){var s=null!==r.memoizedState||Qa;if(!s){var a=r.alternate,l=null!==a&&null!==a.memoizedState||Ya;a=Qa;var c=Ya;if(Qa=s,(Ya=l)&&!c)for($a=r;null!==$a;)l=(s=$a).child,22===s.tag&&null!==s.memoizedState?xl(r):null!==l?(l.return=s,$a=l):xl(r);for(;null!==o;)$a=o,yl(o,t,n),o=o.sibling;$a=r,Qa=a,Ya=c}_l(e)}else 0!==(8772&r.subtreeFlags)&&null!==o?(o.return=r,$a=o):_l(e)}}function _l(e){for(;null!==$a;){var t=$a;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Ya||nl(5,t);break;case 1:var i=t.stateNode;if(4&t.flags&&!Ya)if(null===n)i.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:na(t.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Wo(t,s,i);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Wo(t,a,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&qt(h)}}}break;default:throw Error(o(163))}Ya||512&t.flags&&il(t)}catch(p){kc(t,t.return,p)}}if(t===e){$a=null;break}if(null!==(n=t.sibling)){n.return=t.return,$a=n;break}$a=t.return}}function bl(e){for(;null!==$a;){var t=$a;if(t===e){$a=null;break}var n=t.sibling;if(null!==n){n.return=t.return,$a=n;break}$a=t.return}}function xl(e){for(;null!==$a;){var t=$a;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nl(4,t)}catch(l){kc(t,n,l)}break;case 1:var i=t.stateNode;if("function"===typeof i.componentDidMount){var r=t.return;try{i.componentDidMount()}catch(l){kc(t,r,l)}}var o=t.return;try{il(t)}catch(l){kc(t,o,l)}break;case 5:var s=t.return;try{il(t)}catch(l){kc(t,s,l)}}}catch(l){kc(t,t.return,l)}if(t===e){$a=null;break}var a=t.sibling;if(null!==a){a.return=t.return,$a=a;break}$a=t.return}}var wl,kl=Math.ceil,Sl=b.ReactCurrentDispatcher,Cl=b.ReactCurrentOwner,Ll=b.ReactCurrentBatchConfig,El=0,Pl=null,Tl=null,jl=0,Nl=0,Ol=Sr(0),Ml=0,Al=null,Rl=0,Il=0,zl=0,Bl=null,Dl=null,Fl=0,Ul=1/0,ql=null,Vl=!1,Wl=null,Hl=null,Zl=!1,Gl=null,Ql=0,Yl=0,Kl=null,$l=-1,Xl=0;function Jl(){return 0!==(6&El)?$e():-1!==$l?$l:$l=$e()}function ec(e){return 0===(1&e.mode)?1:0!==(2&El)&&0!==jl?jl&-jl:null!==go.transition?(0===Xl&&(Xl=mt()),Xl):0!==(e=_t)?e:e=void 0===(e=window.event)?16:Kt(e.type)}function tc(e,t,n,i){if(50<Yl)throw Yl=0,Kl=null,Error(o(185));vt(e,n,i),0!==(2&El)&&e===Pl||(e===Pl&&(0===(2&El)&&(Il|=n),4===Ml&&sc(e,jl)),nc(e,i),1===n&&0===El&&0===(1&t.mode)&&(Ul=$e()+500,Dr&&qr()))}function nc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-st(o),a=1<<s,l=r[s];-1===l?0!==(a&n)&&0===(a&i)||(r[s]=pt(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}(e,t);var i=ht(e,e===Pl?jl:0);if(0===i)null!==n&&Qe(n),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(null!=n&&Qe(n),1===t)0===e.tag?function(e){Dr=!0,Ur(e)}(ac.bind(null,e)):Ur(ac.bind(null,e)),sr(function(){0===(6&El)&&qr()}),n=null;else{switch(bt(i)){case 1:n=Je;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=it}n=Pc(n,ic.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ic(e,t){if($l=-1,Xl=0,0!==(6&El))throw Error(o(327));var n=e.callbackNode;if(xc()&&e.callbackNode!==n)return null;var i=ht(e,e===Pl?jl:0);if(0===i)return null;if(0!==(30&i)||0!==(i&e.expiredLanes)||t)t=mc(e,i);else{t=i;var r=El;El|=2;var s=pc();for(Pl===e&&jl===t||(ql=null,Ul=$e()+500,dc(e,t));;)try{vc();break}catch(l){hc(e,l)}Eo(),Sl.current=s,El=r,null!==Tl?t=0:(Pl=null,jl=0,t=Ml)}if(0!==t){if(2===t&&(0!==(r=ft(e))&&(i=r,t=rc(e,r))),1===t)throw n=Al,dc(e,0),sc(e,i),nc(e,$e()),n;if(6===t)sc(e,i);else{if(r=e.current.alternate,0===(30&i)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!ai(o(),r))return!1}catch(a){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(r)&&(2===(t=mc(e,i))&&(0!==(s=ft(e))&&(i=s,t=rc(e,s))),1===t))throw n=Al,dc(e,0),sc(e,i),nc(e,$e()),n;switch(e.finishedWork=r,e.finishedLanes=i,t){case 0:case 1:throw Error(o(345));case 2:case 5:bc(e,Dl,ql);break;case 3:if(sc(e,i),(130023424&i)===i&&10<(t=Fl+500-$e())){if(0!==ht(e,0))break;if(((r=e.suspendedLanes)&i)!==i){Jl(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=ir(bc.bind(null,e,Dl,ql),t);break}bc(e,Dl,ql);break;case 4:if(sc(e,i),(4194240&i)===i)break;for(t=e.eventTimes,r=-1;0<i;){var a=31-st(i);s=1<<a,(a=t[a])>r&&(r=a),i&=~s}if(i=r,10<(i=(120>(i=$e()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*kl(i/1960))-i)){e.timeoutHandle=ir(bc.bind(null,e,Dl,ql),i);break}bc(e,Dl,ql);break;default:throw Error(o(329))}}}return nc(e,$e()),e.callbackNode===n?ic.bind(null,e):null}function rc(e,t){var n=Bl;return e.current.memoizedState.isDehydrated&&(dc(e,t).flags|=256),2!==(e=mc(e,t))&&(t=Dl,Dl=n,null!==t&&oc(t)),e}function oc(e){null===Dl?Dl=e:Dl.push.apply(Dl,e)}function sc(e,t){for(t&=~zl,t&=~Il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-st(t),i=1<<n;e[n]=-1,t&=~i}}function ac(e){if(0!==(6&El))throw Error(o(327));xc();var t=ht(e,0);if(0===(1&t))return nc(e,$e()),null;var n=mc(e,t);if(0!==e.tag&&2===n){var i=ft(e);0!==i&&(t=i,n=rc(e,i))}if(1===n)throw n=Al,dc(e,0),sc(e,t),nc(e,$e()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bc(e,Dl,ql),nc(e,$e()),null}function lc(e,t){var n=El;El|=1;try{return e(t)}finally{0===(El=n)&&(Ul=$e()+500,Dr&&qr())}}function cc(e){null!==Gl&&0===Gl.tag&&0===(6&El)&&xc();var t=El;El|=1;var n=Ll.transition,i=_t;try{if(Ll.transition=null,_t=1,e)return e()}finally{_t=i,Ll.transition=n,0===(6&(El=t))&&qr()}}function uc(){Nl=Ol.current,Cr(Ol)}function dc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,rr(n)),null!==Tl)for(n=Tl.return;null!==n;){var i=n;switch(to(i),i.tag){case 1:null!==(i=i.type.childContextTypes)&&void 0!==i&&Mr();break;case 3:$o(),Cr(Tr),Cr(Pr),is();break;case 5:Jo(i);break;case 4:$o();break;case 13:case 19:Cr(es);break;case 10:Po(i.type._context);break;case 22:case 23:uc()}n=n.return}if(Pl=e,Tl=e=Oc(e.current,null),jl=Nl=t,Ml=0,Al=null,zl=Il=Rl=0,Dl=Bl=null,null!==Oo){for(t=0;t<Oo.length;t++)if(null!==(i=(n=Oo[t]).interleaved)){n.interleaved=null;var r=i.next,o=n.pending;if(null!==o){var s=o.next;o.next=r,i.next=s}n.pending=i}Oo=null}return e}function hc(e,t){for(;;){var n=Tl;try{if(Eo(),rs.current=Xs,us){for(var i=as.memoizedState;null!==i;){var r=i.queue;null!==r&&(r.pending=null),i=i.next}us=!1}if(ss=0,cs=ls=as=null,ds=!1,hs=0,Cl.current=null,null===n||null===n.return){Ml=1,Al=t,Tl=null;break}e:{var s=e,a=n.return,l=n,c=t;if(t=jl,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c,d=l,h=d.tag;if(0===(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=ga(a);if(null!==f){f.flags&=-257,va(f,a,l,0,t),1&f.mode&&ma(s,u,t),c=u;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){ma(s,u,t),fc();break e}c=Error(o(426))}else if(ro&&1&l.mode){var v=ga(a);if(null!==v){0===(65536&v.flags)&&(v.flags|=256),va(v,a,l,0,t),mo(ca(c,l));break e}}s=c=ca(c,l),4!==Ml&&(Ml=2),null===Bl?Bl=[s]:Bl.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,qo(s,pa(0,c,t));break e;case 1:l=c;var y=s.type,_=s.stateNode;if(0===(128&s.flags)&&("function"===typeof y.getDerivedStateFromError||null!==_&&"function"===typeof _.componentDidCatch&&(null===Hl||!Hl.has(_)))){s.flags|=65536,t&=-t,s.lanes|=t,qo(s,fa(s,l,t));break e}}s=s.return}while(null!==s)}_c(n)}catch(b){t=b,Tl===n&&null!==n&&(Tl=n=n.return);continue}break}}function pc(){var e=Sl.current;return Sl.current=Xs,null===e?Xs:e}function fc(){0!==Ml&&3!==Ml&&2!==Ml||(Ml=4),null===Pl||0===(268435455&Rl)&&0===(268435455&Il)||sc(Pl,jl)}function mc(e,t){var n=El;El|=2;var i=pc();for(Pl===e&&jl===t||(ql=null,dc(e,t));;)try{gc();break}catch(r){hc(e,r)}if(Eo(),El=n,Sl.current=i,null!==Tl)throw Error(o(261));return Pl=null,jl=0,Ml}function gc(){for(;null!==Tl;)yc(Tl)}function vc(){for(;null!==Tl&&!Ye();)yc(Tl)}function yc(e){var t=wl(e.alternate,e,Nl);e.memoizedProps=e.pendingProps,null===t?_c(e):Tl=t,Cl.current=null}function _c(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=Za(n,t,Nl)))return void(Tl=n)}else{if(null!==(n=Ga(n,t)))return n.flags&=32767,void(Tl=n);if(null===e)return Ml=6,void(Tl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Tl=t);Tl=t=e}while(null!==t);0===Ml&&(Ml=5)}function bc(e,t,n){var i=_t,r=Ll.transition;try{Ll.transition=null,_t=1,function(e,t,n,i){do{xc()}while(null!==Gl);if(0!==(6&El))throw Error(o(327));n=e.finishedWork;var r=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-st(n),o=1<<r;t[r]=0,i[r]=-1,e[r]=-1,n&=~o}}(e,s),e===Pl&&(Tl=Pl=null,jl=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||Zl||(Zl=!0,Pc(tt,function(){return xc(),null})),s=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||s){s=Ll.transition,Ll.transition=null;var a=_t;_t=1;var l=El;El|=4,Cl.current=null,function(e,t){if(er=Wt,pi(e=hi())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(i&&0!==i.rangeCount){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch(x){n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==r&&3!==h.nodeType||(l=a+r),h!==s||0!==i&&3!==h.nodeType||(c=a+i),3===h.nodeType&&(a+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++u===r&&(l=a),p===s&&++d===i&&(c=a),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(tr={focusedElem:e,selectionRange:n},Wt=!1,$a=t;null!==$a;)if(e=(t=$a).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,$a=e;else for(;null!==$a;){t=$a;try{var m=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,y=t.stateNode,_=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:na(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(o(163))}}catch(x){kc(t,t.return,x)}if(null!==(e=t.sibling)){e.return=t.return,$a=e;break}$a=t.return}m=el,el=!1}(e,n),ml(n,e),fi(tr),Wt=!!er,tr=er=null,e.current=n,vl(n,e,r),Ke(),El=l,_t=a,Ll.transition=s}else e.current=n;if(Zl&&(Zl=!1,Gl=e,Ql=r),s=e.pendingLanes,0===s&&(Hl=null),function(e){if(ot&&"function"===typeof ot.onCommitFiberRoot)try{ot.onCommitFiberRoot(rt,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),nc(e,$e()),null!==t)for(i=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],i(r.value,{componentStack:r.stack,digest:r.digest});if(Vl)throw Vl=!1,e=Wl,Wl=null,e;0!==(1&Ql)&&0!==e.tag&&xc(),s=e.pendingLanes,0!==(1&s)?e===Kl?Yl++:(Yl=0,Kl=e):Yl=0,qr()}(e,t,n,i)}finally{Ll.transition=r,_t=i}return null}function xc(){if(null!==Gl){var e=bt(Ql),t=Ll.transition,n=_t;try{if(Ll.transition=null,_t=16>e?16:e,null===Gl)var i=!1;else{if(e=Gl,Gl=null,Ql=0,0!==(6&El))throw Error(o(331));var r=El;for(El|=4,$a=e.current;null!==$a;){var s=$a,a=s.child;if(0!==(16&$a.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for($a=u;null!==$a;){var d=$a;switch(d.tag){case 0:case 11:case 15:tl(8,d,s)}var h=d.child;if(null!==h)h.return=d,$a=h;else for(;null!==$a;){var p=(d=$a).sibling,f=d.return;if(rl(d),d===u){$a=null;break}if(null!==p){p.return=f,$a=p;break}$a=f}}}var m=s.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}$a=s}}if(0!==(2064&s.subtreeFlags)&&null!==a)a.return=s,$a=a;else e:for(;null!==$a;){if(0!==(2048&(s=$a).flags))switch(s.tag){case 0:case 11:case 15:tl(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,$a=y;break e}$a=s.return}}var _=e.current;for($a=_;null!==$a;){var b=(a=$a).child;if(0!==(2064&a.subtreeFlags)&&null!==b)b.return=a,$a=b;else e:for(a=_;null!==$a;){if(0!==(2048&(l=$a).flags))try{switch(l.tag){case 0:case 11:case 15:nl(9,l)}}catch(w){kc(l,l.return,w)}if(l===a){$a=null;break e}var x=l.sibling;if(null!==x){x.return=l.return,$a=x;break e}$a=l.return}}if(El=r,qr(),ot&&"function"===typeof ot.onPostCommitFiberRoot)try{ot.onPostCommitFiberRoot(rt,e)}catch(w){}i=!0}return i}finally{_t=n,Ll.transition=t}}return!1}function wc(e,t,n){e=Fo(e,t=pa(0,t=ca(n,t),1),1),t=Jl(),null!==e&&(vt(e,1,t),nc(e,t))}function kc(e,t,n){if(3===e.tag)wc(e,e,n);else for(;null!==t;){if(3===t.tag){wc(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof i.componentDidCatch&&(null===Hl||!Hl.has(i))){t=Fo(t,e=fa(t,e=ca(n,e),1),1),e=Jl(),null!==t&&(vt(t,1,e),nc(t,e));break}}t=t.return}}function Sc(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),t=Jl(),e.pingedLanes|=e.suspendedLanes&n,Pl===e&&(jl&n)===n&&(4===Ml||3===Ml&&(130023424&jl)===jl&&500>$e()-Fl?dc(e,0):zl|=n),nc(e,t)}function Cc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ut,0===(130023424&(ut<<=1))&&(ut=4194304)));var n=Jl();null!==(e=Ro(e,t))&&(vt(e,t,n),nc(e,n))}function Lc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cc(e,n)}function Ec(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}null!==i&&i.delete(t),Cc(e,n)}function Pc(e,t){return Ge(e,t)}function Tc(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jc(e,t,n,i){return new Tc(e,t,n,i)}function Nc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Oc(e,t){var n=e.alternate;return null===n?((n=jc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Mc(e,t,n,i,r,s){var a=2;if(i=e,"function"===typeof e)Nc(e)&&(a=1);else if("string"===typeof e)a=5;else e:switch(e){case k:return Ac(n.children,r,s,t);case S:a=8,r|=8;break;case C:return(e=jc(12,n,t,2|r)).elementType=C,e.lanes=s,e;case T:return(e=jc(13,n,t,r)).elementType=T,e.lanes=s,e;case j:return(e=jc(19,n,t,r)).elementType=j,e.lanes=s,e;case M:return Rc(n,r,s,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case L:a=10;break e;case E:a=9;break e;case P:a=11;break e;case N:a=14;break e;case O:a=16,i=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=jc(a,n,t,r)).elementType=e,t.type=i,t.lanes=s,t}function Ac(e,t,n,i){return(e=jc(7,e,i,t)).lanes=n,e}function Rc(e,t,n,i){return(e=jc(22,e,i,t)).elementType=M,e.lanes=n,e.stateNode={isHidden:!1},e}function Ic(e,t,n){return(e=jc(6,e,null,t)).lanes=n,e}function zc(e,t,n){return(t=jc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bc(e,t,n,i,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Dc(e,t,n,i,r,o,s,a,l){return e=new Bc(e,t,n,a,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=jc(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zo(o),e}function Fc(e){if(!e)return Er;e:{if(qe(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(Or(n))return Rr(e,n,t)}return t}function Uc(e,t,n,i,r,o,s,a,l){return(e=Dc(n,i,!0,e,0,o,0,a,l)).context=Fc(null),n=e.current,(o=Do(i=Jl(),r=ec(n))).callback=void 0!==t&&null!==t?t:null,Fo(n,o,r),e.current.lanes=r,vt(e,r,i),nc(e,i),e}function qc(e,t,n,i){var r=t.current,o=Jl(),s=ec(r);return n=Fc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Do(o,s)).payload={element:e},null!==(i=void 0===i?null:i)&&(t.callback=i),null!==(e=Fo(r,t,s))&&(tc(e,r,s,o),Uo(e,r,s)),s}function Vc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Wc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Hc(e,t){Wc(e,t),(e=e.alternate)&&Wc(e,t)}wl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Tr.current)_a=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return _a=!1,function(e,t,n){switch(t.tag){case 3:Ta(t),fo();break;case 5:Xo(t);break;case 1:Or(t.type)&&Ir(t);break;case 4:Ko(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,r=t.memoizedProps.value;Lr(ko,i._currentValue),i._currentValue=r;break;case 13:if(null!==(i=t.memoizedState))return null!==i.dehydrated?(Lr(es,1&es.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ia(e,t,n):(Lr(es,1&es.current),null!==(e=Va(e,t,n))?e.sibling:null);Lr(es,1&es.current);break;case 19:if(i=0!==(n&t.childLanes),0!==(128&e.flags)){if(i)return Ua(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),Lr(es,es.current),i)break;return null;case 22:case 23:return t.lanes=0,Sa(e,t,n)}return Va(e,t,n)}(e,t,n);_a=0!==(131072&e.flags)}else _a=!1,ro&&0!==(1048576&t.flags)&&Jr(t,Zr,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;qa(e,t),e=t.pendingProps;var r=Nr(t,Pr.current);jo(t,n),r=gs(null,t,i,e,r,n);var s=vs();return t.flags|=1,"object"===typeof r&&null!==r&&"function"===typeof r.render&&void 0===r.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Or(i)?(s=!0,Ir(t)):s=!1,t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,zo(t),r.updater=ra,t.stateNode=r,r._reactInternals=t,la(t,i,e,n),t=Pa(null,t,i,!0,s,n)):(t.tag=0,ro&&s&&eo(t),ba(null,t,r,n),t=t.child),t;case 16:i=t.elementType;e:{switch(qa(e,t),e=t.pendingProps,i=(r=i._init)(i._payload),t.type=i,r=t.tag=function(e){if("function"===typeof e)return Nc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===P)return 11;if(e===N)return 14}return 2}(i),e=na(i,e),r){case 0:t=La(null,t,i,e,n);break e;case 1:t=Ea(null,t,i,e,n);break e;case 11:t=xa(null,t,i,e,n);break e;case 14:t=wa(null,t,i,na(i.type,e),n);break e}throw Error(o(306,i,""))}return t;case 0:return i=t.type,r=t.pendingProps,La(e,t,i,r=t.elementType===i?r:na(i,r),n);case 1:return i=t.type,r=t.pendingProps,Ea(e,t,i,r=t.elementType===i?r:na(i,r),n);case 3:e:{if(Ta(t),null===e)throw Error(o(387));i=t.pendingProps,r=(s=t.memoizedState).element,Bo(e,t),Vo(t,i,null,n);var a=t.memoizedState;if(i=a.element,s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=ja(e,t,i,n,r=ca(Error(o(423)),t));break e}if(i!==r){t=ja(e,t,i,n,r=ca(Error(o(424)),t));break e}for(io=cr(t.stateNode.containerInfo.firstChild),no=t,ro=!0,oo=null,n=wo(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(fo(),i===r){t=Va(e,t,n);break e}ba(e,t,i,n)}t=t.child}return t;case 5:return Xo(t),null===e&&co(t),i=t.type,r=t.pendingProps,s=null!==e?e.memoizedProps:null,a=r.children,nr(i,r)?a=null:null!==s&&nr(i,s)&&(t.flags|=32),Ca(e,t),ba(e,t,a,n),t.child;case 6:return null===e&&co(t),null;case 13:return Ia(e,t,n);case 4:return Ko(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=xo(t,null,i,n):ba(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,xa(e,t,i,r=t.elementType===i?r:na(i,r),n);case 7:return ba(e,t,t.pendingProps,n),t.child;case 8:case 12:return ba(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,r=t.pendingProps,s=t.memoizedProps,a=r.value,Lr(ko,i._currentValue),i._currentValue=a,null!==s)if(ai(s.value,a)){if(s.children===r.children&&!Tr.current){t=Va(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){a=s.child;for(var c=l.firstContext;null!==c;){if(c.context===i){if(1===s.tag){(c=Do(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,null!==(c=s.alternate)&&(c.lanes|=n),To(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===s.tag)a=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(o(341));a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),To(a,n,t),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===t){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}ba(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=t.pendingProps.children,jo(t,n),i=i(r=No(r)),t.flags|=1,ba(e,t,i,n),t.child;case 14:return r=na(i=t.type,t.pendingProps),wa(e,t,i,r=na(i.type,r),n);case 15:return ka(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:na(i,r),qa(e,t),t.tag=1,Or(i)?(e=!0,Ir(t)):e=!1,jo(t,n),sa(t,i,r),la(t,i,r,n),Pa(null,t,i,!0,e,n);case 19:return Ua(e,t,n);case 22:return Sa(e,t,n)}throw Error(o(156,t.tag))};var Zc="function"===typeof reportError?reportError:function(e){console.error(e)};function Gc(e){this._internalRoot=e}function Qc(e){this._internalRoot=e}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Kc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function $c(){}function Xc(e,t,n,i,r){var o=n._reactRootContainer;if(o){var s=o;if("function"===typeof r){var a=r;r=function(){var e=Vc(s);a.call(e)}}qc(t,s,e,r)}else s=function(e,t,n,i,r){if(r){if("function"===typeof i){var o=i;i=function(){var e=Vc(s);o.call(e)}}var s=Uc(t,i,e,0,null,!1,0,"",$c);return e._reactRootContainer=s,e[fr]=s.current,qi(8===e.nodeType?e.parentNode:e),cc(),s}for(;r=e.lastChild;)e.removeChild(r);if("function"===typeof i){var a=i;i=function(){var e=Vc(l);a.call(e)}}var l=Dc(e,0,!1,null,0,!1,0,"",$c);return e._reactRootContainer=l,e[fr]=l.current,qi(8===e.nodeType?e.parentNode:e),cc(function(){qc(t,l,n,i)}),l}(n,t,e,r,i);return Vc(s)}Qc.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));qc(e,t,null,null)},Qc.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cc(function(){qc(null,e,null,null)}),t[fr]=null}},Qc.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mt.length&&0!==t&&t<Mt[n].priority;n++);Mt.splice(n,0,e),0===n&&zt(e)}},xt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(yt(t,1|n),nc(t,$e()),0===(6&El)&&(Ul=$e()+500,qr()))}break;case 13:cc(function(){var t=Ro(e,1);if(null!==t){var n=Jl();tc(t,e,1,n)}}),Hc(e,1)}},wt=function(e){if(13===e.tag){var t=Ro(e,134217728);if(null!==t)tc(t,e,134217728,Jl());Hc(e,134217728)}},kt=function(e){if(13===e.tag){var t=ec(e),n=Ro(e,t);if(null!==n)tc(n,e,t,Jl());Hc(e,t)}},St=function(){return _t},Ct=function(e,t){var n=_t;try{return _t=e,t()}finally{_t=n}},we=function(e,t,n){switch(t){case"input":if(X(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=xr(i);if(!r)throw Error(o(90));G(i),X(i,r)}}}break;case"textarea":oe(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Pe=lc,Te=cc;var Jc={usingClientEntryPoint:!1,Events:[_r,br,xr,Le,Ee,lc]},eu={findFiberByHostInstance:yr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tu={bundleType:eu.bundleType,version:eu.version,rendererPackageName:eu.rendererPackageName,rendererConfig:eu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=He(e))?null:e.stateNode},findFiberByHostInstance:eu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nu.isDisabled&&nu.supportsFiber)try{rt=nu.inject(tu),ot=nu}catch(ue){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yc(t))throw Error(o(200));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:w,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Yc(e))throw Error(o(299));var n=!1,i="",r=Zc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onRecoverableError&&(r=t.onRecoverableError)),t=Dc(e,1,!1,null,0,n,0,i,r),e[fr]=t.current,qi(8===e.nodeType?e.parentNode:e),new Gc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return e=null===(e=He(t))?null:e.stateNode},t.flushSync=function(e){return cc(e)},t.hydrate=function(e,t,n){if(!Kc(t))throw Error(o(200));return Xc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Yc(e))throw Error(o(405));var i=null!=n&&n.hydratedSources||null,r=!1,s="",a=Zc;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=Uc(t,null,e,1,null!=n?n:null,r,0,s,a),e[fr]=t.current,qi(e),i)for(e=0;e<i.length;e++)r=(r=(n=i[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Qc(t)},t.render=function(e,t,n){if(!Kc(t))throw Error(o(200));return Xc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Kc(e))throw Error(o(40));return!!e._reactRootContainer&&(cc(function(){Xc(null,null,e,!1,function(){e._reactRootContainer=null,e[fr]=null})}),!0)},t.unstable_batchedUpdates=lc,t.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Kc(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return Xc(e,t,n,!1,i)},t.version="18.3.1-next-f1338f8080-20240426"},391(e,t,n){"use strict";var i=n(950);t.createRoot=i.createRoot,t.hydrateRoot=i.hydrateRoot},950(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(730)},861(e){"use strict";var t=function(e,t){return e+n(t)},n=function(e){return null===e||"boolean"===typeof e||"undefined"===typeof e?"":"number"===typeof e?e.toString():"string"===typeof e?e:Array.isArray(e)?e.reduce(t,""):function(e){return Object.prototype.hasOwnProperty.call(e,"props")}(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?n(e.props.children):""};n.default=n,e.exports=n},153(e,t,n){"use strict";var i=n(43),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var i,o={},c=null,u=null;for(i in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,i)&&!l.hasOwnProperty(i)&&(o[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===o[i]&&(o[i]=t[i]);return{$$typeof:r,type:e,key:c,ref:u,props:o,_owner:a.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},202(e,t){"use strict";var n=Symbol.for("react.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function y(){}function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var b=_.prototype=new y;b.constructor=_,m(b,v.prototype),b.isPureReactComponent=!0;var x=Array.isArray,w=Object.prototype.hasOwnProperty,k={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,i){var r,o={},s=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)w.call(t,r)&&!S.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=i;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:n,type:e,key:s,ref:a,props:o,_owner:k.current}}function L(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var E=/\/+/g;function P(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function T(e,t,r,o,s){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case i:l=!0}}if(l)return s=s(l=e),e=""===o?"."+P(l,0):o,x(s)?(r="",null!=e&&(r=e.replace(E,"$&/")+"/"),T(s,t,r,"",function(e){return e})):null!=s&&(L(s)&&(s=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(E,"$&/")+"/")+e)),t.push(s)),1;if(l=0,o=""===o?".":o+":",x(e))for(var c=0;c<e.length;c++){var u=o+P(a=e[c],c);l+=T(a,t,r,u,s)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),c=0;!(a=e.next()).done;)l+=T(a=a.value,t,r,u=o+P(a,c++),s);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function j(e,t,n){if(null==e)return e;var i=[],r=0;return T(e,i,"","",function(e){return t.call(n,e,r++)}),i}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},M={transition:null},A={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:M,ReactCurrentOwner:k};function R(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!L(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=r,t.Profiler=s,t.PureComponent=_,t.StrictMode=o,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,t.act=R,t.cloneElement=function(e,t,i){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=m({},e.props),o=e.key,s=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,a=k.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)w.call(t,c)&&!S.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:n,type:e.type,key:o,ref:s,props:r,_owner:a}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=L,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:N}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=M.transition;M.transition={};try{e()}finally{M.transition=t}},t.unstable_act=R,t.useCallback=function(e,t){return O.current.useCallback(e,t)},t.useContext=function(e){return O.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return O.current.useDeferredValue(e)},t.useEffect=function(e,t){return O.current.useEffect(e,t)},t.useId=function(){return O.current.useId()},t.useImperativeHandle=function(e,t,n){return O.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return O.current.useMemo(e,t)},t.useReducer=function(e,t,n){return O.current.useReducer(e,t,n)},t.useRef=function(e){return O.current.useRef(e)},t.useState=function(e){return O.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return O.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return O.current.useTransition()},t.version="18.3.1"},43(e,t,n){"use strict";e.exports=n(202)},579(e,t,n){"use strict";e.exports=n(153)},234(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,r=e[i];if(!(0<o(r,t)))break e;e[i]=t,e[n]=r,n=i}}function i(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,r=e.length,s=r>>>1;i<s;){var a=2*(i+1)-1,l=e[a],c=a+1,u=e[c];if(0>o(l,n))c<r&&0>o(u,l)?(e[i]=u,e[c]=n,i=c):(e[i]=l,e[a]=n,i=a);else{if(!(c<r&&0>o(u,n)))break e;e[i]=u,e[c]=n,i=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,_="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=i(u);null!==t;){if(null===t.callback)r(u);else{if(!(t.startTime<=e))break;r(u),t.sortIndex=t.expirationTime,n(c,t)}t=i(u)}}function x(e){if(g=!1,b(e),!m)if(null!==i(c))m=!0,M(w);else{var t=i(u);null!==t&&A(x,t.startTime-e)}}function w(e,n){m=!1,g&&(g=!1,y(L),L=-1),f=!0;var o=p;try{for(b(n),h=i(c);null!==h&&(!(h.expirationTime>n)||e&&!T());){var s=h.callback;if("function"===typeof s){h.callback=null,p=h.priorityLevel;var a=s(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof a?h.callback=a:h===i(c)&&r(c),b(n)}else r(c);h=i(c)}if(null!==h)var l=!0;else{var d=i(u);null!==d&&A(x,d.startTime-n),l=!1}return l}finally{h=null,p=o,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,S=!1,C=null,L=-1,E=5,P=-1;function T(){return!(t.unstable_now()-P<E)}function j(){if(null!==C){var e=t.unstable_now();P=e;var n=!0;try{n=C(!0,e)}finally{n?k():(S=!1,C=null)}}else S=!1}if("function"===typeof _)k=function(){_(j)};else if("undefined"!==typeof MessageChannel){var N=new MessageChannel,O=N.port2;N.port1.onmessage=j,k=function(){O.postMessage(null)}}else k=function(){v(j,0)};function M(e){C=e,S||(S=!0,k())}function A(e,n){L=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,M(w))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return i(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,r,o){var s=t.unstable_now();switch("object"===typeof o&&null!==o?o="number"===typeof(o=o.delay)&&0<o?s+o:s:o=s,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:d++,callback:r,priorityLevel:e,startTime:o,expirationTime:a=o+a,sortIndex:-1},o>s?(e.sortIndex=o,n(u,e),null===i(c)&&e===i(u)&&(g?(y(L),L=-1):g=!0,A(x,o-s))):(e.sortIndex=a,n(c,e),m||f||(m=!0,M(w))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},853(e,t,n){"use strict";e.exports=n(234)},865(e){var t=new Error("Element already at target scroll position"),n=new Error("Scroll cancelled"),i=Math.min,r=Date.now;function o(e){return function(o,l,c,u){"function"==typeof(c=c||{})&&(u=c,c={}),"function"!=typeof u&&(u=a);var d=r(),h=o[e],p=c.ease||s,f=isNaN(c.duration)?350:+c.duration,m=!1;return h===l?u(t,o[e]):requestAnimationFrame(function t(s){if(m)return u(n,o[e]);var a=r(),c=i(1,(a-d)/f),g=p(c);o[e]=g*(l-h)+h,c<1?requestAnimationFrame(t):requestAnimationFrame(function(){u(null,o[e])})}),function(){m=!0}}}function s(e){return.5*(1-Math.cos(Math.PI*e))}function a(){}e.exports={left:o("scrollLeft"),top:o("scrollTop")}},496(e,t){var n,i,r;i=[],void 0===(r="function"===typeof(n=function(){function e(e){var t=getComputedStyle(e,null).getPropertyValue("overflow");return t.indexOf("scroll")>-1||t.indexOf("auto")>-1}function t(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var n=t.parentNode;n.parentNode;){if(e(n))return n;n=n.parentNode}return document.scrollingElement||document.documentElement}}return t})?n.apply(t,i):n)||(e.exports=r)},330(e,t,n){"use strict";var i=n(43);var r="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},o=i.useState,s=i.useEffect,a=i.useLayoutEffect,l=i.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(i){return!0}}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),i=o({inst:{value:n,getSnapshot:t}}),r=i[0].inst,u=i[1];return a(function(){r.value=n,r.getSnapshot=t,c(r)&&u({inst:r})},[e,n,t]),s(function(){return c(r)&&u({inst:r}),e(function(){c(r)&&u({inst:r})})},[e]),l(n),n};t.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:u},717(e,t,n){"use strict";var i=n(43),r=n(461);var o="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},s=r.useSyncExternalStore,a=i.useRef,l=i.useEffect,c=i.useMemo,u=i.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c(function(){function e(e){if(!l){if(l=!0,s=e,e=i(e),void 0!==r&&h.hasValue){var t=h.value;if(r(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var n=i(e);return void 0!==r&&r(t,n)?(s=e,t):(s=e,a=n)}var s,a,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,i,r]);var p=s(e,d[0],d[1]);return l(function(){h.hasValue=!0,h.value=p},[p]),u(p),p}},461(e,t,n){"use strict";e.exports=n(330)},443(e,t,n){"use strict";e.exports=n(717)},24(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII="},71(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(i,r){if(1&r&&(i=this(i)),8&r)return i;if("object"===typeof i&&i){if(4&r&&i.__esModule)return i;if(16&r&&"function"===typeof i.then)return i}var o=Object.create(null);n.r(o);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&i;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>s[e]=()=>i[e]);return s.default=()=>i,n.d(o,s),o}})(),n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>Wt,hasStandardBrowserEnv:()=>Zt,hasStandardBrowserWebWorkerEnv:()=>Gt,navigator:()=>Ht,origin:()=>Qt});var t,i=n(43),r=n.t(i,2),o=n(391),s=n(950),a=n.t(s,2);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(t||(t={}));const c="popstate";function u(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function d(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function h(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,n,i){return void 0===n&&(n=null),l({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?m(t):t,{state:n,key:t&&t.key||i||Math.random().toString(36).substr(2,8)})}function f(e){let{pathname:t="/",search:n="",hash:i=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(t+="#"===i.charAt(0)?i:"#"+i),t}function m(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substr(i),e=e.substr(0,i)),e&&(t.pathname=e)}return t}function g(e,n,i,r){void 0===r&&(r={});let{window:o=document.defaultView,v5Compat:s=!1}=r,a=o.history,d=t.Pop,m=null,g=v();function v(){return(a.state||{idx:null}).idx}function y(){d=t.Pop;let e=v(),n=null==e?null:e-g;g=e,m&&m({action:d,location:b.location,delta:n})}function _(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,n="string"===typeof e?e:f(e);return n=n.replace(/ $/,"%20"),u(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==g&&(g=0,a.replaceState(l({},a.state,{idx:g}),""));let b={get action(){return d},get location(){return e(o,a)},listen(e){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(c,y),m=e,()=>{o.removeEventListener(c,y),m=null}},createHref:e=>n(o,e),createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,n){d=t.Push;let r=p(b.location,e,n);i&&i(r,e),g=v()+1;let l=h(r,g),c=b.createHref(r);try{a.pushState(l,"",c)}catch(u){if(u instanceof DOMException&&"DataCloneError"===u.name)throw u;o.location.assign(c)}s&&m&&m({action:d,location:b.location,delta:1})},replace:function(e,n){d=t.Replace;let r=p(b.location,e,n);i&&i(r,e),g=v();let o=h(r,g),l=b.createHref(r);a.replaceState(o,"",l),s&&m&&m({action:d,location:b.location,delta:0})},go:e=>a.go(e)};return b}var v;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(v||(v={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function y(e,t,n){return void 0===n&&(n="/"),_(e,t,n,!1)}function _(e,t,n,i){let r=M(("string"===typeof t?m(t):t).pathname||"/",n);if(null==r)return null;let o=b(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let s=null;for(let a=0;null==s&&a<o.length;++a){let e=O(r);s=j(o[a],e,i)}return s}function b(e,t,n,i){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===i&&(i="");let r=(e,r,o)=>{let s={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:r,route:e};s.relativePath.startsWith("/")&&(u(s.relativePath.startsWith(i),'Absolute route path "'+s.relativePath+'" nested under path "'+i+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(i.length));let a=U([i,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(u(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+a+'".'),b(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:T(a,e.index),routesMeta:l})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let i of x(e.path))r(e,t,i);else r(e,t)}),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[n,...i]=t,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===i.length)return r?[o,""]:[o];let s=x(i.join("/")),a=[];return a.push(...s.map(e=>""===e?o:[o,e].join("/"))),r&&a.push(...s),a.map(t=>e.startsWith("/")&&""===t?"/":t)}const w=/^:[\w-]+$/,k=3,S=2,C=1,L=10,E=-2,P=e=>"*"===e;function T(e,t){let n=e.split("/"),i=n.length;return n.some(P)&&(i+=E),t&&(i+=S),n.filter(e=>!P(e)).reduce((e,t)=>e+(w.test(t)?k:""===t?C:L),i)}function j(e,t,n){void 0===n&&(n=!1);let{routesMeta:i}=e,r={},o="/",s=[];for(let a=0;a<i.length;++a){let e=i[a],l=a===i.length-1,c="/"===o?t:t.slice(o.length)||"/",u=N({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!i[i.length-1].route.index&&(u=N({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(r,u.params),s.push({params:r,pathname:U([o,u.pathname]),pathnameBase:q(U([o,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(o=U([o,u.pathnameBase]))}return s}function N(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);d("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let i=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(i.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));e.endsWith("*")?(i.push({paramName:"*"}),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":""!==e&&"/"!==e&&(r+="(?:(?=\\/|$))");let o=new RegExp(r,t?void 0:"i");return[o,i]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let o=r[0],s=o.replace(/(.)\/+$/,"$1"),a=r.slice(1),l=i.reduce((e,t,n)=>{let{paramName:i,isOptional:r}=t;if("*"===i){let e=a[n]||"";s=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=a[n];return e[i]=r&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{});return{params:l,pathname:o,pathnameBase:s,pattern:e}}function O(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return d(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function M(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&"/"!==i?null:e.slice(n)||"/"}const A=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function R(e,t){void 0===t&&(t="/");let n,{pathname:i,search:r="",hash:o=""}="string"===typeof e?m(e):e;if(i)if(s=i,A.test(s))n=i;else{if(i.includes("//")){let e=i;i=i.replace(/\/\/+/g,"/"),d(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+i)}n=i.startsWith("/")?I(i.substring(1),"/"):I(i,t)}else n=t;var s;return{pathname:n,search:V(r),hash:W(o)}}function I(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function z(e,t,n,i){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(i)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function B(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function D(e,t){let n=B(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function F(e,t,n,i){let r;void 0===i&&(i=!1),"string"===typeof e?r=m(e):(r=l({},e),u(!r.pathname||!r.pathname.includes("?"),z("?","pathname","search",r)),u(!r.pathname||!r.pathname.includes("#"),z("#","pathname","hash",r)),u(!r.search||!r.search.includes("#"),z("#","search","hash",r)));let o,s=""===e||""===r.pathname,a=s?"/":r.pathname;if(null==a)o=n;else{let e=t.length-1;if(!i&&a.startsWith("..")){let t=a.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}o=e>=0?t[e]:"/"}let c=R(r,o),d=a&&"/"!==a&&a.endsWith("/"),h=(s||"."===a)&&n.endsWith("/");return c.pathname.endsWith("/")||!d&&!h||(c.pathname+="/"),c}const U=e=>e.join("/").replace(/\/\/+/g,"/"),q=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),V=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",W=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function H(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const Z=["post","put","patch","delete"],G=(new Set(Z),["get",...Z]);new Set(G),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Q.apply(this,arguments)}const Y=i.createContext(null);const K=i.createContext(null);const $=i.createContext(null);const X=i.createContext(null);const J=i.createContext({outlet:null,matches:[],isDataRoute:!1});const ee=i.createContext(null);function te(){return null!=i.useContext(X)}function ne(){return te()||u(!1),i.useContext(X).location}function ie(e){i.useContext($).static||i.useLayoutEffect(e)}function re(){let{isDataRoute:e}=i.useContext(J);return e?function(){let{router:e}=fe(he.UseNavigateStable),t=ge(pe.UseNavigateStable),n=i.useRef(!1);ie(()=>{n.current=!0});let r=i.useCallback(function(i,r){void 0===r&&(r={}),n.current&&("number"===typeof i?e.navigate(i):e.navigate(i,Q({fromRouteId:t},r)))},[e,t]);return r}():function(){te()||u(!1);let e=i.useContext(Y),{basename:t,future:n,navigator:r}=i.useContext($),{matches:o}=i.useContext(J),{pathname:s}=ne(),a=JSON.stringify(D(o,n.v7_relativeSplatPath)),l=i.useRef(!1);return ie(()=>{l.current=!0}),i.useCallback(function(n,i){if(void 0===i&&(i={}),!l.current)return;if("number"===typeof n)return void r.go(n);let o=F(n,JSON.parse(a),s,"path"===i.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:U([t,o.pathname])),(i.replace?r.replace:r.push)(o,i.state,i)},[t,r,a,s,e])}()}function oe(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=i.useContext($),{matches:o}=i.useContext(J),{pathname:s}=ne(),a=JSON.stringify(D(o,r.v7_relativeSplatPath));return i.useMemo(()=>F(e,JSON.parse(a),s,"path"===n),[e,a,s,n])}function se(e,n,r,o){te()||u(!1);let{navigator:s}=i.useContext($),{matches:a}=i.useContext(J),l=a[a.length-1],c=l?l.params:{},d=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let h,p=ne();if(n){var f;let e="string"===typeof n?m(n):n;"/"===d||(null==(f=e.pathname)?void 0:f.startsWith(d))||u(!1),h=e}else h=p;let g=h.pathname||"/",v=g;if("/"!==d){let e=d.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let _=y(e,{pathname:v});let b=de(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:U([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:U([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,r,o);return n&&b?i.createElement(X.Provider,{value:{location:Q({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:t.Pop}},b):b}function ae(){let e=function(){var e;let t=i.useContext(ee),n=me(pe.UseRouteError),r=ge(pe.UseRouteError);if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=H(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r};return i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:o},n):null,null)}const le=i.createElement(ae,null);class ce extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?i.createElement(J.Provider,{value:this.props.routeContext},i.createElement(ee.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ue(e){let{routeContext:t,match:n,children:r}=e,o=i.useContext(Y);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),i.createElement(J.Provider,{value:t},r)}function de(e,t,n,r){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var s;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(s=r)&&s.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let a=e,l=null==(o=n)?void 0:o.errors;if(null!=l){let e=a.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));e>=0||u(!1),a=a.slice(0,Math.min(a.length,e+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let i=0;i<a.length;i++){let e=a[i];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(d=i),e.route.id){let{loaderData:t,errors:i}=n,r=e.route.loader&&void 0===t[e.route.id]&&(!i||void 0===i[e.route.id]);if(e.route.lazy||r){c=!0,a=d>=0?a.slice(0,d+1):[a[0]];break}}}return a.reduceRight((e,r,o)=>{let s,u=!1,h=null,p=null;var f;n&&(s=l&&r.route.id?l[r.route.id]:void 0,h=r.route.errorElement||le,c&&(d<0&&0===o?(f="route-fallback",!1||ve[f]||(ve[f]=!0),u=!0,p=null):d===o&&(u=!0,p=r.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,o+1)),g=()=>{let t;return t=s?h:u?p:r.route.Component?i.createElement(r.route.Component,null):r.route.element?r.route.element:e,i.createElement(ue,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?i.createElement(ce,{location:n.location,revalidation:n.revalidation,component:h,error:s,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}var he=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(he||{}),pe=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(pe||{});function fe(e){let t=i.useContext(Y);return t||u(!1),t}function me(e){let t=i.useContext(K);return t||u(!1),t}function ge(e){let t=function(){let e=i.useContext(J);return e||u(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||u(!1),n.route.id}const ve={};function ye(e,t){null==e||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}r.startTransition;function _e(e){let{to:t,replace:n,state:r,relative:o}=e;te()||u(!1);let{future:s,static:a}=i.useContext($),{matches:l}=i.useContext(J),{pathname:c}=ne(),d=re(),h=F(t,D(l,s.v7_relativeSplatPath),c,"path"===o),p=JSON.stringify(h);return i.useEffect(()=>d(JSON.parse(p),{replace:n,state:r,relative:o}),[d,p,o,n,r]),null}function be(e){u(!1)}function xe(e){let{basename:n="/",children:r=null,location:o,navigationType:s=t.Pop,navigator:a,static:l=!1,future:c}=e;te()&&u(!1);let d=n.replace(/^\/*/,"/"),h=i.useMemo(()=>({basename:d,navigator:a,static:l,future:Q({v7_relativeSplatPath:!1},c)}),[d,c,a,l]);"string"===typeof o&&(o=m(o));let{pathname:p="/",search:f="",hash:g="",state:v=null,key:y="default"}=o,_=i.useMemo(()=>{let e=M(p,d);return null==e?null:{location:{pathname:e,search:f,hash:g,state:v,key:y},navigationType:s}},[d,p,f,g,v,y,s]);return null==_?null:i.createElement($.Provider,{value:h},i.createElement(X.Provider,{children:r,value:_}))}function we(e){let{children:t,location:n}=e;return se(ke(t),n)}new Promise(()=>{});i.Component;function ke(e,t){void 0===t&&(t=[]);let n=[];return i.Children.forEach(e,(e,r)=>{if(!i.isValidElement(e))return;let o=[...t,r];if(e.type===i.Fragment)return void n.push.apply(n,ke(e.props.children,o));e.type!==be&&u(!1),e.props.index&&e.props.children&&u(!1);let s={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=ke(e.props.children,o)),n.push(s)}),n}function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Se.apply(this,arguments)}function Ce(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Le=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(qg){}new Map;const Ee=r.startTransition;a.flushSync,r.useId;function Pe(e){let{basename:t,children:n,future:r,window:o}=e,s=i.useRef();var a;null==s.current&&(s.current=(void 0===(a={window:o,v5Compat:!0})&&(a={}),g(function(e,t){let{pathname:n,search:i,hash:r}=e.location;return p("",{pathname:n,search:i,hash:r},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"===typeof t?t:f(t)},null,a)));let l=s.current,[c,u]=i.useState({action:l.action,location:l.location}),{v7_startTransition:d}=r||{},h=i.useCallback(e=>{d&&Ee?Ee(()=>u(e)):u(e)},[u,d]);return i.useLayoutEffect(()=>l.listen(h),[l,h]),i.useEffect(()=>ye(r),[r]),i.createElement(xe,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:l,future:r})}const Te="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,je=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=i.forwardRef(function(e,t){let n,{onClick:r,relative:o,reloadDocument:s,replace:a,state:l,target:c,to:d,preventScrollReset:h,viewTransition:p}=e,m=Ce(e,Le),{basename:g}=i.useContext($),v=!1;if("string"===typeof d&&je.test(d)&&(n=d,Te))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),n=M(t.pathname,g);t.origin===e.origin&&null!=n?d=n+t.search+t.hash:v=!0}catch(qg){}let y=function(e,t){let{relative:n}=void 0===t?{}:t;te()||u(!1);let{basename:r,navigator:o}=i.useContext($),{hash:s,pathname:a,search:l}=oe(e,{relative:n}),c=a;return"/"!==r&&(c="/"===a?r:U([r,a])),o.createHref({pathname:c,search:l,hash:s})}(d,{relative:o}),_=function(e,t){let{target:n,replace:r,state:o,preventScrollReset:s,relative:a,viewTransition:l}=void 0===t?{}:t,c=re(),u=ne(),d=oe(e,{relative:a});return i.useCallback(t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,n)){t.preventDefault();let n=void 0!==r?r:f(u)===f(d);c(e,{replace:n,state:o,preventScrollReset:s,relative:a,viewTransition:l})}},[u,c,d,r,o,n,e,s,a,l])}(d,{replace:a,state:l,target:c,preventScrollReset:h,relative:o,viewTransition:p});return i.createElement("a",Se({},m,{href:n||y,onClick:v||s?r:function(e){r&&r(e),e.defaultPrevented||_(e)},ref:t,target:c}))});var Oe,Me;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Oe||(Oe={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Me||(Me={}));function Ae(e){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(e)}function Re(e){var t=function(e,t){if("object"!=Ae(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=Ae(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ae(t)?t:t+""}function Ie(e,t,n){return(t=Re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(n),!0).forEach(function(t){Ie(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function De(e,t){return function(){return e.apply(t,arguments)}}const{toString:Fe}=Object.prototype,{getPrototypeOf:Ue}=Object,{iterator:qe,toStringTag:Ve}=Symbol,We=(He=Object.create(null),e=>{const t=Fe.call(e);return He[t]||(He[t]=t.slice(8,-1).toLowerCase())});var He;const Ze=e=>(e=e.toLowerCase(),t=>We(t)===e),Ge=e=>t=>typeof t===e,{isArray:Qe}=Array,Ye=Ge("undefined");function Ke(e){return null!==e&&!Ye(e)&&null!==e.constructor&&!Ye(e.constructor)&&Je(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=Ze("ArrayBuffer");const Xe=Ge("string"),Je=Ge("function"),et=Ge("number"),tt=e=>null!==e&&"object"===typeof e,nt=e=>{if("object"!==We(e))return!1;const t=Ue(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Ve in e)&&!(qe in e)},it=Ze("Date"),rt=Ze("File"),ot=Ze("Blob"),st=Ze("FileList");const at="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:{},lt="undefined"!==typeof at.FormData?at.FormData:void 0,ct=Ze("URLSearchParams"),[ut,dt,ht,pt]=["ReadableStream","Request","Response","Headers"].map(Ze);function ft(e,t){let n,i,{allOwnKeys:r=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),Qe(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(Ke(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(n=0;n<o;n++)s=i[n],t.call(null,e[s],s,e)}}function mt(e,t){if(Ke(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i,r=n.length;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const gt="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:n.g,vt=e=>!Ye(e)&&e!==gt;const yt=(_t="undefined"!==typeof Uint8Array&&Ue(Uint8Array),e=>_t&&e instanceof _t);var _t;const bt=Ze("HTMLFormElement"),xt=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),wt=Ze("RegExp"),kt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};ft(n,(n,r)=>{let o;!1!==(o=t(n,r,e))&&(i[r]=o||n)}),Object.defineProperties(e,i)};const St=Ze("AsyncFunction"),Ct=((e,t)=>{return e?setImmediate:t?(n="axios@".concat(Math.random()),i=[],gt.addEventListener("message",e=>{let{source:t,data:r}=e;t===gt&&r===n&&i.length&&i.shift()()},!1),e=>{i.push(e),gt.postMessage(n,"*")}):e=>setTimeout(e);var n,i})("function"===typeof setImmediate,Je(gt.postMessage)),Lt="undefined"!==typeof queueMicrotask?queueMicrotask.bind(gt):"undefined"!==typeof process&&process.nextTick||Ct,Et={isArray:Qe,isArrayBuffer:$e,isBuffer:Ke,isFormData:e=>{let t;return e&&(lt&&e instanceof lt||Je(e.append)&&("formdata"===(t=We(e))||"object"===t&&Je(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$e(e.buffer),t},isString:Xe,isNumber:et,isBoolean:e=>!0===e||!1===e,isObject:tt,isPlainObject:nt,isEmptyObject:e=>{if(!tt(e)||Ke(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(qg){return!1}},isReadableStream:ut,isRequest:dt,isResponse:ht,isHeaders:pt,isUndefined:Ye,isDate:it,isFile:rt,isReactNativeBlob:e=>!(!e||"undefined"===typeof e.uri),isReactNative:e=>e&&"undefined"!==typeof e.getParts,isBlob:ot,isRegExp:wt,isFunction:Je,isStream:e=>tt(e)&&Je(e.pipe),isURLSearchParams:ct,isTypedArray:yt,isFileList:st,forEach:ft,merge:function e(){const{caseless:t,skipUndefined:n}=vt(this)&&this||{},i={},r=(r,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const s=t&&mt(i,o)||o;nt(i[s])&&nt(r)?i[s]=e(i[s],r):nt(r)?i[s]=e({},r):Qe(r)?i[s]=r.slice():n&&Ye(r)||(i[s]=r)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&ft(arguments[o],r);return i},extend:function(e,t,n){let{allOwnKeys:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return ft(t,(t,i)=>{n&&Je(t)?Object.defineProperty(e,i,{value:De(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),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,i)=>{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let r,o,s;const a={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)s=r[o],i&&!i(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&Ue(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:We,kindOfTest:Ze,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(Qe(e))return e;let t=e.length;if(!et(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[qe]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:bt,hasOwnProperty:xt,hasOwnProp:xt,reduceDescriptors:kt,freezeMethods:e=>{kt(e,(t,n)=>{if(Je(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const i=e[n];Je(i)&&(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={},i=e=>{e.forEach(e=>{n[e]=!0})};return Qe(e)?i(e):i(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)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:mt,global:gt,isContextDefined:vt,isSpecCompliantForm:function(e){return!!(e&&Je(e.append)&&"FormData"===e[Ve]&&e[qe])},toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(tt(e)){if(t.indexOf(e)>=0)return;if(Ke(e))return e;if(!("toJSON"in e)){t[i]=e;const r=Qe(e)?[]:{};return ft(e,(e,t)=>{const o=n(e,i+1);!Ye(o)&&(r[t]=o)}),t[i]=void 0,r}}return e};return n(e,0)},isAsyncFn:St,isThenable:e=>e&&(tt(e)||Je(e))&&Je(e.then)&&Je(e.catch),setImmediate:Ct,asap:Lt,isIterable:e=>null!=e&&Je(e[qe])};class Pt extends Error{static from(e,t,n,i,r,o){const s=new Pt(e.message,t||e.code,n,i,r);return s.cause=e,s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),o&&Object.assign(s,o),s}constructor(e,t,n,i,r){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status)}toJSON(){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:Et.toJSONObject(this.config),code:this.code,status:this.status}}}Pt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Pt.ERR_BAD_OPTION="ERR_BAD_OPTION",Pt.ECONNABORTED="ECONNABORTED",Pt.ETIMEDOUT="ETIMEDOUT",Pt.ERR_NETWORK="ERR_NETWORK",Pt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Pt.ERR_DEPRECATED="ERR_DEPRECATED",Pt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Pt.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Pt.ERR_CANCELED="ERR_CANCELED",Pt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Pt.ERR_INVALID_URL="ERR_INVALID_URL";const Tt=Pt;function jt(e){return Et.isPlainObject(e)||Et.isArray(e)}function Nt(e){return Et.endsWith(e,"[]")?e.slice(0,-2):e}function Ot(e,t,n){return e?e.concat(t).map(function(e,t){return e=Nt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Mt=Et.toFlatObject(Et,{},null,function(e){return/^is[A-Z]/.test(e)});const At=function(e,t,n){if(!Et.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(n=Et.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Et.isUndefined(t[e])})).metaTokens,r=n.visitor||c,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!==typeof Blob&&Blob)&&Et.isSpecCompliantForm(t);if(!Et.isFunction(r))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Et.isDate(e))return e.toISOString();if(Et.isBoolean(e))return e.toString();if(!a&&Et.isBlob(e))throw new Tt("Blob is not supported. Use a Buffer instead.");return Et.isArrayBuffer(e)||Et.isTypedArray(e)?a&&"function"===typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,r){let a=e;if(Et.isReactNative(t)&&Et.isReactNativeBlob(e))return t.append(Ot(r,n,o),l(e)),!1;if(e&&!r&&"object"===typeof e)if(Et.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(Et.isArray(e)&&function(e){return Et.isArray(e)&&!e.some(jt)}(e)||(Et.isFileList(e)||Et.endsWith(n,"[]"))&&(a=Et.toArray(e)))return n=Nt(n),a.forEach(function(e,i){!Et.isUndefined(e)&&null!==e&&t.append(!0===s?Ot([n],i,o):null===s?n:n+"[]",l(e))}),!1;return!!jt(e)||(t.append(Ot(r,n,o),l(e)),!1)}const u=[],d=Object.assign(Mt,{defaultVisitor:c,convertValue:l,isVisitable:jt});if(!Et.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!Et.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+i.join("."));u.push(n),Et.forEach(n,function(n,o){!0===(!(Et.isUndefined(n)||null===n)&&r.call(t,n,Et.isString(o)?o.trim():o,i,d))&&e(n,i?i.concat(o):[o])}),u.pop()}}(e),t};function Rt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function It(e,t){this._pairs=[],e&&At(e,this,t)}const zt=It.prototype;zt.append=function(e,t){this._pairs.push([e,t])},zt.toString=function(e){const t=e?function(t){return e.call(this,t,Rt)}:Rt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Bt=It;function Dt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ft(e,t,n){if(!t)return e;const i=n&&n.encode||Dt,r=Et.isFunction(n)?{serialize:n}:n,o=r&&r.serialize;let s;if(s=o?o(t,r):Et.isURLSearchParams(t)?t.toString():new Bt(t,r).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ut=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){Et.forEach(this.handlers,function(t){null!==t&&e(t)})}},qt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Vt={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:Bt,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Wt="undefined"!==typeof window&&"undefined"!==typeof document,Ht="object"===typeof navigator&&navigator||void 0,Zt=Wt&&(!Ht||["ReactNative","NativeScript","NS"].indexOf(Ht.product)<0),Gt="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,Qt=Wt&&window.location.href||"http://localhost",Yt=Be(Be({},e),Vt);const Kt=function(e){function t(e,n,i,r){let o=e[r++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=r>=e.length;if(o=!o&&Et.isArray(i)?i.length:o,a)return Et.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s;i[o]&&Et.isObject(i[o])||(i[o]=[]);return t(e,n,i[o],r)&&Et.isArray(i[o])&&(i[o]=function(e){const t={},n=Object.keys(e);let i;const r=n.length;let o;for(i=0;i<r;i++)o=n[i],t[o]=e[o];return t}(i[o])),!s}if(Et.isFormData(e)&&Et.isFunction(e.entries)){const n={};return Et.forEachEntry(e,(e,i)=>{t(function(e){return Et.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),i,n,0)}),n}return null};const $t={transitional:qt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=Et.isObject(e);r&&Et.isHTMLForm(e)&&(e=new FormData(e));if(Et.isFormData(e))return i?JSON.stringify(Kt(e)):e;if(Et.isArrayBuffer(e)||Et.isBuffer(e)||Et.isStream(e)||Et.isFile(e)||Et.isBlob(e)||Et.isReadableStream(e))return e;if(Et.isArrayBufferView(e))return e.buffer;if(Et.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return At(e,new Yt.classes.URLSearchParams,Be({visitor:function(e,t,n,i){return Yt.isNode&&Et.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=Et.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return At(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||i?(t.setContentType("application/json",!1),function(e,t,n){if(Et.isString(e))try{return(t||JSON.parse)(e),Et.trim(e)}catch(qg){if("SyntaxError"!==qg.name)throw qg}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||$t.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(Et.isResponse(e)||Et.isReadableStream(e))return e;if(e&&Et.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(qg){if(n){if("SyntaxError"===qg.name)throw Tt.from(qg,Tt.ERR_BAD_RESPONSE,this,null,this.response);throw qg}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yt.classes.FormData,Blob:Yt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Et.forEach(["delete","get","head","post","put","patch"],e=>{$t.headers[e]={}});const Xt=$t,Jt=Et.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"]),en=Symbol("internals");function tn(e){return e&&String(e).trim().toLowerCase()}function nn(e){return!1===e||null==e?e:Et.isArray(e)?e.map(nn):String(e)}function rn(e,t,n,i,r){return Et.isFunction(i)?i.call(this,t,n):(r&&(t=n),Et.isString(t)?Et.isString(i)?-1!==t.indexOf(i):Et.isRegExp(i)?i.test(t):void 0:void 0)}class on{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function r(e,t,n){const r=tn(t);if(!r)throw new Error("header name must be a non-empty string");const o=Et.findKey(i,r);(!o||void 0===i[o]||!0===n||void 0===n&&!1!==i[o])&&(i[o||t]=nn(e))}const o=(e,t)=>Et.forEach(e,(e,n)=>r(e,n,t));if(Et.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Et.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,i,r;return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),i=e.substring(r+1).trim(),!n||t[n]&&Jt[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t})(e),t);else if(Et.isObject(e)&&Et.isIterable(e)){let n,i,r={};for(const t of e){if(!Et.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[i=t[0]]=(n=r[i])?Et.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(r,t)}else null!=e&&r(t,e,n);return this}get(e,t){if(e=tn(e)){const n=Et.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 i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(Et.isFunction(t))return t.call(this,e,n);if(Et.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=tn(e)){const n=Et.findKey(this,e);return!(!n||void 0===this[n]||t&&!rn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function r(e){if(e=tn(e)){const r=Et.findKey(n,e);!r||t&&!rn(0,n[r],r,t)||(delete n[r],i=!0)}}return Et.isArray(e)?e.forEach(r):r(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const r=t[n];e&&!rn(0,this[r],r,e,!0)||(delete this[r],i=!0)}return i}normalize(e){const t=this,n={};return Et.forEach(this,(i,r)=>{const o=Et.findKey(n,r);if(o)return t[o]=nn(i),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]=nn(i),n[s]=!0}),this}concat(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.constructor.concat(this,...t)}toJSON(e){const t=Object.create(null);return Et.forEach(this,(n,i)=>{null!=n&&!1!==n&&(t[i]=e&&Et.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(e=>{let[t,n]=e;return t+": "+n}).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.forEach(e=>t.set(e)),t}static accessor(e){const t=(this[en]=this[en]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=tn(e);t[i]||(!function(e,t){const n=Et.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(e,n,r){return this[i].call(this,t,e,n,r)},configurable:!0})})}(n,e),t[i]=!0)}return Et.isArray(e)?e.forEach(i):i(e),this}}on.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Et.reduceDescriptors(on.prototype,(e,t)=>{let{value:n}=e,i=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(e){this[i]=e}}}),Et.freezeMethods(on);const sn=on;function an(e,t){const n=this||Xt,i=t||n,r=sn.from(i.headers);let o=i.data;return Et.forEach(e,function(e){o=e.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function ln(e){return!(!e||!e.__CANCEL__)}const cn=class extends Tt{constructor(e,t,n){super(null==e?"canceled":e,Tt.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function un(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new Tt("Request failed with status code "+n.status,[Tt.ERR_BAD_REQUEST,Tt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const dn=function(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=i[s];r||(r=l),n[o]=a,i[o]=l;let u=s,d=0;for(;u!==o;)d+=n[u++],u%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-r<t)return;const h=c&&l-c;return h?Math.round(1e3*d/h):void 0}};const hn=function(e,t){let n,i,r=0,o=1e3/t;const s=function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();r=o,n=null,i&&(clearTimeout(i),i=null),e(...t)};return[function(){const e=Date.now(),t=e-r;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];t>=o?s(l,e):(n=l,i||(i=setTimeout(()=>{i=null,s(n)},o-t)))},()=>n&&s(n)]},pn=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=0;const r=dn(50,250);return hn(n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-i,l=r(a);i=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},fn=(e,t)=>{const n=null!=e;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},mn=e=>function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Et.asap(()=>e(...n))},gn=Yt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Yt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Yt.origin),Yt.navigator&&/(msie|trident)/i.test(Yt.navigator.userAgent)):()=>!0,vn=Yt.hasStandardBrowserEnv?{write(e,t,n,i,r,o,s){if("undefined"===typeof document)return;const a=["".concat(e,"=").concat(encodeURIComponent(t))];Et.isNumber(n)&&a.push("expires=".concat(new Date(n).toUTCString())),Et.isString(i)&&a.push("path=".concat(i)),Et.isString(r)&&a.push("domain=".concat(r)),!0===o&&a.push("secure"),Et.isString(s)&&a.push("SameSite=".concat(s)),document.cookie=a.join("; ")},read(e){if("undefined"===typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function yn(e,t,n){let i=!("string"===typeof(r=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r));var r;return e&&(i||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const _n=e=>e instanceof sn?Be({},e):e;function bn(e,t){t=t||{};const n={};function i(e,t,n,i){return Et.isPlainObject(e)&&Et.isPlainObject(t)?Et.merge.call({caseless:i},e,t):Et.isPlainObject(t)?Et.merge({},t):Et.isArray(t)?t.slice():t}function r(e,t,n,r){return Et.isUndefined(t)?Et.isUndefined(e)?void 0:i(void 0,e,0,r):i(e,t,0,r)}function o(e,t){if(!Et.isUndefined(t))return i(void 0,t)}function s(e,t){return Et.isUndefined(t)?Et.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(n,r,o){return o in t?i(n,r):o in e?i(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken: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,n)=>r(_n(e),_n(t),0,!0)};return Et.forEach(Object.keys(Be(Be({},e),t)),function(i){if("__proto__"===i||"constructor"===i||"prototype"===i)return;const o=Et.hasOwnProp(l,i)?l[i]:r,s=o(e[i],t[i],i);Et.isUndefined(s)&&o!==a||(n[i]=s)}),n}const xn=e=>{const t=bn({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=sn.from(s),t.url=Ft(yn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Et.isFormData(n))if(Yt.hasStandardBrowserEnv||Yt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Et.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(e=>{let[n,i]=e;t.includes(n.toLowerCase())&&s.set(n,i)})}if(Yt.hasStandardBrowserEnv&&(i&&Et.isFunction(i)&&(i=i(t)),i||!1!==i&&gn(t.url))){const e=r&&o&&vn.read(o);e&&s.set(r,e)}return t},wn="undefined"!==typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const i=xn(e);let r=i.data;const o=sn.from(i.headers).normalize();let s,a,l,c,u,{responseType:d,onUploadProgress:h,onDownloadProgress:p}=i;function f(){c&&c(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(s),i.signal&&i.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const i=sn.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());un(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:i,config:e,request:m}),m=null}m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Tt("Request aborted",Tt.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const i=t&&t.message?t.message:"Network Error",r=new Tt(i,Tt.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||qt;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new Tt(t,r.clarifyTimeoutError?Tt.ETIMEDOUT:Tt.ECONNABORTED,e,m)),m=null},void 0===r&&o.setContentType(null),"setRequestHeader"in m&&Et.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),Et.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),d&&"json"!==d&&(m.responseType=i.responseType),p&&([l,u]=pn(p,!0),m.addEventListener("progress",l)),h&&m.upload&&([a,c]=pn(h),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(i.cancelToken||i.signal)&&(s=t=>{m&&(n(!t||t.type?new cn(null,e,m):t),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(s),i.signal&&(i.signal.aborted?s():i.signal.addEventListener("abort",s)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);v&&-1===Yt.protocols.indexOf(v)?n(new Tt("Unsupported protocol "+v+":",Tt.ERR_BAD_REQUEST,e)):m.send(r||null)})},kn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,i=new AbortController;const r=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;i.abort(t instanceof Tt?t:new cn(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,r(new Tt("timeout of ".concat(t,"ms exceeded"),Tt.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)}),e=null)};e.forEach(e=>e.addEventListener("abort",r));const{signal:a}=i;return a.unsubscribe=()=>Et.asap(s),a}};function Sn(e,t){this.v=e,this.k=t}function Cn(e){return function(){return new Ln(e.apply(this,arguments))}}function Ln(e){var t,n;function i(t,n){try{var o=e[t](n),s=o.value,a=s instanceof Sn;Promise.resolve(a?s.v:s).then(function(n){if(a){var l="return"===t?"return":"next";if(!s.k||n.done)return i(l,n);n=e[l](n).value}r(o.done?"return":"normal",n)},function(e){i("throw",e)})}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(o,s){var a={key:e,arg:r,resolve:o,reject:s,next:null};n?n=n.next=a:(t=n=a,i(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}function En(e){return new Sn(e,0)}function Pn(e){var t={},n=!1;function i(t,i){return n=!0,i=new Promise(function(n){n(e[t](i))}),{done:!1,value:new Sn(i,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):i("return",e)}),t}function Tn(e){var t,n,i,r=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,i=Symbol.iterator);r--;){if(n&&null!=(t=e[n]))return t.call(e);if(i&&null!=(t=e[i]))return new jn(t.call(e));n="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function jn(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return jn=function(e){this.s=e,this.n=e.next},jn.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new jn(e)}Ln.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Ln.prototype.next=function(e){return this._invoke("next",e)},Ln.prototype.throw=function(e){return this._invoke("throw",e)},Ln.prototype.return=function(e){return this._invoke("return",e)};const Nn=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let i,r=0;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},On=function(){var e=Cn(function*(e,t){var n,i=!1,r=!1;try{for(var o,s=Tn(Mn(e));i=!(o=yield En(s.next())).done;i=!1){const e=o.value;yield*Pn(Tn(Nn(e,t)))}}catch(a){r=!0,n=a}finally{try{i&&null!=s.return&&(yield En(s.return()))}finally{if(r)throw n}}});return function(t,n){return e.apply(this,arguments)}}(),Mn=function(){var e=Cn(function*(e){if(e[Symbol.asyncIterator])return void(yield*Pn(Tn(e)));const t=e.getReader();try{for(;;){const{done:e,value:n}=yield En(t.read());if(e)break;yield n}}finally{yield En(t.cancel())}});return function(t){return e.apply(this,arguments)}}(),An=(e,t,n,i)=>{const r=On(e,t);let o,s=0,a=e=>{o||(o=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await r.next();if(t)return a(),void e.close();let o=i.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(i))}catch(t){throw a(t),t}},cancel:e=>(a(e),r.return())},{highWaterMark:2})},{isFunction:Rn}=Et,In=(e=>{let{Request:t,Response:n}=e;return{Request:t,Response:n}})(Et.global),{ReadableStream:zn,TextEncoder:Bn}=Et.global,Dn=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return!!e(...n)}catch(qg){return!1}},Fn=e=>{e=Et.merge.call({skipUndefined:!0},In,e);const{fetch:t,Request:n,Response:i}=e,r=t?Rn(t):"function"===typeof fetch,o=Rn(n),s=Rn(i);if(!r)return!1;const a=r&&Rn(zn),l=r&&("function"===typeof Bn?(c=new Bn,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const u=o&&a&&Dn(()=>{let e=!1;const t=new n(Yt.origin,{body:new zn,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=s&&a&&Dn(()=>Et.isReadableStream(new i("").body)),h={stream:d&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let i=t&&t[e];if(i)return i.call(t);throw new Tt("Response type '".concat(e,"' is not supported"),Tt.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const i=Et.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(Et.isBlob(e))return e.size;if(Et.isSpecCompliantForm(e)){const t=new n(Yt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Et.isArrayBufferView(e)||Et.isArrayBuffer(e)?e.byteLength:(Et.isURLSearchParams(e)&&(e+=""),Et.isString(e)?(await l(e)).byteLength:void 0)})(t):i};return async e=>{let{url:r,method:s,data:a,signal:l,cancelToken:c,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:v,headers:y,withCredentials:_="same-origin",fetchOptions:b}=xn(e),x=t||fetch;v=v?(v+"").toLowerCase():"text";let w=kn([l,c&&c.toAbortSignal()],f),k=null;const S=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let C;try{if(g&&u&&"get"!==s&&"head"!==s&&0!==(C=await p(y,a))){let e,t=new n(r,{method:"POST",body:a,duplex:"half"});if(Et.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=fn(C,pn(mn(g)));a=An(t.body,65536,e,n)}}Et.isString(_)||(_=_?"include":"omit");const t=o&&"credentials"in n.prototype,l=Be(Be({},b),{},{signal:w,method:s.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?_:void 0});k=o&&new n(r,l);let c=await(o?x(k,b):x(r,l));const f=d&&("stream"===v||"response"===v);if(d&&(m||f&&S)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=Et.toFiniteNumber(c.headers.get("content-length")),[n,r]=m&&fn(t,pn(mn(m),!0))||[];c=new i(An(c.body,65536,n,()=>{r&&r(),S&&S()}),e)}v=v||"text";let L=await h[Et.findKey(h,v)||"text"](c,e);return!f&&S&&S(),await new Promise((t,n)=>{un(t,n,{data:L,headers:sn.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(L){if(S&&S(),L&&"TypeError"===L.name&&/Load failed|fetch/i.test(L.message))throw Object.assign(new Tt("Network Error",Tt.ERR_NETWORK,e,k,L&&L.response),{cause:L.cause||L});throw Tt.from(L,L&&L.code,e,k,L&&L.response)}}},Un=new Map,qn=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:r}=t,o=[i,r,n];let s,a,l=o.length,c=Un;for(;l--;)s=o[l],a=c.get(s),void 0===a&&c.set(s,a=l?new Map:Fn(t)),c=a;return a},Vn=(qn(),{http:null,xhr:wn,fetch:{get:qn}});Et.forEach(Vn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(qg){}Object.defineProperty(e,"adapterName",{value:t})}});const Wn=e=>"- ".concat(e),Hn=e=>Et.isFunction(e)||null===e||!1===e;const Zn={getAdapter:function(e,t){e=Et.isArray(e)?e:[e];const{length:n}=e;let i,r;const o={};for(let s=0;s<n;s++){let n;if(i=e[s],r=i,!Hn(i)&&(r=Vn[(n=String(i)).toLowerCase()],void 0===r))throw new Tt("Unknown adapter '".concat(n,"'"));if(r&&(Et.isFunction(r)||(r=r.get(t))))break;o[n||"#"+s]=r}if(!r){const e=Object.entries(o).map(e=>{let[t,n]=e;return"adapter ".concat(t," ")+(!1===n?"is not supported by the environment":"is not available in the build")});let t=n?e.length>1?"since :\n"+e.map(Wn).join("\n"):" "+Wn(e[0]):"as no adapter specified";throw new Tt("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return r},adapters:Vn};function Gn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cn(null,e)}function Qn(e){Gn(e),e.headers=sn.from(e.headers),e.data=an.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Zn.getAdapter(e.adapter||Xt.adapter,e)(e).then(function(t){return Gn(e),t.data=an.call(e,e.transformResponse,t),t.headers=sn.from(t.headers),t},function(t){return ln(t)||(Gn(e),t&&t.response&&(t.response.data=an.call(e,e.transformResponse,t.response),t.response.headers=sn.from(t.response.headers))),Promise.reject(t)})}const Yn="1.13.6",Kn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Kn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const $n={};Kn.transitional=function(e,t,n){function i(e,t){return"[Axios v"+Yn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,o)=>{if(!1===e)throw new Tt(i(r," has been removed"+(t?" in "+t:"")),Tt.ERR_DEPRECATED);return t&&!$n[r]&&($n[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}},Kn.spelling=function(e){return(t,n)=>(console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0)};const Xn={assertOptions:function(e,t,n){if("object"!==typeof e)throw new Tt("options must be an object",Tt.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const o=i[r],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new Tt("option "+o+" must be "+n,Tt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Tt("Unknown option "+o,Tt.ERR_BAD_OPTION)}},validators:Kn},Jn=Xn.validators;class ei{constructor(e){this.defaults=e||{},this.interceptors={request:new Ut,response:new Ut}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(qg){}}throw n}}_request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=bn(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:r}=t;void 0!==n&&Xn.assertOptions(n,{silentJSONParsing:Jn.transitional(Jn.boolean),forcedJSONParsing:Jn.transitional(Jn.boolean),clarifyTimeoutError:Jn.transitional(Jn.boolean),legacyInterceptorReqResOrdering:Jn.transitional(Jn.boolean)},!1),null!=i&&(Et.isFunction(i)?t.paramsSerializer={serialize:i}:Xn.assertOptions(i,{encode:Jn.function,serialize:Jn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Xn.assertOptions(t,{baseUrl:Jn.spelling("baseURL"),withXsrfToken:Jn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=r&&Et.merge(r.common,r[t.method]);r&&Et.forEach(["delete","get","head","post","put","patch","common"],e=>{delete r[e]}),t.headers=sn.concat(o,r);const s=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"===typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||qt;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[Qn.bind(this),void 0];for(e.unshift(...s),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=s.length;let h=t;for(;d<u;){const e=s[d++],t=s[d++];try{h=e(h)}catch(p){t.call(this,p);break}}try{c=Qn.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Ft(yn((e=bn(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Et.forEach(["delete","get","head","options"],function(e){ei.prototype[e]=function(t,n){return this.request(bn(n||{},{method:e,url:t,data:(n||{}).data}))}}),Et.forEach(["post","put","patch"],function(e){function t(t){return function(n,i,r){return this.request(bn(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}ei.prototype[e]=t(),ei.prototype[e+"Form"]=t(!0)});const ti=ei;class ni{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 i=new Promise(e=>{n.subscribe(e),t=e}).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e(function(e,i,r){n.reason||(n.reason=new cn(e,i,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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ni(function(t){e=t}),cancel:e}}}const ii=ni;const ri={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ri).forEach(e=>{let[t,n]=e;ri[n]=t});const oi=ri;const si=function e(t){const n=new ti(t),i=De(ti.prototype.request,n);return Et.extend(i,ti.prototype,n,{allOwnKeys:!0}),Et.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(bn(t,n))},i}(Xt);si.Axios=ti,si.CanceledError=cn,si.CancelToken=ii,si.isCancel=ln,si.VERSION=Yn,si.toFormData=At,si.AxiosError=Tt,si.Cancel=si.CanceledError,si.all=function(e){return Promise.all(e)},si.spread=function(e){return function(t){return e.apply(null,t)}},si.isAxiosError=function(e){return Et.isObject(e)&&!0===e.isAxiosError},si.mergeConfig=bn,si.AxiosHeaders=sn,si.formToJSON=e=>Kt(Et.isHTMLForm(e)?new FormData(e):e),si.getAdapter=Zn.getAdapter,si.HttpStatusCode=oi,si.default=si;const ai=si,li=(()=>{const e="/api";if(e&&e.startsWith("http"))return e;if("undefined"!==typeof window){const e=window.location.port,t=window.location.hostname;if("3000"===e)return"http://".concat(t,"/api")}return"/api"})();const ci=new class{constructor(){this.api=void 0,this.api=ai.create({baseURL:li,withCredentials:!0,headers:{"Content-Type":"application/json"}})}async login(e){return(await this.api.post("/auth/login",e)).data}async signup(e){return(await this.api.post("/auth/signup",e)).data}async logout(){await this.api.post("/auth/logout")}async getCurrentUser(){return(await this.api.get("/auth/me")).data}async getSutStatus(){return(await this.api.get("/status")).data}async getQuests(e){const t=new URLSearchParams;e&&(e.status&&t.append("status",e.status),e.quest_type&&t.append("quest_type",e.quest_type),e.priority&&t.append("priority",e.priority),void 0!==e.dark_magic&&t.append("dark_magic",e.dark_magic.toString()),e.location_id&&t.append("location_id",e.location_id.toString()),e.assigned_to&&t.append("assigned_to",e.assigned_to.toString()));const n=t.toString(),i=n?"/quests/?".concat(n):"/quests/";return(await this.api.get(i)).data}async getQuest(e){return(await this.api.get("/quests/".concat(e))).data}async createQuest(e){return(await this.api.post("/quests/",e)).data}async updateQuest(e,t){return(await this.api.put("/quests/".concat(e),t)).data}async deleteQuest(e){await this.api.delete("/quests/".concat(e))}async completeQuest(e){return(await this.api.put("/quests/".concat(e,"/complete"))).data}async getMembers(){return(await this.api.get("/members/")).data}async getMember(e){return(await this.api.get("/members/".concat(e))).data}async getLocations(){return(await this.api.get("/locations/")).data}async getLocation(e){return(await this.api.get("/locations/".concat(e))).data}async startNpcChat(e){return(await this.api.post("/chat/start",{character:e})).data}async sendNpcMessage(e,t){return(await this.api.post("/chat/message",{character:e,message:t})).data}async getNpcChatSession(e){return(await this.api.get("/chat/session?character=".concat(e))).data}async resetNpcChat(e){return(await this.api.post("/chat/reset",{character:e})).data}async createQuestFromNpc(e,t){return(await this.api.post("/chat/create_quest",Be({character:e},t))).data}async getShopItems(e){const t=e?"?character=".concat(encodeURIComponent(e)):"";return(await this.api.get("/shop/items".concat(t))).data.items}async purchaseItem(e,t){return(await this.api.post("/shop/purchase",{item_id:e,paid_price:t})).data}async getInventory(){return(await this.api.get("/shop/inventory")).data.inventory}async getBargainStats(){return(await this.api.get("/shop/stats")).data.stats}async getGoldBalance(){return(await this.api.get("/shop/balance")).data.gold}},ui="user_signup",di="user_login",hi="user_logout",pi="quest_created",fi="quest_updated",mi="quest_deleted",gi="quest_completed",vi="game_started",yi="game_completed",_i="game_failed",bi="bargain_initiated",xi="bargain_completed",wi="bargain_failed",ki="item_purchased",Si="npc_chat_initiated",Ci="npc_message_sent",Li="inventory_viewed",Ei="inventory_item_added",Pi="inventory_item_removed",Ti="map_viewed",ji="dashboard_viewed",Ni="quests_page_viewed";const Oi=new class{constructor(){this.isEnabled=!0,this.isEnabled="undefined"!==typeof window&&"function"===typeof window.gtag;("true"==={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:"fellowship-tutorial1-admin-14.fellowship.testingfantasy.com",WDS_SOCKET_PATH:"/ws",WDS_SOCKET_PORT:"80",FAST_REFRESH:!1,REACT_APP_ENABLE_TEST_CONTROLS:"true",REACT_APP_API_URL:"/api"}.REACT_APP_DISABLE_ANALYTICS||"undefined"!==typeof window&&(void 0!==window.Cypress||!0===navigator.webdriver))&&(this.isEnabled=!1)}trackEvent(e,t){if(this.isEnabled)try{gtag("event",e,t||{})}catch(n){console.error("Error tracking analytics event:",n)}else console.debug("Analytics disabled or gtag not available")}setUserProperties(e){if(this.isEnabled)try{gtag("config",Be({},e))}catch(t){console.error("Error setting user properties:",t)}else console.debug("Analytics disabled or gtag not available")}setUserId(e){if(this.isEnabled)try{gtag("config",{user_id:String(e)})}catch(t){console.error("Error setting user ID:",t)}else console.debug("Analytics disabled or gtag not available")}trackSignup(e){this.trackEvent(ui,{username:e})}trackLogin(e){this.trackEvent(di,{username:e})}trackLogout(){this.trackEvent(hi)}trackQuestCreated(e,t,n){this.trackEvent(pi,{quest_id:e,quest_title:t,quest_type:n||"unknown"})}trackQuestUpdated(e,t){this.trackEvent(fi,{quest_id:e,quest_title:t})}trackQuestDeleted(e,t){this.trackEvent(mi,{quest_id:e,quest_title:t})}trackQuestCompleted(e,t,n){this.trackEvent(gi,{quest_id:e,quest_title:t,game_type:n||"unknown"})}trackGameStarted(e){this.trackEvent(vi,{game_type:e})}trackGameCompleted(e,t){this.trackEvent(yi,{game_type:e,score:t||0})}trackGameFailed(e,t){this.trackEvent(_i,{game_type:e,reason:t||"unknown"})}trackBargainInitiated(){this.trackEvent(bi)}trackBargainCompleted(e,t){this.trackEvent(xi,{item_name:e,bargain_value:t||0})}trackBargainFailed(e){this.trackEvent(wi,{item_name:e||"unknown"})}trackItemPurchased(e,t,n){this.trackEvent(ki,{item_name:e,item_id:n||0,price:t,currency:"gold"})}trackNpcChatInitiated(e){this.trackEvent(Si,{character:e})}trackNpcMessageSent(e,t){this.trackEvent(Ci,{character:e,message_length:t||0})}trackInventoryViewed(e){this.trackEvent(Li,{item_count:e||0})}trackInventoryItemAdded(e,t){this.trackEvent(Ei,{item_name:e,quantity:t||1})}trackInventoryItemRemoved(e,t){this.trackEvent(Pi,{item_name:e,quantity:t||1})}trackPageView(e,t){this.trackEvent("page_view",{page_title:t||e,page_location:window.location.href})}trackMapViewed(){this.trackEvent(Ti,{page_title:"Middle-earth Map"})}trackDashboardViewed(){this.trackEvent(ji,{page_title:"The Council Chamber"})}trackQuestsPageViewed(){this.trackEvent(Ni,{page_title:"Quests"})}isAnalyticsEnabled(){return this.isEnabled}setEnabled(e){this.isEnabled=e}};function Mi(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ai=n(579);const Ri=["variant","children","isLoading","icon","disabled","className"],Ii=i.forwardRef((e,t)=>{let{variant:n="epic",children:i,isLoading:r=!1,icon:o,disabled:s,className:a=""}=e,l=Mi(e,Ri);const c=s||r?"opacity-50 cursor-not-allowed":"";return(0,Ai.jsxs)("button",Be(Be({ref:t,className:"".concat({epic:"px-6 py-3 bg-gold text-parchment-light font-epic rounded-lg hover:bg-gold-light shadow-lg hover:shadow-gold transition-all duration-300 hover:scale-105 active:scale-95",secondary:"px-6 py-3 bg-forest text-parchment-light font-medium rounded-lg hover:bg-forest-light shadow-md hover:shadow-lg transition-all duration-300",danger:"px-6 py-3 bg-red-600 text-white font-medium rounded-lg hover:bg-red-700 shadow-md hover:shadow-lg transition-all duration-300",small:"px-3 py-1 text-sm font-medium rounded transition-all duration-300 bg-gold hover:bg-gold-light text-text-primary"}[n]," ").concat(c," ").concat(a," font-medium cursor-pointer flex items-center gap-2 justify-center"),disabled:s||r},l),{},{children:[r&&(0,Ai.jsx)("span",{className:"animate-spin",children:"\u23f3"}),o&&(0,Ai.jsx)("span",{children:o}),i]}))});Ii.displayName="Button";const zi=(0,i.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Bi=(0,i.createContext)({}),Di=(0,i.createContext)(null),Fi="undefined"!==typeof document,Ui=Fi?i.useLayoutEffect:i.useEffect,qi=(0,i.createContext)({strict:!1}),Vi=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Wi="data-"+Vi("framerAppearId");function Hi(e){return e&&"object"===typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Zi(e){return"string"===typeof e||Array.isArray(e)}function Gi(e){return null!==e&&"object"===typeof e&&"function"===typeof e.start}const Qi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yi=["initial",...Qi];function Ki(e){return Gi(e.animate)||Yi.some(t=>Zi(e[t]))}function $i(e){return Boolean(Ki(e)||e.variants)}function Xi(e){const{initial:t,animate:n}=function(e,t){if(Ki(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Zi(t)?t:void 0,animate:Zi(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,i.useContext)(Bi));return(0,i.useMemo)(()=>({initial:t,animate:n}),[Ji(t),Ji(n)])}function Ji(e){return Array.isArray(e)?e.join(" "):e}const er={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},tr={};for(const n in er)tr[n]={isEnabled:e=>er[n].some(t=>!!e[t])};const nr=(0,i.createContext)({}),ir=(0,i.createContext)({}),rr=Symbol.for("motionComponentSymbol");function or(e){let{preloadedFeatures:t,createVisualElement:n,useRender:r,useVisualState:o,Component:s}=e;t&&function(e){for(const t in e)tr[t]=Be(Be({},tr[t]),e[t])}(t);const a=(0,i.forwardRef)(function(e,a){let l;const c=Be(Be(Be({},(0,i.useContext)(zi)),e),{},{layoutId:sr(e)}),{isStatic:u}=c,d=Xi(e),h=o(e,u);if(!u&&Fi){d.visualElement=function(e,t,n,r){const{visualElement:o}=(0,i.useContext)(Bi),s=(0,i.useContext)(qi),a=(0,i.useContext)(Di),l=(0,i.useContext)(zi).reducedMotion,c=(0,i.useRef)();r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:l}));const u=c.current;(0,i.useInsertionEffect)(()=>{u&&u.update(n,a)});const d=(0,i.useRef)(Boolean(n[Wi]&&!window.HandoffComplete));return Ui(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,i.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(s,h,c,n);const e=(0,i.useContext)(ir),r=(0,i.useContext)(qi).strict;d.visualElement&&(l=d.visualElement.loadFeatures(c,r,t,e))}return i.createElement(Bi.Provider,{value:d},l&&d.visualElement?i.createElement(l,Be({visualElement:d.visualElement},c)):null,r(s,e,function(e,t,n){return(0,i.useCallback)(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&("function"===typeof n?n(i):Hi(n)&&(n.current=i))},[t])}(h,d.visualElement,a),h,u,d.visualElement))});return a[rr]=s,a}function sr(e){let{layoutId:t}=e;const n=(0,i.useContext)(nr).id;return n&&void 0!==t?n+"-"+t:t}function ar(e){function t(t){return or(e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}if("undefined"===typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const lr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function cr(e){return"string"===typeof e&&!e.includes("-")&&!!(lr.indexOf(e)>-1||/[A-Z]/.test(e))}const ur={};const dr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hr=new Set(dr);function pr(e,t){let{layout:n,layoutId:i}=t;return hr.has(e)||e.startsWith("origin")||(n||void 0!==i)&&(!!ur[e]||"opacity"===e)}const fr=e=>Boolean(e&&e.getVelocity),mr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gr=dr.length;const vr=e=>t=>"string"===typeof t&&t.startsWith(e),yr=vr("--"),_r=vr("var(--"),br=(e,t)=>t&&"number"===typeof e?t.transform(e):e,xr=(e,t,n)=>Math.min(Math.max(n,e),t),wr={test:e=>"number"===typeof e,parse:parseFloat,transform:e=>e},kr=Be(Be({},wr),{},{transform:e=>xr(0,1,e)}),Sr=Be(Be({},wr),{},{default:1}),Cr=e=>Math.round(1e5*e)/1e5,Lr=/(-)?([\d]*\.?[\d])+/g,Er=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Pr=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Tr(e){return"string"===typeof e}const jr=e=>({test:t=>Tr(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>"".concat(t).concat(e)}),Nr=jr("deg"),Or=jr("%"),Mr=jr("px"),Ar=jr("vh"),Rr=jr("vw"),Ir=Be(Be({},Or),{},{parse:e=>Or.parse(e)/100,transform:e=>Or.transform(100*e)}),zr=Be(Be({},wr),{},{transform:Math.round}),Br={borderWidth:Mr,borderTopWidth:Mr,borderRightWidth:Mr,borderBottomWidth:Mr,borderLeftWidth:Mr,borderRadius:Mr,radius:Mr,borderTopLeftRadius:Mr,borderTopRightRadius:Mr,borderBottomRightRadius:Mr,borderBottomLeftRadius:Mr,width:Mr,maxWidth:Mr,height:Mr,maxHeight:Mr,size:Mr,top:Mr,right:Mr,bottom:Mr,left:Mr,padding:Mr,paddingTop:Mr,paddingRight:Mr,paddingBottom:Mr,paddingLeft:Mr,margin:Mr,marginTop:Mr,marginRight:Mr,marginBottom:Mr,marginLeft:Mr,rotate:Nr,rotateX:Nr,rotateY:Nr,rotateZ:Nr,scale:Sr,scaleX:Sr,scaleY:Sr,scaleZ:Sr,skew:Nr,skewX:Nr,skewY:Nr,distance:Mr,translateX:Mr,translateY:Mr,translateZ:Mr,x:Mr,y:Mr,z:Mr,perspective:Mr,transformPerspective:Mr,opacity:kr,originX:Ir,originY:Ir,originZ:Mr,zIndex:zr,fillOpacity:kr,strokeOpacity:kr,numOctaves:zr};function Dr(e,t,n,i){const{style:r,vars:o,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const e=t[d];if(yr(d)){o[d]=e;continue}const n=Br[d],i=br(e,n);if(hr.has(d)){if(l=!0,s[d]=i,!u)continue;e!==(n.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=i):r[d]=i}if(t.transform||(l||i?r.transform=function(e,t,n,i){let{enableHardwareAcceleration:r=!0,allowTransformNone:o=!0}=t,s="";for(let a=0;a<gr;a++){const t=dr[a];void 0!==e[t]&&(s+="".concat(mr[t]||t,"(").concat(e[t],") "))}return r&&!e.z&&(s+="translateZ(0)"),s=s.trim(),i?s=i(e,n?"":s):o&&n&&(s="none"),s}(e.transform,n,u,i):r.transform&&(r.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin="".concat(e," ").concat(t," ").concat(n)}}const Fr=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ur(e,t,n){for(const i in t)fr(t[i])||pr(i,n)||(e[i]=t[i])}function qr(e,t,n){const r={};return Ur(r,e.style||{},e),Object.assign(r,function(e,t,n){let{transformTemplate:r}=e;return(0,i.useMemo)(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Dr(e,t,{enableHardwareAcceleration:!n},r),Object.assign({},e.vars,e.style)},[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}function Vr(e,t,n){const i={},r=qr(e,t,n);return e.drag&&!1!==e.dragListener&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-".concat("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=r,i}const Wr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Hr(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Wr.has(e)}let Zr=e=>!Hr(e);try{(Gr=require("@emotion/is-prop-valid").default)&&(Zr=e=>e.startsWith("on")?!Hr(e):Gr(e))}catch(Vg){}var Gr;function Qr(e,t,n){return"string"===typeof e?e:Mr.transform(t+n*e)}const Yr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Kr={offset:"strokeDashoffset",array:"strokeDasharray"};const $r=["attrX","attrY","attrScale","originX","originY","pathLength","pathSpacing","pathOffset"];function Xr(e,t,n,i,r){let{attrX:o,attrY:s,attrScale:a,originX:l,originY:c,pathLength:u,pathSpacing:d=1,pathOffset:h=0}=t;if(Dr(e,Mi(t,$r),n,r),i)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:f,dimensions:m}=e;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==l||void 0!==c||f.transform)&&(f.transformOrigin=function(e,t,n){const i=Qr(t,e.x,e.width),r=Qr(n,e.y,e.height);return"".concat(i," ").concat(r)}(m,void 0!==l?l:.5,void 0!==c?c:.5)),void 0!==o&&(p.x=o),void 0!==s&&(p.y=s),void 0!==a&&(p.scale=a),void 0!==u&&function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];e.pathLength=1;const o=r?Yr:Kr;e[o.offset]=Mr.transform(-i);const s=Mr.transform(t),a=Mr.transform(n);e[o.array]="".concat(s," ").concat(a)}(p,u,d,h,!1)}const Jr=()=>Be(Be({},{style:{},transform:{},transformOrigin:{},vars:{}}),{},{attrs:{}}),eo=e=>"string"===typeof e&&"svg"===e.toLowerCase();function to(e,t,n,r){const o=(0,i.useMemo)(()=>{const n=Jr();return Xr(n,t,{enableHardwareAcceleration:!1},eo(r),e.transformTemplate),Be(Be({},n.attrs),{},{style:Be({},n.style)})},[t]);if(e.style){const t={};Ur(t,e.style,e),o.style=Be(Be({},t),o.style)}return o}function no(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(t,n,r,o,s)=>{let{latestValues:a}=o;const l=(cr(t)?to:Vr)(n,a,s,t),c=function(e,t,n){const i={};for(const r in e)"values"===r&&"object"===typeof e.values||(Zr(r)||!0===n&&Hr(r)||!t&&!Hr(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}(n,"string"===typeof t,e),u=Be(Be(Be({},c),l),{},{ref:r}),{children:d}=n,h=(0,i.useMemo)(()=>fr(d)?d.get():d,[d]);return(0,i.createElement)(t,Be(Be({},u),{},{children:h}))}}function io(e,t,n,i){let{style:r,vars:o}=t;Object.assign(e.style,r,i&&i.getProjectionStyles(n));for(const s in o)e.style.setProperty(s,o[s])}const ro=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function oo(e,t,n,i){io(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(ro.has(r)?r:Vi(r),t.attrs[r])}function so(e,t){const{style:n}=e,i={};for(const r in n)(fr(n[r])||t.style&&fr(t.style[r])||pr(r,e))&&(i[r]=n[r]);return i}function ao(e,t){const n=so(e,t);for(const i in e)if(fr(e[i])||fr(t[i])){n[-1!==dr.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]}return n}function lo(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return"function"===typeof t&&(t=t(void 0!==n?n:e.custom,i,r)),"string"===typeof t&&(t=e.variants&&e.variants[t]),"function"===typeof t&&(t=t(void 0!==n?n:e.custom,i,r)),t}function co(e){const t=(0,i.useRef)(null);return null===t.current&&(t.current=e()),t.current}const uo=e=>Array.isArray(e),ho=e=>uo(e)?e[e.length-1]||0:e;function po(e){const t=fr(e)?e.get():e;return n=t,Boolean(n&&"object"===typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const fo=["transitionEnd","transition"];const mo=e=>(t,n)=>{const r=(0,i.useContext)(Bi),o=(0,i.useContext)(Di),s=()=>function(e,t,n,i){let{scrapeMotionValuesFromProps:r,createRenderState:o,onMount:s}=e;const a={latestValues:go(t,n,i,r),renderState:o()};return s&&(a.mount=e=>s(t,e,a)),a}(e,t,r,o);return n?s():co(s)};function go(e,t,n,i){const r={},o=i(e,{});for(const h in o)r[h]=po(o[h]);let{initial:s,animate:a}=e;const l=Ki(e),c=$i(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!==typeof d&&!Gi(d)){(Array.isArray(d)?d:[d]).forEach(t=>{const n=lo(e,t);if(!n)return;const{transitionEnd:i,transition:o}=n,s=Mi(n,fo);for(const e in s){let t=s[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(r[e]=t)}for(const e in i)r[e]=i[e]})}return r}const vo=e=>e;class yo{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const _o=["prepare","read","update","preRender","render","postRender"];const{schedule:bo,cancel:xo,state:wo,steps:ko}=function(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=_o.reduce((e,t)=>(e[t]=function(e){let t=new yo,n=new yo,i=0,r=!1,o=!1;const s=new WeakSet,a={schedule:function(e){const o=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&r,a=o?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&s.add(e),a.add(e)&&o&&r&&(i=t.order.length),e},cancel:e=>{n.remove(e),s.delete(e)},process:l=>{if(r)o=!0;else{if(r=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let n=0;n<i;n++){const i=t.order[n];i(l),s.has(i)&&(a.schedule(i),e())}r=!1,o&&(o=!1,a.process(l))}}};return a}(()=>n=!0),e),{}),s=e=>o[e].process(r),a=()=>{const o=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(o-r.timestamp,40),1),r.timestamp=o,r.isProcessing=!0,_o.forEach(s),r.isProcessing=!1,n&&t&&(i=!1,e(a))},l=_o.reduce((t,s)=>{const l=o[s];return t[s]=function(t){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n||(n=!0,i=!0,r.isProcessing||e(a)),l.schedule(t,o,s)},t},{});return{schedule:l,cancel:e=>_o.forEach(t=>o[t].cancel(e)),state:r,steps:o}}("undefined"!==typeof requestAnimationFrame?requestAnimationFrame:vo,!0),So={useVisualState:mo({scrapeMotionValuesFromProps:ao,createRenderState:Jr,onMount:(e,t,n)=>{let{renderState:i,latestValues:r}=n;bo.read(()=>{try{i.dimensions="function"===typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(qg){i.dimensions={x:0,y:0,width:0,height:0}}}),bo.render(()=>{Xr(i,r,{enableHardwareAcceleration:!1},eo(t.tagName),e.transformTemplate),oo(t,i)})}})},Co={useVisualState:mo({scrapeMotionValuesFromProps:so,createRenderState:Fr})};function Lo(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const Eo=e=>"mouse"===e.pointerType?"number"!==typeof e.button||e.button<=0:!1!==e.isPrimary;function Po(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{point:{x:e[t+"X"],y:e[t+"Y"]}}}function To(e,t,n,i){return Lo(e,t,(e=>t=>Eo(t)&&e(t,Po(t)))(n),i)}const jo=(e,t)=>n=>t(e(n)),No=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(jo)};function Oo(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const Mo=Oo("dragHorizontal"),Ao=Oo("dragVertical");function Ro(e){let t=!1;if("y"===e)t=Ao();else if("x"===e)t=Mo();else{const e=Mo(),n=Ao();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function Io(){const e=Ro(!0);return!e||(e(),!1)}class zo{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Bo(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End");return To(e.current,n,(n,r)=>{if("touch"===n.pointerType||Io())return;const o=e.getProps();e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",t),o[i]&&bo.update(()=>o[i](n,r))},{passive:!e.getProps()[i]})}const Do=(e,t)=>!!t&&(e===t||Do(e,t.parentElement));function Fo(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Po(n))}const Uo=["root"],qo=new WeakMap,Vo=new WeakMap,Wo=e=>{const t=qo.get(e.target);t&&t(e)},Ho=e=>{e.forEach(Wo)};function Zo(e,t,n){const i=function(e){let{root:t}=e,n=Mi(e,Uo);const i=t||document;Vo.has(i)||Vo.set(i,{});const r=Vo.get(i),o=JSON.stringify(n);return r[o]||(r[o]=new IntersectionObserver(Ho,Be({root:t},n))),r[o]}(t);return qo.set(e,n),i.observe(e),()=>{qo.delete(e),i.unobserve(e)}}const Go={some:0,all:1};const Qo={inView:{Feature:class extends zo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:i="some",once:r}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"===typeof i?i:Go[i]};return Zo(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,r&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=t?n:i;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"===typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node,n=["amount","margin","root"].some(function(e){let{viewport:t={}}=e,{viewport:n={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=>t[e]!==n[e]}(e,t));n&&this.startObserver()}unmount(){}}},tap:{Feature:class extends zo{constructor(){super(...arguments),this.removeStartListeners=vo,this.removeEndListeners=vo,this.removeAccessibleListeners=vo,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),i=To(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:i,globalTapTarget:r}=this.node.getProps();bo.update(()=>{r||Do(this.node.current,e.target)?n&&n(e,t):i&&i(e,t)})},{passive:!(n.onTap||n.onPointerUp)}),r=To(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=No(i,r),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=Lo(this.node.current,"keydown",e=>{if("Enter"!==e.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=Lo(this.node.current,"keyup",e=>{"Enter"===e.key&&this.checkPressEnd()&&Fo("up",(e,t)=>{const{onTap:n}=this.node.getProps();n&&bo.update(()=>n(e,t))})}),Fo("down",(e,t)=>{this.startPress(e,t)})}),t=Lo(this.node.current,"blur",()=>{this.isPressing&&Fo("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=No(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&bo.update(()=>n(e,t))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Io()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&bo.update(()=>n(e,t))}mount(){const e=this.node.getProps(),t=To(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Lo(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=No(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends zo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(qg){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=No(Lo(this.node.current,"focus",()=>this.onFocus()),Lo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends zo{mount(){this.unmount=No(Bo(this.node,!0),Bo(this.node,!1))}unmount(){}}}};function Yo(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function Ko(e,t,n){const i=e.getProps();return lo(i,t,void 0!==n?n:i.custom,function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.get()),t}(e),function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}(e))}let $o=vo,Xo=vo;const Jo=e=>1e3*e,es=e=>e/1e3,ts=!1,ns=e=>Array.isArray(e)&&"number"===typeof e[0];function is(e){return Boolean(!e||"string"===typeof e&&os[e]||ns(e)||Array.isArray(e)&&e.every(is))}const rs=e=>{let[t,n,i,r]=e;return"cubic-bezier(".concat(t,", ").concat(n,", ").concat(i,", ").concat(r,")")},os={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:rs([0,.65,.55,1]),circOut:rs([.55,0,1,.45]),backIn:rs([.31,.01,.66,-.59]),backOut:rs([.33,1.53,.69,.99])};function ss(e){if(e)return ns(e)?rs(e):Array.isArray(e)?e.map(ss):os[e]}const as=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ls(e,t,n,i){if(e===t&&n===i)return vo;const r=t=>function(e,t,n,i,r){let o,s,a=0;do{s=t+(n-t)/2,o=as(s,i,r)-e,o>0?n=s:t=s}while(Math.abs(o)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:as(r(e),t,i)}const cs=ls(.42,0,1,1),us=ls(0,0,.58,1),ds=ls(.42,0,.58,1),hs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ps=e=>t=>1-e(1-t),fs=e=>1-Math.sin(Math.acos(e)),ms=ps(fs),gs=hs(fs),vs=ls(.33,1.53,.69,.99),ys=ps(vs),_s=hs(ys),bs={linear:vo,easeIn:cs,easeInOut:ds,easeOut:us,circIn:fs,circInOut:gs,circOut:ms,backIn:ys,backInOut:_s,backOut:vs,anticipate:e=>(e*=2)<1?.5*ys(e):.5*(2-Math.pow(2,-10*(e-1)))},xs=e=>{if(Array.isArray(e)){Xo(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,i,r]=e;return ls(t,n,i,r)}return"string"===typeof e?(Xo(void 0!==bs[e],"Invalid easing type '".concat(e,"'")),bs[e]):e},ws=(e,t)=>n=>Boolean(Tr(n)&&Pr.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),ks=(e,t,n)=>i=>{if(!Tr(i))return i;const[r,o,s,a]=i.match(Lr);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Ss=Be(Be({},wr),{},{transform:e=>Math.round((e=>xr(0,255,e))(e))}),Cs={test:ws("rgb","red"),parse:ks("red","green","blue"),transform:e=>{let{red:t,green:n,blue:i,alpha:r=1}=e;return"rgba("+Ss.transform(t)+", "+Ss.transform(n)+", "+Ss.transform(i)+", "+Cr(kr.transform(r))+")"}};const Ls={test:ws("#"),parse:function(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:Cs.transform},Es={test:ws("hsl","hue"),parse:ks("hue","saturation","lightness"),transform:e=>{let{hue:t,saturation:n,lightness:i,alpha:r=1}=e;return"hsla("+Math.round(t)+", "+Or.transform(Cr(n))+", "+Or.transform(Cr(i))+", "+Cr(kr.transform(r))+")"}},Ps={test:e=>Cs.test(e)||Ls.test(e)||Es.test(e),parse:e=>Cs.test(e)?Cs.parse(e):Es.test(e)?Es.parse(e):Ls.parse(e),transform:e=>Tr(e)?e:e.hasOwnProperty("red")?Cs.transform(e):Es.transform(e)},Ts=(e,t,n)=>-n*e+n*t+e;function js(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const Ns=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},Os=[Ls,Cs,Es];function Ms(e){const t=(n=e,Os.find(e=>e.test(n)));var n;Xo(Boolean(t),"'".concat(e,"' is not an animatable color. Use the equivalent color code instead."));let i=t.parse(e);return t===Es&&(i=function(e){let{hue:t,saturation:n,lightness:i,alpha:r}=e;t/=360,n/=100,i/=100;let o=0,s=0,a=0;if(n){const e=i<.5?i*(1+n):i+n-i*n,r=2*i-e;o=js(r,e,t+1/3),s=js(r,e,t),a=js(r,e,t-1/3)}else o=s=a=i;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*a),alpha:r}}(i)),i}const As=(e,t)=>{const n=Ms(e),i=Ms(t),r=Be({},n);return e=>(r.red=Ns(n.red,i.red,e),r.green=Ns(n.green,i.green,e),r.blue=Ns(n.blue,i.blue,e),r.alpha=Ts(n.alpha,i.alpha,e),Cs.transform(r))};const Rs={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:vo},Is={regex:Er,countKey:"Colors",token:"${c}",parse:Ps.parse},zs={regex:Lr,countKey:"Numbers",token:"${n}",parse:wr.parse};function Bs(e,t){let{regex:n,countKey:i,token:r,parse:o}=t;const s=e.tokenised.match(n);s&&(e["num"+i]=s.length,e.tokenised=e.tokenised.replace(n,r),e.values.push(...s.map(o)))}function Ds(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Bs(n,Rs),Bs(n,Is),Bs(n,zs),n}function Fs(e){return Ds(e).values}function Us(e){const{values:t,numColors:n,numVars:i,tokenised:r}=Ds(e),o=t.length;return e=>{let t=r;for(let r=0;r<o;r++)t=r<i?t.replace(Rs.token,e[r]):r<i+n?t.replace(Is.token,Ps.transform(e[r])):t.replace(zs.token,Cr(e[r]));return t}}const qs=e=>"number"===typeof e?0:e;const Vs={test:function(e){var t,n;return isNaN(e)&&Tr(e)&&((null===(t=e.match(Lr))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Er))||void 0===n?void 0:n.length)||0)>0},parse:Fs,createTransformer:Us,getAnimatableNone:function(e){const t=Fs(e);return Us(e)(t.map(qs))}},Ws=(e,t)=>n=>"".concat(n>0?t:e);function Hs(e,t){return"number"===typeof e?n=>Ts(e,t,n):Ps.test(e)?As(e,t):e.startsWith("var(")?Ws(e,t):Qs(e,t)}const Zs=(e,t)=>{const n=[...e],i=n.length,r=e.map((e,n)=>Hs(e,t[n]));return e=>{for(let t=0;t<i;t++)n[t]=r[t](e);return n}},Gs=(e,t)=>{const n=Be(Be({},e),t),i={};for(const r in n)void 0!==e[r]&&void 0!==t[r]&&(i[r]=Hs(e[r],t[r]));return e=>{for(const t in i)n[t]=i[t](e);return n}},Qs=(e,t)=>{const n=Vs.createTransformer(t),i=Ds(e),r=Ds(t);return i.numVars===r.numVars&&i.numColors===r.numColors&&i.numNumbers>=r.numNumbers?No(Zs(i.values,r.values),n):($o(!0,"Complex values '".concat(e,"' and '").concat(t,"' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.")),Ws(e,t))},Ys=(e,t,n)=>{const i=t-e;return 0===i?1:(n-e)/i},Ks=(e,t)=>n=>Ts(e,t,n);function $s(e,t,n){const i=[],r=n||("number"===typeof(o=e[0])?Ks:"string"===typeof o?Ps.test(o)?As:Qs:Array.isArray(o)?Zs:"object"===typeof o?Gs:Ks);var o;const s=e.length-1;for(let a=0;a<s;a++){let n=r(e[a],e[a+1]);if(t){const e=Array.isArray(t)?t[a]||vo:t;n=No(e,n)}i.push(n)}return i}function Xs(e,t){let{clamp:n=!0,ease:i,mixer:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=e.length;if(Xo(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=$s(t,i,r),a=s.length,l=t=>{let n=0;if(a>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const i=Ys(e[n],e[n+1],t);return s[n](i)};return n?t=>l(xr(e[0],e[o-1],t)):l}function Js(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Ys(0,t,i);e.push(Ts(n,1,r))}}(t,e.length-1),t}function ea(e){let{duration:t=300,keyframes:n,times:i,ease:r="easeInOut"}=e;const o=(e=>Array.isArray(e)&&"number"!==typeof e[0])(r)?r.map(xs):xs(r),s={done:!1,value:n[0]},a=function(e,t){return e.map(e=>e*t)}(i&&i.length===n.length?i:Js(n),t),l=Xs(a,n,{ease:Array.isArray(o)?o:(c=n,u=o,c.map(()=>u||ds).splice(0,c.length-1))});var c,u;return{calculatedDuration:t,next:e=>(s.value=l(e),s.done=e>=t,s)}}function ta(e,t){return t?e*(1e3/t):0}function na(e,t,n){const i=Math.max(t-5,0);return ta(n-e(i),t-i)}const ia=.001;function ra(e){let t,n,{duration:i=800,bounce:r=.25,velocity:o=0,mass:s=1}=e;$o(i<=Jo(10),"Spring duration must be 10 seconds or less");let a=1-r;a=xr(.05,1,a),i=xr(.01,10,es(i)),a<1?(t=e=>{const t=e*a,n=t*i,r=t-o,s=sa(e,a),l=Math.exp(-n);return ia-r/s*l},n=e=>{const n=e*a*i,r=n*o+o,s=Math.pow(a,2)*Math.pow(e,2)*i,l=Math.exp(-n),c=sa(Math.pow(e,2),a);return(-t(e)+ia>0?-1:1)*((r-s)*l)/c}):(t=e=>Math.exp(-e*i)*((e-o)*i+1)-.001,n=e=>Math.exp(-e*i)*(i*i*(o-e)));const l=function(e,t,n){let i=n;for(let r=1;r<oa;r++)i-=e(i)/t(i);return i}(t,n,5/i);if(i=Jo(i),isNaN(l))return{stiffness:100,damping:10,duration:i};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:i}}}const oa=12;function sa(e,t){return e*Math.sqrt(1-t*t)}const aa=["keyframes","restDelta","restSpeed"],la=["duration","bounce"],ca=["stiffness","damping","mass"];function ua(e,t){return t.some(t=>void 0!==e[t])}function da(e){let{keyframes:t,restDelta:n,restSpeed:i}=e,r=Mi(e,aa);const o=t[0],s=t[t.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t=Be({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!ua(e,ca)&&ua(e,la)){const n=ra(e);t=Be(Be(Be({},t),n),{},{mass:1}),t.isResolvedFromDuration=!0}return t}(Be(Be({},r),{},{velocity:-es(r.velocity||0)})),f=h||0,m=c/(2*Math.sqrt(l*u)),g=s-o,v=es(Math.sqrt(l/u)),y=Math.abs(g)<5;let _;if(i||(i=y?.01:2),n||(n=y?.005:.5),m<1){const e=sa(v,m);_=t=>{const n=Math.exp(-m*v*t);return s-n*((f+m*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)_=e=>s-Math.exp(-v*e)*(g+(f+v*g)*e);else{const e=v*Math.sqrt(m*m-1);_=t=>{const n=Math.exp(-m*v*t),i=Math.min(e*t,300);return s-n*((f+m*v*g)*Math.sinh(i)+e*g*Math.cosh(i))/e}}return{calculatedDuration:p&&d||null,next:e=>{const t=_(e);if(p)a.done=e>=d;else{let r=f;0!==e&&(r=m<1?na(_,e,t):0);const o=Math.abs(r)<=i,l=Math.abs(s-t)<=n;a.done=o&&l}return a.value=a.done?s:t,a}}}function ha(e){let{keyframes:t,velocity:n=0,power:i=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}=e;const h=t[0],p={done:!1,value:h},f=e=>void 0===l?c:void 0===c||Math.abs(l-e)<Math.abs(c-e)?l:c;let m=i*n;const g=h+m,v=void 0===a?g:a(g);v!==g&&(m=v-h);const y=e=>-m*Math.exp(-e/r),_=e=>v+y(e),b=e=>{const t=y(e),n=_(e);p.done=Math.abs(t)<=u,p.value=p.done?v:n};let x,w;const k=e=>{var t;(t=p.value,void 0!==l&&t<l||void 0!==c&&t>c)&&(x=e,w=da({keyframes:[p.value,f(p.value)],velocity:na(_,e,p.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),k(e)),void 0!==x&&e>x?w.next(e-x):(!t&&b(e),p)}}}const pa=e=>{const t=t=>{let{timestamp:n}=t;return e(n)};return{start:()=>bo.update(t,!0),stop:()=>xo(t),now:()=>wo.isProcessing?wo.timestamp:performance.now()}};function fa(e){let t=0;let n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}const ma=["autoplay","delay","driver","keyframes","type","repeat","repeatDelay","repeatType","onPlay","onStop","onComplete","onUpdate"],ga={decay:ha,inertia:ha,tween:ea,keyframes:ea,spring:da};function va(e){let t,n,{autoplay:i=!0,delay:r=0,driver:o=pa,keyframes:s,type:a="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:u="loop",onPlay:d,onStop:h,onComplete:p,onUpdate:f}=e,m=Mi(e,ma),g=1,v=!1;const y=()=>{n=new Promise(e=>{t=e})};let _;y();const b=ga[a]||ea;let x;b!==ea&&"number"!==typeof s[0]&&(x=Xs([0,100],s,{clamp:!1}),s=[0,100]);const w=b(Be(Be({},m),{},{keyframes:s}));let k;"mirror"===u&&(k=b(Be(Be({},m),{},{keyframes:[...s].reverse(),velocity:-(m.velocity||0)})));let S="idle",C=null,L=null,E=null;null===w.calculatedDuration&&l&&(w.calculatedDuration=fa(w));const{calculatedDuration:P}=w;let T=1/0,j=1/0;null!==P&&(T=P+c,j=T*(l+1)-c);let N=0;const O=e=>{if(null===L)return;g>0&&(L=Math.min(L,e)),g<0&&(L=Math.min(e-j/g,L)),N=null!==C?C:Math.round(e-L)*g;const t=N-r*(g>=0?1:-1),n=g>=0?t<0:t>j;N=Math.max(t,0),"finished"===S&&null===C&&(N=j);let i=N,o=w;if(l){const e=Math.min(N,j)/T;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,l+1);Boolean(t%2)&&("reverse"===u?(n=1-n,c&&(n-=c/T)):"mirror"===u&&(o=k)),i=xr(0,1,n)*T}const a=n?{done:!1,value:s[0]}:o.next(i);x&&(a.value=x(a.value));let{done:d}=a;n||null===P||(d=g>=0?N>=j:N<=0);const h=null===C&&("finished"===S||"running"===S&&d);return f&&f(a.value),h&&R(),a},M=()=>{_&&_.stop(),_=void 0},A=()=>{S="idle",M(),t(),y(),L=E=null},R=()=>{S="finished",p&&p(),M(),t()},I=()=>{if(v)return;_||(_=o(O));const e=_.now();d&&d(),null!==C?L=e-C:L&&"finished"!==S||(L=e),"finished"===S&&y(),E=L,C=null,S="running",_.start()};i&&I();const z={then:(e,t)=>n.then(e,t),get time(){return es(N)},set time(e){e=Jo(e),N=e,null===C&&_&&0!==g?L=_.now()-e/g:C=e},get duration(){const e=null===w.calculatedDuration?fa(w):w.calculatedDuration;return es(e)},get speed(){return g},set speed(e){e!==g&&_&&(g=e,z.time=es(N))},get state(){return S},play:I,pause:()=>{S="paused",C=N},stop:()=>{v=!0,"idle"!==S&&(S="idle",h&&h(),A())},cancel:()=>{null!==E&&O(E),A()},complete:()=>{S="finished"},sample:e=>(L=0,O(e))};return z}const ya=["onUpdate","onComplete"],_a=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ba=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);function xa(e,t,n){let{onUpdate:i,onComplete:r}=n,o=Mi(n,ya);if(!(_a()&&ba.has(t)&&!o.repeatDelay&&"mirror"!==o.repeatType&&0!==o.damping&&"inertia"!==o.type))return!1;let s,a,l=!1,c=!1;const u=()=>{a=new Promise(e=>{s=e})};u();let{keyframes:d,duration:h=300,ease:p,times:f}=o;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!is(t.ease))(t,o)){const e=va(Be(Be({},o),{},{repeat:0,delay:0}));let t={done:!1,value:d[0]};const n=[];let i=0;for(;!t.done&&i<2e4;)t=e.sample(i),n.push(t.value),i+=10;f=void 0,d=n,h=i-10,p="linear"}const m=function(e,t,n){let{delay:i=0,duration:r,repeat:o=0,repeatType:s="loop",ease:a,times:l}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const c={[t]:n};l&&(c.offset=l);const u=ss(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(e.owner.current,t,d,Be(Be({},o),{},{duration:h,ease:p,times:f})),g=()=>{c=!1,m.cancel()},v=()=>{c=!0,bo.update(g),s(),u()};m.onfinish=()=>{c||(e.set(function(e,t){let{repeat:n,repeatType:i="loop"}=t;return e[n&&"loop"!==i&&n%2===1?0:e.length-1]}(d,o)),r&&r(),v())};return{then:(e,t)=>a.then(e,t),attachTimeline:e=>(m.timeline=e,m.onfinish=null,vo),get time(){return es(m.currentTime||0)},set time(e){m.currentTime=Jo(e)},get speed(){return m.playbackRate},set speed(e){m.playbackRate=e},get duration(){return es(h)},play:()=>{l||(m.play(),xo(g))},pause:()=>m.pause(),stop:()=>{if(l=!0,"idle"===m.playState)return;const{currentTime:t}=m;if(t){const n=va(Be(Be({},o),{},{autoplay:!1}));e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}v()},complete:()=>{c||m.finish()},cancel:v}}const wa={type:"spring",stiffness:500,damping:25,restSpeed:10},ka={type:"keyframes",duration:.8},Sa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ca=(e,t)=>{let{keyframes:n}=t;return n.length>2?ka:hr.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===n[1]?2*Math.sqrt(550):30,restSpeed:10}:wa:Sa},La=(e,t)=>"zIndex"!==e&&(!("number"!==typeof t&&!Array.isArray(t))||!("string"!==typeof t||!Vs.test(t)&&"0"!==t||t.startsWith("url("))),Ea=new Set(["brightness","contrast","saturate","opacity"]);function Pa(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[i]=n.match(Lr)||[];if(!i)return e;const r=n.replace(i,"");let o=Ea.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const Ta=/([a-z-]*)\(.*?\)/g,ja=Be(Be({},Vs),{},{getAnimatableNone:e=>{const t=e.match(Ta);return t?t.map(Pa).join(" "):e}}),Na=Be(Be({},Br),{},{color:Ps,backgroundColor:Ps,outlineColor:Ps,fill:Ps,stroke:Ps,borderColor:Ps,borderTopColor:Ps,borderRightColor:Ps,borderBottomColor:Ps,borderLeftColor:Ps,filter:ja,WebkitFilter:ja}),Oa=e=>Na[e];function Ma(e,t){let n=Oa(e);return n!==ja&&(n=Vs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Aa=e=>/^0[^.\s]+$/.test(e);function Ra(e){return"number"===typeof e?0===e:null!==e?"none"===e||"0"===e||Aa(e):void 0}const Ia=["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"];function za(e,t){return e[t]||e.default||e}const Ba=!1,Da=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return r=>{const o=za(i,e)||{},s=o.delay||i.delay||0;let{elapsed:a=0}=i;a-=Jo(s);const l=function(e,t,n,i){const r=La(t,n);let o;o=Array.isArray(n)?[...n]:[null,n];const s=void 0!==i.from?i.from:e.get();let a;const l=[];for(let c=0;c<o.length;c++)null===o[c]&&(o[c]=0===c?s:o[c-1]),Ra(o[c])&&l.push(c),"string"===typeof o[c]&&"none"!==o[c]&&"0"!==o[c]&&(a=o[c]);if(r&&l.length&&a)for(let c=0;c<l.length;c++)o[l[c]]=Ma(t,a);return o}(t,e,n,o),c=l[0],u=l[l.length-1],d=La(e,c),h=La(e,u);$o(d===h,"You are trying to animate ".concat(e,' from "').concat(c,'" to "').concat(u,'". ').concat(c," is not an animatable value - to enable this animation set ").concat(c," to a value animatable to ").concat(u," via the `style` property."));let p=Be(Be({keyframes:l,velocity:t.getVelocity(),ease:"easeOut"},o),{},{delay:-a,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{r(),o.onComplete&&o.onComplete()}});if(function(e){let{when:t,delay:n,delayChildren:i,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:a,repeatDelay:l,from:c,elapsed:u}=e,d=Mi(e,Ia);return!!Object.keys(d).length}(o)||(p=Be(Be({},p),Ca(e,p))),p.duration&&(p.duration=Jo(p.duration)),p.repeatDelay&&(p.repeatDelay=Jo(p.repeatDelay)),!d||!h||ts||!1===o.type||Ba)return function(e){let{keyframes:t,delay:n,onUpdate:i,onComplete:r}=e;const o=()=>(i&&i(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:vo,pause:vo,stop:vo,then:e=>(e(),Promise.resolve()),cancel:vo,complete:vo});return n?va({keyframes:[0,1],duration:0,delay:n,onComplete:o}):o()}(ts?Be(Be({},p),{},{delay:0}):p);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const n=xa(t,e,p);if(n)return n}return va(p)}};function Fa(e){return Boolean(fr(e)&&e.add)}const Ua=e=>/^\-?\d*\.?\d+$/.test(e);function qa(e,t){-1===e.indexOf(t)&&e.push(t)}function Va(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Wa{constructor(){this.subscriptions=[]}add(e){return qa(this.subscriptions,e),()=>Va(this.subscriptions,e)}notify(e,t,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let r=0;r<i;r++){const i=this.subscriptions[r];i&&i(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ha={current:void 0};class Za{constructor(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.prev=t.current,t.current=e;const{delta:i,timestamp:r}=wo;t.lastUpdated!==r&&(t.timeDelta=i,t.lastUpdated=r,bo.postRender(t.scheduleVelocityCheck)),t.prev!==t.current&&t.events.change&&t.events.change.notify(t.current),t.events.velocityChange&&t.events.velocityChange.notify(t.getVelocity()),n&&t.events.renderRequest&&t.events.renderRequest.notify(t.current)},this.scheduleVelocityCheck=()=>bo.postRender(this.velocityCheck),this.velocityCheck=e=>{let{timestamp:t}=e;t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(i=this.current,!isNaN(parseFloat(i))),this.owner=n.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Wa);const n=this.events[e].add(t);return"change"===e?()=>{n(),bo.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Ha.current&&Ha.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ta(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ga(e,t){return new Za(e,t)}const Qa=e=>t=>t.test(e),Ya=[wr,Mr,Or,Nr,Rr,Ar,{test:e=>"auto"===e,parse:e=>e}],Ka=e=>Ya.find(Qa(e)),$a=[...Ya,Ps,Vs],Xa=e=>$a.find(Qa(e)),Ja=["transitionEnd","transition"];function el(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ga(n))}function tl(e,t){const n=Ko(e,t);let i=n?e.makeTargetAnimatable(n,!1):{},{transitionEnd:r={},transition:o={}}=i,s=Mi(i,Ja);s=Be(Be({},s),r);for(const a in s){el(e,a,ho(s[a]))}}function nl(e,t){if(!t)return;return(t[e]||t.default||t).from}const il=["transition","transitionEnd"];function rl(e,t){let{protectedKeys:n,needsAnimating:i}=e;const r=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,r}function ol(e,t){const n=e.get();if(!Array.isArray(t))return n!==t;for(let i=0;i<t.length;i++)if(t[i]!==n)return!0}function sl(e,t){let{delay:n=0,transitionOverride:i,type:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.makeTargetAnimatable(t),{transition:s=e.getDefaultTransition(),transitionEnd:a}=o,l=Mi(o,il);const c=e.getValue("willChange");i&&(s=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const h in l){const t=e.getValue(h),i=l[h];if(!t||void 0===i||d&&rl(d,h))continue;const r=Be({delay:n,elapsed:0},za(s||{},h));if(window.HandoffAppearAnimations){const n=e.getProps()[Wi];if(n){const e=window.HandoffAppearAnimations(n,h,t,bo);null!==e&&(r.elapsed=e,r.isHandoff=!0)}}let o=!r.isHandoff&&!ol(t,i);if("spring"===r.type&&(t.getVelocity()||r.velocity)&&(o=!1),t.animation&&(o=!1),o)continue;t.start(Da(h,t,i,e.shouldReduceMotion&&hr.has(h)?{type:!1}:r));const a=t.animation;Fa(c)&&(c.add(h),a.then(()=>c.remove(h))),u.push(a)}return a&&Promise.all(u).then(()=>{a&&tl(e,a)}),u}function al(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Ko(e,t,n.custom);let{transition:r=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(sl(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=r;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5?arguments[5]:void 0;const s=[],a=(e.variantChildren.size-1)*i,l=1===r?function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)*i}:function(){return a-(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)*i};return Array.from(e.variantChildren).sort(ll).forEach((e,i)=>{e.notify("AnimationStart",t),s.push(al(e,t,Be(Be({},o),{},{delay:n+l(i)})).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(s)}(e,t,o+i,s,a,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[e,t]="beforeChildren"===a?[o,s]:[s,o];return e().then(()=>t())}return Promise.all([o(),s(n.delay)])}function ll(e,t){return e.sortNodePosition(t)}const cl=["transition","transitionEnd"],ul=[...Qi].reverse(),dl=Qi.length;function hl(e){return t=>Promise.all(t.map(t=>{let{animation:n,options:i}=t;return function(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.notify("AnimationStart",t),Array.isArray(t)){const r=t.map(t=>al(e,t,i));n=Promise.all(r)}else if("string"===typeof t)n=al(e,t,i);else{const r="function"===typeof t?Ko(e,t,i.custom):t;n=Promise.all(sl(e,r,i))}return n.then(()=>e.notify("AnimationComplete",t))}(e,n,i)}))}function pl(e){let t=hl(e);const n={animate:ml(!0),whileInView:ml(),whileHover:ml(),whileTap:ml(),whileDrag:ml(),whileFocus:ml(),exit:ml()};let i=!0;const r=(t,n)=>{const i=Ko(e,n);if(i){const{transition:e,transitionEnd:n}=i,r=Mi(i,cl);t=Be(Be(Be({},t),r),n)}return t};function o(o,s){const a=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let d={},h=1/0;for(let t=0;t<dl;t++){const p=ul[t],f=n[p],m=void 0!==a[p]?a[p]:l[p],g=Zi(m),v=p===s?f.isActive:null;!1===v&&(h=t);let y=m===l[p]&&m!==a[p]&&g;if(y&&i&&e.manuallyAnimateOnMount&&(y=!1),f.protectedKeys=Be({},d),!f.isActive&&null===v||!m&&!f.prevProp||Gi(m)||"boolean"===typeof m)continue;let _=fl(f.prevProp,m)||p===s&&f.isActive&&!y&&g||t>h&&g,b=!1;const x=Array.isArray(m)?m:[m];let w=x.reduce(r,{});!1===v&&(w={});const{prevResolvedValues:k={}}=f,S=Be(Be({},k),w),C=e=>{_=!0,u.has(e)&&(b=!0,u.delete(e)),f.needsAnimating[e]=!0};for(const e in S){const t=w[e],n=k[e];if(d.hasOwnProperty(e))continue;let i=!1;i=uo(t)&&uo(n)?!Yo(t,n):t!==n,i?void 0!==t?C(e):u.add(e):void 0!==t&&u.has(e)?C(e):f.protectedKeys[e]=!0}f.prevProp=m,f.prevResolvedValues=w,f.isActive&&(d=Be(Be({},d),w)),i&&e.blockInitialAnimation&&(_=!1),!_||y&&!b||c.push(...x.map(e=>({animation:e,options:Be({type:p},o)})))}if(u.size){const t={};u.forEach(n=>{const i=e.getBaseTarget(n);void 0!==i&&(t[n]=i)}),c.push({animation:t})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||e.manuallyAnimateOnMount||(p=!1),i=!1,p?t(c):Promise.resolve()}return{animateChanges:o,setActive:function(t,i,r){var s;if(n[t].isActive===i)return Promise.resolve();null===(s=e.variantChildren)||void 0===s||s.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,i)}),n[t].isActive=i;const a=o(r,t);for(const e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function fl(e,t){return"string"===typeof t?t!==e:!!Array.isArray(t)&&!Yo(t,e)}function ml(){return{isActive:arguments.length>0&&void 0!==arguments[0]&&arguments[0],protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let gl=0;const vl={animation:{Feature:class extends zo{constructor(e){super(e),e.animationState||(e.animationState=pl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Gi(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends zo{constructor(){super(...arguments),this.id=gl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e,{custom:null!==n&&void 0!==n?n:this.node.getProps().custom});t&&!e&&r.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},yl=(e,t)=>Math.abs(e-t);class _l{constructor(e,t){let{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:r=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=wl(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=yl(e.x,t.x),i=yl(e.y,t.y);return Math.sqrt(n**2+i**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:i}=e,{timestamp:r}=wo;this.history.push(Be(Be({},i),{},{timestamp:r}));const{onStart:o,onMove:s}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=bl(t,this.transformPagePoint),bo.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:r}=this.handlers;if(this.dragSnapToOrigin&&r&&r(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=wl("pointercancel"===e.type?this.lastMoveEventInfo:bl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),i&&i(e,o)},!Eo(e))return;this.dragSnapToOrigin=r,this.handlers=t,this.transformPagePoint=n,this.contextWindow=i||window;const o=bl(Po(e),this.transformPagePoint),{point:s}=o,{timestamp:a}=wo;this.history=[Be(Be({},s),{},{timestamp:a})];const{onSessionStart:l}=t;l&&l(e,wl(o,this.history)),this.removeListeners=No(To(this.contextWindow,"pointermove",this.handlePointerMove),To(this.contextWindow,"pointerup",this.handlePointerUp),To(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),xo(this.updatePoint)}}function bl(e,t){return t?{point:t(e.point)}:e}function xl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function wl(e,t){let{point:n}=e;return{point:n,delta:xl(n,Sl(t)),offset:xl(n,kl(t)),velocity:Cl(t,.1)}}function kl(e){return e[0]}function Sl(e){return e[e.length-1]}function Cl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=Sl(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Jo(t)));)n--;if(!i)return{x:0,y:0};const o=es(r.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ll(e){return e.max-e.min}function El(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return Math.abs(e-t)<=n}function Pl(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;e.origin=i,e.originPoint=Ts(t.min,t.max,e.origin),e.scale=Ll(n)/Ll(t),(El(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Ts(n.min,n.max,e.origin)-e.originPoint,(El(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Tl(e,t,n,i){Pl(e.x,t.x,n.x,i?i.originX:void 0),Pl(e.y,t.y,n.y,i?i.originY:void 0)}function jl(e,t,n){e.min=n.min+t.min,e.max=e.min+Ll(t)}function Nl(e,t,n){e.min=t.min-n.min,e.max=e.min+Ll(t)}function Ol(e,t,n){Nl(e.x,t.x,n.x),Nl(e.y,t.y,n.y)}function Ml(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Al(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}const Rl=.35;function Il(e,t,n){return{min:zl(e,t),max:zl(e,n)}}function zl(e,t){return"number"===typeof e?e:e[t]||0}const Bl=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Dl(e){return[e("x"),e("y")]}function Fl(e){let{top:t,left:n,right:i,bottom:r}=e;return{x:{min:n,max:i},y:{min:t,max:r}}}function Ul(e){return void 0===e||1===e}function ql(e){let{scale:t,scaleX:n,scaleY:i}=e;return!Ul(t)||!Ul(n)||!Ul(i)}function Vl(e){return ql(e)||Wl(e)||e.z||e.rotate||e.rotateX||e.rotateY}function Wl(e){return Hl(e.x)||Hl(e.y)}function Hl(e){return e&&"0%"!==e}function Zl(e,t,n){return n+t*(e-n)}function Gl(e,t,n,i,r){return void 0!==r&&(e=Zl(e,r,i)),Zl(e,n,i)+t}function Ql(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;e.min=Gl(e.min,t,n,i,r),e.max=Gl(e.max,t,n,i,r)}function Yl(e,t){let{x:n,y:i}=t;Ql(e.x,n.translate,n.scale,n.originPoint),Ql(e.y,i.translate,i.scale,i.originPoint)}function Kl(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function $l(e,t){e.min=e.min+t,e.max=e.max+t}function Xl(e,t,n){let[i,r,o]=n;const s=void 0!==t[o]?t[o]:.5,a=Ts(e.min,e.max,s);Ql(e,t[i],t[r],a,t.scale)}const Jl=["x","scaleX","originX"],ec=["y","scaleY","originY"];function tc(e,t){Xl(e.x,t,Jl),Xl(e.y,t,ec)}function nc(e,t){return Fl(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}const ic=e=>{let{current:t}=e;return t?t.ownerDocument.defaultView:null},rc=new WeakMap;class oc{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e){let{snapToCursor:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new _l(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Po(e,"page").point)},onStart:(e,t)=>{const{drag:n,dragPropagation:i,onDragStart:r}=this.getProps();if(n&&!i&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ro(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Dl(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Or.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[e];if(i){t=Ll(i)*(parseFloat(t)/100)}}}this.originPoint[e]=t}),r&&bo.update(()=>r(e,t),!1,!0);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:r,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(i&&null===this.currentDirection)return this.currentDirection=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&r&&r(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),o&&o(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Dl(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:ic(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=t;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&bo.update(()=>r(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:i}=this.getProps();if(!n||!sc(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,t,n){let{min:i,max:r}=t;return void 0!==i&&e<i?e=n?Ts(i,e,n.min):Math.max(e,i):void 0!==r&&e>r&&(e=n?Ts(r,e,n.max):Math.min(e,r)),e}(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,r=this.constraints;t&&Hi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(e,t){let{top:n,left:i,bottom:r,right:o}=t;return{x:Ml(e.x,i,o),y:Ml(e.y,n,r)}}(i.layoutBox,t),this.elastic=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rl;return!1===e?e=0:!0===e&&(e=Rl),{x:Il(e,"left","right"),y:Il(e,"top","bottom")}}(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Dl(e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(i.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Hi(e))return!1;const n=e.current;Xo(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=function(e,t,n){const i=nc(e,n),{scroll:r}=t;return r&&($l(i.x,r.offset.x),$l(i.y,r.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(e,t){return{x:Al(e.x,t.x),y:Al(e.y,t.y)}}(i.layout.layoutBox,r);if(t){const e=t(function(e){let{x:t,y:n}=e;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=Fl(e))}return o}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Dl(s=>{if(!sc(s,t,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,d=Be(Be({type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10},r),l);return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(Da(e,n,0,t))}stopAnimation(){Dl(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Dl(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),n=this.visualElement.getProps(),i=n[t];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Dl(t=>{const{drag:n}=this.getProps();if(!sc(t,n,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(t);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[t];r.set(e[t]-Ts(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Hi(t)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Dl(e=>{const t=this.getAxisMotionValue(e);if(t){const n=t.get();i[e]=function(e,t){let n=.5;const i=Ll(e),r=Ll(t);return r>i?n=Ys(t.min,t.max-i,e.min):i>r&&(n=Ys(e.min,e.max-r,t.min)),xr(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Dl(t=>{if(!sc(t,e,null))return;const n=this.getAxisMotionValue(t),{min:r,max:o}=this.constraints[t];n.set(Ts(r,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;rc.set(this.visualElement,this);const e=To(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();Hi(e)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),t();const r=Lo(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n}=e;this.isDragging&&n&&(Dl(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Rl,dragMomentum:s=!0}=e;return Be(Be({},e),{},{drag:t,dragDirectionLock:n,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:s})}}function sc(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}const ac=e=>(t,n)=>{e&&bo.update(()=>e(t,n))};const lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uc={correct:(e,t)=>{if(!t.target)return e;if("string"===typeof e){if(!Mr.test(e))return e;e=parseFloat(e)}const n=cc(e,t.target.x),i=cc(e,t.target.y);return"".concat(n,"% ").concat(i,"%")}},dc={correct:(e,t)=>{let{treeScale:n,projectionDelta:i}=t;const r=e,o=Vs.parse(e);if(o.length>5)return r;const s=Vs.createTransformer(e),a="number"!==typeof o[0]?1:0,l=i.x.scale*n.x,c=i.y.scale*n.y;o[0+a]/=l,o[1+a]/=c;const u=Ts(l,c,.5);return"number"===typeof o[2+a]&&(o[2+a]/=u),"number"===typeof o[3+a]&&(o[3+a]/=u),s(o)}};class hc extends i.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:i}=this.props,{projection:r}=e;var o;o=fc,Object.assign(ur,o),r&&(t.group&&t.group.add(r),n&&n.register&&i&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions(Be(Be({},r.options),{},{onExitComplete:()=>this.safeToRemove()}))),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:i,isPresent:r}=this.props,o=n.projection;return o?(o.isPresent=r,i||e.layoutDependency!==t||void 0===t?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||bo.postRender(()=>{const e=o.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function pc(e){const[t,n]=function(){const e=(0,i.useContext)(Di);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,i.useId)();return(0,i.useEffect)(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}(),r=(0,i.useContext)(nr);return i.createElement(hc,Be(Be({},e),{},{layoutGroup:r,switchLayoutGroup:(0,i.useContext)(ir),isPresent:t,safeToRemove:n}))}const fc={borderRadius:Be(Be({},uc),{},{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:uc,borderTopRightRadius:uc,borderBottomLeftRadius:uc,borderBottomRightRadius:uc,boxShadow:dc},mc=["TopLeft","TopRight","BottomLeft","BottomRight"],gc=mc.length,vc=e=>"string"===typeof e?parseFloat(e):e,yc=e=>"number"===typeof e||Mr.test(e);function _c(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const bc=wc(0,.5,ms),xc=wc(.5,.95,vo);function wc(e,t,n){return i=>i<e?0:i>t?1:n(Ys(e,t,i))}function kc(e,t){e.min=t.min,e.max=t.max}function Sc(e,t){kc(e.x,t.x),kc(e.y,t.y)}function Cc(e,t,n,i,r){return e=Zl(e-=t,1/n,i),void 0!==r&&(e=Zl(e,1/r,i)),e}function Lc(e,t,n,i,r){let[o,s,a]=n;!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,r=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e;Or.test(t)&&(t=parseFloat(t),t=Ts(s.min,s.max,t/100)-s.min);if("number"!==typeof t)return;let a=Ts(o.min,o.max,i);e===o&&(a-=t),e.min=Cc(e.min,t,n,a,r),e.max=Cc(e.max,t,n,a,r)}(e,t[o],t[s],t[a],t.scale,i,r)}const Ec=["x","scaleX","originX"],Pc=["y","scaleY","originY"];function Tc(e,t,n,i){Lc(e.x,t,Ec,n?n.x:void 0,i?i.x:void 0),Lc(e.y,t,Pc,n?n.y:void 0,i?i.y:void 0)}function jc(e){return 0===e.translate&&1===e.scale}function Nc(e){return jc(e.x)&&jc(e.y)}function Oc(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Mc(e){return Ll(e.x)/Ll(e.y)}class Ac{constructor(){this.members=[]}add(e){qa(this.members,e),e.scheduleRender()}remove(e){if(Va(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let i=t;i>=0;i--){const e=this.members[i];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Rc(e,t,n){let i="";const r=e.x.translate/t.x,o=e.y.translate/t.y;if((r||o)&&(i="translate3d(".concat(r,"px, ").concat(o,"px, 0) ")),1===t.x&&1===t.y||(i+="scale(".concat(1/t.x,", ").concat(1/t.y,") ")),n){const{rotate:e,rotateX:t,rotateY:r}=n;e&&(i+="rotate(".concat(e,"deg) ")),t&&(i+="rotateX(".concat(t,"deg) ")),r&&(i+="rotateY(".concat(r,"deg) "))}const s=e.x.scale*t.x,a=e.y.scale*t.y;return 1===s&&1===a||(i+="scale(".concat(s,", ").concat(a,")")),i||"none"}const Ic=(e,t)=>e.depth-t.depth;class zc{constructor(){this.children=[],this.isDirty=!1}add(e){qa(this.children,e),this.isDirty=!0}remove(e){Va(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ic),this.isDirty=!1,this.children.forEach(e)}}const Bc=["","X","Y","Z"],Dc={visibility:"hidden"};let Fc=0;const Uc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function qc(e){let{attachResizeListener:t,defaultParent:n,measureScroll:i,checkIsScrollRoot:r,resetTransform:o}=e;return class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===n||void 0===n?void 0:n();this.id=Fc++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Uc.totalNodes=Uc.resolvedTargetDeltas=Uc.recalculatedProjection=0,this.nodes.forEach(Hc),this.nodes.forEach(Xc),this.nodes.forEach(Jc),this.nodes.forEach(Zc),function(e){window.MotionDebug&&window.MotionDebug.record(e)}(Uc)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=t?t.root||t:this,this.path=t?[...t.path,t]:[],this.parent=t,this.depth=t?t.depth+1:0;for(let n=0;n<this.path.length;n++)this.path[n].shouldResetTransform=!0;this.root===this&&(this.nodes=new zc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Wa),this.eventHandlers.get(e).add(t)}notifyListeners(e){const t=this.eventHandlers.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];t&&t.notify(...i)}hasListeners(e){return this.eventHandlers.has(e)}mount(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.root.hasTreeAnimated;if(this.instance)return;var i;this.isSVG=(i=e)instanceof SVGElement&&"svg"!==i.tagName,this.instance=e;const{layoutId:r,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||r)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=performance.now(),i=r=>{let{timestamp:o}=r;const s=o-n;s>=t&&(xo(i),e(s-t))};return bo.read(i,!0),()=>xo(i)}(i,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEach($c))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||o)&&this.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n,hasRelativeTargetChanged:i,layout:r}=e;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||ou,{onLayoutAnimationStart:a,onLayoutAnimationComplete:l}=s.getProps(),c=!this.targetLayout||!Oc(this.targetLayout,r)||i,u=!n&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||n&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e=Be(Be({},za(o,"layout")),{},{onPlay:a,onComplete:l});(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else n||$c(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,xo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(eu),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let r=0;r<this.path.length;r++){const e=this.path[r];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Qc);this.isUpdating||this.nodes.forEach(Yc),this.isUpdating=!1,this.nodes.forEach(Kc),this.nodes.forEach(Vc),this.nodes.forEach(Wc),this.clearAllSnapshots();const e=performance.now();wo.delta=xr(0,1e3/60,e-wo.timestamp),wo.timestamp=e,wo.isProcessing=!0,ko.update.process(wo),ko.preRender.process(wo),ko.render.process(wo),wo.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(Gc),this.sharedNodes.forEach(tu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,bo.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){bo.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),(!this.options.alwaysMeasureLayout||!this.isLead())&&!this.isLayoutDirty)return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"measure",t=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:r(this.instance),offset:i(this.instance)})}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,t=this.projectionDelta&&!Nc(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,r=i!==this.prevTransformTemplateValue;e&&(t||Vl(this.latestValues)||r)&&(o(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.measurePageBox();let n=this.removeElementScroll(t);var i;return e&&(n=this.removeTransform(n)),lu((i=n).x),lu(i.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const t=e.measureViewportBox(),{scroll:n}=this.root;return n&&($l(t.x,n.offset.x),$l(t.y,n.offset.y)),t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Sc(t,e);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:r,options:o}=i;if(i!==this.root&&r&&o.layoutScroll){if(r.isRoot){Sc(t,e);const{scroll:n}=this.root;n&&($l(t.x,-n.offset.x),$l(t.y,-n.offset.y))}$l(t.x,r.offset.x),$l(t.y,r.offset.y)}}return t}applyTransform(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={x:{min:0,max:0},y:{min:0,max:0}};Sc(n,e);for(let i=0;i<this.path.length;i++){const e=this.path[i];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&tc(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),Vl(e.latestValues)&&tc(n,e.latestValues)}return Vl(this.latestValues)&&tc(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Sc(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!Vl(e.latestValues))continue;ql(e.latestValues)&&e.updateSnapshot();const i=Bl();Sc(i,e.measurePageBox()),Tc(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,i)}return Vl(this.latestValues)&&Tc(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options=Be(Be(Be({},this.options),e),{},{crossfade:void 0===e.crossfade||e.crossfade})}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wo.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(e||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:r,layoutId:o}=this.options;if(this.layout&&(r||o)){if(this.resolvedRelativeTargetAt=wo.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ol(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Sc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,jl(s.x,a.x,l.x),jl(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Sc(this.target,this.layout.layoutBox),Yl(this.target,this.targetDelta)):Sc(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ol(this.relativeTargetOrigin,this.target,e.target),Sc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Uc.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ql(this.parent.latestValues)&&!Wl(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===wo.timestamp&&(i=!1),i)return;const{layout:r,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!o)return;Sc(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=n.length;if(!r)return;let o,s;t.x=t.y=1;for(let a=0;a<r;a++){o=n[a],s=o.projectionDelta;const r=o.instance;r&&r.style&&"contents"===r.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&tc(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Yl(e,s)),i&&Vl(o.latestValues)&&tc(e,o.latestValues))}t.x=Kl(t.x),t.y=Kl(t.y)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox);const{target:l}=t;if(!l)return void(this.projectionTransform&&(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const c=this.projectionTransform;Tl(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=Rc(this.projectionDelta,this.treeScale),this.projectionTransform===c&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Uc.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.options.scheduleRender&&this.options.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.snapshot,i=n?n.latestValues:{},r=Be({},this.latestValues),o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(ru));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,p,f,m,g;nu(o.x,e.x,n),nu(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ol(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,f=this.relativeTargetOrigin,m=s,g=n,iu(p.x,f.x,m.x,g),iu(p.y,f.y,m.y,g),d&&(l=this.relativeTarget,h=d,l.x.min===h.x.min&&l.x.max===h.x.max&&l.y.min===h.y.min&&l.y.max===h.y.max)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Sc(d,this.relativeTarget)),a&&(this.animationValues=r,function(e,t,n,i,r,o){r?(e.opacity=Ts(0,void 0!==n.opacity?n.opacity:1,bc(i)),e.opacityExit=Ts(void 0!==t.opacity?t.opacity:1,0,xc(i))):o&&(e.opacity=Ts(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<gc;s++){const r="border".concat(mc[s],"Radius");let o=_c(t,r),a=_c(n,r);void 0===o&&void 0===a||(o||(o=0),a||(a=0),0===o||0===a||yc(o)===yc(a)?(e[r]=Math.max(Ts(vc(o),vc(a),i),0),(Or.test(a)||Or.test(o))&&(e[r]+="%")):e[r]=a)}(t.rotate||n.rotate)&&(e.rotate=Ts(t.rotate||0,n.rotate||0,i))}(r,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(xo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=bo.update(()=>{lc.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const i=fr(e)?e:Ga(e);return i.start(Da("",i,t,n)),i.animation}(0,1e3,Be(Be({},e),{},{onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:i,latestValues:r}=e;if(t&&n&&i){if(this!==e&&this.layout&&i&&cu(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Ll(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const i=Ll(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+i}Sc(t,n),tc(t,r),Tl(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ac);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote(){let{needsReset:e,transition:t,preserveFollowOpacity:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=this.getStack();i&&i.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(t=!0),!t)return;const i={};for(let r=0;r<Bc.length;r++){const t="rotate"+Bc[r];n[t]&&(i[t]=n[t],e.setStaticValue(t,0))}e.render();for(const r in i)e.setStaticValue(r,i[r]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Dc;const i={visibility:""},r=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=po(null===e||void 0===e?void 0:e.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=po(null===e||void 0===e?void 0:e.pointerEvents)||""),this.hasProjected&&!Vl(this.latestValues)&&(t.transform=r?r({},""):"none",this.hasProjected=!1),t}const s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=Rc(this.projectionDeltaWithTransform,this.treeScale,s),r&&(i.transform=r(s,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin="".concat(100*a.origin,"% ").concat(100*l.origin,"% 0"),o.animationValues?i.opacity=o===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:i.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const c in ur){if(void 0===s[c])continue;const{correct:e,applyTo:t}=ur[c],n="none"===i.transform?s[c]:e(s[c],o);if(t){const e=t.length;for(let r=0;r<e;r++)i[t[r]]=n}else i[c]=n}return this.options.layoutId&&(i.pointerEvents=o===this?po(null===e||void 0===e?void 0:e.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(Qc),this.root.sharedNodes.clear()}}}function Vc(e){e.updateLayout()}function Wc(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:i}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;"size"===r?Dl(e=>{const i=o?n.measuredBox[e]:n.layoutBox[e],r=Ll(i);i.min=t[e].min,i.max=i.min+r}):cu(r,n.layoutBox,t)&&Dl(i=>{const r=o?n.measuredBox[i]:n.layoutBox[i],s=Ll(t[i]);r.max=r.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Tl(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Tl(a,e.applyTransform(i,!0),n.measuredBox):Tl(a,t,n.layoutBox);const l=!Nc(s);let c=!1;if(!e.resumeFrom){const i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:r,layout:o}=i;if(r&&o){const s={x:{min:0,max:0},y:{min:0,max:0}};Ol(s,n.layoutBox,r.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ol(a,t,o.layoutBox),Oc(s,a)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Hc(e){Uc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Zc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Gc(e){e.clearSnapshot()}function Qc(e){e.clearMeasurements()}function Yc(e){e.isLayoutDirty=!1}function Kc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $c(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Xc(e){e.resolveTargetDelta()}function Jc(e){e.calcProjection()}function eu(e){e.resetRotation()}function tu(e){e.removeLeadSnapshot()}function nu(e,t,n){e.translate=Ts(t.translate,0,n),e.scale=Ts(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function iu(e,t,n,i){e.min=Ts(t.min,n.min,i),e.max=Ts(t.max,n.max,i)}function ru(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ou={duration:.45,ease:[.4,0,.1,1]},su=e=>"undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().includes(e),au=su("applewebkit/")&&!su("chrome/")?Math.round:vo;function lu(e){e.min=au(e.min),e.max=au(e.max)}function cu(e,t,n){return"position"===e||"preserve-aspect"===e&&!El(Mc(t),Mc(n),.2)}const uu=qc({attachResizeListener:(e,t)=>Lo(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),du={current:void 0},hu=qc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!du.current){const e=new uu({});e.mount(window),e.setOptions({layoutScroll:!0}),du.current=e}return du.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),pu={pan:{Feature:class extends zo{constructor(){super(...arguments),this.removePointerDownListener=vo}onPointerDown(e){this.session=new _l(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ic(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ac(e),onStart:ac(t),onMove:n,onEnd:(e,t)=>{delete this.session,i&&bo.update(()=>i(e,t))}}}mount(){this.removePointerDownListener=To(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends zo{constructor(e){super(e),this.removeGroupControls=vo,this.removeListeners=vo,this.controls=new oc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vo}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:hu,MeasureLayout:pc}};const fu=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function mu(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;Xo(n<=4,'Max CSS variable fallback depth detected in property "'.concat(e,'". This may indicate a circular fallback dependency.'));const[i,r]=function(e){const t=fu.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const e=o.trim();return Ua(e)?parseFloat(e):e}return _r(r)?mu(r,t,n+1):r}function gu(e,t,n){let i=Object.assign({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(t),t));const r=e.current;if(!(r instanceof Element))return{target:i,transitionEnd:n};n&&(n=Be({},n)),e.values.forEach(e=>{const t=e.get();if(!_r(t))return;const n=mu(t,r);n&&e.set(n)});for(const o in i){const e=i[o];if(!_r(e))continue;const t=mu(e,r);t&&(i[o]=t,n||(n={}),void 0===n[o]&&(n[o]=e))}return{target:i,transitionEnd:n}}const vu=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),yu=e=>vu.has(e),_u=e=>e===wr||e===Mr,bu=(e,t)=>parseFloat(e.split(", ")[t]),xu=(e,t)=>(n,i)=>{let{transform:r}=i;if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return bu(o[1],t);{const t=r.match(/^matrix\((.+)\)$/);return t?bu(t[1],e):0}},wu=new Set(["x","y","z"]),ku=dr.filter(e=>!wu.has(e));const Su={width:(e,t)=>{let{x:n}=e,{paddingLeft:i="0",paddingRight:r="0"}=t;return n.max-n.min-parseFloat(i)-parseFloat(r)},height:(e,t)=>{let{y:n}=e,{paddingTop:i="0",paddingBottom:r="0"}=t;return n.max-n.min-parseFloat(i)-parseFloat(r)},top:(e,t)=>{let{top:n}=t;return parseFloat(n)},left:(e,t)=>{let{left:n}=t;return parseFloat(n)},bottom:(e,t)=>{let{y:n}=e,{top:i}=t;return parseFloat(i)+(n.max-n.min)},right:(e,t)=>{let{x:n}=e,{left:i}=t;return parseFloat(i)+(n.max-n.min)},x:xu(4,13),y:xu(5,14)};Su.translateX=Su.x,Su.translateY=Su.y;const Cu=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=Be({},t),i=Be({},i);const r=Object.keys(t).filter(yu);let o=[],s=!1;const a=[];if(r.forEach(r=>{const l=e.getValue(r);if(!e.hasValue(r))return;let c=n[r],u=Ka(c);const d=t[r];let h;if(uo(d)){const e=d.length,t=null===d[0]?1:0;c=d[t],u=Ka(c);for(let n=t;n<e&&null!==d[n];n++)h?Xo(Ka(d[n])===h,"All keyframes must be of the same type"):(h=Ka(d[n]),Xo(h===u||_u(u)&&_u(h),"Keyframes must be of the same dimension as the current value"))}else h=Ka(d);if(u!==h)if(_u(u)&&_u(h)){const e=l.get();"string"===typeof e&&l.set(parseFloat(e)),"string"===typeof d?t[r]=parseFloat(d):Array.isArray(d)&&h===Mr&&(t[r]=d.map(parseFloat))}else(null===u||void 0===u?void 0:u.transform)&&(null===h||void 0===h?void 0:h.transform)&&(0===c||0===d)?0===c?l.set(h.transform(c)):t[r]=u.transform(d):(s||(o=function(e){const t=[];return ku.forEach(n=>{const i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),s=!0),a.push(r),i[r]=void 0!==i[r]?i[r]:t[r],l.jump(d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((e,t,n)=>{const i=t.measureViewportBox(),r=t.current,o=getComputedStyle(r),{display:s}=o,a={};"none"===s&&t.setStaticValue("display",e.display||"block"),n.forEach(e=>{a[e]=Su[e](i,o)}),t.render();const l=t.measureViewportBox();return n.forEach(n=>{const i=t.getValue(n);i&&i.jump(a[n]),e[n]=Su[n](l,o)}),e})(t,e,a);return o.length&&o.forEach(t=>{let[n,i]=t;e.getValue(n).set(i)}),e.render(),Fi&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:i}}return{target:t,transitionEnd:i}};function Lu(e,t,n,i){return(e=>Object.keys(e).some(yu))(t)?Cu(e,t,n,i):{target:t,transitionEnd:i}}const Eu={current:null},Pu={current:!1};const Tu=new WeakMap,ju=["willChange"],Nu=["children"],Ou=Object.keys(tr),Mu=Ou.length,Au=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ru=Yi.length;class Iu{constructor(e){let{parent:t,props:n,presenceContext:i,reducedMotionConfig:r,visualState:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>bo.render(this.render,!1,!0);const{latestValues:a,renderState:l}=o;this.latestValues=a,this.baseTarget=Be({},a),this.initialValues=n.initial?Be({},a):{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.isControllingVariants=Ki(n),this.isVariantNode=$i(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const c=this.scrapeMotionValuesFromProps(n,{}),{willChange:u}=c,d=Mi(c,ju);for(const h in d){const e=d[h];void 0!==a[h]&&fr(e)&&(e.set(a[h],!1),Fa(u)&&u.add(h))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,Tu.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),Pu.current||function(){if(Pu.current=!0,Fi)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Eu.current=e.matches;e.addListener(t),t()}else Eu.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Eu.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Tu.delete(this.current),this.projection&&this.projection.unmount(),xo(this.notifyUpdate),xo(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const n=hr.has(e),i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&bo.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),r()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures(e,t,n,i){let r,o,{children:s}=e,a=Mi(e,Nu);for(let l=0;l<Mu;l++){const e=Ou[l],{isEnabled:t,Feature:n,ProjectionNode:i,MeasureLayout:s}=tr[e];i&&(r=i),t(a)&&(!this.features[e]&&n&&(this.features[e]=new n(this)),s&&(o=s))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&r){this.projection=new r(this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:t,drag:n,dragConstraints:o,layoutScroll:s,layoutRoot:l}=a;this.projection.setOptions({layoutId:e,layout:t,alwaysMeasureLayout:Boolean(n)||o&&Hi(o),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"===typeof t?t:"both",initialPromotionConfig:i,layoutScroll:s,layoutRoot:l})}return o}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<Au.length;n++){const t=Au[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const i=e["on"+t];i&&(this.propEventSubscriptions[t]=this.on(t,i))}this.prevMotionValues=function(e,t,n){const{willChange:i}=t;for(const r in t){const o=t[r],s=n[r];if(fr(o))e.addValue(r,o),Fa(i)&&i.add(r);else if(fr(s))e.addValue(r,Ga(o,{owner:e})),Fa(i)&&i.remove(r);else if(s!==o)if(e.hasValue(r)){const t=e.getValue(r);!t.hasAnimated&&t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,Ga(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0])return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const e={};for(let t=0;t<Ru;t++){const n=Yi[t],i=this.props[n];(Zi(i)||!1===i)&&(e[n]=i)}return e}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Ga(t,{owner:this}),this.addValue(e,n)),n}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props,i="string"===typeof n||"object"===typeof n?null===(t=lo(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==i)return i;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||fr(r)?void 0!==this.initialValues[e]&&void 0===i?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new Wa),this.events[e].add(t)}notify(e){if(this.events[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.events[e].notify(...n)}}}const zu=["transition","transitionEnd"];class Bu extends Iu{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,t){let{vars:n,style:i}=t;delete n[e],delete i[e]}makeTargetAnimatableFromInstance(e,t,n){let{transition:i,transitionEnd:r}=e,o=Mi(e,zu),{transformValues:s}=t,a=function(e,t,n){const i={};for(const r in e){const e=nl(r,t);if(void 0!==e)i[r]=e;else{const e=n.getValue(r);e&&(i[r]=e.get())}}return i}(o,i||{},this);if(s&&(r&&(r=s(r)),o&&(o=s(o)),a&&(a=s(a))),n){!function(e,t,n){var i,r;const o=Object.keys(t).filter(t=>!e.hasValue(t)),s=o.length;if(s)for(let a=0;a<s;a++){const s=o[a],l=t[s];let c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(r=null!==(i=n[s])&&void 0!==i?i:e.readValue(s))&&void 0!==r?r:t[s]),void 0!==c&&null!==c&&("string"===typeof c&&(Ua(c)||Aa(c))?c=parseFloat(c):!Xa(c)&&Vs.test(l)&&(c=Ma(s,l)),e.addValue(s,Ga(c,{owner:e})),void 0===n[s]&&(n[s]=c),null!==c&&e.setBaseTarget(s,c))}}(this,o,a);const e=((e,t,n,i)=>{const r=gu(e,t,i);return Lu(e,t=r.target,n,i=r.transitionEnd)})(this,o,a,r);r=e.transitionEnd,o=e.target}return Be({transition:i,transitionEnd:r},o)}}class Du extends Bu{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(hr.has(t)){const e=Oa(t);return e&&e.default||0}{const i=(n=e,window.getComputedStyle(n)),r=(yr(t)?i.getPropertyValue(t):i[t])||0;return"string"===typeof r?r.trim():r}var n}measureInstanceViewportBox(e,t){let{transformPagePoint:n}=t;return nc(e,n)}build(e,t,n,i){Dr(e,t,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,t){return so(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;fr(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent="".concat(e))}))}renderInstance(e,t,n,i){io(e,t,n,i)}}class Fu extends Bu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(hr.has(t)){const e=Oa(t);return e&&e.default||0}return t=ro.has(t)?t:Vi(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return ao(e,t)}build(e,t,n,i){Xr(e,t,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,n,i){oo(e,t,0,i)}mount(e){this.isSVGTag=eo(e.tagName),super.mount(e)}}const Uu=(e,t)=>cr(e)?new Fu(t,{enableHardwareAcceleration:!1}):new Du(t,{enableHardwareAcceleration:!0}),qu={layout:{ProjectionNode:hu,MeasureLayout:pc}};const Vu=Be(Be(Be(Be({},vl),Qo),pu),qu),Wu=ar((e,t)=>function(e,t,n,i){let{forwardMotionProps:r=!1}=t;return Be(Be({},cr(e)?So:Co),{},{preloadedFeatures:n,useRender:no(r),createVisualElement:i,Component:e})}(e,t,Vu,Uu));const Hu=e=>{let{children:t,variant:n="parchment",className:i="",hover:r=!0,onClick:o,testId:s}=e;const a=r?"hover:shadow-lg transition-shadow duration-300 ".concat(o?"cursor-pointer":""):"transition-all duration-300";return(0,Ai.jsx)(Wu.div,{className:"".concat({parchment:"bg-gradient-to-br from-parchment-light to-parchment rounded-lg p-4 sm:p-6 shadow-md border border-gold-dark/30",dark:"bg-gradient-to-br from-forest to-forest-dark text-parchment-light rounded-lg p-4 sm:p-6 shadow-lg border border-gold-dark/40"}[n]," ").concat(a," ").concat(i),"data-testid":s,onClick:o,whileHover:r?{y:-4}:{},transition:{duration:.2},children:t})};Hu.displayName="Card";const Zu=e=>{let{children:t,variant:n="standard",className:i=""}=e;return(0,Ai.jsx)("span",{className:"inline-block px-3 py-1 rounded-full text-xs font-semibold ".concat({ready:"bg-ready/20 text-ready",inprogress:"bg-in-progress/20 text-in-progress",blocked:"bg-blocked/20 text-blocked",pending:"bg-pending/20 text-pending",critical:"bg-red-600/20 text-red-600",important:"bg-orange-600/20 text-orange-600",standard:"bg-indigo-600/20 text-indigo-600"}[n]," ").concat(i),children:t})};Zu.displayName="Badge";const Gu=e=>{let{children:t,variant:n="info",title:i,onClose:r,className:o=""}=e;return(0,Ai.jsx)(Wu.div,{className:"rounded-lg p-4 ".concat({info:"bg-blue-600/20 border border-blue-600 text-blue-600",warning:"bg-yellow-600/20 border border-yellow-600 text-yellow-600",error:"bg-red-600/20 border border-red-600 text-red-600",success:"bg-green-600/20 border border-green-600 text-green-600"}[n]," ").concat(o),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3},children:(0,Ai.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Ai.jsx)("span",{className:"text-xl flex-shrink-0",children:{info:"\u2139\ufe0f",warning:"\u26a0\ufe0f",error:"\u274c",success:"\u2705"}[n]}),(0,Ai.jsxs)("div",{className:"flex-1",children:[i&&(0,Ai.jsx)("h4",{className:"font-semibold mb-1",children:i}),(0,Ai.jsx)("div",{className:"text-sm",children:t})]}),r&&(0,Ai.jsx)("button",{onClick:r,className:"flex-shrink-0 text-lg hover:opacity-70 transition-opacity",children:"\u2715"})]})})};function Qu(){const e=(0,i.useRef)(!1);return Ui(()=>(e.current=!0,()=>{e.current=!1}),[]),e}Gu.displayName="Alert";class Yu extends i.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ku(e){let{children:t,isPresent:n}=e;const r=(0,i.useId)(),o=(0,i.useRef)(null),s=(0,i.useRef)({width:0,height:0,top:0,left:0});return(0,i.useInsertionEffect)(()=>{const{width:e,height:t,top:i,left:a}=s.current;if(n||!o.current||!e||!t)return;o.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule('\n [data-motion-pop-id="'.concat(r,'"] {\n position: absolute !important;\n width: ').concat(e,"px !important;\n height: ").concat(t,"px !important;\n top: ").concat(i,"px !important;\n left: ").concat(a,"px !important;\n }\n ")),()=>{document.head.removeChild(l)}},[n]),i.createElement(Yu,{isPresent:n,childRef:o,sizeRef:s},i.cloneElement(t,{ref:o}))}const $u=e=>{let{children:t,initial:n,isPresent:r,onExitComplete:o,custom:s,presenceAffectsLayout:a,mode:l}=e;const c=co(Xu),u=(0,i.useId)(),d=(0,i.useMemo)(()=>({id:u,initial:n,isPresent:r,custom:s,onExitComplete:e=>{c.set(e,!0);for(const t of c.values())if(!t)return;o&&o()},register:e=>(c.set(e,!1),()=>c.delete(e))}),a?void 0:[r]);return(0,i.useMemo)(()=>{c.forEach((e,t)=>c.set(t,!1))},[r]),i.useEffect(()=>{!r&&!c.size&&o&&o()},[r]),"popLayout"===l&&(t=i.createElement(Ku,{isPresent:r},t)),i.createElement(Di.Provider,{value:d},t)};function Xu(){return new Map}const Ju=e=>e.key||"";const ed=e=>{let{children:t,custom:n,initial:r=!0,onExitComplete:o,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"}=e;Xo(!s,"Replace exitBeforeEnter with mode='wait'");const c=(0,i.useContext)(nr).forceRender||function(){const e=Qu(),[t,n]=(0,i.useState)(0),r=(0,i.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,i.useCallback)(()=>bo.postRender(r),[r]),t]}()[0],u=Qu(),d=function(e){const t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}(t);let h=d;const p=(0,i.useRef)(new Map).current,f=(0,i.useRef)(h),m=(0,i.useRef)(new Map).current,g=(0,i.useRef)(!0);var v;if(Ui(()=>{g.current=!1,function(e,t){e.forEach(e=>{const n=Ju(e);t.set(n,e)})}(d,m),f.current=h}),v=()=>{g.current=!0,m.clear(),p.clear()},(0,i.useEffect)(()=>()=>v(),[]),g.current)return i.createElement(i.Fragment,null,h.map(e=>i.createElement($u,{key:Ju(e),isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:a,mode:l},e)));h=[...h];const y=f.current.map(Ju),_=d.map(Ju),b=y.length;for(let i=0;i<b;i++){const e=y[i];-1!==_.indexOf(e)||p.has(e)||p.set(e,void 0)}return"wait"===l&&p.size&&(h=[]),p.forEach((e,t)=>{if(-1!==_.indexOf(t))return;const r=m.get(t);if(!r)return;const s=y.indexOf(t);let g=e;if(!g){const e=()=>{p.delete(t);const e=Array.from(m.keys()).filter(e=>!_.includes(e));if(e.forEach(e=>m.delete(e)),f.current=d.filter(n=>{const i=Ju(n);return i===t||e.includes(i)}),!p.size){if(!1===u.current)return;c(),o&&o()}};g=i.createElement($u,{key:Ju(r),isPresent:!1,onExitComplete:e,custom:n,presenceAffectsLayout:a,mode:l},r),p.set(t,g)}h.splice(s,0,g)}),h=h.map(e=>{const t=e.key;return p.has(t)?e:i.createElement($u,{key:Ju(e),isPresent:!0,presenceAffectsLayout:a,mode:l},e)}),i.createElement(i.Fragment,null,p.size?h:h.map(e=>(0,i.cloneElement)(e)))},td=e=>{let{isOpen:t,onClose:n,title:i,children:r,size:o="md",footer:s,className:a=""}=e;return(0,Ai.jsx)(ed,{children:t&&(0,Ai.jsxs)(Ai.Fragment,{children:[(0,Ai.jsx)(Wu.div,{className:"fixed inset-0 bg-background-primary/50 backdrop-blur-sm z-40",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,transition:{duration:.2}}),(0,Ai.jsx)("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-4",children:(0,Ai.jsxs)(Wu.div,{role:"dialog","aria-modal":"true","aria-label":i,className:"bg-background-secondary rounded-lg shadow-xl border border-gold-dark/30 ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",full:"max-w-4xl"}[o]," ").concat(a),initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.3},children:[(0,Ai.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gold-dark/20",children:[(0,Ai.jsx)("h2",{className:"text-2xl font-epic text-parchment-light",children:i}),(0,Ai.jsx)("button",{onClick:n,className:"text-text-secondary hover:text-parchment-light transition-colors text-2xl",children:"\u2715"})]}),(0,Ai.jsx)("div",{className:"p-6 text-text-primary max-h-[80vh] overflow-y-auto",children:r}),s&&(0,Ai.jsx)("div",{className:"p-6 border-t border-gold-dark/20",children:s})]})})]})})};td.displayName="Modal";const nd={sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base",xl:"w-16 h-16 text-lg"},id=e=>{let{initials:t,emoji:n,name:i,size:r="md",className:o=""}=e;const s=n||(null===t||void 0===t?void 0:t.substring(0,2).toUpperCase())||"?";return(0,Ai.jsx)("div",{className:"".concat(nd[r]," rounded-full bg-gradient-to-br from-gold to-gold-light text-text-primary font-semibold flex items-center justify-center shadow-md border-2 border-parchment-light ").concat(o),title:i,children:s})};id.displayName="Avatar";const rd=["label","error","hint","className"],od=["label","error","hint","className","rows"],sd=["label","error","hint","options","className"],ad=i.forwardRef((e,t)=>{let{label:n,error:i,hint:r,className:o=""}=e,s=Mi(e,rd);const a=i?"border-red-600 focus:border-red-600 focus:ring-red-600/20":"";return(0,Ai.jsxs)("div",{className:"w-full",children:[n&&(0,Ai.jsx)("label",{htmlFor:s.id,className:"block text-sm font-semibold text-forest-dark mb-2",children:n}),(0,Ai.jsx)("input",Be({ref:t,className:"".concat("w-full px-4 py-2 bg-background-tertiary border border-gold-dark/50 rounded-lg text-text-primary focus:outline-none focus:border-gold focus:ring-2 focus:ring-gold/20 transition-all duration-300 placeholder-text-secondary"," ").concat(a," ").concat(o)},s)),i&&(0,Ai.jsx)("p",{className:"text-red-600 text-xs mt-1",children:i}),r&&(0,Ai.jsx)("p",{className:"text-text-secondary text-xs mt-1",children:r})]})});ad.displayName="Input";i.forwardRef((e,t)=>{let{label:n,error:i,hint:r,className:o="",rows:s=4}=e,a=Mi(e,od);const l=i?"border-red-600 focus:border-red-600 focus:ring-red-600/20":"";return(0,Ai.jsxs)("div",{className:"w-full",children:[n&&(0,Ai.jsx)("label",{className:"block text-sm font-semibold text-forest-dark mb-2",children:n}),(0,Ai.jsx)("textarea",Be({ref:t,rows:s,className:"".concat("w-full px-4 py-2 bg-background-tertiary border border-gold-dark/50 rounded-lg text-text-primary focus:outline-none focus:border-gold focus:ring-2 focus:ring-gold/20 transition-all duration-300 placeholder-text-secondary resize-vertical"," ").concat(l," ").concat(o)},a)),i&&(0,Ai.jsx)("p",{className:"text-red-600 text-xs mt-1",children:i}),r&&(0,Ai.jsx)("p",{className:"text-text-secondary text-xs mt-1",children:r})]})}).displayName="Textarea";i.forwardRef((e,t)=>{let{label:n,error:i,hint:r,options:o,className:s=""}=e,a=Mi(e,sd);const l=i?"border-red-600 focus:border-red-600 focus:ring-red-600/20":"";return(0,Ai.jsxs)("div",{className:"w-full",children:[n&&(0,Ai.jsx)("label",{className:"block text-sm font-semibold text-forest-dark mb-2",children:n}),(0,Ai.jsxs)("div",{className:"relative",children:[(0,Ai.jsxs)("select",Be(Be({ref:t,className:"".concat("w-full px-4 py-2 bg-background-tertiary border border-gold-dark/50 rounded-lg text-text-primary focus:outline-none focus:border-gold focus:ring-2 focus:ring-gold/20 transition-all duration-300 appearance-none cursor-pointer"," ").concat(l," ").concat(s)},a),{},{children:[(0,Ai.jsx)("option",{value:"",children:"Select an option..."}),o.map(e=>(0,Ai.jsx)("option",{value:e.value,children:e.label},e.value))]})),(0,Ai.jsx)("span",{className:"absolute right-3 top-3 text-parchment-light pointer-events-none",children:"\u25bc"})]}),i&&(0,Ai.jsx)("p",{className:"text-red-600 text-xs mt-1",children:i}),r&&(0,Ai.jsx)("p",{className:"text-text-secondary text-xs mt-1",children:r})]})}).displayName="Select";const ld=e=>{let{onLogin:t}=e;const[n,r]=(0,i.useState)("login"),[o,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(""),[c,u]=(0,i.useState)(""),[d,h]=(0,i.useState)(!1),[p,f]=(0,i.useState)(!0),[m,g]=(0,i.useState)(""),[v,y]=(0,i.useState)(null),[_,b]=(0,i.useState)(!1);i.useEffect(()=>{ci.getSutStatus().then(e=>y(e)).catch(()=>y(null))},[]);return(0,Ai.jsx)("div",{className:"w-full max-w-md",children:(0,Ai.jsxs)("div",{className:"card-parchment shadow-epic border border-gold-dark/30",children:[(0,Ai.jsx)("h1",{className:"text-3xl md:text-4xl text-center text-text-primary mb-2",children:"Enter the Fellowship"}),(0,Ai.jsx)("p",{className:"text-center text-pending mb-6 italic",children:"One does not simply walk into Middle-earth without credentials."}),(0,Ai.jsxs)("div",{className:"mb-5 flex justify-center gap-2",children:[(0,Ai.jsx)(Ii,{type:"button",variant:"login"===n?"epic":"secondary",onClick:()=>r("login"),className:"min-w-[120px]",children:"Login"}),(0,Ai.jsx)(Ii,{type:"button",variant:"signup"===n?"epic":"secondary",onClick:()=>r("signup"),className:"min-w-[120px]",children:"Sign up"})]}),m&&(0,Ai.jsx)(Gu,{variant:"error",title:"The Gate Remains Closed",className:"mb-4",children:m}),(0,Ai.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),g(""),b(!0);try{console.log("Login: Starting login attempt for mode:",n);const e="signup"===n?await ci.signup({username:o,password:a,email:c||void 0}):await ci.login({username:o,password:a});console.log("Login: API response received:",e),"signup"===n?Oi.trackSignup(o):Oi.trackLogin(o),t(e.user),console.log("Login: onLogin callback completed, navigating to dashboard");const i=window.location.pathname.includes("/login")?window.location.origin:window.location.href;console.log("Login: Setting window.location to /dashboard"),window.location.href=i+"/dashboard"}catch(s){var i,r;console.error("Login: Error during login/signup:",s),b(!1);const e=null===(i=s.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.error;g("signup"===n&&"Username already exists"===e?"Username already exists. Please choose a different username.":e||("signup"===n?"Signup failed. Please try again.":"Invalid credentials. Please try again."))}},className:"space-y-4",noValidate:!0,children:[(0,Ai.jsx)(ad,{id:"username",label:"Username",value:o,onChange:e=>s(e.target.value),required:!0,placeholder:"e.g., frodo_baggins",autoComplete:"username"}),"signup"===n&&(0,Ai.jsx)(ad,{id:"email",label:"Email (optional)",value:c,onChange:e=>u(e.target.value),placeholder:"traveler@example.com",autoComplete:"email"}),(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)(ad,{id:"password",label:"Password",type:d?"text":"password",value:a,onChange:e=>l(e.target.value),required:!0,placeholder:"Enter your password",autoComplete:"current-password"}),"signup"===n&&(0,Ai.jsx)("p",{className:"mt-2 text-xs text-text-secondary",children:"Password requirements: minimum 8 characters and at least 1 number."}),(0,Ai.jsx)("button",{type:"button",className:"mt-2 text-sm text-forest hover:text-forest-light",onClick:()=>h(e=>!e),children:d?"Hide password":"Show password"})]}),(0,Ai.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-primary",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:p,onChange:e=>f(e.target.checked),className:"h-4 w-4 accent-gold"}),"Keep me in the Fellowship on this device"]}),(0,Ai.jsx)(Ii,{type:"submit",variant:"epic",className:"w-full",isLoading:_,children:_?"Opening the Gates...":"signup"===n?"Create account":"Enter Middle-earth"})]}),(0,Ai.jsxs)("div",{className:"mt-6 pt-4 border-t border-gold-dark/30 text-sm text-text-primary space-y-2",children:[(0,Ai.jsxs)("p",{children:["Default password: ",(0,Ai.jsx)("strong",{children:"fellowship123"})]}),(0,Ai.jsx)("p",{className:"mt-1 text-text-secondary",children:"Try: frodo_baggins, samwise_gamgee, aragorn, legolas, gimli, gandalf"}),(0,Ai.jsxs)("p",{className:"text-xs text-text-secondary",children:["Last SUT restart (instance): ",(0,Ai.jsx)("strong",{children:(e=>{if(!e)return"Unavailable";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()})(null===v||void 0===v?void 0:v.instance_boot_time_utc)})]})]})]})})},cd={welcomes:{frodo:["Well met, bearer of knowledge! The roads of our journey await.","Hail, friend! I feel a change in the air. A new quest perhaps?","Welcome back to Middle-earth! The Fellowship needs you."],sam:["Bless you, master! The breakfast's nice and warm, but there's work to be done.","There you are! I've been keeping the fire going.","Welcome, friend! Ready to face whatever comes next?"]},questSuggestions:{journey:["Frodo: Every journey begins with a single step. This quest shall test your resolve.","Sam: Come on then! The sooner we start, the sooner we'll see it done.","Gandalf: This quest requires both courage and wisdom. Choose well."],battle:["Frodo: Steel yourself! This battle will not be easy.","Sam: Right then! Let's get this done and be home by supper.","Gandalf: The time for action is upon you. Stand firm!"],fellowship:["Frodo: Together, we are stronger. This quest binds us as one fellowship.","Sam: We should do this as a team. No one should face this alone.","Gandalf: The strength of the Fellowship is in unity. Remember this."],ring:["Frodo: This task weighs heavy upon my heart... but it must be done.","Sam: I won't let you do this alone, master.","Gandalf: The burden of power tests all who bear it. Proceed with caution."]},darkMagicWarnings:["Frodo: I sense darkness gathering... the Shadow spreads. Be vigilant!","Sam: Something wicked this way comes! We should be careful-like.","Gandalf: The Enemy stirs. Dark magic corrupts all it touches. Tread carefully!"],completionCelebrations:{one:["Frodo: Your first quest complete! The mountains of glory await you, friend.","Sam: Well done! One down, and many more to go!"],five:["Frodo: Five quests! You grow in strength and wisdom.","Sam: That's fine work! You're becoming a true hero."],ten:["Frodo: Ten quests on your shoulders! You rival the mightiest of warriors.","Sam: By the roots of Yggdrasil, you've earned your rest!"],milestone:["Gandalf: Behold! A champion emerges from the shadows!","Frodo: You have done what many thought impossible. Bravo!"]},progressRemarks:["The road is long, but you walk it well.","Each quest brings you closer to legend.","The Fellowship believes in you.","Your deeds echo through Middle-earth.","Even the smallest person can change the course of the future."],encouragements:["Sam: I know what we must do. We must go there. But we can't do it on foot.","Frodo: This is just a taste of the doom that awaits those who give in to despair.","Gandalf: All we have to decide is what to do with the time that is given to us.","All we have to decide is what to do with the time that is given to us.","There and back again - a quest by any name is still perilous."],loreQuotes:['"In a hole in the ground there lived a hobbit." - The beginning of legends.','"All we have to decide is what to do with the time that is given us." - Gandalf','"Even the smallest person can change the course of the future." - Galadriel','"The board is set, the pieces are moving." - The Wizard','"I wish it need not have happened in my time," said Frodo. "So do I," said Gandalf, "and so do all who live to see such times: but that is not for them to decide. All we have to decide is what to do with the time that is given us."']};class ud{static getWelcomeMessage(e){const t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]||Math.random()>.5?"frodo":"sam",n=cd.welcomes[t];return{character:t,message:n[Math.floor(Math.random()*n.length)].replace(/\b[a-z]/,e=>e.toUpperCase()),emoji:"frodo"===t?"\ud83e\uddd9\u200d\u2642\ufe0f":"\ud83d\udc68\u200d\ud83c\udf3e",mood:"hopeful"}}static getQuestAdvice(e){const t=e.toLowerCase().replace(/\s+/g,"")||"journey",n=cd.questSuggestions[t]||cd.questSuggestions.journey,i=n[Math.floor(Math.random()*n.length)],[r]=i.split(":"),o=i.split(": ")[1];return{character:r.toLowerCase(),message:o||i,mood:"determined"}}static getDarkMagicWarning(){const e=cd.darkMagicWarnings[Math.floor(Math.random()*cd.darkMagicWarnings.length)],[t]=e.split(":"),n=e.split(": ")[1];return{character:t.toLowerCase(),message:n||e,emoji:"\ud83d\udc41\ufe0f",mood:"worried"}}static getCelebration(e){let t="one";e>=50?t="milestone":e>=10?t="ten":e>=5&&(t="five");const n=cd.completionCelebrations[t],i=n[Math.floor(Math.random()*n.length)],[r]=i.split(":"),o=i.split(": ")[1];return{character:r.toLowerCase(),message:o||i,emoji:"\ud83c\udf89",mood:"celebratory"}}static getEncouragement(){return{character:"frodo",message:cd.encouragements[Math.floor(Math.random()*cd.encouragements.length)],mood:"hopeful"}}static getLoreQuote(){return{character:"gandalf",message:cd.loreQuotes[Math.floor(Math.random()*cd.loreQuotes.length)],emoji:"\ud83d\udcd6",mood:"determined"}}static getProgressRemark(e,t,n){const i=e/t,r=i>.5?"gandalf":Math.random()>.5?"frodo":"sam";let o=cd.progressRemarks[Math.floor(Math.random()*cd.progressRemarks.length)];return o=i<.2?"The journey is long, but you've taken the first steps: ".concat(e,"/").concat(t," quests complete."):i<.5?"Good progress! ".concat(e,"/").concat(t," quests done. The end is in sight."):i<.9?"Remarkable work! You're nearly there: ".concat(e,"/").concat(t," quests complete."):"Champion! You've conquered ".concat(e,"/").concat(t," quests! Only legend awaits."),{character:r,message:o,mood:i>.7?"celebratory":"hopeful"}}static getMood(e,t){return e>5?"worried":t>.8?"celebratory":t<.1?"weary":"hopeful"}}const dd=e=>{let{onLogin:t}=e;const[n,r]=(0,i.useState)(null);(0,i.useEffect)(()=>{const e=ud.getWelcomeMessage({id:0,username:"traveler",email:"traveler@middle-earth.local",role:"guest"},!0);r(e)},[]);const o="sam"===(null===n||void 0===n?void 0:n.character)?"\ud83d\udc68\u200d\ud83c\udf3e":"gandalf"===(null===n||void 0===n?void 0:n.character)?"\ud83e\uddd9\u200d\u2642\ufe0f":"\ud83e\udddd";return(0,Ai.jsxs)("div",{className:"relative min-h-screen overflow-hidden bg-background-primary flex flex-col items-center justify-center px-4 py-10",children:[(0,Ai.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-forest/20 via-background-primary to-gold/20"}),(0,Ai.jsxs)("div",{className:"absolute inset-0 opacity-20",children:[(0,Ai.jsx)("div",{className:"absolute top-10 left-10 h-48 w-48 rounded-full bg-gold/20 blur-3xl animate-pulse"}),(0,Ai.jsx)("div",{className:"absolute bottom-10 right-10 h-56 w-56 rounded-full bg-dark-magic/20 blur-3xl animate-pulse"})]}),(0,Ai.jsxs)("div",{className:"relative z-10 text-center mb-12",children:[(0,Ai.jsx)("h1",{className:"text-4xl md:text-5xl mb-4",children:"The Fellowship Quest Tracker"}),(0,Ai.jsx)("p",{className:"text-lg font-medium mb-6",children:"Track quests, bargain for treasures, play mini-games, and chat with Fellowship companions."})]}),(0,Ai.jsx)("div",{className:"relative z-10 w-full max-w-md",children:(0,Ai.jsx)(ld,{onLogin:t})}),n&&(0,Ai.jsxs)("div",{className:"relative z-10 mt-12 max-w-md text-center",children:[(0,Ai.jsxs)("div",{className:"flex items-center justify-center gap-2 mb-2",children:[(0,Ai.jsx)("span",{className:"text-2xl",children:o}),(0,Ai.jsx)("p",{className:"text-xs uppercase tracking-wider text-parchment/70",children:n.character})]}),(0,Ai.jsxs)("p",{className:"text-sm text-parchment/60 italic",children:['"',n.message,'"']})]})]})},hd=e=>{let t;const n=new Set,i=(e,i)=>{const r="function"===typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=i?i:"object"!==typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,o={setState:i,getState:r,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(i,r,o);return o},pd=e=>e?hd(e):hd;var fd=n(443);const{useDebugValue:md}=i,{useSyncExternalStoreWithSelector:gd}=fd;let vd=!1;const yd=e=>e;const _d=e=>{"function"!==typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"===typeof e?pd(e):e,n=(e,n)=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yd,n=arguments.length>2?arguments[2]:void 0;n&&!vd&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),vd=!0);const i=gd(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return md(i),i}(t,e,n);return Object.assign(n,t),n},bd=e=>e?_d(e):_d;const xd=bd((e,t)=>({activeCharacter:"frodo",currentDialogue:null,dialogueHistory:[],characterMood:"hopeful",isDarkMagicActive:!1,questCompletionCount:0,chatMessages:[],suggestedAction:null,suggestedQuest:null,isChatLoading:!1,setActiveCharacter:t=>e({activeCharacter:t}),setCurrentDialogue:n=>{n&&t().addDialogueToHistory(n),e({currentDialogue:n})},addDialogueToHistory:t=>e(e=>({dialogueHistory:[...e.dialogueHistory.slice(-9),t]})),clearDialogueHistory:()=>e({dialogueHistory:[],currentDialogue:null}),setCharacterMood:t=>e({characterMood:t}),setDarkMagicActive:t=>e({isDarkMagicActive:t}),setQuestCompletionCount:t=>e({questCompletionCount:t}),setChatMessages:t=>e({chatMessages:t}),appendChatMessage:t=>e(e=>({chatMessages:[...e.chatMessages,t]})),setSuggestedAction:t=>e({suggestedAction:t}),setSuggestedQuest:t=>e({suggestedQuest:t}),setChatLoading:t=>e({isChatLoading:t}),getCharacterAvatar:()=>({frodo:"\ud83e\udddd",sam:"\ud83d\udc68\u200d\ud83c\udf3e",gandalf:"\ud83e\uddd9\u200d\u2642\ufe0f"}[t().activeCharacter]),getCharacterColor:()=>({frodo:"#3B82F6",sam:"#10B981",gandalf:"#8B5CF6"}[t().activeCharacter]),getShouldShowPanel:()=>null!==t().currentDialogue})),wd=()=>xd(e=>({activeCharacter:e.activeCharacter,currentDialogue:e.currentDialogue,mood:e.characterMood,chatMessages:e.chatMessages,suggestedAction:e.suggestedAction,suggestedQuest:e.suggestedQuest,isChatLoading:e.isChatLoading,avatar:e.getCharacterAvatar(),color:e.getCharacterColor(),setActiveCharacter:e.setActiveCharacter,setCurrentDialogue:e.setCurrentDialogue,setChatMessages:e.setChatMessages,appendChatMessage:e.appendChatMessage,setSuggestedAction:e.setSuggestedAction,setSuggestedQuest:e.setSuggestedQuest,setChatLoading:e.setChatLoading})),kd={frodo:{name:"Frodo",emoji:"\ud83e\udddd"},sam:{name:"Sam",emoji:"\ud83d\udc68\u200d\ud83c\udf3e"},gandalf:{name:"Gandalf",emoji:"\ud83e\uddd9\u200d\u2642\ufe0f"}},Sd=()=>{var e;const t=re(),{activeCharacter:n,chatMessages:r,suggestedAction:o,suggestedQuest:s,isChatLoading:a,setActiveCharacter:l,setChatMessages:c,setSuggestedAction:u,setSuggestedQuest:d,setChatLoading:h}=wd(),[p,f]=(0,i.useState)(""),[m,g]=(0,i.useState)(null),v=(0,i.useMemo)(()=>kd[n],[n]);(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{g(null),h(!0);const t=await ci.getNpcChatSession(n);if(!e)return;if(t.messages.length>0)return c(t.messages),u(t.suggested_action),void d(t.suggested_quest||null);const i=await ci.startNpcChat(n);if(!e)return;c(i.messages),u(i.suggested_action),d(i.suggested_quest||null)}catch(t){if(!e)return;g("The companion is gathering thoughts. Try again in a moment.")}finally{e&&h(!1)}})(),()=>{e=!1}},[n,h,c,u,d]);const y=async()=>{const e=p.trim();e&&(f(""),await(async e=>{const t=e.trim();if(t)try{g(null),h(!0);const e=await ci.sendNpcMessage(n,t);c(e.messages),u(e.suggested_action),d(e.suggested_quest||null)}catch(i){g("The character did not answer. Try sending again.")}finally{h(!1)}})(e))};return(0,Ai.jsxs)(Wu.aside,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},transition:{duration:.25},"data-testid":"character-panel",className:"bg-gradient-to-br from-parchment-light to-parchment border border-gold-dark/40 rounded-xl shadow-lg p-4 space-y-4",children:[(0,Ai.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ai.jsx)(id,{emoji:v.emoji,size:"lg"}),(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)("h3",{className:"font-epic text-xl text-forest-dark",children:v.name}),(0,Ai.jsx)("p",{className:"text-xs text-text-secondary",children:"Companion Chat"})]})]}),(0,Ai.jsx)("div",{className:"flex flex-wrap gap-2",children:["frodo","sam","gandalf"].map(e=>(0,Ai.jsxs)(Ii,{variant:e===n?"epic":"small",className:"text-xs",onClick:()=>l(e),children:[kd[e].emoji," ",kd[e].name]},e))}),(0,Ai.jsxs)("div",{className:"h-80 overflow-y-auto bg-white/50 rounded-lg border border-gold-dark/20 p-3 space-y-3","data-testid":"chat-panel",children:[0===r.length&&!a&&(0,Ai.jsx)("p",{className:"text-sm text-text-secondary",children:"Your companion will open the conversation shortly."}),r.map((e,t)=>(0,Ai.jsx)("div",{className:"assistant"===e.role?"text-left":"text-right","data-testid":"assistant"===e.role?"npc-message":"user-message","data-role":e.role,children:(0,Ai.jsx)("div",{className:"assistant"===e.role?"inline-block max-w-[92%] rounded-lg px-3 py-2 bg-parchment-dark/70 text-text-primary text-sm whitespace-pre-wrap break-words":"inline-block max-w-[92%] rounded-lg px-3 py-2 bg-forest text-parchment-light text-sm whitespace-pre-wrap break-words",children:e.content})},"".concat(e.role,"-").concat(t))),a&&(0,Ai.jsxs)("p",{className:"text-xs text-text-secondary italic",children:[v.name," is thinking\u2026"]})]}),o&&(0,Ai.jsxs)("div",{className:"rounded-lg border border-gold-dark/30 bg-gold/10 p-3",children:[(0,Ai.jsx)("p",{className:"text-xs uppercase tracking-wide text-text-secondary",children:"Suggested action"}),(0,Ai.jsx)("p",{className:"font-readable text-sm text-text-primary mt-1",children:o.title}),(0,Ai.jsx)("p",{className:"text-xs text-text-secondary mt-1",children:o.reason}),(null===(e=o.target)||void 0===e?void 0:e.route)&&(0,Ai.jsx)(Ii,{variant:"small",className:"mt-2",onClick:()=>t((()=>{var e,t;const n=(null===o||void 0===o||null===(e=o.target)||void 0===e?void 0:e.route)||"/quests",i=(null===o||void 0===o||null===(t=o.target)||void 0===t?void 0:t.query)||{},r=new URLSearchParams;Object.entries(i).forEach(e=>{let[t,n]=e;r.set(t,String(n))});const s=r.toString();return s?"".concat(n,"?").concat(s):n})()),children:(()=>{switch(null===o||void 0===o?void 0:o.goal_type){case"scout_map_hotspot":return"Scout on Map";case"propose_side_quest":return"Create Side Quest";case"resolve_dark_magic":return"Contain Dark Magic";default:return"Open Action"}})()})]}),s&&(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"rounded-lg border-2 border-gold bg-gradient-to-br from-gold/20 to-gold/10 p-3",children:[(0,Ai.jsxs)("p",{className:"text-xs uppercase tracking-wider font-epic text-gold-dark mb-2",children:["\u2728 ",v.name," Proposes a Quest!"]}),(0,Ai.jsxs)("div",{className:"space-y-2",children:[(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)("p",{className:"font-epic text-sm text-forest-dark",children:s.title}),(0,Ai.jsx)("p",{className:"text-xs text-text-secondary mt-1",children:s.description})]}),(0,Ai.jsxs)("div",{className:"flex gap-2 text-xs",children:[(0,Ai.jsx)("span",{className:"inline-block px-2 py-1 rounded bg-forest/20 text-forest-dark font-medium",children:s.quest_type}),(0,Ai.jsx)("span",{className:"inline-block px-2 py-1 rounded font-medium ".concat("Critical"===s.priority?"bg-red/20 text-red-700":"Important"===s.priority?"bg-orange/20 text-orange-700":"bg-yellow/20 text-yellow-700"),children:s.priority})]})]}),(0,Ai.jsxs)("div",{className:"flex gap-2 mt-3",children:[(0,Ai.jsx)(Ii,{variant:"epic",className:"flex-1",onClick:async()=>{if(s)try{g(null),h(!0);const e=await ci.createQuestFromNpc(n,s);d(null),setTimeout(()=>{t("/quests?focusQuestId=".concat(e.quest.id))},1e3)}catch(e){g("Unable to create the quest right now. Try again?")}finally{h(!1)}},disabled:a,children:"Accept Quest"}),(0,Ai.jsx)(Ii,{variant:"secondary",className:"flex-1",onClick:()=>d(null),disabled:a,children:"Decline"})]})]}),(0,Ai.jsxs)("div",{className:"space-y-2",children:[(0,Ai.jsx)("textarea",{value:p,onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),y())},rows:3,placeholder:"Reply to ".concat(v.name,"..."),"data-testid":"chat-input",className:"w-full rounded-lg border border-gold-dark/30 bg-white/70 px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-gold/50 resize-none"}),(0,Ai.jsxs)("div",{className:"flex gap-2",children:[(0,Ai.jsx)(Ii,{variant:"epic",className:"flex-1",onClick:y,disabled:a,"data-testid":"send-button",children:"Send"}),(0,Ai.jsx)(Ii,{variant:"secondary",className:"flex-1",onClick:async()=>{try{g(null),h(!0),await ci.resetNpcChat(n);const e=await ci.startNpcChat(n);c(e.messages),u(e.suggested_action),d(e.suggested_quest||null)}catch(e){g("Unable to reset this conversation right now.")}finally{h(!1)}},disabled:a,"data-testid":"reset-button",children:"New Opener"})]})]}),m&&(0,Ai.jsx)("p",{className:"text-xs text-red-700",children:m})]})};Sd.displayName="CharacterPanel";const Cd=e=>e?{pending:"not_yet_begun",in_progress:"the_road_goes_ever_on",completed:"it_is_done",blocked:"the_shadow_falls"}[e]||e:"",Ld=e=>"it_is_done"===Cd(e.status),Ed=e=>{const t=new URLSearchParams;return e.location_id&&t.set("zoomToLocation",String(e.location_id)),t.set("selectedQuestId",String(e.id)),"/map?".concat(t.toString())},Pd=e=>{let{quests:t,members:n,user:r}=e;const o=re(),[s,a]=(0,i.useState)(null),l=(e,t)=>t.includes(e.status),c={total:t.length,notYetBegun:t.filter(e=>l(e,["not_yet_begun","pending"])).length,inProgress:t.filter(e=>l(e,["the_road_goes_ever_on","in_progress"])).length,completed:t.filter(e=>l(e,["it_is_done","completed"])).length,shadowFalls:t.filter(e=>l(e,["the_shadow_falls","blocked"])).length,darkMagic:t.filter(e=>e.is_dark_magic).length},u=n.filter(e=>"active"===e.status).length,d=t.filter(e=>e.assignee_name===r.role||e.assigned_to),h=d.filter(e=>l(e,["it_is_done","completed"])).length,p=t.length>0?Math.round(c.completed/t.length*100):0,f=s?t.filter(e=>e.status===s):t.slice(0,8),m=(0,i.useMemo)(()=>(e=>{if(0===e.length)return{title:"Forge the Fellowship Plan",description:"Begin your journey by creating the first quest objective for the council.",ctaLabel:"Open Quest Scrolls",route:"/quests",mode:"quests"};const t=e.filter(e=>!Ld(e));if(t.find(e=>e.is_dark_magic))return{title:"Contain the Shadow",description:"A dark-magic objective needs immediate focus before it spreads further.",ctaLabel:"Resolve in Quest Scrolls",route:"/quests?status=the_shadow_falls",mode:"quests"};const n=t.find(e=>"the_road_goes_ever_on"===Cd(e.status));if(n){const e=n.location_name||"the marked region";return{title:"Advance the Active Journey",description:"Scout ".concat(e," and push the active objective toward completion."),ctaLabel:"Scout on Map",route:Ed(n),mode:"map"}}const i=t.find(e=>"not_yet_begun"===Cd(e.status));if(i){if(i.location_id){const e=i.location_name||"its location";return{title:"Scout the Next Objective",description:"Review ".concat(e," on the map before beginning the objective."),ctaLabel:"Scout on Map",route:Ed(i),mode:"map"}}return{title:"Open the Next Quest",description:"Review details and assign your next objective in the quest scrolls.",ctaLabel:"Open Quest Scrolls",route:"/quests?focusQuestId=".concat(i.id),mode:"quests"}}const r=e.find(e=>Ld(e)&&e.location_id),o=new URLSearchParams({propose:"1",seedTitle:"Scout a new frontier",seedDescription:"Define the next objective for the Fellowship and keep momentum alive.",seedType:"The Journey",seedPriority:"Important"});return null!==r&&void 0!==r&&r.location_id&&o.set("seedLocationId",String(r.location_id)),{title:"Set the Next Chapter",description:"All known objectives are complete. Propose a new side quest to continue the journey.",ctaLabel:"Create Side Quest",route:"/quests?".concat(o.toString()),mode:"quests"}})(t),[t]),g={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.2}}},v={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.5,ease:"easeOut"}}};return(0,Ai.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,Ai.jsxs)("div",{className:"lg:col-span-2 space-y-8",children:[(0,Ai.jsx)(Wu.div,{variants:v,initial:"hidden",animate:"visible",className:"space-y-2",children:(0,Ai.jsx)("div",{className:"flex items-center justify-between",children:(0,Ai.jsx)("div",{children:(0,Ai.jsxs)("p",{className:"font-readable text-text-muted text-lg",children:["Welcome, ",r.role,"! Track the Fellowship's journey through Middle-earth"]})})})}),c.darkMagic>0&&(0,Ai.jsx)(Wu.div,{variants:v,initial:"hidden",animate:"visible",children:(0,Ai.jsxs)(Gu,{variant:"warning",title:"Dark Magic Detected!",children:[c.darkMagic," quest",1!==c.darkMagic?"s have":" has"," been corrupted by Sauron's influence."]})}),(0,Ai.jsx)(Wu.div,{variants:v,initial:"hidden",animate:"visible",children:(0,Ai.jsxs)(Hu,{variant:"dark",className:"space-y-4",testId:"mission-briefing",children:[(0,Ai.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)("h2",{className:"font-epic text-2xl text-gold",children:"Mission Briefing"}),(0,Ai.jsx)("p",{className:"font-readable text-parchment-light mt-2",children:m.title}),(0,Ai.jsx)("p",{className:"text-sm text-parchment-light/80 mt-2",children:m.description})]}),(0,Ai.jsx)("span",{className:"text-3xl","aria-hidden":"true",children:"map"===m.mode?"\ud83d\uddfa\ufe0f":"\ud83d\udcdc"})]}),(0,Ai.jsx)("div",{children:(0,Ai.jsx)(Ii,{variant:"epic",className:"text-sm","data-testid":"mission-briefing-cta",onClick:()=>o(m.route),children:m.ctaLabel})})]})}),(0,Ai.jsxs)(Wu.div,{variants:g,initial:"hidden",animate:"visible",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,Ai.jsx)(Wu.div,{variants:v,className:"h-full",children:(0,Ai.jsx)(Hu,{variant:"parchment",className:"cursor-pointer hover:shadow-lg transition-shadow h-full flex flex-col justify-center items-center min-h-[180px]",children:(0,Ai.jsxs)("div",{className:"text-center py-4",children:[(0,Ai.jsx)("div",{className:"text-4xl font-epic text-forest-dark mb-2",children:c.total}),(0,Ai.jsx)("div",{className:"text-sm font-readable text-text-muted",children:"Total Quest Objectives"}),(0,Ai.jsx)("div",{className:"mt-3 flex justify-center",children:(0,Ai.jsx)(Zu,{variant:"standard",children:"All Quests"})})]})})}),(0,Ai.jsx)(Wu.div,{variants:v,className:"h-full",children:(0,Ai.jsx)(Hu,{variant:"parchment",className:"cursor-pointer hover:shadow-lg transition-shadow h-full flex flex-col justify-center items-center min-h-[180px]",onClick:()=>a("the_road_goes_ever_on"),children:(0,Ai.jsxs)("div",{className:"text-center py-4",children:[(0,Ai.jsx)("div",{className:"text-4xl font-epic text-forest mb-2",children:c.inProgress}),(0,Ai.jsx)("div",{className:"text-sm font-readable text-text-muted",children:"The Road Goes Ever On..."}),(0,Ai.jsx)("div",{className:"mt-3 flex justify-center",children:(0,Ai.jsx)(Zu,{variant:"inprogress",children:"In Progress"})})]})})}),(0,Ai.jsx)(Wu.div,{variants:v,className:"h-full",children:(0,Ai.jsx)(Hu,{variant:"parchment",className:"cursor-pointer hover:shadow-lg transition-shadow h-full flex flex-col justify-center items-center min-h-[180px]",onClick:()=>a("it_is_done"),children:(0,Ai.jsxs)("div",{className:"text-center py-4",children:[(0,Ai.jsx)("div",{className:"text-4xl font-epic text-success mb-2",children:c.completed}),(0,Ai.jsx)("div",{className:"text-sm font-readable text-text-muted",children:"It Is Done"}),(0,Ai.jsx)("div",{className:"mt-3 flex justify-center",children:(0,Ai.jsx)(Zu,{variant:"ready",children:"Completed"})})]})})}),(0,Ai.jsx)(Wu.div,{variants:v,className:"h-full",children:(0,Ai.jsx)(Hu,{variant:"parchment",className:"cursor-pointer hover:shadow-lg transition-shadow h-full flex flex-col justify-center items-center min-h-[180px]",children:(0,Ai.jsxs)("div",{className:"text-center py-4",children:[(0,Ai.jsx)("div",{className:"text-4xl font-epic text-gray-600 mb-2",children:c.notYetBegun}),(0,Ai.jsx)("div",{className:"text-sm font-readable text-text-muted",children:"Not Yet Begun"}),(0,Ai.jsx)("div",{className:"mt-3 flex justify-center",children:(0,Ai.jsx)(Zu,{variant:"pending",children:"Planned"})})]})})}),(0,Ai.jsx)(Wu.div,{variants:v,className:"h-full",children:(0,Ai.jsx)(Hu,{variant:"parchment",className:"cursor-pointer hover:shadow-lg transition-shadow h-full flex flex-col justify-center items-center min-h-[180px]",children:(0,Ai.jsxs)("div",{className:"text-center py-4",children:[(0,Ai.jsx)("div",{className:"text-4xl font-epic text-danger mb-2",children:c.shadowFalls}),(0,Ai.jsx)("div",{className:"text-sm font-readable text-text-muted",children:"The Shadow Falls"}),(0,Ai.jsx)("div",{className:"mt-3 flex justify-center",children:(0,Ai.jsx)(Zu,{variant:"blocked",children:"Blocked"})})]})})}),(0,Ai.jsx)(Wu.div,{variants:v,className:"h-full",children:(0,Ai.jsx)(Hu,{variant:"parchment",className:"cursor-pointer hover:shadow-lg transition-shadow h-full flex flex-col justify-center items-center min-h-[180px]",children:(0,Ai.jsxs)("div",{className:"text-center py-4",children:[(0,Ai.jsx)("div",{className:"text-4xl font-epic text-forest mb-2",children:u}),(0,Ai.jsx)("div",{className:"text-sm font-readable text-text-muted",children:"Active Fellowship Members"})]})})})]}),d.length>0&&(0,Ai.jsx)(Wu.div,{variants:v,initial:"hidden",animate:"visible",children:(0,Ai.jsx)(Hu,{variant:"dark",children:(0,Ai.jsxs)("div",{className:"space-y-2",children:[(0,Ai.jsx)("h2",{className:"font-epic text-2xl text-gold mb-4",children:"Your Personal Journey"}),(0,Ai.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,Ai.jsxs)("div",{className:"text-center",children:[(0,Ai.jsx)("div",{className:"text-2xl font-epic text-parchment mb-1",children:d.length}),(0,Ai.jsx)("div",{className:"text-sm text-parchment-light",children:"Assigned to You"})]}),(0,Ai.jsxs)("div",{className:"text-center",children:[(0,Ai.jsx)("div",{className:"text-2xl font-epic text-success mb-1",children:h}),(0,Ai.jsx)("div",{className:"text-sm text-parchment-light",children:"Completed"})]}),(0,Ai.jsxs)("div",{className:"text-center",children:[(0,Ai.jsxs)("div",{className:"text-2xl font-epic text-gold mb-1",children:[p,"%"]}),(0,Ai.jsx)("div",{className:"text-sm text-parchment-light",children:"Completion Rate"})]})]})]})})}),(0,Ai.jsx)(Wu.div,{variants:v,initial:"hidden",animate:"visible",children:(0,Ai.jsxs)("div",{className:"space-y-4",children:[(0,Ai.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ai.jsx)("h2",{className:"font-epic text-2xl text-forest-dark",children:s?"Filtered Quests":"Recent Quest Objectives"}),s&&(0,Ai.jsx)("button",{onClick:()=>a(null),className:"px-4 py-2 text-sm rounded bg-forest text-parchment hover:bg-forest-dark transition-colors",children:"Clear Filter"})]}),(0,Ai.jsx)(Wu.div,{variants:g,initial:"hidden",animate:"visible",className:"space-y-3 max-h-96 overflow-y-auto",children:f.length>0?f.map((e,t)=>{return(0,Ai.jsx)(Wu.div,{variants:v,children:(0,Ai.jsx)(Hu,{variant:"parchment",className:"hover:shadow-md transition-shadow",children:(0,Ai.jsxs)("div",{className:"space-y-2",children:[(0,Ai.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)("h3",{className:"font-epic text-lg text-forest-dark",children:e.title}),(0,Ai.jsx)("p",{className:"text-sm text-text-muted mt-1",children:e.description})]}),(0,Ai.jsx)(Zu,{variant:e.is_dark_magic?"critical":"standard",children:(n=e.status,"not_yet_begun"===n||"pending"===n?"Not Yet Begun":"the_road_goes_ever_on"===n||"in_progress"===n?"The Road Goes Ever On...":"it_is_done"===n||"completed"===n?"It Is Done":"the_shadow_falls"===n||"blocked"===n?"The Shadow Falls":String(n).replace(/_/g," "))})]}),(0,Ai.jsxs)("div",{className:"flex gap-4 text-xs text-text-muted",children:[e.location_name&&(0,Ai.jsxs)("span",{children:["\ud83d\udccd ",e.location_name]}),e.priority&&(0,Ai.jsxs)("span",{children:["\u26a1 Priority: ",e.priority]})]})]})})},e.id);var n}):(0,Ai.jsx)("div",{className:"text-center py-8 text-text-muted",children:(0,Ai.jsx)("p",{className:"text-lg",children:"No quests found with current criteria"})})})]})}),s&&(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"text-center text-sm text-text-muted",children:["Showing ",f.length," of ",t.length," quests"]})]}),(0,Ai.jsx)("div",{className:"lg:col-span-1 lg:sticky lg:top-6 h-fit",children:(0,Ai.jsx)(Sd,{})})]})},Td=e=>{let{gold:t,completedQuests:n,averageSavings:i}=e;const r=[t,n,i],o=[e=>"number"===typeof e?e.toString():"\u2014",e=>"number"===typeof e?e.toString():"\u2014",e=>null===e||void 0===e?"\u2014":"".concat(e.toFixed(2),"%")],s={hidden:{opacity:0,scale:.92,x:-5},visible:{opacity:1,scale:1,x:0,transition:{duration:.35,ease:"easeOut"}}};return(0,Ai.jsx)(Wu.div,{className:"flex items-center gap-4 px-4 py-2.5 rounded-2xl bg-gradient-to-br from-parchment-light/90 via-parchment/90 to-parchment-light/85 border border-gold/50 shadow-md",style:{minWidth:0,backdropFilter:"blur(8px)"},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0,transition:{staggerChildren:.08,delayChildren:.15,duration:.4}}},initial:"hidden",animate:"visible","data-testid":"scoring-card",children:[{icon:"\ud83e\ude99",label:"Gold",testId:"scoring-card-gold"},{icon:"\ud83c\udfc6",label:"Quests",testId:"scoring-card-quests"},{icon:"\ud83d\udcb0",label:"Bargain Avg",testId:"scoring-card-savings"}].map((e,t)=>(0,Ai.jsxs)(Wu.div,{className:"flex items-center gap-2 flex-1 min-w-0",variants:s,"data-testid":e.testId,children:[(0,Ai.jsx)("span",{className:"text-xl flex-shrink-0","aria-hidden":"true",style:{filter:"drop-shadow(0 1px 4px rgba(255, 215, 0, 0.4))"},children:e.icon}),(0,Ai.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,Ai.jsx)("span",{className:"text-[0.65rem] font-readable text-forest-dark/70 uppercase tracking-widest truncate",style:{fontWeight:600,letterSpacing:"0.15em"},children:e.label}),(0,Ai.jsx)("span",{className:"text-lg font-epic text-forest-dark tabular-nums",style:{fontWeight:700,letterSpacing:"0.05em",textShadow:"0 1px 2px rgba(0, 0, 0, 0.1)"},children:o[t](r[t])})]})]},e.testId))})},jd=()=>(0,Ai.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none","aria-hidden":"true",className:"lotr-header__ring-svg",children:[(0,Ai.jsx)("circle",{cx:"15",cy:"15",r:"11",stroke:"#DAA520",strokeWidth:"2.5",fill:"none"}),(0,Ai.jsx)("circle",{cx:"15",cy:"15",r:"6.5",stroke:"#B8860B",strokeWidth:"1.5",fill:"none"}),(0,Ai.jsx)("circle",{cx:"15",cy:"15",r:"2.5",fill:"#DAA520"}),(0,Ai.jsx)("circle",{cx:"15",cy:"3.5",r:"1",fill:"#FFD700",opacity:"0.8"}),(0,Ai.jsx)("circle",{cx:"15",cy:"26.5",r:"1",fill:"#FFD700",opacity:"0.8"}),(0,Ai.jsx)("circle",{cx:"3.5",cy:"15",r:"1",fill:"#FFD700",opacity:"0.8"}),(0,Ai.jsx)("circle",{cx:"26.5",cy:"15",r:"1",fill:"#FFD700",opacity:"0.8"})]}),Nd={dashboard:{title:"Dashboard",icon:"\ud83c\udff0"},quests:{title:"Quests",icon:"\ud83d\udcdc"},map:{title:"Middle-Earth Map",icon:"\ud83d\uddfa\ufe0f"},inventory:{title:"Inventory",icon:"\ud83c\udf92"}},Od=[{to:"/dashboard",label:"Dashboard",icon:"\ud83c\udff0",pageKey:"dashboard"},{to:"/quests",label:"Quests",icon:"\ud83d\udcdc",pageKey:"quests"},{to:"/map",label:"Middle-Earth Map",icon:"\ud83d\uddfa\ufe0f",pageKey:"map"},{to:"/inventory",label:"Inventory",icon:"\ud83c\udf92",pageKey:"inventory"}],Md=e=>{var t;let{page:n,gold:r,completedQuests:o,averageSavings:s,onLogout:a}=e;const[l,c]=(0,i.useState)(!1),u=null!==(t=Nd[n])&&void 0!==t?t:Nd.dashboard;return(0,Ai.jsxs)("header",{className:"lotr-header".concat(l?" lotr-header--menu-open":""),role:"banner",children:[(0,Ai.jsx)("div",{className:"lotr-header__top-accent","aria-hidden":"true"}),(0,Ai.jsxs)("div",{className:"lotr-header__inner",children:[(0,Ai.jsxs)("div",{className:"lotr-header__brand",children:[(0,Ai.jsx)("span",{className:"lotr-header__ring-wrap",children:(0,Ai.jsx)(jd,{})}),(0,Ai.jsxs)("div",{className:"lotr-header__brand-text",children:[(0,Ai.jsx)("span",{className:"lotr-header__subtitle",children:"The Fellowship"}),(0,Ai.jsxs)("h1",{className:"lotr-header__page-title",children:[(0,Ai.jsx)("span",{"aria-hidden":"true",children:u.icon})," ",u.title]})]})]}),(0,Ai.jsx)("nav",{className:"lotr-header__nav","data-tour":"main-navigation","data-testid":"header-navigation","aria-label":"Main navigation",id:"main-navigation",children:Od.map(e=>{const t=n===e.pageKey;return(0,Ai.jsxs)(Ne,{to:e.to,className:"lotr-nav-link".concat(t?" lotr-nav-link--active text-gold font-bold":" text-parchment hover:text-gold"),"data-testid":"header-nav-".concat(e.to.slice(1)),"aria-current":t?"page":void 0,onClick:()=>c(!1),children:[(0,Ai.jsx)("span",{className:"lotr-nav-link__icon","aria-hidden":"true",children:e.icon}),(0,Ai.jsx)("span",{className:"lotr-nav-link__label",children:e.label})]},e.to)})}),(0,Ai.jsxs)("div",{className:"lotr-header__controls",children:[(0,Ai.jsx)(Td,{gold:r,completedQuests:o,averageSavings:s}),(0,Ai.jsx)(Ii,{onClick:a,variant:"secondary",className:"lotr-logout-btn text-sm whitespace-nowrap","data-testid":"header-logout-button",children:"Leave Fellowship"})]}),(0,Ai.jsxs)("button",{className:"lotr-hamburger".concat(l?" lotr-hamburger--open":""),onClick:()=>c(e=>!e),"aria-expanded":l,"aria-controls":"main-navigation","aria-label":l?"Close navigation menu":"Open navigation menu","data-testid":"header-mobile-menu-btn",type:"button",children:[(0,Ai.jsx)("span",{className:"lotr-hamburger__bar","aria-hidden":"true"}),(0,Ai.jsx)("span",{className:"lotr-hamburger__bar","aria-hidden":"true"}),(0,Ai.jsx)("span",{className:"lotr-hamburger__bar","aria-hidden":"true"})]})]}),(0,Ai.jsxs)("div",{className:"lotr-header__elvish-border","aria-hidden":"true",children:[(0,Ai.jsxs)("svg",{viewBox:"0 0 1440 14",preserveAspectRatio:"none",className:"lotr-header__border-svg",children:[(0,Ai.jsx)("path",{d:"M0,7 C90,1 180,13 270,7 C360,1 450,13 540,7 C630,1 720,13 810,7 C900,1 990,13 1080,7 C1170,1 1260,13 1350,7 C1395,4 1420,10 1440,7",fill:"none",stroke:"url(#elvishGold)",strokeWidth:"1.5"}),(0,Ai.jsx)("defs",{children:(0,Ai.jsxs)("linearGradient",{id:"elvishGold",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,Ai.jsx)("stop",{offset:"0%",stopColor:"#B8860B",stopOpacity:"0"}),(0,Ai.jsx)("stop",{offset:"15%",stopColor:"#DAA520",stopOpacity:"0.9"}),(0,Ai.jsx)("stop",{offset:"50%",stopColor:"#FFD700",stopOpacity:"1"}),(0,Ai.jsx)("stop",{offset:"85%",stopColor:"#DAA520",stopOpacity:"0.9"}),(0,Ai.jsx)("stop",{offset:"100%",stopColor:"#B8860B",stopOpacity:"0"})]})})]}),(0,Ai.jsx)("span",{className:"lotr-header__gems",children:"\u25c6\u25c7\u25c6"})]})]})},Ad=e=>{let{user:t,onLogout:n}=e;const[r,o]=(0,i.useState)([]),[s,a]=(0,i.useState)([]),[l,c]=(0,i.useState)(!0),[u,d]=(0,i.useState)(t.gold||0);return(0,i.useEffect)(()=>{(async()=>{try{const[e,t]=await Promise.all([ci.getQuests(),ci.getMembers()]);o(e),a(t);const n=await ci.getGoldBalance();d(n)}catch(e){console.error("Failed to load dashboard data:",e)}finally{c(!1)}})()},[]),l?(0,Ai.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,Ai.jsxs)("div",{className:"text-center",children:[(0,Ai.jsx)("div",{className:"text-4xl mb-4",children:"\ud83e\udddd"}),(0,Ai.jsx)("p",{className:"text-text-primary font-readable",children:"Opening the gates of Rivendell..."})]})}):(0,Ai.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,Ai.jsx)(Md,{page:"dashboard",gold:u,completedQuests:r.filter(e=>"it_is_done"===e.status).length,averageSavings:null,onLogout:n}),(0,Ai.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:(0,Ai.jsx)(Pd,{quests:r,members:s,user:t})})]})},Rd=e=>({not_yet_begun:"Not Yet Begun",the_road_goes_ever_on:"The Road Goes Ever On...",it_is_done:"It Is Done",the_shadow_falls:"The Shadow Falls",pending:"Not Yet Begun",in_progress:"The Road Goes Ever On...",completed:"It Is Done",blocked:"The Shadow Falls"}[e]||String(e).replace(/_/g," ")),Id=e=>{let{quests:t,onEdit:n,onDelete:i,onComplete:r,onLocationClick:o}=e;const s=re();if(0===t.length)return(0,Ai.jsx)("div",{className:"text-center py-12",children:(0,Ai.jsx)("p",{className:"text-lg sm:text-2xl text-text-secondary font-readable px-4",children:"No quests found. Propose your first quest to begin the journey! \ud83d\udcdc"})});const a={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.5,ease:"easeOut"}}};return(0,Ai.jsx)(Wu.div,{variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},initial:"hidden",animate:"visible",className:"grid grid-cols-1 lg:grid-cols-2 gap-4 auto-rows-fr",children:t.map(e=>{return(0,Ai.jsx)(Wu.div,{variants:a,className:"h-full","data-testid":"quest-item","data-quest-title":e.title,children:(0,Ai.jsx)(Hu,{variant:e.is_dark_magic?"dark":"parchment",className:"hover:shadow-lg transition-shadow h-full flex flex-col",children:(0,Ai.jsxs)("div",{className:"space-y-3 sm:space-y-4 min-w-0 flex-1 flex flex-col",children:[(0,Ai.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4 min-w-0",children:[(0,Ai.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ai.jsxs)("h3",{className:"font-epic text-lg sm:text-xl text-forest-dark mb-2 break-words",children:[(c=e.quest_type,{"The Journey":"\ud83e\udded","The Battle":"\u2694\ufe0f","The Fellowship":"\ud83d\udc65","The Ring":"\ud83d\udc8d","Dark Magic":"\ud83d\udc41\ufe0f"}[c||""]||"\ud83d\udcdc")," ",e.title]}),(0,Ai.jsx)("p",{className:"font-readable text-text-secondary text-sm break-words line-clamp-3",children:e.description})]}),e.priority&&(0,Ai.jsx)("div",{className:"flex-shrink-0 self-start",children:(0,Ai.jsxs)(Zu,{variant:(l=e.priority,{Critical:"critical",Important:"important",Standard:"standard"}[l||""]||"standard"),children:["Critical"===e.priority?"\ud83d\udd34":"Important"===e.priority?"\ud83d\udfe1":"\u26aa"," ",e.priority]})})]}),(0,Ai.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[e.quest_type&&(0,Ai.jsx)(Zu,{variant:"standard",className:"text-xs",children:e.quest_type}),(0,Ai.jsx)(Zu,{variant:(t=e.status,{it_is_done:"ready",the_road_goes_ever_on:"inprogress",the_shadow_falls:"blocked",not_yet_begun:"pending",completed:"ready",in_progress:"inprogress",blocked:"blocked",pending:"pending"}[t]||"pending"),children:Rd(e.status)}),e.is_dark_magic&&(0,Ai.jsx)(Zu,{variant:"critical",className:"text-xs",children:"\ud83d\udc41\ufe0f Dark Magic"})]}),e.character_quote&&("it_is_done"===e.status||"completed"===e.status)&&(0,Ai.jsx)("div",{className:"p-3 bg-forest/10 rounded border-l-4 border-gold",children:(0,Ai.jsxs)("em",{className:"text-sm text-text-secondary block break-words line-clamp-3",children:['"',e.character_quote,'"']})}),(0,Ai.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 text-xs sm:text-sm text-text-secondary flex-1",children:[e.location_name&&e.location_id&&(0,Ai.jsxs)("button",{className:"text-left hover:text-gold transition-colors cursor-pointer break-words",onClick:()=>{return t=e.location_id,void(o?o(t):s("/map",{state:{zoomToLocation:t}}));var t},title:"Click to view on map",children:["\ud83d\udccd ",e.location_name]}),e.assignee_name&&(0,Ai.jsxs)("div",{className:"break-words",children:["\ud83d\udc64 ",e.assignee_name]})]}),(0,Ai.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-4 border-t border-text-secondary/20 mt-auto",children:[r&&"it_is_done"!==e.status&&"completed"!==e.status&&(0,Ai.jsx)(Ii,{variant:"epic",className:"text-sm w-full sm:flex-1",onClick:()=>{Oi.trackQuestCompleted(e.id,e.title,e.quest_type),r(e.id)},children:"\u2713 Complete Quest"}),n&&(0,Ai.jsx)(Ii,{variant:"secondary",className:"text-sm w-full sm:flex-1",onClick:()=>n(e),children:"\u270f\ufe0f Revise"}),i&&(0,Ai.jsx)(Ii,{variant:"danger",className:"text-sm w-full sm:flex-1",onClick:()=>i(e.id),children:"\u2715 Abandon"})]})]})})},e.id);var t,l,c})})},zd=e=>{let{quest:t,locations:n,members:r,onSubmit:o,onCancel:s}=e;const[a,l]=(0,i.useState)((null===t||void 0===t?void 0:t.title)||""),[c,u]=(0,i.useState)((null===t||void 0===t?void 0:t.description)||""),[d,h]=(0,i.useState)((null===t||void 0===t?void 0:t.status)||"not_yet_begun"),[p,f]=(0,i.useState)(null===t||void 0===t?void 0:t.quest_type),[m,g]=(0,i.useState)(null===t||void 0===t?void 0:t.priority),[v,y]=(0,i.useState)((null===t||void 0===t?void 0:t.is_dark_magic)||!1),[_,b]=(0,i.useState)((null===t||void 0===t?void 0:t.character_quote)||""),[x,w]=(0,i.useState)(null===t||void 0===t?void 0:t.location_id),[k,S]=(0,i.useState)(null===t||void 0===t?void 0:t.assigned_to),[C,L]=(0,i.useState)(!1),[E,P]=(0,i.useState)("");return(0,Ai.jsx)("div",{className:"quest-form-overlay",onClick:s,children:(0,Ai.jsxs)("div",{className:"quest-form-modal",onClick:e=>e.stopPropagation(),children:[(0,Ai.jsxs)("div",{className:"quest-form-header",children:[(0,Ai.jsx)("h2",{children:t?"Revise the Quest":"Propose a Quest"}),(0,Ai.jsx)("button",{className:"close-button",onClick:s,children:"\xd7"})]}),E&&(0,Ai.jsx)("div",{className:"error-message",children:E}),(0,Ai.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),P(""),x){L(!0);try{await o({title:a,description:c,status:d,quest_type:p,priority:m,is_dark_magic:v,character_quote:_||void 0,location_id:x,assigned_to:k})}catch(t){P(t.message||"Failed to save quest")}finally{L(!1)}}else P("Please select a location for this quest. All quests must be associated with a location on the map.")},className:"quest-form",children:[(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"title",className:"form-label",children:"Title *"}),(0,Ai.jsx)("input",{type:"text",id:"title",className:"form-input",value:a,onChange:e=>l(e.target.value),required:!0})]}),(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"description",className:"form-label",children:"Description"}),(0,Ai.jsx)("textarea",{id:"description",className:"form-input form-textarea",value:c,onChange:e=>u(e.target.value),placeholder:"Describe the quest in epic detail...",rows:4})]}),(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"quest_type",className:"form-label",children:"Quest Type *"}),(0,Ai.jsxs)("select",{id:"quest_type",className:"form-input",value:p||"",onChange:e=>f(e.target.value),required:!0,children:[(0,Ai.jsx)("option",{value:"",children:"Select quest type"}),(0,Ai.jsx)("option",{value:"The Journey",children:"The Journey"}),(0,Ai.jsx)("option",{value:"The Battle",children:"The Battle"}),(0,Ai.jsx)("option",{value:"The Fellowship",children:"The Fellowship"}),(0,Ai.jsx)("option",{value:"The Ring",children:"The Ring"}),(0,Ai.jsx)("option",{value:"Dark Magic",children:"Dark Magic"})]})]}),(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"priority",className:"form-label",children:"Priority *"}),(0,Ai.jsxs)("select",{id:"priority",className:"form-input",value:m||"",onChange:e=>g(e.target.value),required:!0,children:[(0,Ai.jsx)("option",{value:"",children:"Select priority"}),(0,Ai.jsx)("option",{value:"Critical",children:"Critical"}),(0,Ai.jsx)("option",{value:"Important",children:"Important"}),(0,Ai.jsx)("option",{value:"Standard",children:"Standard"})]})]}),(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"status",className:"form-label",children:"Status"}),(0,Ai.jsxs)("select",{id:"status",className:"form-input",value:d,onChange:e=>h(e.target.value),children:[(0,Ai.jsx)("option",{value:"not_yet_begun",children:"Not Yet Begun"}),(0,Ai.jsx)("option",{value:"the_road_goes_ever_on",children:"The Road Goes Ever On..."}),(0,Ai.jsx)("option",{value:"it_is_done",children:"It Is Done"}),(0,Ai.jsx)("option",{value:"the_shadow_falls",children:"The Shadow Falls"})]})]}),(0,Ai.jsx)("div",{className:"form-group",children:(0,Ai.jsxs)("label",{htmlFor:"is_dark_magic",className:"form-label",children:[(0,Ai.jsx)("input",{type:"checkbox",id:"is_dark_magic",checked:v,onChange:e=>y(e.target.checked)}),(0,Ai.jsx)("span",{style:{marginLeft:"8px"},children:"Dark Magic (for testing challenges)"})]})}),(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"character_quote",className:"form-label",children:"Character Quote (optional)"}),(0,Ai.jsx)("input",{type:"text",id:"character_quote",className:"form-input",value:_,onChange:e=>b(e.target.value),placeholder:"Quote to display when quest is completed..."})]}),(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"location",className:"form-label",children:"Location *"}),(0,Ai.jsxs)("select",{id:"location",className:"form-input",value:x||"",onChange:e=>w(e.target.value?Number(e.target.value):void 0),required:!0,children:[(0,Ai.jsx)("option",{value:"",children:"Select a location"}),n.map(e=>(0,Ai.jsxs)("option",{value:e.id,children:[e.name," - ",e.region]},e.id))]})]}),(0,Ai.jsxs)("div",{className:"form-group",children:[(0,Ai.jsx)("label",{htmlFor:"assigned_to",className:"form-label",children:"Assign To"}),(0,Ai.jsxs)("select",{id:"assigned_to",className:"form-input",value:k||"",onChange:e=>S(e.target.value?Number(e.target.value):void 0),children:[(0,Ai.jsx)("option",{value:"",children:"Unassigned"}),r.map(e=>(0,Ai.jsxs)("option",{value:e.id,children:[e.name," (",e.role,")"]},e.id))]})]}),(0,Ai.jsxs)("div",{className:"quest-form-actions",children:[(0,Ai.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:s,children:"Cancel"}),(0,Ai.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:C,children:C?"Saving...":t?"Revise Quest":"Propose Quest"})]})]})]})})},Bd=e=>{let{quests:t,locations:n,onStatusChange:r,onTypeChange:o,onLocationChange:s,selectedStatus:a,selectedType:l,selectedLocation:c}=e;const[u,d]=(0,i.useState)(new Set(["status"])),h=e=>{const t=new Set(u);t.has(e)?t.delete(e):t.add(e),d(t)},p=e=>{switch(e){case"the_road_goes_ever_on":return"bg-in-progress/20 text-in-progress border-in-progress/40 hover:bg-in-progress/30";case"it_is_done":return"bg-ready/20 text-ready border-ready/40 hover:bg-ready/30";case"the_shadow_falls":return"bg-blocked/20 text-blocked border-blocked/40 hover:bg-blocked/30";default:return"bg-parchment-light text-text-primary border-gold/30 hover:bg-gold/20"}},f=e=>{switch(e){case"the_road_goes_ever_on":return"In Progress";case"it_is_done":return"Completed";case"the_shadow_falls":return"Blocked";default:return"All Quests"}},m=[{key:null,label:f("")},{key:"the_road_goes_ever_on",label:f("the_road_goes_ever_on")},{key:"it_is_done",label:f("it_is_done")},{key:"the_shadow_falls",label:f("the_shadow_falls")}];return(0,Ai.jsxs)("div",{className:"bg-gradient-to-br from-parchment-light to-parchment border-l-4 border-gold rounded-lg p-4 mb-6 shadow-md",children:[(0,Ai.jsxs)("div",{className:"mb-4",children:[(0,Ai.jsxs)("button",{onClick:()=>h("status"),className:"flex items-center justify-between w-full mb-2 font-epic text-sm text-forest-dark hover:text-forest transition-colors","aria-expanded":u.has("status"),children:[(0,Ai.jsx)("span",{children:"Quest Status"}),(0,Ai.jsx)("span",{className:"transition-transform ".concat(u.has("status")?"rotate-180":""),children:"\u25bc"})]}),u.has("status")&&(0,Ai.jsx)("div",{className:"flex flex-wrap gap-2",children:m.map(e=>{let{key:n,label:i}=e;return(0,Ai.jsxs)("button",{onClick:()=>r(n),className:"px-3 py-2 rounded-md text-sm font-readable border transition-all ".concat(a===n?"bg-forest text-parchment-light border-forest-dark shadow-md":p(n)),"aria-pressed":a===n,"data-testid":"status-filter-".concat(n||"all"),children:[i," (",t.filter(e=>!n||e.status===n).length,")"]},n||"all")})})]}),(0,Ai.jsxs)("div",{className:"mb-4",children:[(0,Ai.jsxs)("button",{onClick:()=>h("type"),className:"flex items-center justify-between w-full mb-2 font-epic text-sm text-forest-dark hover:text-forest transition-colors","aria-expanded":u.has("type"),children:[(0,Ai.jsx)("span",{children:"Quest Type"}),(0,Ai.jsx)("span",{className:"transition-transform ".concat(u.has("type")?"rotate-180":""),children:"\u25bc"})]}),u.has("type")&&(0,Ai.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Ai.jsxs)("button",{onClick:()=>o(null),className:"px-3 py-2 rounded-md text-sm font-readable border transition-all ".concat(null===l?"bg-forest text-parchment-light border-forest-dark shadow-md":"bg-parchment-light text-text-primary border-gold/30 hover:bg-gold/20"),"aria-pressed":null===l,"data-testid":"type-filter-all",children:["All Types (",t.length,")"]}),["The Journey","The Battle","The Fellowship","The Ring"].map(e=>(0,Ai.jsxs)("button",{onClick:()=>o(e),className:"px-3 py-2 rounded-md text-sm font-readable border transition-all ".concat(l===e?"bg-forest text-parchment-light border-forest-dark shadow-md":"bg-parchment-light text-text-primary border-gold/30 hover:bg-gold/20"),"aria-pressed":l===e,"data-testid":"type-filter-".concat(e.replace(/\s+/g,"_")),children:[e," (",t.filter(t=>t.quest_type===e).length,")"]},e))]})]}),n.length>0&&(0,Ai.jsxs)("div",{children:[(0,Ai.jsxs)("button",{onClick:()=>h("location"),className:"flex items-center justify-between w-full mb-2 font-epic text-sm text-forest-dark hover:text-forest transition-colors","aria-expanded":u.has("location"),children:[(0,Ai.jsx)("span",{children:"Location"}),(0,Ai.jsx)("span",{className:"transition-transform ".concat(u.has("location")?"rotate-180":""),children:"\u25bc"})]}),u.has("location")&&(0,Ai.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Ai.jsx)("button",{onClick:()=>s(null),className:"px-3 py-2 rounded-md text-sm font-readable border transition-all ".concat(null===c?"bg-forest text-parchment-light border-forest-dark shadow-md":"bg-parchment-light text-text-primary border-gold/30 hover:bg-gold/20"),"aria-pressed":null===c,"data-testid":"location-filter-all",children:"All Locations"}),n.map(e=>(0,Ai.jsxs)("button",{onClick:()=>s(e.id),className:"px-3 py-2 rounded-md text-sm font-readable border transition-all ".concat(c===e.id?"bg-forest text-parchment-light border-forest-dark shadow-md":"bg-parchment-light text-text-primary border-gold/30 hover:bg-gold/20"),"aria-pressed":c===e.id,"data-testid":"location-filter-".concat(e.name.replace(/\s+/g,"_")),children:[e.name," (",t.filter(t=>t.location_id===e.id).length,")"]},e.id))]})]})]})},Dd=[{question:"What is the name of Frodo's best friend?",options:["Gandalf","Samwise","Boromir","Legolas"],correct:1},{question:"In which Shire town does Frodo live?",options:["Bree","Hobbiton","Rivendell","Lothl\xf3rien"],correct:1},{question:"What is the Elvish name for Mithril?",options:["Adamant","Moria","Silmaril","Mithril is only known in Dwarvish"],correct:3},{question:"Who forged the One Ring?",options:["Gandalf","Elrond","Sauron","Bilbo Baggins"],correct:2},{question:"What is the name of Gandalf's horse?",options:["Asfaloth","Shadowfax","Arod","Firefoot"],correct:1},{question:"How many members were in the Fellowship?",options:["7","8","9","10"],correct:2},{question:"What is the capital of Rohan?",options:["Gondor","Edoras","Minas Tirith","Aragorn"],correct:1},{question:'What does "Frodo" mean in Sindarin?',options:["Friend","Ring-bearer","Wisdom-Dweller","Hobbit"],correct:2},{question:"Who carries the shards of Narsil to Rivendell?",options:["Arwen","Aragorn","Boromir","Elrond"],correct:1},{question:"What creature bites Frodo in Shelob's Lair?",options:["Warg","Balrog","Shelob","Watcher in the Water"],correct:2},{question:"Which city is known as the White City?",options:["Edoras","Minas Tirith","Bree","Osgiliath"],correct:1},{question:'Who says, "You shall not pass!"?',options:["Saruman","Elrond","Gandalf","Theoden"],correct:2},{question:"What race is Gimli?",options:["Elf","Human","Wizard","Dwarf"],correct:3},{question:"Where is the Council of Elrond held?",options:["Rivendell","Helm's Deep","Minas Tirith","The Shire"],correct:0},{question:"Who is the father of Legolas in the films?",options:["Thranduil","Celeborn","Elrond","Haldir"],correct:0},{question:"Which king of Rohan is freed from Saruman's influence?",options:["Eomer","Theoden","Denethor","Bard"],correct:1},{question:"What food do the elves give the Fellowship for the journey?",options:["Lembas","Mead","Mushrooms","Salt pork"],correct:0},{question:"What is the name of Aragorn's sword after it is reforged?",options:["Glamdring","Orcrist","And\xfaril","Sting"],correct:2},{question:"Who tries to take the Ring from Frodo at Amon Hen?",options:["Boromir","Sam","Merry","Pippin"],correct:0},{question:"What river do the Fellowship travel down in boats?",options:["Anduin","Brandywine","Silverlode","Isen"],correct:0},{question:"Which ent marches on Isengard?",options:["Quickbeam","Treebeard","Beechbone","Skinbark"],correct:1},{question:"What title is given to Sauron?",options:["The White Rider","The Dark Lord","The Grey Pilgrim","The Steward"],correct:1},{question:"Who guards the secret stair to Mordor?",options:["Faramir","Gollum","Denethor","Eowyn"],correct:1},{question:"What is Bilbo's sword called?",options:["Sting","Gurthang","Narsil","Herugrim"],correct:0},{question:"Who is the Steward of Gondor during the War of the Ring?",options:["Theoden","Denethor","Faramir","Imrahil"],correct:1},{question:"What mountain must the Ring be destroyed in?",options:["Mindolluin","Mount Doom","Caradhras","Erebor"],correct:1},{question:"Who helps Frodo and Sam enter Mordor in disguise?",options:["Aragorn","Gollum","Legolas","Galadriel"],correct:1},{question:"Which member of the Fellowship is an elf?",options:["Boromir","Legolas","Merry","Gimli"],correct:1},{question:"Where do Merry and Pippin meet Treebeard?",options:["Fangorn Forest","Mirkwood","Lothl\xf3rien","Bree"],correct:0},{question:"Who kills the Witch-king of Angmar?",options:["Aragorn","Eowyn","Gandalf","Legolas"],correct:1}],Fd=e=>{let{onSuccess:t,onFail:n}=e;const r=(0,i.useMemo)(()=>(()=>{const e=[...Dd],t=[];for(;t.length<4&&e.length>0;){const n=Math.floor(Math.random()*e.length),[i]=e.splice(n,1);t.push(i)}return t})(),[]),[o,s]=(0,i.useState)(0),[a,l]=(0,i.useState)(null),[c,u]=(0,i.useState)(!1),[d,h]=(0,i.useState)(null),[p,f]=(0,i.useState)(0),[m,g]=(0,i.useState)(!1),v=r[o],y=o===r.length-1;return(0,Ai.jsxs)("div",{className:"space-y-4",children:[(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center",children:[(0,Ai.jsx)("h3",{className:"text-xl font-epic text-gold-dark mb-2",children:"\ud83e\uddd9 Gandalf's Trivia Challenge"}),(0,Ai.jsxs)("div",{className:"flex items-center justify-center gap-4 text-sm text-text-secondary flex-wrap",children:[(0,Ai.jsxs)("p",{children:["Question ",o+1," of ",r.length]}),(0,Ai.jsxs)("p",{children:["Score: ",p,"/",3," needed"]}),(0,Ai.jsxs)("p",{children:["Pool: ",Dd.length," questions"]})]})]}),(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.25},className:"space-y-4",children:[(0,Ai.jsx)(Hu,{variant:"dark",className:"text-center p-4",children:(0,Ai.jsx)("p",{className:"text-base sm:text-lg font-semibold text-parchment-light leading-relaxed",children:v.question})}),(0,Ai.jsx)("div",{className:"grid grid-cols-1 gap-3",children:v.options.map((e,t)=>{const n=a===t,i=n&&!0===d?"bg-green-600 text-white scale-[1.02]":n&&!1===d?"bg-red-600 text-white scale-[1.02]":"bg-forest hover:bg-forest-light text-parchment-light";return(0,Ai.jsx)(Wu.button,{type:"button",onClick:()=>(e=>{if(c||m)return;const t=e===v.correct;l(e),u(!0),h(t),t&&f(e=>e+1)})(t),disabled:c||m,whileHover:c?{}:{scale:1.01},whileTap:c?{}:{scale:.99},className:"w-full min-h-[52px] rounded-lg p-3 text-left font-medium transition-all duration-200 ".concat(i),children:e},"".concat(v.question,"-").concat(t))})}),(0,Ai.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,Ai.jsxs)("div",{className:"min-h-[24px] text-center font-semibold",children:[c&&!0===d&&(0,Ai.jsx)("span",{className:"text-green-400",children:"\u2713 Correct!"}),c&&!1===d&&(0,Ai.jsx)("span",{className:"text-red-400",children:"\u2717 Incorrect."}),m&&(0,Ai.jsx)("span",{className:p>=3?"text-green-400":"text-red-400",children:p>=3?"Challenge cleared. Claim your reward next.":"Challenge failed. Resetting for another try."})]}),(0,Ai.jsx)(Ii,{onClick:()=>{if(!c||m)return;if(!y)return s(e=>e+1),l(null),u(!1),void h(null);g(!0);const e=p;window.setTimeout(()=>{e>=3?t():n()},900)},variant:"epic",className:"w-full",disabled:!c||m,children:y?"See Result":"Next Question"})]})]},o)]})};Fd.displayName="TriviaGame";const Ud=["\ud83e\uddd9","\ud83e\udddd","\ud83d\udde1\ufe0f","\ud83d\udc51","\ud83d\udc8d","\ud83d\udc34"],qd=e=>{let{onSuccess:t,onFail:n}=e;const[r,o]=(0,i.useState)(()=>[...Ud,...Ud].sort(()=>Math.random()-.5).map((e,t)=>({id:t,symbol:e,revealed:!1,matched:!1}))),[s,a]=(0,i.useState)([]),[l,c]=(0,i.useState)(0),[u,d]=(0,i.useState)(0),[h,p]=(0,i.useState)(!1),[f,m]=(0,i.useState)(!1);return(0,Ai.jsxs)("div",{className:"space-y-4",children:[(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center",children:[(0,Ai.jsx)("h3",{className:"text-xl font-epic text-gold-dark mb-2",children:"\ud83c\udfad Memory Game"}),(0,Ai.jsxs)("div",{className:"flex items-center justify-center gap-4 text-sm text-text-secondary flex-wrap",children:[(0,Ai.jsxs)("p",{children:["Pairs: ",l,"/",Ud.length]}),(0,Ai.jsxs)("p",{children:["Attempts: ",u,"/",18]})]})]}),f&&(0,Ai.jsx)(Wu.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"text-center text-red-400 font-semibold",children:"\u2717 Attempt limit reached. Resetting challenge..."}),(0,Ai.jsx)("div",{className:"grid grid-cols-4 gap-2 sm:gap-3",children:r.map((e,i)=>(0,Ai.jsx)(Wu.button,{type:"button","aria-label":"Memory card ".concat(i+1),onClick:()=>(e=>{if(h||f||s.length>=2||r[e].matched||r[e].revealed||s.includes(e))return;const i=[...s,e];if(o(t=>t.map((t,n)=>n===e?Be(Be({},t),{},{revealed:!0}):t)),a(i),2!==i.length)return;const[g,v]=i,y=r[g].symbol===r[v].symbol,_=u+1;if(p(!0),d(_),!y)return _>=18?(m(!0),void window.setTimeout(()=>{n()},900)):void window.setTimeout(()=>{o(e=>e.map((e,t)=>t===g||t===v?Be(Be({},e),{},{revealed:!1}):e)),a([]),p(!1)},800);window.setTimeout(()=>{o(e=>e.map((e,t)=>t===g||t===v?Be(Be({},e),{},{matched:!0}):e));const e=l+1;c(e),a([]),p(!1),e===Ud.length&&window.setTimeout(()=>{t()},300)},450)})(i),disabled:e.matched||e.revealed||s.length>=2||h||f,whileHover:{scale:e.matched||e.revealed||h||f?1:1.04},whileTap:{scale:e.matched||e.revealed||h||f?1:.97},className:"aspect-square rounded-lg text-2xl flex items-center justify-center transition-all duration-300 ".concat(e.matched?"bg-green-600 cursor-default":e.revealed?"bg-gold cursor-default text-forest-dark":"bg-forest hover:bg-forest-light cursor-pointer text-transparent"),children:(0,Ai.jsx)(Wu.div,{initial:{rotateY:90},animate:{rotateY:e.revealed||e.matched?0:90},transition:{duration:.25},children:(e.revealed||e.matched)&&e.symbol})},e.id))}),l===Ud.length&&(0,Ai.jsx)(Wu.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-green-400 font-semibold",children:"\u2713 All pairs matched!"})]})};qd.displayName="MemoryGame";const Vd=e=>{let{onSuccess:t,onFail:n}=e;const[r,o]=(0,i.useState)("waiting"),[s,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(null),u=(0,i.useRef)(null),d=(0,i.useRef)(null);(0,i.useEffect)(()=>{if("waiting"!==r)return()=>{};const e=2e3*Math.random()+1e3;return u.current=setTimeout(()=>{d.current=Date.now(),o("go")},e),()=>{u.current&&clearTimeout(u.current)}},[r]);const h=(e,i)=>{u.current&&clearTimeout(u.current),a(i),c(e),o(null===i?"tooEarly":"result"),window.setTimeout(()=>{e?t():n()},900)};return(0,Ai.jsxs)("div",{className:"space-y-8 text-center",children:[(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"space-y-2",children:[(0,Ai.jsx)("h3",{className:"text-xl font-epic text-gold-dark",children:"\u26a1 Reaction Test"}),(0,Ai.jsx)("p",{className:"text-sm text-text-secondary",children:'Click when you see "GO!" \u2014 500ms or faster succeeds.'})]}),"waiting"===r&&(0,Ai.jsxs)(Wu.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-4",children:[(0,Ai.jsx)("p",{className:"text-parchment-light",children:"Wait for the signal..."}),(0,Ai.jsx)(Wu.div,{animate:{scale:[1,1.15,1]},transition:{duration:.7,repeat:1/0},className:"text-4xl",children:"\u23f3"})]}),"go"===r&&(0,Ai.jsx)(Wu.div,{initial:{scale:.7,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:220},className:"text-6xl font-bold text-green-400",children:"GO!"}),"tooEarly"===r&&(0,Ai.jsx)(Wu.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"text-lg text-red-400 font-semibold",children:"\u2717 Too early! Resetting challenge..."}),"result"===r&&(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"space-y-3",children:[(0,Ai.jsx)("p",{className:"text-lg text-parchment-light",children:"Your reaction time:"}),(0,Ai.jsxs)("p",{className:"text-3xl font-bold ".concat(l?"text-green-400":"text-red-400"),children:[s,"ms"]}),(0,Ai.jsx)("p",{className:"text-sm text-text-secondary",children:l?"\u26a1 Excellent!":"\u23f1\ufe0f Too slow..."})]}),(0,Ai.jsx)(Wu.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.15},children:(0,Ai.jsx)(Ii,{onClick:()=>{if("result"!==r&&"tooEarly"!==r)if("waiting"!==r){if("go"===r&&null!==d.current){const e=Date.now()-d.current;h(e<=500,e)}}else h(!1,null)},variant:"epic",className:"w-full py-6 text-lg",children:"go"===r?"CLICK!":"Wait for GO!"})})]})};Vd.displayName="ReactionGame";const Wd=e=>{let{onSuccess:t,onFail:n}=e;const[r,o]=(0,i.useState)(()=>(()=>{const e=Math.floor(3*Math.random());return[{id:0,hasRing:0===e,revealed:!1},{id:1,hasRing:1===e,revealed:!1},{id:2,hasRing:2===e,revealed:!1}]})()),[s,a]=(0,i.useState)(!1),[l,c]=(0,i.useState)(!1),[u,d]=(0,i.useState)(0);return(0,Ai.jsxs)("div",{className:"space-y-6",children:[(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center",children:[(0,Ai.jsx)("h3",{className:"text-xl font-epic text-gold-dark mb-2",children:"\ud83c\udfc6 Find the Ring"}),(0,Ai.jsx)("p",{className:"text-sm text-text-secondary",children:s?"Wrong guesses: ".concat(u,"/").concat(3):"Test your luck!"}),s&&(0,Ai.jsx)("p",{className:"text-xs text-text-secondary mt-1",children:"Two wrong guesses are allowed. The third wrong pick fails the challenge."})]}),s?(0,Ai.jsxs)(Wu.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[l&&(0,Ai.jsx)(Wu.div,{animate:{x:[0,10,-10,0]},transition:{duration:.3,repeat:1/0},className:"text-center text-yellow-400 font-semibold",children:"Shuffling..."}),(0,Ai.jsx)("div",{className:"flex justify-center gap-4 sm:gap-6",children:r.map(e=>(0,Ai.jsx)(Wu.button,{type:"button","aria-label":"Cup ".concat(e.id+1),onClick:()=>(e=>{const i=r[e];if(l||i.revealed)return;if(o(t=>t.map(t=>t.id===e?Be(Be({},t),{},{revealed:!0}):t)),i.hasRing)return void window.setTimeout(()=>{t()},700);const s=u+1;d(s),s>=3?window.setTimeout(()=>{n()},900):window.setTimeout(()=>{o(t=>t.map(t=>t.id===e?Be(Be({},t),{},{revealed:!1}):t))},800)})(e.id),disabled:l||e.revealed,whileHover:l||e.revealed?{}:{scale:1.04,y:-4},whileTap:l||e.revealed?{}:{scale:.96},className:"rounded-lg p-4 text-6xl sm:text-7xl transition-all duration-300 ".concat(e.revealed?e.hasRing?"bg-green-600 cursor-default":"bg-red-600 cursor-default":"bg-forest hover:bg-forest-light cursor-pointer"," ").concat(l?"cursor-default":""),children:(0,Ai.jsx)(Wu.div,{animate:e.revealed?{rotateY:180}:{rotateY:0},transition:{duration:.35},children:e.revealed?e.hasRing?"\ud83d\udc8d":"\u2205":"\ud83c\udffa"})},e.id))}),u>0&&!r.some(e=>e.revealed&&e.hasRing)&&(0,Ai.jsxs)(Wu.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-red-400 font-semibold",children:["\u2717 Wrong cup! Try again... (",u,"/",3,")"]}),r.some(e=>e.revealed&&e.hasRing)&&(0,Ai.jsx)(Wu.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"text-center text-green-400 font-semibold text-lg",children:"\u2713 Found the ring!"})]}):(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center space-y-4",children:[(0,Ai.jsx)("p",{className:"text-parchment-light",children:"Watch the cups as they shuffle. Can you find the ring?"}),(0,Ai.jsx)("div",{className:"flex justify-center gap-4 text-5xl",children:[0,1,2].map(e=>(0,Ai.jsx)(Wu.div,{initial:{y:0},animate:{y:-10},transition:{duration:.5,repeat:1/0,repeatType:"reverse"},children:"\ud83c\udffa"},e))}),(0,Ai.jsx)(Ii,{onClick:async()=>{a(!0),c(!0),await new Promise(e=>setTimeout(e,1200)),c(!1)},variant:"epic",className:"w-full",children:"Start Shuffling"})]})]})};Wd.displayName="FindTheRingGame";const Hd=e=>{let{isOpen:t,onClose:n,onComplete:r,questId:o,questTitle:s}=e;const[a,l]=(0,i.useState)(null),[c,u]=(0,i.useState)(!1),[d,h]=(0,i.useState)(!1),[p,f]=(0,i.useState)(!1),[m,g]=(0,i.useState)(!1),[v,y]=(0,i.useState)(0),_=(0,i.useCallback)(()=>{null===a&&(l((()=>{const e=["trivia","memory","reaction","findring"];return e[Math.floor(Math.random()*e.length)]})()),y(0))},[a]),b=(0,i.useCallback)(()=>{a&&Oi.trackGameCompleted(a),u(!0)},[a]),x=(0,i.useCallback)(()=>{a&&Oi.trackGameFailed(a),h(!0)},[a]),w=(0,i.useCallback)(()=>{h(!1),f(!0),setTimeout(()=>{u(!1),y(e=>e+1),f(!1)},300)},[]),k=(0,i.useCallback)(async()=>{g(!0);try{await r(o),u(!1),l(null),y(0),g(!1),n()}catch(e){console.error("Failed to complete quest:",e),g(!1)}},[o,r,n]);i.useEffect(()=>{t?_():(u(!1),h(!1),f(!1),g(!1),l(null),y(0))},[t,_]);let S=null;return c?S=(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"space-y-6 text-center",children:[(0,Ai.jsx)(Wu.div,{animate:{scale:[1,1.1,1]},transition:{duration:.6,repeat:1/0},className:"text-6xl",children:"\u2728"}),(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)("h4",{className:"text-2xl font-epic text-gold-dark mb-2",children:"Quest Complete!"}),(0,Ai.jsx)("p",{className:"text-parchment-light mb-4",children:"You have overcome the challenge."}),(0,Ai.jsxs)("p",{className:"text-sm text-text-secondary italic",children:['"',s,'"']})]}),(0,Ai.jsx)(Ii,{onClick:k,isLoading:m,variant:"epic",className:"w-full",children:"\ud83d\udcb0 Claim Reward"})]},"reward"):d?S=(0,Ai.jsxs)(Wu.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"space-y-6 text-center",children:[(0,Ai.jsx)("div",{className:"text-6xl",children:"\ud83d\udc80"}),(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)("h4",{className:"text-2xl font-epic text-red-600 mb-2",children:"Challenge Failed!"}),(0,Ai.jsx)("p",{className:"text-parchment-light mb-4",children:"The darkness prevails... for now."})]}),(0,Ai.jsx)(Ii,{onClick:w,variant:"epic",className:"w-full",children:"\ud83d\udd04 Try Again"})]},"failed"):p?S=(0,Ai.jsx)(Wu.div,{initial:{opacity:1},animate:{opacity:.5},transition:{duration:.3},className:"text-center",children:(0,Ai.jsx)("p",{className:"text-parchment-light",children:"Resetting challenge..."})}):"trivia"===a?S=(0,Ai.jsx)(Fd,{onSuccess:b,onFail:x},"trivia-".concat(v)):"memory"===a?S=(0,Ai.jsx)(qd,{onSuccess:b,onFail:x},"memory-".concat(v)):"reaction"===a?S=(0,Ai.jsx)(Vd,{onSuccess:b,onFail:x},"reaction-".concat(v)):"findring"===a&&(S=(0,Ai.jsx)(Wd,{onSuccess:b,onFail:x},"findring-".concat(v))),(0,Ai.jsxs)(td,{isOpen:t,onClose:n,title:"\u2694\ufe0f Quest Challenge",size:"full",className:"w-full",children:[(0,Ai.jsxs)("div",{"aria-hidden":"true",style:{position:"absolute",top:"-9999px",left:"-9999px"},children:[(0,Ai.jsx)("button",{"data-testid":"force-game-win",onClick:b,tabIndex:-1,type:"button",children:"Force Win"}),(0,Ai.jsx)("button",{"data-testid":"force-game-fail",onClick:x,tabIndex:-1,type:"button",children:"Force Fail"})]}),(0,Ai.jsx)(ed,{mode:"wait",children:(0,Ai.jsx)(Wu.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3},children:S},"".concat(a,"-").concat(v))})]})},Zd=e=>{var t;let{user:n,onLogout:r}=e;const o=ne(),[s,a]=(0,i.useState)([]),[l,c]=(0,i.useState)([]),[u,d]=(0,i.useState)([]),[h,p]=(0,i.useState)(!0),[f,m]=(0,i.useState)(!1),[g,v]=(0,i.useState)(),[y,_]=(0,i.useState)(),[b,x]=(0,i.useState)(null),[w,k]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),[L,E]=(0,i.useState)(n.gold||0),[P,T]=(0,i.useState)(!1),[j,N]=(0,i.useState)(null),[O,M]=(0,i.useState)(null);(0,i.useEffect)(()=>{A()},[]),(0,i.useEffect)(()=>{const e=new URLSearchParams(o.search),t=e.get("status");t&&x(t);if("1"===e.get("propose")){const t=e.get("seedType"),n=e.get("seedPriority"),i=e.get("seedLocationId"),r=["Critical","Important","Standard"],o=["The Journey","The Battle","The Fellowship","The Ring","Dark Magic"].includes(t)?t:"The Journey",s=r.includes(n)?n:"Important",a=i?Number(i):void 0;v(void 0),_({title:e.get("seedTitle")||"Scout the frontier",description:e.get("seedDescription")||"Investigate the region and report meaningful leads.",status:"not_yet_begun",quest_type:o,priority:s,location_id:Number.isNaN(a)?void 0:a}),m(!0)}},[o.search]),(0,i.useEffect)(()=>{var e;if(null!==(e=o.state)&&void 0!==e&&e.selectedQuestId&&s.length>0){const e=s.find(e=>e.id===o.state.selectedQuestId);e&&(v(e),m(!0))}},[null===(t=o.state)||void 0===t?void 0:t.selectedQuestId,s]),(0,i.useEffect)(()=>{if(0===s.length)return;const e=new URLSearchParams(o.search).get("focusQuestId");if(!e)return;const t=Number(e);if(!t||Number.isNaN(t))return;const n=s.find(e=>e.id===t);n&&(v(n),m(!0))},[o.search,s]);const A=async()=>{try{const[e,t,n]=await Promise.all([ci.getQuests(),ci.getLocations(),ci.getMembers()]);a(e),c(t),d(n);const i=await ci.getGoldBalance();E(i)}catch(e){console.error("Failed to load data:",e)}finally{p(!1)}};(0,i.useEffect)(()=>{if(!O)return;const e=window.setTimeout(()=>{M(null)},5e3);return()=>window.clearTimeout(e)},[O]);return h?(0,Ai.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,Ai.jsxs)("div",{className:"text-center",children:[(0,Ai.jsx)("div",{className:"text-4xl mb-4",children:"\ud83d\udcdc"}),(0,Ai.jsx)("p",{className:"text-text-primary font-readable",children:"Unfurling the Scrolls of Middle-earth..."})]})}):(0,Ai.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,Ai.jsx)(Md,{page:"quests",gold:L,completedQuests:s.filter(e=>"it_is_done"===e.status).length,averageSavings:null,onLogout:r}),(0,Ai.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[O&&(0,Ai.jsx)("div",{className:"fixed right-4 top-24 z-[60] w-full max-w-md",children:(0,Ai.jsx)(Gu,{variant:O.variant,title:O.title,onClose:()=>M(null),className:"shadow-2xl backdrop-blur",children:O.message})}),(0,Ai.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,Ai.jsx)("div",{children:(0,Ai.jsxs)("p",{className:"font-readable text-text-muted text-lg",children:["All ",s.length," quest objectives across the realm"]})}),(0,Ai.jsx)(Ii,{onClick:()=>{v(void 0),_(void 0),m(!0)},variant:"epic",children:"\ud83d\uddc2\ufe0f Propose a Quest"})]}),(0,Ai.jsx)(Bd,{quests:s,locations:l,onStatusChange:x,onTypeChange:C,onLocationChange:k,selectedStatus:b,selectedType:S,selectedLocation:w}),(0,Ai.jsx)("div",{"data-tour":"quests-overview",children:(0,Ai.jsx)(Id,{quests:s.filter(e=>(!b||e.status===b)&&(!S||e.quest_type===S)&&(!w||e.location_id===w)),onEdit:e=>{v(e),_(void 0),m(!0)},onDelete:async e=>{window.confirm("Are you sure you want to abandon this quest?")&&(await ci.deleteQuest(e),await A())},onComplete:async e=>{const t=s.find(t=>t.id===e);t&&(N(t),T(!0))}})})]}),f&&(0,Ai.jsx)(zd,{quest:g||y,locations:l,members:u,onSubmit:async e=>{g?await(async e=>{g&&(await ci.updateQuest(g.id,e),await A(),v(void 0),_(void 0))})(e):await(async e=>{await ci.createQuest(e),await A(),m(!1),_(void 0)})(e)},onCancel:()=>{m(!1),v(void 0),_(void 0)}}),j&&(0,Ai.jsx)(Hd,{isOpen:P,onClose:()=>{T(!1),N(null)},onComplete:async e=>{try{const t=await ci.completeQuest(e);void 0!==t.current_gold&&E(t.current_gold),M({title:"Quest reward claimed",message:t.message+(t.character_quote?' \u2014 "'.concat(t.character_quote,'"'):""),variant:"success"}),await A()}catch(t){console.error("Failed to complete quest:",t),M({title:"Quest completion failed",message:"The shadow may have fallen upon it. Please try again.",variant:"error"})}},questId:j.id,questTitle:j.title})]})};const Gd=(0,i.createContext)(null),Qd=Gd.Provider;function Yd(){const e=(0,i.useContext)(Gd);if(null==e)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function Kd(){return Yd().map}var $d=n(228),Xd=n.n($d);const Jd=["bounds","boundsOptions","center","children","className","id","placeholder","style","whenReady","zoom"];function eh(){return eh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},eh.apply(this,arguments)}function th(e,t){let{bounds:n,boundsOptions:r,center:o,children:s,className:a,id:l,placeholder:c,style:u,whenReady:d,zoom:h}=e,p=Mi(e,Jd);const[f]=(0,i.useState)({className:a,id:l,style:u}),[m,g]=(0,i.useState)(null);(0,i.useImperativeHandle)(t,()=>{var e;return null!==(e=null===m||void 0===m?void 0:m.map)&&void 0!==e?e:null},[m]);const v=(0,i.useCallback)(e=>{if(null!==e&&null===m){const t=new $d.Map(e,p);null!=o&&null!=h?t.setView(o,h):null!=n&&t.fitBounds(n,r),null!=d&&t.whenReady(d),g(function(e){return Object.freeze({__version:1,map:e})}(t))}},[]);(0,i.useEffect)(()=>()=>{null===m||void 0===m||m.map.remove()},[m]);const y=m?i.createElement(Qd,{value:m},s):null!==c&&void 0!==c?c:null;return i.createElement("div",eh({},f,{ref:v}),y)}const nh=(0,i.forwardRef)(th);function ih(e){return function(t){const n=Yd(),r=e(function(e,t){var n;const i=null!==(n=e.pane)&&void 0!==n?n:t.pane;return i?Be(Be({},e),{},{pane:i}):e}(t,n),n);return function(e,t){const n=(0,i.useRef)(t);(0,i.useEffect)(function(){t!==n.current&&null!=e.attributionControl&&(null!=n.current&&e.attributionControl.removeAttribution(n.current),null!=t&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}(n.map,t.attribution),function(e,t){const n=(0,i.useRef)();(0,i.useEffect)(function(){return null!=t&&e.instance.on(t),n.current=t,function(){null!=n.current&&e.instance.off(n.current),n.current=null}},[e,t])}(r.current,t.eventHandlers),function(e,t){(0,i.useEffect)(function(){var n;return(null!==(n=t.layerContainer)&&void 0!==n?n:t.map).addLayer(e.instance),function(){var n;null===(n=t.layerContainer)||void 0===n||n.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}(r.current,n),r}}const rh=["bounds","url"],oh=function(e){function t(t,n){const{instance:r,context:o}=e(t).current;return(0,i.useImperativeHandle)(n,()=>r),null==t.children?null:i.createElement(Qd,{value:o},t.children)}return(0,i.forwardRef)(t)}(ih(function(e,t){return null==t?function(t,n){const r=(0,i.useRef)();return r.current||(r.current=e(t,n)),r}:function(n,r){const o=(0,i.useRef)();o.current||(o.current=e(n,r));const s=(0,i.useRef)(n),{instance:a}=o.current;return(0,i.useEffect)(function(){s.current!==n&&(t(a,n,s.current),s.current=n)},[a,n,r]),o}}(function(e,t){let{bounds:n,url:i}=e,r=Mi(e,rh);const o=new $d.ImageOverlay(i,n,r);return s=o,c=t,u={overlayContainer:o},a=Object.freeze(Be(Be({},c),u)),Object.freeze({instance:s,context:a,container:l});var s,a,l,c,u},function(e,t,n){if(function(e,t,n){t.bounds instanceof $d.LatLngBounds&&t.bounds!==n.bounds&&e.setBounds(t.bounds),null!=t.opacity&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),null!=t.zIndex&&t.zIndex!==n.zIndex&&e.setZIndex(t.zIndex)}(e,t,n),t.bounds!==n.bounds){const n=t.bounds instanceof $d.LatLngBounds?t.bounds:new $d.LatLngBounds(t.bounds);e.setBounds(n)}t.url!==n.url&&e.setUrl(t.url)})));n(260);function sh(e){return e._icon||null}const ah=n(24),lh=n(71),ch=Xd().icon({iconUrl:ah.default||ah,shadowUrl:lh.default||lh,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});function uh(e){return{"The Journey":"\ud83e\udded","The Battle":"\u2694\ufe0f","The Fellowship":"\ud83d\udc65","The Ring":"\ud83d\udc8d","Dark Magic":"\ud83d\udc41\ufe0f"}[e||""]||"\ud83d\udcdc"}Xd().Marker.prototype.options.icon=ch;const dh=[{id:"frodo",name:"Frodo",emoji:"\ud83e\udddd",map_x:1482,map_y:1158,title:"Sentimental Seller"},{id:"sam",name:"Sam",emoji:"\ud83d\udc68\u200d\ud83c\udf3e",map_x:2589,map_y:2383,title:"Friendly Bargainer"},{id:"gandalf",name:"Gandalf",emoji:"\ud83e\uddd9\u200d\u2642\ufe0f",map_x:2516,map_y:1123,title:"Mystic Merchant"}];function hh(e){let{bounds:t,initialFit:n}=e;const r=Kd();return(0,i.useEffect)(()=>{n&&r&&r.setView([2172,2500],-1,{animate:!1})},[r,n]),null}function ph(e){let{locationId:t,locations:n,convertToLatLng:r,onFocused:o}=e;const s=Kd(),a=(0,i.useRef)();return(0,i.useEffect)(()=>{if(t&&t!==a.current){const e=n.find(e=>e.id===t);if(e&&void 0!==e.map_x&&void 0!==e.map_y){const[n,i]=r(e.map_x,e.map_y);s.setView([n,i],0,{animate:!0,duration:.5}),a.current=t,o&&setTimeout(()=>o(),600)}}},[s,t,n,r,o]),(0,i.useEffect)(()=>{const e=[[0,0],[4344,5e3]],t=Xd().latLngBounds(e[0],e[1]);s.setMaxBounds(t)},[s]),null}function fh(e){let{quests:t,locations:n,selectedQuestId:r,convertToLatLng:o,onQuestClick:s,onCompleteQuest:a}=e;const l=Kd(),c=(0,i.useRef)(null),u=(0,i.useMemo)(()=>{const e=t.filter(e=>e.location_id);return t.length>0&&e.length<t.length&&console.warn("\u26a0 ".concat(t.length-e.length," quest(s) of ").concat(t.length," total without location_id will not be displayed on the map.")),e.reduce((e,t)=>(t.location_id&&(e[t.location_id]||(e[t.location_id]=[]),e[t.location_id].push(t)),e),{})},[t]);return(0,i.useEffect)(()=>{if(!l||!l.getContainer())return;let e=0;const i=()=>{if(!(()=>{const e=l.getContainer();if(!e)return!1;if(!l.getSize||0===l.getSize().x)return!1;const t=e.querySelector("img.leaflet-image-layer");return!!(t&&t instanceof HTMLImageElement&&t.complete)})()){if(e++,e<20)return void setTimeout(i,100);console.warn("\u26a0 Map not ready after max retries, adding markers anyway")}c.current&&(l.removeLayer(c.current),c.current=null);const d=Xd().markerClusterGroup({maxClusterRadius:50,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0,iconCreateFunction:e=>{const t=e.getChildCount(),n=t<10?"small":t<50?"medium":"large";return Xd().divIcon({html:'<div class="quest-marker-cluster quest-marker-cluster-'.concat(n,'"><span>').concat(t,"</span></div>"),className:"quest-marker-cluster-icon",iconSize:"small"===n?[35,35]:"medium"===n?[45,45]:[55,55]})}});Object.entries(u).forEach(e=>{let[t,i]=e;const a=parseInt(t,10),l=n.find(e=>e.id===a);if(l&&void 0!==l.map_x&&void 0!==l.map_y){const[e,t]=o(l.map_x,l.map_y);i.forEach((o,a)=>{var l;const[c,u]=function(e,t){if(1===t)return[0,0];const n=2*Math.PI*e/t;return[30*Math.sin(n),30*Math.cos(n)]}(a,i.length),[h,p]=[e+c,t+u],f=r===o.id,m=Xd().divIcon({className:"quest-marker-icon",html:'\n <div class="quest-marker '.concat(f?"quest-marker-selected":"",'" \n style="background-color: ').concat(f?"#DAA520":"#8B4513",'; pointer-events: auto;"\n data-testid="quest-marker"\n data-quest-id="').concat(o.id,'"\n data-quest-title="').concat(o.title.replace(/"/g,"""),'">\n <div class="quest-marker-inner">').concat(uh(o.quest_type),"</div>\n </div>\n "),iconSize:[35,35],iconAnchor:[17,17],popupAnchor:[0,-17]}),g=Xd().marker([h,p],{icon:m,interactive:!0,keyboard:!0,title:o.title,riseOnHover:!0,bubblingMouseEvents:!1}),v=(null===(l=n.find(e=>e.id===o.location_id))||void 0===l?void 0:l.name)||"Unknown",y='\n <div class="quest-popup" data-testid="marker-popup">\n <h4>'.concat(o.title,"</h4>\n ").concat(o.quest_type?'<p class="quest-popup-type"><strong>'.concat(uh(o.quest_type)," ").concat(o.quest_type,"</strong>").concat(o.priority?" - ".concat(o.priority):"","</p>"):"",'\n <p class="quest-popup-status">').concat((_=o.status,{not_yet_begun:"Not Yet Begun",the_road_goes_ever_on:"The Road Goes Ever On...",it_is_done:"It Is Done",the_shadow_falls:"The Shadow Falls",pending:"Not Yet Begun",in_progress:"The Road Goes Ever On...",completed:"It Is Done",blocked:"The Shadow Falls"}[_]||String(_).replace(/_/g," ")),"</p>\n ").concat(o.description?'<p class="quest-popup-description">'.concat(o.description,"</p>"):"","\n ").concat(v?'<p class="quest-popup-location">\ud83d\udccd '.concat(v,"</p>"):"","\n ").concat(o.assignee_name?'<p class="quest-popup-assignee">\ud83d\udc64 Assigned to: '.concat(o.assignee_name,"</p>"):"",'\n <div class="quest-popup-actions">\n <button class="btn-view-quest" onclick="window.questClickHandler && window.questClickHandler(').concat(o.id,')">\n View Quest\n </button>\n ').concat("it_is_done"!==o.status&&"completed"!==o.status?'\n <button class="btn-complete-quest" onclick="window.completeQuestHandler && window.completeQuestHandler('.concat(o.id,')">\n Complete Quest\n </button>\n '):"","\n </div>\n </div>\n ");var _;g.bindPopup(y,{maxWidth:350,className:"quest-popup-wrapper",autoPan:!0,autoPanPadding:[50,50],closeOnClick:!1,autoClose:!1,keepInView:!0}),g.on("click",e=>{e.originalEvent&&(e.originalEvent.stopPropagation(),e.originalEvent.stopImmediatePropagation()),g.openPopup(),s&&s(o.id)}),g.on("mouseover",()=>{const e=sh(g);e&&(e.style.zIndex="3000")}),g.on("mouseout",()=>{const e=sh(g);e&&(e.style.zIndex="2000")}),d.addLayer(g)})}}),d.addTo(l),c.current=d,s&&(window.questClickHandler=s),a&&(window.completeQuestHandler=a);const h=Object.values(u).flat().length,p=t.length,f=t.filter(e=>e.location_id).length;h>0?(console.log("\u2713 Quest Markers: Added ".concat(h," clustered quest markers (").concat(p," total quests, ").concat(f," with locations)")),console.log(" Quest locations: ".concat(Object.keys(u).join(", ")))):p>0?(console.warn("\u26a0 No quest markers displayed: ".concat(p," total quests found, but only ").concat(f," have location_id")),console.warn(" Ensure all quests have a valid location_id assigned")):console.debug("\u2139 No quests to display on map")};return i(),()=>{c.current&&(l.removeLayer(c.current),c.current=null),delete window.questClickHandler,delete window.completeQuestHandler}},[l,u,n,r,o,s,a]),null}function mh(e,t){const n=t?"#DAA520":"#8B4513";return Xd().divIcon({className:"location-marker-icon",html:'\n <div class="location-marker" style="background-color: '.concat(n,';">\n <div class="marker-pin-inner"></div>\n ').concat(e>0?'<div class="quest-count-badge"><span>'.concat(e,"</span></div>"):"","\n </div>\n "),iconSize:[40,50],iconAnchor:[20,50],popupAnchor:[0,-50]})}function gh(e){let{locations:t,questsByLocation:n,selectedLocationId:r,convertToLatLng:o,onLocationClick:s}=e;const a=Kd(),l=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!a||!a.getContainer())return;let e=0;const i=()=>{if(!(()=>{const e=a.getContainer();if(!e)return!1;if(!a.getSize||0===a.getSize().x)return!1;const t=e.querySelector("img.leaflet-image-layer");return!!(t&&t instanceof HTMLImageElement&&t.complete)})()){if(e++,e<20)return void setTimeout(i,100);console.warn("Map not ready after max retries, adding location markers anyway")}l.current&&(a.removeLayer(l.current),l.current=null);const c=Xd().markerClusterGroup({maxClusterRadius:50,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0,iconCreateFunction:e=>{const t=e.getChildCount();return Xd().divIcon({html:'<div class="marker-cluster">'.concat(t,"</div>"),className:"marker-cluster-icon",iconSize:Xd().point(40,40)})}});t.filter(e=>void 0!==e.map_x&&void 0!==e.map_y).forEach(e=>{const[t,i]=o(e.map_x,e.map_y),a=r===e.id,l=n[e.id]||0,u=Xd().marker([t,i],{icon:mh(l,a)}),d='\n <div class="location-popup">\n <h3>'.concat(e.name,'</h3>\n <p class="location-region">').concat(e.region,"</p>\n ").concat(e.description?'<p class="location-description">'.concat(e.description,"</p>"):"","\n ").concat(l>0?'<p class="quest-count-info"><strong>'.concat(l,"</strong> quest").concat(1!==l?"s":""," at this location</p>"):"",'\n <button class="btn-view-quests" onclick="window.locationClickHandler && window.locationClickHandler(').concat(e.id,')">\n View Quests Here\n </button>\n </div>\n ');u.bindPopup(d),u.on("click",()=>{s(e.id)}),c.addLayer(u)}),c.addTo(a),l.current=c,window.locationClickHandler=s;const u=t.filter(e=>void 0!==e.map_x&&void 0!==e.map_y).length;u>0?console.log("\u2713 Added ".concat(u," location markers to map")):console.warn("\u26a0 No location markers to display - ensure locations have map_x and map_y coordinates")};return i(),()=>{l.current&&(a.removeLayer(l.current),l.current=null),delete window.locationClickHandler}},[a,t,n,r,o,s]),null}function vh(e){let{convertToLatLng:t,onCharacterClick:n}=e;const r=Kd(),o=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!r||!n)return;o.current&&r.removeLayer(o.current);const e=Xd().layerGroup();return dh.forEach(i=>{const[r,o]=t(i.map_x,i.map_y);console.log("Character Marker: ".concat(i.name," (").concat(i.id,") at map_x=").concat(i.map_x,", map_y=").concat(i.map_y," -> lat=").concat(r,", lng=").concat(o));const s=Xd().divIcon({className:"character-marker-icon",html:'<div class="character-marker" data-character="'.concat(i.id,'" data-testid="seller-marker" data-seller-id="').concat(i.id,'" style="cursor: pointer;">').concat(i.emoji,"</div>"),iconSize:[40,40],iconAnchor:[20,20]}),a=Xd().marker([r,o],{icon:s,title:"".concat(i.name," - ").concat(i.title),interactive:!0});a.bindPopup('<div class="character-popup" data-testid="marker-popup">\n <h4>'.concat(i.emoji," ").concat(i.name,"</h4>\n <p>").concat(i.title,'</p>\n <button class="btn-bargain-character" data-testid="popup-action-button" onclick="window.characterBargainHandler && window.characterBargainHandler(\'').concat(i.id,"')\">Start Bargain</button>\n </div>")),a.on("click",()=>{a.openPopup(),n(i.id)}),e.addLayer(a)}),e.addTo(r),o.current=e,window.characterBargainHandler=n,()=>{o.current&&(r.removeLayer(o.current),o.current=null),delete window.characterBargainHandler}},[r,t,n]),null}const yh=e=>{let{locations:t,quests:n,selectedLocationId:r,selectedQuestId:o,onLocationClick:s,onQuestClick:a,onCompleteQuest:l,onCharacterClick:c,focusLocationId:u,zoomToLocation:d,onFocusComplete:h}=e;const p=[[0,0],[4344,5e3]],f=(e,t)=>[p[1][0]-t,e],m=(0,i.useMemo)(()=>n.reduce((e,t)=>(t.location_id&&(e[t.location_id]=(e[t.location_id]||0)+1),e),{}),[n]),[g,v]=i.useState(!0);return(0,i.useEffect)(()=>{v(!1)},[]),(0,Ai.jsx)("div",{className:"middle-earth-map-container",children:(0,Ai.jsxs)(nh,{center:[2172,2500],zoom:-1,style:{height:"100%",width:"100%"},crs:Xd().CRS.Simple,minZoom:-2,maxZoom:2,scrollWheelZoom:!0,zoomControl:!0,attributionControl:!1,dragging:!0,boxZoom:!0,children:[(0,Ai.jsx)(oh,{url:"/middle-earth-map.webp",bounds:p,opacity:1}),(0,Ai.jsx)(hh,{bounds:Xd().latLngBounds(p[0],p[1]),initialFit:g}),(0,Ai.jsx)(ph,{locationId:d||u,locations:t,convertToLatLng:f,onFocused:h}),(0,Ai.jsx)(gh,{locations:t,questsByLocation:m,selectedLocationId:r,convertToLatLng:f,onLocationClick:s}),(0,Ai.jsx)(vh,{convertToLatLng:f,onCharacterClick:c}),(0,Ai.jsx)(fh,{quests:n,locations:t,selectedQuestId:o,convertToLatLng:f,onQuestClick:a,onCompleteQuest:l})]})})},_h={frodo:{name:"Frodo",emoji:"\ud83e\udddd"},sam:{name:"Sam",emoji:"\ud83d\udc68\u200d\ud83c\udf3e"},gandalf:{name:"Gandalf",emoji:"\ud83e\uddd9\u200d\u2642\ufe0f"}},bh=e=>{const t=[],n=/\*\*(.+?)\*\*/g;let i=0,r=n.exec(e);for(;r;)r.index>i&&t.push(e.slice(i,r.index)),t.push((0,Ai.jsx)("strong",{children:r[1]},"bold-".concat(r.index))),i=r.index+r[0].length,r=n.exec(e);return i<e.length&&t.push(e.slice(i)),t},xh=e=>{if("markdown"!==e.format)return e.content;const t=e.content.split("\n"),n=[];let i=[];const r=()=>{if(0===i.length)return;const e="list-".concat(n.length);n.push((0,Ai.jsx)("ul",{className:"list-disc pl-5 space-y-1",children:i.map((t,n)=>(0,Ai.jsx)("li",{children:bh(t)},"".concat(e,"-").concat(n)))},e)),i=[]};return t.forEach((e,o)=>{const s=e.trim();if(s){if(s.startsWith("- "))return i.push(s.slice(2).trim()),void(o===t.length-1&&r());r(),n.push((0,Ai.jsx)("p",{className:"leading-relaxed",children:bh(s)},"p-".concat(o)))}else r()}),r(),(0,Ai.jsx)("div",{className:"space-y-1",children:n})},wh=e=>e.some(e=>{var t;return"shop-catalog"===(null===(t=e.metadata)||void 0===t?void 0:t.kind)})?e.filter(e=>{var t;return"opener"!==(null===(t=e.metadata)||void 0===t?void 0:t.kind)}):e,kh=e=>{let{onClose:t,onGoldChange:n}=e;const{activeCharacter:r,setActiveCharacter:o,isChatLoading:s,chatMessages:a,setChatMessages:l,setChatLoading:c}=wd(),[u,d]=(0,i.useState)(""),[h,p]=(0,i.useState)([]),[f,m]=(0,i.useState)(""),g=(0,i.useCallback)(e=>{null===n||void 0===n||n(e)},[n]),[v,y]=(0,i.useState)(null),_=(0,i.useMemo)(()=>_h[r],[r]);(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{var t,n;y(null),c(!0);const s=await ci.getNpcChatSession(r);if(!e)return;let a=wh(s.messages||[]);l(a),void 0!==(null===(t=s.balance)||void 0===t?void 0:t.gold)&&g(s.balance.gold),null!==(n=s.negotiation)&&void 0!==n&&n.status&&m(s.negotiation.status);if(!a.some(e=>{var t;return"shop-catalog"===(null===(t=e.metadata)||void 0===t?void 0:t.kind)})){var i,o;const t=await ci.sendNpcMessage(r,"shop");if(!e)return;l(wh(t.messages||[])),void 0!==(null===(i=t.balance)||void 0===i?void 0:i.gold)&&g(t.balance.gold),null!==(o=t.negotiation)&&void 0!==o&&o.status&&m(t.negotiation.status),t.shop_items&&p(t.shop_items)}}catch(s){if(!e)return;y("The trader is gathering wares. Try again in a moment.")}finally{e&&c(!1)}})(),()=>{e=!1}},[r,c,l,g]),(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{const[t,n]=await Promise.all([ci.getShopItems(r),ci.getGoldBalance()]);if(!e)return;p(t),g(n)}catch(t){if(!e)return;p([])}})(),()=>{e=!1}},[r,g]);const b=async()=>{const e=u.trim();e&&(d(""),await(async e=>{const t=e.trim();if(t)try{var n,i;y(null),c(!0);const e=await ci.sendNpcMessage(r,t);if(l(wh(e.messages||[])),void 0!==(null===(n=e.balance)||void 0===n?void 0:n.gold)&&g(e.balance.gold),null!==(i=e.negotiation)&&void 0!==i&&i.status&&m(e.negotiation.status),e.shop_items)p(e.shop_items);else{const e=await ci.getShopItems(r);p(e)}}catch(o){y("The character did not answer. Try sending again.")}finally{c(!1)}})(e))},x=i.useRef(null);return(0,i.useEffect)(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight)},[a,s]),(0,Ai.jsxs)(Wu.aside,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},transition:{duration:.25},className:"bg-gradient-to-br from-parchment-light to-parchment border border-gold-dark/40 rounded-xl shadow-lg p-4 space-y-4 relative",children:[t&&(0,Ai.jsx)("button",{className:"absolute top-2 right-2 text-xl text-gold-dark hover:text-red-700 focus:outline-none bg-white/70 rounded-full w-8 h-8 flex items-center justify-center shadow",onClick:t,title:"Close","aria-label":"Close",children:"\xd7"}),(0,Ai.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ai.jsx)(id,{emoji:_.emoji,size:"lg"}),(0,Ai.jsxs)("div",{children:[(0,Ai.jsx)("h3",{className:"font-epic text-xl text-forest-dark",children:_.name}),(0,Ai.jsx)("p",{className:"text-xs text-text-secondary",children:"Trader Bargain"})]})]}),(0,Ai.jsx)("div",{className:"flex flex-wrap gap-2",children:["frodo","sam","gandalf"].map(e=>(0,Ai.jsxs)(Ii,{variant:e===r?"epic":"small",className:"text-xs",onClick:()=>o(e),children:[_h[e].emoji," ",_h[e].name]},e))}),(0,Ai.jsxs)("div",{className:"h-80 overflow-y-auto bg-white/50 rounded-lg border border-gold-dark/20 p-3 space-y-3","data-tour":"dialogue-panel","data-testid":"dialogue-panel",ref:x,children:[0===a.length&&!s&&(0,Ai.jsx)("p",{className:"text-sm text-text-secondary",children:"Start a bargain with your companion."}),a.map((e,t)=>{const n="assistant"===e.role&&/congratulations|sold|all wares are sold out|goodbye/i.test(e.content);return(0,Ai.jsx)("div",{className:"assistant"===e.role?"text-left":"text-right","data-testid":n?"sold-message":void 0,children:(0,Ai.jsx)("div",{className:"assistant"===e.role?"inline-block max-w-[92%] rounded-lg px-3 py-2 bg-parchment-dark/70 text-text-primary text-sm break-words".concat(n?" border-2 border-gold-dark font-bold bg-yellow-100/80":""):"inline-block max-w-[92%] rounded-lg px-3 py-2 bg-forest text-parchment-light text-sm break-words",children:xh(e)})},"".concat(e.role,"-").concat(t))}),s&&(0,Ai.jsxs)("p",{className:"text-xs text-text-secondary italic",children:[_.name," is thinking\u2026"]})]}),(0,Ai.jsxs)("div",{className:"space-y-2",children:[(0,Ai.jsx)("textarea",{value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),b())},rows:3,placeholder:"Reply to ".concat(_.name,"..."),className:"w-full rounded-lg border border-gold-dark/30 bg-white/70 px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-gold/50 resize-none"}),(0,Ai.jsx)("div",{className:"flex gap-2",children:(0,Ai.jsx)(Ii,{variant:"epic",className:"flex-1",onClick:b,disabled:s,children:"Send"})})]}),v&&(0,Ai.jsx)("p",{className:"text-xs text-red-700",children:v})]})};kh.displayName="MapCharacterPanel";const Sh=e=>{var t;let{user:n,onLogout:r}=e;const o=ne(),s=re(),[a,l]=(0,i.useState)([]),[c,u]=(0,i.useState)([]),[d,h]=(0,i.useState)(),[p,f]=(0,i.useState)(),[m,g]=(0,i.useState)(),[v,y]=(0,i.useState)(!0),[_,b]=(0,i.useState)(null),[x,w]=(0,i.useState)(window.innerWidth>1024),[k,S]=(0,i.useState)((null===n||void 0===n?void 0:n.gold)||0),[C,L]=(0,i.useState)(!1),E=xd(e=>e.setActiveCharacter),[P,T]=(0,i.useState)(["all"]),[j,N]=(0,i.useState)(["all"]),O=(0,i.useCallback)(async()=>{try{console.log("MapPage: Loading data...");const[e,t]=await Promise.all([ci.getQuests(),ci.getLocations()]);if(console.log("MapPage: Loaded ".concat(e.length," quests and ").concat(t.length," locations")),l(e),u(t),n){const e=await ci.getGoldBalance();S(e)}const i=await ci.getSutStatus();b(i)}catch(e){console.error("Failed to load data:",e)}finally{y(!1)}},[n]);(0,i.useEffect)(()=>{var e;O(),null!==(e=o.state)&&void 0!==e&&e.zoomToLocation&&g(o.state.zoomToLocation)},[O,null===(t=o.state)||void 0===t?void 0:t.zoomToLocation]),(0,i.useEffect)(()=>{var e;const t=new URLSearchParams(o.search),i=t.get("zoomToLocation"),r=t.get("selectedQuestId"),s=t.get("tourCharacterPanel");if(i){const e=Number(i);Number.isNaN(e)||g(e)}if(r){const e=Number(r);Number.isNaN(e)||h(e)}"1"===s&&n?(E("gandalf"),L(!0)):["frodo","sam","gandalf"].includes(null!==(e=null===s||void 0===s?void 0:s.toLowerCase())&&void 0!==e?e:"")&&n&&(E(s.toLowerCase()),L(!0))},[o.search,E,n]);const M=()=>{w(!x)},A=async e=>{if(n)try{await ci.completeQuest(e),h(e);const t=await ci.getGoldBalance();S(t),await O()}catch(t){console.error("Failed to complete quest from map:",t)}else s("/login")},R=(()=>{let e=a;return P.length>0&&!P.includes("all")&&(e=e.filter(e=>{return P.includes((t=e.status)?{pending:"not_yet_begun",in_progress:"the_road_goes_ever_on",completed:"it_is_done",blocked:"the_shadow_falls"}[t]||t:"");var t})),j.length>0&&!j.includes("all")&&(e=e.filter(e=>j.includes(e.quest_type||""))),e})(),I=a.find(e=>e.id===d),z=c.find(e=>e.id===p);return v?(0,Ai.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,Ai.jsx)("div",{className:"text-center",children:(0,Ai.jsx)("p",{className:"text-text-primary font-readable",children:"Charting the Map of Middle-earth..."})})}):(0,Ai.jsxs)("div",{className:"min-h-screen bg-background flex flex-col",children:[n?(0,Ai.jsx)(Md,{page:"map",gold:k,completedQuests:a.filter(e=>"it_is_done"===e.status).length,averageSavings:null,onLogout:r}):(0,Ai.jsx)("header",{className:"bg-gradient-to-r from-forest to-forest-dark shadow-lg border-b-2 border-gold",children:(0,Ai.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-4 flex items-center justify-between",children:[(0,Ai.jsx)("h1",{className:"font-epic text-2xl text-gold",children:"\ud83d\uddfa\ufe0f Middle-Earth Map"}),(0,Ai.jsx)(Ii,{onClick:()=>s("/login"),variant:"secondary",className:"text-sm",children:"Login / Sign up"})]})}),(0,Ai.jsxs)("div",{className:"bg-parchment-light border-b border-gold-dark/20 text-text-secondary text-sm px-4 py-2",children:["Last SUT restart: ",(0,Ai.jsx)("strong",{children:(e=>{if(!e)return"Unavailable";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()})(null===_||void 0===_?void 0:_.instance_boot_time_utc)})]}),(0,Ai.jsxs)("div",{className:"flex-1 map-page-container","data-testid":"map-container",children:[(0,Ai.jsxs)("aside",{className:"filter-sidebar ".concat(x?"open":"closed"),children:[(0,Ai.jsxs)("div",{className:"filter-sidebar-header",children:[(0,Ai.jsx)("h3",{children:"Filters"}),(0,Ai.jsx)("button",{className:"filter-close-btn",onClick:M,"aria-label":"Close filters",children:"\u2715"})]}),(0,Ai.jsxs)("div",{className:"filter-content",children:[(0,Ai.jsxs)("div",{className:"filter-section",children:[(0,Ai.jsx)("h4",{children:"Quest Status"}),(0,Ai.jsxs)("label",{className:"filter-checkbox",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:P.includes("all"),onChange:e=>{e.target.checked?T(["all"]):T([])}}),(0,Ai.jsx)("span",{children:"All"})]}),(0,Ai.jsxs)("label",{className:"filter-checkbox",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:P.includes("not_yet_begun"),onChange:e=>{const t=P.filter(e=>"all"!==e);e.target.checked?T([...t,"not_yet_begun"]):T(t.filter(e=>"not_yet_begun"!==e))}}),(0,Ai.jsx)("span",{style:{color:"#888"},children:"\u25cf Not Yet Begun"})]}),(0,Ai.jsxs)("label",{className:"filter-checkbox",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:P.includes("the_road_goes_ever_on"),onChange:e=>{const t=P.filter(e=>"all"!==e);e.target.checked?T([...t,"the_road_goes_ever_on"]):T(t.filter(e=>"the_road_goes_ever_on"!==e))}}),(0,Ai.jsx)("span",{style:{color:"#FF6B6B"},children:"\u25cf In Progress"})]}),(0,Ai.jsxs)("label",{className:"filter-checkbox",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:P.includes("it_is_done"),onChange:e=>{const t=P.filter(e=>"all"!==e);e.target.checked?T([...t,"it_is_done"]):T(t.filter(e=>"it_is_done"!==e))}}),(0,Ai.jsx)("span",{style:{color:"#51CF66"},children:"\u25cf Completed"})]}),(0,Ai.jsxs)("label",{className:"filter-checkbox",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:P.includes("the_shadow_falls"),onChange:e=>{const t=P.filter(e=>"all"!==e);e.target.checked?T([...t,"the_shadow_falls"]):T(t.filter(e=>"the_shadow_falls"!==e))}}),(0,Ai.jsx)("span",{style:{color:"#1A1A1A"},children:"\u25cf Failed"})]})]}),(0,Ai.jsxs)("div",{className:"filter-section",children:[(0,Ai.jsx)("h4",{children:"Quest Type"}),(0,Ai.jsxs)("label",{className:"filter-checkbox",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:j.includes("all"),onChange:e=>{e.target.checked?N(["all"]):N([])}}),(0,Ai.jsx)("span",{children:"All"})]}),Array.from(new Set(a.map(e=>e.quest_type).filter(Boolean))).map(e=>(0,Ai.jsxs)("label",{className:"filter-checkbox",children:[(0,Ai.jsx)("input",{type:"checkbox",checked:j.includes(e),onChange:t=>{const n=j.filter(e=>"all"!==e);t.target.checked?N([...n,e]):N(n.filter(t=>t!==e))}}),(0,Ai.jsx)("span",{children:e})]},e))]}),(0,Ai.jsxs)("div",{className:"filter-actions",children:[z&&(0,Ai.jsxs)("div",{className:"mb-3 text-sm text-amber-900 font-semibold",children:["Focused Location: ",z.name]}),(0,Ai.jsx)("button",{className:"btn btn-secondary btn-sm",onClick:()=>{T(["all"]),N(["all"]),h(void 0),f(void 0)},children:"Clear All"})]})]}),(0,Ai.jsxs)("div",{className:"filter-attribution",children:[(0,Ai.jsx)("p",{children:(0,Ai.jsx)("strong",{children:"Map Credit"})}),(0,Ai.jsxs)("p",{children:["Credits to Emil Johansson, creator of ",(0,Ai.jsx)("em",{children:"lotrproject.com"}),", for creating the map used in this website."]}),(0,Ai.jsx)("p",{children:"Created by Yohann Bethoule, 2022"})]})]}),(0,Ai.jsxs)("div",{className:"map-main-content",children:[(0,Ai.jsx)("button",{className:"filter-toggle-btn ".concat(x?"filter-open":""),onClick:M,title:"Toggle filters",children:"\u2630"}),(0,Ai.jsx)(yh,{locations:c,quests:R.filter(e=>e.location_id),selectedLocationId:p,selectedQuestId:d,zoomToLocation:m,onLocationClick:e=>{f(e)},onQuestClick:e=>{console.log("MapPage.handleQuestClick: Quest ID ".concat(e," clicked")),h(e)},onCompleteQuest:A,onCharacterClick:e=>{n?(E(e),L(!0)):s("/login")}}),C&&(0,Ai.jsx)("div",{className:"map-character-panel",children:(0,Ai.jsx)(kh,{onClose:()=>L(!1),onGoldChange:S})}),I&&(0,Ai.jsxs)("div",{className:"quest-details-card",children:[(0,Ai.jsxs)("div",{className:"quest-details-header",children:[(0,Ai.jsx)("h2",{children:I.title}),(0,Ai.jsx)("button",{className:"close-btn",onClick:()=>h(void 0),"aria-label":"Close quest details",children:"\u2715"})]}),(0,Ai.jsxs)("div",{className:"quest-details-body",children:[(0,Ai.jsxs)("div",{className:"quest-badges quest-badges-map",children:[I.quest_type&&(0,Ai.jsxs)("span",{className:"quest-type-badge quest-chip",title:I.quest_type,children:[(0,Ai.jsx)("span",{className:"quest-chip-icon","aria-hidden":"true",children:(D=I.quest_type,{"The Journey":"\ud83e\udded","The Battle":"\u2694\ufe0f","The Fellowship":"\ud83d\udc65","The Ring":"\ud83d\udc8d","Dark Magic":"\ud83d\udc41\ufe0f"}[D||""]||"\ud83d\udcdc")}),(0,Ai.jsx)("span",{className:"quest-chip-label",children:I.quest_type})]}),(0,Ai.jsx)("span",{className:"quest-status quest-status-".concat((B=I.status||"",{pending:"not_yet_begun",in_progress:"the_road_goes_ever_on",completed:"it_is_done",blocked:"the_shadow_falls"}[B]||B)," quest-chip"),children:(0,Ai.jsx)("span",{className:"quest-chip-label",children:(e=>({not_yet_begun:"Not Yet Begun",the_road_goes_ever_on:"The Road Goes Ever On...",it_is_done:"It Is Done",the_shadow_falls:"The Shadow Falls",pending:"Not Yet Begun",in_progress:"The Road Goes Ever On...",completed:"It Is Done",blocked:"The Shadow Falls"}[e]||e))(I.status||"")})}),I.priority&&(0,Ai.jsxs)("span",{className:"priority-badge",children:["Priority: ",I.priority]})]}),I.description&&(0,Ai.jsx)("div",{className:"quest-description",children:(0,Ai.jsx)("p",{children:I.description})}),I.quest_type&&(0,Ai.jsxs)("div",{className:"quest-info-row",children:[(0,Ai.jsx)("strong",{children:"Type:"})," ",I.quest_type]}),I.location_name&&(0,Ai.jsxs)("div",{className:"quest-info-row",children:[(0,Ai.jsx)("strong",{children:"Location:"})," ",I.location_name]}),I.assignee_name&&(0,Ai.jsxs)("div",{className:"quest-info-row",children:[(0,Ai.jsx)("strong",{children:"Assigned to:"})," ",I.assignee_name]}),I.character_quote&&(0,Ai.jsx)("div",{className:"quest-quote",children:(0,Ai.jsxs)("em",{children:['"',I.character_quote,'"']})})]}),(0,Ai.jsxs)("div",{className:"quest-details-actions",children:["it_is_done"!==I.status&&"completed"!==I.status&&(0,Ai.jsx)("button",{className:"btn btn-secondary btn-sm map-action-btn",onClick:()=>A(I.id),children:"Complete Quest"}),(0,Ai.jsx)("button",{className:"btn btn-secondary btn-sm map-action-btn",onClick:()=>{h(void 0)},children:"Close"}),(0,Ai.jsx)("button",{className:"btn btn-primary btn-sm map-action-btn",onClick:()=>{s("/quests",{state:{selectedQuestId:I.id}})},children:"View Full Details \u2192"})]})]})]})]})]});var B,D},Ch=e=>{let{user:t,onLogout:n}=e;const[r,o]=(0,i.useState)([]),[s,a]=(0,i.useState)([]),[l,c]=(0,i.useState)({purchased_count:0,best_bargain_percent:0,average_savings_percent:0}),[u,d]=(0,i.useState)(t.gold||0),[h,p]=(0,i.useState)(!0);return(0,i.useEffect)(()=>{(async()=>{try{const[e,t,n,i]=await Promise.all([ci.getInventory(),ci.getBargainStats(),ci.getGoldBalance(),ci.getQuests()]);o(e),c(t),d(n),a(i),Oi.trackInventoryViewed(e.length)}catch(e){console.error("Failed to load inventory:",e)}finally{p(!1)}})()},[]),h?(0,Ai.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,Ai.jsx)("p",{className:"text-text-primary font-readable",children:"Gathering your purchased relics..."})}):(0,Ai.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,Ai.jsx)(Md,{page:"inventory",gold:u,completedQuests:s.filter(e=>"it_is_done"===e.status).length,averageSavings:l.average_savings_percent,onLogout:n}),(0,Ai.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8 space-y-6",children:[(0,Ai.jsx)("h1",{className:"font-epic text-3xl text-gold",children:"Inventory"}),(0,Ai.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4","data-tour":"inventory-stats",children:[(0,Ai.jsxs)("div",{className:"bg-parchment-light rounded-lg p-4 border border-gold-dark/30",children:[(0,Ai.jsx)("p",{className:"text-xs uppercase text-text-secondary",children:"Items Purchased"}),(0,Ai.jsx)("p",{className:"font-epic text-2xl text-forest-dark",children:l.purchased_count})]}),(0,Ai.jsxs)("div",{className:"bg-parchment-light rounded-lg p-4 border border-gold-dark/30",children:[(0,Ai.jsx)("p",{className:"text-xs uppercase text-text-secondary",children:"Best Bargain"}),(0,Ai.jsxs)("p",{className:"font-epic text-2xl text-forest-dark",children:[l.best_bargain_percent.toFixed(2),"%"]})]}),(0,Ai.jsxs)("div",{className:"bg-parchment-light rounded-lg p-4 border border-gold-dark/30",children:[(0,Ai.jsx)("p",{className:"text-xs uppercase text-text-secondary",children:"Average Savings"}),(0,Ai.jsxs)("p",{className:"font-epic text-2xl text-forest-dark",children:[l.average_savings_percent.toFixed(2),"%"]})]})]}),(0,Ai.jsx)("div",{className:"bg-parchment-light rounded-lg border border-gold-dark/30 overflow-hidden",children:(0,Ai.jsxs)("table",{className:"w-full",children:[(0,Ai.jsx)("thead",{className:"bg-forest/10",children:(0,Ai.jsxs)("tr",{children:[(0,Ai.jsx)("th",{className:"text-left p-3",children:"Item"}),(0,Ai.jsx)("th",{className:"text-left p-3",children:"Seller"}),(0,Ai.jsx)("th",{className:"text-left p-3",children:"Paid"}),(0,Ai.jsx)("th",{className:"text-left p-3",children:"Real Price"}),(0,Ai.jsx)("th",{className:"text-left p-3",children:"Deal %"})]})}),(0,Ai.jsx)("tbody",{children:0===r.length?(0,Ai.jsx)("tr",{children:(0,Ai.jsx)("td",{colSpan:5,className:"p-4 text-text-secondary",children:"No purchased items yet. Visit character markers on the map to start bargaining."})}):r.map(e=>(0,Ai.jsxs)("tr",{className:"border-t border-gold-dark/20",children:[(0,Ai.jsx)("td",{className:"p-3",children:e.item_name}),(0,Ai.jsx)("td",{className:"p-3 capitalize",children:e.owner_character}),(0,Ai.jsxs)("td",{className:"p-3",children:[e.paid_price," Gold"]}),(0,Ai.jsxs)("td",{className:"p-3",children:[e.base_price_revealed," Gold"]}),(0,Ai.jsxs)("td",{className:"p-3 ".concat(e.savings_percent>=0?"text-green-700":"text-red-700"),children:[e.savings_percent.toFixed(2),"%"]})]},e.id))})]})})]})]})},Lh=bd((e,t)=>({currentUser:null,quests:[],members:[],locations:[],isLoading:!1,error:null,statusFilter:null,typeFilter:null,priorityFilter:null,locationFilter:null,searchQuery:"",setCurrentUser:t=>e({currentUser:t}),setQuests:t=>e({quests:t}),addQuest:t=>e(e=>({quests:[...e.quests,t]})),updateQuest:(t,n)=>e(e=>({quests:e.quests.map(e=>e.id===t?Be(Be({},e),n):e)})),deleteQuest:t=>e(e=>({quests:e.quests.filter(e=>e.id!==t)})),setIsLoading:t=>e({isLoading:t}),setError:t=>e({error:t}),setMembers:t=>e({members:t}),setLocations:t=>e({locations:t}),setStatusFilter:t=>e({statusFilter:t}),setTypeFilter:t=>e({typeFilter:t}),setPriorityFilter:t=>e({priorityFilter:t}),setLocationFilter:t=>e({locationFilter:t}),setSearchQuery:t=>e({searchQuery:t}),clearFilters:()=>e({statusFilter:null,typeFilter:null,priorityFilter:null,locationFilter:null,searchQuery:""}),getFilteredQuests:()=>{const e=t();return e.quests.filter(t=>(!e.statusFilter||t.status===e.statusFilter)&&((!e.typeFilter||t.quest_type===e.typeFilter)&&((!e.priorityFilter||t.priority===e.priorityFilter)&&((!e.locationFilter||t.location_id===e.locationFilter)&&!(e.searchQuery&&!t.title.toLowerCase().includes(e.searchQuery.toLowerCase()))))))},getQuestsByStatus:e=>t().quests.filter(t=>t.status===e),getQuestsByUser:e=>t().quests.filter(t=>t.assigned_to===e),getDarkMagicQuests:()=>t().quests.filter(e=>e.is_dark_magic),getQuestStats:()=>{const e=t().quests;return{total:e.length,notBegun:e.filter(e=>"not_yet_begun"===e.status).length,inProgress:e.filter(e=>"the_road_goes_ever_on"===e.status).length,completed:e.filter(e=>"it_is_done"===e.status).length,blocked:e.filter(e=>"the_shadow_falls"===e.status).length}},getCompletionRate:()=>{const e=t().quests;if(0===e.length)return 0;const n=e.filter(e=>"it_is_done"===e.status).length;return Math.round(n/e.length*100)},getCompletedQuestCount:()=>t().quests.filter(e=>"it_is_done"===e.status).length,getActiveMembers:()=>{const e=new Set(t().quests.map(e=>e.assigned_to).filter(Boolean));return t().members.filter(t=>e.has(t.id))},getLocationStats:()=>{const e={};return t().quests.forEach(t=>{t.location_id&&(e[t.location_id]=(e[t.location_id]||0)+1)}),e},fetchAllData:async()=>{e({isLoading:!0,error:null});try{const[t,n,i]=await Promise.all([ci.getQuests(),ci.getMembers(),ci.getLocations()]);e({quests:t,members:n,locations:i,isLoading:!1})}catch(t){const n=t instanceof Error?t.message:"Failed to fetch data";e({error:n,isLoading:!1})}},fetchQuests:async()=>{e({isLoading:!0,error:null});try{const t=await ci.getQuests();e({quests:t,isLoading:!1})}catch(t){const n=t instanceof Error?t.message:"Failed to fetch quests";e({error:n,isLoading:!1})}},createQuest:async n=>{try{const e=await ci.createQuest(n);return t().addQuest(e),e}catch(i){const t=i instanceof Error?i.message:"Failed to create quest";throw e({error:t}),i}},completeQuest:async n=>{try{const e=await ci.completeQuest(n);t().updateQuest(n,e)}catch(i){const t=i instanceof Error?i.message:"Failed to complete quest";throw e({error:t}),i}}}));let Eh=[];const Ph=()=>{const e=["ArrowUp","ArrowUp","ArrowDown","ArrowDown","ArrowLeft","ArrowRight","ArrowLeft","ArrowRight","b","a"];document.addEventListener("keydown",t=>{Eh.push(t.key),Eh=Eh.slice(-e.length),Eh.join(",")===e.join(",")&&(Th(),Eh=[])})},Th=()=>{const e=document.createElement("div");e.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: rgba(45, 80, 22, 0.95);\n border: 3px solid #FFD700;\n padding: 2rem;\n border-radius: 12px;\n z-index: 99999;\n text-align: center;\n animation: scaleIn 0.4s ease-out;\n ",e.innerHTML='\n <div style="font-family: \'Cinzel\', serif; font-size: 2rem; color: #FFD700; text-shadow: 0 0 10px #DAA520; margin-bottom: 1rem;">\n \ud83c\udf1f Secret Discovered \ud83c\udf1f\n </div>\n <div style="font-family: \'Lora\', serif; font-size: 1rem; color: #E8D5B7; line-height: 1.8; margin-bottom: 1rem;">\n <p>You have unlocked the Fellowship\'s Hidden Wisdom!</p>\n <p style="font-style: italic; margin-top: 1rem;">"Not all who wander are lost,<br/>For in the darkness of code,<br/>Gems of joy are revealed to those bold."</p>\n </div>\n ',document.body.appendChild(e),setTimeout(()=>{e.style.animation="fadeOut 0.6s ease-out forwards",setTimeout(()=>e.remove(),600)},5e3),console.log("%c\u2728 You discovered the secret! Welcome to the Fellowship of the Code! \u2728","font-size: 16px; color: #FFD700; font-weight: bold; background: #2D5016;")};function jh(e){return t=>typeof t===e}"undefined"!==typeof window&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ph):Ph());var Nh=jh("function"),Oh=e=>"RegExp"===Object.prototype.toString.call(e).slice(8,-1),Mh=e=>!Ah(e)&&!(e=>null===e)(e)&&(Nh(e)||"object"===typeof e),Ah=jh("undefined");function Rh(e,t){if(e===t)return!0;if(e&&Mh(e)&&t&&Mh(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return function(e,t){const{length:n}=e;if(n!==t.length)return!1;for(let i=n;0!==i--;)if(!Rh(e[i],t[i]))return!1;return!0}(e,t);if(e instanceof Map&&t instanceof Map)return function(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!Rh(n[1],t.get(n[0])))return!1;return!0}(e,t);if(e instanceof Set&&t instanceof Set)return function(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return function(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e.buffer),i=new DataView(t.buffer);let r=e.byteLength;for(;r--;)if(n.getUint8(r)!==i.getUint8(r))return!1;return!0}(e,t);if(Oh(e)&&Oh(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let e=n.length;0!==e--;)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let r=n.length;0!==r--;){const i=n[r];if(("_owner"!==i||!e.$$typeof)&&!Rh(e[i],t[i]))return!1}return!0}return!(!Number.isNaN(e)||!Number.isNaN(t))||e===t}var Ih=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],zh=["bigint","boolean","null","number","string","symbol","undefined"];function Bh(e){const t=Object.prototype.toString.call(e).slice(8,-1);return/HTML\w+Element/.test(t)?"HTMLElement":(n=t,Ih.includes(n)?t:void 0);var n}function Dh(e){return t=>Bh(t)===e}function Fh(e){return t=>typeof t===e}var Uh=["innerHTML","ownerDocument","style","attributes","nodeValue"];function qh(e){if(null===e)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(qh.array(e))return"Array";if(qh.plainFunction(e))return"Function";const t=Bh(e);return t||"Object"}qh.array=Array.isArray,qh.arrayOf=(e,t)=>!(!qh.array(e)&&!qh.function(t))&&e.every(e=>t(e)),qh.asyncGeneratorFunction=e=>"AsyncGeneratorFunction"===Bh(e),qh.asyncFunction=Dh("AsyncFunction"),qh.bigint=Fh("bigint"),qh.boolean=e=>!0===e||!1===e,qh.date=Dh("Date"),qh.defined=e=>!qh.undefined(e),qh.domElement=e=>qh.object(e)&&!qh.plainObject(e)&&1===e.nodeType&&qh.string(e.nodeName)&&Uh.every(t=>t in e),qh.empty=e=>qh.string(e)&&0===e.length||qh.array(e)&&0===e.length||qh.object(e)&&!qh.map(e)&&!qh.set(e)&&0===Object.keys(e).length||qh.set(e)&&0===e.size||qh.map(e)&&0===e.size,qh.error=Dh("Error"),qh.function=Fh("function"),qh.generator=e=>qh.iterable(e)&&qh.function(e.next)&&qh.function(e.throw),qh.generatorFunction=Dh("GeneratorFunction"),qh.instanceOf=(e,t)=>!(!e||!t)&&Object.getPrototypeOf(e)===t.prototype,qh.iterable=e=>!qh.nullOrUndefined(e)&&qh.function(e[Symbol.iterator]),qh.map=Dh("Map"),qh.nan=e=>Number.isNaN(e),qh.null=e=>null===e,qh.nullOrUndefined=e=>qh.null(e)||qh.undefined(e),qh.number=e=>Fh("number")(e)&&!qh.nan(e),qh.numericString=e=>qh.string(e)&&e.length>0&&!Number.isNaN(Number(e)),qh.object=e=>!qh.nullOrUndefined(e)&&(qh.function(e)||"object"===typeof e),qh.oneOf=(e,t)=>!!qh.array(e)&&e.indexOf(t)>-1,qh.plainFunction=Dh("Function"),qh.plainObject=e=>{if("Object"!==Bh(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})},qh.primitive=e=>{return qh.null(e)||(t=typeof e,zh.includes(t));var t},qh.promise=Dh("Promise"),qh.propertyOf=(e,t,n)=>{if(!qh.object(e)||!t)return!1;const i=e[t];return qh.function(n)?n(i):qh.defined(i)},qh.regexp=Dh("RegExp"),qh.set=Dh("Set"),qh.string=Fh("string"),qh.symbol=Fh("symbol"),qh.undefined=Fh("undefined"),qh.weakMap=Dh("WeakMap"),qh.weakSet=Dh("WeakSet");var Vh=qh;function Wh(e,t,n){const{actual:i,key:r,previous:o,type:s}=n,a=Xh(e,r),l=Xh(t,r);let c=[a,l].every(Vh.number)&&("increased"===s?a<l:a>l);return Vh.undefined(i)||(c=c&&l===i),Vh.undefined(o)||(c=c&&a===o),c}function Hh(e,t,n){const{key:i,type:r,value:o}=n,s=Xh(e,i),a=Xh(t,i),l="added"===r?s:a,c="added"===r?a:s;return Vh.nullOrUndefined(o)?[s,a].every(Vh.array)?!c.every(Kh(l)):[s,a].every(Vh.plainObject)?function(e,t){return t.some(t=>!e.includes(t))}(Object.keys(l),Object.keys(c)):![s,a].every(e=>Vh.primitive(e)&&Vh.defined(e))&&("added"===r?!Vh.defined(s)&&Vh.defined(a):Vh.defined(s)&&!Vh.defined(a)):Vh.defined(l)?!(!Vh.array(l)&&!Vh.plainObject(l))&&function(e,t,n){return!!$h(e,t)&&([e,t].every(Vh.array)?!e.some(Qh(n))&&t.some(Qh(n)):[e,t].every(Vh.plainObject)?!Object.entries(e).some(Gh(n))&&Object.entries(t).some(Gh(n)):t===n)}(l,c,o):Rh(c,o)}function Zh(e,t){let{key:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Xh(e,n),r=Xh(t,n);if(!$h(i,r))throw new TypeError("Inputs have different types");if(!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(e=>Vh.string(e)||Vh.array(e)||Vh.plainObject(e))}(i,r))throw new TypeError("Inputs don't have length");return[i,r].every(Vh.plainObject)&&(i=Object.keys(i),r=Object.keys(r)),[i,r]}function Gh(e){return t=>{let[n,i]=t;return Vh.array(e)?Rh(e,i)||e.some(e=>Rh(e,i)||Vh.array(i)&&Kh(i)(e)):Vh.plainObject(e)&&e[n]?!!e[n]&&Rh(e[n],i):Rh(e,i)}}function Qh(e){return t=>Vh.array(e)?e.some(e=>Rh(e,t)||Vh.array(t)&&Kh(t)(e)):Rh(e,t)}function Yh(e,t){return Vh.array(e)?e.some(e=>Rh(e,t)):Rh(e,t)}function Kh(e){return t=>e.some(e=>Rh(e,t))}function $h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(Vh.array)||t.every(Vh.number)||t.every(Vh.plainObject)||t.every(Vh.string)}function Xh(e,t){if(Vh.plainObject(e)||Vh.array(e)){if(Vh.string(t)){return t.split(".").reduce((e,t)=>e&&e[t],e)}return Vh.number(t)?e[t]:e}return e}function Jh(e,t){if([e,t].some(Vh.nullOrUndefined))throw new Error("Missing required parameters");if(![e,t].every(e=>Vh.plainObject(e)||Vh.array(e)))throw new Error("Expected plain objects or array");return{added:(n,i)=>{try{return Hh(e,t,{key:n,type:"added",value:i})}catch(r){return!1}},changed:(n,i,r)=>{try{const o=Xh(e,n),s=Xh(t,n),a=Vh.defined(i),l=Vh.defined(r);if(a||l){const e=l?Yh(r,o):!Yh(i,o),t=Yh(i,s);return e&&t}return[o,s].every(Vh.array)||[o,s].every(Vh.plainObject)?!Rh(o,s):o!==s}catch(o){return!1}},changedFrom:(n,i,r)=>{if(!Vh.defined(n))return!1;try{const o=Xh(e,n),s=Xh(t,n),a=Vh.defined(r);return Yh(i,o)&&(a?Yh(r,s):!a)}catch(o){return!1}},decreased:(n,i,r)=>{if(!Vh.defined(n))return!1;try{return Wh(e,t,{key:n,actual:i,previous:r,type:"decreased"})}catch(o){return!1}},emptied:n=>{try{const[i,r]=Zh(e,t,{key:n});return!!i.length&&!r.length}catch(i){return!1}},filled:n=>{try{const[i,r]=Zh(e,t,{key:n});return!i.length&&!!r.length}catch(i){return!1}},increased:(n,i,r)=>{if(!Vh.defined(n))return!1;try{return Wh(e,t,{key:n,actual:i,previous:r,type:"increased"})}catch(o){return!1}},removed:(n,i)=>{try{return Hh(e,t,{key:n,type:"removed",value:i})}catch(r){return!1}}}}var ep=n(865),tp=n(496),np=n(861),ip=n(789),rp=n.n(ip),op=n(173),sp=n.n(op),ap="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,lp=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(ap&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var cp=ap&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},lp))}};function up(e){return e&&"[object Function]"==={}.toString.call(e)}function dp(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function hp(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function pp(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=dp(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/(auto|scroll|overlay)/.test(n+r+i)?e:pp(hp(e))}function fp(e){return e&&e.referenceNode?e.referenceNode:e}var mp=ap&&!(!window.MSInputMethodContext||!document.documentMode),gp=ap&&/MSIE 10/.test(navigator.userAgent);function vp(e){return 11===e?mp:10===e?gp:mp||gp}function yp(e){if(!e)return document.documentElement;for(var t=vp(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===dp(n,"position")?yp(n):n:e?e.ownerDocument.documentElement:document.documentElement}function _p(e){return null!==e.parentNode?_p(e.parentNode):e}function bp(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||yp(e.firstElementChild)===e)}(s)?s:yp(s);var a=_p(e);return a.host?bp(a.host,t):bp(e,_p(t).host)}function xp(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var i=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||i)[t]}return e[t]}function wp(e,t){var n="x"===t?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+i+"Width"])}function kp(e,t,n,i){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],vp(10)?parseInt(n["offset"+e])+parseInt(i["margin"+("Height"===e?"Top":"Left")])+parseInt(i["margin"+("Height"===e?"Bottom":"Right")]):0)}function Sp(e){var t=e.body,n=e.documentElement,i=vp(10)&&getComputedStyle(n);return{height:kp("Height",t,n,i),width:kp("Width",t,n,i)}}var Cp=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Lp=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Ep=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};function Pp(e){return Ep({},e,{right:e.left+e.width,bottom:e.top+e.height})}function Tp(e){var t={};try{if(vp(10)){t=e.getBoundingClientRect();var n=xp(e,"top"),i=xp(e,"left");t.top+=n,t.left+=i,t.bottom+=n,t.right+=i}else t=e.getBoundingClientRect()}catch(qg){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?Sp(e.ownerDocument):{},s=o.width||e.clientWidth||r.width,a=o.height||e.clientHeight||r.height,l=e.offsetWidth-s,c=e.offsetHeight-a;if(l||c){var u=dp(e);l-=wp(u,"x"),c-=wp(u,"y"),r.width-=l,r.height-=c}return Pp(r)}function jp(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=vp(10),r="HTML"===t.nodeName,o=Tp(e),s=Tp(t),a=pp(e),l=dp(t),c=parseFloat(l.borderTopWidth),u=parseFloat(l.borderLeftWidth);n&&r&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var d=Pp({top:o.top-s.top-c,left:o.left-s.left-u,width:o.width,height:o.height});if(d.marginTop=0,d.marginLeft=0,!i&&r){var h=parseFloat(l.marginTop),p=parseFloat(l.marginLeft);d.top-=c-h,d.bottom-=c-h,d.left-=u-p,d.right-=u-p,d.marginTop=h,d.marginLeft=p}return(i&&!n?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=xp(t,"top"),r=xp(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}(d,t)),d}function Np(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===dp(e,"position"))return!0;var n=hp(e);return!!n&&Np(n)}function Op(e){if(!e||!e.parentElement||vp())return document.documentElement;for(var t=e.parentElement;t&&"none"===dp(t,"transform");)t=t.parentElement;return t||document.documentElement}function Mp(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},s=r?Op(e):bp(e,fp(t));if("viewport"===i)o=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=jp(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:xp(n),a=t?0:xp(n,"left");return Pp({top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:r,height:o})}(s,r);else{var a=void 0;"scrollParent"===i?"BODY"===(a=pp(hp(t))).nodeName&&(a=e.ownerDocument.documentElement):a="window"===i?e.ownerDocument.documentElement:i;var l=jp(a,s,r);if("HTML"!==a.nodeName||Np(s))o=l;else{var c=Sp(e.ownerDocument),u=c.height,d=c.width;o.top+=l.top-l.marginTop,o.bottom=u+l.top,o.left+=l.left-l.marginLeft,o.right=d+l.left}}var h="number"===typeof(n=n||0);return o.left+=h?n:n.left||0,o.top+=h?n:n.top||0,o.right-=h?n:n.right||0,o.bottom-=h?n:n.bottom||0,o}function Ap(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var s=Mp(n,i,o,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},l=Object.keys(a).map(function(e){return Ep({key:e},a[e],{area:(t=a[e],t.width*t.height)});var t}).sort(function(e,t){return t.area-e.area}),c=l.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),u=c.length>0?c[0].key:l[0].key,d=e.split("-")[1];return u+(d?"-"+d:"")}function Rp(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return jp(n,i?Op(t):bp(t,fp(n)),i)}function Ip(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),i=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function zp(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function Bp(e,t,n){n=n.split("-")[0];var i=Ip(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return r[s]=t[s]+t[l]/2-i[l]/2,r[a]=n===a?t[a]-i[c]:t[zp(a)],r}function Dp(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Fp(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=Dp(e,function(e){return e[t]===n});return e.indexOf(i)}(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&up(n)&&(t.offsets.popper=Pp(t.offsets.popper),t.offsets.reference=Pp(t.offsets.reference),t=n(t,e))}),t}function Up(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=Rp(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=Ap(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=Bp(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=Fp(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function qp(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function Vp(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;i<t.length;i++){var r=t[i],o=r?""+r+n:e;if("undefined"!==typeof document.body.style[o])return o}return null}function Wp(){return this.state.isDestroyed=!0,qp(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[Vp("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function Hp(e){var t=e.ownerDocument;return t?t.defaultView:window}function Zp(e,t,n,i){var r="BODY"===e.nodeName,o=r?e.ownerDocument.defaultView:e;o.addEventListener(t,n,{passive:!0}),r||Zp(pp(o.parentNode),t,n,i),i.push(o)}function Gp(e,t,n,i){n.updateBound=i,Hp(e).addEventListener("resize",n.updateBound,{passive:!0});var r=pp(e);return Zp(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function Qp(){this.state.eventsEnabled||(this.state=Gp(this.reference,this.options,this.state,this.scheduleUpdate))}function Yp(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,Hp(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function Kp(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function $p(e,t){Object.keys(t).forEach(function(n){var i="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&Kp(t[n])&&(i="px"),e.style[n]=t[n]+i})}var Xp=ap&&/Firefox/i.test(navigator.userAgent);function Jp(e,t,n){var i=Dp(e,function(e){return e.name===t}),r=!!i&&e.some(function(e){return e.name===n&&e.enabled&&e.order<i.order});if(!r){var o="`"+t+"`",s="`"+n+"`";console.warn(s+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return r}var ef=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],tf=ef.slice(3);function nf(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=tf.indexOf(e),i=tf.slice(n+1).concat(tf.slice(0,n));return t?i.reverse():i}var rf="flip",of="clockwise",sf="counterclockwise";function af(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(Dp(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==a?[s.slice(0,a).concat([s[a].split(l)[0]]),[s[a].split(l)[1]].concat(s.slice(a+1))]:[s];return c=c.map(function(e,i){var r=(1===i?!o:o)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return e;if(0===s.indexOf("%")){return Pp("%p"===s?n:i)[t]/100*o}if("vh"===s||"vw"===s)return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,r,t,n)})}),c.forEach(function(e,t){e.forEach(function(n,i){Kp(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}var lf={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),l=a?"left":"top",c=a?"width":"height",u={start:Lp({},l,o[l]),end:Lp({},l,o[l]+o[c]-s[c])};e.offsets.popper=Ep({},s,u[i])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,i=e.placement,r=e.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],l=void 0;return l=Kp(+n)?[+n,0]:af(n,o,s,a),"left"===a?(o.top+=l[0],o.left-=l[1]):"right"===a?(o.top+=l[0],o.left+=l[1]):"top"===a?(o.left+=l[0],o.top-=l[1]):"bottom"===a&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||yp(e.instance.popper);e.instance.reference===n&&(n=yp(n));var i=Vp("transform"),r=e.instance.popper.style,o=r.top,s=r.left,a=r[i];r.top="",r.left="",r[i]="";var l=Mp(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);r.top=o,r.left=s,r[i]=a,t.boundaries=l;var c=t.priority,u=e.offsets.popper,d={primary:function(e){var n=u[e];return u[e]<l[e]&&!t.escapeWithReference&&(n=Math.max(u[e],l[e])),Lp({},e,n)},secondary:function(e){var n="right"===e?"left":"top",i=u[n];return u[e]>l[e]&&!t.escapeWithReference&&(i=Math.min(u[n],l[e]-("right"===e?u.width:u.height))),Lp({},n,i)}};return c.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=Ep({},u,d[t](e))}),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]<o(i[l])&&(e.offsets.popper[l]=o(i[l])-n[c]),n[l]>o(i[a])&&(e.offsets.popper[l]=o(i[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Jp(e.instance.modifiers,"arrow","keepTogether"))return e;var i=t.element;if("string"===typeof i){if(!(i=e.instance.popper.querySelector(i)))return e}else if(!e.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var r=e.placement.split("-")[0],o=e.offsets,s=o.popper,a=o.reference,l=-1!==["left","right"].indexOf(r),c=l?"height":"width",u=l?"Top":"Left",d=u.toLowerCase(),h=l?"left":"top",p=l?"bottom":"right",f=Ip(i)[c];a[p]-f<s[d]&&(e.offsets.popper[d]-=s[d]-(a[p]-f)),a[d]+f>s[p]&&(e.offsets.popper[d]+=a[d]+f-s[p]),e.offsets.popper=Pp(e.offsets.popper);var m=a[d]+a[c]/2-f/2,g=dp(e.instance.popper),v=parseFloat(g["margin"+u]),y=parseFloat(g["border"+u+"Width"]),_=m-e.offsets.popper[d]-v-y;return _=Math.max(Math.min(s[c]-f,_),0),e.arrowElement=i,e.offsets.arrow=(Lp(n={},d,Math.round(_)),Lp(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(qp(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=Mp(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=zp(i),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case rf:s=[i,r];break;case of:s=nf(i);break;case sf:s=nf(i,!0);break;default:s=t.behavior}return s.forEach(function(a,l){if(i!==a||s.length===l+1)return e;i=e.placement.split("-")[0],r=zp(i);var c=e.offsets.popper,u=e.offsets.reference,d=Math.floor,h="left"===i&&d(c.right)>d(u.left)||"right"===i&&d(c.left)<d(u.right)||"top"===i&&d(c.bottom)>d(u.top)||"bottom"===i&&d(c.top)<d(u.bottom),p=d(c.left)<d(n.left),f=d(c.right)>d(n.right),m=d(c.top)<d(n.top),g=d(c.bottom)>d(n.bottom),v="left"===i&&p||"right"===i&&f||"top"===i&&m||"bottom"===i&&g,y=-1!==["top","bottom"].indexOf(i),_=!!t.flipVariations&&(y&&"start"===o&&p||y&&"end"===o&&f||!y&&"start"===o&&m||!y&&"end"===o&&g),b=!!t.flipVariationsByContent&&(y&&"start"===o&&f||y&&"end"===o&&p||!y&&"start"===o&&g||!y&&"end"===o&&m),x=_||b;(h||v||x)&&(e.flipped=!0,(h||v)&&(i=s[l+1]),x&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=Ep({},e.offsets.popper,Bp(e.instance.popper,e.offsets.reference,e.placement)),e=Fp(e.instance.modifiers,e,"flip"))}),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],i=e.offsets,r=i.popper,o=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return r[s?"left":"top"]=o[n]-(a?r[s?"width":"height"]:0),e.placement=zp(t),e.offsets.popper=Pp(r),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Jp(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=Dp(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,i=t.y,r=e.offsets.popper,o=Dp(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var s=void 0!==o?o:t.gpuAcceleration,a=yp(e.instance.popper),l=Tp(a),c={position:r.position},u=function(e,t){var n=e.offsets,i=n.popper,r=n.reference,o=Math.round,s=Math.floor,a=function(e){return e},l=o(r.width),c=o(i.width),u=-1!==["left","right"].indexOf(e.placement),d=-1!==e.placement.indexOf("-"),h=t?u||d||l%2===c%2?o:s:a,p=t?o:a;return{left:h(l%2===1&&c%2===1&&!d&&t?i.left-1:i.left),top:p(i.top),bottom:p(i.bottom),right:h(i.right)}}(e,window.devicePixelRatio<2||!Xp),d="bottom"===n?"top":"bottom",h="right"===i?"left":"right",p=Vp("transform"),f=void 0,m=void 0;if(m="bottom"===d?"HTML"===a.nodeName?-a.clientHeight+u.bottom:-l.height+u.bottom:u.top,f="right"===h?"HTML"===a.nodeName?-a.clientWidth+u.right:-l.width+u.right:u.left,s&&p)c[p]="translate3d("+f+"px, "+m+"px, 0)",c[d]=0,c[h]=0,c.willChange="transform";else{var g="bottom"===d?-1:1,v="right"===h?-1:1;c[d]=m*g,c[h]=f*v,c.willChange=d+", "+h}var y={"x-placement":e.placement};return e.attributes=Ep({},y,e.attributes),e.styles=Ep({},c,e.styles),e.arrowStyles=Ep({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return $p(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach(function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)}),e.arrowElement&&Object.keys(e.arrowStyles).length&&$p(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,i,r){var o=Rp(r,t,e,n.positionFixed),s=Ap(n.placement,o,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",s),$p(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}},cf={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:lf},uf=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=cp(this.update.bind(this)),this.options=Ep({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(Ep({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=Ep({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Ep({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&up(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return Cp(e,[{key:"update",value:function(){return Up.call(this)}},{key:"destroy",value:function(){return Wp.call(this)}},{key:"enableEventListeners",value:function(){return Qp.call(this)}},{key:"disableEventListeners",value:function(){return Yp.call(this)}}]),e}();uf.Utils=("undefined"!==typeof window?window:n.g).PopperUtils,uf.placements=ef,uf.Defaults=cf;const df=uf;var hf=["innerHTML","ownerDocument","style","attributes","nodeValue"],pf=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],ff=["bigint","boolean","null","number","string","symbol","undefined"];function mf(e){var t,n=Object.prototype.toString.call(e).slice(8,-1);return/HTML\w+Element/.test(n)?"HTMLElement":(t=n,pf.includes(t)?n:void 0)}function gf(e){return function(t){return mf(t)===e}}function vf(e){return function(t){return typeof t===e}}function yf(e){if(null===e)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(yf.array(e))return"Array";if(yf.plainFunction(e))return"Function";var t=mf(e);return t||"Object"}yf.array=Array.isArray,yf.arrayOf=function(e,t){return!(!yf.array(e)&&!yf.function(t))&&e.every(function(e){return t(e)})},yf.asyncGeneratorFunction=function(e){return"AsyncGeneratorFunction"===mf(e)},yf.asyncFunction=gf("AsyncFunction"),yf.bigint=vf("bigint"),yf.boolean=function(e){return!0===e||!1===e},yf.date=gf("Date"),yf.defined=function(e){return!yf.undefined(e)},yf.domElement=function(e){return yf.object(e)&&!yf.plainObject(e)&&1===e.nodeType&&yf.string(e.nodeName)&&hf.every(function(t){return t in e})},yf.empty=function(e){return yf.string(e)&&0===e.length||yf.array(e)&&0===e.length||yf.object(e)&&!yf.map(e)&&!yf.set(e)&&0===Object.keys(e).length||yf.set(e)&&0===e.size||yf.map(e)&&0===e.size},yf.error=gf("Error"),yf.function=vf("function"),yf.generator=function(e){return yf.iterable(e)&&yf.function(e.next)&&yf.function(e.throw)},yf.generatorFunction=gf("GeneratorFunction"),yf.instanceOf=function(e,t){return!(!e||!t)&&Object.getPrototypeOf(e)===t.prototype},yf.iterable=function(e){return!yf.nullOrUndefined(e)&&yf.function(e[Symbol.iterator])},yf.map=gf("Map"),yf.nan=function(e){return Number.isNaN(e)},yf.null=function(e){return null===e},yf.nullOrUndefined=function(e){return yf.null(e)||yf.undefined(e)},yf.number=function(e){return vf("number")(e)&&!yf.nan(e)},yf.numericString=function(e){return yf.string(e)&&e.length>0&&!Number.isNaN(Number(e))},yf.object=function(e){return!yf.nullOrUndefined(e)&&(yf.function(e)||"object"===typeof e)},yf.oneOf=function(e,t){return!!yf.array(e)&&e.indexOf(t)>-1},yf.plainFunction=gf("Function"),yf.plainObject=function(e){if("Object"!==mf(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})},yf.primitive=function(e){return yf.null(e)||(t=typeof e,ff.includes(t));var t},yf.promise=gf("Promise"),yf.propertyOf=function(e,t,n){if(!yf.object(e)||!t)return!1;var i=e[t];return yf.function(n)?n(i):yf.defined(i)},yf.regexp=gf("RegExp"),yf.set=gf("Set"),yf.string=vf("string"),yf.symbol=vf("symbol"),yf.undefined=vf("undefined"),yf.weakMap=gf("WeakMap"),yf.weakSet=gf("WeakSet");const _f=yf;function bf(e){return function(t){return typeof t===e}}var xf=bf("function"),wf=function(e){return"RegExp"===Object.prototype.toString.call(e).slice(8,-1)},kf=function(e){return!Sf(e)&&!function(e){return null===e}(e)&&(xf(e)||"object"===typeof e)},Sf=bf("undefined"),Cf=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Lf(e,t){if(e===t)return!0;if(e&&kf(e)&&t&&kf(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return function(e,t){var n=e.length;if(n!==t.length)return!1;for(var i=n;0!==i--;)if(!Lf(e[i],t[i]))return!1;return!0}(e,t);if(e instanceof Map&&t instanceof Map)return function(e,t){var n,i,r,o;if(e.size!==t.size)return!1;try{for(var s=Cf(e.entries()),a=s.next();!a.done;a=s.next()){var l=a.value;if(!t.has(l[0]))return!1}}catch(d){n={error:d}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}try{for(var c=Cf(e.entries()),u=c.next();!u.done;u=c.next())if(!Lf((l=u.value)[1],t.get(l[0])))return!1}catch(h){r={error:h}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}return!0}(e,t);if(e instanceof Set&&t instanceof Set)return function(e,t){var n,i;if(e.size!==t.size)return!1;try{for(var r=Cf(e.entries()),o=r.next();!o.done;o=r.next()){var s=o.value;if(!t.has(s[0]))return!1}}catch(a){n={error:a}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return!0}(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=new DataView(e.buffer),i=new DataView(t.buffer),r=e.byteLength;r--;)if(n.getUint8(r)!==i.getUint8(r))return!1;return!0}(e,t);if(wf(e)&&wf(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var r=n.length;0!==r--;)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return!1;for(r=n.length;0!==r--;){var o=n[r];if(("_owner"!==o||!e.$$typeof)&&!Lf(e[o],t[o]))return!1}return!0}return!(!Number.isNaN(e)||!Number.isNaN(t))||e===t}function Ef(e,t,n){var i=n.actual,r=n.key,o=n.previous,s=n.type,a=Rf(e,r),l=Rf(t,r),c=[a,l].every(_f.number)&&("increased"===s?a<l:a>l);return _f.undefined(i)||(c=c&&l===i),_f.undefined(o)||(c=c&&a===o),c}function Pf(e,t,n){var i=n.key,r=n.type,o=n.value,s=Rf(e,i),a=Rf(t,i),l="added"===r?s:a,c="added"===r?a:s;return _f.nullOrUndefined(o)?[s,a].every(_f.array)?!c.every(Mf(l)):[s,a].every(_f.plainObject)?function(e,t){return t.some(function(t){return!e.includes(t)})}(Object.keys(l),Object.keys(c)):![s,a].every(function(e){return _f.primitive(e)&&_f.defined(e)})&&("added"===r?!_f.defined(s)&&_f.defined(a):_f.defined(s)&&!_f.defined(a)):_f.defined(l)?!(!_f.array(l)&&!_f.plainObject(l))&&function(e,t,n){return!!Af(e,t)&&([e,t].every(_f.array)?!e.some(Nf(n))&&t.some(Nf(n)):[e,t].every(_f.plainObject)?!Object.entries(e).some(jf(n))&&Object.entries(t).some(jf(n)):t===n)}(l,c,o):Lf(c,o)}function Tf(e,t,n){var i=(void 0===n?{}:n).key,r=Rf(e,i),o=Rf(t,i);if(!Af(r,o))throw new TypeError("Inputs have different types");if(!function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.every(function(e){return _f.string(e)||_f.array(e)||_f.plainObject(e)})}(r,o))throw new TypeError("Inputs don't have length");return[r,o].every(_f.plainObject)&&(r=Object.keys(r),o=Object.keys(o)),[r,o]}function jf(e){return function(t){var n=t[0],i=t[1];return _f.array(e)?Lf(e,i)||e.some(function(e){return Lf(e,i)||_f.array(i)&&Mf(i)(e)}):_f.plainObject(e)&&e[n]?!!e[n]&&Lf(e[n],i):Lf(e,i)}}function Nf(e){return function(t){return _f.array(e)?e.some(function(e){return Lf(e,t)||_f.array(t)&&Mf(t)(e)}):Lf(e,t)}}function Of(e,t){return _f.array(e)?e.some(function(e){return Lf(e,t)}):Lf(e,t)}function Mf(e){return function(t){return e.some(function(e){return Lf(e,t)})}}function Af(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.every(_f.array)||e.every(_f.number)||e.every(_f.plainObject)||e.every(_f.string)}function Rf(e,t){return _f.plainObject(e)||_f.array(e)?_f.string(t)?t.split(".").reduce(function(e,t){return e&&e[t]},e):_f.number(t)?e[t]:e:e}function If(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function zf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?If(Object(n),!0).forEach(function(t){Uf(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):If(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Df(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Qf(i.key),i)}}function Ff(e,t,n){return t&&Df(e.prototype,t),n&&Df(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uf(e,t,n){return(t=Qf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qf(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wf(e,t)}function Vf(e){return Vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vf(e)}function Wf(e,t){return Wf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wf(e,t)}function Hf(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gf(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(qg){return!1}}();return function(){var n,i=Vf(e);if(t){var r=Vf(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zf(e)}(this,n)}}function Qf(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}var Yf={flip:{padding:20},preventOverflow:{padding:10}};function Kf(e,t,n){return function(e,t){if("function"!==typeof e)throw new TypeError("The typeValidator argument must be a function with the signature function(props, propName, componentName).");if(Boolean(t)&&"string"!==typeof t)throw new TypeError("The error message is optional, but must be a string if provided.")}(e,n),function(i,r,o){for(var s=arguments.length,a=new Array(s>3?s-3:0),l=3;l<s;l++)a[l-3]=arguments[l];return function(e,t,n,i){return"boolean"===typeof e?e:"function"===typeof e?e(t,n,i):!0===Boolean(e)&&Boolean(e)}(t,i,r,o)?function(e,t){return Object.hasOwnProperty.call(e,t)}(i,r)?e.apply(void 0,[i,r,o].concat(a)):function(e,t,n,i){return i?new Error(i):new Error("Required ".concat(e[t]," `").concat(t,"` was not specified in `").concat(n,"`."))}(i,r,o,n):e.apply(void 0,[i,r,o].concat(a))}}var $f={INIT:"init",IDLE:"idle",OPENING:"opening",OPEN:"open",CLOSING:"closing",ERROR:"error"},Xf=void 0!==s.createPortal;function Jf(){return!("undefined"===typeof window||!window.document||!window.document.createElement)}function em(){return"ontouchstart"in window&&/Mobi/.test(navigator.userAgent)}function tm(e){var t=e.title,n=e.data,i=e.warn,r=void 0!==i&&i,o=e.debug,s=void 0!==o&&o,a=r?console.warn||console.error:console.log;s&&t&&n&&(console.groupCollapsed("%creact-floater: ".concat(t),"color: #9b00ff; font-weight: bold; font-size: 12px;"),Array.isArray(n)?n.forEach(function(e){_f.plainObject(e)&&e.key?a.apply(console,[e.key,e.value]):a.apply(console,[e])}):a.apply(console,[n]),console.groupEnd())}function nm(){}var im=function(e){qf(n,e);var t=Gf(n);function n(){return Bf(this,n),t.apply(this,arguments)}return Ff(n,[{key:"componentDidMount",value:function(){Jf()&&(this.node||this.appendNode(),Xf||this.renderPortal())}},{key:"componentDidUpdate",value:function(){Jf()&&(Xf||this.renderPortal())}},{key:"componentWillUnmount",value:function(){Jf()&&this.node&&(Xf||s.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var e=this.props,t=e.id,n=e.zIndex;this.node||(this.node=document.createElement("div"),t&&(this.node.id=t),n&&(this.node.style.zIndex=n),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!Jf())return null;var e=this.props,t=e.children,n=e.setRef;return this.node||this.appendNode(),Xf?s.createPortal(t,this.node):(n(s.unstable_renderSubtreeIntoContainer(this,t.length>1?i.createElement("div",null,t):t[0],this.node)),null)}},{key:"renderReact16",value:function(){var e=this.props,t=e.hasChildren,n=e.placement,i=e.target;return t||i||"center"===n?this.renderPortal():null}},{key:"render",value:function(){return Xf?this.renderReact16():null}}]),n}(i.Component);Uf(im,"propTypes",{children:sp().oneOfType([sp().element,sp().array]),hasChildren:sp().bool,id:sp().oneOfType([sp().string,sp().number]),placement:sp().string,setRef:sp().func.isRequired,target:sp().oneOfType([sp().object,sp().string]),zIndex:sp().number});var rm=function(e){qf(n,e);var t=Gf(n);function n(){return Bf(this,n),t.apply(this,arguments)}return Ff(n,[{key:"parentStyle",get:function(){var e=this.props,t=e.placement,n=e.styles.arrow.length,i={pointerEvents:"none",position:"absolute",width:"100%"};return t.startsWith("top")?(i.bottom=0,i.left=0,i.right=0,i.height=n):t.startsWith("bottom")?(i.left=0,i.right=0,i.top=0,i.height=n):t.startsWith("left")?(i.right=0,i.top=0,i.bottom=0):t.startsWith("right")&&(i.left=0,i.top=0),i}},{key:"render",value:function(){var e,t=this.props,n=t.placement,r=t.setArrowRef,o=t.styles.arrow,s=o.color,a=o.display,l=o.length,c=o.margin,u=o.position,d=o.spread,h={display:a,position:u},p=d,f=l;return n.startsWith("top")?(e="0,0 ".concat(p/2,",").concat(f," ").concat(p,",0"),h.bottom=0,h.marginLeft=c,h.marginRight=c):n.startsWith("bottom")?(e="".concat(p,",").concat(f," ").concat(p/2,",0 0,").concat(f),h.top=0,h.marginLeft=c,h.marginRight=c):n.startsWith("left")?(f=d,e="0,0 ".concat(p=l,",").concat(f/2," 0,").concat(f),h.right=0,h.marginTop=c,h.marginBottom=c):n.startsWith("right")&&(f=d,e="".concat(p=l,",").concat(f," ").concat(p,",0 0,").concat(f/2),h.left=0,h.marginTop=c,h.marginBottom=c),i.createElement("div",{className:"__floater__arrow",style:this.parentStyle},i.createElement("span",{ref:r,style:h},i.createElement("svg",{width:p,height:f,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.createElement("polygon",{points:e,fill:s}))))}}]),n}(i.Component);Uf(rm,"propTypes",{placement:sp().string.isRequired,setArrowRef:sp().func.isRequired,styles:sp().object.isRequired});var om=["color","height","width"];function sm(e){var t=e.handleClick,n=e.styles,r=n.color,o=n.height,s=n.width,a=Hf(n,om);return i.createElement("button",{"aria-label":"close",onClick:t,style:a,type:"button"},i.createElement("svg",{width:"".concat(s,"px"),height:"".concat(o,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},i.createElement("g",null,i.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}function am(e){var t=e.content,n=e.footer,r=e.handleClick,o=e.open,s=e.positionWrapper,a=e.showCloseButton,l=e.title,c=e.styles,u={content:i.isValidElement(t)?t:i.createElement("div",{className:"__floater__content",style:c.content},t)};return l&&(u.title=i.isValidElement(l)?l:i.createElement("div",{className:"__floater__title",style:c.title},l)),n&&(u.footer=i.isValidElement(n)?n:i.createElement("div",{className:"__floater__footer",style:c.footer},n)),!a&&!s||_f.boolean(o)||(u.close=i.createElement(sm,{styles:c.close,handleClick:r})),i.createElement("div",{className:"__floater__container",style:c.container},u.close,u.title,u.content,u.footer)}sm.propTypes={handleClick:sp().func.isRequired,styles:sp().object.isRequired},am.propTypes={content:sp().node.isRequired,footer:sp().node,handleClick:sp().func.isRequired,open:sp().bool,positionWrapper:sp().bool.isRequired,showCloseButton:sp().bool.isRequired,styles:sp().object.isRequired,title:sp().node};var lm=function(e){qf(n,e);var t=Gf(n);function n(){return Bf(this,n),t.apply(this,arguments)}return Ff(n,[{key:"style",get:function(){var e=this.props,t=e.disableAnimation,n=e.component,i=e.placement,r=e.hideArrow,o=e.status,s=e.styles,a=s.arrow.length,l=s.floater,c=s.floaterCentered,u=s.floaterClosing,d=s.floaterOpening,h=s.floaterWithAnimation,p=s.floaterWithComponent,f={};return r||(i.startsWith("top")?f.padding="0 0 ".concat(a,"px"):i.startsWith("bottom")?f.padding="".concat(a,"px 0 0"):i.startsWith("left")?f.padding="0 ".concat(a,"px 0 0"):i.startsWith("right")&&(f.padding="0 0 0 ".concat(a,"px"))),-1!==[$f.OPENING,$f.OPEN].indexOf(o)&&(f=zf(zf({},f),d)),o===$f.CLOSING&&(f=zf(zf({},f),u)),o!==$f.OPEN||t||(f=zf(zf({},f),h)),"center"===i&&(f=zf(zf({},f),c)),n&&(f=zf(zf({},f),p)),zf(zf({},l),f)}},{key:"render",value:function(){var e=this.props,t=e.component,n=e.handleClick,r=e.hideArrow,o=e.setFloaterRef,s=e.status,a={},l=["__floater"];return a.content=t?i.isValidElement(t)?i.cloneElement(t,{closeFn:n}):t({closeFn:n}):i.createElement(am,this.props),s===$f.OPEN&&l.push("__floater__open"),r||(a.arrow=i.createElement(rm,this.props)),i.createElement("div",{ref:o,className:l.join(" "),style:this.style},i.createElement("div",{className:"__floater__body"},a.content,a.arrow))}}]),n}(i.Component);Uf(lm,"propTypes",{component:sp().oneOfType([sp().func,sp().element]),content:sp().node,disableAnimation:sp().bool.isRequired,footer:sp().node,handleClick:sp().func.isRequired,hideArrow:sp().bool.isRequired,open:sp().bool,placement:sp().string.isRequired,positionWrapper:sp().bool.isRequired,setArrowRef:sp().func.isRequired,setFloaterRef:sp().func.isRequired,showCloseButton:sp().bool,status:sp().string.isRequired,styles:sp().object.isRequired,title:sp().node});var cm=function(e){qf(n,e);var t=Gf(n);function n(){return Bf(this,n),t.apply(this,arguments)}return Ff(n,[{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.handleClick,o=t.handleMouseEnter,s=t.handleMouseLeave,a=t.setChildRef,l=t.setWrapperRef,c=t.style,u=t.styles;if(n)if(1===i.Children.count(n))if(i.isValidElement(n)){var d=_f.function(n.type)?"innerRef":"ref";e=i.cloneElement(i.Children.only(n),Uf({},d,a))}else e=i.createElement("span",null,n);else e=n;return e?i.createElement("span",{ref:l,style:zf(zf({},u),c),onClick:r,onMouseEnter:o,onMouseLeave:s},e):null}}]),n}(i.Component);Uf(cm,"propTypes",{children:sp().node,handleClick:sp().func.isRequired,handleMouseEnter:sp().func.isRequired,handleMouseLeave:sp().func.isRequired,setChildRef:sp().func.isRequired,setWrapperRef:sp().func.isRequired,style:sp().object,styles:sp().object.isRequired});var um={zIndex:100};var dm=["arrow","flip","offset"],hm=["position","top","right","bottom","left"],pm=function(e){qf(n,e);var t=Gf(n);function n(e){var i;return Bf(this,n),Uf(Zf(i=t.call(this,e)),"setArrowRef",function(e){i.arrowRef=e}),Uf(Zf(i),"setChildRef",function(e){i.childRef=e}),Uf(Zf(i),"setFloaterRef",function(e){i.floaterRef=e}),Uf(Zf(i),"setWrapperRef",function(e){i.wrapperRef=e}),Uf(Zf(i),"handleTransitionEnd",function(){var e=i.state.status,t=i.props.callback;i.wrapperPopper&&i.wrapperPopper.instance.update(),i.setState({status:e===$f.OPENING?$f.OPEN:$f.IDLE},function(){var e=i.state.status;t(e===$f.OPEN?"open":"close",i.props)})}),Uf(Zf(i),"handleClick",function(){var e=i.props,t=e.event,n=e.open;if(!_f.boolean(n)){var r=i.state,o=r.positionWrapper,s=r.status;("click"===i.event||"hover"===i.event&&o)&&(tm({title:"click",data:[{event:t,status:s===$f.OPEN?"closing":"opening"}],debug:i.debug}),i.toggle())}}),Uf(Zf(i),"handleMouseEnter",function(){var e=i.props,t=e.event,n=e.open;if(!_f.boolean(n)&&!em()){var r=i.state.status;"hover"===i.event&&r===$f.IDLE&&(tm({title:"mouseEnter",data:[{key:"originalEvent",value:t}],debug:i.debug}),clearTimeout(i.eventDelayTimeout),i.toggle())}}),Uf(Zf(i),"handleMouseLeave",function(){var e=i.props,t=e.event,n=e.eventDelay,r=e.open;if(!_f.boolean(r)&&!em()){var o=i.state,s=o.status,a=o.positionWrapper;"hover"===i.event&&(tm({title:"mouseLeave",data:[{key:"originalEvent",value:t}],debug:i.debug}),n?-1===[$f.OPENING,$f.OPEN].indexOf(s)||a||i.eventDelayTimeout||(i.eventDelayTimeout=setTimeout(function(){delete i.eventDelayTimeout,i.toggle()},1e3*n)):i.toggle($f.IDLE))}}),i.state={currentPlacement:e.placement,needsUpdate:!1,positionWrapper:e.wrapperOptions.position&&!!e.target,status:$f.INIT,statusWrapper:$f.INIT},i._isMounted=!1,i.hasMounted=!1,Jf()&&window.addEventListener("load",function(){i.popper&&i.popper.instance.update(),i.wrapperPopper&&i.wrapperPopper.instance.update()}),i}return Ff(n,[{key:"componentDidMount",value:function(){if(Jf()){var e=this.state.positionWrapper,t=this.props,n=t.children,i=t.open,r=t.target;this._isMounted=!0,tm({title:"init",data:{hasChildren:!!n,hasTarget:!!r,isControlled:_f.boolean(i),positionWrapper:e,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!n&&r&&_f.boolean(i)}}},{key:"componentDidUpdate",value:function(e,t){if(Jf()){var n,i=this.props,r=i.autoOpen,o=i.open,s=i.target,a=i.wrapperOptions,l=function(e,t){if([e,t].some(_f.nullOrUndefined))throw new Error("Missing required parameters");if(![e,t].every(function(e){return _f.plainObject(e)||_f.array(e)}))throw new Error("Expected plain objects or array");var n=function(n,i,r){try{var o=Rf(e,n),s=Rf(t,n),a=_f.defined(i),l=_f.defined(r);if(a||l){var c=l?Of(r,o):!Of(i,o),u=Of(i,s);return c&&u}return[o,s].every(_f.array)||[o,s].every(_f.plainObject)?!Lf(o,s):o!==s}catch(Vg){return!1}};return{added:function(n,i){try{return Pf(e,t,{key:n,type:"added",value:i})}catch(Vg){return!1}},changed:n,changedFrom:function(n,i,r){if(!_f.defined(n))return!1;try{var o=Rf(e,n),s=Rf(t,n),a=_f.defined(r);return Of(i,o)&&(a?Of(r,s):!a)}catch(Vg){return!1}},changedTo:function(e,t){return!!_f.defined(e)&&n(e,t)},decreased:function(n,i,r){if(!_f.defined(n))return!1;try{return Ef(e,t,{key:n,actual:i,previous:r,type:"decreased"})}catch(Vg){return!1}},emptied:function(n){try{var i=Tf(e,t,{key:n}),r=i[0],o=i[1];return!!r.length&&!o.length}catch(s){return!1}},filled:function(n){try{var i=Tf(e,t,{key:n}),r=i[0],o=i[1];return!r.length&&!!o.length}catch(s){return!1}},increased:function(n,i,r){if(!_f.defined(n))return!1;try{return Ef(e,t,{key:n,actual:i,previous:r,type:"increased"})}catch(Vg){return!1}},removed:function(n,i){try{return Pf(e,t,{key:n,type:"removed",value:i})}catch(Vg){return!1}}}}(t,this.state),c=l.changedFrom,u=l.changed;if(e.open!==o)_f.boolean(o)&&(n=o?$f.OPENING:$f.CLOSING),this.toggle(n);e.wrapperOptions.position===a.position&&e.target===s||this.changeWrapperPosition(this.props),(u("status",$f.IDLE)&&o||c("status",$f.INIT,$f.IDLE)&&r)&&this.toggle($f.OPEN),this.popper&&u("status",$f.OPENING)&&this.popper.instance.update(),this.floaterRef&&(u("status",$f.OPENING)||u("status",$f.CLOSING))&&function(e,t,n){var i;i=function(r){n(r),function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,n,i)}(e,t,i)},function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.addEventListener(t,n,i)}(e,t,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3])}(this.floaterRef,"transitionend",this.handleTransitionEnd),u("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){Jf()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.target,n=this.state.positionWrapper,i=this.props,r=i.disableFlip,o=i.getPopper,s=i.hideArrow,a=i.offset,l=i.placement,c=i.wrapperOptions,u="top"===l||"bottom"===l?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if("center"===l)this.setState({status:$f.IDLE});else if(t&&this.floaterRef){var d=this.options,h=d.arrow,p=d.flip,f=d.offset,m=Hf(d,dm);new df(t,this.floaterRef,{placement:l,modifiers:zf({arrow:zf({enabled:!s,element:this.arrowRef},h),flip:zf({enabled:!r,behavior:u},p),offset:zf({offset:"0, ".concat(a,"px")},f)},m),onCreate:function(t){var n;e.popper=t,null!==(n=e.floaterRef)&&void 0!==n&&n.isConnected?(o(t,"floater"),e._isMounted&&e.setState({currentPlacement:t.placement,status:$f.IDLE}),l!==t.placement&&setTimeout(function(){t.instance.update()},1)):e.setState({needsUpdate:!0})},onUpdate:function(t){e.popper=t;var n=e.state.currentPlacement;e._isMounted&&t.placement!==n&&e.setState({currentPlacement:t.placement})}})}if(n){var g=_f.undefined(c.offset)?0:c.offset;new df(this.target,this.wrapperRef,{placement:c.placement||l,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(g,"px")},flip:{enabled:!1}},onCreate:function(t){e.wrapperPopper=t,e._isMounted&&e.setState({statusWrapper:$f.IDLE}),o(t,"wrapper"),l!==t.placement&&setTimeout(function(){t.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var e=this;this.floaterRefInterval=setInterval(function(){var t;null!==(t=e.floaterRef)&&void 0!==t&&t.isConnected&&(clearInterval(e.floaterRefInterval),e.setState({needsUpdate:!1}),e.initPopper())},50)}},{key:"changeWrapperPosition",value:function(e){var t=e.target,n=e.wrapperOptions;this.setState({positionWrapper:n.position&&!!t})}},{key:"toggle",value:function(e){var t=this.state.status===$f.OPEN?$f.CLOSING:$f.OPENING;_f.undefined(e)||(t=e),this.setState({status:t})}},{key:"debug",get:function(){return this.props.debug||Jf()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var e=this.props,t=e.disableHoverToClick,n=e.event;return"hover"===n&&em()&&!t?"click":n}},{key:"options",get:function(){var e=this.props.options;return rp()(Yf,e||{})}},{key:"styles",get:function(){var e,t=this,n=this.state,i=n.status,r=n.positionWrapper,o=n.statusWrapper,s=this.props.styles,a=rp()(function(e){var t=rp()(um,e.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:t.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:t.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:t}}(s),s);r&&(e=-1===[$f.IDLE].indexOf(i)||-1===[$f.IDLE].indexOf(o)?a.wrapperPosition:this.wrapperPopper.styles,a.wrapper=zf(zf({},a.wrapper),e));if(this.target){var l=window.getComputedStyle(this.target);this.wrapperStyles?a.wrapper=zf(zf({},a.wrapper),this.wrapperStyles):-1===["relative","static"].indexOf(l.position)&&(this.wrapperStyles={},r||(hm.forEach(function(e){t.wrapperStyles[e]=l[e]}),a.wrapper=zf(zf({},a.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return a}},{key:"target",get:function(){if(!Jf())return null;var e=this.props.target;return e?_f.domElement(e)?e:document.querySelector(e):this.childRef||this.wrapperRef}},{key:"render",value:function(){var e=this.state,t=e.currentPlacement,n=e.positionWrapper,r=e.status,o=this.props,s=o.children,a=o.component,l=o.content,c=o.disableAnimation,u=o.footer,d=o.hideArrow,h=o.id,p=o.open,f=o.showCloseButton,m=o.style,g=o.target,v=o.title,y=i.createElement(cm,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:m,styles:this.styles.wrapper},s),_={};return n?_.wrapperInPortal=y:_.wrapperAsChildren=y,i.createElement("span",null,i.createElement(im,{hasChildren:!!s,id:h,placement:t,setRef:this.setFloaterRef,target:g,zIndex:this.styles.options.zIndex},i.createElement(lm,{component:a,content:l,disableAnimation:c,footer:u,handleClick:this.handleClick,hideArrow:d||"center"===t,open:p,placement:t,positionWrapper:n,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:f,status:r,styles:this.styles,title:v}),_.wrapperInPortal),_.wrapperAsChildren)}}]),n}(i.Component);Uf(pm,"propTypes",{autoOpen:sp().bool,callback:sp().func,children:sp().node,component:Kf(sp().oneOfType([sp().func,sp().element]),function(e){return!e.content}),content:Kf(sp().node,function(e){return!e.component}),debug:sp().bool,disableAnimation:sp().bool,disableFlip:sp().bool,disableHoverToClick:sp().bool,event:sp().oneOf(["hover","click"]),eventDelay:sp().number,footer:sp().node,getPopper:sp().func,hideArrow:sp().bool,id:sp().oneOfType([sp().string,sp().number]),offset:sp().number,open:sp().bool,options:sp().object,placement:sp().oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:sp().bool,style:sp().object,styles:sp().object,target:sp().oneOfType([sp().object,sp().string]),title:sp().node,wrapperOptions:sp().shape({offset:sp().number,placement:sp().oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:sp().bool})}),Uf(pm,"defaultProps",{autoOpen:!1,callback:nm,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:nm,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});const fm=["mixBlendMode","zIndex"],mm=["styles"],gm=["color","height","width"],vm=["beaconComponent","tooltipComponent"];var ym=Object.defineProperty,_m=(e,t,n)=>((e,t,n)=>t in e?ym(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!==typeof t?t+"":t,n),bm="init",xm="start",wm="stop",km="reset",Sm="prev",Cm="next",Lm="go",Em="close",Pm="skip",Tm="update",jm="tour:start",Nm="step:before",Om="beacon",Mm="tooltip",Am="step:after",Rm="tour:end",Im="tour:status",zm="error:target_not_found",Bm={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},Dm={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished",ERROR:"error"};function Fm(){var e;return!("undefined"===typeof window||!(null==(e=window.document)?void 0:e.createElement))}function Um(e){return e?e.getBoundingClientRect():null}function qm(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{body:t,documentElement:n}=document;if(!t||!n)return 0;if(e){const e=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((e,t)=>e-t),i=Math.floor(e.length/2);return e.length%2===0?(e[i-1]+e[i])/2:e[i]}return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Vm(e){if("string"===typeof e)try{return document.querySelector(e)}catch(t){return null}return e}function Wm(e,t,n){if(!e)return Qm();const i=tp(e);if(i){if(i.isSameNode(Qm()))return n?document:Qm();if(!(i.scrollHeight>i.offsetHeight)&&!t)return i.style.overflow="initial",Qm()}return i}function Hm(e,t){if(!e)return!1;const n=Wm(e,t);return!!n&&!n.isSameNode(Qm())}function Zm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fixed";if(!e||!(e instanceof HTMLElement))return!1;const{nodeName:n}=e,i=function(e){return e&&1===e.nodeType?getComputedStyle(e):null}(e);return"BODY"!==n&&"HTML"!==n&&(!(!i||i.position!==t)||!!e.parentNode&&Zm(e.parentNode,t))}function Gm(e,t,n){var i;if(!e)return 0;const{offsetTop:r=0,scrollTop:o=0}=null!=(i=tp(e))?i:{};let s=e.getBoundingClientRect().top+o;r&&(Hm(e,n)||function(e){return e.offsetParent!==document.body}(e))&&(s-=r);const a=Math.floor(s-t);return a<0?0:a}function Qm(){var e;return null!=(e=document.scrollingElement)?e:document.documentElement}var Ym=void 0!==s.createPortal;function Km(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent,t=e;return"undefined"===typeof window?t="node":document.documentMode?t="ie":/Edge/.test(e)?t="edge":Boolean(window.opera)||e.includes(" OPR/")?t="opera":"undefined"!==typeof window.InstallTrigger?t="firefox":window.chrome?t="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(e)&&(t="safari"),t}function $m(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function Xm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultValue:n,step:r,steps:o}=t;let s=np(e);if(s)(s.includes("{step}")||s.includes("{steps}"))&&r&&o&&(s=s.replace("{step}",r.toString()).replace("{steps}",o.toString()));else if((0,i.isValidElement)(e)&&!Object.values(e.props).length&&"function"===$m(e.type)){s=Xm(e.type({}),t)}else s=np(n);return s}function Jm(e){const t=e.replace(/^#?([\da-f])([\da-f])([\da-f])$/i,(e,t,n,i)=>t+t+n+n+i+i),n=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(t);return n?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:[]}function eg(e){return e.disableBeacon||"center"===e.placement}function tg(){return!["chrome","safari","firefox","opera"].includes(Km())}function ng(e){let{data:t,debug:n=!1,title:i,warn:r=!1}=e;const o=r?console.warn||console.error:console.log;n&&(i&&t?(console.groupCollapsed("%creact-joyride: ".concat(i),"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(t)?t.forEach(e=>{Vh.plainObject(e)&&e.key?o.apply(console,[e.key,e.value]):o.apply(console,[e])}):o.apply(console,[t]),console.groupEnd()):console.error("Missing title or data props"))}function ig(e){if(!Vh.plainObject(e))throw new TypeError("Expected an object");const t={};for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(const o in e)({}).hasOwnProperty.call(e,o)&&(i.includes(o)||(t[o]=e[o]));return t}function rg(e,t,n){const r=e=>e.replace("{step}",String(t)).replace("{steps}",String(n));if("string"===$m(e))return r(e);if(!(0,i.isValidElement)(e))return e;const{children:o}=e.props;if("string"===$m(o)&&o.includes("{step}"))return(0,i.cloneElement)(e,{children:r(o)});if(Array.isArray(o))return(0,i.cloneElement)(e,{children:o.map(e=>"string"===typeof e?r(e):rg(e,t,n))});if("function"===$m(e.type)&&!Object.values(e.props).length){return rg(e.type({}),t,n)}return e}var og={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},sg={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},ag={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:sg,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},lg={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},cg={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},ug={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},dg={borderRadius:4,position:"absolute"};function hg(e){return function(e){if(!Vh.plainObject(e))throw new TypeError("Expected an object");for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;const r={};for(const o in e)({}).hasOwnProperty.call(e,o)&&n.includes(o)&&(r[o]=e[o]);return r}(e,"beaconComponent","disableCloseOnEsc","disableOverlay","disableOverlayClose","disableScrolling","disableScrollParentFix","floaterProps","hideBackButton","hideCloseButton","locale","showProgress","showSkipButton","spotlightClicks","spotlightPadding","styles","tooltipComponent")}function pg(e,t){var n,i,r,o,s,a;const l=null!=t?t:{},c=ip.all([ag,hg(e),l],{isMergeableObject:Vh.plainObject}),u=function(e,t){var n,i,r,o,s;const{floaterProps:a,styles:l}=e,c=ip(null!=(n=t.floaterProps)?n:{},null!=a?a:{}),u=ip(null!=l?l:{},null!=(i=t.styles)?i:{}),d=ip(cg,u.options||{}),h="center"===t.placement||t.disableBeacon;let{width:p}=d;window.innerWidth>480&&(p=380),"width"in d&&(p="number"===typeof d.width&&window.innerWidth<d.width?window.innerWidth-30:d.width);const f={bottom:0,left:0,overflow:"hidden",position:"absolute",right:0,top:0,zIndex:d.zIndex},m={beacon:Be(Be({},ug),{},{display:h?"none":"inline-block",height:d.beaconSize,position:"relative",width:d.beaconSize,zIndex:d.zIndex}),beaconInner:{animation:"joyride-beacon-inner 1.2s infinite ease-in-out",backgroundColor:d.primaryColor,borderRadius:"50%",display:"block",height:"50%",left:"50%",opacity:.7,position:"absolute",top:"50%",transform:"translate(-50%, -50%)",width:"50%"},beaconOuter:{animation:"joyride-beacon-outer 1.2s infinite ease-in-out",backgroundColor:"rgba(".concat(Jm(d.primaryColor).join(","),", 0.2)"),border:"2px solid ".concat(d.primaryColor),borderRadius:"50%",boxSizing:"border-box",display:"block",height:"100%",left:0,opacity:.9,position:"absolute",top:0,transformOrigin:"center",width:"100%"},tooltip:{backgroundColor:d.backgroundColor,borderRadius:5,boxSizing:"border-box",color:d.textColor,fontSize:16,maxWidth:"100%",padding:15,position:"relative",width:p},tooltipContainer:{lineHeight:1.4,textAlign:"center"},tooltipTitle:{fontSize:18,margin:0},tooltipContent:{padding:"20px 10px"},tooltipFooter:{alignItems:"center",display:"flex",justifyContent:"flex-end",marginTop:15},tooltipFooterSpacer:{flex:1},buttonNext:Be(Be({},ug),{},{backgroundColor:d.primaryColor,borderRadius:4,color:"#fff"}),buttonBack:Be(Be({},ug),{},{color:d.primaryColor,marginLeft:"auto",marginRight:5}),buttonClose:Be(Be({},ug),{},{color:d.textColor,height:14,padding:15,position:"absolute",right:0,top:0,width:14}),buttonSkip:Be(Be({},ug),{},{color:d.textColor,fontSize:14}),overlay:Be(Be({},f),{},{backgroundColor:d.overlayColor,mixBlendMode:"hard-light"}),overlayLegacy:Be({},f),overlayLegacyCenter:Be(Be({},f),{},{backgroundColor:d.overlayColor}),spotlight:Be(Be({},dg),{},{backgroundColor:"gray"}),spotlightLegacy:Be(Be({},dg),{},{boxShadow:"0 0 0 9999px ".concat(d.overlayColor,", ").concat(d.spotlightShadow)}),floaterStyles:{arrow:{color:null!=(s=null==(o=null==(r=null==c?void 0:c.styles)?void 0:r.arrow)?void 0:o.color)?s:d.arrowColor},options:{zIndex:d.zIndex+100}},options:d};return ip(m,u)}(e,c),d=Hm(Vm(c.target),c.disableScrollParentFix),h=ip.all([og,null!=(n=e.floaterProps)?n:{},null!=(i=c.floaterProps)?i:{}]);return h.offset=c.offset,h.styles=ip(null!=(r=h.styles)?r:{},u.floaterStyles),h.offset+=null!=(s=null!=(o=e.spotlightPadding)?o:c.spotlightPadding)?s:0,c.placementBeacon&&h.wrapperOptions&&(h.wrapperOptions.placement=c.placementBeacon),d&&h.options.preventOverflow&&(h.options.preventOverflow.boundariesElement="window"),Be(Be({},c),{},{locale:ip.all([sg,null!=(a=e.locale)?a:{},c.locale||{}]),floaterProps:h,styles:ig(u,"floaterStyles")})}function fg(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Vh.plainObject(e)?!!e.target||(ng({title:"validateStep",data:"target is missing from the step",warn:!0,debug:t}),!1):(ng({title:"validateStep",data:"step must be an object",warn:!0,debug:t}),!1)}function mg(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Vh.array(e)?e.every(e=>fg(e,t)):(ng({title:"validateSteps",data:"steps must be an array",warn:!0,debug:t}),!1)}var gg,vg={action:"init",controlled:!1,index:0,lifecycle:Bm.INIT,origin:null,size:0,status:Dm.IDLE},yg=(gg=ig(vg,"controlled","size"),Object.keys(gg)),_g=class{constructor(e){var t=this;_m(this,"beaconPopper"),_m(this,"tooltipPopper"),_m(this,"data",new Map),_m(this,"listener"),_m(this,"store",new Map),_m(this,"addListener",e=>{this.listener=e}),_m(this,"setSteps",e=>{const{size:t,status:n}=this.getState(),i={size:e.length,status:n};this.data.set("steps",e),n===Dm.WAITING&&!t&&e.length&&(i.status=Dm.RUNNING),this.setState(i)}),_m(this,"getPopper",e=>"beacon"===e?this.beaconPopper:this.tooltipPopper),_m(this,"setPopper",(e,t)=>{"beacon"===e?this.beaconPopper=t:this.tooltipPopper=t}),_m(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),_m(this,"close",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const{index:n,status:i}=t.getState();i===Dm.RUNNING&&t.setState(Be({},t.getNextState({action:Em,index:n+1,origin:e})))}),_m(this,"go",e=>{const{controlled:t,status:n}=this.getState();if(t||n!==Dm.RUNNING)return;const i=this.getSteps()[e];this.setState(Be(Be({},this.getNextState({action:Lm,index:e})),{},{status:i?n:Dm.FINISHED}))}),_m(this,"info",()=>this.getState()),_m(this,"next",()=>{const{index:e,status:t}=this.getState();t===Dm.RUNNING&&this.setState(this.getNextState({action:Cm,index:e+1}))}),_m(this,"open",()=>{const{status:e}=this.getState();e===Dm.RUNNING&&this.setState(Be({},this.getNextState({action:Tm,lifecycle:Bm.TOOLTIP})))}),_m(this,"prev",()=>{const{index:e,status:t}=this.getState();t===Dm.RUNNING&&this.setState(Be({},this.getNextState({action:Sm,index:e-1})))}),_m(this,"reset",function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{controlled:n}=t.getState();n||t.setState(Be(Be({},t.getNextState({action:km,index:0})),{},{status:e?Dm.RUNNING:Dm.READY}))}),_m(this,"skip",()=>{const{status:e}=this.getState();e===Dm.RUNNING&&this.setState({action:Pm,lifecycle:Bm.INIT,status:Dm.SKIPPED})}),_m(this,"start",e=>{const{index:t,size:n}=this.getState();this.setState(Be(Be({},this.getNextState({action:xm,index:Vh.number(e)?e:t},!0)),{},{status:n?Dm.RUNNING:Dm.WAITING}))}),_m(this,"stop",function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{index:n,status:i}=t.getState();[Dm.FINISHED,Dm.SKIPPED].includes(i)||t.setState(Be(Be({},t.getNextState({action:wm,index:n+(e?1:0)})),{},{status:Dm.PAUSED}))}),_m(this,"update",e=>{var t,n,i,r;if(i=e,r=yg,!(Vh.plainObject(i)&&Vh.array(r)&&Object.keys(i).every(e=>r.includes(e))))throw new Error("State is not valid. Valid keys: ".concat(yg.join(", ")));this.setState(Be({},this.getNextState(Be(Be(Be({},this.getState()),e),{},{action:null!=(t=e.action)?t:Tm,origin:null!=(n=e.origin)?n:null}),!0)))});const{continuous:n=!1,stepIndex:i,steps:r=[]}=null!=e?e:{};this.setState({action:bm,controlled:Vh.number(i),continuous:n,index:Vh.number(i)?i:0,lifecycle:Bm.INIT,origin:null,status:r.length?Dm.READY:Dm.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:Be({},vg)}getNextState(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var n,i,r,o,s;const{action:a,controlled:l,index:c,size:u,status:d}=this.getState(),h=Vh.number(e.index)?e.index:c,p=l&&!t?c:Math.min(Math.max(h,0),u);return{action:null!=(n=e.action)?n:a,controlled:l,index:p,lifecycle:null!=(i=e.lifecycle)?i:Bm.INIT,origin:null!=(r=e.origin)?r:null,size:null!=(o=e.size)?o:u,status:p===u?Dm.FINISHED:null!=(s=e.status)?s:d}}getSteps(){const e=this.data.get("steps");return Array.isArray(e)?e:[]}hasUpdatedState(e){return JSON.stringify(e)!==JSON.stringify(this.getState())}setState(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.getState(),{action:i,index:r,lifecycle:o,origin:s=null,size:a,status:l}=Be(Be({},n),e);this.store.set("action",i),this.store.set("index",r),this.store.set("lifecycle",o),this.store.set("origin",s),this.store.set("size",a),this.store.set("status",l),t&&(this.store.set("controlled",e.controlled),this.store.set("continuous",e.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};var bg=function(e){let{styles:t}=e;return i.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:t})},xg=class extends i.Component{constructor(){super(...arguments),_m(this,"isActive",!1),_m(this,"resizeTimeout"),_m(this,"scrollTimeout"),_m(this,"scrollParent"),_m(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),_m(this,"hideSpotlight",()=>{const{continuous:e,disableOverlay:t,lifecycle:n}=this.props,i=[Bm.INIT,Bm.BEACON,Bm.COMPLETE,Bm.ERROR];return t||(e?i.includes(n):n!==Bm.TOOLTIP)}),_m(this,"handleMouseMove",e=>{const{mouseOverSpotlight:t}=this.state,{height:n,left:i,position:r,top:o,width:s}=this.spotlightStyles,a="fixed"===r?e.clientY:e.pageY,l="fixed"===r?e.clientX:e.pageX,c=l>=i&&l<=i+s&&(a>=o&&a<=o+n);c!==t&&this.updateState({mouseOverSpotlight:c})}),_m(this,"handleScroll",()=>{const{target:e}=this.props,t=Vm(e);if(this.scrollParent!==document){const{isScrolling:e}=this.state;e||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else Zm(t,"sticky")&&this.updateState({})}),_m(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:e,disableScrolling:t,disableScrollParentFix:n=!1,target:i}=this.props,r=Vm(i);this.scrollParent=Wm(null!=r?r:document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(e){var t;const{disableScrollParentFix:n,lifecycle:i,spotlightClicks:r,target:o}=this.props,{changed:s}=Jh(e,this.props);if(s("target")||s("disableScrollParentFix")){const e=Vm(o);this.scrollParent=Wm(null!=e?e:document.body,n,!0)}s("lifecycle",Bm.TOOLTIP)&&(null==(t=this.scrollParent)||t.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:e}=this.state;e||this.updateState({showSpotlight:!0})},100)),(s("spotlightClicks")||s("disableOverlay")||s("lifecycle"))&&(r&&i===Bm.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):i!==Bm.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var e;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),null==(e=this.scrollParent)||e.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:e}=this.state,{disableOverlayClose:t,placement:n,styles:i}=this.props;let r=i.overlay;return tg()&&(r="center"===n?i.overlayLegacyCenter:i.overlayLegacy),Be({cursor:t?"default":"pointer",height:qm(),pointerEvents:e?"none":"auto"},r)}get spotlightStyles(){var e,t,n;const{showSpotlight:i}=this.state,{disableScrollParentFix:r=!1,spotlightClicks:o,spotlightPadding:s=0,styles:a,target:l}=this.props,c=Vm(l),u=Um(c),d=Zm(c),h=function(e,t,n){var i,r,o;const s=Um(e),a=Wm(e,n),l=Hm(e,n),c=Zm(e);let u=0,d=null!=(i=null==s?void 0:s.top)?i:0;l&&c?d=(null!=(r=null==e?void 0:e.offsetTop)?r:0)-(null!=(o=null==a?void 0:a.scrollTop)?o:0):a instanceof HTMLElement&&(u=a.scrollTop,l||Zm(e)||(d+=u),a.isSameNode(Qm())||(d+=Qm().scrollTop));return Math.floor(d-t)}(c,s,r);return Be(Be({},tg()?a.spotlightLegacy:a.spotlight),{},{height:Math.round((null!=(e=null==u?void 0:u.height)?e:0)+2*s),left:Math.round((null!=(t=null==u?void 0:u.left)?t:0)-s),opacity:i?1:0,pointerEvents:o?"none":"auto",position:d?"fixed":"absolute",top:h,transition:"opacity 0.2s",width:Math.round((null!=(n=null==u?void 0:u.width)?n:0)+2*s)})}updateState(e){this.isActive&&this.setState(t=>Be(Be({},t),e))}render(){const{showSpotlight:e}=this.state,{onClickOverlay:t,placement:n}=this.props,{hideSpotlight:r,overlayStyles:o,spotlightStyles:s}=this;if(r())return null;let a="center"!==n&&e&&i.createElement(bg,{styles:s});if("safari"===Km()){const{mixBlendMode:e,zIndex:t}=o,n=Mi(o,fm);a=i.createElement("div",{style:Be({},n)},a),delete o.backgroundColor}return i.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:t,role:"presentation",style:o},a)}},wg=class extends i.Component{constructor(){super(...arguments),_m(this,"node",null)}componentDidMount(){const{id:e}=this.props;Fm()&&(this.node=document.createElement("div"),this.node.id=e,document.body.appendChild(this.node),Ym||this.renderReact15())}componentDidUpdate(){Fm()&&(Ym||this.renderReact15())}componentWillUnmount(){Fm()&&this.node&&(Ym||s.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Fm())return;const{children:e}=this.props;this.node&&s.unstable_renderSubtreeIntoContainer(this,e,this.node)}renderReact16(){if(!Fm()||!Ym)return null;const{children:e}=this.props;return this.node?s.createPortal(e,this.node):null}render(){return Ym?this.renderReact16():null}},kg=class{constructor(e,t){if(_m(this,"element"),_m(this,"options"),_m(this,"canBeTabbed",e=>{const{tabIndex:t}=e;return!(null===t||t<0)&&this.canHaveFocus(e)}),_m(this,"canHaveFocus",e=>{const t=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(t)&&!e.getAttribute("disabled")||"a"===t&&!!e.getAttribute("href"))&&this.isVisible(e)}),_m(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),_m(this,"handleKeyDown",e=>{const{code:t="Tab"}=this.options;e.code===t&&this.interceptTab(e)}),_m(this,"interceptTab",e=>{e.preventDefault();const t=this.findValidTabElements(),{shiftKey:n}=e;if(!t.length)return;let i=document.activeElement?t.indexOf(document.activeElement):0;-1===i||!n&&i+1===t.length?i=0:n&&0===i?i=t.length-1:i+=n?-1:1,t[i].focus()}),_m(this,"isHidden",e=>{const t=e.offsetWidth<=0&&e.offsetHeight<=0,n=window.getComputedStyle(e);return!(!t||e.innerHTML)||(t&&"visible"!==n.getPropertyValue("overflow")||"none"===n.getPropertyValue("display"))}),_m(this,"isVisible",e=>{let t=e;for(;t;)if(t instanceof HTMLElement){if(t===document.body)break;if(this.isHidden(t))return!1;t=t.parentNode}return!0}),_m(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),_m(this,"checkFocus",e=>{document.activeElement!==e&&(e.focus(),window.requestAnimationFrame(()=>this.checkFocus(e)))}),_m(this,"setFocus",()=>{const{selector:e}=this.options;if(!e)return;const t=this.element.querySelector(e);t&&window.requestAnimationFrame(()=>this.checkFocus(t))}),!(e instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=e,this.options=t,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},Sg=class extends i.Component{constructor(e){if(super(e),_m(this,"beacon",null),_m(this,"setBeaconRef",e=>{this.beacon=e}),e.beaconComponent)return;const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",e.nonce&&n.setAttribute("nonce",e.nonce);n.appendChild(document.createTextNode("\n @keyframes joyride-beacon-inner {\n 20% {\n opacity: 0.9;\n }\n \n 90% {\n opacity: 0.7;\n }\n }\n \n @keyframes joyride-beacon-outer {\n 0% {\n transform: scale(1);\n }\n \n 45% {\n opacity: 0.7;\n transform: scale(0.75);\n }\n \n 100% {\n opacity: 0.9;\n transform: scale(1);\n }\n }\n ")),t.appendChild(n)}componentDidMount(){const{shouldFocus:e}=this.props;setTimeout(()=>{Vh.domElement(this.beacon)&&e&&this.beacon.focus()},0)}componentWillUnmount(){const e=document.getElementById("joyride-beacon-animation");(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)}render(){const{beaconComponent:e,continuous:t,index:n,isLastStep:r,locale:o,onClickOrHover:s,size:a,step:l,styles:c}=this.props,u=Xm(o.open),d={"aria-label":u,onClick:s,onMouseEnter:s,ref:this.setBeaconRef,title:u};let h;if(e){const o=e;h=i.createElement(o,Be({continuous:t,index:n,isLastStep:r,size:a,step:l},d))}else h=i.createElement("button",Be({key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:c.beacon,type:"button"},d),i.createElement("span",{style:c.beaconInner}),i.createElement("span",{style:c.beaconOuter}));return h}};var Cg=function(e){let{styles:t}=e,n=Mi(e,mm);const{color:r,height:o,width:s}=t,a=Mi(t,gm);return i.createElement("button",Be({style:a,type:"button"},n),i.createElement("svg",{height:"number"===typeof o?"".concat(o,"px"):o,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:"number"===typeof s?"".concat(s,"px"):s,xmlns:"http://www.w3.org/2000/svg"},i.createElement("g",null,i.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))};var Lg=function(e){const{backProps:t,closeProps:n,index:r,isLastStep:o,primaryProps:s,skipProps:a,step:l,tooltipProps:c}=e,{content:u,hideBackButton:d,hideCloseButton:h,hideFooter:p,showSkipButton:f,styles:m,title:g}=l,v={};return v.primary=i.createElement("button",Be({"data-test-id":"button-primary",style:m.buttonNext,type:"button"},s)),f&&!o&&(v.skip=i.createElement("button",Be({"aria-live":"off","data-test-id":"button-skip",style:m.buttonSkip,type:"button"},a))),!d&&r>0&&(v.back=i.createElement("button",Be({"data-test-id":"button-back",style:m.buttonBack,type:"button"},t))),v.close=!h&&i.createElement(Cg,Be({"data-test-id":"button-close",styles:m.buttonClose},n)),i.createElement("div",Be({key:"JoyrideTooltip","aria-label":Xm(null!=g?g:u),className:"react-joyride__tooltip",style:m.tooltip},c),i.createElement("div",{style:m.tooltipContainer},g&&i.createElement("h1",{"aria-label":Xm(g),style:m.tooltipTitle},g),i.createElement("div",{style:m.tooltipContent},u)),!p&&i.createElement("div",{style:m.tooltipFooter},i.createElement("div",{style:m.tooltipFooterSpacer},v.skip),v.back,v.primary),v.close)},Eg=class extends i.Component{constructor(){super(...arguments),_m(this,"handleClickBack",e=>{e.preventDefault();const{helpers:t}=this.props;t.prev()}),_m(this,"handleClickClose",e=>{e.preventDefault();const{helpers:t}=this.props;t.close("button_close")}),_m(this,"handleClickPrimary",e=>{e.preventDefault();const{continuous:t,helpers:n}=this.props;t?n.next():n.close("button_primary")}),_m(this,"handleClickSkip",e=>{e.preventDefault();const{helpers:t}=this.props;t.skip()}),_m(this,"getElementsProps",()=>{const{continuous:e,index:t,isLastStep:n,setTooltipRef:i,size:r,step:o}=this.props,{back:s,close:a,last:l,next:c,nextLabelWithProgress:u,skip:d}=o.locale,h=Xm(s),p=Xm(a),f=Xm(l),m=Xm(c),g=Xm(d);let v=a,y=p;if(e){if(v=c,y=m,o.showProgress&&!n){const e=Xm(u,{step:t+1,steps:r});v=rg(u,t+1,r),y=e}n&&(v=l,y=f)}return{backProps:{"aria-label":h,children:s,"data-action":"back",onClick:this.handleClickBack,role:"button",title:h},closeProps:{"aria-label":p,children:a,"data-action":"close",onClick:this.handleClickClose,role:"button",title:p},primaryProps:{"aria-label":y,children:v,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:y},skipProps:{"aria-label":g,children:d,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:g},tooltipProps:{"aria-modal":!0,ref:i,role:"alertdialog"}}})}render(){const{continuous:e,index:t,isLastStep:n,setTooltipRef:r,size:o,step:s}=this.props,{beaconComponent:a,tooltipComponent:l}=s,c=Mi(s,vm);let u;if(l){const s=Be(Be({},this.getElementsProps()),{},{continuous:e,index:t,isLastStep:n,size:o,step:c,setTooltipRef:r}),a=l;u=i.createElement(a,Be({},s))}else u=i.createElement(Lg,Be(Be({},this.getElementsProps()),{},{continuous:e,index:t,isLastStep:n,size:o,step:s}));return u}},Pg=class extends i.Component{constructor(){super(...arguments),_m(this,"scope",null),_m(this,"tooltip",null),_m(this,"handleClickHoverBeacon",e=>{const{step:t,store:n}=this.props;"mouseenter"===e.type&&"hover"!==t.event||n.update({lifecycle:Bm.TOOLTIP})}),_m(this,"setTooltipRef",e=>{this.tooltip=e}),_m(this,"setPopper",(e,t)=>{var n;const{action:i,lifecycle:r,step:o,store:s}=this.props;"wrapper"===t?s.setPopper("beacon",e):s.setPopper("tooltip",e),s.getPopper("beacon")&&(s.getPopper("tooltip")||"center"===o.placement)&&r===Bm.INIT&&s.update({action:i,lifecycle:Bm.READY}),(null==(n=o.floaterProps)?void 0:n.getPopper)&&o.floaterProps.getPopper(e,t)}),_m(this,"renderTooltip",e=>{const{continuous:t,helpers:n,index:r,size:o,step:s}=this.props;return i.createElement(Eg,Be({continuous:t,helpers:n,index:r,isLastStep:r+1===o,setTooltipRef:this.setTooltipRef,size:o,step:s},e))})}componentDidMount(){const{debug:e,index:t}=this.props;ng({title:"step:".concat(t),data:[{key:"props",value:this.props}],debug:e})}componentDidUpdate(e){var t;const{action:n,callback:i,continuous:r,controlled:o,debug:s,helpers:a,index:l,lifecycle:c,shouldScroll:u,status:d,step:h,store:p}=this.props,{changed:f,changedFrom:m}=Jh(e,this.props),g=a.info(),v=r&&n!==Em&&(l>0||n===Sm),y=f("action")||f("index")||f("lifecycle")||f("status"),_=m("lifecycle",[Bm.TOOLTIP,Bm.INIT],Bm.INIT),b=f("action",[Cm,Sm,Pm,Em]),x=o&&l===e.index;if(b&&(_||x)&&i(Be(Be({},g),{},{index:e.index,lifecycle:Bm.COMPLETE,step:e.step,type:Am})),"center"===h.placement&&d===Dm.RUNNING&&f("index")&&n!==xm&&c===Bm.INIT&&p.update({lifecycle:Bm.READY}),y){const e=Vm(h.target),t=!!e,r=t&&function(e){var t;if(!e)return!1;let n=e;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:e,visibility:t}=getComputedStyle(n);if("none"===e||"hidden"===t)return!1}n=null!=(t=n.parentElement)?t:null}return!0}(e);r?(m("status",Dm.READY,Dm.RUNNING)||m("lifecycle",Bm.INIT,Bm.READY))&&i(Be(Be({},g),{},{step:h,type:Nm})):(console.warn(t?"Target not visible":"Target not mounted",h),i(Be(Be({},g),{},{type:zm,step:h})),o||p.update({index:l+(n===Sm?-1:1)}))}m("lifecycle",Bm.INIT,Bm.READY)&&p.update({lifecycle:eg(h)||v?Bm.TOOLTIP:Bm.BEACON}),f("index")&&ng({title:"step:".concat(c),data:[{key:"props",value:this.props}],debug:s}),f("lifecycle",Bm.BEACON)&&i(Be(Be({},g),{},{step:h,type:Om})),f("lifecycle",Bm.TOOLTIP)&&(i(Be(Be({},g),{},{step:h,type:Mm})),u&&this.tooltip&&(this.scope=new kg(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),m("lifecycle",[Bm.TOOLTIP,Bm.INIT],Bm.INIT)&&(null==(t=this.scope)||t.removeScope(),p.cleanupPoppers())}componentWillUnmount(){var e;null==(e=this.scope)||e.removeScope()}get open(){const{lifecycle:e,step:t}=this.props;return eg(t)||e===Bm.TOOLTIP}render(){const{continuous:e,debug:t,index:n,nonce:r,shouldScroll:o,size:s,step:a}=this.props,l=Vm(a.target);return fg(a)&&Vh.domElement(l)?i.createElement("div",{key:"JoyrideStep-".concat(n),className:"react-joyride__step"},i.createElement(pm,Be(Be({},a.floaterProps),{},{component:this.renderTooltip,debug:t,getPopper:this.setPopper,id:"react-joyride-step-".concat(n),open:this.open,placement:a.placement,target:a.target}),i.createElement(Sg,{beaconComponent:a.beaconComponent,continuous:e,index:n,isLastStep:n+1===s,locale:a.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:o,size:s,step:a,styles:a.styles}))):null}},Tg=class extends i.Component{constructor(e){super(e),_m(this,"helpers"),_m(this,"store"),_m(this,"callback",e=>{const{callback:t}=this.props;Vh.function(t)&&t(e)}),_m(this,"handleKeyboard",e=>{const{index:t,lifecycle:n}=this.state,{steps:i}=this.props,r=i[t];n===Bm.TOOLTIP&&"Escape"===e.code&&r&&!r.disableCloseOnEsc&&this.store.close("keyboard")}),_m(this,"handleClickOverlay",()=>{const{index:e}=this.state,{steps:t}=this.props;pg(this.props,t[e]).disableOverlayClose||this.helpers.close("overlay")}),_m(this,"syncState",e=>{this.setState(e)});const{debug:t,getHelpers:n,run:i=!0,stepIndex:r}=e;var o;this.store=(o=Be(Be({},e),{},{controlled:i&&Vh.number(r)}),new _g(o)),this.helpers=this.store.getHelpers();const{addListener:s}=this.store;ng({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:t}),s(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!Fm())return;const{debug:e,disableCloseOnEsc:t,run:n,steps:i}=this.props,{start:r}=this.store;mg(i,e)&&n&&r(),t||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(e,t){if(!Fm())return;const{action:n,controlled:i,index:r,status:o}=this.state,{debug:s,run:a,stepIndex:l,steps:c}=this.props,{stepIndex:u,steps:d}=e,{reset:h,setSteps:p,start:f,stop:m,update:g}=this.store,{changed:v}=Jh(e,this.props),{changed:y,changedFrom:_}=Jh(t,this.state),b=pg(this.props,c[r]),x=!Rh(d,c),w=Vh.number(l)&&v("stepIndex"),k=Vm(b.target);if(x&&(mg(c,s)?p(c):console.warn("Steps are not valid",c)),v("run")&&(a?f(l):m()),w){let e=Vh.number(u)&&u<l?Cm:Sm;n===wm&&(e=xm),[Dm.FINISHED,Dm.SKIPPED].includes(o)||g({action:n===Em?Em:e,index:l,lifecycle:Bm.INIT})}i||o!==Dm.RUNNING||0!==r||k||(this.store.update({index:r+1}),this.callback(Be(Be({},this.state),{},{type:zm,step:b})));const S=Be(Be({},this.state),{},{index:r,step:b});if(y("action",[Cm,Sm,Pm,Em])&&y("status",Dm.PAUSED)){const e=pg(this.props,c[t.index]);this.callback(Be(Be({},S),{},{index:t.index,lifecycle:Bm.COMPLETE,step:e,type:Am}))}if(y("status",[Dm.FINISHED,Dm.SKIPPED])){const e=pg(this.props,c[t.index]);i||this.callback(Be(Be({},S),{},{index:t.index,lifecycle:Bm.COMPLETE,step:e,type:Am})),this.callback(Be(Be({},S),{},{type:Rm,step:e,index:t.index})),h()}else _("status",[Dm.IDLE,Dm.READY],Dm.RUNNING)?this.callback(Be(Be({},S),{},{type:jm})):(y("status")||y("action",km))&&this.callback(Be(Be({},S),{},{type:Im}));this.scrollToStep(t)}componentWillUnmount(){const{disableCloseOnEsc:e}=this.props;e||document.body.removeEventListener("keydown",this.handleKeyboard)}scrollToStep(e){const{index:t,lifecycle:n,status:i}=this.state,{debug:r,disableScrollParentFix:o=!1,scrollDuration:s,scrollOffset:a=20,scrollToFirstStep:l=!1,steps:c}=this.props,u=pg(this.props,c[t]),d=Vm(u.target),h=function(e){const{isFirstStep:t,lifecycle:n,previousLifecycle:i,scrollToFirstStep:r,step:o,target:s}=e;return!o.disableScrolling&&(!t||r||n===Bm.TOOLTIP)&&"center"!==o.placement&&(!o.isFixed||!Zm(s))&&i!==n&&[Bm.BEACON,Bm.TOOLTIP].includes(n)}({isFirstStep:0===t,lifecycle:n,previousLifecycle:e.lifecycle,scrollToFirstStep:l,step:u,target:d});if(i===Dm.RUNNING&&h){const e=Hm(d,o),l=Wm(d,o);let c=Math.floor(Gm(d,a,o))||0;ng({title:"scrollToStep",data:[{key:"index",value:t},{key:"lifecycle",value:n},{key:"status",value:i}],debug:r});const h=this.store.getPopper("beacon"),p=this.store.getPopper("tooltip");if(n===Bm.BEACON&&h){const{offsets:t,placement:n}=h;["bottom"].includes(n)||e||(c=Math.floor(t.popper.top-a))}else if(n===Bm.TOOLTIP&&p){const{flipped:t,offsets:n,placement:i}=p;!["top","right","left"].includes(i)||t||e?c-=u.spotlightPadding:c=Math.floor(n.popper.top-a)}c=c>=0?c:0,i===Dm.RUNNING&&function(e,t){const{duration:n,element:i}=t;return new Promise((t,r)=>{const{scrollTop:o}=i,s=e>o?e-o:o-e;ep.top(i,e,{duration:s<100?50:n},e=>e&&"Element already at target scroll position"!==e.message?r(e):t())})}(c,{element:l,duration:s}).then(()=>{setTimeout(()=>{var e;null==(e=this.store.getPopper("tooltip"))||e.instance.update()},10)})}}render(){if(!Fm())return null;const{index:e,lifecycle:t,status:n}=this.state,{continuous:r=!1,debug:o=!1,nonce:s,scrollToFirstStep:a=!1,steps:l}=this.props,c={};if(n===Dm.RUNNING&&l[e]){const n=pg(this.props,l[e]);c.step=i.createElement(Pg,Be(Be({},this.state),{},{callback:this.callback,continuous:r,debug:o,helpers:this.helpers,nonce:s,shouldScroll:!n.disableScrolling&&(0!==e||a),step:n,store:this.store})),c.overlay=i.createElement(wg,{id:"react-joyride-portal"},i.createElement(xg,Be(Be({},n),{},{continuous:r,debug:o,lifecycle:t,onClickOverlay:this.handleClickOverlay})))}return i.createElement("div",{className:"react-joyride"},c.step,c.overlay)}};_m(Tg,"defaultProps",lg);var jg=Tg;const Ng={light:"#F4E4BC",default:"#E8D5B7",dark:"#D4C0A4"},Og={light:"#3D6B1F",default:"#2D5016",dark:"#1F3A0E"},Mg={light:"#FFD700",default:"#DAA520",dark:"#B8860B"},Ag={primary:"#1A1F2E",secondary:"#4B5563",light:"#E8E8E8"},Rg="sut.walkthroughSeen.v1",Ig=[{target:'[data-tour="main-navigation"]',placement:"bottom",disableBeacon:!0,route:"/dashboard",content:"Welcome to your Fellowship command center. Use this navigation to move between quests, the map, and your inventory."},{target:'[data-tour="quests-overview"]',placement:"top",disableBeacon:!0,route:"/quests",content:"This is where quests are managed. Create a new quest, track progress, and keep your party aligned on objectives."},{target:'[data-tour="dialogue-panel"]',placement:"left",disableBeacon:!0,route:"/map?tourCharacterPanel=1",content:"On the map, talk with LOTR characters here. Each conversation can reveal hints, trade context, and negotiation opportunities."},{target:'[data-tour="bargain-ledger"]',placement:"left",disableBeacon:!0,route:"/map?tourCharacterPanel=1",content:"This ledger drives bargaining. Start with a seller item, send offers, and adjust based on negotiation status and your gold."},{target:'[data-tour="inventory-stats"]',placement:"bottom",disableBeacon:!0,route:"/inventory",content:"Your inventory records bargaining performance. Best bargain and average savings show how skillfully you trade across Middle-earth."}],zg=e=>e||("undefined"!==typeof window&&window.localStorage?window.localStorage:null),Bg=["route"],Dg=e=>{let{isEnabled:t}=e;const n=re(),r=ne(),[o,s]=(0,i.useState)(!1),[a,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(0),d=(0,i.useRef)(!1),h=(0,i.useMemo)(()=>Ig.map(e=>{let{route:t}=e;return Be({},Mi(e,Bg))}),[]),p=(0,i.useCallback)(e=>{const t=Ig[e];if(!t)return;const i=t.route;"".concat(r.pathname).concat(r.search)!==i&&n(i)},[r.pathname,r.search,n]),f=(0,i.useCallback)(e=>{if("undefined"===typeof document)return!1;const t=Ig[e];return!!t&&null!==document.querySelector(t.target)},[]),m=(0,i.useCallback)(()=>{t&&(u(0),l(!1),s(!0),p(0))},[t,p]);(0,i.useEffect)(()=>{if(!t)return s(!1),void l(!1);d.current||(e=>{const t=zg(e);return!!t&&"true"===t.getItem(Rg)})()||(d.current=!0,m())},[t,m]),(0,i.useEffect)(()=>{if(!t||!o)return void l(!1);let e=!1;p(c);const n=()=>{if(e)return;const t=f(c);l(t),t||window.setTimeout(n,150)};return n(),()=>{e=!0}},[o,t,f,p,c,r.pathname,r.search]);const g=(0,i.useCallback)(()=>{s(!1),l(!1),(e=>{const t=zg(e);t&&t.setItem(Rg,"true")})()},[]),v=(0,i.useCallback)(e=>{const{action:t,index:n,status:i,type:r}=e;if(i!==Dm.FINISHED&&i!==Dm.SKIPPED){if(r===zm)return l(!1),void p(n);if(r===Am){const e=t===Sm?n-1:n+1;if(e<0||e>=Ig.length)return void g();l(!1),u(e),p(e)}}else g()},[g,p]);return t?(0,Ai.jsxs)(Ai.Fragment,{children:[(0,Ai.jsx)(jg,{callback:v,continuous:!0,disableScrolling:!1,hideBackButton:!1,run:o&&a,scrollToFirstStep:!0,showProgress:!0,showSkipButton:!0,spotlightClicks:!1,stepIndex:c,steps:h,locale:{back:"Back",close:"Close",last:"Finish",next:"Next",skip:"Skip tour"},styles:{options:{arrowColor:Ng.light,backgroundColor:Ng.light,overlayColor:"rgba(15, 17, 23, 0.7)",primaryColor:Mg.default,textColor:Ag.primary,zIndex:9999},buttonBack:{color:Og.dark},buttonSkip:{color:Ag.secondary}}}),(0,Ai.jsx)("button",{type:"button",onClick:m,"aria-label":"Show walkthrough",title:"Show walkthrough",className:"fixed bottom-6 right-6 h-12 w-12 rounded-full bg-gold text-text-primary border-2 border-forest shadow-lg hover:bg-gold-light transition-all duration-300 z-40 font-epic text-xl",children:"?"})]}):null};function Fg(e){let{currentUser:t,isLoading:n,onLogin:r,onLogout:o}=e;const s=ne();return(0,i.useEffect)(()=>{const e={"/login":{title:"Login"},"/dashboard":{title:"The Council Chamber",trackEvent:"trackDashboardViewed"},"/quests":{title:"Quests",trackEvent:"trackQuestsPageViewed"},"/map":{title:"Middle-earth Map",trackEvent:"trackMapViewed"},"/inventory":{title:"Inventory"}}[s.pathname]||{title:s.pathname};Oi.trackPageView(s.pathname,e.title),e.trackEvent&&"trackDashboardViewed"===e.trackEvent?Oi.trackDashboardViewed():e.trackEvent&&"trackQuestsPageViewed"===e.trackEvent?Oi.trackQuestsPageViewed():e.trackEvent&&"trackMapViewed"===e.trackEvent&&Oi.trackMapViewed()},[s]),(0,Ai.jsxs)("div",{className:"app min-h-screen bg-background-primary text-text-primary",children:[n&&(0,Ai.jsx)("div",{className:"fixed inset-0 bg-background-primary/80 backdrop-blur-sm flex items-center justify-center z-50 animate-fadeIn",children:(0,Ai.jsxs)("div",{className:"text-center",children:[(0,Ai.jsx)("div",{className:"text-6xl mb-4 animate-bounce",children:"\ud83e\uddd9\u200d\u2642\ufe0f"}),(0,Ai.jsx)("p",{className:"text-parchment-light font-epic text-2xl",children:"Loading your Fellowship..."})]})}),(0,Ai.jsxs)(we,{children:[(0,Ai.jsx)(be,{path:"/login",element:t?(0,Ai.jsx)(_e,{to:"/dashboard",replace:!0}):(0,Ai.jsx)(dd,{onLogin:r})}),(0,Ai.jsx)(be,{path:"/dashboard",element:t?(0,Ai.jsx)(Ad,{user:t,onLogout:o}):(0,Ai.jsx)(_e,{to:"/login",replace:!0})}),(0,Ai.jsx)(be,{path:"/quests",element:t?(0,Ai.jsx)(Zd,{user:t,onLogout:o}):(0,Ai.jsx)(_e,{to:"/login",replace:!0})}),(0,Ai.jsx)(be,{path:"/map",element:(0,Ai.jsx)(Sh,{user:t,onLogout:o})}),(0,Ai.jsx)(be,{path:"/inventory",element:t?(0,Ai.jsx)(Ch,{user:t,onLogout:o}):(0,Ai.jsx)(_e,{to:"/login",replace:!0})}),(0,Ai.jsx)(be,{path:"/",element:(0,Ai.jsx)(_e,{to:t?"/dashboard":"/login",replace:!0})})]}),!navigator.webdriver&&(0,Ai.jsx)(Dg,{isEnabled:Boolean(t)})]})}Dg.displayName="GuidedWalkthrough";const Ug=function(){const{currentUser:e,setCurrentUser:t,fetchAllData:n}=Lh(e=>({currentUser:e.currentUser,setCurrentUser:e.setCurrentUser,fetchAllData:e.fetchAllData})),{isLoading:r}=Lh(e=>({isLoading:e.isLoading}));return(0,i.useEffect)(()=>{ci.getCurrentUser().then(e=>{t(e),Oi.setUserId(e.id),Oi.setUserProperties({[Oi.constructor.name]:e.username}),n()}).catch(()=>{t(null)}).finally(()=>{console.log("%c".concat((()=>{const e=['"All we have to decide is what to do with the time that is given us." - Gandalf','"Not all those who wander are lost." - Tolkien','"A wizard is never late, nor is he early." - Gandalf','"I wish it need not have happened in my time," said Frodo. "So do I," said Gandalf, "and so do all who live to see such times."','"Even the smallest person can change the course of the future." - Galadriel','"Courage is found in unlikely places." - Gimli','"There and Back Again" - Bilbo Baggins','"My precious..." - Gollum','"One does not simply walk into Mordor." - Boromir','"I am no man." - \xc9owyn'];return e[Math.floor(Math.random()*e.length)]})()),"font-size: 14px; color: #DAA520; font-style: italic; font-family: Lora, serif;")})},[t,n]),(0,Ai.jsx)(Pe,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:(0,Ai.jsx)(Fg,{currentUser:e,isLoading:r,onLogin:e=>{t(e),Oi.setUserId(e.id),Oi.setUserProperties({[Oi.constructor.name]:e.username}),n()},onLogout:async()=>{try{await ci.logout(),Oi.trackLogout()}catch(e){console.error("Logout error:",e),Oi.trackLogout()}finally{t(null),xd.getState().clearDialogueHistory()}}})})};o.createRoot(document.getElementById("root")).render((0,Ai.jsx)(i.StrictMode,{children:(0,Ai.jsx)(Ug,{})}))})()})();
|
|
//# sourceMappingURL=main.cdb3f2d7.js.map
|