@qratilabs/qrati-connect 2.3.3 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/element/{AuthLayout-BQsxj8DA.js → AuthLayout-Cb29YL2A.js} +1 -1
- package/element/{ContentsPage-BswZWICC.js → ContentsPage-Dy9C3p31.js} +3 -3
- package/element/{CuratePage-l_53kq1u.js → CuratePage-BUmxwjzW.js} +1 -1
- package/element/{Dialog-xRPAHU1U.js → Dialog-Dv2w7GiN.js} +1 -1
- package/element/{DotLottiePlayer-DWbmlHl0.js → DotLottiePlayer-BM_SpbNm.js} +1 -1
- package/element/{EventHeaderAdminButtons-DpqqYPmp.js → EventHeaderAdminButtons-BjztFxCi.js} +1 -1
- package/element/{FolderBreadcrumb-DgOZR2JO.js → FolderBreadcrumb-D_vuN164.js} +1 -1
- package/element/{ForgotPasswordPage-CIz3_X-3.js → ForgotPasswordPage-CLTfCRSc.js} +1 -1
- package/element/{InputField-DybXE_Ab.js → InputField-Dpa6h5y6.js} +1 -1
- package/element/{LazyLoadImage-8X8b06AJ.js → LazyLoadImage-btDC6I6Y.js} +1 -1
- package/element/{LeaderboardPage-Bphjksy_.js → LeaderboardPage-C35B-9Gu.js} +1 -1
- package/element/LoginPage-r5G2G0oG.js +1 -0
- package/element/{NCMVHL6D-CBCgRwdZ.js → NCMVHL6D-2v69SxO0.js} +1 -1
- package/element/{PublicEvents-RN-_fsl2.js → PublicEvents-CKFcMhSD.js} +1 -1
- package/element/RegisterPage-DiL8319w.js +1 -0
- package/element/{SocialLoginButton-DpBl7dWg.js → SocialLoginButton-Cm1XFx8_.js} +1 -1
- package/element/{UploadPage-B7BieTEU.js → UploadPage-9jnk9Zmk.js} +1 -1
- package/element/{VideoPlayer-Bk8Hao3q.js → VideoPlayer-D9AI4cZc.js} +1 -1
- package/element/element.es.js +1 -1
- package/element/{heic2any-DLQd-wQs.js → heic2any-DQvpqzo3.js} +1 -1
- package/element/{index-DI8B7D73.js → index-BHVViZaJ.js} +1 -1
- package/element/{index-JyoNGo8S.js → index-BKOpkw1h.js} +9 -9
- package/element/{index.esm-CAQX5kI5.js → index.esm-Hfm1g5lN.js} +1 -1
- package/element/{photoswipe-Coj-X7bR.js → photoswipe-C58kAXHU.js} +1 -1
- package/element/{tslib.es6-C9bR68b3.js → tslib.es6-khl_spk_.js} +1 -1
- package/element/{useOrgAccess-CnN4aiYB.js → useOrgAccess-D2Xgijq3.js} +1 -1
- package/element/web.es.js +1 -1
- package/package.json +12 -11
- package/react/{IbMHxVCj.js → 7c7bXPlP.js} +1 -1
- package/react/B0dDfEtH.js +1 -0
- package/react/{CZp0lmKh.js → B1r-QO-6.js} +1 -1
- package/react/{Y9TU3Znq.js → BDG18AiE.js} +1 -1
- package/react/{DBnzOELO.js → BE5TseI4.js} +3 -3
- package/react/{CXu6PHUW.js → BUZRB64M.js} +1 -1
- package/react/{Ply2G2qz.js → BUkcR85F.js} +1 -1
- package/react/{Pcjql-py.js → Bdifa0jH.js} +1 -1
- package/react/{BO8jvMXn.js → Brhsb0-T.js} +1 -1
- package/react/{B1neVlFZ.js → C5-YA8nT.js} +1 -1
- package/react/{Gbk2zO2l.js → C92qhyHF.js} +1 -1
- package/react/{D6nR1wv_.js → CJ6agILN.js} +1 -1
- package/react/{fuEo08KS.js → Ck1QkDXW.js} +1 -1
- package/react/{Dwry3hNI.js → CyVAYliQ.js} +1 -1
- package/react/{rZy1FKOQ.js → D7D-fe1-.js} +1 -1
- package/react/{CfZ5_7x-.js → DGkkW9h-.js} +1 -1
- package/react/{DyklTvwE.js → DT_P8FaG.js} +1 -1
- package/react/{jRrpvD0D.js → DW2r0IAI.js} +1 -1
- package/react/DzJMp-c4.js +1 -0
- package/react/{DrqnWQLs.js → IujfE24r.js} +1 -1
- package/react/{D_imcCpv.js → Lyg2aTtz.js} +3 -3
- package/react/{DvDETl8u.js → Z6p4C64a.js} +1 -1
- package/react/{DvOl03h5.js → gTevyE5I.js} +1 -1
- package/react/index.es.js +1 -2
- package/react/styles.css +1 -0
- package/umd/web.umd.js +106 -106
- package/element/LoginPage-CHzBIQEq.js +0 -1
- package/element/RegisterPage-7WLryyTX.js +0 -1
- package/react/BbIY3X7C.js +0 -1
- package/react/CN2vdtYT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,M as t,L as n,u as r,O as o,c as a}from"./DBnzOELO.js";import*as c from"react";import{useState as i}from"react";import*as s from"react-dom";import u from"react-dom";import{a as l,b as d,c as f}from"./D6nr9_KD.js";function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function m(t,n=[]){let r=[];const o=()=>{const e=r.map(e=>c.createContext(e));return function(n){const r=n?.[t]||e;return c.useMemo(()=>({[`__scope${t}`]:{...n,[t]:r}}),[n,r])}};return o.scopeName=t,[function(n,o){const a=c.createContext(o),i=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,u=r?.[t]?.[i]||a,l=c.useMemo(()=>s,Object.values(s));return e.jsx(u.Provider,{value:l,children:o})};return s.displayName=n+"Provider",[s,function(e,r){const s=r?.[t]?.[i]||a,u=c.useContext(s);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${n}\``)}]},v(o,...n)]}function v(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var h=globalThis?.document?c.useLayoutEffect:()=>{},g=c[" useId ".trim().toString()]||(()=>{}),y=0;function b(e){const[t,n]=c.useState(g());return h(()=>{n(e=>e??String(y++))},[e]),e||(t?`radix-${t}`:"")}var E=c[" useInsertionEffect ".trim().toString()]||h;function w({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),a=c.useRef(t);return E(()=>{a.current=t},[t]),c.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),s=void 0!==e,u=s?e:o;{const t=c.useRef(void 0!==e);c.useEffect(()=>{const e=t.current;e!==s&&console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[u,c.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&i.current?.(n)}else a(t)},[s,e,a,i])]}var N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((n,r)=>{const o=t(`Primitive.${r}`),a=c.forwardRef((t,n)=>{const{asChild:a,...c}=t,i=a?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...c,ref:n})});return a.displayName=`Primitive.${r}`,{...n,[r]:a}},{});function x(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}var C,R="dismissableLayer.update",D="dismissableLayer.pointerDownOutside",S="dismissableLayer.focusOutside",q=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M=c.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:l,...d}=t,f=c.useContext(q),[m,v]=c.useState(null),h=m?.ownerDocument??globalThis?.document,[,g]=c.useState({}),y=n(r,e=>v(e)),b=Array.from(f.layers),[E]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(E),M=m?b.indexOf(m):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,L=M>=w,_=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){T(D,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...f.branches].some(e=>e.contains(t));!L||n||(i?.(e),u?.(e),e.defaultPrevented||l?.())},h),k=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1);return c.useEffect(()=>{const e=e=>{e.target&&!r.current&&T(S,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...f.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const n=x(e);c.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{M===f.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),c.useEffect(()=>{if(m)return o&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(C=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),P(),()=>{o&&1===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=C)}},[m,h,o,f]),c.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),P())},[m,f]),c.useEffect(()=>{const e=()=>g({});return document.addEventListener(R,e),()=>document.removeEventListener(R,e)},[]),e.jsx(N.div,{...d,ref:y,style:{pointerEvents:O?L?"auto":"none":void 0,...t.style},onFocusCapture:p(t.onFocusCapture,k.onFocusCapture),onBlurCapture:p(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:p(t.onPointerDownCapture,_.onPointerDownCapture)})});M.displayName="DismissableLayer";var O=c.forwardRef((t,r)=>{const o=c.useContext(q),a=c.useRef(null),i=n(r,a);return c.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),e.jsx(N.div,{...t,ref:i})});function P(){const e=new CustomEvent(R);document.dispatchEvent(e)}function T(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}O.displayName="DismissableLayerBranch";var L="focusScope.autoFocusOnMount",_="focusScope.autoFocusOnUnmount",k={bubbles:!1,cancelable:!0},A=c.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=t,[l,d]=c.useState(null),f=x(i),p=x(s),m=c.useRef(null),v=n(r,e=>d(e)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(a){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:W(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||W(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&W(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,l,h.paused]),c.useEffect(()=>{if(l){$.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(L,k);l.addEventListener(L,f),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(W(r,{select:t}),document.activeElement!==n)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(j(l)),{select:!0}),document.activeElement===e&&W(l))}return()=>{l.removeEventListener(L,f),setTimeout(()=>{const t=new CustomEvent(_,k);l.addEventListener(_,p),l.dispatchEvent(t),t.defaultPrevented||W(e??document.body,{select:!0}),l.removeEventListener(_,p),$.remove(h)},0)}}},[l,f,p,h]);const g=c.useCallback(e=>{if(!o&&!a||h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=j(e),n=I(t,e),r=I(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&W(a,{select:!0})):(e.preventDefault(),o&&W(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return e.jsx(N.div,{tabIndex:-1,...u,ref:v,onKeyDown:g})});function j(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function I(e,t){for(const n of e)if(!F(n,{upTo:t}))return n}function F(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function W(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}A.displayName="FocusScope";var $=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=B(e,t),e.unshift(t)},remove(t){e=B(e,t),e[0]?.resume()}}}();function B(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var U=c.forwardRef((t,n)=>{const{container:r,...o}=t,[a,i]=c.useState(!1);h(()=>i(!0),[]);const s=r||a&&globalThis?.document?.body;return s?u.createPortal(e.jsx(N.div,{...o,ref:n}),s):null});U.displayName="Portal";var z=e=>{const{present:t,children:r}=e,o=function(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),i=e?"mounted":"unmounted",[s,u]=function(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const e=K(r.current);a.current="mounted"===s?e:"none"},[s]),h(()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,c=K(t);u(e?"MOUNT":"none"===c||"none"===t?.display?"UNMOUNT":n&&r!==c?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),h(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,c=a=>{const c=K(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&c&&(u("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},i=e=>{e.target===t&&(a.current=K(r.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof r?r({present:o.isPresent}):c.Children.only(r),i=n(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(a));return"function"==typeof r||o.isPresent?c.cloneElement(a,{ref:i}):null};function K(e){return e?.animationName||"none"}z.displayName="Presence";var X=0;function Y(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??H()),document.body.insertAdjacentElement("beforeend",e[1]??H()),X++,()=>{1===X&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),X--}},[])}function H(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Z="right-scroll-bar-position",V="width-before-scroll-bar";function G(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var J=typeof window<"u"?c.useLayoutEffect:c.useEffect,Q=new WeakMap;function ee(e,t){var n=function(e,t){var n=i(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(null,function(t){return e.forEach(function(e){return G(e,t)})});return J(function(){var t=Q.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||G(e,null)}),o.forEach(function(e){r.has(e)||G(e,a)})}Q.set(n,e)},[e]),n}function te(e){return e}var ne=function(e){var t=e.sideCar,n=d(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,l({},n))};ne.isSideCarExport=!0;var re=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=te);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=l({async:!0,ssr:!1},e),t}(),oe=function(){},ae=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:oe,onWheelCapture:oe,onTouchMoveCapture:oe}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,u=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,h=e.noRelative,g=e.noIsolation,y=e.inert,b=e.allowPinchZoom,E=e.as,w=void 0===E?"div":E,N=e.gapMode,x=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,R=ee([n,t]),D=l(l({},x),o);return c.createElement(c.Fragment,null,p&&c.createElement(C,{sideCar:re,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:N}),i?c.cloneElement(c.Children.only(s),l(l({},D),{ref:R})):c.createElement(w,l({},D,{className:u,ref:R}),s))});ae.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ae.classNames={fullWidth:V,zeroRight:Z};function ce(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ie=function(){var e=0,t=null;return{add:function(n){0==e&&(t=ce())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},se=function(){var e=function(){var e=ie();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}}();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ue={left:0,top:0,right:0,gap:0},le=function(e){return parseInt(e||"",10)||0},de=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return ue;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[le(n),le(r),le(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fe=se(),pe="data-scroll-locked",me=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,i=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(i,"px ").concat(r,";\n }\n body[").concat(pe,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Z," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(V," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(Z," .").concat(Z," {\n right: 0 ").concat(r,";\n }\n \n .").concat(V," .").concat(V," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(pe,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},ve=function(){var e=parseInt(document.body.getAttribute(pe)||"0",10);return isFinite(e)?e:0},he=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;c.useEffect(function(){return document.body.setAttribute(pe,(ve()+1).toString()),function(){var e=ve()-1;e<=0?document.body.removeAttribute(pe):document.body.setAttribute(pe,e.toString())}},[]);var a=c.useMemo(function(){return de(o)},[o]);return c.createElement(fe,{styles:me(a,!t,o,n?"":"!important")})},ge=!1;if(typeof window<"u")try{var ye=Object.defineProperty({},"passive",{get:function(){return ge=!0,!0}});window.addEventListener("test",ye,ye),window.removeEventListener("test",ye,ye)}catch{ge=!1}var be=!!ge&&{passive:!1},Ee=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},we=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),Ne(e,r)){var o=xe(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ne=function(e,t){return"v"===e?function(e){return Ee(e,"overflowY")}(t):function(e){return Ee(e,"overflowX")}(t)},xe=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Ce=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Re=function(e){return[e.deltaX,e.deltaY]},De=function(e){return e&&"current"in e?e.current:e},Se=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},qe=0,Me=[];function Oe(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pe=(Te=function(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(qe++)[0],a=c.useState(se)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=f([e.lockRef.current],(e.shards||[]).map(De),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=Ce(e),c=n.current,s="deltaX"in e?e.deltaX:c[0]-a[0],u="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=we(d,l);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=we(d,l)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,i=t.contains(c),s=!1,u=a>0,l=0,d=0;do{if(!c)break;var f=xe(e,c),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&Ne(e,c)&&(l+=m,d+=p);var v=c.parentNode;c=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!i&&c!==document.body||i&&(t.contains(c)||t===c));return(u&&Math.abs(l)<1||!u&&Math.abs(d)<1)&&(s=!0),s}(p,t,e,"h"===p?s:u)},[]),u=c.useCallback(function(e){var n=e;if(Me.length&&Me[Me.length-1]===a){var r="deltaY"in n?Re(n):Ce(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(o&&o.should)return void(n.cancelable&&n.preventDefault());if(!o){var c=(i.current.shards||[]).map(De).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=c.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Oe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=Ce(e),r.current=void 0},[]),p=c.useCallback(function(t){l(t.type,Re(t),t.target,s(t,e.lockRef.current))},[]),m=c.useCallback(function(t){l(t.type,Ce(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return Me.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,be),document.addEventListener("touchmove",u,be),document.addEventListener("touchstart",d,be),function(){Me=Me.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,be),document.removeEventListener("touchmove",u,be),document.removeEventListener("touchstart",d,be)}},[]);var v=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Se(o)}):null,v?c.createElement(he,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},re.useMedium(Te),ne);var Te,Le=c.forwardRef(function(e,t){return c.createElement(ae,l({},e,{ref:t,sideCar:Pe}))});Le.classNames=ae.classNames;var _e=new WeakMap,ke=new WeakMap,Ae={},je=0,Ie=function(e){return e&&(e.host||Ie(e.parentNode))},Fe=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ie(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Ae[n]||(Ae[n]=new WeakMap);var a=Ae[n],c=[],i=new Set,s=new Set(o),u=function(e){!e||i.has(e)||(i.add(e),u(e.parentNode))};o.forEach(u);var l=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(i.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(_e.get(e)||0)+1,u=(a.get(e)||0)+1;_e.set(e,s),a.set(e,u),c.push(e),1===s&&o&&ke.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return l(t),i.clear(),je++,function(){c.forEach(function(e){var t=_e.get(e)-1,o=a.get(e)-1;_e.set(e,t),a.set(e,o),t||(ke.has(e)||e.removeAttribute(r),ke.delete(e)),o||e.removeAttribute(n)}),--je||(_e=new WeakMap,_e=new WeakMap,ke=new WeakMap,Ae={})}},We=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Fe(r,o,n,"aria-hidden")):function(){return null}},$e="Dialog",[Be]=m($e),[Ue,ze]=Be($e),Ke=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,u=c.useRef(null),l=c.useRef(null),[d,f]=w({prop:o,defaultProp:a??!1,onChange:i,caller:$e});return e.jsx(Ue,{scope:n,triggerRef:u,contentRef:l,contentId:b(),titleId:b(),descriptionId:b(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(e=>!e),[f]),modal:s,children:r})};Ke.displayName=$e;var Xe="DialogTrigger",Ye=c.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,c=ze(Xe,o),i=n(r,c.triggerRef);return e.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":pt(c.open),...a,ref:i,onClick:p(t.onClick,c.onOpenToggle)})});Ye.displayName=Xe;var He="DialogPortal",[Ze,Ve]=Be(He,{forceMount:void 0}),Ge=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=ze(He,n);return e.jsx(Ze,{scope:n,forceMount:r,children:c.Children.map(o,t=>e.jsx(z,{present:r||i.open,children:e.jsx(U,{asChild:!0,container:a,children:t})}))})};Ge.displayName=He;var Je="DialogOverlay",Qe=c.forwardRef((t,n)=>{const r=Ve(Je,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(Je,t.__scopeDialog);return c.modal?e.jsx(z,{present:o||c.open,children:e.jsx(tt,{...a,ref:n})}):null});Qe.displayName=Je;var et=t("DialogOverlay.RemoveScroll"),tt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(Je,r);return e.jsx(Le,{as:et,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(N.div,{"data-state":pt(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),nt="DialogContent",rt=c.forwardRef((t,n)=>{const r=Ve(nt,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(nt,t.__scopeDialog);return e.jsx(z,{present:o||c.open,children:c.modal?e.jsx(ot,{...a,ref:n}):e.jsx(at,{...a,ref:n})})});rt.displayName=nt;var ot=c.forwardRef((t,r)=>{const o=ze(nt,t.__scopeDialog),a=c.useRef(null),i=n(r,o.contentRef,a);return c.useEffect(()=>{const e=a.current;if(e)return We(e)},[]),e.jsx(ct,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(t.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:p(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:p(t.onFocusOutside,e=>e.preventDefault())})}),at=c.forwardRef((t,n)=>{const r=ze(nt,t.__scopeDialog),o=c.useRef(!1),a=c.useRef(!1);return e.jsx(ct,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target;r.triggerRef.current?.contains(n)&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ct=c.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...u}=t,l=ze(nt,o),d=c.useRef(null),f=n(r,d);return Y(),e.jsxs(e.Fragment,{children:[e.jsx(A,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(M,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":pt(l.open),...u,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(gt,{titleId:l.titleId}),e.jsx(yt,{contentRef:d,descriptionId:l.descriptionId})]})]})}),it="DialogTitle",st=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(it,r);return e.jsx(N.h2,{id:a.titleId,...o,ref:n})});st.displayName=it;var ut="DialogDescription",lt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(ut,r);return e.jsx(N.p,{id:a.descriptionId,...o,ref:n})});lt.displayName=ut;var dt="DialogClose",ft=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(dt,r);return e.jsx(N.button,{type:"button",...o,ref:n,onClick:p(t.onClick,()=>a.onOpenChange(!1))})});function pt(e){return e?"open":"closed"}ft.displayName=dt;var mt="DialogTitleWarning",[vt,ht]=function(t,n){const r=c.createContext(n),o=t=>{const{children:n,...o}=t,a=c.useMemo(()=>o,Object.values(o));return e.jsx(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(e){const o=c.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(mt,{contentName:nt,titleName:it,docsSlug:"dialog"}),gt=({titleId:e})=>{const t=ht(mt),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yt=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ht("DialogDescriptionWarning").contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},bt=Qe,Et=rt,wt=st,Nt=lt,xt=ft;const Ct=Ke,Rt=Ge,Dt=c.forwardRef(({className:t,...n},r)=>e.jsx(bt,{ref:r,className:a("qc:data-[state=open]:animate-in qc:data-[state=closed]:animate-out qc:data-[state=closed]:fade-out-0 qc:data-[state=open]:fade-in-0 qc:fixed qc:inset-0 qc:z-2001 qc:backdrop-blur-md",t),...n})),St=c.forwardRef(({className:t,children:n,...c},i)=>{const{organization:s,props:{fontClassName:u,textClassName:l}}=r();return e.jsxs(Rt,{children:[e.jsx(Dt,{}),e.jsxs(Et,{ref:i,className:a("qc:bg-background qc:shadow-outer qc:border-border qc:max-w-screen qc:data-[state=open]:animate-in qc:data-[state=closed]:animate-out qc:data-[state=closed]:fade-out-0 qc:data-[state=open]:fade-in-0 qc:data-[state=closed]:zoom-out-95 qc:data-[state=open]:zoom-in-95 qc:data-[state=closed]:slide-out-to-left-1/2 qc:data-[state=closed]:slide-out-to-top-[48%] qc:data-[state=open]:slide-in-from-left-1/2 qc:data-[state=open]:slide-in-from-top-[48%] qc:fixed qc:left-[50%] qc:top-[50%] qc:z-2002 qc:w-auto qc:translate-x-[-50%] qc:translate-y-[-50%] qc:rounded qc:duration-300 qc:sm:rounded",u,l,t),style:o(s),...c,children:[n,e.jsx(xt,{className:"qc:ring-offset-background qc:focus:ring-ring qc:data-[state=open]:text-foreground qc:hover:opacity-100 qc:focus:outline-none qc:disabled:pointer-events-none qc:focus:ring-2 qc:focus:ring-offset-2 qc:absolute qc:right-3 qc:top-3 qc:rounded qc:opacity-70 qc:transition-opacity",children:e.jsx("span",{className:"qc:sr-only",children:"Close"})})]})]})}),qt=({className:t,...n})=>e.jsx("div",{className:a("qc:flex qc:flex-col qc:space-y-1 qc:p-3 qc:text-center qc:sm:text-left",t),...n}),Mt=c.forwardRef(({className:t,...n},r)=>e.jsx(wt,{ref:r,className:a("qc:text-foreground qc:text-center qc:text-lg qc:font-semibold",t),...n})),Ot=c.forwardRef(({className:t,...n},r)=>e.jsx(Nt,{ref:r,className:a("qc:text-muted qc:text-center qc:text-sm",t),...n}));export{Ct as D,A as F,N as P,Le as R,St as a,qt as b,Mt as c,Ot as d,m as e,x as f,z as g,U as h,We as i,p as j,Y as k,M as l,w as m,b as n,h as u};
|
|
1
|
+
import{j as e,M as t,L as n,u as r,O as o,c as a}from"./BE5TseI4.js";import*as c from"react";import{useState as i}from"react";import*as s from"react-dom";import u from"react-dom";import{a as l,b as d,c as f}from"./D6nr9_KD.js";function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function m(t,n=[]){let r=[];const o=()=>{const e=r.map(e=>c.createContext(e));return function(n){const r=n?.[t]||e;return c.useMemo(()=>({[`__scope${t}`]:{...n,[t]:r}}),[n,r])}};return o.scopeName=t,[function(n,o){const a=c.createContext(o),i=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,u=r?.[t]?.[i]||a,l=c.useMemo(()=>s,Object.values(s));return e.jsx(u.Provider,{value:l,children:o})};return s.displayName=n+"Provider",[s,function(e,r){const s=r?.[t]?.[i]||a,u=c.useContext(s);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${n}\``)}]},v(o,...n)]}function v(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var h=globalThis?.document?c.useLayoutEffect:()=>{},g=c[" useId ".trim().toString()]||(()=>{}),y=0;function b(e){const[t,n]=c.useState(g());return h(()=>{n(e=>e??String(y++))},[e]),e||(t?`radix-${t}`:"")}var E=c[" useInsertionEffect ".trim().toString()]||h;function w({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),a=c.useRef(t);return E(()=>{a.current=t},[t]),c.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),s=void 0!==e,u=s?e:o;{const t=c.useRef(void 0!==e);c.useEffect(()=>{const e=t.current;e!==s&&console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[u,c.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&i.current?.(n)}else a(t)},[s,e,a,i])]}var N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((n,r)=>{const o=t(`Primitive.${r}`),a=c.forwardRef((t,n)=>{const{asChild:a,...c}=t,i=a?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...c,ref:n})});return a.displayName=`Primitive.${r}`,{...n,[r]:a}},{});function x(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}var C,R="dismissableLayer.update",D="dismissableLayer.pointerDownOutside",S="dismissableLayer.focusOutside",q=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M=c.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:l,...d}=t,f=c.useContext(q),[m,v]=c.useState(null),h=m?.ownerDocument??globalThis?.document,[,g]=c.useState({}),y=n(r,e=>v(e)),b=Array.from(f.layers),[E]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(E),M=m?b.indexOf(m):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,L=M>=w,_=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){T(D,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...f.branches].some(e=>e.contains(t));!L||n||(i?.(e),u?.(e),e.defaultPrevented||l?.())},h),k=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1);return c.useEffect(()=>{const e=e=>{e.target&&!r.current&&T(S,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...f.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const n=x(e);c.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{M===f.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),c.useEffect(()=>{if(m)return o&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(C=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),P(),()=>{o&&1===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=C)}},[m,h,o,f]),c.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),P())},[m,f]),c.useEffect(()=>{const e=()=>g({});return document.addEventListener(R,e),()=>document.removeEventListener(R,e)},[]),e.jsx(N.div,{...d,ref:y,style:{pointerEvents:O?L?"auto":"none":void 0,...t.style},onFocusCapture:p(t.onFocusCapture,k.onFocusCapture),onBlurCapture:p(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:p(t.onPointerDownCapture,_.onPointerDownCapture)})});M.displayName="DismissableLayer";var O=c.forwardRef((t,r)=>{const o=c.useContext(q),a=c.useRef(null),i=n(r,a);return c.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),e.jsx(N.div,{...t,ref:i})});function P(){const e=new CustomEvent(R);document.dispatchEvent(e)}function T(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}O.displayName="DismissableLayerBranch";var L="focusScope.autoFocusOnMount",_="focusScope.autoFocusOnUnmount",k={bubbles:!1,cancelable:!0},A=c.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=t,[l,d]=c.useState(null),f=x(i),p=x(s),m=c.useRef(null),v=n(r,e=>d(e)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(a){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:W(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||W(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&W(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,l,h.paused]),c.useEffect(()=>{if(l){$.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(L,k);l.addEventListener(L,f),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(W(r,{select:t}),document.activeElement!==n)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(j(l)),{select:!0}),document.activeElement===e&&W(l))}return()=>{l.removeEventListener(L,f),setTimeout(()=>{const t=new CustomEvent(_,k);l.addEventListener(_,p),l.dispatchEvent(t),t.defaultPrevented||W(e??document.body,{select:!0}),l.removeEventListener(_,p),$.remove(h)},0)}}},[l,f,p,h]);const g=c.useCallback(e=>{if(!o&&!a||h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=j(e),n=I(t,e),r=I(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&W(a,{select:!0})):(e.preventDefault(),o&&W(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return e.jsx(N.div,{tabIndex:-1,...u,ref:v,onKeyDown:g})});function j(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function I(e,t){for(const n of e)if(!F(n,{upTo:t}))return n}function F(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function W(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}A.displayName="FocusScope";var $=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=B(e,t),e.unshift(t)},remove(t){e=B(e,t),e[0]?.resume()}}}();function B(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var U=c.forwardRef((t,n)=>{const{container:r,...o}=t,[a,i]=c.useState(!1);h(()=>i(!0),[]);const s=r||a&&globalThis?.document?.body;return s?u.createPortal(e.jsx(N.div,{...o,ref:n}),s):null});U.displayName="Portal";var z=e=>{const{present:t,children:r}=e,o=function(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),i=e?"mounted":"unmounted",[s,u]=function(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const e=K(r.current);a.current="mounted"===s?e:"none"},[s]),h(()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,c=K(t);u(e?"MOUNT":"none"===c||"none"===t?.display?"UNMOUNT":n&&r!==c?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),h(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,c=a=>{const c=K(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&c&&(u("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},i=e=>{e.target===t&&(a.current=K(r.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof r?r({present:o.isPresent}):c.Children.only(r),i=n(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(a));return"function"==typeof r||o.isPresent?c.cloneElement(a,{ref:i}):null};function K(e){return e?.animationName||"none"}z.displayName="Presence";var X=0;function Y(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??H()),document.body.insertAdjacentElement("beforeend",e[1]??H()),X++,()=>{1===X&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),X--}},[])}function H(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Z="right-scroll-bar-position",V="width-before-scroll-bar";function G(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var J=typeof window<"u"?c.useLayoutEffect:c.useEffect,Q=new WeakMap;function ee(e,t){var n=function(e,t){var n=i(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(null,function(t){return e.forEach(function(e){return G(e,t)})});return J(function(){var t=Q.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||G(e,null)}),o.forEach(function(e){r.has(e)||G(e,a)})}Q.set(n,e)},[e]),n}function te(e){return e}var ne=function(e){var t=e.sideCar,n=d(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,l({},n))};ne.isSideCarExport=!0;var re=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=te);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=l({async:!0,ssr:!1},e),t}(),oe=function(){},ae=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:oe,onWheelCapture:oe,onTouchMoveCapture:oe}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,u=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,h=e.noRelative,g=e.noIsolation,y=e.inert,b=e.allowPinchZoom,E=e.as,w=void 0===E?"div":E,N=e.gapMode,x=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,R=ee([n,t]),D=l(l({},x),o);return c.createElement(c.Fragment,null,p&&c.createElement(C,{sideCar:re,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:N}),i?c.cloneElement(c.Children.only(s),l(l({},D),{ref:R})):c.createElement(w,l({},D,{className:u,ref:R}),s))});ae.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ae.classNames={fullWidth:V,zeroRight:Z};function ce(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ie=function(){var e=0,t=null;return{add:function(n){0==e&&(t=ce())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},se=function(){var e=function(){var e=ie();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}}();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ue={left:0,top:0,right:0,gap:0},le=function(e){return parseInt(e||"",10)||0},de=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return ue;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[le(n),le(r),le(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fe=se(),pe="data-scroll-locked",me=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,i=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(i,"px ").concat(r,";\n }\n body[").concat(pe,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Z," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(V," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(Z," .").concat(Z," {\n right: 0 ").concat(r,";\n }\n \n .").concat(V," .").concat(V," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(pe,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},ve=function(){var e=parseInt(document.body.getAttribute(pe)||"0",10);return isFinite(e)?e:0},he=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;c.useEffect(function(){return document.body.setAttribute(pe,(ve()+1).toString()),function(){var e=ve()-1;e<=0?document.body.removeAttribute(pe):document.body.setAttribute(pe,e.toString())}},[]);var a=c.useMemo(function(){return de(o)},[o]);return c.createElement(fe,{styles:me(a,!t,o,n?"":"!important")})},ge=!1;if(typeof window<"u")try{var ye=Object.defineProperty({},"passive",{get:function(){return ge=!0,!0}});window.addEventListener("test",ye,ye),window.removeEventListener("test",ye,ye)}catch{ge=!1}var be=!!ge&&{passive:!1},Ee=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},we=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),Ne(e,r)){var o=xe(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ne=function(e,t){return"v"===e?function(e){return Ee(e,"overflowY")}(t):function(e){return Ee(e,"overflowX")}(t)},xe=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Ce=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Re=function(e){return[e.deltaX,e.deltaY]},De=function(e){return e&&"current"in e?e.current:e},Se=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},qe=0,Me=[];function Oe(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pe=(Te=function(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(qe++)[0],a=c.useState(se)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=f([e.lockRef.current],(e.shards||[]).map(De),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=Ce(e),c=n.current,s="deltaX"in e?e.deltaX:c[0]-a[0],u="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=we(d,l);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=we(d,l)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,i=t.contains(c),s=!1,u=a>0,l=0,d=0;do{if(!c)break;var f=xe(e,c),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&Ne(e,c)&&(l+=m,d+=p);var v=c.parentNode;c=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!i&&c!==document.body||i&&(t.contains(c)||t===c));return(u&&Math.abs(l)<1||!u&&Math.abs(d)<1)&&(s=!0),s}(p,t,e,"h"===p?s:u)},[]),u=c.useCallback(function(e){var n=e;if(Me.length&&Me[Me.length-1]===a){var r="deltaY"in n?Re(n):Ce(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(o&&o.should)return void(n.cancelable&&n.preventDefault());if(!o){var c=(i.current.shards||[]).map(De).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=c.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Oe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=Ce(e),r.current=void 0},[]),p=c.useCallback(function(t){l(t.type,Re(t),t.target,s(t,e.lockRef.current))},[]),m=c.useCallback(function(t){l(t.type,Ce(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return Me.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,be),document.addEventListener("touchmove",u,be),document.addEventListener("touchstart",d,be),function(){Me=Me.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,be),document.removeEventListener("touchmove",u,be),document.removeEventListener("touchstart",d,be)}},[]);var v=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Se(o)}):null,v?c.createElement(he,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},re.useMedium(Te),ne);var Te,Le=c.forwardRef(function(e,t){return c.createElement(ae,l({},e,{ref:t,sideCar:Pe}))});Le.classNames=ae.classNames;var _e=new WeakMap,ke=new WeakMap,Ae={},je=0,Ie=function(e){return e&&(e.host||Ie(e.parentNode))},Fe=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ie(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Ae[n]||(Ae[n]=new WeakMap);var a=Ae[n],c=[],i=new Set,s=new Set(o),u=function(e){!e||i.has(e)||(i.add(e),u(e.parentNode))};o.forEach(u);var l=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(i.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(_e.get(e)||0)+1,u=(a.get(e)||0)+1;_e.set(e,s),a.set(e,u),c.push(e),1===s&&o&&ke.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return l(t),i.clear(),je++,function(){c.forEach(function(e){var t=_e.get(e)-1,o=a.get(e)-1;_e.set(e,t),a.set(e,o),t||(ke.has(e)||e.removeAttribute(r),ke.delete(e)),o||e.removeAttribute(n)}),--je||(_e=new WeakMap,_e=new WeakMap,ke=new WeakMap,Ae={})}},We=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Fe(r,o,n,"aria-hidden")):function(){return null}},$e="Dialog",[Be]=m($e),[Ue,ze]=Be($e),Ke=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,u=c.useRef(null),l=c.useRef(null),[d,f]=w({prop:o,defaultProp:a??!1,onChange:i,caller:$e});return e.jsx(Ue,{scope:n,triggerRef:u,contentRef:l,contentId:b(),titleId:b(),descriptionId:b(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(e=>!e),[f]),modal:s,children:r})};Ke.displayName=$e;var Xe="DialogTrigger",Ye=c.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,c=ze(Xe,o),i=n(r,c.triggerRef);return e.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":pt(c.open),...a,ref:i,onClick:p(t.onClick,c.onOpenToggle)})});Ye.displayName=Xe;var He="DialogPortal",[Ze,Ve]=Be(He,{forceMount:void 0}),Ge=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=ze(He,n);return e.jsx(Ze,{scope:n,forceMount:r,children:c.Children.map(o,t=>e.jsx(z,{present:r||i.open,children:e.jsx(U,{asChild:!0,container:a,children:t})}))})};Ge.displayName=He;var Je="DialogOverlay",Qe=c.forwardRef((t,n)=>{const r=Ve(Je,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(Je,t.__scopeDialog);return c.modal?e.jsx(z,{present:o||c.open,children:e.jsx(tt,{...a,ref:n})}):null});Qe.displayName=Je;var et=t("DialogOverlay.RemoveScroll"),tt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(Je,r);return e.jsx(Le,{as:et,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(N.div,{"data-state":pt(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),nt="DialogContent",rt=c.forwardRef((t,n)=>{const r=Ve(nt,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(nt,t.__scopeDialog);return e.jsx(z,{present:o||c.open,children:c.modal?e.jsx(ot,{...a,ref:n}):e.jsx(at,{...a,ref:n})})});rt.displayName=nt;var ot=c.forwardRef((t,r)=>{const o=ze(nt,t.__scopeDialog),a=c.useRef(null),i=n(r,o.contentRef,a);return c.useEffect(()=>{const e=a.current;if(e)return We(e)},[]),e.jsx(ct,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(t.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:p(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:p(t.onFocusOutside,e=>e.preventDefault())})}),at=c.forwardRef((t,n)=>{const r=ze(nt,t.__scopeDialog),o=c.useRef(!1),a=c.useRef(!1);return e.jsx(ct,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target;r.triggerRef.current?.contains(n)&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ct=c.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...u}=t,l=ze(nt,o),d=c.useRef(null),f=n(r,d);return Y(),e.jsxs(e.Fragment,{children:[e.jsx(A,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(M,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":pt(l.open),...u,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(gt,{titleId:l.titleId}),e.jsx(yt,{contentRef:d,descriptionId:l.descriptionId})]})]})}),it="DialogTitle",st=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(it,r);return e.jsx(N.h2,{id:a.titleId,...o,ref:n})});st.displayName=it;var ut="DialogDescription",lt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(ut,r);return e.jsx(N.p,{id:a.descriptionId,...o,ref:n})});lt.displayName=ut;var dt="DialogClose",ft=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(dt,r);return e.jsx(N.button,{type:"button",...o,ref:n,onClick:p(t.onClick,()=>a.onOpenChange(!1))})});function pt(e){return e?"open":"closed"}ft.displayName=dt;var mt="DialogTitleWarning",[vt,ht]=function(t,n){const r=c.createContext(n),o=t=>{const{children:n,...o}=t,a=c.useMemo(()=>o,Object.values(o));return e.jsx(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(e){const o=c.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(mt,{contentName:nt,titleName:it,docsSlug:"dialog"}),gt=({titleId:e})=>{const t=ht(mt),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yt=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ht("DialogDescriptionWarning").contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},bt=Qe,Et=rt,wt=st,Nt=lt,xt=ft;const Ct=Ke,Rt=Ge,Dt=c.forwardRef(({className:t,...n},r)=>e.jsx(bt,{ref:r,className:a("qc:data-[state=open]:animate-in qc:data-[state=closed]:animate-out qc:data-[state=closed]:fade-out-0 qc:data-[state=open]:fade-in-0 qc:fixed qc:inset-0 qc:z-2001 qc:backdrop-blur-md",t),...n})),St=c.forwardRef(({className:t,children:n,...c},i)=>{const{organization:s,props:{fontClassName:u,textClassName:l}}=r();return e.jsxs(Rt,{children:[e.jsx(Dt,{}),e.jsxs(Et,{ref:i,className:a("qc:bg-background qc:shadow-outer qc:border-border qc:max-w-screen qc:data-[state=open]:animate-in qc:data-[state=closed]:animate-out qc:data-[state=closed]:fade-out-0 qc:data-[state=open]:fade-in-0 qc:data-[state=closed]:zoom-out-95 qc:data-[state=open]:zoom-in-95 qc:data-[state=closed]:slide-out-to-left-1/2 qc:data-[state=closed]:slide-out-to-top-[48%] qc:data-[state=open]:slide-in-from-left-1/2 qc:data-[state=open]:slide-in-from-top-[48%] qc:fixed qc:left-[50%] qc:top-[50%] qc:z-2002 qc:w-auto qc:translate-x-[-50%] qc:translate-y-[-50%] qc:rounded qc:duration-300 qc:sm:rounded",u,l,t),style:o(s),...c,children:[n,e.jsx(xt,{className:"qc:ring-offset-background qc:focus:ring-ring qc:data-[state=open]:text-foreground qc:hover:opacity-100 qc:focus:outline-none qc:disabled:pointer-events-none qc:focus:ring-2 qc:focus:ring-offset-2 qc:absolute qc:right-3 qc:top-3 qc:rounded qc:opacity-70 qc:transition-opacity",children:e.jsx("span",{className:"qc:sr-only",children:"Close"})})]})]})}),qt=({className:t,...n})=>e.jsx("div",{className:a("qc:flex qc:flex-col qc:space-y-1 qc:p-3 qc:text-center qc:sm:text-left",t),...n}),Mt=c.forwardRef(({className:t,...n},r)=>e.jsx(wt,{ref:r,className:a("qc:text-foreground qc:text-center qc:text-lg qc:font-semibold",t),...n})),Ot=c.forwardRef(({className:t,...n},r)=>e.jsx(Nt,{ref:r,className:a("qc:text-muted qc:text-center qc:text-sm",t),...n}));export{Ct as D,A as F,N as P,Le as R,St as a,qt as b,Mt as c,Ot as d,m as e,x as f,z as g,U as h,We as i,p as j,Y as k,M as l,w as m,b as n,h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./D_imcCpv.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.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:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{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:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.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 s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{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 y(this),this.zoomLevels=new x(this),this.tapHandler=new f(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,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).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,t(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?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(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())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{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||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{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,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+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=r("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,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!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 s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-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 s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{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:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.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=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,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(z)),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(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):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,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!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(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{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:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{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,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e: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 s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("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 I(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,0)||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 s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}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,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}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,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+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!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!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),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={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:D},M={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)=>{D(t,i,!0)}},F={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"},B={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"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={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 s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;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 s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{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=[F,E,M,B,k,R],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 H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+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),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}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)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={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)"};class $ extends _{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 Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(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 Z(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)),s(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,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,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(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(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=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("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 N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(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)),s.applyFilters("thumbBounds",n,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),{...j,...t}}}export{$ as default};
|
|
1
|
+
import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./Lyg2aTtz.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.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:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{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:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.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 s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{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 y(this),this.zoomLevels=new x(this),this.tapHandler=new f(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,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).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,t(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?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(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())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{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||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{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,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+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=r("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,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!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 s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-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 s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{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:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.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=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,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(z)),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(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):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,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!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(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{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:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{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,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e: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 s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("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 I(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,0)||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 s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}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,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}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,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+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!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!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),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={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:D},M={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)=>{D(t,i,!0)}},F={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"},B={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"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={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 s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;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 s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{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=[F,E,M,B,k,R],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 H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+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),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}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)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={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)"};class $ extends _{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 Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(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 Z(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)),s(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,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,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(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(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=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("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 N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(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)),s.applyFilters("thumbBounds",n,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),{...j,...t}}}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,c as r,T as t,_ as a,d as c,b as s,u as n,H as i,k as o,i as l,$ as d,S as m,h as q,N as h,P as u,E as g,w as p,J as x,g as f,a0 as v,I as j}from"./DBnzOELO.js";import{useState as b,useEffect as y,lazy as N,Fragment as w}from"react";import{D as k,a as E,b as I,c as _,d as C}from"./fuEo08KS.js";import{L as $}from"./Y9TU3Znq.js";import{V as S}from"./CfZ5_7x-.js";const T=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,A=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},O=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},z=({position:r,maxPosition:t=4,content:a,isOverlapping:c,colorclsx:s,borderColorclsx:n})=>{const i=r/t*100;let o="qc:transform qc:-translate-x-1/2 qc:left-1/2";r<2?o="qc:left-0":r>3&&(o="qc:right-0 qc:transform qc:-translate-x-full");const l=c?"qc:-top-1.5":"qc:bottom-full";return e.jsxs("div",{className:"qc:relative",children:[e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${s}`,children:a}),e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`})]})},R=t=>{const{crowdScore:a,userScore:c}=t,[s,n]=b(0);y(()=>{setTimeout(()=>{n(c-1)},300)},[c]);const i=a-1,o=c-1,l=Math.abs(i-o)<1;return e.jsxs("div",{className:r("qc:relative qc:h-4",l?"qc:mb-3":"qc:mb-0"),children:[e.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),e.jsx("div",{style:{left:(i<s?i:s)/4*100+"%",right:`calc(100% - ${(i<s?s:i)/4*100}%)`},className:r("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",A(i,o))}),e.jsx(z,{position:i,content:`crowd · ${T(a,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),e.jsx(z,{position:s,content:`you · ${T(c,1)}`,isOverlapping:l,colorclsx:A(i,o),borderColorclsx:O(i,o)})]})},P=N(()=>import("./DYrfBufu.js").then(e=>e.i)),F=N(()=>import("./CXu6PHUW.js")),M=({feedback:r})=>{const a="#374151",[c,s]=b(10);return y(()=>{const e=(r?.parameters||[]).reduce((e,r)=>e+Math.abs(parseFloat(r.crowdRating)-parseFloat(r.userRating)),0);s(e.toFixed?e.toFixed(2):0)},[r]),r?e.jsxs("div",{className:"qc:w-full",children:[r.rateCount<=0&&e.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[e.jsx(F,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),e.jsx(t,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),r.rateCount>0&&e.jsxs("div",{className:"qc:mt-4",children:[(r.parameters||[]).map(r=>e.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[e.jsx(t,{variant:"h5",children:r.name}),e.jsx(R,{crowdScore:parseFloat(r.crowdRating),userScore:parseFloat(r.userRating)})]},r.name)),e.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[e.jsx(P,{nrOfLevels:10,percent:(10-c)/10,colors:["#ef4444","#22c55e"],textColor:a,needleColor:a,needleBaseColor:a}),e.jsx(t,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},U=N(()=>import("./CXu6PHUW.js")),B=({parameter:c,selected:s,onChange:n,showValues:i=!0})=>e.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[e.jsx(t,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:c.name}),e.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(c.tooltips||[]).map(t=>{const o=`${c._id}-option-${t.value}`;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:r("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",s===t.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{s!==t.value&&n?.(t.value)},children:[c.mode===a.TEXT&&e.jsx("div",{className:r("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",s===t.value?"qc:text-primary-foreground":"qc:text-foreground"),children:t.label}),c.mode===a.IMAGE&&e.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:t.imageUrl,alt:t.value}),c.mode===a.LOTTIE&&e.jsx(U,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:t.imageUrl,autoplay:!0,loop:!0})]}),i&&e.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:e.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:t.value})})]},o)})})]});var L,D,G=function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,c,s=t.call(e),n=[];try{for(;(void 0===r||r-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(e){c={error:e}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(c)throw c.error}}return n};function V(e,r,t,a,c,s,n,i,o,l,d){var m,q,h,u;if(0!==n)if(n!==t-r+(s-c)){for(var g=t-r,p=s-c,x=Math.floor(p/2),f={},v=-n-1;v<=n+1;++v)f[v]={d:1/0,segments:0,direct:L.none};for(var j=((m={})[-n-1]={d:1/0,segments:0,direct:L.none},m[n+1]={d:1/0,segments:0,direct:L.none},m),b=0;b<=x;++b){q=G([j,f],2),f=q[0],j=q[1];var y=function(t){var s=b+t;if(0===b&&0===s)return f[t]={d:0,segments:0,direct:i},"continue";var n=[{direct:L.horizontal,d:f[t-1].d+1,segments:f[t-1].segments+(f[t-1].direct&L.horizontal?0:1)},{direct:L.vertical,d:j[t+1].d+1,segments:j[t+1].segments+(j[t+1].direct&L.vertical?0:1)}];s>0&&s<=g&&b>0&&b<=p&&l(e[r+s-1],a[c+b-1])&&n.push({direct:L.diagonal,d:j[t].d,segments:j[t].segments+(j[t].direct&L.diagonal?0:1)});var o=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){o.d===e.d&&o.segments===e.segments&&(o.direct|=e.direct)}),f[t]=o};for(v=-n;v<=n;++v)y(v)}var N={};for(v=-n-1;v<=n+1;++v)N[v]={d:1/0,segments:0,direct:L.none};var w=((h={})[-n-1]={d:1/0,segments:0,direct:L.none},h[n+1]={d:1/0,segments:0,direct:L.none},h);for(b=p;b>=x;--b){u=G([w,N],2),N=u[0],w=u[1];var k=function(t){var s=b+t;if(b===p&&s===g)return N[t]={d:0,segments:0,direct:o},"continue";var n=[{direct:L.horizontal,d:N[t+1].d+1,segments:N[t+1].segments+(N[t+1].direct&L.horizontal?0:1)},{direct:L.vertical,d:w[t-1].d+1,segments:w[t-1].segments+(w[t-1].direct&L.vertical?0:1)}];s>=0&&s<g&&b>=0&&b<p&&l(e[r+s],a[c+b])&&n.push({direct:L.diagonal,d:w[t].d,segments:w[t].segments+(w[t].direct&L.diagonal?0:1)});var i=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){i.d===e.d&&i.segments===e.segments&&(i.direct|=e.direct)}),N[t]=i};for(v=n;v>=-n;--v)k(v)}var E={k:-1,d:1/0,segments:0,direct:L.none};for(v=-n;v<=n;++v){var I=f[v].d+N[v].d;if(I<E.d)E.k=v,E.d=I,E.segments=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1),E.direct=N[v].direct;else if(I===E.d){var _=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1);(_<E.segments||_===E.segments&&!(E.direct&L.diagonal)&&N[v].direct&L.diagonal)&&(E.k=v,E.d=I,E.segments=_,E.direct=N[v].direct)}}x+E.k===0&&0===x&&(x++,f[E.k].direct=N[E.k].direct,N[E.k].direct=w[E.k].direct),V(e,r,r+x+E.k,a,c,c+x,f[E.k].d,i,N[E.k].direct,l,d),V(e,r+x+E.k,t,a,c+x,s,N[E.k].d,f[E.k].direct,o,l,d)}else(i&L.horizontal?1:0)+(o&L.vertical?1:0)>=(i&L.vertical?1:0)+(o&L.horizontal?1:0)?(r!==t&&d("remove",e,r,t,a,c,c),c!==s&&d("add",e,t,t,a,c,s)):(c!==s&&d("add",e,r,r,a,c,s),r!==t&&d("remove",e,r,t,a,s,s));else d("same",e,r,t,a,c,s)}function W(e,r,t,a){var c=function(e,r,t){for(var a=e.length,c=r.length,s=a+c,n={1:0},i=0;i<=s;++i)for(var o=-i;o<=i;o+=2){for(var l=void 0,d=(l=o===-i||o!==i&&n[o-1]+1<n[o+1]?n[o+1]:n[o-1]+1)-o;l<a&&d<c&&t(e[l],r[d]);)l++,d++;if(l===a&&d===c)return i;n[o]=l}return-1}(e,r,t);V(e,0,e.length,r,0,r.length,c,L.diagonal,L.all,t,a)}(D=L||(L={}))[D.none=0]="none",D[D.horizontal=1]="horizontal",D[D.vertical=2]="vertical",D[D.diagonal=4]="diagonal",D[D.all=7]="all";const Y=()=>{const r=c(),{eventSlug:a,contentId:j}=s(),{props:{organizationId:N,loginUrl:T},user:A,loadingUser:O,organization:z}=n(),[R,P]=b(!1),[F,U]=b(null),[L,D]=b([]),[G,V]=b(null),[Y,J]=b("contain"),[X,K]=b({}),[Q,Z]=b(null),[ee,re]=b(!1),[te,ae]=b(!0),[ce,se]=b(null),{loading:ne,event:ie,parameters:oe}=i({eventSlug:a});y(()=>{ie&&A&&de(ie._id)},[ie,A]);const le=z?.navigationSettings?.showAIDescription,de=async e=>{P(!0);try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e,page:1,limit:10,includeDescription:le}}).json();if(r.error)throw new Error(r.error);const t=j?r.data.filter(e=>e._id!==j):r.data;let a,c=t;if(j){const e=await o.get(l.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{contentId:j,includeDescription:le}}).json();if(e.error)throw new Error(e.error);const r=e.data;c=r?[r,...t]:t||[],a=r&&r.userId===A?._id?"Sorry, you cannot rate your own content":r&&r.ratingStatus===d.CURATED?"Sorry, you have already rated this photo.":null}const s=await o.get(l.GET_EVENT_POINTS,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e}}).json();if(s.error)throw new Error(s.error);V(s.data),D(c),U(a)}catch(e){console.error("Failed to fetch contents",e)}P(!1)},me=async e=>{try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:ie?._id,page:1,limit:10,includeDescription:le}});if(r.error)throw new Error(r.error);if(r?.data?.length>0){const t=function(e,r,t){void 0===t&&(t=function(e,r){return e===r});var a={removed:[],added:[]};return W(e,r,t,function(e,r,t,c,s,n,i){if("add"===e)for(var o=n;o<i;++o)a.added.push(s[o]);else if("remove"===e)for(o=t;o<c;++o)a.removed.push(r[o])}),a}(e,r.data,(e,r)=>e._id===r._id),a=[...e,...t.added];D(a)}}catch(e){console.error(e)}},qe=()=>{const e=L.slice(1);U(null),Z(null),K({}),e.length===v?me(e):D(e),ae(!0)};if(O)return e.jsx(m,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!A){if(!z.customAuth)return e.jsx(h,{to:u.LOGIN,state:{referrer:r.pathname}});if(!T)return e.jsx(q,{title:"Please login to upload content"});window.history.pushState({},"",T)}return e.jsx("div",{className:"qc:min-h-[80vh]",children:R||ne?e.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsx(m,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),e.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((r,t)=>e.jsxs("div",{className:"qc:space-y-4",children:[e.jsx(m,{className:"qc:h-8 qc:w-36"}),e.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((r,t)=>e.jsx(m,{className:"qc:h-24 qc:w-full qc:sm:h-32"},t))})]},t))})]}):e.jsxs("div",{className:"qc:lg:mt-8",children:[ie?.status===g.CLOSED&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),ie?.status===g.OPEN&&L.length<=0&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),ie?.status===g.OPEN&&L.length>0&&e.jsxs("div",{children:[!(oe?.length<=0&&le)&&e.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[e.jsxs(t,{variant:"h4",children:["Rate this ",L[0].type===p.IMAGE?"image":"video"]}),e.jsxs(t,{variant:"h4",children:[ie?.pointName,":"," ",e.jsx("span",{className:"qc:text-primary",children:G.upload+G.curate})]})]}),e.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[L[0].type===p.IMAGE&&e.jsx(w,{children:e.jsx($,{sizeMode:Y,src:L[0].url,alt:L[0].caption,blurhash:L[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),L[0].type===p.VIDEO&&e.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:e.jsx(S,{fit:Y,src:L[0].url,loop:!0,playing:te,volume:0,muted:!0,onPlay:()=>ae(!0),onPause:()=>ae(!1),onEnd:()=>ae(!1)})}),L[0].caption&&L[0].caption.length>0&&e.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:e.jsx(t,{variant:"body3",lines:"2",children:L[0].caption})}),L.length>1&&e.jsx("img",{style:{display:"none"},src:L[1].url,alt:"Next image"})]}),e.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!F&&oe&&oe.map(r=>e.jsx(B,{parameter:r,selected:X[r._id],onChange:e=>K({...X,[r._id]:e})},r._id)),ce&&oe?.length>0&&e.jsx(t,{variant:"h5",color:"error",children:ce}),F&&oe?.length>0&&e.jsx("div",{className:"qc:sm:pt-16",children:e.jsx(t,{variant:"h5",color:"error",align:"center",children:F})}),oe?.length>0&&e.jsx(x,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:ee,loading:ee,icon:"material-symbols:check-rounded",onClick:F?qe:async()=>{if(oe.length<1)return void se("no parameters found");if(Object.keys(X).length<oe.length)return void se("please select your ratings");se(null),re(!0);const e=await o.post(l.CURATE_CONTENT,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},json:{eventId:ie._id,contentId:L[0]._id,parameterCount:oe.length,userRatings:oe.map(e=>({parameterId:e._id,weight:e.weight,rate:X[e._id]})),inappropriate:""}}).json();if(e.error)se(e.error);else{const r=e.data,t=r.crowdRatings||{},a={parameters:oe.map(e=>({name:e.name,crowdRating:t[e._id],userRating:r.ratings?.find(r=>r.parameterId===e._id)?.rate})),similarity:r.similarity||null,points:r.points||0,rateCount:r.rateCount||0};Z(a);const c={...G};c.curate+=ie.activityScores.curate,V(c)}re(!1)},children:F?"Rate Next Image":ee?"Rating...":"Submit"}),L?.length>0&&le&&e.jsx(H,{summary:L[0].contentSummary,url:L[0].url})]})]}),e.jsx("div",{className:"qc:mt-16",children:e.jsx(f,{to:u.GALLERY(a),state:{internalNavigation:!0},children:e.jsx(t,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),e.jsx(k,{open:!!Q,onOpenChange:e=>!e&&qe(),children:e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsxs(_,{className:"qc:hidden",children:[ie?.pointName,": ",G?.upload+G?.curate]}),e.jsx(C,{className:"qc:hidden",children:"We are here to help you"})]}),e.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[e.jsx(M,{feedback:Q}),e.jsx(x,{fullWidth:!0,color:"primary",onClick:qe,children:"Next"})]})]})})]})})},H=({summary:r,url:a})=>e.jsxs("div",{className:"qc:w-full",children:[r?.subject&&e.jsx(t,{variant:"h3",className:"qc:mb-4",align:"center",children:r?.subject}),r?.labels&&e.jsx("div",{className:"qc:space-y-2",children:Object.entries(r?.labels).filter(([e,r])=>Array.isArray(r)&&r.length>0).map(([r,a])=>e.jsxs("div",{className:"",children:[e.jsx(t,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:r.replace("_"," ")}),e.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((r,a)=>e.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[e.jsx(j,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),e.jsx(t,{variant:"body1",children:r}),e.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:e.jsx(x,{variant:"outlined",icon:"flat-color-icons:google",children:e.jsx(j,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},a))})]},r))}),r?.description&&e.jsxs(w,{children:[e.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),e.jsx(t,{variant:"body2",children:r?.description})]}),e.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:e.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${a}&idpbck=1&selectedindex=0&id=${a}&mediaurl=${a}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:e.jsx(x,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),r&&e.jsx(t,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]});export{Y as default};
|
|
1
|
+
import{j as e,c as r,T as t,_ as a,d as c,b as s,u as n,H as i,k as o,i as l,$ as d,S as m,h as q,N as h,P as u,E as g,w as p,J as x,g as f,a0 as v,I as j}from"./BE5TseI4.js";import{useState as b,useEffect as y,lazy as N,Fragment as w}from"react";import{D as k,a as E,b as I,c as _,d as C}from"./Ck1QkDXW.js";import{L as $}from"./BDG18AiE.js";import{V as S}from"./DGkkW9h-.js";const T=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,A=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},O=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},z=({position:r,maxPosition:t=4,content:a,isOverlapping:c,colorclsx:s,borderColorclsx:n})=>{const i=r/t*100;let o="qc:transform qc:-translate-x-1/2 qc:left-1/2";r<2?o="qc:left-0":r>3&&(o="qc:right-0 qc:transform qc:-translate-x-full");const l=c?"qc:-top-1.5":"qc:bottom-full";return e.jsxs("div",{className:"qc:relative",children:[e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${s}`,children:a}),e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`})]})},R=t=>{const{crowdScore:a,userScore:c}=t,[s,n]=b(0);y(()=>{setTimeout(()=>{n(c-1)},300)},[c]);const i=a-1,o=c-1,l=Math.abs(i-o)<1;return e.jsxs("div",{className:r("qc:relative qc:h-4",l?"qc:mb-3":"qc:mb-0"),children:[e.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),e.jsx("div",{style:{left:(i<s?i:s)/4*100+"%",right:`calc(100% - ${(i<s?s:i)/4*100}%)`},className:r("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",A(i,o))}),e.jsx(z,{position:i,content:`crowd · ${T(a,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),e.jsx(z,{position:s,content:`you · ${T(c,1)}`,isOverlapping:l,colorclsx:A(i,o),borderColorclsx:O(i,o)})]})},P=N(()=>import("./DYrfBufu.js").then(e=>e.i)),F=N(()=>import("./BUZRB64M.js")),M=({feedback:r})=>{const a="#374151",[c,s]=b(10);return y(()=>{const e=(r?.parameters||[]).reduce((e,r)=>e+Math.abs(parseFloat(r.crowdRating)-parseFloat(r.userRating)),0);s(e.toFixed?e.toFixed(2):0)},[r]),r?e.jsxs("div",{className:"qc:w-full",children:[r.rateCount<=0&&e.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[e.jsx(F,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),e.jsx(t,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),r.rateCount>0&&e.jsxs("div",{className:"qc:mt-4",children:[(r.parameters||[]).map(r=>e.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[e.jsx(t,{variant:"h5",children:r.name}),e.jsx(R,{crowdScore:parseFloat(r.crowdRating),userScore:parseFloat(r.userRating)})]},r.name)),e.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[e.jsx(P,{nrOfLevels:10,percent:(10-c)/10,colors:["#ef4444","#22c55e"],textColor:a,needleColor:a,needleBaseColor:a}),e.jsx(t,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},U=N(()=>import("./BUZRB64M.js")),B=({parameter:c,selected:s,onChange:n,showValues:i=!0})=>e.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[e.jsx(t,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:c.name}),e.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(c.tooltips||[]).map(t=>{const o=`${c._id}-option-${t.value}`;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:r("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",s===t.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{s!==t.value&&n?.(t.value)},children:[c.mode===a.TEXT&&e.jsx("div",{className:r("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",s===t.value?"qc:text-primary-foreground":"qc:text-foreground"),children:t.label}),c.mode===a.IMAGE&&e.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:t.imageUrl,alt:t.value}),c.mode===a.LOTTIE&&e.jsx(U,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:t.imageUrl,autoplay:!0,loop:!0})]}),i&&e.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:e.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:t.value})})]},o)})})]});var L,D,G=function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,c,s=t.call(e),n=[];try{for(;(void 0===r||r-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(e){c={error:e}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(c)throw c.error}}return n};function V(e,r,t,a,c,s,n,i,o,l,d){var m,q,h,u;if(0!==n)if(n!==t-r+(s-c)){for(var g=t-r,p=s-c,x=Math.floor(p/2),f={},v=-n-1;v<=n+1;++v)f[v]={d:1/0,segments:0,direct:L.none};for(var j=((m={})[-n-1]={d:1/0,segments:0,direct:L.none},m[n+1]={d:1/0,segments:0,direct:L.none},m),b=0;b<=x;++b){q=G([j,f],2),f=q[0],j=q[1];var y=function(t){var s=b+t;if(0===b&&0===s)return f[t]={d:0,segments:0,direct:i},"continue";var n=[{direct:L.horizontal,d:f[t-1].d+1,segments:f[t-1].segments+(f[t-1].direct&L.horizontal?0:1)},{direct:L.vertical,d:j[t+1].d+1,segments:j[t+1].segments+(j[t+1].direct&L.vertical?0:1)}];s>0&&s<=g&&b>0&&b<=p&&l(e[r+s-1],a[c+b-1])&&n.push({direct:L.diagonal,d:j[t].d,segments:j[t].segments+(j[t].direct&L.diagonal?0:1)});var o=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){o.d===e.d&&o.segments===e.segments&&(o.direct|=e.direct)}),f[t]=o};for(v=-n;v<=n;++v)y(v)}var N={};for(v=-n-1;v<=n+1;++v)N[v]={d:1/0,segments:0,direct:L.none};var w=((h={})[-n-1]={d:1/0,segments:0,direct:L.none},h[n+1]={d:1/0,segments:0,direct:L.none},h);for(b=p;b>=x;--b){u=G([w,N],2),N=u[0],w=u[1];var k=function(t){var s=b+t;if(b===p&&s===g)return N[t]={d:0,segments:0,direct:o},"continue";var n=[{direct:L.horizontal,d:N[t+1].d+1,segments:N[t+1].segments+(N[t+1].direct&L.horizontal?0:1)},{direct:L.vertical,d:w[t-1].d+1,segments:w[t-1].segments+(w[t-1].direct&L.vertical?0:1)}];s>=0&&s<g&&b>=0&&b<p&&l(e[r+s],a[c+b])&&n.push({direct:L.diagonal,d:w[t].d,segments:w[t].segments+(w[t].direct&L.diagonal?0:1)});var i=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){i.d===e.d&&i.segments===e.segments&&(i.direct|=e.direct)}),N[t]=i};for(v=n;v>=-n;--v)k(v)}var E={k:-1,d:1/0,segments:0,direct:L.none};for(v=-n;v<=n;++v){var I=f[v].d+N[v].d;if(I<E.d)E.k=v,E.d=I,E.segments=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1),E.direct=N[v].direct;else if(I===E.d){var _=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1);(_<E.segments||_===E.segments&&!(E.direct&L.diagonal)&&N[v].direct&L.diagonal)&&(E.k=v,E.d=I,E.segments=_,E.direct=N[v].direct)}}x+E.k===0&&0===x&&(x++,f[E.k].direct=N[E.k].direct,N[E.k].direct=w[E.k].direct),V(e,r,r+x+E.k,a,c,c+x,f[E.k].d,i,N[E.k].direct,l,d),V(e,r+x+E.k,t,a,c+x,s,N[E.k].d,f[E.k].direct,o,l,d)}else(i&L.horizontal?1:0)+(o&L.vertical?1:0)>=(i&L.vertical?1:0)+(o&L.horizontal?1:0)?(r!==t&&d("remove",e,r,t,a,c,c),c!==s&&d("add",e,t,t,a,c,s)):(c!==s&&d("add",e,r,r,a,c,s),r!==t&&d("remove",e,r,t,a,s,s));else d("same",e,r,t,a,c,s)}function W(e,r,t,a){var c=function(e,r,t){for(var a=e.length,c=r.length,s=a+c,n={1:0},i=0;i<=s;++i)for(var o=-i;o<=i;o+=2){for(var l=void 0,d=(l=o===-i||o!==i&&n[o-1]+1<n[o+1]?n[o+1]:n[o-1]+1)-o;l<a&&d<c&&t(e[l],r[d]);)l++,d++;if(l===a&&d===c)return i;n[o]=l}return-1}(e,r,t);V(e,0,e.length,r,0,r.length,c,L.diagonal,L.all,t,a)}(D=L||(L={}))[D.none=0]="none",D[D.horizontal=1]="horizontal",D[D.vertical=2]="vertical",D[D.diagonal=4]="diagonal",D[D.all=7]="all";const Y=()=>{const r=c(),{eventSlug:a,contentId:j}=s(),{props:{organizationId:N,loginUrl:T},user:A,loadingUser:O,organization:z}=n(),[R,P]=b(!1),[F,U]=b(null),[L,D]=b([]),[G,V]=b(null),[Y,J]=b("contain"),[X,K]=b({}),[Q,Z]=b(null),[ee,re]=b(!1),[te,ae]=b(!0),[ce,se]=b(null),{loading:ne,event:ie,parameters:oe}=i({eventSlug:a});y(()=>{ie&&A&&de(ie._id)},[ie,A]);const le=z?.navigationSettings?.showAIDescription,de=async e=>{P(!0);try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e,page:1,limit:10,includeDescription:le}}).json();if(r.error)throw new Error(r.error);const t=j?r.data.filter(e=>e._id!==j):r.data;let a,c=t;if(j){const e=await o.get(l.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{contentId:j,includeDescription:le}}).json();if(e.error)throw new Error(e.error);const r=e.data;c=r?[r,...t]:t||[],a=r&&r.userId===A?._id?"Sorry, you cannot rate your own content":r&&r.ratingStatus===d.CURATED?"Sorry, you have already rated this photo.":null}const s=await o.get(l.GET_EVENT_POINTS,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e}}).json();if(s.error)throw new Error(s.error);V(s.data),D(c),U(a)}catch(e){console.error("Failed to fetch contents",e)}P(!1)},me=async e=>{try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:ie?._id,page:1,limit:10,includeDescription:le}});if(r.error)throw new Error(r.error);if(r?.data?.length>0){const t=function(e,r,t){void 0===t&&(t=function(e,r){return e===r});var a={removed:[],added:[]};return W(e,r,t,function(e,r,t,c,s,n,i){if("add"===e)for(var o=n;o<i;++o)a.added.push(s[o]);else if("remove"===e)for(o=t;o<c;++o)a.removed.push(r[o])}),a}(e,r.data,(e,r)=>e._id===r._id),a=[...e,...t.added];D(a)}}catch(e){console.error(e)}},qe=()=>{const e=L.slice(1);U(null),Z(null),K({}),e.length===v?me(e):D(e),ae(!0)};if(O)return e.jsx(m,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!A){if(!z.customAuth)return e.jsx(h,{to:u.LOGIN,state:{referrer:r.pathname}});if(!T)return e.jsx(q,{title:"Please login to upload content"});window.history.pushState({},"",T)}return e.jsx("div",{className:"qc:min-h-[80vh] qc:bg-background",children:R||ne?e.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsx(m,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),e.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((r,t)=>e.jsxs("div",{className:"qc:space-y-4",children:[e.jsx(m,{className:"qc:h-8 qc:w-36"}),e.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((r,t)=>e.jsx(m,{className:"qc:h-24 qc:w-full qc:sm:h-32"},t))})]},t))})]}):e.jsxs("div",{className:"qc:lg:mt-8",children:[ie?.status===g.CLOSED&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),ie?.status===g.OPEN&&L.length<=0&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),ie?.status===g.OPEN&&L.length>0&&e.jsxs("div",{children:[!(oe?.length<=0&&le)&&e.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[e.jsxs(t,{variant:"h4",children:["Rate this ",L[0].type===p.IMAGE?"image":"video"]}),e.jsxs(t,{variant:"h4",children:[ie?.pointName,":"," ",e.jsx("span",{className:"qc:text-primary",children:G.upload+G.curate})]})]}),e.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[L[0].type===p.IMAGE&&e.jsx(w,{children:e.jsx($,{sizeMode:Y,src:L[0].url,alt:L[0].caption,blurhash:L[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),L[0].type===p.VIDEO&&e.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:e.jsx(S,{fit:Y,src:L[0].url,loop:!0,playing:te,volume:0,muted:!0,onPlay:()=>ae(!0),onPause:()=>ae(!1),onEnd:()=>ae(!1)})}),L[0].caption&&L[0].caption.length>0&&e.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:e.jsx(t,{variant:"body3",lines:"2",children:L[0].caption})}),L.length>1&&e.jsx("img",{style:{display:"none"},src:L[1].url,alt:"Next image"})]}),e.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!F&&oe&&oe.map(r=>e.jsx(B,{parameter:r,selected:X[r._id],onChange:e=>K({...X,[r._id]:e})},r._id)),ce&&oe?.length>0&&e.jsx(t,{variant:"h5",color:"error",children:ce}),F&&oe?.length>0&&e.jsx("div",{className:"qc:sm:pt-16",children:e.jsx(t,{variant:"h5",color:"error",align:"center",children:F})}),oe?.length>0&&e.jsx(x,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:ee,loading:ee,icon:"material-symbols:check-rounded",onClick:F?qe:async()=>{if(oe.length<1)return void se("no parameters found");if(Object.keys(X).length<oe.length)return void se("please select your ratings");se(null),re(!0);const e=await o.post(l.CURATE_CONTENT,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},json:{eventId:ie._id,contentId:L[0]._id,parameterCount:oe.length,userRatings:oe.map(e=>({parameterId:e._id,weight:e.weight,rate:X[e._id]})),inappropriate:""}}).json();if(e.error)se(e.error);else{const r=e.data,t=r.crowdRatings||{},a={parameters:oe.map(e=>({name:e.name,crowdRating:t[e._id],userRating:r.ratings?.find(r=>r.parameterId===e._id)?.rate})),similarity:r.similarity||null,points:r.points||0,rateCount:r.rateCount||0};Z(a);const c={...G};c.curate+=ie.activityScores.curate,V(c)}re(!1)},children:F?"Rate Next Image":ee?"Rating...":"Submit"}),L?.length>0&&le&&e.jsx(H,{summary:L[0].contentSummary,url:L[0].url})]})]}),e.jsx("div",{className:"qc:mt-16",children:e.jsx(f,{to:u.GALLERY(a),state:{internalNavigation:!0},children:e.jsx(t,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),e.jsx(k,{open:!!Q,onOpenChange:e=>!e&&qe(),children:e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsxs(_,{className:"qc:hidden",children:[ie?.pointName,": ",G?.upload+G?.curate]}),e.jsx(C,{className:"qc:hidden",children:"We are here to help you"})]}),e.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[e.jsx(M,{feedback:Q}),e.jsx(x,{fullWidth:!0,color:"primary",onClick:qe,children:"Next"})]})]})})]})})},H=({summary:r,url:a})=>e.jsxs("div",{className:"qc:w-full",children:[r?.subject&&e.jsx(t,{variant:"h3",className:"qc:mb-4",align:"center",children:r?.subject}),r?.labels&&e.jsx("div",{className:"qc:space-y-2",children:Object.entries(r?.labels).filter(([e,r])=>Array.isArray(r)&&r.length>0).map(([r,a])=>e.jsxs("div",{className:"",children:[e.jsx(t,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:r.replace("_"," ")}),e.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((r,a)=>e.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[e.jsx(j,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),e.jsx(t,{variant:"body1",children:r}),e.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:e.jsx(x,{variant:"outlined",icon:"flat-color-icons:google",children:e.jsx(j,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},a))})]},r))}),r?.description&&e.jsxs(w,{children:[e.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),e.jsx(t,{variant:"body2",children:r?.description})]}),e.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:e.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${a}&idpbck=1&selectedindex=0&id=${a}&mediaurl=${a}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:e.jsx(x,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),r&&e.jsx(t,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]});export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,c as t}from"./
|
|
1
|
+
import{j as e,c as t}from"./BE5TseI4.js";import{useRef as s,useState as r,useCallback as c,useEffect as l}from"react";const n=({src:n,thumbnailUrl:o,playing:a=!1,controls:u=!1,playsInline:i=!0,fit:q="cover",muted:h=!0,showFullscreen:m=!0,onClick:d,onPlay:v,onPause:T,onEnd:p})=>{const w=s(null),x=s(null),[f,g]=r(!0),j=s(typeof window<"u"&&window.matchMedia("(hover: hover)").matches),b=c(()=>{a?T?.():v?.()},[a,T,v]),y=c(()=>{if(!w.current)return;const e=w.current;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()},[]);return l(()=>{const e=w.current;if(!e)return;const t=()=>{try{a&&e.play().catch(()=>{})}catch(e){console.error("Error handling video play:",e)}};return e.addEventListener("canplay",t),()=>e.removeEventListener("canplay",t)},[a]),l(()=>{const e=w.current;if(e){try{a?(e.play().catch(()=>{}),j.current||(x.current=setTimeout(()=>g(!1),1e3))):(e.pause(),g(!0))}catch(e){console.error("Error controlling video playback:",e)}return()=>{x.current&&(clearTimeout(x.current),x.current=null)}}},[a]),e.jsxs("div",{className:"qc:hover:cursor-pointer qc:relative qc:size-full",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[e.jsx("video",{ref:w,className:t("qc:size-full",`qc:object-${q}`),src:n,muted:h,poster:o,controls:u,playsInline:i,onEnded:p,onClick:d,children:"Your browser does not support the video tag."}),!u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:items-center qc:justify-center",children:f&&e.jsx("button",{onClick:b,className:"qc:text-white","aria-label":a?"Pause":"Play",children:a?e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"})]}):e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",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"})," "]})})}),f&&m&&e.jsx("button",{onClick:y,className:"qc:absolute qc:right-3 qc:top-3 qc:size-8 qc:rounded-lg qc:p-2 qc:text-white","aria-label":"Enter fullscreen",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"qc:size-6",children:[" ",e.jsx("path",{fill:"currentColor",d:"M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"})," "]})})]})]})};export{n as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c,a3 as e}from"./
|
|
1
|
+
import{j as c,a3 as e}from"./BE5TseI4.js";const a=({disabled:a,provider:r,onClick:s,loading:i})=>c.jsx("button",{disabled:a||i,onClick:async()=>{if(!a&&!i)try{await s()}catch(c){console.error(`${e(r)} login error:`,c)}},className:"qc:group qc:h-12 qc:rounded-full qc:transition qc:duration-300 qc:disabled:cursor-not-allowed qc:disabled:border-gray-500 qc:disabled:opacity-50",children:i?c.jsx("div",{className:"qc:flex qc:h-full qc:items-center qc:justify-center",children:c.jsx("div",{className:"qc:h-5 qc:w-5 qc:animate-spin qc:rounded-full qc:border-b-2 qc:border-gray-900"})}):c.jsx("img",{className:"qc:h-auto qc:w-full",src:(c=>{switch(c){case"google":return"https://qrati.com/images/continue-with-google.svg";case"apple":return"https://qrati.com/images/continue-with-apple.svg";default:return""}})(r,a),alt:`sign in with ${e(r)}`})});export{a as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./
|
|
1
|
+
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./BE5TseI4.js";import"react";const o=({title:t,entries:s=[],showFloatingPoint:a=!1,hidePictures:l=!0})=>{const i=t.replace(/\s+/g,"-").toLowerCase(),r=e=>{if(!e)return"";const c=e.trim().split(" ");return 1===c.length?c[0]:`${c[0]} ${c[1][0]}.`};return e.jsxs("div",{className:"qc:border-border qc:mx-auto qc:flex qc:max-w-lg qc:flex-col qc:space-y-4 qc:rounded qc:border qc:p-4 qc:lg:space-y-8",children:[e.jsx(c,{variant:"h4",align:"center",color:"primary",children:t}),0===s.length?e.jsx(c,{variant:"h5",align:"center",color:"error",children:"Not available"}):e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"qc:flex qc:w-full qc:items-end qc:justify-center qc:gap-4 qc:lg:gap-24",children:[s.length>1&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-warning qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"2"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[1].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[1].totalPoint?s[1].maxScore?.toFixed(a?2:0):s[1].totalPoint?.toFixed(a?2:0)})]}),s.length>0&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-destructive qc:text-primary-foreground qc:flex qc:size-24 qc:items-center qc:justify-center qc:rounded-full qc:text-4xl",children:"1"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[0].name)}),e.jsx("div",{className:"qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[0].totalPoint?s[0].maxScore?.toFixed(a?2:0):s[0].totalPoint?.toFixed(a?2:0)})]}),s.length>2&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-success qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"3"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[2].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[2].totalPoint?s[2].maxScore?.toFixed(a?2:0):s[2].totalPoint?.toFixed(a?2:0)})]})]}),e.jsx("div",{className:"qc:mt-6",children:e.jsx("div",{className:"qc:-my-2 qc:overflow-x-auto qc:sm:-mx-6 qc:lg:-mx-8",children:e.jsx("div",{className:"qc:inline-block qc:min-w-full qc:py-2 qc:align-middle qc:md:px-6 qc:lg:px-8",children:e.jsx("div",{className:"qc:shadow-outer qc:overflow-hidden qc:ring-1 qc:ring-black qc:ring-opacity-5 qc:md:rounded",children:e.jsx("table",{className:"qc:w-full qc:divide-y qc:divide-gray-300",children:e.jsx("tbody",{className:"qc:bg-background qc:bg-opacity-50",children:s.slice(3).map((c,t)=>e.jsxs("tr",{children:[e.jsx("td",{className:"qc:text-muted qc:whitespace-nowrap qc:py-4 qc:pl-4 qc:text-sm qc:font-medium",children:e.jsx("span",{className:"qc:px-2",children:t+4})}),e.jsx("td",{className:"qc:whitespace-nowrap qc:py-4",children:e.jsxs("div",{className:"qc:flex qc:items-center",children:[!l&&e.jsx("div",{className:"qc:size-8 qc:shrink-0"}),e.jsx("div",{className:"qc-ml-4",children:e.jsx("div",{className:"qc-text-primary qc-font-medium",children:r(c.name)})})]})}),e.jsx("td",{className:"qc:text-foreground qc:whitespace-nowrap qc:py-4 qc:pr-4 qc:text-right qc:text-base qc:font-medium qc:italic",children:void 0===c.totalPoint?c.maxScore?.toFixed(a?2:0):c.totalPoint?.toFixed(a?2:0)})]},`${i}-${t}`))})})})})})})]})]})},m=()=>{const{eventSlug:c}=t(),{props:{organizationId:m}}=s(),{event:x}=a({eventSlug:c}),{isLoading:f,data:g}=l({queryKey:[`leaderboard-${m}-${x?._id}`],queryFn:async()=>(await q.get(d.GET_LEADERBOARD,{headers:{"x-org-id":m},searchParams:{eventId:x?._id}}).json()).data,enabled:!!x});return f?e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:bg-background qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",x?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsxs("div",{className:"qc:flex-1",children:[e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"}),e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"})]}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:g?.leaderboardByScore?.topRankers||[],pointName:x?.pointName})})]}):e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",x?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:"Point Leaders",entries:g?.leaderboardByPoint?.topRankers||[],pointName:x?.pointName})}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:g?.leaderboardByScore?.topRankers||[],pointName:x?.pointName})})]})};export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as e,j as s,J as a,T as r,g as o,P as l}from"./BE5TseI4.js";import{useState as i}from"react";import{I as n}from"./B1r-QO-6.js";import{S as d}from"./DT_P8FaG.js";import{u as t,C as c,o as m,c as u,a as g,b as p}from"./-74yB4f5.js";const h={fname:"",lname:"",email:"",password:"",confirmPassword:""},w=u().shape({fname:g().required("First name is required"),lname:g().required("Last name is required"),email:g().required("Please enter your Email").email("Enter a valid Email"),password:g().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:g().required("Please confirm your password").oneOf([p("password"),null],"Passwords do not match")}),f=()=>{const[u,g]=i(null),[p,f]=i(!1),[j,x]=i({google:!1,apple:!1}),[q,v]=i({showPassword:!1,showConfirmPassword:!1}),{registerUsingEmail:y,loginWithGoogle:C,loginWithApple:b}=e(),P=async(e,s)=>{x(s=>({...s,[e]:!0})),g(null);try{await s()}catch(s){g(s.message||`Failed to sign up with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{x(s=>({...s,[e]:!1}))}},{control:N,handleSubmit:B,formState:{errors:S}}=t({defaultValues:h,mode:"onSubmit",resolver:m(w)});return s.jsxs("div",{className:"qc:w-full qc:space-y-8 qc:bg-background",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:B(async e=>{const{email:s,password:a,fname:r,lname:o}=e;f(!0);try{const e=await y(s.toLowerCase(),a,r,o);e?.error&&g(e.error)}catch(e){g(e)}finally{f(!1)}}),className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{name:"fname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"First name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.fname?.message})}),s.jsx(c,{name:"lname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Last name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.lname?.message})})]}),s.jsx(c,{name:"email",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Email",disabled:p,type:"email",value:e,onChange:a,onBlur:r,error:S.email?.message})}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"password",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Password",disabled:p,type:q.showPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.password?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:q.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showPassword:!q.showPassword})})]}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"confirmPassword",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Confirm password",disabled:p,type:q.showConfirmPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.confirmPassword?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:q.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showConfirmPassword:!q.showConfirmPassword})})]}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(o,{to:l.FORGOT_PASSWORD,state:location?.state,children:s.jsx(r,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(a,{type:"submit",color:"primary",className:"qc:w-full",disabled:p,loading:p,children:"Register"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-2",children:[s.jsx(d,{disabled:p||j.google||j.apple,loading:j.google,onClick:()=>P("google",C),provider:"google"}),s.jsx(d,{disabled:p||j.google||j.apple,loading:j.apple,onClick:()=>P("apple",b),provider:"apple"})]})]})};export{f as default};
|