@samvera/bloom-iiif
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -1,2 +0,2 @@ | ||
"use strict";var Oe=Object.create;var E=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Qe=(e,o)=>{for(var t in o)E(e,t,{get:o[t],enumerable:!0})},Z=(e,o,t,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of qe(o))!Ke.call(e,n)&&n!==t&&E(e,n,{get:()=>o[n],enumerable:!(i=Ue(o,n))||i.enumerable});return e};var c=(e,o,t)=>(t=e!=null?Oe(Je(e)):{},Z(o||!e||!e.__esModule?E(t,"default",{value:e,enumerable:!0}):t,e)),Xe=e=>Z(E({},"__esModule",{value:!0}),e);var vo={};Qe(vo,{default:()=>yo});module.exports=Xe(vo);var d=c(require("react"));var v=c(require("react")),_=require("@iiif/vault"),W={isLoaded:!1,vault:new _.Vault},R=v.default.createContext(W),Ye=v.default.createContext(W);function Ze(e,o){switch(o.type){case"updateIsLoaded":return{...e,isLoaded:o.isLoaded};default:throw new Error(`Unhandled action type: ${o.type}`)}}var ee=({initialState:e=W,children:o})=>{let[t,i]=v.default.useReducer(Ze,e);return v.default.createElement(R.Provider,{value:t},v.default.createElement(Ye.Provider,{value:i},o))};function H(){let e=v.default.useContext(R);if(e===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return e}var a=c(require("react"));var te=require("@stitches/react"),h=e=>1.618**e;var oe={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${h(2)})`,6:`calc(1rem * ${h(3)})`,7:`calc(1rem * ${h(4)})`,8:`calc(1rem * ${h(5)})`,9:`calc(1rem * ${h(6)})`,10:`calc(1rem * ${h(7)})`,11:`calc(1rem * ${h(8)})`,12:`calc(1rem * ${h(9)})`},_e={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${h(1)})`,8:`calc(1rem * ${h(2)})`,9:`calc(1rem * ${h(3)})`},sizes:{...oe},space:{...oe},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},Re={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:r,css:Io,keyframes:$o,createTheme:ko}=(0,te.createStitches)({theme:_e,media:Re});var re=r("div",{display:"flex",flexDirection:"column"}),ne=r("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),ie=r("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});var y=require("@samvera/nectar-iiif");var M=c(require("react")),B=()=>M.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},M.default.createElement("title",null,"Next"),M.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));var z=c(require("react")),D=()=>z.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},z.default.createElement("title",null,"Previous"),z.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var P=r("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),G=r("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${P}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${P}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var ae=c(require("react"));var eo=r("span",{display:"flex",background:"none",height:"2rem !important",padding:"0 $3",margin:"0 0 0 $3",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",fontSize:"0.8333rem",lineBreak:"none",whiteSpace:"nowrap",["&:hover"]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}),oo=()=>ae.default.createElement(eo,null,"View All"),se=oo;var to=({homepage:e,instance:o,label:t,summary:i})=>{let[n,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{e.length>0&&l(!0)},[e]),a.default.createElement(ie,null,a.default.createElement(re,null,n?a.default.createElement(y.Homepage,{homepage:e,className:"bloom-header-homepage"},a.default.createElement(y.Label,{label:t,as:"span",className:"bloom-header-label"})):a.default.createElement(y.Label,{label:t,as:"span",className:"bloom-header-label"}),i&&a.default.createElement(y.Summary,{summary:i,as:"span",className:"bloom-header-summary"})),a.default.createElement(ne,null,a.default.createElement(G,{className:`bloom-previous-${o}`,"aria-label":"previous"},a.default.createElement(P,null,a.default.createElement(D,null))),a.default.createElement(G,{className:`bloom-next-${o}`,"aria-label":"next"},a.default.createElement(P,null,a.default.createElement(B,null))),n&&a.default.createElement(y.Homepage,{homepage:e,className:"bloom-header-homepage"},a.default.createElement(se,null))))},le=to;var w=c(require("react"));var s=c(require("react"));var he=c(require("@radix-ui/react-aspect-ratio"));var L=require("@samvera/nectar-iiif");var ce=r("div",{position:"absolute",width:"100%",backgroundColor:"green"}),de=r("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),me=r("span",{display:"flex",position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),pe=r(L.Label,{fontSize:"$3",fontWeight:"700"}),ue=r(L.Summary,{fontSize:"$2",marginTop:"$1",color:"$primary"});var u=c(require("react")),ge=require("@samvera/nectar-iiif");var m=c(require("react"));var ro=m.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},m.default.createElement("title",null,"Restricted Item"),m.default.createElement("path",{d:"M368 192h-16v-80a96 96 0 10-192 0v80h-16a64.07 64.07 0 00-64 64v176a64.07 64.07 0 0064 64h224a64.07 64.07 0 0064-64V256a64.07 64.07 0 00-64-64zm-48 0H192v-80a64 64 0 11128 0z"})),no=m.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},m.default.createElement("title",null,"Unknown Status"),m.default.createElement("path",{d:"M160 164s1.44-33 33.54-59.46C212.6 88.83 235.49 84.28 256 84c18.73-.23 35.47 2.94 45.48 7.82C318.59 100.2 352 120.6 352 164c0 45.67-29.18 66.37-62.35 89.18S248 298.36 248 324",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"40"}),m.default.createElement("circle",{cx:"248",cy:"399.99",r:"32"})),io=({status:e})=>{let[o,t]=(0,m.useState)(m.default.createElement(m.default.Fragment,null));return(0,m.useEffect)(()=>{switch(e){case 403:t(ro);break;default:t(no);break}},[e]),m.default.createElement(ao,null,o)},ao=r("div",{width:"2rem",height:"2rem",backgroundColor:"#fff",borderRadius:"50%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",margin:"-1rem 0 0 -1rem",boxShadow:"5px 5px 13px #0003",svg:{height:"1rem",width:"1rem",color:"$accent",fill:"$accent"}}),fe=io;var so=({isFocused:e,label:o,status:t,summary:i,thumbnail:n})=>{let l=(0,u.useRef)(null);return u.default.createElement(de,{isFocused:e},u.default.createElement(he.Root,{ratio:1/1},u.default.createElement(ce,{ref:l}),u.default.createElement(me,null,n&&t===200?u.default.createElement(ge.Thumbnail,{altAsLabel:o,thumbnail:n}):u.default.createElement(fe,{status:t}))),u.default.createElement("figcaption",null,u.default.createElement(pe,{label:o}),i&&u.default.createElement(ue,{summary:i})))},be=so;var xe=r("a",{color:"black",textDecoration:"none"}),Ce=r("div",{position:"relative",zIndex:"0",borderRadius:"3px"});var p=c(require("react"));var ye=r("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),ve=r("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),we=r("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),Se=r("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});var Ie=c(require("@radix-ui/react-aspect-ratio"));var lo=({activeCanvas:e,handleActiveCanvas:o,isFocused:t,manifest:i})=>{let[n,l]=(0,p.useState)(!1),[g,S]=(0,p.useState)(!1),b=e+1,f=0;return i&&(f=i.items.length),(0,p.useEffect)(()=>{b<=1?l(!1):l(!0),b>=f?S(!1):S(!0)},[e,i]),p.default.createElement(ye,{isFocused:t},p.default.createElement(Ie.Root,{ratio:1/1},i&&p.default.createElement(ve,null,p.default.createElement(we,{onClick:$=>$.preventDefault()},p.default.createElement("button",{onClick:()=>o(-1),disabled:!n},p.default.createElement(D,null)),p.default.createElement("button",{onClick:()=>o(1),disabled:!g},p.default.createElement(B,null))),p.default.createElement(Se,{onClick:$=>$.preventDefault()},b," of ",f))))},$e=lo;var ke=(e,o)=>{if(e.thumbnail.length!==0)return e.thumbnail;let t=o.get(e.items[0]);return o.get(t.items[0]).body};var Pe=c(require("@radix-ui/react-aspect-ratio")),O=c(require("react"));var co=({backgroundImage:e})=>O.default.createElement(po,null,O.default.createElement(mo,{ratio:1/1,css:{backgroundImage:`url(${e})`}})),mo=r(Pe.Root,{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%",filter:"blur(3em)",opacity:"0.7"}),po=r("div",{position:"absolute",width:"100%",overflow:"hidden",backgroundColor:"#716C6B"}),Fe=co;var uo=({credentials:e,index:o,item:t})=>{let i=H(),{vault:n}=i,[l,g]=(0,s.useState)(0),[S,b]=(0,s.useState)(),[f,$]=(0,s.useState)(t.id),[F,U]=(0,s.useState)(!1),[x,Ve]=(0,s.useState)(),[q,Te]=(0,s.useState)(),[je,J]=(0,s.useState)(200),[We,K]=(0,s.useState)([]);(0,s.useEffect)(()=>{F&&!x&&n.load(t.id).then(C=>Ve(C)).catch(C=>{console.error(`Manifest failed to load: ${C}`)})},[F]),(0,s.useEffect)(()=>{var C,I;if(t&&(t==null?void 0:t.thumbnail)&&((C=t.thumbnail)==null?void 0:C.length)>0){let k=n.get(t.thumbnail);K(k),Te(k[0].id)}(t==null?void 0:t.homepage)&&((I=t.homepage)==null?void 0:I.length)>0&&b(t.homepage[0].id)},[]);let Q=()=>U(!0),X=()=>U(!1),Y=C=>{if(!x)return;let I=l+C;if(Array.isArray(x.items)&&x.items[I]){let k=n.get(x.items[I]),Ge=ke(k,n),A=n.get(Ge);A.length>0&&A[0].id&&(K(A),fetch(A[0].id,{method:"GET",headers:{accept:"image/*"},credentials:e}).then(j=>J(j.status)).catch(j=>J(j.status))),$(k.id),g(I)}};return(0,s.useEffect)(()=>{x&&Y(0)},[x]),s.default.createElement(Ce,null,s.default.createElement(xe,{href:S,tabIndex:0,onFocus:Q,onBlur:X,onMouseEnter:Q,onMouseLeave:X},q&&s.default.createElement(Fe,{backgroundImage:q}),s.default.createElement(be,{index:o,isFocused:F,key:f,label:t.label,summary:t.summary,status:je,thumbnail:We}),s.default.createElement($e,{manifest:x,activeCanvas:l,handleActiveCanvas:Y,isFocused:F})))},Ae=uo;var Ee=r("div",{"& .swiper-slide":{}});var N=require("swiper"),V=require("swiper/react"),fo={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},ho=({breakpoints:e=fo,credentials:o,instance:t,items:i})=>{let n=(0,w.useRef)(null);return w.default.createElement(Ee,{ref:n},w.default.createElement(V.Swiper,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[N.Navigation,N.A11y],navigation:{nextEl:`.bloom-next-${t}`,prevEl:`.bloom-previous-${t}`},slidesPerView:2,slidesPerGroup:2,breakpoints:e},i.map((l,g)=>w.default.createElement(V.SwiperSlide,{key:`${l.id}-${g}`,"data-index":g,"data-type":l==null?void 0:l.type.toLowerCase()},w.default.createElement(Ae,{credentials:o,index:g,item:l})))))},He=ho;var go=e=>{var o=0,t=e.length,i=0;if(t>0)for(;i<t;)o=(o<<5)-o+e.charCodeAt(i++)|0;return o},Me=go;var Ne=require("react-error-boundary");var T=c(require("react"));var Be=r("div",{display:"flex",flexDirection:"column",alignItems:"center"}),ze=r("p",{fontWeight:"bold"}),De=r("span",{});var bo=({error:e})=>{let{message:o}=e;return T.default.createElement(Be,{role:"alert"},T.default.createElement(ze,{"data-testid":"headline"},"Something went wrong"),o&&T.default.createElement(De,null,`Error message: ${o}`," "))},Le=bo;var xo=e=>d.default.createElement(ee,null,d.default.createElement(Co,{...e})),Co=({collectionId:e,options:o={}})=>{let t=H(),{vault:i}=t,[n,l]=(0,d.useState)(),[g,S]=(0,d.useState)("");if((0,d.useEffect)(()=>{!e||i.loadCollection(e).then(f=>l(f)).catch(f=>{console.error(`The IIIF Collection ${e} failed to load: ${f}`),S(f instanceof Error?f.message:"Collection failed to load")}).finally(()=>{})},[e]),(n==null?void 0:n.items.length)===0)return console.log(`The IIIF Collection ${e} does not contain items.`),d.default.createElement(d.default.Fragment,null);let b=Me(e);return n?d.default.createElement("div",null,d.default.createElement(Ne.ErrorBoundary,{FallbackComponent:Le},d.default.createElement(le,{label:n.label,summary:n&&n.summary?n.summary:{none:[""]},homepage:n.homepage,instance:b}),d.default.createElement(He,{items:n.items,instance:b,breakpoints:Boolean(o.breakpoints)?o.breakpoints:void 0,credentials:o.credentials?o.credentials:"omit"}))):d.default.createElement(d.default.Fragment,null)},yo=xo; | ||
"use strict";var Oe=Object.create;var E=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Qe=(e,o)=>{for(var t in o)E(e,t,{get:o[t],enumerable:!0})},Z=(e,o,t,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of qe(o))!Ke.call(e,n)&&n!==t&&E(e,n,{get:()=>o[n],enumerable:!(i=Ue(o,n))||i.enumerable});return e};var c=(e,o,t)=>(t=e!=null?Oe(Je(e)):{},Z(o||!e||!e.__esModule?E(t,"default",{value:e,enumerable:!0}):t,e)),Xe=e=>Z(E({},"__esModule",{value:!0}),e);var vo={};Qe(vo,{default:()=>yo});module.exports=Xe(vo);var d=c(require("react"));var v=c(require("react")),_=require("@iiif/vault"),W={isLoaded:!1,vault:new _.Vault},R=v.default.createContext(W),Ye=v.default.createContext(W);function Ze(e,o){switch(o.type){case"updateIsLoaded":return{...e,isLoaded:o.isLoaded};default:throw new Error(`Unhandled action type: ${o.type}`)}}var ee=({initialState:e=W,children:o})=>{let[t,i]=v.default.useReducer(Ze,e);return v.default.createElement(R.Provider,{value:t},v.default.createElement(Ye.Provider,{value:i},o))};function H(){let e=v.default.useContext(R);if(e===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return e}var a=c(require("react"));var te=require("@stitches/react"),h=e=>1.618**e;var oe={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${h(2)})`,6:`calc(1rem * ${h(3)})`,7:`calc(1rem * ${h(4)})`,8:`calc(1rem * ${h(5)})`,9:`calc(1rem * ${h(6)})`,10:`calc(1rem * ${h(7)})`,11:`calc(1rem * ${h(8)})`,12:`calc(1rem * ${h(9)})`},_e={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${h(1)})`,8:`calc(1rem * ${h(2)})`,9:`calc(1rem * ${h(3)})`},sizes:{...oe},space:{...oe},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},Re={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:r,css:Io,keyframes:$o,createTheme:ko}=(0,te.createStitches)({theme:_e,media:Re});var re=r("div",{display:"flex",flexDirection:"column"}),ne=r("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),ie=r("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});var y=require("@samvera/nectar-iiif");var M=c(require("react")),B=()=>M.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},M.default.createElement("title",null,"Next"),M.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));var z=c(require("react")),D=()=>z.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},z.default.createElement("title",null,"Previous"),z.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var P=r("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),G=r("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${P}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${P}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var ae=c(require("react"));var eo=r("span",{display:"flex",background:"none",height:"2rem !important",padding:"0 $3",margin:"0 0 0 $3",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",fontSize:"0.8333rem",lineBreak:"none",whiteSpace:"nowrap",["&:hover"]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}),oo=()=>ae.default.createElement(eo,null,"View All"),se=oo;var to=({homepage:e,instance:o,label:t,summary:i})=>{let[n,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{e.length>0&&l(!0)},[e]),a.default.createElement(ie,null,a.default.createElement(re,null,n?a.default.createElement(y.Homepage,{homepage:e,className:"bloom-header-homepage"},a.default.createElement(y.Label,{label:t,as:"span",className:"bloom-header-label"})):a.default.createElement(y.Label,{label:t,as:"span",className:"bloom-header-label"}),i&&a.default.createElement(y.Summary,{summary:i,as:"span",className:"bloom-header-summary"})),a.default.createElement(ne,null,a.default.createElement(G,{className:`bloom-previous-${o}`,"aria-label":"previous"},a.default.createElement(P,null,a.default.createElement(D,null))),a.default.createElement(G,{className:`bloom-next-${o}`,"aria-label":"next"},a.default.createElement(P,null,a.default.createElement(B,null))),n&&a.default.createElement(y.Homepage,{homepage:e,className:"bloom-header-view-all"},a.default.createElement(se,null))))},le=to;var w=c(require("react"));var s=c(require("react"));var he=c(require("@radix-ui/react-aspect-ratio"));var L=require("@samvera/nectar-iiif");var ce=r("div",{position:"absolute",width:"100%",backgroundColor:"green"}),de=r("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),me=r("span",{display:"flex",position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),pe=r(L.Label,{fontSize:"$3",fontWeight:"700"}),ue=r(L.Summary,{fontSize:"$2",marginTop:"$1",color:"$primary"});var u=c(require("react")),ge=require("@samvera/nectar-iiif");var m=c(require("react"));var ro=m.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},m.default.createElement("title",null,"Restricted Item"),m.default.createElement("path",{d:"M368 192h-16v-80a96 96 0 10-192 0v80h-16a64.07 64.07 0 00-64 64v176a64.07 64.07 0 0064 64h224a64.07 64.07 0 0064-64V256a64.07 64.07 0 00-64-64zm-48 0H192v-80a64 64 0 11128 0z"})),no=m.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},m.default.createElement("title",null,"Unknown Status"),m.default.createElement("path",{d:"M160 164s1.44-33 33.54-59.46C212.6 88.83 235.49 84.28 256 84c18.73-.23 35.47 2.94 45.48 7.82C318.59 100.2 352 120.6 352 164c0 45.67-29.18 66.37-62.35 89.18S248 298.36 248 324",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"40"}),m.default.createElement("circle",{cx:"248",cy:"399.99",r:"32"})),io=({status:e})=>{let[o,t]=(0,m.useState)(m.default.createElement(m.default.Fragment,null));return(0,m.useEffect)(()=>{switch(e){case 403:t(ro);break;default:t(no);break}},[e]),m.default.createElement(ao,null,o)},ao=r("div",{width:"2rem",height:"2rem",backgroundColor:"#fff",borderRadius:"50%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",margin:"-1rem 0 0 -1rem",boxShadow:"5px 5px 13px #0003",svg:{height:"1rem",width:"1rem",color:"$accent",fill:"$accent"}}),fe=io;var so=({isFocused:e,label:o,status:t,summary:i,thumbnail:n})=>{let l=(0,u.useRef)(null);return u.default.createElement(de,{isFocused:e},u.default.createElement(he.Root,{ratio:1/1},u.default.createElement(ce,{ref:l}),u.default.createElement(me,null,n&&t===200?u.default.createElement(ge.Thumbnail,{altAsLabel:o,thumbnail:n}):u.default.createElement(fe,{status:t}))),u.default.createElement("figcaption",null,u.default.createElement(pe,{label:o}),i&&u.default.createElement(ue,{summary:i})))},be=so;var xe=r("a",{color:"black",textDecoration:"none"}),Ce=r("div",{position:"relative",zIndex:"0",borderRadius:"3px"});var p=c(require("react"));var ye=r("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),ve=r("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),we=r("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),Se=r("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});var Ie=c(require("@radix-ui/react-aspect-ratio"));var lo=({activeCanvas:e,handleActiveCanvas:o,isFocused:t,manifest:i})=>{let[n,l]=(0,p.useState)(!1),[g,S]=(0,p.useState)(!1),b=e+1,f=0;return i&&(f=i.items.length),(0,p.useEffect)(()=>{b<=1?l(!1):l(!0),b>=f?S(!1):S(!0)},[e,i]),p.default.createElement(ye,{isFocused:t},p.default.createElement(Ie.Root,{ratio:1/1},i&&p.default.createElement(ve,null,p.default.createElement(we,{onClick:$=>$.preventDefault()},p.default.createElement("button",{onClick:()=>o(-1),disabled:!n},p.default.createElement(D,null)),p.default.createElement("button",{onClick:()=>o(1),disabled:!g},p.default.createElement(B,null))),p.default.createElement(Se,{onClick:$=>$.preventDefault()},b," of ",f))))},$e=lo;var ke=(e,o)=>{if(e.thumbnail.length!==0)return e.thumbnail;let t=o.get(e.items[0]);return o.get(t.items[0]).body};var Pe=c(require("@radix-ui/react-aspect-ratio")),O=c(require("react"));var co=({backgroundImage:e})=>O.default.createElement(po,null,O.default.createElement(mo,{ratio:1/1,css:{backgroundImage:`url(${e})`}})),mo=r(Pe.Root,{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%",filter:"blur(3em)",opacity:"0.7"}),po=r("div",{position:"absolute",width:"100%",overflow:"hidden",backgroundColor:"#716C6B"}),Fe=co;var uo=({credentials:e,index:o,item:t})=>{let i=H(),{vault:n}=i,[l,g]=(0,s.useState)(0),[S,b]=(0,s.useState)(),[f,$]=(0,s.useState)(t.id),[F,U]=(0,s.useState)(!1),[x,Ve]=(0,s.useState)(),[q,Te]=(0,s.useState)(),[je,J]=(0,s.useState)(200),[We,K]=(0,s.useState)([]);(0,s.useEffect)(()=>{F&&!x&&n.load(t.id).then(C=>Ve(C)).catch(C=>{console.error(`Manifest failed to load: ${C}`)})},[F]),(0,s.useEffect)(()=>{var C,I;if(t&&(t==null?void 0:t.thumbnail)&&((C=t.thumbnail)==null?void 0:C.length)>0){let k=n.get(t.thumbnail);K(k),Te(k[0].id)}(t==null?void 0:t.homepage)&&((I=t.homepage)==null?void 0:I.length)>0&&b(t.homepage[0].id)},[]);let Q=()=>U(!0),X=()=>U(!1),Y=C=>{if(!x)return;let I=l+C;if(Array.isArray(x.items)&&x.items[I]){let k=n.get(x.items[I]),Ge=ke(k,n),A=n.get(Ge);A.length>0&&A[0].id&&(K(A),fetch(A[0].id,{method:"GET",headers:{accept:"image/*"},credentials:e}).then(j=>J(j.status)).catch(j=>J(j.status))),$(k.id),g(I)}};return(0,s.useEffect)(()=>{x&&Y(0)},[x]),s.default.createElement(Ce,null,s.default.createElement(xe,{href:S,tabIndex:0,onFocus:Q,onBlur:X,onMouseEnter:Q,onMouseLeave:X},q&&s.default.createElement(Fe,{backgroundImage:q}),s.default.createElement(be,{index:o,isFocused:F,key:f,label:t.label,summary:t.summary,status:je,thumbnail:We}),s.default.createElement($e,{manifest:x,activeCanvas:l,handleActiveCanvas:Y,isFocused:F})))},Ae=uo;var Ee=r("div",{"& .swiper-slide":{}});var N=require("swiper"),V=require("swiper/react"),fo={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},ho=({breakpoints:e=fo,credentials:o,instance:t,items:i})=>{let n=(0,w.useRef)(null);return w.default.createElement(Ee,{ref:n},w.default.createElement(V.Swiper,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[N.Navigation,N.A11y],navigation:{nextEl:`.bloom-next-${t}`,prevEl:`.bloom-previous-${t}`},slidesPerView:2,slidesPerGroup:2,breakpoints:e},i.map((l,g)=>w.default.createElement(V.SwiperSlide,{key:`${l.id}-${g}`,"data-index":g,"data-type":l==null?void 0:l.type.toLowerCase()},w.default.createElement(Ae,{credentials:o,index:g,item:l})))))},He=ho;var go=e=>{var o=0,t=e.length,i=0;if(t>0)for(;i<t;)o=(o<<5)-o+e.charCodeAt(i++)|0;return o},Me=go;var Ne=require("react-error-boundary");var T=c(require("react"));var Be=r("div",{display:"flex",flexDirection:"column",alignItems:"center"}),ze=r("p",{fontWeight:"bold"}),De=r("span",{});var bo=({error:e})=>{let{message:o}=e;return T.default.createElement(Be,{role:"alert"},T.default.createElement(ze,{"data-testid":"headline"},"Something went wrong"),o&&T.default.createElement(De,null,`Error message: ${o}`," "))},Le=bo;var xo=e=>d.default.createElement(ee,null,d.default.createElement(Co,{...e})),Co=({collectionId:e,options:o={}})=>{let t=H(),{vault:i}=t,[n,l]=(0,d.useState)(),[g,S]=(0,d.useState)("");if((0,d.useEffect)(()=>{!e||i.loadCollection(e).then(f=>l(f)).catch(f=>{console.error(`The IIIF Collection ${e} failed to load: ${f}`),S(f instanceof Error?f.message:"Collection failed to load")}).finally(()=>{})},[e]),(n==null?void 0:n.items.length)===0)return console.log(`The IIIF Collection ${e} does not contain items.`),d.default.createElement(d.default.Fragment,null);let b=Me(e);return n?d.default.createElement("div",null,d.default.createElement(Ne.ErrorBoundary,{FallbackComponent:Le},d.default.createElement(le,{label:n.label,summary:n&&n.summary?n.summary:{none:[""]},homepage:n.homepage,instance:b}),d.default.createElement(He,{items:n.items,instance:b,breakpoints:Boolean(o.breakpoints)?o.breakpoints:void 0,credentials:o.credentials?o.credentials:"omit"}))):d.default.createElement(d.default.Fragment,null)},yo=xo; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import m,{useEffect as So,useState as He}from"react";import v from"react";import{Vault as Ne}from"@iiif/vault";var B={isLoaded:!1,vault:new Ne},J=v.createContext(B),Ve=v.createContext(B);function Te(e,t){switch(t.type){case"updateIsLoaded":return{...e,isLoaded:t.isLoaded};default:throw new Error(`Unhandled action type: ${t.type}`)}}var K=({initialState:e=B,children:t})=>{let[o,i]=v.useReducer(Te,e);return v.createElement(J.Provider,{value:o},v.createElement(Ve.Provider,{value:i},t))};function F(){let e=v.useContext(J);if(e===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return e}import s,{useEffect as Je,useState as Ke}from"react";import{createStitches as je}from"@stitches/react";var c=e=>1.618**e;var Q={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${c(2)})`,6:`calc(1rem * ${c(3)})`,7:`calc(1rem * ${c(4)})`,8:`calc(1rem * ${c(5)})`,9:`calc(1rem * ${c(6)})`,10:`calc(1rem * ${c(7)})`,11:`calc(1rem * ${c(8)})`,12:`calc(1rem * ${c(9)})`},We={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${c(1)})`,8:`calc(1rem * ${c(2)})`,9:`calc(1rem * ${c(3)})`},sizes:{...Q},space:{...Q},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},Ge={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:r,css:Ho,keyframes:Mo,createTheme:Bo}=je({theme:We,media:Ge});var X=r("div",{display:"flex",flexDirection:"column"}),Y=r("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),Z=r("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});import{Homepage as R,Label as ee,Summary as Qe}from"@samvera/nectar-iiif";import z from"react";var A=()=>z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},z.createElement("title",null,"Next"),z.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));import D from"react";var E=()=>D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},D.createElement("title",null,"Previous"),D.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var I=r("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),L=r("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${I}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${I}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});import Oe from"react";var Ue=r("span",{display:"flex",background:"none",height:"2rem !important",padding:"0 $3",margin:"0 0 0 $3",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",fontSize:"0.8333rem",lineBreak:"none",whiteSpace:"nowrap",["&:hover"]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}),qe=()=>Oe.createElement(Ue,null,"View All"),_=qe;var Xe=({homepage:e,instance:t,label:o,summary:i})=>{let[n,a]=Ke(!1);return Je(()=>{e.length>0&&a(!0)},[e]),s.createElement(Z,null,s.createElement(X,null,n?s.createElement(R,{homepage:e,className:"bloom-header-homepage"},s.createElement(ee,{label:o,as:"span",className:"bloom-header-label"})):s.createElement(ee,{label:o,as:"span",className:"bloom-header-label"}),i&&s.createElement(Qe,{summary:i,as:"span",className:"bloom-header-summary"})),s.createElement(Y,null,s.createElement(L,{className:`bloom-previous-${t}`,"aria-label":"previous"},s.createElement(I,null,s.createElement(E,null))),s.createElement(L,{className:`bloom-next-${t}`,"aria-label":"next"},s.createElement(I,null,s.createElement(A,null))),n&&s.createElement(R,{homepage:e,className:"bloom-header-homepage"},s.createElement(_,null))))},oe=Xe;import H,{useRef as fo}from"react";import $,{useEffect as N,useState as x}from"react";import*as le from"@radix-ui/react-aspect-ratio";import{Label as Ye,Summary as Ze}from"@samvera/nectar-iiif";var te=r("div",{position:"absolute",width:"100%",backgroundColor:"green"}),re=r("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),ne=r("span",{display:"flex",position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),ie=r(Ye,{fontSize:"$3",fontWeight:"700"}),ae=r(Ze,{fontSize:"$2",marginTop:"$1",color:"$primary"});import p,{useRef as no}from"react";import{Thumbnail as io}from"@samvera/nectar-iiif";import d,{useEffect as _e,useState as Re}from"react";var eo=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},d.createElement("title",null,"Restricted Item"),d.createElement("path",{d:"M368 192h-16v-80a96 96 0 10-192 0v80h-16a64.07 64.07 0 00-64 64v176a64.07 64.07 0 0064 64h224a64.07 64.07 0 0064-64V256a64.07 64.07 0 00-64-64zm-48 0H192v-80a64 64 0 11128 0z"})),oo=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},d.createElement("title",null,"Unknown Status"),d.createElement("path",{d:"M160 164s1.44-33 33.54-59.46C212.6 88.83 235.49 84.28 256 84c18.73-.23 35.47 2.94 45.48 7.82C318.59 100.2 352 120.6 352 164c0 45.67-29.18 66.37-62.35 89.18S248 298.36 248 324",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"40"}),d.createElement("circle",{cx:"248",cy:"399.99",r:"32"})),to=({status:e})=>{let[t,o]=Re(d.createElement(d.Fragment,null));return _e(()=>{switch(e){case 403:o(eo);break;default:o(oo);break}},[e]),d.createElement(ro,null,t)},ro=r("div",{width:"2rem",height:"2rem",backgroundColor:"#fff",borderRadius:"50%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",margin:"-1rem 0 0 -1rem",boxShadow:"5px 5px 13px #0003",svg:{height:"1rem",width:"1rem",color:"$accent",fill:"$accent"}}),se=to;var ao=({isFocused:e,label:t,status:o,summary:i,thumbnail:n})=>{let a=no(null);return p.createElement(re,{isFocused:e},p.createElement(le.Root,{ratio:1/1},p.createElement(te,{ref:a}),p.createElement(ne,null,n&&o===200?p.createElement(io,{altAsLabel:t,thumbnail:n}):p.createElement(se,{status:o}))),p.createElement("figcaption",null,p.createElement(ie,{label:t}),i&&p.createElement(ae,{summary:i})))},ce=ao;var de=r("a",{color:"black",textDecoration:"none"}),me=r("div",{position:"relative",zIndex:"0",borderRadius:"3px"});import u,{useEffect as so,useState as ge}from"react";var pe=r("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),ue=r("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),fe=r("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),he=r("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});import*as be from"@radix-ui/react-aspect-ratio";var lo=({activeCanvas:e,handleActiveCanvas:t,isFocused:o,manifest:i})=>{let[n,a]=ge(!1),[f,C]=ge(!1),h=e+1,l=0;return i&&(l=i.items.length),so(()=>{h<=1?a(!1):a(!0),h>=l?C(!1):C(!0)},[e,i]),u.createElement(pe,{isFocused:o},u.createElement(be.Root,{ratio:1/1},i&&u.createElement(ue,null,u.createElement(fe,{onClick:w=>w.preventDefault()},u.createElement("button",{onClick:()=>t(-1),disabled:!n},u.createElement(E,null)),u.createElement("button",{onClick:()=>t(1),disabled:!f},u.createElement(A,null))),u.createElement(he,{onClick:w=>w.preventDefault()},h," of ",l))))},xe=lo;var Ce=(e,t)=>{if(e.thumbnail.length!==0)return e.thumbnail;let o=t.get(e.items[0]);return t.get(o.items[0]).body};import*as ve from"@radix-ui/react-aspect-ratio";import ye from"react";var co=({backgroundImage:e})=>ye.createElement(po,null,ye.createElement(mo,{ratio:1/1,css:{backgroundImage:`url(${e})`}})),mo=r(ve.Root,{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%",filter:"blur(3em)",opacity:"0.7"}),po=r("div",{position:"absolute",width:"100%",overflow:"hidden",backgroundColor:"#716C6B"}),we=co;var uo=({credentials:e,index:t,item:o})=>{let i=F(),{vault:n}=i,[a,f]=x(0),[C,h]=x(),[l,w]=x(o.id),[k,T]=x(!1),[g,Me]=x(),[j,Be]=x(),[ze,W]=x(200),[De,G]=x([]);N(()=>{k&&!g&&n.load(o.id).then(b=>Me(b)).catch(b=>{console.error(`Manifest failed to load: ${b}`)})},[k]),N(()=>{var b,y;if(o&&(o==null?void 0:o.thumbnail)&&((b=o.thumbnail)==null?void 0:b.length)>0){let S=n.get(o.thumbnail);G(S),Be(S[0].id)}(o==null?void 0:o.homepage)&&((y=o.homepage)==null?void 0:y.length)>0&&h(o.homepage[0].id)},[]);let O=()=>T(!0),U=()=>T(!1),q=b=>{if(!g)return;let y=a+b;if(Array.isArray(g.items)&&g.items[y]){let S=n.get(g.items[y]),Le=Ce(S,n),P=n.get(Le);P.length>0&&P[0].id&&(G(P),fetch(P[0].id,{method:"GET",headers:{accept:"image/*"},credentials:e}).then(M=>W(M.status)).catch(M=>W(M.status))),w(S.id),f(y)}};return N(()=>{g&&q(0)},[g]),$.createElement(me,null,$.createElement(de,{href:C,tabIndex:0,onFocus:O,onBlur:U,onMouseEnter:O,onMouseLeave:U},j&&$.createElement(we,{backgroundImage:j}),$.createElement(ce,{index:t,isFocused:k,key:l,label:o.label,summary:o.summary,status:ze,thumbnail:De}),$.createElement(xe,{manifest:g,activeCanvas:a,handleActiveCanvas:q,isFocused:k})))},Se=uo;var Ie=r("div",{"& .swiper-slide":{}});import{Navigation as ho,A11y as go}from"swiper";import{Swiper as bo,SwiperSlide as xo}from"swiper/react";var Co={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},yo=({breakpoints:e=Co,credentials:t,instance:o,items:i})=>{let n=fo(null);return H.createElement(Ie,{ref:n},H.createElement(bo,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[ho,go],navigation:{nextEl:`.bloom-next-${o}`,prevEl:`.bloom-previous-${o}`},slidesPerView:2,slidesPerGroup:2,breakpoints:e},i.map((a,f)=>H.createElement(xo,{key:`${a.id}-${f}`,"data-index":f,"data-type":a==null?void 0:a.type.toLowerCase()},H.createElement(Se,{credentials:t,index:f,item:a})))))},$e=yo;var vo=e=>{var t=0,o=e.length,i=0;if(o>0)for(;i<o;)t=(t<<5)-t+e.charCodeAt(i++)|0;return t},ke=vo;import{ErrorBoundary as Io}from"react-error-boundary";import V from"react";var Pe=r("div",{display:"flex",flexDirection:"column",alignItems:"center"}),Fe=r("p",{fontWeight:"bold"}),Ae=r("span",{});var wo=({error:e})=>{let{message:t}=e;return V.createElement(Pe,{role:"alert"},V.createElement(Fe,{"data-testid":"headline"},"Something went wrong"),t&&V.createElement(Ae,null,`Error message: ${t}`," "))},Ee=wo;var $o=e=>m.createElement(K,null,m.createElement(ko,{...e})),ko=({collectionId:e,options:t={}})=>{let o=F(),{vault:i}=o,[n,a]=He(),[f,C]=He("");if(So(()=>{!e||i.loadCollection(e).then(l=>a(l)).catch(l=>{console.error(`The IIIF Collection ${e} failed to load: ${l}`),C(l instanceof Error?l.message:"Collection failed to load")}).finally(()=>{})},[e]),(n==null?void 0:n.items.length)===0)return console.log(`The IIIF Collection ${e} does not contain items.`),m.createElement(m.Fragment,null);let h=ke(e);return n?m.createElement("div",null,m.createElement(Io,{FallbackComponent:Ee},m.createElement(oe,{label:n.label,summary:n&&n.summary?n.summary:{none:[""]},homepage:n.homepage,instance:h}),m.createElement($e,{items:n.items,instance:h,breakpoints:Boolean(t.breakpoints)?t.breakpoints:void 0,credentials:t.credentials?t.credentials:"omit"}))):m.createElement(m.Fragment,null)},or=$o;export{or as default}; | ||
import m,{useEffect as So,useState as He}from"react";import v from"react";import{Vault as Ne}from"@iiif/vault";var B={isLoaded:!1,vault:new Ne},J=v.createContext(B),Ve=v.createContext(B);function Te(e,t){switch(t.type){case"updateIsLoaded":return{...e,isLoaded:t.isLoaded};default:throw new Error(`Unhandled action type: ${t.type}`)}}var K=({initialState:e=B,children:t})=>{let[o,i]=v.useReducer(Te,e);return v.createElement(J.Provider,{value:o},v.createElement(Ve.Provider,{value:i},t))};function F(){let e=v.useContext(J);if(e===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return e}import s,{useEffect as Je,useState as Ke}from"react";import{createStitches as je}from"@stitches/react";var c=e=>1.618**e;var Q={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${c(2)})`,6:`calc(1rem * ${c(3)})`,7:`calc(1rem * ${c(4)})`,8:`calc(1rem * ${c(5)})`,9:`calc(1rem * ${c(6)})`,10:`calc(1rem * ${c(7)})`,11:`calc(1rem * ${c(8)})`,12:`calc(1rem * ${c(9)})`},We={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${c(1)})`,8:`calc(1rem * ${c(2)})`,9:`calc(1rem * ${c(3)})`},sizes:{...Q},space:{...Q},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},Ge={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:r,css:Ho,keyframes:Mo,createTheme:Bo}=je({theme:We,media:Ge});var X=r("div",{display:"flex",flexDirection:"column"}),Y=r("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),Z=r("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});import{Homepage as R,Label as ee,Summary as Qe}from"@samvera/nectar-iiif";import z from"react";var A=()=>z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},z.createElement("title",null,"Next"),z.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));import D from"react";var E=()=>D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},D.createElement("title",null,"Previous"),D.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var I=r("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),L=r("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${I}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${I}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});import Oe from"react";var Ue=r("span",{display:"flex",background:"none",height:"2rem !important",padding:"0 $3",margin:"0 0 0 $3",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",fontSize:"0.8333rem",lineBreak:"none",whiteSpace:"nowrap",["&:hover"]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}),qe=()=>Oe.createElement(Ue,null,"View All"),_=qe;var Xe=({homepage:e,instance:t,label:o,summary:i})=>{let[n,a]=Ke(!1);return Je(()=>{e.length>0&&a(!0)},[e]),s.createElement(Z,null,s.createElement(X,null,n?s.createElement(R,{homepage:e,className:"bloom-header-homepage"},s.createElement(ee,{label:o,as:"span",className:"bloom-header-label"})):s.createElement(ee,{label:o,as:"span",className:"bloom-header-label"}),i&&s.createElement(Qe,{summary:i,as:"span",className:"bloom-header-summary"})),s.createElement(Y,null,s.createElement(L,{className:`bloom-previous-${t}`,"aria-label":"previous"},s.createElement(I,null,s.createElement(E,null))),s.createElement(L,{className:`bloom-next-${t}`,"aria-label":"next"},s.createElement(I,null,s.createElement(A,null))),n&&s.createElement(R,{homepage:e,className:"bloom-header-view-all"},s.createElement(_,null))))},oe=Xe;import H,{useRef as fo}from"react";import $,{useEffect as N,useState as x}from"react";import*as le from"@radix-ui/react-aspect-ratio";import{Label as Ye,Summary as Ze}from"@samvera/nectar-iiif";var te=r("div",{position:"absolute",width:"100%",backgroundColor:"green"}),re=r("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),ne=r("span",{display:"flex",position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),ie=r(Ye,{fontSize:"$3",fontWeight:"700"}),ae=r(Ze,{fontSize:"$2",marginTop:"$1",color:"$primary"});import p,{useRef as no}from"react";import{Thumbnail as io}from"@samvera/nectar-iiif";import d,{useEffect as _e,useState as Re}from"react";var eo=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},d.createElement("title",null,"Restricted Item"),d.createElement("path",{d:"M368 192h-16v-80a96 96 0 10-192 0v80h-16a64.07 64.07 0 00-64 64v176a64.07 64.07 0 0064 64h224a64.07 64.07 0 0064-64V256a64.07 64.07 0 00-64-64zm-48 0H192v-80a64 64 0 11128 0z"})),oo=d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},d.createElement("title",null,"Unknown Status"),d.createElement("path",{d:"M160 164s1.44-33 33.54-59.46C212.6 88.83 235.49 84.28 256 84c18.73-.23 35.47 2.94 45.48 7.82C318.59 100.2 352 120.6 352 164c0 45.67-29.18 66.37-62.35 89.18S248 298.36 248 324",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"40"}),d.createElement("circle",{cx:"248",cy:"399.99",r:"32"})),to=({status:e})=>{let[t,o]=Re(d.createElement(d.Fragment,null));return _e(()=>{switch(e){case 403:o(eo);break;default:o(oo);break}},[e]),d.createElement(ro,null,t)},ro=r("div",{width:"2rem",height:"2rem",backgroundColor:"#fff",borderRadius:"50%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",margin:"-1rem 0 0 -1rem",boxShadow:"5px 5px 13px #0003",svg:{height:"1rem",width:"1rem",color:"$accent",fill:"$accent"}}),se=to;var ao=({isFocused:e,label:t,status:o,summary:i,thumbnail:n})=>{let a=no(null);return p.createElement(re,{isFocused:e},p.createElement(le.Root,{ratio:1/1},p.createElement(te,{ref:a}),p.createElement(ne,null,n&&o===200?p.createElement(io,{altAsLabel:t,thumbnail:n}):p.createElement(se,{status:o}))),p.createElement("figcaption",null,p.createElement(ie,{label:t}),i&&p.createElement(ae,{summary:i})))},ce=ao;var de=r("a",{color:"black",textDecoration:"none"}),me=r("div",{position:"relative",zIndex:"0",borderRadius:"3px"});import u,{useEffect as so,useState as ge}from"react";var pe=r("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),ue=r("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),fe=r("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),he=r("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});import*as be from"@radix-ui/react-aspect-ratio";var lo=({activeCanvas:e,handleActiveCanvas:t,isFocused:o,manifest:i})=>{let[n,a]=ge(!1),[f,C]=ge(!1),h=e+1,l=0;return i&&(l=i.items.length),so(()=>{h<=1?a(!1):a(!0),h>=l?C(!1):C(!0)},[e,i]),u.createElement(pe,{isFocused:o},u.createElement(be.Root,{ratio:1/1},i&&u.createElement(ue,null,u.createElement(fe,{onClick:w=>w.preventDefault()},u.createElement("button",{onClick:()=>t(-1),disabled:!n},u.createElement(E,null)),u.createElement("button",{onClick:()=>t(1),disabled:!f},u.createElement(A,null))),u.createElement(he,{onClick:w=>w.preventDefault()},h," of ",l))))},xe=lo;var Ce=(e,t)=>{if(e.thumbnail.length!==0)return e.thumbnail;let o=t.get(e.items[0]);return t.get(o.items[0]).body};import*as ve from"@radix-ui/react-aspect-ratio";import ye from"react";var co=({backgroundImage:e})=>ye.createElement(po,null,ye.createElement(mo,{ratio:1/1,css:{backgroundImage:`url(${e})`}})),mo=r(ve.Root,{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"50% 50%",filter:"blur(3em)",opacity:"0.7"}),po=r("div",{position:"absolute",width:"100%",overflow:"hidden",backgroundColor:"#716C6B"}),we=co;var uo=({credentials:e,index:t,item:o})=>{let i=F(),{vault:n}=i,[a,f]=x(0),[C,h]=x(),[l,w]=x(o.id),[k,T]=x(!1),[g,Me]=x(),[j,Be]=x(),[ze,W]=x(200),[De,G]=x([]);N(()=>{k&&!g&&n.load(o.id).then(b=>Me(b)).catch(b=>{console.error(`Manifest failed to load: ${b}`)})},[k]),N(()=>{var b,y;if(o&&(o==null?void 0:o.thumbnail)&&((b=o.thumbnail)==null?void 0:b.length)>0){let S=n.get(o.thumbnail);G(S),Be(S[0].id)}(o==null?void 0:o.homepage)&&((y=o.homepage)==null?void 0:y.length)>0&&h(o.homepage[0].id)},[]);let O=()=>T(!0),U=()=>T(!1),q=b=>{if(!g)return;let y=a+b;if(Array.isArray(g.items)&&g.items[y]){let S=n.get(g.items[y]),Le=Ce(S,n),P=n.get(Le);P.length>0&&P[0].id&&(G(P),fetch(P[0].id,{method:"GET",headers:{accept:"image/*"},credentials:e}).then(M=>W(M.status)).catch(M=>W(M.status))),w(S.id),f(y)}};return N(()=>{g&&q(0)},[g]),$.createElement(me,null,$.createElement(de,{href:C,tabIndex:0,onFocus:O,onBlur:U,onMouseEnter:O,onMouseLeave:U},j&&$.createElement(we,{backgroundImage:j}),$.createElement(ce,{index:t,isFocused:k,key:l,label:o.label,summary:o.summary,status:ze,thumbnail:De}),$.createElement(xe,{manifest:g,activeCanvas:a,handleActiveCanvas:q,isFocused:k})))},Se=uo;var Ie=r("div",{"& .swiper-slide":{}});import{Navigation as ho,A11y as go}from"swiper";import{Swiper as bo,SwiperSlide as xo}from"swiper/react";var Co={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},yo=({breakpoints:e=Co,credentials:t,instance:o,items:i})=>{let n=fo(null);return H.createElement(Ie,{ref:n},H.createElement(bo,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[ho,go],navigation:{nextEl:`.bloom-next-${o}`,prevEl:`.bloom-previous-${o}`},slidesPerView:2,slidesPerGroup:2,breakpoints:e},i.map((a,f)=>H.createElement(xo,{key:`${a.id}-${f}`,"data-index":f,"data-type":a==null?void 0:a.type.toLowerCase()},H.createElement(Se,{credentials:t,index:f,item:a})))))},$e=yo;var vo=e=>{var t=0,o=e.length,i=0;if(o>0)for(;i<o;)t=(t<<5)-t+e.charCodeAt(i++)|0;return t},ke=vo;import{ErrorBoundary as Io}from"react-error-boundary";import V from"react";var Pe=r("div",{display:"flex",flexDirection:"column",alignItems:"center"}),Fe=r("p",{fontWeight:"bold"}),Ae=r("span",{});var wo=({error:e})=>{let{message:t}=e;return V.createElement(Pe,{role:"alert"},V.createElement(Fe,{"data-testid":"headline"},"Something went wrong"),t&&V.createElement(Ae,null,`Error message: ${t}`," "))},Ee=wo;var $o=e=>m.createElement(K,null,m.createElement(ko,{...e})),ko=({collectionId:e,options:t={}})=>{let o=F(),{vault:i}=o,[n,a]=He(),[f,C]=He("");if(So(()=>{!e||i.loadCollection(e).then(l=>a(l)).catch(l=>{console.error(`The IIIF Collection ${e} failed to load: ${l}`),C(l instanceof Error?l.message:"Collection failed to load")}).finally(()=>{})},[e]),(n==null?void 0:n.items.length)===0)return console.log(`The IIIF Collection ${e} does not contain items.`),m.createElement(m.Fragment,null);let h=ke(e);return n?m.createElement("div",null,m.createElement(Io,{FallbackComponent:Ee},m.createElement(oe,{label:n.label,summary:n&&n.summary?n.summary:{none:[""]},homepage:n.homepage,instance:h}),m.createElement($e,{items:n.items,instance:h,breakpoints:Boolean(t.breakpoints)?t.breakpoints:void 0,credentials:t.credentials?t.credentials:"omit"}))):m.createElement(m.Fragment,null)},or=$o;export{or as default}; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@samvera/bloom-iiif", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "<img src=\"https://user-images.githubusercontent.com/7376450/160845852-39bf8942-1db4-41ee-881f-889ba2a4f61e.png\" class=\"bloom-screenshot\" alt=\"Bloom screenshot\"/>", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package