From 7e65c2da6161cf8e3f1fce977cf9522ee4a4faec Mon Sep 17 00:00:00 2001 From: mathewjordan Date: Tue, 12 Dec 2023 20:25:20 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20samvera-?= =?UTF-8?q?labs/clover-iiif@6a6bc97c61c01ab94a3a1965d9497493a15f1bff=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- .../{744.a26e6392a2a75aeb.js => 744.21cd5de4e6006a85.js} | 2 +- ...ebpack-23ed263e357b16b7.js => webpack-b16c715c557808e5.js} | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 docs.html | 4 ++-- docs/composing.html | 4 ++-- docs/homepage.html | 4 ++-- docs/label.html | 4 ++-- docs/metadata.html | 4 ++-- docs/partOf.html | 4 ++-- docs/requiredStatement.html | 4 ++-- docs/seeAlso.html | 4 ++-- docs/slider.html | 4 ++-- docs/slider/demo.html | 4 ++-- docs/summary.html | 4 ++-- docs/thumbnail.html | 4 ++-- docs/viewer.html | 4 ++-- docs/viewer/demo.html | 4 ++-- index.html | 4 ++-- 20 files changed, 33 insertions(+), 33 deletions(-) rename _next/static/chunks/{744.a26e6392a2a75aeb.js => 744.21cd5de4e6006a85.js} (64%) rename _next/static/chunks/{webpack-23ed263e357b16b7.js => webpack-b16c715c557808e5.js} (98%) rename _next/static/{f-TlTVBSpSUsDItFefnSr => mtpEn_biZakr45oIu3zEk}/_buildManifest.js (100%) rename _next/static/{f-TlTVBSpSUsDItFefnSr => mtpEn_biZakr45oIu3zEk}/_ssgManifest.js (100%) diff --git a/404.html b/404.html index 9aa6fc77..159948ba 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/_next/static/chunks/744.a26e6392a2a75aeb.js b/_next/static/chunks/744.21cd5de4e6006a85.js similarity index 64% rename from _next/static/chunks/744.a26e6392a2a75aeb.js rename to _next/static/chunks/744.21cd5de4e6006a85.js index 798813de..ce679352 100644 --- a/_next/static/chunks/744.a26e6392a2a75aeb.js +++ b/_next/static/chunks/744.21cd5de4e6006a85.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{4744:function(e,t,n){n.r(t),n.d(t,{default:function(){return tY}});var i,o=n(1527),r=n(959),a=n(8892),l=n(7785);let s={background:"transparent",canvasBackgroundColor:"#6662",canvasHeight:"61.8vh",ignoreCaptionLabels:[],informationPanel:{open:!0,renderAbout:!0,renderSupplementing:!0,renderToggle:!0},openSeadragon:{},requestHeaders:{"Content-Type":"application/json"},showIIIFBadge:!0,showTitle:!0,withCredentials:!1},d={activeCanvas:"",activeManifest:"",collection:{},configOptions:s,informationOpen:null==s?void 0:null===(i=s.informationPanel)||void 0===i?void 0:i.open,isLoaded:!1,vault:new a.j},c=r.createContext(d),u=r.createContext(d);function h(e,t){switch(t.type){case"updateActiveCanvas":return t.canvasId||(t.canvasId=""),{...e,activeCanvas:t.canvasId};case"updateActiveManifest":return{...e,activeManifest:t.manifestId};case"updateCollection":return{...e,collection:t.collection};case"updateConfigOptions":return{...e,configOptions:(0,l.RH)(e.configOptions,t.configOptions)};case"updateInformationOpen":return{...e,informationOpen:t.informationOpen};case"updateIsLoaded":return{...e,isLoaded:t.isLoaded};default:throw Error("Unhandled action type: ".concat(t.type))}}let p=e=>{let{initialState:t=d,children:n}=e,[i,a]=(0,r.useReducer)(h,t);return(0,o.jsx)(c.Provider,{value:i,children:(0,o.jsx)(u.Provider,{value:a,children:n})})};function m(){let e=r.useContext(c);if(void 0===e)throw Error("useViewerState must be used within a ViewerProvider");return e}function g(){let e=r.useContext(u);if(void 0===e)throw Error("useViewerDispatch must be used within a ViewerProvider");return e}var x=n(1844);let f=(e,t,n,i)=>{let o={canvas:void 0,accompanyingCanvas:void 0,annotationPage:void 0,annotations:[]};if(o.canvas=e.get(t),o.canvas){var r,a;o.annotationPage=e.get(o.canvas.items[0]),o.accompanyingCanvas=(null===(r=o.canvas)||void 0===r?void 0:r.accompanyingCanvas)?e.get(null===(a=o.canvas)||void 0===a?void 0:a.accompanyingCanvas):void 0}if(o.annotationPage){let r=e.get(o.annotationPage.items).map(t=>({body:e.get(t.body[0].id),motivation:t.motivation,type:"Annotation"})),a=[];r.forEach(t=>{"Choice"===t.body.type?t.body.items.forEach(n=>a.push({...t,id:n.id,body:e.get(n.id)})):a.push(t)}),o.annotations=a.filter(o=>{if(o){if(!o.body||!o.motivation){console.error("Invalid annotation after Hyperion parsing: missing either 'body' or 'motivation'",o);return}let r=o.body;Array.isArray(r)&&(r=r[0]);let a=e.get(r.id);if(a)switch(n){case"painting":return o.target===t.id&&o.motivation&&"painting"===o.motivation[0]&&i.includes(a.type)&&(o.body=a),!!o;case"supplementing":return;default:throw Error("Invalid annotation motivation.")}}})}return o},v=(e,t)=>{let n=f(e,{id:t,type:"Canvas"},"painting",["Image","Sound","Video"]);if(0!==n.annotations.length&&n.annotations&&n.annotations)return n.annotations.map(e=>null==e?void 0:e.body)},b=(e,t,n)=>{let i=e.get({id:t,type:"Canvas"});if(!(null==i?void 0:i.annotations)||!i.annotations[0])return[];let o=e.get(i.annotations[0]),r=e.get(o.items);return Array.isArray(r)?r.filter(t=>{var i;if(t.body&&(null===(i=t.motivation)||void 0===i?void 0:i.includes("supplementing"))){let i=t.body;Array.isArray(i)&&(i=i[0]);let o=e.get(i.id);if(o.format===n)return t.body=o,t}}).map(e=>e.body):[]};var j=n(1524),y=n(8734);let w=(0,y.zo)("div",{display:"flex",flexDirection:"column",alignItems:"center"}),C=(0,y.zo)("p",{fontWeight:"bold",fontSize:"x-large"}),k=(0,y.zo)("span",{fontSize:"medium"});var z=e=>{let{error:t}=e,{message:n}=t;return(0,o.jsxs)(w,{role:"alert",children:[(0,o.jsx)(C,{"data-testid":"headline",children:"Something went wrong"}),n&&(0,o.jsxs)(k,{children:["Error message: ".concat(n)," "]})]})};let S=(0,y.zo)("div",{position:"relative",zIndex:"0"}),I=(0,y.zo)("div",{display:"flex",flexDirection:"row",overflow:"hidden","@sm":{flexDirection:"column"}}),M=(0,y.zo)("div",{display:"flex",flexDirection:"column",flexGrow:"1",flexShrink:"1",width:"61.8%","@sm":{width:"100%"}}),L=(0,y.zo)(x.xz,{display:"none",border:"none",padding:"0",transition:"$all",opacity:"1",background:"#6663",margin:"1rem 0",borderRadius:"6px","&[data-information-panel='false']":{opacity:"0",marginTop:"-59px"},"@sm":{display:"flex","> span":{display:"flex",flexGrow:"1",fontSize:"0.8333em",justifyContent:"center",padding:"0.5rem",fontFamily:"inherit"}}}),$=(0,y.zo)(x.VY,{width:"100%",display:"flex"}),A=(0,y.zo)("aside",{display:"flex",flexGrow:"1",flexShrink:"0",width:"38.2%",maxHeight:"100%","@sm":{width:"100%"}}),R=(0,y.zo)("div",{display:"flex",flexDirection:"column",fontSmooth:"auto",webkitFontSmoothing:"antialiased","> div":{display:"flex",flexDirection:"column",flexGrow:"1",justifyContent:"flex-start","@sm":{["& ".concat(I)]:{flexGrow:"1"},["& ".concat(M)]:{flexGrow:"0"}}},"@sm":{padding:"0"},"&[data-information-panel-open='true']":{"@sm":{position:"fixed",height:"100%",width:"100%",top:"0",left:"0",zIndex:"2500000000",["& ".concat(S)]:{display:"none"},["& ".concat(L)]:{margin:"1rem"},["& ".concat($)]:{height:"100%"}}}});var T=n(3515);let E=(0,y.zo)(T.fC,{display:"flex",flexDirection:"column",width:"100%",height:"100%",flexGrow:"1",flexShrink:"0",position:"relative",zIndex:"1",maskImage:"linear-gradient(180deg, rgba(0, 0, 0, 1) calc(100% - 2rem), transparent 100%)","@sm":{marginTop:"0.5rem",boxShadow:"none"}}),F=(0,y.zo)(T.aV,{display:"flex",flexGrow:"0",margin:"0 1.618rem",borderBottom:"4px solid #6663","@sm":{margin:"0 1rem"}}),H=(0,y.zo)(T.xz,{display:"flex",position:"relative",padding:"0.5rem 1rem",background:"none",backgroundColor:"transparent",fontFamily:"inherit",border:"none",opacity:"0.7",fontSize:"1rem",marginRight:"1rem",lineHeight:"1rem",whiteSpace:"nowrap",cursor:"pointer",fontWeight:400,transition:"$all","&::after":{width:"0",height:"4px",content:"",position:"absolute",bottom:"-4px",left:"0",transition:"$all"},"&[data-state='active']":{opacity:"1",fontWeight:700,"&::after":{width:"100%",backgroundColor:"$accent"}}}),B=(0,y.zo)(T.VY,{display:"flex",flexGrow:"1",flexShrink:"0",position:"absolute",top:"0",left:"0","&[data-state='active']":{width:"100%",height:"calc(100% - 2rem)",padding:"1.618rem 0"}}),V=(0,y.zo)("div",{position:"relative",height:"100%",width:"100%",overflowY:"scroll"}),O=(0,y.zo)("div",{padding:" 0 1.618rem 2rem",display:"flex",flexDirection:"column",overflow:"scroll",position:"absolute",fontWeight:"400",fontSize:"1rem",zIndex:"0",img:{maxWidth:"100px",maxHeight:"100px",objectFit:"contain",color:"transparent",margin:"0 0 1rem",borderRadius:"3px",backgroundColor:"$secondaryMuted"},video:{display:"none"},"a, a:visited":{color:"$accent"},p:{fontSize:"1rem",lineHeight:"1.45em",margin:"0"},dl:{margin:"0",dt:{fontWeight:"700",margin:"1rem 0 0.25rem"},dd:{margin:"0"}},".manifest-property-title":{fontWeight:"700",margin:"1rem 0 0.25rem"},"ul, ol":{padding:"0",margin:"0",li:{fontSize:"1rem",lineHeight:"1.45em",listStyle:"none",margin:"0.25rem 0 0.25rem"}}}),W=(0,y.zo)("div",{position:"relative",width:"100%",height:"100%",zIndex:"0"});var P=n(9960),D=e=>{let{homepage:t}=e;return(null==t?void 0:t.length)===0?(0,o.jsx)(o.Fragment,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:"Homepage"}),(0,o.jsx)(P.bw,{homepage:t})]})},_=e=>{let{id:t,htmlLabel:n,parent:i="manifest"}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:n}),(0,o.jsx)("a",{href:t,target:"_blank",id:"iiif-".concat(i,"-id"),children:t})]})},N=e=>{let{metadata:t,parent:n="manifest"}=e;return t?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.SF,{metadata:t,id:"iiif-".concat(n,"-metadata")})}):(0,o.jsx)(o.Fragment,{})},G=e=>{let{requiredStatement:t,parent:n="manifest"}=e;return t?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.bT,{requiredStatement:t,id:"iiif-".concat(n,"-required-statement")})}):(0,o.jsx)(o.Fragment,{})},Z=e=>{let{rights:t}=e;return t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:"Rights"}),(0,o.jsx)("a",{href:t,target:"_blank",children:t})]}):(0,o.jsx)(o.Fragment,{})},q=e=>{let{seeAlso:t}=e;return(null==t?void 0:t.length)===0?(0,o.jsx)(o.Fragment,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:"See Also"}),(0,o.jsx)(P.QZ,{seeAlso:t})]})},Y=e=>{let{summary:t,parent:n="manifest"}=e;return t?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.ER,{summary:t,as:"p",id:"iiif-".concat(n,"-summary")})}):(0,o.jsx)(o.Fragment,{})},J=e=>{let{label:t,thumbnail:n}=e;return(null==n?void 0:n.length)===0?(0,o.jsx)(o.Fragment,{}):(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.pl,{altAsLabel:t||{none:["resource"]},thumbnail:n,style:{backgroundColor:"#6663",objectFit:"cover"}})})},U=()=>{let e=m(),{activeManifest:t,vault:n}=e,[i,a]=(0,r.useState)(),[l,s]=(0,r.useState)([]),[d,c]=(0,r.useState)([]),[u,h]=(0,r.useState)([]);return((0,r.useEffect)(()=>{var e,i,o;let r=n.get(t);a(r),(null===(e=r.homepage)||void 0===e?void 0:e.length)>0&&s(n.get(r.homepage)),(null===(i=r.seeAlso)||void 0===i?void 0:i.length)>0&&c(n.get(r.seeAlso)),(null===(o=r.thumbnail)||void 0===o?void 0:o.length)>0&&h(n.get(r.thumbnail))},[t,n]),i)?(0,o.jsx)(W,{children:(0,o.jsxs)(O,{children:[(0,o.jsx)(J,{thumbnail:u,label:i.label}),(0,o.jsx)(Y,{summary:i.summary}),(0,o.jsx)(N,{metadata:i.metadata}),(0,o.jsx)(G,{requiredStatement:i.requiredStatement}),(0,o.jsx)(Z,{rights:i.rights}),(0,o.jsx)(D,{homepage:l}),(0,o.jsx)(q,{seeAlso:d}),(0,o.jsx)(_,{id:i.id,htmlLabel:"IIIF Manifest"})]})}):(0,o.jsx)(o.Fragment,{})},X=n(2950),Q=()=>{function e(e){return e.map(e=>{let t=e.identifier||(0,X.Z)();return{...e,identifier:t}})}return{addIdentifiersToParsedCues:e,createNestedCues:function(t){let n=[],i=[],o=e(t);for(let e of o){for(;i.length>0&&i[i.length-1].end<=e.start;)i.pop();if(i.length>0){var r;i[i.length-1].children||(i[i.length-1].children=[]),null===(r=i[i.length-1].children)||void 0===r||r.push(e),i.push(e)}else n.push(e),i.push(e)}return n},isChild:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.some(t=>e.start>=t.start&&e.end<=t.end)},orderCuesByTime:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.sort((e,t)=>e.start-t.start)}}},K=n(6446);let ee=(0,y.F4)({from:{transform:"rotate(360deg)"},to:{transform:"rotate(0deg)"}}),et=(0,y.zo)(K.fC,{display:"flex",flexDirection:"column",width:"100%"}),en=(0,y.zo)(K.ck,{position:"relative",cursor:"pointer",display:"flex",width:"100%",justifyContent:"space-between",textAlign:"left",margin:"0",padding:"0.5rem 1.618rem",fontFamily:"inherit",lineHeight:"1.25em",fontSize:"1rem",color:"inherit",border:"none",background:"none","@sm":{padding:"0.5rem 1rem",fontSize:"0.8333rem"},"&::before":{content:"",width:"12px",height:"12px",borderRadius:"12px",position:"absolute",backgroundColor:"$primaryMuted",opacity:"0",left:"8px",marginTop:"3px",boxSizing:"content-box","@sm":{content:"unset"}},"&::after":{content:"",width:"4px",height:"6px",position:"absolute",backgroundColor:"$secondary",opacity:"0",clipPath:"polygon(100% 50%, 0 100%, 0 0)",left:"13px",marginTop:"6px",boxSizing:"content-box","@sm":{content:"unset"}},strong:{marginLeft:"1rem"},"&:hover":{color:"$accent","&::before":{backgroundColor:"$accent",opacity:"1"},"&::after":{content:"",width:"4px",height:"6px",position:"absolute",backgroundColor:"$secondary",clipPath:"polygon(100% 50%, 0 100%, 0 0)",opacity:"1"}},"&[aria-checked='true']":{backgroundColor:"#6663","&::before":{content:"",width:"6px",height:"6px",position:"absolute",backgroundColor:"transparent",border:"3px solid $accentMuted",borderRadius:"12px",left:"8px",marginTop:"4px",opacity:"1",animation:"1s linear infinite",animationName:ee,boxSizing:"content-box","@sm":{content:"unset"}},"&::after":{content:"",width:"6px",height:"6px",position:"absolute",backgroundColor:"transparent",border:"3px solid $accent",clipPath:"polygon(100% 0, 100% 100%, 0 0)",borderRadius:"12px",left:"8px",marginTop:"4px",opacity:"1",animation:"1.5s linear infinite",animationName:ee,boxSizing:"content-box","@sm":{content:"unset"}}}});var ei=e=>{let{label:t,start:n,end:i}=e,[a,s]=(0,r.useState)(!1),d=document.getElementById("clover-iiif-video");return(0,r.useEffect)(()=>(null==d||d.addEventListener("timeupdate",()=>{let{currentTime:e}=d;s(n<=e&&edocument.removeEventListener("timeupdate",()=>{})),[i,n,d]),(0,o.jsxs)(en,{"aria-checked":a,"data-testid":"information-panel-cue",onClick:()=>{d&&(d.pause(),d.currentTime=n,d.play())},value:t,children:[t,(0,o.jsx)("strong",{children:(0,l.rJ)(n)})]})};let eo=(0,y.zo)("ul",{listStyle:"none",paddingLeft:"1rem",position:"relative","&&:first-child":{paddingLeft:"0"},"& li ul":{["& ".concat(en)]:{backgroundColor:"unset","&::before":{content:"none"},"&::after":{content:"none"}}},"&:first-child":{margin:"0 0 1.618rem"}}),er=e=>{let{items:t}=e;return(0,o.jsx)(eo,{children:t.map(e=>{let{text:t,start:n,end:i,children:r,identifier:a}=e;return(0,o.jsxs)("li",{children:[(0,o.jsx)(ei,{label:t,start:n,end:i}),r&&(0,o.jsx)(er,{items:r})]},a)})})},ea=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";if(!e)return"";if(!e[t]){let t=Object.getOwnPropertyNames(e);if(t.length>0)return e[t[0]]}return e[t]};var el=n(3836),es=e=>{let{resource:t}=e,[n,i]=r.useState([]),{id:a,label:l}=t,{createNestedCues:s,orderCuesByTime:d}=Q();return(0,r.useEffect)(()=>{a&&fetch(a,{headers:{"Content-Type":"text/plain",Accept:"application/json"}}).then(e=>e.text()).then(e=>{let t=(0,el.parse)(e).cues,n=d(t),o=s(n);i(o)}).catch(e=>console.error(a,e.toString()))},[s,a,d]),(0,o.jsx)(et,{"aria-label":"navigate ".concat(ea(l,"en")),children:(0,o.jsx)(er,{items:n})})},ed=e=>{var t;let{activeCanvas:n,resources:i}=e,a=m(),{configOptions:l}=a,{informationPanel:s}=l,[d,c]=(0,r.useState)(),u=(null==s?void 0:s.renderAbout)||(null==l?void 0:null===(t=l.informationPanel)||void 0===t?void 0:t.renderAbout),h=null==s?void 0:s.renderSupplementing;return((0,r.useEffect)(()=>{u?c("manifest-about"):i&&(null==i?void 0:i.length)>0&&!u&&c(i[0].id)},[n,u,i]),i)?(0,o.jsxs)(E,{"data-testid":"information-panel",defaultValue:d,onValueChange:e=>{c(e)},orientation:"horizontal",value:d,children:[(0,o.jsxs)(F,{"aria-label":"select chapter","data-testid":"information-panel-list",children:[u&&(0,o.jsx)(H,{value:"manifest-about",children:"About"}),h&&i&&i.map(e=>{let{id:t,label:n}=e;return(0,o.jsx)(H,{value:t,children:(0,o.jsx)(P.__,{label:n})},t)})]}),(0,o.jsxs)(V,{children:[u&&(0,o.jsx)(B,{value:"manifest-about",children:(0,o.jsx)(U,{})}),h&&i&&i.map(e=>(0,o.jsx)(B,{value:e.id,children:(0,o.jsx)(es,{resource:e})},e.id))]})]}):(0,o.jsx)(o.Fragment,{})};let ec=(e,t,n,i)=>{let o=[];if(t.canvas&&t.canvas.thumbnail.length>0){let n=e.get(t.canvas.thumbnail[0]);o.push(n)}if(t.annotations[0]){if(t.annotations[0].thumbnail&&t.annotations[0].thumbnail.length>0){let n=e.get(t.annotations[0].thumbnail[0]);o.push(n)}if(!t.annotations[0].body)return;let n=t.annotations[0].body;"Image"===n.type&&o.push(n)}if(0===o.length)return;let r={id:o[0].id,format:o[0].format,type:o[0].type,width:n,height:i};return r},eu=(0,y.zo)("div",{position:"absolute",right:"1rem",top:"1rem",display:"flex",justifyContent:"flex-end",zIndex:"1"}),eh=(0,y.zo)("input",{flexGrow:"1",border:"none",backgroundColor:"$secondaryMuted",color:"$primary",marginRight:"1rem",height:"2rem",padding:"0 1rem",borderRadius:"2rem",fontFamily:"inherit",fontSize:"1rem",lineHeight:"1rem",boxShadow:"inset 1px 1px 2px #0003","&::placeholder":{color:"$primaryMuted"}}),ep=(0,y.zo)("button",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",fontWeight:"700",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",svg:{height:"60%",width:"60%",padding:"20%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",boxSizing:"inherit",transition:"$all"},"&:disabled":{backgroundColor:"transparent",boxShadow:"none",svg:{opacity:"0.25"}}}),em=(0,y.zo)("div",{display:"flex",marginRight:"0.618rem",backgroundColor:"$accentAlt",borderRadius:"2rem",boxShadow:"5px 5px 5px #0003",color:"$secondary",alignItems:"center","> span":{display:"flex",margin:"0 0.5rem",fontSize:"0.7222rem"}}),eg=(0,y.zo)("div",{display:"flex",position:"relative",zIndex:"1",width:"100%",padding:"0",transition:"$all",variants:{isToggle:{true:{paddingTop:"2.618rem",["& ".concat(eu)]:{width:"calc(100% - 2rem)","@sm":{width:"calc(100% - 2rem)"}}}}}});var ex=(e,t)=>{(0,r.useEffect)(()=>{function n(n){n.key===e&&t()}return window.addEventListener("keyup",n),()=>window.removeEventListener("keyup",n)},[])};let ef=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Arrow Back"}),(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})]}),ev=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Arrow Forward"}),(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"})]}),eb=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Close"}),(0,o.jsx)("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})]}),ej=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Search"}),(0,o.jsx)("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"})]});var ey=e=>{let{handleCanvasToggle:t,handleFilter:n,activeIndex:i,canvasLength:a}=e,[l,s]=(0,r.useState)(!1),[d,c]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{0===i?h(!0):h(!1),i===a-1?c(!0):c(!1)},[i,a]),ex("Escape",()=>{s(!1),n("")}),(0,o.jsx)(eg,{isToggle:l,children:(0,o.jsxs)(eu,{children:[l&&(0,o.jsx)(eh,{autoFocus:!0,onChange:e=>n(e.target.value),placeholder:"Search"}),!l&&(0,o.jsxs)(em,{children:[(0,o.jsx)(ep,{onClick:()=>t(-1),disabled:u,type:"button",children:(0,o.jsx)(ef,{})}),(0,o.jsxs)("span",{children:[i+1," of ",a]}),(0,o.jsx)(ep,{onClick:()=>t(1),disabled:d,type:"button",children:(0,o.jsx)(ev,{})})]}),(0,o.jsx)(ep,{onClick:()=>{s(e=>!e),n("")},type:"button",children:l?(0,o.jsx)(eb,{}):(0,o.jsx)(ej,{})})]})})};let ew=(0,y.zo)(K.fC,{display:"flex",flexDirection:"row",flexGrow:"1",padding:"1.618rem",overflowX:"scroll",position:"relative",zIndex:"0"}),eC=(0,y.zo)("svg",{display:"inline-flex",variants:{isLarge:{true:{height:"4rem",width:"4rem"}},isMedium:{true:{height:"2rem",width:"2rem"}},isSmall:{true:{height:"1rem",width:"1rem"}}}}),ek=e=>(0,o.jsx)(eC,{...e,"data-testid":"icon-svg",role:"img",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:e.children});ek.Title=e=>{let{children:t}=e;return(0,o.jsx)("title",{children:t})},ek.Add=()=>(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 112v288M400 256H112"}),ek.Audio=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24zm-106.18-80zm-.27-159.86zM320 336a16 16 0 01-14.29-23.19c9.49-18.87 14.3-38 14.3-56.81 0-19.38-4.66-37.94-14.25-56.73a16 16 0 0128.5-14.54C346.19 208.12 352 231.44 352 256c0 23.86-6 47.81-17.7 71.19A16 16 0 01320 336z"}),(0,o.jsx)("path",{d:"M368 384a16 16 0 01-13.86-24C373.05 327.09 384 299.51 384 256c0-44.17-10.93-71.56-29.82-103.94a16 16 0 0127.64-16.12C402.92 172.11 416 204.81 416 256c0 50.43-13.06 83.29-34.13 120a16 16 0 01-13.87 8z"}),(0,o.jsx)("path",{d:"M416 432a16 16 0 01-13.39-24.74C429.85 365.47 448 323.76 448 256c0-66.5-18.18-108.62-45.49-151.39a16 16 0 1127-17.22C459.81 134.89 480 181.74 480 256c0 64.75-14.66 113.63-50.6 168.74A16 16 0 01416 432z"})]}),ek.Close=()=>(0,o.jsx)("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"}),ek.Image=()=>(0,o.jsx)("path",{d:"M416 64H96a64.07 64.07 0 00-64 64v256a64.07 64.07 0 0064 64h320a64.07 64.07 0 0064-64V128a64.07 64.07 0 00-64-64zm-80 64a48 48 0 11-48 48 48.05 48.05 0 0148-48zM96 416a32 32 0 01-32-32v-67.63l94.84-84.3a48.06 48.06 0 0165.8 1.9l64.95 64.81L172.37 416zm352-32a32 32 0 01-32 32H217.63l121.42-121.42a47.72 47.72 0 0161.64-.16L448 333.84z"}),ek.Video=()=>(0,o.jsx)("path",{d:"M464 384.39a32 32 0 01-13-2.77 15.77 15.77 0 01-2.71-1.54l-82.71-58.22A32 32 0 01352 295.7v-79.4a32 32 0 0113.58-26.16l82.71-58.22a15.77 15.77 0 012.71-1.54 32 32 0 0145 29.24v192.76a32 32 0 01-32 32zM268 400H84a68.07 68.07 0 01-68-68V180a68.07 68.07 0 0168-68h184.48A67.6 67.6 0 01336 179.52V332a68.07 68.07 0 01-68 68z"});var ez=n(2731);let eS=(0,y.F4)({"0%":{opacity:0,transform:"translateY(1rem)"},"100%":{opacity:1,transform:"translateY(0)"}}),eI=(0,y.F4)({"0%":{opacity:0,transform:"translateY(1rem)"},"100%":{opacity:1,transform:"translateY(0)"}}),eM=(0,y.zo)(ez.Eh,{fill:"$secondaryAlt"}),eL=(0,y.zo)(ez.x8,{position:"absolute",right:"0",top:"0",padding:"0.5rem",margin:"0",cursor:"pointer",border:"none",background:"none",fill:"inherit","&:hover":{opacity:"0.75"}}),e$=(0,y.zo)(ez.VY,{border:"none",backgroundColor:"white",fill:"inhrerit",padding:"1rem 2rem 1rem 1rem",width:"auto",minWidth:"200px",maxWidth:"350px",borderRadius:"3px",boxShadow:"5px 5px 13px #0002",animationDuration:"0.3s",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",'&[data-side="top"]':{animationName:eI},'&[data-side="bottom"]':{animationName:eS},'&[data-align="end"]':{["& ".concat(eM)]:{margin:"0 0.7rem"}}}),eA=(0,y.zo)(ez.xz,{display:"inline-flex",padding:"0.5rem 0",margin:"0 0.5rem 0 0",cursor:"pointer",border:"none",background:"none","> button, > span":{margin:"0"}}),eR=(0,y.zo)(ez.fC,{boxSizing:"content-box"}),eT=e=>{let{children:t}=e;return(0,o.jsx)(eR,{children:t})};eT.Trigger=e=>(0,o.jsx)(eA,{...e,children:e.children}),eT.Content=e=>(0,o.jsxs)(e$,{...e,children:[(0,o.jsx)(eM,{}),(0,o.jsx)(eL,{children:(0,o.jsx)(ek,{isSmall:!0,children:(0,o.jsx)(ek.Close,{})})}),e.children]});let eE=(0,y.zo)("div",{boxSizing:"border-box",display:"inline-flex",alignItems:"center",borderRadius:"5px",padding:"$1",marginBottom:"$2",marginRight:"$2",backgroundColor:"$lightGrey",color:"$richBlack50",textTransform:"uppercase",fontSize:"$2",objectFit:"contain",lineHeight:"1em !important","&:last-child":{marginRight:"0"},["".concat(eC)]:{position:"absolute",left:"$1",height:"$3",width:"$3"},variants:{isIcon:{true:{position:"relative",paddingLeft:"$5"}}}}),eF=(0,y.zo)("span",{display:"flex"}),eH=(0,y.zo)("span",{display:"flex",width:"1.2111rem",height:"0.7222rem"}),eB=(0,y.zo)("span",{display:"inline-flex",marginLeft:"5px",marginBottom:"-1px"}),eV=(0,y.zo)(K.ck,{display:"flex",flexShrink:"0",margin:"0 1.618rem 0 0",padding:"0",cursor:"pointer",background:"none",border:"none",fontFamily:"inherit",lineHeight:"1.25em",fontSize:"1rem",textAlign:"left","&:last-child":{marginRight:"1rem"},figure:{margin:"0",width:"161.8px","> div":{position:"relative",display:"flex",backgroundColor:"$secondaryAlt",width:"inherit",height:"100px",overflow:"hidden",borderRadius:"3px",transition:"$all",img:{width:"100%",height:"100%",objectFit:"cover",filter:"blur(0)",transform:"scale3d(1, 1, 1)",transition:"$all",color:"transparent"},["& ".concat(eF)]:{position:"absolute",right:"0",bottom:"0",["& ".concat(eE)]:{margin:"0",paddingLeft:"0",fontSize:"0.7222rem",backgroundColor:"#000d",color:"$secondary",fill:"$secondary",borderBottomLeftRadius:"0",borderTopRightRadius:"0"}}},figcaption:{marginTop:"0.5rem",fontWeight:"400",fontSize:"0.8333rem",display:"-webkit-box",overflow:"hidden",MozBoxOrient:"vertical",WebkitBoxOrient:"vertical",WebkitLineClamp:"5","@sm":{fontSize:"0.8333rem"}}},"&[aria-checked='true']":{figure:{"> div":{backgroundColor:"$primaryAlt","&::before":{position:"absolute",zIndex:"1",color:"$secondaryMuted",content:"Active Item",textTransform:"uppercase",fontWeight:"700",fontSize:"0.6111rem",letterSpacing:"0.03rem",display:"flex",width:"100%",height:"100%",flexDirection:"column",justifyContent:"center",textAlign:"center",textShadow:"5px 5px 5px #0003"},img:{opacity:"0.3",transform:"scale3d(1.1, 1.1, 1.1)",filter:"blur(2px)"},["& ".concat(eF)]:{["& ".concat(eE)]:{backgroundColor:"$accent"}}}},figcaption:{fontWeight:"700"}}}),eO=e=>{let{type:t}=e;switch(t){case"Sound":return(0,o.jsx)(ek.Audio,{});case"Image":default:return(0,o.jsx)(ek.Image,{});case"Video":return(0,o.jsx)(ek.Video,{})}};var eW=e=>{let{canvas:t,canvasIndex:n,isActive:i,thumbnail:r,type:a,handleChange:s}=e;return(0,o.jsx)(eV,{"aria-checked":i,"data-testid":"media-thumbnail","data-canvas":n,onClick:()=>s(t.id),value:t.id,children:(0,o.jsxs)("figure",{children:[(0,o.jsxs)("div",{children:[(null==r?void 0:r.id)&&(0,o.jsx)("img",{src:r.id,alt:(null==t?void 0:t.label)?ea(t.label):""}),(0,o.jsx)(eF,{children:(0,o.jsxs)(eE,{isIcon:!0,"data-testid":"thumbnail-tag",children:[(0,o.jsx)(eH,{}),(0,o.jsx)(ek,{"aria-label":a,children:(0,o.jsx)(eO,{type:a})}),["Video","Sound"].includes(a)&&(0,o.jsx)(eB,{children:(0,l.rJ)(t.duration)})]})})]}),(null==t?void 0:t.label)&&(0,o.jsx)("figcaption",{"data-testid":"fig-caption",children:(0,o.jsx)(P.__,{label:t.label})})]})})};let eP=e=>e.body?e.body.type:"Image";var eD=e=>{let{items:t}=e,n=g(),i=m(),{activeCanvas:a,vault:l}=i,[s,d]=(0,r.useState)(""),[c,u]=(0,r.useState)([]),[h,p]=(0,r.useState)(0),x=r.useRef(null),v=e=>{a!==e&&n({type:"updateActiveCanvas",canvasId:e})};return(0,r.useEffect)(()=>{if(!c.length){let e=["Image","Sound","Video"],n=t.map(t=>f(l,t,"painting",e)).filter(e=>e.annotations.length>0);u(n)}},[t,c.length,l]),(0,r.useEffect)(()=>{c.forEach((e,t)=>{(null==e?void 0:e.canvas)&&e.canvas.id===a&&p(t)})},[a,c]),(0,r.useEffect)(()=>{let e=document.querySelector('[data-canvas="'.concat(h,'"]'));if(e instanceof HTMLElement&&x.current){let t=e.offsetLeft-x.current.offsetWidth/2+e.offsetWidth/2;x.current.scrollTo({left:t,behavior:"smooth"})}},[h]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ey,{handleFilter:e=>d(e),handleCanvasToggle:e=>{let t=c[h+e];(null==t?void 0:t.canvas)&&v(t.canvas.id)},activeIndex:h,canvasLength:c.length}),(0,o.jsx)(ew,{"aria-label":"select item","data-testid":"media",ref:x,children:c.filter(e=>{var t;if(null===(t=e.canvas)||void 0===t?void 0:t.label){let t=ea(e.canvas.label);if(Array.isArray(t))return t[0].toLowerCase().includes(s.toLowerCase())}}).map((e,t)=>{var n,i;return(0,o.jsx)(eW,{canvas:e.canvas,canvasIndex:t,handleChange:v,isActive:a===(null==e?void 0:null===(n=e.canvas)||void 0===n?void 0:n.id),thumbnail:ec(l,e,200,200),type:eP(e.annotations[0])},null==e?void 0:null===(i=e.canvas)||void 0===i?void 0:i.id)})})]})};let e_=(0,y.zo)("button",{background:"none",border:"none",cursor:"zoom-in",width:"100%",height:"100%",margin:"0",padding:"0",transition:"$all","& img":{width:"100%",height:"100%",objectFit:"contain",color:"transparent",transition:"$all"},variants:{isMedia:{true:{cursor:"pointer"}}}}),eN=(0,y.zo)("button",{display:"flex",height:"2rem",width:"2rem",borderRadius:"2rem",padding:"0",margin:"0",fontFamily:"inherit",background:"none",border:"none",color:"white",cursor:"pointer",marginLeft:"0.618rem",backgroundColor:"$primary",filter:"drop-shadow(2px 2px 5px #0003)",transition:"$all",boxSizing:"content-box !important","&:first-child":{marginLeft:"0"},"@xs":{marginBottom:"0.618rem",marginLeft:"0","&:last-child":{marginBottom:"0"}},svg:{height:"60%",width:"60%",padding:"20%",fill:"$secondary",stroke:"$secondary",filter:"drop-shadow(2px 2px 5px #0003)",transition:"$all",boxSizing:"inherit"},"&:hover, &:focus":{backgroundColor:"$accent"},"&#rotateRight":{"&:hover, &:focus":{svg:{rotate:"45deg"}}},"&#rotateLeft":{transform:"scaleX(-1)","&:hover, &:focus":{svg:{rotate:"45deg"}}},"&#reset":{"&:hover, &:focus":{svg:{rotate:"-15deg"}}}}),eG=(0,y.zo)(eN,{position:"absolute",width:"2rem",top:"1rem",right:"1rem",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",transition:"$all",borderRadius:"50%",backgroundColor:"$accent",cursor:"pointer","&:hover, &:focus":{backgroundColor:"$accent !important"},variants:{isInteractive:{true:{"&:hover":{opacity:"1"}},false:{}},isMedia:{true:{cursor:"pointer !important"}}},compoundVariants:[{isInteractive:!1,isMedia:!0,css:{top:"50%",right:"50%",width:"4rem",height:"4rem",transform:"translate(50%,-50%)"}}]}),eZ=(0,y.zo)("div",{position:"relative",zIndex:"0",display:"flex",flexDirection:"column",gap:"1rem","&:hover":{["".concat(eG)]:{backgroundColor:"$accent"},["".concat(e_)]:{backgroundColor:"#6662",img:{filter:"brightness(0.85)"}}}}),eq=(0,y.zo)("div",{});var eY=n(1643);let eJ=(0,y.zo)("svg",{height:"19px",color:"$accent",fill:"$accent",stroke:"$accent",display:"flex",margin:"0.25rem 0.85rem"}),eU=(0,y.zo)(eY.xz,{fontSize:"1.25rem",fontWeight:"400",fontFamily:"inherit",alignSelf:"flex-start",flexGrow:"1",cursor:"pointer",transition:"$all",border:"1px solid #6663",boxShadow:"2px 2px 5px #0001",borderRadius:"3px",display:"flex",alignItems:"center",paddingLeft:"0.5rem",width:"100%","@sm":{fontSize:"1rem"}}),eX=(0,y.zo)(eY.VY,{borderRadius:"3px",boxShadow:"3px 3px 8px #0003",backgroundColor:"$secondary",marginTop:"2.25rem",marginLeft:"6px",paddingBottom:"0.25rem",maxHeight:"calc(61.8vh - 2.5rem) !important",borderTopLeftRadius:"0",border:"1px solid $secondaryMuted",maxWidth:"90vw"}),eQ=(0,y.zo)(eY.ck,{display:"flex",alignItems:"center",fontFamily:"inherit",padding:"0.25rem 0.5rem",color:"$primary",fontWeight:"400",fontSize:"0.8333rem",cursor:"pointer",backgroundColor:"$secondary",width:"calc(100% - 1rem)","> span":{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},'&[data-state="checked"]':{fontWeight:"700",color:"$primary !important"},"&:hover":{color:"$accent"},img:{width:"31px",height:"31px",marginRight:"0.5rem",borderRadius:"3px"}}),eK=(0,y.zo)(eY.__,{color:"$primaryMuted",fontFamily:"inherit",fontSize:"0.85rem",padding:"0.5rem 1rem 0.5rem 0.5rem",display:"flex",alignItems:"center",marginBottom:"0.25rem",borderRadius:"3px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",backgroundColor:"$secondaryMuted"}),e0=(0,y.zo)(eY.fC,{position:"relative",zIndex:"5",width:"100%"});var e1=e=>{let{direction:t,title:n}=e;return(0,o.jsxs)(eJ,{xmlns:"http://www.w3.org/2000/svg",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{children:n}),"up"===t&&(0,o.jsx)(()=>(0,o.jsx)("path",{d:"M414 321.94L274.22 158.82a24 24 0 00-36.44 0L98 321.94c-13.34 15.57-2.28 39.62 18.22 39.62h279.6c20.5 0 31.56-24.05 18.18-39.62z"}),{}),"down"===t&&(0,o.jsx)(()=>(0,o.jsx)("path",{d:"M98 190.06l139.78 163.12a24 24 0 0036.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z"}),{})]})},e2=e=>{let{children:t,label:n,maxHeight:i,onValueChange:r,value:a}=e;return(0,o.jsxs)(e0,{onValueChange:r,value:a,children:[(0,o.jsxs)(eU,{"data-testid":"select-button",children:[(0,o.jsx)(eY.ki,{"data-testid":"select-button-value"}),(0,o.jsx)(eY.GV,{children:(0,o.jsx)(e1,{direction:"down",title:"select"})})]}),(0,o.jsx)(eY.ue,{children:(0,o.jsxs)(eX,{css:{maxHeight:"".concat(i," !important")},"data-testid":"select-content",children:[(0,o.jsx)(eY.Pn,{children:(0,o.jsx)(e1,{direction:"up",title:"scroll up for more"})}),(0,o.jsx)(eY.Q_,{children:(0,o.jsxs)(eY.DI,{children:[n&&(0,o.jsx)(eK,{children:(0,o.jsx)(P.__,{"data-testid":"select-label",label:n})}),t]})}),(0,o.jsx)(eY.Jk,{children:(0,o.jsx)(e1,{direction:"down",title:"scroll down for more"})})]})})]})},e4=e=>(0,o.jsxs)(eQ,{...e,children:[e.thumbnail&&(0,o.jsx)(P.pl,{thumbnail:e.thumbnail}),(0,o.jsx)(eY.S_,{children:(0,o.jsx)(P.__,{label:e.label})}),(0,o.jsx)(eY.o6,{})]});let e3=(0,y.zo)("div",{position:"absolute !important",zIndex:"1",top:"1rem",left:"1rem",width:"161.8px",height:"100px",backgroundColor:"#000D",boxShadow:"5px 5px 5px #0002",borderRadius:"3px",".displayregion":{border:" 3px solid $accent !important",boxShadow:"0 0 3px #0006"},"@sm":{width:"123px",height:"76px"},"@xs":{width:"100px",height:"61.8px"}}),e5=(0,y.zo)("div",{position:"relative",width:"100%",height:"100%",zIndex:"0"}),e6=(0,y.zo)("div",{width:"100%",height:"61.8vh",maxHeight:"100vh",background:"black",backgroundSize:"contain",color:"white",position:"relative",zIndex:"1",overflow:"hidden"});var e8=n(2929),e7=n.n(e8),e9=e=>{let{id:t,label:n,children:i}=e;return(0,o.jsx)(eN,{id:t,"data-testid":"openseadragon-button",children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"".concat(t,"-svg-title"),"data-testid":"openseadragon-button-svg",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{id:"".concat(t,"-svg-title"),children:n}),i]})})};let te=(0,y.zo)("div",{position:"absolute",zIndex:"1",top:"1rem",display:"flex","@xs":{flexDirection:"column",zIndex:"2"},variants:{hasPlaceholder:{true:{right:"3.618rem","@xs":{top:"3.618rem",right:"1rem"}},false:{right:"1rem","@xs":{top:"1rem",right:"1rem"}}}}}),tt=()=>(0,o.jsx)("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),tn=()=>(0,o.jsx)("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),ti=()=>(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),to=()=>(0,o.jsx)("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),tr=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),(0,o.jsx)("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})]});var ta=e=>{let{hasPlaceholder:t,options:n}=e;return(0,o.jsxs)(te,{"data-testid":"openseadragon-controls",hasPlaceholder:t,id:"openseadragon-controls",children:[n.showZoomControl&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e9,{id:"zoomIn",label:"zoom in",children:(0,o.jsx)(tt,{})}),(0,o.jsx)(e9,{id:"zoomOut",label:"zoom out",children:(0,o.jsx)(tn,{})})]}),n.showFullPageControl&&(0,o.jsx)(e9,{id:"fullPage",label:"full page",children:(0,o.jsx)(ti,{})}),n.showRotationControl&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e9,{id:"rotateRight",label:"rotate right",children:(0,o.jsx)(tr,{})}),(0,o.jsx)(e9,{id:"rotateLeft",label:"rotate left",children:(0,o.jsx)(tr,{})})]}),n.showHomeControl&&(0,o.jsx)(e9,{id:"reset",label:"reset",children:(0,o.jsx)(to,{})})]})};let tl=e=>fetch("".concat(e.replace(/\/$/,""),"/info.json")).then(e=>e.json()).then(e=>e).catch(t=>{console.error("The IIIF tilesource ".concat(e.replace(/\/$/,""),"/info.json failed to load: ").concat(t))}),ts=e=>{let t,n;return Array.isArray(e)&&(t=e[0])&&(n="@id"in t?t["@id"]:t.id),n};var td=e=>{let{uri:t,hasPlaceholder:n,imageType:i}=e,[a,l]=(0,r.useState)(),s=m(),{configOptions:d}=s,c=(0,X.Z)(),u={id:"openseadragon-viewport-".concat(c),loadTilesWithAjax:!0,fullPageButton:"fullPage",homeButton:"reset",rotateLeftButton:"rotateLeft",rotateRightButton:"rotateRight",zoomInButton:"zoomIn",zoomOutButton:"zoomOut",showNavigator:!0,showFullPageControl:!0,showHomeControl:!0,showRotationControl:!0,showZoomControl:!0,navigatorBorderColor:"transparent",navigatorId:"openseadragon-navigator-".concat(c),gestureSettingsMouse:{clickToZoom:!0,dblClickToZoom:!0,pinchToZoom:!0,scrollToZoom:!0},...d.openSeadragon,ajaxWithCredentials:d.withCredentials};return(0,r.useEffect)(()=>{t!==a&&l(t)},[a,t]),(0,r.useEffect)(()=>{if(a)switch(i){case"simpleImage":e7()(u).addSimpleImage({url:a});break;case"tiledImage":tl(a).then(e=>e7()(u).addTiledImage({tileSource:e}));break;default:console.warn("Unable to render ".concat(a,' in OpenSeadragon as type: "').concat(i,'"'))}},[a]),(0,o.jsxs)(e6,{css:{backgroundColor:d.canvasBackgroundColor,height:d.canvasHeight},children:[(0,o.jsx)(ta,{hasPlaceholder:n,options:u}),(0,o.jsx)(e3,{id:"openseadragon-navigator-".concat(c)}),(0,o.jsx)(e5,{id:"openseadragon-viewport-".concat(c)})]})},tc=e=>{let{painting:t,hasPlaceholder:n}=e,[i,a]=(0,r.useState)(),[l,s]=(0,r.useState)();return(0,r.useEffect)(()=>{Array.isArray(null==t?void 0:t.service)&&(null==t?void 0:t.service.length)>0?(a("tiledImage"),s(ts(null==t?void 0:t.service))):(a("simpleImage"),s(null==t?void 0:t.id))},[t]),(0,o.jsx)(td,{uri:l,hasPlaceholder:n,imageType:i},l)},tu=e=>{let{isMedia:t,label:n,placeholderCanvas:i,setIsInteractive:r}=e,{vault:a}=m(),l=v(a,i),s=l?l[0]:void 0,d=n?ea(n):["placeholder image"];return(0,o.jsx)(e_,{onClick:()=>r(!0),isMedia:t,children:(0,o.jsx)("img",{src:(null==s?void 0:s.id)||"",alt:d.join(),height:null==s?void 0:s.height,width:null==s?void 0:s.width})})},th=n(3398);let tp=(0,y.zo)("canvas",{position:"absolute",width:"100%",height:"100%",zIndex:"0"}),tm=r.forwardRef((e,t)=>{let n=r.useRef(null),i=(0,r.useCallback)(()=>{var e,i;if((null===(e=t.current)||void 0===e?void 0:e.currentTime)&&(null===(i=t.current)||void 0===i?void 0:i.currentTime)>0)return;let o=t.current;if(!o)return;let r=new AudioContext,a=r.createMediaElementSource(o),l=r.createAnalyser(),s=n.current;if(!s)return;s.width=o.offsetWidth,s.height=o.offsetHeight;let d=s.getContext("2d");a.connect(l),l.connect(r.destination),l.fftSize=256;let c=l.frequencyBinCount,u=new Uint8Array(c);setInterval(function(){!function(e,t,n,i,o,r){let a;let l=o/n*2.6,s=0;e.getByteFrequencyData(i),t.fillStyle="#000000",t.fillRect(0,0,o,r);for(let e=0;e{t&&t.current&&(t.current.onplay=i)},[i,t]),(0,o.jsx)(tp,{ref:n,role:"presentation"})}),tg=(0,y.zo)("div",{position:"relative",backgroundColor:"$primaryAlt",display:"flex",flexGrow:"0",flexShrink:"1",maxHeight:"500px",zIndex:"1",video:{backgroundColor:"transparent",objectFit:"contain",width:"100%",height:"100%",position:"relative",zIndex:"1"}});var tx=e=>{let{resource:t,ignoreCaptionLabels:n}=e,i=ea(t.label,"en"),r=Array.isArray(i)&&i.some(e=>n.includes(e));return r?null:(0,o.jsx)("track",{src:t.id,label:Array.isArray(i)?i[0]:i,srcLang:"en","data-testid":"player-track"},t.id)},tf=e=>{let{allSources:t,resources:n,painting:i}=e,[a,l]=r.useState(0),[s,d]=r.useState(),c=r.useRef(null),u=(null==i?void 0:i.type)==="Sound",h=m(),{activeCanvas:p,configOptions:g,vault:x}=h;return(0,r.useEffect)(()=>{if(!i.id||!c.current)return;if(null==c?void 0:c.current){let e=c.current;e.src=i.id,e.load()}if("m3u8"!==i.id.split(".").pop())return;let e=new th.Z({xhrSetup:function(e,t){e.withCredentials=!!g.withCredentials}});return e.attachMedia(c.current),e.on(th.Z.Events.MEDIA_ATTACHED,function(){e.loadSource(i.id)}),e.on(th.Z.Events.ERROR,function(t,n){if(n.fatal)switch(n.type){case th.Z.ErrorTypes.NETWORK_ERROR:console.error("fatal ".concat(t," network error encountered, try to recover")),e.startLoad();break;case th.Z.ErrorTypes.MEDIA_ERROR:console.error("fatal ".concat(t," media error encountered, try to recover")),e.recoverMediaError();break;default:e.destroy()}}),()=>{if(e&&c.current){let t=c.current;e.detachMedia(),e.destroy(),t.currentTime=0}}},[g.withCredentials,i.id]),(0,r.useEffect)(()=>{var e,t,n,i;let o=x.get(p),r=(null===(e=o.accompanyingCanvas)||void 0===e?void 0:e.id)?v(x,null===(t=o.accompanyingCanvas)||void 0===t?void 0:t.id):null,l=(null===(n=o.placeholderCanvas)||void 0===n?void 0:n.id)?v(x,null===(i=o.placeholderCanvas)||void 0===i?void 0:i.id):null;r&&l?0===a?d(l[0].id):d(r[0].id):(r&&d(r[0].id),l&&d(l[0].id))},[p,a,x]),(0,r.useEffect)(()=>{if(null==c?void 0:c.current){let e=c.current;return null==e||e.addEventListener("timeupdate",()=>l(e.currentTime)),()=>document.removeEventListener("timeupdate",()=>{})}},[]),(0,o.jsxs)(tg,{css:{backgroundColor:g.canvasBackgroundColor,maxHeight:g.canvasHeight,position:"relative"},"data-testid":"player-wrapper",children:[(0,o.jsxs)("video",{id:"clover-iiif-video",ref:c,controls:!0,height:i.height,width:i.width,crossOrigin:"anonymous",poster:s,style:{maxHeight:g.canvasHeight,position:"relative",zIndex:"1"},children:[t.map(e=>(0,o.jsx)("source",{src:e.id,type:e.format},e.id)),n.length>0&&n.map(e=>(0,o.jsx)(tx,{resource:e,ignoreCaptionLabels:g.ignoreCaptionLabels||[]},e.id)),"Sorry, your browser doesn't support embedded videos."]},i.id),u&&(0,o.jsx)(tm,{ref:c})]})};let tv=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-svg-title",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{id:"close-svg-title",children:"close"}),(0,o.jsx)("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})]}),tb=e=>{let{isMedia:t}=e;return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"open-svg-title",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{id:"open-svg-title",children:"open"}),t?(0,o.jsx)("path",{d:"M133 440a35.37 35.37 0 01-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0135.77.45l247.85 148.36a36 36 0 010 61l-247.89 148.4A35.5 35.5 0 01133 440z"}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),(0,o.jsx)("path",{d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"})]})]})};var tj=e=>{let{handleToggle:t,isInteractive:n,isMedia:i}=e;return(0,o.jsx)(eG,{onClick:t,isInteractive:n,isMedia:i,children:n?(0,o.jsx)(tv,{}):(0,o.jsx)(tb,{isMedia:i})})},ty=e=>{var t,n;let{activeCanvas:i,isMedia:a,painting:l,resources:s}=e,[d,c]=r.useState(0),[u,h]=r.useState(!1),{configOptions:p,vault:g}=m(),x=g.get(i),f=null==x?void 0:null===(t=x.placeholderCanvas)||void 0===t?void 0:t.id,v=(null==l?void 0:l.length)>1,b=f&&!u&&!a;return(0,o.jsxs)(eZ,{children:[(0,o.jsxs)(eq,{style:{backgroundColor:p.canvasBackgroundColor,maxHeight:p.canvasHeight},children:[f&&!a&&(0,o.jsx)(tj,{handleToggle:()=>h(!u),isInteractive:u,isMedia:a}),b&&!a&&(0,o.jsx)(tu,{isMedia:a,label:null==x?void 0:x.label,placeholderCanvas:f,setIsInteractive:h}),!b&&(0,o.jsx)("div",{children:a?(0,o.jsx)(tf,{allSources:l,painting:l[d],resources:s}):l&&(0,o.jsx)(tc,{painting:l[d],hasPlaceholder:!!f},i)})]}),v&&(0,o.jsx)(e2,{value:null===(n=l[d])||void 0===n?void 0:n.id,onValueChange:e=>{let t=l.findIndex(t=>t.id===e);c(t)},maxHeight:"200px",children:null==l?void 0:l.map(e=>(0,o.jsx)(e4,{value:null==e?void 0:e.id,label:null==e?void 0:e.label},null==e?void 0:e.id))})]})},tw=e=>{let{activeCanvas:t,painting:n,resources:i,items:r,isAudioVideo:a}=e,{informationOpen:l,configOptions:s}=m(),{informationPanel:d}=s,c=(null==d?void 0:d.renderAbout)||(null==d?void 0:d.renderSupplementing)&&i.length>0;return(0,o.jsxs)(I,{className:"clover-content",children:[(0,o.jsxs)(M,{children:[(0,o.jsx)(ty,{activeCanvas:t,isMedia:a,painting:n,resources:i}),c&&(0,o.jsx)(L,{children:(0,o.jsx)("span",{children:l?"View Items":"More Information"})}),r.length>1&&(0,o.jsx)(S,{className:"clover-canvases",children:(0,o.jsx)(eD,{items:r,activeItem:0})})]}),l&&c&&(0,o.jsx)(A,{children:(0,o.jsx)($,{children:(0,o.jsx)(ed,{activeCanvas:t,resources:i})})})]})};let tC=(0,y.zo)(eT.Trigger,{width:"30px",padding:"5px"}),tk=(0,y.zo)(eT.Content,{display:"flex",flexDirection:"column",fontSize:"0.8333rem",border:"none",boxShadow:"2px 2px 5px #0003",zIndex:"2",button:{display:"flex",textDecoration:"none",marginBottom:"0.5em",color:"$accentAlt",cursor:"pointer",background:"$secondary",border:"none","&:last-child":{marginBottom:"0"}}}),tz=(0,y.zo)("span",{fontSize:"1.33rem",alignSelf:"flex-start",flexGrow:"0",flexShrink:"1",padding:"1rem","@sm":{fontSize:"1rem"},"&.visually-hidden":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}),tS=(0,y.zo)("header",{display:"flex",backgroundColor:"transparent !important",justifyContent:"space-between",alignItems:"flex-start",width:"100%",["> ".concat(e0)]:{flexGrow:"1",flexShrink:"0"},form:{flexGrow:"0",flexShrink:"1"}}),tI=(0,y.zo)("div",{display:"flex",alignItems:"flex-end",justifyContent:"flex-end",padding:"1rem",flexShrink:"0",flexGrow:"1"});var tM=()=>{var e;let t=g(),n=m(),{activeManifest:i,collection:r,configOptions:a,vault:l}=n,s=null==a?void 0:a.canvasHeight;return(0,o.jsx)("div",{style:{margin:"0.75rem"},children:(0,o.jsx)(e2,{label:r.label,maxHeight:s,value:i,onValueChange:e=>{t({type:"updateActiveManifest",manifestId:e})},children:null==r?void 0:null===(e=r.items)||void 0===e?void 0:e.map(e=>(0,o.jsx)(e4,{value:e.id,thumbnail:(null==e?void 0:e.thumbnail)?l.get(null==e?void 0:e.thumbnail):void 0,label:e.label},e.id))})})};let tL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2500,[n,i]=(0,r.useState)(),o=(0,r.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>i("copied"),()=>i("failed"))},[e]);return(0,r.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>i(void 0),t);return()=>clearTimeout(e)},[n]),[n,o]},t$=(0,y.zo)("span",{display:"flex",alignContent:"center",alignItems:"center",padding:"0.125rem 0.25rem 0",marginTop:"-0.125rem",marginLeft:"0.5rem",backgroundColor:"$accent",color:"$secondary",borderRadius:"3px",fontSize:"0.6111rem",textTransform:"uppercase",lineHeight:"1em"}),tA=e=>{let{status:t}=e;return t?(0,o.jsx)(t$,{"data-copy-status":t,children:t}):null};var tR=e=>{let{textPrompt:t,textToCopy:n}=e,[i,r]=tL(n);return(0,o.jsxs)("button",{onClick:r,children:[t," ",(0,o.jsx)(tA,{status:i})]})},tT=()=>{let e="#ed1d33",t="#2873ab";return(0,o.jsxs)("svg",{viewBox:"0 0 493.35999 441.33334",id:"iiif-logo",version:"1.1",children:[(0,o.jsx)("title",{children:"IIIF Manifest Options"}),(0,o.jsx)("g",{transform:"matrix(1.3333333,0,0,-1.3333333,0,441.33333)",children:(0,o.jsxs)("g",{transform:"scale(0.1)",children:[(0,o.jsx)("path",{style:{fill:t},d:"M 65.2422,2178.75 775.242,1915 773.992,15 65.2422,276.25 v 1902.5"}),(0,o.jsx)("path",{style:{fill:t},d:"m 804.145,2640.09 c 81.441,-240.91 -26.473,-436.2 -241.04,-436.2 -214.558,0 -454.511,195.29 -535.9527,436.2 -81.4335,240.89 26.4805,436.18 241.0387,436.18 214.567,0 454.512,-195.29 535.954,-436.18"}),(0,o.jsx)("path",{style:{fill:e},d:"M 1678.58,2178.75 968.578,1915 969.828,15 1678.58,276.25 v 1902.5"}),(0,o.jsx)("path",{style:{fill:e},d:"m 935.082,2640.09 c -81.437,-240.91 26.477,-436.2 241.038,-436.2 214.56,0 454.51,195.29 535.96,436.2 81.43,240.89 -26.48,436.18 -241.04,436.18 -214.57,0 -454.52,-195.29 -535.958,-436.18"}),(0,o.jsx)("path",{style:{fill:t},d:"m 1860.24,2178.75 710,-263.75 -1.25,-1900 -708.75,261.25 v 1902.5"}),(0,o.jsx)("path",{style:{fill:t},d:"m 2603.74,2640.09 c 81.45,-240.91 -26.47,-436.2 -241.03,-436.2 -214.58,0 -454.52,195.29 -535.96,436.2 -81.44,240.89 26.48,436.18 241.03,436.18 214.57,0 454.51,-195.29 535.96,-436.18"}),(0,o.jsx)("path",{style:{fill:e},d:"m 3700.24,3310 v -652.5 c 0,0 -230,90 -257.5,-142.5 -2.5,-247.5 0,-336.25 0,-336.25 l 257.5,83.75 V 1690 l -258.61,-92.5 V 262.5 L 2735.24,0 v 2360 c 0,0 -15,850 965,950"})]})})]})},tE=n(7067);let tF=(0,y.zo)(tE.fC,{all:"unset",height:"2rem",width:"3.236rem",backgroundColor:"#6663",borderRadius:"9999px",position:"relative",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:focus":{boxShadow:"0 0 0 2px $secondaryAlt"},'&[data-state="checked"]':{backgroundColor:"$accent",boxShadow:"inset 2px 2px 5px #0003"}}),tH=(0,y.zo)(tE.bU,{display:"block",height:"calc(2rem - 12px)",width:"calc(2rem - 12px)",backgroundColor:"$secondary",borderRadius:"100%",boxShadow:"2px 2px 5px #0001",transition:"$all",transform:"translateX(6px)",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc(1.236rem + 6px))"}}),tB=(0,y.zo)("label",{fontSize:"0.8333rem",fontWeight:"400",lineHeight:"1em",userSelect:"none",cursor:"pointer",paddingRight:"0.618rem"}),tV=(0,y.zo)("form",{display:"flex",flexShrink:"0",flexGrow:"1",alignItems:"center",marginLeft:"1.618rem"});var tO=()=>{var e;let{configOptions:t}=m(),n=g(),[i,a]=(0,r.useState)(null==t?void 0:null===(e=t.informationPanel)||void 0===e?void 0:e.open);return(0,r.useEffect)(()=>{n({type:"updateInformationOpen",informationOpen:i})},[i]),(0,o.jsxs)(tV,{children:[(0,o.jsx)(tB,{htmlFor:"information-toggle",css:i?{opacity:"1"}:{},children:"More Information"}),(0,o.jsx)(tF,{checked:i,onCheckedChange:()=>a(!i),id:"information-toggle","aria-label":"information panel toggle",name:"toggled?",children:(0,o.jsx)(tH,{})})]})};let tW=e=>{let t=()=>!!window.matchMedia&&window.matchMedia(e).matches,[n,i]=(0,r.useState)(t);return(0,r.useEffect)(()=>{let e=()=>i(t);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),n};var tP=e=>{let{manifestId:t,manifestLabel:n}=e,i=m(),{collection:r,configOptions:a}=i,{showTitle:l,showIIIFBadge:s,informationPanel:d}=a,c=s||(null==d?void 0:d.renderToggle),u=tW(y.BC.sm);return(0,o.jsxs)(tS,{className:"clover-header",children:[(null==r?void 0:r.items)?(0,o.jsx)(tM,{}):(0,o.jsx)(tz,{className:l?"":"visually-hidden",children:l&&(0,o.jsx)(P.__,{label:n})}),c&&(0,o.jsxs)(tI,{children:[s&&(0,o.jsxs)(eT,{children:[(0,o.jsx)(tC,{children:(0,o.jsx)(tT,{})}),(0,o.jsxs)(tk,{children:[(null==r?void 0:r.items)&&(0,o.jsx)("button",{onClick:e=>{e.preventDefault(),window.open(r.id,"_blank")},children:"View Collection"}),(0,o.jsx)("button",{onClick:e=>{e.preventDefault(),window.open(t,"_blank")},children:"View Manifest"})," ",(null==r?void 0:r.items)&&(0,o.jsx)(tR,{textPrompt:"Copy Collection URL",textToCopy:r.id}),(0,o.jsx)(tR,{textPrompt:"Copy Manifest URL",textToCopy:t})]})]}),(null==d?void 0:d.renderToggle)&&!u&&(0,o.jsx)(tO,{})]})]})};let tD=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[t,n]=(0,r.useState)(e);return(0,r.useLayoutEffect)(()=>{if(!t)return;let e=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=e}},[t]),(0,r.useEffect)(()=>{t!==e&&n(e)},[e]),[t,n]};var t_=e=>{var t;let{manifest:n,theme:i}=e,a=m(),l=g(),{activeCanvas:s,informationOpen:d,vault:c,configOptions:u}=a,[h,p]=(0,r.useState)(!1),[f,w]=(0,r.useState)(!1),[C,k]=(0,r.useState)([]),[S,I]=(0,r.useState)([]),[M,L]=tD(!1),$=tW(y.BC.sm),A=(0,r.useCallback)(e=>{l({type:"updateInformationOpen",informationOpen:e})},[l]);return(0,r.useEffect)(()=>{var e;(null==u?void 0:null===(e=u.informationPanel)||void 0===e?void 0:e.open)&&A(!$)},[$,null==u?void 0:null===(t=u.informationPanel)||void 0===t?void 0:t.open,A]),(0,r.useEffect)(()=>{if(!$){L(!1);return}L(d)},[d,$,L]),(0,r.useEffect)(()=>{let e=v(c,s),t=b(c,s,"text/vtt");e&&(w(["Sound","Video"].indexOf(e[0].type)>-1),k(e)),I(t),p(0!==t.length)},[s,c]),(0,o.jsx)(j.SV,{FallbackComponent:z,children:(0,o.jsx)(R,{className:"".concat(i," clover-iiif"),css:{background:null==u?void 0:u.background},"data-body-locked":M,"data-information-panel":h,"data-information-panel-open":d,children:(0,o.jsxs)(x.fC,{open:d,onOpenChange:A,children:[(0,o.jsx)(tP,{manifestLabel:n.label,manifestId:n.id}),(0,o.jsx)(tw,{activeCanvas:s,painting:C,resources:S,items:n.items,isAudioVideo:f})]})})})},tN=n(458);let tG={ignoreCache:!1,headers:{Accept:"application/json, text/javascript, text/plain"},timeout:5e3,withCredentials:!1};function tZ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{ok:!1,status:e.status,statusText:e.statusText,headers:e.getAllResponseHeaders(),data:t||e.statusText,json:()=>JSON.parse(t||e.statusText)}}let tq=e=>{let{canvasIdCallback:t,customTheme:n,iiifContent:i,options:a}=e,l=g(),s=m(),{activeCanvas:d,activeManifest:c,isLoaded:u,vault:h}=s,[p,x]=(0,r.useState)(),[f,v]=(0,r.useState)(),b={};return(n&&(b=(0,tN.jG)("custom",n)),(0,r.useEffect)(()=>{t&&t(d)},[d,t]),(0,r.useEffect)(()=>{c&&h.loadManifest(c).then(e=>{v(e),l({type:"updateActiveCanvas",canvasId:e.items[0]&&e.items[0].id})}).catch(e=>{console.error("Manifest failed to load: ".concat(e))}).finally(()=>{l({type:"updateIsLoaded",isLoaded:!0})})},[c,l,h]),(0,r.useEffect)(()=>{l({type:"updateConfigOptions",configOptions:a}),h.load(i).then(e=>{x(e)}).catch(e=>{console.error("The IIIF resource ".concat(i," failed to load: ").concat(e))})},[l,i,a,h]),(0,r.useEffect)(()=>{let e=[];(null==p?void 0:p.type)==="Collection"?(l({type:"updateCollection",collection:p}),(e=p.items.filter(e=>"Manifest"===e.type).map(e=>e.id)).length>0&&l({type:"updateActiveManifest",manifestId:e[0]})):(null==p?void 0:p.type)==="Manifest"&&l({type:"updateActiveManifest",manifestId:p.id})},[l,p]),u)?f&&f.items?0===f.items.length?(console.log("The IIIF manifest ".concat(i," does not contain canvases.")),(0,o.jsx)(o.Fragment,{})):(0,o.jsx)(t_,{manifest:f,theme:b},f.id):(console.log("The IIIF manifest ".concat(i," failed to load.")),(0,o.jsx)(o.Fragment,{})):(0,o.jsx)(o.Fragment,{children:"Loading"})};var tY=e=>{var t;let{canvasIdCallback:n=()=>{},customTheme:i,iiifContent:r,id:l,manifestId:s,options:c}=e,u=r;return l&&(u=l),s&&(u=s),(0,o.jsx)(p,{initialState:{...d,informationOpen:!!(null==c?void 0:null===(t=c.informationPanel)||void 0===t?void 0:t.open),vault:new a.j({customFetcher:e=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tG,n=t.headers||tG.headers;return new Promise((i,o)=>{let r=new XMLHttpRequest;r.open("get",e),r.withCredentials=t.withCredentials,n&&Object.keys(n).forEach(e=>r.setRequestHeader(e,n[e])),r.onload=()=>{i({ok:r.status>=200&&r.status<300,status:r.status,statusText:r.statusText,headers:r.getAllResponseHeaders(),data:r.responseText,json:()=>JSON.parse(r.responseText)})},r.onerror=()=>{o(tZ(r,"Failed to make request."))},r.ontimeout=()=>{o(tZ(r,"Request took longer than expected."))},r.send()})})(e,{withCredentials:null==c?void 0:c.withCredentials,headers:null==c?void 0:c.requestHeaders}).then(e=>JSON.parse(e.data))})},children:(0,o.jsx)(tq,{iiifContent:u,canvasIdCallback:n,customTheme:i,options:c})})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{4744:function(e,t,n){n.r(t),n.d(t,{default:function(){return tY}});var i,o=n(1527),r=n(959),a=n(8892),l=n(7785);let s={background:"transparent",canvasBackgroundColor:"#6662",canvasHeight:"61.8vh",ignoreCaptionLabels:[],informationPanel:{open:!0,renderAbout:!0,renderSupplementing:!0,renderToggle:!0},openSeadragon:{},requestHeaders:{"Content-Type":"application/json"},showIIIFBadge:!0,showTitle:!0,withCredentials:!1},d={activeCanvas:"",activeManifest:"",collection:{},configOptions:s,informationOpen:null==s?void 0:null===(i=s.informationPanel)||void 0===i?void 0:i.open,isLoaded:!1,vault:new a.j},c=r.createContext(d),u=r.createContext(d);function h(e,t){switch(t.type){case"updateActiveCanvas":return t.canvasId||(t.canvasId=""),{...e,activeCanvas:t.canvasId};case"updateActiveManifest":return{...e,activeManifest:t.manifestId};case"updateCollection":return{...e,collection:t.collection};case"updateConfigOptions":return{...e,configOptions:(0,l.RH)(e.configOptions,t.configOptions)};case"updateInformationOpen":return{...e,informationOpen:t.informationOpen};case"updateIsLoaded":return{...e,isLoaded:t.isLoaded};default:throw Error("Unhandled action type: ".concat(t.type))}}let p=e=>{let{initialState:t=d,children:n}=e,[i,a]=(0,r.useReducer)(h,t);return(0,o.jsx)(c.Provider,{value:i,children:(0,o.jsx)(u.Provider,{value:a,children:n})})};function m(){let e=r.useContext(c);if(void 0===e)throw Error("useViewerState must be used within a ViewerProvider");return e}function g(){let e=r.useContext(u);if(void 0===e)throw Error("useViewerDispatch must be used within a ViewerProvider");return e}var x=n(1844);let f=(e,t,n,i)=>{let o={canvas:void 0,accompanyingCanvas:void 0,annotationPage:void 0,annotations:[]};if(o.canvas=e.get(t),o.canvas){var r,a;o.annotationPage=e.get(o.canvas.items[0]),o.accompanyingCanvas=(null===(r=o.canvas)||void 0===r?void 0:r.accompanyingCanvas)?e.get(null===(a=o.canvas)||void 0===a?void 0:a.accompanyingCanvas):void 0}if(o.annotationPage){let r=e.get(o.annotationPage.items).map(t=>({body:e.get(t.body[0].id),motivation:t.motivation,type:"Annotation"})),a=[];r.forEach(t=>{"Choice"===t.body.type?t.body.items.forEach(n=>a.push({...t,id:n.id,body:e.get(n.id)})):a.push(t)}),o.annotations=a.filter(o=>{if(o){if(!o.body||!o.motivation){console.error("Invalid annotation after Hyperion parsing: missing either 'body' or 'motivation'",o);return}let r=o.body;Array.isArray(r)&&(r=r[0]);let a=e.get(r.id);if(a)switch(n){case"painting":return o.target===t.id&&o.motivation&&"painting"===o.motivation[0]&&i.includes(a.type)&&(o.body=a),!!o;case"supplementing":return;default:throw Error("Invalid annotation motivation.")}}})}return o},v=(e,t)=>{let n=f(e,{id:t,type:"Canvas"},"painting",["Image","Sound","Video"]);if(0!==n.annotations.length&&n.annotations&&n.annotations)return n.annotations.map(e=>null==e?void 0:e.body)},b=(e,t,n)=>{let i=e.get({id:t,type:"Canvas"});if(!(null==i?void 0:i.annotations)||!i.annotations[0])return[];let o=e.get(i.annotations[0]),r=e.get(o.items);return Array.isArray(r)?r.filter(t=>{var i;if(t.body&&(null===(i=t.motivation)||void 0===i?void 0:i.includes("supplementing"))){let i=t.body;Array.isArray(i)&&(i=i[0]);let o=e.get(i.id);if(o.format===n)return t.body=o,t}}).map(e=>e.body):[]};var j=n(1524),y=n(8734);let w=(0,y.zo)("div",{display:"flex",flexDirection:"column",alignItems:"center"}),C=(0,y.zo)("p",{fontWeight:"bold",fontSize:"x-large"}),k=(0,y.zo)("span",{fontSize:"medium"});var z=e=>{let{error:t}=e,{message:n}=t;return(0,o.jsxs)(w,{role:"alert",children:[(0,o.jsx)(C,{"data-testid":"headline",children:"Something went wrong"}),n&&(0,o.jsxs)(k,{children:["Error message: ".concat(n)," "]})]})};let S=(0,y.zo)("div",{position:"relative",zIndex:"0"}),I=(0,y.zo)("div",{display:"flex",flexDirection:"row",overflow:"hidden","@sm":{flexDirection:"column"}}),M=(0,y.zo)("div",{display:"flex",flexDirection:"column",flexGrow:"1",flexShrink:"1",width:"61.8%","@sm":{width:"100%"}}),L=(0,y.zo)(x.xz,{display:"none",border:"none",padding:"0",transition:"$all",opacity:"1",background:"#6663",margin:"1rem 0",borderRadius:"6px","&[data-information-panel='false']":{opacity:"0",marginTop:"-59px"},"@sm":{display:"flex","> span":{display:"flex",flexGrow:"1",fontSize:"0.8333em",justifyContent:"center",padding:"0.5rem",fontFamily:"inherit"}}}),$=(0,y.zo)(x.VY,{width:"100%",display:"flex"}),A=(0,y.zo)("aside",{display:"flex",flexGrow:"1",flexShrink:"0",width:"38.2%",maxHeight:"100%","@sm":{width:"100%"}}),R=(0,y.zo)("div",{display:"flex",flexDirection:"column",fontSmooth:"auto",webkitFontSmoothing:"antialiased","> div":{display:"flex",flexDirection:"column",flexGrow:"1",justifyContent:"flex-start","@sm":{["& ".concat(I)]:{flexGrow:"1"},["& ".concat(M)]:{flexGrow:"0"}}},"@sm":{padding:"0"},"&[data-information-panel-open='true']":{"@sm":{position:"fixed",height:"100%",width:"100%",top:"0",left:"0",zIndex:"2500000000",["& ".concat(S)]:{display:"none"},["& ".concat(L)]:{margin:"1rem"},["& ".concat($)]:{height:"100%"}}}});var T=n(3515);let E=(0,y.zo)(T.fC,{display:"flex",flexDirection:"column",width:"100%",height:"100%",flexGrow:"1",flexShrink:"0",position:"relative",zIndex:"1",maskImage:"linear-gradient(180deg, rgba(0, 0, 0, 1) calc(100% - 2rem), transparent 100%)","@sm":{marginTop:"0.5rem",boxShadow:"none"}}),F=(0,y.zo)(T.aV,{display:"flex",flexGrow:"0",margin:"0 1.618rem",borderBottom:"4px solid #6663","@sm":{margin:"0 1rem"}}),H=(0,y.zo)(T.xz,{display:"flex",position:"relative",padding:"0.5rem 1rem",background:"none",backgroundColor:"transparent",fontFamily:"inherit",border:"none",opacity:"0.7",fontSize:"1rem",marginRight:"1rem",lineHeight:"1rem",whiteSpace:"nowrap",cursor:"pointer",fontWeight:400,transition:"$all","&::after":{width:"0",height:"4px",content:"",position:"absolute",bottom:"-4px",left:"0",transition:"$all"},"&[data-state='active']":{opacity:"1",fontWeight:700,"&::after":{width:"100%",backgroundColor:"$accent"}}}),B=(0,y.zo)(T.VY,{display:"flex",flexGrow:"1",flexShrink:"0",position:"absolute",top:"0",left:"0","&[data-state='active']":{width:"100%",height:"calc(100% - 2rem)",padding:"1.618rem 0"}}),V=(0,y.zo)("div",{position:"relative",height:"100%",width:"100%",overflowY:"scroll"}),O=(0,y.zo)("div",{padding:" 0 1.618rem 2rem",display:"flex",flexDirection:"column",overflow:"scroll",position:"absolute",fontWeight:"400",fontSize:"1rem",zIndex:"0",img:{maxWidth:"100px",maxHeight:"100px",objectFit:"contain",color:"transparent",margin:"0 0 1rem",borderRadius:"3px",backgroundColor:"$secondaryMuted"},video:{display:"none"},"a, a:visited":{color:"$accent"},p:{fontSize:"1rem",lineHeight:"1.45em",margin:"0"},dl:{margin:"0",dt:{fontWeight:"700",margin:"1rem 0 0.25rem"},dd:{margin:"0"}},".manifest-property-title":{fontWeight:"700",margin:"1rem 0 0.25rem"},"ul, ol":{padding:"0",margin:"0",li:{fontSize:"1rem",lineHeight:"1.45em",listStyle:"none",margin:"0.25rem 0 0.25rem"}}}),W=(0,y.zo)("div",{position:"relative",width:"100%",height:"100%",zIndex:"0"});var P=n(9960),D=e=>{let{homepage:t}=e;return(null==t?void 0:t.length)===0?(0,o.jsx)(o.Fragment,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:"Homepage"}),(0,o.jsx)(P.bw,{homepage:t})]})},_=e=>{let{id:t,htmlLabel:n,parent:i="manifest"}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:n}),(0,o.jsx)("a",{href:t,target:"_blank",id:"iiif-".concat(i,"-id"),children:t})]})},N=e=>{let{metadata:t,parent:n="manifest"}=e;return t?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.SF,{metadata:t,id:"iiif-".concat(n,"-metadata")})}):(0,o.jsx)(o.Fragment,{})},G=e=>{let{requiredStatement:t,parent:n="manifest"}=e;return t?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.bT,{requiredStatement:t,id:"iiif-".concat(n,"-required-statement")})}):(0,o.jsx)(o.Fragment,{})},Z=e=>{let{rights:t}=e;return t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:"Rights"}),(0,o.jsx)("a",{href:t,target:"_blank",children:t})]}):(0,o.jsx)(o.Fragment,{})},q=e=>{let{seeAlso:t}=e;return(null==t?void 0:t.length)===0?(0,o.jsx)(o.Fragment,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"manifest-property-title",children:"See Also"}),(0,o.jsx)(P.QZ,{seeAlso:t})]})},Y=e=>{let{summary:t,parent:n="manifest"}=e;return t?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.ER,{summary:t,as:"p",id:"iiif-".concat(n,"-summary")})}):(0,o.jsx)(o.Fragment,{})},J=e=>{let{label:t,thumbnail:n}=e;return(null==n?void 0:n.length)===0?(0,o.jsx)(o.Fragment,{}):(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(P.pl,{altAsLabel:t||{none:["resource"]},thumbnail:n,style:{backgroundColor:"#6663",objectFit:"cover"}})})},U=()=>{let e=m(),{activeManifest:t,vault:n}=e,[i,a]=(0,r.useState)(),[l,s]=(0,r.useState)([]),[d,c]=(0,r.useState)([]),[u,h]=(0,r.useState)([]);return((0,r.useEffect)(()=>{var e,i,o;let r=n.get(t);a(r),(null===(e=r.homepage)||void 0===e?void 0:e.length)>0&&s(n.get(r.homepage)),(null===(i=r.seeAlso)||void 0===i?void 0:i.length)>0&&c(n.get(r.seeAlso)),(null===(o=r.thumbnail)||void 0===o?void 0:o.length)>0&&h(n.get(r.thumbnail))},[t,n]),i)?(0,o.jsx)(W,{children:(0,o.jsxs)(O,{children:[(0,o.jsx)(J,{thumbnail:u,label:i.label}),(0,o.jsx)(Y,{summary:i.summary}),(0,o.jsx)(N,{metadata:i.metadata}),(0,o.jsx)(G,{requiredStatement:i.requiredStatement}),(0,o.jsx)(Z,{rights:i.rights}),(0,o.jsx)(D,{homepage:l}),(0,o.jsx)(q,{seeAlso:d}),(0,o.jsx)(_,{id:i.id,htmlLabel:"IIIF Manifest"})]})}):(0,o.jsx)(o.Fragment,{})},X=n(2950),Q=()=>{function e(e){return e.map(e=>{let t=e.identifier||(0,X.Z)();return{...e,identifier:t}})}return{addIdentifiersToParsedCues:e,createNestedCues:function(t){let n=[],i=[],o=e(t);for(let e of o){for(;i.length>0&&i[i.length-1].end<=e.start;)i.pop();if(i.length>0){var r;i[i.length-1].children||(i[i.length-1].children=[]),null===(r=i[i.length-1].children)||void 0===r||r.push(e),i.push(e)}else n.push(e),i.push(e)}return n},isChild:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.some(t=>e.start>=t.start&&e.end<=t.end)},orderCuesByTime:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.sort((e,t)=>e.start-t.start)}}},K=n(6446);let ee=(0,y.F4)({from:{transform:"rotate(360deg)"},to:{transform:"rotate(0deg)"}}),et=(0,y.zo)(K.fC,{display:"flex",flexDirection:"column",width:"100%"}),en=(0,y.zo)(K.ck,{position:"relative",cursor:"pointer",display:"flex",width:"100%",justifyContent:"space-between",textAlign:"left",margin:"0",padding:"0.5rem 1.618rem",fontFamily:"inherit",lineHeight:"1.25em",fontSize:"1rem",color:"inherit",border:"none",background:"none","@sm":{padding:"0.5rem 1rem",fontSize:"0.8333rem"},"&::before":{content:"",width:"12px",height:"12px",borderRadius:"12px",position:"absolute",backgroundColor:"$primaryMuted",opacity:"0",left:"8px",marginTop:"3px",boxSizing:"content-box","@sm":{content:"unset"}},"&::after":{content:"",width:"4px",height:"6px",position:"absolute",backgroundColor:"$secondary",opacity:"0",clipPath:"polygon(100% 50%, 0 100%, 0 0)",left:"13px",marginTop:"6px",boxSizing:"content-box","@sm":{content:"unset"}},strong:{marginLeft:"1rem"},"&:hover":{color:"$accent","&::before":{backgroundColor:"$accent",opacity:"1"},"&::after":{content:"",width:"4px",height:"6px",position:"absolute",backgroundColor:"$secondary",clipPath:"polygon(100% 50%, 0 100%, 0 0)",opacity:"1"}},"&[aria-checked='true']":{backgroundColor:"#6663","&::before":{content:"",width:"6px",height:"6px",position:"absolute",backgroundColor:"transparent",border:"3px solid $accentMuted",borderRadius:"12px",left:"8px",marginTop:"4px",opacity:"1",animation:"1s linear infinite",animationName:ee,boxSizing:"content-box","@sm":{content:"unset"}},"&::after":{content:"",width:"6px",height:"6px",position:"absolute",backgroundColor:"transparent",border:"3px solid $accent",clipPath:"polygon(100% 0, 100% 100%, 0 0)",borderRadius:"12px",left:"8px",marginTop:"4px",opacity:"1",animation:"1.5s linear infinite",animationName:ee,boxSizing:"content-box","@sm":{content:"unset"}}}});var ei=e=>{let{label:t,start:n,end:i}=e,[a,s]=(0,r.useState)(!1),d=document.getElementById("clover-iiif-video");return(0,r.useEffect)(()=>(null==d||d.addEventListener("timeupdate",()=>{let{currentTime:e}=d;s(n<=e&&edocument.removeEventListener("timeupdate",()=>{})),[i,n,d]),(0,o.jsxs)(en,{"aria-checked":a,"data-testid":"information-panel-cue",onClick:()=>{d&&(d.pause(),d.currentTime=n,d.play())},value:t,children:[t,(0,o.jsx)("strong",{children:(0,l.rJ)(n)})]})};let eo=(0,y.zo)("ul",{listStyle:"none",paddingLeft:"1rem",position:"relative","&&:first-child":{paddingLeft:"0"},"& li ul":{["& ".concat(en)]:{backgroundColor:"unset","&::before":{content:"none"},"&::after":{content:"none"}}},"&:first-child":{margin:"0 0 1.618rem"}}),er=e=>{let{items:t}=e;return(0,o.jsx)(eo,{children:t.map(e=>{let{text:t,start:n,end:i,children:r,identifier:a}=e;return(0,o.jsxs)("li",{children:[(0,o.jsx)(ei,{label:t,start:n,end:i}),r&&(0,o.jsx)(er,{items:r})]},a)})})},ea=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";if(!e)return"";if(!e[t]){let t=Object.getOwnPropertyNames(e);if(t.length>0)return e[t[0]]}return e[t]};var el=n(3836),es=e=>{let{resource:t}=e,[n,i]=r.useState([]),{id:a,label:l}=t,{createNestedCues:s,orderCuesByTime:d}=Q();return(0,r.useEffect)(()=>{a&&fetch(a,{headers:{"Content-Type":"text/plain",Accept:"application/json"}}).then(e=>e.text()).then(e=>{let t=(0,el.parse)(e).cues,n=d(t),o=s(n);i(o)}).catch(e=>console.error(a,e.toString()))},[s,a,d]),(0,o.jsx)(et,{"aria-label":"navigate ".concat(ea(l,"en")),children:(0,o.jsx)(er,{items:n})})},ed=e=>{var t;let{activeCanvas:n,resources:i}=e,a=m(),{configOptions:l}=a,{informationPanel:s}=l,[d,c]=(0,r.useState)(),u=(null==s?void 0:s.renderAbout)||(null==l?void 0:null===(t=l.informationPanel)||void 0===t?void 0:t.renderAbout),h=null==s?void 0:s.renderSupplementing;return((0,r.useEffect)(()=>{u?c("manifest-about"):i&&(null==i?void 0:i.length)>0&&!u&&c(i[0].id)},[n,u,i]),i)?(0,o.jsxs)(E,{"data-testid":"information-panel",defaultValue:d,onValueChange:e=>{c(e)},orientation:"horizontal",value:d,children:[(0,o.jsxs)(F,{"aria-label":"select chapter","data-testid":"information-panel-list",children:[u&&(0,o.jsx)(H,{value:"manifest-about",children:"About"}),h&&i&&i.map(e=>{let{id:t,label:n}=e;return(0,o.jsx)(H,{value:t,children:(0,o.jsx)(P.__,{label:n})},t)})]}),(0,o.jsxs)(V,{children:[u&&(0,o.jsx)(B,{value:"manifest-about",children:(0,o.jsx)(U,{})}),h&&i&&i.map(e=>(0,o.jsx)(B,{value:e.id,children:(0,o.jsx)(es,{resource:e})},e.id))]})]}):(0,o.jsx)(o.Fragment,{})};let ec=(e,t,n,i)=>{let o=[];if(t.canvas&&t.canvas.thumbnail.length>0){let n=e.get(t.canvas.thumbnail[0]);o.push(n)}if(t.annotations[0]){if(t.annotations[0].thumbnail&&t.annotations[0].thumbnail.length>0){let n=e.get(t.annotations[0].thumbnail[0]);o.push(n)}if(!t.annotations[0].body)return;let n=t.annotations[0].body;"Image"===n.type&&o.push(n)}if(0===o.length)return;let r={id:o[0].id,format:o[0].format,type:o[0].type,width:n,height:i};return r},eu=(0,y.zo)("div",{position:"absolute",right:"1rem",top:"1rem",display:"flex",justifyContent:"flex-end",zIndex:"1"}),eh=(0,y.zo)("input",{flexGrow:"1",border:"none",backgroundColor:"$secondaryMuted",color:"$primary",marginRight:"1rem",height:"2rem",padding:"0 1rem",borderRadius:"2rem",fontFamily:"inherit",fontSize:"1rem",lineHeight:"1rem",boxShadow:"inset 1px 1px 2px #0003","&::placeholder":{color:"$primaryMuted"}}),ep=(0,y.zo)("button",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",fontWeight:"700",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",svg:{height:"60%",width:"60%",padding:"20%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",boxSizing:"inherit",transition:"$all"},"&:disabled":{backgroundColor:"transparent",boxShadow:"none",svg:{opacity:"0.25"}}}),em=(0,y.zo)("div",{display:"flex",marginRight:"0.618rem",backgroundColor:"$accentAlt",borderRadius:"2rem",boxShadow:"5px 5px 5px #0003",color:"$secondary",alignItems:"center","> span":{display:"flex",margin:"0 0.5rem",fontSize:"0.7222rem"}}),eg=(0,y.zo)("div",{display:"flex",position:"relative",zIndex:"1",width:"100%",padding:"0",transition:"$all",variants:{isToggle:{true:{paddingTop:"2.618rem",["& ".concat(eu)]:{width:"calc(100% - 2rem)","@sm":{width:"calc(100% - 2rem)"}}}}}});var ex=(e,t)=>{(0,r.useEffect)(()=>{function n(n){n.key===e&&t()}return window.addEventListener("keyup",n),()=>window.removeEventListener("keyup",n)},[])};let ef=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Arrow Back"}),(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})]}),ev=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Arrow Forward"}),(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"})]}),eb=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Close"}),(0,o.jsx)("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})]}),ej=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:[(0,o.jsx)("title",{children:"Search"}),(0,o.jsx)("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"})]});var ey=e=>{let{handleCanvasToggle:t,handleFilter:n,activeIndex:i,canvasLength:a}=e,[l,s]=(0,r.useState)(!1),[d,c]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{0===i?h(!0):h(!1),i===a-1?c(!0):c(!1)},[i,a]),ex("Escape",()=>{s(!1),n("")}),(0,o.jsx)(eg,{isToggle:l,children:(0,o.jsxs)(eu,{children:[l&&(0,o.jsx)(eh,{autoFocus:!0,onChange:e=>n(e.target.value),placeholder:"Search"}),!l&&(0,o.jsxs)(em,{children:[(0,o.jsx)(ep,{onClick:()=>t(-1),disabled:u,type:"button",children:(0,o.jsx)(ef,{})}),(0,o.jsxs)("span",{children:[i+1," of ",a]}),(0,o.jsx)(ep,{onClick:()=>t(1),disabled:d,type:"button",children:(0,o.jsx)(ev,{})})]}),(0,o.jsx)(ep,{onClick:()=>{s(e=>!e),n("")},type:"button",children:l?(0,o.jsx)(eb,{}):(0,o.jsx)(ej,{})})]})})};let ew=(0,y.zo)(K.fC,{display:"flex",flexDirection:"row",flexGrow:"1",padding:"1.618rem",overflowX:"scroll",position:"relative",zIndex:"0"}),eC=(0,y.zo)("svg",{display:"inline-flex",variants:{isLarge:{true:{height:"4rem",width:"4rem"}},isMedium:{true:{height:"2rem",width:"2rem"}},isSmall:{true:{height:"1rem",width:"1rem"}}}}),ek=e=>(0,o.jsx)(eC,{...e,"data-testid":"icon-svg",role:"img",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:e.children});ek.Title=e=>{let{children:t}=e;return(0,o.jsx)("title",{children:t})},ek.Add=()=>(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 112v288M400 256H112"}),ek.Audio=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24zm-106.18-80zm-.27-159.86zM320 336a16 16 0 01-14.29-23.19c9.49-18.87 14.3-38 14.3-56.81 0-19.38-4.66-37.94-14.25-56.73a16 16 0 0128.5-14.54C346.19 208.12 352 231.44 352 256c0 23.86-6 47.81-17.7 71.19A16 16 0 01320 336z"}),(0,o.jsx)("path",{d:"M368 384a16 16 0 01-13.86-24C373.05 327.09 384 299.51 384 256c0-44.17-10.93-71.56-29.82-103.94a16 16 0 0127.64-16.12C402.92 172.11 416 204.81 416 256c0 50.43-13.06 83.29-34.13 120a16 16 0 01-13.87 8z"}),(0,o.jsx)("path",{d:"M416 432a16 16 0 01-13.39-24.74C429.85 365.47 448 323.76 448 256c0-66.5-18.18-108.62-45.49-151.39a16 16 0 1127-17.22C459.81 134.89 480 181.74 480 256c0 64.75-14.66 113.63-50.6 168.74A16 16 0 01416 432z"})]}),ek.Close=()=>(0,o.jsx)("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"}),ek.Image=()=>(0,o.jsx)("path",{d:"M416 64H96a64.07 64.07 0 00-64 64v256a64.07 64.07 0 0064 64h320a64.07 64.07 0 0064-64V128a64.07 64.07 0 00-64-64zm-80 64a48 48 0 11-48 48 48.05 48.05 0 0148-48zM96 416a32 32 0 01-32-32v-67.63l94.84-84.3a48.06 48.06 0 0165.8 1.9l64.95 64.81L172.37 416zm352-32a32 32 0 01-32 32H217.63l121.42-121.42a47.72 47.72 0 0161.64-.16L448 333.84z"}),ek.Video=()=>(0,o.jsx)("path",{d:"M464 384.39a32 32 0 01-13-2.77 15.77 15.77 0 01-2.71-1.54l-82.71-58.22A32 32 0 01352 295.7v-79.4a32 32 0 0113.58-26.16l82.71-58.22a15.77 15.77 0 012.71-1.54 32 32 0 0145 29.24v192.76a32 32 0 01-32 32zM268 400H84a68.07 68.07 0 01-68-68V180a68.07 68.07 0 0168-68h184.48A67.6 67.6 0 01336 179.52V332a68.07 68.07 0 01-68 68z"});var ez=n(2731);let eS=(0,y.F4)({"0%":{opacity:0,transform:"translateY(1rem)"},"100%":{opacity:1,transform:"translateY(0)"}}),eI=(0,y.F4)({"0%":{opacity:0,transform:"translateY(1rem)"},"100%":{opacity:1,transform:"translateY(0)"}}),eM=(0,y.zo)(ez.Eh,{fill:"$secondaryAlt"}),eL=(0,y.zo)(ez.x8,{position:"absolute",right:"0",top:"0",padding:"0.5rem",margin:"0",cursor:"pointer",border:"none",background:"none",fill:"inherit","&:hover":{opacity:"0.75"}}),e$=(0,y.zo)(ez.VY,{border:"none",backgroundColor:"white",fill:"inhrerit",padding:"1rem 2rem 1rem 1rem",width:"auto",minWidth:"200px",maxWidth:"350px",borderRadius:"3px",boxShadow:"5px 5px 13px #0002",animationDuration:"0.3s",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",'&[data-side="top"]':{animationName:eI},'&[data-side="bottom"]':{animationName:eS},'&[data-align="end"]':{["& ".concat(eM)]:{margin:"0 0.7rem"}}}),eA=(0,y.zo)(ez.xz,{display:"inline-flex",padding:"0.5rem 0",margin:"0 0.5rem 0 0",cursor:"pointer",border:"none",background:"none","> button, > span":{margin:"0"}}),eR=(0,y.zo)(ez.fC,{boxSizing:"content-box"}),eT=e=>{let{children:t}=e;return(0,o.jsx)(eR,{children:t})};eT.Trigger=e=>(0,o.jsx)(eA,{...e,children:e.children}),eT.Content=e=>(0,o.jsxs)(e$,{...e,children:[(0,o.jsx)(eM,{}),(0,o.jsx)(eL,{children:(0,o.jsx)(ek,{isSmall:!0,children:(0,o.jsx)(ek.Close,{})})}),e.children]});let eE=(0,y.zo)("div",{boxSizing:"border-box",display:"inline-flex",alignItems:"center",borderRadius:"5px",padding:"$1",marginBottom:"$2",marginRight:"$2",backgroundColor:"$lightGrey",color:"$richBlack50",textTransform:"uppercase",fontSize:"$2",objectFit:"contain",lineHeight:"1em !important","&:last-child":{marginRight:"0"},["".concat(eC)]:{position:"absolute",left:"$1",height:"$3",width:"$3"},variants:{isIcon:{true:{position:"relative",paddingLeft:"$5"}}}}),eF=(0,y.zo)("span",{display:"flex"}),eH=(0,y.zo)("span",{display:"flex",width:"1.2111rem",height:"0.7222rem"}),eB=(0,y.zo)("span",{display:"inline-flex",marginLeft:"5px",marginBottom:"-1px"}),eV=(0,y.zo)(K.ck,{display:"flex",flexShrink:"0",margin:"0 1.618rem 0 0",padding:"0",cursor:"pointer",background:"none",border:"none",fontFamily:"inherit",lineHeight:"1.25em",fontSize:"1rem",textAlign:"left","&:last-child":{marginRight:"1rem"},figure:{margin:"0",width:"161.8px","> div":{position:"relative",display:"flex",backgroundColor:"$secondaryAlt",width:"inherit",height:"100px",overflow:"hidden",borderRadius:"3px",transition:"$all",img:{width:"100%",height:"100%",objectFit:"cover",filter:"blur(0)",transform:"scale3d(1, 1, 1)",transition:"$all",color:"transparent"},["& ".concat(eF)]:{position:"absolute",right:"0",bottom:"0",["& ".concat(eE)]:{margin:"0",paddingLeft:"0",fontSize:"0.7222rem",backgroundColor:"#000d",color:"$secondary",fill:"$secondary",borderBottomLeftRadius:"0",borderTopRightRadius:"0"}}},figcaption:{marginTop:"0.5rem",fontWeight:"400",fontSize:"0.8333rem",display:"-webkit-box",overflow:"hidden",MozBoxOrient:"vertical",WebkitBoxOrient:"vertical",WebkitLineClamp:"5","@sm":{fontSize:"0.8333rem"}}},"&[aria-checked='true']":{figure:{"> div":{backgroundColor:"$primaryAlt","&::before":{position:"absolute",zIndex:"1",color:"$secondaryMuted",content:"Active Item",textTransform:"uppercase",fontWeight:"700",fontSize:"0.6111rem",letterSpacing:"0.03rem",display:"flex",width:"100%",height:"100%",flexDirection:"column",justifyContent:"center",textAlign:"center",textShadow:"5px 5px 5px #0003"},img:{opacity:"0.3",transform:"scale3d(1.1, 1.1, 1.1)",filter:"blur(2px)"},["& ".concat(eF)]:{["& ".concat(eE)]:{backgroundColor:"$accent"}}}},figcaption:{fontWeight:"700"}}}),eO=e=>{let{type:t}=e;switch(t){case"Sound":return(0,o.jsx)(ek.Audio,{});case"Image":default:return(0,o.jsx)(ek.Image,{});case"Video":return(0,o.jsx)(ek.Video,{})}};var eW=e=>{let{canvas:t,canvasIndex:n,isActive:i,thumbnail:r,type:a,handleChange:s}=e;return(0,o.jsx)(eV,{"aria-checked":i,"data-testid":"media-thumbnail","data-canvas":n,onClick:()=>s(t.id),value:t.id,children:(0,o.jsxs)("figure",{children:[(0,o.jsxs)("div",{children:[(null==r?void 0:r.id)&&(0,o.jsx)("img",{src:r.id,alt:(null==t?void 0:t.label)?ea(t.label):""}),(0,o.jsx)(eF,{children:(0,o.jsxs)(eE,{isIcon:!0,"data-testid":"thumbnail-tag",children:[(0,o.jsx)(eH,{}),(0,o.jsx)(ek,{"aria-label":a,children:(0,o.jsx)(eO,{type:a})}),["Video","Sound"].includes(a)&&(0,o.jsx)(eB,{children:(0,l.rJ)(t.duration)})]})})]}),(null==t?void 0:t.label)&&(0,o.jsx)("figcaption",{"data-testid":"fig-caption",children:(0,o.jsx)(P.__,{label:t.label})})]})})};let eP=e=>e.body?e.body.type:"Image";var eD=e=>{let{items:t}=e,n=g(),i=m(),{activeCanvas:a,vault:l}=i,[s,d]=(0,r.useState)(""),[c,u]=(0,r.useState)([]),[h,p]=(0,r.useState)(0),x=r.useRef(null),v=e=>{a!==e&&n({type:"updateActiveCanvas",canvasId:e})};return(0,r.useEffect)(()=>{if(!c.length){let e=["Image","Sound","Video"],n=t.map(t=>f(l,t,"painting",e)).filter(e=>e.annotations.length>0);u(n)}},[t,c.length,l]),(0,r.useEffect)(()=>{c.forEach((e,t)=>{(null==e?void 0:e.canvas)&&e.canvas.id===a&&p(t)})},[a,c]),(0,r.useEffect)(()=>{let e=document.querySelector('[data-canvas="'.concat(h,'"]'));if(e instanceof HTMLElement&&x.current){let t=e.offsetLeft-x.current.offsetWidth/2+e.offsetWidth/2;x.current.scrollTo({left:t,behavior:"smooth"})}},[h]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ey,{handleFilter:e=>d(e),handleCanvasToggle:e=>{let t=c[h+e];(null==t?void 0:t.canvas)&&v(t.canvas.id)},activeIndex:h,canvasLength:c.length}),(0,o.jsx)(ew,{"aria-label":"select item","data-testid":"media",ref:x,children:c.filter(e=>{var t;if(null===(t=e.canvas)||void 0===t?void 0:t.label){let t=ea(e.canvas.label);if(Array.isArray(t))return t[0].toLowerCase().includes(s.toLowerCase())}}).map((e,t)=>{var n,i;return(0,o.jsx)(eW,{canvas:e.canvas,canvasIndex:t,handleChange:v,isActive:a===(null==e?void 0:null===(n=e.canvas)||void 0===n?void 0:n.id),thumbnail:ec(l,e,200,200),type:eP(e.annotations[0])},null==e?void 0:null===(i=e.canvas)||void 0===i?void 0:i.id)})})]})};let e_=(0,y.zo)("button",{background:"none",border:"none",cursor:"zoom-in",width:"100%",height:"100%",margin:"0",padding:"0",transition:"$all","& img":{width:"100%",height:"100%",objectFit:"contain",color:"transparent",transition:"$all"},variants:{isMedia:{true:{cursor:"pointer"}}}}),eN=(0,y.zo)("button",{display:"flex",height:"2rem",width:"2rem",borderRadius:"2rem",padding:"0",margin:"0",fontFamily:"inherit",background:"none",border:"none",color:"white",cursor:"pointer",marginLeft:"0.618rem",backgroundColor:"$primary",filter:"drop-shadow(2px 2px 5px #0003)",transition:"$all",boxSizing:"content-box !important","&:first-child":{marginLeft:"0"},"@xs":{marginBottom:"0.618rem",marginLeft:"0","&:last-child":{marginBottom:"0"}},svg:{height:"60%",width:"60%",padding:"20%",fill:"$secondary",stroke:"$secondary",filter:"drop-shadow(2px 2px 5px #0003)",transition:"$all",boxSizing:"inherit"},"&:hover, &:focus":{backgroundColor:"$accent"},"&#rotateRight":{"&:hover, &:focus":{svg:{rotate:"45deg"}}},"&#rotateLeft":{transform:"scaleX(-1)","&:hover, &:focus":{svg:{rotate:"45deg"}}},"&#reset":{"&:hover, &:focus":{svg:{rotate:"-15deg"}}}}),eG=(0,y.zo)(eN,{position:"absolute",width:"2rem",top:"1rem",right:"1rem",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",transition:"$all",borderRadius:"50%",backgroundColor:"$accent",cursor:"pointer","&:hover, &:focus":{backgroundColor:"$accent !important"},variants:{isInteractive:{true:{"&:hover":{opacity:"1"}},false:{}},isMedia:{true:{cursor:"pointer !important"}}},compoundVariants:[{isInteractive:!1,isMedia:!0,css:{top:"50%",right:"50%",width:"4rem",height:"4rem",transform:"translate(50%,-50%)"}}]}),eZ=(0,y.zo)("div",{position:"relative",zIndex:"0",display:"flex",flexDirection:"column",gap:"1rem","&:hover":{["".concat(eG)]:{backgroundColor:"$accent"},["".concat(e_)]:{backgroundColor:"#6662",img:{filter:"brightness(0.85)"}}}}),eq=(0,y.zo)("div",{});var eY=n(1643);let eJ=(0,y.zo)("svg",{height:"19px",color:"$accent",fill:"$accent",stroke:"$accent",display:"flex",margin:"0.25rem 0.85rem"}),eU=(0,y.zo)(eY.xz,{fontSize:"1.25rem",fontWeight:"400",fontFamily:"inherit",alignSelf:"flex-start",flexGrow:"1",cursor:"pointer",transition:"$all",border:"1px solid #6663",boxShadow:"2px 2px 5px #0001",borderRadius:"3px",display:"flex",alignItems:"center",paddingLeft:"0.5rem",width:"100%","@sm":{fontSize:"1rem"}}),eX=(0,y.zo)(eY.VY,{borderRadius:"3px",boxShadow:"3px 3px 8px #0003",backgroundColor:"$secondary",marginTop:"2.25rem",marginLeft:"6px",paddingBottom:"0.25rem",maxHeight:"calc(61.8vh - 2.5rem) !important",borderTopLeftRadius:"0",border:"1px solid $secondaryMuted",maxWidth:"90vw"}),eQ=(0,y.zo)(eY.ck,{display:"flex",alignItems:"center",fontFamily:"inherit",padding:"0.25rem 0.5rem",color:"$primary",fontWeight:"400",fontSize:"0.8333rem",cursor:"pointer",backgroundColor:"$secondary",width:"calc(100% - 1rem)","> span":{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},'&[data-state="checked"]':{fontWeight:"700",color:"$primary !important"},"&:hover":{color:"$accent"},img:{width:"31px",height:"31px",marginRight:"0.5rem",borderRadius:"3px"}}),eK=(0,y.zo)(eY.__,{color:"$primaryMuted",fontFamily:"inherit",fontSize:"0.85rem",padding:"0.5rem 1rem 0.5rem 0.5rem",display:"flex",alignItems:"center",marginBottom:"0.25rem",borderRadius:"3px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",backgroundColor:"$secondaryMuted"}),e0=(0,y.zo)(eY.fC,{position:"relative",zIndex:"5",width:"100%"});var e1=e=>{let{direction:t,title:n}=e;return(0,o.jsxs)(eJ,{xmlns:"http://www.w3.org/2000/svg",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{children:n}),"up"===t&&(0,o.jsx)(()=>(0,o.jsx)("path",{d:"M414 321.94L274.22 158.82a24 24 0 00-36.44 0L98 321.94c-13.34 15.57-2.28 39.62 18.22 39.62h279.6c20.5 0 31.56-24.05 18.18-39.62z"}),{}),"down"===t&&(0,o.jsx)(()=>(0,o.jsx)("path",{d:"M98 190.06l139.78 163.12a24 24 0 0036.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z"}),{})]})},e2=e=>{let{children:t,label:n,maxHeight:i,onValueChange:r,value:a}=e;return(0,o.jsxs)(e0,{onValueChange:r,value:a,children:[(0,o.jsxs)(eU,{"data-testid":"select-button",children:[(0,o.jsx)(eY.ki,{"data-testid":"select-button-value"}),(0,o.jsx)(eY.GV,{children:(0,o.jsx)(e1,{direction:"down",title:"select"})})]}),(0,o.jsx)(eY.ue,{children:(0,o.jsxs)(eX,{css:{maxHeight:"".concat(i," !important")},"data-testid":"select-content",children:[(0,o.jsx)(eY.Pn,{children:(0,o.jsx)(e1,{direction:"up",title:"scroll up for more"})}),(0,o.jsx)(eY.Q_,{children:(0,o.jsxs)(eY.DI,{children:[n&&(0,o.jsx)(eK,{children:(0,o.jsx)(P.__,{"data-testid":"select-label",label:n})}),t]})}),(0,o.jsx)(eY.Jk,{children:(0,o.jsx)(e1,{direction:"down",title:"scroll down for more"})})]})})]})},e4=e=>(0,o.jsxs)(eQ,{...e,children:[e.thumbnail&&(0,o.jsx)(P.pl,{thumbnail:e.thumbnail}),(0,o.jsx)(eY.S_,{children:(0,o.jsx)(P.__,{label:e.label})}),(0,o.jsx)(eY.o6,{})]});let e3=(0,y.zo)("div",{position:"absolute !important",zIndex:"1",top:"1rem",left:"1rem",width:"161.8px",height:"100px",backgroundColor:"#000D",boxShadow:"5px 5px 5px #0002",borderRadius:"3px",".displayregion":{border:" 3px solid $accent !important",boxShadow:"0 0 3px #0006"},"@sm":{width:"123px",height:"76px"},"@xs":{width:"100px",height:"61.8px"}}),e5=(0,y.zo)("div",{position:"relative",width:"100%",height:"100%",zIndex:"0"}),e6=(0,y.zo)("div",{width:"100%",height:"61.8vh",maxHeight:"100vh",background:"black",backgroundSize:"contain",color:"white",position:"relative",zIndex:"1",overflow:"hidden"});var e8=n(2929),e7=n.n(e8),e9=e=>{let{id:t,label:n,children:i}=e;return(0,o.jsx)(eN,{id:t,"data-testid":"openseadragon-button",children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"".concat(t,"-svg-title"),"data-testid":"openseadragon-button-svg",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{id:"".concat(t,"-svg-title"),children:n}),i]})})};let te=(0,y.zo)("div",{position:"absolute",zIndex:"1",top:"1rem",display:"flex","@xs":{flexDirection:"column",zIndex:"2"},variants:{hasPlaceholder:{true:{right:"3.618rem","@xs":{top:"3.618rem",right:"1rem"}},false:{right:"1rem","@xs":{top:"1rem",right:"1rem"}}}}}),tt=()=>(0,o.jsx)("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),tn=()=>(0,o.jsx)("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),ti=()=>(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),to=()=>(0,o.jsx)("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),tr=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),(0,o.jsx)("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})]});var ta=e=>{let{hasPlaceholder:t,options:n}=e;return(0,o.jsxs)(te,{"data-testid":"openseadragon-controls",hasPlaceholder:t,id:"openseadragon-controls",children:[n.showZoomControl&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e9,{id:"zoomIn",label:"zoom in",children:(0,o.jsx)(tt,{})}),(0,o.jsx)(e9,{id:"zoomOut",label:"zoom out",children:(0,o.jsx)(tn,{})})]}),n.showFullPageControl&&(0,o.jsx)(e9,{id:"fullPage",label:"full page",children:(0,o.jsx)(ti,{})}),n.showRotationControl&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e9,{id:"rotateRight",label:"rotate right",children:(0,o.jsx)(tr,{})}),(0,o.jsx)(e9,{id:"rotateLeft",label:"rotate left",children:(0,o.jsx)(tr,{})})]}),n.showHomeControl&&(0,o.jsx)(e9,{id:"reset",label:"reset",children:(0,o.jsx)(to,{})})]})};let tl=e=>fetch("".concat(e.replace(/\/$/,""),"/info.json")).then(e=>e.json()).then(e=>e).catch(t=>{console.error("The IIIF tilesource ".concat(e.replace(/\/$/,""),"/info.json failed to load: ").concat(t))}),ts=e=>{let t,n;return Array.isArray(e)&&(t=e[0])&&(n="@id"in t?t["@id"]:t.id),n};var td=e=>{let{uri:t,hasPlaceholder:n,imageType:i}=e,[a,l]=(0,r.useState)(),[s,d]=(0,r.useState)(),c=m(),{configOptions:u}=c,h={id:"openseadragon-viewport-".concat(s),loadTilesWithAjax:!0,fullPageButton:"fullPage",homeButton:"reset",rotateLeftButton:"rotateLeft",rotateRightButton:"rotateRight",zoomInButton:"zoomIn",zoomOutButton:"zoomOut",showNavigator:!0,showFullPageControl:!0,showHomeControl:!0,showRotationControl:!0,showZoomControl:!0,navigatorBorderColor:"transparent",navigatorId:"openseadragon-navigator-".concat(s),gestureSettingsMouse:{clickToZoom:!0,dblClickToZoom:!0,pinchToZoom:!0,scrollToZoom:!0},...u.openSeadragon,ajaxWithCredentials:u.withCredentials};return((0,r.useEffect)(()=>{t!==a&&(l(t),d((0,X.Z)()))},[a,t]),(0,r.useEffect)(()=>{if(a)switch(i){case"simpleImage":e7()(h).addSimpleImage({url:a});break;case"tiledImage":tl(a).then(e=>e7()(h).addTiledImage({tileSource:e}));break;default:console.warn("Unable to render ".concat(a,' in OpenSeadragon as type: "').concat(i,'"'))}},[a]),s)?(0,o.jsxs)(e6,{css:{backgroundColor:u.canvasBackgroundColor,height:u.canvasHeight},children:[(0,o.jsx)(ta,{hasPlaceholder:n,options:h}),(0,o.jsx)(e3,{id:"openseadragon-navigator-".concat(s)}),(0,o.jsx)(e5,{id:"openseadragon-viewport-".concat(s)})]}):null},tc=e=>{let{painting:t,hasPlaceholder:n}=e,[i,a]=(0,r.useState)(),[l,s]=(0,r.useState)();return(0,r.useEffect)(()=>{Array.isArray(null==t?void 0:t.service)&&(null==t?void 0:t.service.length)>0?(a("tiledImage"),s(ts(null==t?void 0:t.service))):(a("simpleImage"),s(null==t?void 0:t.id))},[t]),(0,o.jsx)(td,{uri:l,hasPlaceholder:n,imageType:i},l)},tu=e=>{let{isMedia:t,label:n,placeholderCanvas:i,setIsInteractive:r}=e,{vault:a}=m(),l=v(a,i),s=l?l[0]:void 0,d=n?ea(n):["placeholder image"];return(0,o.jsx)(e_,{onClick:()=>r(!0),isMedia:t,children:(0,o.jsx)("img",{src:(null==s?void 0:s.id)||"",alt:d.join(),height:null==s?void 0:s.height,width:null==s?void 0:s.width})})},th=n(3398);let tp=(0,y.zo)("canvas",{position:"absolute",width:"100%",height:"100%",zIndex:"0"}),tm=r.forwardRef((e,t)=>{let n=r.useRef(null),i=(0,r.useCallback)(()=>{var e,i;if((null===(e=t.current)||void 0===e?void 0:e.currentTime)&&(null===(i=t.current)||void 0===i?void 0:i.currentTime)>0)return;let o=t.current;if(!o)return;let r=new AudioContext,a=r.createMediaElementSource(o),l=r.createAnalyser(),s=n.current;if(!s)return;s.width=o.offsetWidth,s.height=o.offsetHeight;let d=s.getContext("2d");a.connect(l),l.connect(r.destination),l.fftSize=256;let c=l.frequencyBinCount,u=new Uint8Array(c);setInterval(function(){!function(e,t,n,i,o,r){let a;let l=o/n*2.6,s=0;e.getByteFrequencyData(i),t.fillStyle="#000000",t.fillRect(0,0,o,r);for(let e=0;e{t&&t.current&&(t.current.onplay=i)},[i,t]),(0,o.jsx)(tp,{ref:n,role:"presentation"})}),tg=(0,y.zo)("div",{position:"relative",backgroundColor:"$primaryAlt",display:"flex",flexGrow:"0",flexShrink:"1",maxHeight:"500px",zIndex:"1",video:{backgroundColor:"transparent",objectFit:"contain",width:"100%",height:"100%",position:"relative",zIndex:"1"}});var tx=e=>{let{resource:t,ignoreCaptionLabels:n}=e,i=ea(t.label,"en"),r=Array.isArray(i)&&i.some(e=>n.includes(e));return r?null:(0,o.jsx)("track",{src:t.id,label:Array.isArray(i)?i[0]:i,srcLang:"en","data-testid":"player-track"},t.id)},tf=e=>{let{allSources:t,resources:n,painting:i}=e,[a,l]=r.useState(0),[s,d]=r.useState(),c=r.useRef(null),u=(null==i?void 0:i.type)==="Sound",h=m(),{activeCanvas:p,configOptions:g,vault:x}=h;return(0,r.useEffect)(()=>{if(!i.id||!c.current)return;if(null==c?void 0:c.current){let e=c.current;e.src=i.id,e.load()}if("m3u8"!==i.id.split(".").pop())return;let e=new th.Z({xhrSetup:function(e,t){e.withCredentials=!!g.withCredentials}});return e.attachMedia(c.current),e.on(th.Z.Events.MEDIA_ATTACHED,function(){e.loadSource(i.id)}),e.on(th.Z.Events.ERROR,function(t,n){if(n.fatal)switch(n.type){case th.Z.ErrorTypes.NETWORK_ERROR:console.error("fatal ".concat(t," network error encountered, try to recover")),e.startLoad();break;case th.Z.ErrorTypes.MEDIA_ERROR:console.error("fatal ".concat(t," media error encountered, try to recover")),e.recoverMediaError();break;default:e.destroy()}}),()=>{if(e&&c.current){let t=c.current;e.detachMedia(),e.destroy(),t.currentTime=0}}},[g.withCredentials,i.id]),(0,r.useEffect)(()=>{var e,t,n,i;let o=x.get(p),r=(null===(e=o.accompanyingCanvas)||void 0===e?void 0:e.id)?v(x,null===(t=o.accompanyingCanvas)||void 0===t?void 0:t.id):null,l=(null===(n=o.placeholderCanvas)||void 0===n?void 0:n.id)?v(x,null===(i=o.placeholderCanvas)||void 0===i?void 0:i.id):null;r&&l?0===a?d(l[0].id):d(r[0].id):(r&&d(r[0].id),l&&d(l[0].id))},[p,a,x]),(0,r.useEffect)(()=>{if(null==c?void 0:c.current){let e=c.current;return null==e||e.addEventListener("timeupdate",()=>l(e.currentTime)),()=>document.removeEventListener("timeupdate",()=>{})}},[]),(0,o.jsxs)(tg,{css:{backgroundColor:g.canvasBackgroundColor,maxHeight:g.canvasHeight,position:"relative"},"data-testid":"player-wrapper",children:[(0,o.jsxs)("video",{id:"clover-iiif-video",ref:c,controls:!0,height:i.height,width:i.width,crossOrigin:"anonymous",poster:s,style:{maxHeight:g.canvasHeight,position:"relative",zIndex:"1"},children:[t.map(e=>(0,o.jsx)("source",{src:e.id,type:e.format},e.id)),n.length>0&&n.map(e=>(0,o.jsx)(tx,{resource:e,ignoreCaptionLabels:g.ignoreCaptionLabels||[]},e.id)),"Sorry, your browser doesn't support embedded videos."]},i.id),u&&(0,o.jsx)(tm,{ref:c})]})};let tv=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-svg-title",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{id:"close-svg-title",children:"close"}),(0,o.jsx)("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})]}),tb=e=>{let{isMedia:t}=e;return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"open-svg-title",focusable:"false",viewBox:"0 0 512 512",role:"img",children:[(0,o.jsx)("title",{id:"open-svg-title",children:"open"}),t?(0,o.jsx)("path",{d:"M133 440a35.37 35.37 0 01-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0135.77.45l247.85 148.36a36 36 0 010 61l-247.89 148.4A35.5 35.5 0 01133 440z"}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),(0,o.jsx)("path",{d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"})]})]})};var tj=e=>{let{handleToggle:t,isInteractive:n,isMedia:i}=e;return(0,o.jsx)(eG,{onClick:t,isInteractive:n,isMedia:i,children:n?(0,o.jsx)(tv,{}):(0,o.jsx)(tb,{isMedia:i})})},ty=e=>{var t,n;let{activeCanvas:i,isMedia:a,painting:l,resources:s}=e,[d,c]=r.useState(0),[u,h]=r.useState(!1),{configOptions:p,vault:g}=m(),x=g.get(i),f=null==x?void 0:null===(t=x.placeholderCanvas)||void 0===t?void 0:t.id,v=(null==l?void 0:l.length)>1,b=f&&!u&&!a;return(0,o.jsxs)(eZ,{children:[(0,o.jsxs)(eq,{style:{backgroundColor:p.canvasBackgroundColor,maxHeight:p.canvasHeight},children:[f&&!a&&(0,o.jsx)(tj,{handleToggle:()=>h(!u),isInteractive:u,isMedia:a}),b&&!a&&(0,o.jsx)(tu,{isMedia:a,label:null==x?void 0:x.label,placeholderCanvas:f,setIsInteractive:h}),!b&&(0,o.jsx)("div",{children:a?(0,o.jsx)(tf,{allSources:l,painting:l[d],resources:s}):l&&(0,o.jsx)(tc,{painting:l[d],hasPlaceholder:!!f},i)})]}),v&&(0,o.jsx)(e2,{value:null===(n=l[d])||void 0===n?void 0:n.id,onValueChange:e=>{let t=l.findIndex(t=>t.id===e);c(t)},maxHeight:"200px",children:null==l?void 0:l.map(e=>(0,o.jsx)(e4,{value:null==e?void 0:e.id,label:null==e?void 0:e.label},null==e?void 0:e.id))})]})},tw=e=>{let{activeCanvas:t,painting:n,resources:i,items:r,isAudioVideo:a}=e,{informationOpen:l,configOptions:s}=m(),{informationPanel:d}=s,c=(null==d?void 0:d.renderAbout)||(null==d?void 0:d.renderSupplementing)&&i.length>0;return(0,o.jsxs)(I,{className:"clover-content",children:[(0,o.jsxs)(M,{children:[(0,o.jsx)(ty,{activeCanvas:t,isMedia:a,painting:n,resources:i}),c&&(0,o.jsx)(L,{children:(0,o.jsx)("span",{children:l?"View Items":"More Information"})}),r.length>1&&(0,o.jsx)(S,{className:"clover-canvases",children:(0,o.jsx)(eD,{items:r,activeItem:0})})]}),l&&c&&(0,o.jsx)(A,{children:(0,o.jsx)($,{children:(0,o.jsx)(ed,{activeCanvas:t,resources:i})})})]})};let tC=(0,y.zo)(eT.Trigger,{width:"30px",padding:"5px"}),tk=(0,y.zo)(eT.Content,{display:"flex",flexDirection:"column",fontSize:"0.8333rem",border:"none",boxShadow:"2px 2px 5px #0003",zIndex:"2",button:{display:"flex",textDecoration:"none",marginBottom:"0.5em",color:"$accentAlt",cursor:"pointer",background:"$secondary",border:"none","&:last-child":{marginBottom:"0"}}}),tz=(0,y.zo)("span",{fontSize:"1.33rem",alignSelf:"flex-start",flexGrow:"0",flexShrink:"1",padding:"1rem","@sm":{fontSize:"1rem"},"&.visually-hidden":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}),tS=(0,y.zo)("header",{display:"flex",backgroundColor:"transparent !important",justifyContent:"space-between",alignItems:"flex-start",width:"100%",["> ".concat(e0)]:{flexGrow:"1",flexShrink:"0"},form:{flexGrow:"0",flexShrink:"1"}}),tI=(0,y.zo)("div",{display:"flex",alignItems:"flex-end",justifyContent:"flex-end",padding:"1rem",flexShrink:"0",flexGrow:"1"});var tM=()=>{var e;let t=g(),n=m(),{activeManifest:i,collection:r,configOptions:a,vault:l}=n,s=null==a?void 0:a.canvasHeight;return(0,o.jsx)("div",{style:{margin:"0.75rem"},children:(0,o.jsx)(e2,{label:r.label,maxHeight:s,value:i,onValueChange:e=>{t({type:"updateActiveManifest",manifestId:e})},children:null==r?void 0:null===(e=r.items)||void 0===e?void 0:e.map(e=>(0,o.jsx)(e4,{value:e.id,thumbnail:(null==e?void 0:e.thumbnail)?l.get(null==e?void 0:e.thumbnail):void 0,label:e.label},e.id))})})};let tL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2500,[n,i]=(0,r.useState)(),o=(0,r.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>i("copied"),()=>i("failed"))},[e]);return(0,r.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>i(void 0),t);return()=>clearTimeout(e)},[n]),[n,o]},t$=(0,y.zo)("span",{display:"flex",alignContent:"center",alignItems:"center",padding:"0.125rem 0.25rem 0",marginTop:"-0.125rem",marginLeft:"0.5rem",backgroundColor:"$accent",color:"$secondary",borderRadius:"3px",fontSize:"0.6111rem",textTransform:"uppercase",lineHeight:"1em"}),tA=e=>{let{status:t}=e;return t?(0,o.jsx)(t$,{"data-copy-status":t,children:t}):null};var tR=e=>{let{textPrompt:t,textToCopy:n}=e,[i,r]=tL(n);return(0,o.jsxs)("button",{onClick:r,children:[t," ",(0,o.jsx)(tA,{status:i})]})},tT=()=>{let e="#ed1d33",t="#2873ab";return(0,o.jsxs)("svg",{viewBox:"0 0 493.35999 441.33334",id:"iiif-logo",version:"1.1",children:[(0,o.jsx)("title",{children:"IIIF Manifest Options"}),(0,o.jsx)("g",{transform:"matrix(1.3333333,0,0,-1.3333333,0,441.33333)",children:(0,o.jsxs)("g",{transform:"scale(0.1)",children:[(0,o.jsx)("path",{style:{fill:t},d:"M 65.2422,2178.75 775.242,1915 773.992,15 65.2422,276.25 v 1902.5"}),(0,o.jsx)("path",{style:{fill:t},d:"m 804.145,2640.09 c 81.441,-240.91 -26.473,-436.2 -241.04,-436.2 -214.558,0 -454.511,195.29 -535.9527,436.2 -81.4335,240.89 26.4805,436.18 241.0387,436.18 214.567,0 454.512,-195.29 535.954,-436.18"}),(0,o.jsx)("path",{style:{fill:e},d:"M 1678.58,2178.75 968.578,1915 969.828,15 1678.58,276.25 v 1902.5"}),(0,o.jsx)("path",{style:{fill:e},d:"m 935.082,2640.09 c -81.437,-240.91 26.477,-436.2 241.038,-436.2 214.56,0 454.51,195.29 535.96,436.2 81.43,240.89 -26.48,436.18 -241.04,436.18 -214.57,0 -454.52,-195.29 -535.958,-436.18"}),(0,o.jsx)("path",{style:{fill:t},d:"m 1860.24,2178.75 710,-263.75 -1.25,-1900 -708.75,261.25 v 1902.5"}),(0,o.jsx)("path",{style:{fill:t},d:"m 2603.74,2640.09 c 81.45,-240.91 -26.47,-436.2 -241.03,-436.2 -214.58,0 -454.52,195.29 -535.96,436.2 -81.44,240.89 26.48,436.18 241.03,436.18 214.57,0 454.51,-195.29 535.96,-436.18"}),(0,o.jsx)("path",{style:{fill:e},d:"m 3700.24,3310 v -652.5 c 0,0 -230,90 -257.5,-142.5 -2.5,-247.5 0,-336.25 0,-336.25 l 257.5,83.75 V 1690 l -258.61,-92.5 V 262.5 L 2735.24,0 v 2360 c 0,0 -15,850 965,950"})]})})]})},tE=n(7067);let tF=(0,y.zo)(tE.fC,{all:"unset",height:"2rem",width:"3.236rem",backgroundColor:"#6663",borderRadius:"9999px",position:"relative",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:focus":{boxShadow:"0 0 0 2px $secondaryAlt"},'&[data-state="checked"]':{backgroundColor:"$accent",boxShadow:"inset 2px 2px 5px #0003"}}),tH=(0,y.zo)(tE.bU,{display:"block",height:"calc(2rem - 12px)",width:"calc(2rem - 12px)",backgroundColor:"$secondary",borderRadius:"100%",boxShadow:"2px 2px 5px #0001",transition:"$all",transform:"translateX(6px)",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc(1.236rem + 6px))"}}),tB=(0,y.zo)("label",{fontSize:"0.8333rem",fontWeight:"400",lineHeight:"1em",userSelect:"none",cursor:"pointer",paddingRight:"0.618rem"}),tV=(0,y.zo)("form",{display:"flex",flexShrink:"0",flexGrow:"1",alignItems:"center",marginLeft:"1.618rem"});var tO=()=>{var e;let{configOptions:t}=m(),n=g(),[i,a]=(0,r.useState)(null==t?void 0:null===(e=t.informationPanel)||void 0===e?void 0:e.open);return(0,r.useEffect)(()=>{n({type:"updateInformationOpen",informationOpen:i})},[i]),(0,o.jsxs)(tV,{children:[(0,o.jsx)(tB,{htmlFor:"information-toggle",css:i?{opacity:"1"}:{},children:"More Information"}),(0,o.jsx)(tF,{checked:i,onCheckedChange:()=>a(!i),id:"information-toggle","aria-label":"information panel toggle",name:"toggled?",children:(0,o.jsx)(tH,{})})]})};let tW=e=>{let t=()=>!!window.matchMedia&&window.matchMedia(e).matches,[n,i]=(0,r.useState)(t);return(0,r.useEffect)(()=>{let e=()=>i(t);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),n};var tP=e=>{let{manifestId:t,manifestLabel:n}=e,i=m(),{collection:r,configOptions:a}=i,{showTitle:l,showIIIFBadge:s,informationPanel:d}=a,c=s||(null==d?void 0:d.renderToggle),u=tW(y.BC.sm);return(0,o.jsxs)(tS,{className:"clover-header",children:[(null==r?void 0:r.items)?(0,o.jsx)(tM,{}):(0,o.jsx)(tz,{className:l?"":"visually-hidden",children:l&&(0,o.jsx)(P.__,{label:n})}),c&&(0,o.jsxs)(tI,{children:[s&&(0,o.jsxs)(eT,{children:[(0,o.jsx)(tC,{children:(0,o.jsx)(tT,{})}),(0,o.jsxs)(tk,{children:[(null==r?void 0:r.items)&&(0,o.jsx)("button",{onClick:e=>{e.preventDefault(),window.open(r.id,"_blank")},children:"View Collection"}),(0,o.jsx)("button",{onClick:e=>{e.preventDefault(),window.open(t,"_blank")},children:"View Manifest"})," ",(null==r?void 0:r.items)&&(0,o.jsx)(tR,{textPrompt:"Copy Collection URL",textToCopy:r.id}),(0,o.jsx)(tR,{textPrompt:"Copy Manifest URL",textToCopy:t})]})]}),(null==d?void 0:d.renderToggle)&&!u&&(0,o.jsx)(tO,{})]})]})};let tD=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[t,n]=(0,r.useState)(e);return(0,r.useLayoutEffect)(()=>{if(!t)return;let e=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=e}},[t]),(0,r.useEffect)(()=>{t!==e&&n(e)},[e]),[t,n]};var t_=e=>{var t;let{manifest:n,theme:i}=e,a=m(),l=g(),{activeCanvas:s,informationOpen:d,vault:c,configOptions:u}=a,[h,p]=(0,r.useState)(!1),[f,w]=(0,r.useState)(!1),[C,k]=(0,r.useState)([]),[S,I]=(0,r.useState)([]),[M,L]=tD(!1),$=tW(y.BC.sm),A=(0,r.useCallback)(e=>{l({type:"updateInformationOpen",informationOpen:e})},[l]);return(0,r.useEffect)(()=>{var e;(null==u?void 0:null===(e=u.informationPanel)||void 0===e?void 0:e.open)&&A(!$)},[$,null==u?void 0:null===(t=u.informationPanel)||void 0===t?void 0:t.open,A]),(0,r.useEffect)(()=>{if(!$){L(!1);return}L(d)},[d,$,L]),(0,r.useEffect)(()=>{let e=v(c,s),t=b(c,s,"text/vtt");e&&(w(["Sound","Video"].indexOf(e[0].type)>-1),k(e)),I(t),p(0!==t.length)},[s,c]),(0,o.jsx)(j.SV,{FallbackComponent:z,children:(0,o.jsx)(R,{className:"".concat(i," clover-iiif"),css:{background:null==u?void 0:u.background},"data-body-locked":M,"data-information-panel":h,"data-information-panel-open":d,children:(0,o.jsxs)(x.fC,{open:d,onOpenChange:A,children:[(0,o.jsx)(tP,{manifestLabel:n.label,manifestId:n.id}),(0,o.jsx)(tw,{activeCanvas:s,painting:C,resources:S,items:n.items,isAudioVideo:f})]})})})},tN=n(458);let tG={ignoreCache:!1,headers:{Accept:"application/json, text/javascript, text/plain"},timeout:5e3,withCredentials:!1};function tZ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{ok:!1,status:e.status,statusText:e.statusText,headers:e.getAllResponseHeaders(),data:t||e.statusText,json:()=>JSON.parse(t||e.statusText)}}let tq=e=>{let{canvasIdCallback:t,customTheme:n,iiifContent:i,options:a}=e,l=g(),s=m(),{activeCanvas:d,activeManifest:c,isLoaded:u,vault:h}=s,[p,x]=(0,r.useState)(),[f,v]=(0,r.useState)(),b={};return(n&&(b=(0,tN.jG)("custom",n)),(0,r.useEffect)(()=>{t&&t(d)},[d,t]),(0,r.useEffect)(()=>{c&&h.loadManifest(c).then(e=>{v(e),l({type:"updateActiveCanvas",canvasId:e.items[0]&&e.items[0].id})}).catch(e=>{console.error("Manifest failed to load: ".concat(e))}).finally(()=>{l({type:"updateIsLoaded",isLoaded:!0})})},[c,l,h]),(0,r.useEffect)(()=>{l({type:"updateConfigOptions",configOptions:a}),h.load(i).then(e=>{x(e)}).catch(e=>{console.error("The IIIF resource ".concat(i," failed to load: ").concat(e))})},[l,i,a,h]),(0,r.useEffect)(()=>{let e=[];(null==p?void 0:p.type)==="Collection"?(l({type:"updateCollection",collection:p}),(e=p.items.filter(e=>"Manifest"===e.type).map(e=>e.id)).length>0&&l({type:"updateActiveManifest",manifestId:e[0]})):(null==p?void 0:p.type)==="Manifest"&&l({type:"updateActiveManifest",manifestId:p.id})},[l,p]),u)?f&&f.items?0===f.items.length?(console.log("The IIIF manifest ".concat(i," does not contain canvases.")),(0,o.jsx)(o.Fragment,{})):(0,o.jsx)(t_,{manifest:f,theme:b},f.id):(console.log("The IIIF manifest ".concat(i," failed to load.")),(0,o.jsx)(o.Fragment,{})):(0,o.jsx)(o.Fragment,{children:"Loading"})};var tY=e=>{var t;let{canvasIdCallback:n=()=>{},customTheme:i,iiifContent:r,id:l,manifestId:s,options:c}=e,u=r;return l&&(u=l),s&&(u=s),(0,o.jsx)(p,{initialState:{...d,informationOpen:!!(null==c?void 0:null===(t=c.informationPanel)||void 0===t?void 0:t.open),vault:new a.j({customFetcher:e=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tG,n=t.headers||tG.headers;return new Promise((i,o)=>{let r=new XMLHttpRequest;r.open("get",e),r.withCredentials=t.withCredentials,n&&Object.keys(n).forEach(e=>r.setRequestHeader(e,n[e])),r.onload=()=>{i({ok:r.status>=200&&r.status<300,status:r.status,statusText:r.statusText,headers:r.getAllResponseHeaders(),data:r.responseText,json:()=>JSON.parse(r.responseText)})},r.onerror=()=>{o(tZ(r,"Failed to make request."))},r.ontimeout=()=>{o(tZ(r,"Request took longer than expected."))},r.send()})})(e,{withCredentials:null==c?void 0:c.withCredentials,headers:null==c?void 0:c.requestHeaders}).then(e=>JSON.parse(e.data))})},children:(0,o.jsx)(tq,{iiifContent:u,canvasIdCallback:n,customTheme:i,options:c})})}}}]); \ No newline at end of file diff --git a/_next/static/chunks/webpack-23ed263e357b16b7.js b/_next/static/chunks/webpack-b16c715c557808e5.js similarity index 98% rename from _next/static/chunks/webpack-23ed263e357b16b7.js rename to _next/static/chunks/webpack-b16c715c557808e5.js index 83bfb3ce..b9b939da 100644 --- a/_next/static/chunks/webpack-23ed263e357b16b7.js +++ b/_next/static/chunks/webpack-b16c715c557808e5.js @@ -1 +1 @@ -!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,loaded:!1,exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,l),r=!1}finally{r&&delete s[e]}return n.loaded=!0,n.exports}l.m=a,e=[],l.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(l.O).every(function(e){return l.O[e](n[f])})?n.splice(f--,1):(c=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(l.O).every(function(e){return l.O[e](n[f])})?n.splice(f--,1):(c=!1,o
Documentation
Overview

Overview

+
Documentation
Overview

Overview

UI component library for rapidly creating high-quality and accessible IIIF-fluent web interfaces.

Clover IIIF is a suite of Manifest and Collection components combined with lower-level IIIF Presentation 3.0 API UI components. Clover IIIF has a focus on accessibility, customization and developer experience. You can use Clover IIIF to build your own custom IIIF-fluent web interfaces while still using the full power of the IIIF Presentation 3.0 API.

Vision

@@ -27,4 +27,4 @@

Developer Experience - All components are built with developer experience in mind and are designed to be easily integrated into any web application.

-


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/composing.html b/docs/composing.html index d0a4fc22..7ba0aa6b 100644 --- a/docs/composing.html +++ b/docs/composing.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Composing

Composing

+
Documentation
Composing

Composing

Clover IIIF is designed to allow for rapid creation of web content translated from IIIF resources. The following is quick step-by-step guide to get you up and running with Clover IIIF.

Creating a Work page

In this tutorial, we will install Clover IIIF and compose a "Work" page representing a IIIF Manifest for Northwestern Football vs. Illinois, 1950 (opens in a new tab).

@@ -140,4 +140,4 @@

Summary

In this tutorial, we installed Clover IIIF and composed an unstyled "Work" page representing a IIIF Manifest. The completed code covered in these steps is available in a CodeSandbox (opens in a new tab).


-Experiment with the CodeSandbox

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +Experiment with the CodeSandbox

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/homepage.html b/docs/homepage.html index 14381625..219947fd 100644 --- a/docs/homepage.html +++ b/docs/homepage.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Homepage

Homepage

+
Documentation
Homepage

Homepage

A web page that is about the object represented by the resource that has the homepage property.

homepage
<Homepage
@@ -89,4 +89,4 @@ 

]} > <span>View Homepage</span> -</Homepage>


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +</Homepage>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/label.html b/docs/label.html index 2bae6ced..ec5f1006 100644 --- a/docs/label.html +++ b/docs/label.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Label

Label

+
Documentation
Label

Label

The Label component is used to display the label of a resource. It is used in the following contexts: Manifest, Canvas, Range, Annotation, AnnotationPage, Collection, and Manifest. It is a string or an object with language keys and string values.

label
<Label label={{ none: ["Crossing the Pend d'Oreille - Kalispel"] }} />
@@ -46,4 +46,4 @@

fr: ["Notes des réunions de mise en scène et d'environnement"], }} lang="fr" -/>


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +/>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/metadata.html b/docs/metadata.html index 472995f8..bd16cc54 100644 --- a/docs/metadata.html +++ b/docs/metadata.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Metadata

Metadata

+
Documentation
Metadata

Metadata

An ordered list of descriptions to be displayed to the user when they interact with the resource, given as pairs of human readable label and value entries.

metadata
<Metadata
@@ -141,4 +141,4 @@ 

}, ]} customValueDelimiter="<br/>" -/>


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +/>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/partOf.html b/docs/partOf.html index aacb246c..e829adca 100644 --- a/docs/partOf.html +++ b/docs/partOf.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
PartOf

PartOf

+

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +/>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/requiredStatement.html b/docs/requiredStatement.html index 911976b8..6f5a8d0c 100644 --- a/docs/requiredStatement.html +++ b/docs/requiredStatement.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
RequiredStatement

RequiredStatement

+
Documentation
RequiredStatement

RequiredStatement

The RequiredStatement component renders the required statement for a IIIF resource. The required statement is a human readable label and value pair that describes the rights status of the resource.

requiredStatement
<RequiredStatement
@@ -82,4 +82,4 @@ 

}, }} customValueDelimiter=". " -/>


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +/>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/seeAlso.html b/docs/seeAlso.html index 1e4bec25..c222dcf0 100644 --- a/docs/seeAlso.html +++ b/docs/seeAlso.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
SeeAlso

SeeAlso

+
Documentation
SeeAlso

SeeAlso

The SeeAlso component is used to display a list of related resources. A machine-readable resource such as an XML or RDF description that is related to the current resource that has the seeAlso property. The resource may be of any media type, and contain any type of data.

seeAlso
<SeeAlso
@@ -51,4 +51,4 @@ 

}, ]} as="ol" -/>


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +/>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/slider.html b/docs/slider.html index 38777e5a..99625a5c 100644 --- a/docs/slider.html +++ b/docs/slider.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Slider

Slider

+

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +]

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/slider/demo.html b/docs/slider/demo.html index 9169a2f8..984cec94 100644 --- a/docs/slider/demo.html +++ b/docs/slider/demo.html @@ -11,9 +11,9 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -

Slider

+

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/summary.html b/docs/summary.html index 5e05ef7e..b986ca13 100644 --- a/docs/summary.html +++ b/docs/summary.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Summary

Summary

+
Documentation
Summary

Summary

The Summary component is used to display a short description of the resource. It is a wrapper around the IIIF Presentation API 3.0 summary property (opens in a new tab). The summary property is a multi-lingual field that can be used to provide a short description of the resource. It is recommended that the summary be less than 250 characters. The summary property is intended to be displayed to the user when the resource is being selected from a list of search results or resources.

summary
<Summary
@@ -67,4 +67,4 @@ 

as="p" dir="rtl" lang="ar" -/>


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +/>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/thumbnail.html b/docs/thumbnail.html index 2c329967..5a7f7c2d 100644 --- a/docs/thumbnail.html +++ b/docs/thumbnail.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Thumbnail

Thumbnail

+
Documentation
Thumbnail

Thumbnail

The Thumbnail component is used to display a thumbnail for a IIIF resource. This generally is an Image, however, could be a short Video or Sound clip.

thumbnail
<Thumbnail
@@ -50,4 +50,4 @@ 

duration: 30, }, ]} -/>


Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +/>

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/viewer.html b/docs/viewer.html index 6431cbc4..77175f68 100644 --- a/docs/viewer.html +++ b/docs/viewer.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
Documentation
Viewer

Viewer

+

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +);

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/docs/viewer/demo.html b/docs/viewer/demo.html index 1318feda..de0e18d4 100644 --- a/docs/viewer/demo.html +++ b/docs/viewer/demo.html @@ -11,10 +11,10 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -

Viewer

+

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file diff --git a/index.html b/index.html index 8a5a4e9c..21264d9f 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,6 @@ --nextra-primary-hue: 209deg; --nextra-primary-saturation: 100%; } -
+

Showcase IIIF Manifests
as interoperable web content.

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.

Get Started
-

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file +

Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.
\ No newline at end of file