@qratilabs/qrati-connect 2.22.2 → 2.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/element/{CPlVxcfY.js → B1h4rQf7.js} +1 -1
- package/element/web.es.js +2 -2
- package/package.json +1 -1
- package/react/{CPlVxcfY-DpaDwsHR.js → B1h4rQf7-BlCih4CD.js} +1 -1
- package/react/{CPlVxcfY-Bif80UuQ.js → B1h4rQf7-DGwPbWg7.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +2 -2
- package/umd/web.umd.js +1 -1
|
@@ -3,7 +3,7 @@ import{C as t,D as e,E as n,O as i,S as s,b as o,d as r,f as a,j as l,l as c,n a
|
|
|
3
3
|
/* @__PURE__ */r("img",{className:"h-auto w-full object-contain sm:max-h-96",src:e?.imageUrl,alt:"Image not found"}),
|
|
4
4
|
/* @__PURE__ */r("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */r(et,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */r(et,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */r(nt,{fullWidth:!0,className:"rounded-none",onClick:()=>{i?.(e?._id,e?.targetType??M.LINK,e?.targetUrl),n?.()},iconName:I[e?.targetType]??I[M.LINK],children:e?.targetText})]})]})})},jt=({style:t,content:e,curateLink:n,onAdClick:i})=>{const{captureAdImpression:s,captureAdEngagement:o,captureAdClick:a}=j(),l=Boolean(n&&i),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF";return r("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
|
|
5
5
|
/* @__PURE__ */r(D,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&s(e._id)},onClick:()=>o(e._id),children:/* @__PURE__ */r(J,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:l?i:void 0,pswpData:{id:e._id,type:v.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
|
|
6
|
-
/* @__PURE__ */r("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==M.NONE)&&/* @__PURE__ */r("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[e.title&&/* @__PURE__ */r("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */r("h3",{className:"line-clamp-1 text-sm
|
|
6
|
+
/* @__PURE__ */r("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==M.NONE)&&/* @__PURE__ */r("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[e.title&&/* @__PURE__ */r("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */r("h3",{className:"line-clamp-1 text-sm font-medium text-red-500",children:e.title})}),e?.targetType!==M.NONE&&/* @__PURE__ */r("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{l?i?.():a(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */r(Z,{style:{color:d},icon:I[e?.targetType??M.LINK]}),e?.targetText]})]})]})},Wt=({style:t,gamConfig:n,slotIndex:i,eventId:s,organizationId:o})=>{const a=g(null),l=g(null),{trackGamAnalytics:c}=j(),d=`gam-slot-${s??"ev"}-${i}`,h=Math.max(1,Math.round(t?.width||n.sizes[0]?.[0]||300)),p=Math.max(1,Math.round(t?.height||n.sizes[0]?.[1]||250)),u=g({w:h,h:p});return e(()=>{let t=!1,e=null,i=null,r=null,h=null;return(async()=>{await W(),!t&&a.current&&window.googletag.cmd.push(()=>{if(t)return;U(d);const{w:p,h:m}=u.current,g=[[p,m],...n.sizes],f=window.googletag.defineSlot(n.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;l.current=f,i=window.googletag.pubads(),s?f.setConfig({targeting:{qrati_event:s,...n.categories.length>0?{qrati_category:n.categories}:{}}}):n.categories.length>0&&f.setConfig({targeting:{qrati_category:n.categories}}),r=t=>{t.slot===f&&c({eventId:s,organizationId:o,type:C.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},i.addEventListener("slotRenderEnded",r),h=t=>{t.slot===f&&c({eventId:s,organizationId:o,type:C.GAM_VIEWABLE})},i.addEventListener("impressionViewable",h);const w=a.current;w&&(e=K({container:w,onClick:()=>{c({eventId:s,organizationId:o,type:C.GAM_CLICK})}}),Y(),window.googletag.display(d))})})(),()=>{t=!0,e?.(),i&&"function"==typeof i.removeEventListener&&(r&&i.removeEventListener("slotRenderEnded",r),h&&i.removeEventListener("impressionViewable",h));const n=l.current;l.current=null,n&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([n])})}},[s,n.adUnitPath,n.categories,o,d]),/* @__PURE__ */r("div",{style:{width:h,height:p},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":i,children:/* @__PURE__ */r("div",{id:d,ref:a,style:{width:h,height:p},className:"gam-ad-slot"})})},Gt=a(null),Kt=()=>{const e=t(Gt);if(!e)throw new Error("Popover components must be used within a Popover");return e},Qt=({children:t,className:e,open:n,onOpenChange:i})=>{const[o,a]=s(!1),l="boolean"==typeof n,c=l?n:o,d=p(),h=`popover-trigger-${d}`,u=`popover-content-${d}`,m=g(null);return r(Gt.Provider,{value:{isOpen:c,setIsOpen:t=>{l||a(t),i?.(t)},triggerId:h,contentId:u,triggerRef:m},children:/* @__PURE__ */r("div",{"data-slot":"popover",className:S("relative inline-block",e),children:t})})},Yt=({children:t,asChild:e,className:n,onClick:i,...s})=>{const{isOpen:o,setIsOpen:a,triggerId:l,contentId:d,triggerRef:h}=Kt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return c(e,{ref:t=>{h.current=t},id:l,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?d:void 0,onClick:t=>{a(!o),e.props?.onClick?.(t)},"data-state":o?"open":"closed"})}}return r("button",{ref:h,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?d:void 0,"data-slot":"popover-trigger","data-state":o?"open":"closed",className:n,onClick:t=>{a(!o),i?.(t)},...s,children:t})},Zt=({children:t,className:n,align:i="center",side:a="top",sideOffset:l=4,...c})=>{const{isOpen:d,setIsOpen:h,contentId:p,triggerRef:u}=Kt(),{organization:m,portalContainer:w}=L(),y=g(null),[v,b]=s(null);if(f(()=>{if(!d)return;const t=()=>{if(!u.current||!y.current)return;const t=u.current.getBoundingClientRect(),e=y.current.getBoundingClientRect();let n=t.left,s=t.bottom+l;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===a&&(s=t.top-e.height-l),"left"===a&&(n=t.left-e.width-l,s=t.top+t.height/2-e.height/2),"right"===a&&(n=t.right+l,s=t.top+t.height/2-e.height/2),"bottom"===a&&(s=t.bottom+l),b({top:s,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,d,a,l,u]),e(()=>{if(!d)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=y.current&&(y.current.contains(n)||e.includes(y.current)),s=u.current&&(u.current.contains(n)||e.includes(u.current));i||s||h(!1)},e=t=>{"Escape"===t.key&&(h(!1),u.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[d,h,u]),!d)return null;const x=/* @__PURE__ */r("div",{ref:y,id:p,role:"dialog","aria-modal":"false","data-state":d?"open":"closed",className:S("bg-background text-foreground border-border shadow-outer rounded outline-none",n),style:{position:"fixed",top:v?.top??0,left:v?.left??0,zIndex:2010,...T(m)},...c,children:t});return"undefined"!=typeof document?o(x,w??document.body):x},Jt=({eventId:t,contentId:n,emojis:i=[],counts:o={},userReaction:a})=>{const{user:c,props:d,organization:h}=L(),p=d?.loginUrl,{handleReactionClick:u,isPending:f}=(()=>{const t=x(),{props:n,user:i}=L(),o=n?.organizationId,r=function(t){const n=x(void 0),[i]=s(()=>new rt(n,t));e(()=>{i.setOptions(t)},[i,t]);const o=m(l(t=>i.subscribe(V.batchCalls(t)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),r=l((t,e)=>{i.mutate(t,e).catch(k)},[i]);if(o.error&&R(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:r,mutateAsync:o.mutate}}({mutationFn:async({eventId:t,contentId:e,emoji:n})=>{await B.post(y.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:n},headers:{"x-org-id":o,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[E.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),tt.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)},onSettled:async(e,n,i)=>{await t.invalidateQueries({queryKey:[E.CONTENTS_BY_EVENT(i.eventId)]})}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return tt.error("Please login to react"),!1;try{return await r.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(s){return!1}},isPending:r.isPending}})(),[w,v]=s(!1),[T,_]=s(null),q=g(null),I=Object.values(o).reduce((t,e)=>t+e,0);return e(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */r(Qt,{open:w,onOpenChange:v,children:[/* @__PURE__ */r(Yt,{asChild:!0,children:/* @__PURE__ */r("button",{type:"button",className:S("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",T&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(o[e]||0)-(o[t]||0)).slice(0,1).map(t=>/* @__PURE__ */r("span",{className:S("text-sm transition-transform duration-150 ease-out sm:text-lg",T===(a||t)&&"scale-125"),children:a||t},`${n}-${t}-1`)),I>0&&/* @__PURE__ */r("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */r(Zt,{side:"top",align:"end",children:[c?null:/* @__PURE__ */r("div",h?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
|
|
7
7
|
/* @__PURE__ */r("a",{className:"text-info underline",href:p,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
|
|
8
8
|
/* @__PURE__ */r(b,{className:"text-info underline",to:N.LOGIN,children:"Login"})," ","to react"]}),c&&/* @__PURE__ */r("div",{className:"flex gap-1 p-2",children:i.map(e=>{const i=a===e;return r("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */r("span",{className:"text-xs font-medium",children:o[e]||0}),/* @__PURE__ */r("button",{type:"button",disabled:f,className:S("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",i?"scale-125":"hover:scale-110",T===e&&"scale-125",f&&"cursor-not-allowed"),onClick:()=>(async e=>{!f&&u&&(_(e),v(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>_(null),180),u(t,n,e))})(e),children:e})]},`${n}-${e}-2`)})})]})]})},Xt=({event:t={},content:e,curateLink:n})=>t.engagementStyle===_.CONTEST?/* @__PURE__ */r("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */r(Z,{name:"material-symbols:star-half-rounded",className:"size-4"}),/* @__PURE__ */r("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===_.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */r(Jt,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,te=({content:t})=>/* @__PURE__ */r("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&/* @__PURE__ */r("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */r("div",{role:"note",title:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.caption})}),/* @__PURE__ */r("div",{className:"flex items-center justify-between",children:/* @__PURE__ */r("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:t?.user?.name})})]}),ee=({event:t,content:e,style:n,timestampField:i,curateLink:s,onChangeFaceUrl:o,hideControls:a})=>{const{organization:l}=L(),c=`content-${e._id}`,d=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,e);return r("div",{id:c,style:n,className:"group relative mb-1 overflow-hidden rounded",children:[/* @__PURE__ */r(J,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:{id:e._id,type:v.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption,contentSummary:JSON.stringify(e.contentSummary)}}),!a&&/* @__PURE__ */r(h,{children:[d&&/* @__PURE__ */r("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:d}),l?.integrationSettings?.showQuickSearch&&(e.faces?.length??0)>0&&/* @__PURE__ */r("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:()=>{o?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:/* @__PURE__ */r(Z,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),
|
|
9
9
|
/* @__PURE__ */r("div",{className:"",children:[/* @__PURE__ */r("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */r(te,{content:e})}),/* @__PURE__ */r("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */r(Xt,{event:t,content:e,curateLink:s})})]})]})]})},ne=({content:t,style:e,event:n,timestampField:i,curateLink:s,hideControls:o})=>{const a=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,t);return r("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded",style:e,children:[/* @__PURE__ */r(J,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:v.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */r("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */r("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:a}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=require("./iDVNWJcT-Bf_I6ltO.js"),e=require("./BhA6mkqA-C2OnXTXV.js"),n=require("./C5R-Kmjo-Cb0SK-aw.js"),i=require("./BeqcQjGf-BiJhtnLB.js");var s=class extends e.v{#t;#e=void 0;#n;#i;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),e.M(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&e.L(n.mutationKey)!==e.L(this.options.mutationKey)?this.reset():"pending"===this.#n?.state.status&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,e){return this.#i=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??n.u();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#o(t){e.Z.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,i=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(t.data,null,n,i,s)}catch(e){Promise.reject(e)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(void 0,t.error,n,i,s)}catch(e){Promise.reject(e)}}}this.listeners.forEach(t=>{t(this.#e)})})}};function o(t){return["react-photo-album",t].filter(Boolean).join("--")}function r({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var a=Object.freeze([1200,600,300,0]);function l(t,e){return"function"==typeof t?t(e):t}function c(t,e){return void 0!==e?l(t,e):void 0}function d(t,e,n,i=0){if(void 0===e)return;const s=c(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=a.findIndex(t=>t<=e);return l(t[Math.max(n,0)],e)}(n,e):s,i))}function h(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:d(e,t,[20,15,10,5]),padding:d(n,t,[0,0,0,0]),componentsProps:l(i,t)||{},render:l(s,t)}}function p(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function u(t,e,n,i,s,o,r){let a,l;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${p((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(a=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),l=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:a,sizes:l}}var m=t.Be(function({as:e,render:n,context:i,classes:s=[],variables:r={},style:a,className:l,children:c,...d},h){const u=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(s)?s:[s]).filter(t=>"string"==typeof t).map(o),l),m={style:{...Object.fromEntries(Object.entries(r).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${o(n)}`),"number"==typeof e?p(e,5):e];var n})),...a},className:u,children:c,...d};if(n){const t=n({ref:h,...m},i);if(t)return t}return t.Hn(e||"div",{ref:h,...m})}),g=t.Be(function({photo:e,index:n,width:i,height:s,onClick:o,render:{wrapper:r,link:a,button:l,image:c,extras:d}={},componentsProps:{link:h,button:u,wrapper:g,image:f}={}},w){const{href:y}=e,v={photo:e,index:n,width:p(i,3),height:p(s,3)};let b;return b=y?{...h,as:"a",render:a,classes:["photo","link"],href:y,onClick:o}:o?{...u,as:"button",type:"button",render:l,classes:["photo","button"],onClick:o}:{...g,render:r,classes:"photo"},t.Hn(m,{ref:w,variables:{photoWidth:v.width,photoHeight:v.height},context:v,...b,children:[t.Hn(m,{as:"img",classes:"image",render:c,context:v,...f}),d?.({},v)]})}),f=t.Be(function({layout:e,sizes:n,model:i,skeleton:s,onClick:o,render:{container:r,track:a,photo:c,...d}={},componentsProps:{container:h,track:p,link:f,button:w,wrapper:y,image:v}={}},b){const{spacing:T,padding:x,containerWidth:_,tracks:q,variables:k,horizontal:S}=i||{};return t.Hn(m,{role:"group","aria-label":"Photo album",...h,variables:{spacing:T,padding:x,containerWidth:_,...k},classes:["",e],render:r,ref:b,children:[void 0!==T&&void 0!==x&&void 0!==_&&q?.map(({photos:e,variables:i},s)=>{const r=e.length,h=S?r:q.length;return t.C(m,{...p,key:s,render:a,classes:"track",variables:{trackSize:r,...i}},e.map(e=>{const{photo:i,index:s,width:r}=e,{key:a,src:p,alt:m="",title:b,label:q}=i,k=o?t=>{o({event:t,photo:i,index:s})}:void 0;if(c){const t=c({onClick:k},e);if(t)return t}const S=t=>q?{"aria-label":q,...t}:t;return t.Hn(g,{onClick:k,render:d,componentsProps:{image:{loading:"lazy",decoding:"async",src:p,alt:m,title:b,...u(i,n,r,_,h,T,x),...l(v,e)},link:S(l(f,e)),button:S(l(w,e)),wrapper:l(y,e)},...e},a??s)}))}),void 0===_&&s]})});function w(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+r(e),0)}function y(t,e,n,i,s,o,r){const a=t.slice(e,n),l=w(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}function v(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function b(e,n,i){const[[s],o]=t.se(v,[i]),r=function(e){const[n,i]=t.fe(e);return e===n||e&&n&&e.length===n.length&&!e.some((t,e)=>t!==n[e])?n:(i(e),e)}(n),a=t.he(void 0);return{containerRef:t.ye(t=>{a.current?.disconnect(),a.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(t,r));n(),t&&"undefined"!=typeof ResizeObserver&&(a.current=new ResizeObserver(n),a.current.observe(t)),"function"==typeof e?e(t):e&&(e.current=t)},[e,r]),containerWidth:s}}var T=t.Be(function({photos:e,breakpoints:n,defaultContainerWidth:i,...s},o){const{containerRef:a,containerWidth:l}=b(o,n,i),{spacing:u,padding:m,targetRowHeight:g,minPhotos:v,maxPhotos:T,...x}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=h(t,s),{singleRowMaxHeight:p,minPhotos:u,maxPhotos:m}=c(i,t)||{};if(void 0!==p&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*p+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:d(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:u,maxPhotos:m,componentsProps:a}}(l,{photos:e,...s});return t.Hn(f,{layout:"rows",ref:a,model:t.me(()=>void 0!==l&&void 0!==u&&void 0!==m&&void 0!==g?function(t,e,n,i,s,o,a){const l=Math.min(function(t,e,n,i){return p(e/n/Math.min(...t.map(t=>r(t))))+(i||0)+2}(t,i,s,o),a||1/0),c=o||1,d=t.length,h=new Array(d+1).fill(1/0),u=new Array(d+1).fill(-1);h[0]=0;for(let r=1;r<=d;r+=1)for(let o=r-c;o>=Math.max(0,r-l);o-=1){if(h[o]===1/0)continue;const a=y(t,o,r,i,e,n,s);if(void 0===a)break;const l=h[o]+a;(h[r]===1/0||h[r]>l&&(h[r]/l>1.005||-1!==u[r]&&u[r]<o))&&(h[r]=l,u[r]=o)}if(h[d]===1/0)return;const m=[];for(let r=d;0!==r;r=u[r])m.push(r);m.push(0),m.reverse();const g=[];for(let p=1;p<m.length;p+=1){const s=t.slice(m[p-1],m[p]).map((t,e)=>({photo:t,index:m[p-1]+e})),o=w(s.map(({photo:t})=>t),i,e,n);g.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*r(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:g,horizontal:!0}}(e,u,m,l,g,v,T):void 0,[e,u,m,l,g,v,T]),...x})});function x(t,e,n,i,s,o,a){const l=[],c=a.reduce((t,e)=>t+e,0);for(let d=0;d<t.length-1;d+=1){const h=e.slice(t[d],t[d+1]).map((e,n)=>({photo:e,index:t[d]+n})),p=a.reduce((t,e,n)=>t+(o[d]-o[n])*e,0),u=(s-(t.length-2)*n-2*(t.length-1)*i-p)*a[d]/c;l.push({photos:h.map(({photo:t,index:e})=>({photo:t,index:e,width:u,height:u/r(t)})),variables:{adjustedGaps:p,columnRatio:a[d]}})}return{tracks:l,variables:{totalRatio:c}}}function _(t,e,n,i,s){const{tracks:o,variables:a}=function(t,e,n,i,s,o){const a=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+r(e),0)/t.length:1;for(let e=0;e<o;e+=1)a[e]=2*n,l[e]=e<t.length?r(t[e]):s;return x(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,a,l)}const c=(d=function(t,e,n,i,s){return o=>{const a=[],l=1.5*s;let c=i/r(t[o])+2*n;for(let d=o+1;d<t.length+1&&(a.push([d,(s-c)**2]),!(c>l||d===t.length));d+=1)c+=i/r(t[d])+e+2*n;return a}}(t,e,n,s,(t.reduce((t,e)=>t+s/r(e),0)+e*(t.length-o)+2*n*t.length)/o),function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=new Map,o=new Set;o.add(0);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const a=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,l])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=a+l,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(d,h=o,0,p=t.length),h,p));var d,h,p;for(let u=0;u<c.length-1;u+=1){const i=t.slice(c[u],c[u+1]);a[u]=e*(i.length-1)+2*n*i.length,l[u]=1/i.reduce((t,e)=>t+1/r(e),0)}return x(c,t,e,n,i,a,l)}(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?_(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...a}}}var q=t.Be(function({photos:e,breakpoints:n,defaultContainerWidth:i,...s},o){const{containerRef:r,containerWidth:a}=b(o,n,i),{spacing:l,padding:c,columns:p,...u}=function(t,{columns:e,...n}){return{...n,...h(t,n),columns:d(e,t,[5,4,3,2],1)}}(a,{photos:e,...s});return t.Hn(f,{layout:"columns",ref:r,model:t.me(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==p?_(e,l,c,a,p):void 0,[e,l,c,a,p]),...u})});function k(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?k(t,e,n,i,s-1):void 0;const a=[];for(let r=0;r<s;r+=1)a[r]=0;const l=t.reduce((t,i,s)=>{const l=a.reduce((t,e,n)=>e<a[t]-1?n:t,0);return a[l]=a[l]+o/r(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/r(t)}))}))}}var S=t.Be(function({photos:e,breakpoints:n,defaultContainerWidth:i,...s},o){const{containerRef:r,containerWidth:a}=b(o,n,i),{spacing:l,padding:c,columns:p,...u}=function(t,{columns:e,...n}){return{...n,...h(t,n),columns:d(e,t,[5,4,3,2],1)}}(a,{photos:e,...s});return t.Hn(f,{layout:"masonry",ref:r,model:t.me(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==p?k(e,l,c,a,p):void 0,[e,l,c,a,p]),...u})});function E(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var I=class{constructor(t,e={}){this.lightbox=t,this.aiSummaryVisible=!1,this.currentSummary=null,this.options={aiSummaryButtonOrder:7,width:"400px",height:"300px",transition:"0.3s ease",...e},document.head.insertAdjacentHTML("beforeend",`<style>\n .pswp__ai-summary-panel {\n background: rgba(30, 30, 30, 0.9);\n color: white;\n position: absolute;\n overflow-y: auto;\n z-index: 1;\n transition: transform ${this.options.transition};\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);\n padding: 20px;\n }\n\n /* Desktop styles */\n @media (min-width: 768px) {\n .pswp__ai-summary-panel {\n top: 0;\n right: 0;\n height: 100%;\n width: ${this.options.width};\n transform: translateX(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateX(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateX(-${this.options.width});\n transition: transform ${this.options.transition};\n }\n }\n\n /* Mobile styles */\n @media (max-width: 767px) {\n .pswp__ai-summary-panel {\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${this.options.height};\n transform: translateY(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateY(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateY(-${this.options.height});\n transition: transform ${this.options.transition};\n }\n }\n\n .pswp__ai-summary-close {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 32px;\n height: 32px;\n opacity: 0.6;\n cursor: pointer;\n z-index: 2;\n background: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.3s;\n }\n\n .pswp__ai-summary-close:hover {\n opacity: 1;\n }\n\n .pswp__ai-summary-close:before,\n .pswp__ai-summary-close:after {\n position: absolute;\n content: '';\n width: 16px;\n height: 2px;\n background-color: white;\n }\n\n .pswp__ai-summary-close:before {\n transform: rotate(45deg);\n }\n\n .pswp__ai-summary-close:after {\n transform: rotate(-45deg);\n }\n\n .pswp__ai-summary-content {\n margin-top: 20px;\n }\n\n .pswp__ai-summary-title {\n margin-bottom: 16px;\n font-size: 18px;\n font-weight: bold;\n padding-right: 30px; /* Add space for the close button */\n }\n\n .pswp__ai-summary-section {\n margin-bottom: 16px;\n }\n\n .pswp__ai-summary-section-title {\n font-weight: bold;\n margin-bottom: 8px;\n }\n\n .pswp__ai-summary-label {\n display: inline-flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n padding: 4px 12px;\n margin-right: 8px;\n margin-bottom: 8px;\n font-size: 14px;\n }\n\n .pswp__ai-summary-description {\n font-size: 14px;\n line-height: 1.5;\n }\n\n .pswp__ai-summary-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n font-style: italic;\n }\n\n .pswp__ai-summary-bing-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n z-index: 2;\n }\n\n .pswp__ai-summary-bing-button {\n height: 32px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.3s;\n }\n\n .pswp__ai-summary-bing-button:hover {\n background: rgba(255, 255, 255, 0.4);\n }\n\n .pswp__ai-summary-bing-icon {\n width: 20px;\n height: 20px;\n }\n\n .pswp__ai-summary-disclaimer {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n text-align: center;\n margin-top: 32px;\n padding: 0 10px;\n line-height: 1.4;\n font-style: italic;\n }\n </style>`),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"ai-summary-toggle-button",title:"Toggle AI summary view",order:this.options.aiSummaryButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24">\n <use class="pswp__icn-shadow" xlink:href="#pswp__icn-ai-summary"/>\n <path d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11t-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/>\n </svg>',onClick:()=>{this.toggleAISummary(t)}}),t.ui.registerElement({name:"ai-summary-panel",isButton:!1,appendTo:"root",html:'<div class="pswp__ai-summary-panel"><div class="pswp__ai-summary-close"></div></div>'})}),t.on("change",()=>{this.aiSummaryVisible&&this.updateAISummary(t)}),t.on("close",()=>{this.hideAISummary(t)}),t.on("firstUpdate",()=>{const e=t.element.querySelector(".pswp__ai-summary-close");e&&e.addEventListener("click",()=>{this.hideAISummary(t)})})}toggleAISummary(t){this.aiSummaryVisible?this.hideAISummary(t):this.showAISummary(t)}showAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!0,n.classList.add("visible"),e.classList.add("shifted-for-ai-summary"),this.updateAISummary(t))}hideAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!1,n.classList.remove("visible"),e.classList.remove("shifted-for-ai-summary"))}updateAISummary(t){if(!t.currSlide)return;const e=t.element.querySelector(".pswp__ai-summary-panel");if(!e)return;const n=t.currSlide.data,i=n.src||n.url||"";let s=null;try{n.contentSummary&&(s=JSON.parse(n.contentSummary),this.currentSummary=s)}catch(r){console.error("Error parsing AI summary data:",r)}const o=i?`<a class="pswp__ai-summary-bing-search" href="https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${encodeURIComponent(i)}&idpbck=1&selectedindex=0&id=${encodeURIComponent(i)}&mediaurl=${encodeURIComponent(i)}" target="_blank" rel="noopener noreferrer" class="pswp__ai-summary-bing-button">\n <svg xmlns="http://www.w3.org/2000/svg" style="height:24px;width:24px" width="256" height="388" viewBox="0 0 256 388"><defs><radialGradient id="logosBing0" cx="93.717%" cy="77.818%" r="143.121%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.71954)rotate(49.091 2.036 -2.204)"><stop offset="0%" stop-color="#00cacc"/><stop offset="100%" stop-color="#048fce"/></radialGradient><radialGradient id="logosBing1" cx="13.893%" cy="71.448%" r="150.086%" fx="13.893%" fy="71.448%" gradientTransform="matrix(.55155 -.39387 .23634 .91917 -.107 .112)"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></radialGradient><linearGradient id="logosBing2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></linearGradient></defs><path fill="url(#logosBing0)" d="M129.424 122.047c-7.133.829-12.573 6.622-13.079 13.928c-.218 3.147-.15 3.36 6.986 21.722c16.233 41.774 20.166 51.828 20.827 53.243c1.603 3.427 3.856 6.65 6.672 9.544c2.16 2.22 3.585 3.414 5.994 5.024c4.236 2.829 6.337 3.61 22.818 8.49c16.053 4.754 24.824 7.913 32.381 11.664c9.791 4.86 16.623 10.387 20.944 16.946c3.1 4.706 5.846 13.145 7.04 21.64c.468 3.321.47 10.661.006 13.663c-1.008 6.516-3.021 11.976-6.101 16.545c-1.638 2.43-1.068 2.023 1.313-.939c6.74-8.379 13.605-22.7 17.108-35.687c4.24-15.718 4.817-32.596 1.66-48.57c-6.147-31.108-25.786-57.955-53.444-73.06c-1.738-.95-8.357-4.42-17.331-9.085a1633 1633 0 0 1-4.127-2.154c-.907-.477-2.764-1.447-4.126-2.154c-1.362-.708-5.282-2.75-8.711-4.539l-8.528-4.446a6021 6021 0 0 1-8.344-4.357c-8.893-4.655-12.657-6.537-13.73-6.863c-1.125-.343-3.984-.782-4.701-.723c-.152.012-.838.088-1.527.168"/><path fill="url(#logosBing1)" d="M148.81 277.994c-.493.292-1.184.714-1.537.938c-.354.225-1.137.712-1.743 1.083a8315 8315 0 0 0-13.204 8.137a2848 2848 0 0 0-8.07 4.997a388 388 0 0 1-3.576 2.198c-.454.271-2.393 1.465-4.31 2.654a2652 2652 0 0 1-7.427 4.586a3958 3958 0 0 0-8.62 5.316a3011 3011 0 0 1-7.518 4.637c-1.564.959-3.008 1.885-3.21 2.058c-.3.257-14.205 8.87-21.182 13.121c-5.3 3.228-11.43 5.387-17.705 6.235c-2.921.395-8.45.396-11.363.003c-7.9-1.067-15.176-4.013-21.409-8.666c-2.444-1.826-7.047-6.425-8.806-8.8c-4.147-5.598-6.829-11.602-8.218-18.396c-.32-1.564-.622-2.884-.672-2.935c-.13-.13.105 2.231.528 5.319c.44 3.211 1.377 7.856 2.387 11.829c7.814 30.743 30.05 55.749 60.15 67.646c8.668 3.424 17.415 5.582 26.932 6.64c3.576.4 13.699.56 17.43.276c17.117-1.296 32.02-6.334 47.308-15.996c1.362-.86 3.92-2.474 5.685-3.585a877 877 0 0 0 4.952-3.14c.958-.615 2.114-1.341 2.567-1.614a91 91 0 0 0 2.018-1.268c.656-.424 3.461-2.2 6.235-3.944l11.092-7.006l3.809-2.406l.137-.086l.42-.265l.199-.126l2.804-1.771l9.69-6.121c12.348-7.759 16.03-10.483 21.766-16.102c2.392-2.342 5.997-6.34 6.176-6.848c.037-.104.678-1.092 1.424-2.197c3.036-4.492 5.06-9.995 6.064-16.484c.465-3.002.462-10.342-.005-13.663c-.903-6.42-2.955-13.702-5.167-18.339c-3.627-7.603-11.353-14.512-22.453-20.076c-3.065-1.537-6.23-2.943-6.583-2.924c-.168.009-10.497 6.322-22.954 14.03c-12.457 7.71-23.268 14.4-24.025 14.87s-2.056 1.263-2.888 1.764z"/><path fill="url(#logosBing2)" d="m.053 241.013l.054 53.689l.695 3.118c2.172 9.747 5.937 16.775 12.482 23.302c3.078 3.07 5.432 4.922 8.768 6.896c7.06 4.177 14.657 6.238 22.978 6.235c8.716-.005 16.256-2.179 24.025-6.928c1.311-.801 6.449-3.964 11.416-7.029l9.032-5.572v-127.4l-.002-58.273c-.002-37.177-.07-59.256-.188-60.988c-.74-10.885-5.293-20.892-12.948-28.461c-2.349-2.323-4.356-3.875-10.336-7.99a25160 25160 0 0 1-12.104-8.336L28.617 5.835C22.838 1.85 22.386 1.574 20.639.949C18.367.136 15.959-.163 13.67.084C6.998.804 1.657 5.622.269 12.171C.053 13.191.013 26.751.01 100.35l-.003 86.975H0z"/></svg>\n <span>Search on Bing</span>\n </a>\n <div class="pswp__ai-summary-disclaimer">\n These are AI generated summaries based on the content. Please verify the information before using it.\n </div>`:"";if(s){e.innerHTML=`<div class="pswp__ai-summary-close"></div>${this.renderAISummary(s)}${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}else{e.innerHTML=`<div class="pswp__ai-summary-close"></div><div class="pswp__ai-summary-empty">No AI summary available for this content</div>${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}}renderAISummary(t){let e='<div class="pswp__ai-summary-content">';return t.subject&&(e+=`<div class="pswp__ai-summary-title">${E(t.subject)}</div>`),t.labels&&Object.entries(t.labels).filter(([t,e])=>Array.isArray(e)&&e.length>0).forEach(([t,n])=>{e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-section-title">${E(t.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()))}</div>\n <div class="pswp__ai-summary-labels space-y-2">\n ${n.map(t=>`<span class="pswp__ai-summary-label">${E(t)}</span>`).join("")}\n </div>\n </div>\n `}),t.description&&(e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-description">${E(t.description)}</div>\n </div>\n `),e+="</div>",e}},C='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',H=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=C,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=C,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0),document.querySelector("#pswp__icn-hide-backdrop").style.display=this.backdropOn?"none":"inline",document.querySelector("#pswp__icn-show-backdrop").style.display=this.backdropOn?"inline":"none"}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const s=n.x(t,e,i),o=document.createElement("canvas");o.width=e,o.height=i;const r=o.getContext("2d");if(!r)return null;const a=r.createImageData(e,i);return a.data.set(s),r.putImageData(a,0,0),o.toDataURL()}catch(s){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",s),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:C,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}};function A(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var L={[e.At.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[e.At.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[e.At.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[e.At.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[e.At.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[e.At.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" d="M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"/><path fill="#fff" d="m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"/></svg>'},N=class{constructor(t,e,n){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=n,this.captionOn=!0,this.options={captionButtonOrder:8},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full bg-transparent"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),n=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),n&&(n.style.display=this.captionOn?"none":"inline")}createCaptionHTML(t){const{id:n,type:i,caption:s,title:o,description:r,targetType:a,targetText:l,targetUrl:c}=t||{},d=Boolean(a)&&String(a)!==String(e.At.NONE),h=d?a:e.At.LINK;switch("ad"===i&&this.captureAdImpression&&this.captureAdImpression(n),i){case"image":case"video":return s?.length>0?`\n <div class=" w-full bg-black/50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${A(s)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${A(o)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${A(r)}</h4>\n ${d?`<button\n class=" flex w-full items-center justify-center gap-3 rounded-md bg-white py-1 text-lg text-black caption-action-button"\n data-id="${A(n)}"\n data-target-type="${A(h)}"\n data-target-url="${A(c)}">\n ${L[h]}\n ${A(l)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const n=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(n);const i=e.querySelector(".caption-action-button");i&&i.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,n=t.currentTarget.dataset.targetType,i=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,n,i)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}},M=({contents:i=[],selectedIndex:s,onClick:o})=>{const r=t.he(null);t.pe(()=>{r.current&&a(s)},[s,r.current]);const a=t=>{if(!r.current)return;const e=r.current,n=e.children;if(t<0||t>=n.length)return;const i=n[t],s=e.offsetWidth/2,o=i.offsetLeft+i.offsetWidth/2-s;e.scrollTo({left:o,behavior:"smooth"})};return t.Hn("div",{ref:r,className:"scrollbar-hide flex h-28 w-auto items-center justify-center overflow-x-auto bg-black/50",style:{scrollBehavior:"smooth",userSelect:"none",whiteSpace:"nowrap"},children:i.map((i,r)=>t.Hn("button",{className:"relative mx-0.5 inline-block lg:mx-1.5",onClick:()=>((t,e)=>{o(e)})(0,r),children:[t.Hn(n.X,{wrapperClassName:e.ln("h-16 w-24 rounded-md lg:h-20 lg:w-20",r===s&&"border-2 border-[#ff4800]"),src:i.thumbnailUrl,placeholderSrc:i.blurImageUrl,alt:i.caption}),i.type===e.ct.VIDEO&&t.Hn("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:t.Hn("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:t.Hn("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})}),i.type===e.ct.AD&&t.Hn("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${r}`))})},B=class{constructor(t){this.lightbox=t,this.filmstripVisible=!0,this.options={filmstripButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip view",order:this.options.filmstripButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-show-filmstrip"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-hide-filmstrip" style="display:none"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6"\n />\n <path\n\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n\n ',onClick:()=>{this.toggleFilmstrip()}}),t.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'\n <div id="filmstrip-container" class="w-full absolute bottom-0">\n </div>\n '})}),t.on("change",()=>{this.filmstripVisible&&this.updateFilmstrip(t)}),t.on("close",()=>{this.cleanupFilmstrip()})}onThumbnailClcik(t){this.lightbox.pswp.goTo(t)}updateFilmstrip(e){const n=this.getElementById("filmstrip-container");if(!n)return;t.Y(t.Hn(M,{contents:e?.options?.dataSource?.items?.map(t=>({id:t.getAttribute("data-pswp-id"),type:t.getAttribute("data-pswp-type"),thumbnailUrl:t.getAttribute("data-pswp-thumbnail-url"),blurImageUrl:t.getAttribute("data-pswp-blur-image-url")||t.getAttribute("data-pswp-blurhash")})),selectedIndex:e.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),n);const i=this.getElementById("pswp-caption-container");i&&"7rem"!==i.style.bottom&&(i.style.bottom="7rem")}toggleFilmstrip(){this.filmstripVisible?this.cleanupFilmstrip():this.updateFilmstrip(this.lightbox.pswp),this.filmstripVisible=!this.filmstripVisible;const t=this.querySelector("#pswp__icn-show-filmstrip"),e=this.querySelector("#pswp__icn-hide-filmstrip");t&&(t.style.display=this.filmstripVisible?"inline":"none"),e&&(e.style.display=this.filmstripVisible?"none":"inline")}cleanupFilmstrip(){const e=this.getElementById("filmstrip-container"),n=this.getElementById("pswp-caption-container");n&&(n.style.bottom="0"),e&&t.Y(null,e)}},V=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" 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"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0),document.querySelector("#pswp__icn-exit-fullscreen").style.display=this.fullscreen?"inline":"none",document.querySelector("#pswp__icn-fullscreen").style.display=this.fullscreen?"none":"inline"}},z=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),document.head.insertAdjacentHTML("beforeend",`<style>.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}</style>`),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}init(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" 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"/><path id="pswp__icn-stop" style="display:none" 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"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer()),document.querySelector("#pswp__icn-stop").style.display=this.slideshowIsRunning?"inline":"none",document.querySelector("#pswp__icn-play").style.display=this.slideshowIsRunning?"none":"inline",document.querySelector(".pswp__progress-bar").style.opacity=this.options.autoHideProgressBar?null:1,this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=document.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=document.querySelector(".pswp__progress-bar");t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running")}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},O={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function R(t){return t&&t.data&&"video"===t.data.type}var P=class{constructor(t,e){this.options=e,this.initLightboxEvents(t),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initLightboxEvents(t){t.on("contentLoad",this.onContentLoad.bind(this)),t.on("contentDestroy",this.onContentDestroy.bind(this)),t.on("contentActivate",this.onContentActivate.bind(this)),t.on("contentDeactivate",this.onContentDeactivate.bind(this)),t.on("contentAppend",this.onContentAppend.bind(this)),t.on("contentResize",this.onContentResize.bind(this)),t.addFilter("isKeepingPlaceholder",this.isKeepingPlaceholder.bind(this)),t.addFilter("isContentZoomable",this.isContentZoomable.bind(this)),t.addFilter("useContentPlaceholder",this.useContentPlaceholder.bind(this)),t.addFilter("domItemData",(t,e,n)=>("video"===t.type&&n&&(n.dataset.pswpVideoSources?t.videoSources=JSON.parse(n.dataset.pswpVideoSources):n.dataset.pswpVideoSrc?t.videoSrc=n.dataset.pswpVideoSrc:t.videoSrc=n.href),t))}initPswpEvents(t){t.on("pointerDown",e=>{const n=t.currSlide;if(R(n)&&this.options.preventDragOffset){const i=e.originalEvent;if("pointerdown"===i.type){const s=Math.ceil(n.height*n.currZoomLevel)+n.bounds.center.y,o=i.pageY-t.offset.y;o>s-this.options.preventDragOffset&&o<s&&e.preventDefault()}}}),t.on("appendHeavy",t=>{R(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{R(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){R(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if(R(t.content)){t.preventDefault();const e=t.width,n=t.height,i=t.content;if(i.element&&(i.element.style.width=`${e}px`,i.element.style.height=`${n}px`),i.slide&&i.slide.placeholder){const t=i.slide.placeholder.element.style;t.transform="none",t.width=`${e}px`,t.height=`${n}px`}}}isKeepingPlaceholder(t,e){return!R(e)&&t}isContentZoomable(t,e){return!R(e)&&t}onContentActivate({content:t}){R(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){R(t)&&this.pauseVideo(t)}onContentAppend(t){R(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if(R(t.content)&&(t.preventDefault(),!e.element)){if(e.state="loading",e.type="video",e.element=document.createElement("video"),this.options.videoAttributes)for(let t in this.options.videoAttributes)e.element.setAttribute(t,this.options.videoAttributes[t]||"");e.element.setAttribute("poster",e.data.msrc),this.preloadVideoPoster(e,e.data.msrc),e.element.style.position="relative",e.element.style.left=0,e.element.style.top=0,e.data.videoSources?e.data.videoSources.forEach(t=>{let n=document.createElement("source");n.src=t.src,n.type=t.type,e.element.appendChild(n)}):e.data.videoSrc&&(e.element.src=e.data.videoSrc)}}preloadVideoPoster(t,e){!t._videoPosterImg&&e&&(t._videoPosterImg=new Image,t._videoPosterImg.src=e,t._videoPosterImg.complete?t.onLoaded():t._videoPosterImg.onload=t._videoPosterImg.onerror=()=>{t.onLoaded()})}playVideo(t){t.element&&t.element.play()}pauseVideo(t){t.element&&t.element.pause()}useContentPlaceholder(t,e){return!!R(e)||t}},$=class{constructor(t,e={}){new P(t,{...O,...e})}},D=({open:n,ad:s,onClose:o,captureAdClick:r})=>{const a=Boolean(s?.targetType&&s.targetType!==e.At.NONE);return t.Hn(i.se,{open:Boolean(n&&s),onOpenChange:t=>!t&&o?.(),children:t.Hn(i.re,{className:"border-none p-0",children:[t.Hn(i.ae,{className:"hidden",children:[t.Hn(i.he,{children:s?.title}),t.Hn(i.ce,{children:s?.description})]}),t.Hn("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[t.Hn("img",{className:"h-auto w-full object-contain sm:max-h-96",src:s?.imageUrl,alt:"Image not found"}),t.Hn("div",{className:"flex flex-col gap-2 p-3",children:[t.Hn(i.Ut,{variant:"h4",align:"center",lines:2,children:s?.title}),t.Hn(i.Ut,{variant:"body3",color:"secondary",align:"center",lines:4,children:s?.description})]}),a&&t.Hn(i.$t,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(s?._id,s?.targetType??e.At.LINK,s?.targetUrl),o?.()},iconName:e.Ct[s?.targetType]??e.Ct[e.At.LINK],children:s?.targetText})]})]})})},F=({style:s,content:o,curateLink:r,onAdClick:a})=>{const{captureAdImpression:l,captureAdEngagement:c,captureAdClick:d}=i.te(),h=Boolean(r&&a),p=o.ctaBg||"#ff4800",u=o.ctaForeground||"#FFFFFF";return t.Hn("div",{style:s,className:"group relative mb-1 overflow-hidden rounded",children:[t.Hn(n.d,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&l(o._id)},onClick:()=>c(o._id),children:t.Hn(i.Te,{url:o.src||o.imageUrl,thumbnailUrl:o.src||o.imageUrl,blurhash:o.blurhash,alt:o.caption,onClick:h?a:void 0,pswpData:{id:o._id,type:e.ct.AD,hash:o._id,width:o.width,height:o.height,title:o.title,description:o.description,targetType:o.targetType,targetText:o.targetText,targetUrl:o.targetUrl,thumbnailUrl:o.imageUrl,blurhash:o.blurhash}})}),t.Hn("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(o.title||o.targetType!==e.At.NONE)&&t.Hn("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[o.title&&t.Hn("div",{className:"bg-background/60 px-3 py-1",children:t.Hn("h3",{className:"line-clamp-1 text-sm leading-snug font-medium",children:o.title})}),o?.targetType!==e.At.NONE&&t.Hn("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:p,color:u},onClick:()=>{h?a?.():d(o._id,o.targetType,o.targetUrl)},children:[t.Hn(i.jt,{style:{color:u},icon:e.Ct[o?.targetType??e.At.LINK]}),o?.targetText]})]})]})},U=({style:n,gamConfig:s,slotIndex:o,eventId:r,organizationId:a})=>{const l=t.he(null),c=t.he(null),{trackGamAnalytics:d}=i.te(),h=`gam-slot-${r??"ev"}-${o}`,p=Math.max(1,Math.round(n?.width||s.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(n?.height||s.sizes[0]?.[1]||250)),m=t.he({w:p,h:u});return t.pe(()=>{let t=!1,n=null,o=null,p=null,u=null;return(async()=>{await i.Xt(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;i.Qt(h);const{w:g,h:f}=m.current,w=[[g,f],...s.sizes],y=window.googletag.defineSlot(s.adUnitPath,w,h)?.addService(window.googletag.pubads());if(!y)return;c.current=y,o=window.googletag.pubads(),r?y.setConfig({targeting:{qrati_event:r,...s.categories.length>0?{qrati_category:s.categories}:{}}}):s.categories.length>0&&y.setConfig({targeting:{qrati_category:s.categories}}),p=t=>{t.slot===y&&d({eventId:r,organizationId:a,type:e.ut.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},o.addEventListener("slotRenderEnded",p),u=t=>{t.slot===y&&d({eventId:r,organizationId:a,type:e.ut.GAM_VIEWABLE})},o.addEventListener("impressionViewable",u);const v=l.current;v&&(n=i.ee({container:v,onClick:()=>{d({eventId:r,organizationId:a,type:e.ut.GAM_CLICK})}}),i.Yt(),window.googletag.display(h))})})(),()=>{t=!0,n?.(),o&&"function"==typeof o.removeEventListener&&(p&&o.removeEventListener("slotRenderEnded",p),u&&o.removeEventListener("impressionViewable",u));const e=c.current;c.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[r,s.adUnitPath,s.categories,a,h]),t.Hn("div",{style:{width:p,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":o,children:t.Hn("div",{id:h,ref:l,style:{width:p,height:u},className:"gam-ad-slot"})})},j=t.J(null),W=()=>{const e=t.ge(j);if(!e)throw new Error("Popover components must be used within a Popover");return e},G=({children:n,className:i,open:s,onOpenChange:o})=>{const[r,a]=t.fe(!1),l="boolean"==typeof s,c=l?s:r,d=t.Ce(),h=`popover-trigger-${d}`,p=`popover-content-${d}`,u=t.he(null);return t.Hn(j.Provider,{value:{isOpen:c,setIsOpen:t=>{l||a(t),o?.(t)},triggerId:h,contentId:p,triggerRef:u},children:t.Hn("div",{"data-slot":"popover",className:e.ln("relative inline-block",i),children:n})})},K=({children:e,asChild:n,className:i,onClick:s,...o})=>{const{isOpen:r,setIsOpen:a,triggerId:l,contentId:c,triggerRef:d}=W();if(n){const n=Array.isArray(e)?e[0]:e;if(n&&n.type){const e=n.props?.className;return t.G(n,{ref:t=>{d.current=t},id:l,className:i?e?`${e} ${i}`:i:e,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{a(!r),n.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}return t.Hn("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:i,onClick:t=>{a(!r),s?.(t)},...o,children:e})},Y=({children:n,className:i,align:s="center",side:o="top",sideOffset:r=4,...a})=>{const{isOpen:l,setIsOpen:c,contentId:d,triggerRef:h}=W(),{organization:p,portalContainer:u}=e.vn(),m=t.he(null),[g,f]=t.fe(null);if(t.de(()=>{if(!l)return;const t=()=>{if(!h.current||!m.current)return;const t=h.current.getBoundingClientRect(),e=m.current.getBoundingClientRect();let n=t.left,i=t.bottom+r;"center"===s&&(n=t.left+t.width/2-e.width/2),"end"===s&&(n=t.right-e.width),"top"===o&&(i=t.top-e.height-r),"left"===o&&(n=t.left-e.width-r,i=t.top+t.height/2-e.height/2),"right"===o&&(n=t.right+r,i=t.top+t.height/2-e.height/2),"bottom"===o&&(i=t.bottom+r),f({top:i,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[s,l,o,r,h]),t.pe(()=>{if(!l)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=m.current&&(m.current.contains(n)||e.includes(m.current)),s=h.current&&(h.current.contains(n)||e.includes(h.current));i||s||c(!1)},e=t=>{"Escape"===t.key&&(c(!1),h.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[l,c,h]),!l)return null;const w=t.Hn("div",{ref:m,id:d,role:"dialog","aria-modal":"false","data-state":l?"open":"closed",className:e.ln("bg-background text-foreground border-border shadow-outer rounded outline-none",i),style:{position:"fixed",top:g?.top??0,left:g?.left??0,zIndex:2010,...e.dn(p)},...a,children:n});return"undefined"!=typeof document?t._n(w,u??document.body):w},Q=({eventId:n,contentId:o,emojis:r=[],counts:a={},userReaction:l})=>{const{user:c,props:d,organization:h}=e.vn(),p=d?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const n=e.be(),{props:o,user:r}=e.vn(),a=o?.organizationId,l=function(n){const i=e.be(void 0),[o]=t.fe(()=>new s(i,n));t.pe(()=>{o.setOptions(n)},[o,n]);const r=t.He(t.ye(t=>o.subscribe(e.Z.batchCalls(t)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),a=t.ye((t,n)=>{o.mutate(t,n).catch(e.T)},[o]);if(r.error&&e.H(o.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}({mutationFn:async({eventId:t,contentId:n,emoji:i})=>{await e.rt.post(e.it.UPDATE_REACTION,{json:{eventId:t,contentId:n,reaction:i},headers:{"x-org-id":a,Authorization:`Bearer ${r?.token}`}})},onMutate:async({eventId:t,contentId:i,emoji:s})=>{const o=[e.Pt.CONTENTS_BY_EVENT(t)];await n.cancelQueries({queryKey:o});const r=n.getQueriesData({queryKey:o});return n.setQueriesData({queryKey:o},t=>((t,e,n)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,i,s)),{previousData:r}},onError:(t,e,s)=>{s?.previousData?.forEach(([t,e])=>{n.setQueryData(t,e)}),i.Ce.error("Failed to add reaction"),console.error("Error handling reaction click:",t,e)},onSettled:async(t,i,s)=>{await n.invalidateQueries({queryKey:[e.Pt.CONTENTS_BY_EVENT(s.eventId)]})}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!r)return i.Ce.error("Please login to react"),!1;try{return await l.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(s){return!1}},isPending:l.isPending}})(),[g,f]=t.fe(!1),[w,y]=t.fe(null),v=t.he(null),b=Object.values(a).reduce((t,e)=>t+e,0);return t.pe(()=>()=>{v.current&&clearTimeout(v.current)},[]),t.Hn(G,{open:g,onOpenChange:f,children:[t.Hn(K,{asChild:!0,children:t.Hn("button",{type:"button",className:e.ln("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",w&&"scale-[1.03] shadow-sm"),children:[(r||[]).slice().sort((t,e)=>(a[e]||0)-(a[t]||0)).slice(0,1).map(n=>t.Hn("span",{className:e.ln("text-sm transition-transform duration-150 ease-out sm:text-lg",w===(l||n)&&"scale-125"),children:l||n},`${o}-${n}-1`)),b>0&&t.Hn("span",{className:"text-xs font-bold sm:text-sm",children:b||0})]})}),t.Hn(Y,{side:"top",align:"end",children:[c?null:t.Hn("div",h?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",t.Hn("a",{className:"text-info underline",href:p,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",t.Hn(e.la,{className:"text-info underline",to:e.nt.LOGIN,children:"Login"})," ","to react"]}),c&&t.Hn("div",{className:"flex gap-1 p-2",children:r.map(i=>{const s=l===i;return t.Hn("div",{className:"flex flex-col items-center",children:[t.Hn("span",{className:"text-xs font-medium",children:a[i]||0}),t.Hn("button",{type:"button",disabled:m,className:e.ln("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",s?"scale-125":"hover:scale-110",w===i&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async t=>{!m&&u&&(y(t),f(!1),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>y(null),180),u(n,o,t))})(i),children:i})]},`${o}-${i}-2`)})})]})]})},Z=({event:n={},content:s,curateLink:o})=>n.engagementStyle===e.bt.CONTEST?t.Hn("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[t.Hn(i.jt,{name:"material-symbols:star-half-rounded",className:"size-4"}),t.Hn("span",{className:"text-xs font-semibold",children:parseFloat(String(s.score||0)).toFixed(1)})]}):n.engagementStyle===e.bt.REACTION&&n.reactionEmojis?.length?t.Hn(Q,{eventId:n?._id,contentId:s._id,emojis:n?.reactionEmojis,engagementStyle:n?.engagementStyle,counts:s.reactionCounts||{},userReaction:s.userReaction}):null,J=({content:e})=>t.Hn("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&t.Hn("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:t.Hn("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),t.Hn("div",{className:"flex items-center justify-between",children:t.Hn("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:e?.user?.name})})]}),X=({event:n,content:s,style:o,timestampField:r,curateLink:a,onChangeFaceUrl:l,hideControls:c})=>{const{organization:d}=e.vn(),h=`content-${s._id}`,p=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(r,s);return t.Hn("div",{id:h,style:o,className:"group relative mb-1 overflow-hidden rounded",children:[t.Hn(i.Te,{url:s.src,alt:s.caption,blurhash:s.blurhash,thumbnailUrl:s.thumbnailUrl,curateLink:a,pswpData:{id:s._id,type:e.ct.IMAGE,hash:s._id,width:s.width,height:s.height,thumbnailUrl:s.thumbnailUrl,blurhash:s.blurhash,caption:s.caption,contentSummary:JSON.stringify(s.contentSummary)}}),!c&&t.Hn(t.E,{children:[p&&t.Hn("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:p}),d?.integrationSettings?.showQuickSearch&&(s.faces?.length??0)>0&&t.Hn("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:()=>{l?.(s?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:t.Hn(i.jt,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),t.Hn("div",{className:"",children:[t.Hn("div",{className:"absolute bottom-0 w-full rounded-b",children:t.Hn(J,{content:s})}),t.Hn("div",{className:"absolute right-2 bottom-2",children:t.Hn(Z,{event:n,content:s,curateLink:a})})]})]})]})},tt=({content:n,style:s,event:o,timestampField:r,curateLink:a,hideControls:l})=>{const c=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(r,n);return t.Hn("div",{id:`content-${n._id}`,className:"group relative mb-1 overflow-hidden rounded",style:s,children:[t.Hn(i.Te,{url:n.src??n.url,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,alt:n.caption,curateLink:a,pswpData:{id:n._id,type:e.ct.VIDEO,hash:n._id,width:n.width,height:n.height,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,caption:n.caption}}),!l&&t.Hn("div",{className:"transition-opacity duration-500",children:[c&&t.Hn("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:c}),t.Hn("div",{className:"absolute bottom-0 w-full rounded-b",children:t.Hn(J,{content:n})}),t.Hn("div",{className:"absolute right-2 bottom-2",children:t.Hn(Z,{event:o,content:n,curateLink:a})})]})]})};exports.default=({event:n,contents:s=[],gamConfig:o,singleColumnMode:r,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:d})=>{const h=t.he(null),p=t.he(null),u=t.me(()=>`gallery-${n?._id??""}`,[n]),{captureAdImpression:m,captureAdClick:g}=i.te(),{organization:f,portalContainer:w}=e.vn(),y=f?._id,[v,b]=t.fe(null);t.pe(()=>{const t=p.current;if(!c&&t){const e=new i.si({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:i.Ni,appendToEl:w??document.body});h.current=e,new $(e),new B(e),new H(e),new N(e,m,g),new V(e),new z(e),f?.integrationSettings?.showAIDescription&&new I(e,{width:"400px",height:"40%"}),e.init()}return()=>{h.current?.destroy?.(),h.current=null}},[n?.galleryLayout,c,g,m,u,f]);const x=t.me(()=>{switch(n?.galleryLayout){case e.dt.ROW:return T;case e.dt.COLUMN:return q;case e.dt.MASONRY:return S;default:return T}},[r,n?.galleryLayout]);return t.Hn(t.E,{children:[t.Hn("div",{id:u,ref:p,className:e.ln(r?"w-full lg:w-1/3":"w-full"),children:t.Hn(x,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return r&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>r?1:t<400?2:t<800?3:4,photos:s.map(t=>({src:t.type===e.ct.IMAGE||t.type===e.ct.VIDEO?t.url:t.type===e.ct.GAM_AD?"":t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t})),render:{container:({ref:e,className:n,children:i})=>t.Hn("div",{ref:e,className:n??"",children:i}),photo:(i,{photo:s,width:r,height:h,index:p})=>{const u=s;let m=null;switch(u.type){case e.ct.IMAGE:m=X;break;case e.ct.VIDEO:m=tt;break;case e.ct.AD:m=F;break;case e.ct.GAM_AD:return o?t.Hn(U,{style:{width:r,height:h},gamConfig:o,slotIndex:u.slotIndex??p,eventId:n?._id,organizationId:y},`${u._id??p}-${p}`):null;default:m=null}return m&&t.Hn(m,{style:{width:r,height:h},event:n,content:u,timestampField:l,onAdClick:c?()=>b(u):void 0,hideControls:a,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:d},`${u._id??p}-${p}`)}}})}),t.Hn(D,{open:Boolean(v),ad:v,onClose:()=>b(null),captureAdClick:g})]})};
|
|
1
|
+
const t=require("./iDVNWJcT-Bf_I6ltO.js"),e=require("./BhA6mkqA-C2OnXTXV.js"),n=require("./C5R-Kmjo-Cb0SK-aw.js"),i=require("./BeqcQjGf-BiJhtnLB.js");var s=class extends e.v{#t;#e=void 0;#n;#i;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),e.M(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&e.L(n.mutationKey)!==e.L(this.options.mutationKey)?this.reset():"pending"===this.#n?.state.status&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,e){return this.#i=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??n.u();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#o(t){e.Z.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,i=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{this.#i.onSuccess?.(t.data,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(t.data,null,n,i,s)}catch(e){Promise.reject(e)}}else if("error"===t?.type){try{this.#i.onError?.(t.error,n,i,s)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(void 0,t.error,n,i,s)}catch(e){Promise.reject(e)}}}this.listeners.forEach(t=>{t(this.#e)})})}};function o(t){return["react-photo-album",t].filter(Boolean).join("--")}function r({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var a=Object.freeze([1200,600,300,0]);function l(t,e){return"function"==typeof t?t(e):t}function c(t,e){return void 0!==e?l(t,e):void 0}function d(t,e,n,i=0){if(void 0===e)return;const s=c(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=a.findIndex(t=>t<=e);return l(t[Math.max(n,0)],e)}(n,e):s,i))}function h(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:d(e,t,[20,15,10,5]),padding:d(n,t,[0,0,0,0]),componentsProps:l(i,t)||{},render:l(s,t)}}function p(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function u(t,e,n,i,s,o,r){let a,l;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${p((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(a=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),l=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:a,sizes:l}}var m=t.Be(function({as:e,render:n,context:i,classes:s=[],variables:r={},style:a,className:l,children:c,...d},h){const u=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(s)?s:[s]).filter(t=>"string"==typeof t).map(o),l),m={style:{...Object.fromEntries(Object.entries(r).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${o(n)}`),"number"==typeof e?p(e,5):e];var n})),...a},className:u,children:c,...d};if(n){const t=n({ref:h,...m},i);if(t)return t}return t.Hn(e||"div",{ref:h,...m})}),g=t.Be(function({photo:e,index:n,width:i,height:s,onClick:o,render:{wrapper:r,link:a,button:l,image:c,extras:d}={},componentsProps:{link:h,button:u,wrapper:g,image:f}={}},w){const{href:y}=e,v={photo:e,index:n,width:p(i,3),height:p(s,3)};let b;return b=y?{...h,as:"a",render:a,classes:["photo","link"],href:y,onClick:o}:o?{...u,as:"button",type:"button",render:l,classes:["photo","button"],onClick:o}:{...g,render:r,classes:"photo"},t.Hn(m,{ref:w,variables:{photoWidth:v.width,photoHeight:v.height},context:v,...b,children:[t.Hn(m,{as:"img",classes:"image",render:c,context:v,...f}),d?.({},v)]})}),f=t.Be(function({layout:e,sizes:n,model:i,skeleton:s,onClick:o,render:{container:r,track:a,photo:c,...d}={},componentsProps:{container:h,track:p,link:f,button:w,wrapper:y,image:v}={}},b){const{spacing:T,padding:x,containerWidth:_,tracks:q,variables:k,horizontal:S}=i||{};return t.Hn(m,{role:"group","aria-label":"Photo album",...h,variables:{spacing:T,padding:x,containerWidth:_,...k},classes:["",e],render:r,ref:b,children:[void 0!==T&&void 0!==x&&void 0!==_&&q?.map(({photos:e,variables:i},s)=>{const r=e.length,h=S?r:q.length;return t.C(m,{...p,key:s,render:a,classes:"track",variables:{trackSize:r,...i}},e.map(e=>{const{photo:i,index:s,width:r}=e,{key:a,src:p,alt:m="",title:b,label:q}=i,k=o?t=>{o({event:t,photo:i,index:s})}:void 0;if(c){const t=c({onClick:k},e);if(t)return t}const S=t=>q?{"aria-label":q,...t}:t;return t.Hn(g,{onClick:k,render:d,componentsProps:{image:{loading:"lazy",decoding:"async",src:p,alt:m,title:b,...u(i,n,r,_,h,T,x),...l(v,e)},link:S(l(f,e)),button:S(l(w,e)),wrapper:l(y,e)},...e},a??s)}))}),void 0===_&&s]})});function w(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+r(e),0)}function y(t,e,n,i,s,o,r){const a=t.slice(e,n),l=w(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}function v(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function b(e,n,i){const[[s],o]=t.se(v,[i]),r=function(e){const[n,i]=t.fe(e);return e===n||e&&n&&e.length===n.length&&!e.some((t,e)=>t!==n[e])?n:(i(e),e)}(n),a=t.he(void 0);return{containerRef:t.ye(t=>{a.current?.disconnect(),a.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(t,r));n(),t&&"undefined"!=typeof ResizeObserver&&(a.current=new ResizeObserver(n),a.current.observe(t)),"function"==typeof e?e(t):e&&(e.current=t)},[e,r]),containerWidth:s}}var T=t.Be(function({photos:e,breakpoints:n,defaultContainerWidth:i,...s},o){const{containerRef:a,containerWidth:l}=b(o,n,i),{spacing:u,padding:m,targetRowHeight:g,minPhotos:v,maxPhotos:T,...x}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=h(t,s),{singleRowMaxHeight:p,minPhotos:u,maxPhotos:m}=c(i,t)||{};if(void 0!==p&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*p+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:d(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:u,maxPhotos:m,componentsProps:a}}(l,{photos:e,...s});return t.Hn(f,{layout:"rows",ref:a,model:t.me(()=>void 0!==l&&void 0!==u&&void 0!==m&&void 0!==g?function(t,e,n,i,s,o,a){const l=Math.min(function(t,e,n,i){return p(e/n/Math.min(...t.map(t=>r(t))))+(i||0)+2}(t,i,s,o),a||1/0),c=o||1,d=t.length,h=new Array(d+1).fill(1/0),u=new Array(d+1).fill(-1);h[0]=0;for(let r=1;r<=d;r+=1)for(let o=r-c;o>=Math.max(0,r-l);o-=1){if(h[o]===1/0)continue;const a=y(t,o,r,i,e,n,s);if(void 0===a)break;const l=h[o]+a;(h[r]===1/0||h[r]>l&&(h[r]/l>1.005||-1!==u[r]&&u[r]<o))&&(h[r]=l,u[r]=o)}if(h[d]===1/0)return;const m=[];for(let r=d;0!==r;r=u[r])m.push(r);m.push(0),m.reverse();const g=[];for(let p=1;p<m.length;p+=1){const s=t.slice(m[p-1],m[p]).map((t,e)=>({photo:t,index:m[p-1]+e})),o=w(s.map(({photo:t})=>t),i,e,n);g.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*r(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:g,horizontal:!0}}(e,u,m,l,g,v,T):void 0,[e,u,m,l,g,v,T]),...x})});function x(t,e,n,i,s,o,a){const l=[],c=a.reduce((t,e)=>t+e,0);for(let d=0;d<t.length-1;d+=1){const h=e.slice(t[d],t[d+1]).map((e,n)=>({photo:e,index:t[d]+n})),p=a.reduce((t,e,n)=>t+(o[d]-o[n])*e,0),u=(s-(t.length-2)*n-2*(t.length-1)*i-p)*a[d]/c;l.push({photos:h.map(({photo:t,index:e})=>({photo:t,index:e,width:u,height:u/r(t)})),variables:{adjustedGaps:p,columnRatio:a[d]}})}return{tracks:l,variables:{totalRatio:c}}}function _(t,e,n,i,s){const{tracks:o,variables:a}=function(t,e,n,i,s,o){const a=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+r(e),0)/t.length:1;for(let e=0;e<o;e+=1)a[e]=2*n,l[e]=e<t.length?r(t[e]):s;return x(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,a,l)}const c=(d=function(t,e,n,i,s){return o=>{const a=[],l=1.5*s;let c=i/r(t[o])+2*n;for(let d=o+1;d<t.length+1&&(a.push([d,(s-c)**2]),!(c>l||d===t.length));d+=1)c+=i/r(t[d])+e+2*n;return a}}(t,e,n,s,(t.reduce((t,e)=>t+s/r(e),0)+e*(t.length-o)+2*n*t.length)/o),function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=new Map,o=new Set;o.add(0);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const a=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,l])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=a+l,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(d,h=o,0,p=t.length),h,p));var d,h,p;for(let u=0;u<c.length-1;u+=1){const i=t.slice(c[u],c[u+1]);a[u]=e*(i.length-1)+2*n*i.length,l[u]=1/i.reduce((t,e)=>t+1/r(e),0)}return x(c,t,e,n,i,a,l)}(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?_(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...a}}}var q=t.Be(function({photos:e,breakpoints:n,defaultContainerWidth:i,...s},o){const{containerRef:r,containerWidth:a}=b(o,n,i),{spacing:l,padding:c,columns:p,...u}=function(t,{columns:e,...n}){return{...n,...h(t,n),columns:d(e,t,[5,4,3,2],1)}}(a,{photos:e,...s});return t.Hn(f,{layout:"columns",ref:r,model:t.me(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==p?_(e,l,c,a,p):void 0,[e,l,c,a,p]),...u})});function k(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?k(t,e,n,i,s-1):void 0;const a=[];for(let r=0;r<s;r+=1)a[r]=0;const l=t.reduce((t,i,s)=>{const l=a.reduce((t,e,n)=>e<a[t]-1?n:t,0);return a[l]=a[l]+o/r(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/r(t)}))}))}}var S=t.Be(function({photos:e,breakpoints:n,defaultContainerWidth:i,...s},o){const{containerRef:r,containerWidth:a}=b(o,n,i),{spacing:l,padding:c,columns:p,...u}=function(t,{columns:e,...n}){return{...n,...h(t,n),columns:d(e,t,[5,4,3,2],1)}}(a,{photos:e,...s});return t.Hn(f,{layout:"masonry",ref:r,model:t.me(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==p?k(e,l,c,a,p):void 0,[e,l,c,a,p]),...u})});function E(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var I=class{constructor(t,e={}){this.lightbox=t,this.aiSummaryVisible=!1,this.currentSummary=null,this.options={aiSummaryButtonOrder:7,width:"400px",height:"300px",transition:"0.3s ease",...e},document.head.insertAdjacentHTML("beforeend",`<style>\n .pswp__ai-summary-panel {\n background: rgba(30, 30, 30, 0.9);\n color: white;\n position: absolute;\n overflow-y: auto;\n z-index: 1;\n transition: transform ${this.options.transition};\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);\n padding: 20px;\n }\n\n /* Desktop styles */\n @media (min-width: 768px) {\n .pswp__ai-summary-panel {\n top: 0;\n right: 0;\n height: 100%;\n width: ${this.options.width};\n transform: translateX(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateX(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateX(-${this.options.width});\n transition: transform ${this.options.transition};\n }\n }\n\n /* Mobile styles */\n @media (max-width: 767px) {\n .pswp__ai-summary-panel {\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${this.options.height};\n transform: translateY(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateY(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateY(-${this.options.height});\n transition: transform ${this.options.transition};\n }\n }\n\n .pswp__ai-summary-close {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 32px;\n height: 32px;\n opacity: 0.6;\n cursor: pointer;\n z-index: 2;\n background: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.3s;\n }\n\n .pswp__ai-summary-close:hover {\n opacity: 1;\n }\n\n .pswp__ai-summary-close:before,\n .pswp__ai-summary-close:after {\n position: absolute;\n content: '';\n width: 16px;\n height: 2px;\n background-color: white;\n }\n\n .pswp__ai-summary-close:before {\n transform: rotate(45deg);\n }\n\n .pswp__ai-summary-close:after {\n transform: rotate(-45deg);\n }\n\n .pswp__ai-summary-content {\n margin-top: 20px;\n }\n\n .pswp__ai-summary-title {\n margin-bottom: 16px;\n font-size: 18px;\n font-weight: bold;\n padding-right: 30px; /* Add space for the close button */\n }\n\n .pswp__ai-summary-section {\n margin-bottom: 16px;\n }\n\n .pswp__ai-summary-section-title {\n font-weight: bold;\n margin-bottom: 8px;\n }\n\n .pswp__ai-summary-label {\n display: inline-flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n padding: 4px 12px;\n margin-right: 8px;\n margin-bottom: 8px;\n font-size: 14px;\n }\n\n .pswp__ai-summary-description {\n font-size: 14px;\n line-height: 1.5;\n }\n\n .pswp__ai-summary-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n font-style: italic;\n }\n\n .pswp__ai-summary-bing-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n z-index: 2;\n }\n\n .pswp__ai-summary-bing-button {\n height: 32px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.3s;\n }\n\n .pswp__ai-summary-bing-button:hover {\n background: rgba(255, 255, 255, 0.4);\n }\n\n .pswp__ai-summary-bing-icon {\n width: 20px;\n height: 20px;\n }\n\n .pswp__ai-summary-disclaimer {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n text-align: center;\n margin-top: 32px;\n padding: 0 10px;\n line-height: 1.4;\n font-style: italic;\n }\n </style>`),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"ai-summary-toggle-button",title:"Toggle AI summary view",order:this.options.aiSummaryButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24">\n <use class="pswp__icn-shadow" xlink:href="#pswp__icn-ai-summary"/>\n <path d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11t-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/>\n </svg>',onClick:()=>{this.toggleAISummary(t)}}),t.ui.registerElement({name:"ai-summary-panel",isButton:!1,appendTo:"root",html:'<div class="pswp__ai-summary-panel"><div class="pswp__ai-summary-close"></div></div>'})}),t.on("change",()=>{this.aiSummaryVisible&&this.updateAISummary(t)}),t.on("close",()=>{this.hideAISummary(t)}),t.on("firstUpdate",()=>{const e=t.element.querySelector(".pswp__ai-summary-close");e&&e.addEventListener("click",()=>{this.hideAISummary(t)})})}toggleAISummary(t){this.aiSummaryVisible?this.hideAISummary(t):this.showAISummary(t)}showAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!0,n.classList.add("visible"),e.classList.add("shifted-for-ai-summary"),this.updateAISummary(t))}hideAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!1,n.classList.remove("visible"),e.classList.remove("shifted-for-ai-summary"))}updateAISummary(t){if(!t.currSlide)return;const e=t.element.querySelector(".pswp__ai-summary-panel");if(!e)return;const n=t.currSlide.data,i=n.src||n.url||"";let s=null;try{n.contentSummary&&(s=JSON.parse(n.contentSummary),this.currentSummary=s)}catch(r){console.error("Error parsing AI summary data:",r)}const o=i?`<a class="pswp__ai-summary-bing-search" href="https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${encodeURIComponent(i)}&idpbck=1&selectedindex=0&id=${encodeURIComponent(i)}&mediaurl=${encodeURIComponent(i)}" target="_blank" rel="noopener noreferrer" class="pswp__ai-summary-bing-button">\n <svg xmlns="http://www.w3.org/2000/svg" style="height:24px;width:24px" width="256" height="388" viewBox="0 0 256 388"><defs><radialGradient id="logosBing0" cx="93.717%" cy="77.818%" r="143.121%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.71954)rotate(49.091 2.036 -2.204)"><stop offset="0%" stop-color="#00cacc"/><stop offset="100%" stop-color="#048fce"/></radialGradient><radialGradient id="logosBing1" cx="13.893%" cy="71.448%" r="150.086%" fx="13.893%" fy="71.448%" gradientTransform="matrix(.55155 -.39387 .23634 .91917 -.107 .112)"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></radialGradient><linearGradient id="logosBing2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></linearGradient></defs><path fill="url(#logosBing0)" d="M129.424 122.047c-7.133.829-12.573 6.622-13.079 13.928c-.218 3.147-.15 3.36 6.986 21.722c16.233 41.774 20.166 51.828 20.827 53.243c1.603 3.427 3.856 6.65 6.672 9.544c2.16 2.22 3.585 3.414 5.994 5.024c4.236 2.829 6.337 3.61 22.818 8.49c16.053 4.754 24.824 7.913 32.381 11.664c9.791 4.86 16.623 10.387 20.944 16.946c3.1 4.706 5.846 13.145 7.04 21.64c.468 3.321.47 10.661.006 13.663c-1.008 6.516-3.021 11.976-6.101 16.545c-1.638 2.43-1.068 2.023 1.313-.939c6.74-8.379 13.605-22.7 17.108-35.687c4.24-15.718 4.817-32.596 1.66-48.57c-6.147-31.108-25.786-57.955-53.444-73.06c-1.738-.95-8.357-4.42-17.331-9.085a1633 1633 0 0 1-4.127-2.154c-.907-.477-2.764-1.447-4.126-2.154c-1.362-.708-5.282-2.75-8.711-4.539l-8.528-4.446a6021 6021 0 0 1-8.344-4.357c-8.893-4.655-12.657-6.537-13.73-6.863c-1.125-.343-3.984-.782-4.701-.723c-.152.012-.838.088-1.527.168"/><path fill="url(#logosBing1)" d="M148.81 277.994c-.493.292-1.184.714-1.537.938c-.354.225-1.137.712-1.743 1.083a8315 8315 0 0 0-13.204 8.137a2848 2848 0 0 0-8.07 4.997a388 388 0 0 1-3.576 2.198c-.454.271-2.393 1.465-4.31 2.654a2652 2652 0 0 1-7.427 4.586a3958 3958 0 0 0-8.62 5.316a3011 3011 0 0 1-7.518 4.637c-1.564.959-3.008 1.885-3.21 2.058c-.3.257-14.205 8.87-21.182 13.121c-5.3 3.228-11.43 5.387-17.705 6.235c-2.921.395-8.45.396-11.363.003c-7.9-1.067-15.176-4.013-21.409-8.666c-2.444-1.826-7.047-6.425-8.806-8.8c-4.147-5.598-6.829-11.602-8.218-18.396c-.32-1.564-.622-2.884-.672-2.935c-.13-.13.105 2.231.528 5.319c.44 3.211 1.377 7.856 2.387 11.829c7.814 30.743 30.05 55.749 60.15 67.646c8.668 3.424 17.415 5.582 26.932 6.64c3.576.4 13.699.56 17.43.276c17.117-1.296 32.02-6.334 47.308-15.996c1.362-.86 3.92-2.474 5.685-3.585a877 877 0 0 0 4.952-3.14c.958-.615 2.114-1.341 2.567-1.614a91 91 0 0 0 2.018-1.268c.656-.424 3.461-2.2 6.235-3.944l11.092-7.006l3.809-2.406l.137-.086l.42-.265l.199-.126l2.804-1.771l9.69-6.121c12.348-7.759 16.03-10.483 21.766-16.102c2.392-2.342 5.997-6.34 6.176-6.848c.037-.104.678-1.092 1.424-2.197c3.036-4.492 5.06-9.995 6.064-16.484c.465-3.002.462-10.342-.005-13.663c-.903-6.42-2.955-13.702-5.167-18.339c-3.627-7.603-11.353-14.512-22.453-20.076c-3.065-1.537-6.23-2.943-6.583-2.924c-.168.009-10.497 6.322-22.954 14.03c-12.457 7.71-23.268 14.4-24.025 14.87s-2.056 1.263-2.888 1.764z"/><path fill="url(#logosBing2)" d="m.053 241.013l.054 53.689l.695 3.118c2.172 9.747 5.937 16.775 12.482 23.302c3.078 3.07 5.432 4.922 8.768 6.896c7.06 4.177 14.657 6.238 22.978 6.235c8.716-.005 16.256-2.179 24.025-6.928c1.311-.801 6.449-3.964 11.416-7.029l9.032-5.572v-127.4l-.002-58.273c-.002-37.177-.07-59.256-.188-60.988c-.74-10.885-5.293-20.892-12.948-28.461c-2.349-2.323-4.356-3.875-10.336-7.99a25160 25160 0 0 1-12.104-8.336L28.617 5.835C22.838 1.85 22.386 1.574 20.639.949C18.367.136 15.959-.163 13.67.084C6.998.804 1.657 5.622.269 12.171C.053 13.191.013 26.751.01 100.35l-.003 86.975H0z"/></svg>\n <span>Search on Bing</span>\n </a>\n <div class="pswp__ai-summary-disclaimer">\n These are AI generated summaries based on the content. Please verify the information before using it.\n </div>`:"";if(s){e.innerHTML=`<div class="pswp__ai-summary-close"></div>${this.renderAISummary(s)}${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}else{e.innerHTML=`<div class="pswp__ai-summary-close"></div><div class="pswp__ai-summary-empty">No AI summary available for this content</div>${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}}renderAISummary(t){let e='<div class="pswp__ai-summary-content">';return t.subject&&(e+=`<div class="pswp__ai-summary-title">${E(t.subject)}</div>`),t.labels&&Object.entries(t.labels).filter(([t,e])=>Array.isArray(e)&&e.length>0).forEach(([t,n])=>{e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-section-title">${E(t.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()))}</div>\n <div class="pswp__ai-summary-labels space-y-2">\n ${n.map(t=>`<span class="pswp__ai-summary-label">${E(t)}</span>`).join("")}\n </div>\n </div>\n `}),t.description&&(e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-description">${E(t.description)}</div>\n </div>\n `),e+="</div>",e}},C='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',H=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=C,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=C,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0),document.querySelector("#pswp__icn-hide-backdrop").style.display=this.backdropOn?"none":"inline",document.querySelector("#pswp__icn-show-backdrop").style.display=this.backdropOn?"inline":"none"}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const s=n.x(t,e,i),o=document.createElement("canvas");o.width=e,o.height=i;const r=o.getContext("2d");if(!r)return null;const a=r.createImageData(e,i);return a.data.set(s),r.putImageData(a,0,0),o.toDataURL()}catch(s){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",s),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:C,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}};function A(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var L={[e.At.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[e.At.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[e.At.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[e.At.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[e.At.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[e.At.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" d="M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"/><path fill="#fff" d="m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"/></svg>'},N=class{constructor(t,e,n){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=n,this.captionOn=!0,this.options={captionButtonOrder:8},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full bg-transparent"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),n=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),n&&(n.style.display=this.captionOn?"none":"inline")}createCaptionHTML(t){const{id:n,type:i,caption:s,title:o,description:r,targetType:a,targetText:l,targetUrl:c}=t||{},d=Boolean(a)&&String(a)!==String(e.At.NONE),h=d?a:e.At.LINK;switch("ad"===i&&this.captureAdImpression&&this.captureAdImpression(n),i){case"image":case"video":return s?.length>0?`\n <div class=" w-full bg-black/50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${A(s)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${A(o)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${A(r)}</h4>\n ${d?`<button\n class=" flex w-full items-center justify-center gap-3 rounded-md bg-white py-1 text-lg text-black caption-action-button"\n data-id="${A(n)}"\n data-target-type="${A(h)}"\n data-target-url="${A(c)}">\n ${L[h]}\n ${A(l)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const n=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(n);const i=e.querySelector(".caption-action-button");i&&i.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,n=t.currentTarget.dataset.targetType,i=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,n,i)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}},M=({contents:i=[],selectedIndex:s,onClick:o})=>{const r=t.he(null);t.pe(()=>{r.current&&a(s)},[s,r.current]);const a=t=>{if(!r.current)return;const e=r.current,n=e.children;if(t<0||t>=n.length)return;const i=n[t],s=e.offsetWidth/2,o=i.offsetLeft+i.offsetWidth/2-s;e.scrollTo({left:o,behavior:"smooth"})};return t.Hn("div",{ref:r,className:"scrollbar-hide flex h-28 w-auto items-center justify-center overflow-x-auto bg-black/50",style:{scrollBehavior:"smooth",userSelect:"none",whiteSpace:"nowrap"},children:i.map((i,r)=>t.Hn("button",{className:"relative mx-0.5 inline-block lg:mx-1.5",onClick:()=>((t,e)=>{o(e)})(0,r),children:[t.Hn(n.X,{wrapperClassName:e.ln("h-16 w-24 rounded-md lg:h-20 lg:w-20",r===s&&"border-2 border-[#ff4800]"),src:i.thumbnailUrl,placeholderSrc:i.blurImageUrl,alt:i.caption}),i.type===e.ct.VIDEO&&t.Hn("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:t.Hn("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:t.Hn("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})}),i.type===e.ct.AD&&t.Hn("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${r}`))})},B=class{constructor(t){this.lightbox=t,this.filmstripVisible=!0,this.options={filmstripButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip view",order:this.options.filmstripButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-show-filmstrip"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-hide-filmstrip" style="display:none"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6"\n />\n <path\n\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n\n ',onClick:()=>{this.toggleFilmstrip()}}),t.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'\n <div id="filmstrip-container" class="w-full absolute bottom-0">\n </div>\n '})}),t.on("change",()=>{this.filmstripVisible&&this.updateFilmstrip(t)}),t.on("close",()=>{this.cleanupFilmstrip()})}onThumbnailClcik(t){this.lightbox.pswp.goTo(t)}updateFilmstrip(e){const n=this.getElementById("filmstrip-container");if(!n)return;t.Y(t.Hn(M,{contents:e?.options?.dataSource?.items?.map(t=>({id:t.getAttribute("data-pswp-id"),type:t.getAttribute("data-pswp-type"),thumbnailUrl:t.getAttribute("data-pswp-thumbnail-url"),blurImageUrl:t.getAttribute("data-pswp-blur-image-url")||t.getAttribute("data-pswp-blurhash")})),selectedIndex:e.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),n);const i=this.getElementById("pswp-caption-container");i&&"7rem"!==i.style.bottom&&(i.style.bottom="7rem")}toggleFilmstrip(){this.filmstripVisible?this.cleanupFilmstrip():this.updateFilmstrip(this.lightbox.pswp),this.filmstripVisible=!this.filmstripVisible;const t=this.querySelector("#pswp__icn-show-filmstrip"),e=this.querySelector("#pswp__icn-hide-filmstrip");t&&(t.style.display=this.filmstripVisible?"inline":"none"),e&&(e.style.display=this.filmstripVisible?"none":"inline")}cleanupFilmstrip(){const e=this.getElementById("filmstrip-container"),n=this.getElementById("pswp-caption-container");n&&(n.style.bottom="0"),e&&t.Y(null,e)}},V=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" 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"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0),document.querySelector("#pswp__icn-exit-fullscreen").style.display=this.fullscreen?"inline":"none",document.querySelector("#pswp__icn-fullscreen").style.display=this.fullscreen?"none":"inline"}},z=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),document.head.insertAdjacentHTML("beforeend",`<style>.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}</style>`),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}init(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" 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"/><path id="pswp__icn-stop" style="display:none" 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"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer()),document.querySelector("#pswp__icn-stop").style.display=this.slideshowIsRunning?"inline":"none",document.querySelector("#pswp__icn-play").style.display=this.slideshowIsRunning?"none":"inline",document.querySelector(".pswp__progress-bar").style.opacity=this.options.autoHideProgressBar?null:1,this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=document.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=document.querySelector(".pswp__progress-bar");t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running")}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},O={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function R(t){return t&&t.data&&"video"===t.data.type}var P=class{constructor(t,e){this.options=e,this.initLightboxEvents(t),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initLightboxEvents(t){t.on("contentLoad",this.onContentLoad.bind(this)),t.on("contentDestroy",this.onContentDestroy.bind(this)),t.on("contentActivate",this.onContentActivate.bind(this)),t.on("contentDeactivate",this.onContentDeactivate.bind(this)),t.on("contentAppend",this.onContentAppend.bind(this)),t.on("contentResize",this.onContentResize.bind(this)),t.addFilter("isKeepingPlaceholder",this.isKeepingPlaceholder.bind(this)),t.addFilter("isContentZoomable",this.isContentZoomable.bind(this)),t.addFilter("useContentPlaceholder",this.useContentPlaceholder.bind(this)),t.addFilter("domItemData",(t,e,n)=>("video"===t.type&&n&&(n.dataset.pswpVideoSources?t.videoSources=JSON.parse(n.dataset.pswpVideoSources):n.dataset.pswpVideoSrc?t.videoSrc=n.dataset.pswpVideoSrc:t.videoSrc=n.href),t))}initPswpEvents(t){t.on("pointerDown",e=>{const n=t.currSlide;if(R(n)&&this.options.preventDragOffset){const i=e.originalEvent;if("pointerdown"===i.type){const s=Math.ceil(n.height*n.currZoomLevel)+n.bounds.center.y,o=i.pageY-t.offset.y;o>s-this.options.preventDragOffset&&o<s&&e.preventDefault()}}}),t.on("appendHeavy",t=>{R(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{R(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){R(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if(R(t.content)){t.preventDefault();const e=t.width,n=t.height,i=t.content;if(i.element&&(i.element.style.width=`${e}px`,i.element.style.height=`${n}px`),i.slide&&i.slide.placeholder){const t=i.slide.placeholder.element.style;t.transform="none",t.width=`${e}px`,t.height=`${n}px`}}}isKeepingPlaceholder(t,e){return!R(e)&&t}isContentZoomable(t,e){return!R(e)&&t}onContentActivate({content:t}){R(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){R(t)&&this.pauseVideo(t)}onContentAppend(t){R(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if(R(t.content)&&(t.preventDefault(),!e.element)){if(e.state="loading",e.type="video",e.element=document.createElement("video"),this.options.videoAttributes)for(let t in this.options.videoAttributes)e.element.setAttribute(t,this.options.videoAttributes[t]||"");e.element.setAttribute("poster",e.data.msrc),this.preloadVideoPoster(e,e.data.msrc),e.element.style.position="relative",e.element.style.left=0,e.element.style.top=0,e.data.videoSources?e.data.videoSources.forEach(t=>{let n=document.createElement("source");n.src=t.src,n.type=t.type,e.element.appendChild(n)}):e.data.videoSrc&&(e.element.src=e.data.videoSrc)}}preloadVideoPoster(t,e){!t._videoPosterImg&&e&&(t._videoPosterImg=new Image,t._videoPosterImg.src=e,t._videoPosterImg.complete?t.onLoaded():t._videoPosterImg.onload=t._videoPosterImg.onerror=()=>{t.onLoaded()})}playVideo(t){t.element&&t.element.play()}pauseVideo(t){t.element&&t.element.pause()}useContentPlaceholder(t,e){return!!R(e)||t}},$=class{constructor(t,e={}){new P(t,{...O,...e})}},D=({open:n,ad:s,onClose:o,captureAdClick:r})=>{const a=Boolean(s?.targetType&&s.targetType!==e.At.NONE);return t.Hn(i.se,{open:Boolean(n&&s),onOpenChange:t=>!t&&o?.(),children:t.Hn(i.re,{className:"border-none p-0",children:[t.Hn(i.ae,{className:"hidden",children:[t.Hn(i.he,{children:s?.title}),t.Hn(i.ce,{children:s?.description})]}),t.Hn("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[t.Hn("img",{className:"h-auto w-full object-contain sm:max-h-96",src:s?.imageUrl,alt:"Image not found"}),t.Hn("div",{className:"flex flex-col gap-2 p-3",children:[t.Hn(i.Ut,{variant:"h4",align:"center",lines:2,children:s?.title}),t.Hn(i.Ut,{variant:"body3",color:"secondary",align:"center",lines:4,children:s?.description})]}),a&&t.Hn(i.$t,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(s?._id,s?.targetType??e.At.LINK,s?.targetUrl),o?.()},iconName:e.Ct[s?.targetType]??e.Ct[e.At.LINK],children:s?.targetText})]})]})})},F=({style:s,content:o,curateLink:r,onAdClick:a})=>{const{captureAdImpression:l,captureAdEngagement:c,captureAdClick:d}=i.te(),h=Boolean(r&&a),p=o.ctaBg||"#ff4800",u=o.ctaForeground||"#FFFFFF";return t.Hn("div",{style:s,className:"group relative mb-1 overflow-hidden rounded",children:[t.Hn(n.d,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&l(o._id)},onClick:()=>c(o._id),children:t.Hn(i.Te,{url:o.src||o.imageUrl,thumbnailUrl:o.src||o.imageUrl,blurhash:o.blurhash,alt:o.caption,onClick:h?a:void 0,pswpData:{id:o._id,type:e.ct.AD,hash:o._id,width:o.width,height:o.height,title:o.title,description:o.description,targetType:o.targetType,targetText:o.targetText,targetUrl:o.targetUrl,thumbnailUrl:o.imageUrl,blurhash:o.blurhash}})}),t.Hn("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(o.title||o.targetType!==e.At.NONE)&&t.Hn("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[o.title&&t.Hn("div",{className:"bg-background/60 px-3 py-1",children:t.Hn("h3",{className:"line-clamp-1 text-sm font-medium text-red-500",children:o.title})}),o?.targetType!==e.At.NONE&&t.Hn("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:p,color:u},onClick:()=>{h?a?.():d(o._id,o.targetType,o.targetUrl)},children:[t.Hn(i.jt,{style:{color:u},icon:e.Ct[o?.targetType??e.At.LINK]}),o?.targetText]})]})]})},U=({style:n,gamConfig:s,slotIndex:o,eventId:r,organizationId:a})=>{const l=t.he(null),c=t.he(null),{trackGamAnalytics:d}=i.te(),h=`gam-slot-${r??"ev"}-${o}`,p=Math.max(1,Math.round(n?.width||s.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(n?.height||s.sizes[0]?.[1]||250)),m=t.he({w:p,h:u});return t.pe(()=>{let t=!1,n=null,o=null,p=null,u=null;return(async()=>{await i.Xt(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;i.Qt(h);const{w:g,h:f}=m.current,w=[[g,f],...s.sizes],y=window.googletag.defineSlot(s.adUnitPath,w,h)?.addService(window.googletag.pubads());if(!y)return;c.current=y,o=window.googletag.pubads(),r?y.setConfig({targeting:{qrati_event:r,...s.categories.length>0?{qrati_category:s.categories}:{}}}):s.categories.length>0&&y.setConfig({targeting:{qrati_category:s.categories}}),p=t=>{t.slot===y&&d({eventId:r,organizationId:a,type:e.ut.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},o.addEventListener("slotRenderEnded",p),u=t=>{t.slot===y&&d({eventId:r,organizationId:a,type:e.ut.GAM_VIEWABLE})},o.addEventListener("impressionViewable",u);const v=l.current;v&&(n=i.ee({container:v,onClick:()=>{d({eventId:r,organizationId:a,type:e.ut.GAM_CLICK})}}),i.Yt(),window.googletag.display(h))})})(),()=>{t=!0,n?.(),o&&"function"==typeof o.removeEventListener&&(p&&o.removeEventListener("slotRenderEnded",p),u&&o.removeEventListener("impressionViewable",u));const e=c.current;c.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[r,s.adUnitPath,s.categories,a,h]),t.Hn("div",{style:{width:p,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":o,children:t.Hn("div",{id:h,ref:l,style:{width:p,height:u},className:"gam-ad-slot"})})},j=t.J(null),W=()=>{const e=t.ge(j);if(!e)throw new Error("Popover components must be used within a Popover");return e},G=({children:n,className:i,open:s,onOpenChange:o})=>{const[r,a]=t.fe(!1),l="boolean"==typeof s,c=l?s:r,d=t.Ce(),h=`popover-trigger-${d}`,p=`popover-content-${d}`,u=t.he(null);return t.Hn(j.Provider,{value:{isOpen:c,setIsOpen:t=>{l||a(t),o?.(t)},triggerId:h,contentId:p,triggerRef:u},children:t.Hn("div",{"data-slot":"popover",className:e.ln("relative inline-block",i),children:n})})},K=({children:e,asChild:n,className:i,onClick:s,...o})=>{const{isOpen:r,setIsOpen:a,triggerId:l,contentId:c,triggerRef:d}=W();if(n){const n=Array.isArray(e)?e[0]:e;if(n&&n.type){const e=n.props?.className;return t.G(n,{ref:t=>{d.current=t},id:l,className:i?e?`${e} ${i}`:i:e,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{a(!r),n.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}return t.Hn("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:i,onClick:t=>{a(!r),s?.(t)},...o,children:e})},Y=({children:n,className:i,align:s="center",side:o="top",sideOffset:r=4,...a})=>{const{isOpen:l,setIsOpen:c,contentId:d,triggerRef:h}=W(),{organization:p,portalContainer:u}=e.vn(),m=t.he(null),[g,f]=t.fe(null);if(t.de(()=>{if(!l)return;const t=()=>{if(!h.current||!m.current)return;const t=h.current.getBoundingClientRect(),e=m.current.getBoundingClientRect();let n=t.left,i=t.bottom+r;"center"===s&&(n=t.left+t.width/2-e.width/2),"end"===s&&(n=t.right-e.width),"top"===o&&(i=t.top-e.height-r),"left"===o&&(n=t.left-e.width-r,i=t.top+t.height/2-e.height/2),"right"===o&&(n=t.right+r,i=t.top+t.height/2-e.height/2),"bottom"===o&&(i=t.bottom+r),f({top:i,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[s,l,o,r,h]),t.pe(()=>{if(!l)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=m.current&&(m.current.contains(n)||e.includes(m.current)),s=h.current&&(h.current.contains(n)||e.includes(h.current));i||s||c(!1)},e=t=>{"Escape"===t.key&&(c(!1),h.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[l,c,h]),!l)return null;const w=t.Hn("div",{ref:m,id:d,role:"dialog","aria-modal":"false","data-state":l?"open":"closed",className:e.ln("bg-background text-foreground border-border shadow-outer rounded outline-none",i),style:{position:"fixed",top:g?.top??0,left:g?.left??0,zIndex:2010,...e.dn(p)},...a,children:n});return"undefined"!=typeof document?t._n(w,u??document.body):w},Q=({eventId:n,contentId:o,emojis:r=[],counts:a={},userReaction:l})=>{const{user:c,props:d,organization:h}=e.vn(),p=d?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const n=e.be(),{props:o,user:r}=e.vn(),a=o?.organizationId,l=function(n){const i=e.be(void 0),[o]=t.fe(()=>new s(i,n));t.pe(()=>{o.setOptions(n)},[o,n]);const r=t.He(t.ye(t=>o.subscribe(e.Z.batchCalls(t)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),a=t.ye((t,n)=>{o.mutate(t,n).catch(e.T)},[o]);if(r.error&&e.H(o.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}({mutationFn:async({eventId:t,contentId:n,emoji:i})=>{await e.rt.post(e.it.UPDATE_REACTION,{json:{eventId:t,contentId:n,reaction:i},headers:{"x-org-id":a,Authorization:`Bearer ${r?.token}`}})},onMutate:async({eventId:t,contentId:i,emoji:s})=>{const o=[e.Pt.CONTENTS_BY_EVENT(t)];await n.cancelQueries({queryKey:o});const r=n.getQueriesData({queryKey:o});return n.setQueriesData({queryKey:o},t=>((t,e,n)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,i,s)),{previousData:r}},onError:(t,e,s)=>{s?.previousData?.forEach(([t,e])=>{n.setQueryData(t,e)}),i.Ce.error("Failed to add reaction"),console.error("Error handling reaction click:",t,e)},onSettled:async(t,i,s)=>{await n.invalidateQueries({queryKey:[e.Pt.CONTENTS_BY_EVENT(s.eventId)]})}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!r)return i.Ce.error("Please login to react"),!1;try{return await l.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(s){return!1}},isPending:l.isPending}})(),[g,f]=t.fe(!1),[w,y]=t.fe(null),v=t.he(null),b=Object.values(a).reduce((t,e)=>t+e,0);return t.pe(()=>()=>{v.current&&clearTimeout(v.current)},[]),t.Hn(G,{open:g,onOpenChange:f,children:[t.Hn(K,{asChild:!0,children:t.Hn("button",{type:"button",className:e.ln("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",w&&"scale-[1.03] shadow-sm"),children:[(r||[]).slice().sort((t,e)=>(a[e]||0)-(a[t]||0)).slice(0,1).map(n=>t.Hn("span",{className:e.ln("text-sm transition-transform duration-150 ease-out sm:text-lg",w===(l||n)&&"scale-125"),children:l||n},`${o}-${n}-1`)),b>0&&t.Hn("span",{className:"text-xs font-bold sm:text-sm",children:b||0})]})}),t.Hn(Y,{side:"top",align:"end",children:[c?null:t.Hn("div",h?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",t.Hn("a",{className:"text-info underline",href:p,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",t.Hn(e.la,{className:"text-info underline",to:e.nt.LOGIN,children:"Login"})," ","to react"]}),c&&t.Hn("div",{className:"flex gap-1 p-2",children:r.map(i=>{const s=l===i;return t.Hn("div",{className:"flex flex-col items-center",children:[t.Hn("span",{className:"text-xs font-medium",children:a[i]||0}),t.Hn("button",{type:"button",disabled:m,className:e.ln("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",s?"scale-125":"hover:scale-110",w===i&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async t=>{!m&&u&&(y(t),f(!1),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>y(null),180),u(n,o,t))})(i),children:i})]},`${o}-${i}-2`)})})]})]})},Z=({event:n={},content:s,curateLink:o})=>n.engagementStyle===e.bt.CONTEST?t.Hn("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[t.Hn(i.jt,{name:"material-symbols:star-half-rounded",className:"size-4"}),t.Hn("span",{className:"text-xs font-semibold",children:parseFloat(String(s.score||0)).toFixed(1)})]}):n.engagementStyle===e.bt.REACTION&&n.reactionEmojis?.length?t.Hn(Q,{eventId:n?._id,contentId:s._id,emojis:n?.reactionEmojis,engagementStyle:n?.engagementStyle,counts:s.reactionCounts||{},userReaction:s.userReaction}):null,J=({content:e})=>t.Hn("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&t.Hn("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:t.Hn("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),t.Hn("div",{className:"flex items-center justify-between",children:t.Hn("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:e?.user?.name})})]}),X=({event:n,content:s,style:o,timestampField:r,curateLink:a,onChangeFaceUrl:l,hideControls:c})=>{const{organization:d}=e.vn(),h=`content-${s._id}`,p=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(r,s);return t.Hn("div",{id:h,style:o,className:"group relative mb-1 overflow-hidden rounded",children:[t.Hn(i.Te,{url:s.src,alt:s.caption,blurhash:s.blurhash,thumbnailUrl:s.thumbnailUrl,curateLink:a,pswpData:{id:s._id,type:e.ct.IMAGE,hash:s._id,width:s.width,height:s.height,thumbnailUrl:s.thumbnailUrl,blurhash:s.blurhash,caption:s.caption,contentSummary:JSON.stringify(s.contentSummary)}}),!c&&t.Hn(t.E,{children:[p&&t.Hn("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:p}),d?.integrationSettings?.showQuickSearch&&(s.faces?.length??0)>0&&t.Hn("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:()=>{l?.(s?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:t.Hn(i.jt,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),t.Hn("div",{className:"",children:[t.Hn("div",{className:"absolute bottom-0 w-full rounded-b",children:t.Hn(J,{content:s})}),t.Hn("div",{className:"absolute right-2 bottom-2",children:t.Hn(Z,{event:n,content:s,curateLink:a})})]})]})]})},tt=({content:n,style:s,event:o,timestampField:r,curateLink:a,hideControls:l})=>{const c=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(r,n);return t.Hn("div",{id:`content-${n._id}`,className:"group relative mb-1 overflow-hidden rounded",style:s,children:[t.Hn(i.Te,{url:n.src??n.url,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,alt:n.caption,curateLink:a,pswpData:{id:n._id,type:e.ct.VIDEO,hash:n._id,width:n.width,height:n.height,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,caption:n.caption}}),!l&&t.Hn("div",{className:"transition-opacity duration-500",children:[c&&t.Hn("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:c}),t.Hn("div",{className:"absolute bottom-0 w-full rounded-b",children:t.Hn(J,{content:n})}),t.Hn("div",{className:"absolute right-2 bottom-2",children:t.Hn(Z,{event:o,content:n,curateLink:a})})]})]})};exports.default=({event:n,contents:s=[],gamConfig:o,singleColumnMode:r,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:d})=>{const h=t.he(null),p=t.he(null),u=t.me(()=>`gallery-${n?._id??""}`,[n]),{captureAdImpression:m,captureAdClick:g}=i.te(),{organization:f,portalContainer:w}=e.vn(),y=f?._id,[v,b]=t.fe(null);t.pe(()=>{const t=p.current;if(!c&&t){const e=new i.si({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:i.Ni,appendToEl:w??document.body});h.current=e,new $(e),new B(e),new H(e),new N(e,m,g),new V(e),new z(e),f?.integrationSettings?.showAIDescription&&new I(e,{width:"400px",height:"40%"}),e.init()}return()=>{h.current?.destroy?.(),h.current=null}},[n?.galleryLayout,c,g,m,u,f]);const x=t.me(()=>{switch(n?.galleryLayout){case e.dt.ROW:return T;case e.dt.COLUMN:return q;case e.dt.MASONRY:return S;default:return T}},[r,n?.galleryLayout]);return t.Hn(t.E,{children:[t.Hn("div",{id:u,ref:p,className:e.ln(r?"w-full lg:w-1/3":"w-full"),children:t.Hn(x,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return r&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>r?1:t<400?2:t<800?3:4,photos:s.map(t=>({src:t.type===e.ct.IMAGE||t.type===e.ct.VIDEO?t.url:t.type===e.ct.GAM_AD?"":t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t})),render:{container:({ref:e,className:n,children:i})=>t.Hn("div",{ref:e,className:n??"",children:i}),photo:(i,{photo:s,width:r,height:h,index:p})=>{const u=s;let m=null;switch(u.type){case e.ct.IMAGE:m=X;break;case e.ct.VIDEO:m=tt;break;case e.ct.AD:m=F;break;case e.ct.GAM_AD:return o?t.Hn(U,{style:{width:r,height:h},gamConfig:o,slotIndex:u.slotIndex??p,eventId:n?._id,organizationId:y},`${u._id??p}-${p}`):null;default:m=null}return m&&t.Hn(m,{style:{width:r,height:h},event:n,content:u,timestampField:l,onAdClick:c?()=>b(u):void 0,hideControls:a,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:d},`${u._id??p}-${p}`)}}})}),t.Hn(D,{open:Boolean(v),ad:v,onClose:()=>b(null),captureAdClick:g})]})};
|