@qratilabs/qrati-connect 2.11.2 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/element/B69ImNZT.js +1 -0
- package/element/BJ85RnFv.js +1 -0
- package/element/BMcguUyG.js +3 -0
- package/element/{BYFlh5C5.js → BQqOUW6N.js} +5 -5
- package/element/{C__vUXvg.js → Boe_RDqD.js} +1 -1
- package/element/{BQB7uJ0l.js → Bv-t_m1C.js} +2 -2
- package/element/{kPqeZ-lH.js → C3QMmYnY.js} +1 -1
- package/element/{BSP6ZAxM.js → CDQEYcjb.js} +1 -1
- package/element/CVBzx4z2.js +1 -0
- package/element/C_Ll1SGr.js +3 -0
- package/element/{BgMQfcp1.js → CgysBfpd.js} +2 -2
- package/element/{B6AogNwO.js → CjV7Y_ZR.js} +5 -5
- package/element/web.es.js +138 -140
- package/package.json +1 -1
- package/react/{SmAWGP68.js → B8E540Dw.js} +1 -1
- package/react/BJ85RnFv.js +1 -0
- package/react/{Dx3H0TXY.js → BLFGxc-Z.js} +1 -1
- package/react/{DdUmw-Lp.js → BLyySAIG.js} +1 -1
- package/react/{DEkf_xei.js → BNWA4oPH.js} +1 -1
- package/react/{uiiSr1iu.js → BQ_-fjek.js} +1 -1
- package/react/B_v7xpxg.js +3 -0
- package/react/Bnjm_hPo.js +1 -0
- package/react/BtTYXVAR.js +1 -0
- package/react/{DLDA1Kjz.js → By2TDGd0.js} +1 -1
- package/react/C2_oNmLs.js +1 -0
- package/react/CDxcCZ0e.js +1 -0
- package/react/{C02SORiV.js → CQPNrnGa.js} +1 -1
- package/react/CVBzx4z2.js +1 -0
- package/react/{CO6S8f5W.js → Cg32CQgw.js} +5 -5
- package/react/{BuIB9AXA.js → D1R9CsTD.js} +12 -12
- package/react/{CExWFXPu.js → DIHBL0r_.js} +2 -2
- package/react/DY14MZ7R.js +1 -0
- package/react/{q5E_UWxZ.js → DYF1izRu.js} +1 -1
- package/react/DecT4TR6.js +3 -0
- package/react/{I6Sstf1G.js → Dkfv3zUk.js} +1 -1
- package/react/{DmnfzC9I.js → DnZjfS5P.js} +1 -1
- package/react/{BPczcQJn.js → QyW5oQ3d.js} +1 -1
- package/react/{ZJDrzcXm.js → iNYjrgIk.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +71 -73
- package/umd/web.umd.js +1 -1
- package/element/C-LQPZVK.js +0 -3
- package/element/CHhgXpm7.js +0 -3
- package/element/DnHHH-ld.js +0 -1
- package/react/BVTf5URN.js +0 -1
- package/react/CHwj9Xb4.js +0 -3
- package/react/Ca8RfX27.js +0 -1
- package/react/D5c7A2zT.js +0 -3
- package/react/x8PDxFIY.js +0 -1
- /package/element/{BaDK5_iv.js → BoGN7PAu.js} +0 -0
- /package/element/{D8mHDhEV.js → D0vqGbrV.js} +0 -0
- /package/element/{Dlgiti9h.js → D65dhVYX.js} +0 -0
- /package/element/{C0dqRit2.js → bCYrje4k.js} +0 -0
- /package/react/{BkSX_NqE.js → 2loTkxKJ.js} +0 -0
- /package/react/{B7CKBSvG.js → BB64mo-u.js} +0 -0
- /package/react/{BaDK5_iv.js → BoGN7PAu.js} +0 -0
- /package/react/{D1oAzDTo.js → CQZJGufb.js} +0 -0
- /package/react/{DMEpl2Pi.js → CWvvo0Iu.js} +0 -0
- /package/react/{D8mHDhEV.js → D0vqGbrV.js} +0 -0
- /package/react/{BV6AkckF.js → Ds97LXZO.js} +0 -0
- /package/react/{C0dqRit2.js → bCYrje4k.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./CKhiIZDr.js";var t=/* @__PURE__ */e((e,t)=>{var i,r;i=e,r=function(e){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,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)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 i,r=this._featureGroup,n=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=/* @__PURE__ */(new Date).getTime(),d=L.bind(function(){var p=/* @__PURE__ */(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();l<h&&!(s&&l%200==0&&/* @__PURE__ */(new Date).getTime()-p>o);l++)if((i=e[l])instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var c=i.__parent.getAllChildMarkers(),f=c[0]===i?c[1]:c[0];r.removeLayer(f)}}else n.addLayer(i),t||this.fire("layeradd",{layer:i});a&&a(l,h,/* @__PURE__ */(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var p=this._needsClustering;l<h;l++)(i=e[l])instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||p.push(i):n.addLayer(i);return this},removeLayers:function(e){var t,i,r=e.length,n=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=r;for(t=0;t<h;t++)(i=a[t])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),n.hasLayer(i)&&(n.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));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 i,r,n,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),r=s.length-1;r>=0;r--){for(i=!0,n=o.length-1;n>=0;n--)if(o[n].layer===s[r]){i=!1;break}i&&e.call(t,s[r])}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(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(t=(i=this._needsRemoving).length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;"function"!=typeof t&&(t=function(){});var r=function(){!i.hasLayer(e)&&!i.hasLayer(e.__parent)||this._inZoomAnimation||(this._map.off("moveend",r,this),this.off("animationend",r,this),i.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",r,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",r,this),this.on("animationend",r,this),e.__parent.zoomToBounds())},onAdd:function(e){var t,i,r;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,i=this._needsRemoving.length;t<i;t++)(r=this._needsRemoving[t]).newlatlng=r.layer._latlng,r.layer._latlng=r.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)r=this._needsRemoving[t],this._removeLayer(r.layer,!0),r.layer._latlng=r.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(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!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 i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,r=this._gridUnclustered,n=Math.floor(this._map.getMinZoom());t>=n&&r[t].removeObject(e,i.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,i){e._latlng=t,this.removeLayer(e),e._latlng=i,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,i){var r=this._gridClusters,n=this._gridUnclustered,s=this._featureGroup,o=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,u=l._markers;for(this._arraySplice(u,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(h=l._markers[0]===e?l._markers[1]:l._markers[0],r[l._zoom].removeObject(l,o.project(l._cLatLng,l._zoom)),n[l._zoom].addObject(h,o.project(h.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(h),h.__parent=l.__parent,l._icon&&(s.removeLayer(l),i||s.addLayer(h))):l._iconNeedsUpdate=!0,l=l.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){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,i)},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(),i=" marker-cluster-";return i+=t<10?"small":t<100?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,r=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom;(t||r||n)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(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,i=t;if("clusterkeypress"!==e.type||!e.originalEvent||13===e.originalEvent.keyCode){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._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,i=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom,n=this._map;(e||i||r)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.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()),i=this.options.maxClusterRadius,r=i;"function"!=typeof i&&(r=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var n=e;n>=t;n--)this._gridClusters[n]=new L.DistanceGrid(r(n)),this._gridUnclustered[n]=new L.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,r,n=this._gridClusters,s=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=n[t].getNearObject(i);if(a)return a._addChild(e),void(e.__parent=a);if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);n[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var u=l;for(r=t-1;r>h._zoom;r--)u=new this._markerCluster(this,r,u),n[r].addObject(u,this._map.project(a.getLatLng(),r));return h._addChild(u),void this._removeFromGridUnclustered(a,t)}s[t].addObject(e,i)}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 i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,r=e.getLayers(),n=0;for(t=t||[];n<r.length;n++)(i=r[n])instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);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 i,r=this._getExpandedVisibleBounds(),n=this._featureGroup,s=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(r,e,s,function(s){var o,a=s._latlng,h=s._markers;for(r.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,r)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,r)),i=h.length-1;i>=0;i--)o=h[i],r.contains(o._latlng)||n.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(r,t),n.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(r,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(r,e,s,function(e){n.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 i=this,r=this._featureGroup;r.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(){r.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var r=this._getExpandedVisibleBounds(),n=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(r,n,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(r,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(r,i,n,function(e){e._recursivelyRemoveChildrenFromMap(r,n,t+1)});s._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 i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,r){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.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,i&&this._addChild(i),r&&this._addChild(r)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var r=this._markers.length-1;r>=0;r--)t&&this._markers[r].__dragStart||e.push(this._markers[r]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),r=this._group._map,n=r.getBoundsZoom(this._bounds),s=this._zoom+1,o=r.getZoom();i.length>0&&n>s;){s++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}n>s?this._group._map.setView(this._latlng,s):n<=o?this._group._map.setView(this._latlng,o+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,i,r,n=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e<n.length;e++)i=n[e]._latlng,this._bounds.extend(i),o+=i.lat,a+=i.lng;for(e=0;e<s.length;e++)(t=s[e])._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,r=t._childCount,o+=i.lat*r,a+=i.lng*r;this._latlng=this._wLatLng=new L.LatLng(o/h,a/h),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(e){var i,r,n=e._markers;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())},function(e){var i,r,n=e._childClusters;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,r){this._recursively(e,r,t,function(n){n._recursivelyAnimateChildrenIn(e,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),i),n._isSingleParent()&&i-1===r?(n.clusterShow(),n._recursivelyRemoveChildrenFromMap(e,t,i)):n.clusterHide(),n._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(r){if(t!==r._zoom)for(var n=r._markers.length-1;n>=0;n--){var s=r._markers[n];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),r._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,r){var n,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)n=e._markers[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)n=e._childClusters[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())})},_recursively:function(e,t,i,r,n){var s,o,a=this._childClusters,h=this._zoom;if(t<=h&&(r&&r(this),n&&h===i&&n(this)),h<t||h<i)for(s=a.length-1;s>=0;s--)(o=a[s])._boundsNeedUpdate&&o._recalculateBounds(),e.intersects(o._bounds)&&o._recursively(e,t,i,r,n)},_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 i=this._getCoord(t.x),r=this._getCoord(t.y),n=this._grid,s=n[r]=n[r]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,r,n=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[n]=a[n]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,r=h.length;i<r;i++)if(h[i]===e)return h.splice(i,1),1===r&&delete a[n],!0},eachObject:function(e,t){var i,r,n,s,o,a,h=this._grid;for(i in h)for(r in o=h[i])for(n=0,s=(a=o[r]).length;n<s;n++)e.call(t,a[n])&&(n--,s--)},getNearObject:function(e){var t,i,r,n,s,o,a,h,l=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,p=null;for(t=u-1;t<=u+1;t++)if(n=this._grid[t])for(i=l-1;i<=l+1;i++)if(s=n[i])for(r=0,o=s.length;r<o;r++)a=s[r],((h=this._sqDist(_[L.Util.stamp(a)],e))<d||h<=d&&null===p)&&(d=h,p=a);return p},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r}},L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,r,n,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)r=t[i],(n=this.getDistant(r,e))>0&&(a.push(r),n>s&&(s=n,o=r));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?i=(i=i.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints))).concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints)):[e[0]]},getConvexHull:function(e){var t,i=!1,r=!1,n=!1,s=!1,o=null,a=null,h=null,l=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(!1===i||d.lat>i)&&(o=d,i=d.lat),(!1===r||d.lat<r)&&(a=d,r=d.lat),(!1===n||d.lng>n)&&(h=d,n=d.lng),(!1===s||d.lng<s)&&(l=d,s=d.lng)}return r!==i?(_=a,u=o):(_=l,u=h),[].concat(this.buildConvexHull([_,u],e),this.buildConvexHull([u,_],e))}},L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),r=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),r.push(e);return L.QuickHull.getConvexHull(r)}}),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),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?e=this._group.options.spiderfyShapePositions(t.length,i):t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,i):(i.y+=10,e=this._generatePointsCircle(t.length,i)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,r,n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,s=this._2PI/e,o=[];for(n=Math.max(n,35),o.length=e,i=0;i<e;i++)r=this._circleStartAngle+i*s,o[i]=new L.Point(t.x+n*Math.cos(r),t.y+n*Math.sin(r))._round();return o},_generatePointsSpiral:function(e,t){var i,r=this._group.options.spiderfyDistanceMultiplier,n=r*this._spiralLengthStart,s=r*this._spiralFootSeparation,o=r*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e;i>=0;i--)i<e&&(h[i]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round()),n+=o/(a+=s/n+5e-4*i);return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,r=i._map,n=i._featureGroup,s=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],n.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,r,n,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i<e.length;i++)s=a.layerPointToLatLng(t[i]),r=e[i],n=new L.Polyline([this._latlng,s],l),a.addLayer(n),r._spiderLeg=n,r._preSpiderfyLatlng=r._latlng,r.setLatLng(s),r.setZIndexOffset&&r.setZIndexOffset(1e6),h.addLayer(r);this.setOpacity(.3),o._ignoreMove=!1,o.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,r,n,s,o,a,h=this,l=this._group,u=l._map,_=l._featureGroup,d=this._latlng,p=u.latLngToLayerPoint(d),c=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),c?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,l._ignoreMove=!0,i=0;i<e.length;i++)r=e[i],a=u.layerPointToLatLng(t[i]),n=new L.Polyline([d,a],f),u.addLayer(n),r._spiderLeg=n,c&&(o=(s=n._path).getTotalLength()+.1,s.style.strokeDasharray=o,s.style.strokeDashoffset=o),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),_.addLayer(r),r._setPos&&r._setPos(p);for(l._forceLayout(),l._animationStart(),i=e.length-1;i>=0;i--)a=u.layerPointToLatLng(t[i]),(r=e[i])._preSpiderfyLatlng=r._latlng,r.setLatLng(a),r.clusterShow&&r.clusterShow(),c&&((s=(n=r._spiderLeg)._path).style.strokeDashoffset=0,n.setStyle({opacity:m}));this.setOpacity(.3),l._ignoreMove=!1,setTimeout(function(){l._animationEnd(),l.fire("spiderfied",{cluster:h,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,r,n,s,o,a=this,h=this._group,l=h._map,u=h._featureGroup,_=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),p=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)(t=d[i])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(_),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&u.removeLayer(t),p&&(s=(n=(r=t._spiderLeg)._path).getTotalLength()+.1,n.style.strokeDashoffset=s,r.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},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,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=i,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?r(e):"function"==typeof define&&define.amd?define(["exports"],r):r(((i=i||self).Leaflet=i.Leaflet||{},i.Leaflet.markercluster={}))});export default t();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e}from"./CKhiIZDr.js";import{H as t,M as r,P as n,j as o,r as l,v as i,z as s}from"./DNlPVBFF.js";import{F as c,T as a}from"./CjV7Y_ZR.js";import{n as u}from"./B69ImNZT.js";import{t as d}from"./D65dhVYX.js";import{t as f}from"./C3QMmYnY.js";var m=[[90,-180],[-90,180]],p=[0,0],h=new u,y=e=>e||"#fb8500",g=({folderId:u,onExplore:g,logoUrl:x})=>{const b=o(null),v=o(null),w=o(null),L=o(null),z=o(null),B=o(null),k=o(null),T=o(!1),j=o(u??null),O=o(null),C=o(!1),S=o(()=>{}),F=o(!1),I=r(()=>(()=>{try{const e=sessionStorage.getItem(a);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[Z,E]=n(!0),[q,A]=n(!1),{isFolderViewEnabled:N,activeFolderId:$,visibleEvents:M,visibleFolders:R,folderFeatureCollection:V,breadcrumb:J,isBusy:G,setActiveFolderId:H,goBack:P,activeFolder:W,folderBounds:_}=f({folderId:u});j.current=$,O.current=W,C.current=N,S.current=H;const U=()=>{const e=v.current,t=w.current;if(!e||!q||!t)return;const r=$??null,n=I?.folderId??null;if(!F.current&&I&&r===n)return void(F.current=!0);let o=null;if(_){const[e,r,n,l]=_;o=t.latLngBounds([[r,e],[l,n]])}o||(o=((e,t)=>{const r=e.latLngBounds([]);for(const n of t)"number"==typeof n.location?.x&&"number"==typeof n.location?.y&&r.extend([n.location.y,n.location.x]);return r.isValid()?r:null})(t,M)),o&&(T.current=!0,e.fitBounds(o,{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14}),F.current=!0)};return s(()=>{if(!b.current||v.current)return;let t;return(async()=>{try{const r=await import("./bCYrje4k.js").then(t=>/* @__PURE__ */e(t.default,1));"undefined"!=typeof window&&(window.L=r),await Promise.all([import("./CVBzx4z2.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./BJ85RnFv.js")]);const n=window.L??r,o=r.latLngBounds(m);if(!document.querySelector("link[data-qrati-leaflet-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.setAttribute("data-qrati-leaflet-css",""),document.head.appendChild(e)}if(!b.current)return;const l=r.map(b.current,{center:I?.center?[I.center.lat??p[0],I.center.lng??p[1]]:p,zoom:I?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:o,maxBoundsViscosity:1});r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(l);const i="function"==typeof n.markerClusterGroup?n.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,maxClusterRadius:48,zoomToBoundsOnClick:!1}):r.layerGroup(),s=e=>{const t=e?.layer;t&&(C.current?t.spiderfy?.():t.zoomToBounds?.())},c="function"==typeof n.heatLayer?n.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;c?.addTo(l),i.addTo(l);const u=()=>{k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{try{sessionStorage.setItem(a,JSON.stringify({center:l.getCenter(),zoom:l.getZoom(),folderId:j.current}))}catch{}},250)},d=()=>{if(T.current)return void(T.current=!1);if(!C.current)return;const e=O.current;if(!e?._id)return;const t=((e,t)=>{if(!t?.length)return null;const r=e.latLngBounds([]);for(const n of t)"number"==typeof n?.x&&"number"==typeof n?.y&&r.extend([n.y,n.x]);return r.isValid()?r:null})(n,e.boundary);if(!t)return;const r=l.getBoundsZoom(t,!1);l.getZoom()>=r-1||S.current(e.parentFolderId??null)};l.on("zoomend",u),l.on("moveend",u),l.on("zoomend",d),i.on?.("clusterclick",s),v.current=l,w.current=n,z.current=i,B.current=c;const f=()=>{l.invalidateSize(!1)};let h;"undefined"!=typeof ResizeObserver&&b.current&&(h=new ResizeObserver(f),h.observe(b.current)),requestAnimationFrame(f),A(!0),E(!1),t=()=>{h?.disconnect(),k.current&&(clearTimeout(k.current),k.current=null),l.off("zoomend",u),l.off("moveend",u),l.off("zoomend",d),i.off?.("clusterclick",s),l.remove(),w.current=null,v.current=null,L.current=null,z.current=null,B.current=null}}finally{E(!1)}})(),()=>{t?.()}},[I]),s(()=>{F.current=!1},[$]),s(()=>{if(!v.current||!q)return;const e=v.current,r=w.current;if(!r)return;B.current&&(N?(B.current.setLatLngs?.([]),e.hasLayer(B.current)&&e.removeLayer(B.current)):e.hasLayer(B.current)||B.current.addTo(e)),L.current&&(e.removeLayer(L.current),L.current=null),z.current?.clearLayers?.(),V.features.length>0&&(L.current=r.geoJSON(V,{style:e=>{const t=y(e?.properties?.color);return{color:t,weight:2,opacity:1,fillColor:t,fillOpacity:.22}},onEachFeature:(t,r)=>{const n=t.properties??{},o=String(n.name??"Folder"),l=y(n.color);r.bindTooltip(`<div style="font-size:12px;font-weight:700;color:${l};white-space:nowrap;">${o}</div>`,{permanent:!0,direction:"center",className:"qrati-folder-label",opacity:1}),r.on("click",()=>{const t=n.folderId;t&&("function"==typeof r.getBounds&&(T.current=!0,e.fitBounds(r.getBounds(),{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14})),H(String(t)))}),r.on("mouseover",()=>{r.setStyle({fillOpacity:.4,weight:3}),e.getContainer().style.cursor="pointer"}),r.on("mouseout",()=>{r.setStyle({fillOpacity:.28,weight:2}),e.getContainer().style.cursor=""})},pointToLayer:(t,n)=>{const o=t.properties??{},l=String(o.name??"Folder"),i=y(o.color);return r.circleMarker(n,{color:i,weight:2,fillColor:i,fillOpacity:.22,radius:10}).bindTooltip(`<div style="font-size:12px;font-weight:700;color:${i};white-space:nowrap;">${l}</div>`,{permanent:!0,direction:"top",offset:[0,-8],className:"qrati-folder-label",opacity:1}).on("click",()=>{const t=o.folderId;t&&(T.current=!0,e.setView(n,Math.max(e.getZoom(),10),{animate:!0}),H(String(t)))})}}).addTo(e));const n=M.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(n.length>0){if(n.map(e=>{const n=e.location.x,o=e.location.y,s=r.divIcon({className:"qrati-leaflet-marker-wrapper",html:`\n <div style="\n width: 36px;\n height: 36px;\n cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n ">${x?`<img src="${x}" style="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);" />`:""}</div>\n `,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),a=r.marker([o,n],{icon:s}),u=document.createElement("div");return u.style.width="fit-content",((e,r,n)=>{t(/* @__PURE__ */i(c,{client:h,children:/* @__PURE__ */i(l,{children:/* @__PURE__ */i(d,{event:e,onExplore:n})})}),r)})(e,u,g),a.bindPopup(u,{closeButton:!0,maxWidth:256}),a}).forEach(e=>z.current?.addLayer?.(e)),B.current&&!N){const e=[];n.forEach(t=>{const r=t.location.x,n=t.location.y,o="number"==typeof t.views&&t.views>0?t.views:1;e.push([n,r,o])});const t=n.reduce((e,t)=>{const r="number"==typeof t.views&&t.views>0?t.views:1;return r>e?r:e},1);B.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:t}),B.current.setLatLngs?.(e)}}else B.current?.setLatLngs?.([]);U()},[$,V,M,q,H,g,x,N]),s(()=>{U()},[$,_,q,M]),/* @__PURE__ */i("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",children:[
|
|
2
|
+
/* @__PURE__ */i("div",{class:"absolute top-4 left-4 z-200 flex w-[min(96%,420px)] flex-col gap-2 rounded-xl border border-slate-200 bg-white/95 p-3 shadow-lg backdrop-blur-sm",children:[/* @__PURE__ */i("div",{class:"flex items-center justify-between gap-3",children:[/* @__PURE__ */i("div",{children:[/* @__PURE__ */i("div",{class:"text-sm font-semibold text-slate-900",children:W?.name??"Home"}),/* @__PURE__ */i("div",{class:"text-xs text-slate-600",children:["Tap a folder region to drill into its contents. ",R?.length??0," folder",1===R?.length?"":"s",", ",M.length," event",1===M.length?"":"s"," total"]})]}),$&&/* @__PURE__ */i("button",{type:"button",onClick:P,class:"rounded bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-700 hover:bg-slate-200",children:"Back"})]}),J.length>0&&/* @__PURE__ */i("div",{class:"flex flex-wrap gap-1 text-xs text-slate-500",children:[/* @__PURE__ */i("span",{children:"All folders"}),J.map(e=>/* @__PURE__ */i("span",{class:"inline-flex items-center gap-1",children:[/* @__PURE__ */i("span",{class:"text-slate-300",children:"/"}),/* @__PURE__ */i("span",{children:e.name})]},e._id))]})]}),G&&/* @__PURE__ */i("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/70",children:/* @__PURE__ */i("div",{class:"border-primary flex h-12 w-12 animate-spin items-center justify-center rounded-full border-4 border-t-transparent"})}),Z&&/* @__PURE__ */i("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */i("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */i("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */i("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
3
|
+
/* @__PURE__ */i("div",{ref:b,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{g as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{A as e,u as t,v as r,w as o}from"./DNlPVBFF.js";import{
|
|
1
|
+
import{A as e,u as t,v as r,w as o}from"./DNlPVBFF.js";import{E as s,n as l}from"./CjV7Y_ZR.js";var i=e(()=>import("./C_Ll1SGr.js")),n=e(()=>import("./Boe_RDqD.js")),a=e(()=>import("./CDQEYcjb.js")),c=e(()=>import("./Bv-t_m1C.js")),p=({events:e,isLoading:p=!1})=>{const{organization:d}=l(),m=t(),g=d?.integrationSettings??{},x=g.mapProvider??"openstreetmap",u=g.mapTilerApiKey??"",f=g.googleMapsApiKey??"",h=g.mapboxApiKey??"",v=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),y="openstreetmap"===x&&!u||"google"===x&&!f||"mapbox"===x&&!h,w=e=>{m(s.GALLERY(e))};/* @__PURE__ */
|
|
2
2
|
return r("div",{class:"w relative mt-3 h-screen sm:mt-6",children:p?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary bt-transparent size-8 animate-spin rounded-full"})}):y?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"text-center",children:[
|
|
3
3
|
/* @__PURE__ */r("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */r("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */r("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
4
4
|
/* @__PURE__ */r("p",{class:"text-foreground",children:"Map API Key Required"}),
|
|
5
5
|
/* @__PURE__ */r("p",{class:"text-muted-foreground mt-1 text-xs",children:"Configure your map provider API key in the integration settings."})]})}):0===v.length?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"text-center",children:[
|
|
6
6
|
/* @__PURE__ */r("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */r("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */r("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
7
7
|
/* @__PURE__ */r("p",{class:"text-foreground tex",children:"No events with location data"}),
|
|
8
|
-
/* @__PURE__ */r("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need a location to appear on the map."})]})}):/* @__PURE__ */r(o,{fallback:/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary rounde size-8 animate-spin border-t-transparent"})}),children:["openstreetmap_free"===x&&/* @__PURE__ */r(
|
|
8
|
+
/* @__PURE__ */r("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need a location to appear on the map."})]})}):/* @__PURE__ */r(o,{fallback:/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary rounde size-8 animate-spin border-t-transparent"})}),children:["openstreetmap_free"===x&&/* @__PURE__ */r(i,{events:v,onExplore:w,logoUrl:d?.logoUrl}),"openstreetmap"===x&&/* @__PURE__ */r(n,{is3D:!0,events:v,apiKey:u,onExplore:w,logoUrl:d?.logoUrl}),"mapbox"===x&&/* @__PURE__ */r(c,{onExplore:w,apiKey:h,is3D:!1,logoUrl:d?.logoUrl}),"google"===x&&/* @__PURE__ */r(a,{events:v,apiKey:f,onExplore:w,logoUrl:d?.logoUrl})]})})};export{p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as e,L as t,M as r,P as s,R as n,_ as o,b as i,f as a,g as c,h as l,j as u,p as h,v as d,w as p,z as f}from"./DNlPVBFF.js";var y=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},m=new class extends y{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},w=new class{#s=g;#n=!1;setTimeoutProvider(e){this.#s=e}setTimeout(e,t){return this.#s.setTimeout(e,t)}clearTimeout(e){this.#s.clearTimeout(e)}setInterval(e,t){return this.#s.setInterval(e,t)}clearInterval(e){this.#s.clearInterval(e)}},b="undefined"==typeof window||"Deno"in globalThis;function v(){}function E(e,t){return"function"==typeof e?e(t):e}function R(e){return"number"==typeof e&&e>=0&&e!==1/0}function S(e,t){return Math.max(e+(t||0)-Date.now(),0)}function T(e,t){return"function"==typeof e?e(t):e}function O(e,t){return"function"==typeof e?e(t):e}function A(e,t){const{type:r="all",exact:s,fetchStatus:n,predicate:o,queryKey:i,stale:a}=e;if(i)if(s){if(t.queryHash!==C(i,t.options))return!1}else if(!N(t.queryKey,i))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||n&&n!==t.state.fetchStatus||o&&!o(t))}function I(e,t){const{exact:r,status:s,predicate:n,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(P(t.options.mutationKey)!==P(o))return!1}else if(!N(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||n&&!n(t))}function C(e,t){return(t?.queryKeyHashFn||P)(e)}function P(e){return JSON.stringify(e,(e,t)=>L(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function N(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>N(e[r],t[r]))}var D=Object.prototype.hasOwnProperty;function x(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=q(e)&&q(t);if(!(s||L(e)&&L(t)))return t;const n=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),i=o.length,a=s?new Array(i):{};let c=0;for(let l=0;l<i;l++){const i=s?l:o[l],u=e[i],h=t[i];if(u===h){a[i]=u,(s?l<n:D.call(e,i))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[i]=h;continue}const d=x(u,h,r+1);a[i]=d,d===u&&c++}return n===i&&c===n?e:a}function _(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function q(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function L(e){if(!U(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!U(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function U(e){return"[object Object]"===Object.prototype.toString.call(e)}function M(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?x(e,t):t}function F(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function k(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var j=/* @__PURE__ */Symbol();function $(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==j?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function G(e,t){return"function"==typeof e?e(...t):!!e}function V(e,t,r){let s,n=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Q=/* @__PURE__ */(()=>{let e=()=>b;return{isServer:()=>e(),setIsServer(t){e=t}}})();function H(){let e,t;const r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}var W=function(e){setTimeout(e,0)},z=function(){let e=[],t=0,r=e=>{e()},s=e=>{e()},n=W;const o=s=>{t?e.push(s):n(()=>{r(s)})};return{batch:o=>{let i;t++;try{i=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&n(()=>{s(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}}}(),B=new class extends y{#o=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function Z(e){return Math.min(1e3*2**e,3e4)}function K(e){return"online"!==(e??"online")||B.isOnline()}var J=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Y(e){let t,r=!1,s=0;const n=H(),o=()=>"pending"!==n.status,i=()=>m.isFocused()&&("always"===e.networkMode||B.isOnline())&&e.canRun(),a=()=>K(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),n.resolve(e))},l=e=>{o()||(t?.(),n.reject(e))},u=()=>new Promise(r=>{t=e=>{(o()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let t;const n=0===s?e.initialPromise:void 0;try{t=n??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const n=e.retry??(Q.isServer()?0:3),a=e.retryDelay??Z,c="function"==typeof a?a(s,t):a,d=!0===n||"number"==typeof n&&s<n||"function"==typeof n&&n(s,t);var p;!r&&d?(s++,e.onFail?.(s,t),(p=c,new Promise(e=>{w.setTimeout(e,p)})).then(()=>i()?void 0:u()).then(()=>{r?l(t):h()})):l(t)})};return{promise:n,status:()=>n.status,cancel:t=>{if(!o()){const r=new J(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?h():u().then(h),n)}}var X=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R(this.gcTime)&&(this.#i=w.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Q.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(w.clearTimeout(this.#i),this.#i=void 0)}},ee=class extends X{#a;#c;#l;#u;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#l=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=se(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=se(this.options);void 0!==e.data&&(this.setState(re(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,t){const r=M(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#h?.promise;return this.#h?.cancel(e),t?t.then(v).catch(v):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#a}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==O(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===T(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!S(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p||this.#y()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#h?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},n=()=>{const e=$(this.options,t),r=(()=>{const e={client:this.#u,queryKey:this.queryKey,meta:this.meta};return s(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:n};return s(e),e})();this.options.behavior?.onFetch(o,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=Y({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof J&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#h.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof J){if(i.silent)return this.#h.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#f({type:"error",error:i}),this.#l.config.onError?.(i,this),this.#l.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...te(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...re(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?r:void 0,r;case"error":const s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),z.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function te(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:K(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function re(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function se(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ne=class extends y{constructor(e,t){super(),this.options=t,this.#u=e,this.#m=null,this.#g=H(),this.bindMethods(),this.setOptions(t)}#u;#w=void 0;#b=void 0;#v=void 0;#E;#R;#g;#m;#S;#T;#O;#A;#I;#C;#P=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),oe(this.#w,this.options)?this.#N():this.updateResult(),this.#D())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ie(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ie(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#x(),this.#_(),this.#w.removeObserver(this)}setOptions(e){const t=this.options,r=this.#w;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof O(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#w.setOptions(this.options),t._defaulted&&!_(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const s=this.hasListeners();s&&ae(this.#w,r,this.options,t)&&this.#N(),this.updateResult(),!s||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&T(this.options.staleTime,this.#w)===T(t.staleTime,this.#w)||this.#L();const n=this.#U();!s||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&n===this.#C||this.#M(n)}getOptimisticResult(e){const t=this.#u.getQueryCache().build(this.#u,e),r=this.createResult(t,e);var s;return s=r,_(this.getCurrentResult(),s)||(this.#v=r,this.#R=this.options,this.#E=this.#w.state),r}getCurrentResult(){return this.#v}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#g.status||this.#g.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#P.add(e)}getCurrentQuery(){return this.#w}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#N({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#v))}#N(e){this.#q();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(v)),t}#L(){this.#x();const e=T(this.options.staleTime,this.#w);if(Q.isServer()||this.#v.isStale||!R(e))return;const t=S(this.#v.dataUpdatedAt,e)+1;this.#A=w.setTimeout(()=>{this.#v.isStale||this.updateResult()},t)}#U(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#M(e){this.#_(),this.#C=e,!Q.isServer()&&!1!==O(this.options.enabled,this.#w)&&R(this.#C)&&0!==this.#C&&(this.#I=w.setInterval(()=>{(this.options.refetchIntervalInBackground||m.isFocused())&&this.#N()},this.#C))}#D(){this.#L(),this.#M(this.#U())}#x(){void 0!==this.#A&&(w.clearTimeout(this.#A),this.#A=void 0)}#_(){void 0!==this.#I&&(w.clearInterval(this.#I),this.#I=void 0)}createResult(e,t){const r=this.#w,s=this.options,n=this.#v,o=this.#E,i=this.#R,a=e!==r?e.state:this.#b,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const n=this.hasListeners(),o=!n&&oe(e,t),i=n&&ae(e,r,t,s);(o||i)&&(u={...u,...te(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:f}=u;l=u.data;let y=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===f){let e;n?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=n.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#O?.state.data,this.#O):t.placeholderData,void 0!==e&&(f="success",l=M(n?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!y)if(n&&l===o?.data&&t.select===this.#S)l=this.#T;else try{this.#S=t.select,l=t.select(l),l=M(n?.data,l,t),this.#T=l,this.#m=null}catch(R){this.#m=R}this.#m&&(d=this.#m,l=this.#T,p=Date.now(),f="error");const m="fetching"===u.fetchStatus,g="pending"===f,w="error"===f,b=g&&m,v=void 0!==l,E={status:f,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===f,isError:w,isInitialLoading:b,isLoading:b,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:w&&!v,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:w&&v,isStale:ce(e,t),refetch:this.refetch,promise:this.#g,isEnabled:!1!==O(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==E.data,s="error"===E.status&&!t,n=e=>{s?e.reject(E.error):t&&e.resolve(E.data)},o=()=>{n(this.#g=E.promise=H())},i=this.#g;switch(i.status){case"pending":e.queryHash===r.queryHash&&n(i);break;case"fulfilled":(s||E.data!==i.value)&&o();break;case"rejected":s&&E.error===i.reason||o()}}return E}updateResult(){const e=this.#v,t=this.createResult(this.#w,this.options);this.#E=this.#w.state,this.#R=this.options,void 0!==this.#E.data&&(this.#O=this.#w),_(t,e)||(this.#v=t,this.#F({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#P.size)return!0;const s=new Set(r??this.#P);return this.options.throwOnError&&s.add("error"),Object.keys(this.#v).some(t=>{const r=t;return this.#v[r]!==e[r]&&s.has(r)})})()}))}#q(){const e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#D()}#F(e){z.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#v)}),this.#u.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})})}};function oe(e,t){return function(e,t){return!1!==O(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&ie(e,t,t.refetchOnMount)}function ie(e,t,r){if(!1!==O(t.enabled,e)&&"static"!==T(t.staleTime,e)){const s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&ce(e,t)}return!1}function ae(e,t,r,s){return(e!==t||!1===O(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ce(e,r)}function ce(e,t){return!1!==O(t.enabled,e)&&e.isStaleByTime(T(t.staleTime,e))}var le=e(void 0),ue=e=>{const t=n(le);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},he=({client:e,children:t})=>(f(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */d(le.Provider,{value:e,children:t})),de=e(!1);de.Provider;var pe=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),fe=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ye(e,r,o){const a=n(de),c=n(pe),l=ue(o),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const h=l.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),s=e.staleTime;e.staleTime="function"==typeof s?(...e)=>r(s(...e)):r(s),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(u),((e,t,r)=>{const s=r?.state.error&&"function"==typeof e.throwOnError?G(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))})(u,c,h),(e=>{f(()=>{e.clearReset()},[e])})(c);const d=!l.getQueryCache().get(u.queryHash),[p]=s(()=>new r(l,u)),y=p.getOptimisticResult(u),m=!a&&!1!==e.subscribed;if(i(t(e=>{const t=m?p.subscribe(z.batchCalls(e)):v;return p.updateResult(),t},[p,m]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),f(()=>{p.setOptions(u)},[u,p]),((e,t)=>e?.suspense&&t.isPending)(u,y))throw fe(u,p,c);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||G(r,[e.error,s])))({result:y,errorResetBoundary:c,throwOnError:u.throwOnError,query:h,suspense:u.suspense}))throw y.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,y),u.experimental_prefetchInRender&&!Q.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(y,a)&&(d?fe(u,p,c):h?.promise)?.catch(v).finally(()=>{p.updateResult()}),u.notifyOnChangeProps?y:p.trackResult(y)}function me(e,t){return ye(e,ne,t)}var ge=class extends Error{response;request;options;constructor(e,t,r){const s=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${s?`status code ${s}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},we=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},be=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new we(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},ve=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,s="function"==typeof globalThis.Request;if(r&&s)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&"unsupported BodyInit type"===n.message)return!1;throw n}return e&&!t})(),Ee="function"==typeof globalThis.AbortController,Re="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Se="function"==typeof globalThis.ReadableStream,Te="function"==typeof globalThis.FormData,Oe=["get","post","put","patch","head","delete"],Ae={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Ie=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ce=Symbol("stop"),Pe=class{options;constructor(e){this.options=e}},Ne=e=>new Pe(e),De={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},xe={next:!0},_e={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},qe=(e,t,r)=>{let s,n=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),s){n+=s.byteLength;let e=0===t?0:n/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,n),transferredBytes:n},s)}s=e},flush(){s&&(n+=s.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},s))}}))},Le=e=>null!==e&&"object"==typeof e,Ue=(...e)=>{for(const t of e)if((!Le(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return $e({},...e)},Me=(e={},t={})=>{const r=new globalThis.Headers(e),s=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(const[o,i]of n.entries())s&&"undefined"===i||void 0===i?r.delete(o):r.set(o,i);return r};function Fe(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:$e(e[r]??[],t[r]??[])}var ke=(e={},t={})=>({beforeRequest:Fe(e,t,"beforeRequest"),beforeRetry:Fe(e,t,"beforeRetry"),afterResponse:Fe(e,t,"afterResponse"),beforeError:Fe(e,t,"beforeError")}),je=(e,t)=>{const r=new URLSearchParams;for(const s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams)for(const[e,t]of s.entries())r.append(e,t);else if(Array.isArray(s))for(const e of s){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(Le(s))for(const[e,t]of Object.entries(s))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(s);for(const[t,s]of e.entries())r.append(t,s)}return r},$e=(...e)=>{let t,r={},s={},n={};const o=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(Le(i)){for(let[e,s]of Object.entries(i))if("signal"===e&&s instanceof globalThis.AbortSignal)o.push(s);else if("context"!==e)"searchParams"!==e?(Le(s)&&e in r&&(s=$e(r[e],s)),r={...r,[e]:s}):t=null==s?void 0:void 0===t?s:je(t,s);else{if(null!=s&&(!Le(s)||Array.isArray(s)))throw new TypeError("The `context` option must be an object");r={...r,context:null==s?{}:{...r.context,...s}}}Le(i.hooks)&&(n=ke(n,i.hooks),r.hooks=n),Le(i.headers)&&(s=Me(s,i.headers),r.headers=s)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=Re?AbortSignal.any(o):o.at(-1)),r},Ge=e=>Oe.includes(e)?e.toUpperCase():e,Ve={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Qe=(e={})=>{if("number"==typeof e)return{...Ve,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...Ve,...t}},He=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},We=class e{static create(t,r){const s=new e(t,r),n=s.#k(async()=>{if("number"==typeof s.#j.timeout&&s.#j.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await s.#$();for(const r of s.#j.hooks.afterResponse){const n=s.#G(e.clone());let o;try{o=await r(s.request,s.#V(),n,{retryCount:s.#Q})}catch(t){throw s.#H(n),s.#H(e),t}if(o instanceof Pe)throw s.#H(n),s.#H(e),new be(o.options);const i=o instanceof globalThis.Response?o:e;n!==i&&s.#H(n),e!==i&&s.#H(e),e=i}if(s.#G(e),!e.ok&&("function"==typeof s.#j.throwHttpErrors?s.#j.throwHttpErrors(e.status):s.#j.throwHttpErrors)){let t=new ge(e,s.request,s.#V());for(const e of s.#j.hooks.beforeError)t=await e(t,{retryCount:s.#Q});throw t}if(s.#j.onDownloadProgress){if("function"!=typeof s.#j.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Se)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return s.#H(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(qe(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,s.#j.onDownloadProgress)}return e}).finally(()=>{const e=s.#W;s.#z(e?.body??void 0),s.#z(s.request.body??void 0)});for(const[e,o]of Object.entries(Ae))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(n[e]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||o);const t=await n;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return n}static#B(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#Z;#Q=0;#K;#j;#W;#J;#Y;constructor(t,r={}){if(this.#K=t,this.#j={...r,headers:Me(this.#K.headers,r.headers),hooks:ke({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Ge(r.method??this.#K.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Qe(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#K&&!(this.#K instanceof URL||this.#K instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#j.prefixUrl&&"string"==typeof this.#K){if(this.#K.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#j.prefixUrl.endsWith("/")||(this.#j.prefixUrl+="/"),this.#K=this.#j.prefixUrl+this.#K}Ee&&Re&&(this.#J=this.#j.signal??this.#K.signal,this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal),ve&&(this.#j.duplex="half"),void 0!==this.#j.json&&(this.#j.body=this.#j.stringifyJson?.(this.#j.json)??JSON.stringify(this.#j.json),this.#j.headers.set("content-type",this.#j.headers.get("content-type")??"application/json"));const s=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#K instanceof globalThis.Request&&(Te&&this.#j.body instanceof globalThis.FormData||this.#j.body instanceof URLSearchParams)&&!s&&this.#j.headers.delete("content-type"),this.request=new globalThis.Request(this.#K,this.#j),void 0!==(n=this.#j.searchParams)&&(Array.isArray(n)?n.length>0:n instanceof URLSearchParams?n.size>0:"object"==typeof n?Object.keys(n).length>0:"string"==typeof n?n.trim().length>0:Boolean(n))){const t="?"+("string"==typeof this.#j.searchParams?this.#j.searchParams.replace(/^\?/,""):new URLSearchParams(e.#B(this.#j.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#j)}var n;if(this.#j.onUploadProgress){if("function"!=typeof this.#j.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!ve)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#X(this.request,this.#j.body??void 0)}}#ee(){const e=this.#j.retry.delay(this.#Q);let t=e;!0===this.#j.retry.jitter?t=Math.random()*e:"function"==typeof this.#j.retry.jitter&&(t=this.#j.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#j.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#te(e){if(this.#Q++,this.#Q>this.#j.retry.limit)throw e;const t=e instanceof Error?e:new we(e);if(t instanceof be)return t.customDelay??this.#ee();if(!this.#j.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#j.retry.shouldRetry){const r=await this.#j.retry.shouldRetry({error:t,retryCount:this.#Q});if(!1===r)throw e;if(!0===r)return this.#ee()}if(function(e){return e instanceof He||e?.name===He.name}(e)&&!this.#j.retry.retryOnTimeout)throw e;if(function(e){return e instanceof ge||e?.name===ge.name}(e)){if(!this.#j.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#j.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#j.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#ee()}#G(e){return this.#j.parseJson&&(e.json=async()=>this.#j.parseJson(await e.text())),e}#z(e){e&&e.cancel().catch(()=>{})}#H(e){this.#z(e.body??void 0)}async#k(e){try{return await e()}catch(t){const r=Math.min(await this.#te(t),2147483647);if(this.#Q<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,s)=>{function n(){clearTimeout(o),s(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}(r,this.#J?{signal:this.#J}:{}),t instanceof be&&t.customRequest){const e=this.#j.signal?new globalThis.Request(t.customRequest,{signal:this.#j.signal}):new globalThis.Request(t.customRequest);this.#re(e)}for(const e of this.#j.hooks.beforeRetry){const r=await e({request:this.request,options:this.#V(),error:t,retryCount:this.#Q});if(r instanceof globalThis.Request){this.#re(r);break}if(r instanceof globalThis.Response)return r;if(r===Ce)return}return this.#k(e)}}async#$(){this.#Z?.signal.aborted&&(this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#j.signal}));for(const t of this.#j.hooks.beforeRequest){const e=await t(this.request,this.#V(),{retryCount:this.#Q});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#re(e);break}}const e=((e,t)=>{const r={};for(const s in t)Object.hasOwn(t,s)&&(s in _e||s in De||s in e&&!(s in xe)||(r[s]=t[s]));return r})(this.request,this.#j);return this.#W=this.request,this.request=this.#W.clone(),!1===this.#j.timeout?this.#j.fetch(this.#W,e):async function(e,t,r,s){return new Promise((n,o)=>{const i=setTimeout(()=>{r&&r.abort(),o(new He(e))},s.timeout);s.fetch(e,t).then(n).catch(o).then(()=>{clearTimeout(i)})})}(this.#W,e,this.#Z,this.#j)}#V(){if(!this.#Y){const{hooks:e,...t}=this.#j;this.#Y=Object.freeze(t)}return this.#Y}#re(e){this.#Y=void 0,this.request=this.#X(e)}#X(e,t){return this.#j.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const s=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,s]of e)t+=Ie,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof s?(new TextEncoder).encode(s).length:s.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:qe(e.body,s,t)})})(e,this.#j.onUploadProgress,t??this.#j.body??void 0):e}},ze=e=>{const t=(t,r)=>We.create(t,Ue(e,r));for(const r of Oe)t[r]=(t,s)=>We.create(t,Ue(e,s,{method:r}));return t.create=e=>ze(Ue(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ze(Ue(e,t))),t.stop=Ce,t.retry=Ne,t},Be=ze(),Ze={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`},Ke={ORGANIZATION_SETTINGS:e=>`https://qrati.com/org/${e}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:e=>`https://qrati.com/org/${e}/settings/integration`,ORGANIZATION_DASHBOARD:e=>`https://qrati.com/org/${e}/dashboard`,ORGANIZATION_ADMINS:e=>`https://qrati.com/org/${e}/admins`,EVENT_SETTINGS_BASIC_DETAILS:e=>`https://qrati.com/event/${e}/settings`,EVENT_REVIEW_CONTENTS:e=>`https://qrati.com/event/${e}/review-contents`,EVENT_DEEP_SEARCH:e=>`https://qrati.com/event/${e}/deep-search`,EVENT_GENERATE_ARTICLE:e=>`https://qrati.com/event/${e}/generate-article`,EVENT_ACCESS_REQUESTS:e=>`https://qrati.com/event/${e}/access-requests`,EVENT_SHOT_INSPECTOR:e=>`https://qrati.com/event/${e}/shot-inspector`,EVENT_CURATION_DETAILS:e=>`https://qrati.com/event/${e}/curation-details`},Je={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ye="https://qrati.com/api/connect",Xe={INITIALIZE_SESSION:`${Ye}/session/initialize`,REGISTER:`${Ye}/auth/register`,LOGIN:`${Ye}/auth/login`,LOGOUT:`${Ye}/auth/logout`,UPDATE_SESSION:`${Ye}/session/update`,ACCEPT_TERMS:`${Ye}/auth/accept-terms`,EXTERNAL_LOGIN:`${Ye}/auth/external-login`,PUBLIC_EVENTS:`${Ye}/event/public-events`,SEARCH_EVENTS:`${Ye}/event/search`,FOLDER_DETAILS:`${Ye}/folder/details`,NESTED_FOLDERS:`${Ye}/folder/nested-folders`,GET_EVENT_POINTS:`${Ye}/event/points`,ELIGIBLE_TO_CURATE:`${Ye}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Ye}/content/for-curation`,CURATE_CONTENT:`${Ye}/content/curate`,GET_LEADERBOARD:`${Ye}/event/leaderboard`,GET_UPLOAD_COUNT:`${Ye}/event/upload-count`,SINGLE_UPLOAD:`${Ye}/content/single-upload`,UPDATE_REACTION:`${Ye}/content/update-reaction`,EVENT_DATA:`${Ye}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Ye}/event/update-layout`,GET_EVENT_STATISTICS:`${Ye}/event/statistics`,GET_CONTENTS:`${Ye}/content/for-gallery`,SEARCH_CONTENTS:`${Ye}/content/search`,GET_CONTENTS_COUNT:`${Ye}/content/count`,UPDATE_AD_ANALYTICS:`${Ye}/event/update-ad-analytics`,INCREMENT_EVENT_VIEW:`${Ye}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Ye}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Ye}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Ye}/auth/reset-password`,REPORT_ERROR:`${Ye}/session/report-error`},et={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},tt={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD"},rt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},st={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},nt={WAITING:"Waiting",UPLOADING:"Uploading",RETRYING:"Retrying",DONE:"Done",FAILED:"Failed",ERROR:"Error"},ot=1048576,it={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},at={WAITING:"Waiting",PROCESSING:"Processing",DONE:"Done"},ct={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},lt={CONTEST:"CONTEST",REACTION:"REACTION"},ut={GRID:"grid",SINGLE:"single"},ht={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},dt={[ht.POPULAR]:{label:"Popular",sortField:"score"},[ht.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[ht.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},pt=ht.UPLOAD_TIME,ft={ASC:"asc",DESC:"desc"},yt={[ft.ASC]:{label:"Ascending",sortOrder:""},[ft.DESC]:{label:"Descending",sortOrder:"-"}},mt=ft.DESC,gt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},wt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},bt={[wt.LINK]:"material-symbols:open-in-new-rounded",[wt.EMAIL]:"material-symbols:alternate-email-rounded",[wt.PHONE]:"material-symbols:call-outline",[wt.SMS]:"material-symbols:sms-outline-rounded",[wt.WHATSAPP]:"logos:whatsapp-icon",[wt.MESSENGER]:"logos:messenger"},vt={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},Et={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`};function Rt({title:e,children:t}){/* @__PURE__ */
|
|
1
|
+
import{G as e,L as t,M as r,P as s,R as n,_ as o,b as i,f as a,g as c,h as l,j as u,p as h,v as d,w as p,z as f}from"./DNlPVBFF.js";var y=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},m=new class extends y{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},w=new class{#s=g;#n=!1;setTimeoutProvider(e){this.#s=e}setTimeout(e,t){return this.#s.setTimeout(e,t)}clearTimeout(e){this.#s.clearTimeout(e)}setInterval(e,t){return this.#s.setInterval(e,t)}clearInterval(e){this.#s.clearInterval(e)}},b="undefined"==typeof window||"Deno"in globalThis;function v(){}function E(e,t){return"function"==typeof e?e(t):e}function R(e){return"number"==typeof e&&e>=0&&e!==1/0}function S(e,t){return Math.max(e+(t||0)-Date.now(),0)}function T(e,t){return"function"==typeof e?e(t):e}function O(e,t){return"function"==typeof e?e(t):e}function A(e,t){const{type:r="all",exact:s,fetchStatus:n,predicate:o,queryKey:i,stale:a}=e;if(i)if(s){if(t.queryHash!==C(i,t.options))return!1}else if(!N(t.queryKey,i))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||n&&n!==t.state.fetchStatus||o&&!o(t))}function I(e,t){const{exact:r,status:s,predicate:n,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(P(t.options.mutationKey)!==P(o))return!1}else if(!N(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||n&&!n(t))}function C(e,t){return(t?.queryKeyHashFn||P)(e)}function P(e){return JSON.stringify(e,(e,t)=>L(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function N(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>N(e[r],t[r]))}var D=Object.prototype.hasOwnProperty;function x(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=q(e)&&q(t);if(!(s||L(e)&&L(t)))return t;const n=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),i=o.length,a=s?new Array(i):{};let c=0;for(let l=0;l<i;l++){const i=s?l:o[l],u=e[i],h=t[i];if(u===h){a[i]=u,(s?l<n:D.call(e,i))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[i]=h;continue}const d=x(u,h,r+1);a[i]=d,d===u&&c++}return n===i&&c===n?e:a}function _(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function q(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function L(e){if(!U(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!U(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function U(e){return"[object Object]"===Object.prototype.toString.call(e)}function M(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?x(e,t):t}function F(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function k(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var j=/* @__PURE__ */Symbol();function $(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==j?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function G(e,t){return"function"==typeof e?e(...t):!!e}function V(e,t,r){let s,n=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Q=/* @__PURE__ */(()=>{let e=()=>b;return{isServer:()=>e(),setIsServer(t){e=t}}})();function H(){let e,t;const r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}var W=function(e){setTimeout(e,0)},z=function(){let e=[],t=0,r=e=>{e()},s=e=>{e()},n=W;const o=s=>{t?e.push(s):n(()=>{r(s)})};return{batch:o=>{let i;t++;try{i=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&n(()=>{s(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}}}(),B=new class extends y{#o=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function Z(e){return Math.min(1e3*2**e,3e4)}function K(e){return"online"!==(e??"online")||B.isOnline()}var J=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Y(e){let t,r=!1,s=0;const n=H(),o=()=>"pending"!==n.status,i=()=>m.isFocused()&&("always"===e.networkMode||B.isOnline())&&e.canRun(),a=()=>K(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),n.resolve(e))},l=e=>{o()||(t?.(),n.reject(e))},u=()=>new Promise(r=>{t=e=>{(o()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let t;const n=0===s?e.initialPromise:void 0;try{t=n??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const n=e.retry??(Q.isServer()?0:3),a=e.retryDelay??Z,c="function"==typeof a?a(s,t):a,d=!0===n||"number"==typeof n&&s<n||"function"==typeof n&&n(s,t);var p;!r&&d?(s++,e.onFail?.(s,t),(p=c,new Promise(e=>{w.setTimeout(e,p)})).then(()=>i()?void 0:u()).then(()=>{r?l(t):h()})):l(t)})};return{promise:n,status:()=>n.status,cancel:t=>{if(!o()){const r=new J(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?h():u().then(h),n)}}var X=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R(this.gcTime)&&(this.#i=w.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Q.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(w.clearTimeout(this.#i),this.#i=void 0)}},ee=class extends X{#a;#c;#l;#u;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#l=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=se(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=se(this.options);void 0!==e.data&&(this.setState(re(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,t){const r=M(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#h?.promise;return this.#h?.cancel(e),t?t.then(v).catch(v):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#a}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==O(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===T(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!S(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p||this.#y()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#h?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},n=()=>{const e=$(this.options,t),r=(()=>{const e={client:this.#u,queryKey:this.queryKey,meta:this.meta};return s(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:n};return s(e),e})();this.options.behavior?.onFetch(o,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=Y({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof J&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#h.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof J){if(i.silent)return this.#h.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#f({type:"error",error:i}),this.#l.config.onError?.(i,this),this.#l.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...te(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...re(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?r:void 0,r;case"error":const s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),z.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function te(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:K(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function re(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function se(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ne=class extends y{constructor(e,t){super(),this.options=t,this.#u=e,this.#m=null,this.#g=H(),this.bindMethods(),this.setOptions(t)}#u;#w=void 0;#b=void 0;#v=void 0;#E;#R;#g;#m;#S;#T;#O;#A;#I;#C;#P=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),oe(this.#w,this.options)?this.#N():this.updateResult(),this.#D())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ie(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ie(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#x(),this.#_(),this.#w.removeObserver(this)}setOptions(e){const t=this.options,r=this.#w;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof O(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#w.setOptions(this.options),t._defaulted&&!_(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const s=this.hasListeners();s&&ae(this.#w,r,this.options,t)&&this.#N(),this.updateResult(),!s||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&T(this.options.staleTime,this.#w)===T(t.staleTime,this.#w)||this.#L();const n=this.#U();!s||this.#w===r&&O(this.options.enabled,this.#w)===O(t.enabled,this.#w)&&n===this.#C||this.#M(n)}getOptimisticResult(e){const t=this.#u.getQueryCache().build(this.#u,e),r=this.createResult(t,e);var s;return s=r,_(this.getCurrentResult(),s)||(this.#v=r,this.#R=this.options,this.#E=this.#w.state),r}getCurrentResult(){return this.#v}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#g.status||this.#g.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#P.add(e)}getCurrentQuery(){return this.#w}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#N({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#v))}#N(e){this.#q();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(v)),t}#L(){this.#x();const e=T(this.options.staleTime,this.#w);if(Q.isServer()||this.#v.isStale||!R(e))return;const t=S(this.#v.dataUpdatedAt,e)+1;this.#A=w.setTimeout(()=>{this.#v.isStale||this.updateResult()},t)}#U(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#M(e){this.#_(),this.#C=e,!Q.isServer()&&!1!==O(this.options.enabled,this.#w)&&R(this.#C)&&0!==this.#C&&(this.#I=w.setInterval(()=>{(this.options.refetchIntervalInBackground||m.isFocused())&&this.#N()},this.#C))}#D(){this.#L(),this.#M(this.#U())}#x(){void 0!==this.#A&&(w.clearTimeout(this.#A),this.#A=void 0)}#_(){void 0!==this.#I&&(w.clearInterval(this.#I),this.#I=void 0)}createResult(e,t){const r=this.#w,s=this.options,n=this.#v,o=this.#E,i=this.#R,a=e!==r?e.state:this.#b,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const n=this.hasListeners(),o=!n&&oe(e,t),i=n&&ae(e,r,t,s);(o||i)&&(u={...u,...te(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:f}=u;l=u.data;let y=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===f){let e;n?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=n.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#O?.state.data,this.#O):t.placeholderData,void 0!==e&&(f="success",l=M(n?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!y)if(n&&l===o?.data&&t.select===this.#S)l=this.#T;else try{this.#S=t.select,l=t.select(l),l=M(n?.data,l,t),this.#T=l,this.#m=null}catch(R){this.#m=R}this.#m&&(d=this.#m,l=this.#T,p=Date.now(),f="error");const m="fetching"===u.fetchStatus,g="pending"===f,w="error"===f,b=g&&m,v=void 0!==l,E={status:f,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===f,isError:w,isInitialLoading:b,isLoading:b,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:w&&!v,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:w&&v,isStale:ce(e,t),refetch:this.refetch,promise:this.#g,isEnabled:!1!==O(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==E.data,s="error"===E.status&&!t,n=e=>{s?e.reject(E.error):t&&e.resolve(E.data)},o=()=>{n(this.#g=E.promise=H())},i=this.#g;switch(i.status){case"pending":e.queryHash===r.queryHash&&n(i);break;case"fulfilled":(s||E.data!==i.value)&&o();break;case"rejected":s&&E.error===i.reason||o()}}return E}updateResult(){const e=this.#v,t=this.createResult(this.#w,this.options);this.#E=this.#w.state,this.#R=this.options,void 0!==this.#E.data&&(this.#O=this.#w),_(t,e)||(this.#v=t,this.#F({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#P.size)return!0;const s=new Set(r??this.#P);return this.options.throwOnError&&s.add("error"),Object.keys(this.#v).some(t=>{const r=t;return this.#v[r]!==e[r]&&s.has(r)})})()}))}#q(){const e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#D()}#F(e){z.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#v)}),this.#u.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})})}};function oe(e,t){return function(e,t){return!1!==O(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&ie(e,t,t.refetchOnMount)}function ie(e,t,r){if(!1!==O(t.enabled,e)&&"static"!==T(t.staleTime,e)){const s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&ce(e,t)}return!1}function ae(e,t,r,s){return(e!==t||!1===O(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ce(e,r)}function ce(e,t){return!1!==O(t.enabled,e)&&e.isStaleByTime(T(t.staleTime,e))}var le=e(void 0),ue=e=>{const t=n(le);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},he=({client:e,children:t})=>(f(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */d(le.Provider,{value:e,children:t})),de=e(!1);de.Provider;var pe=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),fe=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ye(e,r,o){const a=n(de),c=n(pe),l=ue(o),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const h=l.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),s=e.staleTime;e.staleTime="function"==typeof s?(...e)=>r(s(...e)):r(s),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(u),((e,t,r)=>{const s=r?.state.error&&"function"==typeof e.throwOnError?G(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))})(u,c,h),(e=>{f(()=>{e.clearReset()},[e])})(c);const d=!l.getQueryCache().get(u.queryHash),[p]=s(()=>new r(l,u)),y=p.getOptimisticResult(u),m=!a&&!1!==e.subscribed;if(i(t(e=>{const t=m?p.subscribe(z.batchCalls(e)):v;return p.updateResult(),t},[p,m]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),f(()=>{p.setOptions(u)},[u,p]),((e,t)=>e?.suspense&&t.isPending)(u,y))throw fe(u,p,c);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||G(r,[e.error,s])))({result:y,errorResetBoundary:c,throwOnError:u.throwOnError,query:h,suspense:u.suspense}))throw y.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,y),u.experimental_prefetchInRender&&!Q.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(y,a)&&(d?fe(u,p,c):h?.promise)?.catch(v).finally(()=>{p.updateResult()}),u.notifyOnChangeProps?y:p.trackResult(y)}function me(e,t){return ye(e,ne,t)}var ge=class extends Error{response;request;options;constructor(e,t,r){const s=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${s?`status code ${s}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},we=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},be=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new we(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},ve=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,s="function"==typeof globalThis.Request;if(r&&s)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&"unsupported BodyInit type"===n.message)return!1;throw n}return e&&!t})(),Ee="function"==typeof globalThis.AbortController,Re="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Se="function"==typeof globalThis.ReadableStream,Te="function"==typeof globalThis.FormData,Oe=["get","post","put","patch","head","delete"],Ae={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Ie=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ce=Symbol("stop"),Pe=class{options;constructor(e){this.options=e}},Ne=e=>new Pe(e),De={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},xe={next:!0},_e={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},qe=(e,t,r)=>{let s,n=0;return e.pipeThrough(new TransformStream({transform(e,o){if(o.enqueue(e),s){n+=s.byteLength;let e=0===t?0:n/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,n),transferredBytes:n},s)}s=e},flush(){s&&(n+=s.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},s))}}))},Le=e=>null!==e&&"object"==typeof e,Ue=(...e)=>{for(const t of e)if((!Le(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return $e({},...e)},Me=(e={},t={})=>{const r=new globalThis.Headers(e),s=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(const[o,i]of n.entries())s&&"undefined"===i||void 0===i?r.delete(o):r.set(o,i);return r};function Fe(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:$e(e[r]??[],t[r]??[])}var ke=(e={},t={})=>({beforeRequest:Fe(e,t,"beforeRequest"),beforeRetry:Fe(e,t,"beforeRetry"),afterResponse:Fe(e,t,"afterResponse"),beforeError:Fe(e,t,"beforeError")}),je=(e,t)=>{const r=new URLSearchParams;for(const s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams)for(const[e,t]of s.entries())r.append(e,t);else if(Array.isArray(s))for(const e of s){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(Le(s))for(const[e,t]of Object.entries(s))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(s);for(const[t,s]of e.entries())r.append(t,s)}return r},$e=(...e)=>{let t,r={},s={},n={};const o=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(Le(i)){for(let[e,s]of Object.entries(i))if("signal"===e&&s instanceof globalThis.AbortSignal)o.push(s);else if("context"!==e)"searchParams"!==e?(Le(s)&&e in r&&(s=$e(r[e],s)),r={...r,[e]:s}):t=null==s?void 0:void 0===t?s:je(t,s);else{if(null!=s&&(!Le(s)||Array.isArray(s)))throw new TypeError("The `context` option must be an object");r={...r,context:null==s?{}:{...r.context,...s}}}Le(i.hooks)&&(n=ke(n,i.hooks),r.hooks=n),Le(i.headers)&&(s=Me(s,i.headers),r.headers=s)}return void 0!==t&&(r.searchParams=t),o.length>0&&(1===o.length?r.signal=o[0]:r.signal=Re?AbortSignal.any(o):o.at(-1)),r},Ge=e=>Oe.includes(e)?e.toUpperCase():e,Ve={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Qe=(e={})=>{if("number"==typeof e)return{...Ve,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...Ve,...t}},He=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},We=class e{static create(t,r){const s=new e(t,r),n=s.#k(async()=>{if("number"==typeof s.#j.timeout&&s.#j.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await s.#$();for(const r of s.#j.hooks.afterResponse){const n=s.#G(e.clone());let o;try{o=await r(s.request,s.#V(),n,{retryCount:s.#Q})}catch(t){throw s.#H(n),s.#H(e),t}if(o instanceof Pe)throw s.#H(n),s.#H(e),new be(o.options);const i=o instanceof globalThis.Response?o:e;n!==i&&s.#H(n),e!==i&&s.#H(e),e=i}if(s.#G(e),!e.ok&&("function"==typeof s.#j.throwHttpErrors?s.#j.throwHttpErrors(e.status):s.#j.throwHttpErrors)){let t=new ge(e,s.request,s.#V());for(const e of s.#j.hooks.beforeError)t=await e(t,{retryCount:s.#Q});throw t}if(s.#j.onDownloadProgress){if("function"!=typeof s.#j.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Se)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return s.#H(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(qe(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,s.#j.onDownloadProgress)}return e}).finally(()=>{const e=s.#W;s.#z(e?.body??void 0),s.#z(s.request.body??void 0)});for(const[e,o]of Object.entries(Ae))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(n[e]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||o);const t=await n;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return n}static#B(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#Z;#Q=0;#K;#j;#W;#J;#Y;constructor(t,r={}){if(this.#K=t,this.#j={...r,headers:Me(this.#K.headers,r.headers),hooks:ke({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Ge(r.method??this.#K.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Qe(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#K&&!(this.#K instanceof URL||this.#K instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#j.prefixUrl&&"string"==typeof this.#K){if(this.#K.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#j.prefixUrl.endsWith("/")||(this.#j.prefixUrl+="/"),this.#K=this.#j.prefixUrl+this.#K}Ee&&Re&&(this.#J=this.#j.signal??this.#K.signal,this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal),ve&&(this.#j.duplex="half"),void 0!==this.#j.json&&(this.#j.body=this.#j.stringifyJson?.(this.#j.json)??JSON.stringify(this.#j.json),this.#j.headers.set("content-type",this.#j.headers.get("content-type")??"application/json"));const s=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#K instanceof globalThis.Request&&(Te&&this.#j.body instanceof globalThis.FormData||this.#j.body instanceof URLSearchParams)&&!s&&this.#j.headers.delete("content-type"),this.request=new globalThis.Request(this.#K,this.#j),void 0!==(n=this.#j.searchParams)&&(Array.isArray(n)?n.length>0:n instanceof URLSearchParams?n.size>0:"object"==typeof n?Object.keys(n).length>0:"string"==typeof n?n.trim().length>0:Boolean(n))){const t="?"+("string"==typeof this.#j.searchParams?this.#j.searchParams.replace(/^\?/,""):new URLSearchParams(e.#B(this.#j.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#j)}var n;if(this.#j.onUploadProgress){if("function"!=typeof this.#j.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!ve)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#X(this.request,this.#j.body??void 0)}}#ee(){const e=this.#j.retry.delay(this.#Q);let t=e;!0===this.#j.retry.jitter?t=Math.random()*e:"function"==typeof this.#j.retry.jitter&&(t=this.#j.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#j.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#te(e){if(this.#Q++,this.#Q>this.#j.retry.limit)throw e;const t=e instanceof Error?e:new we(e);if(t instanceof be)return t.customDelay??this.#ee();if(!this.#j.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#j.retry.shouldRetry){const r=await this.#j.retry.shouldRetry({error:t,retryCount:this.#Q});if(!1===r)throw e;if(!0===r)return this.#ee()}if(function(e){return e instanceof He||e?.name===He.name}(e)&&!this.#j.retry.retryOnTimeout)throw e;if(function(e){return e instanceof ge||e?.name===ge.name}(e)){if(!this.#j.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#j.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#j.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#ee()}#G(e){return this.#j.parseJson&&(e.json=async()=>this.#j.parseJson(await e.text())),e}#z(e){e&&e.cancel().catch(()=>{})}#H(e){this.#z(e.body??void 0)}async#k(e){try{return await e()}catch(t){const r=Math.min(await this.#te(t),2147483647);if(this.#Q<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,s)=>{function n(){clearTimeout(o),s(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));const o=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}(r,this.#J?{signal:this.#J}:{}),t instanceof be&&t.customRequest){const e=this.#j.signal?new globalThis.Request(t.customRequest,{signal:this.#j.signal}):new globalThis.Request(t.customRequest);this.#re(e)}for(const e of this.#j.hooks.beforeRetry){const r=await e({request:this.request,options:this.#V(),error:t,retryCount:this.#Q});if(r instanceof globalThis.Request){this.#re(r);break}if(r instanceof globalThis.Response)return r;if(r===Ce)return}return this.#k(e)}}async#$(){this.#Z?.signal.aborted&&(this.#Z=new globalThis.AbortController,this.#j.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#j.signal}));for(const t of this.#j.hooks.beforeRequest){const e=await t(this.request,this.#V(),{retryCount:this.#Q});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#re(e);break}}const e=((e,t)=>{const r={};for(const s in t)Object.hasOwn(t,s)&&(s in _e||s in De||s in e&&!(s in xe)||(r[s]=t[s]));return r})(this.request,this.#j);return this.#W=this.request,this.request=this.#W.clone(),!1===this.#j.timeout?this.#j.fetch(this.#W,e):async function(e,t,r,s){return new Promise((n,o)=>{const i=setTimeout(()=>{r&&r.abort(),o(new He(e))},s.timeout);s.fetch(e,t).then(n).catch(o).then(()=>{clearTimeout(i)})})}(this.#W,e,this.#Z,this.#j)}#V(){if(!this.#Y){const{hooks:e,...t}=this.#j;this.#Y=Object.freeze(t)}return this.#Y}#re(e){this.#Y=void 0,this.request=this.#X(e)}#X(e,t){return this.#j.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const s=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,s]of e)t+=Ie,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof s?(new TextEncoder).encode(s).length:s.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:qe(e.body,s,t)})})(e,this.#j.onUploadProgress,t??this.#j.body??void 0):e}},ze=e=>{const t=(t,r)=>We.create(t,Ue(e,r));for(const r of Oe)t[r]=(t,s)=>We.create(t,Ue(e,s,{method:r}));return t.create=e=>ze(Ue(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ze(Ue(e,t))),t.stop=Ce,t.retry=Ne,t},Be=ze(),Ze={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`},Ke={ORGANIZATION_SETTINGS:e=>`https://qrati.com/org/${e}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:e=>`https://qrati.com/org/${e}/settings/integration`,ORGANIZATION_DASHBOARD:e=>`https://qrati.com/org/${e}/dashboard`,ORGANIZATION_ADMINS:e=>`https://qrati.com/org/${e}/admins`,EVENT_SETTINGS_BASIC_DETAILS:e=>`https://qrati.com/event/${e}/settings`,EVENT_REVIEW_CONTENTS:e=>`https://qrati.com/event/${e}/review-contents`,EVENT_DEEP_SEARCH:e=>`https://qrati.com/event/${e}/deep-search`,EVENT_GENERATE_ARTICLE:e=>`https://qrati.com/event/${e}/generate-article`,EVENT_ACCESS_REQUESTS:e=>`https://qrati.com/event/${e}/access-requests`,EVENT_SHOT_INSPECTOR:e=>`https://qrati.com/event/${e}/shot-inspector`,EVENT_CURATION_DETAILS:e=>`https://qrati.com/event/${e}/curation-details`},Je={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ye="https://qrati.com/api/connect",Xe={INITIALIZE_SESSION:`${Ye}/session/initialize`,REGISTER:`${Ye}/auth/register`,LOGIN:`${Ye}/auth/login`,LOGOUT:`${Ye}/auth/logout`,UPDATE_SESSION:`${Ye}/session/update`,ACCEPT_TERMS:`${Ye}/auth/accept-terms`,EXTERNAL_LOGIN:`${Ye}/auth/external-login`,PUBLIC_EVENTS:`${Ye}/event/public-events`,SEARCH_EVENTS:`${Ye}/event/search`,FOLDER_DETAILS:`${Ye}/folder/details`,NESTED_FOLDERS:`${Ye}/folder/nested-folders`,GET_EVENT_POINTS:`${Ye}/event/points`,ELIGIBLE_TO_CURATE:`${Ye}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Ye}/content/for-curation`,CURATE_CONTENT:`${Ye}/content/curate`,GET_LEADERBOARD:`${Ye}/event/leaderboard`,GET_UPLOAD_COUNT:`${Ye}/event/upload-count`,SINGLE_UPLOAD:`${Ye}/content/single-upload`,UPDATE_REACTION:`${Ye}/content/update-reaction`,EVENT_DATA:`${Ye}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Ye}/event/update-layout`,GET_EVENT_STATISTICS:`${Ye}/event/statistics`,GET_CONTENTS:`${Ye}/content/for-gallery`,SEARCH_CONTENTS:`${Ye}/content/search`,GET_CONTENTS_COUNT:`${Ye}/content/count`,UPDATE_AD_ANALYTICS:`${Ye}/event/update-ad-analytics`,INCREMENT_EVENT_VIEW:`${Ye}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Ye}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Ye}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Ye}/auth/reset-password`,REPORT_ERROR:`${Ye}/session/report-error`},et={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},tt={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD"},rt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},st={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},nt={WAITING:"Waiting",UPLOADING:"Uploading",RETRYING:"Retrying",DONE:"Done",FAILED:"Failed",ERROR:"Error"},ot=1048576,it={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},at={WAITING:"Waiting",PROCESSING:"Processing",DONE:"Done"},ct={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},lt={CONTEST:"CONTEST",REACTION:"REACTION"},ut={GRID:"grid",SINGLE:"single"},ht={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},dt={[ht.POPULAR]:{label:"Popular",sortField:"score"},[ht.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[ht.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},pt="map-view-state",ft=ht.UPLOAD_TIME,yt={ASC:"asc",DESC:"desc"},mt={[yt.ASC]:{label:"Ascending",sortOrder:""},[yt.DESC]:{label:"Descending",sortOrder:"-"}},gt=yt.DESC,wt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},bt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},vt={[bt.LINK]:"material-symbols:open-in-new-rounded",[bt.EMAIL]:"material-symbols:alternate-email-rounded",[bt.PHONE]:"material-symbols:call-outline",[bt.SMS]:"material-symbols:sms-outline-rounded",[bt.WHATSAPP]:"logos:whatsapp-icon",[bt.MESSENGER]:"logos:messenger"},Et={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},Rt={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`};function St({title:e,children:t}){/* @__PURE__ */
|
|
2
2
|
return d("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit text-[#ff4800]",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */d("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
3
3
|
/* @__PURE__ */d("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
|
|
4
4
|
/* @__PURE__ */d("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
|
|
@@ -26,8 +26,8 @@ return d("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/*
|
|
|
26
26
|
/* @__PURE__ */d("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
|
|
27
27
|
/* @__PURE__ */d("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
|
|
28
28
|
/* @__PURE__ */d("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
|
|
29
|
-
/* @__PURE__ */d("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */d("div",{className:"space-y-4",children:[/* @__PURE__ */d("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */d("p",{className:"text-muted-foreground text-center",children:t})]})]})}function
|
|
30
|
-
return d(
|
|
29
|
+
/* @__PURE__ */d("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */d("div",{className:"space-y-4",children:[/* @__PURE__ */d("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */d("p",{className:"text-muted-foreground text-center",children:t})]})]})}function Tt({organizationId:e,errorType:t}){/* @__PURE__ */
|
|
30
|
+
return d(St,"custom-auth-invalid"===t?{title:"Invalid input",children:"Custom auth mode requires uid, fname, lname. For more details please contact Qrati support."}:"service-unavailable"===t?{title:"We'll be right back!",children:"Our service is getting a quick tune-up. Hang tight — great things are coming your way soon!"}:{title:"page-not-registered"===t?"Page not registered":"Something went wrong",children:["If you are an admin of this organization, please add the current page URL in Allowed URLs under"," ",
|
|
31
31
|
/* @__PURE__ */d("a",{className:"font-medium text-blue-500",href:Ke.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨"," ",
|
|
32
|
-
/* @__PURE__ */d("a",{className:"font-medium text-blue-500",href:Ke.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var Tt=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),Ot=async e=>{try{return await e()}catch{return null}},At=(e,t=1)=>{const r=(new TextEncoder).encode(e),s=3432918353,n=461845907;let o=t>>>0;const i=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<i;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,s),e=e<<15|e>>>17,e=Math.imul(e,n),o^=e,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196>>>0}let c=0;const l=4*i,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,s),c=c<<15|c>>>17,c=Math.imul(c,n),o^=c),o^=r.length,o^=o>>>16,o=Math.imul(o,2246822507)>>>0,o^=o>>>13,o=Math.imul(o,3266489909)>>>0,o^=o>>>16,o.toString(16).padStart(8,"0")},It=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(It).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const s of t){const t=e[s];void 0!==t&&r.push(`${It(s)}:${It(t)}`)}return`{${r.join(",")}}`},Ct=async({debug:e=!1}={})=>{const t=performance.now(),r=await Ot(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?It(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),s=await Ot(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const s of t){const t=e.canPlayType(s);r[s]=""===t?"no":t}return It(r)})()),n=await Ot(()=>(()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const s={};for(const o of e)r.style.fontFamily=o,s[o]=r.offsetWidth;const n=[];for(const o of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${o}", ${i}`,r.offsetWidth!==s[i]){n.push(o),t=!0;break}t||(r.style.fontFamily=`"${o}"`,r.offsetWidth!==s.monospace&&r.offsetWidth!==s.serif&&n.push(o))}return document.body.removeChild(r),n.length?n.sort().join(","):null})()),o=await Ot(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),i=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",f=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",y=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",m=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:w,colorDepth:b}=window.screen,v="ontouchstart"in window||window.navigator.maxTouchPoints>0,E=await Ot(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),s=r.createLinearGradient(0,0,280,100);return s.addColorStop(0,"#f60"),s.addColorStop(.4,"#09f"),s.addColorStop(.7,"#f09"),s.addColorStop(1,"#0f9"),r.fillStyle=s,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),At(t.toDataURL("image/png"))})(e)),R=await Ot(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return At(It({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),S=await Ot(()=>(async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return At(It(r))})(e)),T=await Ot(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const s=t.createDynamicsCompressor();s.threshold.value=-48,s.knee.value=30,s.ratio.value=14,s.attack.value=0,s.release.value=.3;const n=t.createGain();n.gain.value=.4,r.connect(s),s.connect(n),n.connect(t.destination),r.start(0);const o=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let l=3e3;l<5800;l+=2){const e=o[l];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(o.slice(4500,5e3)),s=e.width/r.length;for(let n=0;n<r.length;n++){const o=n*s,i=(r[n]+1)/2*e.height;0===n?t.moveTo(o,i):t.lineTo(o,i)}t.stroke(),document.body.appendChild(e)}return At(c.toString(16))})(e)),O=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,A=await Ot(()=>window.screen.orientation?.type||null),I=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,C=I&&I.type||null,P=I?.effectiveType||null,N=!0===I?.saveData,D="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,x="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,_=await Ot(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),q=await Ot(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return It(t)}),L={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:s||null,fonts:n,numberingSystem:o,languages:i,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:p,prefersContrast:f,prefersReducedTransparency:y,pdfViewerEnabled:D,webdriver:x,intlSupportedCalendars:_||null,permissionsState:q||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:m,devicePixelRatio:g,pixelDepth:w,colorDepth:b,touchSupport:v,screenOrientation:A||null,connectionType:C,effectiveType:P,saveData:N,canvasID:E,webglID:R,webgpuID:S,audioID:T},U={aspectRatio:O,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(L,U);const M=At(It(L)),F=Math.round(performance.now()-t);return{fingerprint:M,...L,elapsedMs:F}};"undefined"!=typeof window&&(window.getBrowserFingerprint=Ct);var Pt=async(e,t)=>{if(e instanceof ge){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},Nt=e(void 0),Dt=({props:e={},children:t})=>{const{organizationId:n,uid:i,fname:y,lname:m,theme:g="light"}=e,w=u(null),[b,v]=s(()=>{if("undefined"==typeof window)return null;if(i||y||m)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:E,data:R,error:S}=me({queryKey:[Et.QRATI_CONNECT_SESSION,n,i??null,y??null,m??null],queryFn:async()=>{const e=await(async()=>{const e=await Ct();return"string"==typeof e?e:e?.fingerprint})();return(await Be.post(Xe.INITIALIZE_SESSION,{json:{uid:i,fname:y,lname:m,browserFingerprint:e},headers:{"x-org-id":n,Authorization:i||y||m||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!n});f(()=>{const e=R?.authSession?.session?.token,t=R?.authSession?.user;t&&e?(v({...t,token:e}),R?.organization?.customAuth||localStorage.setItem("qrati_token",e)):R?.organization?.customAuth&&i&&y&&m&&v(e=>e??{uid:i,name:`${y} ${m}`,fname:y,lname:m})},[R]);const T=r(()=>{const e=R?.organization?.integrationSettings?.fontFamily,t=c("https://qrati.com",e),r=l("https://qrati.com",n);return o(R?.organization?.integrationSettings,R?.organization?.customFontUrl?r||R.organization.customFontUrl:void 0,t||void 0)},[R?.organization?.integrationSettings,R?.organization?.customFontUrl,n]),O=async e=>{try{const t=await((e,t,r)=>new Promise((s,n)=>{if(!e)return void n(/* @__PURE__ */new Error("Provider is required"));if(!t)return void n(/* @__PURE__ */new Error("Organization ID is required"));const o=new URL(`${r}/qc-social-auth`);o.searchParams.set("provider",e),o.searchParams.set("organizationId",t),o.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(o.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void n(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:o,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(o){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),s({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),n(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),n(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),n(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),n(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,n??"","https://qrati.com");return t?.user&&t?.token&&(v({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(S){throw console.error("Social login error:",S),S}};if(S){const e=S;/* @__PURE__ */
|
|
33
|
-
return d(p,{fallback:null,children:/* @__PURE__ */d(
|
|
32
|
+
/* @__PURE__ */d("a",{className:"font-medium text-blue-500",href:Ke.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var Ot=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),At=async e=>{try{return await e()}catch{return null}},It=(e,t=1)=>{const r=(new TextEncoder).encode(e),s=3432918353,n=461845907;let o=t>>>0;const i=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<i;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,s),e=e<<15|e>>>17,e=Math.imul(e,n),o^=e,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196>>>0}let c=0;const l=4*i,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,s),c=c<<15|c>>>17,c=Math.imul(c,n),o^=c),o^=r.length,o^=o>>>16,o=Math.imul(o,2246822507)>>>0,o^=o>>>13,o=Math.imul(o,3266489909)>>>0,o^=o>>>16,o.toString(16).padStart(8,"0")},Ct=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Ct).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const s of t){const t=e[s];void 0!==t&&r.push(`${Ct(s)}:${Ct(t)}`)}return`{${r.join(",")}}`},Pt=async({debug:e=!1}={})=>{const t=performance.now(),r=await At(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?Ct(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),s=await At(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const s of t){const t=e.canPlayType(s);r[s]=""===t?"no":t}return Ct(r)})()),n=await At(()=>(()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const s={};for(const o of e)r.style.fontFamily=o,s[o]=r.offsetWidth;const n=[];for(const o of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${o}", ${i}`,r.offsetWidth!==s[i]){n.push(o),t=!0;break}t||(r.style.fontFamily=`"${o}"`,r.offsetWidth!==s.monospace&&r.offsetWidth!==s.serif&&n.push(o))}return document.body.removeChild(r),n.length?n.sort().join(","):null})()),o=await At(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),i=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",f=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",y=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",m=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:w,colorDepth:b}=window.screen,v="ontouchstart"in window||window.navigator.maxTouchPoints>0,E=await At(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),s=r.createLinearGradient(0,0,280,100);return s.addColorStop(0,"#f60"),s.addColorStop(.4,"#09f"),s.addColorStop(.7,"#f09"),s.addColorStop(1,"#0f9"),r.fillStyle=s,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),It(t.toDataURL("image/png"))})(e)),R=await At(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return It(Ct({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),S=await At(()=>(async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return It(Ct(r))})(e)),T=await At(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const s=t.createDynamicsCompressor();s.threshold.value=-48,s.knee.value=30,s.ratio.value=14,s.attack.value=0,s.release.value=.3;const n=t.createGain();n.gain.value=.4,r.connect(s),s.connect(n),n.connect(t.destination),r.start(0);const o=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let l=3e3;l<5800;l+=2){const e=o[l];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(o.slice(4500,5e3)),s=e.width/r.length;for(let n=0;n<r.length;n++){const o=n*s,i=(r[n]+1)/2*e.height;0===n?t.moveTo(o,i):t.lineTo(o,i)}t.stroke(),document.body.appendChild(e)}return It(c.toString(16))})(e)),O=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,A=await At(()=>window.screen.orientation?.type||null),I=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,C=I&&I.type||null,P=I?.effectiveType||null,N=!0===I?.saveData,D="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,x="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,_=await At(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),q=await At(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return Ct(t)}),L={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:s||null,fonts:n,numberingSystem:o,languages:i,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:p,prefersContrast:f,prefersReducedTransparency:y,pdfViewerEnabled:D,webdriver:x,intlSupportedCalendars:_||null,permissionsState:q||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:m,devicePixelRatio:g,pixelDepth:w,colorDepth:b,touchSupport:v,screenOrientation:A||null,connectionType:C,effectiveType:P,saveData:N,canvasID:E,webglID:R,webgpuID:S,audioID:T},U={aspectRatio:O,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(L,U);const M=It(Ct(L)),F=Math.round(performance.now()-t);return{fingerprint:M,...L,elapsedMs:F}};"undefined"!=typeof window&&(window.getBrowserFingerprint=Pt);var Nt=async(e,t)=>{if(e instanceof ge){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},Dt=e(void 0),xt=({props:e={},children:t})=>{const{organizationId:n,uid:i,fname:y,lname:m,theme:g="light"}=e,w=u(null),[b,v]=s(()=>{if("undefined"==typeof window)return null;if(i||y||m)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:E,data:R,error:S}=me({queryKey:[Rt.QRATI_CONNECT_SESSION,n,i??null,y??null,m??null],queryFn:async()=>{const e=await(async()=>{const e=await Pt();return"string"==typeof e?e:e?.fingerprint})();return(await Be.post(Xe.INITIALIZE_SESSION,{json:{uid:i,fname:y,lname:m,browserFingerprint:e},headers:{"x-org-id":n,Authorization:i||y||m||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!n});f(()=>{const e=R?.authSession?.session?.token,t=R?.authSession?.user;t&&e?(v({...t,token:e}),R?.organization?.customAuth||localStorage.setItem("qrati_token",e)):R?.organization?.customAuth&&i&&y&&m&&v(e=>e??{uid:i,name:`${y} ${m}`,fname:y,lname:m})},[R]);const T=r(()=>{const e=R?.organization?.integrationSettings?.fontFamily,t=c("https://qrati.com",e),r=l("https://qrati.com",n);return o(R?.organization?.integrationSettings,R?.organization?.customFontUrl?r||R.organization.customFontUrl:void 0,t||void 0)},[R?.organization?.integrationSettings,R?.organization?.customFontUrl,n]),O=async e=>{try{const t=await((e,t,r)=>new Promise((s,n)=>{if(!e)return void n(/* @__PURE__ */new Error("Provider is required"));if(!t)return void n(/* @__PURE__ */new Error("Organization ID is required"));const o=new URL(`${r}/qc-social-auth`);o.searchParams.set("provider",e),o.searchParams.set("organizationId",t),o.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(o.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void n(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:o,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(o){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),s({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),l(),c.close(),n(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),n(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),n(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),n(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,n??"","https://qrati.com");return t?.user&&t?.token&&(v({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(S){throw console.error("Social login error:",S),S}};if(S){const e=S;/* @__PURE__ */
|
|
33
|
+
return d(p,{fallback:null,children:/* @__PURE__ */d(Tt,{organizationId:n??"",errorType:401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable"})})}return!R?.organization?.customAuth||i&&y&&m?/* @__PURE__ */d(Dt.Provider,{value:{props:e,initializing:E,sessionId:R?.sessionId,organization:R?.organization,folders:R?.folders,loadingUser:E,user:b,updateUser:async e=>{v(t=>{const r={...t,...e};return r?.token&&localStorage.setItem("qrati_token",r.token),r})},registerUsingEmail:async(e,t,r,s)=>{try{const o=await Be.post(Xe.REGISTER,{json:{email:e,password:t,fname:r,lname:s},headers:{"x-org-id":n}}).json();return o.error?{error:o.error}:(v({...o.user,token:o.token}),localStorage.setItem("qrati_token",o.token),o)}catch(S){return{error:await Nt(S,"Registration failed")}}},loginWithGoogle:async()=>{try{return await O("google")}catch(S){throw console.error("Google login error:",S),S}},loginWithApple:async()=>{try{return await O("apple")}catch(S){throw console.error("Apple login error:",S),S}},loginUsingEmail:async(e,t)=>{try{const r=await Be.post(Xe.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:(v({...r.user,token:r.token}),localStorage.setItem("qrati_token",r.token),r)}catch(S){return{error:await Nt(S,"Invalid email or password")}}},sendPasswordResetCode:async e=>{try{const t=await Be.post(Xe.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":n}}).json();return t.error?{error:t.error}:t}catch(S){return{error:await Nt(S,"Failed to send password reset code")}}},verifyPasswordResetCode:async(e,t)=>{try{const r=await Be.post(Xe.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:r}catch(S){return{error:await Nt(S,"Invalid code, please check your email")}}},resetPassword:async(e,t)=>{try{const r=await Be.post(Xe.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":n}}).json();return r.error?{error:r.error}:r}catch(S){return{error:S?.message}}},signout:async()=>{try{const e=await Be.post(Xe.LOGOUT,{headers:{"x-org-id":n,Authorization:`Bearer ${b?.token}`}}).json();return e.error?{error:e.error}:(localStorage.removeItem("qrati_token"),v(null),e)}catch(S){return console.error(S),{error:S?.message}}},error:S,portalContainer:w.current},children:/* @__PURE__ */d("div",{ref:w,id:"qrati-connect-container",style:{...h(R?.organization,g),fontFamily:"var(--font-family)"},className:a("bg-background text-foreground relative min-h-[80vh]"),children:[T?/* @__PURE__ */d("style",{children:T}):null,t]})}):/* @__PURE__ */d(p,{fallback:null,children:/* @__PURE__ */d(Tt,{organizationId:n??"",errorType:"custom-auth-invalid"})})},_t=()=>{const e=n(Dt);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{N as $,yt as A,Y as B,ot as C,Rt as D,Ze as E,he as F,k as G,z as H,ue as I,P as J,$ as K,ne as L,Be as M,me as N,wt as O,ye as P,v as Q,ee as R,Ke as S,pt as T,V as U,B as V,F as W,I as X,C as Y,A as Z,ft as _,et as a,it as b,vt as c,ht as d,T as et,dt as f,ut as g,nt as h,Ot as i,mt as j,ct as k,Xe as l,tt as m,_t as n,m as nt,Et as o,st as p,E as q,Pt as r,y as rt,bt as s,xt as t,j as tt,at as u,gt as v,rt as w,Je as x,lt as y,X as z};
|