@qratilabs/qrati-connect 2.23.8 → 2.24.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/README.md +84 -54
- package/element/2CMH9VMM.js +4 -0
- package/element/BKDqpSN62.js +3 -0
- package/element/{lrjV8c1G2.js → BM9ujORR2.js} +1 -1
- package/element/BOQzjiMV.js +9 -0
- package/element/{BYEF5Khs.js → BOqkzZ92.js} +1 -1
- package/{umd/BpVacqmD2.js → element/BP2rYgya2.js} +10 -10
- package/element/BZu3c37u.js +1 -0
- package/{umd/ls36Q8v0.js → element/Bb7nx5xF.js} +5 -5
- package/element/Bh8kXbe92.js +93 -0
- package/{umd/NwT4xmUR2.js → element/Bow6F3212.js} +29 -29
- package/{umd/BkvtmX4K.js → element/BsYbcfkG.js} +1 -1
- package/element/{C8_zGNAf.js → C12iSy3L.js} +1 -1
- package/element/{D9NypPiv.js → C3dOFk9A.js} +1 -1
- package/element/C52SUIvC2.js +35 -0
- package/element/{DIYUC8M3.js → CAETItHr.js} +1 -1
- package/element/{Cb1JRT_1.js → CATr-3VW.js} +1 -1
- package/element/{Byk0pccK.js → CFnGGYmq.js} +1 -1
- package/element/CHTzn6mh2.js +4 -0
- package/element/CL_evx_l.js +1 -0
- package/element/{e_wwJ5wx2.js → CLdpUOLk2.js} +4 -4
- package/element/{qWp4ucdT.js → CM46vluW.js} +1 -1
- package/{umd/BtN9y353.js → element/CVRTTCyF.js} +1 -1
- package/element/{9QY9BKOL2.js → CWhnvMey2.js} +8 -8
- package/{umd/B14kCOq8.js → element/CZ9iaxjO.js} +1 -1
- package/element/CaX2xgrP.js +41 -0
- package/element/{b6CwQBFC.js → ChJXhA9c.js} +5 -5
- package/element/{4VTPoA38.js → CqBk9L5O.js} +1 -1
- package/{umd/CiiNqDJq.js → element/CsfDBJh72.js} +1 -1
- package/element/{_ty2jtjs.js → D35mTuTT.js} +1 -1
- package/element/D5TKEdBd2.js +3 -0
- package/element/{CCLXmMXp.js → DF0LxcV7.js} +1 -1
- package/element/{DvTRhlvs.js → DGGc10Cy.js} +1 -1
- package/element/{ekog7y-V.js → DGbyGc8b.js} +1 -1
- package/element/DN26AtHL2.js +4 -0
- package/element/{DsvRTvCp.js → DWBbTgnB.js} +1 -1
- package/element/{BQuhYd4G2.js → DZtaQWVG2.js} +1 -1
- package/element/{D0VKfxwE.js → DdOwRfWG.js} +2 -2
- package/element/DkG0zv7_2.js +9 -0
- package/{umd/gk4TX_a62.js → element/DlRUi0u42.js} +1 -1
- package/element/{DXx41__x2.js → DlqJDAie2.js} +1 -1
- package/element/DnIueBGr2.js +1 -0
- package/element/{BglDIiFp.js → DnQ6XaLR.js} +2 -2
- package/element/DrrpB4Om.js +1 -0
- package/element/DtRwaUYF2.js +85 -0
- package/element/{CSO2IaJ1.js → LYboLIEU.js} +2 -2
- package/element/{DNG5BSHx2.js → N4HKgEC52.js} +1 -1
- package/element/Rcen6i0h.js +80 -0
- package/{umd/MpvHkxaz2.js → element/Z0-Tddye2.js} +1 -1
- package/element/dT6WSX65.js +1 -0
- package/element/h4ZjZXfe2.js +1 -0
- package/element/kiL9JENf2.js +3 -0
- package/element/{BdOzsWR32.js → lcKuIs2T2.js} +1 -1
- package/element/{CXg838Gr2.js → mIANlVHi2.js} +8 -8
- package/element/mQzpzQ_t.js +3 -0
- package/element/web.es.js +26 -108
- package/package.json +3 -15
- package/react/index.d.mts +182 -6
- package/react/index.d.ts +182 -6
- package/element/B14kCOq8.js +0 -2
- package/element/BItJQVdK.js +0 -41
- package/element/BYoa-kpQ2.js +0 -9
- package/element/Be1e_ATJ.js +0 -1
- package/element/BfkCwRAR2.js +0 -3
- package/element/BkvtmX4K.js +0 -2
- package/element/BpVacqmD2.js +0 -14
- package/element/BsT0vqml.js +0 -1
- package/element/BtN9y353.js +0 -1
- package/element/C030L_Hu2.js +0 -4
- package/element/C0MGOytI.js +0 -1
- package/element/C3tT7YRo2.js +0 -37
- package/element/C3uDEVBt.js +0 -1
- package/element/CiiNqDJq.js +0 -3
- package/element/CnoPTYOO.js +0 -1
- package/element/D4apO9G62.js +0 -4
- package/element/DB1jhaAe2.js +0 -85
- package/element/Do2aldFH.js +0 -9
- package/element/Drl8BMLL2.js +0 -93
- package/element/LJWh_4Di.js +0 -2
- package/element/MpvHkxaz2.js +0 -16
- package/element/NwT4xmUR2.js +0 -39
- package/element/gjXXuILV2.js +0 -3
- package/element/gk4TX_a62.js +0 -7
- package/element/ls36Q8v0.js +0 -9
- package/element/qNDy94Dr2.js +0 -3
- package/element/styles.css +0 -288
- package/umd/4VTPoA38.js +0 -1
- package/umd/9QY9BKOL2.js +0 -8
- package/umd/BCTYvPrD.js +0 -1
- package/umd/BItJQVdK.js +0 -41
- package/umd/BQuhYd4G2.js +0 -2
- package/umd/BYEF5Khs.js +0 -1
- package/umd/BYoa-kpQ2.js +0 -9
- package/umd/BdOzsWR32.js +0 -9
- package/umd/Be1e_ATJ.js +0 -1
- package/umd/BfkCwRAR2.js +0 -3
- package/umd/BglDIiFp.js +0 -3
- package/umd/BkIDQGIs.js +0 -1
- package/umd/Bki5T_lb.js +0 -1
- package/umd/BsT0vqml.js +0 -1
- package/umd/Byk0pccK.js +0 -1
- package/umd/C030L_Hu2.js +0 -4
- package/umd/C0MGOytI.js +0 -1
- package/umd/C3tT7YRo2.js +0 -37
- package/umd/C3uDEVBt.js +0 -1
- package/umd/C8_zGNAf.js +0 -1
- package/umd/CCLXmMXp.js +0 -3
- package/umd/CSO2IaJ1.js +0 -2
- package/umd/CXg838Gr2.js +0 -13
- package/umd/Cb1JRT_1.js +0 -1
- package/umd/CfMNBPpx2.js +0 -1
- package/umd/CgUphJWo.js +0 -1
- package/umd/Cko4QHwX.js +0 -1
- package/umd/CnoPTYOO.js +0 -1
- package/umd/D0VKfxwE.js +0 -10
- package/umd/D4apO9G62.js +0 -4
- package/umd/D9NypPiv.js +0 -7
- package/umd/DB1jhaAe2.js +0 -85
- package/umd/DIYUC8M3.js +0 -2
- package/umd/DNG5BSHx2.js +0 -2
- package/umd/DXx41__x2.js +0 -2
- package/umd/Do2aldFH.js +0 -9
- package/umd/Drl8BMLL2.js +0 -93
- package/umd/DsvRTvCp.js +0 -8
- package/umd/DvTRhlvs.js +0 -2
- package/umd/LJWh_4Di.js +0 -2
- package/umd/_ty2jtjs.js +0 -2
- package/umd/b6CwQBFC.js +0 -5
- package/umd/e_wwJ5wx2.js +0 -5
- package/umd/ekog7y-V.js +0 -1
- package/umd/gjXXuILV2.js +0 -3
- package/umd/index.d.ts +0 -14
- package/umd/lrjV8c1G2.js +0 -8
- package/umd/qNDy94Dr2.js +0 -3
- package/umd/qWp4ucdT.js +0 -1
- package/umd/rtH8O6Hc.js +0 -1
- package/umd/web.es.js +0 -125
- package/umd/web.umd.js +0 -1
package/umd/BItJQVdK.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{E as e,b as t,h as r,p as s,r as n,s as o,t as i,v as a,y as c}from"./C3uDEVBt.js";var l=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(){}},u=new class extends l{#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}},h={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},d=new class{#s=h;#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)}},f="undefined"==typeof window||"Deno"in globalThis;function p(){}function y(e,t){return"function"==typeof e?e(t):e}function m(e){return"number"==typeof e&&e>=0&&e!==1/0}function g(e,t){return Math.max(e+(t||0)-Date.now(),0)}function w(e,t){return"function"==typeof e?e(t):e}function b(e,t){return"function"==typeof e?e(t):e}function v(e,t){const{type:r="all",exact:s,fetchStatus:n,predicate:o,queryKey:i,stale:a}=e;if(i)if(s){if(t.queryHash!==R(i,t.options))return!1}else if(!T(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 E(e,t){const{exact:r,status:s,predicate:n,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(S(t.options.mutationKey)!==S(o))return!1}else if(!T(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||n&&!n(t))}function R(e,t){return(t?.queryKeyHashFn||S)(e)}function S(e){return JSON.stringify(e,(e,t)=>P(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function T(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>T(e[r],t[r]))}var O=Object.prototype.hasOwnProperty;function A(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=C(e)&&C(t);if(!(s||P(e)&&P(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:O.call(e,i))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[i]=h;continue}const d=A(u,h,r+1);a[i]=d,d===u&&c++}return n===i&&c===n?e:a}function I(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 C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P(e){if(!N(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!N(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function N(e){return"[object Object]"===Object.prototype.toString.call(e)}function D(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?A(e,t):t}function _(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function L(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var x=/* @__PURE__ */Symbol();function q(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==x?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function U(e,t){return"function"==typeof e?e(...t):!!e}var F=/* @__PURE__ */(()=>{let e=()=>f;return{isServer:()=>e(),setIsServer(t){e=t}}})();function M(){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 k=function(e){setTimeout(e,0)},$=function(){let e=[],t=0,r=e=>{e()},s=e=>{e()},n=k;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}}}(),j=new class extends l{#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 G(e){return Math.min(1e3*2**e,3e4)}function V(e){return"online"!==(e??"online")||j.isOnline()}var Q=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function H(e){let t,r=!1,s=0;const n=M(),o=()=>"pending"!==n.status,i=()=>u.isFocused()&&("always"===e.networkMode||j.isOnline())&&e.canRun(),a=()=>V(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),n.resolve(e))},l=e=>{o()||(t?.(),n.reject(e))},h=()=>new Promise(r=>{t=e=>{(o()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),f=()=>{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??(F.isServer()?0:3),a=e.retryDelay??G,c="function"==typeof a?a(s,t):a,u=!0===n||"number"==typeof n&&s<n||"function"==typeof n&&n(s,t);var p;!r&&u?(s++,e.onFail?.(s,t),(p=c,new Promise(e=>{d.setTimeout(e,p)})).then(()=>i()?void 0:h()).then(()=>{r?l(t):f()})):l(t)})};return{promise:n,status:()=>n.status,cancel:t=>{if(!o()){const r=new Q(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?f():h().then(f),n)}}var z=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#i=d.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(F.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(d.clearTimeout(this.#i),this.#i=void 0)}};function B(e){return{onFetch:(t,r)=>{const s=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let r=!1;const l=e=>{!function(e,r,s){let n,o=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t.signal,o||(o=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)})}(e,0,()=>r=!0)},u=q(t.options,t.fetchOptions),h=async(e,s,n)=>{if(r)return Promise.reject(t.signal.reason);if(null==s&&e.pages.length)return Promise.resolve(e);const o=await u((()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:s,direction:n?"backward":"forward",meta:t.options.meta};return l(e),e})()),{maxPages:i}=t.options,a=n?L:_;return{pages:a(e.pages,o,i),pageParams:a(e.pageParams,s,i)}};if(n&&o.length){const e="backward"===n,t=e?Z:W,r={pages:o,pageParams:i};a=await h(r,t(s,r),e)}else{const t=e??o.length;do{const e=0===c?i[0]??s.initialPageParam:W(s,a);if(c>0&&null==e)break;a=await h(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function W(e,{pages:t,pageParams:r}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function Z(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function K(e,t){return!!t&&null!=W(e,t)}function J(e,t){return!(!t||!e.getPreviousPageParam)&&null!=Z(e,t)}var Y=class extends z{#a;#c;#l;#u;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#u=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=te(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=te(this.options);void 0!==e.data&&(this.setState(ee(e.data,e.dataUpdatedAt)),this.#c=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const r=D(this.state.data,e,this.options);return this.#y({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#y({type:"setState",state:e})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#c}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==b(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===w(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||!g(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.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.#d&&(this.#p||this.#m()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#y({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.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=q(this.options,t),r=(()=>{const e={client:this.#h,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.#h,state:this.state,fetchFn:n};return s(e),e})();("infinite"===this.#a?B(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#y({type:"fetch",meta:o.fetchOptions?.meta}),this.#d=H({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof Q&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:()=>{this.#y({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof Q){if(i.silent)return this.#d.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#y({type:"error",error:i}),this.#u.config.onError?.(i,this),this.#u.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#y(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,...X(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ee(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=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),$.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function X(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:V(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ee(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function te(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 re=class extends l{constructor(e,t){super(),this.options=t,this.#h=e,this.#g=null,this.#w=M(),this.bindMethods(),this.setOptions(t)}#h;#b=void 0;#v=void 0;#E=void 0;#R;#S;#w;#g;#T;#O;#A;#I;#C;#P;#N=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),se(this.#b,this.options)?this.#D():this.updateResult(),this.#_())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ne(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ne(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#L(),this.#x(),this.#b.removeObserver(this)}setOptions(e){const t=this.options,r=this.#b;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof b(this.options.enabled,this.#b))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#b.setOptions(this.options),t._defaulted&&!I(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});const s=this.hasListeners();s&&oe(this.#b,r,this.options,t)&&this.#D(),this.updateResult(),!s||this.#b===r&&b(this.options.enabled,this.#b)===b(t.enabled,this.#b)&&w(this.options.staleTime,this.#b)===w(t.staleTime,this.#b)||this.#U();const n=this.#F();!s||this.#b===r&&b(this.options.enabled,this.#b)===b(t.enabled,this.#b)&&n===this.#P||this.#M(n)}getOptimisticResult(e){const t=this.#h.getQueryCache().build(this.#h,e),r=this.createResult(t,e);var s;return s=r,I(this.getCurrentResult(),s)||(this.#E=r,this.#S=this.options,this.#R=this.#b.state),r}getCurrentResult(){return this.#E}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.#w.status||this.#w.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#N.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#D({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#E))}#D(e){this.#q();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(p)),t}#U(){this.#L();const e=w(this.options.staleTime,this.#b);if(F.isServer()||this.#E.isStale||!m(e))return;const t=g(this.#E.dataUpdatedAt,e)+1;this.#I=d.setTimeout(()=>{this.#E.isStale||this.updateResult()},t)}#F(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#M(e){this.#x(),this.#P=e,!F.isServer()&&!1!==b(this.options.enabled,this.#b)&&m(this.#P)&&0!==this.#P&&(this.#C=d.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#D()},this.#P))}#_(){this.#U(),this.#M(this.#F())}#L(){void 0!==this.#I&&(d.clearTimeout(this.#I),this.#I=void 0)}#x(){void 0!==this.#C&&(d.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){const r=this.#b,s=this.options,n=this.#E,o=this.#R,i=this.#S,a=e!==r?e.state:this.#v,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const n=this.hasListeners(),o=!n&&se(e,t),i=n&&oe(e,r,t,s);(o||i)&&(u={...u,...X(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=u;l=u.data;let y=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===p){let e;n?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=n.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#A?.state.data,this.#A):t.placeholderData,void 0!==e&&(p="success",l=D(n?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!y)if(n&&l===o?.data&&t.select===this.#T)l=this.#O;else try{this.#T=t.select,l=t.select(l),l=D(n?.data,l,t),this.#O=l,this.#g=null}catch(S){this.#g=S}this.#g&&(d=this.#g,l=this.#O,f=Date.now(),p="error");const m="fetching"===u.fetchStatus,g="pending"===p,w="error"===p,v=g&&m,E=void 0!==l,R={status:p,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===p,isError:w,isInitialLoading:v,isLoading:v,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:f,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&&!E,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:w&&E,isStale:ie(e,t),refetch:this.refetch,promise:this.#w,isEnabled:!1!==b(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==R.data,s="error"===R.status&&!t,n=e=>{s?e.reject(R.error):t&&e.resolve(R.data)},o=()=>{n(this.#w=R.promise=M())},i=this.#w;switch(i.status){case"pending":e.queryHash===r.queryHash&&n(i);break;case"fulfilled":(s||R.data!==i.value)&&o();break;case"rejected":s&&R.error===i.reason||o()}}return R}updateResult(){const e=this.#E,t=this.createResult(this.#b,this.options);this.#R=this.#b.state,this.#S=this.options,void 0!==this.#R.data&&(this.#A=this.#b),I(t,e)||(this.#E=t,this.#k({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#N.size)return!0;const s=new Set(r??this.#N);return this.options.throwOnError&&s.add("error"),Object.keys(this.#E).some(t=>{const r=t;return this.#E[r]!==e[r]&&s.has(r)})})()}))}#q(){const e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#b)return;const t=this.#b;this.#b=e,this.#v=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#_()}#k(e){$.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#E)}),this.#h.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function se(e,t){return function(e,t){return!1!==b(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===b(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&ne(e,t,t.refetchOnMount)}function ne(e,t,r){if(!1!==b(t.enabled,e)&&"static"!==w(t.staleTime,e)){const s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&ie(e,t)}return!1}function oe(e,t,r,s){return(e!==t||!1===b(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ie(e,r)}function ie(e,t){return!1!==b(t.enabled,e)&&e.isStaleByTime(w(t.staleTime,e))}var ae=e(void 0),ce=e=>{const t=c(ae);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},le=({client:e,children:r})=>(t(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */i(ae.Provider,{value:e,children:r})),ue=e(!1);ue.Provider;var he=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),de=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function fe(e,s,o){const i=c(ue),l=c(he),u=ce(o),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const d=u.getQueryCache().get(h.queryHash);h._optimisticResults=i?"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))}})(h),((e,t,r)=>{const s=r?.state.error&&"function"==typeof e.throwOnError?U(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))})(h,l,d),(e=>{t(()=>{e.clearReset()},[e])})(l);const f=!u.getQueryCache().get(h.queryHash),[y]=r(()=>new s(u,h)),m=y.getOptimisticResult(h),g=!i&&!1!==e.subscribed;if(n(a(e=>{const t=g?y.subscribe($.batchCalls(e)):p;return y.updateResult(),t},[y,g]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),t(()=>{y.setOptions(h)},[h,y]),((e,t)=>e?.suspense&&t.isPending)(h,m))throw de(h,y,l);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||U(r,[e.error,s])))({result:m,errorResetBoundary:l,throwOnError:h.throwOnError,query:d,suspense:h.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,m),h.experimental_prefetchInRender&&!F.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(m,i)&&(f?de(h,y,l):d?.promise)?.catch(p).finally(()=>{y.updateResult()}),h.notifyOnChangeProps?m:y.trackResult(m)}function pe(e,t){return fe(e,re,t)}var ye=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}},me=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}},ge=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new me(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}},we=(()=>{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})(),be="function"==typeof globalThis.AbortController,ve="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Ee="function"==typeof globalThis.ReadableStream,Re="function"==typeof globalThis.FormData,Se=["get","post","put","patch","head","delete"],Te={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Oe=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ae=Symbol("stop"),Ie=class{options;constructor(e){this.options=e}},Ce=e=>new Ie(e),Pe={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},Ne={next:!0},De={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},_e=(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,xe=(...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 ke({},...e)},qe=(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 Ue(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:ke(e[r]??[],t[r]??[])}var Fe=(e={},t={})=>({beforeRequest:Ue(e,t,"beforeRequest"),beforeRetry:Ue(e,t,"beforeRetry"),afterResponse:Ue(e,t,"afterResponse"),beforeError:Ue(e,t,"beforeError")}),Me=(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},ke=(...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=ke(r[e],s)),r={...r,[e]:s}):t=null==s?void 0:void 0===t?s:Me(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=Fe(n,i.hooks),r.hooks=n),Le(i.headers)&&(s=qe(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=ve?AbortSignal.any(o):o.at(-1)),r},$e=e=>Se.includes(e)?e.toUpperCase():e,je={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},Ge=(e={})=>{if("number"==typeof e)return{...je,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{...je,...t}},Ve=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Qe=class e{static create(t,r){const s=new e(t,r),n=s.#$(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.#G();for(const r of s.#j.hooks.afterResponse){const n=s.#V(e.clone());let o;try{o=await r(s.request,s.#Q(),n,{retryCount:s.#H})}catch(t){throw s.#z(n),s.#z(e),t}if(o instanceof Ie)throw s.#z(n),s.#z(e),new ge(o.options);const i=o instanceof globalThis.Response?o:e;n!==i&&s.#z(n),e!==i&&s.#z(e),e=i}if(s.#V(e),!e.ok&&("function"==typeof s.#j.throwHttpErrors?s.#j.throwHttpErrors(e.status):s.#j.throwHttpErrors)){let t=new ye(e,s.request,s.#Q());for(const e of s.#j.hooks.beforeError)t=await e(t,{retryCount:s.#H});throw t}if(s.#j.onDownloadProgress){if("function"!=typeof s.#j.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Ee)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return s.#z(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(_e(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,s.#j.onDownloadProgress)}return e}).finally(()=>{const e=s.#B;s.#W(e?.body??void 0),s.#W(s.request.body??void 0)});for(const[e,o]of Object.entries(Te))"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#Z(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#K;#H=0;#J;#j;#B;#Y;#X;constructor(t,r={}){if(this.#J=t,this.#j={...r,headers:qe(this.#J.headers,r.headers),hooks:Fe({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:$e(r.method??this.#J.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Ge(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#J&&!(this.#J instanceof URL||this.#J instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#j.prefixUrl&&"string"==typeof this.#J){if(this.#J.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#j.prefixUrl.endsWith("/")||(this.#j.prefixUrl+="/"),this.#J=this.#j.prefixUrl+this.#J}be&&ve&&(this.#Y=this.#j.signal??this.#J.signal,this.#K=new globalThis.AbortController,this.#j.signal=this.#Y?AbortSignal.any([this.#Y,this.#K.signal]):this.#K.signal),we&&(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.#J instanceof globalThis.Request&&(Re&&this.#j.body instanceof globalThis.FormData||this.#j.body instanceof URLSearchParams)&&!s&&this.#j.headers.delete("content-type"),this.request=new globalThis.Request(this.#J,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.#Z(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(!we)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#ee(this.request,this.#j.body??void 0)}}#te(){const e=this.#j.retry.delay(this.#H);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#re(e){if(this.#H++,this.#H>this.#j.retry.limit)throw e;const t=e instanceof Error?e:new me(e);if(t instanceof ge)return t.customDelay??this.#te();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.#H});if(!1===r)throw e;if(!0===r)return this.#te()}if(function(e){return e instanceof Ve||e?.name===Ve.name}(e)&&!this.#j.retry.retryOnTimeout)throw e;if(function(e){return e instanceof ye||e?.name===ye.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.#te()}#V(e){return this.#j.parseJson&&(e.json=async()=>this.#j.parseJson(await e.text())),e}#W(e){e&&e.cancel().catch(()=>{})}#z(e){this.#W(e.body??void 0)}async#$(e){try{return await e()}catch(t){const r=Math.min(await this.#re(t),2147483647);if(this.#H<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.#Y?{signal:this.#Y}:{}),t instanceof ge&&t.customRequest){const e=this.#j.signal?new globalThis.Request(t.customRequest,{signal:this.#j.signal}):new globalThis.Request(t.customRequest);this.#se(e)}for(const e of this.#j.hooks.beforeRetry){const r=await e({request:this.request,options:this.#Q(),error:t,retryCount:this.#H});if(r instanceof globalThis.Request){this.#se(r);break}if(r instanceof globalThis.Response)return r;if(r===Ae)return}return this.#$(e)}}async#G(){this.#K?.signal.aborted&&(this.#K=new globalThis.AbortController,this.#j.signal=this.#Y?AbortSignal.any([this.#Y,this.#K.signal]):this.#K.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.#Q(),{retryCount:this.#H});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#se(e);break}}const e=((e,t)=>{const r={};for(const s in t)Object.hasOwn(t,s)&&(s in De||s in Pe||s in e&&!(s in Ne)||(r[s]=t[s]));return r})(this.request,this.#j);return this.#B=this.request,this.request=this.#B.clone(),!1===this.#j.timeout?this.#j.fetch(this.#B,e):async function(e,t,r,s){return new Promise((n,o)=>{const i=setTimeout(()=>{r&&r.abort(),o(new Ve(e))},s.timeout);s.fetch(e,t).then(n).catch(o).then(()=>{clearTimeout(i)})})}(this.#B,e,this.#K,this.#j)}#Q(){if(!this.#X){const{hooks:e,...t}=this.#j;this.#X=Object.freeze(t)}return this.#X}#se(e){this.#X=void 0,this.request=this.#ee(e)}#ee(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+=Oe,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:_e(e.body,s,t)})})(e,this.#j.onUploadProgress,t??this.#j.body??void 0):e}},He=e=>{const t=(t,r)=>Qe.create(t,xe(e,r));for(const r of Se)t[r]=(t,s)=>Qe.create(t,xe(e,s,{method:r}));return t.create=e=>He(xe(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),He(xe(e,t))),t.stop=Ae,t.retry=Ce,t},ze=He(),Be={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`,MY_UPLOADS:"/my-uploads"},We={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`},Ze={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Ke="https://qrati.com/api/connect",Je={INITIALIZE_SESSION:`${Ke}/session/initialize`,REGISTER:`${Ke}/auth/register`,LOGIN:`${Ke}/auth/login`,LOGOUT:`${Ke}/auth/logout`,UPDATE_SESSION:`${Ke}/session/update`,ACCEPT_TERMS:`${Ke}/auth/accept-terms`,EXTERNAL_LOGIN:`${Ke}/auth/external-login`,PUBLIC_EVENTS:`${Ke}/event/public-events`,SEARCH_EVENTS:`${Ke}/event/search`,FOLDER_DETAILS:`${Ke}/folder/details`,NESTED_FOLDERS:`${Ke}/folder/nested-folders`,GET_EVENT_POINTS:`${Ke}/event/points`,ELIGIBLE_TO_CURATE:`${Ke}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Ke}/content/for-curation`,CURATE_CONTENT:`${Ke}/content/curate`,GET_LEADERBOARD:`${Ke}/event/leaderboard`,GET_UPLOAD_COUNT:`${Ke}/event/upload-count`,UPLOAD_CREATE:`${Ke}/content/upload/create`,UPLOAD_COMPLETE:`${Ke}/content/upload/complete`,UPLOAD_FAIL:`${Ke}/content/upload/fail`,UPLOAD_ABORT:`${Ke}/content/upload/abort`,UPDATE_REACTION:`${Ke}/content/update-reaction`,EVENT_DATA:`${Ke}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Ke}/event/update-layout`,GET_EVENT_STATISTICS:`${Ke}/event/statistics`,GET_CONTENTS:`${Ke}/content/for-gallery`,SEARCH_CONTENTS:`${Ke}/content/search`,GET_CONTENTS_COUNT:`${Ke}/content/count`,UPDATE_AD_ANALYTICS:`${Ke}/event/update-ad-analytics`,UPDATE_GAM_ANALYTICS:`${Ke}/event/update-gam-analytics`,INCREMENT_EVENT_VIEW:`${Ke}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Ke}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Ke}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Ke}/auth/reset-password`,REPORT_ERROR:`${Ke}/session/report-error`,GET_POST_PROCESSING_SETTINGS:`${Ke}/event/post-processing-settings`,MY_UPLOADS:`${Ke}/content/my-uploads`,DELETE_CONTENT:`${Ke}/content/delete`},Ye={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},Xe={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},et={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},tt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},rt={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},st=26214400,nt=262144e3,ot={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},it={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},at={CONTEST:"CONTEST",REACTION:"REACTION"},ct={GRID:"grid",SINGLE:"single"},lt={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},ut={[lt.POPULAR]:{label:"Popular",sortField:"score"},[lt.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[lt.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},ht="map-view-state",dt=lt.UPLOAD_TIME,ft={ASC:"asc",DESC:"desc"},pt={[ft.ASC]:{label:"Ascending",sortOrder:""},[ft.DESC]:{label:"Descending",sortOrder:"-"}},yt=ft.DESC,mt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},gt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},wt={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},bt={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`,USER_UPLOADS:"user-uploads"};function vt({title:e,children:t}){/* @__PURE__ */
|
|
2
|
-
return i("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */i("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__ */i("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
3
|
-
/* @__PURE__ */i("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
|
-
/* @__PURE__ */i("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"}),
|
|
5
|
-
/* @__PURE__ */i("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
|
|
6
|
-
/* @__PURE__ */i("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
|
|
7
|
-
/* @__PURE__ */i("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
|
|
8
|
-
/* @__PURE__ */i("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
|
|
9
|
-
/* @__PURE__ */i("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
|
|
10
|
-
/* @__PURE__ */i("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
|
|
11
|
-
/* @__PURE__ */i("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
|
|
12
|
-
/* @__PURE__ */i("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
|
|
13
|
-
/* @__PURE__ */i("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
|
|
14
|
-
/* @__PURE__ */i("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
|
|
15
|
-
/* @__PURE__ */i("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
|
|
16
|
-
/* @__PURE__ */i("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
|
|
17
|
-
/* @__PURE__ */i("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
|
|
18
|
-
/* @__PURE__ */i("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
|
|
19
|
-
/* @__PURE__ */i("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
|
|
20
|
-
/* @__PURE__ */i("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
|
|
21
|
-
/* @__PURE__ */i("g",{transform:"translate(696.754 297.373)",children:[
|
|
22
|
-
/* @__PURE__ */i("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
|
|
23
|
-
/* @__PURE__ */i("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
|
|
24
|
-
/* @__PURE__ */i("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
|
|
25
|
-
/* @__PURE__ */i("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
|
|
26
|
-
/* @__PURE__ */i("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
|
|
27
|
-
/* @__PURE__ */i("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
|
-
/* @__PURE__ */i("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__ */i("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__ */i("div",{className:"space-y-4",children:[/* @__PURE__ */i("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */i("p",{className:"text-muted-foreground text-center",children:t})]})]})}var Et=({organizationId:e})=>/* @__PURE__ */i("a",{className:"font-medium text-blue-500",href:We.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Guide"});function Rt({organizationId:e,errorType:t,errorMessage:r}){/* @__PURE__ */
|
|
30
|
-
return i(vt,"custom-auth-invalid"===t?{title:"Setup needed",children:["Custom auth is enabled. Pass ",
|
|
31
|
-
/* @__PURE__ */i("code",{children:"uid"}),", ",
|
|
32
|
-
/* @__PURE__ */i("code",{children:"fname"}),", and ",
|
|
33
|
-
/* @__PURE__ */i("code",{children:"lname"})," as props to QratiConnect to complete setup. See our ",
|
|
34
|
-
/* @__PURE__ */i(Et,{organizationId:e})," for details."]}:"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! See our"," ",
|
|
35
|
-
/* @__PURE__ */i(Et,{organizationId:e})," if you need help in the meantime."]}:"generic-error"===t&&r?{title:"Setup needed",children:[r," See our ",
|
|
36
|
-
/* @__PURE__ */i(Et,{organizationId:e})," for details."]}:"page-not-registered"===t?{title:"Page not registered",children:["Add the current page URL in Allowed URLs under"," ",
|
|
37
|
-
/* @__PURE__ */i("a",{className:"font-medium text-blue-500",href:We.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨ Integration Settings. See our ",
|
|
38
|
-
/* @__PURE__ */i(Et,{organizationId:e})," for details."]}:{title:"Heads up",children:["Something needs attention. See our ",
|
|
39
|
-
/* @__PURE__ */i(Et,{organizationId:e})," for details or contact Qrati support."]})}var St='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Tt=e=>e.trim().replace(/\s+/g," "),Ot=e=>e?.replace(/\/+$/,"")||"",At=e=>{if(!e)return St;const t=Tt("string"==typeof e?e:e.fontFamily||""),r="string"==typeof e?void 0:e.customFontName;return t&&"system"!==t?"custom"===t?`"${r||"QratiCustomFont"}", ${St}`:`"${t}", ${St}`:"inherit"};function It(e){var t,r,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=It(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Ct(){for(var e,t,r=0,s="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=It(e))&&(s&&(s+=" "),s+=t);return s}var Pt=(...e)=>Ct(e.filter(Boolean)),Nt=e=>{const t=e.replace(/#/g,"");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"},Dt="px",_t=(e,t="light")=>{const r=e?.themeSettings?.colors??{},s=e?.themeSettings?.border,n=e?.themeSettings?.shadow,o=e?.integrationSettings,i="dark"===t,a=(e,t,s,n)=>{const o=i?n:s;return r[i?t:e]||o},c=a("primaryLight","primaryDark","#ff4800","#ff4800");return{"--background":a("backgroundLight","backgroundDark","#fafafa","#0a0a0a"),"--foreground":a("foregroundLight","foregroundDark","#252629","#f5f5f5"),"--muted":a("mutedLight","mutedDark","#e5e5e5","#171717"),"--muted-foreground":a("mutedForegroundLight","mutedForegroundDark","#484848","#b5b8bb"),"--border":a("borderLight","borderDark","#dddddd","#353538"),"--input":a("inputLight","inputDark","#f5f5f5","#171717"),"--primary":c,"--primary-foreground":Nt(c),"--popover":a("popoverLight","popoverDark","#f5f5f5","#171717"),"--popover-foreground":a("popoverForegroundLight","popoverForegroundDark","#252629","#fafafa"),"--info":a("infoLight","infoDark","#2563eb","#5b8def"),"--warning":a("warningLight","warningDark","#f59e0b","#fbbf24"),"--success":a("successLight","successDark","#10b981","#34d399"),"--destructive":a("destructiveLight","destructiveDark","#ef4444","#f87171"),"--border-width":`${s?.width??"1"}${s?.unit??"px"}`,"--radius":`${s?.radius??"10"}${s?.unit??"px"}`,"--shadow-outer-horizontal-offset":`${n?.outerHorizontalOffset??"0"}${n?.unit??Dt}`,"--shadow-outer-vertical-offset":`${n?.outerVerticalOffset??"0"}${n?.unit??Dt}`,"--shadow-outer-blur":`${n?.outerBlur??"0"}${n?.unit??Dt}`,"--shadow-outer-spread":`${n?.outerSpread??"0"}${n?.unit??Dt}`,...o?.fontFamily&&"system"!==o.fontFamily?{"--font-family":At(o)}:{}}},Lt=async e=>{try{return await e()}catch{return null}},xt=(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")},qt=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(qt).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const s of t){const t=e[s];void 0!==t&&r.push(`${qt(s)}:${qt(t)}`)}return`{${r.join(",")}}`},Ut=async({debug:e=!1}={})=>{const t=performance.now(),r=await Lt(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?qt(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),s=await Lt(()=>(()=>{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 qt(r)})()),n=await Lt(()=>(()=>{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 Lt(()=>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",f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=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 Lt(()=>(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)),xt(t.toDataURL("image/png"))})(e)),R=await Lt(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return xt(qt({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 Lt(()=>(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 xt(qt(r))})(e)),T=await Lt(()=>(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 xt(c.toString(16))})(e)),O=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,A=await Lt(()=>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,_="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,L=await Lt(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),x=await Lt(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 qt(t)}),q={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:f,prefersContrast:p,prefersReducedTransparency:y,pdfViewerEnabled:D,webdriver:_,intlSupportedCalendars:L||null,permissionsState:x||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(q,U);const F=xt(qt(q)),M=Math.round(performance.now()-t);return{fingerprint:F,...q,elapsedMs:M}};"undefined"!=typeof window&&(window.getBrowserFingerprint=Ut);var Ft=async(e,t)=>{if(e instanceof ye){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)},Mt=e(void 0),kt=({props:e={},children:n})=>{const{organizationId:c,uid:l,fname:u,lname:h,theme:d="light"}=e,[f,p]=r(null),[y,m]=r(()=>{if("undefined"==typeof window)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:g,data:w,error:b}=pe({queryKey:[bt.QRATI_CONNECT_SESSION,c,l??null,u??null,h??null],queryFn:async()=>{const e=await(async()=>{const e=await Ut();return"string"==typeof e?e:e?.fingerprint})();try{return(await ze.post(Je.INITIALIZE_SESSION,{json:{uid:l,fname:u,lname:h,browserFingerprint:e},headers:{"x-org-id":c,...!y?.token||l||u||h?{}:{Authorization:`Bearer ${y.token}`}}}).json()).data}catch(t){if(t instanceof ye)try{const e=await t.response.json();t.apiMessage=e?.message||e?.error}catch{}throw t}},enabled:!!c});t(()=>{const e=w?.authSession?.session?.token??w?.authSession?.token,t=w?.authSession?.user;t&&e?(m(r=>({...r,...t,token:e,tcAccepted:void 0===t.tcAccepted?r?.tcAccepted:t.tcAccepted})),localStorage.setItem("qrati_token",e)):w?.organization?.customAuth&&l&&u&&m(e=>e??{_id:l,uid:l,name:h?`${u} ${h}`:u,fname:u,lname:h})},[w]);const v=s(()=>{const e=w?.organization?.integrationSettings?.fontFamily,t=((e,t)=>{const r=Ot("https://qrati.com"),s=t?Tt(t):"";return r&&s?`${r}/api/connect/organization/google-font?family=${encodeURIComponent(s)}`:null})(0,e),r=((e,t)=>{const r=Ot("https://qrati.com");return r&&t?`${r}/api/connect/organization/custom-font?organizationId=${encodeURIComponent(t)}`:null})(0,c);return((e,t,r)=>{if(!e?.fontFamily||"system"===e.fontFamily)return"";const s=Tt(e.fontFamily);if("custom"===s&&t){const r=e.customFontName||"QratiCustomFont",s=/\.woff2(\?|$)/i.test(t)?"woff2":/\.ttf(\?|$)/i.test(t)?"truetype":"woff";return`@font-face{font-family:"${n=r,n.replace(/"/g,'\\"')}";src:url("${t}") format("${s}");font-weight:400 700;font-style:normal;font-display:swap;}`}var n;const o=r||(e=>{if(!e)return null;const t=Tt(e);return t&&"system"!==t.toLowerCase()&&"custom"!==t.toLowerCase()?`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`:null})(s);return o?`@import url("${o}");`:""})(w?.organization?.integrationSettings,w?.organization?.customFontUrl?r||w.organization.customFontUrl:void 0,t||void 0)},[w?.organization?.integrationSettings,w?.organization?.customFontUrl,c]);t(()=>{const e=`data-qrati-font-${c}`;if(document.head.querySelector(`[${e}]`)?.remove(),v){if(v.startsWith("@import")){const t=v.match(/@import url\("([^"]+)"\)/);if(!t?.[1])return;const r=document.createElement("link");r.rel="stylesheet",r.href=t[1],r.setAttribute(e,""),document.head.appendChild(r)}else{const t=document.createElement("style");t.textContent=v,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[v,c]);const E=a(async e=>{m(t=>({...t,...e}))},[]),R=a(async(e,t,r,s)=>{try{const n=await ze.post(Je.REGISTER,{json:{email:e,password:t,fname:r,lname:s},headers:{"x-org-id":c}}).json();return n.error?{error:n.error}:(m({...n.user,token:n.token}),n.token&&localStorage.setItem("qrati_token",n.token),n)}catch(b){return{error:await Ft(b,"Registration failed")}}},[c]),S=a(async(e,t)=>{try{const r=await ze.post(Je.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:(m({...r.user,token:r.token}),r.token&&localStorage.setItem("qrati_token",r.token),r)}catch(b){return{error:await Ft(b,"Invalid email or password")}}},[c]),T=a(async e=>{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,c??"","https://qrati.com");return t?.user&&t?.token&&(m({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t},[c]),O=a(async()=>T("google"),[T]),A=a(async()=>T("apple"),[T]),I=a(async e=>{try{const t=await ze.post(Je.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":c}}).json();return t.error?{error:t.error}:t}catch(b){return{error:await Ft(b,"Failed to send password reset code")}}},[c]),C=a(async(e,t)=>{try{const r=await ze.post(Je.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(b){return{error:await Ft(b,"Invalid code, please check your email")}}},[c]),P=a(async(e,t)=>{try{const r=await ze.post(Je.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(b){return{error:b?.message}}},[c]),N=a(async()=>{try{const e=await ze.post(Je.LOGOUT,{headers:{"x-org-id":c,Authorization:`Bearer ${y?.token}`}}).json();return e.error?{error:e.error}:(m(null),localStorage.removeItem("qrati_token"),e)}catch(b){return{error:b?.message}}},[c,y?.token]),D=s(()=>({props:e,initializing:g,sessionId:w?.sessionId,organization:w?.organization,folders:w?.folders,orgRole:w?.orgRole??null,loadingUser:g,user:y,updateUser:E,registerUsingEmail:R,loginWithGoogle:O,loginWithApple:A,loginUsingEmail:S,sendPasswordResetCode:I,verifyPasswordResetCode:C,resetPassword:P,signout:N,error:b,portalContainer:f}),[e,g,w,y,E,R,O,A,S,I,C,P,N,b,f]);if(b){const e=b,t=401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable";/* @__PURE__ */
|
|
40
|
-
return i(o,{fallback:null,children:/* @__PURE__ */i(Rt,{organizationId:c??"",errorType:t,errorMessage:"generic-error"===t?e.apiMessage:void 0})})}/* @__PURE__ */
|
|
41
|
-
return i(Mt.Provider,{value:D,children:/* @__PURE__ */i("div",{ref:p,id:"qrati-connect-container",style:{..._t(w?.organization,d),fontFamily:w?.organization?.integrationSettings?.fontFamily&&"system"!==w.organization.integrationSettings.fontFamily?"var(--font-family)":"inherit"},className:Pt("bg-background text-foreground relative min-h-[80vh]"),children:n})})},$t=()=>{const e=c(Mt);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{w as $,it as A,K as B,et as C,Be as D,nt as E,fe as F,$ as G,z as H,le as I,R as J,y as K,ce as L,pt as M,ze as N,bt as O,pe as P,T as Q,re as R,tt as S,st as T,H as U,J as V,j as W,v as X,E as Y,p as Z,yt as _,_t as a,Ze as b,wt as c,lt as d,I as et,ut as f,dt as g,ct as h,Pt as i,l as it,ft as j,mt as k,gt as l,Xe as m,$t as n,x as nt,Ct as o,rt as p,S as q,Ut as r,u as rt,Ye as s,kt as t,U as tt,Je as u,at as v,ht as w,We as x,ot as y,Y as z};
|
package/umd/BQuhYd4G2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E as e,b as a,h as t,p as s,t as o,v as n,w as d,y as l}from"./C3uDEVBt.js";import{a as r,i as m,n as c}from"./BItJQVdK.js";var i=e(null),p=({open:e,onOpenChange:d,children:l})=>{const[r,m]=t(!!e);a(()=>{"boolean"==typeof e&&m(e)},[e]);const c=n(e=>{m(e),d?.(e)},[d]),p=s(()=>({open:r,setOpen:c}),[r,c]);/* @__PURE__ */
|
|
2
|
-
return o(i.Provider,{value:p,children:l})},x=({children:e})=>/* @__PURE__ */o(d,{children:e}),u=({className:e,...a})=>/* @__PURE__ */o("div",{"data-state":l(i)?.open?"open":"closed",className:m("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-2001 bg-black/15 backdrop-blur-md",e),...a}),f=({className:e,children:t,...s})=>{const{organization:n}=c(),d=l(i);return a(()=>{if(!d?.open)return;const e=e=>{"Escape"===e.key&&d.setOpen(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.open]),d?.open?/* @__PURE__ */o(x,{children:[/* @__PURE__ */o(u,{onClick:()=>d.setOpen(!1)}),/* @__PURE__ */o("div",{role:"dialog","aria-modal":"true","data-state":d?.open?"open":"closed",className:m("border-border bg-background shadow-outer data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=closed]:slide-out-to-bottom fixed top-[50%] left-[50%] z-2002 h-fit w-auto max-w-5xl translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-t border duration-300 max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:border-x-0 max-sm:border-b-0 sm:rounded",e),style:r(n),...s,children:t})]}):null},b=({className:e,...a})=>/* @__PURE__ */o("div",{className:m("flex flex-col space-y-1 p-3 text-center sm:text-left",e),...a}),h=({className:e,...a})=>/* @__PURE__ */o("div",{className:m("flex justify-end space-x-3 p-4",e),...a}),v=({className:e,...a})=>/* @__PURE__ */o("h2",{className:m("text-center text-lg font-semibold",e),...a}),N=({className:e,...a})=>/* @__PURE__ */o("p",{className:m("text-muted-foreground text-center text-sm",e),...a});export{b as a,h as i,f as n,v as o,N as r,p as t};
|
package/umd/BYEF5Khs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,t as i,w as e}from"./C3uDEVBt.js";import{m as s}from"./BItJQVdK.js";import{t as n}from"./b6CwQBFC.js";import{t as o}from"./CSO2IaJ1.js";import{t as a}from"./Bki5T_lb.js";var r=({url:r,alt:h="",thumbnailUrl:l,blurhash:p,pswpData:d={},curateLink:c,onClick:m})=>{const u=t(()=>(t=>Object.keys(t).reduce((i,e)=>{const s=t[e];return null==s||""===s||(i[`data-pswp-${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=s),i;var n},{}))(d),[d]),_=/* @__PURE__ */i(e,{children:[/* @__PURE__ */i(o,{threshold:.1,src:l||r,blurhash:p,alt:h}),d.type===s.VIDEO&&/* @__PURE__ */i("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */i("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})})]});if(m)/* @__PURE__ */return i("button",{className:"h-full w-full",onClick:m,children:_});if(c)/* @__PURE__ */return i(n,{to:c,className:"h-full w-full",children:_});const g=r&&a(r,["http:","https:"])?r:void 0;return g?/* @__PURE__ */i("a",{href:g,className:"pswp-item block h-full w-full",...u,...l?{"data-pswp-thumbnail-url":l}:{},...p?{"data-pswp-blurhash":p}:{},target:"_blank",rel:"noreferrer",children:_}):/* @__PURE__ */i("span",{className:"pswp-item block h-full w-full",...u,...l?{"data-pswp-thumbnail-url":l}:{},...p?{"data-pswp-blurhash":p}:{},children:_})};function h(t,i,e){const s=document.createElement(i);return t&&(s.className=t),e&&e.appendChild(s),s}function l(t,i){return t.x=i.x,t.y=i.y,void 0!==i.id&&(t.id=i.id),t}function p(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function d(t,i){const e=Math.abs(t.x-i.x),s=Math.abs(t.y-i.y);return Math.sqrt(e*e+s*s)}function c(t,i){return t.x===i.x&&t.y===i.y}function m(t,i,e){return Math.min(Math.max(t,i),e)}function u(t,i,e){let s=`translate3d(${t}px,${i||0}px,0)`;return void 0!==e&&(s+=` scale3d(${e},${e},1)`),s}function _(t,i,e,s){t.style.transform=u(i,e,s)}function g(t,i,e,s){t.style.transition=i?`${i} ${e}ms ${s||"cubic-bezier(.4,0,.22,1)"}`:"none"}function v(t,i,e){t.style.width="number"==typeof i?`${i}px`:i,t.style.height="number"==typeof e?`${e}px`:e}var y="loading",w="loaded",f="error";function x(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}function P(t,i,e=document){let s=[];if(t instanceof Element)s=[t];else if(t instanceof NodeList||Array.isArray(t))s=Array.from(t);else{const n="string"==typeof t?t:i;n&&(s=Array.from(e.querySelectorAll(n)))}return s}function S(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}var b=class{constructor(t,i){if(this.element=h("pswp__img pswp__img--placeholder",t?"img":"div",i),t){const i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,i){this.element&&("IMG"===this.element.tagName?(v(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=u(0,0,t/250)):v(this.element,t,i))}destroy(){this.element?.parentNode&&this.element.remove(),this.element=null}},C=class{constructor(t,i,e){this.instance=i,this.data=t,this.index=e,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state="idle",this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.hash=this.data.hash,this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,i){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new b(t,this.slide.container)}this.element&&!i||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=h("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=h("pswp__content","div"),this.element.innerHTML=this.data.html||""),i&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const i=this.element;this.updateSrcsetSizes(),this.data.srcset&&(i.srcset=this.data.srcset),i.src=this.data.src??"",i.alt=this.data.alt??"",this.state=y,i.complete?this.onLoaded():(i.onload=()=>{this.onLoaded()},i.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=w,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==w&&this.state!==f||this.removePlaceholder())}onError(){this.state=f,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===y,this)}isError(){return this.state===f}isImageContent(){return"image"===this.type||"ad"===this.type}setDisplayedSize(t,i){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,i),!this.instance.dispatch("contentResize",{content:this,width:t,height:i}).defaultPrevented&&(v(this.element,t,i),this.isImageContent()&&!this.isError()))){const e=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=i,e?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:i,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==f,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,i=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||i>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=`${i}px`,t.dataset.largestUsedSize=String(i))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){let t=h("pswp__error-msg","div");t.innerText=this.instance.options?.errorMsg??"",t=this.instance.applyFilters("contentErrorElement",t,this),this.element=h("pswp__content pswp__error-msg-container","div"),this.element.appendChild(t),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===f)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||S())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!S()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==w&&this.state!==f||this.removePlaceholder()))}};function L(t,i){if(t.getViewportSizeFn){const e=t.getViewportSizeFn(t,i);if(e)return e}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function z(t,i,e,s,n){let o=0;if(i.paddingFn)o=i.paddingFn(e,s,n)[t];else if(i.padding)o=i.padding[t];else{const e=`padding${t[0].toUpperCase()}${t.slice(1)}`;i[e]&&(o=i[e])}return Number(o)||0}function I(t,i,e,s){return{x:i.x-z("left",t,i,e,s)-z("right",t,i,e,s),y:i.y-z("top",t,i,e,s)-z("bottom",t,i,e,s)}}var A=class{constructor(t,i,e,s){this.pswp=s,this.options=t,this.itemData=i,this.index=e,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,i,e){const s={x:t,y:i};this.elementSize=s,this.panAreaSize=e;const n=e.x/s.x,o=e.y/s.y;this.fit=Math.min(1,n<o?n:o),this.fill=Math.min(1,n>o?n:o),this.vFill=Math.min(1,o),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const i=`${t}ZoomLevel`,e=this.options[i];if(e)return"function"==typeof e?e(this):"fill"===e?this.fill:"fit"===e?this.fit:Number(e)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}};function T(t,i,e){const s=i.createContentFromData(t,e);let n;const{options:o}=i;if(o){let a;n=new A(o,t,-1),a=i.pswp?i.pswp.viewportSize:L(o,i);const r=I(o,a,t,e);n.update(s.width,s.height,r)}return s.lazyLoad(),n&&s.setDisplayedSize(Math.ceil(s.width*n.initial),Math.ceil(s.height*n.initial)),s}function Z(t,i){const e=i.getItemData(t);if(!i.dispatch("lazyLoadSlide",{index:t,itemData:e}).defaultPrevented)return T(e,i,t)}var O=class{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:i}=this;if(i.dispatch("lazyLoad").defaultPrevented)return;const{preload:e}=i.options,s=void 0===t||t>=0;let n;for(n=0;n<=e[1];n++)this.loadSlideByIndex(i.currIndex+(s?n:-n));for(n=1;n<=e[0];n++)this.loadSlideByIndex(i.currIndex+(s?-n:n))}loadSlideByIndex(t){const i=this.pswp.getLoopedIndex(t);let e=this.getContentByIndex(i);e||(e=Z(i,this.pswp),e&&this.addToCache(e))}getContentBySlide(t){let i=this.getContentByIndex(t.index);return i||(i=this.pswp.createContentFromData(t.data,t.index),this.addToCache(i)),i.setSlide(t),i}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex(t=>!t.isAttached&&!t.hasSlide);-1!==t&&this._cachedItems.splice(t,1)[0].destroy()}}removeByIndex(t){const i=this._cachedItems.findIndex(i=>i.index===t);-1!==i&&this._cachedItems.splice(i,1)}getContentByIndex(t){return this._cachedItems.find(i=>i.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}},E=class{constructor(t,i){this.type=t,this.defaultPrevented=!1,i&&Object.assign(this,i)}preventDefault(){this.defaultPrevented=!0}},D=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,i,e=100){this._filters[t]||(this._filters[t]=[]),this._filters[t]?.push({fn:i,priority:e}),this._filters[t]?.sort((t,i)=>t.priority-i.priority),this.pswp?.addFilter(t,i,e)}removeFilter(t,i){this._filters[t]&&(this._filters[t]=this._filters[t].filter(t=>t.fn!==i)),this.pswp&&this.pswp.removeFilter(t,i)}applyFilters(t,...i){return this._filters[t]?.forEach(t=>{i[0]=t.fn.apply(this,i)}),i[0]}on(t,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t]?.push(i),this.pswp?.on(t,i)}off(t,i){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(t=>i!==t)),this.pswp?.off(t,i)}dispatch(t,i){if(this.pswp)return this.pswp.dispatch(t,i);const e=new E(t,i);return this._listeners[t]?.forEach(t=>{t.call(this,e)}),e}},M=class extends D{getNumItems(){let t=0;const i=this.options?.dataSource;i&&"length"in i?t=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(t=i.items.length));const e=this.dispatch("numItems",{dataSource:i,numItems:t});return this.applyFilters("numItems",e.numItems,i)}createContentFromData(t,i){return new C(t,this,i)}getItemData(t){const i=this.options?.dataSource;let e={};Array.isArray(i)?e=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),e=i.items[t]);let s=e;s instanceof Element&&(s=this._domElementToItemData(s));const n=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",n.itemData,t)}_getGalleryDOMElements(t){return this.options?.children||this.options?.childSelector?P(this.options.children,this.options.childSelector,t)||[]:[t]}_toLowerCaseFirstLetter(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}_domElementToItemData(t){const i={element:t},e="A"===t.tagName?t:t.querySelector("a");if(e){i.src=e.dataset.pswpSrc||e.href,e.dataset.pswpSrcset&&(i.srcset=e.dataset.pswpSrcset),i.width=e.dataset.pswpWidth?parseInt(e.dataset.pswpWidth,10):0,i.height=e.dataset.pswpHeight?parseInt(e.dataset.pswpHeight,10):0,e.dataset.pswpType&&(i.type=e.dataset.pswpType.toLowerCase());const s=t.querySelector("img");s&&(i.msrc=s.currentSrc||s.src,i.alt=s.getAttribute("alt")??""),(e.dataset.pswpCropped||e.dataset.cropped)&&(i.thumbCropped=!0);const n=["element","src","srcset","width","height","type","msrc","alt","thumbCropped"];Object.keys(e.dataset).filter(t=>t.startsWith("pswp")&&!n.includes(this._toLowerCaseFirstLetter(t.slice(4)))).forEach(t=>{i[this._toLowerCaseFirstLetter(t.slice(4))]=e.dataset[t]})}return this.applyFilters("domItemData",i,t,e)}lazyLoadData(t,i){return T(t,this,i)}},F=class extends M{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){P(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.addEventListener("click",this.onThumbnailsClick,!1)})}onThumbnailsClick(t){if(x(t)||window.pswp)return;let i={x:t.clientX,y:t.clientY};i.x||i.y||(i=null);let e=this.getClickedIndex(t);e=this.applyFilters("clickedIndex",e,t,this);const s={gallery:t.currentTarget};e>=0&&(t.preventDefault(),this.loadAndOpen(e,s,i))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const i=t.target,e=P(this.options.children,this.options.childSelector,t.currentTarget).findIndex(t=>t===i||t.contains(i));return-1!==e?e:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,i,e){if(window.pswp||!this.options)return!1;if(!i&&this.options.gallery&&this.options.children){const t=P(this.options.gallery);t[0]&&(i={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=e,this.shouldOpen=!0,this.preload(t,i),!0}preload(t,i){const{options:e}=this;i&&(e.dataSource=i);const s=[],n=typeof e.pswpModule;if("function"==typeof(o=e.pswpModule)&&o.prototype&&o.prototype.goTo)s.push(Promise.resolve(e.pswpModule));else{if("string"===n)throw new Error("pswpModule as string is no longer supported");if("function"!==n)throw new Error("pswpModule is not valid");s.push(e.pswpModule())}var o;"function"==typeof e.openPromise&&s.push(e.openPromise()),!1!==e.preloadFirstSlide&&t>=0&&(this._preloadedContent=Z(t,this));const a=++this._uid;Promise.all(s).then(t=>{if(this.shouldOpen){const i=t[0];this._openPhotoswipe(i,a)}})}_openPhotoswipe(t,i){if(i!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const e="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=e,window.pswp=e,Object.keys(this._listeners).forEach(t=>{this._listeners[t]?.forEach(i=>{e.on(t,i)})}),Object.keys(this._filters).forEach(t=>{this._filters[t]?.forEach(i=>{e.addFilter(t,i.fn,i.priority)})}),this._preloadedContent&&(e.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),e.on("destroy",()=>{this.pswp=void 0,delete window.pswp}),e.init()}destroy(){this.pswp?.destroy(),this.shouldOpen=!1,this._listeners={},P(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)})}},B=class{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&l(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:i,dragAxis:e}=this.gestures,{currSlide:s}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&s&&s.currZoomLevel<=s.zoomLevels.fit&&!this.gestures.isMultitouch){const e=s.pan.y+(t.y-i.y);if(!this.pswp.dispatch("verticalDrag",{panY:e}).defaultPrevented){this._setPanWithFriction("y",e,.6);const t=1-Math.abs(this._getVerticalDragRatio(s.pan.y));this.pswp.applyBgOpacity(t),s.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),s&&(p(s.pan),s.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:e}=this.pswp;let s=0;if(this.pswp.animations.stopAll(),i.isShifted()){const e=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&e<0||t.x<.1&&e<-.5?(s=1,t.x=Math.min(t.x,0)):(t.x>.5&&e>0||t.x>-.1&&e>.5)&&(s=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(s,!0,t.x,!0)}e&&e.currZoomLevel>e.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:s,bounds:n}=e,o=s[t],a=this.pswp.bgOpacity<1&&"y"===t,r=o+i[t]*.995/(1-.995);if(a){const t=this._getVerticalDragRatio(o),i=this._getVerticalDragRatio(r);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const h=n.correctPan(t,r);if(o===h)return;const l=h===r?1:.82,p=this.pswp.bgOpacity,d=h-o;this.pswp.animations.startSpring({name:`panGesture${t}`,isPan:!0,start:o,end:h,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(a&&this.pswp.bgOpacity<1){const t=1-(h-i)/d;this.pswp.applyBgOpacity(m(p+(1-p)*t,0,1))}s[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:e,prevP1:s,isMultitouch:n}=this.gestures,{currSlide:o,mainScroll:a}=this.pswp,r=i[t]-s[t],h=a.x+r;if(!r||!o)return!1;if("x"===t&&!o.isPannable()&&!n)return a.moveTo(h,!0),!0;const{bounds:l}=o,p=o.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===e&&"x"===t&&!n){const i=a.getCurrSlideX(),e=a.x-i,s=r>0,n=!s;if(p>l.min[t]&&s){if(l.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,p)}else if(p<l.max[t]&&n){if(this.startPan[t]<=l.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,p)}else if(0!==e){if(e>0)return a.moveTo(Math.max(h,i),!0),!0;if(e<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,p)}else"y"===t&&(a.isShifted()||l.min.y===l.max.y)||this._setPanWithFriction(t,p);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,e){const{currSlide:s}=this.pswp;if(!s)return;const{pan:n,bounds:o}=s;if(o.correctPan(t,i)!==i||e){const s=Math.round(i-n[t]);n[t]+=s*(e||.35)}else n[t]=i}};function k(t){return!!t.target.closest(".pswp__container")}var R=class{constructor(t){this.gestures=t}click(t,i){const e=i.target.classList,s=e.contains("pswp__img"),n=e.contains("pswp__item")||e.contains("pswp__zoom-wrap");s?this._doClickOrTapAction("imageClick",t,i):n&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){k(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){k(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,e){const{pswp:s}=this.gestures,{currSlide:n}=s,o=`${t}Action`,a=s.options[o];if(!s.dispatch(o,{point:i,originalEvent:e}).defaultPrevented)if("function"!=typeof a)switch(a){case"close":case"next":s[a]();break;case"zoom":n?.toggleZoom(i);break;case"zoom-or-close":n?.isZoomable()&&n.zoomLevels.secondary!==n.zoomLevels.initial?n.toggleZoom(i):s.options.clickToCloseNonZoomable&&s.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}else a.call(s,i,e)}};function H(t,i,e){return t.x=(i.x+e.x)/2,t.y=(i.y+e.y)/2,t}var N=class{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,l(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:e,startP2:s,pswp:n}=this.gestures,{currSlide:o}=n;if(!o)return;const a=o.zoomLevels.min,r=o.zoomLevels.max;if(!o.isZoomable()||n.mainScroll.isShifted())return;H(this._startZoomPoint,i,s),H(this._zoomPoint,t,e);let h=1/d(i,s)*d(t,e)*this._startZoomLevel;if(h>o.zoomLevels.initial+o.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),h<a)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=o.zoomLevels.initial){const t=1-(a-h)/(a/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else h=a-.15*(a-h);else h>r&&(h=r+.05*(h-r));o.pan.x=this._calculatePanForZoomLevel("x",h),o.pan.y=this._calculatePanForZoomLevel("y",h),o.setZoomLevel(h),o.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const e=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*e}correctZoomPan(t){const{pswp:i}=this.gestures,{currSlide:e}=i;if(!e?.isZoomable())return;0===this._zoomPoint.x&&(t=!0);const s=e.currZoomLevel;let n,o=!0;s<e.zoomLevels.initial?n=e.zoomLevels.initial:s>e.zoomLevels.max?n=e.zoomLevels.max:(o=!1,n=s);const a=i.bgOpacity,r=i.bgOpacity<1,h=l({x:0,y:0},e.pan);let p=l({x:0,y:0},h);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=s,l(this._startPan,h)),o&&(p={x:this._calculatePanForZoomLevel("x",n),y:this._calculatePanForZoomLevel("y",n)}),e.setZoomLevel(n),p={x:e.bounds.correctPan("x",p.x),y:e.bounds.correctPan("y",p.y)},e.setZoomLevel(s);const d=!c(p,h);if(!d&&!o&&!r)return e._setResolution(n),void e.applyCurrentZoomPan();i.animations.stopAllPan(),i.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,d||o){if(d&&(e.pan.x=h.x+(p.x-h.x)*t,e.pan.y=h.y+(p.y-h.y)*t),o){const i=s+(n-s)*t;e.setZoomLevel(i)}e.applyCurrentZoomPan()}r&&i.bgOpacity<1&&i.applyBgOpacity(m(a+(1-a)*t,0,1))},onComplete:()=>{e._setResolution(n),e.applyCurrentZoomPan()}})}},W=class{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new B(this),this.zoomLevels=new N(this),this.tapHandler=new R(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,e,s){const{pswp:n}=this,{events:o}=n,a=s?t+s:"";o.add(n.scrollWrap,t+i,this.onPointerDown.bind(this)),o.add(window,`${t}move`,this.onPointerMove.bind(this)),o.add(window,t+e,this.onPointerUp.bind(this)),a&&o.add(n.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(t){const i="mousedown"===t.type||"mouse"===t.pointerType;if(i&&t.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(i&&(e.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),e.animations.stopAll(),this._updatePoints(t,"down"),1===this._numActivePoints&&(this.dragAxis=null,l(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):t.preventDefault()}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented||(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,l(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented||(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():this.isZooming||this.isMultitouch||this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?c(this.p1,this.prevP1)||this.drag.change():c(this.p1,this.prevP1)&&c(this.p2,this.prevP2)||this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const i=Date.now(),e=i-this._intervalTime;e<50&&!t||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=i,l(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:i}=this.pswp;if(i.isShifted())return void i.moveIndexBy(0,!0);if(t.type.indexOf("cancel")>0)return;if("mouseup"===t.type||"mouse"===t.pointerType)return void this.tapHandler.click(this.startP1,t);const e=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),d(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t)):(l(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},e))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const e=this.p1[t]-this._intervalP1[t];return Math.abs(e)>1&&i>5?e/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(t,i){if(this._pointerEventEnabled){const e=t,s=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===i&&s>-1?this._ongoingPointers.splice(s,1):"down"===i&&-1===s?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):s>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[s]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&l(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&l(this.p2,this._ongoingPointers[1])}else{const e=t;this._numActivePoints=0,e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(this._convertEventPosToPoint(e.touches[0],this.p1),this._numActivePoints++,e.touches.length>1&&(this._convertEventPosToPoint(e.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),"up"===i?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){l(this.prevP1,this.p1),l(this.prevP2,this.p2)}_updateStartPoints(){l(this.startP1,this.p1),l(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}},V=class{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,e=this.slide["x"===t?"width":"height"]*this.currZoomLevel,s=z("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),n=this.slide.panAreaSize[t];this.center[t]=Math.round((n-e)/2)+s,this.max[t]=e>n?Math.round(n-e)+s:this.center[t],this.min[t]=e>n?s:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return m(i,this.max[t],this.min[t])}},q=class{constructor(t,i,e){this.data=t,this.index=i,this.pswp=e,this.isActive=i===e.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!e.opener.isOpen,this.zoomLevels=new A(e.options,t,i,e),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=h("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new V(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;!this.heavyAppended&&t.opener.isOpen&&!t.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const e=Math.round(this.width*i)||this.pswp.viewportSize.x,s=Math.round(this.height*i)||this.pswp.viewportSize.y;(this.sizeChanged(e,s)||t)&&this.content.setDisplayedSize(e,s)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,i,e,s){const{pswp:n}=this;if(!this.isZoomable()||n.mainScroll.isShifted())return;n.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:i,transitionDuration:e}),n.animations.stopAllPan();const o=this.currZoomLevel;s||(t=m(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",i,o),this.pan.y=this.calculateZoomToPanOffset("y",i,o),p(this.pan);const a=()=>{this._setResolution(t),this.applyCurrentZoomPan()};e?n.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:a,duration:e,easing:n.options.easing}):a()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,e){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),e||(e=this.zoomLevels.initial);const s=this.currZoomLevel/e;return this.bounds.correctPan(t,(this.pan[t]-i[t])*s+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return Boolean(this.width)&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return Boolean(this.width)&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),l(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,e){e/=this.currentResolution||this.zoomLevels.initial,_(this.container,t,i,e)}calculateSize(){const{pswp:t}=this;l(this.panAreaSize,I(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return u(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}};function $(t,i,e){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=e?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}var U={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:$},G={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{$(t,i,!0)}},j={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},K={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},X={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},Y={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let e,s=null;const n=i=>{var s;e!==i&&(e=i,s=i,t.classList.toggle("pswp__preloader--active",s))},o=()=>{if(!i.currSlide?.content.isLoading())return n(!1),void(s&&(clearTimeout(s),s=null));s||(s=setTimeout(()=>{n(Boolean(i.currSlide?.content.isLoading())),s=null},i.options.preloaderDelay))};i.on("change",o),i.on("loadComplete",t=>{i.currSlide===t.slide&&o()}),i.ui&&(i.ui.updatePreloaderVisibility=o)}},J=class{constructor(t,i){const e=i.name||i.className;let s=i.html;if(!1===t.options[e])return;"string"==typeof t.options[`${e}SVG`]&&(s=t.options[`${e}SVG`]),t.dispatch("uiElementCreate",{data:i});let n="";i.isButton?(n+="pswp__button ",n+=i.className||`pswp__button--${i.name}`):n+=i.className||`pswp__${i.name}`;let o=i.isButton?i.tagName||"button":i.tagName||"div";o=o.toLowerCase();const a=h(n,o);if(i.isButton){"button"===o&&(a.type="button");let{title:s}=i;const{ariaLabel:n}=i;"string"==typeof t.options[`${e}Title`]&&(s=t.options[`${e}Title`]),s&&(a.title=s);const r=n||s;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let e='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return e=e.split("%d").join(i.size||32),i.outlineID&&(e+=`<use class="pswp__icn-shadow" xlink:href="#${i.outlineID}"/>`),e+=i.inner,e+="</svg>",e}(s),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=e=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(e,a,t)});const r=i.appendTo||"bar";let l=t.element;"bar"===r?(t.topBar||(t.topBar=h("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),l=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===r&&(l=t.scrollWrap)),l?.appendChild(t.applyFilters("uiElement",a,i))}};function Q(t,i){t.classList.toggle("pswp--zoomed-in",i)}var tt=class{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[j,U,G,K,Y,X],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new J(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:e}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:s}=i;if(this.pswp.opener.isOpen||(s=i.zoomLevels.initial),s===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=s;const n=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(n)<.01||!i.isZoomable())return Q(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed"),Q(t,(s===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=s),"zoom"!==e.imageClickAction&&"zoom-or-close"!==e.imageClickAction||t.classList.add("pswp--click-to-zoom")}},it="cubic-bezier(.4,0,.22,1)",et=class{constructor(t){this.props=t;const{target:i,onComplete:e,transform:s,onFinish:n=()=>{},duration:o=333,easing:a=it}=t;this.onFinish=n;const r=s?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=e,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{g(i,r,o,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},o+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),g(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}},st=class{constructor(t,i,e){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=e||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let e,s=0;i/=1e3;const n=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)e=this.velocity+this._naturalFrequency*t,s=(t+e*i)*n,this.velocity=s*-this._naturalFrequency+e*n;else if(this._dampingRatio<1){e=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const o=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);s=n*(t*o+e*a),this.velocity=s*-this._naturalFrequency*this._dampingRatio+n*(-this._dampedFrequency*t*a+this._dampedFrequency*e*o)}return s}},nt=class{constructor(t){this.props=t,this._raf=0;const{start:i,end:e,velocity:s,onUpdate:n,onComplete:o,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const l=new st(s,r,h);let p=Date.now(),d=i-e;const c=()=>{this._raf&&(d=l.easeFrame(d,Date.now()-p),Math.abs(d)<1&&Math.abs(l.velocity)<50?(n(e),o&&o(),this.onFinish()):(p=Date.now(),n(d+e),this._raf=requestAnimationFrame(c)))};this._raf=requestAnimationFrame(c)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}},ot=class{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const e=i?new nt(t):new et(t);return this.activeAnimations.push(e),e.onFinish=()=>this.stop(e),e}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}},at=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{at=!0}}))}catch(yt){}var rt=class{constructor(){this._pool=[]}add(t,i,e,s){this._toggleListener(t,i,e,s)}remove(t,i,e,s){this._toggleListener(t,i,e,s,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,e,s,n,o){if(!t)return;const a=n?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){o||(n?this._pool=this._pool.filter(s=>s.type!==i||s.listener!==e||s.target!==t):this._pool.push({target:t,type:i,listener:e,passive:s}));const r=!!at&&{passive:s||!1};t[a](i,e,r)}})}},ht={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},lt=(t,i)=>i?t:ht[t],pt=class{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented)return;if(x(t))return;let e,s,n=!1;const o="key"in t;switch(o?t.key:t.keyCode){case lt("Escape",o):i.options.escKey&&(e="close");break;case lt("z",o):e="toggleZoom";break;case lt("ArrowLeft",o):s="x";break;case lt("ArrowUp",o):s="y";break;case lt("ArrowRight",o):s="x",n=!0;break;case lt("ArrowDown",o):n=!0,s="y";break;case lt("Tab",o):this._focusRoot()}if(s){t.preventDefault();const{currSlide:o}=i;i.options.arrowKeys&&"x"===s&&i.getNumItems()>1?e=n?"next":"prev":o&&o.currZoomLevel>o.zoomLevels.fit&&(o.pan[s]+=n?-80:80,o.panTo(o.pan.x,o.pan.y))}e&&(t.preventDefault(),i[e]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}},dt=class{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,e=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),s=e!==this.slideWidth;s&&(this.slideWidth=e,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,e)=>{s&&_(i.el,(e+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=h("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,e){const{pswp:s}=this;let n=s.potentialIndex+t;const o=s.getNumItems();if(s.canLoop()){n=s.getLoopedIndex(n);const i=(t+o)%o;t=i<=o/2?i:i-o}else n<0?n=0:n>=o&&(n=o-1),t=n-s.potentialIndex;s.potentialIndex=n,this._currPositionIndex-=t,s.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){s.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:e||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),s.appendHeavy()}});let t=s.potentialIndex-s.currIndex;if(s.canLoop()){const i=(t+o)%o;t=i<=o/2?i:i-o}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return Boolean(t)}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let e,s=Math.abs(i);s>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),s=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let n=0;n<s;n++)i>0?(e=this.itemHolders.shift(),e&&(this.itemHolders[2]=e,this._containerShiftIndex++,_(e.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(e,t.currIndex-s+n+2))):(e=this.itemHolders.pop(),e&&(this.itemHolders.unshift(e),this._containerShiftIndex--,_(e.el,this._containerShiftIndex*this.slideWidth),t.setContent(e,t.currIndex+s-n-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const e=Math.round(t-this.x);(i<0&&e>0||i>=this.pswp.getNumItems()-1&&e<0)&&(t=this.x+.35*e)}this.x=t,this.pswp.container&&_(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}},ct=.003,mt=class{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:e}=t;if("fade"===e.showHideAnimationType?(e.showHideOpacity=!0,this._thumbBounds=void 0):"none"===e.showHideAnimationType?(e.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=Boolean(this._duration&&this._duration>50),this._animateZoom=Boolean(this._thumbBounds)&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=e.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>ct,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(ct)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=`${t.viewportSize.x}px`)):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(ct)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(ct)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(ct)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,e=!0;var s;(s=this._placeholder,"decode"in s?s.decode().catch(()=>{}):s.complete?Promise.resolve(s):new Promise((t,i)=>{s.onload=()=>t(s),s.onerror=i})).finally(()=>{i=!0,e||t(!0)}),setTimeout(()=>{e=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",`${this._duration}ms`),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:i}=this,{innerRect:e}=this._thumbBounds,{currSlide:s,viewportSize:n}=i;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const i=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,a=n.y-e.h;t?(this._animateTo(this._cropContainer1,"transform",u(i,s)),this._animateTo(this._cropContainer2,"transform",u(o,a))):(_(this._cropContainer1,i,s),_(this._cropContainer2,o,a))}s&&(l(s.pan,e||this._thumbBounds),s.currZoomLevel=this._thumbBounds.w/s.width,t?this._animateTo(s.container,"transform",s.getCurrentTransform()):s.applyCurrentZoomPan())}_animateTo(t,i,e){if(!this._duration)return void(t.style[i]=e);const{animations:s}=this.pswp,n={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{s.activeAnimations.length||this._onAnimationComplete()},target:t};n[i]=e,s.startTransition(n)}},ut=class{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:e,deltaY:s}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let e=-s;1===t.deltaMode?e*=.05:e*=t.deltaMode?1:.002,e=2**e;const n=i.currZoomLevel*e;i.zoomTo(n,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(e*=18,s*=18),i.panTo(i.pan.x-e,i.pan.y-s))}},_t={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"},gt=class extends M{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new rt,this.animations=new ot,this.mainScroll=new dt(this),this.gestures=new W(this),this.opener=new mt(this),this.keyboard=new pt(this),this.contentLoader=new O(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=` ${this.options.mainClass}`),this.element&&(this.element.className+=` ${t}`),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new ut(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),m(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,e)=>{let s=(this.currSlide?.index??0)-1+e;this.canLoop()&&(s=this.getLoopedIndex(s)),s===t&&(this.setContent(i,t,!0),1===e&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,e){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!e)return;t.slide.destroy(),t.slide=void 0}!this.canLoop()&&(i<0||i>=this.getNumItems())||(t.slide=new q(this.getItemData(i),i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el))}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const i=L(this.options,this);!t&&c(i,this._prevViewportSize)||(l(this._prevViewportSize,i),this.dispatch("beforeResize"),l(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=h("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=h("pswp__bg","div",this.element),this.scrollWrap=h("pswp__scroll-wrap","section",this.element),this.container=h("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new tt(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,e){const s=e.dispatch("thumbBounds",{index:t,itemData:i,instance:e});if(s.thumbBounds)return s.thumbBounds;const{element:n}=i;let o,a;if(n&&!1!==e.options.thumbSelector){const t=e.options.thumbSelector||"img";a=n.matches(t)?n:n.querySelector(t)}return a=e.applyFilters("thumbEl",a,i,t),a&&(o=i.thumbCropped?function(t,i,e){const s=t.getBoundingClientRect(),n=s.width/i,o=s.height/e,a=n>o?n:o,r=(s.width-i*a)/2,h=(s.height-e*a)/2,l={x:s.left+r,y:s.top+h,w:i*a};return l.innerRect={w:s.width,h:s.height,x:r,y:h},l}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),e.applyFilters("thumbBounds",o,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{..._t,...t}}},vt=()=>Promise.resolve(gt);export{F as n,r,vt as t};
|
package/umd/BYoa-kpQ2.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{b as e,h as t,p as l,t as n,v as r,w as a}from"./C3uDEVBt.js";import{N as o,P as s,i,n as d,u as c}from"./BItJQVdK.js";import{t as u}from"./CSO2IaJ1.js";var h=(e,t)=>e.filter(e=>(e.parentFolderId??null)===t).map(t=>{return{folder:t,children:h(e,t._id),eventCount:t.boundary?.length??0,centroid:(l=t.boundary,l?.length?[l.reduce((e,t)=>e+t.x,0)/l.length,l.reduce((e,t)=>e+t.y,0)/l.length]:null),color:t.color||"#fb8500"};var l}).filter(e=>e.eventCount>0||e.children.length>0),p=e=>e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),m=()=>{const{folders:n,organization:a}=d(),[i,u]=t(null),m=Boolean(a?.integrationSettings?.enableFolderView),f=l(()=>m?h(n??[],null):[],[n,m]),g=s({queryKey:["map-all-events",a?._id],queryFn:async()=>p((await o.get(c.PUBLIC_EVENTS,{headers:{"x-org-id":a?._id??""},searchParams:{includeAllFolders:!0,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(a?._id)&&!m,staleTime:3e5,gcTime:6e5,retry:!1}),b=s({queryKey:["map-folder-events",a?._id,i],queryFn:async()=>p((await o.get(c.PUBLIC_EVENTS,{headers:{"x-org-id":a?._id??""},searchParams:{folderId:i,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(a?._id)&&m&&Boolean(i),staleTime:3e5,gcTime:6e5,retry:!1}),v=l(()=>(n??[]).find(e=>e._id===i)??null,[n,i]);e(()=>{m||u(null)},[m]);const x=r(e=>{u(e)},[]);return{folderTree:f,activeFolderId:i,activeFolder:v,visibleEvents:m?b.data??[]:g.data??[],setActiveFolderId:x,isLoadingEvents:m?Boolean(i)&&(b.isLoading||b.isFetching):g.isLoading||g.isFetching}},f=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m15 18-6-6 6-6"})}),g=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m9 18 6-6-6-6"})});function b({items:l,autoplayInterval:r=3e3,showControls:o=!1,className:s}){const[d,c]=t(0);return e(()=>{if(l.length<=1)return;const e=setInterval(()=>c(e=>(e+1)%l.length),r);return()=>clearInterval(e)},[l.length,r]),0===l.length?null:/* @__PURE__ */n("div",{className:i("relative size-full overflow-hidden",s),children:[l.map((e,t)=>/* @__PURE__ */n("div",{className:i("absolute inset-0 transition-opacity duration-500",t===d?"opacity-100":"opacity-0"),children:e},t)),l.length>1&&/* @__PURE__ */n("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:l.map((e,t)=>/* @__PURE__ */n("button",{onClick:()=>c(t),className:i("h-1.5 rounded-full transition-all",t===d?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),o&&l.length>1&&/* @__PURE__ */n(a,{children:[/* @__PURE__ */n("button",{onClick:()=>c(e=>0===e?l.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */n(f,{})}),/* @__PURE__ */n("button",{onClick:()=>c(e=>(e+1)%l.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */n(g,{})})]})]})}var v=({event:e,onExplore:t})=>{const l=(e.contents||[]).map(t=>/* @__PURE__ */n(u,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),r=e?.status?.toUpperCase();/* @__PURE__ */
|
|
2
|
-
return n("div",{className:"w-40 rounded pt-2 pl-1",children:[
|
|
3
|
-
/* @__PURE__ */n("div",{className:"relative h-32 w-full overflow-hidden rounded",children:[/* @__PURE__ */n(b,{items:l,autoplayInterval:3e3}),"OPEN"===r&&/* @__PURE__ */n("span",{className:"absolute top-2 left-2 inline-flex items-center gap-1 rounded-full bg-green-500 px-2 py-0.5 text-[10px] font-medium text-white",children:[/* @__PURE__ */n("span",{className:"size-1.5 animate-pulse rounded-full bg-white"}),"Open"]})]}),
|
|
4
|
-
/* @__PURE__ */n("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
|
|
5
|
-
/* @__PURE__ */n("div",{className:"pb-2 text-xs text-gray-600",children:e.location?.label}),
|
|
6
|
-
/* @__PURE__ */n("button",{type:"button",onClick:()=>t?.(e.slug||""),className:"bg-primary text-primary-foreground flex w-full items-center justify-center rounded py-1",children:"Explore"})]})},x=(e,t)=>e&&(/^#[0-9a-fA-F]{3,8}$/.test(e)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(e))?e:t,y=e=>{if(e)try{const{protocol:t}=new URL(e);return"https:"===t||"http:"===t?e:void 0}catch{return}},w=({node:e,depth:l,activeFolderId:r,onSelect:a})=>{const[o,s]=t(!1),i=e.folder._id===r,d=e.children.length>0,c=e.eventCount>0;/* @__PURE__ */
|
|
7
|
-
return n("li",{children:[/* @__PURE__ */n("div",{class:"flex items-center gap-1 py-1.5 pr-2 rounded-lg "+(i?"bg-foreground/20":"hover:bg-foreground/20"),style:{paddingLeft:8+14*l+"px"},children:[/* @__PURE__ */n("button",{type:"button",class:"flex w-4 shrink-0 items-center justify-center text-slate-400 text-xs",onClick:e=>{e.stopPropagation(),d&&s(e=>!e)},children:d?o?"▾":"▸":/* @__PURE__ */n("span",{class:"size-1.5 rounded-full bg-slate-300 inline-block"})}),/* @__PURE__ */n("button",{type:"button",class:"flex flex-1 min-w-0 items-center gap-2 cursor-pointer",onClick:()=>{c?a(i?null:e.folder._id):s(e=>!e)},children:[
|
|
8
|
-
/* @__PURE__ */n("span",{class:"size-2 shrink-0 rounded-full",style:{background:e.color}}),
|
|
9
|
-
/* @__PURE__ */n("span",{class:"flex-1 truncate text-left text-sm",children:e.folder.name}),c&&/* @__PURE__ */n("span",{class:"text-xs tabular-nums text-slate-400",children:e.eventCount})]})]}),d&&o&&/* @__PURE__ */n("ul",{children:e.children.map(e=>/* @__PURE__ */n(w,{node:e,depth:l+1,activeFolderId:r,onSelect:a},e.folder._id))})]})},k=(e,t)=>{for(const l of e){if(l.folder._id===t)return l;const e=k(l.children,t);if(e)return e}return null},N=({folderTree:e,activeFolderId:t,setActiveFolderId:l,positionClass:r})=>0===e.length?null:/* @__PURE__ */n("div",{class:`${r??""} w-[min(92%,260px)] overflow-hidden rounded-xl bg-background shadow-lg backdrop-blur-sm`,children:[/* @__PURE__ */n("div",{class:"flex items-center justify-between border-b border-slate-100 px-3 py-2.5",children:[/* @__PURE__ */n("p",{class:"text-xs font-semibold uppercase tracking-wide",children:"Destinations"}),t&&/* @__PURE__ */n("button",{type:"button",onClick:()=>l(null),class:"text-xs text-foreground",children:"Show all"})]}),/* @__PURE__ */n("ul",{class:"max-h-[60vh] overflow-y-auto py-1",children:e.map(e=>/* @__PURE__ */n(w,{node:e,depth:0,activeFolderId:t,onSelect:l},e.folder._id))})]});export{v as a,y as i,k as n,m as o,x as r,N as t};
|
package/umd/BdOzsWR32.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./C3uDEVBt.js";import{i as r}from"./BItJQVdK.js";import{t}from"./D9NypPiv.js";import{n as o,o as i,r as s,t as n}from"./BQuhYd4G2.js";function a({color:r="#ff4800",className:t="mx-auto size-9",...o}){/* @__PURE__ */
|
|
2
|
-
return e("svg",{className:t,viewBox:"0 0 20 20",role:"img","aria-hidden":"true",style:{color:r},...o,children:[
|
|
3
|
-
/* @__PURE__ */e("defs",{children:/* @__PURE__ */e("linearGradient",{id:"RadialGradient8932",children:[/* @__PURE__ */e("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"1"}),/* @__PURE__ */e("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.25"})]})}),
|
|
4
|
-
/* @__PURE__ */e("style",{children:"@keyframes spin8932 { to { transform: rotate(360deg); } }\n .circle8932 { transform-origin: 50% 50%; stroke: url(#RadialGradient8932); fill: none; animation: spin8932 .5s infinite linear; }"}),
|
|
5
|
-
/* @__PURE__ */e("circle",{cx:"10",cy:"10",r:"8",className:"circle8932",strokeWidth:2})]})}function l({className:r}){/* @__PURE__ */
|
|
6
|
-
return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M2.725 21q-.275 0-.5-.137t-.35-.363t-.137-.488t.137-.512l9.25-16q.15-.25.388-.375T12 3t.488.125t.387.375l9.25 16q.15.25.138.513t-.138.487t-.35.363t-.5.137zm1.725-2h15.1L12 6zm8.263-1.287Q13 17.425 13 17t-.288-.712T12 16t-.712.288T11 17t.288.713T12 18t.713-.288m0-3Q13 14.425 13 14v-3q0-.425-.288-.712T12 10t-.712.288T11 11v3q0 .425.288.713T12 15t.713-.288M12 12.5"})})}function d({open:a,onOpenChange:d,title:c,description:u,cancelText:m="Cancel",confirmText:g="Confirm",confirmColor:f="error",loading:h,onCancel:b,onConfirm:v}){/* @__PURE__ */
|
|
7
|
-
return e(n,{open:a,onOpenChange:d,children:/* @__PURE__ */e(o,{className:"w-full max-w-lg",children:[/* @__PURE__ */e("div",{className:"flex flex-col gap-6 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */e("div",{className:"bg-destructive/10 mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0",children:/* @__PURE__ */e(l,{className:"text-destructive size-6"})}),/* @__PURE__ */e("div",{className:"flex-1 space-y-2 text-center sm:text-left",children:[c&&/* @__PURE__ */e(i,{children:c}),u&&/* @__PURE__ */e(s,{children:u})]})]}),/* @__PURE__ */e("div",{className:"flex flex-col-reverse gap-3 p-4 sm:flex-row sm:justify-end",children:[/* @__PURE__ */e(t,{variant:"outlined",color:"foreground",disabled:h,className:"w-full sm:w-auto",onClick:b,children:m}),/* @__PURE__ */e(t,{color:f,loading:h,disabled:h,className:r("w-full sm:w-auto","error"===f&&"text-white"),onClick:v,children:g})]})]})})}var c={xs:"size-6 [&>*]:size-4",sm:"size-8 [&>*]:size-5",md:"size-10 [&>*]:size-6",lg:"size-12 [&>*]:size-7"},u={ghost:{primary:"text-primary hover:bg-primary/10",foreground:"text-foreground hover:bg-foreground/10",muted:"text-muted-foreground hover:bg-muted/20",error:"text-destructive hover:bg-destructive/10",success:"text-success hover:bg-success/10",warning:"text-warning hover:bg-warning/10",info:"text-info hover:bg-info/10"},filled:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",foreground:"bg-foreground text-background hover:bg-foreground/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80",error:"bg-destructive text-white hover:bg-destructive/90",success:"bg-success text-white hover:bg-success/90",warning:"bg-warning text-white hover:bg-warning/90",info:"bg-info text-white hover:bg-info/90"},outlined:{primary:"border border-primary text-primary hover:bg-primary/10",foreground:"border border-foreground text-foreground hover:bg-foreground/10",muted:"border border-border text-muted-foreground hover:bg-muted/20",error:"border border-destructive text-destructive hover:bg-destructive/10",success:"border border-success text-success hover:bg-success/10",warning:"border border-warning text-warning hover:bg-warning/10",info:"border border-info text-info hover:bg-info/10"}};function m({icon:t,size:o="md",variant:i="ghost",color:s="foreground",loading:n,disabled:a,tooltip:l,className:d,...m}){const g="default"===i?"filled":i,f=r("inline-flex cursor-pointer items-center justify-center rounded-full transition-colors disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",c[o],u[g]?.[s]||u[g]?.foreground,d);/* @__PURE__ */
|
|
8
|
-
return e("button",{type:"button",disabled:a||n,className:f,title:l,...m,children:n?/* @__PURE__ */e("svg",{className:"animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */e("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):t})}function g({className:r}){/* @__PURE__ */
|
|
9
|
-
return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"m10.6 13.8l-2.15-2.15q-.275-.275-.7-.275t-.7.275t-.275.7t.275.7L9.9 15.9q.3.3.7.3t.7-.3l5.65-5.65q.275-.275.275-.7t-.275-.7t-.7-.275t-.7.275zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22"})})}export{a,l as i,m as n,d as r,g as t};
|
package/umd/Be1e_ATJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as t,G as e,J as s,K as i,Q as r,W as u,X as n,Y as a,Z as o,it as h,nt as c,q as l,rt as f,z as y}from"./BItJQVdK.js";import{t as d}from"./4VTPoA38.js";var m=class extends h{constructor(t={}){super(),this.config=t,this.#t=/* @__PURE__ */new Set,this.#e=/* @__PURE__ */new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new d({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=p(t);if("string"==typeof e){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=p(t);if("string"==typeof e){const s=this.#e.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=p(t);if("string"==typeof e){const s=this.#e.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=p(t);return"string"==typeof e?(this.#e.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){e.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>a(e,t))}findAll(t={}){return this.getAll().filter(e=>a(t,e))}notify(t){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return e.batch(()=>Promise.all(t.map(t=>t.continue().catch(o))))}};function p(t){return t.options.scope?.id}var q=class extends h{constructor(t={}){super(),this.config=t,this.#i=/* @__PURE__ */new Map}#i;build(t,e,i){const r=e.queryKey,u=e.queryHash??s(r,e);let n=this.get(u);return n||(n=new y({client:t,queryKey:r,queryHash:u,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#i.has(t.queryHash)||(this.#i.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#i.get(t.queryHash);e&&(t.destroy(),e===t&&this.#i.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){e.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#i.get(t)}getAll(){return[...this.#i.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>n(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>n(t,e)):e}notify(t){e.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){e.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){e.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},g=class{#r;#u;#n;#a;#o;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new q,this.#u=t.mutationCache||new m,this.#n=t.defaultOptions||{},this.#a=/* @__PURE__ */new Map,this.#o=/* @__PURE__ */new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=f.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=u.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#u.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(e){const s=this.defaultQueryOptions(e),i=this.#r.build(this,s),r=i.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(r))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const r=this.defaultQueryOptions({queryKey:t}),u=this.#r.get(r.queryHash)?.state.data,n=i(e,u);if(void 0!==n)return this.#r.build(this,r).setData(n,{...s,manual:!0})}setQueriesData(t,s,i){return e.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){const s=this.#r;e.batch(()=>{s.findAll(t).forEach(t=>{s.remove(t)})})}resetQueries(t,s){const i=this.#r;return e.batch(()=>(i.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},s)))}cancelQueries(t,s={}){const i={revert:!0,...s},r=e.batch(()=>this.#r.findAll(t).map(t=>t.cancel(i)));return Promise.all(r).then(o).catch(o)}invalidateQueries(t,s={}){return e.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},s)))}refetchQueries(t,s={}){const i={...s,cancelRefetch:s.cancelRefetch??!0},r=e.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(o)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(r).then(o)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#r.build(this,s);return i.isStaleByTime(t(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(o).catch(o)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(o).catch(o)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return u.isOnline()?this.#u.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#u}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(l(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#a.values()],s={};return e.forEach(e=>{r(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#o.set(l(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#o.values()],s={};return e.forEach(e=>{r(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=s(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===c&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#u.clear()}};export{g as t};
|
package/umd/BfkCwRAR2.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{C as t,b as e,f as r,h as n,p as s,t as o}from"./C3uDEVBt.js";import{I as i,a,n as c,w as l}from"./BItJQVdK.js";import{t as u}from"./Be1e_ATJ.js";import{a as h,i as d,n as p,o as f,r as m,t as g}from"./BYoa-kpQ2.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:b}=Object,{hasOwnProperty:w}=Object.prototype;function x(t,e){return function(r,n,s){return t(r,n,s)&&e(r,n,s)}}function k(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);const{cache:s}=n,o=s.get(e),i=s.get(r);if(o&&i)return o===r&&i===e;s.set(e,r),s.set(r,e);const a=t(e,r,n);return s.delete(e),s.delete(r),a}}function E(t){return y(t).concat(b(t))}var v=Object.hasOwn||((t,e)=>w.call(t,e));function M(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var{getOwnPropertyDescriptor:A,keys:C}=Object;function _(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function L(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function j(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I(t,e){return M(t.getTime(),e.getTime())}function O(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function q(t,e){return t===e}function T(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.entries();let i,a,c=0;for(;(i=o.next())&&!i.done;){const n=e.entries();let o=!1,l=0;for(;(a=n.next())&&!a.done;){if(s[l]){l++;continue}const n=i.value,u=a.value;if(r.equals(n[0],u[0],c,l,t,e,r)&&r.equals(n[1],u[1],n[0],u[0],t,e,r)){o=s[l]=!0;break}l++}if(!o)return!1;c++}return!0}var P=M;function S(t,e,r){const n=C(t);let s=n.length;if(C(e).length!==s)return!1;for(;s-- >0;)if(!D(t,e,r,n[s]))return!1;return!0}function z(t,e,r){const n=E(t);let s,o,i,a=n.length;if(E(e).length!==a)return!1;for(;a-- >0;){if(s=n[a],!D(t,e,r,s))return!1;if(o=A(t,s),i=A(e,s),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function U(t,e){return M(t.valueOf(),e.valueOf())}function Z(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.values();let i,a;for(;(i=o.next())&&!i.done;){const n=e.values();let o=!1,c=0;for(;(a=n.next())&&!a.done;){if(!s[c]&&r.equals(i.value,a.value,i.value,a.value,t,e,r)){o=s[c]=!0;break}c++}if(!o)return!1}return!0}function F(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function B(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function D(t,e,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!t.$$typeof&&!e.$$typeof)||v(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var $={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R=Object.prototype.toString;var G=V();function V(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:s=!1}=t,o=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);const w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return c(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return n(m,g,y);if(w===RegExp)return u(m,g,y);if(w===Map)return i(m,g,y);if(w===Set)return h(m,g,y);const x=R.call(m);if("[object Date]"===x)return n(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return i(m,g,y);if("[object Set]"===x)return h(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&c(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return s(m,g,y);if("[object Arguments]"===x)return c(m,g,y);if($[x])return d(m,g,y);if("[object ArrayBuffer]"===x)return t(m,g,y);if("[object DataView]"===x)return r(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(m,g,y);if(f){let t=f[x];if(!t){const e=null!=(k=m)?k[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}var k;return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:_,areArraysEqual:r?z:L,areDataViewsEqual:j,areDatesEqual:I,areErrorsEqual:O,areFunctionsEqual:q,areMapsEqual:r?x(T,z):T,areNumbersEqual:P,areObjectsEqual:r?z:S,arePrimitiveWrappersEqual:U,areRegExpsEqual:Z,areSetsEqual:r?x(N,z):N,areTypedArraysEqual:r?x(F,z):F,areUrlsEqual:B,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const t=k(n.areArraysEqual),e=k(n.areMapsEqual),r=k(n.areObjectsEqual),s=k(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:r,areSetsEqual:s})}return n}(t));return function({circular:t,comparator:e,createState:r,equals:n,strict:s}){if(r)return function(o,i){const{cache:a=(t?/* @__PURE__ */new WeakMap:void 0),meta:c}=r();return e(o,i,{cache:a,equals:n,meta:c,strict:s})};if(t)return function(t,r){return e(t,r,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(t,r){return e(t,r,o)}}({circular:e,comparator:o,createState:n,equals:r?r(o):(i=o,function(t,e,r,n,s,o,a){return i(t,e,a)}),strict:s});var i}V({strict:!0}),V({circular:!0}),V({circular:!0,strict:!0}),V({createInternalComparator:()=>M}),V({strict:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M,strict:!0});var K=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],W=new Uint32Array(96),X=class t{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(1!==s)throw new Error(`Got v${s} data when expected v1.`);const o=K[15&n];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new t(a,i,o,void 0,e)}constructor(t,e=64,r=Float64Array,n=ArrayBuffer,s){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=K.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=2*t,this._finished=!0;else{const s=this.data=new n(8+i+a+c);this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=0,this._finished=!1,new Uint8Array(s,0,2).set([219,16+o]),new Uint16Array(s,2,1)[0]=e,new Uint32Array(s,4,1)[0]=t}}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3;const c=[];for(;a>0;){const l=W[--a],u=W[--a],h=W[--a];if(u-h<=i){for(let i=h;i<=u;i++){const a=o[2*i],l=o[2*i+1];a>=t&&a<=r&&l>=e&&l<=n&&c.push(s[i])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&c.push(s[d]),(0===l?t<=p:e<=f)&&(W[a++]=h,W[a++]=d-1,W[a++]=1-l),(0===l?r>=p:n>=f)&&(W[a++]=d+1,W[a++]=u,W[a++]=1-l)}return c}within(t,e,r){const n=[];return this.withinInto(t,e,r,n),n}withinInto(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3,c=0;const l=r*r;for(;a>0;){const u=W[--a],h=W[--a],d=W[--a];if(h-d<=i){for(let r=d;r<=h;r++)tt(o[2*r],o[2*r+1],t,e)<=l&&(n[c++]=s[r]);continue}const p=d+h>>1,f=o[2*p],m=o[2*p+1];tt(f,m,t,e)<=l&&(n[c++]=s[p]),(0===u?t-r<=f:e-r<=m)&&(W[a++]=d,W[a++]=p-1,W[a++]=1-u),(0===u?t+r>=f:e+r>=m)&&(W[a++]=p+1,W[a++]=h,W[a++]=1-u)}return c}};function J(t,e,r,n,s,o){if(s-n<=r)return;const i=n+s>>1;Y(t,e,i,n,s,o),J(t,e,r,n,i-1,1-o),J(t,e,r,i+1,s,1-o)}function Y(t,e,r,n,s,o){for(;s>n;){if(s-n>600){const i=s-n+1,a=r-n+1,c=Math.log(i),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(i-l)/i)*(a-i/2<0?-1:1);Y(t,e,r,Math.max(n,Math.floor(r-a*l/i+u)),Math.min(s,Math.floor(r+(i-a)*l/i+u)),o)}const i=e[2*r+o];let a=n,c=s;for(H(t,e,n,r),e[2*s+o]>i&&H(t,e,n,s);a<c;){for(H(t,e,a,c),a++,c--;e[2*a+o]<i;)a++;for(;e[2*c+o]>i;)c--}e[2*n+o]===i?H(t,e,n,c):(c++,H(t,e,c,s)),c<=r&&(n=c+1),r<=c&&(s=c-1)}}function H(t,e,r,n){Q(t,r,n),Q(e,2*r,2*n),Q(e,2*r+1,2*n+1)}function Q(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tt(t,e,r,n){const s=t-r,o=e-n;return s*s+o*o}var et,rt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},nt=Math.fround||(et=new Float32Array(1),t=>(et[0]=+t,et[0])),st=class{constructor(t){this.options=Object.assign(Object.create(rt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let a=0;a<t.length;a++){const e=t[a];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,s=nt(at(r)),i=nt(ct(n));o.push(s,i,1/0,a,-1,1),this.options.reduce&&o.push(0)}let i=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(s);for(let a=n;a>=r;a--){const t=+Date.now();i=this.trees[a]=this._createTree(this._cluster(i,a)),e&&console.log("z%d: %d clusters in %dms",a,i.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,s=180;else if(r>s){const t=this.getClusters([r,n,180,o],e),i=this.getClusters([-180,n,s,o],e);return t.concat(i)}const i=this.trees[this._limitZoom(e)],a=i.range(at(r),ct(o),at(s),ct(n)),c=i.data,l=[];for(const u of a){const t=this.stride*u;l.push(c[t+5]>1?ot(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const i=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o[e*this.stride],c=o[e*this.stride+1],l=s.within(a,c,i),u=[];for(const h of l){const e=h*this.stride;o[e+4]===t&&u.push(o[e+5]>1?ot(o,e,this.clusterProps):this.points[o[e+3]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:i}=this.options,a=i/o,c=(r-a)/s,l=(r+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,c,(e+1+a)/s,l),n.data,e,r,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,c,1,l),n.data,s,r,s,u),e===s-1&&this._addTileFeatures(n.range(0,c,a/s,l),n.data,-1,r,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,s){const o=this.getChildren(e);for(const i of o){const e=i.properties;if(e&&e.cluster?s+e.point_count<=n?s+=e.point_count:s=this._appendLeaves(t,e.cluster_id,r,n,s):s<n?s++:t.push(i),t.length===r)break}return s}_createTree(t){const e=new X(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,r,n,s,o){for(const i of t){const t=i*this.stride,a=e[t+5]>1;let c,l,u;if(a)c=it(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const r=this.points[e[t+3]];c=r.properties;const[n,s]=r.geometry.coordinates;l=at(n),u=ct(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*s-r)),Math.round(this.options.extent*(u*s-n))]],tags:c};let d;d=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:s,minPoints:o}=this.options,i=r/(n*Math.pow(2,e)),a=t.data,c=[],l=this.stride;for(let u=0;u<a.length;u+=l){if(a[u+2]<=e)continue;a[u+2]=e;const r=a[u],n=a[u+1],h=t.within(a[u],a[u+1],i),d=a[u+5];let p=d;for(const t of h){const r=t*l;a[r+2]>e&&(p+=a[r+5])}if(p>d&&p>=o){let t,o=r*d,i=n*d,f=-1;const m=(u/l<<5)+(e+1)+this.points.length;for(const r of h){const n=r*l;if(a[n+2]<=e)continue;a[n+2]=e;const c=a[n+5];o+=a[n]*c,i+=a[n+1]*c,a[n+4]=m,s&&(t||(t=this._map(a,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,n)))}a[u+4]=m,c.push(o/p,i/p,1/0,m,-1,p),s&&c.push(f)}else{for(let t=0;t<l;t++)c.push(a[u+t]);if(p>1)for(const t of h){const r=t*l;if(!(a[r+2]<=e)){a[r+2]=e;for(let t=0;t<l;t++)c.push(a[r+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,s=this.options.map(n);return r&&s===n?Object.assign({},s):s}};function ot(t,e,r){return{type:"Feature",id:t[e+3],properties:it(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),lt(t[e+1])]}};var n}function it(t,e,r){const n=t[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],i=-1===o?{}:Object.assign({},r[o]);return Object.assign(i,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:s})}function at(t){return t/360+.5}function ct(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function lt(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ut=class{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(Number.isFinite(t.position.lat)&&Number.isFinite(t.position.lng))return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}},ht=class{constructor({markers:t,position:e}){this.markers=[],t&&(this.markers=t),e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(ut.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>ut.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(ut.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function dt(t,e="assertion failed"){if(null==t)throw Error(e)}var pt,ft=class{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return mt(t)}},mt=t=>t.map(t=>new ht({position:ut.getPosition(t),markers:[t]})),gt=class extends ft{constructor(t){var{maxZoom:e,radius:r=60}=t,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,["maxZoom","radius"]);super({maxZoom:e}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new st(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(t){let e=!1,r=t.map.getZoom();dt(r),r=Math.round(r);const n={zoom:r};if(!G(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(t=>{const e=ut.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!G(this.state,n)),this.state=n,0===t.markers.length?(this.clusters=[],{clusters:this.clusters,changed:e}):(e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e})}cluster({map:t}){const e=t.getZoom();return dt(e),this.superCluster.getClusters([-180,-90,180,90],Math.round(e)).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[t,e]},properties:r}){if(r.cluster)return new ht({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(t=>t.properties.marker),position:{lat:e,lng:t}});const n=r.marker;return new ht({markers:[n],position:ut.getPosition(n)})}},yt=class{constructor(t,e){this.markers={sum:t.length};const r=e.map(t=>t.count),n=r.reduce((t,e)=>t+e,0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}},bt=class{render({count:t,position:e},r,n){const s=`<svg fill="${t>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+t;if(ut.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const r={map:n,position:e,zIndex:i,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(r)}const a={position:e,zIndex:i,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}},wt=class t{constructor(){!function(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)}};!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"}(pt||(pt={}));var xt=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)},kt=class extends wt{constructor({map:t,markers:e=[],algorithmOptions:r={},algorithm:n=new gt(r),renderer:s=new bt,onClusterClick:o=xt}){super(),this.map=null,this.idleListener=null,this.markers=[...e],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(t=>{this.addMarker(t,!0)}),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(ut.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let r=!1;return t.forEach(t=>{r=this.removeMarker(t,!0)||r}),r&&!e&&this.render(),r}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,pt.CLUSTERING_BEGIN,this);const{clusters:e,changed:r}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(r||null==r){const t=/* @__PURE__ */new Set;for(const n of e)1==n.markers.length&&t.add(n.markers[0]);const r=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||ut.setMap(e.marker,null):r.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>r.forEach(t=>ut.setMap(t,null)))}google.maps.event.trigger(this,pt.CLUSTERING_END,this)}}onAdd(){const t=this.getMap();dt(t),this.idleListener=t.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>ut.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new yt(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,t,e),r.markers.forEach(t=>ut.setMap(t,null)),this.onClusterClick){const t=ut.isAdvancedMarker(r.marker)?pt.GMP_CLICK:pt.CLUSTER_CLICK;r.marker.addListener(t,t=>{google.maps.event.trigger(this,pt.CLUSTER_CLICK,r),this.onClusterClick(t,r,e)})}ut.setMap(r.marker,e)})}},Et={top:60,bottom:60,left:276,right:60},vt="#fb8500",Mt=new u,At=(e,r,n)=>{t(/* @__PURE__ */o(i,{client:Mt,children:/* @__PURE__ */o(h,{event:e,onExplore:n})}),r)},Ct=t=>{const e=document.createElement("div");e.style.cssText=`\n background:${m(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=t.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(t.eventCount),e.appendChild(r),e.appendChild(n),e},_t=(t,e)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${t};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,e){const t=document.createElement("img");t.src=d(e)??"",t.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(t)}return r},Lt=({apiKey:t,onExplore:i,logoUrl:u})=>{const h=r(null),d=r(null),m=r(null),y=r(null),b=r([]),w=r([]),x=r(null),k=r(null),E=r(!1),v=r(!1),M=s(()=>(()=>{try{const t=sessionStorage.getItem(l);if(!t)return null;const e=JSON.parse(t);if(Array.isArray(e?.center)&&"number"==typeof e.zoom)return e}catch{}return null})(),[]),[A,C]=n(!1),[_,L]=n(!0),{folderTree:j,activeFolderId:I,activeFolder:O,visibleEvents:q,setActiveFolderId:T,isLoadingEvents:P}=f(),{organization:S}=c(),z=()=>{b.current.forEach(t=>{t.map=null}),b.current=[]},U=()=>{x.current&&(x.current.clearMarkers(),x.current=null),w.current.forEach(t=>{t.map=null}),w.current=[]};return e(()=>{if(!h.current||d.current)return;let e=!1;return(async()=>{try{const{setOptions:r,importLibrary:n}=await import("./BsT0vqml.js");if(e)return;if(r({key:t,v:"weekly"}),await Promise.all([n("maps"),n("marker"),n("visualization")]),e||!h.current)return;const s=window.google.maps;m.current=s;const o=M?.center?{lng:M.center[0],lat:M.center[1]}:{lat:20,lng:0},i=M?.zoom??3,a=new s.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:o,zoom:i,mapTypeControl:!1,streetViewControl:!1});d.current=a,y.current=new s.InfoWindow({maxWidth:280}),k.current=new s.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const t=a.getCenter();if(!t)return;sessionStorage.setItem(l,JSON.stringify({center:[t.lng(),t.lat()],zoom:a.getZoom()}))}catch{}};a.addListener("idle",c),L(!1),C(!0)}finally{e||L(!1)}})(),()=>{e=!0,z(),U(),k.current&&(k.current.setMap(null),k.current=null),y.current?.close(),d.current=null,m.current=null}},[t]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(z(),U(),y.current?.close(),null===I&&j.length>0){k.current?.setMap(null);const r=n=>{for(const s of n)if(s.centroid){const r=Ct(s),n=new e.marker.AdvancedMarkerElement({map:t,position:{lng:s.centroid[0],lat:s.centroid[1]},content:r,gmpClickable:!0});n.addListener("click",()=>T(s.folder._id)),b.current.push(n)}else s.children.length>0&&r(s.children)};r(j)}else{const r=0===j.length&&null===I;if(0===q.length)return;if(r){const r=[],n=q.map(n=>{const s=n.location.y,o=n.location.x;r.push({location:new e.LatLng(s,o),weight:(n.views||0)+1});const a=_t(vt,u),c=new e.marker.AdvancedMarkerElement({map:t,position:{lat:s,lng:o},content:a,gmpClickable:!0});return c.addListener("click",()=>{const e=document.createElement("div");At(n,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:c,map:t})}),c});if(w.current=n,x.current=new kt({markers:n,map:t,renderer:{render:({count:t,position:r})=>{const n=document.createElement("div"),s=t<10?28:t<30?34:40;return n.style.cssText=`\n width:${s}px;height:${s}px;border-radius:50%;cursor:pointer;\n background:${vt};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,n.textContent=String(t),new e.marker.AdvancedMarkerElement({position:r,content:n,gmpClickable:!0,zIndex:Number(e.Marker?.MAX_ZINDEX??0)+t})}}}),k.current&&(k.current.setData(r),k.current.setMap(t)),!v.current&&(v.current=!0,!M)){const r=new e.LatLngBounds;q.forEach(t=>r.extend({lat:t.location.y,lng:t.location.x})),r.isEmpty()||t.fitBounds(r,Et)}}else{k.current?.setMap(null);const r=O?.color||vt,n=new e.LatLngBounds;q.forEach(s=>{const o=s.location.y,a=s.location.x;n.extend({lat:o,lng:a});const c=_t(r,u),l=new e.marker.AdvancedMarkerElement({map:t,position:{lat:o,lng:a},content:c,gmpClickable:!0});l.addListener("click",()=>{const e=document.createElement("div");At(s,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:l,map:t})}),w.current.push(l)})}}},[I,j,q,A,i,u,T,O,M]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(E.current||!M){if(E.current=!0,I){const r=p(j,I);if(!r?.folder.boundary?.length)return;const n=new e.LatLngBounds;for(const t of r.folder.boundary)n.extend({lat:t.y,lng:t.x});n.isEmpty()||t.fitBounds(n,{...Et,maxZoom:14})}else if(j.length>0){const r=new e.LatLngBounds,n=t=>{for(const e of t)e.centroid?r.extend({lng:e.centroid[0],lat:e.centroid[1]}):n(e.children)};n(j),r.isEmpty()||t.fitBounds(r,{...Et,maxZoom:8})}}else E.current=!0},[I,j,A,M]),/* @__PURE__ */o("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:a(S),children:[
|
|
2
|
-
/* @__PURE__ */o(g,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:j,activeFolderId:I,setActiveFolderId:T}),P&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),_&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */o("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */o("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
3
|
-
/* @__PURE__ */o("div",{ref:h,class:"size-full"})]})};export{Lt as default};
|
package/umd/BglDIiFp.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{t}from"./C3uDEVBt.js";import{D as e}from"./BItJQVdK.js";import{l as s}from"./b6CwQBFC.js";function a({className:e}){/* @__PURE__ */
|
|
2
|
-
return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"m7.825 13l4.9 4.9q.3.3.288.7t-.313.7q-.3.275-.7.288t-.7-.288l-6.6-6.6q-.15-.15-.213-.325T4.426 12t.063-.375t.212-.325l6.6-6.6q.275-.275.688-.275t.712.275q.3.3.3.713t-.3.712L7.825 11H19q.425 0 .713.288T20 12t-.288.713T19 13z"})})}var r=()=>{const r=s();/* @__PURE__ */
|
|
3
|
-
return t("button",{type:"button",onClick:()=>{window.history.length>1?r(-1):r(e.PUBLIC_EVENTS,{state:{internalNavigation:!0}})},className:"text-primary absolute top-0 left-0",children:/* @__PURE__ */t(a,{className:"size-6"})})};export{r as t};
|
package/umd/BkIDQGIs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let a=0;for(let r=0;r<e.length;r++){let h=e[r];a=83*a+t.indexOf(h)}return a},a=(e,a)=>{var r="";for(let h=1;h<=a;h++){let l=Math.floor(e)/Math.pow(83,a-h)%83;r+=t[Math.floor(l)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},h=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},l=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),o=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},n=t=>{let e=t>>8&255,a=255&t;return[r(t>>16),r(e),r(a)]},M=(t,e)=>{let a=Math.floor(t/361),r=Math.floor(t/19)%19,h=t%19;return[l((a-9)/9,2)*e,l((r-9)/9,2)*e,l((h-9)/9,2)*e]},s=(t,a,r,l)=>{(t=>{if(!t||t.length<6)throw new o("The blurhash string must be at least 6 characters");let a=e(t[0]),r=Math.floor(a/9)+1,h=a%9+1;if(t.length!==4+2*h*r)throw new o(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*h*r}`)})(t),l|=1;let s=e(t[0]),f=Math.floor(s/9)+1,i=s%9+1,u=(e(t[1])+1)/166,m=new Array(i*f);for(let h=0;h<m.length;h++)m[h]=0===h?n(e(t.substring(2,6))):M(e(t.substring(4+2*h,6+2*h)),u*l);let c=4*a,w=new Uint8ClampedArray(c*r);for(let e=0;e<r;e++)for(let t=0;t<a;t++){let l=0,o=0,n=0;for(let h=0;h<f;h++)for(let M=0;M<i;M++){let s=Math.cos(Math.PI*t*M/a)*Math.cos(Math.PI*e*h/r),f=m[M+h*i];l+=f[0]*s,o+=f[1]*s,n+=f[2]*s}let M=h(l),s=h(o),u=h(n);w[4*t+0+e*c]=M,w[4*t+1+e*c]=s,w[4*t+2+e*c]=u,w[4*t+3+e*c]=255}return w},f=(t,e,a,h)=>{let l=0,o=0,n=0,M=4*e;for(let f=0;f<e;f++){let e=4*f;for(let s=0;s<a;s++){let a=e+s*M,i=h(f,s);l+=i*r(t[a]),o+=i*r(t[a+1]),n+=i*r(t[a+2])}}let s=1/(e*a);return[l*s,o*s,n*s]},i=(t,e,r,n,M)=>{if(n<1||n>9||M<1||M>9)throw new o("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new o("Width and height must match the pixels array");let s=[];for(let a=0;a<M;a++)for(let h=0;h<n;h++){let l=0==h&&0==a?1:2,o=f(t,e,r,(t,o)=>l*Math.cos(Math.PI*h*t/e)*Math.cos(Math.PI*a*o/r));s.push(o)}let i,u=s[0],m=s.slice(1),c="";if(c+=a(n-1+9*(M-1),1),m.length>0){let t=Math.max(...m.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));i=(e+1)/166,c+=a(e,1)}else i=1,c+=a(0,1);return c+=a((t=>(h(t[0])<<16)+(h(t[1])<<8)+h(t[2]))(u),4),m.forEach(t=>{c+=a(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*l(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*l(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*l(t[2]/e,.5)+9.5)))))(t,i),2)}),c};export{s as n,i as t};
|
package/umd/Bki5T_lb.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=["javascript:","data:","vbscript:","file:"];function r(r,n=["http:","https:"]){if(!r||function(r){const n=r.trim().toLowerCase();return t.some(t=>n.startsWith(t))}(r))return!1;try{const t="undefined"!=typeof window?window.location.href:"https://qrati.com",e=new URL(r,t);return n.includes(e.protocol)}catch{return!1}}function n(t){return t.replace(/^\s*[\w-]+:(?:\/\/)?\s*/i,"").trim()}export{n,r as t};
|
package/umd/BsT0vqml.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o=!1;function r(r){o?(o=>{JSON.stringify(o)})(r):(function(o){const r=Boolean(window.google?.maps?.importLibrary);var a,e,n,i,t,s,c,p,l,m,g,w,d,y;r&&(o=>{JSON.stringify(o)})(o),r||(a=o,t="The Google Maps JavaScript API",s="google",c="importLibrary",p="__ib__",l=document,m=window,g=m[s]||(m[s]={}),w=g.maps||(g.maps={}),d=/* @__PURE__ */new Set,y=new URLSearchParams,w[c]?console.warn(t+" only loads once. Ignoring:",a):w[c]=(o,...r)=>d.add(o)&&(e||(e=new Promise(async(o,r)=>{for(i in await(n=l.createElement("script")),y.set("libraries",[...d]+""),a)y.set(i.replace(/[A-Z]/g,o=>"_"+o[0].toLowerCase()),a[i]);y.set("callback",s+".maps."+p),function(o,r){o.src=r}(n,"https://maps.googleapis.com/maps/api/js?"+y),w[p]=o,n.onerror=()=>e=r(Error(t+" could not load.")),n.nonce=l.querySelector("script[nonce]")?.nonce||"",l.head.append(n)}))).then(()=>w[c](o,...r)))}(r),o=!0)}async function a(o){if(!window?.google?.maps?.importLibrary)throw new Error("google.maps.importLibrary is not installed.");return await google.maps.importLibrary(o)}export{a as importLibrary,r as setOptions};
|