1import{j as e,r as t,R as i,m as l,n as a,u as r,a as s,o as n,q as o,s as d,t as c,h as m,v as u,w as g,x as p,y as w,k as y}from"./index-cTPNoMBG.js";import{C as h}from"./index-CkXo-9A5.js";import{u as j,I as x,T as v,C as f}from"./useLayoutHideFooterDynamicHeaderPreset-muBWqUcy.js";import{A as b,G as N,M as T}from"./MentionedGalleryTabContent-wKkWpzef.js";import{A as k}from"./index-ugcYbTUg.js";import{S as G}from"./StandardHead-Ds53XCXK.js";import{b as D}from"./index-lo7C3J_T.js";import{c as I}from"./checkIsUserAdmin-olGdwgmK.js";import{N as P}from"./index-vJYFJ64D.js";import{R as A}from"./RootBreadcrumbs-C7YZZ28u.js";import{B as F}from"./BlockStyles-BkGBQ34D.js";import{g as C}from"./gaEventGalleryView-BFApBlAE.js";import{g as R,V as U}from"./getDevice-XCuG4brm.js";import{U as E}from"./UploadImage-B0H-STvq.js";import{C as S}from"./CustomTabContent-DZbHODCt.js";import{g as $}from"./getArtPicData-BoxMjrpR.js";import{m as _}from"./matchBreakpointUpTo-DqdbVYx5.js";import{u as M,a as L}from"./useSuspenseOwnerDataById-qiKHAaxd.js";import"./windowOpen-0yaTk1Pe.js";import"./Code-CVvdN0sB.js";import"./isMobileOrTablet-CuXGr0mT.js";import"./Link-DfgBR7bE.js";import"./useIsElementInView-TFi5whKa.js";import"./index-C19jcXwg.js";import"./useLayoutDynamicHeaderPreset-BO4zdjnT.js";import"./useLayoutPreset-D8eIfprs.js";import"./index-TJFIy5yQ.js";import"./index-UpqHpo7x.js";import"./index-D6A6STAS.js";import"./PencilSimple-CcRxGENK.js";import"./DeleteFill-ev66OevE.js";import"./EditFill-DfpfJsgw.js";import"./gaEventGalleryImageClicked-BNTTdkqA.js";import"./Plus-D_03AXdq.js";import"./index-CT-lCrAp.js";import"./index-CsSCO24R.js";import"./CheckCircleFilled-BzGcl4_1.js";import"./quickGalleryModal-DNQarafh.js";import"./gaEventExhibitionCreated-DOock5-N.js";import"./IconBg-CgjPaltE.js";import"./WarningCircle-CVXTnk4G.js";import"./useGetDemoGalleries-LHJ33Kbq.js";import"./fetch-state-D2CPjf4w.js";import"./index-G7Tyy7y4.js";import"./floating-ui.dom-CWv14aCs.js";import"./CaretDown-D2oHScnY.js";/* empty css */import"./useAllAvailablePaintings-BoGHmFD9.js";/* empty css *//* empty css *//* empty css */import"./Gallery-CXg7icyi.js";/* empty css */import"./index-C7xLHR24.js";import"./index-BmTdcM4u.js";import"./index-KfdOLteN.js";import"./tourHelper-Ba476A4H.js";import"./tourFormHelper-DF0zWncB.js";import"./useLikes-B4Hdj5Xx.js";import"./gaEventArtworkLike-HB0NZgel.js";import"./AuthModal-BjWsTi9Q.js";import"./PlusCircle-B-pgMIIu.js";import"./index-BV7Uk754.js";import"./MasonryArtCard-D7UU2LI0.js";import"./useRefableState-v2eApV77.js";import"./gaEventAddToCollection-DE4qEk9v.js";import"./index-CYLlI6SP.js";import"./mergeOptionsWithPopperConfig-Dmv8SCAp.js";import"./index-eZY3gz00.js";import"./socialLinksHelper-aTdypnRl.js";import"./SocialYoutube-BMJCHnB3.js";const O=({artists:t,elementRef:i,showTitle:l})=>t.length>0&&e.jsxs("div",{className:"tw-col tw-lg:tw-col-12 tw-mt-[0px] tw-lg:tw-mt-[16px] tw-py-[0px] tw-px-[16px] tw-lg:tw-px-[0px]",id:"artists",ref:i,children:[l&&e.jsx("div",{className:"tw-sm:tw-hidden tw-flex tw-items-center tw-justify-between tw-mb-[16px]",children:e.jsx("h4",{className:"tw-typog-[bodylg] tw-font-medium tw-mb-[0px]",children:t?1===t.length?"1 Artist":`${t.length} Artworks`:"0 Artists"})}),e.jsx("div",{className:"tw-row tw-gy-[24px] tw-gx-[16px]",children:0!==t.length&&t.map((t=>e.jsx("div",{className:"tw-col-12 tw-sm:tw-col-6 tw-md:tw-col-4 tw-cursor-pointer hover-lift lift-ignore-shadow shadow-none",children:e.jsx(k,{...t,artsCount:t.artWorksCount?t.artWorksCount:0,arts:t.artworks},t._id)},t._id)))})]}),K=({id:t,title:a,description:r,image:s})=>{const n=l(),o=JSON.stringify({"@context":"https://schema.org","@type":"Person",name:a,description:r,image:s,url:`https://dslcollection.net/${i.Gallery}/${t}`});try{console.log(JSON.parse(o))}catch{n(`Unparsable jsonld at GalleryProfileSemanticMarkup. id or nickname: ${t}`)}return e.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:o}})},B=({user:i,image:l,canonicalUrl:a})=>{var r;if(!i||!i.galleryData)return e.jsx(t.Fragment,{});const s=`${(null==(r=i.galleryData)?void 0:r.name)||""}`,n=`${s} gallery profile`,o=i.galleryData.nickname?i.galleryData.nickname:i._id;return e.jsxs(e.Fragment,{children:[e.jsx(G,{title:s,description:n,canonicalUrl:a,bannerSrc:l||D}),e.jsx(K,{image:l,id:o,title:s,description:n})]})},H=t=>e.jsx(B,{...t}),V=()=>{const e=r();return(t,i=null)=>e("/exhibition/getGalleryProfile3DGalleries",{ownerId:t},i)},W=(t,i)=>e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"tw-md:tw-hidden",children:t}),e.jsx("span",{className:"tw-hidden tw-md:tw-inline-block",children:i})]}),q=({userOwnerByGallery:l,userLists:n,initialGalleries:o,initialUserOwner:d,initialMentionedGalleries:c,artists:m,mentionedTours:h,paintings:j,tours:k,galleryId:G,galleryAvatar:D,fetchGallery:A})=>{var F,$,M,K,B,H,q,J,Q,X,Y,z,Z;const ee=a();r(),console.warn("tours",k,h),ee.useWatch(["user.data"]);const te=u(),{data:ie,refresh:le}=L(d,null==l?void 0:l._id),ae=I(ee["user.data"])||(null==(F=ee["user.data"])?void 0:F._id)===(null==ie?void 0:ie._id),{data:re,refresh:se}=((e,t)=>{const i=V(),[l,a]=s.useState(e),[r,n]=s.useState(!1);return{refresh:(e=null)=>{if(t)return n(!0),i(t,((t,i)=>{!t&&i&&a(i),n(!1),e&&e(t,i)}))},data:l,loading:r}}
1)({galleries:o,mentionedGalleries:c},ie._id);console.warn("initial galleries",o,c),console.warn("galleryGalleries",re),(({galId:e,sysId:i})=>{const l=a(),s=r(),n=t.useRef(new Date),o=t.useRef(null);t.useEffect((()=>{if(l["user.id"]){C({galId:e});const t={event:U,viewer:l["user.id"],itemId:i,date:n.current,platform:R(),duration:0};s("/visit/create",t,((e,t)=>{e||(o.current=t)}))}return()=>{if(o.current){const e={duration:`${((Number(new Date)-Number(n.current))/1e3).toFixed(2)}`};s("/visit/update",{id:o.current,fields:e},(e=>{console.log("error: ",e)}))}}}),[])})({galId:G,sysId:null==ie?void 0:ie._id});const ne=t.useRef(void 0),oe=t.useRef(void 0),de=t.useRef(void 0),ce=t.useRef(void 0),me=t.useRef(void 0);g();const ue=e=>m.find((t=>t._id===e.artistId)),ge=0===re.galleries.length&&0===k.length,pe=0===re.mentionedGalleries.length&&0===h.length,we=0===(null==($=null==j?void 0:j.paintings)?void 0:$.length),ye=0===(null==n?void 0:n.length),he=0===(null==m?void 0:m.length),je=ge&&we&&ye&&he&&pe,xe=e=>({galleryName:e.name?e.name:(null==ie?void 0:ie.galleryData)?`${null==ie?void 0:ie.galleryData.name} Gallery`:`${null==ie?void 0:ie.artistName} Gallery`,ownerName:"",ownerLink:""}),ve=()=>{se(),A(),(null==l?void 0:l._id)&&le()},fe=t.useMemo((()=>{var e;const t=0===(null==(e=null==j?void 0:j.paintings)?void 0:e.length),i=0===(null==n?void 0:n.length);let l=!1;return i||(l=!n.some((e=>e.artworks.length>0))),t&&(i||!i&&l)}),[null==(M=null==j?void 0:j.paintings)?void 0:M.length,null==n?void 0:n.length]),be=[{eventKey:"paintingTab",title:W(e.jsx(e.Fragment,{children:"Artworks"}),e.jsxs(e.Fragment,{children:["Artworks ",`(${(null==(K=null==j?void 0:j.paintings)?void 0:K.length)||0})`]})),content:()=>e.jsx(b,{artPieces:j.paintings,elementRef:de,designV2:!1,showTitle:!0,matchArtist:ue}),disabled:we},{eventKey:"galleryTab",title:W(e.jsx(e.Fragment,{children:"Exhibitions"}),e.jsxs(e.Fragment,{children:["Exhibitions ",`(${(null==(B=re.galleries)?void 0:B.length)||0})`]})),content:()=>e.jsx(N,{galleries:re.galleries,elementRef:ne,calculateDisplayInfo:xe,showTitle:!0,user:ee["user.data"],tours:k,owner:ie,refreshGalleries:ve,ownerDataEmpty:fe}),disabled:!ae&&ge},{eventKey:"artistTab",title:W(e.jsx(e.Fragment,{children:"Artists"}),e.jsxs(e.Fragment,{children:["Artists ",`(${(null==m?void 0:m.length)||0})`]})),content:()=>e.jsx(O,{artists:m,elementRef:oe,showTitle:!0}),disabled:he},{eventKey:"collectionTab",title:W(e.jsx(e.Fragment,{children:"Collections"}),e.jsxs(e.Fragment,{children:["Collections ",`(${(null==n?void 0:n.length)||0})`]})),content:()=>e.jsx(f,{userLists:n,elementRef:ce,showTitle:!0}),disabled:ye},...pe?[]:[{eventKey:"mentionedTab",title:`Mentioned (${(re.mentionedGalleries.length||0)+(h.length||0)})`,content:()=>e.jsx(T,{galleries:re.mentionedGalleries,elementRef:me,calculateDisplayInfo:xe,showTitle:!0,user:ee["user.data"],tours:h,owner:ie,refreshGalleries:ve,ownerDataEmpty:fe}),disabled:pe}]],{additionalData:Ne,setAdditionalData:Te}=p(),ke=be.map((e=>e.eventKey));t.useEffect((()=>{const e=Ne&&(null==Ne?void 0:Ne.activeTabKey)&&ke.includes(null==Ne?void 0:Ne.activeTabKey)?null==Ne?void 0:Ne.activeTabKey:be[0].eventKey;De(e),Te({activeTabKey:""})}),[]);const[Ge,De]=t.useState(be[0].eventKey),Ie=t.useCallback((e=>{De(e||""),_("md")&&w()}),[]);return l&&l.galleryData?l?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"tw-row tw-gx-[0px] tw-md:tw-gx-[0px] tw-lg:tw-gx-[24px] tw-xl:tw-gx-[24px] tw-xxl:tw-gx-[24px] tw-gy-[0px] tw-m-[0px] tw-md:tw-gy-[0px] tw-lg:tw-gy-[24px]",children:[e.jsx("div",{className:"tw-col-12 tw-xl:tw-col-4 page-wrapper-left-block tw-mt-[0px]",children:e.jsx(x,{avatarSrc:D,name:null==(H=l.galleryData)?void 0:H.name,country:(()=>{var e;const t=[];return(null==(e=null==ie?void 0:ie.galleryData)?void 0:e.country)&&t.push(ie.galleryData.country),t.join(", ")})(),info:null==(q=l.galleryData)?void 0:q.description,activeTab:Ge,onTabClick:Ie,isEmpty:je,tabs:be,type:"gallery",donateTargetType:"gallery",donateTargetId:G,donateAccountOwnerId:l._id,donateDisplay:Boolean(l.isDonationAvailable),donateTotal:l.totalDonationsReceived,shareInfo:{url:`${te}/gallery/${y(ie)}`,title:`${null==(J=l.galleryData)?void 0:J.name}`,shareTitle:"Share Gallery",description:null==(Q=l.galleryData)?void 0:Q.description,image:(null==(Y=null==(X=l.galleryData)?void 0:X.picture)?void 0:Y.pic1024)?null==(Z=null==(z=l.galleryData)?void 0:z.picture)?void 0:Z.pic1024.url:void 0,btnClassName:"btn-sm tw-typog-[bodymd] tw-w-[100%] tw-sm:tw-w-[125px] tw-sm:tw-min-w-[125px]",embedData:{iframeUrl:`https://dslcollection.net/${i.GalleryEmbeded}/${y(ie)}`}},socialNetwork:null==ie?void 0:ie.socialNetwork})}),e.jsxs("div",{className:"tw-col-12 tw-xl:tw-col-8 page-wrapper-right-block tw-mt-[0px] "+(je?"align-content-center":""),children:[e.jsx(v,{activeTab:Ge,onTabClick:Ie,tabs:be,containerClassName:"tw-justify-center tw-xl:tw-justify-start tw-mb-[16px] tw-lg:tw-mb-[32px]"}),e.jsx(S,{activeTab:Ge,tabs:be}),je&&"galleryTab"!==Ge&&e.jsxs("div",{className:"tw-flex tw-flex-col tw-items-center tw-justify-center",style:{minHeight:"360px"},children:[e.jsx(E,{}),e.jsx("p",{className:"tw-typog-[bodyxl]",children:"Gallery didn't post anything"})]})]})]})}):e.jsx("div",{style:{minHeight:"75vh"},className:"tw-flex tw-items-center tw-justify-center",children:"Gallery not found"}):e.jsx(P,{})},J={gallery:null,uriMap:null,isNotFound:!1,galleryAvatar:null,isNickNameIdParam:!1,canonicalUrl:null,canonicalPath:null,isRedirect:null};function Q({galleryId:i,initialDataPromise:l}){var a;const n=r(),o=s.use(l);if(!o.gallery)return e.jsx(P,{});const[d,c]=t.useState(o.gallery),u=t.useCallback((()=>{i&&n("/users/getGalleryDataProfileV2",{id:i},((e,t)=>{e||!t?(console.log("Error fetching gallery data",e),c(J)):c({gallery:t.gallery,galleryAvatar:t.galleryAvatar,uriMap:t.uriM
1ap,isNotFound:t.isNotFound,isNickNameIdParam:t.isNickNameIdParam,canonicalUrl:t.canonicalUrl,canonicalPath:t.canonicalPath,isRedirect:t.isRedirect})}))}),[i]),{gallery:g,isRedirect:p,canonicalPath:w,canonicalUrl:y,galleryAvatar:j}=d;return t.useEffect((()=>{p&&m(w)}),[p,w]),g?e.jsxs(e.Fragment,{children:[e.jsx(H,{user:g,canonicalUrl:y,image:j}),e.jsxs("div",{className:"page-wrapper tw-py-[0px] tw-block",children:[e.jsx("div",{className:"global-container tw-bg-white tw-py-[24px]",children:e.jsx(A,{items:[{to:"/galleries",label:"Galleries"},{to:`/gallery/${i}`,label:null==(a=g.galleryData)?void 0:a.name}]})}),e.jsx("div",{className:"global-container tw-pb-[60px] page-wrapper-section tw-bg-white",children:e.jsx(h,{className:"tw-gy-[24px] tw-gx-[0px]",fluid:!0,children:e.jsx(q,{galleryId:i,initialUserOwner:o.galleryOwner,artists:o.artists,initialGalleries:o.galleries,initialMentionedGalleries:o.mentionedGalleries,mentionedTours:o.mentionedTours,paintings:o.paintings,userLists:o.userLists,tours:o.tours,userOwnerByGallery:g,canonicalUrl:y,galleryAvatar:j,fetchGallery:u})})})]})]}):e.jsx(P,{})}function X(){a();const t=r(),i=n(),m=l();j();const u=o().id,g=M(),p=V(),[w,y]=d(`gallery-data-${u}`,(async()=>{const{res:e}=await t("/users/getGalleryDataProfileV2",{id:u}),l=e;if(!l)return i.onNotFound(),{gallery:null,galleryOwner:null,artists:[],galleries:[],paintings:[],userLists:[],mentionedTours:[]};const a={gallery:l.gallery,galleryAvatar:l.galleryAvatar,uriMap:l.uriMap,isNotFound:l.isNotFound,isNickNameIdParam:l.isNickNameIdParam,canonicalUrl:l.canonicalUrl,canonicalPath:l.canonicalPath,isRedirect:l.isRedirect},r={gallery:null,galleryOwner:null,artists:[],galleries:[],paintings:[],userLists:[],mentionedTours:[]};if(a.isRedirect)return i.onRedirect({redirectPath:a.canonicalPath}),r;if(a.isNotFound)return i.onNotFound(),r;const{res:s}=await g(a.gallery._id),n=s.data;if(!n)return i.onNotFound(),r;const{res:o}=await t("/front/exsubUseArtistsByOwnerWithArtworks",{ownerId:null==n?void 0:n._id,widthNotEmptyArtworks:!0});if(!o)return i.onNotFound(),r;const{res:d}=await p(null==n?void 0:n._id),{res:c}=await t("/front/getGalleryProfileTours",{ownerId:null==n?void 0:n._id}),w=c?c.tours:[],y=c?c.mentionedTours:[],{res:h}=await t("/front/exsubUseAllAvailablePaintings",{ownerId:null==n?void 0:n._id,isPublishedQuery:!0});if(!h)return i.onNotFound(),r;const{res:j}=await t("/front/exsubUseUserListsByUserId2",{userId:null==n?void 0:n._id,showEmpties:!1,publicOnly:!0}),x=j||[];j||m(`Gallery profile public page, user lists errored. galId: ${u}`);const v=h||{paintings:[],artists:[]},f=(()=>{var e;if(0===(null==(e=v.paintings)?void 0:e.length))return v;const t=function(){const e=v.paintings.reduce(((e,t)=>{const i=$(t);return i.url&&0!==i.width&&0!==i.height?e.id?i.height>e.height?{id:t._id,height:i.height,data:t}:e:{id:t._id,height:i.height,data:t}:e}),{id:null,height:0,data:null});if(!e.data||0===e.height)return v.paintings;const t=v.paintings.filter((t=>(null==t?void 0:t._id)!==e.id));return e.data.lcpTarget=!0,[e.data,...t]}();return{...h,paintings:t}})();return{tours:w,gallery:a,galleryOwner:n,artists:o||[],galleries:d?d.galleries:[],mentionedGalleries:d?d.mentionedGalleries:[],paintings:f,userLists:x||[],mentionedTours:y}}),{gallery:null,galleryOwner:null,tours:[],artists:[],paintings:[],userLists:[],mentionedGalleries:[],mentionedTours:[]});return e.jsxs(e.Fragment,{children:[e.jsx(F,{}),e.jsxs(s.Suspense,{fallback:e.jsx(c,{}),children:[e.jsx(Q,{galleryId:u,initialDataPromise:w}),y]})]})}export{X as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.