@orangelogic/orange-dam-content-browser-sdk 2.1.51-pr61281.50 → 2.1.51
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.
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
margin-bottom: var(--cx-spacing-3x-small);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
`;var Ut=n(4413),Vt=n(579);const qt=e=>{let{loadMore:t,isLoading:n,disabled:r=!1,slot:o,disabledIndentation:i}=e;return(0,Vt.jsxs)("cx-space",{direction:"horizontal",slot:o,children:[!i&&(0,Vt.jsx)("div",{className:"browser__load-more__indentation"}),(0,Vt.jsxs)("cx-button",{variant:"text",size:"small",onClick:t,disabled:r,loading:n,className:"browser__load-more",children:[(0,Vt.jsx)("cx-icon",{name:"add",slot:"prefix"}),"More"]})]})},Ht=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Wt=(e,t)=>{if(!t)return e;const n=t.toLowerCase().split(" ").filter(Boolean),r=n.map(Ht),o=new RegExp(`(${r.join("|")})`,"gi");return e.split(o).map(((e,t)=>n.includes(e.toLowerCase())?(0,Vt.jsx)("strong",{children:e},t):e))},Kt=e=>{var t;let{allowedFolders:n,folder:r,currentFolderID:o,icon:i,searchText:a,useSession:s}=e;const[l,c]=(0,wt.useState)(!1),[u,d]=(0,wt.useState)(!1),[h,p]=(0,wt.useState)({start:0,pageSize:Ut.VH}),f=(0,wt.useRef)(null),m=o===r.id,{data:g,isFetching:v,isLoading:b}=(0,Rt.Jz)({allowedFolders:n,folder:r,searchText:"",useSession:s,start:h.start,pageSize:h.pageSize},{skip:!u}),y=(0,wt.useMemo)((()=>{var e;return null!==(e=null===g||void 0===g?void 0:g.items)&&void 0!==e?e:void 0}),[g]),x=null!==(t=null===g||void 0===g?void 0:g.totalCount)&&void 0!==t?t:0,w=(0,wt.useCallback)((()=>{const e=(null===y||void 0===y?void 0:y.length)||0;e>=x||p((t=>({...t,start:e})))}),[null===y||void 0===y?void 0:y.length,x]);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-tree-item")]).then((()=>{c(!0)}))}),[l]),(0,wt.useEffect)((()=>{const e=f.current;if(!e)return;const t=()=>{d(!0)},n=e=>{e.detail.target===f.current&&d(!1)};return e.addEventListener("cx-lazy-load",t),e.addEventListener("cx-expand",t),e.addEventListener("cx-collapse",n),()=>{e.removeEventListener("cx-lazy-load",t),e.removeEventListener("cx-expand",t),e.removeEventListener("cx-collapse",n)}}),[l]);const k=(0,wt.useMemo)((()=>{let e;return e=i||("Album"===r.docType?"share":"folder"),e}),[r.docType,i]),S=r.hasChildren&&(void 0===y||v);return(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsxs)("cx-tree-item",{ref:f,"data-value":JSON.stringify(r),expanded:u,selected:m,lazy:S,children:[(0,Vt.jsx)("cx-icon",{name:k}),(0,Vt.jsx)("cx-line-clamp",{lines:1,children:Wt(r.title,a)}),null===y||void 0===y?void 0:y.map((e=>(0,Vt.jsx)(Kt,{folder:e,searchText:a,currentFolderID:o},e.id)))]}),y&&y.length<x&&!b&&(0,Vt.jsx)(qt,{loadMore:w,isLoading:v,disabled:v})]})},$t=Kt;var Qt=n(1158);const Xt=e=>{switch(e){case Qt.zu.Audio:return"audio_file";case Qt.zu.Album:return"album";case Qt.zu.Widget:return"widgets";case Qt.zu.Multimedia:return"perm_media";case Qt.zu.Story:return"article";case Qt.zu.Video:return"video_file";case Qt.zu.Image:return"photo";default:return"file"}},Gt=e=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")}`,Zt={id:"",title:"My Favorites",docType:"Story",path:[],parents:[],fullPath:"My Favorites",hasChildren:!1},Yt=e=>{var t,n;let{allowedFolders:r,collectionPath:o,currentFolder:i,favoriteFolderId:a,focusInput:s,lastLocationMode:l,open:c,showCollections:u,showFavoriteFolder:d,useSession:h,onFolderSelect:p,onClose:f,isPersistent:m,onChangePersistent:g,forceOverlay:v}=e;const[b,y]=(0,wt.useState)(""),[x,w]=(0,wt.useState)(!1),[k,S]=(0,wt.useState)(!1),[_,C]=(0,wt.useState)(!1),[E,A]=(0,wt.useState)({start:0,pageSize:Ut.VH}),[T,O]=(0,wt.useState)({start:0,pageSize:Ut.VH}),P=(0,wt.useRef)(null),z=(0,wt.useRef)(null),D=(0,wt.useRef)(null),R=(0,wt.useRef)(null),N=(0,wt.useRef)(!0);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-drawer"),customElements.whenDefined("cx-input"),customElements.whenDefined("cx-tree")]).then((()=>{w(!0)}))}),[]),(0,wt.useEffect)((()=>{const e=D.current;if(!e)return;const t=Se((e=>{const t=e.target.value;b!==t&&(t.length>2||0===t.length)&&y(t)}),500);return e.addEventListener("cx-input",t),()=>{e.removeEventListener("cx-input",t)}}),[x,b]),(0,wt.useEffect)((()=>{const e=z.current;if(!e)return;const t=()=>{f(),g(!1)};return e.addEventListener("cx-request-close",t),()=>{e.removeEventListener("cx-request-close",t)}}),[x,f,g]);const{data:j,isLoading:I,isFetching:M,isError:L}=(0,Rt.Jz)({allowedFolders:r,folder:jt,searchText:b,useSession:h,start:E.start,pageSize:E.pageSize}),{data:F}=(0,Rt.Jz)({allowedFolders:r,folder:{...Zt,id:null!==a&&void 0!==a?a:""},searchText:"",useSession:h,self:!0,includeDirectChild:!1},{skip:!a}),B=(0,wt.useMemo)((()=>{var e;return null!==(e=null===j||void 0===j?void 0:j.items)&&void 0!==e?e:void 0}),[j]),U=null!==(t=null===j||void 0===j?void 0:j.totalCount)&&void 0!==t?t:0,V=(0,wt.useCallback)((()=>{if(!B)return;const e=B.length;e>=U||(S(!0),A((t=>({...t,start:e}))))}),[B,U]);(0,wt.useEffect)((()=>{const e=()=>{if(!B)return;if(r&&r.length>0){const e=B.find((e=>r.includes(e.id)));if(e)return void p(e)}const e=B.find((e=>e.title===Dt.mT));p(e||jt)};N.current&&B&&(N.current=!1,l?(0,Mt.bQ)("lastLocation").then((t=>{if("string"===typeof t)try{const n=JSON.parse(t);if(n.id===a&&!d||r&&r.length>0)return void e();p(n)}catch(n){e()}else e()})).catch((()=>{e()})):e())}),[r,a,B,l,p,d]);const{data:q,isLoading:H,isFetching:W,isError:K}=(0,Rt.$Y)(o?{folder:o,searchText:b,useSession:h,start:T.start,pageSize:T.pageSize}:Lt.hT),$=(0,wt.useMemo)((()=>{var e;return null!==(e=null===q||void 0===q?void 0:q.items)&&void 0!==e?e:void 0}),[q]),Q=null!==(n=null===q||void 0===q?void 0:q.totalCount)&&void 0!==n?n:0,X=(0,wt.useCallback)((()=>{if(!$)return;C(!0);const e=$.length;e>=Q||O((t=>({...t,start:e})))}),[$,Q]);(0,wt.useEffect)((()=>{const e=R.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.selection[0].dataset.value)&&void 0!==t?t:"{}");null===p||void 0===p||p(n)};return e.addEventListener("cx-selection-change",t),()=>{e.removeEventListener("cx-selection-change",t)}}),[x,p]),(0,wt.useEffect)((()=>{const e=P.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.item.value)&&void 0!==t?t:"{}");null===p||void 0===p||p(n)};return e.addEventListener("cx-select",t),()=>{e.removeEventListener("cx-select",t)}}),[x,$,p]),(0,wt.useEffect)((()=>{M||S(!1)}),[M]),(0,wt.useEffect)((()=>{W||C(!1)}),[W]);const G=(0,wt.useCallback)((()=>{if(I||M&&!k)return Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t)));if(B&&B.length>0){const o=[];var e,t,n;if(a)o.push((0,Vt.jsx)($t,{folder:{...Zt,id:a,hasChildren:null!==(e=null===F||void 0===F||null===(t=F.items)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.hasChildren)&&void 0!==e&&e},currentFolderID:i.id,icon:"star",useSession:h},a));return[...o,...(null!==B&&void 0!==B?B:[]).map((e=>(0,Vt.jsx)($t,{allowedFolders:r,folder:e,currentFolderID:i.id,searchText:b,useSession:h},e.id)))]}return L?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load folders"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No folders found"})}),[r,i.id,a,B,L,M,I,b,h,k,F]),Z=(0,wt.useCallback)((()=>H||W&&!_?Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t))):$&&$.length>0?null===$||void 0===$?void 0:$.map((e=>{const t=i.id===e.id;return(0,Vt.jsxs)("cx-menu-item",{value:JSON.stringify(e),className:""+(t?"selected":""),children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"collections"}),Wt(e.title,b)]},e.id)})):K?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load collections"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No collections found"})),[H,W,$,K,i.id,b,_]);Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M660-320v-320L500-480l160 160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>'),Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M500-640v320l160-160-160-160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>');return(0,Vt.jsx)(Bt,{ref:z,label:"Browser",placement:"start",contained:!0,open:c,children:(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",wrap:"nowrap",children:[(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",style:{padding:"var(--body-spacing) var(--body-spacing) 0"},children:[(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Folders"}),(0,Vt.jsx)("cx-input",{ref:D,value:b,placeholder:"Search...",clearable:!0,autoFocus:s,className:"search-input",children:(0,Vt.jsx)("cx-icon",{name:"search",slot:"prefix",className:"icon--large"})}),(0,Vt.jsx)("div",{className:"browser__folders",children:(0,Vt.jsxs)("cx-tree",{ref:R,"force-on-change":!0,children:[G(),B&&B.length<U&&!I&&(0,Vt.jsx)(qt,{loadMore:V,isLoading:M,disabled:M})]})})]}),u&&(0,Vt.jsx)("div",{className:"browser__collections",children:(0,Vt.jsxs)("cx-details",{children:[(0,Vt.jsx)("cx-typography",{slot:"summary",variant:"body3",children:"Collections"}),(0,Vt.jsxs)("cx-menu",{ref:P,className:"browser__collections__menu",children:[Z(),$&&$.length<Q&&!H&&(0,Vt.jsx)(qt,{loadMore:X,isLoading:W,disabled:W,disabledIndentation:!0})]})]})})]})})},Jt=[{label:"Ascending",value:"ascending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{opacity:"0.3",d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})},{label:"Descending",value:"descending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{opacity:"0.3",d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})}],en=[{value:Qt.gf.Small,label:"Small labeled"},{value:Qt.gf.Medium,label:"Medium labeled"},{value:Qt.gf.Large,label:"Large labeled"}],tn=Ft.Ay.div`
|
|
106
|
+
`;var Ut=n(4413),Vt=n(579);const qt=e=>{let{loadMore:t,isLoading:n,disabled:r=!1,slot:o,disabledIndentation:i}=e;return(0,Vt.jsxs)("cx-space",{direction:"horizontal",slot:o,children:[!i&&(0,Vt.jsx)("div",{className:"browser__load-more__indentation"}),(0,Vt.jsxs)("cx-button",{variant:"text",size:"small",onClick:t,disabled:r,loading:n,className:"browser__load-more",children:[(0,Vt.jsx)("cx-icon",{name:"add",slot:"prefix"}),"More"]})]})},Ht=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Wt=(e,t)=>{if(!t)return e;const n=t.toLowerCase().split(" ").filter(Boolean),r=n.map(Ht),o=new RegExp(`(${r.join("|")})`,"gi");return e.split(o).map(((e,t)=>n.includes(e.toLowerCase())?(0,Vt.jsx)("strong",{children:e},t):e))},Kt=e=>{var t;let{allowedFolders:n,folder:r,currentFolderID:o,icon:i,searchText:a,useSession:s}=e;const[l,c]=(0,wt.useState)(!1),[u,d]=(0,wt.useState)(!1),[h,p]=(0,wt.useState)({start:0,pageSize:Ut.VH}),f=(0,wt.useRef)(null),m=o===r.id,{data:g,isFetching:v,isLoading:b}=(0,Rt.Jz)({allowedFolders:n,folder:r,searchText:"",useSession:s,start:h.start,pageSize:h.pageSize},{skip:!u}),y=(0,wt.useMemo)((()=>{var e;return null!==(e=null===g||void 0===g?void 0:g.items)&&void 0!==e?e:void 0}),[g]),x=null!==(t=null===g||void 0===g?void 0:g.totalCount)&&void 0!==t?t:0,w=(0,wt.useCallback)((()=>{const e=(null===y||void 0===y?void 0:y.length)||0;e>=x||p((t=>({...t,start:e})))}),[null===y||void 0===y?void 0:y.length,x]);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-tree-item")]).then((()=>{c(!0)}))}),[l]),(0,wt.useEffect)((()=>{const e=f.current;if(!e)return;const t=()=>{d(!0)},n=e=>{e.detail.target===f.current&&d(!1)};return e.addEventListener("cx-lazy-load",t),e.addEventListener("cx-expand",t),e.addEventListener("cx-collapse",n),()=>{e.removeEventListener("cx-lazy-load",t),e.removeEventListener("cx-expand",t),e.removeEventListener("cx-collapse",n)}}),[l]);const k=(0,wt.useMemo)((()=>{let e;return e=i||("Album"===r.docType?"share":"folder"),e}),[r.docType,i]),S=r.hasChildren&&(void 0===y||v);return(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsxs)("cx-tree-item",{ref:f,"data-value":JSON.stringify(r),expanded:u,selected:m,lazy:S,children:[(0,Vt.jsx)("cx-icon",{name:k}),(0,Vt.jsx)("cx-line-clamp",{lines:1,children:Wt(r.title,a)}),null===y||void 0===y?void 0:y.map((e=>(0,Vt.jsx)(Kt,{folder:e,searchText:a,currentFolderID:o},e.id)))]}),y&&y.length<x&&!b&&(0,Vt.jsx)(qt,{loadMore:w,isLoading:v,disabled:v})]})},$t=Kt;var Qt=n(1158);const Xt=e=>{switch(e){case Qt.zu.Audio:return"audio_file";case Qt.zu.Album:return"album";case Qt.zu.Widget:return"widgets";case Qt.zu.Multimedia:return"perm_media";case Qt.zu.Story:return"article";case Qt.zu.Video:return"video_file";case Qt.zu.Image:return"photo";default:return"file"}},Gt=e=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")}`,Zt={id:"",title:"My Favorites",docType:"Story",path:[],parents:[],fullPath:"My Favorites",hasChildren:!1},Yt=e=>{var t,n;let{allowedFolders:r,collectionPath:o,currentFolder:i,favoriteFolderId:a,focusInput:s,lastLocationMode:l,open:c,showCollections:u,showFavoriteFolder:d,useSession:h,onFolderSelect:p,onClose:f,isPersistent:m,onChangePersistent:g,forceOverlay:v}=e;const[b,y]=(0,wt.useState)(""),[x,w]=(0,wt.useState)(!1),[k,S]=(0,wt.useState)(!1),[_,C]=(0,wt.useState)(!1),[E,A]=(0,wt.useState)({start:0,pageSize:Ut.VH}),[T,O]=(0,wt.useState)({start:0,pageSize:Ut.VH}),P=(0,wt.useRef)(null),z=(0,wt.useRef)(null),D=(0,wt.useRef)(null),R=(0,wt.useRef)(null),N=(0,wt.useRef)(!0);(0,wt.useEffect)((()=>{Promise.all([customElements.whenDefined("cx-drawer"),customElements.whenDefined("cx-input"),customElements.whenDefined("cx-tree")]).then((()=>{w(!0)}))}),[]),(0,wt.useEffect)((()=>{const e=D.current;if(!e)return;const t=Se((e=>{const t=e.target.value;b!==t&&(t.length>2||0===t.length)&&y(t)}),500);return e.addEventListener("cx-input",t),()=>{e.removeEventListener("cx-input",t)}}),[x,b]),(0,wt.useEffect)((()=>{const e=z.current;if(!e)return;const t=()=>{f(),g(!1)};return e.addEventListener("cx-request-close",t),()=>{e.removeEventListener("cx-request-close",t)}}),[x,f,g]);const{data:j,isLoading:I,isFetching:M,isError:L}=(0,Rt.Jz)({allowedFolders:r,folder:jt,searchText:b,useSession:h,start:E.start,pageSize:E.pageSize}),{data:F}=(0,Rt.Jz)({allowedFolders:r,folder:{...Zt,id:null!==a&&void 0!==a?a:""},searchText:"",useSession:h,self:!0,includeDirectChild:!1},{skip:!a}),B=(0,wt.useMemo)((()=>{var e;return null!==(e=null===j||void 0===j?void 0:j.items)&&void 0!==e?e:void 0}),[j]),U=null!==(t=null===j||void 0===j?void 0:j.totalCount)&&void 0!==t?t:0,V=(0,wt.useCallback)((()=>{if(!B)return;const e=B.length;e>=U||(S(!0),A((t=>({...t,start:e}))))}),[B,U]);(0,wt.useEffect)((()=>{const e=()=>{if(!B)return;if(r&&r.length>0){const e=B.find((e=>r.includes(e.id)));if(e)return void p(e)}const e=B.find((e=>e.title===Dt.mT));p(e||jt)};N.current&&B&&(N.current=!1,l?(0,Mt.bQ)("lastLocation").then((t=>{if("string"===typeof t)try{const n=JSON.parse(t);if(n.id===a&&!d||r&&r.length>0)return void e();p(n)}catch(n){e()}else e()})).catch((()=>{e()})):e())}),[r,a,B,l,p,d]);const{data:q,isLoading:H,isFetching:W,isError:K}=(0,Rt.$Y)(o?{folder:o,searchText:b,useSession:h,start:T.start,pageSize:T.pageSize}:Lt.hT),$=(0,wt.useMemo)((()=>{var e;return null!==(e=null===q||void 0===q?void 0:q.items)&&void 0!==e?e:void 0}),[q]),Q=null!==(n=null===q||void 0===q?void 0:q.totalCount)&&void 0!==n?n:0,X=(0,wt.useCallback)((()=>{if(!$)return;C(!0);const e=$.length;e>=Q||O((t=>({...t,start:e})))}),[$,Q]);(0,wt.useEffect)((()=>{const e=R.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.selection[0].dataset.value)&&void 0!==t?t:"{}");null===p||void 0===p||p(n)};return e.addEventListener("cx-selection-change",t),()=>{e.removeEventListener("cx-selection-change",t)}}),[x,p]),(0,wt.useEffect)((()=>{const e=P.current;if(!e)return;const t=e=>{var t;const n=JSON.parse(null!==(t=e.detail.item.value)&&void 0!==t?t:"{}");null===p||void 0===p||p(n)};return e.addEventListener("cx-select",t),()=>{e.removeEventListener("cx-select",t)}}),[x,$,p]),(0,wt.useEffect)((()=>{M||S(!1)}),[M]),(0,wt.useEffect)((()=>{W||C(!1)}),[W]);const G=(0,wt.useCallback)((()=>{if(I||M&&!k)return Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t)));if(B&&B.length>0){const o=[];var e,t,n;if(a)o.push((0,Vt.jsx)($t,{folder:{...Zt,id:a,hasChildren:null!==(e=null===F||void 0===F||null===(t=F.items)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.hasChildren)&&void 0!==e&&e},currentFolderID:i.id,icon:"star",useSession:h},a));return[...o,...(null!==B&&void 0!==B?B:[]).map((e=>(0,Vt.jsx)($t,{allowedFolders:r,folder:e,currentFolderID:i.id,searchText:b,useSession:h},e.id)))]}return L?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load folders"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No folders found"})}),[r,i.id,a,B,L,M,I,b,h,k,F]),Z=(0,wt.useCallback)((()=>H||W&&!_?Array.from({length:5}).map(((e,t)=>(0,Vt.jsx)("cx-skeleton",{},t))):$&&$.length>0?null===$||void 0===$?void 0:$.map((e=>{const t=i.id===e.id;return(0,Vt.jsxs)("cx-menu-item",{value:JSON.stringify(e),className:""+(t?"selected":""),children:[(0,Vt.jsx)("cx-icon",{slot:"prefix",name:"collections"}),Wt(e.title,b)]},e.id)})):K?(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Failed to load collections"}):(0,Vt.jsx)("cx-typography",{variant:"body3",children:"No collections found"})),[H,W,$,K,i.id,b,_]),Y={persistent:{src:Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M660-320v-320L500-480l160 160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>'),onclick:()=>{f(),g(!1)}},overlay:{src:Gt('<svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="#52525B"\n >\n <path d="M500-640v320l160-160-160-160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z" />\n </svg>'),onclick:()=>g(!0)}},J=m?Y.persistent:Y.overlay;return(0,Vt.jsxs)(Bt,{ref:z,label:"Browser",placement:"start",contained:!0,open:c,variant:v?"overlay":m?"persistent":"overlay",noCloseButton:!v&&!!m,children:[v?null:(0,Vt.jsx)("cx-icon-button",{slot:"header-actions",...J}),(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",wrap:"nowrap",children:[(0,Vt.jsxs)("cx-space",{direction:"vertical",spacing:"small",style:{padding:"var(--body-spacing) var(--body-spacing) 0"},children:[(0,Vt.jsx)("cx-typography",{variant:"body3",children:"Folders"}),(0,Vt.jsx)("cx-input",{ref:D,value:b,placeholder:"Search...",clearable:!0,autoFocus:s,className:"search-input",children:(0,Vt.jsx)("cx-icon",{name:"search",slot:"prefix",className:"icon--large"})}),(0,Vt.jsx)("div",{className:"browser__folders",children:(0,Vt.jsxs)("cx-tree",{ref:R,"force-on-change":!0,children:[G(),B&&B.length<U&&!I&&(0,Vt.jsx)(qt,{loadMore:V,isLoading:M,disabled:M})]})})]}),u&&(0,Vt.jsx)("div",{className:"browser__collections",children:(0,Vt.jsxs)("cx-details",{children:[(0,Vt.jsx)("cx-typography",{slot:"summary",variant:"body3",children:"Collections"}),(0,Vt.jsxs)("cx-menu",{ref:P,className:"browser__collections__menu",children:[Z(),$&&$.length<Q&&!H&&(0,Vt.jsx)(qt,{loadMore:X,isLoading:W,disabled:W,disabledIndentation:!0})]})]})})]})]})},Jt=[{label:"Ascending",value:"ascending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{opacity:"0.3",d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})},{label:"Descending",value:"descending",icon:()=>(0,Vt.jsxs)("svg",{slot:"prefix",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vt.jsx)("path",{opacity:"0.3",d:"M3.33333 4.7619L4.25984 5.68841L6.60714 3.33929V11.3095H7.61905V3.33929L9.96627 5.68841L10.8929 4.7619L6.96429 0.833333L3.33333 4.7619Z",fill:"currentColor"}),(0,Vt.jsx)("path",{d:"M17.0833 15.2381L16.1568 14.3116L13.8095 16.6607V8.69048H12.7976V16.6607L10.4504 14.3116L9.52381 15.2381L13.4524 19.1667L17.0833 15.2381Z",fill:"currentColor"})]})}],en=[{value:Qt.gf.Small,label:"Small labeled"},{value:Qt.gf.Medium,label:"Medium labeled"},{value:Qt.gf.Large,label:"Large labeled"}],tn=Ft.Ay.div`
|
|
107
107
|
display: flex;
|
|
108
108
|
justify-content: space-between;
|
|
109
109
|
flex-wrap: wrap;
|
|
@@ -1007,7 +1007,7 @@
|
|
|
1007
1007
|
height: 100%;
|
|
1008
1008
|
display: flex;
|
|
1009
1009
|
flex-direction: column;
|
|
1010
|
-
`,qr={containerSize:{width:0,height:0},currentCount:0,currentFolder:jt,defaultPageSize:Ut.md,facets:[],hasScrolled:!1,isLoading:!1,isSeeThrough:!0,openBrowser:!1,start:0,pageSize:0,maxPageSize:0,searchText:"",selectedFacets:{},shouldResetFilters:!0,sortDirection:void 0,sortOrder:"",totalCount:0,view:Qt.gf.Medium},Hr=(e,t)=>{const n={start:0,pageSize:e.maxPageSize};switch(t.type){case"SET_CONTAINER_SIZE":return{...e,containerSize:t.payload};case"SET_CURRENT_COUNT":return{...e,currentCount:t.payload};case"SET_CURRENT_FOLDER":return{...e,currentFolder:t.payload.folder,shouldResetFilters:!!t.payload.shouldResetFilters,...n};case"SET_FACETS":return{...e,facets:t.payload};case"SET_FILTERS":return{...e,selectedFacets:t.payload,shouldResetFilters:!1,...n};case"SET_HAS_SCROLLED":return{...e,hasScrolled:t.payload};case"SET_IS_LOADING":return{...e,isLoading:t.payload};case"SET_IS_SEE_THROUGH":return{...e,isSeeThrough:t.payload,...n};case"SET_OPEN_BROWSER":return{...e,openBrowser:t.payload};case"SET_START":return{...e,start:t.payload,pageSize:e.defaultPageSize};case"SET_PAGE_SIZE":{const n={...e,pageSize:t.payload.pageSize,maxPageSize:t.payload.pageSize};return t.payload.returnToFirstPage&&(n.start=0),n}case"SET_SEARCH_TEXT":return{...e,...n,searchText:t.payload};case"SET_SORT_DIRECTION":return{...e,...n,sortDirection:t.payload};case"SET_SORT_ORDER":return{...e,...n,sortOrder:t.payload};case"SET_TOTAL_COUNT":return{...e,totalCount:t.payload};case"SET_VIEW":{let n=Ut.md;switch(t.payload){case Qt.gf.Large:n=15;break;case Qt.gf.Medium:n=20;break;case Qt.gf.Small:n=30}return{...e,view:t.payload,defaultPageSize:n}}case"RESET_SEARCH":return{...e,currentCount:0,currentFolder:jt,searchText:"",totalCount:0};default:return e}},Wr=()=>{var e;const[t,n]=(0,wt.useReducer)(Hr,qr),r=(0,Mr.GV)(Fr.jT),o=(0,Mr.GV)(Fr.wL),i=(0,Mr.GV)(Lr.OC),{allowedExtensions:a,allowedFolders:s,allowFavorites:l,allowProxy:c,allowTracking:u,availableDocTypes:d,availableRepresentativeSubtypes:h,ctaText:p,lastLocationMode:f,persistMode:m,showCollections:g,showFavoriteFolder:v,showVersions:b,defaultGridView:y}=(0,wt.useContext)(ir.t),{extraFields:x,onAssetAction:w,onAssetSelected:k,onClose:S}=(0,wt.useContext)(zt.B),{data:_,isFetching:C,isError:E}=(0,Rt.aM)(i?{id:i,useSession:o}:Lt.hT),A=(0,wt.useMemo)((()=>_&&i&&_.recordId===i?_:null),[_,i]),{data:T,isFetching:O,isLoading:P,refetch:z}=(0,Br.X)({});(0,wt.useEffect)((()=>{r&&z()}),[r,z]);const{data:D,isFetching:R,isError:N}=(0,Yn.t$)(A?{assetImages:A?[A]:[],useSession:o}:Lt.hT),{data:j}=(0,Yn.jS)({useSession:o}),{data:I}=(0,Yn.M$)({useSession:o}),{ATSEnabled:M,autoExtension:L=".auto",collectionPath:F,supportedExtensions:B,supportedRepresentativeSubtypes:U}=I||{},{data:V}=(0,Yn.ZP)({useSession:o}),{data:q}=(0,Yn.nb)({useSession:o}),{data:H,refetch:W}=(0,Rt.E7)(A&&l?{recordId:A.id}:Lt.hT),[K,$]=(0,wt.useState)(!1),[Q,X]=(0,wt.useState)(!1),[G,Z]=(0,wt.useState)(sn.EI.Hide),[Y,J]=(0,wt.useState)(0),[ee,te]=(0,wt.useState)(!1),ne=(0,wt.useRef)(K),re=(0,wt.useRef)(null),oe=(0,wt.useRef)(null),ie=(0,wt.useRef)(null),ae=(0,wt.useRef)(!1),le=(0,wt.useRef)([]),ce=(0,Mr.jL)(),ue=(0,wt.useRef)(t.pageSize),de=(0,wt.useRef)(t.view),he=(0,wt.useRef)(!1),pe=(0,wt.useRef)(null);ne.current=K,le.current=t.facets,de.current=t.view,ue.current=t.pageSize;const fe=(0,wt.useRef)(null),me=(0,wt.useMemo)((()=>t.selectedFacets.Types&&t.selectedFacets.Types.length>0?t.selectedFacets.Types:["*"]),[t.selectedFacets]),ge=(0,wt.useMemo)((()=>!(null!==me&&void 0!==me&&me.length)||0===me.length),[me]),ve=(0,wt.useMemo)((()=>{var e;if(!V)return;const r=null===(e=Object.values(V).find((e=>e.some((e=>e.isDefault)))))||void 0===e?void 0:e[0];return t.sortOrder&&V[t.sortOrder]&&0!==V[t.sortOrder].length?1===V[t.sortOrder].length?V[t.sortOrder][0]:V[t.sortOrder].find((e=>{let{sortDirection:n}=e;return n.toLowerCase()===t.sortDirection})):(r&&(n({type:"SET_SORT_DIRECTION",payload:r.sortDirection.toLowerCase()}),n({type:"SET_SORT_ORDER",payload:r.sortDirectionGroupKey.toLowerCase()})),r)}),[V,t.sortDirection,t.sortOrder]),be=(0,wt.useMemo)((()=>null===D||void 0===D?void 0:D.proxies.filter((e=>{if(!a||0===a.length)return!0;let t="";if(e.extension)t=e.extension.replace(".","");else{var n;const r=null===(n=e.permanentLink)||void 0===n?void 0:n.split(".").at(-1);t=null!==r&&void 0!==r?r:""}return a.some((e=>!!t&&t.toLowerCase()===e.toLowerCase()))}))),[D,a]),ye=(0,wt.useMemo)((()=>Q&&V&&(null===me||void 0===me?void 0:me.length)&&K),[Q,V,me,K]),{data:xe,isFetching:we,isError:ke,refetch:_e}=(0,Rt.pf)(ye?{folderID:t.currentFolder.id,isSeeThrough:t.isSeeThrough,limitedToDocTypes:d,pageSize:t.pageSize,searchText:t.searchText,selectedFacets:t.selectedFacets,sortOrder:null===ve||void 0===ve?void 0:ve.id,start:t.start,useSession:o}:Lt.hT);(0,wt.useEffect)((()=>{var e;J(null!==(e=null===xe||void 0===xe?void 0:xe.items.length)&&void 0!==e?e:0)}),[null===xe||void 0===xe?void 0:xe.items.length]),(0,wt.useEffect)((()=>{E&&ce((0,Lr.DM)(null))}),[ce,E]),(0,wt.useEffect)((()=>{w&&null!==A&&void 0!==A&&A.recordId&&w("select",A.recordId)}),[w,A]),(0,wt.useEffect)((()=>{let e=null;return we?n({type:"SET_IS_LOADING",payload:!0}):e=setTimeout((()=>{n({type:"SET_IS_LOADING",payload:we})}),200),()=>{e&&clearTimeout(e)}}),[we]),(0,wt.useEffect)((()=>{r&&(ce((0,Lr.DM)(null)),n({type:"RESET_SEARCH"}),Promise.all([(0,Mt.bQ)("selectedSortOrder"),(0,Mt.bQ)("selectedSortDirection"),(0,Mt.bQ)("selectedView"),(0,Mt.bQ)("newFacets"),(0,Mt.bQ)("selectedFilter"),(0,Mt.bQ)("selectedIsSeeThrough"),(0,Mt.bQ)("searchText")]).then((e=>{let[t,r,o,i,a,s,l]=e;if(t&&n({type:"SET_SORT_ORDER",payload:t}),"ascending"!==r&&"descending"!==r||n({type:"SET_SORT_DIRECTION",payload:r}),null===o&&(o=y),"string"===typeof o&&(Object.values(Qt.gf).includes(o)?n({type:"SET_VIEW",payload:o}):n({type:"SET_VIEW",payload:Qt.gf.Medium})),f){if(i){const e=JSON.parse(i);(0,Xe.A)(e)?n({type:"SET_FACETS",payload:e}):n({type:"SET_FACETS",payload:[]})}if(a){const e=JSON.parse(a);n(e?{type:"SET_FILTERS",payload:xt(e,Xe.A)}:{type:"SET_FILTERS",payload:{}})}s&&n({type:"SET_IS_SEE_THROUGH",payload:"true"===s}),l&&n({type:"SET_SEARCH_TEXT",payload:l})}ae.current=!0})))}),[ce,r,f,y]),(0,wt.useEffect)((()=>{let e=null;const t=re.current;if(!t)return;const n=t.offsetWidth;return t.style.width=n-1+"px",e=setTimeout((()=>{t.style.width="100%"}),50),()=>{e&&clearTimeout(e)}}),[r]),(0,wt.useEffect)((()=>{const e=ie.current;if(!e)return;const t=e=>{const t=e.detail.entries;window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&t[0].target===re.current&&n({type:"SET_CONTAINER_SIZE",payload:{width:t[0].contentRect.width,height:t[0].contentRect.height}})}))};return e.addEventListener("cx-resize",t),()=>{e.removeEventListener("cx-resize",t)}}),[]),(0,wt.useEffect)((()=>{!ve&&ae.current&&n({type:"SET_SORT_ORDER",payload:qr.sortOrder})}),[ve,V]),(0,wt.useEffect)((()=>{ae.current&&((0,Mt.yt)("selectedSortOrder",t.sortOrder),t.sortDirection&&(0,Mt.yt)("selectedSortDirection",t.sortDirection),(0,Mt.yt)("selectedView",t.view),(0,Mt.yt)("newFacets",JSON.stringify(t.facets)),(0,Mt.yt)("selectedFilter",JSON.stringify(t.selectedFacets)),(0,Mt.yt)("selectedIsSeeThrough",t.isSeeThrough.toString()),(0,Mt.yt)("searchText",t.searchText))}),[t.currentFolder,t.facets,t.isSeeThrough,t.sortDirection,t.sortOrder,t.searchText,t.view,t.selectedFacets]);const Ce=t.containerSize.width<=Ut.Pm,Ee=e=>{ce((0,Lr.DM)(e.recordId))},Ae=(0,wt.useCallback)((e=>{ce((0,Lr.DM)(null)),n({type:"SET_SEARCH_TEXT",payload:e})}),[ce]),Te=(0,wt.useRef)(0),Oe=(0,wt.useRef)(0),Pe=(0,wt.useRef)(t.defaultPageSize);Pe.current=t.defaultPageSize;const ze=(0,wt.useCallback)(((e,t)=>{var r;const{width:o,height:i}=e,a=o||0,s=i||0;if(a*s===0||!ae.current)return;const l=Te.current,c=Oe.current;if(Math.abs(l-s)<10&&Math.abs(c-a)<10&&(null===t||void 0===t||!t.force))return;Te.current=s,Oe.current=a;const u=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cx-spacing-medium")||"16",10),d=(null===(r=Dr[de.current])||void 0===r?void 0:r.minWidth)||Dr[Qt.gf.Large].minWidth,h=Math.max(1,Math.floor((a+u)/(d+u))),p=Math.ceil(s/(d+u)),f=Math.ceil(p*h/Pe.current+1)*Pe.current;X(!0),f!==ue.current&&0!==f&&n({type:"SET_PAGE_SIZE",payload:{pageSize:f,returnToFirstPage:!(null===t||void 0===t||!t.returnToFirstPage)}})}),[]),De=(0,wt.useMemo)((()=>Se(ze,Ut.h,{leading:!1})),[ze]);(0,wt.useEffect)((()=>{if(ae.current){const e=oe.current;de.current=t.view,e&&De({width:e.clientWidth,height:e.clientHeight},{returnToFirstPage:!0,force:!0})}}),[De,t.view]);const Re=(0,wt.useCallback)(((e,t)=>{switch(e){case"view":n({type:"SET_VIEW",payload:t});break;case"sortDirection":n({type:"SET_SORT_DIRECTION",payload:t});break;case"sortOrder":n({type:"SET_SORT_ORDER",payload:t.toString()});break;case"isSeeThrough":n({type:"SET_IS_SEE_THROUGH",payload:Boolean(t)});break;case"filter":n({type:"SET_FILTERS",payload:t})}}),[]),Ne=(0,wt.useCallback)((e=>{n({type:"SET_CURRENT_COUNT",payload:e.currentCount}),n({type:"SET_TOTAL_COUNT",payload:e.totalCount}),n({type:"SET_FACETS",payload:e.facets})}),[]),je=(0,wt.useCallback)((async e=>{ne.current||$(!0);const t=await ce(It(e));It.fulfilled.match(t)&&(n({type:"SET_CURRENT_FOLDER",payload:{folder:e,shouldResetFilters:ne.current}}),ee||n({type:"SET_OPEN_BROWSER",payload:!1}),ce((0,Lr.DM)(null)),(0,Mt.yt)("lastLocation",JSON.stringify(e)))}),[ce,ee]),Ie=(0,wt.useCallback)((()=>{he.current?he.current=!1:n({type:"SET_START",payload:null!==Y&&void 0!==Y?Y:0})}),[Y]),Me=(0,wt.useCallback)((e=>{if(!e.target)return;const t=e.target.scrollTop;n(0===t?{type:"SET_HAS_SCROLLED",payload:!1}:{type:"SET_HAS_SCROLLED",payload:!0})}),[]),Le=(0,wt.useCallback)((async(e,t,n)=>{const r=[...e];Dt.Yq.forEach((e=>{const o=se(e);var i,a,s,l,c,u,d,h,p,f;A&&null!==x&&void 0!==x&&x.includes(e)&&(r[0]={...r[0],extraFields:{...(null===(i=r[0])||void 0===i?void 0:i.extraFields)||{},[e]:A[o]}});n?r[0]={...r[0],assetTransformationSource:t,assetLinkInfo:{extension:n.extension,isCustomFormat:null===(a=n.isCustomFormat)||void 0===a||a,permanentLink:r[0].imageUrl,width:n.width,height:n.height}}:r[0]={...r[0],assetLinkInfo:{cdnName:null!==(s=null===t||void 0===t?void 0:t.cdnName)&&void 0!==s?s:null,extension:null!==(l=null===t||void 0===t?void 0:t.extension)&&void 0!==l?l:null,isCustomFormat:null!==(c=null===t||void 0===t?void 0:t.isCustomFormat)&&void 0!==c&&c,permanentLink:null!==(u=r[0].imageUrl)&&void 0!==u?u:null,proxyLabel:null!==(d=null===t||void 0===t?void 0:t.proxyLabel)&&void 0!==d?d:null,proxyName:null!==(h=null===t||void 0===t?void 0:t.proxyName)&&void 0!==h?h:null,width:null!==(p=null===t||void 0===t?void 0:t.width)&&void 0!==p?p:null,height:null!==(f=null===t||void 0===t?void 0:t.height)&&void 0!==f?f:null}}}));const o=k(r);if("object"===typeof(i=o)&&null!==i&&"function"===typeof i.then)try{await o}catch(a){return void console.error("Error in onAssetSelected:",a)}var i;m||null===S||void 0===S||S()}),[x,k,S,m,A]),Fe=(0,wt.useMemo)((()=>!!xe&&t.start+t.pageSize<t.totalCount),[xe,t.pageSize,t.start,t.totalCount]);(0,wt.useEffect)((()=>{var e,t,n,r;Ne&&Ne({currentCount:null!==(e=null===xe||void 0===xe?void 0:xe.items.length)&&void 0!==e?e:0,items:null!==(t=null===xe||void 0===xe?void 0:xe.items)&&void 0!==t?t:[],facets:null!==(n=null===xe||void 0===xe?void 0:xe.facets)&&void 0!==n?n:[],totalCount:null!==(r=null===xe||void 0===xe?void 0:xe.totalCount)&&void 0!==r?r:0})}),[xe,Ne]),(0,wt.useEffect)((()=>{const e=()=>{he.current=!0,pe.current&&clearTimeout(pe.current),pe.current=setTimeout((()=>{he.current=!1}),Ut.h)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,wt.useEffect)((()=>{const e=fe.current,t=()=>{e&&window.clearTimeout(e)};return t(),C||R?(Z(sn.EI.Hide),fe.current=window.setTimeout((()=>{Z(sn.EI.ShowLoader)}),800)):C||R||!(null!==D&&void 0!==D&&D.proxies||N)||fe.current&&(t(),Z(sn.EI.ShowDialog)),()=>{t()}}),[D,N,R,C]),(0,wt.useEffect)((()=>{A||Z(sn.EI.ShowDialog)}),[A]);const Be=(0,wt.useMemo)((()=>j&&a&&0!==a.length?Object.entries(j).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:r.filter((e=>!a||0===a.length||a.some((t=>e.value.toLowerCase()===`.${t.toLowerCase()}`))))}}),j):j),[j,a]),Ue=t.containerSize.width<650;return(0,Vt.jsx)("cx-resize-observer",{ref:ie,children:(0,Vt.jsxs)(Ur,{ref:re,children:[(0,Vt.jsx)(Yt,{allowedFolders:s,collectionPath:F,currentFolder:t.currentFolder,favoriteFolderId:null===T||void 0===T?void 0:T.favoriteFolderRecordID,lastLocationMode:f,open:t.openBrowser,showCollections:g,showFavoriteFolder:v,useSession:o,onFolderSelect:je,onClose:()=>n({type:"SET_OPEN_BROWSER",payload:!1}),isPersistent:ee,onChangePersistent:te,forceOverlay:Ue}),(0,Vt.jsxs)(Vr,{children:[(0,Vt.jsx)(sr,{bordered:t.hasScrolled,currentFolder:t.currentFolder,isFetching:O,isLoading:P,userInfo:T,onMenuClick:()=>n({type:"SET_OPEN_BROWSER",payload:!0}),onLogout:()=>{ce((0,Fr.ri)()),ce((0,Lr.DM)(null)),n({type:"RESET_SEARCH"})},children:(0,Vt.jsx)(on,{allowSorting:"Mono"!==(null===ve||void 0===ve?void 0:ve.sortDirection)&&!!ve,availableFacets:null!==q&&void 0!==q?q:[],currentCount:t.currentCount,facets:t.facets,isMobile:Ce,isSeeThrough:t.isSeeThrough,loading:t.isLoading,searchValue:t.searchText,selectedFacets:t.selectedFacets,sortDirection:t.sortDirection,sortOrder:t.sortOrder,sortOrders:V,totalCount:t.totalCount,view:t.view,onSearchChange:Ae,onSettingChange:Re})}),(0,Vt.jsx)("div",{style:{flex:1,minHeight:"320px",padding:"0 var(--cx-spacing-medium)",position:"relative"},children:(0,Vt.jsx)(Pt,{onResize:De,children:e=>{let{height:n,width:r}=e;return(0,Vt.jsx)("div",{style:{height:n+"px",width:r+"px"},children:(0,Vt.jsx)(Ir,{ref:oe,isError:ke,isConfigError:ge,hasNextPage:Fe,height:n,isLoadingData:t.isLoading||!xe,isFetched:!!xe||ge,items:(null===xe||void 0===xe?void 0:xe.items)||[],selectedAsset:null!==A&&void 0!==A?A:null,view:t.view,width:r,onItemSelect:Ee,onLoadMore:Ie,onScroll:Me},t.currentFolder.id+t.searchText+Object.values(t.selectedFacets).join("+")+t.isSeeThrough+t.view)})}})}),G===sn.EI.ShowLoader&&(0,Vt.jsx)("cx-space",{className:"format-loader",children:(0,Vt.jsx)("cx-spinner",{})}),(0,Vt.jsx)(or,{allowCustomFormat:!!M&&!(null===A||void 0===A||!A.allowATSLink),allowFavorites:l,allowProxy:c,allowTracking:u,allowedExtensions:a,appendAutoExtension:null!==(e=null===a||void 0===a?void 0:a.includes(L))&&void 0!==e&&e,autoExtension:L,availableExtensions:Be,availableProxies:N?[]:R?void 0:be,ctaText:p,extensions:null!==B&&void 0!==B?B:[],isFavorite:!!H,maxHeight:t.containerSize.height,open:!!A&&G===sn.EI.ShowDialog,previewUrl:N||R||null===D||void 0===D?void 0:D.previewUrl,selectedAsset:null!==A&&void 0!==A?A:null,showVersions:b,supportedRepresentativeSubtypes:null!==h&&void 0!==h&&h.length?Qe(h,U):U,variant:Ce?"drawer":"dialog",boundary:re.current,onClose:()=>{ce((0,Lr.DM)(null)),w("unselect","")},onFavorite:async()=>{if(!A)return!1;const e=await ce((0,Lr.P1)({recordId:A.recordId}));return Lr.P1.fulfilled.match(e)&&(w&&w("favorite",A.recordId),await W(),t.currentFolder.id===(null===T||void 0===T?void 0:T.favoriteFolderRecordID)&&(0===t.start?_e():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e},onProxyConfirm:async e=>{let{extension:t,value:n,permanentLink:r,parameters:i,useRepresentative:a,selectedProxyMetadata:s}=e;if(!A)return;const l=await ce((0,Lr.Tp)({extension:t,extraFields:x,parameters:i,permanentLink:r,proxiesPreference:n,selectedAsset:A,useRepresentative:a,useSession:o}));Lr.Tp.fulfilled.match(l)&&await Le(l.payload,s)},onFormatConfirm:async e=>{let{value:t,parameters:n,proxiesPreference:r,extension:i,sourceProxyMetadata:a,transformedAssetMetadata:s}=e;if(!A)return;const l=null!==A&&void 0!==A&&A.width?parseInt(A.width,10):0,c=null!==A&&void 0!==A&&A.height?parseInt(A.height,10):0,u=await ce((0,Lr.Tp)({extraFields:x,extension:i,maxHeight:c,maxWidth:l,parameters:n,proxiesPreference:r,selectedAsset:A,useSession:o,transformations:t}));Lr.Tp.fulfilled.match(u)&&await Le(u.payload,a,s)},onUnFavorite:async()=>{if(!A)return!1;const e=await ce((0,Lr.BZ)({recordId:A.recordId}));return Lr.BZ.fulfilled.match(e)&&(w&&w("unfavorite",A.recordId),await W(),t.currentFolder.id===(null===T||void 0===T?void 0:T.favoriteFolderRecordID)&&(0===t.start?_e():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e}})]})]})})}},9989:e=>{"use strict";var t=!("undefined"===typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},9993:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(4802),o=n(3903),i=n(3239),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;const s=function(e){return(0,i.A)(e)&&(0,o.A)(e.length)&&!!a[(0,r.A)(e)]};var l=n(7328),c=n(8187),u="object"==typeof exports&&exports&&!exports.nodeType&&exports,d=u&&"object"==typeof module&&module&&!module.nodeType&&module,h=d&&d.exports===u&&c.A.process,p=function(){try{var e=d&&d.require&&d.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(t){}}();var f=p&&p.isTypedArray;const m=f?(0,l.A)(f):s}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.d(r,{default:()=>xm});var e=n(4391),t=n(5137);const o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),s=new WeakMap;let l=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&s.set(t,e))}return e}toString(){return this.cssText}};const c=e=>new l("string"==typeof e?e:e+"",void 0,a),u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const o=1===e.length?e[0]:n.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new l(o,e,a)},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,b=globalThis,y=b.trustedTypes,x=y?y.emptyScript:"",w=b.reactiveElementPolyfillSupport,k=(e,t)=>e,S={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},_=(e,t)=>!h(e,t),C={attribute:!0,type:String,converter:S,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C;if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:o}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);o?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){const e=this.properties,t=[...m(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const e=this._$Eu(t,n);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:S).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:S;this._$Em=r;const i=o.fromAttribute(t,e.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const r=this.constructor,o=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??_)(o,t)||n.useDefault&&n.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,n,r){let{useDefault:o,reflect:i,wrapped:a}=n;o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(ke){throw e=!1,this._$EM(),ke}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[k("elementProperties")]=new Map,E[k("finalized")]=new Map,w?.({ReactiveElement:E}),(b.reactiveElementVersions??=[]).push("2.1.1");const A=globalThis,T=A.trustedTypes,O=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,P="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+z,R=`<${D}>`,N=document,j=()=>N.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,L="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,V=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,H=/"/g,W=/^(?:script|style|textarea|title)$/i,K=e=>function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return{_$litType$:e,strings:t,values:r}},$=K(1),Q=(K(2),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),G=new WeakMap,Z=N.createTreeWalker(N,129);function Y(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(t):t}class J{constructor(e,t){let n,{strings:r,_$litType$:o}=e;this.parts=[];let i=0,a=0;const s=r.length-1,l=this.parts,[c,u]=((e,t)=>{const n=e.length-1,r=[];let o,i=2===t?"<svg>":3===t?"<math>":"",a=F;for(let s=0;s<n;s++){const t=e[s];let n,l,c=-1,u=0;for(;u<t.length&&(a.lastIndex=u,l=a.exec(t),null!==l);)u=a.lastIndex,a===F?"!--"===l[1]?a=B:void 0!==l[1]?a=U:void 0!==l[2]?(W.test(l[2])&&(o=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=o??F,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?V:'"'===l[3]?H:q):a===H||a===q?a=V:a===B||a===U?a=F:(a=V,o=void 0);const d=a===V&&e[s+1].startsWith("/>")?" ":"";i+=a===F?t+R:c>=0?(r.push(n),t.slice(0,c)+P+t.slice(c)+z+d):t+z+(-2===c?s:d)}return[Y(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(r,o);if(this.el=J.createElement(c,t),Z.currentNode=this.el.content,2===o||3===o){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&l.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(P)){const t=u[a++],r=n.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?oe:"?"===o[1]?ie:"@"===o[1]?ae:re}),n.removeAttribute(e)}else e.startsWith(z)&&(l.push({type:6,index:i}),n.removeAttribute(e));if(W.test(n.tagName)){const e=n.textContent.split(z),t=e.length-1;if(t>0){n.textContent=T?T.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],j()),Z.nextNode(),l.push({type:2,index:++i});n.append(e[t],j())}}}else if(8===n.nodeType)if(n.data===D)l.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(z,e+1));)l.push({type:7,index:i}),e+=z.length-1}i++}}static createElement(e,t){const n=N.createElement("template");return n.innerHTML=e,n}}function ee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;if(t===Q)return t;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=I(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(e),o._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(t=ee(e,o._$AS(e,t.values),o,r)),t}class te{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??N).importNode(t,!0);Z.currentNode=r;let o=Z.nextNode(),i=0,a=0,s=n[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new ne(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new se(o,this,e)),this._$AV.push(t),s=n[++a]}i!==s?.index&&(o=Z.nextNode(),i++)}return Z.currentNode=N,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class ne{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e){e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),I(e)?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>M(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==X&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(N.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=J.createElement(Y(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new J(e)),t}k(e){M(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const o of e)r===t.length?t.push(n=new ne(this.O(j()),this.O(j()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,t=arguments.length>1?arguments[1]:void 0;for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=this.strings;let i=!1;if(void 0===o)e=ee(this,e,t,0),i=!I(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{const r=e;let a,s;for(e=o[0],a=0;a<o.length-1;a++)s=ee(this,r[n+a],t,a),s===Q&&(s=this._$AH[a]),i||=!I(s)||s!==this._$AH[a],s===X?e=X:e!==X&&(e+=(s??"")+o[a+1]),this._$AH[a]=s}i&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class oe extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class ie extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class ae extends re{constructor(e,t,n,r,o){super(e,t,n,r,o),this.type=5}_$AI(e){if((e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??X)===Q)return;const t=this._$AH,n=e===X&&t!==X||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,r=e!==X&&(t===X||n);n&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}const le={I:ne},ce=A.litHtmlPolyfillSupport;ce?.(J,ne),(A.litHtmlVersions??=[]).push("3.3.1");const ue=globalThis;class de extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let o=r._$litPart$;if(void 0===o){const e=n?.renderBefore??null;r._$litPart$=o=new ne(t.insertBefore(j(),e),e,void 0,n??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}de._$litElement$=!0,de.finalized=!0,ue.litElementHydrateSupport?.({LitElement:de});const he=ue.litElementPolyfillSupport;he?.({LitElement:de}),(ue.litElementVersions??=[]).push("4.2.1");const pe={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:_};function fe(e){return(t,n)=>"object"==typeof n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;const{kind:r,metadata:o}=n;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const o=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,o,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=n;return function(n){const o=this[r];t.call(this,n),this.requestUpdate(r,o,e)}}throw Error("Unsupported decorator location: "+r)}(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var me=Object.defineProperty,ge=(e,t,n,r)=>{for(var o,i=void 0,a=e.length-1;a>=0;a--)(o=e[a])&&(i=o(t,n,i)||i);return i&&me(t,n,i),i};const ve=class extends de{emit(e,t){const n=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:{},...t});return this.dispatchEvent(n),n}static define(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=customElements.get(e);if(!r){try{customElements.define(e,t,n)}catch{customElements.define(e,class extends t{},n)}return}let o=" (unknown version)",i=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in r&&r.version&&(i=" v"+r.version),(!o||!i||o!==i)&&console.warn(`Attempted to register <${e}>${o}, but <${e}>${i} has already been registered.`)}static createProperty(e,t){super.createProperty(e,t),t?.attribute&&"string"==typeof t.attribute&&!Object.prototype.hasOwnProperty.call(this.prototype,t.attribute)&&Object.prototype.hasOwnProperty.call(this.prototype,e)&&Object.defineProperty(this.prototype,t.attribute,{get(){return this[e]},set(t){this[e]=t}})}constructor(){super(),Object.entries(this.constructor.dependencies).forEach((e=>{let[t,n]=e;this.constructor.define(t,n)}))}};ve.version="1",ve.dependencies={};let be=ve;ge([fe()],be.prototype,"dir"),ge([fe()],be.prototype,"lang");const ye=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.get(e)||window.customElements.define(e,t),t))(e,t):((e,t)=>{const{elements:n,kind:r}=t;return{elements:n,finisher(t){window.customElements.get(e)||window.customElements.define(e,t)},kind:r}})(e,t),xe=u`
|
|
1010
|
+
`,qr={containerSize:{width:0,height:0},currentCount:0,currentFolder:jt,defaultPageSize:Ut.md,facets:[],hasScrolled:!1,isLoading:!1,isSeeThrough:!0,openBrowser:!1,start:0,pageSize:0,maxPageSize:0,searchText:"",selectedFacets:{},shouldResetFilters:!0,sortDirection:void 0,sortOrder:"",totalCount:0,view:Qt.gf.Medium},Hr=(e,t)=>{const n={start:0,pageSize:e.maxPageSize};switch(t.type){case"SET_CONTAINER_SIZE":return{...e,containerSize:t.payload};case"SET_CURRENT_COUNT":return{...e,currentCount:t.payload};case"SET_CURRENT_FOLDER":return{...e,currentFolder:t.payload.folder,shouldResetFilters:!!t.payload.shouldResetFilters,...n};case"SET_FACETS":return{...e,facets:t.payload};case"SET_FILTERS":return{...e,selectedFacets:t.payload,shouldResetFilters:!1,...n};case"SET_HAS_SCROLLED":return{...e,hasScrolled:t.payload};case"SET_IS_LOADING":return{...e,isLoading:t.payload};case"SET_IS_SEE_THROUGH":return{...e,isSeeThrough:t.payload,...n};case"SET_OPEN_BROWSER":return{...e,openBrowser:t.payload};case"SET_START":return{...e,start:t.payload,pageSize:e.defaultPageSize};case"SET_PAGE_SIZE":{const n={...e,pageSize:t.payload.pageSize,maxPageSize:t.payload.pageSize};return t.payload.returnToFirstPage&&(n.start=0),n}case"SET_SEARCH_TEXT":return{...e,...n,searchText:t.payload};case"SET_SORT_DIRECTION":return{...e,...n,sortDirection:t.payload};case"SET_SORT_ORDER":return{...e,...n,sortOrder:t.payload};case"SET_TOTAL_COUNT":return{...e,totalCount:t.payload};case"SET_VIEW":{let n=Ut.md;switch(t.payload){case Qt.gf.Large:n=15;break;case Qt.gf.Medium:n=20;break;case Qt.gf.Small:n=30}return{...e,view:t.payload,defaultPageSize:n}}case"RESET_SEARCH":return{...e,currentCount:0,currentFolder:jt,searchText:"",totalCount:0};default:return e}},Wr=()=>{var e;const[t,n]=(0,wt.useReducer)(Hr,qr),r=(0,Mr.GV)(Fr.jT),o=(0,Mr.GV)(Fr.wL),i=(0,Mr.GV)(Lr.OC),{allowedExtensions:a,allowFavorites:s,allowProxy:l,allowTracking:c,availableDocTypes:u,availableRepresentativeSubtypes:d,ctaText:h,lastLocationMode:p,persistMode:f,showCollections:m,showVersions:g,defaultGridView:v}=(0,wt.useContext)(ir.t),{extraFields:b,onAssetAction:y,onAssetSelected:x,onClose:w}=(0,wt.useContext)(zt.B),{data:k,isFetching:S,isError:_}=(0,Rt.aM)(i?{id:i,useSession:o}:Lt.hT),C=(0,wt.useMemo)((()=>k&&i&&k.recordId===i?k:null),[k,i]),{data:E,isFetching:A,isLoading:T,refetch:O}=(0,Br.X)({});(0,wt.useEffect)((()=>{r&&O()}),[r,O]);const{data:P,isFetching:z,isError:D}=(0,Yn.t$)(C?{assetImages:C?[C]:[],useSession:o}:Lt.hT),{data:R}=(0,Yn.jS)({useSession:o}),{data:N}=(0,Yn.M$)({useSession:o}),{ATSEnabled:j,autoExtension:I=".auto",collectionPath:M,supportedExtensions:L,supportedRepresentativeSubtypes:F}=N||{},{data:B}=(0,Yn.ZP)({useSession:o}),{data:U}=(0,Yn.nb)({useSession:o}),{data:V,refetch:q}=(0,Rt.E7)(C&&s?{recordId:C.id}:Lt.hT),[H,W]=(0,wt.useState)(!1),[K,$]=(0,wt.useState)(!1),[Q,X]=(0,wt.useState)(sn.EI.Hide),[G,Z]=(0,wt.useState)(0),[Y,J]=(0,wt.useState)(!1),ee=(0,wt.useRef)(H),te=(0,wt.useRef)(null),ne=(0,wt.useRef)(null),re=(0,wt.useRef)(null),oe=(0,wt.useRef)(!1),ie=(0,wt.useRef)([]),ae=(0,Mr.jL)(),le=(0,wt.useRef)(t.pageSize),ce=(0,wt.useRef)(t.view),ue=(0,wt.useRef)(!1),de=(0,wt.useRef)(null);ee.current=H,ie.current=t.facets,ce.current=t.view,le.current=t.pageSize;const he=(0,wt.useRef)(null),pe=(0,wt.useMemo)((()=>t.selectedFacets.Types&&t.selectedFacets.Types.length>0?t.selectedFacets.Types:["*"]),[t.selectedFacets]),fe=(0,wt.useMemo)((()=>!(null!==pe&&void 0!==pe&&pe.length)||0===pe.length),[pe]),me=(0,wt.useMemo)((()=>{var e;if(!B)return;const r=null===(e=Object.values(B).find((e=>e.some((e=>e.isDefault)))))||void 0===e?void 0:e[0];return t.sortOrder&&B[t.sortOrder]&&0!==B[t.sortOrder].length?1===B[t.sortOrder].length?B[t.sortOrder][0]:B[t.sortOrder].find((e=>{let{sortDirection:n}=e;return n.toLowerCase()===t.sortDirection})):(r&&(n({type:"SET_SORT_DIRECTION",payload:r.sortDirection.toLowerCase()}),n({type:"SET_SORT_ORDER",payload:r.sortDirectionGroupKey.toLowerCase()})),r)}),[B,t.sortDirection,t.sortOrder]),ge=(0,wt.useMemo)((()=>null===P||void 0===P?void 0:P.proxies.filter((e=>{if(!a||0===a.length)return!0;let t="";if(e.extension)t=e.extension.replace(".","");else{var n;const r=null===(n=e.permanentLink)||void 0===n?void 0:n.split(".").at(-1);t=null!==r&&void 0!==r?r:""}return a.some((e=>!!t&&t.toLowerCase()===e.toLowerCase()))}))),[P,a]),ve=(0,wt.useMemo)((()=>K&&B&&(null===pe||void 0===pe?void 0:pe.length)&&H),[K,B,pe,H]),{data:be,isFetching:ye,isError:xe,refetch:we}=(0,Rt.pf)(ve?{folderID:t.currentFolder.id,isSeeThrough:t.isSeeThrough,limitedToDocTypes:u,pageSize:t.pageSize,searchText:t.searchText,selectedFacets:t.selectedFacets,sortOrder:null===me||void 0===me?void 0:me.id,start:t.start,useSession:o}:Lt.hT);(0,wt.useEffect)((()=>{var e;Z(null!==(e=null===be||void 0===be?void 0:be.items.length)&&void 0!==e?e:0)}),[null===be||void 0===be?void 0:be.items.length]),(0,wt.useEffect)((()=>{_&&ae((0,Lr.DM)(null))}),[ae,_]),(0,wt.useEffect)((()=>{y&&null!==C&&void 0!==C&&C.recordId&&y("select",C.recordId)}),[y,C]),(0,wt.useEffect)((()=>{let e=null;return ye?n({type:"SET_IS_LOADING",payload:!0}):e=setTimeout((()=>{n({type:"SET_IS_LOADING",payload:ye})}),200),()=>{e&&clearTimeout(e)}}),[ye]),(0,wt.useEffect)((()=>{r&&(ae((0,Lr.DM)(null)),n({type:"RESET_SEARCH"}),Promise.all([(0,Mt.bQ)("selectedSortOrder"),(0,Mt.bQ)("selectedSortDirection"),(0,Mt.bQ)("selectedView"),(0,Mt.bQ)("newFacets"),(0,Mt.bQ)("selectedFilter"),(0,Mt.bQ)("selectedIsSeeThrough"),(0,Mt.bQ)("searchText")]).then((e=>{let[t,r,o,i,a,s,l]=e;if(t&&n({type:"SET_SORT_ORDER",payload:t}),"ascending"!==r&&"descending"!==r||n({type:"SET_SORT_DIRECTION",payload:r}),null===o&&(o=v),"string"===typeof o&&(Object.values(Qt.gf).includes(o)?n({type:"SET_VIEW",payload:o}):n({type:"SET_VIEW",payload:Qt.gf.Medium})),p){if(i){const e=JSON.parse(i);(0,Xe.A)(e)?n({type:"SET_FACETS",payload:e}):n({type:"SET_FACETS",payload:[]})}if(a){const e=JSON.parse(a);n(e?{type:"SET_FILTERS",payload:xt(e,Xe.A)}:{type:"SET_FILTERS",payload:{}})}s&&n({type:"SET_IS_SEE_THROUGH",payload:"true"===s}),l&&n({type:"SET_SEARCH_TEXT",payload:l})}oe.current=!0})))}),[ae,r,p,v]),(0,wt.useEffect)((()=>{let e=null;const t=te.current;if(!t)return;const n=t.offsetWidth;return t.style.width=n-1+"px",e=setTimeout((()=>{t.style.width="100%"}),50),()=>{e&&clearTimeout(e)}}),[r]),(0,wt.useEffect)((()=>{const e=re.current;if(!e)return;const t=e=>{const t=e.detail.entries;window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&t[0].target===te.current&&n({type:"SET_CONTAINER_SIZE",payload:{width:t[0].contentRect.width,height:t[0].contentRect.height}})}))};return e.addEventListener("cx-resize",t),()=>{e.removeEventListener("cx-resize",t)}}),[]),(0,wt.useEffect)((()=>{!me&&oe.current&&n({type:"SET_SORT_ORDER",payload:qr.sortOrder})}),[me,B]),(0,wt.useEffect)((()=>{oe.current&&((0,Mt.yt)("selectedSortOrder",t.sortOrder),t.sortDirection&&(0,Mt.yt)("selectedSortDirection",t.sortDirection),(0,Mt.yt)("selectedView",t.view),(0,Mt.yt)("newFacets",JSON.stringify(t.facets)),(0,Mt.yt)("selectedFilter",JSON.stringify(t.selectedFacets)),(0,Mt.yt)("selectedIsSeeThrough",t.isSeeThrough.toString()),(0,Mt.yt)("searchText",t.searchText))}),[t.currentFolder,t.facets,t.isSeeThrough,t.sortDirection,t.sortOrder,t.searchText,t.view,t.selectedFacets]);const ke=t.containerSize.width<=Ut.Pm,_e=e=>{ae((0,Lr.DM)(e.recordId))},Ce=(0,wt.useCallback)((e=>{ae((0,Lr.DM)(null)),n({type:"SET_SEARCH_TEXT",payload:e})}),[ae]),Ee=(0,wt.useRef)(0),Ae=(0,wt.useRef)(0),Te=(0,wt.useRef)(t.defaultPageSize);Te.current=t.defaultPageSize;const Oe=(0,wt.useCallback)(((e,t)=>{var r;const{width:o,height:i}=e,a=o||0,s=i||0;if(a*s===0||!oe.current)return;const l=Ee.current,c=Ae.current;if(Math.abs(l-s)<10&&Math.abs(c-a)<10&&(null===t||void 0===t||!t.force))return;Ee.current=s,Ae.current=a;const u=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cx-spacing-medium")||"16",10),d=(null===(r=Dr[ce.current])||void 0===r?void 0:r.minWidth)||Dr[Qt.gf.Large].minWidth,h=Math.max(1,Math.floor((a+u)/(d+u))),p=Math.ceil(s/(d+u)),f=Math.ceil(p*h/Te.current+1)*Te.current;$(!0),f!==le.current&&0!==f&&n({type:"SET_PAGE_SIZE",payload:{pageSize:f,returnToFirstPage:!(null===t||void 0===t||!t.returnToFirstPage)}})}),[]),Pe=(0,wt.useMemo)((()=>Se(Oe,Ut.h,{leading:!1})),[Oe]);(0,wt.useEffect)((()=>{if(oe.current){const e=ne.current;ce.current=t.view,e&&Pe({width:e.clientWidth,height:e.clientHeight},{returnToFirstPage:!0,force:!0})}}),[Pe,t.view]);const ze=(0,wt.useCallback)(((e,t)=>{switch(e){case"view":n({type:"SET_VIEW",payload:t});break;case"sortDirection":n({type:"SET_SORT_DIRECTION",payload:t});break;case"sortOrder":n({type:"SET_SORT_ORDER",payload:t.toString()});break;case"isSeeThrough":n({type:"SET_IS_SEE_THROUGH",payload:Boolean(t)});break;case"filter":n({type:"SET_FILTERS",payload:t})}}),[]),De=(0,wt.useCallback)((e=>{n({type:"SET_CURRENT_COUNT",payload:e.currentCount}),n({type:"SET_TOTAL_COUNT",payload:e.totalCount}),n({type:"SET_FACETS",payload:e.facets})}),[]),Re=(0,wt.useCallback)((async e=>{ee.current||W(!0);const t=await ae(It(e));It.fulfilled.match(t)&&(n({type:"SET_CURRENT_FOLDER",payload:{folder:e,shouldResetFilters:ee.current}}),Y||n({type:"SET_OPEN_BROWSER",payload:!1}),ae((0,Lr.DM)(null)),(0,Mt.yt)("lastLocation",JSON.stringify(e)))}),[ae,Y]),Ne=(0,wt.useCallback)((()=>{ue.current?ue.current=!1:n({type:"SET_START",payload:null!==G&&void 0!==G?G:0})}),[G]),je=(0,wt.useCallback)((e=>{if(!e.target)return;const t=e.target.scrollTop;n(0===t?{type:"SET_HAS_SCROLLED",payload:!1}:{type:"SET_HAS_SCROLLED",payload:!0})}),[]),Ie=(0,wt.useCallback)((async(e,t,n)=>{const r=[...e];Dt.Yq.forEach((e=>{const o=se(e);var i,a,s,l,c,u,d,h,p,f;C&&null!==b&&void 0!==b&&b.includes(e)&&(r[0]={...r[0],extraFields:{...(null===(i=r[0])||void 0===i?void 0:i.extraFields)||{},[e]:C[o]}});n?r[0]={...r[0],assetTransformationSource:t,assetLinkInfo:{extension:n.extension,isCustomFormat:null===(a=n.isCustomFormat)||void 0===a||a,permanentLink:r[0].imageUrl,width:n.width,height:n.height}}:r[0]={...r[0],assetLinkInfo:{cdnName:null!==(s=null===t||void 0===t?void 0:t.cdnName)&&void 0!==s?s:null,extension:null!==(l=null===t||void 0===t?void 0:t.extension)&&void 0!==l?l:null,isCustomFormat:null!==(c=null===t||void 0===t?void 0:t.isCustomFormat)&&void 0!==c&&c,permanentLink:null!==(u=r[0].imageUrl)&&void 0!==u?u:null,proxyLabel:null!==(d=null===t||void 0===t?void 0:t.proxyLabel)&&void 0!==d?d:null,proxyName:null!==(h=null===t||void 0===t?void 0:t.proxyName)&&void 0!==h?h:null,width:null!==(p=null===t||void 0===t?void 0:t.width)&&void 0!==p?p:null,height:null!==(f=null===t||void 0===t?void 0:t.height)&&void 0!==f?f:null}}}));const o=x(r);if("object"===typeof(i=o)&&null!==i&&"function"===typeof i.then)try{await o}catch(a){return void console.error("Error in onAssetSelected:",a)}var i;f||null===w||void 0===w||w()}),[b,x,w,f,C]),Me=(0,wt.useMemo)((()=>!!be&&t.start+t.pageSize<t.totalCount),[be,t.pageSize,t.start,t.totalCount]);(0,wt.useEffect)((()=>{var e,t,n,r;De&&De({currentCount:null!==(e=null===be||void 0===be?void 0:be.items.length)&&void 0!==e?e:0,items:null!==(t=null===be||void 0===be?void 0:be.items)&&void 0!==t?t:[],facets:null!==(n=null===be||void 0===be?void 0:be.facets)&&void 0!==n?n:[],totalCount:null!==(r=null===be||void 0===be?void 0:be.totalCount)&&void 0!==r?r:0})}),[be,De]),(0,wt.useEffect)((()=>{const e=()=>{ue.current=!0,de.current&&clearTimeout(de.current),de.current=setTimeout((()=>{ue.current=!1}),Ut.h)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,wt.useEffect)((()=>{const e=he.current,t=()=>{e&&window.clearTimeout(e)};return t(),S||z?(X(sn.EI.Hide),he.current=window.setTimeout((()=>{X(sn.EI.ShowLoader)}),800)):S||z||!(null!==P&&void 0!==P&&P.proxies||D)||he.current&&(t(),X(sn.EI.ShowDialog)),()=>{t()}}),[P,D,z,S]),(0,wt.useEffect)((()=>{C||X(sn.EI.ShowDialog)}),[C]);const Le=(0,wt.useMemo)((()=>R&&a&&0!==a.length?Object.entries(R).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:r.filter((e=>!a||0===a.length||a.some((t=>e.value.toLowerCase()===`.${t.toLowerCase()}`))))}}),R):R),[R,a]),Fe=t.containerSize.width<650;return(0,Vt.jsx)("cx-resize-observer",{ref:re,children:(0,Vt.jsxs)(Ur,{ref:te,children:[(0,Vt.jsx)(Yt,{collectionPath:M,currentFolder:t.currentFolder,lastLocationMode:p,open:t.openBrowser,showCollections:m,useSession:o,onFolderSelect:Re,onClose:()=>n({type:"SET_OPEN_BROWSER",payload:!1}),isPersistent:Y,onChangePersistent:J,forceOverlay:Fe}),(0,Vt.jsxs)(Vr,{children:[(0,Vt.jsx)(sr,{bordered:t.hasScrolled,currentFolder:t.currentFolder,isFetching:A,isLoading:T,userInfo:E,onMenuClick:()=>n({type:"SET_OPEN_BROWSER",payload:!0}),onLogout:()=>{ae((0,Fr.ri)()),ae((0,Lr.DM)(null)),n({type:"RESET_SEARCH"})},children:(0,Vt.jsx)(on,{allowSorting:"Mono"!==(null===me||void 0===me?void 0:me.sortDirection)&&!!me,availableFacets:null!==U&&void 0!==U?U:[],currentCount:t.currentCount,facets:t.facets,isMobile:ke,isSeeThrough:t.isSeeThrough,loading:t.isLoading,searchValue:t.searchText,selectedFacets:t.selectedFacets,sortDirection:t.sortDirection,sortOrder:t.sortOrder,sortOrders:B,totalCount:t.totalCount,view:t.view,onSearchChange:Ce,onSettingChange:ze})}),(0,Vt.jsx)("div",{style:{flex:1,minHeight:"320px",padding:"0 var(--cx-spacing-medium)",position:"relative"},children:(0,Vt.jsx)(Pt,{onResize:Pe,children:e=>{let{height:n,width:r}=e;return(0,Vt.jsx)("div",{style:{height:n+"px",width:r+"px"},children:(0,Vt.jsx)(Ir,{ref:ne,isError:xe,isConfigError:fe,hasNextPage:Me,height:n,isLoadingData:t.isLoading||!be,isFetched:!!be||fe,items:(null===be||void 0===be?void 0:be.items)||[],selectedAsset:null!==C&&void 0!==C?C:null,view:t.view,width:r,onItemSelect:_e,onLoadMore:Ne,onScroll:je},t.currentFolder.id+t.searchText+Object.values(t.selectedFacets).join("+")+t.isSeeThrough+t.view)})}})}),Q===sn.EI.ShowLoader&&(0,Vt.jsx)("cx-space",{className:"format-loader",children:(0,Vt.jsx)("cx-spinner",{})}),(0,Vt.jsx)(or,{allowCustomFormat:!!j&&!(null===C||void 0===C||!C.allowATSLink),allowFavorites:s,allowProxy:l,allowTracking:c,allowedExtensions:a,appendAutoExtension:null!==(e=null===a||void 0===a?void 0:a.includes(I))&&void 0!==e&&e,autoExtension:I,availableExtensions:Le,availableProxies:D?[]:z?void 0:ge,ctaText:h,extensions:null!==L&&void 0!==L?L:[],isFavorite:!!V,maxHeight:t.containerSize.height,open:!!C&&Q===sn.EI.ShowDialog,previewUrl:D||z||null===P||void 0===P?void 0:P.previewUrl,selectedAsset:null!==C&&void 0!==C?C:null,showVersions:g,supportedRepresentativeSubtypes:null!==d&&void 0!==d&&d.length?Qe(d,F):F,variant:ke?"drawer":"dialog",boundary:te.current,onClose:()=>{ae((0,Lr.DM)(null)),y("unselect","")},onFavorite:async()=>{if(!C)return!1;const e=await ae((0,Lr.P1)({recordId:C.recordId}));return Lr.P1.fulfilled.match(e)&&(y&&y("favorite",C.recordId),await q(),t.currentFolder.id===(null===E||void 0===E?void 0:E.favoriteFolderRecordID)&&(0===t.start?we():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e},onProxyConfirm:async e=>{let{extension:t,value:n,permanentLink:r,parameters:i,useRepresentative:a,selectedProxyMetadata:s}=e;if(!C)return;const l=await ae((0,Lr.Tp)({extension:t,extraFields:b,parameters:i,permanentLink:r,proxiesPreference:n,selectedAsset:C,useRepresentative:a,useSession:o}));Lr.Tp.fulfilled.match(l)&&await Ie(l.payload,s)},onFormatConfirm:async e=>{let{value:t,parameters:n,proxiesPreference:r,extension:i,sourceProxyMetadata:a,transformedAssetMetadata:s}=e;if(!C)return;const l=null!==C&&void 0!==C&&C.width?parseInt(C.width,10):0,c=null!==C&&void 0!==C&&C.height?parseInt(C.height,10):0,u=await ae((0,Lr.Tp)({extraFields:b,extension:i,maxHeight:c,maxWidth:l,parameters:n,proxiesPreference:r,selectedAsset:C,useSession:o,transformations:t}));Lr.Tp.fulfilled.match(u)&&await Ie(u.payload,a,s)},onUnFavorite:async()=>{if(!C)return!1;const e=await ae((0,Lr.BZ)({recordId:C.recordId}));return Lr.BZ.fulfilled.match(e)&&(y&&y("unfavorite",C.recordId),await q(),t.currentFolder.id===(null===E||void 0===E?void 0:E.favoriteFolderRecordID)&&(0===t.start?we():n({type:"SET_CURRENT_FOLDER",payload:{folder:t.currentFolder,shouldResetFilters:!0}}))),!!e||e}})]})]})})}},9989:e=>{"use strict";var t=!("undefined"===typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},9993:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(4802),o=n(3903),i=n(3239),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;const s=function(e){return(0,i.A)(e)&&(0,o.A)(e.length)&&!!a[(0,r.A)(e)]};var l=n(7328),c=n(8187),u="object"==typeof exports&&exports&&!exports.nodeType&&exports,d=u&&"object"==typeof module&&module&&!module.nodeType&&module,h=d&&d.exports===u&&c.A.process,p=function(){try{var e=d&&d.require&&d.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(t){}}();var f=p&&p.isTypedArray;const m=f?(0,l.A)(f):s}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.d(r,{default:()=>xm});var e=n(4391),t=n(5137);const o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),s=new WeakMap;let l=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&s.set(t,e))}return e}toString(){return this.cssText}};const c=e=>new l("string"==typeof e?e:e+"",void 0,a),u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const o=1===e.length?e[0]:n.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new l(o,e,a)},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:g,getPrototypeOf:v}=Object,b=globalThis,y=b.trustedTypes,x=y?y.emptyScript:"",w=b.reactiveElementPolyfillSupport,k=(e,t)=>e,S={toAttribute(e,t){switch(t){case Boolean:e=e?x:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},_=(e,t)=>!h(e,t),C={attribute:!0,type:String,converter:S,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C;if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:o}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);o?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){const e=this.properties,t=[...m(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const e=this._$Eu(t,n);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:S).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:S;this._$Em=r;const i=o.fromAttribute(t,e.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const r=this.constructor,o=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??_)(o,t)||n.useDefault&&n.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,n,r){let{useDefault:o,reflect:i,wrapped:a}=n;o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(ke){throw e=!1,this._$EM(),ke}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[k("elementProperties")]=new Map,E[k("finalized")]=new Map,w?.({ReactiveElement:E}),(b.reactiveElementVersions??=[]).push("2.1.1");const A=globalThis,T=A.trustedTypes,O=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,P="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+z,R=`<${D}>`,N=document,j=()=>N.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,L="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,V=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,H=/"/g,W=/^(?:script|style|textarea|title)$/i,K=e=>function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return{_$litType$:e,strings:t,values:r}},$=K(1),Q=(K(2),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),G=new WeakMap,Z=N.createTreeWalker(N,129);function Y(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(t):t}class J{constructor(e,t){let n,{strings:r,_$litType$:o}=e;this.parts=[];let i=0,a=0;const s=r.length-1,l=this.parts,[c,u]=((e,t)=>{const n=e.length-1,r=[];let o,i=2===t?"<svg>":3===t?"<math>":"",a=F;for(let s=0;s<n;s++){const t=e[s];let n,l,c=-1,u=0;for(;u<t.length&&(a.lastIndex=u,l=a.exec(t),null!==l);)u=a.lastIndex,a===F?"!--"===l[1]?a=B:void 0!==l[1]?a=U:void 0!==l[2]?(W.test(l[2])&&(o=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=o??F,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,n=l[1],a=void 0===l[3]?V:'"'===l[3]?H:q):a===H||a===q?a=V:a===B||a===U?a=F:(a=V,o=void 0);const d=a===V&&e[s+1].startsWith("/>")?" ":"";i+=a===F?t+R:c>=0?(r.push(n),t.slice(0,c)+P+t.slice(c)+z+d):t+z+(-2===c?s:d)}return[Y(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(r,o);if(this.el=J.createElement(c,t),Z.currentNode=this.el.content,2===o||3===o){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&l.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(P)){const t=u[a++],r=n.getAttribute(e).split(z),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?oe:"?"===o[1]?ie:"@"===o[1]?ae:re}),n.removeAttribute(e)}else e.startsWith(z)&&(l.push({type:6,index:i}),n.removeAttribute(e));if(W.test(n.tagName)){const e=n.textContent.split(z),t=e.length-1;if(t>0){n.textContent=T?T.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],j()),Z.nextNode(),l.push({type:2,index:++i});n.append(e[t],j())}}}else if(8===n.nodeType)if(n.data===D)l.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(z,e+1));)l.push({type:7,index:i}),e+=z.length-1}i++}}static createElement(e,t){const n=N.createElement("template");return n.innerHTML=e,n}}function ee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;if(t===Q)return t;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=I(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(e),o._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(t=ee(e,o._$AS(e,t.values),o,r)),t}class te{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??N).importNode(t,!0);Z.currentNode=r;let o=Z.nextNode(),i=0,a=0,s=n[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new ne(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new se(o,this,e)),this._$AV.push(t),s=n[++a]}i!==s?.index&&(o=Z.nextNode(),i++)}return Z.currentNode=N,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class ne{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e){e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),I(e)?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>M(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==X&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(N.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=J.createElement(Y(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new te(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new J(e)),t}k(e){M(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const o of e)r===t.length?t.push(n=new ne(this.O(j()),this.O(j()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,t=arguments.length>1?arguments[1]:void 0;for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=this.strings;let i=!1;if(void 0===o)e=ee(this,e,t,0),i=!I(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{const r=e;let a,s;for(e=o[0],a=0;a<o.length-1;a++)s=ee(this,r[n+a],t,a),s===Q&&(s=this._$AH[a]),i||=!I(s)||s!==this._$AH[a],s===X?e=X:e!==X&&(e+=(s??"")+o[a+1]),this._$AH[a]=s}i&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class oe extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class ie extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class ae extends re{constructor(e,t,n,r,o){super(e,t,n,r,o),this.type=5}_$AI(e){if((e=ee(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??X)===Q)return;const t=this._$AH,n=e===X&&t!==X||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,r=e!==X&&(t===X||n);n&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}const le={I:ne},ce=A.litHtmlPolyfillSupport;ce?.(J,ne),(A.litHtmlVersions??=[]).push("3.3.1");const ue=globalThis;class de extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let o=r._$litPart$;if(void 0===o){const e=n?.renderBefore??null;r._$litPart$=o=new ne(t.insertBefore(j(),e),e,void 0,n??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}de._$litElement$=!0,de.finalized=!0,ue.litElementHydrateSupport?.({LitElement:de});const he=ue.litElementPolyfillSupport;he?.({LitElement:de}),(ue.litElementVersions??=[]).push("4.2.1");const pe={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:_};function fe(e){return(t,n)=>"object"==typeof n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;const{kind:r,metadata:o}=n;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const o=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,o,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=n;return function(n){const o=this[r];t.call(this,n),this.requestUpdate(r,o,e)}}throw Error("Unsupported decorator location: "+r)}(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var me=Object.defineProperty,ge=(e,t,n,r)=>{for(var o,i=void 0,a=e.length-1;a>=0;a--)(o=e[a])&&(i=o(t,n,i)||i);return i&&me(t,n,i),i};const ve=class extends de{emit(e,t){const n=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:{},...t});return this.dispatchEvent(n),n}static define(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=customElements.get(e);if(!r){try{customElements.define(e,t,n)}catch{customElements.define(e,class extends t{},n)}return}let o=" (unknown version)",i=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in r&&r.version&&(i=" v"+r.version),(!o||!i||o!==i)&&console.warn(`Attempted to register <${e}>${o}, but <${e}>${i} has already been registered.`)}static createProperty(e,t){super.createProperty(e,t),t?.attribute&&"string"==typeof t.attribute&&!Object.prototype.hasOwnProperty.call(this.prototype,t.attribute)&&Object.prototype.hasOwnProperty.call(this.prototype,e)&&Object.defineProperty(this.prototype,t.attribute,{get(){return this[e]},set(t){this[e]=t}})}constructor(){super(),Object.entries(this.constructor.dependencies).forEach((e=>{let[t,n]=e;this.constructor.define(t,n)}))}};ve.version="1",ve.dependencies={};let be=ve;ge([fe()],be.prototype,"dir"),ge([fe()],be.prototype,"lang");const ye=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.get(e)||window.customElements.define(e,t),t))(e,t):((e,t)=>{const{elements:n,kind:r}=t;return{elements:n,finisher(t){window.customElements.get(e)||window.customElements.define(e,t)},kind:r}})(e,t),xe=u`
|
|
1011
1011
|
:host {
|
|
1012
1012
|
box-sizing: border-box;
|
|
1013
1013
|
}
|
|
@@ -11464,5 +11464,5 @@ governing permissions and limitations under the License.
|
|
|
11464
11464
|
top: 0;
|
|
11465
11465
|
width: 100vw;
|
|
11466
11466
|
z-index: var(--cx-z-index-dialog);
|
|
11467
|
-
`,um=e=>{let{extraFields:t=[],containerId:r,loadExternalFonts:o=!0,multiSelect:i,onClose:a,onError:s,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onConnectClicked:d,onTokenChanged:h,onSiteUrlChanged:p}=e;const f=(0,om.GV)(im.Hb),m=(0,om.GV)(im.KL),[g,v]=(0,Gf.useState)(!0);(0,Gf.useEffect)((()=>{o?Jf().load({google:{families:["Fira Code","Fira Mono","Fira Sans","Fira Sans Condensed","Fira Sans Extra Condensed"]}}):Promise.resolve().then(n.bind(n,4781))}),[o]),(0,Gf.useEffect)((()=>{h&&f&&h(f)}),[f,h]),(0,Gf.useEffect)((()=>{p&&m&&p(m)}),[m,p]);const b=(0,Gf.useCallback)((()=>{v(!1),null===a||void 0===a||a()}),[a]),y=(0,Gf.useMemo)((()=>({extraFields:t,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onError:s,onClose:b,onConnectClicked:d})),[t,b,l,c,s,u,d]);return(0,nm.jsx)(em.B.Provider,{value:y,children:r?(0,nm.jsx)(lm,{multiSelect:i}):(0,nm.jsx)(cm,{open:g,children:(0,nm.jsx)(lm,{multiSelect:i})})})};var dm=n(5650),hm=n(5873),pm=n(3943),fm=n(9063),mm=n(5029),gm=n(4413);class vm{static getInstance(){return vm.instance||(vm.instance=new vm),vm.instance}async fetchAssets(e){const t=await om.M_.dispatch(fm.PG.endpoints.getAssets.initiate(e,{forceRefetch:!0}));return"data"in t?t.data:{facets:[],items:[],totalCount:0}}async fetchFolders(e){var t;const n=await om.M_.dispatch(fm.PG.endpoints.getFolders.initiate({...e,pageSize:null!==(t=e.pageSize)&&void 0!==t?t:gm.VH},{forceRefetch:!0}));return"data"in n?n.data:{items:[],totalCount:0}}}vm.instance=void 0;const bm=vm.getInstance(),ym={help:()=>{console.log("/* Orange DAM Content Browser SDK Example */\n window.OrangeDAMContentBrowser.open({\n onAssetSelected: (assets) => {\n // Callback function triggered when assets are selected\n console.log(assets);\n window.open(assets[0]?.imageUrl, '_blank');\n },\n onError: (errorMessage, error) => {\n // Callback function triggered when an error occurs\n console.error(errorMessage, error);\n },\n onClose: () => {\n // Callback function triggered when the browser is closed\n window.alert('Content Browser is closing');\n },\n containerId: \"\", // ID of the container to attach the browser; opens in a popup if blank\n extraFields: ['coreField.OriginalFileName', 'document.CortexPath'], // Additional fields to retrieve from the assets\n baseUrl: \"\", // Default base URL to pre-fill in the content browser\n displayInfo: {\n title: true, // Whether to display the asset title\n dimension: true, // Whether to display the asset dimensions\n fileSize: false, // Whether to display the file size\n tags: false, // Whether to display the asset tags\n },\n publicApplicationName: \"\", // Public name of the DAM to display on the login screen\n pluginName: \"OrangeDAM Content Browser\", // Name of the plugin to display on the login screen\n ctaText: \"Insert\", // Text to display on the insert button\n persistMode: true, // Whether the browser remains open after selecting an asset\n availableDocTypes: ['Images*', 'Videos*', 'Audio*', 'Others*'], // An array of available OrangeDAM asset types to filter the assets. The available doc types will be configured in OL Platform. If not provided, all doc types will be available. \n availableRepresentativeSubtypes: ['Other'], // Array of supported subtypes for representative images\n showCollections: true, // Whether to show collections in the content browser\n lastLocationMode: true, // Whether to open the last selected folder on load\n allowTracking: true, // Whether to enable tracking parameters for asset URLs\n });")},open:async n=>{let{onAssetAction:r,onAssetSelected:o,onImageSelected:i,onError:a,onClose:s,onRequestToken:l,onTokenChanged:c,onConnectClicked:u,onSiteUrlChanged:d,customStorage:h,allowedExtensions:p,allowedFolders:f,allowFavorites:m,allowLogout:g,allowProxy:v,allowTracking:b,availableDocTypes:y,availableRepresentativeSubtypes:x,baseUrl:w,containerId:k,ctaText:S,displayInfo:_={title:!0,dimension:!0,fileSize:!1,tags:!1},extraFields:C,lastLocationMode:E,loadExternalFonts:A,multiSelect:T,persistMode:O,pluginName:P,publicApplicationName:z,showCollections:D,showFavoriteFolder:R,showVersions:N,useSession:j,defaultGridView:I}=n
|
|
11467
|
+
`,um=e=>{let{extraFields:t=[],containerId:r,loadExternalFonts:o=!0,multiSelect:i,onClose:a,onError:s,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onConnectClicked:d,onTokenChanged:h,onSiteUrlChanged:p}=e;const f=(0,om.GV)(im.Hb),m=(0,om.GV)(im.KL),[g,v]=(0,Gf.useState)(!0);(0,Gf.useEffect)((()=>{o?Jf().load({google:{families:["Fira Code","Fira Mono","Fira Sans","Fira Sans Condensed","Fira Sans Extra Condensed"]}}):Promise.resolve().then(n.bind(n,4781))}),[o]),(0,Gf.useEffect)((()=>{h&&f&&h(f)}),[f,h]),(0,Gf.useEffect)((()=>{p&&m&&p(m)}),[m,p]);const b=(0,Gf.useCallback)((()=>{v(!1),null===a||void 0===a||a()}),[a]),y=(0,Gf.useMemo)((()=>({extraFields:t,onAssetAction:l,onAssetSelected:c,onImageSelected:u,onError:s,onClose:b,onConnectClicked:d})),[t,b,l,c,s,u,d]);return(0,nm.jsx)(em.B.Provider,{value:y,children:r?(0,nm.jsx)(lm,{multiSelect:i}):(0,nm.jsx)(cm,{open:g,children:(0,nm.jsx)(lm,{multiSelect:i})})})};var dm=n(5650),hm=n(5873),pm=n(3943),fm=n(9063),mm=n(5029),gm=n(4413);class vm{static getInstance(){return vm.instance||(vm.instance=new vm),vm.instance}async fetchAssets(e){const t=await om.M_.dispatch(fm.PG.endpoints.getAssets.initiate(e,{forceRefetch:!0}));return"data"in t?t.data:{facets:[],items:[],totalCount:0}}async fetchFolders(e){var t;const n=await om.M_.dispatch(fm.PG.endpoints.getFolders.initiate({...e,pageSize:null!==(t=e.pageSize)&&void 0!==t?t:gm.VH},{forceRefetch:!0}));return"data"in n?n.data:{items:[],totalCount:0}}}vm.instance=void 0;const bm=vm.getInstance(),ym={help:()=>{console.log("/* Orange DAM Content Browser SDK Example */\n window.OrangeDAMContentBrowser.open({\n onAssetSelected: (assets) => {\n // Callback function triggered when assets are selected\n console.log(assets);\n window.open(assets[0]?.imageUrl, '_blank');\n },\n onError: (errorMessage, error) => {\n // Callback function triggered when an error occurs\n console.error(errorMessage, error);\n },\n onClose: () => {\n // Callback function triggered when the browser is closed\n window.alert('Content Browser is closing');\n },\n containerId: \"\", // ID of the container to attach the browser; opens in a popup if blank\n extraFields: ['coreField.OriginalFileName', 'document.CortexPath'], // Additional fields to retrieve from the assets\n baseUrl: \"\", // Default base URL to pre-fill in the content browser\n displayInfo: {\n title: true, // Whether to display the asset title\n dimension: true, // Whether to display the asset dimensions\n fileSize: false, // Whether to display the file size\n tags: false, // Whether to display the asset tags\n },\n publicApplicationName: \"\", // Public name of the DAM to display on the login screen\n pluginName: \"OrangeDAM Content Browser\", // Name of the plugin to display on the login screen\n ctaText: \"Insert\", // Text to display on the insert button\n persistMode: true, // Whether the browser remains open after selecting an asset\n availableDocTypes: ['Images*', 'Videos*', 'Audio*', 'Others*'], // An array of available OrangeDAM asset types to filter the assets. The available doc types will be configured in OL Platform. If not provided, all doc types will be available. \n availableRepresentativeSubtypes: ['Other'], // Array of supported subtypes for representative images\n showCollections: true, // Whether to show collections in the content browser\n lastLocationMode: true, // Whether to open the last selected folder on load\n allowTracking: true, // Whether to enable tracking parameters for asset URLs\n });")},open:async n=>{let{onAssetAction:r,onAssetSelected:o,onImageSelected:i,onError:a,onClose:s,onRequestToken:l,onTokenChanged:c,onConnectClicked:u,onSiteUrlChanged:d,customStorage:h,allowedExtensions:p,allowedFolders:f,allowFavorites:m,allowLogout:g,allowProxy:v,allowTracking:b,availableDocTypes:y,availableRepresentativeSubtypes:x,baseUrl:w,containerId:k,ctaText:S,displayInfo:_={title:!0,dimension:!0,fileSize:!1,tags:!1},extraFields:C,lastLocationMode:E,loadExternalFonts:A,multiSelect:T,persistMode:O,pluginName:P,publicApplicationName:z,showCollections:D,showFavoriteFolder:R,showVersions:N,useSession:j,defaultGridView:I}=n,M=k&&document.getElementById(k);if(k){if(!M)return void console.error(`Container with id ${k} is not found`)}else M=document.body;let L=M.querySelector("#cortex-asset-picker-root");L||(L=document.createElement("div"),L.id="cortex-asset-picker-root",L.style.width="100%",L.style.height="100%",L.style.display="flex",L.style.alignItems="center",L.style.justifyContent="center",L.style.position="relative",M.appendChild(L));const F=(0,e.createRoot)(L);l&&(window.OrangeDAMContentBrowser._onRequestToken=()=>l().then((e=>({token:e,siteUrl:w})))),w&&om.M_.dispatch((0,im._f)(w)),l&&om.M_.dispatch((0,im.Uh)(!0)),om.M_.dispatch((0,im.hG)());const B="function"===typeof a&&a?a:console.log,U="function"===typeof r&&r?r:()=>{},V="function"===typeof o&&o?o:()=>{},q="function"===typeof i&&i?i:()=>{},H="function"===typeof c&&c?c:void 0,W="object"===typeof h&&h&&"function"===typeof h.delete&&h.delete&&"function"===typeof h.get&&h.get&&"function"===typeof h.set&&h.set?h:void 0,K=()=>{om.M_.dispatch((0,hm.ZZ)()),om.M_.dispatch(fm.PG.util.resetApiState()),om.M_.dispatch(pm.A1.util.resetApiState()),om.M_.dispatch(mm.i.util.resetApiState()),F.unmount(),window.OrangeDAMContentBrowser._onAssetSelected=void 0,window.OrangeDAMContentBrowser._onImageSelected=void 0,window.OrangeDAMContentBrowser._onError=void 0,window.OrangeDAMContentBrowser._onClose=void 0,window.OrangeDAMContentBrowser._customStorage=void 0,null===s||void 0===s||s()};window.OrangeDAMContentBrowser._onAssetAction=U,window.OrangeDAMContentBrowser._onAssetSelected=V,window.OrangeDAMContentBrowser._onImageSelected=q,window.OrangeDAMContentBrowser._onError=B,window.OrangeDAMContentBrowser._onClose=K,window.OrangeDAMContentBrowser._customStorage=W,F.render((0,nm.jsx)(t.Kq,{store:om.M_,children:(0,nm.jsx)(dm.t.Provider,{value:{allowedExtensions:p,allowedFolders:f,availableDocTypes:y,availableRepresentativeSubtypes:x,ctaText:null!==S&&void 0!==S?S:"Insert",displayInfo:_,lastLocationMode:void 0===E||!!E,persistMode:!!O,pluginInfo:{publicApplicationName:null!==z&&void 0!==z?z:"",pluginName:null!==P&&void 0!==P?P:"OrangeDAM Content Browser"},isContentBrowserPopedup:!k,showCollections:!!D,showFavoriteFolder:!!R,showVersions:!!N,useSession:j,allowLogout:void 0===g||!!g,allowTracking:void 0===b||!!b,allowProxy:void 0===v||!!v,allowFavorites:!!m,defaultGridView:null!==I&&void 0!==I?I:""},children:(0,nm.jsx)(um,{containerId:k,extraFields:C,loadExternalFonts:A,multiSelect:!!T,onError:B,onAssetAction:U,onAssetSelected:V,onImageSelected:q,onClose:K,onConnectClicked:u,onTokenChanged:H,onSiteUrlChanged:d})})}))},close:()=>{var e,t;null===(e=(t=window.OrangeDAMContentBrowser)._onClose)||void 0===e||e.call(t)},fetchAssets:e=>bm.fetchAssets(e),fetchFolders:e=>bm.fetchFolders(e),previewAsset:e=>{om.M_.dispatch((0,hm.DM)(e))}};window.OrangeDAMContentBrowser=ym;const xm=ym})(),r=r.default})()));
|
|
11468
11468
|
//# sourceMappingURL=OrangeDAMContentBrowserSDK.min.js.map
|