@qratilabs/qrati-connect 2.26.0 → 2.27.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/element/{CVdpS1mF2.js → 1eQ9Ef0M2.js} +3 -3
- package/element/B0sEsGHn.js +8 -0
- package/element/B9ImRAum.js +1 -0
- package/element/{DwanMJWW.js → BKENYwOQ.js} +1 -1
- package/element/{DpD2Abx9.js → BLeZg2Bz.js} +1 -1
- package/element/{BfPopwQu2.js → BdkTKcG52.js} +8 -8
- package/element/{CwPz_TbG.js → BmsDSHUi.js} +1 -1
- package/element/{CM46pkhP2.js → BqiJLitq2.js} +1 -1
- package/element/{DLSVYuRG.js → BspExsK7.js} +2 -2
- package/element/Bspyv2wJ2.js +24 -0
- package/element/{D6nJgjWV.js → C4DSwLWc.js} +1 -1
- package/element/{CMR1TPJ1.js → C6MqLLDX.js} +1 -1
- package/element/C6YE4WUG2.js +5 -0
- package/element/C8meSsHD.js +1 -0
- package/element/CBM5QMn8.js +1 -0
- package/element/CKQOToSD.js +41 -0
- package/element/{DDyjgYNE.js → CUBxHQ8u.js} +1 -1
- package/element/CeHBrY_i.js +1 -0
- package/element/{BXZi_HIE.js → CfTdZB8y.js} +1 -1
- package/element/{xW6UboQF.js → CgxypkdG.js} +1 -1
- package/element/{DBUAmPz_.js → Cl0CwL5p.js} +1 -1
- package/element/DGZEznLT2.js +1 -0
- package/element/{Cw3szkAB.js → DLF5ysgi.js} +1 -1
- package/element/{BBWyJmHC.js → DOOdI-Oh.js} +1 -1
- package/element/DRPgs6nu2.js +16 -0
- package/element/{CDUjv5F52.js → DSx5wvUb2.js} +1 -1
- package/element/{BmU1kgIz2.js → DVFC5Z2L2.js} +14 -14
- package/element/{D9UPX_0d2.js → DWqIpaZ02.js} +1 -1
- package/element/{Bt5DH8OK.js → DZGp2V2-.js} +1 -1
- package/element/{DER_7fjj2.js → D_FNRN5A2.js} +1 -1
- package/element/{OGzsLhnG.js → DdYePHxG.js} +1 -1
- package/element/{BlD6lUxS.js → DlAI3J0X.js} +1 -1
- package/element/{CE4Zhv-W.js → DmIYOIw1.js} +1 -1
- package/element/DmpmrPE5.js +1 -0
- package/element/{Cqyszkb5.js → DvisvxzJ.js} +1 -1
- package/element/{CtWIgfGz.js → DyemeRjE2.js} +1 -1
- package/element/MU5QuIq0.js +3 -0
- package/element/{nOtAuUm1.js → QDuBhueG.js} +1 -1
- package/element/{Bb4v1eCh2.js → SgRzjPnr.js} +11 -11
- package/element/{PRmGsKkz2.js → Vk429P022.js} +1 -1
- package/element/{uIYtFcCq2.js → aXvUP7X72.js} +4 -4
- package/element/{BvrbBj1F.js → p0Q_2x6C.js} +1 -1
- package/element/{CzHEb5lR2.js → qBKIp1ZW2.js} +14 -14
- package/element/web.es.js +4 -4
- package/element/{CCDjXLSf.js → xJZs5Gan.js} +1 -1
- package/package.json +1 -1
- package/element/2CzUGwUv.js +0 -1
- package/element/BlmPmkho.js +0 -41
- package/element/CD7ZeUsI2.js +0 -9
- package/element/CitgNM58.js +0 -3
- package/element/DAjJ8IJf.js +0 -1
- package/element/DhbEeiM3.js +0 -8
- package/element/DvW8TE7T.js +0 -1
- package/element/KcnPb5CZ.js +0 -1
- package/element/PVzBLdl-2.js +0 -5
- package/element/VF9qDLJE2.js +0 -1
- package/element/b3Wjw4T02.js +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t}from"./DrrpB4Om.js";import{i as e,o as r}from"./
|
|
1
|
+
import{t}from"./DrrpB4Om.js";import{i as e,o as r}from"./CKQOToSD.js";var l=t=>"boolean"==typeof t?`${t}`:0===t?"0":t,o=r,a=(t,e)=>r=>{var a;if(null==(null==e?void 0:e.variants))return o(t,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:n,defaultVariants:i}=e,s=Object.keys(n).map(t=>{const e=null==r?void 0:r[t],o=null==i?void 0:i[t];if(null===e)return null;const a=l(e)||l(o);return n[t][a]}),d=r&&Object.entries(r).reduce((t,e)=>{let[r,l]=e;return void 0===l||(t[r]=l),t},{});return o(t,s,null==e||null===(a=e.compoundVariants)||void 0===a?void 0:a.reduce((t,e)=>{let{class:r,className:l,...o}=e;return Object.entries(o).every(t=>{let[e,r]=t;return Array.isArray(r)?r.includes({...i,...d}[e]):{...i,...d}[e]===r})?[...t,r,l]:t},[]),null==r?void 0:r.class,null==r?void 0:r.className)},n={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",p:"p",blockquote:"blockquote",body1:"p",body2:"p",body3:"p",caption:"span",overline:"span",lead:"p"},i=a("antialiased",{variants:{variant:{h1:"scroll-m-20 text-4xl font-bold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-bold tracking-tight lg:text-4xl",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold",h5:"scroll-m-20 text-lg font-semibold",h6:"scroll-m-20 text-base font-semibold",body1:"text-base leading-relaxed font-medium",body2:"text-sm leading-relaxed",body3:"text-sm leading-relaxed sm:text-base",p:"text-base leading-7",lead:"text-muted-foreground text-xl leading-relaxed",blockquote:"border-primary/30 text-muted-foreground border-l-4 pl-4 text-base italic",caption:"text-muted-foreground text-xs",overline:"text-muted-foreground text-xs font-medium tracking-widest uppercase"},color:{foreground:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",info:"text-info",warning:"text-warning",success:"text-success",error:"text-destructive",inherit:"text-inherit",secondary:"text-muted-foreground",white:"text-white",black:"text-black",a11y:"text-primary-foreground",light:"text-text-primary-light"},align:{left:"text-left",right:"text-right",center:"text-center",justify:"text-justify"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"body1",color:"foreground",align:"left"}}),s=({variant:r="body1",color:l,align:o,weight:a,transform:s,lines:d,shadow:u,noWrap:x,className:c,immutable:m,...g})=>/* @__PURE__ */t(n[r],{className:e(i({variant:r,color:l,align:o,weight:a}),s,d&&d>0?`line-clamp-${d}`:void 0,u&&"drop-shadow-[0_1px_2px_rgba(0,0,0,0.5)]",x&&"truncate",c),...g,children:g.children});export{i as n,a as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class extends Error{name="KyError";get isKyError(){return!0}},t=class extends e{name="HTTPError";response;request;options;data;constructor(e,t,o){const r=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=o}},o=class extends e{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},r=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}},s=class extends e{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new r(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}},n=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}},i=class extends e{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},a=(()=>{let e=!1,t=!1;const o="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(o&&r)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(s){if(s instanceof Error&&"unsupported BodyInit type"===s.message)return!1;throw s}return e&&!t})(),h="function"==typeof globalThis.AbortController,c="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,u="function"==typeof globalThis.ReadableStream,l="function"==typeof globalThis.FormData,p=["get","post","put","patch","head","delete"],f={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},d=Symbol("stop"),y=class{options;constructor(e){this.options=e}},m=e=>new y(e),g={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},b={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},w=new TextEncoder,R=(e,t,o)=>{let r,s=0;return e.pipeThrough(new TransformStream({transform(e,n){if(n.enqueue(e),r){s+=r.byteLength;let e=0===t?0:s/t;e>=1&&(e=1-Number.EPSILON),o?.({percent:e,totalBytes:Math.max(t,s),transferredBytes:s},r)}r=e},flush(){r&&(s+=r.byteLength,o?.({percent:1,totalBytes:Math.max(t,s),transferredBytes:s},r))}}))},T=e=>null!==e&&"object"==typeof e,q=Symbol("replaceOption"),v=e=>T(e)&&!0===e[q]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},E=(...e)=>{for(const t of e)if((!T(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return L({},...e)},P=(e={},t={})=>{const o=new globalThis.Headers(e),r=t instanceof globalThis.Headers,s=new globalThis.Headers(t);for(const[n,i]of s.entries())r&&"undefined"===i||void 0===i?o.delete(n):o.set(n,i);return o},S=e=>{if(!T(e)||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},x=e=>{if(e instanceof URLSearchParams){const t=new URLSearchParams(e),o=e[C];return o&&(t[C]=new Set(o)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:S(e)?{...e}:e},A=(e,t)=>{return S(e)&&S(t)?(o={...e,...t},Object.fromEntries(Object.entries(o).filter(e=>void 0!==e[1]))):P(e,t);var o};function j(e,t,o){return Object.hasOwn(t,o)&&void 0===t[o]?[]:L(e[o]??[],t[o]??[])}var k=(e={},t={})=>({init:j(e,t,"init"),beforeRequest:j(e,t,"beforeRequest"),beforeRetry:j(e,t,"beforeRetry"),beforeError:j(e,t,"beforeError"),afterResponse:j(e,t,"afterResponse")}),C=Symbol("deletedParameters"),O=(e,t)=>{const o=new URLSearchParams,r=/* @__PURE__ */new Set;for(const s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams){for(const[t,n]of s.entries())o.append(t,n),r.delete(t);const e=s[C];if(e)for(const t of e)o.delete(t),r.add(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");o.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(T(s))for(const[e,t]of Object.entries(s))void 0===t?(o.delete(e),r.add(e)):(o.append(e,String(t)),r.delete(e));else{const e=new URLSearchParams(s);for(const[t,s]of e.entries())o.append(t,s),r.delete(t)}return r.size>0&&(o[C]=r),o},L=(...e)=>{let t,o={},r={},s={};const n=[];for(const i of e)if(Array.isArray(i))Array.isArray(o)||(o=[]),o=[...o,...i];else if(T(i)){for(let[e,r]of Object.entries(i)){if("signal"===e&&r instanceof globalThis.AbortSignal){n.push(r);continue}const s=v(r),{isReplace:i}=s;if(r=s.value,"context"!==e)"searchParams"!==e?(T(r)&&!i&&e in o&&(r=L(o[e],r)),o={...o,[e]:r}):t=null==r?void 0:i||void 0===t?r:O(t,r);else{if(null!=r&&(!T(r)||Array.isArray(r)))throw new TypeError("The `context` option must be an object");o={...o,context:null==r?{}:i?{...r}:{...o.context,...r}}}}if(T(i.hooks)){const{value:e,isReplace:t}=v(i.hooks);s=k(t?{}:s,e),o.hooks=s}if(T(i.headers)){const{value:e,isReplace:t}=v(i.headers);r=t?x(e):A(r,e),o.headers=r}}return void 0!==t&&(o.searchParams=t),n.length>0&&(1===n.length?o.signal=n[0]:o.signal=c?AbortSignal.any(n):n.at(-1)),o},N=e=>p.includes(e)?e.toUpperCase():e,D={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},B=(e={})=>{if("number"==typeof e)return{...D,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>void 0!==e));return{...D,...t}};async function U(e,{signal:t}){return new Promise((o,r)=>{function s(){clearTimeout(n),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",s,{once:!0}));const n=setTimeout(()=>{t?.removeEventListener("abort",s),o()},e)})}var H=Object.prototype.toString,F=/* @__PURE__ */new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);var J=(e,t)=>e instanceof t||e?.name===t.name,z=Symbol("timedOutResponseData"),I="The `schema` argument must follow the Standard Schema specification",$=Object.prototype.toString,M=e=>e instanceof globalThis.Request||"[object Request]"===$.call(e),W=e=>e instanceof globalThis.Response||"[object Response]"===$.call(e),_=async(e,t)=>{if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError(I);const o=t["~standard"];if("object"!=typeof o||null===o||"function"!=typeof o.validate)throw new TypeError(I);const r=await o.validate(e);if(r.issues)throw new n(r.issues);return r.value},V=class e{static create(o,r){const n=r.hooks?.init??[],i=n.length>0?function(e){const t={...e,json:x(e.json),context:x(e.context),headers:x(e.headers),searchParams:(o=e.searchParams,Array.isArray(o)?o.map(e=>[...e]):x(o))};var o;return void 0!==e.retry&&(t.retry=(e=>"object"!=typeof e?e:{...e,...e.methods&&{methods:[...e.methods]},...e.statusCodes&&{statusCodes:[...e.statusCodes]},...e.afterStatusCodes&&{afterStatusCodes:[...e.afterStatusCodes]}})(e.retry)),t}(r):r;for(const e of n)e(i);const a=new e(o,i),h=(async()=>{try{return await(async()=>{if("number"==typeof a.#e.timeout&&a.#e.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");if("number"==typeof a.#e.totalTimeout&&a.#e.totalTimeout>2147483647)throw new RangeError("The `totalTimeout` option cannot be greater than 2147483647");await Promise.resolve();const e=await a.#t();let o=e??await a.#o(async()=>a.#r()),r=void 0!==e||a.#s();for(;;){if(void 0===o)return o;if(W(o))try{o=await a.#n(o)}catch(n){if(!(n instanceof s))throw n;const e=await a.#i(n,async()=>a.#r());if(void 0===e)return e;o=e,r=a.#s();continue}const e=o;if(!e.ok&&"opaque"!==e.type&&("function"==typeof a.#e.throwHttpErrors?a.#e.throwHttpErrors(e.status):a.#e.throwHttpErrors)){const s=new t(e,a.#a(e),a.#h()),n=s;if(s.data=await a.#c(e),r)throw n;const i=await a.#i(s,async()=>a.#r());if(void 0===i)return i;o=i,r=a.#s();continue}break}if(!W(o))return o;if(a.#u(o),a.#e.onDownloadProgress){if("function"!=typeof a.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!u)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=o.clone();return a.#l(o),((e,t)=>{if(!e.body)return e;const o={status:e.status,statusText:e.statusText,headers:e.headers};if(204===e.status)return new Response(null,o);const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(R(e.body,r,t),o)})(e,a.#e.onDownloadProgress)}return o})()}catch(e){if(!(e instanceof Error))throw e;if(a.#p.has(e))throw e;let t=e;for(const o of a.#e.hooks.beforeError){const e=await o({request:a.request,options:a.#h(),error:t,retryCount:a.#f});e instanceof Error&&(t=e)}throw t}finally{const e=a.#d;a.#y(e?.body??void 0),a.request!==e&&a.#y(a.request.body??void 0)}})();for(const[e,t]of Object.entries(f))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(h[e]=async o=>{a.request.headers.set("accept",a.request.headers.get("accept")||t);const r=await h;if("json"!==e)return r[e]();const s=await r.text();if(""===s)return void 0!==o?_(void 0,o):JSON.parse(s);const n=i.parseJson?await i.parseJson(s,{request:a.#a(r),response:r}):JSON.parse(s);return void 0===o?n:_(n,o)});return h}static#m(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#g;#f=0;#b;#e;#d;#w;#p=/* @__PURE__ */new WeakSet;#R;#T;#q=!1;#v=/* @__PURE__ */new WeakMap;constructor(t,o={}){if(this.#b=t,Object.hasOwn(o,"prefixUrl"))throw new Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");if(this.#e={...o,headers:P(this.#b.headers,o.headers),hooks:k({},o.hooks),method:N(o.method??this.#b.method??"GET"),prefix:String(o.prefix||""),retry:B(o.retry),throwHttpErrors:o.throwHttpErrors??!0,timeout:o.timeout??1e4,totalTimeout:o.totalTimeout??!1,fetch:o.fetch??globalThis.fetch.bind(globalThis),context:o.context??{}},"string"!=typeof this.#b&&!(this.#b instanceof URL||this.#b instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if("string"==typeof this.#b){if(this.#e.prefix){const e=this.#e.prefix.replace(/\/+$/,""),t=this.#b.replace(/^\/+/,"");this.#b=`${e}/${t}`}if(this.#e.baseUrl){let e;try{e=new URL(this.#b)}catch{}e||(this.#b=new URL(this.#b,new Request(this.#e.baseUrl).url))}}h&&c&&(this.#w=this.#e.signal??this.#b.signal,this.#g=new globalThis.AbortController,this.#e.signal=this.#E()),a&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=o.headers&&new globalThis.Headers(o.headers).has("content-type");if(this.#b instanceof globalThis.Request&&(l&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#b,this.#e),void 0!==(s=this.#e.searchParams)&&(Array.isArray(s)?s.length>0:s instanceof URLSearchParams?s.size>0||Boolean(s[C]?.size):"object"==typeof s?Object.keys(s).length>0:"string"==typeof s?s.trim().length>0:Boolean(s))){const t=new URL(this.request.url),o=this.#e.searchParams?.[C];if(o)for(const e of o)t.searchParams.delete(e);if("string"==typeof this.#e.searchParams){const e=this.#e.searchParams.replace(/^\?/,"");""!==e&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{const o=new URLSearchParams(e.#m(this.#e.searchParams));for(const[e,r]of o.entries())t.searchParams.append(e,r)}if(this.#e.searchParams&&"object"==typeof this.#e.searchParams&&!Array.isArray(this.#e.searchParams)&&!(this.#e.searchParams instanceof URLSearchParams))for(const[e,r]of Object.entries(this.#e.searchParams))void 0===r&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#e)}var s;if(this.#e.onUploadProgress&&"function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");this.#T="number"==typeof this.#e.totalTimeout?this.#P():void 0}#S(){const e=this.#e.retry.delay(this.#f+1);let t=e;return!0===this.#e.retry.jitter?t=Math.random()*e:"function"==typeof this.#e.retry.jitter&&(t=this.#e.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e)),Math.min(this.#e.retry.backoffLimit,t)}async#x(e){if(this.#f>=this.#e.retry.limit)throw e;const n=e instanceof Error?e:new r(e);if(n instanceof s)return n.customDelay??this.#S();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#e.retry.shouldRetry){const t=await this.#e.retry.shouldRetry({error:n,retryCount:this.#f+1});if(!1===t)throw e;if(!0===t)return this.#S()}if(function(e){return J(e,i)}(e)){if(!this.#e.retry.retryOnTimeout)throw e;return this.#S()}if(function(e){return J(e,t)}(e)){if(!this.#e.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.#e.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);return Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now()),Number.isFinite(e)?(e=Math.max(0,e),Math.min(this.#e.retry.maxRetryAfter,e)):Math.min(this.#e.retry.maxRetryAfter,this.#S())}if(413===e.response.status)throw e;return this.#S()}if(!function(e){return J(e,o)}(e))throw e;return this.#S()}#u(e){const t=this.#a(e);return this.#e.parseJson&&(e.json=async()=>{const o=await e.text();return""===o?JSON.parse(o):this.#e.parseJson(o,{request:t,response:e})}),e}async#c(e){const t=await this.#A(e,this.#j());if(t===z)return void this.#k();if(!t)return;if(!this.#C(e.headers.get("content-type")??""))return t;const o=await this.#O(t,e,this.#j(),this.#a(e));if(o!==z)return o;this.#k()}#j(){const e=!1===this.#e.timeout?1e4:this.#e.timeout,t=this.#L();if(void 0===t)return e;if(t<=0)throw new i(this.request);return Math.min(e,t)}#C(e){const t=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#A(e,t){const{body:o}=e;if(!o)try{return await e.text()}catch{return}let r;try{r=o.getReader()}catch{return}const s=(e=>{const t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),o=t?.[1]??t?.[2];if(o)try{return new TextDecoder(o)}catch{}return new TextDecoder})(e.headers.get("content-type")??""),n=[];let i=0;const a=(async()=>{try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(i+=t.byteLength,i>10485760)return void r.cancel().catch(()=>{});n.push(s.decode(t,{stream:!0}))}}catch{return}return n.push(s.decode()),n.join("")})(),h=new Promise(e=>{const o=setTimeout(()=>{e(z)},t);a.finally(()=>{clearTimeout(o)})}),c=await Promise.race([a,h]);return c===z&&r.cancel().catch(()=>{}),c}async#O(e,t,o,r){let s;try{return await Promise.race([Promise.resolve().then(()=>this.#e.parseJson?this.#e.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{s=setTimeout(()=>{e(z)},o)})])}catch{return}finally{clearTimeout(s)}}#y(e){e&&e.cancel().catch(()=>{})}#l(e){this.#y(e.body??void 0)}#E(){return this.#w?AbortSignal.any([this.#w,this.#g.signal]):this.#g.signal}#k(){const e=this.#L();if(void 0!==e&&e<=0)throw new i(this.request)}async#t(){for(const e of this.#e.hooks.beforeRequest){const t=await e({request:this.request,options:this.#h(),retryCount:0});if(M(t))this.#N(t);else if(W(t))return t}}async#n(e){const t=this.#a(e);for(const r of this.#e.hooks.afterResponse){const n=this.#D(e.clone(),t);let i;this.#u(n);try{i=await r({request:this.request,options:this.#h(),response:n,retryCount:this.#f})}catch(o){throw n!==e&&this.#l(n),this.#l(e),o}if(i instanceof y)throw n!==e&&this.#l(n),this.#l(e),new s(i.options);const a=W(i)?this.#D(i,t):e;n!==e&&n!==a&&n.body!==a.body&&this.#l(n),e!==a&&e.body!==a.body&&this.#l(e),e=a}return e}async#o(e){try{return await e()}catch(t){return this.#i(t,e)}}async#i(e,t){this.#q=!1;const o=Math.min(await this.#x(e),2147483647),r={signal:this.#w},n=this.#L();if(void 0!==n){if(n<=0)throw new i(this.request);if(o>=n)throw await U(n,r),new i(this.request)}if(await U(o,r),this.#k(),e instanceof s&&e.customRequest){const t=new globalThis.Request(e.customRequest,this.#e.signal?{signal:this.#e.signal}:void 0);this.#N(t)}for(const s of this.#e.hooks.beforeRetry){let t;try{t=await s({request:this.request,options:this.#h(),error:e,retryCount:this.#f+1})}catch(a){throw a instanceof Error&&a!==e&&this.#p.add(a),a}if(M(t)){this.#N(t);break}if(W(t))return this.#q=!0,this.#f++,t;if(t===d)return}return this.#k(),this.#f++,this.#o(t)}#s(){const e=this.#q;return this.#q=!1,e}async#r(){this.#g?.signal.aborted&&(this.#g=new globalThis.AbortController,this.#e.signal=this.#E(),this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));const e=(e=>{const t={};for(const o in e)Object.hasOwn(e,o)&&(o in b||o in g||(t[o]=e[o]));return t})(this.#e),t=this.#e.retry.limit>0?this.request.clone():void 0,r=this.#B(this.request,this.#e.body??void 0);this.#d=r,t&&(this.request=t);try{const t=this.#L();if(void 0!==t&&t<=0)throw new i(this.request);const o=!1===this.#e.timeout?t:void 0===t?this.#e.timeout:Math.min(this.#e.timeout,t),s=void 0===o?await this.#e.fetch(r,e):await async function(e,t,o,r){return new Promise((s,n)=>{const a=setTimeout(()=>{o&&o.abort(),n(new i(e))},r.timeout);r.fetch(e,t).then(s).catch(n).then(()=>{clearTimeout(a)})})}(r,e,this.#g,{timeout:o,fetch:this.#e.fetch});return this.#D(s,r)}catch(s){if(function(e){if(!e||(t=e,"[object Error]"!==H.call(t))||"TypeError"!==e.name||"string"!=typeof e.message)return!1;var t;const{message:o,stack:r}=e;return"Load failed"===o?void 0===r||"__sentry_captured__"in e:!!o.startsWith("error sending request for url")||!!("Failed to fetch"===o||o.startsWith("Failed to fetch (")&&o.endsWith(")"))||F.has(o)}(s))throw new o(this.request,{cause:s});throw s}}#L(){if(void 0===this.#T)return;const e=this.#P()-this.#T;return Math.max(0,this.#e.totalTimeout-e)}#P(){return globalThis.performance?.now()??Date.now()}#h(){if(!this.#R){const{hooks:e,json:t,parseJson:o,stringifyJson:r,searchParams:s,timeout:n,totalTimeout:i,throwHttpErrors:a,fetch:h,...c}=this.#e;this.#R=Object.freeze(c)}return this.#R}#N(e){this.#R=void 0,this.request=e}#a(e){return this.#v.get(e)??this.request}#D(e,t){return this.#v.set(e,t),e}#B(e,t){return this.#e.onUploadProgress&&e.body&&a?((e,t,o)=>{if(!e.body)return e;const r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[o,r]of e)t+=40,t+=w.encode(`Content-Disposition: form-data; name="${o}"`).byteLength,t+="string"==typeof r?w.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?w.encode(e).byteLength:e instanceof URLSearchParams?w.encode(e.toString()).byteLength:0})(o??e.body);return new Request(e,{duplex:"half",body:R(e.body,r,t)})})(e,this.#e.onUploadProgress,t??this.#e.body??void 0):e}},X=e=>{const t=(t,o)=>V.create(t,E(e,o));for(const o of p)t[o]=(t,r)=>V.create(t,E(e,r,{method:o}));return t.create=e=>X(E(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),X(E(e,t))),t.stop=d,t.retry=m,t},K=X();export{t as n,K as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,t as l,w as r}from"./DrrpB4Om.js";import{c as a}from"./
|
|
1
|
+
import{p as t,t as l,w as r}from"./DrrpB4Om.js";import{c as a}from"./BLeZg2Bz.js";import{t as s}from"./DdYePHxG.js";import{t as e}from"./DZGp2V2-.js";import{t as o}from"./Bki5T_lb.js";var p=({url:p,alt:h="",thumbnailUrl:i,blurhash:c,pswpData:n={},curateLink:u,onClick:m})=>{const w=t(()=>(t=>Object.keys(t).reduce((l,r)=>{const a=t[r];return null==a||""===a||(l[`data-pswp-${s=r,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=a),l;var s},{}))(n),[n]),f=/* @__PURE__ */l(r,{children:[/* @__PURE__ */l(e,{threshold:.1,src:i||p,blurhash:c,alt:h}),n.type===a.VIDEO&&/* @__PURE__ */l("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */l("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 l("button",{className:"h-full w-full",onClick:m,children:f});if(u)/* @__PURE__ */return l(s,{to:u,className:"h-full w-full",children:f});const d=p&&o(p,["http:","https:"])?p:void 0;return d?/* @__PURE__ */l("a",{href:d,className:"pswp-item block h-full w-full",...w,...i?{"data-pswp-thumbnail-url":i}:{},...c?{"data-pswp-blurhash":c}:{},target:"_blank",rel:"noreferrer",children:f}):/* @__PURE__ */l("span",{className:"pswp-item block h-full w-full",...w,...i?{"data-pswp-thumbnail-url":i}:{},...c?{"data-pswp-blurhash":c}:{},children:f})};export{p as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as r,t as e}from"./DrrpB4Om.js";import{i as t}from"./
|
|
1
|
+
import{T as r,t as e}from"./DrrpB4Om.js";import{i as t}from"./CKQOToSD.js";import{r as a}from"./DmIYOIw1.js";function i({className:r}){/* @__PURE__ */
|
|
2
2
|
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:[
|
|
3
3
|
/* @__PURE__ */e("circle",{cx:"18",cy:"12",r:"0",fill:"currentColor",children:/* @__PURE__ */e("animate",{attributeName:"r",begin:".67",calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"})}),
|
|
4
4
|
/* @__PURE__ */e("circle",{cx:"12",cy:"12",r:"0",fill:"currentColor",children:/* @__PURE__ */e("animate",{attributeName:"r",begin:".33",calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"})}),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{t as a}from"./DrrpB4Om.js";import{i as t,n as e}from"./CKQOToSD.js";import{t as i}from"./DmIYOIw1.js";var r=({title:r,description:s,iconSvg:o,className:l})=>{const{props:n,organization:c}=e(),m=n?.emptyStateImage;/* @__PURE__ */
|
|
2
|
+
return a("div",{className:t("mx-auto flex w-full max-w-md flex-col items-center justify-center gap-8",l),children:[c?.integrationSettings?.showLogo?/* @__PURE__ */a("img",{className:"h-44 w-auto",src:c?.logoUrl||"/images/qrati-logo.svg",alt:r}):m?/* @__PURE__ */a("img",{className:"h-44 w-auto",src:m,alt:r}):o?/* @__PURE__ */a("div",{className:"text-primary h-44 w-auto",children:o}):null,/* @__PURE__ */a("div",{className:"space-y-2",children:[
|
|
3
|
+
/* @__PURE__ */a(i,{variant:"h4",align:"center",children:r}),"string"==typeof s&&/* @__PURE__ */a(i,{variant:"body2",color:"muted",align:"center",children:s}),"string"!=typeof s&&s]})]})};export{r as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t}from"./DrrpB4Om.js";import{x as e}from"./
|
|
1
|
+
import{t}from"./DrrpB4Om.js";import{x as e}from"./BLeZg2Bz.js";import{l as s}from"./DdYePHxG.js";function o({className:e}){/* @__PURE__ */
|
|
2
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
3
|
return t("button",{type:"button",onClick:()=>{window.history.length>1?r(-1):r(e.PUBLIC_EVENTS,{state:{internalNavigation:!0}})},className:"text-foreground absolute top-0 left-0",children:/* @__PURE__ */t(o,{className:"size-6"})})};export{r as t};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{_ as e,f as t,h as a,p as n,t as r,v as o,w as s}from"./DrrpB4Om.js";import{
|
|
2
|
-
return r(q,{open:Boolean(e),onOpenChange:e=>{e||a()},title:"Delete content?",description:
|
|
3
|
-
return r("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__ */r("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zm-7 11q.425 0 .713-.288T11 16V9q0-.425-.288-.712T10 8t-.712.288T9 9v7q0 .425.288.713T10 17m4 0q.425 0 .713-.288T15 16V9q0-.425-.288-.712T14 8t-.712.288T13 9v7q0 .425.288.713T14 17M7 6v13z"})})}var M={[v.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */r(O,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[v.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */r(z,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[v.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */r(A,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}}
|
|
1
|
+
import{_ as e,f as t,h as a,p as n,t as r,v as o,w as s}from"./DrrpB4Om.js";import{i,n as l,u as c}from"./CKQOToSD.js";import{n as d,r as m,t as u}from"./C8meSsHD.js";import{t as p}from"./DLF5ysgi.js";import{t as h}from"./DmpmrPE5.js";import{S as g,i as f,s as v}from"./BLeZg2Bz.js";import{c as y,l as w}from"./DdYePHxG.js";import{t as x}from"./DmIYOIw1.js";import{t as N}from"./MU5QuIq0.js";import{t as b}from"./BKENYwOQ.js";import{t as T}from"./DvisvxzJ.js";import{t as D}from"./QDuBhueG.js";import{t as j}from"./DyemeRjE2.js";import{t as P}from"./DPg_DKOi2.js";import{n as C,o as I,r as E,t as S}from"./Vk429P022.js";import{t as A}from"./N4HKgEC52.js";import{i as z,n as U,r as q,t as O}from"./D_FNRN5A2.js";var _=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=c(),{user:t,props:a}=l(),n=a?.organizationId,r=t?.token;return p({mutationKey:["delete-upload",r??null],mutationFn:async({contentId:e})=>{const t=await h.post(f.DELETE_CONTENT,{json:{contentId:e},headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(t?.error)throw new Error(t.error);return{contentId:e}},onMutate:async({contentId:t})=>{await e.cancelQueries({queryKey:[g.USER_UPLOADS],exact:!1});const a=e.getQueriesData({queryKey:[g.USER_UPLOADS],exact:!1});return e.setQueriesData({queryKey:[g.USER_UPLOADS],exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.filter(e=>e._id!==t),meta:{...e.meta,totalCount:Math.max(0,(e.meta.totalCount??0)-1)}}))}:e),{previousData:a}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}(),o=e?.rateCount??0,s=o<=0,i=s?null:`This photo has ${o} rating${o>1?"s":""}. Photos with at least 1 rating cannot be deleted.`;/* @__PURE__ */
|
|
2
|
+
return r(q,{open:Boolean(e),onOpenChange:e=>{e||a()},title:"Delete content?",description:i??"Are you sure you want to delete this content? This operation is permanent and cannot be undone.",cancelText:"Cancel",confirmText:s?"Delete":"Got it",confirmColor:s?"error":"primary",onCancel:a,onConfirm:s?()=>{if(!e||!s)return;const a=e.eventId,r=e._id;t(),n.mutate({contentId:r,eventId:a})}:a})};function k({className:e}){/* @__PURE__ */
|
|
3
|
+
return r("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__ */r("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zm-7 11q.425 0 .713-.288T11 16V9q0-.425-.288-.712T10 8t-.712.288T9 9v7q0 .425.288.713T10 17m4 0q.425 0 .713-.288T15 16V9q0-.425-.288-.712T14 8t-.712.288T13 9v7q0 .425.288.713T14 17M7 6v13z"})})}var M={[v.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */r(O,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[v.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */r(z,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[v.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */r(A,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}},R=e=>{const t=new Date(e).getTime();if(Number.isNaN(t))return"";const a=Math.max(0,Math.floor((Date.now()-t)/1e3)),n=[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[Number.POSITIVE_INFINITY,"year"]];let r=a,o="second";for(const[s,i]of n){if(r<s){o=i;break}r=Math.floor(r/s),o=i}return"second"===o&&r<30?"just now":`${r} ${o}${1===r?"":"s"} ago`},$=({content:e,onDelete:t,onStatusClick:a})=>{const n=e.status,o=M[n];/* @__PURE__ */
|
|
4
4
|
return r("div",{className:"group relative size-full overflow-hidden sm:rounded",children:/* @__PURE__ */r("div",{className:"relative size-full",children:[
|
|
5
5
|
/* @__PURE__ */r(T,{url:e.url||"",alt:e.caption||"",thumbnailUrl:e.thumbnailUrl||void 0,blurhash:e.blurhash||void 0,pswpData:{id:e._id,type:e.type,hash:e._id,width:e.dimension?.width,height:e.dimension?.height,thumbnailUrl:e.thumbnailUrl||void 0,caption:e.caption||""}}),
|
|
6
|
-
/* @__PURE__ */r("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-between bg-gradient-to-t from-black/50 to-transparent pl-3",children:[/* @__PURE__ */r(
|
|
7
|
-
/* @__PURE__ */r("button",{type:"button","aria-label":`Status: ${o?.title||"Unknown"}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(n)},className:
|
|
6
|
+
/* @__PURE__ */r("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-between bg-gradient-to-t from-black/50 to-transparent pl-3",children:[/* @__PURE__ */r(x,{variant:"caption",className:"text-xs text-white opacity-90 sm:text-sm",children:R(e.createdAt)}),/* @__PURE__ */r(U,{icon:/* @__PURE__ */r(k,{className:"size-5"}),color:"error",size:"sm",className:"pointer-events-auto","aria-label":"Delete upload",tooltip:"Delete",onClick:e=>{e.stopPropagation(),e.preventDefault(),t()}})]}),
|
|
7
|
+
/* @__PURE__ */r("button",{type:"button","aria-label":`Status: ${o?.title||"Unknown"}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(n)},className:i("pointer-events-auto absolute top-1 right-1 cursor-pointer rounded-full p-1 transition-opacity hover:opacity-80",o?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */r("span",{className:i("block size-5",o?.color||"text-gray-500"),children:o?.icon||null})})]})})},L=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),V=e=>{if(0===e.length)return"";if(1===e.length)return L(e[0].createdAt);const{minTime:t,maxTime:a}=e.reduce((e,t)=>{const a=new Date(t.createdAt).getTime();return{minTime:Math.min(e.minTime,a),maxTime:Math.max(e.maxTime,a)}},{minTime:1/0,maxTime:-1/0}),n=L(new Date(t).toISOString()),r=L(new Date(a).toISOString());return n===r?n:`${n} - ${r}`},F=()=>{const c=w(),p=y(),{user:v,loadingUser:T,portalContainer:A}=l(),z=t(null),U=t(!1),q=t(null),O=t(null),[k,R]=a(null),[L,F]=a(null),{contents:K,loading:B,hasNextPage:Y,fetchNextPage:Q,isFetchingNextPage:G}=function({sort:e="-createdAt",limit:t=20}={}){const{user:a,loadingUser:r,props:o}=l(),s=o?.organizationId,i=a?.token,c=a?._id??a?.uid??null,{data:p,isLoading:v,isError:y,error:w,isFetchingNextPage:x,hasNextPage:N,fetchNextPage:b,refetch:T}=m({queryKey:[g.USER_UPLOADS,s??"",c,t,e],queryFn:async({pageParam:a=1})=>await h.get(f.MY_UPLOADS,{searchParams:{page:a,limit:t,sort:e},headers:{"x-org-id":s,...i?{Authorization:`Bearer ${i}`}:{}}}).json(),initialPageParam:1,getPreviousPageParam:d,getNextPageParam:u,staleTime:12e4,gcTime:3e5,enabled:!r&&!!a});return{contents:n(()=>p?.pages?.flatMap(e=>e?.data??[])??[],[p]),loading:v,isError:y,error:w,isFetchingNextPage:x,hasNextPage:!!N,fetchNextPage:b,refetch:T,totalCount:p?.pages?.[0]?.meta?.totalCount??0}}({sort:"-createdAt",limit:20});e(()=>{T||v||c("/auth/login",{state:{referrer:p.pathname},replace:!0})},[T,v]);const Z=K.length>0,H=!B&&!Z,J=n(()=>{if(!K.length)return[];const e={};return K.forEach(t=>{const a=t.eventId||"unknown";e[a]||(e[a]={eventId:a,eventName:t.event?.name||"Event",uploads:[]}),e[a].uploads.push(t)}),Object.values(e).sort((e,t)=>{const a=new Date(e.uploads[0]?.createdAt||0).getTime();return new Date(t.uploads[0]?.createdAt||0).getTime()-a})},[K]);e(()=>()=>{z.current?.destroy?.(),z.current=null},[A]);const W=o(async e=>{if(z.current||U.current)return;const t=q.current,a=e.target.closest("a");if(!t||!a||!t.contains(a))return;e.preventDefault(),U.current=!0;const n=Array.from(t.querySelectorAll("a")).indexOf(a);try{const[{default:e},{default:a},{default:r},{loadPhotoSwipe:o}]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./DSx5wvUb2.js"),import("./web.es.js").then(e=>e.t)]),s=new e({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:o,appendToEl:A??document.body});z.current=s,new a(s),new r(s),s.init(),n>=0&&z.current?.loadAndOpen?.(n)}finally{U.current=!1}},[A]);e(()=>{const e=O.current;if(!e||!Y)return;const t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&Y&&!G&&Q()},{rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[Y,G,Q]);const X=n(()=>K.find(e=>e._id===k)??null,[k,K]),ee=L?M[L]:null;/* @__PURE__ */
|
|
8
8
|
return r("div",{className:"bg-background mx-auto min-h-screen max-w-5xl px-3 pt-16 pb-12 lg:px-0",children:[
|
|
9
|
-
/* @__PURE__ */r("div",{className:"relative mb-6 flex items-center justify-center",children:[/* @__PURE__ */r(D,{}),/* @__PURE__ */r(
|
|
10
|
-
/* @__PURE__ */r("section",{className:"space-y-3",children:
|
|
11
|
-
/* @__PURE__ */r("div",{ref:q,onClickCapture:
|
|
12
|
-
/* @__PURE__ */r("div",{ref:O,className:"h-px w-full"}),G&&/* @__PURE__ */r("div",{className:"my-6 w-full",children:/* @__PURE__ */r(
|
|
13
|
-
/* @__PURE__ */r(_,{content:X,onClose:()
|
|
14
|
-
/* @__PURE__ */r(
|
|
9
|
+
/* @__PURE__ */r("div",{className:"relative mb-6 flex items-center justify-center",children:[/* @__PURE__ */r(D,{}),/* @__PURE__ */r(x,{variant:"h4",align:"center",children:"My Uploads"})]}),
|
|
10
|
+
/* @__PURE__ */r("section",{className:"space-y-3",children:B?/* @__PURE__ */r("div",{className:"space-y-8 py-4",children:Array.from({length:2}).map((e,t)=>/* @__PURE__ */r("div",{className:"space-y-4",children:[/* @__PURE__ */r("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */r(b,{className:"h-6 w-48"}),/* @__PURE__ */r(b,{className:"h-5 w-24"})]}),/* @__PURE__ */r("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */r(b,{className:"h-52 w-full lg:h-64"},t))})]},t))}):H?/* @__PURE__ */r(N,{className:"py-12",title:"No uploads yet",description:"Photos and videos you upload to events will appear here."}):/* @__PURE__ */r(s,{children:[
|
|
11
|
+
/* @__PURE__ */r("div",{ref:q,onClickCapture:W,className:"space-y-8 py-4",children:J.map(e=>/* @__PURE__ */r("div",{className:"space-y-4",children:[/* @__PURE__ */r("div",{className:"flex items-center justify-between",children:[/* @__PURE__ */r(x,{variant:"h5",color:"muted",children:e.eventName}),/* @__PURE__ */r("span",{className:"text-muted-foreground text-sm font-light uppercase sm:text-base",children:V(e.uploads)})]}),/* @__PURE__ */r("div",{className:"grid grid-cols-2 gap-1 sm:grid-cols-3 sm:gap-3 lg:grid-cols-4",children:e.uploads.map(e=>/* @__PURE__ */r("div",{className:"h-52 lg:h-64",children:/* @__PURE__ */r($,{content:e,onDelete:()=>R(e._id),onStatusClick:e=>F(e)})},e._id))})]},e.eventId))}),
|
|
12
|
+
/* @__PURE__ */r("div",{ref:O,className:"h-px w-full"}),G&&/* @__PURE__ */r("div",{className:"my-6 w-full",children:/* @__PURE__ */r(P,{})})]})}),
|
|
13
|
+
/* @__PURE__ */r(_,{content:X,onClose:()=>R(null),onDeleted:()=>R(null)}),
|
|
14
|
+
/* @__PURE__ */r(S,{open:Boolean(L),onOpenChange:e=>!e&&F(null),children:/* @__PURE__ */r(C,{className:"w-full max-w-lg",children:[/* @__PURE__ */r("div",{className:"flex flex-col gap-4 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */r("div",{className:i("mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",ee?.bgColor||"bg-gray-500/20"),children:/* @__PURE__ */r("span",{className:i("size-6",ee?.color||"text-gray-500"),children:ee?.icon||null})}),/* @__PURE__ */r("div",{className:"flex-1 space-y-2 text-center sm:text-left",children:[/* @__PURE__ */r(I,{children:ee?.title||"Unknown Status"}),/* @__PURE__ */r(E,{children:ee?.description||"Status information unavailable."})]})]}),/* @__PURE__ */r("div",{className:"flex justify-end p-4",children:/* @__PURE__ */r(j,{variant:"outlined",color:"foreground",onClick:()=>F(null),children:"Got it"})})]})})]})};export{F as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as e,_ as a,h as t,p as s,t as o,v as n,w as d,y as l}from"./DrrpB4Om.js";import{a as r,i as m,n as c}from"./
|
|
1
|
+
import{E as e,_ as a,h as t,p as s,t as o,v as n,w as d,y as l}from"./DrrpB4Om.js";import{a as r,i as m,n as c}from"./CKQOToSD.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
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};
|