=this.totalResults||he.length===0)&&(this.endOfDataReached=!0,this.activeOnHost&&this.host.setTileCount(this.size)),this.setSearchResultsLoading(!1),this.requestHostUpdate()}addFetchedResultsToDataSource(e,t,i=!0){const o=[];t==null||t.forEach(s=>{!s.identifier||o.push(new ji(s))}),this.addPage(e,o),i&&this.refreshVisibleResults()}async fetchPrefixFilterBuckets(e){var t,i,o,s,n,l,d;const p=(t=this.host.baseQuery)===null||t===void 0?void 0:t.trim();if(!this.canPerformSearch)return[];const f=yl[e],m=this.host.sortParam?[this.host.sortParam]:[],y=ne(q({},this.pageSpecifierParams),{query:p||"",rows:0,filters:this.filterMap,aggregations:{simpleParams:[f]},aggregationsSize:26});y.uid=await this.requestUID(ne(q({},y),{sort:m}),"aggregations");const w=await((i=this.host.searchService)===null||i===void 0?void 0:i.search(y,this.host.searchType));return(d=(l=(n=(s=(o=w==null?void 0:w.success)===null||o===void 0?void 0:o.response)===null||s===void 0?void 0:s.aggregations)===null||n===void 0?void 0:n[f])===null||l===void 0?void 0:l.buckets)!==null&&d!==void 0?d:[]}async updatePrefixFilterCounts(e){const{facetFetchQueryKey:t}=this,i=await this.fetchPrefixFilterBuckets(e);t===this.facetFetchQueryKey&&(this.prefixFilterCountMap=q({},this.prefixFilterCountMap),this.prefixFilterCountMap[e]=i.reduce((s,n)=>(s[n.key.toUpperCase()]=n.doc_count,s),{}),this.requestHostUpdate())}async updatePrefixFiltersForCurrentSort(){if(["title","creator"].includes(this.host.selectedSort)){const e=this.host.selectedSort;this.prefixFilterCountMap[e]||this.updatePrefixFilterCounts(e)}}refreshLetterCounts(){Object.keys(this.prefixFilterCountMap).length>0&&(this.prefixFilterCountMap={}),this.updatePrefixFiltersForCurrentSort(),this.requestHostUpdate()}}var Ne;(function(a){a.default="collection-browser"})(Ne||(Ne={}));var te;(function(a){a.sortBy="sortBy",a.filterByCreator="filterByCreator",a.filterByTitle="filterByTitle",a.displayMode="displayMode",a.loadDesktopView="loadDesktopView",a.loadMobileView="loadMobileView",a.facetSelected="facetSelected",a.facetDeselected="facetDeselected",a.facetNegativeSelected="facetNegativeSelected",a.facetNegativeDeselected="facetNegativeDeselected",a.mobileFacetsToggled="mobileFacetsToggled",a.partOfCollectionClicked="partOfCollectionClicked",a.histogramChanged="histogramChanged",a.histogramChangedFromModal="histogramChangedFromModal",a.histogramExpanded="histogramExpanded",a.resultSelected="resultSelected",a.moreFacetsPageChange="moreFacetsPageChange",a.showMoreFacetsModal="showMoreFacetsModal",a.closeMoreFacetsModal="closeMoreFacetsModal",a.applyMoreFacetsModal="applyMoreFacetsModal"})(te||(te={}));var da=U`
+`;const et=v`
+ .sr-only {
+ position: absolute !important;
+ width: 1px !important;
+ height: 1px !important;
+ margin: -1px !important;
+ padding: 0 !important;
+ border: 0 !important;
+ overflow: hidden !important;
+ white-space: nowrap !important;
+ clip: rect(1px, 1px, 1px, 1px) !important;
+ -webkit-clip-path: inset(50%) !important;
+ clip-path: inset(50%) !important;
+ user-select: none !important;
+ }
+`;/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const zl=(a,e,t)=>{for(const i of e)if(i[0]===a)return(0,i[1])();return t==null?void 0:t()};var Pl=U`
+
+`,Di=U`
+
+`,Oe;let ke=Oe=class extends D{constructor(){super(...arguments),this.placeholderType=null,this.detailMessage=""}render(){return this.placeholderType?c`${this.placeholderTemplate}`:b}get placeholderTemplate(){return c`
+
+ ${zl(this.placeholderType,[["empty-query",()=>this.emptyQueryTemplate],["empty-collection",()=>this.emptyCollectionTemplate],["no-results",()=>this.noResultsTemplate],["query-error",()=>this.queryErrorTemplate],["collection-error",()=>this.collectionErrorTemplate]])}
+
+ `}get emptyQueryTemplate(){return c`
+
+ ${Oe.MESSAGE_EMPTY_QUERY}
+
+ ${Pl}
+ `}get emptyCollectionTemplate(){return c`
+
+ ${Oe.MESSAGE_NO_VIEWABLE_MEMBERS}
+
+ ${Di}
+ `}get noResultsTemplate(){return c`
+
+ ${this.isCollection?Oe.MESSAGE_NO_COLLECTION_RESULTS:Oe.MESSAGE_NO_SEARCH_RESULTS}
+
+ ${Di}
+ `}get queryErrorTemplate(){return c`
+
+ ${Oe.MESSAGE_QUERY_ERROR}
+
+ ${Di}
+
+ ${Oe.QUERY_ERROR_DETAILS_MESSAGE} ${this.detailMessage}
+
+ `}get collectionErrorTemplate(){return c`
+
+ ${Oe.MESSAGE_COLLECTION_ERROR}
+
+ ${Di}
+
+ ${Oe.QUERY_ERROR_DETAILS_MESSAGE} ${this.detailMessage}
+
+ `}static get styles(){return v`
+ :host {
+ text-align: center;
+ width: 100%;
+ }
+
+ a {
+ text-decoration: none;
+ }
+ a:link {
+ color: var(--ia-theme-link-color, #4b64ff);
+ }
+ a:hover {
+ text-decoration: underline;
+ }
+
+ .placeholder {
+ display: block;
+ }
+
+ .desktop svg {
+ max-height: 40rem;
+ }
+ .desktop .title,
+ .desktop .error-details {
+ margin: 4rem 0;
+ }
+
+ .mobile svg {
+ max-height: 20rem;
+ }
+ .mobile .title,
+ .mobile .error-details {
+ margin: 2rem 0.5;
+ }
+
+ .error-details {
+ font-size: 1.2rem;
+ word-break: break-word;
+ }
+ `}};ke.MESSAGE_EMPTY_QUERY=k('To begin searching, enter a search term in the box above and hit "Go".');ke.MESSAGE_NO_SEARCH_RESULTS=k("Your search did not match any items in the Archive. Try different keywords or a more general search.");ke.MESSAGE_NO_COLLECTION_RESULTS=k("Your search did not match any items in this collection. Try different keywords or a more general search.");ke.MESSAGE_NO_VIEWABLE_MEMBERS=k("This collection contains no viewable items.");ke.MESSAGE_QUERY_ERROR=k(c`The search engine
+ encountered an error, which might be related to your search query.
+
+ Tips for constructing search queries.
+ `);ke.MESSAGE_COLLECTION_ERROR=k(c`The search engine
+ encountered an error while loading this collection. If the problem persists,
+ please let us know at
+ info@archive.org.`);ke.QUERY_ERROR_DETAILS_MESSAGE=k("Error details:");r([h({type:String})],ke.prototype,"placeholderType",void 0);r([h({type:Boolean})],ke.prototype,"isMobileView",void 0);r([h({type:Boolean})],ke.prototype,"isCollection",void 0);r([h({type:String})],ke.prototype,"detailMessage",void 0);ke=Oe=r([L("empty-placeholder")],ke);/**
+ * @license
+ * Copyright 2018 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const Ia=a=>a!=null?a:b,Qr=U`
+
+`;var ca;(function(a){a[a.bytes=0]="bytes",a[a.kilobytes=1]="kilobytes",a[a.megabytes=2]="megabytes",a[a.gigabytes=3]="gigabytes",a[a.terabytes=4]="terabytes",a[a.petabytes=5]="petabytes",a[a.exabytes=6]="exabytes",a[a.zettabytes=7]="zettabytes",a[a.yottabytes=8]="yottabytes"})(ca||(ca={}));function Al(a,e,t=" "){let i=a;if(i===void 0)return b;let o=0;for(;i>1024;)i/=1024,o+=1;const s=10**e;i=Math.round(i*s)/s;let n=ca[o];return n=i===1?n.slice(0,-1):n,`${i.toLocaleString()+t+n}`}const Ll=v`var(--tileBackgroundColor, #ffffff)`,Dl=v`var(--tileCornerRadius, 4px)`,no=v`
+ /* Include .sr-only styles for all tiles */
+ ${et}
+
+ .container {
+ background-color: ${Ll};
+ border: 1px #2c2c2c;
+ border-radius: ${Dl};
+ box-shadow: 1px 1px 2px 0;
+ box-sizing: border-box;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ }
+
+ image-block {
+ display: block;
+ position: relative;
+ text-align: center;
+ }
+
+ .tile-details {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ row-gap: 10px;
+ font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
+ }
+
+ .item-info {
+ display: flex;
+ flex-direction: column;
+ row-gap: 5px;
+ flex-grow: 1;
+ }
+
+ #title {
+ padding: 0 5px;
+ }
+
+ .created-by,
+ .date-sorted-by,
+ .volume-issue,
+ .archivist-since {
+ display: flex;
+ justify-content: left;
+ align-items: flex-start;
+ padding: 0 5px;
+ }
+
+ .truncated {
+ flex: 1;
+ color: #2c2c2c;
+ min-width: 0; /* Important for long words! */
+ text-align: left;
+ line-height: 15px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ word-wrap: break-word;
+ -webkit-line-clamp: 3;
+ -webkit-box-orient: vertical;
+ }
+
+ h4.truncated {
+ display: -webkit-box;
+ margin: 0px;
+ line-height: 15px;
+ font-size: 14px;
+ font-weight: 500;
+ padding-bottom: 1px;
+ }
+
+ span {
+ display: -webkit-box;
+ font-size: 1.4rem;
+ line-height: 15px;
+ overflow: hidden;
+ word-wrap: break-word;
+ -webkit-line-clamp: 1;
+ -webkit-box-orient: vertical;
+ padding-bottom: 1px;
+ }
+
+ .container:hover > .tile-details > .item-info > #title > .truncated {
+ text-decoration: underline;
+ }
+
+ /** this is a workaround for Safari 15 where the hover effects are not working */
+ #title:hover > .truncated {
+ text-decoration: underline;
+ }
+
+ .info-button {
+ position: absolute;
+ right: 10px;
+ top: 10px;
+ margin: 0;
+ padding: 0;
+ border: none;
+ border-radius: 50%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ background: rgba(220, 220, 220, 0.5);
+ color: white;
+ font-size: 2rem;
+ font-weight: bold;
+ line-height: 1;
+ text-shadow: black 1px 1px 3px;
+ overflow: visible;
+ aspect-ratio: 1 / 1;
+ z-index: 1;
+ }
+
+ .hidden {
+ display: none;
+ }
+`;function vi(a,e="short",t="en-US"){if(!a)return"";const i={};switch(e){case"year-only":return`${a.getUTCFullYear()}`;case"short":i.month="short",i.year="numeric";break;case"long":i.year="numeric",i.month="short",i.day="2-digit";break}return new Intl.DateTimeFormat(t,i).format(a)}class Fs{constructor(e={}){var t;this.model=e.model,this.baseNavigationUrl=e.baseNavigationUrl,this.collectionPagePath=(t=e.collectionPagePath)!==null&&t!==void 0?t:"/details/",this.sortParam=e.sortParam,this.creatorFilter=e.creatorFilter}get firstCreatorMatchingFilter(){var e,t;let i;if(this.creatorFilter&&((e=this.model)===null||e===void 0?void 0:e.creators.length)){const o=this.creatorFilter;i=this.model.creators.find(s=>s.normalize("NFD").replace(/[^A-Z]+/gi,"").toUpperCase().startsWith(o))}return i!=null?i:(t=this.model)===null||t===void 0?void 0:t.creator}get accountLabel(){var e;return!((e=this.model)===null||e===void 0)&&e.dateAdded?k(ut`Archivist since ${this.model.dateAdded.getFullYear()}`):""}get dateLabel(){var e;switch((e=this.sortParam)===null||e===void 0?void 0:e.field){case"publicdate":return k("Archived");case"reviewdate":return k("Reviewed");case"addeddate":return k("Added");case"date":return k("Published");default:return""}}itemPageUrl(e,t=!1){if(!e||this.baseNavigationUrl==null)return b;const i=t?this.collectionPagePath:"/details/";return`${this.baseNavigationUrl}${i}${e}`}webArchivesCaptureLink(e,t){const o=`https://web.archive.org/web/${t.toISOString().replace(/[TZ:-]/g,"").replace(/\..*/,"")}/${encodeURIComponent(e)}`,s=vi(t,"long");return c` ${s} `}}class ce extends D{constructor(){super(...arguments),this.sortParam=null,this.defaultSortParam=null,this.loggedIn=!1,this.displayValueProvider=new Fs}willUpdate(e){var t,i;(e.has("model")||e.has("baseNavigationUrl")||e.has("collectionPagePath")||e.has("sortParam")||e.has("defaultSortParam")||e.has("creatorFilter"))&&(this.displayValueProvider=new Fs({model:this.model,baseNavigationUrl:this.baseNavigationUrl,collectionPagePath:this.collectionPagePath,sortParam:(i=(t=this.sortParam)!==null&&t!==void 0?t:this.defaultSortParam)!==null&&i!==void 0?i:void 0,creatorFilter:this.creatorFilter}))}}r([h({type:Object})],ce.prototype,"model",void 0);r([h({type:Number})],ce.prototype,"currentWidth",void 0);r([h({type:Number})],ce.prototype,"currentHeight",void 0);r([h({type:String})],ce.prototype,"baseNavigationUrl",void 0);r([h({type:String})],ce.prototype,"baseImageUrl",void 0);r([h({type:String})],ce.prototype,"collectionPagePath",void 0);r([h({type:Object})],ce.prototype,"sortParam",void 0);r([h({type:Object})],ce.prototype,"defaultSortParam",void 0);r([h({type:String})],ce.prototype,"creatorFilter",void 0);r([h({type:Number})],ce.prototype,"mobileBreakpoint",void 0);r([h({type:Boolean})],ce.prototype,"loggedIn",void 0);let ha=class extends D{render(){return c`${this.iconTemplate}
`}get iconTemplate(){var e;return this.type?c`${(e=Nr[this.type])!==null&&e!==void 0?e:b}`:b}static get styles(){return v`
+ :host {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 100%;
+ z-index: 2;
+ background-color: rgb(255, 254, 203);
+ display: flex;
+ justify-content: center;
+ border: 1px solid #2c2c2c;
+ }
+
+ .icon-overlay {
+ height: 20px;
+ width: 20px;
+ padding: 2px;
+ padding: 2px;
+ }
+
+ :host(.list-detail) .icon-overlay {
+ height: 20px;
+ width: 20px;
+ }
+ :host(.list-compact) .icon-overlay {
+ height: 15px;
+ width: 15px;
+ }
+ `}};r([h({type:String})],ha.prototype,"type",void 0);ha=r([L("icon-overlay")],ha);let pa=class extends D{render(){return c`
+
+
${this.iconTemplate}
+
${this.textTemplate}
+
+ `}get iconTemplate(){var e;return this.type?c`${(e=Nr[this.type])!==null&&e!==void 0?e:b}`:b}get textTemplate(){var e;return this.type?c`${(e=gl[this.type])!==null&&e!==void 0?e:b}`:b}static get styles(){return v`
+ :host {
+ align-items: center;
+ display: flex;
+ }
+
+ .overlay {
+ border: 1px solid #2c2c2c;
+ border-radius: 1px;
+ position: absolute;
+ right: 0;
+ left: 0;
+ top: 50%;
+ transform: translate(0px, -50%);
+ width: auto;
+ height: auto;
+ padding: 5px;
+ background-color: #fffecb;
+ display: flex;
+ align-items: center;
+ border-radius: 1px;
+ }
+
+ .icon-overlay {
+ width: 40px;
+ height: 40px;
+ display: inherit;
+ }
+ .text-overlay {
+ margin: 0;
+ vertical-align: bottom;
+ padding-left: 5px;
+ text-align: center;
+ color: #2c2c2c;
+ font-size: 1.4rem;
+ line-height: 2rem;
+ }
+ `}};r([h({type:String})],pa.prototype,"type",void 0);pa=r([L("text-overlay")],pa);let ot=class extends D{constructor(){super(...arguments),this.isCompactTile=!1,this.isListTile=!1,this.loggedIn=!1,this.viewSize="desktop"}render(){var e;return!((e=this.model)===null||e===void 0)&&e.identifier?c`
+
+
+
+ ${this.textOverlayTemplate} ${this.iconOverlayTemplate}
+
+ `:b}get baseClass(){var e,t;return{container:!0,list:this.isListTile&&!this.isCompactTile,"list-compact":this.isListTile&&this.isCompactTile,collection:((e=this.model)===null||e===void 0?void 0:e.mediatype)==="collection",[this.viewSize]:!0,"search-image":((t=this.model)===null||t===void 0?void 0:t.mediatype)==="search"}}get iconOverlayTemplate(){if(!this.isListTile)return b;const{overlayType:e}=this;return e?c`
+
+
+ `:b}get textOverlayTemplate(){if(this.isListTile)return b;const{overlayType:e}=this;return e?c` `:b}get overlayType(){var e,t;if(((e=this.model)===null||e===void 0?void 0:e.loginRequired)&&!this.loggedIn)return"login-required";if(!((t=this.model)===null||t===void 0)&&t.contentWarning)return"content-warning"}static get styles(){const e=v`var(--imageBlockBackgroundColor, #f1f1f4)`;return v`
+ div {
+ display: flex;
+ justify-content: center;
+ position: relative;
+ background-color: ${e};
+ border-radius: 4px;
+ }
+
+ .grid {
+ height: var(--imgBlockHeight, 16rem);
+ flex: 1;
+ position: initial;
+ padding: 5px;
+ border-radius: 4px 4px 0 0;
+ }
+
+ .collection.grid,
+ .grid.search-image {
+ display: block;
+ }
+
+ /** tile-list view */
+ .list {
+ border-radius: 0;
+ background-color: var(--imageBlockListBackgroundColor, #ebebee);
+ box-shadow: 1px 1px 2px rgb(0, 0, 0, 0.2);
+ }
+
+ .list.desktop {
+ width: 100px;
+ max-width: 100%;
+ height: 100px;
+ max-width: 100%;
+ display: inline-block;
+ position: relative;
+ text-align: center;
+ }
+
+ .list.mobile {
+ width: var(--image-width, 90px);
+ height: 90px;
+ }
+
+ /** tile-list-compact view */
+ .container.list-compact {
+ display: block;
+ text-align: center;
+ }
+
+ .list-compact.desktop {
+ width: 45px;
+ height: 45px;
+ }
+
+ .list-compact.mobile {
+ width: 30px;
+ height: 30px;
+ }
+ `}};r([h({type:String})],ot.prototype,"baseImageUrl",void 0);r([h({type:Boolean})],ot.prototype,"isCompactTile",void 0);r([h({type:Boolean})],ot.prototype,"isListTile",void 0);r([h({type:Boolean})],ot.prototype,"loggedIn",void 0);r([h({type:Object})],ot.prototype,"model",void 0);r([h({type:String})],ot.prototype,"viewSize",void 0);ot=r([L("image-block")],ot);let ua=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){return c`
+
+ ${this.infoButtonTemplate}
+
+
+ ${this.getImageBlockTemplate} ${this.getTitleTemplate}
+
+
+
+ ${this.getTileStatsTemplate}
+
+ `}get getImageBlockTemplate(){return c`
+
+
+ `}get getTitleTemplate(){var e;return c`
+
${(e=this.model)===null||e===void 0?void 0:e.title}
+ `}get getTileStatsTemplate(){return c`
+
+
${Qr}
+
+
+ ${this.getItemsTemplate} ${this.getSizeTemplate}
+
+
+ `}get getItemsTemplate(){var e,t;const i=(t=(e=this.model)===null||e===void 0?void 0:e.itemCount)===null||t===void 0?void 0:t.toLocaleString();return c`${i} item${Number(i)!==1?"s":""}`}get getSizeTemplate(){var e,t;const i=(t=(e=this.model)===null||e===void 0?void 0:e.collectionSize)!==null&&t!==void 0?t:0;return i?c`${Al(i,1)}`:""}get infoButtonTemplate(){return this.showInfoButton?c``:b}infoButtonPressed(e){e.preventDefault();const t=new CustomEvent("infoButtonPressed",{detail:{x:e.clientX,y:e.clientY}});this.dispatchEvent(t)}static get styles(){const e=v`var(--tileBorderColor, #555555)`,t=v`var(--tileBackgroundColor, #666666)`,i=v`#fff`;return[no,v`
+ .container {
+ background-color: ${t};
+ border: 1px solid ${e};
+ }
+
+ .item-info {
+ flex-grow: initial;
+ }
+
+ h4.truncated {
+ color: ${i};
+ }
+
+ #item-mediatype svg {
+ filter: invert(100%);
+ height: 2.5rem;
+ align-items: baseline;
+ }
+
+ .container:hover > #title {
+ text-decoration: underline;
+ }
+
+ /* this is a workaround for Safari 15 where the hover effects are not working */
+ image-block:hover > #title {
+ text-decoration: underline;
+ }
+
+ #item-stats {
+ display: flex;
+ padding: 0 5px 5px;
+ align-items: center;
+ }
+
+ #stats-row {
+ display: flex;
+ align-items: baseline;
+ color: ${i};
+ flex-direction: column;
+ margin-left: 10px;
+ }
+ `]}};r([h({type:Boolean})],ua.prototype,"showInfoButton",void 0);ua=r([L("collection-tile")],ua);/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */function*gt(a,e){if(a!==void 0){let t=0;for(const i of a)yield e(i,t++)}}function Rl(a){return new Date(a.getTime()-a.getTimezoneOffset()*1e3*60)}function Ua(a){return a?Rl(a).toISOString().endsWith("-01-01T00:00:00.000Z"):!1}const Gr=c`
+
+`,Fl=c`
+
+`;let Bt=class extends D{constructor(){super(...arguments),this.title="",this.body="",this.starRating=0,this.viewSize="desktop"}render(){return!this.title&&!this.body&&!this.starRating?b:c`
+
+
+ ${this.starsTemplate}
+
${this.title}
+
${this.body}
+
+
+ `}get starsTemplate(){if(this.starRating<=0)return b;const e=Math.min(5,this.starRating),t=Math.min(5,5-this.starRating);return c`
+
+ ${this.starRating} ${k("out of 5 stars")}
+ ${Array(e).fill(this.filledStarTemplate)}
+ ${Array(t).fill(this.unfilledStarTemplate)}
+
+ `}get filledStarTemplate(){return c`${Gr}`}get unfilledStarTemplate(){return c`
+
+ ${Fl}
+
+ `}static get styles(){return[et,v`
+ .review-container {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ width: calc(100% - 10px);
+ border: 1px solid #ccc;
+ margin-top: var(--containerTopMargin, 10px);
+ margin-left: var(--containerLeftMargin, 0px);
+ padding: 5px;
+ box-sizing: border-box;
+ }
+
+ .review-title,
+ .review-body {
+ display: -webkit-box;
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ overflow: hidden;
+ overflow-wrap: break-word;
+ word-break: break-word;
+ -webkit-line-clamp: var(--maxLines, 3);
+ -webkit-box-orient: vertical;
+ margin: 0;
+ }
+
+ .review-title {
+ font-size: 1.4rem;
+ line-height: 2rem;
+ max-height: 6rem;
+ }
+
+ .review-title > a[href] {
+ color: inherit;
+ text-decoration: none;
+ }
+
+ .review-title > a[href]:hover {
+ text-decoration: underline;
+ }
+
+ .review-body {
+ font-size: 1rem;
+ line-height: 1.4rem;
+ max-height: 4.2rem;
+ }
+
+ .star-rating svg {
+ width: 10px;
+ height: 10px;
+ }
+
+ .unfilled-star {
+ fill: #ccc;
+ }
+
+ .list {
+ margin: 0;
+ padding-left: 5px;
+ }
+ `]}};r([h({type:String})],Bt.prototype,"title",void 0);r([h({type:String})],Bt.prototype,"body",void 0);r([h({type:Number})],Bt.prototype,"starRating",void 0);r([h({type:String})],Bt.prototype,"viewSize",void 0);Bt=r([L("review-block")],Bt);/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */function*Oi(a,e){const t=typeof e=="function";if(a!==void 0){let i=-1;for(const o of a)i>-1&&(yield t?e(i):e),i++,yield o}}let Ki=class extends D{constructor(){super(...arguments),this.snippets=[],this.viewSize="desktop"}render(){var e;return!((e=this.snippets)===null||e===void 0)&&e.length?c`
+
+
+ ${this.ellipsisJoinedSnippets}
+
+
+ `:c`${b}`}get ellipsisJoinedSnippets(){return c`
+ … ${Oi(this.snippetTemplates,c` … `)} …
+ `}get snippetTemplates(){var e;return(e=this.snippets)===null||e===void 0?void 0:e.map(t=>{const i=t.matchAll(/{{{(.+?)}}}/gs),o=[];let s=0;for(const n of i)n.index!=null&&(o.push(c`
+ ${t.slice(s,n.index)}
+ ${n[1]}
+ `),s=n.index+n[0].length);return o.push(c`${t.slice(s)}`),c`${o}`})}static get styles(){return v`
+ .container {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ width: calc(100% - 10px);
+ border-left: 5px solid #194880;
+ margin-top: var(--containerTopMargin, 10px);
+ margin-left: var(--containerLeftMargin, 0px);
+ border-radius: 3px;
+ box-sizing: border-box;
+ }
+
+ .snippet-view {
+ display: -webkit-box;
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ overflow: hidden;
+ overflow-wrap: break-word;
+ -webkit-line-clamp: var(--maxLines, 3);
+ -webkit-box-orient: vertical;
+ margin-left: 5px;
+ }
+
+ .grid {
+ font-size: 1.2rem;
+ line-height: 1.5rem;
+ }
+
+ .list {
+ margin: 0;
+ padding-left: 15px;
+ font-size: 1.4rem;
+ line-height: 2rem;
+
+ /*
+ * Safari doesn't always respect the line-clamping rules,
+ * so we add this to ensure these fields still get truncated.
+ */
+ max-height: 6rem;
+ }
+
+ mark {
+ /* blue, 20% transparency */
+ background-color: #0000ff33;
+ color: inherit;
+ }
+ `}};r([h({type:Array})],Ki.prototype,"snippets",void 0);r([h({type:String})],Ki.prototype,"viewSize",void 0);Ki=r([L("text-snippet-block")],Ki);const Bl=v`
+ .drop-shadow {
+ overflow: hidden;
+ height: 100%;
+ }
+
+ .list-box {
+ overflow: hidden;
+ box-sizing: border-box;
+ display: inline-block;
+ position: relative;
+ }
+
+ .list-box img {
+ border-radius: 0;
+ }
+
+ .contain {
+ object-fit: contain;
+ object-position: center;
+ height: 100%;
+ width: 100%;
+ }
+
+ .cover {
+ object-fit: cover;
+ }
+
+ .blur {
+ filter: blur(15px);
+ box-shadow: 1px 1px 2px 0;
+ }
+
+ .account-image {
+ object-fit: cover;
+ background-position: 50% 50%;
+ border-radius: 50%;
+ width: 160px;
+ height: 160px;
+ }
+
+ :not(.list-box) > .collection-image {
+ object-fit: cover;
+ border-radius: 8px;
+ width: 100%;
+ height: 160px;
+ }
+
+ .list-box.search-image svg {
+ margin: 10px;
+ }
+`,Ol=v`
+ .waveform {
+ mix-blend-mode: screen;
+ position: relative;
+ height: 62.5%;
+ top: 50%;
+ transform: translateY(-50%);
+ }
+
+ .waveform-grad0 {
+ background: linear-gradient(
+ hsl(300, 80%, 55%),
+ hsl(330, 80%, 33%) 35%,
+ hsl(330, 80%, 22%) 70%,
+ hsl(0, 0%, 0%)
+ );
+ }
+
+ .waveform-grad1 {
+ background: linear-gradient(
+ hsl(200, 80%, 55%),
+ hsl(230, 80%, 33%) 35%,
+ hsl(230, 80%, 22%) 70%,
+ hsl(0, 0%, 0%)
+ );
+ }
+
+ .waveform-grad2 {
+ background: linear-gradient(
+ hsl(160, 80%, 55%),
+ hsl(190, 80%, 33%) 35%,
+ hsl(190, 80%, 22%) 70%,
+ hsl(0, 0%, 0%)
+ );
+ }
+
+ .waveform-grad3 {
+ background: linear-gradient(
+ hsl(250, 80%, 55%),
+ hsl(280, 80%, 33%) 35%,
+ hsl(280, 80%, 22%) 70%,
+ hsl(0, 0%, 0%)
+ );
+ }
+
+ .waveform-grad4 {
+ background: linear-gradient(
+ hsl(280, 80%, 55%),
+ hsl(310, 80%, 33%) 35%,
+ hsl(310, 80%, 22%) 70%,
+ hsl(0, 0%, 0%)
+ );
+ }
+
+ .waveform-grad5 {
+ background: linear-gradient(
+ hsl(340, 80%, 55%),
+ hsl(0, 80%, 33%) 35%,
+ hsl(0, 80%, 22%) 70%,
+ hsl(0, 0%, 0%)
+ );
+ }
+`,Kr=U`
+
+`;let He=class extends D{constructor(){super(...arguments),this.isListTile=!1,this.isCompactTile=!1,this.loggedIn=!1,this.isWaveform=!1,this.isNotFound=!1}render(){return c`
+ ${this.imageTemplate}
+ `}get imageTemplate(){var e;return((e=this.model)===null||e===void 0?void 0:e.mediatype)==="search"?c`${Kr}`:c`
+
+ `}get imageSrc(){var e,t;if(this.isNotFound)return this.notFoundSrc;if(((e=this.model)===null||e===void 0?void 0:e.captureDates)&&this.model.identifier)try{const i=new URL(this.model.identifier),o=encodeURIComponent(i.hostname);return this.baseImageUrl?`https://web.archive.org/thumb/${o}?generate=1`:b}catch{return`${this.baseImageUrl}/images/notfound.png`}return this.baseImageUrl&&((t=this.model)===null||t===void 0?void 0:t.identifier)?`${this.baseImageUrl}/services/img/${this.model.identifier}`:b}get notFoundSrc(){return this.baseImageUrl?`${this.baseImageUrl}/images/notfound.png`:b}get hashBasedGradient(){var e;return!((e=this.model)===null||e===void 0)&&e.identifier?`waveform-grad${this.hashStrToInt(this.model.identifier)%6}`:"waveform-grad0"}hashStrToInt(e){return e.split("").reduce((t,i)=>t+i.charCodeAt(0),0)}get itemBaseClass(){var e;return{"drop-shadow":!0,"list-box":this.isListTile,"search-image":((e=this.model)===null||e===void 0?void 0:e.mediatype)==="search",[this.hashBasedGradient]:this.isWaveform}}get itemImageClass(){var e,t,i;const o=((e=this.model)===null||e===void 0?void 0:e.contentWarning)||((t=this.model)===null||t===void 0?void 0:t.loginRequired);return{contain:!this.isCompactTile&&!this.isWaveform,cover:this.isCompactTile,blur:o||!1,waveform:this.isWaveform,"account-image":this.isAccountImage,"collection-image":((i=this.model)===null||i===void 0?void 0:i.mediatype)==="collection"}}get isAccountImage(){var e;return((e=this.model)===null||e===void 0?void 0:e.mediatype)==="account"&&!this.isCompactTile&&!this.isListTile}onLoad(){var e,t;(((e=this.model)===null||e===void 0?void 0:e.mediatype)==="audio"||((t=this.model)===null||t===void 0?void 0:t.mediatype)==="etree")&&this.baseImage.naturalWidth/this.baseImage.naturalHeight===4&&(this.isWaveform=!0)}onError(){this.isNotFound=!0}static get styles(){return[Bl,Ol,v`
+ img {
+ height: var(--imgHeight, 16rem);
+ width: var(--imgWidth, 16rem);
+ }
+
+ .search-image {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: rgb(245, 245, 247);
+ border-radius: 4px;
+ }
+
+ svg {
+ height: 10rem;
+ width: 10rem;
+ }
+ `]}};r([h({type:Object})],He.prototype,"model",void 0);r([h({type:String})],He.prototype,"baseImageUrl",void 0);r([h({type:Boolean})],He.prototype,"isListTile",void 0);r([h({type:Boolean})],He.prototype,"isCompactTile",void 0);r([h({type:Boolean})],He.prototype,"loggedIn",void 0);r([P()],He.prototype,"isWaveform",void 0);r([P()],He.prototype,"isNotFound",void 0);r([G("img")],He.prototype,"baseImage",void 0);He=r([L("item-image")],He);const Il=U`
+
+`,Ul=U`
+
+`,Nl=U`
+
+`,Hl=U`
+
+`,Vl=U`
+
+`,Bs=U`
+
+`,Wl=U`
+
+`,jl=U`
+
+`,ql=U`
+
+`,Ql=U`
+
+`,Gl=U`
+
+`,Kl=U`
+
+`,Yr={account:{color:"#000000",icon:Il,text:"Account"},audio:{color:"#00adef",icon:Ul,text:"Audio"},collection:{color:"#4666ff",icon:Qr,text:"Collection"},data:{color:"#333333",icon:Nl,text:"Data"},etree:{color:"#00adef",icon:Hl,text:"E-tree"},film:{color:"#bf1b2c",icon:Bs,text:"Film"},image:{color:"#aa99c9",icon:Vl,text:"Image"},movies:{color:"#f1644b",icon:Bs,text:"Movie"},radio:{color:"#8fdaef",icon:Wl,text:"Radio"},software:{color:"#9ecc4f",icon:jl,text:"Software"},texts:{color:"#faab3c",icon:ql,text:"Text"},tv:{color:"#f1644b",icon:Ql,text:"TV"},video:{color:"#f1644b",icon:Gl,text:"Video"},web:{color:"#ffcd27",icon:Kl,text:"Web"},search:{color:"#000000",icon:Kr,text:"Search"}};let mi=class extends D{constructor(){super(...arguments),this.showText=!1}get displayMediatype(){var e,t;const i=["tvnews","tvarchive","television"],o=["radio","radioprogram"];return this.mediatype==="movies"&&((e=this.collections)===null||e===void 0?void 0:e.some(s=>i.indexOf(s)>=0))?"tv":this.mediatype==="audio"&&((t=this.collections)===null||t===void 0?void 0:t.some(s=>o.indexOf(s)>=0))?"radio":this.mediatype||""}render(){const e=Yr[this.displayMediatype];return e?c`
+
+ ${e.icon}
+
${e.text}
+
+ `:c``}static get styles(){return v`
+ #icon {
+ height: var(--iconHeight, 25px);
+ }
+
+ .status-text {
+ font-size: 14px;
+ color: #2c2c2c;
+ margin: auto;
+ display: block;
+ text-align: var(--iconTextAlign, center);
+ }
+
+ #icon.hide-text p {
+ display: none;
+ }
+
+ svg {
+ height: var(--iconHeight, 10px);
+ width: var(--iconWidth, 10px);
+ pointer-events: none;
+ }
+
+ .fill-color {
+ fill: var(--iconFillColor, '#000000');
+ }
+ `}};r([h({type:String})],mi.prototype,"mediatype",void 0);r([h({type:Array})],mi.prototype,"collections",void 0);r([h({type:Boolean})],mi.prototype,"showText",void 0);mi=r([L("mediatype-icon")],mi);const Yl=U`
+
+`,Xl=U`
+
+`,Zl=U`
+
+`;function Jl(a,e){let t=1;return a>=1e9?t=1e9:a>=1e6?t=1e6:a>=1e3&&e==="short"&&(t=1e3),t}function ed(a=0,e){const t=a/e,i=t<10;let o=0;return i?o=Math.round((t+Number.EPSILON)*10)/10:o=Math.round(t),o}function td(a,e,t,i){switch(e){case 1e9:return k(t==="short"?ut`${a}B`:ut`${a} billion`);case 1e6:return k(t==="short"?ut`${a}M`:ut`${a} million`);case 1e3:return k(t==="short"?ut`${a}K`:ut`${a} thousand`);default:return new Intl.NumberFormat(i).format(a)}}function ci(a,e="long",t="short",i="en-US"){const o=a!=null?a:-1;if(o<0)return"";const s=Jl(o,e),n=ed(o,s);return td(n,s,t,i)}let at=class extends D{render(){var e,t,i,o,s;const n=ci(this.favCount,"short","short"),l=ci(this.commentCount,"short","short"),d=this.mediatype==="account"?`${(e=this.itemCount)!==null&&e!==void 0?e:0} uploads`:`${(t=this.viewCount)!==null&&t!==void 0?t:0} ${(i=this.viewLabel)!==null&&i!==void 0?i:"all-time views"}`;return c`
+
+
+ ${this.mediatype==="account"?"Account Stats":"Item Stats"}
+
+
+ -
+
${k("Mediatype:")}
+
+
+ -
+ ${this.mediatype==="account"?Xl:Zl}
+
+
+ ${this.mediatype==="account"?k("Uploads:"):k("Views:")}
+
+ ${ci(this.mediatype==="account"?(o=this.itemCount)!==null&&o!==void 0?o:0:(s=this.viewCount)!==null&&s!==void 0?s:0,"short","short")}
+
+
+ -
+ ${Gr}
+
+ ${k("Favorites:")}
+ ${n}
+
+
+ -
+ ${Yl}
+
+ ${k("Reviews:")}
+ ${l}
+
+
+
+
+ `}static get styles(){return[et,v`
+ mediatype-icon {
+ --iconHeight: 25px;
+ --iconWidth: 25px;
+ }
+
+ ul {
+ all: unset; // unset all property values
+ list-style-type: none; // remove default list-style
+ }
+
+ li {
+ list-style-type: none; // remove default list-style
+ }
+
+ svg {
+ height: 13px;
+ width: 13px;
+ display: block;
+ margin: auto;
+ pointer-events: none;
+ }
+
+ /* Make the reviews icon slightly smaller/lower, for even visual weight */
+ .reviews svg {
+ height: 11px;
+ width: 11px;
+ margin-top: 2px;
+ }
+
+ .item-stats {
+ height: 30px;
+ padding-left: 5px;
+ padding-right: 5px;
+ font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
+ text-align: center;
+ }
+
+ #stats-row {
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ width: 100%;
+ padding-bottom: 5px;
+ }
+
+ .col {
+ min-width: 15px;
+ max-width: 25%;
+ height: 25px;
+ }
+
+ .status-text {
+ font-size: 14px;
+ height: 15px;
+ color: #2c2c2c;
+ line-height: 17px;
+ margin: auto;
+ display: block;
+ text-align: center;
+ }
+ `]}};r([h({type:String})],at.prototype,"mediatype",void 0);r([h({type:Number})],at.prototype,"itemCount",void 0);r([h({type:Number})],at.prototype,"viewCount",void 0);r([h({type:String})],at.prototype,"viewLabel",void 0);r([h({type:Number})],at.prototype,"favCount",void 0);r([h({type:Number})],at.prototype,"commentCount",void 0);at=r([L("tile-stats")],at);let fa=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){var e,t,i,o,s,n,l;const d=(e=this.model)===null||e===void 0?void 0:e.title,p=(t=this.sortParam)!==null&&t!==void 0?t:this.defaultSortParam,[f,m]=(p==null?void 0:p.field)==="week"?[(i=this.model)===null||i===void 0?void 0:i.weeklyViewCount,"weekly views"]:[(o=this.model)===null||o===void 0?void 0:o.viewCount,"all-time views"];return c`
+
+ ${this.infoButtonTemplate}
+
+
+ ${this.imageBlockTemplate}
+
+
+
+ ${d}
+
+
+
+ ${this.volumeIssueTemplate}
+ ${this.isSortedByDate?this.sortedDateInfoTemplate:this.creatorTemplate}
+ ${this.webArchivesCaptureDatesTemplate} ${this.textSnippetsTemplate}
+ ${this.reviewBlockTemplate}
+
+
+
+
+
+
+ `}get creatorTemplate(){const e=this.displayValueProvider.firstCreatorMatchingFilter;return e?c`
+
+
+ by ${e}
+
+
+ `:b}get imageBlockTemplate(){return c`
+
+
+ `}get sortedDateInfoTemplate(){var e,t,i,o,s;let n,l="long";switch((e=this.effectiveSort)===null||e===void 0?void 0:e.field){case"date":{const d=(t=this.model)===null||t===void 0?void 0:t.datePublished;n={field:"published",value:d},Ua(d)&&(l="year-only");break}case"reviewdate":n={field:"reviewed",value:(i=this.model)===null||i===void 0?void 0:i.dateReviewed};break;case"addeddate":n={field:"added",value:(o=this.model)===null||o===void 0?void 0:o.dateAdded};break;case"publicdate":n={field:"archived",value:(s=this.model)===null||s===void 0?void 0:s.dateArchived};break}return n!=null&&n.value?c`
+
+
+ ${n==null?void 0:n.field} ${vi(n==null?void 0:n.value,l)}
+
+
+ `:b}get infoButtonTemplate(){return this.showInfoButton?c``:b}get reviewBlockTemplate(){var e;if(!(!((e=this.model)===null||e===void 0)&&e.review))return b;const{title:t,body:i,stars:o}=this.model.review;return c`
+
+
+ `}get textSnippetsTemplate(){var e;return this.hasSnippets?c`
+
+
+ `:b}get volumeIssueTemplate(){var e,t,i,o;return!(!((e=this.model)===null||e===void 0)&&e.volume)||!(!((t=this.model)===null||t===void 0)&&t.issue)?b:c`
+
+
+ Volume ${(i=this.model)===null||i===void 0?void 0:i.volume}, Issue ${(o=this.model)===null||o===void 0?void 0:o.issue}
+
+
+ `}get webArchivesCaptureDatesTemplate(){var e;return!(!((e=this.model)===null||e===void 0)&&e.captureDates)||!this.model.title?b:c`
+
+ ${gt(this.model.captureDates,t=>c`-
+ ${this.displayValueProvider.webArchivesCaptureLink(this.model.title,t)}
+
`)}
+
+ `}get isSortedByDate(){var e;return["date","reviewdate","addeddate","publicdate"].includes((e=this.effectiveSort)===null||e===void 0?void 0:e.field)}get effectiveSort(){var e;return(e=this.sortParam)!==null&&e!==void 0?e:this.defaultSortParam}get hasSnippets(){var e,t;return!!(!((t=(e=this.model)===null||e===void 0?void 0:e.snippets)===null||t===void 0)&&t.length)}infoButtonPressed(e){e.preventDefault();const t=new CustomEvent("infoButtonPressed",{detail:{x:e.clientX,y:e.clientY}});this.dispatchEvent(t)}static get styles(){const e=v`var(--tileBorderColor, #dddddd)`;return[no,v`
+ a:link {
+ text-decoration: none;
+ color: var(--ia-theme-link-color, #4b64ff);
+ }
+ a:hover {
+ text-decoration: underline;
+ }
+
+ .container {
+ border: 1px solid ${e};
+ }
+
+ .capture-dates {
+ margin: 0;
+ padding: 0 5px;
+ list-style-type: none;
+ }
+
+ review-block,
+ text-snippet-block {
+ --containerLeftMargin: 5px;
+ --containerTopMargin: 5px;
+ }
+
+ /**
+ * iOS Safari long-press on tiles (to bring up hover pane)
+ * gets messy without this
+ */
+ @media screen and (pointer: coarse) and (hover: none) {
+ .container {
+ -webkit-touch-callout: none;
+ }
+
+ .truncated {
+ -webkit-touch-callout: default;
+ }
+ }
+ `]}};r([h({type:Boolean})],fa.prototype,"showInfoButton",void 0);fa=r([L("item-tile")],fa);let va=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){return c`
+
+ ${this.infoButtonTemplate}
+
+
+ ${this.getAvatarTemplate} ${this.getTitleTemplate}
+ ${this.getArchivistTemplate}
+
+ ${this.getTileStatsTemplate}
+
+
+ `}get getAvatarTemplate(){return c`
+
+
+ `}get getTitleTemplate(){var e;return c`
+
${(e=this.model)===null||e===void 0?void 0:e.identifier}
+ `}get getArchivistTemplate(){return c`
+ ${this.displayValueProvider.accountLabel}
+
`}get getTileStatsTemplate(){var e,t,i,o;return c`
+ `}get infoButtonTemplate(){return this.showInfoButton?c``:b}infoButtonPressed(e){e.preventDefault();const t=new CustomEvent("infoButtonPressed",{detail:{x:e.clientX,y:e.clientY}});this.dispatchEvent(t)}static get styles(){const e=v`var(--tileBorderColor, #dddddd)`;return[no,v`
+ .container {
+ border: 1px solid ${e};
+ }
+ `]}};r([h({type:Boolean})],va.prototype,"showInfoButton",void 0);va=r([L("account-tile")],va);let ma=class extends ce{constructor(){super(...arguments),this.showInfoButton=!1}render(){return c`
+
+
+
+ ${this.getImageBlockTemplate} ${this.getTitleTemplate}
+
+
+
+ `}get getImageBlockTemplate(){return c`
+
+
+ `}get getTitleTemplate(){var e;return c`
+
${(e=this.model)===null||e===void 0?void 0:e.title}
+ `}static get styles(){const e=v`var(--tileBorderColor, #555555)`,t=v`var(--tileBackgroundColor, #666666)`,i=v`#fff`;return[no,v`
+ .container {
+ background-color: ${t};
+ border: 1px solid ${e};
+ }
+
+ .item-info {
+ flex-grow: initial;
+ }
+
+ h4.truncated {
+ color: ${i};
+ -webkit-line-clamp: 4;
+ }
+
+ .container:hover > #title {
+ text-decoration: underline;
+ }
+
+ /* this is a workaround for Safari 15 where the hover effects are not working */
+ image-block:hover > #title {
+ text-decoration: underline;
+ }
+ `]}};r([h({type:Boolean})],ma.prototype,"showInfoButton",void 0);ma=r([L("search-tile")],ma);/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */class ga extends ki{constructor(e){if(super(e),this.it=b,e.type!==Ie.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===b||e==null)return this.ft=void 0,this.it=e;if(e===Ce)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ga.directiveName="unsafeHTML",ga.resultType=1;const id=Ci(ga);/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:Xr,setPrototypeOf:Os,isFrozen:od,getPrototypeOf:ad,getOwnPropertyDescriptor:sd}=Object;let{freeze:_e,seal:Me,create:Zr}=Object,{apply:ba,construct:ya}=typeof Reflect!="undefined"&&Reflect;_e||(_e=function(e){return e});Me||(Me=function(e){return e});ba||(ba=function(e,t,i){return e.apply(t,i)});ya||(ya=function(e,t){return new e(...t)});const Ri=Te(Array.prototype.forEach),Is=Te(Array.prototype.pop),ii=Te(Array.prototype.push),Ii=Te(String.prototype.toLowerCase),Ao=Te(String.prototype.toString),Us=Te(String.prototype.match),oi=Te(String.prototype.replace),rd=Te(String.prototype.indexOf),nd=Te(String.prototype.trim),Pe=Te(Object.prototype.hasOwnProperty),ye=Te(RegExp.prototype.test),ai=ld(TypeError);function Te(a){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:Ii;Os&&Os(a,null);let i=e.length;for(;i--;){let o=e[i];if(typeof o=="string"){const s=t(o);s!==o&&(od(e)||(e[i]=s),o=s)}a[o]=!0}return a}function dd(a){for(let e=0;e/gm),fd=Me(/\${[\w\W]*}/gm),vd=Me(/^data-[\-\w.\u00B7-\uFFFF]/),md=Me(/^aria-[\-\w]+$/),Jr=Me(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gd=Me(/^(?:\w+script|data):/i),bd=Me(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),en=Me(/^html$/i),yd=Me(/^[a-z][.\w]*(-[.\w]+)+$/i);var js=Object.freeze({__proto__:null,MUSTACHE_EXPR:pd,ERB_EXPR:ud,TMPLIT_EXPR:fd,DATA_ATTR:vd,ARIA_ATTR:md,IS_ALLOWED_URI:Jr,IS_SCRIPT_OR_DATA:gd,ATTR_WHITESPACE:bd,DOCTYPE_NAME:en,CUSTOM_ELEMENT:yd});const ri={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},wd=function(){return typeof window=="undefined"?null:window},_d=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(i=t.getAttribute(o));const s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(n){return n},createScriptURL(n){return n}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function tn(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wd();const e=z=>tn(z);if(e.version="3.1.7",e.removed=[],!a||!a.document||a.document.nodeType!==ri.document)return e.isSupported=!1,e;let{document:t}=a;const i=t,o=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:n,Node:l,Element:d,NodeFilter:p,NamedNodeMap:f=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:m,DOMParser:y,trustedTypes:w}=a,x=d.prototype,C=si(x,"cloneNode"),A=si(x,"remove"),F=si(x,"nextSibling"),R=si(x,"childNodes"),W=si(x,"parentNode");if(typeof n=="function"){const z=t.createElement("template");z.content&&z.content.ownerDocument&&(t=z.content.ownerDocument)}let B,Z="";const{implementation:he,createNodeIterator:ze,createDocumentFragment:ee,getElementsByTagName:me}=t,{importNode:Re}=i;let Se={};e.isSupported=typeof Xr=="function"&&typeof W=="function"&&he&&he.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:rt,ERB_EXPR:nt,TMPLIT_EXPR:lt,DATA_ATTR:jt,ARIA_ATTR:qt,IS_SCRIPT_OR_DATA:Qt,ATTR_WHITESPACE:_t,CUSTOM_ELEMENT:Gt}=js;let{IS_ALLOWED_URI:xt}=js,ie=null;const Kt=I({},[...Ns,...Lo,...Do,...Ro,...Hs]);let pe=null;const ja=I({},[...Vs,...Fo,...Ws,...Fi]);let ae=Object.seal(Zr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Yt=null,uo=null,qa=!0,fo=!0,Qa=!1,Ga=!0,St=!1,vo=!0,dt=!1,mo=!1,go=!1,$t=!1,Ei=!1,Mi=!1,Ka=!0,Ya=!1;const gn="user-content-";let bo=!0,Xt=!1,Ct={},kt=null;const Xa=I({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Za=null;const Ja=I({},["audio","video","img","source","image","track"]);let yo=null;const es=I({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),zi="http://www.w3.org/1998/Math/MathML",Pi="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Tt=Qe,wo=!1,_o=null;const bn=I({},[zi,Pi,Qe],Ao);let Zt=null;const yn=["application/xhtml+xml","text/html"],wn="text/html";let ue=null,Et=null;const _n=t.createElement("form"),ts=function(u){return u instanceof RegExp||u instanceof Function},xo=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Et&&Et===u)){if((!u||typeof u!="object")&&(u={}),u=ft(u),Zt=yn.indexOf(u.PARSER_MEDIA_TYPE)===-1?wn:u.PARSER_MEDIA_TYPE,ue=Zt==="application/xhtml+xml"?Ao:Ii,ie=Pe(u,"ALLOWED_TAGS")?I({},u.ALLOWED_TAGS,ue):Kt,pe=Pe(u,"ALLOWED_ATTR")?I({},u.ALLOWED_ATTR,ue):ja,_o=Pe(u,"ALLOWED_NAMESPACES")?I({},u.ALLOWED_NAMESPACES,Ao):bn,yo=Pe(u,"ADD_URI_SAFE_ATTR")?I(ft(es),u.ADD_URI_SAFE_ATTR,ue):es,Za=Pe(u,"ADD_DATA_URI_TAGS")?I(ft(Ja),u.ADD_DATA_URI_TAGS,ue):Ja,kt=Pe(u,"FORBID_CONTENTS")?I({},u.FORBID_CONTENTS,ue):Xa,Yt=Pe(u,"FORBID_TAGS")?I({},u.FORBID_TAGS,ue):{},uo=Pe(u,"FORBID_ATTR")?I({},u.FORBID_ATTR,ue):{},Ct=Pe(u,"USE_PROFILES")?u.USE_PROFILES:!1,qa=u.ALLOW_ARIA_ATTR!==!1,fo=u.ALLOW_DATA_ATTR!==!1,Qa=u.ALLOW_UNKNOWN_PROTOCOLS||!1,Ga=u.ALLOW_SELF_CLOSE_IN_ATTR!==!1,St=u.SAFE_FOR_TEMPLATES||!1,vo=u.SAFE_FOR_XML!==!1,dt=u.WHOLE_DOCUMENT||!1,$t=u.RETURN_DOM||!1,Ei=u.RETURN_DOM_FRAGMENT||!1,Mi=u.RETURN_TRUSTED_TYPE||!1,go=u.FORCE_BODY||!1,Ka=u.SANITIZE_DOM!==!1,Ya=u.SANITIZE_NAMED_PROPS||!1,bo=u.KEEP_CONTENT!==!1,Xt=u.IN_PLACE||!1,xt=u.ALLOWED_URI_REGEXP||Jr,Tt=u.NAMESPACE||Qe,ae=u.CUSTOM_ELEMENT_HANDLING||{},u.CUSTOM_ELEMENT_HANDLING&&ts(u.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ae.tagNameCheck=u.CUSTOM_ELEMENT_HANDLING.tagNameCheck),u.CUSTOM_ELEMENT_HANDLING&&ts(u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ae.attributeNameCheck=u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),u.CUSTOM_ELEMENT_HANDLING&&typeof u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ae.allowCustomizedBuiltInElements=u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),St&&(fo=!1),Ei&&($t=!0),Ct&&(ie=I({},Hs),pe=[],Ct.html===!0&&(I(ie,Ns),I(pe,Vs)),Ct.svg===!0&&(I(ie,Lo),I(pe,Fo),I(pe,Fi)),Ct.svgFilters===!0&&(I(ie,Do),I(pe,Fo),I(pe,Fi)),Ct.mathMl===!0&&(I(ie,Ro),I(pe,Ws),I(pe,Fi))),u.ADD_TAGS&&(ie===Kt&&(ie=ft(ie)),I(ie,u.ADD_TAGS,ue)),u.ADD_ATTR&&(pe===ja&&(pe=ft(pe)),I(pe,u.ADD_ATTR,ue)),u.ADD_URI_SAFE_ATTR&&I(yo,u.ADD_URI_SAFE_ATTR,ue),u.FORBID_CONTENTS&&(kt===Xa&&(kt=ft(kt)),I(kt,u.FORBID_CONTENTS,ue)),bo&&(ie["#text"]=!0),dt&&I(ie,["html","head","body"]),ie.table&&(I(ie,["tbody"]),delete Yt.tbody),u.TRUSTED_TYPES_POLICY){if(typeof u.TRUSTED_TYPES_POLICY.createHTML!="function")throw ai('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof u.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ai('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');B=u.TRUSTED_TYPES_POLICY,Z=B.createHTML("")}else B===void 0&&(B=_d(w,o)),B!==null&&typeof Z=="string"&&(Z=B.createHTML(""));_e&&_e(u),Et=u}},is=I({},["mi","mo","mn","ms","mtext"]),os=I({},["annotation-xml"]),xn=I({},["title","style","font","a","script"]),as=I({},[...Lo,...Do,...cd]),ss=I({},[...Ro,...hd]),Sn=function(u){let _=W(u);(!_||!_.tagName)&&(_={namespaceURI:Tt,tagName:"template"});const E=Ii(u.tagName),j=Ii(_.tagName);return _o[u.namespaceURI]?u.namespaceURI===Pi?_.namespaceURI===Qe?E==="svg":_.namespaceURI===zi?E==="svg"&&(j==="annotation-xml"||is[j]):Boolean(as[E]):u.namespaceURI===zi?_.namespaceURI===Qe?E==="math":_.namespaceURI===Pi?E==="math"&&os[j]:Boolean(ss[E]):u.namespaceURI===Qe?_.namespaceURI===Pi&&!os[j]||_.namespaceURI===zi&&!is[j]?!1:!ss[E]&&(xn[E]||!as[E]):!!(Zt==="application/xhtml+xml"&&_o[u.namespaceURI]):!1},Fe=function(u){ii(e.removed,{element:u});try{W(u).removeChild(u)}catch{A(u)}},Ai=function(u,_){try{ii(e.removed,{attribute:_.getAttributeNode(u),from:_})}catch{ii(e.removed,{attribute:null,from:_})}if(_.removeAttribute(u),u==="is"&&!pe[u])if($t||Ei)try{Fe(_)}catch{}else try{_.setAttribute(u,"")}catch{}},rs=function(u){let _=null,E=null;if(go)u=""+u;else{const fe=Us(u,/^[\r\n\t ]+/);E=fe&&fe[0]}Zt==="application/xhtml+xml"&&Tt===Qe&&(u=''+u+"");const j=B?B.createHTML(u):u;if(Tt===Qe)try{_=new y().parseFromString(j,Zt)}catch{}if(!_||!_.documentElement){_=he.createDocument(Tt,"template",null);try{_.documentElement.innerHTML=wo?Z:j}catch{}}const ge=_.body||_.documentElement;return u&&E&&ge.insertBefore(t.createTextNode(E),ge.childNodes[0]||null),Tt===Qe?me.call(_,dt?"html":"body")[0]:dt?_.documentElement:ge},ns=function(u){return ze.call(u.ownerDocument||u,u,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},ls=function(u){return u instanceof m&&(typeof u.nodeName!="string"||typeof u.textContent!="string"||typeof u.removeChild!="function"||!(u.attributes instanceof f)||typeof u.removeAttribute!="function"||typeof u.setAttribute!="function"||typeof u.namespaceURI!="string"||typeof u.insertBefore!="function"||typeof u.hasChildNodes!="function")},ds=function(u){return typeof l=="function"&&u instanceof l},Ge=function(u,_,E){!Se[u]||Ri(Se[u],j=>{j.call(e,_,E,Et)})},cs=function(u){let _=null;if(Ge("beforeSanitizeElements",u,null),ls(u))return Fe(u),!0;const E=ue(u.nodeName);if(Ge("uponSanitizeElement",u,{tagName:E,allowedTags:ie}),u.hasChildNodes()&&!ds(u.firstElementChild)&&ye(/<[/\w]/g,u.innerHTML)&&ye(/<[/\w]/g,u.textContent)||u.nodeType===ri.progressingInstruction||vo&&u.nodeType===ri.comment&&ye(/<[/\w]/g,u.data))return Fe(u),!0;if(!ie[E]||Yt[E]){if(!Yt[E]&&ps(E)&&(ae.tagNameCheck instanceof RegExp&&ye(ae.tagNameCheck,E)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(E)))return!1;if(bo&&!kt[E]){const j=W(u)||u.parentNode,ge=R(u)||u.childNodes;if(ge&&j){const fe=ge.length;for(let $e=fe-1;$e>=0;--$e){const Be=C(ge[$e],!0);Be.__removalCount=(u.__removalCount||0)+1,j.insertBefore(Be,F(u))}}}return Fe(u),!0}return u instanceof d&&!Sn(u)||(E==="noscript"||E==="noembed"||E==="noframes")&&ye(/<\/no(script|embed|frames)/i,u.innerHTML)?(Fe(u),!0):(St&&u.nodeType===ri.text&&(_=u.textContent,Ri([rt,nt,lt],j=>{_=oi(_,j," ")}),u.textContent!==_&&(ii(e.removed,{element:u.cloneNode()}),u.textContent=_)),Ge("afterSanitizeElements",u,null),!1)},hs=function(u,_,E){if(Ka&&(_==="id"||_==="name")&&(E in t||E in _n))return!1;if(!(fo&&!uo[_]&&ye(jt,_))){if(!(qa&&ye(qt,_))){if(!pe[_]||uo[_]){if(!(ps(u)&&(ae.tagNameCheck instanceof RegExp&&ye(ae.tagNameCheck,u)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(u))&&(ae.attributeNameCheck instanceof RegExp&&ye(ae.attributeNameCheck,_)||ae.attributeNameCheck instanceof Function&&ae.attributeNameCheck(_))||_==="is"&&ae.allowCustomizedBuiltInElements&&(ae.tagNameCheck instanceof RegExp&&ye(ae.tagNameCheck,E)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(E))))return!1}else if(!yo[_]){if(!ye(xt,oi(E,_t,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&u!=="script"&&rd(E,"data:")===0&&Za[u])){if(!(Qa&&!ye(Qt,oi(E,_t,"")))){if(E)return!1}}}}}}return!0},ps=function(u){return u!=="annotation-xml"&&Us(u,Gt)},us=function(u){Ge("beforeSanitizeAttributes",u,null);const{attributes:_}=u;if(!_)return;const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe};let j=_.length;for(;j--;){const ge=_[j],{name:fe,namespaceURI:$e,value:Be}=ge,Jt=ue(fe);let be=fe==="value"?Be:nd(Be);if(E.attrName=Jt,E.attrValue=be,E.keepAttr=!0,E.forceKeepAttr=void 0,Ge("uponSanitizeAttribute",u,E),be=E.attrValue,E.forceKeepAttr||(Ai(fe,u),!E.keepAttr))continue;if(!Ga&&ye(/\/>/i,be)){Ai(fe,u);continue}St&&Ri([rt,nt,lt],vs=>{be=oi(be,vs," ")});const fs=ue(u.nodeName);if(!!hs(fs,Jt,be)){if(Ya&&(Jt==="id"||Jt==="name")&&(Ai(fe,u),be=gn+be),vo&&ye(/((--!?|])>)|<\/(style|title)/i,be)){Ai(fe,u);continue}if(B&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!$e)switch(w.getAttributeType(fs,Jt)){case"TrustedHTML":{be=B.createHTML(be);break}case"TrustedScriptURL":{be=B.createScriptURL(be);break}}try{$e?u.setAttributeNS($e,fe,be):u.setAttribute(fe,be),ls(u)?Fe(u):Is(e.removed)}catch{}}}Ge("afterSanitizeAttributes",u,null)},$n=function z(u){let _=null;const E=ns(u);for(Ge("beforeSanitizeShadowDOM",u,null);_=E.nextNode();)Ge("uponSanitizeShadowNode",_,null),!cs(_)&&(_.content instanceof s&&z(_.content),us(_));Ge("afterSanitizeShadowDOM",u,null)};return e.sanitize=function(z){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,E=null,j=null,ge=null;if(wo=!z,wo&&(z=""),typeof z!="string"&&!ds(z))if(typeof z.toString=="function"){if(z=z.toString(),typeof z!="string")throw ai("dirty is not a string, aborting")}else throw ai("toString is not a function");if(!e.isSupported)return z;if(mo||xo(u),e.removed=[],typeof z=="string"&&(Xt=!1),Xt){if(z.nodeName){const Be=ue(z.nodeName);if(!ie[Be]||Yt[Be])throw ai("root node is forbidden and cannot be sanitized in-place")}}else if(z instanceof l)_=rs(""),E=_.ownerDocument.importNode(z,!0),E.nodeType===ri.element&&E.nodeName==="BODY"||E.nodeName==="HTML"?_=E:_.appendChild(E);else{if(!$t&&!St&&!dt&&z.indexOf("<")===-1)return B&&Mi?B.createHTML(z):z;if(_=rs(z),!_)return $t?null:Mi?Z:""}_&&go&&Fe(_.firstChild);const fe=ns(Xt?z:_);for(;j=fe.nextNode();)cs(j)||(j.content instanceof s&&$n(j.content),us(j));if(Xt)return z;if($t){if(Ei)for(ge=ee.call(_.ownerDocument);_.firstChild;)ge.appendChild(_.firstChild);else ge=_;return(pe.shadowroot||pe.shadowrootmode)&&(ge=Re.call(i,ge,!0)),ge}let $e=dt?_.outerHTML:_.innerHTML;return dt&&ie["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&ye(en,_.ownerDocument.doctype.name)&&($e="
+`+$e),St&&Ri([rt,nt,lt],Be=>{$e=oi($e,Be," ")}),B&&Mi?B.createHTML($e):$e},e.setConfig=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xo(z),mo=!0},e.clearConfig=function(){Et=null,mo=!1},e.isValidAttribute=function(z,u,_){Et||xo({});const E=ue(z),j=ue(u);return hs(E,j,_)},e.addHook=function(z,u){typeof u=="function"&&(Se[z]=Se[z]||[],ii(Se[z],u))},e.removeHook=function(z){if(Se[z])return Is(Se[z])},e.removeHooks=function(z){Se[z]&&(Se[z]=[])},e.removeAllHooks=function(){Se={}},e}var Ui=tn();let Yi=class extends ce{constructor(){super(...arguments),this.collectionLinks=[]}render(){return c`
+
+ ${this.classSize==="mobile"?this.mobileTemplate:this.desktopTemplate}
+
+ `}get mobileTemplate(){return c`
+
+
${this.imageBlockTemplate}
+
+
+
${this.titleTemplate}
+ ${this.iconRightTemplate}
+
+
+
+ ${this.detailsTemplate}
+ `}get desktopTemplate(){return c`
+ ${this.imageBlockTemplate}
+
+
+
${this.titleTemplate}
+ ${this.iconRightTemplate}
+
+ ${this.detailsTemplate}
+
+ `}get imageBlockTemplate(){if(!this.model)return b;const e=this.model.mediatype==="collection",t=this.displayValueProvider.itemPageUrl(this.model.identifier,e);return c`
+
+
+ `}get detailsTemplate(){return c`
+ ${this.itemLineTemplate} ${this.creatorTemplate}
+
+ ${this.datePublishedTemplate} ${this.dateSortByTemplate}
+ ${this.webArchivesCaptureDatesTemplate}
+
+
+ ${this.viewsTemplate} ${this.ratingTemplate} ${this.reviewsTemplate}
+
+ ${this.topicsTemplate} ${this.collectionsTemplate}
+ ${this.descriptionTemplate} ${this.textSnippetsTemplate}
+ ${this.reviewBlockTemplate}
+ `}get iconRightTemplate(){var e,t;return c`
+
+
+
+
+ `}get titleTemplate(){var e,t,i;return!((e=this.model)===null||e===void 0)&&e.title?!((t=this.model)===null||t===void 0)&&t.href?c`${(i=this.model.title)!==null&&i!==void 0?i:this.model.identifier}`:this.detailsLink(this.model.identifier,this.model.title,this.model.mediatype==="collection"):b}get itemLineTemplate(){const e=this.sourceTemplate,t=this.volumeTemplate,i=this.issueTemplate;return!e&&!t&&!i?b:c` ${e} ${t} ${i}
`}get sourceTemplate(){var e;return!((e=this.model)===null||e===void 0)&&e.source?c`
+
+ ${this.labelTemplate(k("Source"))}
+ ${this.searchLink("source",this.model.source)}
+
+ `:b}get volumeTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.volume,k("Volume"))}get issueTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.issue,k("Issue"))}get creatorTemplate(){var e,t,i;return((e=this.model)===null||e===void 0?void 0:e.mediatype)==="account"?c`
+
+ ${(t=this.displayValueProvider.accountLabel)!==null&&t!==void 0?t:b}
+
+ `:!(!((i=this.model)===null||i===void 0)&&i.creators)||this.model.creators.length===0?b:c`
+
+ ${this.labelTemplate(k("By"))}
+ ${Oi(gt(this.model.creators,o=>this.searchLink("creator",o)),", ")}
+
+ `}get datePublishedTemplate(){var e;const t=(e=this.model)===null||e===void 0?void 0:e.datePublished;let i="long";return Ua(t)&&(i="year-only"),this.metadataTemplate(vi(t,i),k("Published"))}get dateSortByTemplate(){return this.effectiveSort&&(this.effectiveSort.field==="addeddate"||this.effectiveSort.field==="reviewdate"||this.effectiveSort.field==="publicdate")?this.metadataTemplate(vi(this.date,"long"),this.displayValueProvider.dateLabel):b}get viewsTemplate(){var e,t,i,o;const s=((e=this.effectiveSort)===null||e===void 0?void 0:e.field)==="week"?(t=this.model)===null||t===void 0?void 0:t.weeklyViewCount:(i=this.model)===null||i===void 0?void 0:i.viewCount;return s==null?b:((o=this.model)===null||o===void 0?void 0:o.mediatype)==="search"?this.metadataTemplate("(Favorited search query)",""):this.metadataTemplate(`${ci(s,this.formatSize)}`,k("Views"))}get ratingTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.averageRating,k("Avg Rating"))}get reviewsTemplate(){var e;return this.metadataTemplate((e=this.model)===null||e===void 0?void 0:e.commentCount,k("Reviews"))}get topicsTemplate(){var e;return!(!((e=this.model)===null||e===void 0)&&e.subjects)||this.model.subjects.length===0?b:c`
+
+ ${this.labelTemplate(k("Topics"))}
+ ${Oi(gt(this.model.subjects,t=>this.searchLink("subject",t)),", ")}
+
+ `}get collectionsTemplate(){return!this.collectionLinks||this.collectionLinks.length===0?b:c`
+
+ ${this.labelTemplate(k("Collections"))}
+ ${Oi(this.collectionLinks,", ")}
+
+ `}get descriptionTemplate(){var e,t,i;return this.metadataTemplate(id(Ui.sanitize((i=(t=(e=this.model)===null||e===void 0?void 0:e.description)===null||t===void 0?void 0:t.replace(/\n/g," "))!==null&&i!==void 0?i:"")),"","description")}get reviewBlockTemplate(){var e;if(!(!((e=this.model)===null||e===void 0)&&e.review))return b;const{title:t,body:i,stars:o}=this.model.review;return c`
+
+
+ `}get textSnippetsTemplate(){var e;return this.hasSnippets?c``:b}get hasSnippets(){var e,t;return!!(!((t=(e=this.model)===null||e===void 0?void 0:e.snippets)===null||t===void 0)&&t.length)}get webArchivesCaptureDatesTemplate(){var e;return!(!((e=this.model)===null||e===void 0)&&e.captureDates)||!this.model.title?b:c`
+
+ ${gt(this.model.captureDates,t=>c`-
+ ${this.displayValueProvider.webArchivesCaptureLink(this.model.title,t)}
+
`)}
+
+ `}metadataTemplate(e,t="",i){return e?c`
+
+ ${this.labelTemplate(t)} ${e}
+
+ `:b}labelTemplate(e){return c` ${e?c`${e}: `:b}`}searchLink(e,t){if(!e||!t)return b;const i=encodeURIComponent(`${e}:"${t}"`);return c`
+ ${Ui.sanitize(t)}`}detailsLink(e,t,i=!1){if(!e)return b;const o=t!=null?t:e,s=this.displayValueProvider.itemPageUrl(e,i);return c` ${Ui.sanitize(o)} `}get mediatypeURL(){var e;if(this.baseNavigationUrl===void 0||!(!((e=this.model)===null||e===void 0)&&e.mediatype))return b;switch(this.model.mediatype){case"collection":return`${this.baseNavigationUrl}/search?query=mediatype:collection&sort=-downloads`;case"account":return b;default:return this.displayValueProvider.itemPageUrl(this.model.mediatype,!0)}}updated(e){(e.has("model")||e.has("collectionTitles"))&&this.buildCollectionLinks()}async buildCollectionLinks(){var e,t,i;if(!(!((e=this.model)===null||e===void 0)&&e.collections)||this.model.collections.length===0)return;this.collectionLinks=[];const o=[];for(const s of this.model.collections)!ro[s]&&!s.startsWith("fav-")&&o.push(this.detailsLink(s,(i=(t=this.collectionTitles)===null||t===void 0?void 0:t.get(s))!==null&&i!==void 0?i:s,!0));this.collectionLinks=o}get date(){var e,t,i,o,s;switch((e=this.effectiveSort)===null||e===void 0?void 0:e.field){case"date":return(t=this.model)===null||t===void 0?void 0:t.datePublished;case"reviewdate":return(i=this.model)===null||i===void 0?void 0:i.dateReviewed;case"addeddate":return(o=this.model)===null||o===void 0?void 0:o.dateAdded;default:return(s=this.model)===null||s===void 0?void 0:s.dateArchived}}get effectiveSort(){var e;return(e=this.sortParam)!==null&&e!==void 0?e:this.defaultSortParam}get classSize(){return this.mobileBreakpoint&&this.currentWidth&&this.currentWidth a {
+ display: inline-block;
+ }
+
+ #icon {
+ padding-top: 5px;
+ }
+
+ #description {
+ padding-top: 10px;
+ }
+
+ /* Top level container */
+ #list-line {
+ display: flex;
+ }
+
+ #list-line.mobile {
+ flex-direction: column;
+ }
+
+ #list-line.desktop {
+ column-gap: 10px;
+ }
+
+ #list-line-top {
+ display: flex;
+ column-gap: 7px;
+ }
+
+ #list-line-bottom {
+ padding-top: 4px;
+ }
+
+ #list-line-right,
+ #list-line-top,
+ #list-line-bottom {
+ width: 100%;
+ }
+
+ /*
+ * If the container becomes very tiny, don't let the thumbnail side take
+ * up too much space. Shouldn't make a difference on ordinary viewport sizes.
+ */
+ #list-line-left {
+ max-width: 25%;
+
+ display: flex;
+ flex-direction: column;
+ row-gap: 5px;
+ }
+
+ div a:hover {
+ text-decoration: underline;
+ }
+
+ /* Lines containing multiple div as row */
+ #item-line,
+ #dates-line,
+ #views-line,
+ #title-line {
+ display: flex;
+ flex-direction: row;
+ column-gap: 10px;
+ }
+
+ /*
+ * With the exception of the title line, allow these to wrap if
+ * the space becomes too small to accommodate them together.
+ *
+ * The title line is excluded because it contains the mediatype icon
+ * which we don't want to wrap.
+ */
+ #item-line,
+ #dates-line,
+ #views-line {
+ flex-wrap: wrap;
+ }
+
+ .capture-dates {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ }
+
+ .capture-dates a:link {
+ text-decoration: none;
+ color: var(--ia-theme-link-color, #4b64ff);
+ }
+ .capture-dates a:hover {
+ text-decoration: underline;
+ }
+ `}};r([h({type:Object})],Yi.prototype,"collectionTitles",void 0);r([P()],Yi.prototype,"collectionLinks",void 0);Yi=r([L("tile-list")],Yi);let Ve=class extends D{constructor(){super(...arguments),this.loggedIn=!1}render(){return c`
+
+ ${this.headerTemplate}
+
+
+
+
+ `}get headerTemplate(){var e,t,i,o;if(((e=this.model)===null||e===void 0?void 0:e.collections.length)===0)return b;let s="",n="";for(const l of((t=this.model)===null||t===void 0?void 0:t.collections)||[])if(!ro[l]&&!l.startsWith("fav-")){s=(o=(i=this.collectionTitles)===null||i===void 0?void 0:i.get(l))!==null&&o!==void 0?o:l,n=l;break}return n?c`
+
+ `:b}static get styles(){const e=v`var(--hoverPaneHeaderBGColor, #edf0ff)`,t=v`var(--ia-theme-link-color, #4b64ff)`,i=v`var(--ia-theme-base-font-family, "Helvetica Neue", Helvetica, Arial, sans-serif);`;return v`
+ :host {
+ visibility: hidden;
+ opacity: 0;
+ transform: translateY(8px);
+ transition: opacity 0.1s ease-in, transform 0.1s ease-in;
+ --image-width: auto;
+ }
+
+ :host(.visible) {
+ visibility: visible;
+ }
+
+ :host(.fade-in) {
+ opacity: 1;
+ transform: translateY(0);
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ :host {
+ transition-duration: 0.001s !important; /* Imperceptibly fast */
+ }
+ }
+
+ #container {
+ width: max-content;
+ max-width: min(45vw, 600px);
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.8);
+ background: white;
+ }
+
+ @media screen and (max-width: 600px) {
+ #container {
+ max-width: 80vw;
+ }
+ }
+
+ /* main tile-list container */
+ #hover-tile-list {
+ padding: 10px;
+ }
+
+ /* header on hover panel to show collection icon and title */
+ #list-line-header {
+ background: ${e};
+ }
+ #list-line-header a {
+ display: flex;
+ align-items: center;
+ column-gap: 5px;
+ height: 3.4rem;
+ padding: 0 10px;
+ width: fit-content;
+ font-size: 1.4rem;
+ color: ${t};
+ font-family: ${i};
+ text-decoration: none;
+ width: auto;
+ }
+ #list-line-header a span {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ #list-line-header a:hover {
+ text-decoration: underline;
+ }
+ #list-line-header a img {
+ width: 30px;
+ max-height: 30px;
+ }
+ `}};r([h({type:Object})],Ve.prototype,"model",void 0);r([h({type:String})],Ve.prototype,"baseNavigationUrl",void 0);r([h({type:String})],Ve.prototype,"baseImageUrl",void 0);r([h({type:Boolean})],Ve.prototype,"loggedIn",void 0);r([h({type:Object})],Ve.prototype,"sortParam",void 0);r([h({type:Number})],Ve.prototype,"mobileBreakpoint",void 0);r([h({type:Number})],Ve.prototype,"currentWidth",void 0);r([h({type:Object})],Ve.prototype,"collectionTitles",void 0);Ve=r([L("tile-hover-pane")],Ve);let qs=class extends ce{render(){var e,t,i,o,s,n;return c`
+
+ `}get href(){var e;return!(!((e=this.model)===null||e===void 0)&&e.identifier)||this.baseNavigationUrl==null?b:this.model.href?`${this.baseNavigationUrl}${this.model.href}`:this.displayValueProvider.itemPageUrl(this.model.identifier,this.model.mediatype==="collection")}get creator(){var e;return(e=this.displayValueProvider.firstCreatorMatchingFilter)!==null&&e!==void 0?e:b}get date(){var e,t,i,o,s;switch((e=this.effectiveSort)===null||e===void 0?void 0:e.field){case"publicdate":return(t=this.model)===null||t===void 0?void 0:t.dateArchived;case"reviewdate":return(i=this.model)===null||i===void 0?void 0:i.dateReviewed;case"addeddate":return(o=this.model)===null||o===void 0?void 0:o.dateAdded;default:return(s=this.model)===null||s===void 0?void 0:s.datePublished}}get views(){var e,t,i;return((e=this.effectiveSort)===null||e===void 0?void 0:e.field)==="week"?(t=this.model)===null||t===void 0?void 0:t.weeklyViewCount:(i=this.model)===null||i===void 0?void 0:i.viewCount}get effectiveSort(){var e;return(e=this.sortParam)!==null&&e!==void 0?e:this.defaultSortParam}get classSize(){return this.mobileBreakpoint&&this.currentWidth&&this.currentWidth