diff --git a/tify.css b/tify.css index 4a649b5b..f9d9987c 100644 --- a/tify.css +++ b/tify.css @@ -4,4 +4,4 @@ TIFY v0.31.0 AGPL-3.0 https://tify.rocks/ */ -.tify-toc-toggle,.tify-scan-reset,.tify-scan-page-button,.tify-scan-button,.tify-page-select-button,.tify-header-button,.tify-collection-link,.tify-toc-toggle-all,.tify-info-toggle,.tify-info-button,.tify-export-toggle,.tify-collection-reset{align-items:center;background:#f5f5f5 linear-gradient(to bottom,#fff7,#fff0);border-radius:var(--tify-border-radius, 2px);border:0;box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset;color:inherit;display:inline-flex;font:inherit;justify-content:center;padding:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5);text-align:center;-webkit-user-select:none;user-select:none;vertical-align:middle}.tify-toc-toggle:not(:disabled),.tify-scan-reset:not(:disabled),.tify-scan-page-button:not(:disabled),.tify-scan-button:not(:disabled),.tify-page-select-button:not(:disabled),.tify-header-button:not(:disabled),.tify-collection-link:not(:disabled),.tify-toc-toggle-all:not(:disabled),.tify-info-toggle:not(:disabled),.tify-info-button:not(:disabled),.tify-export-toggle:not(:disabled),.tify-collection-reset:not(:disabled){cursor:pointer}.tify-toc-toggle:not(:disabled):hover,.tify-scan-reset:not(:disabled):hover,.tify-scan-page-button:not(:disabled):hover,.tify-scan-button:not(:disabled):hover,.tify-page-select-button:not(:disabled):hover,.tify-header-button:not(:disabled):hover,.tify-collection-link:not(:disabled):hover,.tify-toc-toggle-all:not(:disabled):hover,.tify-info-toggle:not(:disabled):hover,.tify-info-button:not(:disabled):hover,.tify-export-toggle:not(:disabled):hover,.tify-collection-reset:not(:disabled):hover,.tify-toc-toggle:not(:disabled):focus,.tify-scan-reset:not(:disabled):focus,.tify-scan-page-button:not(:disabled):focus,.tify-scan-button:not(:disabled):focus,.tify-page-select-button:not(:disabled):focus,.tify-header-button:not(:disabled):focus,.tify-collection-link:not(:disabled):focus,.tify-toc-toggle-all:not(:disabled):focus,.tify-info-toggle:not(:disabled):focus,.tify-info-button:not(:disabled):focus,.tify-export-toggle:not(:disabled):focus,.tify-collection-reset:not(:disabled):focus,.tify-toc-toggle:not(:disabled):active,.tify-scan-reset:not(:disabled):active,.tify-scan-page-button:not(:disabled):active,.tify-scan-button:not(:disabled):active,.tify-page-select-button:not(:disabled):active,.tify-header-button:not(:disabled):active,.tify-collection-link:not(:disabled):active,.tify-toc-toggle-all:not(:disabled):active,.tify-info-toggle:not(:disabled):active,.tify-info-button:not(:disabled):active,.tify-export-toggle:not(:disabled):active,.tify-collection-reset:not(:disabled):active{background:#f5f5f5 linear-gradient(to bottom,#fff,#fff7)}.tify-toc-toggle:not(:disabled):active,.tify-scan-reset:not(:disabled):active,.tify-scan-page-button:not(:disabled):active,.tify-scan-button:not(:disabled):active,.tify-page-select-button:not(:disabled):active,.tify-header-button:not(:disabled):active,.tify-collection-link:not(:disabled):active,.tify-toc-toggle-all:not(:disabled):active,.tify-info-toggle:not(:disabled):active,.tify-info-button:not(:disabled):active,.tify-export-toggle:not(:disabled):active,.tify-collection-reset:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-toc-toggle:not(:disabled):focus-visible,.tify-scan-reset:not(:disabled):focus-visible,.tify-scan-page-button:not(:disabled):focus-visible,.tify-scan-button:not(:disabled):focus-visible,.tify-page-select-button:not(:disabled):focus-visible,.tify-header-button:not(:disabled):focus-visible,.tify-collection-link:not(:disabled):focus-visible,.tify-toc-toggle-all:not(:disabled):focus-visible,.tify-info-toggle:not(:disabled):focus-visible,.tify-info-button:not(:disabled):focus-visible,.tify-export-toggle:not(:disabled):focus-visible,.tify-collection-reset:not(:disabled):focus-visible{outline:2px solid var(--tify-base-color-light, #73abda);z-index:1}[disabled].tify-toc-toggle,[disabled].tify-scan-reset,[disabled].tify-scan-page-button,[disabled].tify-scan-button,[disabled].tify-page-select-button,[disabled].tify-header-button,[disabled].tify-collection-link,[disabled].tify-toc-toggle-all,[disabled].tify-info-toggle,[disabled].tify-info-button,[disabled].tify-export-toggle,[disabled].tify-collection-reset{opacity:.3}.tify-info-button.-active,.tify-header-button.-active,.tify-collection-item.-current .tify-collection-link{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff3,#fff0);color:#fff;z-index:1}.tify-info-button.-active:not(:disabled):hover,.tify-header-button.-active:not(:disabled):hover,.tify-collection-item.-current .tify-collection-link:not(:disabled):hover,.tify-info-button.-active:not(:disabled):focus,.tify-header-button.-active:not(:disabled):focus,.tify-collection-item.-current .tify-collection-link:not(:disabled):focus,.tify-info-button.-active:not(:disabled):active,.tify-header-button.-active:not(:disabled):active,.tify-collection-item.-current .tify-collection-link:not(:disabled):active{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff1,#0002);color:#fff}.tify-toc-toggle-all,.tify-info-toggle,.tify-info-button,.tify-export-toggle,.tify-collection-reset{font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));padding:0 calc(var(--tify-grid-base, 24px) * .5)}.tify-toc,.tify-thumbnails,.tify-scan,.tify-info,.tify-help,.tify-fulltext,.tify-export,.tify-collection{background:#fff;box-shadow:-1px 0 var(--tify-border-color, rgba(0, 0, 0, .2));flex:1;min-width:calc(var(--tify-grid-base, 24px) * 15);overflow-y:auto;padding:calc(var(--tify-grid-base, 24px) * .5);position:relative}.tify.-medium .tify-toc,.tify.-medium .tify-thumbnails,.tify.-medium .tify-scan,.tify.-medium .tify-info,.tify.-medium .tify-help,.tify.-medium .tify-fulltext,.tify.-medium .tify-export,.tify.-medium .tify-collection{border:0;bottom:0;min-width:0;position:absolute;top:0;width:100%;z-index:0}.tify-toc:first-child,.tify-thumbnails:first-child,.tify-scan:first-child,.tify-info:first-child,.tify-help:first-child,.tify-fulltext:first-child,.tify-export:first-child,.tify-collection:first-child{border:0}.-active.tify-toc,.-active.tify-thumbnails,.-active.tify-scan,.-active.tify-info,.-active.tify-help,.-active.tify-fulltext,.-active.tify-export,.-active.tify-collection{display:block}.-always-active.tify-toc,.-always-active.tify-thumbnails,.-always-active.tify-scan,.-always-active.tify-info,.-always-active.tify-help,.-always-active.tify-fulltext,.-always-active.tify-export,.-always-active.tify-collection{display:block!important}.tify{background:var(--tify-body-bg, #666 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAEElEQVQImWNgwAGkcElgAgAEogAbFZcwKQAAAABJRU5ErkJggg==));box-sizing:border-box;color:var(--tify-text-color, #333);display:flex;flex-direction:column;font-size:var(--tify-font-size, 16px);height:100%;line-height:var(--tify-line-height, var(--tify-grid-base, 24px));min-height:240px;min-width:240px;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,.1)}.tify *,.tify *:before,.tify *:after{box-sizing:inherit}.tify a{color:var(--tify-link-color, var(--tify-base-color, #06b));word-wrap:break-word}.tify a:hover,.tify a:focus,.tify a:active{color:var(--tify-link-hover-color, var(--tify-link-color, var(--tify-base-color, #06b)))}.tify a:focus-visible{outline:2px solid var(--tify-base-color-light, #73abda)}.tify h3{box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2));font-size:.75em;font-weight:700;letter-spacing:.1em;margin:0 0 calc(var(--tify-grid-base, 24px) * .5);color:var(--tify-text-muted-color, #666);padding:0;text-transform:uppercase}.tify h4{font-size:1em;font-weight:400;margin:0;color:var(--tify-text-muted-color, #666);padding:0}.tify h4:nth-of-type(n+2){margin-top:calc(var(--tify-grid-base, 24px) * .5)}.tify label{cursor:pointer;font-size:inherit;font-weight:400}.tify p{margin:0 0 calc(var(--tify-grid-base, 24px) * .5);padding:0}.tify [type=text]{background:#fff;border:1px solid rgba(0,0,0,.2);border-radius:var(--tify-border-radius, 2px);color:inherit;font:inherit;padding:calc(calc(var(--tify-grid-base, 24px) * .25) - 1px) .5em}.tify [type=text]:focus{border-color:var(--tify-base-color, #06b);outline:2px solid var(--tify-base-color-lighter, #e6f0f8)}.tify-collection{overflow-y:scroll;padding:calc(var(--tify-grid-base, 24px) * .5)}.tify-collection-controls{display:flex}.tify-collection-controls>:first-child{border-radius:var(--tify-border-radius, 2px) 0 0 var(--tify-border-radius, 2px)}.tify-collection-controls>:last-child{border-radius:0 var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) 0}.tify-collection-filter{flex:1;max-width:36em}.tify-collection-filter:focus{z-index:1}.tify-collection-list{list-style:none;margin:0;padding:0}.tify-collection-list .tify-collection-list{margin-left:var(--tify-grid-base, 24px);margin-top:calc(var(--tify-grid-base, 24px) * .25)}.tify-collection-list li{margin-bottom:calc(var(--tify-grid-base, 24px) * .25)}.tify-collection-link{color:inherit!important;display:block;padding:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5);text-align:left;text-decoration:none;width:100%}.tify-collection-link.-has-children{font-weight:700}.tify-collection-item.-current .tify-collection-link{color:#fff!important}.tify-collection-link .tify-icon{margin-left:calc(var(--tify-grid-base, 24px) * -.25)}.tify-collection-no-results{color:var(--tify-text-muted-color, #666)}.tify-collection-reset{margin-left:-1px;white-space:nowrap}.tify-error{background:#d22c;border-radius:0 var(--tify-border-radius, 2px) 0 0;bottom:0;color:#fff;display:flex;font-weight:700;max-height:50%;max-width:90%;position:absolute}.tify-error p{margin:0}.tify-error-close{align-self:flex-start;background:0;border:0;color:#fff;cursor:pointer;display:flex;padding:calc(var(--tify-grid-base, 24px) * .25)}.tify-error-close:hover,.tify-error-close:focus,.tify-error-close:active{background:#0000001a}.tify-error-messages{overflow:auto;padding:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5) calc(var(--tify-grid-base, 24px) * .25) 0}.tify-export-container{margin:calc(var(--tify-grid-base, 24px) * .5) 0 var(--tify-grid-base, 24px);position:relative}.tify-export-section{margin:0 0 var(--tify-grid-base, 24px)}.tify-export-toc{border:1px solid var(--tify-border-color, rgba(0, 0, 0, .2));border-radius:var(--tify-border-radius, 2px);margin:calc(var(--tify-grid-base, 24px) * .5) 0 0;padding:calc(var(--tify-grid-base, 24px) * .25);position:relative}.tify-export-toc h4{margin:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .75)}.tify-export-toc ul{margin:0 0 0 calc(var(--tify-grid-base, 24px) * .5);padding:0}.tify-export-toggle.-close{border-radius:0 var(--tify-border-radius, 2px);padding:calc(var(--tify-grid-base, 24px) * .25);position:absolute;right:0;z-index:1}.tify-fulltext{overflow-y:auto}.tify-fulltext-none{color:var(--tify-text-muted-color, #666);font-style:italic}.tify-fulltext-page{margin:0 0 var(--tify-grid-base, 24px)}.tify-fulltext-text{margin-left:1em;text-indent:-1em;word-break:break-word}.tify-fulltext-text p{margin:0 0 1em}.tify-header{background:var(--tify-header-bg, #f5f5f5);box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2));display:flex;flex-wrap:wrap;justify-content:space-between;z-index:9}.tify-header-button-group{align-items:center;display:flex;margin:calc(var(--tify-grid-base, 24px) * .25) 0;padding:0 calc(var(--tify-grid-base, 24px) * .25);position:relative}.tify-header-button-group.-page-select{align-self:center;box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset;border-radius:var(--tify-border-radius, 2px);margin:0 calc(var(--tify-grid-base, 24px) * .25);padding:0}.tify.-small .tify-header-button-group.-page-select{margin:0}.tify-header-button-group.-pagination{padding-left:0}.tify.-small .tify-header-button-group.-pagination{display:none}.tify-header-popup .tify-header-button-group.-pagination{box-shadow:0 -1px var(--tify-border-color, rgba(0, 0, 0, .2));display:none;margin:calc(var(--tify-border-radius, 2px) * 2 - 1px) 0 0;padding:var(--tify-border-radius, 2px) 0 0}.tify.-small .tify-header-popup .tify-header-button-group.-pagination{display:flex}.tify-header-button-group.-toggle{display:none}.tify.-large .tify-header-button-group.-toggle{display:flex}.tify-header-column:not(:nth-child(2)) .tify-header-button-group.-toggle{border-left:1px solid var(--tify-border-color, rgba(0, 0, 0, .2))}.tify.-small .tify-header-column:not(:nth-child(2)) .tify-header-button-group.-toggle{border:0}.tify.-large .tify-header-button-group.-view{display:block;margin:0;padding:0}.tify-header-button-group.-view:nth-child(n+2),.tify-header-column.-pagination~.tify-header-column .tify-header-button-group.-view{border-left:1px solid var(--tify-border-color, rgba(0, 0, 0, .2))}.tify.-large .tify-header-button-group.-view:nth-child(n+2),.tify.-large .tify-header-column.-pagination~.tify-header-column .tify-header-button-group.-view{border-left:0}.tify-header-button{align-self:center;background:none;border-radius:var(--tify-border-radius, 2px);border:0;box-shadow:none;margin:0;min-height:calc(var(--tify-grid-base, 24px) * 1.5);min-width:calc(var(--tify-grid-base, 24px) * 1.5);padding:0}.tify-header-button:not(:disabled):hover,.tify-header-button:not(:disabled):focus,.tify-header-button:not(:disabled):active{box-shadow:0 0 0 1px #0000001a inset}.tify-header-button:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px #0000001a inset}.tify-header-button.-icon-only{display:block;font-size:0!important}.tify.-large .tify-header-button.-icon-only{font-size:inherit!important}.tify-header-button.-scan{display:none!important}.tify.-medium .tify-header-button.-scan{display:block!important}.tify-header-button-group.-toggle .tify-header-button{padding:calc(var(--tify-grid-base, 24px) * .375)}.tify.-tiny .tify-header-button-group.-toggle .tify-header-button{margin:calc(var(--tify-grid-base, 24px) * .125) 0;padding:calc(var(--tify-grid-base, 24px) * .25)}.tify-header-button-group.-view .tify-header-button{font-size:.75em}.tify-header-button-group.-view .tify-header-button:not(.-icon-only){align-items:center;display:flex;flex-direction:column;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));line-height:1;min-height:calc(var(--tify-grid-base, 24px) * 1.75);min-width:calc(var(--tify-grid-base, 24px) * 1.75);padding:0 .5em 4px}.tify.-large .tify-header-button-group.-view .tify-header-button{align-items:flex-start;display:block;font:inherit;min-height:0;padding:calc(var(--tify-grid-base, 24px) * .25);text-align:left;width:100%}.tify-page-select+.tify-header-button{border-radius:0 var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) 0;margin-left:-1px}.tify-page-select+.tify-header-button:not(:disabled):hover,.tify-page-select+.tify-header-button:not(:disabled):focus,.tify-page-select+.tify-header-button:not(:disabled):active{box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-page-select+.tify-header-button:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-header-column{display:flex;flex-wrap:wrap;justify-content:space-between;min-width:0}.tify-header-column:first-child{flex:1}.tify-header-popup{display:flex}.tify.-large .tify-header-popup{background:#fff;border:var(--tify-border-radius, 2px) solid #fff;border-radius:var(--tify-border-radius, 2px);filter:drop-shadow(0 0 calc(var(--tify-grid-base, 24px) * .25) rgba(0,0,0,.5));min-width:6em;overflow:visible;position:absolute;text-shadow:none;z-index:9;margin:calc(var(--tify-grid-base, 24px) * .25) 0;left:auto;right:calc(var(--tify-grid-base, 24px) * .25);box-shadow:none;display:none;top:calc(var(--tify-grid-base, 24px) * 2)}.tify.-large .tify-header-popup:before{position:absolute;content:"";background:#fff;width:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * .5);transform:rotate(45deg);z-index:-1;bottom:auto;top:calc(calc(var(--tify-grid-base, 24px) * -.25) - var(--tify-border-radius, 2px));left:auto;right:calc(var(--tify-grid-base, 24px) * .5)}.tify.-large .tify-header-popup.-visible{display:block}.tify-header-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;align-self:center;display:-webkit-box;font-size:1em;font-weight:400;line-height:var(--tify-grid-base, 24px);margin:0;overflow:hidden;margin:calc(var(--tify-grid-base, 24px) * .125) calc(var(--tify-grid-base, 24px) * .5);text-align:left;text-overflow:ellipsis}.tify-help{overflow-y:auto}.tify-help-footer{box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));margin-top:var(--tify-grid-base, 24px);padding-top:calc(var(--tify-grid-base, 24px) * .5)}.tify-icon{fill:currentColor;height:24px;vertical-align:middle;width:24px}.tify-info{overflow-y:auto}.tify-info-button{border-radius:0}.tify-info-button:first-child{border-radius:var(--tify-border-radius, 2px) 0 0 var(--tify-border-radius, 2px)}.tify-info-button:last-child{border-radius:0 var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) 0}.tify-info-button+.tify-info-button{margin-left:-1px}.tify-info-content{position:relative}.tify-info-content.-collapsed{max-height:calc(var(--tify-grid-base, 24px) * 6.5)}.tify-info-header{display:inline-flex;margin:0 0 calc(var(--tify-grid-base, 24px) * .75);position:relative}.tify-info-logo{display:block;max-height:calc(var(--tify-grid-base, 24px) * 6);max-width:100%;height:auto;width:auto}.tify-info-metadata>div{margin-bottom:calc(var(--tify-grid-base, 24px) * .5)}.tify-info-section{margin:0 0 var(--tify-grid-base, 24px);word-break:break-word}.tify-info-section.-attribution img{display:block}.tify-info-section.-logo>a{border:0;box-shadow:none;display:inline-block}.tify-info-section.-title>p{font-weight:700}.tify-info-toggle{margin:calc(var(--tify-grid-base, 24px) * .5) 0;padding-left:calc(var(--tify-grid-base, 24px) * .25);position:relative}.tify-info-value>div:last-child>:last-child{margin-bottom:0}.tify-info-content.-collapsed .tify-info-value{max-height:calc(calc(var(--tify-grid-base, 24px) * 6.5) - calc(var(--tify-grid-base, 24px) * 2));overflow:hidden}.tify-info-content.-collapsed .tify-info-value:after{background:linear-gradient(#fff0,#fff);bottom:calc(var(--tify-grid-base, 24px) * 2);content:"";height:calc(var(--tify-grid-base, 24px) * 2);position:absolute;width:100%}.tify-list{margin:0 0 calc(var(--tify-grid-base, 24px) * .5);padding:0 0 0 var(--tify-grid-base, 24px)}.tify-list li{margin:0;padding:0}.tify-list li:only-child{list-style:none;margin-left:calc(var(--tify-grid-base, 24px) * -1)}.tify-loading{animation:fadeIn .5s forwards .5s,spin 1.2s infinite ease-in-out;background:var(--tify-base-color-light, #73abda);border-radius:var(--tify-border-radius, 2px);bottom:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * 1.5);left:calc(var(--tify-grid-base, 24px) * .5);opacity:0;pointer-events:none;position:absolute;width:calc(var(--tify-grid-base, 24px) * 1.5)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes spin{0%{transform:perspective(120px) rotateX(0) rotateY(0)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0)}to{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.tify-main{display:flex;flex:1;overflow:hidden;position:relative}.tify-page-select a{border:0;box-shadow:none}.tify-page-select-button{background:none;border-radius:var(--tify-border-radius, 2px) 0 0 var(--tify-border-radius, 2px);box-shadow:none;display:block;height:100%;max-width:calc(var(--tify-grid-base, 24px) * 10);min-width:calc(var(--tify-grid-base, 24px) * 3);overflow:hidden;padding:calc(var(--tify-grid-base, 24px) * .25) .5em;position:relative;text-overflow:ellipsis;white-space:nowrap}.tify-page-select-button:not(:disabled):hover,.tify-page-select-button:not(:disabled):focus,.tify-page-select-button:not(:disabled):active{box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-page-select-button:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify.-medium .tify-page-select-button{max-width:calc(var(--tify-grid-base, 24px) * 8)}.tify.-small .tify-page-select-button{max-width:calc(var(--tify-grid-base, 24px) * 6)}.tify.-tiny .tify-page-select-button{max-width:calc(var(--tify-grid-base, 24px) * 4)}.tify-page-select-dropdown{background:#fff;border:var(--tify-border-radius, 2px) solid #fff;border-radius:var(--tify-border-radius, 2px);filter:drop-shadow(0 0 calc(var(--tify-grid-base, 24px) * .25) rgba(0,0,0,.5));min-width:6em;overflow:visible;position:absolute;text-shadow:none;z-index:9;margin:calc(var(--tify-grid-base, 24px) * .25) 0;left:0;right:auto;max-width:100%;text-align:center}.tify-page-select-dropdown:before{position:absolute;content:"";background:#fff;width:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * .5);transform:rotate(45deg);z-index:-1;bottom:auto;top:calc(calc(var(--tify-grid-base, 24px) * -.25) - var(--tify-border-radius, 2px));left:calc(var(--tify-grid-base, 24px) * .5);right:auto}.tify.-small .tify-page-select-dropdown{left:0}.tify-page-select-filter{padding:var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) calc(var(--tify-border-radius, 2px) * 2)}.tify-page-select-input{width:100%}.tify-page-select-list{list-style:none;margin:0;max-height:calc(var(--tify-grid-base, 24px) * 11);min-width:100%;overflow-y:scroll;padding:0;position:relative}.tify-page-select-list>li{margin:0;-webkit-user-select:none;user-select:none}.tify-page-select-list>li+li{box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-page-select-list>li>a:hover,.tify-page-select-list>li>a:focus,.tify-page-select-list>li>a:active{background:#0000001a}.tify-page-select-list>li.-current>a{background:#0000001a}.tify-page-select-list>li.-highlighted>a{background:var(--tify-link-color, var(--tify-base-color, #06b));color:#fff}.tify-page-select-list a{color:inherit;display:block;padding:calc(var(--tify-grid-base, 24px) * .125) .5em;text-decoration:none}.tify-page-select-list a:hover,.tify-page-select-list a:focus,.tify-page-select-list a:active{color:inherit}.tify-scan{background:transparent;box-shadow:none;flex:3;padding:0;-webkit-user-select:none;user-select:none;z-index:0}.tify-scan-buttons{border-radius:var(--tify-border-radius, 2px);display:flex;flex-direction:column;left:calc(var(--tify-grid-base, 24px) * .25);position:absolute;top:calc(var(--tify-grid-base, 24px) * .25);z-index:9}.tify-scan-button{background:none;box-shadow:none;color:#fff;height:calc(var(--tify-grid-base, 24px) * 1.5);padding:0;position:relative;width:calc(var(--tify-grid-base, 24px) * 1.5)}.tify-scan-button:not(:disabled):hover,.tify-scan-button:not(:disabled):focus,.tify-scan-button:not(:disabled):active{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#0003}.tify-scan-button.-active:after{background:var(--tify-base-color, #06b);box-shadow:0 0 calc(var(--tify-grid-base, 24px) * .25) var(--tify-base-color-lighter, #e6f0f8);content:"";border-radius:50%;display:block;height:.5em;position:absolute;right:calc(var(--tify-grid-base, 24px) * .25);top:calc(var(--tify-grid-base, 24px) * .25);width:.5em}.tify-scan-button .tify-icon{filter:drop-shadow(0 0 2px rgba(0,0,0,.2)) drop-shadow(0 0 1px rgba(0,0,0,.5))}.tify-scan-filters{position:relative}.tify-scan-filters-popup{background:#fff;border:var(--tify-border-radius, 2px) solid #fff;border-radius:var(--tify-border-radius, 2px);filter:drop-shadow(0 0 calc(var(--tify-grid-base, 24px) * .25) rgba(0,0,0,.5));min-width:6em;overflow:visible;position:absolute;text-shadow:none;z-index:9;transform:translateY(-50%);left:0;right:auto;left:calc(var(--tify-grid-base, 24px) * 1.75);padding:calc(var(--tify-grid-base, 24px) * .5);top:calc(var(--tify-grid-base, 24px) * .75);width:calc(var(--tify-grid-base, 24px) * 10)}.tify-scan-filters-popup:before{position:absolute;content:"";background:#fff;width:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * .5);transform:rotate(45deg);z-index:-1;left:calc(calc(var(--tify-grid-base, 24px) * -.25) - var(--tify-border-radius, 2px));top:calc(50% - calc(var(--tify-grid-base, 24px) * .25))}.tify-scan-filters-popup label>b{float:right;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125))}.tify-scan-filters-popup>p{margin:0}.tify-scan-filters-popup>p+p{margin-top:calc(var(--tify-grid-base, 24px) * .5)}.tify-scan-image{height:100%;white-space:nowrap;width:100%}.tify-scan-image .openseadragon-canvas{outline:0}.tify-scan-page-button{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#fff6;border:0;box-shadow:0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2));height:calc(var(--tify-grid-base, 24px) * 2.5);margin-top:calc(var(--tify-grid-base, 24px) * -1.25);padding:0;position:absolute;top:50%;width:calc(var(--tify-grid-base, 24px) * 1.25);z-index:1}.tify.-short .tify-scan-page-button{bottom:0;height:calc(var(--tify-grid-base, 24px) * 1.75);width:calc(var(--tify-grid-base, 24px) * 1.75);top:auto}.tify-scan-page-button.-previous{border-radius:0 calc(var(--tify-grid-base, 24px) * 1.25) calc(var(--tify-grid-base, 24px) * 1.25) 0;left:0;justify-content:flex-start}.tify.-short .tify-scan-page-button.-previous{border-radius:0 calc(var(--tify-grid-base, 24px) * 1.75) 0 0;padding:calc(var(--tify-grid-base, 24px) * .375) 0 0 calc(var(--tify-grid-base, 24px) * .25)}.tify-scan-page-button.-next{border-radius:calc(var(--tify-grid-base, 24px) * 1.25) 0 0 calc(var(--tify-grid-base, 24px) * 1.25);right:0;justify-content:flex-end}.tify.-short .tify-scan-page-button.-next{border-radius:calc(var(--tify-grid-base, 24px) * 1.75) 0 0;padding:calc(var(--tify-grid-base, 24px) * .375) calc(var(--tify-grid-base, 24px) * .25) 0 0}.tify-scan-range{-webkit-appearance:none;margin:calc(var(--tify-grid-base, 24px) * .25) 0 calc(var(--tify-grid-base, 24px) * -.25);width:100%}.tify-scan-range::-webkit-slider-runnable-track{cursor:pointer;height:calc(var(--tify-grid-base, 24px) * .25);width:100%;background:var(--tify-border-color, rgba(0, 0, 0, .2));border-radius:var(--tify-border-radius, 2px);margin:0}.tify-scan-range::-webkit-slider-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff3,#fff0);border:0;border-radius:var(--tify-border-radius, 2px);cursor:pointer;height:var(--tify-grid-base, 24px);width:calc(var(--tify-grid-base, 24px) * .5);-webkit-appearance:none;margin-top:calc(calc(var(--tify-grid-base, 24px) * .25) * .5 - var(--tify-grid-base, 24px) * .5)}.tify-scan-range::-moz-range-track{cursor:pointer;height:calc(var(--tify-grid-base, 24px) * .25);width:100%;background:var(--tify-border-color, rgba(0, 0, 0, .2));border:0;border-radius:var(--tify-border-radius, 2px)}.tify-scan-range::-moz-range-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff3,#fff0);border:0;border-radius:var(--tify-border-radius, 2px);cursor:pointer;height:var(--tify-grid-base, 24px);width:calc(var(--tify-grid-base, 24px) * .5)}.tify-scan-range:focus::-webkit-slider-runnable-track{box-shadow:0 .5px 3px #0003 inset}.tify-scan-range:focus::-webkit-slider-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff1,#0002);box-shadow:0 .5px 3px #0003 inset}.tify-scan-range:focus::-moz-range-track{box-shadow:0 .5px 3px #0003 inset}.tify-scan-range:focus::-moz-range-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff1,#0002);box-shadow:0 .5px 3px #0003 inset}.tify-scan-reset{width:100%}.tify-sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.tify-thumbnails{min-height:100%;overflow-y:scroll;position:relative;-webkit-user-select:none;user-select:none}.tify-thumbnails a{color:inherit;border:0;box-shadow:none}.tify-thumbnails-list{margin:calc(var(--tify-grid-base, 24px) * -.25)}.tify-thumbnails-item{background:currentColor;border-radius:var(--tify-border-radius, 2px);cursor:pointer;float:left;margin:calc(var(--tify-grid-base, 24px) * .25);overflow:hidden;padding-bottom:var(--tify-grid-base, 24px);position:relative}.tify-thumbnails-item:hover,.tify-thumbnails-item:focus,.tify-thumbnails-item:active{background:currentColor;filter:brightness(1.2)}.tify-thumbnails-item img{display:block;height:var(--tify-thumbnail-height, calc(var(--tify-grid-base, 24px) * 4.5));margin:auto;object-fit:contain;pointer-events:none;max-width:100%;width:var(--tify-thumbnail-width, calc(var(--tify-grid-base, 24px) * 4))}.tify-thumbnails-item.-current{outline:calc(var(--tify-grid-base, 24px) * .1666666667) solid var(--tify-base-color-light, #73abda)}.tify-thumbnails-page{bottom:0;box-shadow:0 -1px #fff6;color:#fff;display:block;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));font-weight:700;height:var(--tify-grid-base, 24px);overflow:hidden;padding:0 calc(var(--tify-grid-base, 24px) * .25);position:absolute;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%}.tify-thumbnails-item.-current .tify-thumbnails-page{background:var(--tify-link-color, var(--tify-base-color, #06b))}.tify-toc-page,.tify-toc-label{background:#fff;position:relative;z-index:1}.tify-toc{overflow-y:auto;position:relative;z-index:0}.tify-toc-header{margin:0 calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5)}.tify-toc-label{padding-right:.2em;transition:inherit}.tify-toc-link{border-radius:var(--tify-border-radius, 2px);color:var(--tify-link-color, var(--tify-base-color, #06b));cursor:pointer;display:block;overflow:hidden;padding:calc(var(--tify-grid-base, 24px) * .25);position:relative;text-decoration:none}.tify-toc-link:hover,.tify-toc-link:focus,.tify-toc-link:active{background:var(--tify-base-color-lighter, #e6f0f8)}.tify-toc-link:hover>span,.tify-toc-link:focus>span,.tify-toc-link:active>span{background:var(--tify-base-color-lighter, #e6f0f8)}.tify-toc-link.-dots:after{bottom:calc(calc(var(--tify-grid-base, 24px) * .5) - 1px);content:"";left:calc(var(--tify-grid-base, 24px) * .25);min-width:4em;border-bottom:1px dotted;position:absolute;right:calc(var(--tify-grid-base, 24px) * .25)}.tify-toc-list{margin:0 0 calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .25);padding:0;position:relative;z-index:0}.tify-toc-list .tify-toc-list{margin:0 0 0 calc(var(--tify-grid-base, 24px) * 1.25)}.tify-toc-list a{border:0;box-shadow:none}.tify-toc-page{float:right;padding-left:.2em;transition:inherit;z-index:1}.tify-toc-structure{display:block;margin:0;position:relative}.tify-toc-structure.-current{box-shadow:calc(calc(var(--tify-grid-base, 24px) * -.5) + 1px) 0 #fff,calc(var(--tify-grid-base, 24px) * -.75) 0 var(--tify-base-color-light, #73abda)}.tify-toc-structure.-expanded:after{border-left:1px solid var(--tify-base-color-light, #73abda);content:"";left:calc(var(--tify-grid-base, 24px) * .75);height:100%;position:absolute;top:calc(var(--tify-grid-base, 24px) * .25);z-index:-2}.tify-toc-structure .tify-toc-structure:before{border-top:1px solid var(--tify-base-color-light, #73abda);content:"";display:block;height:100%;left:calc(var(--tify-grid-base, 24px) * -.5);position:absolute;top:calc(var(--tify-grid-base, 24px) * .75);width:calc(var(--tify-grid-base, 24px) * .5)}.tify-toc-structure .tify-toc-structure:not(.-current):last-child:before{background:#fff}.tify-toc-toggle-all{margin:calc(var(--tify-grid-base, 24px) * .25)}.tify-toc-toggle{float:left;margin:calc(var(--tify-grid-base, 24px) * .25) 0 0 calc(var(--tify-grid-base, 24px) * .25);padding:0;position:relative}.tify-toc-toggle:after{content:"";border-bottom:calc(var(--tify-grid-base, 24px) * .25) solid #fff;bottom:calc(var(--tify-grid-base, 24px) * -.25);left:calc(var(--tify-grid-base, 24px) * .5);pointer-events:none;position:absolute;width:1px;z-index:-1} +.tify-toc-toggle,.tify-scan-reset,.tify-scan-page-button,.tify-scan-button,.tify-page-select-button,.tify-header-button,.tify-collection-link,.tify-toc-toggle-all,.tify-info-toggle,.tify-info-button,.tify-export-toggle,.tify-collection-reset{align-items:center;background:#f5f5f5 linear-gradient(to bottom,#fff7,#fff0);border-radius:var(--tify-border-radius, 2px);border:0;box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset;color:inherit;display:inline-flex;font:inherit;justify-content:center;padding:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5);text-align:center;-webkit-user-select:none;user-select:none;vertical-align:middle}.tify-toc-toggle:not(:disabled),.tify-scan-reset:not(:disabled),.tify-scan-page-button:not(:disabled),.tify-scan-button:not(:disabled),.tify-page-select-button:not(:disabled),.tify-header-button:not(:disabled),.tify-collection-link:not(:disabled),.tify-toc-toggle-all:not(:disabled),.tify-info-toggle:not(:disabled),.tify-info-button:not(:disabled),.tify-export-toggle:not(:disabled),.tify-collection-reset:not(:disabled){cursor:pointer}.tify-toc-toggle:not(:disabled):hover,.tify-scan-reset:not(:disabled):hover,.tify-scan-page-button:not(:disabled):hover,.tify-scan-button:not(:disabled):hover,.tify-page-select-button:not(:disabled):hover,.tify-header-button:not(:disabled):hover,.tify-collection-link:not(:disabled):hover,.tify-toc-toggle-all:not(:disabled):hover,.tify-info-toggle:not(:disabled):hover,.tify-info-button:not(:disabled):hover,.tify-export-toggle:not(:disabled):hover,.tify-collection-reset:not(:disabled):hover,.tify-toc-toggle:not(:disabled):focus,.tify-scan-reset:not(:disabled):focus,.tify-scan-page-button:not(:disabled):focus,.tify-scan-button:not(:disabled):focus,.tify-page-select-button:not(:disabled):focus,.tify-header-button:not(:disabled):focus,.tify-collection-link:not(:disabled):focus,.tify-toc-toggle-all:not(:disabled):focus,.tify-info-toggle:not(:disabled):focus,.tify-info-button:not(:disabled):focus,.tify-export-toggle:not(:disabled):focus,.tify-collection-reset:not(:disabled):focus,.tify-toc-toggle:not(:disabled):active,.tify-scan-reset:not(:disabled):active,.tify-scan-page-button:not(:disabled):active,.tify-scan-button:not(:disabled):active,.tify-page-select-button:not(:disabled):active,.tify-header-button:not(:disabled):active,.tify-collection-link:not(:disabled):active,.tify-toc-toggle-all:not(:disabled):active,.tify-info-toggle:not(:disabled):active,.tify-info-button:not(:disabled):active,.tify-export-toggle:not(:disabled):active,.tify-collection-reset:not(:disabled):active{background:#f5f5f5 linear-gradient(to bottom,#fff,#fff7)}.tify-toc-toggle:not(:disabled):active,.tify-scan-reset:not(:disabled):active,.tify-scan-page-button:not(:disabled):active,.tify-scan-button:not(:disabled):active,.tify-page-select-button:not(:disabled):active,.tify-header-button:not(:disabled):active,.tify-collection-link:not(:disabled):active,.tify-toc-toggle-all:not(:disabled):active,.tify-info-toggle:not(:disabled):active,.tify-info-button:not(:disabled):active,.tify-export-toggle:not(:disabled):active,.tify-collection-reset:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-toc-toggle:not(:disabled):focus-visible,.tify-scan-reset:not(:disabled):focus-visible,.tify-scan-page-button:not(:disabled):focus-visible,.tify-scan-button:not(:disabled):focus-visible,.tify-page-select-button:not(:disabled):focus-visible,.tify-header-button:not(:disabled):focus-visible,.tify-collection-link:not(:disabled):focus-visible,.tify-toc-toggle-all:not(:disabled):focus-visible,.tify-info-toggle:not(:disabled):focus-visible,.tify-info-button:not(:disabled):focus-visible,.tify-export-toggle:not(:disabled):focus-visible,.tify-collection-reset:not(:disabled):focus-visible{outline:2px solid var(--tify-base-color-light, #73abda);z-index:1}[disabled].tify-toc-toggle,[disabled].tify-scan-reset,[disabled].tify-scan-page-button,[disabled].tify-scan-button,[disabled].tify-page-select-button,[disabled].tify-header-button,[disabled].tify-collection-link,[disabled].tify-toc-toggle-all,[disabled].tify-info-toggle,[disabled].tify-info-button,[disabled].tify-export-toggle,[disabled].tify-collection-reset{opacity:.3}.tify-info-button.-active,.tify-header-button.-active,.tify-collection-item.-current .tify-collection-link{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff3,#fff0);color:#fff;z-index:1}.tify-info-button.-active:not(:disabled):hover,.tify-header-button.-active:not(:disabled):hover,.tify-collection-item.-current .tify-collection-link:not(:disabled):hover,.tify-info-button.-active:not(:disabled):focus,.tify-header-button.-active:not(:disabled):focus,.tify-collection-item.-current .tify-collection-link:not(:disabled):focus,.tify-info-button.-active:not(:disabled):active,.tify-header-button.-active:not(:disabled):active,.tify-collection-item.-current .tify-collection-link:not(:disabled):active{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff1,#0002);color:#fff}.tify-toc-toggle-all,.tify-info-toggle,.tify-info-button,.tify-export-toggle,.tify-collection-reset{font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));padding:0 calc(var(--tify-grid-base, 24px) * .5)}.tify-toc,.tify-thumbnails,.tify-scan,.tify-info,.tify-help,.tify-fulltext,.tify-export,.tify-collection{background:#fff;box-shadow:-1px 0 var(--tify-border-color, rgba(0, 0, 0, .2));flex:1;min-width:calc(var(--tify-grid-base, 24px) * 15);overflow-y:auto;padding:calc(var(--tify-grid-base, 24px) * .5);position:relative}.tify.-medium .tify-toc,.tify.-medium .tify-thumbnails,.tify.-medium .tify-scan,.tify.-medium .tify-info,.tify.-medium .tify-help,.tify.-medium .tify-fulltext,.tify.-medium .tify-export,.tify.-medium .tify-collection{border:0;bottom:0;min-width:0;position:absolute;top:0;width:100%;z-index:0}.tify-toc:first-child,.tify-thumbnails:first-child,.tify-scan:first-child,.tify-info:first-child,.tify-help:first-child,.tify-fulltext:first-child,.tify-export:first-child,.tify-collection:first-child{border:0}.-active.tify-toc,.-active.tify-thumbnails,.-active.tify-scan,.-active.tify-info,.-active.tify-help,.-active.tify-fulltext,.-active.tify-export,.-active.tify-collection{display:block}.-always-active.tify-toc,.-always-active.tify-thumbnails,.-always-active.tify-scan,.-always-active.tify-info,.-always-active.tify-help,.-always-active.tify-fulltext,.-always-active.tify-export,.-always-active.tify-collection{display:block!important}.tify{background:var(--tify-body-bg, #666 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAEElEQVQImWNgwAGkcElgAgAEogAbFZcwKQAAAABJRU5ErkJggg==));box-sizing:border-box;color:var(--tify-text-color, #333);display:flex;flex-direction:column;font-size:var(--tify-font-size, 16px);height:100%;line-height:var(--tify-line-height, var(--tify-grid-base, 24px));min-height:240px;min-width:240px;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,.1)}.tify *,.tify *:before,.tify *:after{box-sizing:inherit}.tify a{color:var(--tify-link-color, var(--tify-base-color, #06b));word-wrap:break-word}.tify a:hover,.tify a:focus,.tify a:active{color:var(--tify-link-hover-color, var(--tify-link-color, var(--tify-base-color, #06b)))}.tify a:focus-visible{outline:2px solid var(--tify-base-color-light, #73abda)}.tify h3{box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2));font-size:.75em;font-weight:700;letter-spacing:.1em;margin:0 0 calc(var(--tify-grid-base, 24px) * .5);color:var(--tify-text-muted-color, #666);padding:0;text-transform:uppercase}.tify h4{font-size:1em;font-weight:400;margin:0;color:var(--tify-text-muted-color, #666);padding:0}.tify h4:nth-of-type(n+2){margin-top:calc(var(--tify-grid-base, 24px) * .5)}.tify label{cursor:pointer;font-size:inherit;font-weight:400}.tify p{margin:0 0 calc(var(--tify-grid-base, 24px) * .5);padding:0}.tify [type=text]{background:#fff;border:1px solid rgba(0,0,0,.2);border-radius:var(--tify-border-radius, 2px);color:inherit;font:inherit;padding:calc(calc(var(--tify-grid-base, 24px) * .25) - 1px) .5em}.tify [type=text]:focus{border-color:var(--tify-base-color, #06b);outline:2px solid var(--tify-base-color-lighter, #e6f0f8)}.tify-collection{overflow-y:scroll;padding:calc(var(--tify-grid-base, 24px) * .5)}.tify-collection-controls{display:flex}.tify-collection-controls>:first-child{border-radius:var(--tify-border-radius, 2px) 0 0 var(--tify-border-radius, 2px)}.tify-collection-controls>:last-child{border-radius:0 var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) 0}.tify-collection-filter{flex:1;max-width:36em}.tify-collection-filter:focus{z-index:1}.tify-collection-list{list-style:none;margin:0;padding:0}.tify-collection-list .tify-collection-list{margin-left:var(--tify-grid-base, 24px);margin-top:calc(var(--tify-grid-base, 24px) * .25)}.tify-collection-list li{margin-bottom:calc(var(--tify-grid-base, 24px) * .25)}.tify-collection-link{color:inherit!important;display:block;padding:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5);text-align:left;text-decoration:none;width:100%}.tify-collection-link.-has-children{font-weight:700}.tify-collection-item.-current .tify-collection-link{color:#fff!important}.tify-collection-link .tify-icon{margin-left:calc(var(--tify-grid-base, 24px) * -.25)}.tify-collection-no-results{color:var(--tify-text-muted-color, #666)}.tify-collection-reset{margin-left:-1px;white-space:nowrap}.tify-error{background:#d22c;border-radius:0 var(--tify-border-radius, 2px) 0 0;bottom:0;color:#fff;display:flex;font-weight:700;max-height:50%;max-width:90%;position:absolute}.tify-error p{margin:0}.tify-error-close{align-self:flex-start;background:0;border:0;color:#fff;cursor:pointer;display:flex;padding:calc(var(--tify-grid-base, 24px) * .25)}.tify-error-close:hover,.tify-error-close:focus,.tify-error-close:active{background:#0000001a}.tify-error-messages{overflow:auto;padding:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5) calc(var(--tify-grid-base, 24px) * .25) 0}.tify-export-container{margin:calc(var(--tify-grid-base, 24px) * .5) 0 var(--tify-grid-base, 24px);position:relative}.tify-export-section{margin:0 0 var(--tify-grid-base, 24px)}.tify-export-toc{border:1px solid var(--tify-border-color, rgba(0, 0, 0, .2));border-radius:var(--tify-border-radius, 2px);margin:calc(var(--tify-grid-base, 24px) * .5) 0 0;padding:calc(var(--tify-grid-base, 24px) * .25);position:relative}.tify-export-toc h4{margin:calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .75)}.tify-export-toc ul{margin:0 0 0 calc(var(--tify-grid-base, 24px) * .5);padding:0}.tify-export-toggle.-close{border-radius:0 var(--tify-border-radius, 2px);padding:calc(var(--tify-grid-base, 24px) * .25);position:absolute;right:0;z-index:1}.tify-fulltext{overflow-y:auto}.tify-fulltext-item{margin:0 calc(var(--tify-grid-base, 24px) * -.75);padding:0 calc(var(--tify-grid-base, 24px) * .5)}.tify-fulltext-item.-current{box-shadow:calc(var(--tify-grid-base, 24px) * -.25) 0 var(--tify-base-color-light, #73abda);color:var(--tify-link-color, var(--tify-base-color, #06b))}.tify-fulltext-toggle{border-radius:var(--tify-border-radius, 2px);cursor:pointer;display:block;padding:calc(var(--tify-grid-base, 24px) * .25);text-decoration:none;word-break:break-word}.tify-fulltext-toggle:hover,.tify-fulltext-toggle:focus,.tify-fulltext-toggle:active{background:var(--tify-base-color-lighter, #e6f0f8);color:var(--tify-link-color, var(--tify-base-color, #06b))}.tify-fulltext-toggle:hover>span,.tify-fulltext-toggle:focus>span,.tify-fulltext-toggle:active>span{background:var(--tify-base-color-lighter, #e6f0f8)}.tify-fulltext-toggle p{margin:0}.tify-fulltext-list{list-style:none;padding:0!important}.tify-fulltext-none{color:var(--tify-text-muted-color, #666);font-style:italic}.tify-fulltext-page{margin:0 calc(var(--tify-grid-base, 24px) * .25) var(--tify-grid-base, 24px) calc(var(--tify-grid-base, 24px) * .5)}.tify-header{background:var(--tify-header-bg, #f5f5f5);box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2));display:flex;flex-wrap:wrap;justify-content:space-between;z-index:9}.tify-header-button-group{align-items:center;display:flex;margin:calc(var(--tify-grid-base, 24px) * .25) 0;padding:0 calc(var(--tify-grid-base, 24px) * .25);position:relative}.tify-header-button-group.-page-select{align-self:center;box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset;border-radius:var(--tify-border-radius, 2px);margin:0 calc(var(--tify-grid-base, 24px) * .25);padding:0}.tify.-small .tify-header-button-group.-page-select{margin:0}.tify-header-button-group.-pagination{padding-left:0}.tify.-small .tify-header-button-group.-pagination{display:none}.tify-header-popup .tify-header-button-group.-pagination{box-shadow:0 -1px var(--tify-border-color, rgba(0, 0, 0, .2));display:none;margin:calc(var(--tify-border-radius, 2px) * 2 - 1px) 0 0;padding:var(--tify-border-radius, 2px) 0 0}.tify.-small .tify-header-popup .tify-header-button-group.-pagination{display:flex}.tify-header-button-group.-toggle{display:none}.tify.-large .tify-header-button-group.-toggle{display:flex}.tify-header-column:not(:nth-child(2)) .tify-header-button-group.-toggle{border-left:1px solid var(--tify-border-color, rgba(0, 0, 0, .2))}.tify.-small .tify-header-column:not(:nth-child(2)) .tify-header-button-group.-toggle{border:0}.tify.-large .tify-header-button-group.-view{display:block;margin:0;padding:0}.tify-header-button-group.-view:nth-child(n+2),.tify-header-column.-pagination~.tify-header-column .tify-header-button-group.-view{border-left:1px solid var(--tify-border-color, rgba(0, 0, 0, .2))}.tify.-large .tify-header-button-group.-view:nth-child(n+2),.tify.-large .tify-header-column.-pagination~.tify-header-column .tify-header-button-group.-view{border-left:0}.tify-header-button{align-self:center;background:none;border-radius:var(--tify-border-radius, 2px);border:0;box-shadow:none;margin:0;min-height:calc(var(--tify-grid-base, 24px) * 1.5);min-width:calc(var(--tify-grid-base, 24px) * 1.5);padding:0}.tify-header-button:not(:disabled):hover,.tify-header-button:not(:disabled):focus,.tify-header-button:not(:disabled):active{box-shadow:0 0 0 1px #0000001a inset}.tify-header-button:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px #0000001a inset}.tify-header-button.-icon-only{display:block;font-size:0!important}.tify.-large .tify-header-button.-icon-only{font-size:inherit!important}.tify-header-button.-scan{display:none!important}.tify.-medium .tify-header-button.-scan{display:block!important}.tify-header-button-group.-toggle .tify-header-button{padding:calc(var(--tify-grid-base, 24px) * .375)}.tify.-tiny .tify-header-button-group.-toggle .tify-header-button{margin:calc(var(--tify-grid-base, 24px) * .125) 0;padding:calc(var(--tify-grid-base, 24px) * .25)}.tify-header-button-group.-view .tify-header-button{font-size:.75em}.tify-header-button-group.-view .tify-header-button:not(.-icon-only){align-items:center;display:flex;flex-direction:column;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));line-height:1;min-height:calc(var(--tify-grid-base, 24px) * 1.75);min-width:calc(var(--tify-grid-base, 24px) * 1.75);padding:0 .5em 4px}.tify.-large .tify-header-button-group.-view .tify-header-button{align-items:flex-start;display:block;font:inherit;min-height:0;padding:calc(var(--tify-grid-base, 24px) * .25);text-align:left;width:100%}.tify-page-select+.tify-header-button{border-radius:0 var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) 0;margin-left:-1px}.tify-page-select+.tify-header-button:not(:disabled):hover,.tify-page-select+.tify-header-button:not(:disabled):focus,.tify-page-select+.tify-header-button:not(:disabled):active{box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-page-select+.tify-header-button:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-header-column{display:flex;flex-wrap:wrap;justify-content:space-between;min-width:0}.tify-header-column:first-child{flex:1}.tify-header-popup{display:flex}.tify.-large .tify-header-popup{background:#fff;border:var(--tify-border-radius, 2px) solid #fff;border-radius:var(--tify-border-radius, 2px);filter:drop-shadow(0 0 calc(var(--tify-grid-base, 24px) * .25) rgba(0,0,0,.5));min-width:6em;overflow:visible;position:absolute;text-shadow:none;z-index:9;margin:calc(var(--tify-grid-base, 24px) * .25) 0;left:auto;right:calc(var(--tify-grid-base, 24px) * .25);box-shadow:none;display:none;top:calc(var(--tify-grid-base, 24px) * 2)}.tify.-large .tify-header-popup:before{position:absolute;content:"";background:#fff;width:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * .5);transform:rotate(45deg);z-index:-1;bottom:auto;top:calc(calc(var(--tify-grid-base, 24px) * -.25) - var(--tify-border-radius, 2px));left:auto;right:calc(var(--tify-grid-base, 24px) * .5)}.tify.-large .tify-header-popup.-visible{display:block}.tify-header-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;align-self:center;display:-webkit-box;font-size:1em;font-weight:400;line-height:var(--tify-grid-base, 24px);margin:0;overflow:hidden;margin:calc(var(--tify-grid-base, 24px) * .125) calc(var(--tify-grid-base, 24px) * .5);text-align:left;text-overflow:ellipsis}.tify-help{overflow-y:auto}.tify-help-footer{box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));margin-top:var(--tify-grid-base, 24px);padding-top:calc(var(--tify-grid-base, 24px) * .5)}.tify-icon{fill:currentColor;height:24px;vertical-align:middle;width:24px}.tify-info{overflow-y:auto}.tify-info-button{border-radius:0}.tify-info-button:first-child{border-radius:var(--tify-border-radius, 2px) 0 0 var(--tify-border-radius, 2px)}.tify-info-button:last-child{border-radius:0 var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) 0}.tify-info-button+.tify-info-button{margin-left:-1px}.tify-info-content{position:relative}.tify-info-content.-collapsed{max-height:calc(var(--tify-grid-base, 24px) * 6.5)}.tify-info-header{display:inline-flex;margin:0 0 calc(var(--tify-grid-base, 24px) * .75);position:relative}.tify-info-logo{display:block;max-height:calc(var(--tify-grid-base, 24px) * 6);max-width:100%;height:auto;width:auto}.tify-info-metadata>div{margin-bottom:calc(var(--tify-grid-base, 24px) * .5)}.tify-info-section{margin:0 0 var(--tify-grid-base, 24px);word-break:break-word}.tify-info-section.-attribution img{display:block}.tify-info-section.-logo>a{border:0;box-shadow:none;display:inline-block}.tify-info-section.-title>p{font-weight:700}.tify-info-toggle{margin:calc(var(--tify-grid-base, 24px) * .5) 0;padding-left:calc(var(--tify-grid-base, 24px) * .25);position:relative}.tify-info-value>div:last-child>:last-child{margin-bottom:0}.tify-info-content.-collapsed .tify-info-value{max-height:calc(calc(var(--tify-grid-base, 24px) * 6.5) - calc(var(--tify-grid-base, 24px) * 2));overflow:hidden}.tify-info-content.-collapsed .tify-info-value:after{background:linear-gradient(#fff0,#fff);bottom:calc(var(--tify-grid-base, 24px) * 2);content:"";height:calc(var(--tify-grid-base, 24px) * 2);position:absolute;width:100%}.tify-list{margin:0 0 calc(var(--tify-grid-base, 24px) * .5);padding:0 0 0 var(--tify-grid-base, 24px)}.tify-list li{margin:0;padding:0}.tify-list li:only-child{list-style:none;margin-left:calc(var(--tify-grid-base, 24px) * -1)}.tify-loading{animation:fadeIn .5s forwards .5s,spin 1.2s infinite ease-in-out;background:var(--tify-base-color-light, #73abda);border-radius:var(--tify-border-radius, 2px);bottom:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * 1.5);left:calc(var(--tify-grid-base, 24px) * .5);opacity:0;pointer-events:none;position:absolute;width:calc(var(--tify-grid-base, 24px) * 1.5)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes spin{0%{transform:perspective(120px) rotateX(0) rotateY(0)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0)}to{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.tify-main{display:flex;flex:1;overflow:hidden;position:relative}.tify-page-select a{border:0;box-shadow:none}.tify-page-select-button{background:none;border-radius:var(--tify-border-radius, 2px) 0 0 var(--tify-border-radius, 2px);box-shadow:none;display:block;height:100%;max-width:calc(var(--tify-grid-base, 24px) * 10);min-width:calc(var(--tify-grid-base, 24px) * 3);overflow:hidden;padding:calc(var(--tify-grid-base, 24px) * .25) .5em;position:relative;text-overflow:ellipsis;white-space:nowrap}.tify-page-select-button:not(:disabled):hover,.tify-page-select-button:not(:disabled):focus,.tify-page-select-button:not(:disabled):active{box-shadow:0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-page-select-button:not(:disabled):active{box-shadow:0 .5px 3px #0003 inset,0 0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify.-medium .tify-page-select-button{max-width:calc(var(--tify-grid-base, 24px) * 8)}.tify.-small .tify-page-select-button{max-width:calc(var(--tify-grid-base, 24px) * 6)}.tify.-tiny .tify-page-select-button{max-width:calc(var(--tify-grid-base, 24px) * 4)}.tify-page-select-dropdown{background:#fff;border:var(--tify-border-radius, 2px) solid #fff;border-radius:var(--tify-border-radius, 2px);filter:drop-shadow(0 0 calc(var(--tify-grid-base, 24px) * .25) rgba(0,0,0,.5));min-width:6em;overflow:visible;position:absolute;text-shadow:none;z-index:9;margin:calc(var(--tify-grid-base, 24px) * .25) 0;left:0;right:auto;max-width:100%;text-align:center}.tify-page-select-dropdown:before{position:absolute;content:"";background:#fff;width:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * .5);transform:rotate(45deg);z-index:-1;bottom:auto;top:calc(calc(var(--tify-grid-base, 24px) * -.25) - var(--tify-border-radius, 2px));left:calc(var(--tify-grid-base, 24px) * .5);right:auto}.tify.-small .tify-page-select-dropdown{left:0}.tify-page-select-filter{padding:var(--tify-border-radius, 2px) var(--tify-border-radius, 2px) calc(var(--tify-border-radius, 2px) * 2)}.tify-page-select-input{width:100%}.tify-page-select-list{list-style:none;margin:0;max-height:calc(var(--tify-grid-base, 24px) * 11);min-width:100%;overflow-y:scroll;padding:0;position:relative}.tify-page-select-list>li{margin:0;-webkit-user-select:none;user-select:none}.tify-page-select-list>li+li{box-shadow:0 1px var(--tify-border-color, rgba(0, 0, 0, .2)) inset}.tify-page-select-list>li>a:hover,.tify-page-select-list>li>a:focus,.tify-page-select-list>li>a:active{background:#0000001a}.tify-page-select-list>li.-current>a{background:#0000001a}.tify-page-select-list>li.-highlighted>a{background:var(--tify-link-color, var(--tify-base-color, #06b));color:#fff}.tify-page-select-list a{color:inherit;display:block;padding:calc(var(--tify-grid-base, 24px) * .125) .5em;text-decoration:none}.tify-page-select-list a:hover,.tify-page-select-list a:focus,.tify-page-select-list a:active{color:inherit}.tify-scan{background:transparent;box-shadow:none;flex:3;padding:0;-webkit-user-select:none;user-select:none;z-index:0}.tify-scan-buttons{border-radius:var(--tify-border-radius, 2px);display:flex;flex-direction:column;left:calc(var(--tify-grid-base, 24px) * .25);position:absolute;top:calc(var(--tify-grid-base, 24px) * .25);z-index:9}.tify-scan-button{background:none;box-shadow:none;color:#fff;height:calc(var(--tify-grid-base, 24px) * 1.5);padding:0;position:relative;width:calc(var(--tify-grid-base, 24px) * 1.5)}.tify-scan-button:not(:disabled):hover,.tify-scan-button:not(:disabled):focus,.tify-scan-button:not(:disabled):active{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#0003}.tify-scan-button.-active:after{background:var(--tify-base-color, #06b);box-shadow:0 0 calc(var(--tify-grid-base, 24px) * .25) var(--tify-base-color-lighter, #e6f0f8);border-radius:50%;content:"";display:block;height:.5em;position:absolute;right:calc(var(--tify-grid-base, 24px) * .25);top:calc(var(--tify-grid-base, 24px) * .25);width:.5em}.tify-scan-button .tify-icon{filter:drop-shadow(0 0 2px rgba(0,0,0,.2)) drop-shadow(0 0 1px rgba(0,0,0,.5))}.tify-scan-filters{position:relative}.tify-scan-filters-popup{background:#fff;border:var(--tify-border-radius, 2px) solid #fff;border-radius:var(--tify-border-radius, 2px);filter:drop-shadow(0 0 calc(var(--tify-grid-base, 24px) * .25) rgba(0,0,0,.5));min-width:6em;overflow:visible;position:absolute;text-shadow:none;z-index:9;transform:translateY(-50%);left:0;right:auto;left:calc(var(--tify-grid-base, 24px) * 1.75);padding:calc(var(--tify-grid-base, 24px) * .5);top:calc(var(--tify-grid-base, 24px) * .75);width:calc(var(--tify-grid-base, 24px) * 10)}.tify-scan-filters-popup:before{position:absolute;content:"";background:#fff;width:calc(var(--tify-grid-base, 24px) * .5);height:calc(var(--tify-grid-base, 24px) * .5);transform:rotate(45deg);z-index:-1;left:calc(calc(var(--tify-grid-base, 24px) * -.25) - var(--tify-border-radius, 2px));top:calc(50% - calc(var(--tify-grid-base, 24px) * .25))}.tify-scan-filters-popup label>b{float:right;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125))}.tify-scan-filters-popup>p{margin:0}.tify-scan-filters-popup>p+p{margin-top:calc(var(--tify-grid-base, 24px) * .5)}.tify-scan-image{height:100%;white-space:nowrap;width:100%}.tify-scan-image .openseadragon-canvas{outline:0}.tify-scan-overlay{border-radius:var(--tify-border-radius, 2px);box-shadow:0 0 0 1px var(--tify-link-color, var(--tify-base-color, #06b)),0 0 0 1.5px #fff6;cursor:pointer}.tify-scan-overlay:hover,.tify-scan-overlay:focus,.tify-scan-overlay:active{-webkit-backdrop-filter:contrast(120%);backdrop-filter:contrast(120%);background:#0000001a;z-index:1}.tify-scan-overlay.-current{background:none;-webkit-backdrop-filter:invert(100%) brightness(120%);backdrop-filter:invert(100%) brightness(120%)}.tify-scan-page-button{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#fff6;border:0;box-shadow:0 0 1px var(--tify-border-color, rgba(0, 0, 0, .2));height:calc(var(--tify-grid-base, 24px) * 2.5);margin-top:calc(var(--tify-grid-base, 24px) * -1.25);padding:0;position:absolute;top:50%;width:calc(var(--tify-grid-base, 24px) * 1.25);z-index:1}.tify.-short .tify-scan-page-button{bottom:0;height:calc(var(--tify-grid-base, 24px) * 1.75);width:calc(var(--tify-grid-base, 24px) * 1.75);top:auto}.tify-scan-page-button.-previous{border-radius:0 calc(var(--tify-grid-base, 24px) * 1.25) calc(var(--tify-grid-base, 24px) * 1.25) 0;left:0;justify-content:flex-start}.tify.-short .tify-scan-page-button.-previous{border-radius:0 calc(var(--tify-grid-base, 24px) * 1.75) 0 0;padding:calc(var(--tify-grid-base, 24px) * .375) 0 0 calc(var(--tify-grid-base, 24px) * .25)}.tify-scan-page-button.-next{border-radius:calc(var(--tify-grid-base, 24px) * 1.25) 0 0 calc(var(--tify-grid-base, 24px) * 1.25);right:0;justify-content:flex-end}.tify.-short .tify-scan-page-button.-next{border-radius:calc(var(--tify-grid-base, 24px) * 1.75) 0 0;padding:calc(var(--tify-grid-base, 24px) * .375) calc(var(--tify-grid-base, 24px) * .25) 0 0}.tify-scan-range{-webkit-appearance:none;margin:calc(var(--tify-grid-base, 24px) * .25) 0 calc(var(--tify-grid-base, 24px) * -.25);width:100%}.tify-scan-range::-webkit-slider-runnable-track{cursor:pointer;height:calc(var(--tify-grid-base, 24px) * .25);width:100%;background:var(--tify-border-color, rgba(0, 0, 0, .2));border-radius:var(--tify-border-radius, 2px);margin:0}.tify-scan-range::-webkit-slider-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff3,#fff0);border:0;border-radius:var(--tify-border-radius, 2px);cursor:pointer;height:var(--tify-grid-base, 24px);width:calc(var(--tify-grid-base, 24px) * .5);-webkit-appearance:none;margin-top:calc(calc(var(--tify-grid-base, 24px) * .25) * .5 - var(--tify-grid-base, 24px) * .5)}.tify-scan-range::-moz-range-track{cursor:pointer;height:calc(var(--tify-grid-base, 24px) * .25);width:100%;background:var(--tify-border-color, rgba(0, 0, 0, .2));border:0;border-radius:var(--tify-border-radius, 2px)}.tify-scan-range::-moz-range-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff3,#fff0);border:0;border-radius:var(--tify-border-radius, 2px);cursor:pointer;height:var(--tify-grid-base, 24px);width:calc(var(--tify-grid-base, 24px) * .5)}.tify-scan-range:focus::-webkit-slider-runnable-track{box-shadow:0 .5px 3px #0003 inset}.tify-scan-range:focus::-webkit-slider-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff1,#0002);box-shadow:0 .5px 3px #0003 inset}.tify-scan-range:focus::-moz-range-track{box-shadow:0 .5px 3px #0003 inset}.tify-scan-range:focus::-moz-range-thumb{background:var(--tify-link-color, var(--tify-base-color, #06b)) linear-gradient(to bottom,#fff1,#0002);box-shadow:0 .5px 3px #0003 inset}.tify-scan-reset{width:100%}.tify-sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.tify-thumbnails{min-height:100%;overflow-y:scroll;position:relative;-webkit-user-select:none;user-select:none}.tify-thumbnails a{color:inherit;border:0;box-shadow:none}.tify-thumbnails-list{margin:calc(var(--tify-grid-base, 24px) * -.25)}.tify-thumbnails-item{background:currentColor;border-radius:var(--tify-border-radius, 2px);cursor:pointer;float:left;margin:calc(var(--tify-grid-base, 24px) * .25);overflow:hidden;padding-bottom:var(--tify-grid-base, 24px);position:relative}.tify-thumbnails-item:hover,.tify-thumbnails-item:focus,.tify-thumbnails-item:active{background:currentColor;filter:brightness(1.2)}.tify-thumbnails-item img{display:block;height:var(--tify-thumbnail-height, calc(var(--tify-grid-base, 24px) * 4.5));margin:auto;object-fit:contain;pointer-events:none;max-width:100%;width:var(--tify-thumbnail-width, calc(var(--tify-grid-base, 24px) * 4))}.tify-thumbnails-item.-current{outline:calc(var(--tify-grid-base, 24px) * .1666666667) solid var(--tify-base-color-light, #73abda)}.tify-thumbnails-page{bottom:0;box-shadow:0 -1px #fff6;color:#fff;display:block;font-size:var(--tify-font-size-small, calc(var(--tify-font-size, 16px) * .8125));font-weight:700;height:var(--tify-grid-base, 24px);overflow:hidden;padding:0 calc(var(--tify-grid-base, 24px) * .25);position:absolute;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%}.tify-thumbnails-item.-current .tify-thumbnails-page{background:var(--tify-link-color, var(--tify-base-color, #06b))}.tify-toc-page,.tify-toc-label{background:#fff;position:relative;z-index:1}.tify-toc{overflow-y:auto;position:relative;z-index:0}.tify-toc-header{margin:0 calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .5)}.tify-toc-label{padding-right:.2em;transition:inherit}.tify-toc-link{border-radius:var(--tify-border-radius, 2px);color:var(--tify-link-color, var(--tify-base-color, #06b));cursor:pointer;display:block;overflow:hidden;padding:calc(var(--tify-grid-base, 24px) * .25);position:relative;text-decoration:none}.tify-toc-link:hover,.tify-toc-link:focus,.tify-toc-link:active{background:var(--tify-base-color-lighter, #e6f0f8)}.tify-toc-link:hover>span,.tify-toc-link:focus>span,.tify-toc-link:active>span{background:var(--tify-base-color-lighter, #e6f0f8)}.tify-toc-link.-dots:after{bottom:calc(calc(var(--tify-grid-base, 24px) * .5) - 1px);content:"";left:calc(var(--tify-grid-base, 24px) * .25);min-width:4em;border-bottom:1px dotted;position:absolute;right:calc(var(--tify-grid-base, 24px) * .25)}.tify-toc-list{margin:0 0 calc(var(--tify-grid-base, 24px) * .25) calc(var(--tify-grid-base, 24px) * .25);padding:0;position:relative;z-index:0}.tify-toc-list .tify-toc-list{margin:0 0 0 calc(var(--tify-grid-base, 24px) * 1.25)}.tify-toc-list a{border:0;box-shadow:none}.tify-toc-page{float:right;padding-left:.2em;transition:inherit;z-index:1}.tify-toc-structure{display:block;margin:0;position:relative}.tify-toc-structure.-current{box-shadow:calc(calc(var(--tify-grid-base, 24px) * -.5) + 1px) 0 #fff,calc(var(--tify-grid-base, 24px) * -.75) 0 var(--tify-base-color-light, #73abda)}.tify-toc-structure.-expanded:after{border-left:1px solid var(--tify-base-color-light, #73abda);content:"";left:calc(var(--tify-grid-base, 24px) * .75);height:100%;position:absolute;top:calc(var(--tify-grid-base, 24px) * .25);z-index:-2}.tify-toc-structure .tify-toc-structure:before{border-top:1px solid var(--tify-base-color-light, #73abda);content:"";display:block;height:100%;left:calc(var(--tify-grid-base, 24px) * -.5);position:absolute;top:calc(var(--tify-grid-base, 24px) * .75);width:calc(var(--tify-grid-base, 24px) * .5)}.tify-toc-structure .tify-toc-structure:not(.-current):last-child:before{background:#fff}.tify-toc-toggle-all{margin:calc(var(--tify-grid-base, 24px) * .25)}.tify-toc-toggle{float:left;margin:calc(var(--tify-grid-base, 24px) * .25) 0 0 calc(var(--tify-grid-base, 24px) * .25);padding:0;position:relative}.tify-toc-toggle:after{content:"";border-bottom:calc(var(--tify-grid-base, 24px) * .25) solid #fff;bottom:calc(var(--tify-grid-base, 24px) * -.25);left:calc(var(--tify-grid-base, 24px) * .5);pointer-events:none;position:absolute;width:1px;z-index:-1} diff --git a/tify.js b/tify.js index 2e9aacb0..bb16f0a2 100644 --- a/tify.js +++ b/tify.js @@ -8,22 +8,22 @@ https://tify.rocks/ * @vue/shared v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function nn(t,n){const e=new Set(t.split(","));return n?i=>e.has(i.toLowerCase()):i=>e.has(i)}const _e={},At=[],Ve=()=>{},jr=()=>!1,gi=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),sn=t=>t.startsWith("onUpdate:"),Re=Object.assign,rn=(t,n)=>{const e=t.indexOf(n);e>-1&&t.splice(e,1)},Wr=Object.prototype.hasOwnProperty,ge=(t,n)=>Wr.call(t,n),ce=Array.isArray,kt=t=>mi(t)==="[object Map]",ys=t=>mi(t)==="[object Set]",de=t=>typeof t=="function",Se=t=>typeof t=="string",Rt=t=>typeof t=="symbol",xe=t=>t!==null&&typeof t=="object",ws=t=>(xe(t)||de(t))&&de(t.then)&&de(t.catch),_s=Object.prototype.toString,mi=t=>_s.call(t),Gr=t=>mi(t).slice(8,-1),Ts=t=>mi(t)==="[object Object]",on=t=>Se(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ut=nn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),vi=t=>{const n=Object.create(null);return e=>n[e]||(n[e]=t(e))},qr=/-(\w)/g,Ye=vi(t=>t.replace(qr,(n,e)=>e?e.toUpperCase():"")),Zr=/\B([A-Z])/g,Lt=vi(t=>t.replace(Zr,"-$1").toLowerCase()),yi=vi(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ci=vi(t=>t?`on${yi(t)}`:""),Pt=(t,n)=>!Object.is(t,n),ni=(t,n)=>{for(let e=0;e{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,writable:i,value:e})},Bi=t=>{const n=parseFloat(t);return isNaN(n)?t:n};let Mn;const bs=()=>Mn||(Mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function an(t){if(ce(t)){const n={};for(let e=0;e{if(e){const i=e.split(Xr);i.length>1&&(n[i[0].trim()]=i[1].trim())}}),n}function Te(t){let n="";if(Se(t))n=t;else if(ce(t))for(let e=0;eSe(t)?t:t==null?"":ce(t)||xe(t)&&(t.toString===_s||!de(t.toString))?JSON.stringify(t,Es,2):String(t),Es=(t,n)=>n&&n.__v_isRef?Es(t,n.value):kt(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((e,[i,s],r)=>(e[Ri(i,r)+" =>"]=s,e),{})}:ys(n)?{[`Set(${n.size})`]:[...n.values()].map(e=>Ri(e))}:Rt(n)?Ri(n):xe(n)&&!ce(n)&&!Ts(n)?String(n):n,Ri=(t,n="")=>{var e;return Rt(t)?`Symbol(${(e=t.description)!=null?e:n})`:t};/** +**//*! #__NO_SIDE_EFFECTS__ */function sn(t,n){const e=new Set(t.split(","));return n?i=>e.has(i.toLowerCase()):i=>e.has(i)}const Te={},kt=[],Ne=()=>{},Gr=()=>!1,pi=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),rn=t=>t.startsWith("onUpdate:"),Re=Object.assign,on=(t,n)=>{const e=t.indexOf(n);e>-1&&t.splice(e,1)},qr=Object.prototype.hasOwnProperty,ge=(t,n)=>qr.call(t,n),ce=Array.isArray,It=t=>gi(t)==="[object Map]",_s=t=>gi(t)==="[object Set]",de=t=>typeof t=="function",Se=t=>typeof t=="string",Rt=t=>typeof t=="symbol",xe=t=>t!==null&&typeof t=="object",Ts=t=>(xe(t)||de(t))&&de(t.then)&&de(t.catch),xs=Object.prototype.toString,gi=t=>xs.call(t),Zr=t=>gi(t).slice(8,-1),bs=t=>gi(t)==="[object Object]",an=t=>Se(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ut=sn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mi=t=>{const n=Object.create(null);return e=>n[e]||(n[e]=t(e))},Kr=/-(\w)/g,Je=mi(t=>t.replace(Kr,(n,e)=>e?e.toUpperCase():"")),Xr=/\B([A-Z])/g,Lt=mi(t=>t.replace(Xr,"-$1").toLowerCase()),vi=mi(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ci=mi(t=>t?`on${vi(t)}`:""),Pt=(t,n)=>!Object.is(t,n),ni=(t,n)=>{for(let e=0;e{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,writable:i,value:e})},zi=t=>{const n=parseFloat(t);return isNaN(n)?t:n};let Dn;const Ss=()=>Dn||(Dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ln(t){if(ce(t)){const n={};for(let e=0;e{if(e){const i=e.split(Jr);i.length>1&&(n[i[0].trim()]=i[1].trim())}}),n}function _e(t){let n="";if(Se(t))n=t;else if(ce(t))for(let e=0;eSe(t)?t:t==null?"":ce(t)||xe(t)&&(t.toString===xs||!de(t.toString))?JSON.stringify(t,Cs,2):String(t),Cs=(t,n)=>n&&n.__v_isRef?Cs(t,n.value):It(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((e,[i,s],r)=>(e[Ri(i,r)+" =>"]=s,e),{})}:_s(n)?{[`Set(${n.size})`]:[...n.values()].map(e=>Ri(e))}:Rt(n)?Ri(n):xe(n)&&!ce(n)&&!bs(n)?String(n):n,Ri=(t,n="")=>{var e;return Rt(t)?`Symbol(${(e=t.description)!=null?e:n})`:t};/** * @vue/reactivity v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let je;class eo{constructor(n=!1){this.detached=n,this._active=!0,this.effects=[],this.cleanups=[],this.parent=je,!n&&je&&(this.index=(je.scopes||(je.scopes=[])).push(this)-1)}get active(){return this._active}run(n){if(this._active){const e=je;try{return je=this,n()}finally{je=e}}}on(){je=this}off(){je=this.parent}stop(n){if(this._active){let e,i;for(e=0,i=this.effects.length;e=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),pt()}return this._dirtyLevel>=4}set dirty(n){this._dirtyLevel=n?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let n=ht,e=St;try{return ht=!0,St=this,this._runnings++,Dn(this),this.fn()}finally{An(this),this._runnings--,St=e,ht=n}}stop(){this.active&&(Dn(this),An(this),this.onStop&&this.onStop(),this.active=!1)}}function no(t){return t.value}function Dn(t){t._trackId++,t._depsLength=0}function An(t){if(t.deps.length>t._depsLength){for(let n=t._depsLength;n{const e=new Map;return e.cleanup=t,e.computed=n,e},Vi=new WeakMap,Et=Symbol(""),Ui=Symbol("");function ze(t,n,e){if(ht&&St){let i=Vi.get(t);i||Vi.set(t,i=new Map);let s=i.get(e);s||i.set(e,s=Hs(()=>i.delete(e))),Rs(St,s)}}function et(t,n,e,i,s,r){const o=Vi.get(t);if(!o)return;let l=[];if(n==="clear")l=[...o.values()];else if(e==="length"&&ce(t)){const a=Number(i);o.forEach((c,h)=>{(h==="length"||!Rt(h)&&h>=a)&&l.push(c)})}else switch(e!==void 0&&l.push(o.get(e)),n){case"add":ce(t)?on(e)&&l.push(o.get("length")):(l.push(o.get(Et)),kt(t)&&l.push(o.get(Ui)));break;case"delete":ce(t)||(l.push(o.get(Et)),kt(t)&&l.push(o.get(Ui)));break;case"set":kt(t)&&l.push(o.get(Et));break}cn();for(const a of l)a&&Ls(a,4);un()}const so=nn("__proto__,__v_isRef,__isVue"),Os=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Rt)),kn=ro();function ro(){const t={};return["includes","indexOf","lastIndexOf"].forEach(n=>{t[n]=function(...e){const i=we(this);for(let r=0,o=this.length;r{t[n]=function(...e){dt(),cn();const i=we(this)[n].apply(this,e);return un(),pt(),i}}),t}function oo(t){Rt(t)||(t=String(t));const n=we(this);return ze(n,"has",t),n.hasOwnProperty(t)}class Ms{constructor(n=!1,e=!1){this._isReadonly=n,this._isShallow=e}get(n,e,i){const s=this._isReadonly,r=this._isShallow;if(e==="__v_isReactive")return!s;if(e==="__v_isReadonly")return s;if(e==="__v_isShallow")return r;if(e==="__v_raw")return i===(s?r?_o:Fs:r?ks:As).get(n)||Object.getPrototypeOf(n)===Object.getPrototypeOf(i)?n:void 0;const o=ce(n);if(!s){if(o&&ge(kn,e))return Reflect.get(kn,e,i);if(e==="hasOwnProperty")return oo}const l=Reflect.get(n,e,i);return(Rt(e)?Os.has(e):so(e))||(s||ze(n,"get",e),r)?l:Ne(l)?o&&on(e)?l:l.value:xe(l)?s?Is(l):_i(l):l}}class Ds extends Ms{constructor(n=!1){super(!1,n)}set(n,e,i,s){let r=n[e];if(!this._isShallow){const a=li(r);if(!ji(i)&&!li(i)&&(r=we(r),i=we(i)),!ce(n)&&Ne(r)&&!Ne(i))return a?!1:(r.value=i,!0)}const o=ce(n)&&on(e)?Number(e)t,wi=t=>Reflect.getPrototypeOf(t);function Jt(t,n,e=!1,i=!1){t=t.__v_raw;const s=we(t),r=we(n);e||(Pt(n,r)&&ze(s,"get",n),ze(s,"get",r));const{has:o}=wi(s),l=i?hn:e?gn:pn;if(o.call(s,n))return l(t.get(n));if(o.call(s,r))return l(t.get(r));t!==s&&t.get(n)}function Qt(t,n=!1){const e=this.__v_raw,i=we(e),s=we(t);return n||(Pt(t,s)&&ze(i,"has",t),ze(i,"has",s)),t===s?e.has(t):e.has(t)||e.has(s)}function $t(t,n=!1){return t=t.__v_raw,!n&&ze(we(t),"iterate",Et),Reflect.get(t,"size",t)}function Fn(t){t=we(t);const n=we(this);return wi(n).has.call(n,t)||(n.add(t),et(n,"add",t,t)),this}function In(t,n){n=we(n);const e=we(this),{has:i,get:s}=wi(e);let r=i.call(e,t);r||(t=we(t),r=i.call(e,t));const o=s.call(e,t);return e.set(t,n),r?Pt(n,o)&&et(e,"set",t,n):et(e,"add",t,n),this}function Bn(t){const n=we(this),{has:e,get:i}=wi(n);let s=e.call(n,t);s||(t=we(t),s=e.call(n,t)),i&&i.call(n,t);const r=n.delete(t);return s&&et(n,"delete",t,void 0),r}function zn(){const t=we(this),n=t.size!==0,e=t.clear();return n&&et(t,"clear",void 0,void 0),e}function ei(t,n){return function(i,s){const r=this,o=r.__v_raw,l=we(o),a=n?hn:t?gn:pn;return!t&&ze(l,"iterate",Et),o.forEach((c,h)=>i.call(s,a(c),a(h),r))}}function ti(t,n,e){return function(...i){const s=this.__v_raw,r=we(s),o=kt(r),l=t==="entries"||t===Symbol.iterator&&o,a=t==="keys"&&o,c=s[t](...i),h=e?hn:n?gn:pn;return!n&&ze(r,"iterate",a?Ui:Et),{next(){const{value:p,done:m}=c.next();return m?{value:p,done:m}:{value:l?[h(p[0]),h(p[1])]:h(p),done:m}},[Symbol.iterator](){return this}}}}function at(t){return function(...n){return t==="delete"?!1:t==="clear"?void 0:this}}function ho(){const t={get(r){return Jt(this,r)},get size(){return $t(this)},has:Qt,add:Fn,set:In,delete:Bn,clear:zn,forEach:ei(!1,!1)},n={get(r){return Jt(this,r,!1,!0)},get size(){return $t(this)},has:Qt,add:Fn,set:In,delete:Bn,clear:zn,forEach:ei(!1,!0)},e={get(r){return Jt(this,r,!0)},get size(){return $t(this,!0)},has(r){return Qt.call(this,r,!0)},add:at("add"),set:at("set"),delete:at("delete"),clear:at("clear"),forEach:ei(!0,!1)},i={get(r){return Jt(this,r,!0,!0)},get size(){return $t(this,!0)},has(r){return Qt.call(this,r,!0)},add:at("add"),set:at("set"),delete:at("delete"),clear:at("clear"),forEach:ei(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=ti(r,!1,!1),e[r]=ti(r,!0,!1),n[r]=ti(r,!1,!0),i[r]=ti(r,!0,!0)}),[t,e,n,i]}const[fo,po,go,mo]=ho();function fn(t,n){const e=n?t?mo:go:t?po:fo;return(i,s,r)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?i:Reflect.get(ge(e,s)&&s in i?e:i,s,r)}const vo={get:fn(!1,!1)},yo={get:fn(!1,!0)},wo={get:fn(!0,!1)};const As=new WeakMap,ks=new WeakMap,Fs=new WeakMap,_o=new WeakMap;function To(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xo(t){return t.__v_skip||!Object.isExtensible(t)?0:To(Gr(t))}function _i(t){return li(t)?t:dn(t,!1,lo,vo,As)}function bo(t){return dn(t,!1,uo,yo,ks)}function Is(t){return dn(t,!0,co,wo,Fs)}function dn(t,n,e,i,s){if(!xe(t)||t.__v_raw&&!(n&&t.__v_isReactive))return t;const r=s.get(t);if(r)return r;const o=xo(t);if(o===0)return t;const l=new Proxy(t,o===2?i:e);return s.set(t,l),l}function jt(t){return li(t)?jt(t.__v_raw):!!(t&&t.__v_isReactive)}function li(t){return!!(t&&t.__v_isReadonly)}function ji(t){return!!(t&&t.__v_isShallow)}function Bs(t){return t?!!t.__v_raw:!1}function we(t){const n=t&&t.__v_raw;return n?we(n):t}function So(t){return Object.isExtensible(t)&&xs(t,"__v_skip",!0),t}const pn=t=>xe(t)?_i(t):t,gn=t=>xe(t)?Is(t):t;class zs{constructor(n,e,i,s){this.getter=n,this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ln(()=>n(this._value),()=>Li(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=i}get value(){const n=we(this);return(!n._cacheable||n.effect.dirty)&&Pt(n._value,n._value=n.effect.run())&&Li(n,4),Po(n),n.effect._dirtyLevel>=2&&Li(n,2),n._value}set value(n){this._setter(n)}get _dirty(){return this.effect.dirty}set _dirty(n){this.effect.dirty=n}}function Eo(t,n,e=!1){let i,s;const r=de(t);return r?(i=t,s=Ve):(i=t.get,s=t.set),new zs(i,s,r||!s,e)}function Po(t){var n;ht&&St&&(t=we(t),Rs(St,(n=t.dep)!=null?n:t.dep=Hs(()=>t.dep=void 0,t instanceof zs?t:void 0)))}function Li(t,n=4,e){t=we(t);const i=t.dep;i&&Ls(i,n)}function Ne(t){return!!(t&&t.__v_isRef===!0)}function Co(t){return Ne(t)?t.value:t}const Ro={get:(t,n,e)=>Co(Reflect.get(t,n,e)),set:(t,n,e,i)=>{const s=t[n];return Ne(s)&&!Ne(e)?(s.value=e,!0):Reflect.set(t,n,e,i)}};function Ns(t){return jt(t)?t:new Proxy(t,Ro)}/** +**/let je;class io{constructor(n=!1){this.detached=n,this._active=!0,this.effects=[],this.cleanups=[],this.parent=je,!n&&je&&(this.index=(je.scopes||(je.scopes=[])).push(this)-1)}get active(){return this._active}run(n){if(this._active){const e=je;try{return je=this,n()}finally{je=e}}}on(){je=this}off(){je=this.parent}stop(n){if(this._active){let e,i;for(e=0,i=this.effects.length;e=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),pt()}return this._dirtyLevel>=4}set dirty(n){this._dirtyLevel=n?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let n=ht,e=Et;try{return ht=!0,Et=this,this._runnings++,An(this),this.fn()}finally{kn(this),this._runnings--,Et=e,ht=n}}stop(){this.active&&(An(this),kn(this),this.onStop&&this.onStop(),this.active=!1)}}function ro(t){return t.value}function An(t){t._trackId++,t._depsLength=0}function kn(t){if(t.deps.length>t._depsLength){for(let n=t._depsLength;n{const e=new Map;return e.cleanup=t,e.computed=n,e},Ui=new WeakMap,St=Symbol(""),ji=Symbol("");function ze(t,n,e){if(ht&&Et){let i=Ui.get(t);i||Ui.set(t,i=new Map);let s=i.get(e);s||i.set(e,s=Ms(()=>i.delete(e))),Hs(Et,s)}}function et(t,n,e,i,s,r){const o=Ui.get(t);if(!o)return;let l=[];if(n==="clear")l=[...o.values()];else if(e==="length"&&ce(t)){const a=Number(i);o.forEach((c,h)=>{(h==="length"||!Rt(h)&&h>=a)&&l.push(c)})}else switch(e!==void 0&&l.push(o.get(e)),n){case"add":ce(t)?an(e)&&l.push(o.get("length")):(l.push(o.get(St)),It(t)&&l.push(o.get(ji)));break;case"delete":ce(t)||(l.push(o.get(St)),It(t)&&l.push(o.get(ji)));break;case"set":It(t)&&l.push(o.get(St));break}un();for(const a of l)a&&Os(a,4);hn()}const oo=sn("__proto__,__v_isRef,__isVue"),Ds=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Rt)),In=ao();function ao(){const t={};return["includes","indexOf","lastIndexOf"].forEach(n=>{t[n]=function(...e){const i=we(this);for(let r=0,o=this.length;r{t[n]=function(...e){dt(),un();const i=we(this)[n].apply(this,e);return hn(),pt(),i}}),t}function lo(t){Rt(t)||(t=String(t));const n=we(this);return ze(n,"has",t),n.hasOwnProperty(t)}class As{constructor(n=!1,e=!1){this._isReadonly=n,this._isShallow=e}get(n,e,i){const s=this._isReadonly,r=this._isShallow;if(e==="__v_isReactive")return!s;if(e==="__v_isReadonly")return s;if(e==="__v_isShallow")return r;if(e==="__v_raw")return i===(s?r?xo:Bs:r?Fs:Is).get(n)||Object.getPrototypeOf(n)===Object.getPrototypeOf(i)?n:void 0;const o=ce(n);if(!s){if(o&&ge(In,e))return Reflect.get(In,e,i);if(e==="hasOwnProperty")return lo}const l=Reflect.get(n,e,i);return(Rt(e)?Ds.has(e):oo(e))||(s||ze(n,"get",e),r)?l:Ve(l)?o&&an(e)?l:l.value:xe(l)?s?zs(l):wi(l):l}}class ks extends As{constructor(n=!1){super(!1,n)}set(n,e,i,s){let r=n[e];if(!this._isShallow){const a=li(r);if(!Wi(i)&&!li(i)&&(r=we(r),i=we(i)),!ce(n)&&Ve(r)&&!Ve(i))return a?!1:(r.value=i,!0)}const o=ce(n)&&an(e)?Number(e)t,yi=t=>Reflect.getPrototypeOf(t);function Jt(t,n,e=!1,i=!1){t=t.__v_raw;const s=we(t),r=we(n);e||(Pt(n,r)&&ze(s,"get",n),ze(s,"get",r));const{has:o}=yi(s),l=i?fn:e?mn:gn;if(o.call(s,n))return l(t.get(n));if(o.call(s,r))return l(t.get(r));t!==s&&t.get(n)}function Qt(t,n=!1){const e=this.__v_raw,i=we(e),s=we(t);return n||(Pt(t,s)&&ze(i,"has",t),ze(i,"has",s)),t===s?e.has(t):e.has(t)||e.has(s)}function $t(t,n=!1){return t=t.__v_raw,!n&&ze(we(t),"iterate",St),Reflect.get(t,"size",t)}function Fn(t){t=we(t);const n=we(this);return yi(n).has.call(n,t)||(n.add(t),et(n,"add",t,t)),this}function Bn(t,n){n=we(n);const e=we(this),{has:i,get:s}=yi(e);let r=i.call(e,t);r||(t=we(t),r=i.call(e,t));const o=s.call(e,t);return e.set(t,n),r?Pt(n,o)&&et(e,"set",t,n):et(e,"add",t,n),this}function zn(t){const n=we(this),{has:e,get:i}=yi(n);let s=e.call(n,t);s||(t=we(t),s=e.call(n,t)),i&&i.call(n,t);const r=n.delete(t);return s&&et(n,"delete",t,void 0),r}function Vn(){const t=we(this),n=t.size!==0,e=t.clear();return n&&et(t,"clear",void 0,void 0),e}function ei(t,n){return function(i,s){const r=this,o=r.__v_raw,l=we(o),a=n?fn:t?mn:gn;return!t&&ze(l,"iterate",St),o.forEach((c,h)=>i.call(s,a(c),a(h),r))}}function ti(t,n,e){return function(...i){const s=this.__v_raw,r=we(s),o=It(r),l=t==="entries"||t===Symbol.iterator&&o,a=t==="keys"&&o,c=s[t](...i),h=e?fn:n?mn:gn;return!n&&ze(r,"iterate",a?ji:St),{next(){const{value:p,done:m}=c.next();return m?{value:p,done:m}:{value:l?[h(p[0]),h(p[1])]:h(p),done:m}},[Symbol.iterator](){return this}}}}function at(t){return function(...n){return t==="delete"?!1:t==="clear"?void 0:this}}function po(){const t={get(r){return Jt(this,r)},get size(){return $t(this)},has:Qt,add:Fn,set:Bn,delete:zn,clear:Vn,forEach:ei(!1,!1)},n={get(r){return Jt(this,r,!1,!0)},get size(){return $t(this)},has:Qt,add:Fn,set:Bn,delete:zn,clear:Vn,forEach:ei(!1,!0)},e={get(r){return Jt(this,r,!0)},get size(){return $t(this,!0)},has(r){return Qt.call(this,r,!0)},add:at("add"),set:at("set"),delete:at("delete"),clear:at("clear"),forEach:ei(!0,!1)},i={get(r){return Jt(this,r,!0,!0)},get size(){return $t(this,!0)},has(r){return Qt.call(this,r,!0)},add:at("add"),set:at("set"),delete:at("delete"),clear:at("clear"),forEach:ei(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=ti(r,!1,!1),e[r]=ti(r,!0,!1),n[r]=ti(r,!1,!0),i[r]=ti(r,!0,!0)}),[t,e,n,i]}const[go,mo,vo,yo]=po();function dn(t,n){const e=n?t?yo:vo:t?mo:go;return(i,s,r)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?i:Reflect.get(ge(e,s)&&s in i?e:i,s,r)}const wo={get:dn(!1,!1)},_o={get:dn(!1,!0)},To={get:dn(!0,!1)};const Is=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,xo=new WeakMap;function bo(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Eo(t){return t.__v_skip||!Object.isExtensible(t)?0:bo(Zr(t))}function wi(t){return li(t)?t:pn(t,!1,uo,wo,Is)}function So(t){return pn(t,!1,fo,_o,Fs)}function zs(t){return pn(t,!0,ho,To,Bs)}function pn(t,n,e,i,s){if(!xe(t)||t.__v_raw&&!(n&&t.__v_isReactive))return t;const r=s.get(t);if(r)return r;const o=Eo(t);if(o===0)return t;const l=new Proxy(t,o===2?i:e);return s.set(t,l),l}function jt(t){return li(t)?jt(t.__v_raw):!!(t&&t.__v_isReactive)}function li(t){return!!(t&&t.__v_isReadonly)}function Wi(t){return!!(t&&t.__v_isShallow)}function Vs(t){return t?!!t.__v_raw:!1}function we(t){const n=t&&t.__v_raw;return n?we(n):t}function Po(t){return Object.isExtensible(t)&&Es(t,"__v_skip",!0),t}const gn=t=>xe(t)?wi(t):t,mn=t=>xe(t)?zs(t):t;class Ns{constructor(n,e,i,s){this.getter=n,this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new cn(()=>n(this._value),()=>Li(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=i}get value(){const n=we(this);return(!n._cacheable||n.effect.dirty)&&Pt(n._value,n._value=n.effect.run())&&Li(n,4),Ro(n),n.effect._dirtyLevel>=2&&Li(n,2),n._value}set value(n){this._setter(n)}get _dirty(){return this.effect.dirty}set _dirty(n){this.effect.dirty=n}}function Co(t,n,e=!1){let i,s;const r=de(t);return r?(i=t,s=Ne):(i=t.get,s=t.set),new Ns(i,s,r||!s,e)}function Ro(t){var n;ht&&Et&&(t=we(t),Hs(Et,(n=t.dep)!=null?n:t.dep=Ms(()=>t.dep=void 0,t instanceof Ns?t:void 0)))}function Li(t,n=4,e){t=we(t);const i=t.dep;i&&Os(i,n)}function Ve(t){return!!(t&&t.__v_isRef===!0)}function Lo(t){return Ve(t)?t.value:t}const Ho={get:(t,n,e)=>Lo(Reflect.get(t,n,e)),set:(t,n,e,i)=>{const s=t[n];return Ve(s)&&!Ve(e)?(s.value=e,!0):Reflect.set(t,n,e,i)}};function Us(t){return jt(t)?t:new Proxy(t,Ho)}/** * @vue/runtime-core v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function ft(t,n,e,i){try{return i?t(...i):t()}catch(s){Ti(s,n,e)}}function Ge(t,n,e,i){if(de(t)){const s=ft(t,n,e,i);return s&&ws(s)&&s.catch(r=>{Ti(r,n,e)}),s}if(ce(t)){const s=[];for(let r=0;r>>1,s=He[i],r=Kt(s);rXe&&He.splice(n,1)}function Mo(t){ce(t)?Ft.push(...t):(!lt||!lt.includes(t,t.allowRecurse?_t+1:_t))&&Ft.push(t),js()}function Nn(t,n,e=Zt?Xe+1:0){for(;eKt(e)-Kt(i));if(Ft.length=0,lt){lt.push(...n);return}for(lt=n,_t=0;_tt.id==null?1/0:t.id,Do=(t,n)=>{const e=Kt(t)-Kt(n);if(e===0){if(t.pre&&!n.pre)return-1;if(n.pre&&!t.pre)return 1}return e};function Gs(t){Wi=!1,Zt=!0,He.sort(Do);try{for(Xe=0;XeSe(T)?T.trim():T)),p&&(s=e.map(Bi))}let l,a=i[l=Ci(n)]||i[l=Ci(Ye(n))];!a&&r&&(a=i[l=Ci(Lt(n))]),a&&Ge(a,t,6,s);const c=i[l+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,Ge(c,t,6,s)}}function qs(t,n,e=!1){const i=n.emitsCache,s=i.get(t);if(s!==void 0)return s;const r=t.emits;let o={},l=!1;if(!de(t)){const a=c=>{const h=qs(c,n,!0);h&&(l=!0,Re(o,h))};!e&&n.mixins.length&&n.mixins.forEach(a),t.extends&&a(t.extends),t.mixins&&t.mixins.forEach(a)}return!r&&!l?(xe(t)&&i.set(t,null),null):(ce(r)?r.forEach(a=>o[a]=null):Re(o,r),xe(t)&&i.set(t,o),o)}function xi(t,n){return!t||!gi(n)?!1:(n=n.slice(2).replace(/Once$/,""),ge(t,n[0].toLowerCase()+n.slice(1))||ge(t,Lt(n))||ge(t,n))}let Ie=null,Zs=null;function ci(t){const n=Ie;return Ie=t,Zs=t&&t.type.__scopeId||null,n}function ko(t,n=Ie,e){if(!n||t._n)return t;const i=(...s)=>{i._d&&Jn(-1);const r=ci(n);let o;try{o=t(...s)}finally{ci(r),i._d&&Jn(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Hi(t){const{type:n,vnode:e,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:l,emit:a,render:c,renderCache:h,props:p,data:m,setupState:T,ctx:x,inheritAttrs:E}=t,R=ci(t);let M,f;try{if(e.shapeFlag&4){const H=s||i,L=H;M=Ke(c.call(L,H,h,p,T,m,x)),f=l}else{const H=n;M=Ke(H.length>1?H(p,{attrs:l,slots:o,emit:a}):H(p,null)),f=n.props?l:Fo(l)}}catch(H){qt.length=0,Ti(H,t,1),M=ie(Ct)}let _=M;if(f&&E!==!1){const H=Object.keys(f),{shapeFlag:L}=_;H.length&&L&7&&(r&&H.some(sn)&&(f=Io(f,r)),_=It(_,f,!1,!0))}return e.dirs&&(_=It(_,null,!1,!0),_.dirs=_.dirs?_.dirs.concat(e.dirs):e.dirs),e.transition&&(_.transition=e.transition),M=_,ci(R),M}const Fo=t=>{let n;for(const e in t)(e==="class"||e==="style"||gi(e))&&((n||(n={}))[e]=t[e]);return n},Io=(t,n)=>{const e={};for(const i in t)(!sn(i)||!(i.slice(9)in n))&&(e[i]=t[i]);return e};function Bo(t,n,e){const{props:i,children:s,component:r}=t,{props:o,children:l,patchFlag:a}=n,c=r.emitsOptions;if(n.dirs||n.transition)return!0;if(e&&a>=0){if(a&1024)return!0;if(a&16)return i?Vn(i,o,c):!!o;if(a&8){const h=n.dynamicProps;for(let p=0;pt.__isSuspense;function jo(t,n){n&&n.pendingBranch?ce(t)?n.effects.push(...t):n.effects.push(t):Mo(t)}const Wo=Symbol.for("v-scx"),Go=()=>ri(Wo),ii={};function Oi(t,n,e){return Js(t,n,e)}function Js(t,n,{immediate:e,deep:i,flush:s,once:r,onTrack:o,onTrigger:l}=_e){if(n&&r){const O=n;n=(...N)=>{O(...N),L()}}const a=Oe,c=O=>i===!0?O:Tt(O,i===!1?1:void 0);let h,p=!1,m=!1;if(Ne(t)?(h=()=>t.value,p=ji(t)):jt(t)?(h=()=>c(t),p=!0):ce(t)?(m=!0,p=t.some(O=>jt(O)||ji(O)),h=()=>t.map(O=>{if(Ne(O))return O.value;if(jt(O))return c(O);if(de(O))return ft(O,a,2)})):de(t)?n?h=()=>ft(t,a,2):h=()=>(T&&T(),Ge(t,a,3,[x])):h=Ve,n&&i){const O=h;h=()=>Tt(O())}let T,x=O=>{T=_.onStop=()=>{ft(O,a,4),T=_.onStop=void 0}},E;if(Ei)if(x=Ve,n?e&&Ge(n,a,3,[h(),m?[]:void 0,x]):h(),s==="sync"){const O=Go();E=O.__watcherHandles||(O.__watcherHandles=[])}else return Ve;let R=m?new Array(t.length).fill(ii):ii;const M=()=>{if(!(!_.active||!_.dirty))if(n){const O=_.run();(i||p||(m?O.some((N,G)=>Pt(N,R[G])):Pt(O,R)))&&(T&&T(),Ge(n,a,3,[O,R===ii?void 0:m&&R[0]===ii?[]:R,x]),R=O)}else _.run()};M.allowRecurse=!!n;let f;s==="sync"?f=M:s==="post"?f=()=>Fe(M,a&&a.suspense):(M.pre=!0,a&&(M.id=a.uid),f=()=>vn(M));const _=new ln(h,Ve,f),H=io(),L=()=>{_.stop(),H&&rn(H.effects,_)};return n?e?M():R=_.run():s==="post"?Fe(_.run.bind(_),a&&a.suspense):_.run(),E&&E.push(L),L}function qo(t,n,e){const i=this.proxy,s=Se(t)?t.includes(".")?Qs(i,t):()=>i[t]:t.bind(i,i);let r;de(n)?r=n:(r=n.handler,e=n);const o=Yt(this),l=Js(s,r.bind(i),e);return o(),l}function Qs(t,n){const e=n.split(".");return()=>{let i=t;for(let s=0;s{Tt(i,n,e)});else if(Ts(t))for(const i in t)Tt(t[i],n,e);return t}function De(t,n){if(Ie===null)return t;const e=Pi(Ie)||Ie.proxy,i=t.dirs||(t.dirs=[]);for(let s=0;s!!t.type.__asyncLoader,$s=t=>t.type.__isKeepAlive;function Zo(t,n){er(t,"a",n)}function Ko(t,n){er(t,"da",n)}function er(t,n,e=Oe){const i=t.__wdc||(t.__wdc=()=>{let s=e;for(;s;){if(s.isDeactivated)return;s=s.parent}return t()});if(bi(n,i,e),e){let s=e.parent;for(;s&&s.parent;)$s(s.parent.vnode)&&Xo(i,n,e,s),s=s.parent}}function Xo(t,n,e,i){const s=bi(n,t,i,!0);tr(()=>{rn(i[n],s)},e)}function bi(t,n,e=Oe,i=!1){if(e){const s=e[t]||(e[t]=[]),r=n.__weh||(n.__weh=(...o)=>{if(e.isUnmounted)return;dt();const l=Yt(e),a=Ge(n,e,t,o);return l(),pt(),a});return i?s.unshift(r):s.push(r),r}}const tt=t=>(n,e=Oe)=>(!Ei||t==="sp")&&bi(t,(...i)=>n(...i),e),Yo=tt("bm"),Jo=tt("m"),Qo=tt("bu"),$o=tt("u"),ea=tt("bum"),tr=tt("um"),ta=tt("sp"),ia=tt("rtg"),na=tt("rtc");function sa(t,n=Oe){bi("ec",t,n)}function Be(t,n,e,i){let s;const r=e&&e[i];if(ce(t)||Se(t)){s=new Array(t.length);for(let o=0,l=t.length;on(o,l,void 0,r&&r[l]));else{const o=Object.keys(t);s=new Array(o.length);for(let l=0,a=o.length;lt?mr(t)?Pi(t)||t.proxy:Gi(t.parent):null,Wt=Re(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Gi(t.parent),$root:t=>Gi(t.root),$emit:t=>t.emit,$options:t=>wn(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,vn(t.update)}),$nextTick:t=>t.n||(t.n=Us.bind(t.proxy)),$watch:t=>qo.bind(t)}),Mi=(t,n)=>t!==_e&&!t.__isScriptSetup&&ge(t,n),ra={get({_:t},n){if(n==="__v_skip")return!0;const{ctx:e,setupState:i,data:s,props:r,accessCache:o,type:l,appContext:a}=t;let c;if(n[0]!=="$"){const T=o[n];if(T!==void 0)switch(T){case 1:return i[n];case 2:return s[n];case 4:return e[n];case 3:return r[n]}else{if(Mi(i,n))return o[n]=1,i[n];if(s!==_e&&ge(s,n))return o[n]=2,s[n];if((c=t.propsOptions[0])&&ge(c,n))return o[n]=3,r[n];if(e!==_e&&ge(e,n))return o[n]=4,e[n];qi&&(o[n]=0)}}const h=Wt[n];let p,m;if(h)return n==="$attrs"&&ze(t.attrs,"get",""),h(t);if((p=l.__cssModules)&&(p=p[n]))return p;if(e!==_e&&ge(e,n))return o[n]=4,e[n];if(m=a.config.globalProperties,ge(m,n))return m[n]},set({_:t},n,e){const{data:i,setupState:s,ctx:r}=t;return Mi(s,n)?(s[n]=e,!0):i!==_e&&ge(i,n)?(i[n]=e,!0):ge(t.props,n)||n[0]==="$"&&n.slice(1)in t?!1:(r[n]=e,!0)},has({_:{data:t,setupState:n,accessCache:e,ctx:i,appContext:s,propsOptions:r}},o){let l;return!!e[o]||t!==_e&&ge(t,o)||Mi(n,o)||(l=r[0])&&ge(l,o)||ge(i,o)||ge(Wt,o)||ge(s.config.globalProperties,o)},defineProperty(t,n,e){return e.get!=null?t._.accessCache[n]=0:ge(e,"value")&&this.set(t,n,e.value,null),Reflect.defineProperty(t,n,e)}};function jn(t){return ce(t)?t.reduce((n,e)=>(n[e]=null,n),{}):t}let qi=!0;function oa(t){const n=wn(t),e=t.proxy,i=t.ctx;qi=!1,n.beforeCreate&&Wn(n.beforeCreate,t,"bc");const{data:s,computed:r,methods:o,watch:l,provide:a,inject:c,created:h,beforeMount:p,mounted:m,beforeUpdate:T,updated:x,activated:E,deactivated:R,beforeDestroy:M,beforeUnmount:f,destroyed:_,unmounted:H,render:L,renderTracked:O,renderTriggered:N,errorCaptured:G,serverPrefetch:q,expose:$,inheritAttrs:re,components:J,directives:fe,filters:ue}=n;if(c&&aa(c,i,null),o)for(const oe in o){const ee=o[oe];de(ee)&&(i[oe]=ee.bind(e))}if(s){const oe=s.call(e,e);xe(oe)&&(t.data=_i(oe))}if(qi=!0,r)for(const oe in r){const ee=r[oe],ye=de(ee)?ee.bind(e,e):de(ee.get)?ee.get.bind(e,e):Ve,Y=!de(ee)&&de(ee.set)?ee.set.bind(e):Ve,Ee=$e({get:ye,set:Y});Object.defineProperty(i,oe,{enumerable:!0,configurable:!0,get:()=>Ee.value,set:Ae=>Ee.value=Ae})}if(l)for(const oe in l)ir(l[oe],i,e,oe);if(a){const oe=de(a)?a.call(e):a;Reflect.ownKeys(oe).forEach(ee=>{da(ee,oe[ee])})}h&&Wn(h,t,"c");function le(oe,ee){ce(ee)?ee.forEach(ye=>oe(ye.bind(e))):ee&&oe(ee.bind(e))}if(le(Yo,p),le(Jo,m),le(Qo,T),le($o,x),le(Zo,E),le(Ko,R),le(sa,G),le(na,O),le(ia,N),le(ea,f),le(tr,H),le(ta,q),ce($))if($.length){const oe=t.exposed||(t.exposed={});$.forEach(ee=>{Object.defineProperty(oe,ee,{get:()=>e[ee],set:ye=>e[ee]=ye})})}else t.exposed||(t.exposed={});L&&t.render===Ve&&(t.render=L),re!=null&&(t.inheritAttrs=re),J&&(t.components=J),fe&&(t.directives=fe)}function aa(t,n,e=Ve){ce(t)&&(t=Zi(t));for(const i in t){const s=t[i];let r;xe(s)?"default"in s?r=ri(s.from||i,s.default,!0):r=ri(s.from||i):r=ri(s),Ne(r)?Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):n[i]=r}}function Wn(t,n,e){Ge(ce(t)?t.map(i=>i.bind(n.proxy)):t.bind(n.proxy),n,e)}function ir(t,n,e,i){const s=i.includes(".")?Qs(e,i):()=>e[i];if(Se(t)){const r=n[t];de(r)&&Oi(s,r)}else if(de(t))Oi(s,t.bind(e));else if(xe(t))if(ce(t))t.forEach(r=>ir(r,n,e,i));else{const r=de(t.handler)?t.handler.bind(e):n[t.handler];de(r)&&Oi(s,r,t)}}function wn(t){const n=t.type,{mixins:e,extends:i}=n,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,l=r.get(n);let a;return l?a=l:!s.length&&!e&&!i?a=n:(a={},s.length&&s.forEach(c=>ui(a,c,o,!0)),ui(a,n,o)),xe(n)&&r.set(n,a),a}function ui(t,n,e,i=!1){const{mixins:s,extends:r}=n;r&&ui(t,r,e,!0),s&&s.forEach(o=>ui(t,o,e,!0));for(const o in n)if(!(i&&o==="expose")){const l=la[o]||e&&e[o];t[o]=l?l(t[o],n[o]):n[o]}return t}const la={data:Gn,props:qn,emits:qn,methods:Nt,computed:Nt,beforeCreate:Me,created:Me,beforeMount:Me,mounted:Me,beforeUpdate:Me,updated:Me,beforeDestroy:Me,beforeUnmount:Me,destroyed:Me,unmounted:Me,activated:Me,deactivated:Me,errorCaptured:Me,serverPrefetch:Me,components:Nt,directives:Nt,watch:ua,provide:Gn,inject:ca};function Gn(t,n){return n?t?function(){return Re(de(t)?t.call(this,this):t,de(n)?n.call(this,this):n)}:n:t}function ca(t,n){return Nt(Zi(t),Zi(n))}function Zi(t){if(ce(t)){const n={};for(let e=0;e1)return e&&de(n)?n.call(i&&i.proxy):n}}const sr={},rr=()=>Object.create(sr),or=t=>Object.getPrototypeOf(t)===sr;function pa(t,n,e,i=!1){const s={},r=rr();t.propsDefaults=Object.create(null),ar(t,n,s,r);for(const o in t.propsOptions[0])o in s||(s[o]=void 0);e?t.props=i?s:bo(s):t.type.props?t.props=s:t.props=r,t.attrs=r}function ga(t,n,e,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=t,l=we(s),[a]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const h=t.vnode.dynamicProps;for(let p=0;p{a=!0;const[m,T]=lr(p,n,!0);Re(o,m),T&&l.push(...T)};!e&&n.mixins.length&&n.mixins.forEach(h),t.extends&&h(t.extends),t.mixins&&t.mixins.forEach(h)}if(!r&&!a)return xe(t)&&i.set(t,At),At;if(ce(r))for(let h=0;h-1,T[1]=E<0||x-1||ge(T,"default"))&&l.push(p)}}}const c=[o,l];return xe(t)&&i.set(t,c),c}function Zn(t){return t[0]!=="$"&&!Ut(t)}function Kn(t){return t===null?"null":typeof t=="function"?t.name||"":typeof t=="object"&&t.constructor&&t.constructor.name||""}function Xn(t,n){return Kn(t)===Kn(n)}function Yn(t,n){return ce(n)?n.findIndex(e=>Xn(e,t)):de(n)&&Xn(n,t)?0:-1}const cr=t=>t[0]==="_"||t==="$stable",_n=t=>ce(t)?t.map(Ke):[Ke(t)],ma=(t,n,e)=>{if(n._n)return n;const i=ko((...s)=>_n(n(...s)),e);return i._c=!1,i},ur=(t,n,e)=>{const i=t._ctx;for(const s in t){if(cr(s))continue;const r=t[s];if(de(r))n[s]=ma(s,r,i);else if(r!=null){const o=_n(r);n[s]=()=>o}}},hr=(t,n)=>{const e=_n(n);t.slots.default=()=>e},va=(t,n)=>{const e=t.slots=rr();if(t.vnode.shapeFlag&32){const i=n._;i?(Re(e,n),xs(e,"_",i,!0)):ur(n,e)}else n&&hr(t,n)},ya=(t,n,e)=>{const{vnode:i,slots:s}=t;let r=!0,o=_e;if(i.shapeFlag&32){const l=n._;l?e&&l===1?r=!1:(Re(s,n),!e&&l===1&&delete s._):(r=!n.$stable,ur(n,s)),o=n}else n&&(hr(t,n),o={default:1});if(r)for(const l in s)!cr(l)&&o[l]==null&&delete s[l]};function Xi(t,n,e,i,s=!1){if(ce(t)){t.forEach((m,T)=>Xi(m,n&&(ce(n)?n[T]:n),e,i,s));return}if(si(i)&&!s)return;const r=i.shapeFlag&4?Pi(i.component)||i.component.proxy:i.el,o=s?null:r,{i:l,r:a}=t,c=n&&n.r,h=l.refs===_e?l.refs={}:l.refs,p=l.setupState;if(c!=null&&c!==a&&(Se(c)?(h[c]=null,ge(p,c)&&(p[c]=null)):Ne(c)&&(c.value=null)),de(a))ft(a,l,12,[o,h]);else{const m=Se(a),T=Ne(a);if(m||T){const x=()=>{if(t.f){const E=m?ge(p,a)?p[a]:h[a]:a.value;s?ce(E)&&rn(E,r):ce(E)?E.includes(r)||E.push(r):m?(h[a]=[r],ge(p,a)&&(p[a]=h[a])):(a.value=[r],t.k&&(h[t.k]=a.value))}else m?(h[a]=o,ge(p,a)&&(p[a]=o)):T&&(a.value=o,t.k&&(h[t.k]=o))};o?(x.id=-1,Fe(x,e)):x()}}}const Fe=jo;function wa(t){return _a(t)}function _a(t,n){const e=bs();e.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:l,createComment:a,setText:c,setElementText:h,parentNode:p,nextSibling:m,setScopeId:T=Ve,insertStaticContent:x}=t,E=(S,u,v,b=null,C=null,P=null,B=void 0,D=null,V=!!u.dynamicChildren)=>{if(S===u)return;S&&!Bt(S,u)&&(b=Qe(S),Ae(S,C,P,!0),S=null),u.patchFlag===-2&&(V=!1,u.dynamicChildren=null);const{type:z,ref:U,shapeFlag:W}=u;switch(z){case Si:R(S,u,v,b);break;case Ct:M(S,u,v,b);break;case Ai:S==null&&f(u,v,b,B);break;case ve:J(S,u,v,b,C,P,B,D,V);break;default:W&1?L(S,u,v,b,C,P,B,D,V):W&6?fe(S,u,v,b,C,P,B,D,V):(W&64||W&128)&&z.process(S,u,v,b,C,P,B,D,V,Ue)}U!=null&&C&&Xi(U,S&&S.ref,P,u||S,!u)},R=(S,u,v,b)=>{if(S==null)i(u.el=l(u.children),v,b);else{const C=u.el=S.el;u.children!==S.children&&c(C,u.children)}},M=(S,u,v,b)=>{S==null?i(u.el=a(u.children||""),v,b):u.el=S.el},f=(S,u,v,b)=>{[S.el,S.anchor]=x(S.children,u,v,b,S.el,S.anchor)},_=({el:S,anchor:u},v,b)=>{let C;for(;S&&S!==u;)C=m(S),i(S,v,b),S=C;i(u,v,b)},H=({el:S,anchor:u})=>{let v;for(;S&&S!==u;)v=m(S),s(S),S=v;s(u)},L=(S,u,v,b,C,P,B,D,V)=>{u.type==="svg"?B="svg":u.type==="math"&&(B="mathml"),S==null?O(u,v,b,C,P,B,D,V):q(S,u,C,P,B,D,V)},O=(S,u,v,b,C,P,B,D)=>{let V,z;const{props:U,shapeFlag:W,transition:X,dirs:K}=S;if(V=S.el=o(S.type,P,U&&U.is,U),W&8?h(V,S.children):W&16&&G(S.children,V,null,b,C,Di(S,P),B,D),K&&yt(S,null,b,"created"),N(V,S,S.scopeId,B,b),U){for(const pe in U)pe!=="value"&&!Ut(pe)&&r(V,pe,null,U[pe],P,S.children,b,C,ke);"value"in U&&r(V,"value",null,U.value,P),(z=U.onVnodeBeforeMount)&&qe(z,b,S)}K&&yt(S,null,b,"beforeMount");const te=Ta(C,X);te&&X.beforeEnter(V),i(V,u,v),((z=U&&U.onVnodeMounted)||te||K)&&Fe(()=>{z&&qe(z,b,S),te&&X.enter(V),K&&yt(S,null,b,"mounted")},C)},N=(S,u,v,b,C)=>{if(v&&T(S,v),b)for(let P=0;P{for(let z=V;z{const D=u.el=S.el;let{patchFlag:V,dynamicChildren:z,dirs:U}=u;V|=S.patchFlag&16;const W=S.props||_e,X=u.props||_e;let K;if(v&&wt(v,!1),(K=X.onVnodeBeforeUpdate)&&qe(K,v,u,S),U&&yt(u,S,v,"beforeUpdate"),v&&wt(v,!0),z?$(S.dynamicChildren,z,D,v,b,Di(u,C),P):B||ee(S,u,D,null,v,b,Di(u,C),P,!1),V>0){if(V&16)re(D,u,W,X,v,b,C);else if(V&2&&W.class!==X.class&&r(D,"class",null,X.class,C),V&4&&r(D,"style",W.style,X.style,C),V&8){const te=u.dynamicProps;for(let pe=0;pe{K&&qe(K,v,u,S),U&&yt(u,S,v,"updated")},b)},$=(S,u,v,b,C,P,B)=>{for(let D=0;D{if(v!==b){if(v!==_e)for(const D in v)!Ut(D)&&!(D in b)&&r(S,D,v[D],null,B,u.children,C,P,ke);for(const D in b){if(Ut(D))continue;const V=b[D],z=v[D];V!==z&&D!=="value"&&r(S,D,z,V,B,u.children,C,P,ke)}"value"in b&&r(S,"value",v.value,b.value,B)}},J=(S,u,v,b,C,P,B,D,V)=>{const z=u.el=S?S.el:l(""),U=u.anchor=S?S.anchor:l("");let{patchFlag:W,dynamicChildren:X,slotScopeIds:K}=u;K&&(D=D?D.concat(K):K),S==null?(i(z,v,b),i(U,v,b),G(u.children||[],v,U,C,P,B,D,V)):W>0&&W&64&&X&&S.dynamicChildren?($(S.dynamicChildren,X,v,C,P,B,D),(u.key!=null||C&&u===C.subTree)&&fr(S,u,!0)):ee(S,u,v,U,C,P,B,D,V)},fe=(S,u,v,b,C,P,B,D,V)=>{u.slotScopeIds=D,S==null?u.shapeFlag&512?C.ctx.activate(u,v,b,B,V):ue(u,v,b,C,P,B,V):me(S,u,V)},ue=(S,u,v,b,C,P,B)=>{const D=S.component=Ha(S,b,C);if($s(S)&&(D.ctx.renderer=Ue),Oa(D),D.asyncDep){if(C&&C.registerDep(D,le),!S.el){const V=D.subTree=ie(Ct);M(null,V,u,v)}}else le(D,S,u,v,C,P,B)},me=(S,u,v)=>{const b=u.component=S.component;if(Bo(S,u,v))if(b.asyncDep&&!b.asyncResolved){oe(b,u,v);return}else b.next=u,Oo(b.update),b.effect.dirty=!0,b.update();else u.el=S.el,b.vnode=u},le=(S,u,v,b,C,P,B)=>{const D=()=>{if(S.isMounted){let{next:U,bu:W,u:X,parent:K,vnode:te}=S;{const w=dr(S);if(w){U&&(U.el=te.el,oe(S,U,B)),w.asyncDep.then(()=>{S.isUnmounted||D()});return}}let pe=U,g;wt(S,!1),U?(U.el=te.el,oe(S,U,B)):U=te,W&&ni(W),(g=U.props&&U.props.onVnodeBeforeUpdate)&&qe(g,K,U,te),wt(S,!0);const d=Hi(S),y=S.subTree;S.subTree=d,E(y,d,p(y.el),Qe(y),S,C,P),U.el=d.el,pe===null&&zo(S,d.el),X&&Fe(X,C),(g=U.props&&U.props.onVnodeUpdated)&&Fe(()=>qe(g,K,U,te),C)}else{let U;const{el:W,props:X}=u,{bm:K,m:te,parent:pe}=S,g=si(u);if(wt(S,!1),K&&ni(K),!g&&(U=X&&X.onVnodeBeforeMount)&&qe(U,pe,u),wt(S,!0),W&&vt){const d=()=>{S.subTree=Hi(S),vt(W,S.subTree,S,C,null)};g?u.type.__asyncLoader().then(()=>!S.isUnmounted&&d()):d()}else{const d=S.subTree=Hi(S);E(null,d,v,b,S,C,P),u.el=d.el}if(te&&Fe(te,C),!g&&(U=X&&X.onVnodeMounted)){const d=u;Fe(()=>qe(U,pe,d),C)}(u.shapeFlag&256||pe&&si(pe.vnode)&&pe.vnode.shapeFlag&256)&&S.a&&Fe(S.a,C),S.isMounted=!0,u=v=b=null}},V=S.effect=new ln(D,Ve,()=>vn(z),S.scope),z=S.update=()=>{V.dirty&&V.run()};z.id=S.uid,wt(S,!0),z()},oe=(S,u,v)=>{u.component=S;const b=S.vnode.props;S.vnode=u,S.next=null,ga(S,u.props,b,v),ya(S,u.children,v),dt(),Nn(S),pt()},ee=(S,u,v,b,C,P,B,D,V=!1)=>{const z=S&&S.children,U=S?S.shapeFlag:0,W=u.children,{patchFlag:X,shapeFlag:K}=u;if(X>0){if(X&128){Y(z,W,v,b,C,P,B,D,V);return}else if(X&256){ye(z,W,v,b,C,P,B,D,V);return}}K&8?(U&16&&ke(z,C,P),W!==z&&h(v,W)):U&16?K&16?Y(z,W,v,b,C,P,B,D,V):ke(z,C,P,!0):(U&8&&h(v,""),K&16&&G(W,v,b,C,P,B,D,V))},ye=(S,u,v,b,C,P,B,D,V)=>{S=S||At,u=u||At;const z=S.length,U=u.length,W=Math.min(z,U);let X;for(X=0;XU?ke(S,C,P,!0,!1,W):G(u,v,b,C,P,B,D,V,W)},Y=(S,u,v,b,C,P,B,D,V)=>{let z=0;const U=u.length;let W=S.length-1,X=U-1;for(;z<=W&&z<=X;){const K=S[z],te=u[z]=V?ct(u[z]):Ke(u[z]);if(Bt(K,te))E(K,te,v,null,C,P,B,D,V);else break;z++}for(;z<=W&&z<=X;){const K=S[W],te=u[X]=V?ct(u[X]):Ke(u[X]);if(Bt(K,te))E(K,te,v,null,C,P,B,D,V);else break;W--,X--}if(z>W){if(z<=X){const K=X+1,te=KX)for(;z<=W;)Ae(S[z],C,P,!0),z++;else{const K=z,te=z,pe=new Map;for(z=te;z<=X;z++){const he=u[z]=V?ct(u[z]):Ke(u[z]);he.key!=null&&pe.set(he.key,z)}let g,d=0;const y=X-te+1;let w=!1,I=0;const j=new Array(y);for(z=0;z=y){Ae(he,C,P,!0);continue}let Q;if(he.key!=null)Q=pe.get(he.key);else for(g=te;g<=X;g++)if(j[g-te]===0&&Bt(he,u[g])){Q=g;break}Q===void 0?Ae(he,C,P,!0):(j[Q-te]=z+1,Q>=I?I=Q:w=!0,E(he,u[Q],v,null,C,P,B,D,V),d++)}const ne=w?xa(j):At;for(g=ne.length-1,z=y-1;z>=0;z--){const he=te+z,Q=u[he],Le=he+1{const{el:P,type:B,transition:D,children:V,shapeFlag:z}=S;if(z&6){Ee(S.component.subTree,u,v,b);return}if(z&128){S.suspense.move(u,v,b);return}if(z&64){B.move(S,u,v,Ue);return}if(B===ve){i(P,u,v);for(let W=0;WD.enter(P),C);else{const{leave:W,delayLeave:X,afterLeave:K}=D,te=()=>i(P,u,v),pe=()=>{W(P,()=>{te(),K&&K()})};X?X(P,te,pe):pe()}else i(P,u,v)},Ae=(S,u,v,b=!1,C=!1)=>{const{type:P,props:B,ref:D,children:V,dynamicChildren:z,shapeFlag:U,patchFlag:W,dirs:X}=S;if(D!=null&&Xi(D,null,v,S,!0),U&256){u.ctx.deactivate(S);return}const K=U&1&&X,te=!si(S);let pe;if(te&&(pe=B&&B.onVnodeBeforeUnmount)&&qe(pe,u,S),U&6)Ht(S.component,v,b);else{if(U&128){S.suspense.unmount(v,b);return}K&&yt(S,null,u,"beforeUnmount"),U&64?S.type.remove(S,u,v,C,Ue,b):z&&(P!==ve||W>0&&W&64)?ke(z,u,v,!1,!0):(P===ve&&W&384||!C&&U&16)&&ke(V,u,v),b&&mt(S)}(te&&(pe=B&&B.onVnodeUnmounted)||K)&&Fe(()=>{pe&&qe(pe,u,S),K&&yt(S,null,u,"unmounted")},v)},mt=S=>{const{type:u,el:v,anchor:b,transition:C}=S;if(u===ve){st(v,b);return}if(u===Ai){H(S);return}const P=()=>{s(v),C&&!C.persisted&&C.afterLeave&&C.afterLeave()};if(S.shapeFlag&1&&C&&!C.persisted){const{leave:B,delayLeave:D}=C,V=()=>B(v,P);D?D(S.el,P,V):V()}else P()},st=(S,u)=>{let v;for(;S!==u;)v=m(S),s(S),S=v;s(u)},Ht=(S,u,v)=>{const{bum:b,scope:C,update:P,subTree:B,um:D}=S;b&&ni(b),C.stop(),P&&(P.active=!1,Ae(B,S,u,v)),D&&Fe(D,u),Fe(()=>{S.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&S.asyncDep&&!S.asyncResolved&&S.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},ke=(S,u,v,b=!1,C=!1,P=0)=>{for(let B=P;BS.shapeFlag&6?Qe(S.component.subTree):S.shapeFlag&128?S.suspense.next():m(S.anchor||S.el);let rt=!1;const Ot=(S,u,v)=>{S==null?u._vnode&&Ae(u._vnode,null,null,!0):E(u._vnode||null,S,u,null,null,null,v),rt||(rt=!0,Nn(),Ws(),rt=!1),u._vnode=S},Ue={p:E,um:Ae,m:Ee,r:mt,mt:ue,mc:G,pc:ee,pbc:$,n:Qe,o:t};let ot,vt;return n&&([ot,vt]=n(Ue)),{render:Ot,hydrate:ot,createApp:fa(Ot,ot)}}function Di({type:t,props:n},e){return e==="svg"&&t==="foreignObject"||e==="mathml"&&t==="annotation-xml"&&n&&n.encoding&&n.encoding.includes("html")?void 0:e}function wt({effect:t,update:n},e){t.allowRecurse=n.allowRecurse=e}function Ta(t,n){return(!t||t&&!t.pendingBranch)&&n&&!n.persisted}function fr(t,n,e=!1){const i=t.children,s=n.children;if(ce(i)&&ce(s))for(let r=0;r>1,t[e[l]]0&&(n[i]=e[r-1]),e[r]=i)}}for(r=e.length,o=e[r-1];r-- >0;)e[r]=o,o=n[o];return e}function dr(t){const n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:dr(n)}const ba=t=>t.__isTeleport,ve=Symbol.for("v-fgt"),Si=Symbol.for("v-txt"),Ct=Symbol.for("v-cmt"),Ai=Symbol.for("v-stc"),qt=[];let We=null;function k(t=!1){qt.push(We=t?null:[])}function Sa(){qt.pop(),We=qt[qt.length-1]||null}let Xt=1;function Jn(t){Xt+=t}function pr(t){return t.dynamicChildren=Xt>0?We||At:null,Sa(),Xt>0&&We&&We.push(t),t}function F(t,n,e,i,s,r){return pr(A(t,n,e,i,s,r,!0))}function Ce(t,n,e,i,s){return pr(ie(t,n,e,i,s,!0))}function Yi(t){return t?t.__v_isVNode===!0:!1}function Bt(t,n){return t.type===n.type&&t.key===n.key}const gr=({key:t})=>t??null,oi=({ref:t,ref_key:n,ref_for:e})=>(typeof t=="number"&&(t=""+t),t!=null?Se(t)||Ne(t)||de(t)?{i:Ie,r:t,k:n,f:!!e}:t:null);function A(t,n=null,e=null,i=0,s=null,r=t===ve?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:n,key:n&&gr(n),ref:n&&oi(n),scopeId:Zs,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ie};return l?(Tn(a,e),r&128&&t.normalize(a)):e&&(a.shapeFlag|=Se(e)?8:16),Xt>0&&!o&&We&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&We.push(a),a}const ie=Ea;function Ea(t,n=null,e=null,i=0,s=null,r=!1){if((!t||t===Vo)&&(t=Ct),Yi(t)){const l=It(t,n,!0);return e&&Tn(l,e),Xt>0&&!r&&We&&(l.shapeFlag&6?We[We.indexOf(t)]=l:We.push(l)),l.patchFlag|=-2,l}if(Fa(t)&&(t=t.__vccOpts),n){n=Pa(n);let{class:l,style:a}=n;l&&!Se(l)&&(n.class=Te(l)),xe(a)&&(Bs(a)&&!ce(a)&&(a=Re({},a)),n.style=an(a))}const o=Se(t)?1:Uo(t)?128:ba(t)?64:xe(t)?4:de(t)?2:0;return A(t,n,e,i,s,o,r,!0)}function Pa(t){return t?Bs(t)||or(t)?Re({},t):t:null}function It(t,n,e=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:l,transition:a}=t,c=n?Ca(s||{},n):s,h={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&gr(c),ref:n&&n.ref?e&&r?ce(r)?r.concat(oi(n)):[r,oi(n)]:oi(n):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:n&&t.type!==ve?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:a,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&It(t.ssContent),ssFallback:t.ssFallback&&It(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return a&&i&&(h.transition=a.clone(h)),h}function be(t=" ",n=0){return ie(Si,null,t,n)}function se(t="",n=!1){return n?(k(),Ce(Ct,null,t)):ie(Ct,null,t)}function Ke(t){return t==null||typeof t=="boolean"?ie(Ct):ce(t)?ie(ve,null,t.slice()):typeof t=="object"?ct(t):ie(Si,null,String(t))}function ct(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:It(t)}function Tn(t,n){let e=0;const{shapeFlag:i}=t;if(n==null)n=null;else if(ce(n))e=16;else if(typeof n=="object")if(i&65){const s=n.default;s&&(s._c&&(s._d=!1),Tn(t,s()),s._c&&(s._d=!0));return}else{e=32;const s=n._;!s&&!or(n)?n._ctx=Ie:s===3&&Ie&&(Ie.slots._===1?n._=1:(n._=2,t.patchFlag|=1024))}else de(n)?(n={default:n,_ctx:Ie},e=32):(n=String(n),i&64?(e=16,n=[be(n)]):e=8);t.children=n,t.shapeFlag|=e}function Ca(...t){const n={};for(let e=0;e{let s;return(s=t[e])||(s=t[e]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};hi=n("__VUE_INSTANCE_SETTERS__",e=>Oe=e),Ji=n("__VUE_SSR_SETTERS__",e=>Ei=e)}const Yt=t=>{const n=Oe;return hi(t),t.scope.on(),()=>{t.scope.off(),hi(n)}},Qn=()=>{Oe&&Oe.scope.off(),hi(null)};function mr(t){return t.vnode.shapeFlag&4}let Ei=!1;function Oa(t,n=!1){n&&Ji(n);const{props:e,children:i}=t.vnode,s=mr(t);pa(t,e,s,n),va(t,i);const r=s?Ma(t,n):void 0;return n&&Ji(!1),r}function Ma(t,n){const e=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,ra);const{setup:i}=e;if(i){const s=t.setupContext=i.length>1?Aa(t):null,r=Yt(t);dt();const o=ft(i,t,0,[t.props,s]);if(pt(),r(),ws(o)){if(o.then(Qn,Qn),n)return o.then(l=>{$n(t,l,n)}).catch(l=>{Ti(l,t,0)});t.asyncDep=o}else $n(t,o,n)}else vr(t,n)}function $n(t,n,e){de(n)?t.type.__ssrInlineRender?t.ssrRender=n:t.render=n:xe(n)&&(t.setupState=Ns(n)),vr(t,e)}let es;function vr(t,n,e){const i=t.type;if(!t.render){if(!n&&es&&!i.render){const s=i.template||wn(t).template;if(s){const{isCustomElement:r,compilerOptions:o}=t.appContext.config,{delimiters:l,compilerOptions:a}=i,c=Re(Re({isCustomElement:r,delimiters:l},o),a);i.render=es(s,c)}}t.render=i.render||Ve}{const s=Yt(t);dt();try{oa(t)}finally{pt(),s()}}}const Da={get(t,n){return ze(t,"get",""),t[n]}};function Aa(t){const n=e=>{t.exposed=e||{}};return{attrs:new Proxy(t.attrs,Da),slots:t.slots,emit:t.emit,expose:n}}function Pi(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(Ns(So(t.exposed)),{get(n,e){if(e in n)return n[e];if(e in Wt)return Wt[e](t)},has(n,e){return e in n||e in Wt}}))}function ka(t,n=!0){return de(t)?t.displayName||t.name:t.name||n&&t.__name}function Fa(t){return de(t)&&"__vccOpts"in t}const $e=(t,n)=>Eo(t,n,Ei);function Ia(t,n,e){const i=arguments.length;return i===2?xe(n)&&!ce(n)?Yi(n)?ie(t,null,[n]):ie(t,n):ie(t,null,n):(i>3?e=Array.prototype.slice.call(arguments,2):i===3&&Yi(e)&&(e=[e]),ie(t,n,e))}const Ba="3.4.27";/** +**/function ft(t,n,e,i){try{return i?t(...i):t()}catch(s){_i(s,n,e)}}function Ge(t,n,e,i){if(de(t)){const s=ft(t,n,e,i);return s&&Ts(s)&&s.catch(r=>{_i(r,n,e)}),s}if(ce(t)){const s=[];for(let r=0;r>>1,s=He[i],r=Kt(s);rYe&&He.splice(n,1)}function Ao(t){ce(t)?Ft.push(...t):(!lt||!lt.includes(t,t.allowRecurse?_t+1:_t))&&Ft.push(t),Gs()}function Nn(t,n,e=Zt?Ye+1:0){for(;eKt(e)-Kt(i));if(Ft.length=0,lt){lt.push(...n);return}for(lt=n,_t=0;_tt.id==null?1/0:t.id,ko=(t,n)=>{const e=Kt(t)-Kt(n);if(e===0){if(t.pre&&!n.pre)return-1;if(n.pre&&!t.pre)return 1}return e};function Zs(t){Gi=!1,Zt=!0,He.sort(ko);try{for(Ye=0;YeSe(T)?T.trim():T)),p&&(s=e.map(zi))}let l,a=i[l=Ci(n)]||i[l=Ci(Je(n))];!a&&r&&(a=i[l=Ci(Lt(n))]),a&&Ge(a,t,6,s);const c=i[l+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,Ge(c,t,6,s)}}function Ks(t,n,e=!1){const i=n.emitsCache,s=i.get(t);if(s!==void 0)return s;const r=t.emits;let o={},l=!1;if(!de(t)){const a=c=>{const h=Ks(c,n,!0);h&&(l=!0,Re(o,h))};!e&&n.mixins.length&&n.mixins.forEach(a),t.extends&&a(t.extends),t.mixins&&t.mixins.forEach(a)}return!r&&!l?(xe(t)&&i.set(t,null),null):(ce(r)?r.forEach(a=>o[a]=null):Re(o,r),xe(t)&&i.set(t,o),o)}function Ti(t,n){return!t||!pi(n)?!1:(n=n.slice(2).replace(/Once$/,""),ge(t,n[0].toLowerCase()+n.slice(1))||ge(t,Lt(n))||ge(t,n))}let Fe=null,Xs=null;function ci(t){const n=Fe;return Fe=t,Xs=t&&t.type.__scopeId||null,n}function Fo(t,n=Fe,e){if(!n||t._n)return t;const i=(...s)=>{i._d&&Qn(-1);const r=ci(n);let o;try{o=t(...s)}finally{ci(r),i._d&&Qn(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Hi(t){const{type:n,vnode:e,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:l,emit:a,render:c,renderCache:h,props:p,data:m,setupState:T,ctx:x,inheritAttrs:S}=t,C=ci(t);let A,f;try{if(e.shapeFlag&4){const P=s||i,H=P;A=Xe(c.call(H,P,h,p,T,m,x)),f=l}else{const P=n;A=Xe(P.length>1?P(p,{attrs:l,slots:o,emit:a}):P(p,null)),f=n.props?l:Bo(l)}}catch(P){qt.length=0,_i(P,t,1),A=ie(Ct)}let _=A;if(f&&S!==!1){const P=Object.keys(f),{shapeFlag:H}=_;P.length&&H&7&&(r&&P.some(rn)&&(f=zo(f,r)),_=Bt(_,f,!1,!0))}return e.dirs&&(_=Bt(_,null,!1,!0),_.dirs=_.dirs?_.dirs.concat(e.dirs):e.dirs),e.transition&&(_.transition=e.transition),A=_,ci(C),A}const Bo=t=>{let n;for(const e in t)(e==="class"||e==="style"||pi(e))&&((n||(n={}))[e]=t[e]);return n},zo=(t,n)=>{const e={};for(const i in t)(!rn(i)||!(i.slice(9)in n))&&(e[i]=t[i]);return e};function Vo(t,n,e){const{props:i,children:s,component:r}=t,{props:o,children:l,patchFlag:a}=n,c=r.emitsOptions;if(n.dirs||n.transition)return!0;if(e&&a>=0){if(a&1024)return!0;if(a&16)return i?Un(i,o,c):!!o;if(a&8){const h=n.dynamicProps;for(let p=0;pt.__isSuspense;function Go(t,n){n&&n.pendingBranch?ce(t)?n.effects.push(...t):n.effects.push(t):Ao(t)}const qo=Symbol.for("v-scx"),Zo=()=>ri(qo),ii={};function Oi(t,n,e){return $s(t,n,e)}function $s(t,n,{immediate:e,deep:i,flush:s,once:r,onTrack:o,onTrigger:l}=Te){if(n&&r){const O=n;n=(...V)=>{O(...V),H()}}const a=Oe,c=O=>i===!0?O:Tt(O,i===!1?1:void 0);let h,p=!1,m=!1;if(Ve(t)?(h=()=>t.value,p=Wi(t)):jt(t)?(h=()=>c(t),p=!0):ce(t)?(m=!0,p=t.some(O=>jt(O)||Wi(O)),h=()=>t.map(O=>{if(Ve(O))return O.value;if(jt(O))return c(O);if(de(O))return ft(O,a,2)})):de(t)?n?h=()=>ft(t,a,2):h=()=>(T&&T(),Ge(t,a,3,[x])):h=Ne,n&&i){const O=h;h=()=>Tt(O())}let T,x=O=>{T=_.onStop=()=>{ft(O,a,4),T=_.onStop=void 0}},S;if(Ei)if(x=Ne,n?e&&Ge(n,a,3,[h(),m?[]:void 0,x]):h(),s==="sync"){const O=Zo();S=O.__watcherHandles||(O.__watcherHandles=[])}else return Ne;let C=m?new Array(t.length).fill(ii):ii;const A=()=>{if(!(!_.active||!_.dirty))if(n){const O=_.run();(i||p||(m?O.some((V,W)=>Pt(V,C[W])):Pt(O,C)))&&(T&&T(),Ge(n,a,3,[O,C===ii?void 0:m&&C[0]===ii?[]:C,x]),C=O)}else _.run()};A.allowRecurse=!!n;let f;s==="sync"?f=A:s==="post"?f=()=>Ie(A,a&&a.suspense):(A.pre=!0,a&&(A.id=a.uid),f=()=>yn(A));const _=new cn(h,Ne,f),P=so(),H=()=>{_.stop(),P&&on(P.effects,_)};return n?e?A():C=_.run():s==="post"?Ie(_.run.bind(_),a&&a.suspense):_.run(),S&&S.push(H),H}function Ko(t,n,e){const i=this.proxy,s=Se(t)?t.includes(".")?er(i,t):()=>i[t]:t.bind(i,i);let r;de(n)?r=n:(r=n.handler,e=n);const o=Yt(this),l=$s(s,r.bind(i),e);return o(),l}function er(t,n){const e=n.split(".");return()=>{let i=t;for(let s=0;s{Tt(i,n,e)});else if(bs(t))for(const i in t)Tt(t[i],n,e);return t}function De(t,n){if(Fe===null)return t;const e=Si(Fe)||Fe.proxy,i=t.dirs||(t.dirs=[]);for(let s=0;s!!t.type.__asyncLoader,tr=t=>t.type.__isKeepAlive;function Xo(t,n){ir(t,"a",n)}function Yo(t,n){ir(t,"da",n)}function ir(t,n,e=Oe){const i=t.__wdc||(t.__wdc=()=>{let s=e;for(;s;){if(s.isDeactivated)return;s=s.parent}return t()});if(xi(n,i,e),e){let s=e.parent;for(;s&&s.parent;)tr(s.parent.vnode)&&Jo(i,n,e,s),s=s.parent}}function Jo(t,n,e,i){const s=xi(n,t,i,!0);nr(()=>{on(i[n],s)},e)}function xi(t,n,e=Oe,i=!1){if(e){const s=e[t]||(e[t]=[]),r=n.__weh||(n.__weh=(...o)=>{if(e.isUnmounted)return;dt();const l=Yt(e),a=Ge(n,e,t,o);return l(),pt(),a});return i?s.unshift(r):s.push(r),r}}const tt=t=>(n,e=Oe)=>(!Ei||t==="sp")&&xi(t,(...i)=>n(...i),e),Qo=tt("bm"),$o=tt("m"),ea=tt("bu"),ta=tt("u"),ia=tt("bum"),nr=tt("um"),na=tt("sp"),sa=tt("rtg"),ra=tt("rtc");function oa(t,n=Oe){xi("ec",t,n)}function Be(t,n,e,i){let s;const r=e&&e[i];if(ce(t)||Se(t)){s=new Array(t.length);for(let o=0,l=t.length;on(o,l,void 0,r&&r[l]));else{const o=Object.keys(t);s=new Array(o.length);for(let l=0,a=o.length;lt?yr(t)?Si(t)||t.proxy:qi(t.parent):null,Wt=Re(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>qi(t.parent),$root:t=>qi(t.root),$emit:t=>t.emit,$options:t=>_n(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,yn(t.update)}),$nextTick:t=>t.n||(t.n=Ws.bind(t.proxy)),$watch:t=>Ko.bind(t)}),Mi=(t,n)=>t!==Te&&!t.__isScriptSetup&&ge(t,n),aa={get({_:t},n){if(n==="__v_skip")return!0;const{ctx:e,setupState:i,data:s,props:r,accessCache:o,type:l,appContext:a}=t;let c;if(n[0]!=="$"){const T=o[n];if(T!==void 0)switch(T){case 1:return i[n];case 2:return s[n];case 4:return e[n];case 3:return r[n]}else{if(Mi(i,n))return o[n]=1,i[n];if(s!==Te&&ge(s,n))return o[n]=2,s[n];if((c=t.propsOptions[0])&&ge(c,n))return o[n]=3,r[n];if(e!==Te&&ge(e,n))return o[n]=4,e[n];Zi&&(o[n]=0)}}const h=Wt[n];let p,m;if(h)return n==="$attrs"&&ze(t.attrs,"get",""),h(t);if((p=l.__cssModules)&&(p=p[n]))return p;if(e!==Te&&ge(e,n))return o[n]=4,e[n];if(m=a.config.globalProperties,ge(m,n))return m[n]},set({_:t},n,e){const{data:i,setupState:s,ctx:r}=t;return Mi(s,n)?(s[n]=e,!0):i!==Te&&ge(i,n)?(i[n]=e,!0):ge(t.props,n)||n[0]==="$"&&n.slice(1)in t?!1:(r[n]=e,!0)},has({_:{data:t,setupState:n,accessCache:e,ctx:i,appContext:s,propsOptions:r}},o){let l;return!!e[o]||t!==Te&&ge(t,o)||Mi(n,o)||(l=r[0])&&ge(l,o)||ge(i,o)||ge(Wt,o)||ge(s.config.globalProperties,o)},defineProperty(t,n,e){return e.get!=null?t._.accessCache[n]=0:ge(e,"value")&&this.set(t,n,e.value,null),Reflect.defineProperty(t,n,e)}};function Wn(t){return ce(t)?t.reduce((n,e)=>(n[e]=null,n),{}):t}let Zi=!0;function la(t){const n=_n(t),e=t.proxy,i=t.ctx;Zi=!1,n.beforeCreate&&Gn(n.beforeCreate,t,"bc");const{data:s,computed:r,methods:o,watch:l,provide:a,inject:c,created:h,beforeMount:p,mounted:m,beforeUpdate:T,updated:x,activated:S,deactivated:C,beforeDestroy:A,beforeUnmount:f,destroyed:_,unmounted:P,render:H,renderTracked:O,renderTriggered:V,errorCaptured:W,serverPrefetch:q,expose:$,inheritAttrs:oe,components:J,directives:fe,filters:ue}=n;if(c&&ca(c,i,null),o)for(const ae in o){const ee=o[ae];de(ee)&&(i[ae]=ee.bind(e))}if(s){const ae=s.call(e,e);xe(ae)&&(t.data=wi(ae))}if(Zi=!0,r)for(const ae in r){const ee=r[ae],ye=de(ee)?ee.bind(e,e):de(ee.get)?ee.get.bind(e,e):Ne,Y=!de(ee)&&de(ee.set)?ee.set.bind(e):Ne,Pe=Ze({get:ye,set:Y});Object.defineProperty(i,ae,{enumerable:!0,configurable:!0,get:()=>Pe.value,set:Ae=>Pe.value=Ae})}if(l)for(const ae in l)sr(l[ae],i,e,ae);if(a){const ae=de(a)?a.call(e):a;Reflect.ownKeys(ae).forEach(ee=>{ga(ee,ae[ee])})}h&&Gn(h,t,"c");function le(ae,ee){ce(ee)?ee.forEach(ye=>ae(ye.bind(e))):ee&&ae(ee.bind(e))}if(le(Qo,p),le($o,m),le(ea,T),le(ta,x),le(Xo,S),le(Yo,C),le(oa,W),le(ra,O),le(sa,V),le(ia,f),le(nr,P),le(na,q),ce($))if($.length){const ae=t.exposed||(t.exposed={});$.forEach(ee=>{Object.defineProperty(ae,ee,{get:()=>e[ee],set:ye=>e[ee]=ye})})}else t.exposed||(t.exposed={});H&&t.render===Ne&&(t.render=H),oe!=null&&(t.inheritAttrs=oe),J&&(t.components=J),fe&&(t.directives=fe)}function ca(t,n,e=Ne){ce(t)&&(t=Ki(t));for(const i in t){const s=t[i];let r;xe(s)?"default"in s?r=ri(s.from||i,s.default,!0):r=ri(s.from||i):r=ri(s),Ve(r)?Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):n[i]=r}}function Gn(t,n,e){Ge(ce(t)?t.map(i=>i.bind(n.proxy)):t.bind(n.proxy),n,e)}function sr(t,n,e,i){const s=i.includes(".")?er(e,i):()=>e[i];if(Se(t)){const r=n[t];de(r)&&Oi(s,r)}else if(de(t))Oi(s,t.bind(e));else if(xe(t))if(ce(t))t.forEach(r=>sr(r,n,e,i));else{const r=de(t.handler)?t.handler.bind(e):n[t.handler];de(r)&&Oi(s,r,t)}}function _n(t){const n=t.type,{mixins:e,extends:i}=n,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,l=r.get(n);let a;return l?a=l:!s.length&&!e&&!i?a=n:(a={},s.length&&s.forEach(c=>ui(a,c,o,!0)),ui(a,n,o)),xe(n)&&r.set(n,a),a}function ui(t,n,e,i=!1){const{mixins:s,extends:r}=n;r&&ui(t,r,e,!0),s&&s.forEach(o=>ui(t,o,e,!0));for(const o in n)if(!(i&&o==="expose")){const l=ua[o]||e&&e[o];t[o]=l?l(t[o],n[o]):n[o]}return t}const ua={data:qn,props:Zn,emits:Zn,methods:Nt,computed:Nt,beforeCreate:Me,created:Me,beforeMount:Me,mounted:Me,beforeUpdate:Me,updated:Me,beforeDestroy:Me,beforeUnmount:Me,destroyed:Me,unmounted:Me,activated:Me,deactivated:Me,errorCaptured:Me,serverPrefetch:Me,components:Nt,directives:Nt,watch:fa,provide:qn,inject:ha};function qn(t,n){return n?t?function(){return Re(de(t)?t.call(this,this):t,de(n)?n.call(this,this):n)}:n:t}function ha(t,n){return Nt(Ki(t),Ki(n))}function Ki(t){if(ce(t)){const n={};for(let e=0;e1)return e&&de(n)?n.call(i&&i.proxy):n}}const or={},ar=()=>Object.create(or),lr=t=>Object.getPrototypeOf(t)===or;function ma(t,n,e,i=!1){const s={},r=ar();t.propsDefaults=Object.create(null),cr(t,n,s,r);for(const o in t.propsOptions[0])o in s||(s[o]=void 0);e?t.props=i?s:So(s):t.type.props?t.props=s:t.props=r,t.attrs=r}function va(t,n,e,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=t,l=we(s),[a]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const h=t.vnode.dynamicProps;for(let p=0;p{a=!0;const[m,T]=ur(p,n,!0);Re(o,m),T&&l.push(...T)};!e&&n.mixins.length&&n.mixins.forEach(h),t.extends&&h(t.extends),t.mixins&&t.mixins.forEach(h)}if(!r&&!a)return xe(t)&&i.set(t,kt),kt;if(ce(r))for(let h=0;h-1,T[1]=S<0||x-1||ge(T,"default"))&&l.push(p)}}}const c=[o,l];return xe(t)&&i.set(t,c),c}function Kn(t){return t[0]!=="$"&&!Ut(t)}function Xn(t){return t===null?"null":typeof t=="function"?t.name||"":typeof t=="object"&&t.constructor&&t.constructor.name||""}function Yn(t,n){return Xn(t)===Xn(n)}function Jn(t,n){return ce(n)?n.findIndex(e=>Yn(e,t)):de(n)&&Yn(n,t)?0:-1}const hr=t=>t[0]==="_"||t==="$stable",Tn=t=>ce(t)?t.map(Xe):[Xe(t)],ya=(t,n,e)=>{if(n._n)return n;const i=Fo((...s)=>Tn(n(...s)),e);return i._c=!1,i},fr=(t,n,e)=>{const i=t._ctx;for(const s in t){if(hr(s))continue;const r=t[s];if(de(r))n[s]=ya(s,r,i);else if(r!=null){const o=Tn(r);n[s]=()=>o}}},dr=(t,n)=>{const e=Tn(n);t.slots.default=()=>e},wa=(t,n)=>{const e=t.slots=ar();if(t.vnode.shapeFlag&32){const i=n._;i?(Re(e,n),Es(e,"_",i,!0)):fr(n,e)}else n&&dr(t,n)},_a=(t,n,e)=>{const{vnode:i,slots:s}=t;let r=!0,o=Te;if(i.shapeFlag&32){const l=n._;l?e&&l===1?r=!1:(Re(s,n),!e&&l===1&&delete s._):(r=!n.$stable,fr(n,s)),o=n}else n&&(dr(t,n),o={default:1});if(r)for(const l in s)!hr(l)&&o[l]==null&&delete s[l]};function Yi(t,n,e,i,s=!1){if(ce(t)){t.forEach((m,T)=>Yi(m,n&&(ce(n)?n[T]:n),e,i,s));return}if(si(i)&&!s)return;const r=i.shapeFlag&4?Si(i.component)||i.component.proxy:i.el,o=s?null:r,{i:l,r:a}=t,c=n&&n.r,h=l.refs===Te?l.refs={}:l.refs,p=l.setupState;if(c!=null&&c!==a&&(Se(c)?(h[c]=null,ge(p,c)&&(p[c]=null)):Ve(c)&&(c.value=null)),de(a))ft(a,l,12,[o,h]);else{const m=Se(a),T=Ve(a);if(m||T){const x=()=>{if(t.f){const S=m?ge(p,a)?p[a]:h[a]:a.value;s?ce(S)&&on(S,r):ce(S)?S.includes(r)||S.push(r):m?(h[a]=[r],ge(p,a)&&(p[a]=h[a])):(a.value=[r],t.k&&(h[t.k]=a.value))}else m?(h[a]=o,ge(p,a)&&(p[a]=o)):T&&(a.value=o,t.k&&(h[t.k]=o))};o?(x.id=-1,Ie(x,e)):x()}}}const Ie=Go;function Ta(t){return xa(t)}function xa(t,n){const e=Ss();e.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:l,createComment:a,setText:c,setElementText:h,parentNode:p,nextSibling:m,setScopeId:T=Ne,insertStaticContent:x}=t,S=(E,u,v,b=null,L=null,R=null,B=void 0,k=null,N=!!u.dynamicChildren)=>{if(E===u)return;E&&!zt(E,u)&&(b=$e(E),Ae(E,L,R,!0),E=null),u.patchFlag===-2&&(N=!1,u.dynamicChildren=null);const{type:z,ref:U,shapeFlag:G}=u;switch(z){case bi:C(E,u,v,b);break;case Ct:A(E,u,v,b);break;case Ai:E==null&&f(u,v,b,B);break;case ve:J(E,u,v,b,L,R,B,k,N);break;default:G&1?H(E,u,v,b,L,R,B,k,N):G&6?fe(E,u,v,b,L,R,B,k,N):(G&64||G&128)&&z.process(E,u,v,b,L,R,B,k,N,Ue)}U!=null&&L&&Yi(U,E&&E.ref,R,u||E,!u)},C=(E,u,v,b)=>{if(E==null)i(u.el=l(u.children),v,b);else{const L=u.el=E.el;u.children!==E.children&&c(L,u.children)}},A=(E,u,v,b)=>{E==null?i(u.el=a(u.children||""),v,b):u.el=E.el},f=(E,u,v,b)=>{[E.el,E.anchor]=x(E.children,u,v,b,E.el,E.anchor)},_=({el:E,anchor:u},v,b)=>{let L;for(;E&&E!==u;)L=m(E),i(E,v,b),E=L;i(u,v,b)},P=({el:E,anchor:u})=>{let v;for(;E&&E!==u;)v=m(E),s(E),E=v;s(u)},H=(E,u,v,b,L,R,B,k,N)=>{u.type==="svg"?B="svg":u.type==="math"&&(B="mathml"),E==null?O(u,v,b,L,R,B,k,N):q(E,u,L,R,B,k,N)},O=(E,u,v,b,L,R,B,k)=>{let N,z;const{props:U,shapeFlag:G,transition:X,dirs:K}=E;if(N=E.el=o(E.type,R,U&&U.is,U),G&8?h(N,E.children):G&16&&W(E.children,N,null,b,L,Di(E,R),B,k),K&&yt(E,null,b,"created"),V(N,E,E.scopeId,B,b),U){for(const pe in U)pe!=="value"&&!Ut(pe)&&r(N,pe,null,U[pe],R,E.children,b,L,ke);"value"in U&&r(N,"value",null,U.value,R),(z=U.onVnodeBeforeMount)&&qe(z,b,E)}K&&yt(E,null,b,"beforeMount");const te=ba(L,X);te&&X.beforeEnter(N),i(N,u,v),((z=U&&U.onVnodeMounted)||te||K)&&Ie(()=>{z&&qe(z,b,E),te&&X.enter(N),K&&yt(E,null,b,"mounted")},L)},V=(E,u,v,b,L)=>{if(v&&T(E,v),b)for(let R=0;R{for(let z=N;z{const k=u.el=E.el;let{patchFlag:N,dynamicChildren:z,dirs:U}=u;N|=E.patchFlag&16;const G=E.props||Te,X=u.props||Te;let K;if(v&&wt(v,!1),(K=X.onVnodeBeforeUpdate)&&qe(K,v,u,E),U&&yt(u,E,v,"beforeUpdate"),v&&wt(v,!0),z?$(E.dynamicChildren,z,k,v,b,Di(u,L),R):B||ee(E,u,k,null,v,b,Di(u,L),R,!1),N>0){if(N&16)oe(k,u,G,X,v,b,L);else if(N&2&&G.class!==X.class&&r(k,"class",null,X.class,L),N&4&&r(k,"style",G.style,X.style,L),N&8){const te=u.dynamicProps;for(let pe=0;pe{K&&qe(K,v,u,E),U&&yt(u,E,v,"updated")},b)},$=(E,u,v,b,L,R,B)=>{for(let k=0;k{if(v!==b){if(v!==Te)for(const k in v)!Ut(k)&&!(k in b)&&r(E,k,v[k],null,B,u.children,L,R,ke);for(const k in b){if(Ut(k))continue;const N=b[k],z=v[k];N!==z&&k!=="value"&&r(E,k,z,N,B,u.children,L,R,ke)}"value"in b&&r(E,"value",v.value,b.value,B)}},J=(E,u,v,b,L,R,B,k,N)=>{const z=u.el=E?E.el:l(""),U=u.anchor=E?E.anchor:l("");let{patchFlag:G,dynamicChildren:X,slotScopeIds:K}=u;K&&(k=k?k.concat(K):K),E==null?(i(z,v,b),i(U,v,b),W(u.children||[],v,U,L,R,B,k,N)):G>0&&G&64&&X&&E.dynamicChildren?($(E.dynamicChildren,X,v,L,R,B,k),(u.key!=null||L&&u===L.subTree)&&pr(E,u,!0)):ee(E,u,v,U,L,R,B,k,N)},fe=(E,u,v,b,L,R,B,k,N)=>{u.slotScopeIds=k,E==null?u.shapeFlag&512?L.ctx.activate(u,v,b,B,N):ue(u,v,b,L,R,B,N):me(E,u,N)},ue=(E,u,v,b,L,R,B)=>{const k=E.component=Ma(E,b,L);if(tr(E)&&(k.ctx.renderer=Ue),Da(k),k.asyncDep){if(L&&L.registerDep(k,le),!E.el){const N=k.subTree=ie(Ct);A(null,N,u,v)}}else le(k,E,u,v,L,R,B)},me=(E,u,v)=>{const b=u.component=E.component;if(Vo(E,u,v))if(b.asyncDep&&!b.asyncResolved){ae(b,u,v);return}else b.next=u,Do(b.update),b.effect.dirty=!0,b.update();else u.el=E.el,b.vnode=u},le=(E,u,v,b,L,R,B)=>{const k=()=>{if(E.isMounted){let{next:U,bu:G,u:X,parent:K,vnode:te}=E;{const w=gr(E);if(w){U&&(U.el=te.el,ae(E,U,B)),w.asyncDep.then(()=>{E.isUnmounted||k()});return}}let pe=U,g;wt(E,!1),U?(U.el=te.el,ae(E,U,B)):U=te,G&&ni(G),(g=U.props&&U.props.onVnodeBeforeUpdate)&&qe(g,K,U,te),wt(E,!0);const d=Hi(E),y=E.subTree;E.subTree=d,S(y,d,p(y.el),$e(y),E,L,R),U.el=d.el,pe===null&&No(E,d.el),X&&Ie(X,L),(g=U.props&&U.props.onVnodeUpdated)&&Ie(()=>qe(g,K,U,te),L)}else{let U;const{el:G,props:X}=u,{bm:K,m:te,parent:pe}=E,g=si(u);if(wt(E,!1),K&&ni(K),!g&&(U=X&&X.onVnodeBeforeMount)&&qe(U,pe,u),wt(E,!0),G&&vt){const d=()=>{E.subTree=Hi(E),vt(G,E.subTree,E,L,null)};g?u.type.__asyncLoader().then(()=>!E.isUnmounted&&d()):d()}else{const d=E.subTree=Hi(E);S(null,d,v,b,E,L,R),u.el=d.el}if(te&&Ie(te,L),!g&&(U=X&&X.onVnodeMounted)){const d=u;Ie(()=>qe(U,pe,d),L)}(u.shapeFlag&256||pe&&si(pe.vnode)&&pe.vnode.shapeFlag&256)&&E.a&&Ie(E.a,L),E.isMounted=!0,u=v=b=null}},N=E.effect=new cn(k,Ne,()=>yn(z),E.scope),z=E.update=()=>{N.dirty&&N.run()};z.id=E.uid,wt(E,!0),z()},ae=(E,u,v)=>{u.component=E;const b=E.vnode.props;E.vnode=u,E.next=null,va(E,u.props,b,v),_a(E,u.children,v),dt(),Nn(E),pt()},ee=(E,u,v,b,L,R,B,k,N=!1)=>{const z=E&&E.children,U=E?E.shapeFlag:0,G=u.children,{patchFlag:X,shapeFlag:K}=u;if(X>0){if(X&128){Y(z,G,v,b,L,R,B,k,N);return}else if(X&256){ye(z,G,v,b,L,R,B,k,N);return}}K&8?(U&16&&ke(z,L,R),G!==z&&h(v,G)):U&16?K&16?Y(z,G,v,b,L,R,B,k,N):ke(z,L,R,!0):(U&8&&h(v,""),K&16&&W(G,v,b,L,R,B,k,N))},ye=(E,u,v,b,L,R,B,k,N)=>{E=E||kt,u=u||kt;const z=E.length,U=u.length,G=Math.min(z,U);let X;for(X=0;XU?ke(E,L,R,!0,!1,G):W(u,v,b,L,R,B,k,N,G)},Y=(E,u,v,b,L,R,B,k,N)=>{let z=0;const U=u.length;let G=E.length-1,X=U-1;for(;z<=G&&z<=X;){const K=E[z],te=u[z]=N?ct(u[z]):Xe(u[z]);if(zt(K,te))S(K,te,v,null,L,R,B,k,N);else break;z++}for(;z<=G&&z<=X;){const K=E[G],te=u[X]=N?ct(u[X]):Xe(u[X]);if(zt(K,te))S(K,te,v,null,L,R,B,k,N);else break;G--,X--}if(z>G){if(z<=X){const K=X+1,te=KX)for(;z<=G;)Ae(E[z],L,R,!0),z++;else{const K=z,te=z,pe=new Map;for(z=te;z<=X;z++){const he=u[z]=N?ct(u[z]):Xe(u[z]);he.key!=null&&pe.set(he.key,z)}let g,d=0;const y=X-te+1;let w=!1,F=0;const j=new Array(y);for(z=0;z=y){Ae(he,L,R,!0);continue}let Q;if(he.key!=null)Q=pe.get(he.key);else for(g=te;g<=X;g++)if(j[g-te]===0&&zt(he,u[g])){Q=g;break}Q===void 0?Ae(he,L,R,!0):(j[Q-te]=z+1,Q>=F?F=Q:w=!0,S(he,u[Q],v,null,L,R,B,k,N),d++)}const ne=w?Ea(j):kt;for(g=ne.length-1,z=y-1;z>=0;z--){const he=te+z,Q=u[he],Le=he+1{const{el:R,type:B,transition:k,children:N,shapeFlag:z}=E;if(z&6){Pe(E.component.subTree,u,v,b);return}if(z&128){E.suspense.move(u,v,b);return}if(z&64){B.move(E,u,v,Ue);return}if(B===ve){i(R,u,v);for(let G=0;Gk.enter(R),L);else{const{leave:G,delayLeave:X,afterLeave:K}=k,te=()=>i(R,u,v),pe=()=>{G(R,()=>{te(),K&&K()})};X?X(R,te,pe):pe()}else i(R,u,v)},Ae=(E,u,v,b=!1,L=!1)=>{const{type:R,props:B,ref:k,children:N,dynamicChildren:z,shapeFlag:U,patchFlag:G,dirs:X}=E;if(k!=null&&Yi(k,null,v,E,!0),U&256){u.ctx.deactivate(E);return}const K=U&1&&X,te=!si(E);let pe;if(te&&(pe=B&&B.onVnodeBeforeUnmount)&&qe(pe,u,E),U&6)Ht(E.component,v,b);else{if(U&128){E.suspense.unmount(v,b);return}K&&yt(E,null,u,"beforeUnmount"),U&64?E.type.remove(E,u,v,L,Ue,b):z&&(R!==ve||G>0&&G&64)?ke(z,u,v,!1,!0):(R===ve&&G&384||!L&&U&16)&&ke(N,u,v),b&&mt(E)}(te&&(pe=B&&B.onVnodeUnmounted)||K)&&Ie(()=>{pe&&qe(pe,u,E),K&&yt(E,null,u,"unmounted")},v)},mt=E=>{const{type:u,el:v,anchor:b,transition:L}=E;if(u===ve){st(v,b);return}if(u===Ai){P(E);return}const R=()=>{s(v),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(E.shapeFlag&1&&L&&!L.persisted){const{leave:B,delayLeave:k}=L,N=()=>B(v,R);k?k(E.el,R,N):N()}else R()},st=(E,u)=>{let v;for(;E!==u;)v=m(E),s(E),E=v;s(u)},Ht=(E,u,v)=>{const{bum:b,scope:L,update:R,subTree:B,um:k}=E;b&&ni(b),L.stop(),R&&(R.active=!1,Ae(B,E,u,v)),k&&Ie(k,u),Ie(()=>{E.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&E.asyncDep&&!E.asyncResolved&&E.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},ke=(E,u,v,b=!1,L=!1,R=0)=>{for(let B=R;BE.shapeFlag&6?$e(E.component.subTree):E.shapeFlag&128?E.suspense.next():m(E.anchor||E.el);let rt=!1;const Ot=(E,u,v)=>{E==null?u._vnode&&Ae(u._vnode,null,null,!0):S(u._vnode||null,E,u,null,null,null,v),rt||(rt=!0,Nn(),qs(),rt=!1),u._vnode=E},Ue={p:S,um:Ae,m:Pe,r:mt,mt:ue,mc:W,pc:ee,pbc:$,n:$e,o:t};let ot,vt;return n&&([ot,vt]=n(Ue)),{render:Ot,hydrate:ot,createApp:pa(Ot,ot)}}function Di({type:t,props:n},e){return e==="svg"&&t==="foreignObject"||e==="mathml"&&t==="annotation-xml"&&n&&n.encoding&&n.encoding.includes("html")?void 0:e}function wt({effect:t,update:n},e){t.allowRecurse=n.allowRecurse=e}function ba(t,n){return(!t||t&&!t.pendingBranch)&&n&&!n.persisted}function pr(t,n,e=!1){const i=t.children,s=n.children;if(ce(i)&&ce(s))for(let r=0;r>1,t[e[l]]0&&(n[i]=e[r-1]),e[r]=i)}}for(r=e.length,o=e[r-1];r-- >0;)e[r]=o,o=n[o];return e}function gr(t){const n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:gr(n)}const Sa=t=>t.__isTeleport,ve=Symbol.for("v-fgt"),bi=Symbol.for("v-txt"),Ct=Symbol.for("v-cmt"),Ai=Symbol.for("v-stc"),qt=[];let We=null;function M(t=!1){qt.push(We=t?null:[])}function Pa(){qt.pop(),We=qt[qt.length-1]||null}let Xt=1;function Qn(t){Xt+=t}function mr(t){return t.dynamicChildren=Xt>0?We||kt:null,Pa(),Xt>0&&We&&We.push(t),t}function I(t,n,e,i,s,r){return mr(D(t,n,e,i,s,r,!0))}function Ee(t,n,e,i,s){return mr(ie(t,n,e,i,s,!0))}function Ji(t){return t?t.__v_isVNode===!0:!1}function zt(t,n){return t.type===n.type&&t.key===n.key}const vr=({key:t})=>t??null,oi=({ref:t,ref_key:n,ref_for:e})=>(typeof t=="number"&&(t=""+t),t!=null?Se(t)||Ve(t)||de(t)?{i:Fe,r:t,k:n,f:!!e}:t:null);function D(t,n=null,e=null,i=0,s=null,r=t===ve?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:n,key:n&&vr(n),ref:n&&oi(n),scopeId:Xs,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Fe};return l?(xn(a,e),r&128&&t.normalize(a)):e&&(a.shapeFlag|=Se(e)?8:16),Xt>0&&!o&&We&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&We.push(a),a}const ie=Ca;function Ca(t,n=null,e=null,i=0,s=null,r=!1){if((!t||t===jo)&&(t=Ct),Ji(t)){const l=Bt(t,n,!0);return e&&xn(l,e),Xt>0&&!r&&We&&(l.shapeFlag&6?We[We.indexOf(t)]=l:We.push(l)),l.patchFlag|=-2,l}if(Ba(t)&&(t=t.__vccOpts),n){n=Ra(n);let{class:l,style:a}=n;l&&!Se(l)&&(n.class=_e(l)),xe(a)&&(Vs(a)&&!ce(a)&&(a=Re({},a)),n.style=ln(a))}const o=Se(t)?1:Wo(t)?128:Sa(t)?64:xe(t)?4:de(t)?2:0;return D(t,n,e,i,s,o,r,!0)}function Ra(t){return t?Vs(t)||lr(t)?Re({},t):t:null}function Bt(t,n,e=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:l,transition:a}=t,c=n?La(s||{},n):s,h={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&vr(c),ref:n&&n.ref?e&&r?ce(r)?r.concat(oi(n)):[r,oi(n)]:oi(n):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:n&&t.type!==ve?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:a,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Bt(t.ssContent),ssFallback:t.ssFallback&&Bt(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return a&&i&&(h.transition=a.clone(h)),h}function be(t=" ",n=0){return ie(bi,null,t,n)}function se(t="",n=!1){return n?(M(),Ee(Ct,null,t)):ie(Ct,null,t)}function Xe(t){return t==null||typeof t=="boolean"?ie(Ct):ce(t)?ie(ve,null,t.slice()):typeof t=="object"?ct(t):ie(bi,null,String(t))}function ct(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Bt(t)}function xn(t,n){let e=0;const{shapeFlag:i}=t;if(n==null)n=null;else if(ce(n))e=16;else if(typeof n=="object")if(i&65){const s=n.default;s&&(s._c&&(s._d=!1),xn(t,s()),s._c&&(s._d=!0));return}else{e=32;const s=n._;!s&&!lr(n)?n._ctx=Fe:s===3&&Fe&&(Fe.slots._===1?n._=1:(n._=2,t.patchFlag|=1024))}else de(n)?(n={default:n,_ctx:Fe},e=32):(n=String(n),i&64?(e=16,n=[be(n)]):e=8);t.children=n,t.shapeFlag|=e}function La(...t){const n={};for(let e=0;e{let s;return(s=t[e])||(s=t[e]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};hi=n("__VUE_INSTANCE_SETTERS__",e=>Oe=e),Qi=n("__VUE_SSR_SETTERS__",e=>Ei=e)}const Yt=t=>{const n=Oe;return hi(t),t.scope.on(),()=>{t.scope.off(),hi(n)}},$n=()=>{Oe&&Oe.scope.off(),hi(null)};function yr(t){return t.vnode.shapeFlag&4}let Ei=!1;function Da(t,n=!1){n&&Qi(n);const{props:e,children:i}=t.vnode,s=yr(t);ma(t,e,s,n),wa(t,i);const r=s?Aa(t,n):void 0;return n&&Qi(!1),r}function Aa(t,n){const e=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,aa);const{setup:i}=e;if(i){const s=t.setupContext=i.length>1?Ia(t):null,r=Yt(t);dt();const o=ft(i,t,0,[t.props,s]);if(pt(),r(),Ts(o)){if(o.then($n,$n),n)return o.then(l=>{es(t,l,n)}).catch(l=>{_i(l,t,0)});t.asyncDep=o}else es(t,o,n)}else wr(t,n)}function es(t,n,e){de(n)?t.type.__ssrInlineRender?t.ssrRender=n:t.render=n:xe(n)&&(t.setupState=Us(n)),wr(t,e)}let ts;function wr(t,n,e){const i=t.type;if(!t.render){if(!n&&ts&&!i.render){const s=i.template||_n(t).template;if(s){const{isCustomElement:r,compilerOptions:o}=t.appContext.config,{delimiters:l,compilerOptions:a}=i,c=Re(Re({isCustomElement:r,delimiters:l},o),a);i.render=ts(s,c)}}t.render=i.render||Ne}{const s=Yt(t);dt();try{la(t)}finally{pt(),s()}}}const ka={get(t,n){return ze(t,"get",""),t[n]}};function Ia(t){const n=e=>{t.exposed=e||{}};return{attrs:new Proxy(t.attrs,ka),slots:t.slots,emit:t.emit,expose:n}}function Si(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(Us(Po(t.exposed)),{get(n,e){if(e in n)return n[e];if(e in Wt)return Wt[e](t)},has(n,e){return e in n||e in Wt}}))}function Fa(t,n=!0){return de(t)?t.displayName||t.name:t.name||n&&t.__name}function Ba(t){return de(t)&&"__vccOpts"in t}const Ze=(t,n)=>Co(t,n,Ei);function za(t,n,e){const i=arguments.length;return i===2?xe(n)&&!ce(n)?Ji(n)?ie(t,null,[n]):ie(t,n):ie(t,null,n):(i>3?e=Array.prototype.slice.call(arguments,2):i===3&&Ji(e)&&(e=[e]),ie(t,n,e))}const Va="3.4.27";/** * @vue/runtime-dom v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const za="http://www.w3.org/2000/svg",Na="http://www.w3.org/1998/Math/MathML",ut=typeof document<"u"?document:null,ts=ut&&ut.createElement("template"),Va={insert:(t,n,e)=>{n.insertBefore(t,e||null)},remove:t=>{const n=t.parentNode;n&&n.removeChild(t)},createElement:(t,n,e,i)=>{const s=n==="svg"?ut.createElementNS(za,t):n==="mathml"?ut.createElementNS(Na,t):ut.createElement(t,e?{is:e}:void 0);return t==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:t=>ut.createTextNode(t),createComment:t=>ut.createComment(t),setText:(t,n)=>{t.nodeValue=n},setElementText:(t,n)=>{t.textContent=n},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ut.querySelector(t),setScopeId(t,n){t.setAttribute(n,"")},insertStaticContent(t,n,e,i,s,r){const o=e?e.previousSibling:n.lastChild;if(s&&(s===r||s.nextSibling))for(;n.insertBefore(s.cloneNode(!0),e),!(s===r||!(s=s.nextSibling)););else{ts.innerHTML=i==="svg"?`${t}`:i==="mathml"?`${t}`:t;const l=ts.content;if(i==="svg"||i==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}n.insertBefore(l,e)}return[o?o.nextSibling:n.firstChild,e?e.previousSibling:n.lastChild]}},Ua=Symbol("_vtc");function ja(t,n,e){const i=t[Ua];i&&(n=(n?[n,...i]:[...i]).join(" ")),n==null?t.removeAttribute("class"):e?t.setAttribute("class",n):t.className=n}const fi=Symbol("_vod"),yr=Symbol("_vsh"),Ze={beforeMount(t,{value:n},{transition:e}){t[fi]=t.style.display==="none"?"":t.style.display,e&&n?e.beforeEnter(t):zt(t,n)},mounted(t,{value:n},{transition:e}){e&&n&&e.enter(t)},updated(t,{value:n,oldValue:e},{transition:i}){!n!=!e&&(i?n?(i.beforeEnter(t),zt(t,!0),i.enter(t)):i.leave(t,()=>{zt(t,!1)}):zt(t,n))},beforeUnmount(t,{value:n}){zt(t,n)}};function zt(t,n){t.style.display=n?t[fi]:"none",t[yr]=!n}const Wa=Symbol(""),Ga=/(^|;)\s*display\s*:/;function qa(t,n,e){const i=t.style,s=Se(e);let r=!1;if(e&&!s){if(n)if(Se(n))for(const o of n.split(";")){const l=o.slice(0,o.indexOf(":")).trim();e[l]==null&&ai(i,l,"")}else for(const o in n)e[o]==null&&ai(i,o,"");for(const o in e)o==="display"&&(r=!0),ai(i,o,e[o])}else if(s){if(n!==e){const o=i[Wa];o&&(e+=";"+o),i.cssText=e,r=Ga.test(e)}}else n&&t.removeAttribute("style");fi in t&&(t[fi]=r?i.display:"",t[yr]&&(i.display="none"))}const is=/\s*!important$/;function ai(t,n,e){if(ce(e))e.forEach(i=>ai(t,n,i));else if(e==null&&(e=""),n.startsWith("--"))t.setProperty(n,e);else{const i=Za(t,n);is.test(e)?t.setProperty(Lt(i),e.replace(is,""),"important"):t[i]=e}}const ns=["Webkit","Moz","ms"],ki={};function Za(t,n){const e=ki[n];if(e)return e;let i=Ye(n);if(i!=="filter"&&i in t)return ki[n]=i;i=yi(i);for(let s=0;sFi||($a.then(()=>Fi=0),Fi=Date.now());function tl(t,n){const e=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=e.attached)return;Ge(il(i,e.value),n,5,[i])};return e.value=t,e.attached=el(),e}function il(t,n){if(ce(n)){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{e.call(t),t._stopped=!0},n.map(i=>s=>!s._stopped&&i&&i(s))}else return n}const as=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,nl=(t,n,e,i,s,r,o,l,a)=>{const c=s==="svg";n==="class"?ja(t,i,c):n==="style"?qa(t,e,i):gi(n)?sn(n)||Ja(t,n,e,i,o):(n[0]==="."?(n=n.slice(1),!0):n[0]==="^"?(n=n.slice(1),!1):sl(t,n,i,c))?Xa(t,n,i,r,o,l,a):(n==="true-value"?t._trueValue=i:n==="false-value"&&(t._falseValue=i),Ka(t,n,i,c))};function sl(t,n,e,i){if(i)return!!(n==="innerHTML"||n==="textContent"||n in t&&as(n)&&de(e));if(n==="spellcheck"||n==="draggable"||n==="translate"||n==="form"||n==="list"&&t.tagName==="INPUT"||n==="type"&&t.tagName==="TEXTAREA")return!1;if(n==="width"||n==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return as(n)&&Se(e)?!1:n in t}const ls=t=>{const n=t.props["onUpdate:modelValue"]||!1;return ce(n)?e=>ni(n,e):n};function rl(t){t.target.composing=!0}function cs(t){const n=t.target;n.composing&&(n.composing=!1,n.dispatchEvent(new Event("input")))}const Ii=Symbol("_assign"),wr={created(t,{modifiers:{lazy:n,trim:e,number:i}},s){t[Ii]=ls(s);const r=i||s.props&&s.props.type==="number";Dt(t,n?"change":"input",o=>{if(o.target.composing)return;let l=t.value;e&&(l=l.trim()),r&&(l=Bi(l)),t[Ii](l)}),e&&Dt(t,"change",()=>{t.value=t.value.trim()}),n||(Dt(t,"compositionstart",rl),Dt(t,"compositionend",cs),Dt(t,"change",cs))},mounted(t,{value:n}){t.value=n??""},beforeUpdate(t,{value:n,modifiers:{lazy:e,trim:i,number:s}},r){if(t[Ii]=ls(r),t.composing)return;const o=(s||t.type==="number")&&!/^0\d/.test(t.value)?Bi(t.value):t.value,l=n??"";o!==l&&(document.activeElement===t&&t.type!=="range"&&(e||i&&t.value.trim()===l)||(t.value=l))}},ol=["ctrl","shift","alt","meta"],al={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,n)=>ol.some(e=>t[`${e}Key`]&&!n.includes(e))},xt=(t,n)=>{const e=t._withMods||(t._withMods={}),i=n.join(".");return e[i]||(e[i]=(s,...r)=>{for(let o=0;o{const e=t._withKeys||(t._withKeys={}),i=n.join(".");return e[i]||(e[i]=s=>{if(!("key"in s))return;const r=Lt(s.key);if(n.some(o=>o===r||ll[o]===r))return t(s)})},cl=Re({patchProp:nl},Va);let us;function ul(){return us||(us=wa(cl))}const hl=(...t)=>{const n=ul().createApp(...t),{mount:e}=n;return n.mount=i=>{const s=dl(i);if(!s)return;const r=n._component;!de(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.innerHTML="";const o=e(s,!1,fl(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},n};function fl(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function dl(t){return Se(t)?document.querySelector(t):t}const ae=(t,n)=>{const e=t.__vccOpts||t;for(const[i,s]of n)e[i]=s;return e},pl={},gl={class:"tify-icon",viewBox:"0 0 24 24"},ml=A("path",{d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},null,-1),vl=[ml];function yl(t,n){return k(),F("svg",gl,vl)}const _r=ae(pl,[["render",yl]]);var wl={version:"0.31.0",license:"AGPL-3.0",bugsUrl:"https://github.com/tify-iiif-viewer/tify/issues",contributorsUrl:"https://github.com/tify-iiif-viewer/tify/blob/v0.31.0/CONTRIBUTORS.md",docsUrl:"https://github.com/tify-iiif-viewer/tify/blob/v0.31.0/doc",docsLanguages:["de","en"],repositoryUrl:"https://github.com/tify-iiif-viewer/tify"};const _l={computed:{copyrightHtml(){return'Copyright © 2017–2022 Göttingen University / Göttingen State and University Library'},env(){return wl},infoHtml(){return'TIFY is a slim and mobile-friendly IIIF document viewer, released under the GNU Affero General Public License 3.0.'},userGuideUrl(){const t=this.env.docsLanguages.includes(this.$store.options.language)?this.$store.options.language:"en";return`${this.env.docsUrl}/user-guide.${t}.md`}}},Tl={class:"tify-help",tabindex:"0"},xl={class:"tify-sr-only"},bl=["innerHTML"],Sl={class:"tify-list"},El=["href"],Pl=["href"],Cl=["href"],Rl=["href"],Ll={class:"tify-help-footer"},Hl=["innerHTML"];function Ol(t,n,e,i,s,r){return k(),F("section",Tl,[A("h2",xl,Z(t.$translate("Help")),1),A("h3",null,Z(t.$translate("About TIFY")),1),A("p",{innerHTML:t.$translate("$info",r.infoHtml)},null,8,bl),A("ul",Sl,[A("li",null,[A("a",{href:r.userGuideUrl},Z(t.$translate("User guide")),9,El)]),A("li",null,[A("a",{href:r.env.repositoryUrl},Z(t.$translate("Source code")),9,Pl)]),A("li",null,[A("a",{href:r.env.contributorsUrl},Z(t.$translate("Contributors")),9,Cl)]),A("li",null,[A("a",{href:r.env.bugsUrl},Z(t.$translate("Report a bug")),9,Rl)])]),A("footer",Ll,[A("p",null,[be(Z(t.$translate("Version"))+" ",1),A("b",null,Z(r.env.version),1),be(" · "),A("span",{innerHTML:t.$translate("$copyright",r.copyrightHtml)},null,8,Hl)])])])}const Ml=ae(_l,[["render",Ol]]),Dl={},Al={class:"tify-icon",viewBox:"0 0 24 24"},kl=A("path",{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"},null,-1),Fl=[kl];function Il(t,n){return k(),F("svg",Al,Fl)}const Tr=ae(Dl,[["render",Il]]),Bl={},zl={class:"tify-icon",viewBox:"0 0 24 24"},Nl=A("path",{d:"M19,13H5V11H19V13Z"},null,-1),Vl=[Nl];function Ul(t,n){return k(),F("svg",zl,Vl)}const xr=ae(Bl,[["render",Ul]]),jl={name:"CollectionNode",props:{item:{type:Object,default:()=>{}}},data(){return{children:null,expanded:!1,id:this.$store.getId(`collection-node-${Math.floor(Math.random()*1e12)}`)}},methods:{toggleChildren(){if(this.expanded){this.expanded=!1;return}if(this.children){this.expanded=!0;return}if(this.item.children){this.children=this.item.children,this.expanded=!0;return}this.$store.fetchJson(this.item["@id"]||this.item.id).then(t=>{this.children=t.collections||t.items||t.manifests||[],this.expanded=!0},t=>{const n=t.response&&(t.response.statusText||t.response.data)||t.message;this.$store.addError(`Error loading IIIF manifest: ${n}`),this.children=!1})}}},Wl=["aria-controls","aria-expanded"],Gl={class:"tify-sr-only"},ql={class:"tify-sr-only"},Zl=["id"],Kl={key:1,class:"tify-collection-error"};function Xl(t,n,e,i,s,r){const o=xr,l=Tr,a=Xs("CollectionNode",!0);return k(),F("li",{class:Te(["tify-collection-item",{"-current":t.$store.manifest&&t.$store.manifest.id===(e.item["@id"]||e.item.id)}])},[e.item.type==="Collection"?(k(),F("button",{key:0,type:"button","aria-controls":s.id,"aria-expanded":s.expanded?"true":"false",class:"tify-collection-link -has-children",onClick:n[0]||(n[0]=c=>r.toggleChildren())},[s.expanded?(k(),F(ve,{key:0},[ie(o),A("span",Gl,Z(t.$translate("Collapse")),1)],64)):(k(),F(ve,{key:1},[ie(l),A("span",ql,Z(t.$translate("Expand")),1)],64)),be(" "+Z(t.$store.localize(e.item.label)),1)],8,Wl)):(k(),F("a",{key:1,href:"javascript:;",class:"tify-collection-link",onClick:n[1]||(n[1]=c=>t.$store.loadManifest(e.item["@id"]||e.item.id,{expectedType:e.item.type,reset:!0}))},Z(t.$store.localize(e.item.label)),1)),s.expanded?(k(),F(ve,{key:2},[s.expanded?(k(),F("ol",{key:0,id:s.id,class:"tify-collection-list"},[(k(!0),F(ve,null,Be(s.children,c=>(k(),Ce(a,{key:c.id,item:c},null,8,["item"]))),128))],8,Zl)):s.children===!1?(k(),F("p",Kl,Z(t.$translate("Could not load child manifest")),1)):se("",!0)],64)):se("",!0)],2)}const Yl=ae(jl,[["render",Xl]]),Jl={data(){return{filter:""}},computed:{filteredItems(){const t=this.filter.trim().toLowerCase().split(/\s+/);return this.$store.collection.items.filter(n=>{const e=(this.$store.localize(n.label)||"").toLowerCase();return t.every(i=>e.includes(i))})}}},Ql={class:"tify-collection",tabindex:"0"},$l={class:"tify-sr-only"},ec={key:0,class:"tify-collection-controls"},tc=["aria-label","placeholder"],ic=["disabled"],nc={key:1,class:"tify-collection-list"},sc={key:2,class:"tify-collection-no-results"};function rc(t,n,e,i,s,r){const o=Yl;return k(),F("section",Ql,[A("h2",$l,Z(t.$translate("Collection")),1),t.$store.collection.items.length>5?(k(),F("p",ec,[De(A("input",{"onUpdate:modelValue":n[0]||(n[0]=l=>s.filter=l),"aria-label":t.$translate("Filter collection"),class:"tify-collection-filter",placeholder:t.$translate("Filter collection"),type:"text",onKeydown:[n[1]||(n[1]=Vt(xt(l=>s.filter?s.filter="":l.target.blur(),["prevent"]),["esc"])),n[2]||(n[2]=xt(()=>{},["stop"]))]},null,40,tc),[[wr,s.filter]]),A("button",{type:"button",class:"tify-collection-reset",disabled:!s.filter,onClick:n[3]||(n[3]=l=>s.filter="")},Z(t.$translate("Reset")),9,ic)])):se("",!0),r.filteredItems.length?(k(),F("ol",nc,[(k(!0),F(ve,null,Be(r.filteredItems,l=>(k(),Ce(o,{key:l.id,item:l},null,8,["item"]))),128))])):(k(),F("p",sc,Z(t.$translate("No results")),1))])}const oc=ae(Jl,[["render",rc]]),ac={},lc={class:"tify-icon",viewBox:"0 0 24 24"},cc=A("path",{d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"},null,-1),uc=[cc];function hc(t,n){return k(),F("svg",lc,uc)}const fc=ae(ac,[["render",hc]]),dc={},pc={class:"tify-icon",viewBox:"0 0 24 24"},gc=A("path",{d:"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"},null,-1),mc=[gc];function vc(t,n){return k(),F("svg",pc,mc)}const yc=ae(dc,[["render",vc]]);var xn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var br={exports:{}};(function(t){(function(n){if(typeof e!="function"){var e=function(x){return x};e.nonNative=!0}const i=e("plaintext"),s=e("html"),r=e("comment"),o=/<(\w*)>/g,l=/<\/?([^\s\/>]+)/;function a(x,E,R){x=x||"",E=E||[],R=R||"";let M=h(E,R);return p(x,M)}function c(x,E){x=x||[],E=E||"";let R=h(x,E);return function(f){return p(f||"",R)}}a.init_streaming_mode=c;function h(x,E){return x=m(x),{allowable_tags:x,tag_replacement:E,state:i,tag_buffer:"",depth:0,in_quote_char:""}}function p(x,E){if(typeof x!="string")throw new TypeError("'html' parameter must be a string");let R=E.allowable_tags,M=E.tag_replacement,f=E.state,_=E.tag_buffer,H=E.depth,L=E.in_quote_char,O="";for(let N=0,G=x.length;N":if(L)break;if(H){H--;break}L="",f=i,_+=">",R.has(T(_))?O+=_:O+=M,_="";break;case'"':case"'":q===L?L="":L=L||q,_+=q;break;case"-":_==="":_.slice(-2)=="--"&&(f=i),_="";break;default:_+=q;break}}return E.state=f,E.tag_buffer=_,E.depth=H,E.in_quote_char=L,O}function m(x){let E=new Set;if(typeof x=="string"){let R;for(;R=o.exec(x);)E.add(R[1])}else!e.nonNative&&typeof x[e.iterator]=="function"?E=new Set(x):typeof x.forEach=="function"&&x.forEach(E.add,E);return E}function T(x){let E=l.exec(x);return E?E[1].toLowerCase():null}t.exports?t.exports=a:n.striptags=a})(xn)})(br);var wc=br.exports;const _c=bn(wc);function di(t){const n=["a","b","br","i","img","p","span"],e={a:["href"],img:["alt","src"]};let i=_c(t,n);const s=/<(\w+)((\s+.+?(\s*=\s*(?:".*?"|'.*?'|.*?|[\^'">\s]+))?)+\s*|\s*)>/g;return i=i.replace(s,(r,o,l)=>{if(!l)return`<${o}>`;const a=/(?:([^\s]+)=(?:"(.*?)"|'(.*?)'))|([^\s]+)/g,c=[];return l.replace(a,(h,p)=>{h!==p&&e[o]&&e[o].includes(p)&&c.push(h)}),c.length>0?`<${o} ${c.join(" ")}>`:`<${o}>`}),i}function hs(t,n){if(!(t instanceof Array)||!n||new Set(t).size!==t.length)return!1;for(let e=0,i=t.length;e0&&t[e]>0&&t[e]<=t[e-1]||t[e]<0||t[e]>n)return!1;return!0}function Sn(t,n=["https:","http:"]){let e;try{e=new URL(t)}catch{return!1}return n.includes(e.protocol)}const Tc={props:{metadata:{type:Array,default:()=>[]}},data(){return{infoItems:[]}},watch:{metadata(){this.updateInfoItems()}},mounted(){this.updateInfoItems()},methods:{cleanLabel(t){const n=t.replace("_"," ");return n.charAt(0).toUpperCase()+n.substr(1)},updateInfoItems(){this.$nextTick(()=>{this.$refs.contents&&this.$refs.contents.forEach((t,n)=>{const e=t.offsetHeight;this.infoItems[n]={collapsed:!0,exceedsHeight:!0},this.$nextTick(()=>{const i=t.offsetHeight,s=e>=i;this.infoItems[n]={collapsed:s,exceedsHeight:s}})})})},filterHtml:di,isValidUrl:Sn}},xc={class:"tify-info-metadata"},bc={class:"tify-info-value"},Sc=["href"],Ec=["innerHTML"],Pc=["onClick"];function Cc(t,n,e,i,s,r){const o=yc,l=fc;return k(),F("div",xc,[(k(!0),F(ve,null,Be(e.metadata,(a,c)=>(k(),F("div",{key:c},[A("h4",null,Z(r.cleanLabel(t.$store.localize(a.label))),1),A("div",{ref_for:!0,ref:"contents",class:Te(["tify-info-content",{"-collapsed":s.infoItems[c]&&s.infoItems[c].collapsed}])},[A("div",bc,[r.isValidUrl(a.value)?(k(),F("p",{key:`url-${c}`},[A("a",{href:a.value},Z(a.value),9,Sc)])):(k(),F("p",{key:`html-${c}`,innerHTML:r.filterHtml(t.$store.localize(a.value))},null,8,Ec))]),s.infoItems[c]&&s.infoItems[c].exceedsHeight?(k(),F("button",{key:0,type:"button",class:"tify-info-toggle",onClick:h=>s.infoItems[c].collapsed=!s.infoItems[c].collapsed},[s.infoItems[c].collapsed?(k(),F(ve,{key:0},[ie(o),be(" "+Z(t.$translate("Expand")),1)],64)):(k(),F(ve,{key:1},[ie(l),be(" "+Z(t.$translate("Collapse")),1)],64))],8,Pc)):se("",!0)],2)]))),128))])}const Rc=ae(Tc,[["render",Cc]]),Lc={data(){return{collectionDataShown:!1}},computed:{manifestOrCollection(){return this.collectionDataShown?this.$store.collection:this.$store.manifest||this.$store.collection||{}},homepages(){return this.manifestOrCollection.homepage?[].concat(this.manifestOrCollection.homepage):[]},logos(){var n;let t=this.manifestOrCollection.logo?[].concat(this.manifestOrCollection.logo):[];return(n=this.manifestOrCollection.provider)==null||n.forEach(e=>{e.logo&&(t=t.concat(e.logo))}),t=t.map(e=>{var i,s,r,o;return{id:e.id,link:((s=(i=e.service)==null?void 0:i[0])==null?void 0:s.id)||((o=(r=e.service)==null?void 0:r[0])==null?void 0:o["@id"])}}),t}},methods:{filterHtml:di,isValidUrl:Sn}},Hc={class:"tify-info",tabindex:"0"},Oc={class:"tify-sr-only"},Mc={key:0,class:"tify-info-header"},Dc={key:1,class:"tify-info-section -title"},Ac={key:2,class:"tify-info-section -metadata"},kc={key:3,class:"tify-info-section -description"},Fc={key:4,class:"tify-info-section -metadata -structure"},Ic={key:0,class:"tify-info-structure"},Bc={key:5,class:"tify-info-section -related"},zc={class:"tify-list"},Nc=["href"],Vc=["href"],Uc={key:6,class:"tify-info-section -attribution"},jc=["innerHTML"],Wc={key:7,class:"tify-info-section -license"},Gc=["href"],qc={key:8,class:"tify-info-section -logo"},Zc=["href"],Kc=["src","alt"],Xc=["src","alt"];function Yc(t,n,e,i,s,r){const o=Rc;return k(),F("section",Hc,[A("h2",Oc,Z(t.$translate("Info")),1),t.$store.collection&&t.$store.manifest?(k(),F("div",Mc,[A("button",{type:"button",class:Te(["tify-info-button",{"-active":!s.collectionDataShown}]),onClick:n[0]||(n[0]=l=>s.collectionDataShown=!1)},Z(t.$translate("Document")),3),A("button",{type:"button",class:Te(["tify-info-button",{"-active":s.collectionDataShown}]),onClick:n[1]||(n[1]=l=>s.collectionDataShown=!0)},Z(t.$translate("Collection")),3)])):se("",!0),r.manifestOrCollection.label?(k(),F("div",Dc,[A("h3",null,Z(t.$translate("Title")),1),A("p",null,Z(t.$store.localize(r.manifestOrCollection.label)),1)])):se("",!0),r.manifestOrCollection.metadata&&r.manifestOrCollection.metadata.length?(k(),F("div",Ac,[A("h3",null,Z(t.$translate("Metadata")),1),t.$store.options.view==="info"?(k(),Ce(o,{key:0,metadata:r.manifestOrCollection.metadata},null,8,["metadata"])):se("",!0)])):se("",!0),r.manifestOrCollection.summary?(k(),F("div",kc,[A("h3",null,Z(t.$translate("Description")),1),t.$store.options.view==="info"?(k(),Ce(o,{key:0,metadata:[{value:r.manifestOrCollection.summary}]},null,8,["metadata"])):se("",!0)])):se("",!0),r.manifestOrCollection.structures&&(t.$store.currentStructure.label||t.$store.currentStructure.metadata)?(k(),F("div",Fc,[A("h3",null,Z(t.$translate("Current Element")),1),t.$store.currentStructure.label?(k(),F("p",Ic,Z(t.$store.localize(t.$store.currentStructure.label)),1)):se("",!0),t.$store.options.view==="info"&&t.$store.currentStructure.metadata?(k(),Ce(o,{key:1,class:"tify-info-section -metadata",metadata:t.$store.currentStructure.metadata},null,8,["metadata"])):se("",!0)])):se("",!0),r.homepages.length?(k(),F("div",Bc,[A("h3",null,Z(t.$translate("Related Resources")),1),A("ul",zc,[(k(!0),F(ve,null,Be(r.homepages,(l,a)=>(k(),F("li",{key:a},[typeof l=="string"?(k(),F("a",{key:0,href:l},Z(l),9,Nc)):(k(),F("a",{key:1,href:l.id},Z(t.$store.localize(l.label)||l.id),9,Vc))]))),128))])])):se("",!0),r.manifestOrCollection.requiredStatement?(k(),F("div",Uc,[A("h3",null,Z(t.$store.localize(r.manifestOrCollection.requiredStatement.label)),1),A("p",{innerHTML:r.filterHtml(t.$store.localize(r.manifestOrCollection.requiredStatement.value))},null,8,jc)])):se("",!0),r.manifestOrCollection.rights?(k(),F("div",Wc,[A("h3",null,Z(t.$translate("License")),1),A("p",null,[A("a",{href:r.manifestOrCollection.rights},Z(r.manifestOrCollection.rights),9,Gc)])])):se("",!0),r.logos.length?(k(),F("div",qc,[(k(!0),F(ve,null,Be(r.logos,(l,a)=>(k(),F("p",{key:a},[l.link?(k(),F("a",{key:0,href:l.link},[A("img",{class:"tify-info-logo",src:l.id,alt:t.$translate("Logo")},null,8,Kc)],8,Zc)):(k(),F("img",{key:1,class:"tify-info-logo",src:l.id,alt:t.$translate("Logo")},null,8,Xc))]))),128))])):se("",!0)])}const Jc=ae(Lc,[["render",Yc]]),Qc={name:"TocList",props:{level:{type:Number,default:0},structures:{type:Array,default:()=>[]},purpose:{type:String,default:""}},data(){return{expandedStructures:this.level===0&&this.structures.length===1&&this.structures[0].items.some(t=>t.items)?[!0]:[],id:this.$store.getId(`toc-list-${Math.floor(Math.random()*1e12)}`)}},methods:{getFirstPage(t){if(t.items)return this.getFirstPage(t.items[0]);const n=this.$store.manifest.items.findIndex(e=>e.id===t.id);return n<0?1:n+1},getFirstPageLabel(t){var e;const n=this.getFirstPage(t);return this.$store.localize((e=this.$store.manifest.items[n-1])==null?void 0:e.label)},getLastPage(t){if(t.items)return this.getLastPage(t.items.at(-1));const n=this.$store.manifest.items.findLastIndex(e=>e.id===t.id);return n<0?this.$store.manifest.items.length:n+1},isCurrentPageInStructure(t){if(this.$store.manifest.items.filter((s,r)=>this.$store.options.pages.includes(r+1)).map(s=>s.id).some(s=>{var r;return(r=t.items)==null?void 0:r.some(o=>o.id===s)}))return!0;const e=t.firstPage||this.getFirstPage(t),i=t.lastPage||this.getLastPage(t);return this.$store.options.pages.some(s=>s>=e&&s<=i)},setPage(t){this.$store.setPage(t),this.$store.isMobile()&&this.$store.updateOptions({view:"scan"})},toggleAllChildren(t=null){if(this.$refs.children){for(let n=this.structures.length-1;n>=0;n-=1)this.toggleChildren(n,t);this.$refs.children.forEach(n=>{n.toggleAllChildren(t)})}},toggleChildren(t,n=null){var i;(i=this.structures[t].items)!=null&&i.some(s=>s.items)&&(this.expandedStructures[t]=n!==null?n:!this.expandedStructures[t])}}},$c={class:"tify-toc-list"},eu=["data-level"],tu=["title","aria-controls","aria-expanded","onClick"],iu=["href"],nu=["onClick"],su={class:"tify-toc-label"},ru={class:"tify-toc-page"},ou=["onClick"],au={class:"tify-toc-label"};function lu(t,n,e,i,s,r){const o=xr,l=Tr,a=Xs("TocList",!0);return k(),F("ul",$c,[(k(!0),F(ve,null,Be(e.structures,(c,h)=>{var p,m;return k(),F("li",{key:h,class:Te(["tify-toc-structure",{"-current":r.isCurrentPageInStructure(c),"-expanded":s.expandedStructures[h]}]),"data-level":e.level},[(p=c.items)!=null&&p.some(T=>T.items)?(k(),F("button",{key:0,type:"button",class:"tify-toc-toggle",title:t.$translate(s.expandedStructures[h]?"Collapse":"Expand"),"aria-controls":`${s.id}-${h}`,"aria-expanded":s.expandedStructures[h]?"true":"false",onClick:T=>r.toggleChildren(h)},[s.expandedStructures[h]?(k(),Ce(o,{key:0})):(k(),Ce(l,{key:1}))],8,tu)):se("",!0),e.purpose==="pdf"&&c.pageCount?(k(),F("a",{key:1,class:"tify-toc-link",href:c.rendering[0].id,download:""},Z(t.$store.localize(c.label))+" ("+Z(c.pageCount)+" "+Z(t.$translate(c.pageCount===1?"page":"pages"))+") ",9,iu)):c.label&&t.$store.localize(c.label)!==r.getFirstPageLabel(c)?(k(),F("a",{key:2,class:"tify-toc-link -dots",href:"javascript:;",onClick:T=>t.$store.setPage(c.firstPage||r.getFirstPage(c))},[A("span",su,Z(t.$store.localize(c.label)),1),A("span",ru,Z(r.getFirstPageLabel(c)||"—"),1)],8,nu)):(k(),F("a",{key:3,class:"tify-toc-link",href:"javascript:;",onClick:T=>t.$store.setPage(c.firstPage||r.getFirstPage(c))},[A("span",au,Z(t.$store.localize(c.label)||r.getFirstPageLabel(c)),1)],8,ou)),(m=c.items)!=null&&m.some(T=>T.items)?De((k(),Ce(a,{key:4,id:`${s.id}-${h}`,ref_for:!0,ref:"children",level:e.level+1,purpose:e.purpose,structures:c.items},null,8,["id","level","purpose","structures"])),[[Ze,s.expandedStructures[h]]]):se("",!0)],10,eu)}),128))])}const Sr=ae(Qc,[["render",lu]]),cu={data(){return{otherItems:[],perElementPdfLinksVisible:!1}},computed:{hasElementPdfLinks(){return!(this.$store.manifest.structures instanceof Array)||!this.$store.manifest.structures[0]||!this.$store.manifest.structures[0].rendering?!1:this.$store.manifest.structures[0].rendering.some(n=>n.format&&n.format==="application/pdf")},imageUrls(){const t={};return this.$store.options.pages.forEach(n=>{var i,s;if(!n)return;const e=(s=(i=this.$store.manifest.items[n-1].items)==null?void 0:i[0].items)==null?void 0:s[0].body;if(e!=null&&e.service){const r=e.service instanceof Array?e.service[0]:e.service,o=["ImageService2","ImageService3"].includes(r.type||r["@type"])?"default":"native",l=r.type==="ImageService3"?"max":"full",a=r.id||r["@id"];t[n]=`${a}${a.at(-1)==="/"?"":"/"}full/${l}/0/${o}.jpg`}else t[n]=e.id}),t},pages(){return this.$store.options.pages.filter(t=>t>0)},renderings(){return this.$store.manifest.rendering?[].concat(this.$store.manifest.rendering):[]}}},uu={class:"tify-export",tabindex:"0"},hu={class:"tify-sr-only"},fu={class:"tify-export-section -links"},du={class:"tify-list"},pu=["href","download"],gu={key:0,class:"tify-export-section -renderings"},mu={class:"tify-list"},vu=["href"],yu={key:0,class:"tify-export-container"},wu=["aria-controls","aria-expanded"],_u={class:"tify-sr-only"},Tu=["id"],xu={class:"tify-export-section -iiif"},bu=A("h3",null,"IIIF",-1),Su={class:"tify-list"},Eu={key:0},Pu=["href"],Cu=["href"],Ru={key:1,class:"tify-export-section -other"},Lu={class:"tify-list"},Hu=["href"];function Ou(t,n,e,i,s,r){var a;const o=_r,l=Sr;return k(),F("section",uu,[A("h2",hu,Z(t.$translate("Export")),1),A("div",fu,[A("h3",null,Z(t.$translate("Download Individual Images")),1),A("ul",du,[(k(!0),F(ve,null,Be(r.pages,c=>(k(),F("li",{key:c},[A("a",{href:r.imageUrls[c],download:`${c}.jpg`},Z(t.$translate("Page"))+" "+Z(t.$store.getPageLabel(c,t.$store.localize(t.$store.manifest.items[c-1].label))),9,pu)]))),128))])]),t.$store.manifest.rendering?(k(),F("div",gu,[A("h3",null,Z(t.$translate("Renderings")),1),A("ul",mu,[(k(!0),F(ve,null,Be(r.renderings,c=>(k(),F("li",{key:c.id},[A("a",{href:c.id},Z(t.$store.localize(c.label)),9,vu)]))),128))]),r.hasElementPdfLinks?(k(),F("div",yu,[A("button",{type:"button",class:Te(["tify-export-toggle",{"-close":s.perElementPdfLinksVisible}]),"aria-controls":t.$store.getId("export-pdf-list"),"aria-expanded":s.perElementPdfLinksVisible?"true":"false",onClick:n[0]||(n[0]=c=>s.perElementPdfLinksVisible=!s.perElementPdfLinksVisible)},[s.perElementPdfLinksVisible?(k(),F(ve,{key:1},[ie(o),A("span",_u,Z(t.$translate("Close PDF list")),1)],64)):(k(),F(ve,{key:0},[be(Z(t.$translate("PDFs for each element")),1)],64))],10,wu),s.perElementPdfLinksVisible?(k(),F("div",{key:0,id:t.$store.getId("export-pdf-list"),class:"tify-export-toc"},[A("h4",null,Z(t.$translate("PDFs for each element")),1),ie(l,{ref:"children",purpose:"pdf",level:0,structures:t.$store.structures},null,8,["structures"])],8,Tu)):se("",!0)])):se("",!0)])):se("",!0),A("div",xu,[bu,A("ul",Su,[t.$store.options.childManifestUrl?(k(),F("li",Eu,[A("a",{href:t.$store.options.childManifestUrl,download:"manifest.json"},Z(t.$translate("IIIF manifest (current document)")),9,Pu)])):se("",!0),A("li",null,[A("a",{href:t.$store.options.manifestUrl,download:"manifest.json"},Z(t.$translate(t.$store.collection?"IIIF manifest (collection)":"IIIF manifest")),9,Cu)])])]),(a=t.$store.manifest.seeAlso)!=null&&a.length?(k(),F("div",Ru,[A("h3",null,Z(t.$translate("Other Formats")),1),A("ul",Lu,[(k(!0),F(ve,null,Be(t.$store.manifest.seeAlso,c=>(k(),F("li",{key:c.id},[A("a",{href:c.id,download:""},Z(c.label?t.$store.localize(c.label):c.id),9,Hu)]))),128))])])):se("",!0)])}const Mu=ae(cu,[["render",Ou]]);function pi(t,n,e=120){const i=t,s=e===!0?120:e;if(!s||s<0){i.scrollTop=n;return}const o=(n-t.scrollTop)/s/.1;setTimeout(()=>{i.scrollTop+=o,i.scrollTop!==n&&pi(i,n,s-10)},10)}function Qi(t,n,e=!0){const i=n.querySelectorAll(t);if(!i.length)return;let s=i[0];const r=i[i.length-1];Array.prototype.forEach.call(i,c=>{c.dataset.level>=s.dataset.level&&(s=c)});const o=n.getBoundingClientRect(),l=s.getBoundingClientRect(),a=r.getBoundingClientRect();if(l.topo.bottom){const c=a.bottom-o.bottom+n.scrollTop;pi(n,c+50,e)}}const fs=".tify-toc-structure.-current",Du={data(){return{isInited:!1}},computed:{isNested(){return this.$store.structures.filter(t=>{var n;return(n=t.items)==null?void 0:n.some(e=>e.items)}).length>1}},watch:{"$store.options.pages":function(){this.$nextTick(()=>Qi(fs,this.$el))},"$store.options.view":{handler(t){t==="toc"&&this.$nextTick(this.init)},immediate:!0}},methods:{init(){this.isInited=!0,this.$nextTick(()=>Qi(fs,this.$el,!1))}}},Au={class:"tify-toc",tabindex:"0"},ku={class:"tify-sr-only"},Fu={key:0,class:"tify-toc-header"};function Iu(t,n,e,i,s,r){const o=Sr;return k(),F("section",Au,[A("h2",ku,Z(t.$translate("Table of Contents")),1),r.isNested?(k(),F("div",Fu,[A("button",{type:"button",class:"tify-toc-toggle-all",onClick:n[0]||(n[0]=l=>t.$refs.children.toggleAllChildren(!0))},Z(t.$translate("Expand all")),1),A("button",{type:"button",class:"tify-toc-toggle-all",onClick:n[1]||(n[1]=l=>t.$refs.children.toggleAllChildren(!1))},Z(t.$translate("Collapse all")),1)])):se("",!0),s.isInited?(k(),Ce(o,{key:1,ref:"children",level:0,structures:t.$store.structures},null,8,["structures"])):se("",!0)])}const Bu=ae(Du,[["render",Iu]]),zu=750,Nu={data(){return{itemHeight:0,itemVMargin:0,items:[{label:""}],itemsPerRow:0,knownImages:[],lastScrollTop:0,resizeTimeout:null,style:{},thumbnailWidth:0,touchTimeout:null}},watch:{"$store.options.pages":function(t){this.$nextTick(()=>{const n=".tify-thumbnails-item.-current";t.length>2||t.length>1&&t[1]!==t[0]+1||(this.$refs.container.querySelector(n)?Qi(n,this.$el):this.scrollToCurrentPage())})},"$store.options.view":{handler(t){t==="thumbnails"&&this.$nextTick(this.init)},immediate:!0}},mounted(){this.style.flex=this.$el.style.flex},methods:{init(){this.updateDimensions(),this.scrollToCurrentPage(!1),new ResizeObserver(this.onResize).observe(this.$el)},onResize(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.$store.options.view==="thumbnails"&&this.updateDimensions()},200)},updateDimensions(){const t=this.$refs.container.querySelector(".tify-thumbnails-item"),n=t.currentStyle||window.getComputedStyle(t),e=parseInt(n.marginTop,10)+parseFloat(n.marginBottom,10);this.itemHeight=t.offsetHeight+e,this.itemVerticalMargin=e;const i=parseInt(n.marginLeft,10)+parseFloat(n.marginRight,10),s=t.offsetWidth+i;this.thumbnailWidth=t.offsetWidth,this.itemsPerRow=Math.floor(this.$refs.container.clientWidth/s);const o=Math.ceil(this.$store.manifest.items.length/this.itemsPerRow)*this.itemHeight;this.$refs.container.style.height=`${o}px`,this.redrawThumbnails(),this.scrollToCurrentPage(!1)},redrawThumbnails(){const t=this.$el.scrollTop,n=Math.floor(t/this.itemHeight)*this.itemsPerRow+1,i=Math.ceil(this.$el.offsetHeight/this.itemHeight)*this.itemsPerRow,s=n+this.itemsPerRow+i,r=Math.min(this.$store.manifest.items.length,s),o=[];for(let l=n-1;l{const l=Math.floor(n/this.itemsPerRow);this.$refs.container.style.paddingTop=`${l*this.itemHeight}px`})},scrollToCurrentPage(t=!0){const e=Math.floor((this.$store.options.pages[0]-1)/this.itemsPerRow)*this.itemHeight+(this.itemVMargin-50);t?pi(this.$el,e):this.$el.scrollTop=e},setPageAndSwitchView(t,n=!1){if(n){const e=this.$store.options.pages.slice(0),i=e.indexOf(t);i<0?(e.push(t),e.sort((s,r)=>s-r),e[0]===0&&e.shift()):e.length>1&&e.splice(i,1),this.$store.updateOptions({pages:e});return}this.$store.setPage(t),this.$store.isMobile()&&this.$store.updateOptions({view:"scan"})},touchStartTogglePage(t){this.lastScrollTop=this.$el.scrollTop,this.touchTimeout=setTimeout(()=>{this.$el.scrollTop===this.lastScrollTop&&this.setPageAndSwitchView(t,!0)},zu)},touchEnd(){clearTimeout(this.touchTimeout)}}},Vu={class:"tify-sr-only"},Uu={ref:"container",class:"tify-thumbnails-list"},ju=["onClick","onTouchstart"],Wu=["src"],Gu={class:"tify-thumbnails-page"};function qu(t,n,e,i,s,r){return k(),F("section",{class:"tify-thumbnails",tabindex:"0",onScroll:n[1]||(n[1]=(...o)=>r.redrawThumbnails&&r.redrawThumbnails(...o))},[A("h2",Vu,Z(t.$translate("Pages")),1),A("div",Uu,[(k(!0),F(ve,null,Be(s.items,o=>(k(),F("a",{key:o.page,class:Te(["tify-thumbnails-item",{"-current":t.$store.options.pages.includes(o.page)}]),href:"javascript:;",onClick:xt(l=>r.setPageAndSwitchView(o.page,l.ctrlKey),["prevent"]),onTouchstart:l=>r.touchStartTogglePage(o.page),onTouchend:n[0]||(n[0]=(...l)=>r.touchEnd&&r.touchEnd(...l))},[A("img",{alt:"",src:o.imgUrl},null,8,Wu),A("span",Gu,Z(t.$store.getPageLabel(o.page,o.label)),1)],42,ju))),128))],512)],32)}const Zu=ae(Nu,[["render",qu]]),Ku={data(){return{fulltextAvailable:null,fulltexts:[]}},computed:{pages(){return this.$store.options.pages.filter(t=>!!t)}},watch:{"$store.options.pages":function(){this.loadFulltexts()}},mounted(){this.loadFulltexts()},methods:{loadFulltexts(){this.fulltextAvailable=null,this.fulltexts=[],this.$store.options.pages.forEach(t=>{if(t<1||this.fulltexts[t])return;const n=this.$store.manifest.items[t-1];if(!("annotations"in n)){this.fulltextAvailable=!1;return}const e=n.annotations[0].id;this.$store.fetchJson(e).then(i=>{const{resources:s}=i;s instanceof Array&&s.forEach((r,o)=>{const l=r.resource;if(l)if(this.fulltexts[t]||(this.fulltexts[t]=[]),l&&l.chars){const a=di(l.chars);a&&(this.fulltextAvailable=!0),this.fulltexts[t][o]=a}else(l.id||l["@id"])&&this.loadRemoteFulltext(t,o,l.id||l["@id"])})},i=>{const s=i.response?i.response.statusText:i.message;console.warn(`Could not load annotations: ${s}`),this.fulltextAvailable=!1})})},loadRemoteFulltext(t,n,e){Sn(e)&&this.$store.fetchText(e).then(i=>{const s=di(i);s&&(this.fulltextAvailable=!0),this.fulltexts[t]||(this.fulltexts[t]=[]),this.fulltexts[t][n]=s},i=>{const s=i.response?i.response.statusText:i.message;console.warn(`Could not load fulltext: ${s}`)})}}},Xu={class:"tify-fulltext",tabindex:"0"},Yu={class:"tify-sr-only"},Ju={key:0,class:"tify-fulltext-texts"},Qu=["innerHTML"],$u={key:1,class:"tify-fulltext-none"};function eh(t,n,e,i,s,r){return k(),F("section",Xu,[A("h2",Yu,Z(t.$translate("Fulltext")),1),s.fulltextAvailable!==!1?(k(),F("div",Ju,[(k(!0),F(ve,null,Be(r.pages,o=>(k(),F("div",{key:o,class:"tify-fulltext-page"},[A("h3",null,Z(t.$translate("Page"))+" "+Z(t.$store.getPageLabel(o,t.$store.localize(t.$store.manifest.items[o-1].label))),1),(k(!0),F(ve,null,Be(s.fulltexts[o],(l,a)=>(k(),F("div",{key:`${o}-${a}`,class:"tify-fulltext-text",innerHTML:l},null,8,Qu))),128))]))),128))])):(k(),F("p",$u,Z(t.$translate("Fulltext not available for this page")),1))])}const th=ae(Ku,[["render",eh]]),ih={},nh={class:"tify-icon",viewBox:"0 0 24 24"},sh=A("path",{d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"},null,-1),rh=[sh];function oh(t,n){return k(),F("svg",nh,rh)}const ah=ae(ih,[["render",oh]]),lh={},ch={class:"tify-icon",viewBox:"0 0 24 24"},uh=A("path",{d:"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z"},null,-1),hh=[uh];function fh(t,n){return k(),F("svg",ch,hh)}const dh=ae(lh,[["render",fh]]),ph={},gh={class:"tify-icon",viewBox:"0 0 24 24"},mh=A("path",{d:"M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z"},null,-1),vh=[mh];function yh(t,n){return k(),F("svg",gh,vh)}const wh=ae(ph,[["render",yh]]),_h={},Th={class:"tify-icon",viewBox:"0 0 24 24"},xh=A("path",{d:"M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13"},null,-1),bh=[xh];function Sh(t,n){return k(),F("svg",Th,bh)}const Eh=ae(_h,[["render",Sh]]),Ph={},Ch={class:"tify-icon",viewBox:"0 0 24 24"},Rh=A("path",{d:"M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z"},null,-1),Lh=[Rh];function Hh(t,n){return k(),F("svg",Ch,Lh)}const Oh=ae(Ph,[["render",Hh]]),Mh={},Dh={class:"tify-icon",viewBox:"0 0 24 24"},Ah=A("path",{d:"M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z"},null,-1),kh=[Ah];function Fh(t,n){return k(),F("svg",Dh,kh)}const Ih=ae(Mh,[["render",Fh]]),Bh={},zh={class:"tify-icon",viewBox:"0 0 24 24"},Nh=A("path",{d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M5,8V10H13V8H5Z"},null,-1),Vh=[Nh];function Uh(t,n){return k(),F("svg",zh,Vh)}const jh=ae(Bh,[["render",Uh]]),Wh={},Gh={class:"tify-icon",viewBox:"0 0 24 24"},qh=A("path",{d:"M19,12H17V15H14V17H19V12M7,9H10V7H5V12H7V9M21,3H3A2,2 0 0,0 1,5V19A2,2 0 0,0 3,21H21A2,2 0 0,0 23,19V5A2,2 0 0,0 21,3M21,19H3V5H21V19Z"},null,-1),Zh=[qh];function Kh(t,n){return k(),F("svg",Gh,Zh)}const Xh=ae(Wh,[["render",Kh]]),Yh={},Jh={class:"tify-icon",viewBox:"0 0 24 24"},Qh=A("path",{d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M8,5V8H5V10H8V13H10V10H13V8H10V5H8Z"},null,-1),$h=[Qh];function ef(t,n){return k(),F("svg",Jh,$h)}const tf=ae(Yh,[["render",ef]]),nf={},sf={class:"tify-icon",viewBox:"0 0 24 24"},rf=A("path",{d:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"},null,-1),of=[rf];function af(t,n){return k(),F("svg",sf,of)}const Er=ae(nf,[["render",af]]),lf={},cf={class:"tify-icon",viewBox:"0 0 24 24"},uf=A("path",{d:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"},null,-1),hf=[uf];function ff(t,n){return k(),F("svg",cf,hf)}const Pr=ae(lf,[["render",ff]]);var Cr={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(xn,function(){var e="__v-click-outside",i=typeof window<"u",s=typeof navigator<"u",r=i&&("ontouchstart"in window||s&&navigator.msMaxTouchPoints>0)?["touchstart"]:["click"],o=function(h){var p=h.event,m=h.handler;(0,h.middleware)(p)&&m(p)},l=function(h,p){var m=function(f){var _=typeof f=="function";if(!_&&typeof f!="object")throw new Error("v-click-outside: Binding value must be a function or an object");return{handler:_?f:f.handler,middleware:f.middleware||function(H){return H},events:f.events||r,isActive:f.isActive!==!1,detectIframe:f.detectIframe!==!1,capture:!!f.capture}}(p.value),T=m.handler,x=m.middleware,E=m.detectIframe,R=m.capture;if(m.isActive){if(h[e]=m.events.map(function(f){return{event:f,srcTarget:document.documentElement,handler:function(_){return function(H){var L=H.el,O=H.event,N=H.handler,G=H.middleware,q=O.path||O.composedPath&&O.composedPath();(q?q.indexOf(L)<0:!L.contains(O.target))&&o({event:O,handler:N,middleware:G})}({el:h,event:_,handler:T,middleware:x})},capture:R}}),E){var M={event:"blur",srcTarget:window,handler:function(f){return function(_){var H=_.el,L=_.event,O=_.handler,N=_.middleware;setTimeout(function(){var G=document.activeElement;G&&G.tagName==="IFRAME"&&!H.contains(G)&&o({event:L,handler:O,middleware:N})},0)}({el:h,event:f,handler:T,middleware:x})},capture:R};h[e]=[].concat(h[e],[M])}h[e].forEach(function(f){var _=f.event,H=f.srcTarget,L=f.handler;return setTimeout(function(){h[e]&&H.addEventListener(_,L,R)},0)})}},a=function(h){(h[e]||[]).forEach(function(p){return p.srcTarget.removeEventListener(p.event,p.handler,p.capture)}),delete h[e]},c=i?{beforeMount:l,updated:function(h,p){var m=p.value,T=p.oldValue;JSON.stringify(m)!==JSON.stringify(T)&&(a(h),l(h,{value:m}))},unmounted:a}:{};return{install:function(h){h.directive("click-outside",c)},directive:c}})})(Cr);var df=Cr.exports;const En=bn(df);var Rr={exports:{}};(function(t){//! openseadragon 3.0.0 +**/const Na="http://www.w3.org/2000/svg",Ua="http://www.w3.org/1998/Math/MathML",ut=typeof document<"u"?document:null,is=ut&&ut.createElement("template"),ja={insert:(t,n,e)=>{n.insertBefore(t,e||null)},remove:t=>{const n=t.parentNode;n&&n.removeChild(t)},createElement:(t,n,e,i)=>{const s=n==="svg"?ut.createElementNS(Na,t):n==="mathml"?ut.createElementNS(Ua,t):ut.createElement(t,e?{is:e}:void 0);return t==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:t=>ut.createTextNode(t),createComment:t=>ut.createComment(t),setText:(t,n)=>{t.nodeValue=n},setElementText:(t,n)=>{t.textContent=n},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ut.querySelector(t),setScopeId(t,n){t.setAttribute(n,"")},insertStaticContent(t,n,e,i,s,r){const o=e?e.previousSibling:n.lastChild;if(s&&(s===r||s.nextSibling))for(;n.insertBefore(s.cloneNode(!0),e),!(s===r||!(s=s.nextSibling)););else{is.innerHTML=i==="svg"?`${t}`:i==="mathml"?`${t}`:t;const l=is.content;if(i==="svg"||i==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}n.insertBefore(l,e)}return[o?o.nextSibling:n.firstChild,e?e.previousSibling:n.lastChild]}},Wa=Symbol("_vtc");function Ga(t,n,e){const i=t[Wa];i&&(n=(n?[n,...i]:[...i]).join(" ")),n==null?t.removeAttribute("class"):e?t.setAttribute("class",n):t.className=n}const fi=Symbol("_vod"),_r=Symbol("_vsh"),Ke={beforeMount(t,{value:n},{transition:e}){t[fi]=t.style.display==="none"?"":t.style.display,e&&n?e.beforeEnter(t):Vt(t,n)},mounted(t,{value:n},{transition:e}){e&&n&&e.enter(t)},updated(t,{value:n,oldValue:e},{transition:i}){!n!=!e&&(i?n?(i.beforeEnter(t),Vt(t,!0),i.enter(t)):i.leave(t,()=>{Vt(t,!1)}):Vt(t,n))},beforeUnmount(t,{value:n}){Vt(t,n)}};function Vt(t,n){t.style.display=n?t[fi]:"none",t[_r]=!n}const qa=Symbol(""),Za=/(^|;)\s*display\s*:/;function Ka(t,n,e){const i=t.style,s=Se(e);let r=!1;if(e&&!s){if(n)if(Se(n))for(const o of n.split(";")){const l=o.slice(0,o.indexOf(":")).trim();e[l]==null&&ai(i,l,"")}else for(const o in n)e[o]==null&&ai(i,o,"");for(const o in e)o==="display"&&(r=!0),ai(i,o,e[o])}else if(s){if(n!==e){const o=i[qa];o&&(e+=";"+o),i.cssText=e,r=Za.test(e)}}else n&&t.removeAttribute("style");fi in t&&(t[fi]=r?i.display:"",t[_r]&&(i.display="none"))}const ns=/\s*!important$/;function ai(t,n,e){if(ce(e))e.forEach(i=>ai(t,n,i));else if(e==null&&(e=""),n.startsWith("--"))t.setProperty(n,e);else{const i=Xa(t,n);ns.test(e)?t.setProperty(Lt(i),e.replace(ns,""),"important"):t[i]=e}}const ss=["Webkit","Moz","ms"],ki={};function Xa(t,n){const e=ki[n];if(e)return e;let i=Je(n);if(i!=="filter"&&i in t)return ki[n]=i;i=vi(i);for(let s=0;sIi||(tl.then(()=>Ii=0),Ii=Date.now());function nl(t,n){const e=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=e.attached)return;Ge(sl(i,e.value),n,5,[i])};return e.value=t,e.attached=il(),e}function sl(t,n){if(ce(n)){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{e.call(t),t._stopped=!0},n.map(i=>s=>!s._stopped&&i&&i(s))}else return n}const ls=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,rl=(t,n,e,i,s,r,o,l,a)=>{const c=s==="svg";n==="class"?Ga(t,i,c):n==="style"?Ka(t,e,i):pi(n)?rn(n)||$a(t,n,e,i,o):(n[0]==="."?(n=n.slice(1),!0):n[0]==="^"?(n=n.slice(1),!1):ol(t,n,i,c))?Ja(t,n,i,r,o,l,a):(n==="true-value"?t._trueValue=i:n==="false-value"&&(t._falseValue=i),Ya(t,n,i,c))};function ol(t,n,e,i){if(i)return!!(n==="innerHTML"||n==="textContent"||n in t&&ls(n)&&de(e));if(n==="spellcheck"||n==="draggable"||n==="translate"||n==="form"||n==="list"&&t.tagName==="INPUT"||n==="type"&&t.tagName==="TEXTAREA")return!1;if(n==="width"||n==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return ls(n)&&Se(e)?!1:n in t}const cs=t=>{const n=t.props["onUpdate:modelValue"]||!1;return ce(n)?e=>ni(n,e):n};function al(t){t.target.composing=!0}function us(t){const n=t.target;n.composing&&(n.composing=!1,n.dispatchEvent(new Event("input")))}const Fi=Symbol("_assign"),Tr={created(t,{modifiers:{lazy:n,trim:e,number:i}},s){t[Fi]=cs(s);const r=i||s.props&&s.props.type==="number";Dt(t,n?"change":"input",o=>{if(o.target.composing)return;let l=t.value;e&&(l=l.trim()),r&&(l=zi(l)),t[Fi](l)}),e&&Dt(t,"change",()=>{t.value=t.value.trim()}),n||(Dt(t,"compositionstart",al),Dt(t,"compositionend",us),Dt(t,"change",us))},mounted(t,{value:n}){t.value=n??""},beforeUpdate(t,{value:n,modifiers:{lazy:e,trim:i,number:s}},r){if(t[Fi]=cs(r),t.composing)return;const o=(s||t.type==="number")&&!/^0\d/.test(t.value)?zi(t.value):t.value,l=n??"";o!==l&&(document.activeElement===t&&t.type!=="range"&&(e||i&&t.value.trim()===l)||(t.value=l))}},ll=["ctrl","shift","alt","meta"],cl={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,n)=>ll.some(e=>t[`${e}Key`]&&!n.includes(e))},xt=(t,n)=>{const e=t._withMods||(t._withMods={}),i=n.join(".");return e[i]||(e[i]=(s,...r)=>{for(let o=0;o{const e=t._withKeys||(t._withKeys={}),i=n.join(".");return e[i]||(e[i]=s=>{if(!("key"in s))return;const r=Lt(s.key);if(n.some(o=>o===r||ul[o]===r))return t(s)})},hl=Re({patchProp:rl},ja);let hs;function fl(){return hs||(hs=Ta(hl))}const dl=(...t)=>{const n=fl().createApp(...t),{mount:e}=n;return n.mount=i=>{const s=gl(i);if(!s)return;const r=n._component;!de(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.innerHTML="";const o=e(s,!1,pl(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},n};function pl(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function gl(t){return Se(t)?document.querySelector(t):t}const re=(t,n)=>{const e=t.__vccOpts||t;for(const[i,s]of n)e[i]=s;return e},ml={},vl={class:"tify-icon",viewBox:"0 0 24 24"},yl=D("path",{d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},null,-1),wl=[yl];function _l(t,n){return M(),I("svg",vl,wl)}const xr=re(ml,[["render",_l]]);var Tl={version:"0.31.0",license:"AGPL-3.0",bugsUrl:"https://github.com/tify-iiif-viewer/tify/issues",contributorsUrl:"https://github.com/tify-iiif-viewer/tify/blob/v0.31.0/CONTRIBUTORS.md",docsUrl:"https://github.com/tify-iiif-viewer/tify/blob/v0.31.0/doc",docsLanguages:["de","en"],repositoryUrl:"https://github.com/tify-iiif-viewer/tify"};const xl={computed:{copyrightHtml(){return'Copyright © 2017–2022 Göttingen University / Göttingen State and University Library'},env(){return Tl},infoHtml(){return'TIFY is a slim and mobile-friendly IIIF document viewer, released under the GNU Affero General Public License 3.0.'},userGuideUrl(){const t=this.env.docsLanguages.includes(this.$store.options.language)?this.$store.options.language:"en";return`${this.env.docsUrl}/user-guide.${t}.md`}}},bl={class:"tify-help",tabindex:"0"},El={class:"tify-sr-only"},Sl=["innerHTML"],Pl={class:"tify-list"},Cl=["href"],Rl=["href"],Ll=["href"],Hl=["href"],Ol={class:"tify-help-footer"},Ml=["innerHTML"];function Dl(t,n,e,i,s,r){return M(),I("section",bl,[D("h2",El,Z(t.$translate("Help")),1),D("h3",null,Z(t.$translate("About TIFY")),1),D("p",{innerHTML:t.$translate("$info",r.infoHtml)},null,8,Sl),D("ul",Pl,[D("li",null,[D("a",{href:r.userGuideUrl},Z(t.$translate("User guide")),9,Cl)]),D("li",null,[D("a",{href:r.env.repositoryUrl},Z(t.$translate("Source code")),9,Rl)]),D("li",null,[D("a",{href:r.env.contributorsUrl},Z(t.$translate("Contributors")),9,Ll)]),D("li",null,[D("a",{href:r.env.bugsUrl},Z(t.$translate("Report a bug")),9,Hl)])]),D("footer",Ol,[D("p",null,[be(Z(t.$translate("Version"))+" ",1),D("b",null,Z(r.env.version),1),be(" · "),D("span",{innerHTML:t.$translate("$copyright",r.copyrightHtml)},null,8,Ml)])])])}const Al=re(xl,[["render",Dl]]),kl={},Il={class:"tify-icon",viewBox:"0 0 24 24"},Fl=D("path",{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"},null,-1),Bl=[Fl];function zl(t,n){return M(),I("svg",Il,Bl)}const br=re(kl,[["render",zl]]),Vl={},Nl={class:"tify-icon",viewBox:"0 0 24 24"},Ul=D("path",{d:"M19,13H5V11H19V13Z"},null,-1),jl=[Ul];function Wl(t,n){return M(),I("svg",Nl,jl)}const Er=re(Vl,[["render",Wl]]),Gl={name:"CollectionNode",props:{item:{type:Object,default:()=>{}}},data(){return{children:null,expanded:!1,id:this.$store.getId(`collection-node-${Math.floor(Math.random()*1e12)}`)}},methods:{toggleChildren(){if(this.expanded){this.expanded=!1;return}if(this.children){this.expanded=!0;return}if(this.item.children){this.children=this.item.children,this.expanded=!0;return}this.$store.fetchJson(this.item["@id"]||this.item.id).then(t=>{this.children=t.collections||t.items||t.manifests||[],this.expanded=!0},t=>{const n=t.response&&(t.response.statusText||t.response.data)||t.message;this.$store.addError(`Error loading IIIF manifest: ${n}`),this.children=!1})}}},ql=["aria-controls","aria-expanded"],Zl={class:"tify-sr-only"},Kl={class:"tify-sr-only"},Xl=["id"],Yl={key:1,class:"tify-collection-error"};function Jl(t,n,e,i,s,r){const o=Er,l=br,a=Js("CollectionNode",!0);return M(),I("li",{class:_e(["tify-collection-item",{"-current":t.$store.manifest&&t.$store.manifest.id===(e.item["@id"]||e.item.id)}])},[e.item.type==="Collection"?(M(),I("button",{key:0,type:"button","aria-controls":s.id,"aria-expanded":s.expanded?"true":"false",class:"tify-collection-link -has-children",onClick:n[0]||(n[0]=c=>r.toggleChildren())},[s.expanded?(M(),I(ve,{key:0},[ie(o),D("span",Zl,Z(t.$translate("Collapse")),1)],64)):(M(),I(ve,{key:1},[ie(l),D("span",Kl,Z(t.$translate("Expand")),1)],64)),be(" "+Z(t.$store.localize(e.item.label)),1)],8,ql)):(M(),I("a",{key:1,href:"javascript:;",class:"tify-collection-link",onClick:n[1]||(n[1]=c=>t.$store.loadManifest(e.item["@id"]||e.item.id,{expectedType:e.item.type,reset:!0}))},Z(t.$store.localize(e.item.label)),1)),s.expanded?(M(),I(ve,{key:2},[s.expanded?(M(),I("ol",{key:0,id:s.id,class:"tify-collection-list"},[(M(!0),I(ve,null,Be(s.children,c=>(M(),Ee(a,{key:c.id,item:c},null,8,["item"]))),128))],8,Xl)):s.children===!1?(M(),I("p",Yl,Z(t.$translate("Could not load child manifest")),1)):se("",!0)],64)):se("",!0)],2)}const Ql=re(Gl,[["render",Jl]]),$l={data(){return{filter:""}},computed:{filteredItems(){const t=this.filter.trim().toLowerCase().split(/\s+/);return this.$store.collection.items.filter(n=>{const e=(this.$store.localize(n.label)||"").toLowerCase();return t.every(i=>e.includes(i))})}}},ec={class:"tify-collection",tabindex:"0"},tc={class:"tify-sr-only"},ic={key:0,class:"tify-collection-controls"},nc=["aria-label","placeholder"],sc=["disabled"],rc={key:1,class:"tify-collection-list"},oc={key:2,class:"tify-collection-no-results"};function ac(t,n,e,i,s,r){const o=Ql;return M(),I("section",ec,[D("h2",tc,Z(t.$translate("Collection")),1),t.$store.collection.items.length>5?(M(),I("p",ic,[De(D("input",{"onUpdate:modelValue":n[0]||(n[0]=l=>s.filter=l),"aria-label":t.$translate("Filter collection"),class:"tify-collection-filter",placeholder:t.$translate("Filter collection"),type:"text",onKeydown:[n[1]||(n[1]=At(xt(l=>s.filter?s.filter="":l.target.blur(),["prevent"]),["esc"])),n[2]||(n[2]=xt(()=>{},["stop"]))]},null,40,nc),[[Tr,s.filter]]),D("button",{type:"button",class:"tify-collection-reset",disabled:!s.filter,onClick:n[3]||(n[3]=l=>s.filter="")},Z(t.$translate("Reset")),9,sc)])):se("",!0),r.filteredItems.length?(M(),I("ol",rc,[(M(!0),I(ve,null,Be(r.filteredItems,l=>(M(),Ee(o,{key:l.id,item:l},null,8,["item"]))),128))])):(M(),I("p",oc,Z(t.$translate("No results")),1))])}const lc=re($l,[["render",ac]]),cc={},uc={class:"tify-icon",viewBox:"0 0 24 24"},hc=D("path",{d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"},null,-1),fc=[hc];function dc(t,n){return M(),I("svg",uc,fc)}const pc=re(cc,[["render",dc]]),gc={},mc={class:"tify-icon",viewBox:"0 0 24 24"},vc=D("path",{d:"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"},null,-1),yc=[vc];function wc(t,n){return M(),I("svg",mc,yc)}const _c=re(gc,[["render",wc]]);var bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function En(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Sr={exports:{}};(function(t){(function(n){if(typeof e!="function"){var e=function(x){return x};e.nonNative=!0}const i=e("plaintext"),s=e("html"),r=e("comment"),o=/<(\w*)>/g,l=/<\/?([^\s\/>]+)/;function a(x,S,C){x=x||"",S=S||[],C=C||"";let A=h(S,C);return p(x,A)}function c(x,S){x=x||[],S=S||"";let C=h(x,S);return function(f){return p(f||"",C)}}a.init_streaming_mode=c;function h(x,S){return x=m(x),{allowable_tags:x,tag_replacement:S,state:i,tag_buffer:"",depth:0,in_quote_char:""}}function p(x,S){if(typeof x!="string")throw new TypeError("'html' parameter must be a string");let C=S.allowable_tags,A=S.tag_replacement,f=S.state,_=S.tag_buffer,P=S.depth,H=S.in_quote_char,O="";for(let V=0,W=x.length;V":if(H)break;if(P){P--;break}H="",f=i,_+=">",C.has(T(_))?O+=_:O+=A,_="";break;case'"':case"'":q===H?H="":H=H||q,_+=q;break;case"-":_==="":_.slice(-2)=="--"&&(f=i),_="";break;default:_+=q;break}}return S.state=f,S.tag_buffer=_,S.depth=P,S.in_quote_char=H,O}function m(x){let S=new Set;if(typeof x=="string"){let C;for(;C=o.exec(x);)S.add(C[1])}else!e.nonNative&&typeof x[e.iterator]=="function"?S=new Set(x):typeof x.forEach=="function"&&x.forEach(S.add,S);return S}function T(x){let S=l.exec(x);return S?S[1].toLowerCase():null}t.exports?t.exports=a:n.striptags=a})(bn)})(Sr);var Tc=Sr.exports;const xc=En(Tc);function Pi(t){const n=["a","b","br","i","img","p","span"],e={a:["href"],img:["alt","src"]};let i=xc(t,n);const s=/<(\w+)((\s+.+?(\s*=\s*(?:".*?"|'.*?'|.*?|[\^'">\s]+))?)+\s*|\s*)>/g;return i=i.replace(s,(r,o,l)=>{if(!l)return`<${o}>`;const a=/(?:([^\s]+)=(?:"(.*?)"|'(.*?)'))|([^\s]+)/g,c=[];return l.replace(a,(h,p)=>{h!==p&&e[o]&&e[o].includes(p)&&c.push(h)}),c.length>0?`<${o} ${c.join(" ")}>`:`<${o}>`}),i}function fs(t,n){if(!(t instanceof Array)||!n||new Set(t).size!==t.length)return!1;for(let e=0,i=t.length;e0&&t[e]>0&&t[e]<=t[e-1]||t[e]<0||t[e]>n)return!1;return!0}function Sn(t,n=["https:","http:"]){let e;try{e=new URL(t)}catch{return!1}return n.includes(e.protocol)}const bc={props:{metadata:{type:Array,default:()=>[]}},data(){return{infoItems:[]}},watch:{metadata(){this.updateInfoItems()}},mounted(){this.updateInfoItems()},methods:{cleanLabel(t){const n=t.replace("_"," ");return n.charAt(0).toUpperCase()+n.substr(1)},updateInfoItems(){this.$nextTick(()=>{this.$refs.contents&&this.$refs.contents.forEach((t,n)=>{const e=t.offsetHeight;this.infoItems[n]={collapsed:!0,exceedsHeight:!0},this.$nextTick(()=>{const i=t.offsetHeight,s=e>=i;this.infoItems[n]={collapsed:s,exceedsHeight:s}})})})},filterHtml:Pi,isValidUrl:Sn}},Ec={class:"tify-info-metadata"},Sc={class:"tify-info-value"},Pc=["href"],Cc=["innerHTML"],Rc=["onClick"];function Lc(t,n,e,i,s,r){const o=_c,l=pc;return M(),I("div",Ec,[(M(!0),I(ve,null,Be(e.metadata,(a,c)=>(M(),I("div",{key:c},[D("h4",null,Z(r.cleanLabel(t.$store.localize(a.label))),1),D("div",{ref_for:!0,ref:"contents",class:_e(["tify-info-content",{"-collapsed":s.infoItems[c]&&s.infoItems[c].collapsed}])},[D("div",Sc,[r.isValidUrl(a.value)?(M(),I("p",{key:`url-${c}`},[D("a",{href:a.value},Z(a.value),9,Pc)])):(M(),I("p",{key:`html-${c}`,innerHTML:r.filterHtml(t.$store.localize(a.value))},null,8,Cc))]),s.infoItems[c]&&s.infoItems[c].exceedsHeight?(M(),I("button",{key:0,type:"button",class:"tify-info-toggle",onClick:h=>s.infoItems[c].collapsed=!s.infoItems[c].collapsed},[s.infoItems[c].collapsed?(M(),I(ve,{key:0},[ie(o),be(" "+Z(t.$translate("Expand")),1)],64)):(M(),I(ve,{key:1},[ie(l),be(" "+Z(t.$translate("Collapse")),1)],64))],8,Rc)):se("",!0)],2)]))),128))])}const Hc=re(bc,[["render",Lc]]),Oc={data(){return{collectionDataShown:!1}},computed:{manifestOrCollection(){return this.collectionDataShown?this.$store.collection:this.$store.manifest||this.$store.collection||{}},homepages(){return this.manifestOrCollection.homepage?[].concat(this.manifestOrCollection.homepage):[]},logos(){var n;let t=this.manifestOrCollection.logo?[].concat(this.manifestOrCollection.logo):[];return(n=this.manifestOrCollection.provider)==null||n.forEach(e=>{e.logo&&(t=t.concat(e.logo))}),t=t.map(e=>{var i,s,r,o;return{id:e.id,link:((s=(i=e.service)==null?void 0:i[0])==null?void 0:s.id)||((o=(r=e.service)==null?void 0:r[0])==null?void 0:o["@id"])}}),t}},methods:{filterHtml:Pi,isValidUrl:Sn}},Mc={class:"tify-info",tabindex:"0"},Dc={class:"tify-sr-only"},Ac={key:0,class:"tify-info-header"},kc={key:1,class:"tify-info-section -title"},Ic={key:2,class:"tify-info-section -metadata"},Fc={key:3,class:"tify-info-section -description"},Bc={key:4,class:"tify-info-section -metadata -structure"},zc={key:0,class:"tify-info-structure"},Vc={key:5,class:"tify-info-section -related"},Nc={class:"tify-list"},Uc=["href"],jc=["href"],Wc={key:6,class:"tify-info-section -attribution"},Gc=["innerHTML"],qc={key:7,class:"tify-info-section -license"},Zc=["href"],Kc={key:8,class:"tify-info-section -logo"},Xc=["href"],Yc=["src","alt"],Jc=["src","alt"];function Qc(t,n,e,i,s,r){const o=Hc;return M(),I("section",Mc,[D("h2",Dc,Z(t.$translate("Info")),1),t.$store.collection&&t.$store.manifest?(M(),I("div",Ac,[D("button",{type:"button",class:_e(["tify-info-button",{"-active":!s.collectionDataShown}]),onClick:n[0]||(n[0]=l=>s.collectionDataShown=!1)},Z(t.$translate("Document")),3),D("button",{type:"button",class:_e(["tify-info-button",{"-active":s.collectionDataShown}]),onClick:n[1]||(n[1]=l=>s.collectionDataShown=!0)},Z(t.$translate("Collection")),3)])):se("",!0),r.manifestOrCollection.label?(M(),I("div",kc,[D("h3",null,Z(t.$translate("Title")),1),D("p",null,Z(t.$store.localize(r.manifestOrCollection.label)),1)])):se("",!0),r.manifestOrCollection.metadata&&r.manifestOrCollection.metadata.length?(M(),I("div",Ic,[D("h3",null,Z(t.$translate("Metadata")),1),t.$store.options.view==="info"?(M(),Ee(o,{key:0,metadata:r.manifestOrCollection.metadata},null,8,["metadata"])):se("",!0)])):se("",!0),r.manifestOrCollection.summary?(M(),I("div",Fc,[D("h3",null,Z(t.$translate("Description")),1),t.$store.options.view==="info"?(M(),Ee(o,{key:0,metadata:[{value:r.manifestOrCollection.summary}]},null,8,["metadata"])):se("",!0)])):se("",!0),r.manifestOrCollection.structures&&(t.$store.currentStructure.label||t.$store.currentStructure.metadata)?(M(),I("div",Bc,[D("h3",null,Z(t.$translate("Current Element")),1),t.$store.currentStructure.label?(M(),I("p",zc,Z(t.$store.localize(t.$store.currentStructure.label)),1)):se("",!0),t.$store.options.view==="info"&&t.$store.currentStructure.metadata?(M(),Ee(o,{key:1,class:"tify-info-section -metadata",metadata:t.$store.currentStructure.metadata},null,8,["metadata"])):se("",!0)])):se("",!0),r.homepages.length?(M(),I("div",Vc,[D("h3",null,Z(t.$translate("Related Resources")),1),D("ul",Nc,[(M(!0),I(ve,null,Be(r.homepages,(l,a)=>(M(),I("li",{key:a},[typeof l=="string"?(M(),I("a",{key:0,href:l},Z(l),9,Uc)):(M(),I("a",{key:1,href:l.id},Z(t.$store.localize(l.label)||l.id),9,jc))]))),128))])])):se("",!0),r.manifestOrCollection.requiredStatement?(M(),I("div",Wc,[D("h3",null,Z(t.$store.localize(r.manifestOrCollection.requiredStatement.label)),1),D("p",{innerHTML:r.filterHtml(t.$store.localize(r.manifestOrCollection.requiredStatement.value))},null,8,Gc)])):se("",!0),r.manifestOrCollection.rights?(M(),I("div",qc,[D("h3",null,Z(t.$translate("License")),1),D("p",null,[D("a",{href:r.manifestOrCollection.rights},Z(r.manifestOrCollection.rights),9,Zc)])])):se("",!0),r.logos.length?(M(),I("div",Kc,[(M(!0),I(ve,null,Be(r.logos,(l,a)=>(M(),I("p",{key:a},[l.link?(M(),I("a",{key:0,href:l.link},[D("img",{class:"tify-info-logo",src:l.id,alt:t.$translate("Logo")},null,8,Yc)],8,Xc)):(M(),I("img",{key:1,class:"tify-info-logo",src:l.id,alt:t.$translate("Logo")},null,8,Jc))]))),128))])):se("",!0)])}const $c=re(Oc,[["render",Qc]]),eu={name:"TocList",props:{level:{type:Number,default:0},structures:{type:Array,default:()=>[]},purpose:{type:String,default:""}},data(){return{expandedStructures:this.level===0&&this.structures.length===1&&this.structures[0].items.some(t=>t.items)?[!0]:[],id:this.$store.getId(`toc-list-${Math.floor(Math.random()*1e12)}`)}},methods:{getFirstPage(t){if(t.items)return this.getFirstPage(t.items[0]);const n=this.$store.manifest.items.findIndex(e=>e.id===t.id);return n<0?1:n+1},getFirstPageLabel(t){var e;const n=this.getFirstPage(t);return this.$store.localize((e=this.$store.manifest.items[n-1])==null?void 0:e.label)},getLastPage(t){if(t.items)return this.getLastPage(t.items.at(-1));const n=this.$store.manifest.items.findLastIndex(e=>e.id===t.id);return n<0?this.$store.manifest.items.length:n+1},isCurrentPageInStructure(t){if(this.$store.manifest.items.filter((s,r)=>this.$store.options.pages.includes(r+1)).map(s=>s.id).some(s=>{var r;return(r=t.items)==null?void 0:r.some(o=>o.id===s)}))return!0;const e=t.firstPage||this.getFirstPage(t),i=t.lastPage||this.getLastPage(t);return this.$store.options.pages.some(s=>s>=e&&s<=i)},setPage(t){this.$store.setPage(t),this.$store.isMobile()&&this.$store.updateOptions({view:"scan"})},toggleAllChildren(t=null){if(this.$refs.children){for(let n=this.structures.length-1;n>=0;n-=1)this.toggleChildren(n,t);this.$refs.children.forEach(n=>{n.toggleAllChildren(t)})}},toggleChildren(t,n=null){var i;(i=this.structures[t].items)!=null&&i.some(s=>s.items)&&(this.expandedStructures[t]=n!==null?n:!this.expandedStructures[t])}}},tu={class:"tify-toc-list"},iu=["data-level"],nu=["title","aria-controls","aria-expanded","onClick"],su=["href"],ru=["onClick"],ou={class:"tify-toc-label"},au={class:"tify-toc-page"},lu=["onClick"],cu={class:"tify-toc-label"};function uu(t,n,e,i,s,r){const o=Er,l=br,a=Js("TocList",!0);return M(),I("ul",tu,[(M(!0),I(ve,null,Be(e.structures,(c,h)=>{var p,m;return M(),I("li",{key:h,class:_e(["tify-toc-structure",{"-current":r.isCurrentPageInStructure(c),"-expanded":s.expandedStructures[h]}]),"data-level":e.level},[(p=c.items)!=null&&p.some(T=>T.items)?(M(),I("button",{key:0,type:"button",class:"tify-toc-toggle",title:t.$translate(s.expandedStructures[h]?"Collapse":"Expand"),"aria-controls":`${s.id}-${h}`,"aria-expanded":s.expandedStructures[h]?"true":"false",onClick:T=>r.toggleChildren(h)},[s.expandedStructures[h]?(M(),Ee(o,{key:0})):(M(),Ee(l,{key:1}))],8,nu)):se("",!0),e.purpose==="pdf"&&c.pageCount?(M(),I("a",{key:1,class:"tify-toc-link",href:c.rendering[0].id,download:""},Z(t.$store.localize(c.label))+" ("+Z(c.pageCount)+" "+Z(t.$translate(c.pageCount===1?"page":"pages"))+") ",9,su)):c.label&&t.$store.localize(c.label)!==r.getFirstPageLabel(c)?(M(),I("a",{key:2,class:"tify-toc-link -dots",href:"javascript:;",onClick:T=>t.$store.setPage(c.firstPage||r.getFirstPage(c))},[D("span",ou,Z(t.$store.localize(c.label)),1),D("span",au,Z(r.getFirstPageLabel(c)||"—"),1)],8,ru)):(M(),I("a",{key:3,class:"tify-toc-link",href:"javascript:;",onClick:T=>t.$store.setPage(c.firstPage||r.getFirstPage(c))},[D("span",cu,Z(t.$store.localize(c.label)||r.getFirstPageLabel(c)),1)],8,lu)),(m=c.items)!=null&&m.some(T=>T.items)?De((M(),Ee(a,{key:4,id:`${s.id}-${h}`,ref_for:!0,ref:"children",level:e.level+1,purpose:e.purpose,structures:c.items},null,8,["id","level","purpose","structures"])),[[Ke,s.expandedStructures[h]]]):se("",!0)],10,iu)}),128))])}const Pr=re(eu,[["render",uu]]),hu={data(){return{otherItems:[],perElementPdfLinksVisible:!1}},computed:{hasElementPdfLinks(){return!(this.$store.manifest.structures instanceof Array)||!this.$store.manifest.structures[0]||!this.$store.manifest.structures[0].rendering?!1:this.$store.manifest.structures[0].rendering.some(n=>n.format&&n.format==="application/pdf")},imageUrls(){const t={};return this.$store.options.pages.forEach(n=>{var i,s;if(!n)return;const e=(s=(i=this.$store.manifest.items[n-1].items)==null?void 0:i[0].items)==null?void 0:s[0].body;if(e!=null&&e.service){const r=e.service instanceof Array?e.service[0]:e.service,o=["ImageService2","ImageService3"].includes(r.type||r["@type"])?"default":"native",l=r.type==="ImageService3"?"max":"full",a=r.id||r["@id"];t[n]=`${a}${a.at(-1)==="/"?"":"/"}full/${l}/0/${o}.jpg`}else t[n]=e.id}),t},pages(){return this.$store.options.pages.filter(t=>t>0)},renderings(){return this.$store.manifest.rendering?[].concat(this.$store.manifest.rendering):[]}}},fu={class:"tify-export",tabindex:"0"},du={class:"tify-sr-only"},pu={class:"tify-export-section -links"},gu={class:"tify-list"},mu=["href","download"],vu={key:0,class:"tify-export-section -renderings"},yu={class:"tify-list"},wu=["href"],_u={key:0,class:"tify-export-container"},Tu=["aria-controls","aria-expanded"],xu={class:"tify-sr-only"},bu=["id"],Eu={class:"tify-export-section -iiif"},Su=D("h3",null,"IIIF",-1),Pu={class:"tify-list"},Cu={key:0},Ru=["href"],Lu=["href"],Hu={key:1,class:"tify-export-section -other"},Ou={class:"tify-list"},Mu=["href"];function Du(t,n,e,i,s,r){var a;const o=xr,l=Pr;return M(),I("section",fu,[D("h2",du,Z(t.$translate("Export")),1),D("div",pu,[D("h3",null,Z(t.$translate("Download Individual Images")),1),D("ul",gu,[(M(!0),I(ve,null,Be(r.pages,c=>(M(),I("li",{key:c},[D("a",{href:r.imageUrls[c],download:`${c}.jpg`},Z(t.$translate("Page"))+" "+Z(t.$store.getPageLabel(c,t.$store.localize(t.$store.manifest.items[c-1].label))),9,mu)]))),128))])]),t.$store.manifest.rendering?(M(),I("div",vu,[D("h3",null,Z(t.$translate("Renderings")),1),D("ul",yu,[(M(!0),I(ve,null,Be(r.renderings,c=>(M(),I("li",{key:c.id},[D("a",{href:c.id},Z(t.$store.localize(c.label)),9,wu)]))),128))]),r.hasElementPdfLinks?(M(),I("div",_u,[D("button",{type:"button",class:_e(["tify-export-toggle",{"-close":s.perElementPdfLinksVisible}]),"aria-controls":t.$store.getId("export-pdf-list"),"aria-expanded":s.perElementPdfLinksVisible?"true":"false",onClick:n[0]||(n[0]=c=>s.perElementPdfLinksVisible=!s.perElementPdfLinksVisible)},[s.perElementPdfLinksVisible?(M(),I(ve,{key:1},[ie(o),D("span",xu,Z(t.$translate("Close PDF list")),1)],64)):(M(),I(ve,{key:0},[be(Z(t.$translate("PDFs for each element")),1)],64))],10,Tu),s.perElementPdfLinksVisible?(M(),I("div",{key:0,id:t.$store.getId("export-pdf-list"),class:"tify-export-toc"},[D("h4",null,Z(t.$translate("PDFs for each element")),1),ie(l,{ref:"children",purpose:"pdf",level:0,structures:t.$store.structures},null,8,["structures"])],8,bu)):se("",!0)])):se("",!0)])):se("",!0),D("div",Eu,[Su,D("ul",Pu,[t.$store.options.childManifestUrl?(M(),I("li",Cu,[D("a",{href:t.$store.options.childManifestUrl,download:"manifest.json"},Z(t.$translate("IIIF manifest (current document)")),9,Ru)])):se("",!0),D("li",null,[D("a",{href:t.$store.options.manifestUrl,download:"manifest.json"},Z(t.$translate(t.$store.collection?"IIIF manifest (collection)":"IIIF manifest")),9,Lu)])])]),(a=t.$store.manifest.seeAlso)!=null&&a.length?(M(),I("div",Hu,[D("h3",null,Z(t.$translate("Other Formats")),1),D("ul",Ou,[(M(!0),I(ve,null,Be(t.$store.manifest.seeAlso,c=>(M(),I("li",{key:c.id},[D("a",{href:c.id,download:""},Z(c.label?t.$store.localize(c.label):c.id),9,Mu)]))),128))])])):se("",!0)])}const Au=re(hu,[["render",Du]]);function di(t,n,e=120){const i=t,s=e===!0?120:e;if(!s||s<0){i.scrollTop=n;return}const o=(n-t.scrollTop)/s/.1;setTimeout(()=>{i.scrollTop+=o,i.scrollTop!==n&&di(i,n,s-10)},10)}function $i(t,n,e=!0){const i=n.querySelectorAll(t);if(!i.length)return;let s=i[0];const r=i[i.length-1];Array.prototype.forEach.call(i,c=>{c.dataset.level>=s.dataset.level&&(s=c)});const o=n.getBoundingClientRect(),l=s.getBoundingClientRect(),a=r.getBoundingClientRect();if(l.topo.bottom){const c=a.bottom-o.bottom+n.scrollTop;di(n,c+50,e)}}const ds=".tify-toc-structure.-current",ku={data(){return{isInited:!1}},computed:{isNested(){return this.$store.structures.filter(t=>{var n;return(n=t.items)==null?void 0:n.some(e=>e.items)}).length>1}},watch:{"$store.options.pages":function(){this.$nextTick(()=>$i(ds,this.$el))},"$store.options.view":{handler(t){t==="toc"&&this.$nextTick(this.init)},immediate:!0}},methods:{init(){this.isInited=!0,this.$nextTick(()=>$i(ds,this.$el,!1))}}},Iu={class:"tify-toc",tabindex:"0"},Fu={class:"tify-sr-only"},Bu={key:0,class:"tify-toc-header"};function zu(t,n,e,i,s,r){const o=Pr;return M(),I("section",Iu,[D("h2",Fu,Z(t.$translate("Table of Contents")),1),r.isNested?(M(),I("div",Bu,[D("button",{type:"button",class:"tify-toc-toggle-all",onClick:n[0]||(n[0]=l=>t.$refs.children.toggleAllChildren(!0))},Z(t.$translate("Expand all")),1),D("button",{type:"button",class:"tify-toc-toggle-all",onClick:n[1]||(n[1]=l=>t.$refs.children.toggleAllChildren(!1))},Z(t.$translate("Collapse all")),1)])):se("",!0),s.isInited?(M(),Ee(o,{key:1,ref:"children",level:0,structures:t.$store.structures},null,8,["structures"])):se("",!0)])}const Vu=re(ku,[["render",zu]]),Nu=750,Uu={data(){return{itemHeight:0,itemVMargin:0,items:[{label:""}],itemsPerRow:0,knownImages:[],lastScrollTop:0,resizeTimeout:null,style:{},thumbnailWidth:0,touchTimeout:null}},watch:{"$store.options.pages":function(t){this.$nextTick(()=>{const n=".tify-thumbnails-item.-current";t.length>2||t.length>1&&t[1]!==t[0]+1||(this.$refs.container.querySelector(n)?$i(n,this.$el):this.scrollToCurrentPage())})},"$store.options.view":{handler(t){t==="thumbnails"&&this.$nextTick(this.init)},immediate:!0}},mounted(){this.style.flex=this.$el.style.flex},methods:{init(){this.updateDimensions(),this.scrollToCurrentPage(!1),new ResizeObserver(this.onResize).observe(this.$el)},onResize(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.$store.options.view==="thumbnails"&&this.updateDimensions()},200)},updateDimensions(){const t=this.$refs.container.querySelector(".tify-thumbnails-item"),n=t.currentStyle||window.getComputedStyle(t),e=parseInt(n.marginTop,10)+parseFloat(n.marginBottom,10);this.itemHeight=t.offsetHeight+e,this.itemVerticalMargin=e;const i=parseInt(n.marginLeft,10)+parseFloat(n.marginRight,10),s=t.offsetWidth+i;this.thumbnailWidth=t.offsetWidth,this.itemsPerRow=Math.floor(this.$refs.container.clientWidth/s);const o=Math.ceil(this.$store.manifest.items.length/this.itemsPerRow)*this.itemHeight;this.$refs.container.style.height=`${o}px`,this.redrawThumbnails(),this.scrollToCurrentPage(!1)},redrawThumbnails(){const t=this.$el.scrollTop,n=Math.floor(t/this.itemHeight)*this.itemsPerRow+1,i=Math.ceil(this.$el.offsetHeight/this.itemHeight)*this.itemsPerRow,s=n+this.itemsPerRow+i,r=Math.min(this.$store.manifest.items.length,s),o=[];for(let l=n-1;l{const l=Math.floor(n/this.itemsPerRow);this.$refs.container.style.paddingTop=`${l*this.itemHeight}px`})},scrollToCurrentPage(t=!0){const e=Math.floor((this.$store.options.pages[0]-1)/this.itemsPerRow)*this.itemHeight+(this.itemVMargin-50);t?di(this.$el,e):this.$el.scrollTop=e},setPageAndSwitchView(t,n=!1){if(n){const e=this.$store.options.pages.slice(0),i=e.indexOf(t);i<0?(e.push(t),e.sort((s,r)=>s-r),e[0]===0&&e.shift()):e.length>1&&e.splice(i,1),this.$store.updateOptions({pages:e});return}this.$store.setPage(t),this.$store.isMobile()&&this.$store.updateOptions({view:"scan"})},touchStartTogglePage(t){this.lastScrollTop=this.$el.scrollTop,this.touchTimeout=setTimeout(()=>{this.$el.scrollTop===this.lastScrollTop&&this.setPageAndSwitchView(t,!0)},Nu)},touchEnd(){clearTimeout(this.touchTimeout)}}},ju={class:"tify-sr-only"},Wu={ref:"container",class:"tify-thumbnails-list"},Gu=["onClick","onTouchstart"],qu=["src"],Zu={class:"tify-thumbnails-page"};function Ku(t,n,e,i,s,r){return M(),I("section",{class:"tify-thumbnails",tabindex:"0",onScroll:n[1]||(n[1]=(...o)=>r.redrawThumbnails&&r.redrawThumbnails(...o))},[D("h2",ju,Z(t.$translate("Pages")),1),D("div",Wu,[(M(!0),I(ve,null,Be(s.items,o=>(M(),I("a",{key:o.page,class:_e(["tify-thumbnails-item",{"-current":t.$store.options.pages.includes(o.page)}]),href:"javascript:;",onClick:xt(l=>r.setPageAndSwitchView(o.page,l.ctrlKey),["prevent"]),onTouchstart:l=>r.touchStartTogglePage(o.page),onTouchend:n[0]||(n[0]=(...l)=>r.touchEnd&&r.touchEnd(...l))},[D("img",{alt:"",src:o.imgUrl},null,8,qu),D("span",Zu,Z(t.$store.getPageLabel(o.page,o.label)),1)],42,Gu))),128))],512)],32)}const Xu=re(Uu,[["render",Ku]]),Yu={computed:{pages(){return this.$store.options.pages.filter(t=>!!t)}},watch:{"$store.options.annotationId":function(){this.scrollToCurrentAnnotation()},"$store.annotationsAvailable":function(){this.$store.options.annotationId&&this.scrollToCurrentAnnotation()}},mounted(){this.$store.options.annotationId&&this.$store.annotationsAvailable&&this.scrollToCurrentAnnotation()},methods:{filterHtml:Pi,scrollToCurrentAnnotation(){this.$nextTick(()=>{var n;const t=(n=this.$refs.currentItem)==null?void 0:n[0];t&&t.scrollIntoView({behavior:"smooth",block:t.offsetHeight(M(),I("div",{key:o,class:"tify-fulltext-page"},[D("h3",null,Z(t.$translate("Page"))+" "+Z(t.$store.getPageLabel(o,t.$store.localize(t.$store.manifest.items[o-1].label))),1),D("ul",eh,[(M(!0),I(ve,null,Be(t.$store.annotations[o],(l,a)=>(M(),I("li",{key:`${o}-${a}`,ref_for:!0,ref:t.$store.options.annotationId===l.id?"currentItem":"",class:_e(["tify-fulltext-item",{"-current":t.$store.options.annotationId===l.id}])},[D("div",{role:"button",tabindex:"0",class:"tify-fulltext-toggle",onKeydown:At(c=>t.$store.toggleAnnotationId(l.id),["enter","space"]),onClick:c=>t.$store.toggleAnnotationId(l.id),innerHTML:r.filterHtml(l.html)},null,40,th)],2))),128))])]))),128))])):(M(),I("p",ih,Z(t.$translate("Fulltext not available for this page")),1))],512)}const sh=re(Yu,[["render",nh]]),rh={},oh={class:"tify-icon",viewBox:"0 0 24 24"},ah=D("path",{d:"M7.2 4L5.2 2H20C21.11 2 22 2.9 22 4V16C22 16.76 21.57 17.41 20.95 17.75L19.2 16H20V4H7.2M22.11 21.46L20.84 22.73L16.11 18H6L2 22V4C2 3.97 2 3.93 2 3.9L1.11 3L2.39 1.73L6.1 5.44L16.65 16H16.66L18.66 18H18.65L22.11 21.46M14.11 16L4 5.89V18L6 16H14.11Z"},null,-1),lh=[ah];function ch(t,n){return M(),I("svg",oh,lh)}const uh=re(rh,[["render",ch]]),hh={},fh={class:"tify-icon",viewBox:"0 0 24 24"},dh=D("path",{d:"M20,2A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H6L2,22V4C2,2.89 2.9,2 4,2H20M4,4V17.17L5.17,16H20V4H4M6,7H18V9H6V7M6,11H15V13H6V11Z"},null,-1),ph=[dh];function gh(t,n){return M(),I("svg",fh,ph)}const mh=re(hh,[["render",gh]]),vh={},yh={class:"tify-icon",viewBox:"0 0 24 24"},wh=D("path",{d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"},null,-1),_h=[wh];function Th(t,n){return M(),I("svg",yh,_h)}const xh=re(vh,[["render",Th]]),bh={},Eh={class:"tify-icon",viewBox:"0 0 24 24"},Sh=D("path",{d:"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z"},null,-1),Ph=[Sh];function Ch(t,n){return M(),I("svg",Eh,Ph)}const Rh=re(bh,[["render",Ch]]),Lh={},Hh={class:"tify-icon",viewBox:"0 0 24 24"},Oh=D("path",{d:"M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z"},null,-1),Mh=[Oh];function Dh(t,n){return M(),I("svg",Hh,Mh)}const Ah=re(Lh,[["render",Dh]]),kh={},Ih={class:"tify-icon",viewBox:"0 0 24 24"},Fh=D("path",{d:"M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13"},null,-1),Bh=[Fh];function zh(t,n){return M(),I("svg",Ih,Bh)}const Vh=re(kh,[["render",zh]]),Nh={},Uh={class:"tify-icon",viewBox:"0 0 24 24"},jh=D("path",{d:"M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z"},null,-1),Wh=[jh];function Gh(t,n){return M(),I("svg",Uh,Wh)}const qh=re(Nh,[["render",Gh]]),Zh={},Kh={class:"tify-icon",viewBox:"0 0 24 24"},Xh=D("path",{d:"M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z"},null,-1),Yh=[Xh];function Jh(t,n){return M(),I("svg",Kh,Yh)}const Qh=re(Zh,[["render",Jh]]),$h={},ef={class:"tify-icon",viewBox:"0 0 24 24"},tf=D("path",{d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M5,8V10H13V8H5Z"},null,-1),nf=[tf];function sf(t,n){return M(),I("svg",ef,nf)}const rf=re($h,[["render",sf]]),of={},af={class:"tify-icon",viewBox:"0 0 24 24"},lf=D("path",{d:"M19,12H17V15H14V17H19V12M7,9H10V7H5V12H7V9M21,3H3A2,2 0 0,0 1,5V19A2,2 0 0,0 3,21H21A2,2 0 0,0 23,19V5A2,2 0 0,0 21,3M21,19H3V5H21V19Z"},null,-1),cf=[lf];function uf(t,n){return M(),I("svg",af,cf)}const hf=re(of,[["render",uf]]),ff={},df={class:"tify-icon",viewBox:"0 0 24 24"},pf=D("path",{d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M8,5V8H5V10H8V13H10V10H13V8H10V5H8Z"},null,-1),gf=[pf];function mf(t,n){return M(),I("svg",df,gf)}const vf=re(ff,[["render",mf]]),yf={},wf={class:"tify-icon",viewBox:"0 0 24 24"},_f=D("path",{d:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"},null,-1),Tf=[_f];function xf(t,n){return M(),I("svg",wf,Tf)}const Cr=re(yf,[["render",xf]]),bf={},Ef={class:"tify-icon",viewBox:"0 0 24 24"},Sf=D("path",{d:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"},null,-1),Pf=[Sf];function Cf(t,n){return M(),I("svg",Ef,Pf)}const Rr=re(bf,[["render",Cf]]);var Lr={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(bn,function(){var e="__v-click-outside",i=typeof window<"u",s=typeof navigator<"u",r=i&&("ontouchstart"in window||s&&navigator.msMaxTouchPoints>0)?["touchstart"]:["click"],o=function(h){var p=h.event,m=h.handler;(0,h.middleware)(p)&&m(p)},l=function(h,p){var m=function(f){var _=typeof f=="function";if(!_&&typeof f!="object")throw new Error("v-click-outside: Binding value must be a function or an object");return{handler:_?f:f.handler,middleware:f.middleware||function(P){return P},events:f.events||r,isActive:f.isActive!==!1,detectIframe:f.detectIframe!==!1,capture:!!f.capture}}(p.value),T=m.handler,x=m.middleware,S=m.detectIframe,C=m.capture;if(m.isActive){if(h[e]=m.events.map(function(f){return{event:f,srcTarget:document.documentElement,handler:function(_){return function(P){var H=P.el,O=P.event,V=P.handler,W=P.middleware,q=O.path||O.composedPath&&O.composedPath();(q?q.indexOf(H)<0:!H.contains(O.target))&&o({event:O,handler:V,middleware:W})}({el:h,event:_,handler:T,middleware:x})},capture:C}}),S){var A={event:"blur",srcTarget:window,handler:function(f){return function(_){var P=_.el,H=_.event,O=_.handler,V=_.middleware;setTimeout(function(){var W=document.activeElement;W&&W.tagName==="IFRAME"&&!P.contains(W)&&o({event:H,handler:O,middleware:V})},0)}({el:h,event:f,handler:T,middleware:x})},capture:C};h[e]=[].concat(h[e],[A])}h[e].forEach(function(f){var _=f.event,P=f.srcTarget,H=f.handler;return setTimeout(function(){h[e]&&P.addEventListener(_,H,C)},0)})}},a=function(h){(h[e]||[]).forEach(function(p){return p.srcTarget.removeEventListener(p.event,p.handler,p.capture)}),delete h[e]},c=i?{beforeMount:l,updated:function(h,p){var m=p.value,T=p.oldValue;JSON.stringify(m)!==JSON.stringify(T)&&(a(h),l(h,{value:m}))},unmounted:a}:{};return{install:function(h){h.directive("click-outside",c)},directive:c}})})(Lr);var Rf=Lr.exports;const Pn=En(Rf);var Hr={exports:{}};(function(t){//! openseadragon 3.0.0 //! Built on 2021-12-15 //! Git commit: v3.0.0-0-3eded36 //! http://openseadragon.github.io //! License: http://openseadragon.github.io/license/ -function n(e){return new n.Viewer(e)}(function(e){e.version={versionStr:"3.0.0",major:parseInt("3",10),minor:parseInt("0",10),revision:parseInt("0",10)};var i={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},s=Object.prototype.toString,r=Object.prototype.hasOwnProperty;e.isFunction=function(o){return e.type(o)==="function"},e.isArray=Array.isArray||function(o){return e.type(o)==="array"},e.isWindow=function(o){return o&&typeof o=="object"&&"setInterval"in o},e.type=function(o){return o==null?String(o):i[s.call(o)]||"object"},e.isPlainObject=function(o){if(!o||n.type(o)!=="object"||o.nodeType||e.isWindow(o)||o.constructor&&!r.call(o,"constructor")&&!r.call(o.constructor.prototype,"isPrototypeOf"))return!1;var l;for(var a in o)l=a;return l===void 0||r.call(o,l)},e.isEmptyObject=function(o){for(var l in o)return!1;return!0},e.freezeObject=function(o){return Object.freeze?e.freezeObject=Object.freeze:e.freezeObject=function(l){return l},e.freezeObject(o)},e.supportsCanvas=function(){var o=document.createElement("canvas");return!!(e.isFunction(o.getContext)&&o.getContext("2d"))}(),e.isCanvasTainted=function(o){var l=!1;try{o.getContext("2d").getImageData(0,0,1,1)}catch{l=!0}return l},e.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),e.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),e.supportsEventListenerOptions=function(){var o=0;if(e.supportsAddEventListener)try{var l={get capture(){return o++,!1},get once(){return o++,!1},get passive(){return o++,!1}};window.addEventListener("test",null,l),window.removeEventListener("test",null,l)}catch{o=0}return o>=3}(),e.getCurrentPixelDensityRatio=function(){if(e.supportsCanvas){var o=document.createElement("canvas").getContext("2d"),l=window.devicePixelRatio||1,a=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;return Math.max(l,1)/a}else return 1},e.pixelDensityRatio=e.getCurrentPixelDensityRatio()})(n),function(e){e.extend=function(){var a,c,h,p,m,T,x=arguments[0]||{},E=arguments.length,R=!1,M=1;for(typeof x=="boolean"&&(R=x,x=arguments[1]||{},M=2),typeof x!="object"&&!n.isFunction(x)&&(x={}),E===M&&(x=this,--M);M=h.x&&c.x=h.y},getMousePosition:function(a){if(typeof a.pageX=="number")e.getMousePosition=function(c){var h=new e.Point;return h.x=c.pageX,h.y=c.pageY,h};else if(typeof a.clientX=="number")e.getMousePosition=function(c){var h=new e.Point;return h.x=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,h.y=c.clientY+document.body.scrollTop+document.documentElement.scrollTop,h};else throw new Error("Unknown event mouse position, no known technique.");return e.getMousePosition(a)},getPageScroll:function(){var a=document.documentElement||{},c=document.body||{};if(typeof window.pageXOffset=="number")e.getPageScroll=function(){return new e.Point(window.pageXOffset,window.pageYOffset)};else if(c.scrollLeft||c.scrollTop)e.getPageScroll=function(){return new e.Point(document.body.scrollLeft,document.body.scrollTop)};else if(a.scrollLeft||a.scrollTop)e.getPageScroll=function(){return new e.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new e.Point(0,0);return e.getPageScroll()},setPageScroll:function(a){if(typeof window.scrollTo<"u")e.setPageScroll=function(p){window.scrollTo(p.x,p.y)};else{var c=e.getPageScroll();if(c.x===a.x&&c.y===a.y)return;document.body.scrollLeft=a.x,document.body.scrollTop=a.y;var h=e.getPageScroll();if(h.x!==c.x&&h.y!==c.y){e.setPageScroll=function(p){document.body.scrollLeft=p.x,document.body.scrollTop=p.y};return}if(document.documentElement.scrollLeft=a.x,document.documentElement.scrollTop=a.y,h=e.getPageScroll(),h.x!==c.x&&h.y!==c.y){e.setPageScroll=function(p){document.documentElement.scrollLeft=p.x,document.documentElement.scrollTop=p.y};return}e.setPageScroll=function(p){}}e.setPageScroll(a)},getWindowSize:function(){var a=document.documentElement||{},c=document.body||{};if(typeof window.innerWidth=="number")e.getWindowSize=function(){return new e.Point(window.innerWidth,window.innerHeight)};else if(a.clientWidth||a.clientHeight)e.getWindowSize=function(){return new e.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(c.clientWidth||c.clientHeight)e.getWindowSize=function(){return new e.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return e.getWindowSize()},makeCenteredNode:function(a){a=e.getElement(a);var c=[e.makeNeutralElement("div"),e.makeNeutralElement("div"),e.makeNeutralElement("div")];return e.extend(c[0].style,{display:"table",height:"100%",width:"100%"}),e.extend(c[1].style,{display:"table-row"}),e.extend(c[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),c[0].appendChild(c[1]),c[1].appendChild(c[2]),c[2].appendChild(a),c[0]},makeNeutralElement:function(a){var c=document.createElement(a),h=c.style;return h.background="transparent none",h.border="none",h.margin="0px",h.padding="0px",h.position="static",c},now:function(){return Date.now?e.now=Date.now:e.now=function(){return new Date().getTime()},e.now()},makeTransparentImage:function(a){var c=e.makeNeutralElement("img");return c.src=a,c},setElementOpacity:function(a,c,h){var p,m;a=e.getElement(a),h&&!e.Browser.alpha&&(c=Math.round(c)),e.Browser.opacity?a.style.opacity=c<1?c:"":c<1?(p=Math.round(100*c),m="alpha(opacity="+p+")",a.style.filter=m):a.style.filter=""},setElementTouchActionNone:function(a){a=e.getElement(a),typeof a.style.touchAction<"u"?a.style.touchAction="none":typeof a.style.msTouchAction<"u"&&(a.style.msTouchAction="none")},setElementPointerEvents:function(a,c){a=e.getElement(a),typeof a.style.pointerEvents<"u"&&(a.style.pointerEvents=c)},setElementPointerEventsNone:function(a){e.setElementPointerEvents(a,"none")},addClass:function(a,c){a=e.getElement(a),a.className?(" "+a.className+" ").indexOf(" "+c+" ")===-1&&(a.className+=" "+c):a.className=c},indexOf:function(a,c,h){return Array.prototype.indexOf?this.indexOf=function(p,m,T){return p.indexOf(m,T)}:this.indexOf=function(p,m,T){var x,E=T||0,R;if(!p)throw new TypeError;if(R=p.length,R===0||E>=R)return-1;for(E<0&&(E=R-Math.abs(E)),x=E;x=200&&E.status<300||E.status===0&&x!=="http:"&&x!=="https:"?c(E):(e.console.log("AJAX request returned %d: %s",E.status,a),e.isFunction(h)&&h(E)))};try{if(E.open("GET",a,!0),T&&(E.responseType=T),m)for(var R in m)Object.prototype.hasOwnProperty.call(m,R)&&m[R]&&E.setRequestHeader(R,m[R]);p&&(E.withCredentials=!0),E.send(null)}catch(M){e.console.log("%s while making AJAX request: %s",M.name,M.message),E.onreadystatechange=function(){},e.isFunction(h)&&h(E,M)}return E},jsonp:function(a){var c,h=a.url,p=document.head||document.getElementsByTagName("head")[0]||document.documentElement,m=a.callbackName||"openseadragon"+e.now(),T=window[m],x="$1"+m+"$2",E=a.param||"callback",R=a.callback;h=h.replace(/(=)\?(&|$)|\?\?/i,x),h+=(/\?/.test(h)?"&":"?")+E+"="+m,window[m]=function(M){if(T)window[m]=T;else try{delete window[m]}catch{}R&&e.isFunction(R)&&R(M)},c=document.createElement("script"),(a.async!==void 0||a.async!==!1)&&(c.async="async"),a.scriptCharset&&(c.charset=a.scriptCharset),c.src=h,c.onload=c.onreadystatechange=function(M,f){(f||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,p&&c.parentNode&&p.removeChild(c),c=void 0)},p.insertBefore(c,p.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(a){if(window.DOMParser)e.parseXml=function(c){var h=null,p;return p=new DOMParser,h=p.parseFromString(c,"text/xml"),h};else if(window.ActiveXObject)e.parseXml=function(c){var h=null;return h=new ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(c),h};else throw new Error("Browser doesn't support XML DOM.");return e.parseXml(a)},parseJSON:function(a){return e.parseJSON=window.JSON.parse,e.parseJSON(a)},imageFormatSupported:function(a){return a=a||"",!!r[a.toLowerCase()]},setImageFormatsSupported:function(a){e.extend(r,a)}});var s=function(a){};e.console=window.console||{log:s,debug:s,info:s,warn:s,error:s,assert:s},e.Browser={vendor:e.BROWSERS.UNKNOWN,version:0,alpha:!0};var r={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},o={};(function(){var a=navigator.appVersion,c=navigator.userAgent,h;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(c.substring(c.indexOf("MSIE")+5,c.indexOf(";",c.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(c.indexOf("Edge")>=0?(e.Browser.vendor=e.BROWSERS.EDGE,e.Browser.version=parseFloat(c.substring(c.indexOf("Edge")+5))):c.indexOf("Edg")>=0?(e.Browser.vendor=e.BROWSERS.CHROMEEDGE,e.Browser.version=parseFloat(c.substring(c.indexOf("Edg")+4))):c.indexOf("Firefox")>=0?(e.Browser.vendor=e.BROWSERS.FIREFOX,e.Browser.version=parseFloat(c.substring(c.indexOf("Firefox")+8))):c.indexOf("Safari")>=0?(e.Browser.vendor=c.indexOf("Chrome")>=0?e.BROWSERS.CHROME:e.BROWSERS.SAFARI,e.Browser.version=parseFloat(c.substring(c.substring(0,c.indexOf("Safari")).lastIndexOf("/")+1,c.indexOf("Safari")))):(h=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),h.exec(c)!==null&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":e.Browser.vendor=e.BROWSERS.OPERA,e.Browser.version=parseFloat(a);break}var p=window.location.search.substring(1),m=p.split("&"),T,x,E;for(E=0;E0){var R=T.substring(0,x),M=T.substring(x+1);try{o[R]=decodeURIComponent(M)}catch{e.console.error("Ignoring malformed URL parameter: %s=%s",R,M)}}e.Browser.alpha=!(e.Browser.vendor===e.BROWSERS.CHROME&&e.Browser.version<2),e.Browser.opacity=!0,e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version<11&&e.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(a){var c=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,h=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame;if(c&&h)e.requestAnimationFrame=function(){return c.apply(a,arguments)},e.cancelAnimationFrame=function(){return h.apply(a,arguments)};else{var p=[],m=[],T=0,x;e.requestAnimationFrame=function(E){return p.push([++T,E]),x||(x=setInterval(function(){if(p.length){var R=e.now(),M=m;for(m=p,p=M;m.length;)m.shift()[1](R)}else clearInterval(x),x=void 0},1e3/50)),T},e.cancelAnimationFrame=function(E){var R,M;for(R=0,M=p.length;R8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",e.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",e.MouseTracker.wheelEventName],e.MouseTracker.wheelEventName==="DOMMouseScroll"&&e.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),e.MouseTracker.havePointerCapture=function(){var g=document.createElement("div");return e.isFunction(g.setPointerCapture)&&e.isFunction(g.releasePointerCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(e.MouseTracker.havePointerEvents=!1,e.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),e.MouseTracker.mousePointerId="legacy-mouse",e.MouseTracker.havePointerCapture=function(){var g=document.createElement("div");return e.isFunction(g.setCapture)&&e.isFunction(g.releaseCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&e.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&e.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),e.MouseTracker.GesturePointList=function(g){this._gPoints=[],this.type=g,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},e.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(g){return this._gPoints.push(g)},removeById:function(g){var d,y=this._gPoints.length;for(d=0;d1&&(this.type==="mouse"||this.type==="pen")&&(e.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(e.console.warn("GesturePointList.removeContact() Implausible contacts value"),this.contacts=0)}};function o(g){var d=i[g.hash],y,w,I,j,ne,he=d.activePointersLists.length;for(y=0;y0){for(ne=[],j=I.asArray(),w=0;wd.touches.length-I&&e.console.warn("Tracked touch contact count doesn't match event.touches.length");var he={originalEvent:d,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(P(g,he),w=0;w0&&d.removeContact(),w=d.removeById(y.id)):w=d.getLength(),w}function C(g,d){switch(d.eventType){case"pointermove":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasGestureHandlers,d.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!1,d.stopPropagation=!1;break;case"pointerdown":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasGestureHandlers,d.stopPropagation=!1;break;case"pointerup":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasGestureHandlers,d.stopPropagation=!1;break;case"wheel":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasScrollHandler,d.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":d.isStoppable=!0,d.isCancelable=!1,d.preventDefault=!1,d.preventGesture=!1,d.stopPropagation=!1;break;case"click":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!!g.clickHandler,d.preventGesture=!1,d.stopPropagation=!1;break;case"dblclick":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!!g.dblClickHandler,d.preventGesture=!1,d.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:d.isStoppable=!1,d.isCancelable=!1,d.preventDefault=!1,d.preventGesture=!1,d.stopPropagation=!1;break}}function P(g,d){d.eventSource=g,d.eventPhase=d.originalEvent&&typeof d.originalEvent.eventPhase<"u"?d.originalEvent.eventPhase:0,d.defaultPrevented=e.eventIsCanceled(d.originalEvent),d.shouldCapture=!1,d.shouldReleaseCapture=!1,d.userData=g.userData,C(g,d),g.preProcessEventHandler&&g.preProcessEventHandler(d)}function B(g,d,y){var w=g.getActivePointersListByType(d.type),I=w.getById(d.id);I?y&&!I.captured?(I.captured=!0,w.captureCount++):!y&&I.captured&&(I.captured=!1,w.captureCount--,w.captureCount<0&&(w.captureCount=0,e.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):e.console.warn("updatePointerCaptured() called on untracked pointer")}function D(g,d,y){var w=g.getActivePointersListByType(y.type),I;I=w.getById(y.id),I?(I.insideElement=!0,I.lastPos=I.currentPos,I.lastTime=I.currentTime,I.currentPos=y.currentPos,I.currentTime=y.currentTime,y=I):(y.captured=!1,y.insideElementPressed=!1,y.insideElement=!0,v(w,y)),g.enterHandler&&g.enterHandler({eventSource:g,pointerType:y.type,position:M(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData})}function V(g,d,y){var w=g.getActivePointersListByType(y.type),I,j;I=w.getById(y.id),I?(I.captured?(I.insideElement=!1,I.lastPos=I.currentPos,I.lastTime=I.currentTime,I.currentPos=y.currentPos,I.currentTime=y.currentTime):b(g,w,I),y=I):(y.captured=!1,y.insideElementPressed=!1),(g.leaveHandler||g.exitHandler)&&(j={eventSource:g,pointerType:y.type,position:y.currentPos&&M(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData},g.leaveHandler&&g.leaveHandler(j),g.exitHandler&&g.exitHandler(j))}function z(g,d,y){var w,I;w=g.getActivePointersListByType(y.type),I=w.getById(y.id),I?y=I:(y.captured=!1,y.insideElementPressed=!1),g.overHandler&&g.overHandler({eventSource:g,pointerType:y.type,position:M(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData})}function U(g,d,y){var w,I;w=g.getActivePointersListByType(y.type),I=w.getById(y.id),I?y=I:(y.captured=!1,y.insideElementPressed=!1),g.outHandler&&g.outHandler({eventSource:g,pointerType:y.type,position:y.currentPos&&M(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData})}function W(g,d,y,w){var I=i[g.hash],j=g.getActivePointersListByType(y.type),ne;if(typeof d.originalEvent.buttons<"u"?j.buttons=d.originalEvent.buttons:w===0?j.buttons|=1:w===1?j.buttons|=4:w===2?j.buttons|=2:w===3?j.buttons|=8:w===4?j.buttons|=16:w===5&&(j.buttons|=32),w!==0){d.shouldCapture=!1,d.shouldReleaseCapture=!1,g.nonPrimaryPressHandler&&!d.preventGesture&&!d.defaultPrevented&&(d.preventDefault=!0,g.nonPrimaryPressHandler({eventSource:g,pointerType:y.type,position:M(y.currentPos,g.element),button:w,buttons:j.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}));return}if(ne=j.getById(y.id),ne)ne.insideElementPressed=!0,ne.insideElement=!0,ne.originalTarget=d.originalEvent.target,ne.contactPos=y.currentPos,ne.contactTime=y.currentTime,ne.lastPos=ne.currentPos,ne.lastTime=ne.currentTime,ne.currentPos=y.currentPos,ne.currentTime=y.currentTime,y=ne;else{e.console.warn("pointerdown event on untracked pointer"),y.captured=!1,y.insideElementPressed=!0,y.insideElement=!0,y.originalTarget=d.originalEvent.target,v(j,y);return}j.addContact(),!d.preventGesture&&!d.defaultPrevented?(d.shouldCapture=!0,d.shouldReleaseCapture=!1,d.preventDefault=!0,(g.dragHandler||g.dragEndHandler||g.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.addPoint(g,y),j.contacts===1?g.pressHandler&&!d.preventGesture&&g.pressHandler({eventSource:g,pointerType:y.type,position:M(y.contactPos,g.element),buttons:j.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}):j.contacts===2&&g.pinchHandler&&y.type==="touch"&&(I.pinchGPoints=j.asArray(),I.lastPinchDist=I.currentPinchDist=I.pinchGPoints[0].currentPos.distanceTo(I.pinchGPoints[1].currentPos),I.lastPinchCenter=I.currentPinchCenter=f(I.pinchGPoints[0].currentPos,I.pinchGPoints[1].currentPos))):(d.shouldCapture=!1,d.shouldReleaseCapture=!1)}function X(g,d,y,w){var I=i[g.hash],j=g.getActivePointersListByType(y.type),ne,he,Q,Le=!1,Pe;if(typeof d.originalEvent.buttons<"u"?j.buttons=d.originalEvent.buttons:w===0?j.buttons^=-2:w===1?j.buttons^=-5:w===2?j.buttons^=-3:w===3?j.buttons^=-9:w===4?j.buttons^=-17:w===5&&(j.buttons^=-33),d.shouldCapture=!1,w!==0){d.shouldReleaseCapture=!1,g.nonPrimaryReleaseHandler&&!d.preventGesture&&!d.defaultPrevented&&(d.preventDefault=!0,g.nonPrimaryReleaseHandler({eventSource:g,pointerType:y.type,position:M(y.currentPos,g.element),button:w,buttons:j.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}));return}Q=j.getById(y.id),Q?(j.removeContact(),Q.captured&&(Le=!0),Q.lastPos=Q.currentPos,Q.lastTime=Q.currentTime,Q.currentPos=y.currentPos,Q.currentTime=y.currentTime,Q.insideElement||b(g,j,Q),ne=Q.currentPos,he=Q.currentTime):(e.console.warn("updatePointerUp(): pointerup on untracked gPoint"),y.captured=!1,y.insideElementPressed=!1,y.insideElement=!0,v(j,y),Q=y),!d.preventGesture&&!d.defaultPrevented&&(Le?(d.shouldReleaseCapture=!0,d.preventDefault=!0,(g.dragHandler||g.dragEndHandler||g.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.removePoint(g,Q),j.contacts===0?(g.releaseHandler&&g.releaseHandler({eventSource:g,pointerType:Q.type,position:M(ne,g.element),buttons:j.buttons,insideElementPressed:Q.insideElementPressed,insideElementReleased:Q.insideElement,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),g.dragEndHandler&&I.sentDragEvent&&g.dragEndHandler({eventSource:g,pointerType:Q.type,position:M(Q.currentPos,g.element),speed:Q.speed,direction:Q.direction,shift:d.originalEvent.shiftKey,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),I.sentDragEvent=!1,(g.clickHandler||g.dblClickHandler)&&Q.insideElement&&(Pe=he-Q.contactTime<=g.clickTimeThreshold&&Q.contactPos.distanceTo(ne)<=g.clickDistThreshold,g.clickHandler&&g.clickHandler({eventSource:g,pointerType:Q.type,position:M(Q.currentPos,g.element),quick:Pe,shift:d.originalEvent.shiftKey,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,originalTarget:Q.originalTarget,userData:g.userData}),g.dblClickHandler&&Pe&&(j.clicks++,j.clicks===1?(I.lastClickPos=ne,I.dblClickTimeOut=setTimeout(function(){j.clicks=0},g.dblClickTimeThreshold)):j.clicks===2&&(clearTimeout(I.dblClickTimeOut),j.clicks=0,I.lastClickPos.distanceTo(ne)<=g.dblClickDistThreshold&&g.dblClickHandler({eventSource:g,pointerType:Q.type,position:M(Q.currentPos,g.element),shift:d.originalEvent.shiftKey,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),I.lastClickPos=null)))):j.contacts===2&&g.pinchHandler&&Q.type==="touch"&&(I.pinchGPoints=j.asArray(),I.lastPinchDist=I.currentPinchDist=I.pinchGPoints[0].currentPos.distanceTo(I.pinchGPoints[1].currentPos),I.lastPinchCenter=I.currentPinchCenter=f(I.pinchGPoints[0].currentPos,I.pinchGPoints[1].currentPos))):(d.shouldReleaseCapture=!1,g.releaseHandler&&(g.releaseHandler({eventSource:g,pointerType:Q.type,position:M(ne,g.element),buttons:j.buttons,insideElementPressed:Q.insideElementPressed,insideElementReleased:Q.insideElement,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),d.preventDefault=!0)))}function K(g,d,y){var w=i[g.hash],I=g.getActivePointersListByType(y.type),j,ne,he;if(typeof d.originalEvent.buttons<"u"&&(I.buttons=d.originalEvent.buttons),j=I.getById(y.id),j)j.lastPos=j.currentPos,j.lastTime=j.currentTime,j.currentPos=y.currentPos,j.currentTime=y.currentTime;else return;d.shouldCapture=!1,d.shouldReleaseCapture=!1,g.stopHandler&&y.type==="mouse"&&(clearTimeout(g.stopTimeOut),g.stopTimeOut=setTimeout(function(){pe(g,d.originalEvent,y.type)},g.stopDelay)),I.contacts===0?g.moveHandler&&g.moveHandler({eventSource:g,pointerType:y.type,position:M(y.currentPos,g.element),buttons:I.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}):I.contacts===1?(g.moveHandler&&(j=I.asArray()[0],g.moveHandler({eventSource:g,pointerType:j.type,position:M(j.currentPos,g.element),buttons:I.buttons,isTouchEvent:j.type==="touch",originalEvent:d.originalEvent,userData:g.userData})),g.dragHandler&&!d.preventGesture&&!d.defaultPrevented&&(j=I.asArray()[0],he=j.currentPos.minus(j.lastPos),g.dragHandler({eventSource:g,pointerType:j.type,position:M(j.currentPos,g.element),buttons:I.buttons,delta:he,speed:j.speed,direction:j.direction,shift:d.originalEvent.shiftKey,isTouchEvent:j.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),d.preventDefault=!0,w.sentDragEvent=!0)):I.contacts===2&&(g.moveHandler&&(ne=I.asArray(),g.moveHandler({eventSource:g,pointerType:ne[0].type,position:M(f(ne[0].currentPos,ne[1].currentPos),g.element),buttons:I.buttons,isTouchEvent:ne[0].type==="touch",originalEvent:d.originalEvent,userData:g.userData})),g.pinchHandler&&y.type==="touch"&&!d.preventGesture&&!d.defaultPrevented&&(he=w.pinchGPoints[0].currentPos.distanceTo(w.pinchGPoints[1].currentPos),he!==w.currentPinchDist&&(w.lastPinchDist=w.currentPinchDist,w.currentPinchDist=he,w.lastPinchCenter=w.currentPinchCenter,w.currentPinchCenter=f(w.pinchGPoints[0].currentPos,w.pinchGPoints[1].currentPos),g.pinchHandler({eventSource:g,pointerType:"touch",gesturePoints:w.pinchGPoints,lastCenter:M(w.lastPinchCenter,g.element),center:M(w.currentPinchCenter,g.element),lastDistance:w.lastPinchDist,distance:w.currentPinchDist,shift:d.originalEvent.shiftKey,originalEvent:d.originalEvent,userData:g.userData}),d.preventDefault=!0)))}function te(g,d,y){var w=g.getActivePointersListByType(y.type),I;I=w.getById(y.id),I&&b(g,w,I)}function pe(g,d,y){g.stopHandler&&g.stopHandler({eventSource:g,pointerType:y,position:R(d,g.element),buttons:g.getActivePointersListByType(y).buttons,isTouchEvent:y==="touch",originalEvent:d,userData:g.userData})}}(n),function(e){e.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},e.Control=function(i,s,r){var o=i.parentNode;typeof s=="number"&&(e.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),s={anchor:s}),s.attachToViewer=typeof s.attachToViewer>"u"?!0:s.attachToViewer,this.autoFade=typeof s.autoFade>"u"?!0:s.autoFade,this.element=i,this.anchor=s.anchor,this.container=r,this.anchor===e.ControlAnchor.ABSOLUTE?(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof s.top=="number"?s.top+"px":s.top,this.wrapper.style.left=typeof s.left=="number"?s.left+"px":s.left,this.wrapper.style.height=typeof s.height=="number"?s.height+"px":s.height,this.wrapper.style.width=typeof s.width=="number"?s.width+"px":s.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===e.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),s.attachToViewer?this.anchor===e.ControlAnchor.TOP_RIGHT||this.anchor===e.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):o.appendChild(this.wrapper)},e.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==e.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(i){this.wrapper.style.display=i?this.anchor===e.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(i){this.element[e.SIGNAL]&&e.Browser.vendor===e.BROWSERS.IE?e.setElementOpacity(this.element,i,!0):e.setElementOpacity(this.wrapper,i,!0)}}}(n),function(e){e.ControlDock=function(s){var r=["topleft","topright","bottomright","bottomleft"],o,l;for(e.extend(!0,this,{id:"controldock-"+e.now()+"-"+Math.floor(Math.random()*1e6),container:e.makeNeutralElement("div"),controls:[]},s),this.container.onsubmit=function(){return!1},this.element&&(this.element=e.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),l=0;l=0)){switch(r.anchor){case e.ControlAnchor.TOP_RIGHT:o=this.controls.topright,s.style.position="relative",s.style.paddingRight="0px",s.style.paddingTop="0px";break;case e.ControlAnchor.BOTTOM_RIGHT:o=this.controls.bottomright,s.style.position="relative",s.style.paddingRight="0px",s.style.paddingBottom="0px";break;case e.ControlAnchor.BOTTOM_LEFT:o=this.controls.bottomleft,s.style.position="relative",s.style.paddingLeft="0px",s.style.paddingBottom="0px";break;case e.ControlAnchor.TOP_LEFT:o=this.controls.topleft,s.style.position="relative",s.style.paddingLeft="0px",s.style.paddingTop="0px";break;case e.ControlAnchor.ABSOLUTE:o=this.container,s.style.margin="0px",s.style.padding="0px";break;default:case e.ControlAnchor.NONE:o=this.container,s.style.margin="0px",s.style.padding="0px";break}this.controls.push(new e.Control(s,r,o)),s.style.display="inline-block"}},removeControl:function(s){s=e.getElement(s);var r=i(this,s);return r>=0&&(this.controls[r].destroy(),this.controls.splice(r,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var s;for(s=this.controls.length-1;s>=0;s--)if(this.controls[s].isVisible())return!0;return!1},setControlsEnabled:function(s){var r;for(r=this.controls.length-1;r>=0;r--)this.controls[r].setVisible(s);return this}};function i(s,r){var o=s.controls,l;for(l=o.length-1;l>=0;l--)if(o[l].element===r)return l;return-1}}(n),function(e){e.Placement=e.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(n),function(e){var i={},s=1;e.Viewer=function(u){var v=arguments,b=this,C;if(e.isPlainObject(u)||(u={id:v[0],xmlPath:v.length>1?v[1]:void 0,prefixUrl:v.length>2?v[2]:void 0,controls:v.length>3?v[3]:void 0,overlays:v.length>4?v[4]:void 0}),u.config&&(e.extend(!0,u,u.config),delete u.config),e.extend(!0,this,{id:u.id,hash:u.hash||s++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},e.DEFAULT_SETTINGS,u),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof i[this.hash]<"u"&&e.console.warn("Hash "+this.hash+" has already been used."),i[this.hash]={fsBoundsDelta:new e.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=e.now(),e.EventSource.call(this),this.addHandler("open-failed",function(P){var B=e.getString("Errors.OpenFailed",P.eventSource,P.message);b._showMessage(B)}),e.ControlDock.call(this,u),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=e.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(P){P.width="100%",P.height="100%",P.overflow="hidden",P.position="absolute",P.top="0px",P.left="0px"}(this.canvas.style),e.setElementTouchActionNone(this.canvas),u.tabIndex!==""&&(this.canvas.tabIndex=u.tabIndex===void 0?0:u.tabIndex),this.container.className="openseadragon-container",function(P){P.width="100%",P.height="100%",P.position="relative",P.overflow="hidden",P.left="0px",P.top="0px",P.textAlign="left"}(this.container.style),e.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new e.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:e.delegate(this,R),keyDownHandler:e.delegate(this,M),keyHandler:e.delegate(this,f),clickHandler:e.delegate(this,_),dblClickHandler:e.delegate(this,H),dragHandler:e.delegate(this,L),dragEndHandler:e.delegate(this,O),enterHandler:e.delegate(this,N),leaveHandler:e.delegate(this,G),pressHandler:e.delegate(this,q),releaseHandler:e.delegate(this,$),nonPrimaryPressHandler:e.delegate(this,re),nonPrimaryReleaseHandler:e.delegate(this,J),scrollHandler:e.delegate(this,ue),pinchHandler:e.delegate(this,fe)}),this.outerTracker=new e.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:e.delegate(this,me),leaveHandler:e.delegate(this,le)}),this.toolbar&&(this.toolbar=new e.ControlDock({element:this.toolbar})),this.bindStandardControls(),i[this.hash].prevContainerSize=r(this.container),this.world=new e.World({viewer:this}),this.world.addHandler("add-item",function(P){b.source=b.world.getItemAt(0).source,i[b.hash].forceRedraw=!0,b._updateRequestId||(b._updateRequestId=c(b,oe))}),this.world.addHandler("remove-item",function(P){b.world.getItemCount()?b.source=b.world.getItemAt(0).source:b.source=null,i[b.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(P){b.viewport&&b.viewport._setContentBounds(b.world.getHomeBounds(),b.world.getContentFactor())}),this.world.addHandler("item-index-change",function(P){b.source=b.world.getItemAt(0).source}),this.viewport=new e.Viewport({containerSize:i[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new e.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:u.timeout}),this.tileCache=new e.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new e.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=e.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(C=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(C,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(C=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(C,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new e.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),C=0;C-1&&u.index=0&&u=0)return this;var B=l(this,P);return this.currentOverlays.push(B),B.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:u,location:P.location,placement:P.placement}),this},updateOverlay:function(u,v,b){var C;return u=e.getElement(u),C=a(this.currentOverlays,u),C>=0&&(this.currentOverlays[C].update(v,b),i[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:u,location:v,placement:b})),this},removeOverlay:function(u){var v;return u=e.getElement(u),v=a(this.currentOverlays,u),v>=0&&(this.currentOverlays[v].destroy(),this.currentOverlays.splice(v,1),i[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:u})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return i[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(u){var v;return u=e.getElement(u),v=a(this.currentOverlays,u),v>=0?this.currentOverlays[v]:null},_updateSequenceButtons:function(u){this.nextButton&&(!this.tileSources||this.tileSources.length-1===u?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(u>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(u){this._hideMessage();var v=e.makeNeutralElement("div");v.appendChild(document.createTextNode(u)),this.messageDiv=e.makeCenteredNode(v),e.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var u=this.messageDiv;u&&(u.parentNode.removeChild(u),delete this.messageDiv)},gestureSettingsByDeviceType:function(u){switch(u){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var u,v=this.currentOverlays.length;for(u=0;u1&&(this.referenceStrip=new e.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else e.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),e.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){e.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var u=e.pixelDensityRatio,v=e.getCurrentPixelDensityRatio();u!==v&&(e.pixelDensityRatio=v,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var u=this._sequenceIndex-1;this.navPrevNextWrap&&u<0&&(u+=this.tileSources.length),this.goToPage(u)},goToNextPage:function(){var u=this._sequenceIndex+1;this.navPrevNextWrap&&u>=this.tileSources.length&&(u=0),this.goToPage(u)}});function r(u){return u=e.getElement(u),new e.Point(u.clientWidth===0?1:u.clientWidth,u.clientHeight===0?1:u.clientHeight)}function o(u,v,b,C,P){var B=u;if(e.type(v)==="string"){if(v.match(/^\s*<.*>\s*$/))v=e.parseXml(v);else if(v.match(/^\s*[{[].*[}\]]\s*$/))try{var D=e.parseJSON(v);v=D}catch{}}function V(z,U){z.ready?C(z):(z.addHandler("ready",function(){C(z)}),z.addHandler("open-failed",function(W){P({message:W.message,source:U})}))}setTimeout(function(){if(e.type(v)==="string")v=new e.TileSource({url:v,crossOriginPolicy:b.crossOriginPolicy!==void 0?b.crossOriginPolicy:u.crossOriginPolicy,ajaxWithCredentials:u.ajaxWithCredentials,ajaxHeaders:b.ajaxHeaders?b.ajaxHeaders:u.ajaxHeaders,useCanvas:u.useCanvas,success:function(X){C(X.tileSource)}}),v.addHandler("open-failed",function(X){P(X)});else if(e.isPlainObject(v)||v.nodeType)if(v.crossOriginPolicy===void 0&&(b.crossOriginPolicy!==void 0||u.crossOriginPolicy!==void 0)&&(v.crossOriginPolicy=b.crossOriginPolicy!==void 0?b.crossOriginPolicy:u.crossOriginPolicy),v.ajaxWithCredentials===void 0&&(v.ajaxWithCredentials=u.ajaxWithCredentials),v.useCanvas===void 0&&(v.useCanvas=u.useCanvas),e.isFunction(v.getTileUrl)){var z=new e.TileSource(v);z.getTileUrl=v.getTileUrl,C(z)}else{var U=e.TileSource.determineType(B,v);if(!U){P({message:"Unable to load TileSource",source:v});return}var W=U.prototype.configure.apply(B,[v]);V(new U(W),v)}else V(v,v)})}function l(u,v){if(v instanceof e.Overlay)return v;var b=null;if(v.element)b=e.getElement(v.element);else{var C=v.id?v.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);b=e.getElement(v.id),b||(b=document.createElement("a"),b.href="#/overlay/"+C),b.id=C,e.addClass(b,v.className?v.className:"openseadragon-overlay")}var P=v.location,B=v.width,D=v.height;if(!P){var V=v.x,z=v.y;if(v.px!==void 0){var U=u.viewport.imageToViewportRectangle(new e.Rect(v.px,v.py,B||0,D||0));V=U.x,z=U.y,B=B!==void 0?U.width:void 0,D=D!==void 0?U.height:void 0}P=new e.Point(V,z)}var W=v.placement;return W&&e.type(W)==="string"&&(W=e.Placement[v.placement.toUpperCase()]),new e.Overlay({element:b,location:P,placement:W,onDraw:v.onDraw,checkResize:v.checkResize,width:B,height:D,rotationMode:v.rotationMode})}function a(u,v){var b;for(b=u.length-1;b>=0;b--)if(u[b].element===v)return b;return-1}function c(u,v){return e.requestAnimationFrame(function(){v(u)})}function h(u){e.requestAnimationFrame(function(){m(u)})}function p(u){u.autoHideControls&&(u.controlsShouldFade=!0,u.controlsFadeBeginTime=e.now()+u.controlsFadeDelay,window.setTimeout(function(){h(u)},u.controlsFadeDelay))}function m(u){var v,b,C,P;if(u.controlsShouldFade){for(v=e.now(),b=v-u.controlsFadeBeginTime,C=1-b/u.controlsFadeLength,C=Math.min(1,C),C=Math.max(0,C),P=u.controls.length-1;P>=0;P--)u.controls[P].autoFade&&u.controls[P].setOpacity(C);C>0&&h(u)}}function T(u){var v;for(u.controlsShouldFade=!1,v=u.controls.length-1;v>=0;v--)u.controls[v].setOpacity(1)}function x(){T(this)}function E(){p(this)}function R(u){var v={tracker:u.eventSource,position:u.position,originalEvent:u.originalEvent,preventDefault:u.preventDefault};this.raiseEvent("canvas-contextmenu",v),u.preventDefault=v.preventDefault}function M(u){var v={originalEvent:u.originalEvent,preventDefaultAction:!1,preventVerticalPan:u.preventVerticalPan,preventHorizontalPan:u.preventHorizontalPan};if(this.raiseEvent("canvas-key",v),!v.preventDefaultAction&&!u.ctrl&&!u.alt&&!u.meta)switch(u.keyCode){case 38:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 40:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 37:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 39:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;default:u.preventDefault=!1;break}else u.preventDefault=!1}function f(u){var v={originalEvent:u.originalEvent,preventDefaultAction:!1,preventVerticalPan:u.preventVerticalPan,preventHorizontalPan:u.preventHorizontalPan};if(this.raiseEvent("canvas-key",v),!v.preventDefaultAction&&!u.ctrl&&!u.alt&&!u.meta)switch(u.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 119:case 87:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-40))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 115:case 83:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,40))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 97:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-40,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 100:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(40,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),u.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:u.preventDefault=!1;break}else u.preventDefault=!1}function _(u){var v,b=document.activeElement===this.canvas;b||this.canvas.focus(),this.viewport.flipped&&(u.position.x=this.viewport.getContainerSize().x-u.position.x);var C={tracker:u.eventSource,position:u.position,quick:u.quick,shift:u.shift,originalEvent:u.originalEvent,originalTarget:u.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",C),!C.preventDefaultAction&&this.viewport&&u.quick&&(v=this.gestureSettingsByDeviceType(u.pointerType),v.clickToZoom&&(this.viewport.zoomBy(u.shift?1/this.zoomPerClick:this.zoomPerClick,v.zoomToRefPoint?this.viewport.pointFromPixel(u.position,!0):null),this.viewport.applyConstraints()))}function H(u){var v,b={tracker:u.eventSource,position:u.position,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",b),!b.preventDefaultAction&&this.viewport&&(v=this.gestureSettingsByDeviceType(u.pointerType),v.dblClickToZoom&&(this.viewport.zoomBy(u.shift?1/this.zoomPerClick:this.zoomPerClick,v.zoomToRefPoint?this.viewport.pointFromPixel(u.position,!0):null),this.viewport.applyConstraints()))}function L(u){var v,b={tracker:u.eventSource,pointerType:u.pointerType,position:u.position,delta:u.delta,speed:u.speed,direction:u.direction,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",b),v=this.gestureSettingsByDeviceType(u.pointerType),v.dragToPan&&!b.preventDefaultAction&&this.viewport){if(this.panHorizontal||(u.delta.x=0),this.panVertical||(u.delta.y=0),this.viewport.flipped&&(u.delta.x=-u.delta.x),this.constrainDuringPan){var C=this.viewport.deltaPointsFromPixels(u.delta.negate());this.viewport.centerSpringX.target.value+=C.x,this.viewport.centerSpringY.target.value+=C.y;var P=this.viewport.getBounds(),B=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=C.x,this.viewport.centerSpringY.target.value-=C.y,P.x!==B.x&&(u.delta.x=0),P.y!==B.y&&(u.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(u.delta.negate()),v.flickEnabled&&!this.constrainDuringPan)}}function O(u){var v={tracker:u.eventSource,pointerType:u.pointerType,position:u.position,speed:u.speed,direction:u.direction,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",v),!v.preventDefaultAction&&this.viewport){var b=this.gestureSettingsByDeviceType(u.pointerType);if(b.flickEnabled&&u.speed>=b.flickMinSpeed){var C=0;this.panHorizontal&&(C=b.flickMomentum*u.speed*Math.cos(u.direction));var P=0;this.panVertical&&(P=b.flickMomentum*u.speed*Math.sin(u.direction));var B=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),D=this.viewport.pointFromPixel(new e.Point(B.x-C,B.y-P));this.viewport.panTo(D,!1)}this.viewport.applyConstraints()}}function N(u){this.raiseEvent("canvas-enter",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function G(u){this.raiseEvent("canvas-exit",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function q(u){this.raiseEvent("canvas-press",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,insideElementPressed:u.insideElementPressed,insideElementReleased:u.insideElementReleased,originalEvent:u.originalEvent})}function $(u){this.raiseEvent("canvas-release",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,insideElementPressed:u.insideElementPressed,insideElementReleased:u.insideElementReleased,originalEvent:u.originalEvent})}function re(u){this.raiseEvent("canvas-nonprimary-press",{tracker:u.eventSource,position:u.position,pointerType:u.pointerType,button:u.button,buttons:u.buttons,originalEvent:u.originalEvent})}function J(u){this.raiseEvent("canvas-nonprimary-release",{tracker:u.eventSource,position:u.position,pointerType:u.pointerType,button:u.button,buttons:u.buttons,originalEvent:u.originalEvent})}function fe(u){var v,b,C,P,B={tracker:u.eventSource,pointerType:u.pointerType,gesturePoints:u.gesturePoints,lastCenter:u.lastCenter,center:u.center,lastDistance:u.lastDistance,distance:u.distance,shift:u.shift,originalEvent:u.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",B),this.viewport&&(v=this.gestureSettingsByDeviceType(u.pointerType),v.pinchToZoom&&(!B.preventDefaultPanAction||!B.preventDefaultZoomAction)&&(b=this.viewport.pointFromPixel(u.center,!0),B.preventDefaultZoomAction||this.viewport.zoomBy(u.distance/u.lastDistance,b,!0),v.zoomToRefPoint&&!B.preventDefaultPanAction&&(C=this.viewport.pointFromPixel(u.lastCenter,!0),P=C.minus(b),this.panHorizontal||(P.x=0),this.panVertical||(P.y=0),this.viewport.panBy(P,!0)),this.viewport.applyConstraints()),v.pinchRotate&&!B.preventDefaultRotateAction)){var D=Math.atan2(u.gesturePoints[0].currentPos.y-u.gesturePoints[1].currentPos.y,u.gesturePoints[0].currentPos.x-u.gesturePoints[1].currentPos.x),V=Math.atan2(u.gesturePoints[0].lastPos.y-u.gesturePoints[1].lastPos.y,u.gesturePoints[0].lastPos.x-u.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(D-V)*(180/Math.PI))}}function ue(u){var v,b,C,P,B;P=e.now(),B=P-this._lastScrollTime,B>this.minScrollDeltaTime?(this._lastScrollTime=P,v={tracker:u.eventSource,position:u.position,scroll:u.scroll,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",v),!v.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(u.position.x=this.viewport.getContainerSize().x-u.position.x),b=this.gestureSettingsByDeviceType(u.pointerType),b.scrollToZoom&&(C=Math.pow(this.zoomPerScroll,u.scroll),this.viewport.zoomBy(C,b.zoomToRefPoint?this.viewport.pointFromPixel(u.position,!0):null),this.viewport.applyConstraints())),u.preventDefault=v.preventDefault):u.preventDefault=!0}function me(u){i[this.hash].mouseInside=!0,T(this),this.raiseEvent("container-enter",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function le(u){u.pointers<1&&(i[this.hash].mouseInside=!1,i[this.hash].animating||p(this)),this.raiseEvent("container-exit",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function oe(u){ee(u),u.isOpen()?u._updateRequestId=c(u,oe):u._updateRequestId=!1}function ee(u){if(!(u._opening||!i[u.hash])){if(u.autoResize){var v=r(u.container),b=i[u.hash].prevContainerSize;if(!v.equals(b)){var C=u.viewport;if(u.preserveImageSizeOnResize){var P=b.x/v.x,B=C.getZoom()*P,D=C.getCenter();C.resize(v,!1),C.zoomTo(B,null,!0),C.panTo(D,!0)}else{var V=C.getBounds();C.resize(v,!0),C.fitBoundsWithConstraints(V,!0)}i[u.hash].prevContainerSize=v,i[u.hash].forceRedraw=!0}}var z=u.viewport.update(),U=u.world.update()||z;z&&u.raiseEvent("viewport-change"),u.referenceStrip&&(U=u.referenceStrip.update(u.viewport)||U),!i[u.hash].animating&&U&&(u.raiseEvent("animation-start"),T(u)),(U||i[u.hash].forceRedraw||u.world.needsDraw())&&(ye(u),u._drawOverlays(),u.navigator&&u.navigator.update(u.viewport),i[u.hash].forceRedraw=!1,U&&u.raiseEvent("animation")),i[u.hash].animating&&!U&&(u.raiseEvent("animation-finish"),i[u.hash].mouseInside||p(u)),i[u.hash].animating=U}}function ye(u){u.imageLoader.clear(),u.drawer.clear(),u.world.draw(),u.raiseEvent("update-viewport",{})}function Y(u,v){return u?u+v:v}function Ee(){i[this.hash].lastZoomTime=e.now(),i[this.hash].zoomFactor=this.zoomPerSecond,i[this.hash].zooming=!0,st(this)}function Ae(){i[this.hash].lastZoomTime=e.now(),i[this.hash].zoomFactor=1/this.zoomPerSecond,i[this.hash].zooming=!0,st(this)}function mt(){i[this.hash].zooming=!1}function st(u){e.requestAnimationFrame(e.delegate(u,Ht))}function Ht(){var u,v,b;i[this.hash].zooming&&this.viewport&&(u=e.now(),v=u-i[this.hash].lastZoomTime,b=Math.pow(i[this.hash].zoomFactor,v/1e3),this.viewport.zoomBy(b),this.viewport.applyConstraints(),i[this.hash].lastZoomTime=u,st(this))}function ke(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function Qe(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function rt(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function Ot(){this.viewport&&this.viewport.goHome()}function Ue(){this.isFullPage()&&!e.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function ot(){if(this.viewport){var u=this.viewport.getRotation();this.viewport.flipped?u=e.positiveModulo(u+this.rotationIncrement,360):u=e.positiveModulo(u-this.rotationIncrement,360),this.viewport.setRotation(u)}}function vt(){if(this.viewport){var u=this.viewport.getRotation();this.viewport.flipped?u=e.positiveModulo(u-this.rotationIncrement,360):u=e.positiveModulo(u+this.rotationIncrement,360),this.viewport.setRotation(u)}}function S(){this.viewport.toggleFlip()}}(n),function(e){e.Navigator=function(c){var h=c.viewer,p=this,m,T;c.id?(this.element=document.getElementById(c.id),c.controlOptions={anchor:e.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(c.id="navigator-"+e.now(),this.element=e.makeNeutralElement("div"),c.controlOptions={anchor:e.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:c.autoFade},c.position&&(c.position==="BOTTOM_RIGHT"?c.controlOptions.anchor=e.ControlAnchor.BOTTOM_RIGHT:c.position==="BOTTOM_LEFT"?c.controlOptions.anchor=e.ControlAnchor.BOTTOM_LEFT:c.position==="TOP_RIGHT"?c.controlOptions.anchor=e.ControlAnchor.TOP_RIGHT:c.position==="TOP_LEFT"?c.controlOptions.anchor=e.ControlAnchor.TOP_LEFT:c.position==="ABSOLUTE"&&(c.controlOptions.anchor=e.ControlAnchor.ABSOLUTE,c.controlOptions.top=c.top,c.controlOptions.left=c.left,c.controlOptions.height=c.height,c.controlOptions.width=c.width))),this.element.id=c.id,this.element.className+=" navigator",c=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.navigatorSizeRatio},c,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:c.autoResize,minZoomImageRatio:1,background:c.background,opacity:c.opacity,borderColor:c.borderColor,displayRegionColor:c.displayRegionColor}),c.minPixelRatio=this.minPixelRatio=h.minPixelRatio,e.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new e.Point(1,1),this.totalBorderWidths=new e.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),c.controlOptions.anchor!==e.ControlAnchor.NONE&&function(R,M){R.margin="0px",R.border=M+"px solid "+c.borderColor,R.padding="0px",R.background=c.background,R.opacity=c.opacity,R.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=e.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(R,M){R.position="relative",R.top="0px",R.left="0px",R.fontSize="0px",R.overflow="hidden",R.border=M+"px solid "+c.displayRegionColor,R.margin="0px",R.padding="0px",R.background="transparent",R.float="left",R.cssFloat="left",R.styleFloat="left",R.zIndex=999999999,R.cursor="default"}(this.displayRegion.style,this.borderWidth),e.setElementPointerEventsNone(this.displayRegion),e.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=e.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",e.setElementPointerEventsNone(this.displayRegionContainer),e.setElementTouchActionNone(this.displayRegionContainer),h.addControl(this.element,c.controlOptions),this._resizeWithViewer=c.controlOptions.anchor!==e.ControlAnchor.ABSOLUTE&&c.controlOptions.anchor!==e.ControlAnchor.NONE,c.width&&c.height?(this.setWidth(c.width),this.setHeight(c.height)):this._resizeWithViewer&&(m=e.getElementSize(h.element),this.element.style.height=Math.round(m.y*c.sizeRatio)+"px",this.element.style.width=Math.round(m.x*c.sizeRatio)+"px",this.oldViewerSize=m,T=e.getElementSize(this.element),this.elementArea=T.x*T.y),this.oldContainerSize=new e.Point(0,0),e.Viewer.apply(this,[c]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function x(R){l(p.displayRegionContainer,R),l(p.displayRegion,-R),p.viewport.setRotation(R)}if(c.navigatorRotate){var E=c.viewer.viewport?c.viewer.viewport.getRotation():c.viewer.degrees||0;x(E),c.viewer.addHandler("rotate",function(R){x(R.degrees)})}this.innerTracker.destroy(),this.innerTracker=new e.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:e.delegate(this,s),clickHandler:e.delegate(this,i),releaseHandler:e.delegate(this,r),scrollHandler:e.delegate(this,o),preProcessEventHandler:function(R){R.eventType==="wheel"&&(R.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",e.setElementPointerEventsNone(this.canvas),e.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){p.viewport&&p.viewport.goHome(!0)}),h.world.addHandler("item-index-change",function(R){window.setTimeout(function(){var M=p.world.getItemAt(R.previousIndex);p.world.setItemIndex(M,R.newIndex)},1)}),h.world.addHandler("remove-item",function(R){var M=R.item,f=p._getMatchingItem(M);f&&p.world.removeItem(f)}),this.update(h.viewport)},e.extend(e.Navigator.prototype,e.EventSource.prototype,e.Viewer.prototype,{updateSize:function(){if(this.viewport){var c=new e.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);c.equals(this.oldContainerSize)||(this.viewport.resize(c,!0),this.viewport.goHome(!0),this.oldContainerSize=c,this.drawer.clear(),this.world.draw())}},setWidth:function(c){this.width=c,this.element.style.width=typeof c=="number"?c+"px":c,this._resizeWithViewer=!1},setHeight:function(c){this.height=c,this.element.style.height=typeof c=="number"?c+"px":c,this._resizeWithViewer=!1},setFlip:function(c){return this.viewport.setFlip(c),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(c){a(this.displayRegion,c),a(this.canvas,c),a(this.element,c)},update:function(c){var h,p,m,T,x,E;if(h=e.getElementSize(this.viewer.element),this._resizeWithViewer&&h.x&&h.y&&!h.equals(this.oldViewerSize)&&(this.oldViewerSize=h,this.maintainSizeRatio||!this.elementArea?(p=h.x*this.sizeRatio,m=h.y*this.sizeRatio):(p=Math.sqrt(this.elementArea*(h.x/h.y)),m=this.elementArea/p),this.element.style.width=Math.round(p)+"px",this.element.style.height=Math.round(m)+"px",this.elementArea||(this.elementArea=p*m),this.updateSize()),c&&this.viewport){T=c.getBoundsNoRotate(!0),x=this.viewport.pixelFromPointNoRotate(T.getTopLeft(),!1),E=this.viewport.pixelFromPointNoRotate(T.getBottomRight(),!1).minus(this.totalBorderWidths);var R=this.displayRegion.style;R.display=this.world.getItemCount()?"block":"none",R.top=Math.round(x.y)+"px",R.left=Math.round(x.x)+"px";var M=Math.abs(x.x-E.x),f=Math.abs(x.y-E.y);R.width=Math.round(Math.max(M,0))+"px",R.height=Math.round(Math.max(f,0))+"px"}},addTiledImage:function(c){var h=this,p=c.originalTiledImage;delete c.original;var m=e.extend({},c,{success:function(T){var x=T.item;x._originalForNavigator=p,h._matchBounds(x,p,!0),h._matchOpacity(x,p),h._matchCompositeOperation(x,p);function E(){h._matchBounds(x,p)}function R(){h._matchOpacity(x,p)}function M(){h._matchCompositeOperation(x,p)}p.addHandler("bounds-change",E),p.addHandler("clip-change",E),p.addHandler("opacity-change",R),p.addHandler("composite-operation-change",M)}});return e.Viewer.prototype.addTiledImage.apply(this,[m])},destroy:function(){return e.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(c){for(var h=this.world.getItemCount(),p,m=0;m1||r.y>1));s++);return s-1},getTileAtPoint:function(s,r){var o=r.x>=0&&r.x<=1&&r.y>=0&&r.y<=1/this.aspectRatio;e.console.assert(o,"[TileSource.getTileAtPoint] must be called with a valid point.");var l=this.dimensions.x*this.getLevelScale(s),a=r.x*l,c=r.y*l,h=Math.floor(a/this.getTileWidth(s)),p=Math.floor(c/this.getTileHeight(s));r.x>=1&&(h=this.getNumTiles(s).x-1);var m=1e-15;return r.y>=1/this.aspectRatio-m&&(p=this.getNumTiles(s).y-1),new e.Point(h,p)},getTileBounds:function(s,r,o,l){var a=this.dimensions.times(this.getLevelScale(s)),c=this.getTileWidth(s),h=this.getTileHeight(s),p=r===0?0:c*r-this.tileOverlap,m=o===0?0:h*o-this.tileOverlap,T=c+(r===0?1:2)*this.tileOverlap,x=h+(o===0?1:2)*this.tileOverlap,E=1/a.x;return T=Math.min(T,a.x-p),x=Math.min(x,a.y-m),l?new e.Rect(0,0,T,x):new e.Rect(p*E,m*E,T*E,x*E)},getImageInfo:function(s){var r=this,o,l,a,c,h,p,m;s&&(h=s.split("/"),p=h[h.length-1],m=p.lastIndexOf("."),m>-1&&(h[h.length-1]=p.slice(0,m))),l=function(T){typeof T=="string"&&(T=e.parseXml(T));var x=e.TileSource.determineType(r,T,s);if(!x){r.raiseEvent("open-failed",{message:"Unable to load TileSource",source:s});return}c=x.prototype.configure.apply(r,[T,s]),c.ajaxWithCredentials===void 0&&(c.ajaxWithCredentials=r.ajaxWithCredentials),a=new x(c),r.ready=!0,r.raiseEvent("ready",{tileSource:a})},s.match(/\.js$/)?(o=s.split("/").pop().replace(".js",""),e.jsonp({url:s,async:!1,callbackName:o,callback:l})):e.makeAjaxRequest({url:s,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(T){var x=i(T);l(x)},error:function(T,x){var E;try{E="HTTP "+T.status+" attempting to load TileSource"}catch{var R;typeof x>"u"||!x.toString?R="Unknown error":R=x.toString(),E=R+" attempting to load TileSource"}r.raiseEvent("open-failed",{message:E,source:s})}})},supports:function(s,r){return!1},configure:function(s,r){throw new Error("Method not implemented.")},getTileUrl:function(s,r,o){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(s,r,o){return{}},tileExists:function(s,r,o){var l=this.getNumTiles(s);return s>=this.minLevel&&s<=this.maxLevel&&r>=0&&o>=0&&r=0;x--)for(E=this.displayRects[x],R=E.minLevel;R<=E.maxLevel;R++)this._levelRects[R]||(this._levelRects[R]=[]),this._levelRects[R].push(E);e.TileSource.apply(this,[M])},e.extend(e.DziTileSource.prototype,e.TileSource.prototype,{supports:function(r,o){var l;return r.Image?l=r.Image.xmlns:r.documentElement&&(r.documentElement.localName==="Image"||r.documentElement.tagName==="Image")&&(l=r.documentElement.namespaceURI),l=(l||"").toLowerCase(),l.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||l.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(r,o){var l;return e.isPlainObject(r)?l=s(this,r):l=i(this,r),o&&!l.tilesUrl&&(l.tilesUrl=o.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),o.search(/\.(dzi|xml|js)\?/)!==-1?l.queryParams=o.match(/\?.*/):l.queryParams=""),l},getTileUrl:function(r,o,l){return[this.tilesUrl,r,"/",o,"_",l,".",this.fileFormat,this.queryParams].join("")},tileExists:function(r,o,l){var a=this._levelRects[r],c,h,p,m,T,x,E;if(this.minLevel&&rthis.maxLevel)return!1;if(!a||!a.length)return!0;for(E=a.length-1;E>=0;E--)if(c=a[E],!(rc.maxLevel)&&(h=this.getLevelScale(r),p=c.x*h,m=c.y*h,T=p+c.width*h,x=m+c.height*h,p=Math.floor(p/this._tileWidth),m=Math.floor(m/this._tileWidth),T=Math.ceil(T/this._tileWidth),x=Math.ceil(x/this._tileWidth),p<=o&&o0?l.tileSize=Math.max.apply(null,T):l.tileSize=p}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,l.levels=s(this),e.extend(!0,l,{width:l.levels[l.levels.length-1].width,height:l.levels[l.levels.length-1].height,tileSize:Math.max(l.height,l.width),tileOverlap:0,minLevel:0,maxLevel:l.levels.length-1}),this.levels=l.levels):e.console.error("Nothing in the info.json to construct image pyramids from");if(!l.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)l.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var E=Math.max.apply(null,this.scale_factors);l.maxLevel=Math.round(Math.log(E)*Math.LOG2E)}e.TileSource.apply(this,[l])},e.extend(e.IIIFTileSource.prototype,e.TileSource.prototype,{supports:function(l,a){return l.protocol&&l.protocol==="http://iiif.io/api/image"||l["@context"]&&(l["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||l["@context"]==="http://iiif.io/api/image/1/context.json")||l.profile&&l.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||l.identifier&&l.width&&l.height?!0:!!(l.documentElement&&l.documentElement.tagName==="info"&&l.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(l,a){if(e.isPlainObject(l)){if(!l["@context"])l["@context"]="http://iiif.io/api/image/1.0/context.json",l["@id"]=a.replace("/info.json",""),l.version=1;else{var h=l["@context"];if(Array.isArray(h)){for(var p=0;p0&&l>=this.minLevel&&l<=this.maxLevel&&(a=this.levels[l].width/this.levels[this.maxLevel].width),a}return e.TileSource.prototype.getLevelScale.call(this,l)},getNumTiles:function(l){if(this.emulateLegacyImagePyramid){var a=this.getLevelScale(l);return a?new e.Point(1,1):new e.Point(0,0)}return e.TileSource.prototype.getNumTiles.call(this,l)},getTileAtPoint:function(l,a){return this.emulateLegacyImagePyramid?new e.Point(0,0):e.TileSource.prototype.getTileAtPoint.call(this,l,a)},getTileUrl:function(l,a,c){if(this.emulateLegacyImagePyramid){var h=null;return this.levels.length>0&&l>=this.minLevel&&l<=this.maxLevel&&(h=this.levels[l].url),h}var p="0",m=Math.pow(.5,this.maxLevel-l),T=Math.ceil(this.width*m),x=Math.ceil(this.height*m),E,R,M,f,_,H,L,O,N,G,q,$,re,J;return E=this.getTileWidth(l),R=this.getTileHeight(l),M=Math.ceil(E/m),f=Math.ceil(R/m),this.version===1?re="native."+this.tileFormat:re="default."+this.tileFormat,T1&&l.profile[1].supports&&(p=l.profile[1].supports.indexOf("sizeByW")!==-1),l.version===3&&l.extraFeatures&&(p=l.extraFeatures.indexOf("sizeByWh")!==-1),!h||p}function s(l){for(var a=[],c=0;ch?p=c/256:p=h/256,a.maxLevel=Math.ceil(Math.log(p)/Math.log(2))-1,a.tileSize=256,a.width=c,a.height=h,e.TileSource.apply(this,[a])},e.extend(e.TmsTileSource.prototype,e.TileSource.prototype,{supports:function(i,s){return i.type&&i.type==="tiledmapservice"},configure:function(i,s){return i},getTileUrl:function(i,s,r){var o=this.getNumTiles(i).y-1;return this.tilesUrl+i+"/"+s+"/"+(o-r)+".png"}})}(n),function(e){e.ZoomifyTileSource=function(i){typeof i.tileSize>"u"&&(i.tileSize=256),typeof i.fileFormat>"u"&&(i.fileFormat="jpg",this.fileFormat=i.fileFormat);var s={x:i.width,y:i.height};for(i.imageSizes=[{x:i.width,y:i.height}],i.gridSize=[this._getGridSize(i.width,i.height,i.tileSize)];parseInt(s.x,10)>i.tileSize||parseInt(s.y,10)>i.tileSize;)s.x=Math.floor(s.x/2),s.y=Math.floor(s.y/2),i.imageSizes.push({x:s.x,y:s.y}),i.gridSize.push(this._getGridSize(s.x,s.y,i.tileSize));i.imageSizes.reverse(),i.gridSize.reverse(),i.minLevel=0,i.maxLevel=i.gridSize.length-1,n.TileSource.apply(this,[i])},e.extend(e.ZoomifyTileSource.prototype,e.TileSource.prototype,{_getGridSize:function(i,s,r){return{x:Math.ceil(i/r),y:Math.ceil(s/r)}},_calculateAbsoluteTileNumber:function(i,s,r){for(var o=0,l={},a=0;a0?(a=l.levels[l.levels.length-1].width,c=l.levels[l.levels.length-1].height):(a=0,c=0,e.console.error("No supported image formats found")),e.extend(!0,l,{width:a,height:c,tileSize:Math.max(c,a),tileOverlap:0,minLevel:0,maxLevel:l.levels.length>0?l.levels.length-1:0}),e.TileSource.apply(this,[l]),this.levels=l.levels},e.extend(e.LegacyTileSource.prototype,e.TileSource.prototype,{supports:function(o,l){return o.type&&o.type==="legacy-image-pyramid"||o.documentElement&&o.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(o,l){var a;return e.isPlainObject(o)?a=r(this,o):a=s(this,o),a},getLevelScale:function(o){var l=NaN;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(l=this.levels[o].width/this.levels[this.maxLevel].width),l},getNumTiles:function(o){var l=this.getLevelScale(o);return l?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(o,l,a){var c=null;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(c=this.levels[o].url),c}});function i(o){var l=[],a,c;for(c=0;c");return l.sort(function(h,p){return h.height-p.height})}function s(o,l){if(!l||!l.documentElement)throw new Error(e.getString("Errors.Xml"));var a=l.documentElement,c=a.tagName,h=null,p=[],m,T;if(c==="image")try{for(h={type:a.getAttribute("type"),levels:[]},p=a.getElementsByTagName("level"),T=0;T=this.minLevel&&i<=this.maxLevel&&(s=this.levels[i].width/this.levels[this.maxLevel].width),s},getNumTiles:function(i){var s=this.getLevelScale(i);return s?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(i,s,r){var o=null;return i>=this.minLevel&&i<=this.maxLevel&&(o=this.levels[i].url),o},getContext2D:function(i,s,r){var o=null;return i>=this.minLevel&&i<=this.maxLevel&&(o=this.levels[i].context2D),o},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var i=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!e.supportsCanvas||!this.useCanvas)return delete this._image,i;var s=this._image.naturalWidth,r=this._image.naturalHeight,o=document.createElement("canvas"),l=o.getContext("2d");if(o.width=s,o.height=r,l.drawImage(this._image,0,0,s,r),i[0].context2D=l,delete this._image,e.isCanvasTainted(o))return i;for(;s>=2&&r>=2;){s=Math.floor(s/2),r=Math.floor(r/2);var a=document.createElement("canvas"),c=a.getContext("2d");a.width=s,a.height=r,c.drawImage(o,0,0,s,r),i.splice(0,0,{context2D:c,width:s,height:r}),o=a,l=c}return i},_freeupCanvasMemory:function(){for(var i=0;i0&&i(c))}function r(c){c.shouldFade=!0,c.fadeBeginTime=e.now()+c.fadeDelay,window.setTimeout(function(){i(c)},c.fadeDelay)}function o(c){c.shouldFade=!1,c.imgGroup&&e.setElementOpacity(c.imgGroup,1,!0)}function l(c,h){c.element.disabled||(h>=e.ButtonState.GROUP&&c.currentState===e.ButtonState.REST&&(o(c),c.currentState=e.ButtonState.GROUP),h>=e.ButtonState.HOVER&&c.currentState===e.ButtonState.GROUP&&(c.imgHover&&(c.imgHover.style.visibility=""),c.currentState=e.ButtonState.HOVER),h>=e.ButtonState.DOWN&&c.currentState===e.ButtonState.HOVER&&(c.imgDown&&(c.imgDown.style.visibility=""),c.currentState=e.ButtonState.DOWN))}function a(c,h){c.element.disabled||(h<=e.ButtonState.HOVER&&c.currentState===e.ButtonState.DOWN&&(c.imgDown&&(c.imgDown.style.visibility="hidden"),c.currentState=e.ButtonState.HOVER),h<=e.ButtonState.GROUP&&c.currentState===e.ButtonState.HOVER&&(c.imgHover&&(c.imgHover.style.visibility="hidden"),c.currentState=e.ButtonState.GROUP),h<=e.ButtonState.REST&&c.currentState===e.ButtonState.GROUP&&(r(c),c.currentState=e.ButtonState.REST))}}(n),function(e){e.ButtonGroup=function(i){e.extend(!0,this,{buttons:[],clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},i);var s=this.buttons.concat([]),r=this,o;if(this.element=i.element||e.makeNeutralElement("div"),!i.group)for(this.element.style.display="inline-block",o=0;o=270?(a=this.getTopRight(),this.x=a.x,this.y=a.y,c=this.height,this.height=this.width,this.width=c,this.degrees-=270):this.degrees>=180?(a=this.getBottomRight(),this.x=a.x,this.y=a.y,this.degrees-=180):this.degrees>=90&&(a=this.getBottomLeft(),this.x=a.x,this.y=a.y,c=this.height,this.height=this.width,this.width=c,this.degrees-=90)},e.Rect.fromSummits=function(i,s,r){var o=i.distanceTo(s),l=i.distanceTo(r),a=s.minus(i),c=Math.atan(a.y/a.x);return a.x<0?c+=Math.PI:a.y<0&&(c+=2*Math.PI),new e.Rect(i.x,i.y,o,l,c/Math.PI*180)},e.Rect.prototype={clone:function(){return new e.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new e.Point(this.x,this.y)},getBottomRight:function(){return new e.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new e.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new e.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new e.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new e.Point(this.width,this.height)},equals:function(i){return i instanceof e.Rect&&this.x===i.x&&this.y===i.y&&this.width===i.width&&this.height===i.height&&this.degrees===i.degrees},times:function(i){return new e.Rect(this.x*i,this.y*i,this.width*i,this.height*i,this.degrees)},translate:function(i){return new e.Rect(this.x+i.x,this.y+i.y,this.width,this.height,this.degrees)},union:function(i){var s=this.getBoundingBox(),r=i.getBoundingBox(),o=Math.min(s.x,r.x),l=Math.min(s.y,r.y),a=Math.max(s.x+s.width,r.x+r.width),c=Math.max(s.y+s.height,r.y+r.height);return new e.Rect(o,l,a-o,c-l)},intersection:function(i){var s=1e-10,r=[],o=this.getTopLeft();i.containsPoint(o,s)&&r.push(o);var l=this.getTopRight();i.containsPoint(l,s)&&r.push(l);var a=this.getBottomLeft();i.containsPoint(a,s)&&r.push(a);var c=this.getBottomRight();i.containsPoint(c,s)&&r.push(c);var h=i.getTopLeft();this.containsPoint(h,s)&&r.push(h);var p=i.getTopRight();this.containsPoint(p,s)&&r.push(p);var m=i.getBottomLeft();this.containsPoint(m,s)&&r.push(m);var T=i.getBottomRight();this.containsPoint(T,s)&&r.push(T);for(var x=this._getSegments(),E=i._getSegments(),R=0;RN&&(N=re.x),re.yq&&(q=re.y)}return new e.Rect(O,G,N-O,q-G)},_getSegments:function(){var i=this.getTopLeft(),s=this.getTopRight(),r=this.getBottomLeft(),o=this.getBottomRight();return[[i,s],[s,o],[o,r],[r,i]]},rotate:function(i,s){if(i=e.positiveModulo(i,360),i===0)return this.clone();s=s||this.getCenter();var r=this.getTopLeft().rotate(i,s),o=this.getTopRight().rotate(i,s),l=o.minus(r);l=l.apply(function(c){var h=1e-15;return Math.abs(c)=-s&&(i.x-o.x)*a.x+(i.y-o.y)*a.y<=s&&(i.x-r.x)*c.x+(i.y-r.y)*c.y>=-s&&(i.x-l.x)*c.x+(i.y-l.y)*c.y<=s},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(n),function(e){var i={};e.ReferenceStrip=function(m){var T=this,x=m.viewer,E=e.getElementSize(x.element),R,M,f;for(m.id||(m.id="referencestrip-"+e.now(),this.element=e.makeNeutralElement("div"),this.element.id=m.id,this.element.className="referencestrip"),m=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.referenceStripSizeRatio,position:e.DEFAULT_SETTINGS.referenceStripPosition,scroll:e.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold},m,{element:this.element}),e.extend(this,m),i[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,M=this.element.style,M.marginTop="0px",M.marginRight="0px",M.marginBottom="0px",M.marginLeft="0px",M.left="0px",M.bottom="0px",M.border="0px",M.background="#000",M.position="relative",e.setElementTouchActionNone(this.element),e.setElementOpacity(this.element,.8),this.viewer=x,this.tracker=new e.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:e.delegate(this,s),dragHandler:e.delegate(this,r),scrollHandler:e.delegate(this,o),enterHandler:e.delegate(this,a),leaveHandler:e.delegate(this,c),keyDownHandler:e.delegate(this,h),keyHandler:e.delegate(this,p),preProcessEventHandler:function(_){_.eventType==="wheel"&&(_.preventDefault=!0)}}),m.width&&m.height?(this.element.style.width=m.width+"px",this.element.style.height=m.height+"px",x.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):m.scroll==="horizontal"?(this.element.style.width=E.x*m.sizeRatio*x.tileSources.length+12*x.tileSources.length+"px",this.element.style.height=E.y*m.sizeRatio+"px",x.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=E.y*m.sizeRatio*x.tileSources.length+12*x.tileSources.length+"px",this.element.style.width=E.x*m.sizeRatio+"px",x.addControl(this.element,{anchor:e.ControlAnchor.TOP_LEFT})),this.panelWidth=E.x*this.sizeRatio+8,this.panelHeight=E.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},f=0;fM+x.x-this.panelWidth?(_=Math.min(_,E-x.x),this.element.style.marginLeft=-_+"px",l(this,x.x,-_)):_f+x.y-this.panelHeight?(_=Math.min(_,R-x.y),this.element.style.marginTop=-_+"px",l(this,x.y,-_)):_0?T>-(E-M.x)&&(this.element.style.marginLeft=T+m.delta.x*2+"px",l(this,M.x,T+m.delta.x*2)):-m.delta.x<0&&T<0&&(this.element.style.marginLeft=T+m.delta.x*2+"px",l(this,M.x,T+m.delta.x*2)):-m.delta.y>0?x>-(R-M.y)&&(this.element.style.marginTop=x+m.delta.y*2+"px",l(this,M.y,x+m.delta.y*2)):-m.delta.y<0&&x<0&&(this.element.style.marginTop=x+m.delta.y*2+"px",l(this,M.y,x+m.delta.y*2))}}function o(m){if(this.element){var T=Number(this.element.style.marginLeft.replace("px","")),x=Number(this.element.style.marginTop.replace("px","")),E=Number(this.element.style.width.replace("px","")),R=Number(this.element.style.height.replace("px","")),M=e.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?m.scroll>0?T>-(E-M.x)&&(this.element.style.marginLeft=T-m.scroll*60+"px",l(this,M.x,T-m.scroll*60)):m.scroll<0&&T<0&&(this.element.style.marginLeft=T-m.scroll*60+"px",l(this,M.x,T-m.scroll*60)):m.scroll<0?x>M.y-R&&(this.element.style.marginTop=x+m.scroll*60+"px",l(this,M.y,x+m.scroll*60)):m.scroll>0&&x<0&&(this.element.style.marginTop=x+m.scroll*60+"px",l(this,M.y,x+m.scroll*60)),m.preventDefault=!0}}function l(m,T,x){var E,R,M,f,_,H;for(m.scroll==="horizontal"?E=m.panelWidth:E=m.panelHeight,R=Math.ceil(T/E)+5,M=Math.ceil((Math.abs(x)+T)/E)+1,R=M-R,R=R<0?0:R,_=R;_1?r[1].springStiffness:5,animationTime:r.length>1?r[1].animationTime:1.5}),e.console.assert(typeof s.springStiffness=="number"&&s.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),e.console.assert(typeof s.animationTime=="number"&&s.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),s.exponential&&(this._exponential=!0,delete s.exponential),e.extend(!0,this,s),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:e.now()},e.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},e.Spring.prototype={resetTo:function(s){e.console.assert(!this._exponential||s!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=s,this.start.time=this.target.time=this.current.time=e.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(s){e.console.assert(!this._exponential||s!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=s,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(s){this.start.value+=s,this.target.value+=s,this._exponential&&(e.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(s){this._exponential=s,this._exponential&&(e.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=e.now();var s,r;this._exponential?(s=this.start._logValue,r=this.target._logValue):(s=this.start.value,r=this.target.value);var o=this.current.time>=this.target.time?r:s+(r-s)*i(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),l=this.current.value;return this._exponential?this.current.value=Math.exp(o):this.current.value=o,l!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function i(s,r){return(1-Math.exp(s*-r))/(1-Math.exp(-s))}}(n),function(e){function i(r){e.extend(!0,this,{timeout:e.DEFAULT_SETTINGS.timeout,jobId:null},r),this.image=null}i.prototype={errorMsg:null,start:function(){var r=this,o=this.abort;this.image=new Image,this.image.onload=function(){r.finish(!0)},this.image.onabort=this.image.onerror=function(){r.errorMsg="Image load aborted",r.finish(!1)},this.jobId=window.setTimeout(function(){r.errorMsg="Image load exceeded timeout ("+r.timeout+" ms)",r.finish(!1)},this.timeout),this.loadWithAjax?(this.request=e.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(l){var a;try{a=new window.Blob([l.response])}catch(m){var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(m.name==="TypeError"&&c){var h=new c;h.append(l.response),a=h.getBlob()}}a.size===0&&(r.errorMsg="Empty image response.",r.finish(!1));var p=(window.URL||window.webkitURL).createObjectURL(a);r.image.src=p},error:function(l){r.errorMsg="Image load aborted - XHR error",r.finish(!1)}}),this.abort=function(){r.request.abort(),typeof o=="function"&&o()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(r){this.image.onload=this.image.onerror=this.image.onabort=null,r||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},e.ImageLoader=function(r){e.extend(!0,this,{jobLimit:e.DEFAULT_SETTINGS.imageLoaderLimit,timeout:e.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},r)},e.ImageLoader.prototype={addJob:function(r){var o=this,l=function(h){s(o,h,r.callback)},a={src:r.src,loadWithAjax:r.loadWithAjax,ajaxHeaders:r.loadWithAjax?r.ajaxHeaders:null,crossOriginPolicy:r.crossOriginPolicy,ajaxWithCredentials:r.ajaxWithCredentials,callback:l,abort:r.abort,timeout:this.timeout},c=new i(a);!this.jobLimit||this.jobsInProgress0&&(a=r.jobQueue.shift(),a.start(),r.jobsInProgress++),l(o.image,o.errorMsg,o.request)}}(n),function(e){e.Tile=function(i,s,r,o,l,a,c,h,p,m){this.level=i,this.x=s,this.y=r,this.bounds=o,this.sourceBounds=m,this.exists=l,this.url=a,this.context2D=c,this.loadWithAjax=h,this.ajaxHeaders=p,this.ajaxHeaders?this.cacheKey=this.url+"+"+JSON.stringify(this.ajaxHeaders):this.cacheKey=this.url,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},e.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(i){if(!this.cacheImageRecord){e.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=e.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==i&&i.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),e.setElementOpacity(this.element,this.opacity)},drawCanvas:function(i,s,r,o){var l=this.position.times(e.pixelDensityRatio),a=this.size.times(e.pixelDensityRatio),c;if(!this.context2D&&!this.cacheImageRecord){e.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(c=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!c){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}i.save(),i.globalAlpha=this.opacity,typeof r=="number"&&r!==1&&(l=l.times(r),a=a.times(r)),o instanceof e.Point&&(l=l.plus(o)),i.globalAlpha===1&&this._hasTransparencyChannel()&&i.clearRect(l.x,l.y,a.x,a.y),s({context:i,tile:this,rendered:c});var h,p;this.sourceBounds?(h=Math.min(this.sourceBounds.width,c.canvas.width),p=Math.min(this.sourceBounds.height,c.canvas.height)):(h=c.canvas.width,p=c.canvas.height),i.translate(l.x+a.x/2,0),this.flipped&&i.scale(-1,1),i.drawImage(c.canvas,0,0,h,p,-a.x/2,l.y,a.x,a.y),i.restore()},getScaleForEdgeSmoothing:function(){var i;if(this.cacheImageRecord)i=this.cacheImageRecord.getRenderedContext();else if(this.context2D)i=this.context2D;else return e.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return i.canvas.width/(this.size.x*e.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(i,s,r){var o=Math.max(1,Math.ceil((r.x-s.x)/2)),l=Math.max(1,Math.ceil((r.y-s.y)/2));return new e.Point(o,l).minus(this.position.times(e.pixelDensityRatio).times(i||1).apply(function(a){return a%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(n),function(e){e.OverlayPlacement=e.Placement,e.OverlayRotationMode=e.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),e.Overlay=function(i,s,r){var o;e.isPlainObject(i)?o=i:o={element:i,location:s,placement:r},this.element=o.element,this.style=o.element.style,this._init(o)},e.Overlay.prototype={_init:function(i){this.location=i.location,this.placement=i.placement===void 0?e.Placement.TOP_LEFT:i.placement,this.onDraw=i.onDraw,this.checkResize=i.checkResize===void 0?!0:i.checkResize,this.width=i.width===void 0?null:i.width,this.height=i.height===void 0?null:i.height,this.rotationMode=i.rotationMode||e.OverlayRotationMode.EXACT,this.location instanceof e.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=e.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new e.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(i,s){var r=e.Placement.properties[this.placement];r&&(r.isHorizontallyCentered?i.x-=s.x/2:r.isRight&&(i.x-=s.x),r.isVerticallyCentered?i.y-=s.y/2:r.isBottom&&(i.y-=s.y))},destroy:function(){var i=this.element,s=this.style;i.parentNode&&(i.parentNode.removeChild(i),i.prevElementParent&&(s.display="none",document.body.appendChild(i))),this.onDraw=null,s.top="",s.left="",s.position="",this.width!==null&&(s.width=""),this.height!==null&&(s.height="");var r=e.getCssPropertyWithVendorPrefix("transformOrigin"),o=e.getCssPropertyWithVendorPrefix("transform");r&&o&&(s[r]="",s[o]="")},drawHTML:function(i,s){var r=this.element;r.parentNode!==i&&(r.prevElementParent=r.parentNode,r.prevNextSibling=r.nextSibling,i.appendChild(r),this.style.position="absolute",this.size=e.getElementSize(r));var o=this._getOverlayPositionAndSize(s),l=o.position,a=this.size=o.size,c=o.rotate;if(this.onDraw)this.onDraw(l,a,this.element);else{var h=this.style;h.left=l.x+"px",h.top=l.y+"px",this.width!==null&&(h.width=a.x+"px"),this.height!==null&&(h.height=a.y+"px");var p=e.getCssPropertyWithVendorPrefix("transformOrigin"),m=e.getCssPropertyWithVendorPrefix("transform");p&&m&&(c?(h[p]=this._getTransformOrigin(),h[m]="rotate("+c+"deg)"):(h[p]="",h[m]="")),h.display="block"}},_getOverlayPositionAndSize:function(i){var s=i.pixelFromPoint(this.location,!0),r=this._getSizeInPixels(i);this.adjust(s,r);var o=0;if(i.degrees&&this.rotationMode!==e.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var l=new e.Rect(s.x,s.y,r.x,r.y),a=this._getBoundingBox(l,i.degrees);s=a.getTopLeft(),r=a.getSize()}else o=i.degrees;return{position:s,size:r,rotate:o}},_getSizeInPixels:function(i){var s=this.size.x,r=this.size.y;if(this.width!==null||this.height!==null){var o=i.deltaPixelsFromPointsNoRotate(new e.Point(this.width||0,this.height||0),!0);this.width!==null&&(s=o.x),this.height!==null&&(r=o.y)}if(this.checkResize&&(this.width===null||this.height===null)){var l=this.size=e.getElementSize(this.element);this.width===null&&(s=l.x),this.height===null&&(r=l.y)}return new e.Point(s,r)},_getBoundingBox:function(i,s){var r=this._getPlacementPoint(i);return i.rotate(s,r).getBoundingBox()},_getPlacementPoint:function(i){var s=new e.Point(i.x,i.y),r=e.Placement.properties[this.placement];return r&&(r.isHorizontallyCentered?s.x+=i.width/2:r.isRight&&(s.x+=i.width),r.isVerticallyCentered?s.y+=i.height/2:r.isBottom&&(s.y+=i.height)),s},_getTransformOrigin:function(){var i="",s=e.Placement.properties[this.placement];return s&&(s.isLeft?i="left":s.isRight&&(i="right"),s.isTop?i+=" top":s.isBottom&&(i+=" bottom")),i},update:function(i,s){var r=e.isPlainObject(i)?i:{location:i,placement:s};this._init({location:r.location||this.location,placement:r.placement!==void 0?r.placement:this.placement,onDraw:r.onDraw||this.onDraw,checkResize:r.checkResize||this.checkResize,width:r.width!==void 0?r.width:this.width,height:r.height!==void 0?r.height:this.height,rotationMode:r.rotationMode||this.rotationMode})},getBounds:function(i){e.console.assert(i,"A viewport must now be passed to Overlay.getBounds.");var s=this.width,r=this.height;if(s===null||r===null){var o=i.deltaPointsFromPixelsNoRotate(this.size,!0);s===null&&(s=o.x),r===null&&(r=o.y)}var l=this.location.clone();return this.adjust(l,new e.Point(s,r)),this._adjustBoundsForRotation(i,new e.Rect(l.x,l.y,s,r))},_adjustBoundsForRotation:function(i,s){if(!i||i.degrees===0||this.rotationMode===e.OverlayRotationMode.EXACT)return s;if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return s;var r=this._getOverlayPositionAndSize(i);return i.viewerElementToViewportRectangle(new e.Rect(r.position.x,r.position.y,r.size.x,r.size.y))}return s.rotate(-i.degrees,this._getPlacementPoint(s))}}}(n),function(e){e.Drawer=function(i){e.console.assert(i.viewer,"[Drawer] options.viewer is required");var s=arguments;if(e.isPlainObject(i)||(i={source:s[0],viewport:s[1],element:s[2]}),e.console.assert(i.viewport,"[Drawer] options.viewport is required"),e.console.assert(i.element,"[Drawer] options.element is required"),i.source&&e.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=i.viewer,this.viewport=i.viewport,this.debugGridColor=typeof i.debugGridColor=="string"?[i.debugGridColor]:i.debugGridColor||e.DEFAULT_SETTINGS.debugGridColor,i.opacity&&e.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=e.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=e.getElement(i.element),this.canvas=e.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var r=this._calculateCanvasSize();this.canvas.width=r.x,this.canvas.height=r.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",e.setElementOpacity(this.canvas,this.opacity,!0),e.setElementPointerEventsNone(this.canvas),e.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},e.Drawer.prototype={addOverlay:function(i,s,r,o){return e.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(i,s,r,o),this},updateOverlay:function(i,s,r){return e.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(i,s,r),this},removeOverlay:function(i){return e.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(i),this},clearOverlays:function(){return e.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(i){var s=this.viewport.pixelFromPointNoRotate(i,!0);return new e.Point(s.x*e.pixelDensityRatio,s.y*e.pixelDensityRatio)},clipWithPolygons:function(i,s){if(this.useCanvas){var r=this._getContext(s);r.beginPath(),i.forEach(function(o){o.forEach(function(l,a){r[a===0?"moveTo":"lineTo"](l.x,l.y)})}),r.clip()}},setOpacity:function(i){e.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var s=this.viewer.world,r=0;rs&&(s=o)}return s},needsUpdate:function(){return e.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return e.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return e.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return e.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var i=this._calculateCanvasSize();if((this.canvas.width!==i.x||this.canvas.height!==i.y)&&(this.canvas.width=i.x,this.canvas.height=i.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var s=this._calculateSketchCanvasSize();this.sketchCanvas.width=s.x,this.sketchCanvas.height=s.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(i,s){if(this.useCanvas){var r=this._getContext(i);if(s)r.clearRect(s.x,s.y,s.width,s.height);else{var o=r.canvas;r.clearRect(0,0,o.width,o.height)}}},viewportToDrawerRectangle:function(i){var s=this.viewport.pixelFromPointNoRotate(i.getTopLeft(),!0),r=this.viewport.deltaPixelsFromPointsNoRotate(i.getSize(),!0);return new e.Rect(s.x*e.pixelDensityRatio,s.y*e.pixelDensityRatio,r.x*e.pixelDensityRatio,r.y*e.pixelDensityRatio)},drawTile:function(i,s,r,o,l){if(e.console.assert(i,"[Drawer.drawTile] tile is required"),e.console.assert(s,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var a=this._getContext(r);o=o||1,i.drawCanvas(a,s,o,l)}else i.drawHTML(this.canvas)},_getContext:function(i){var s=this.context;if(i){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var r=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=r.x,this.sketchCanvas.height=r.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var o=this;this.viewer.addHandler("rotate",function l(){if(o.viewport.getRotation()!==0){o.viewer.removeHandler("rotate",l);var a=o._calculateSketchCanvasSize();o.sketchCanvas.width=a.x,o.sketchCanvas.height=a.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}s=this.sketchContext}return s},saveContext:function(i){this.useCanvas&&this._getContext(i).save()},restoreContext:function(i){this.useCanvas&&this._getContext(i).restore()},setClip:function(i,s){if(this.useCanvas){var r=this._getContext(s);r.beginPath(),r.rect(i.x,i.y,i.width,i.height),r.clip()}},drawRectangle:function(i,s,r){if(this.useCanvas){var o=this._getContext(r);o.save(),o.fillStyle=s,o.fillRect(i.x,i.y,i.width,i.height),o.restore()}},blendSketch:function(i,s,r,o){var l=i;if(e.isPlainObject(l)||(l={opacity:i,scale:s,translate:r,compositeOperation:o}),!(!this.useCanvas||!this.sketchCanvas)){i=l.opacity,o=l.compositeOperation;var a=l.bounds;if(this.context.save(),this.context.globalAlpha=i,o&&(this.context.globalCompositeOperation=o),a)a.x<0&&(a.width+=a.x,a.x=0),a.x+a.width>this.canvas.width&&(a.width=this.canvas.width-a.x),a.y<0&&(a.height+=a.y,a.y=0),a.y+a.height>this.canvas.height&&(a.height=this.canvas.height-a.y),this.context.drawImage(this.sketchCanvas,a.x,a.y,a.width,a.height,a.x,a.y,a.width,a.height);else{s=l.scale||1,r=l.translate;var c=r instanceof e.Point?r:new e.Point(0,0),h=0,p=0;if(r){var m=this.sketchCanvas.width-this.canvas.width,T=this.sketchCanvas.height-this.canvas.height;h=Math.round(m/2),p=Math.round(T/2)}this.context.drawImage(this.sketchCanvas,c.x-h*s,c.y-p*s,(this.canvas.width+2*h)*s,(this.canvas.height+2*p)*s,-h,-p,this.canvas.width+2*h,this.canvas.height+2*p)}this.context.restore()}},drawDebugInfo:function(i,s,r,o){if(this.useCanvas){var l=this.viewer.world.getIndexOfItem(o)%this.debugGridColor.length,a=this.context;a.save(),a.lineWidth=2*e.pixelDensityRatio,a.font="small-caps bold "+13*e.pixelDensityRatio+"px arial",a.strokeStyle=this.debugGridColor[l],a.fillStyle=this.debugGridColor[l],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),o.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:o.getRotation(!0),point:o.viewport.pixelFromPointNoRotate(o._getRotationPoint(!0),!0)}),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),a.strokeRect(i.position.x*e.pixelDensityRatio,i.position.y*e.pixelDensityRatio,i.size.x*e.pixelDensityRatio,i.size.y*e.pixelDensityRatio);var c=(i.position.x+i.size.x/2)*e.pixelDensityRatio,h=(i.position.y+i.size.y/2)*e.pixelDensityRatio;a.translate(c,h),a.rotate(Math.PI/180*-this.viewport.degrees),a.translate(-c,-h),i.x===0&&i.y===0&&(a.fillText("Zoom: "+this.viewport.getZoom(),i.position.x*e.pixelDensityRatio,(i.position.y-30)*e.pixelDensityRatio),a.fillText("Pan: "+this.viewport.getBounds().toString(),i.position.x*e.pixelDensityRatio,(i.position.y-20)*e.pixelDensityRatio)),a.fillText("Level: "+i.level,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+20)*e.pixelDensityRatio),a.fillText("Column: "+i.x,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+30)*e.pixelDensityRatio),a.fillText("Row: "+i.y,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+40)*e.pixelDensityRatio),a.fillText("Order: "+r+" of "+s,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+50)*e.pixelDensityRatio),a.fillText("Size: "+i.size.toString(),(i.position.x+10)*e.pixelDensityRatio,(i.position.y+60)*e.pixelDensityRatio),a.fillText("Position: "+i.position.toString(),(i.position.x+10)*e.pixelDensityRatio,(i.position.y+70)*e.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),o.getRotation(!0)%360!==0&&this._restoreRotationChanges(),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),a.restore()}},debugRect:function(i){if(this.useCanvas){var s=this.context;s.save(),s.lineWidth=2*e.pixelDensityRatio,s.strokeStyle=this.debugGridColor[0],s.fillStyle=this.debugGridColor[0],s.strokeRect(i.x*e.pixelDensityRatio,i.y*e.pixelDensityRatio,i.width*e.pixelDensityRatio,i.height*e.pixelDensityRatio),s.restore()}},setImageSmoothingEnabled:function(i){this.useCanvas&&(this._imageSmoothingEnabled=i,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(i){i.msImageSmoothingEnabled=this._imageSmoothingEnabled,i.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(i){var s=this._getContext(i).canvas;return new e.Point(s.width,s.height)},getCanvasCenter:function(){return new e.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(i){var s=i.point?i.point.times(e.pixelDensityRatio):this.getCanvasCenter(),r=this._getContext(i.useSketch);r.save(),r.translate(s.x,s.y),this.viewer.viewport.flipped?(r.rotate(Math.PI/180*-i.degrees),r.scale(-1,1)):r.rotate(Math.PI/180*i.degrees),r.translate(-s.x,-s.y)},_flip:function(i){i=i||{};var s=i.point?i.point.times(e.pixelDensityRatio):this.getCanvasCenter(),r=this._getContext(i.useSketch);r.translate(s.x,0),r.scale(-1,1),r.translate(-s.x,0)},_restoreRotationChanges:function(i){var s=this._getContext(i);s.restore()},_calculateCanvasSize:function(){var i=e.pixelDensityRatio,s=this.viewport.getContainerSize();return{x:Math.round(s.x*i),y:Math.round(s.y*i)}},_calculateSketchCanvasSize:function(){var i=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return i;var s=Math.ceil(Math.sqrt(i.x*i.x+i.y*i.y));return{x:s,y:s}}}}(n),function(e){e.Viewport=function(i){var s=arguments;s.length&&s[0]instanceof e.Point&&(i={containerSize:s[0],contentSize:s[1],config:s[2]}),i.config&&(e.extend(!0,i,i.config),delete i.config),this._margins=e.extend({left:0,top:0,right:0,bottom:0},i.margins||{}),delete i.margins,e.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:e.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:e.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:e.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:e.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:e.DEFAULT_SETTINGS.maxZoomLevel,degrees:e.DEFAULT_SETTINGS.degrees,flipped:e.DEFAULT_SETTINGS.flipped,homeFillsViewer:e.DEFAULT_SETTINGS.homeFillsViewer},i),this._updateContainerInnerSize(),this.centerSpringX=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new e.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new e.Rect(0,0,1,1),1),this.goHome(!0),this.update()},e.Viewport.prototype={resetContentSize:function(i){return e.console.assert(i,"[Viewport.resetContentSize] contentSize is required"),e.console.assert(i instanceof e.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),e.console.assert(i.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),e.console.assert(i.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new e.Rect(0,0,1,i.y/i.x),i.x),this},setHomeBounds:function(i,s){e.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(i,s)},_setContentBounds:function(i,s){e.console.assert(i,"[Viewport._setContentBounds] bounds is required"),e.console.assert(i instanceof e.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),e.console.assert(i.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),e.console.assert(i.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=i.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(s),this._contentBounds=i.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(s),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:s,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var i=this._contentAspectRatio/this.getAspectRatio(),s;return this.homeFillsViewer?s=i>=1?i:1:s=i>=1?1:i,s/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var i=this._contentBounds.getCenter(),s=1/this.getHomeZoom(),r=s/this.getAspectRatio();return new e.Rect(i.x-s/2,i.y-r/2,s,r)},goHome:function(i){return this.viewer&&this.viewer.raiseEvent("home",{immediately:i}),this.fitBounds(this.getHomeBounds(),i)},getMinZoom:function(){var i=this.getHomeZoom(),s=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*i;return s},getMaxZoom:function(){var i=this.maxZoomLevel;return i||(i=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,i/=this._contentBounds.width),Math.max(i,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new e.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return e.extend({},this._margins)},setMargins:function(i){e.console.assert(e.type(i)==="object","[Viewport.setMargins] margins must be an object"),this._margins=e.extend({left:0,top:0,right:0,bottom:0},i),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(i){return this.getBoundsNoRotate(i).rotate(-this.getRotation())},getBoundsNoRotate:function(i){var s=this.getCenter(i),r=1/this.getZoom(i),o=r/this.getAspectRatio();return new e.Rect(s.x-r/2,s.y-o/2,r,o)},getBoundsWithMargins:function(i){return this.getBoundsNoRotateWithMargins(i).rotate(-this.getRotation(),this.getCenter(i))},getBoundsNoRotateWithMargins:function(i){var s=this.getBoundsNoRotate(i),r=this._containerInnerSize.x*this.getZoom(i);return s.x-=this._margins.left/r,s.y-=this._margins.top/r,s.width+=(this._margins.left+this._margins.right)/r,s.height+=(this._margins.top+this._margins.bottom)/r,s},getCenter:function(i){var s=new e.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),r=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),o,l,a,c,h,p,m,T;return i?s:this.zoomPoint?(o=this.pixelFromPoint(this.zoomPoint,!0),l=this.getZoom(),a=1/l,c=a/this.getAspectRatio(),h=new e.Rect(s.x-a/2,s.y-c/2,a,c),p=this._pixelFromPoint(this.zoomPoint,h),m=p.minus(o),T=m.divide(this._containerInnerSize.x*l),r.plus(T)):r},getZoom:function(i){return i?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(i){return Math.max(Math.min(i,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(i){var s=new e.Rect(i.x,i.y,i.width,i.height);if(!this.wrapHorizontal){var r=this.visibilityRatio*s.width,o=s.x+s.width,l=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,a=this._contentBoundsNoRotate.x-o+r,c=l-s.x-r;r>this._contentBoundsNoRotate.width?s.x+=(a+c)/2:c<0?s.x+=c:a>0&&(s.x+=a)}if(!this.wrapVertical){var h=this.visibilityRatio*s.height,p=s.y+s.height,m=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,T=this._contentBoundsNoRotate.y-p+h,x=m-s.y-h;h>this._contentBoundsNoRotate.height?s.y+=(T+x)/2:x<0?s.y+=x:T>0&&(s.y+=T)}return s},_raiseConstraintsEvent:function(i){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:i})},applyConstraints:function(i){var s=this.getZoom(),r=this._applyZoomConstraints(s);s!==r&&this.zoomTo(r,this.zoomPoint,i);var o=this.getBoundsNoRotate(),l=this._applyBoundaryConstraints(o);return this._raiseConstraintsEvent(i),(o.x!==l.x||o.y!==l.y||i)&&this.fitBounds(l.rotate(-this.getRotation()),i),this},ensureVisible:function(i){return this.applyConstraints(i)},_fitBounds:function(i,s){s=s||{};var r=s.immediately||!1,o=s.constraints||!1,l=this.getAspectRatio(),a=i.getCenter(),c=new e.Rect(i.x,i.y,i.width,i.height,i.degrees+this.getRotation()).getBoundingBox();c.getAspectRatio()>=l?c.height=c.width/l:c.width=c.height*l,c.x=a.x-c.width/2,c.y=a.y-c.height/2;var h=1/c.width;if(o){var p=c.getAspectRatio(),m=this._applyZoomConstraints(h);h!==m&&(h=m,c.width=1/h,c.x=a.x-c.width/2,c.height=c.width/p,c.y=a.y-c.height/2),c=this._applyBoundaryConstraints(c),a=c.getCenter(),this._raiseConstraintsEvent(r)}if(r)return this.panTo(a,!0),this.zoomTo(h,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var T=this.getBounds(),x=this.getZoom();if(x===0||Math.abs(h/x-1)<1e-8)return this.zoomTo(h,!0),this.panTo(a,r);c=c.rotate(-this.getRotation());var E=c.getTopLeft().times(h).minus(T.getTopLeft().times(x)).divide(h-x);return this.zoomTo(h,E,r)},fitBounds:function(i,s){return this._fitBounds(i,{immediately:s,constraints:!1})},fitBoundsWithConstraints:function(i,s){return this._fitBounds(i,{immediately:s,constraints:!0})},fitVertically:function(i){var s=new e.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(s,i)},fitHorizontally:function(i){var s=new e.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(s,i)},getConstrainedBounds:function(i){var s,r;return s=this.getBounds(i),r=this._applyBoundaryConstraints(s),r},panBy:function(i,s){var r=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(r.plus(i),s)},panTo:function(i,s){return s?(this.centerSpringX.resetTo(i.x),this.centerSpringY.resetTo(i.y)):(this.centerSpringX.springTo(i.x),this.centerSpringY.springTo(i.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:i,immediately:s}),this},zoomBy:function(i,s,r){return this.zoomTo(this.zoomSpring.target.value*i,s,r)},zoomTo:function(i,s,r){var o=this;return this.zoomPoint=s instanceof e.Point&&!isNaN(s.x)&&!isNaN(s.y)?s:null,r?this._adjustCenterSpringsForZoomPoint(function(){o.zoomSpring.resetTo(i)}):this.zoomSpring.springTo(i),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:i,refPoint:s,immediately:r}),this},setRotation:function(i){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=e.positiveModulo(i,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:i}),this)},getRotation:function(){return this.degrees},resize:function(i,s){var r=this.getBoundsNoRotate(),o=r,l;return this.containerSize.x=i.x,this.containerSize.y=i.y,this._updateContainerInnerSize(),s&&(l=i.x/this.containerSize.x,o.width=r.width*l,o.height=o.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:i,maintain:s}),this.fitBounds(o,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new e.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var i=this;this._adjustCenterSpringsForZoomPoint(function(){i.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var s=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,s},_adjustCenterSpringsForZoomPoint:function(i){if(this.zoomPoint){var s=this.pixelFromPoint(this.zoomPoint,!0);i();var r=this.pixelFromPoint(this.zoomPoint,!0),o=r.minus(s),l=this.deltaPointsFromPixels(o,!0);this.centerSpringX.shiftBy(l.x),this.centerSpringY.shiftBy(l.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else i()},deltaPixelsFromPointsNoRotate:function(i,s){return i.times(this._containerInnerSize.x*this.getZoom(s))},deltaPixelsFromPoints:function(i,s){return this.deltaPixelsFromPointsNoRotate(i.rotate(this.getRotation()),s)},deltaPointsFromPixelsNoRotate:function(i,s){return i.divide(this._containerInnerSize.x*this.getZoom(s))},deltaPointsFromPixels:function(i,s){return this.deltaPointsFromPixelsNoRotate(i,s).rotate(-this.getRotation())},pixelFromPointNoRotate:function(i,s){return this._pixelFromPointNoRotate(i,this.getBoundsNoRotate(s))},pixelFromPoint:function(i,s){return this._pixelFromPoint(i,this.getBoundsNoRotate(s))},_pixelFromPointNoRotate:function(i,s){return i.minus(s.getTopLeft()).times(this._containerInnerSize.x/s.width).plus(new e.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(i,s){return this._pixelFromPointNoRotate(i.rotate(this.getRotation(),this.getCenter(!0)),s)},pointFromPixelNoRotate:function(i,s){var r=this.getBoundsNoRotate(s);return i.minus(new e.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/r.width).plus(r.getTopLeft())},pointFromPixel:function(i,s){return this.pointFromPixelNoRotate(i,s).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(i,s){var r=this._contentBoundsNoRotate.width;return new e.Point(i*this._contentSizeNoRotate.x/r,s*this._contentSizeNoRotate.x/r)},viewportToImageCoordinates:function(i,s){if(i instanceof e.Point)return this.viewportToImageCoordinates(i.x,i.y);if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(r===1){var o=this.viewer.world.getItemAt(0);return o.viewportToImageCoordinates(i,s,!0)}}return this._viewportToImageDelta(i-this._contentBoundsNoRotate.x,s-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(i,s){var r=this._contentBoundsNoRotate.width;return new e.Point(i/this._contentSizeNoRotate.x*r,s/this._contentSizeNoRotate.x*r)},imageToViewportCoordinates:function(i,s){if(i instanceof e.Point)return this.imageToViewportCoordinates(i.x,i.y);if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(r===1){var o=this.viewer.world.getItemAt(0);return o.imageToViewportCoordinates(i,s,!0)}}var l=this._imageToViewportDelta(i,s);return l.x+=this._contentBoundsNoRotate.x,l.y+=this._contentBoundsNoRotate.y,l},imageToViewportRectangle:function(i,s,r,o){var l=i;if(l instanceof e.Rect||(l=new e.Rect(i,s,r,o)),this.viewer){var a=this.viewer.world.getItemCount();if(a>1)e.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(a===1){var c=this.viewer.world.getItemAt(0);return c.imageToViewportRectangle(i,s,r,o,!0)}}var h=this.imageToViewportCoordinates(l.x,l.y),p=this._imageToViewportDelta(l.width,l.height);return new e.Rect(h.x,h.y,p.x,p.y,l.degrees)},viewportToImageRectangle:function(i,s,r,o){var l=i;if(l instanceof e.Rect||(l=new e.Rect(i,s,r,o)),this.viewer){var a=this.viewer.world.getItemCount();if(a>1)e.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(a===1){var c=this.viewer.world.getItemAt(0);return c.viewportToImageRectangle(i,s,r,o,!0)}}var h=this.viewportToImageCoordinates(l.x,l.y),p=this._viewportToImageDelta(l.width,l.height);return new e.Rect(h.x,h.y,p.x,p.y,l.degrees)},viewerElementToImageCoordinates:function(i){var s=this.pointFromPixel(i,!0);return this.viewportToImageCoordinates(s)},imageToViewerElementCoordinates:function(i){var s=this.imageToViewportCoordinates(i);return this.pixelFromPoint(s,!0)},windowToImageCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var s=i.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(s)},imageToWindowCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var s=this.imageToViewerElementCoordinates(i);return s.plus(e.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(i){return this.pointFromPixel(i,!0)},viewportToViewerElementCoordinates:function(i){return this.pixelFromPoint(i,!0)},viewerElementToViewportRectangle:function(i){return e.Rect.fromSummits(this.pointFromPixel(i.getTopLeft(),!0),this.pointFromPixel(i.getTopRight(),!0),this.pointFromPixel(i.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(i){return e.Rect.fromSummits(this.pixelFromPoint(i.getTopLeft(),!0),this.pixelFromPoint(i.getTopRight(),!0),this.pixelFromPoint(i.getBottomLeft(),!0))},windowToViewportCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var s=i.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(s)},viewportToWindowCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var s=this.viewportToViewerElementCoordinates(i);return s.plus(e.getElementPosition(this.viewer.element))},viewportToImageZoom:function(i){if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)e.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(s===1){var r=this.viewer.world.getItemAt(0);return r.viewportToImageZoom(i)}}var o=this._contentSizeNoRotate.x,l=this._containerInnerSize.x,a=this._contentBoundsNoRotate.width,c=l/o*a;return i*c},imageToViewportZoom:function(i){if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)e.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(s===1){var r=this.viewer.world.getItemAt(0);return r.imageToViewportZoom(i)}}var o=this._contentSizeNoRotate.x,l=this._containerInnerSize.x,a=this._contentBoundsNoRotate.width,c=o/l/a;return i*c},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(i){return this.flipped===i?this:(this.flipped=i,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:i}),this)}}}(n),function(e){e.TiledImage=function(f){var _=this;e.console.assert(f.tileCache,"[TiledImage] options.tileCache is required"),e.console.assert(f.drawer,"[TiledImage] options.drawer is required"),e.console.assert(f.viewer,"[TiledImage] options.viewer is required"),e.console.assert(f.imageLoader,"[TiledImage] options.imageLoader is required"),e.console.assert(f.source,"[TiledImage] options.source is required"),e.console.assert(!f.clip||f.clip instanceof e.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),e.EventSource.call(this),this._tileCache=f.tileCache,delete f.tileCache,this._drawer=f.drawer,delete f.drawer,this._imageLoader=f.imageLoader,delete f.imageLoader,f.clip instanceof e.Rect&&(this._clip=f.clip.clone()),delete f.clip;var H=f.x||0;delete f.x;var L=f.y||0;delete f.y,this.normHeight=f.source.dimensions.y/f.source.dimensions.x,this.contentAspectX=f.source.dimensions.x/f.source.dimensions.y;var O=1;f.width?(O=f.width,delete f.width,f.height&&(e.console.error("specifying both width and height to a tiledImage is not supported"),delete f.height)):f.height&&(O=f.height/this.normHeight,delete f.height);var N=f.fitBounds;delete f.fitBounds;var G=f.fitBoundsPlacement||n.Placement.CENTER;delete f.fitBoundsPlacement;var q=f.degrees||0;delete f.degrees,e.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,immediateRender:e.DEFAULT_SETTINGS.immediateRender,blendTime:e.DEFAULT_SETTINGS.blendTime,alwaysBlend:e.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:e.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:e.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:e.DEFAULT_SETTINGS.iOSDevice,debugMode:e.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:e.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:e.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:e.DEFAULT_SETTINGS.placeholderFillStyle,opacity:e.DEFAULT_SETTINGS.opacity,preload:e.DEFAULT_SETTINGS.preload,compositeOperation:e.DEFAULT_SETTINGS.compositeOperation},f),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new e.Spring({initial:H,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new e.Spring({initial:L,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new e.Spring({initial:O,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new e.Spring({initial:q,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),N&&this.fitBounds(N,G,!0),this._drawingHandler=function($){_.viewer.raiseEvent("tile-drawing",e.extend({tiledImage:_},$))}},e.extend(e.TiledImage.prototype,e.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(f){f!==this._fullyLoaded&&(this._fullyLoaded=f,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=e.now(),this._needsDraw=!0},update:function(){var f=this._xSpring.update(),_=this._ySpring.update(),H=this._scaleSpring.update(),L=this._degreesSpring.update();return f||_||H||L?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(f){return this.getBoundsNoRotate(f).rotate(this.getRotation(f),this._getRotationPoint(f))},getBoundsNoRotate:function(f){return f?new e.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new e.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return e.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(f){var _=this.getBoundsNoRotate(f);if(this._clip){var H=f?this._worldWidthCurrent:this._worldWidthTarget,L=H/this.source.dimensions.x,O=this._clip.times(L);_=new e.Rect(_.x+O.x,_.y+O.y,O.width,O.height)}return _.rotate(this.getRotation(f),this._getRotationPoint(f))},getTileBounds:function(f,_,H){var L=this.source.getNumTiles(f),O=(L.x+_%L.x)%L.x,N=(L.y+H%L.y)%L.y,G=this.source.getTileBounds(f,O,N);return this.getFlip()&&(G.x=1-G.x-G.width),G.x+=(_-O)/L.x,G.y+=this._worldHeightCurrent/this._worldWidthCurrent*((H-N)/L.y),G},getContentSize:function(){return new e.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var f=this.imageToWindowCoordinates(new e.Point(0,0)),_=this.imageToWindowCoordinates(this.getContentSize());return new e.Point(_.x-f.x,_.y-f.y)},_viewportToImageDelta:function(f,_,H){var L=H?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(f*(this.source.dimensions.x/L),_*(this.source.dimensions.y*this.contentAspectX/L))},viewportToImageCoordinates:function(f,_,H){var L;return f instanceof e.Point?(H=_,L=f):L=new e.Point(f,_),L=L.rotate(-this.getRotation(H),this._getRotationPoint(H)),H?this._viewportToImageDelta(L.x-this._xSpring.current.value,L.y-this._ySpring.current.value):this._viewportToImageDelta(L.x-this._xSpring.target.value,L.y-this._ySpring.target.value)},_imageToViewportDelta:function(f,_,H){var L=H?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(f/this.source.dimensions.x*L,_/this.source.dimensions.y/this.contentAspectX*L)},imageToViewportCoordinates:function(f,_,H){f instanceof e.Point&&(H=_,_=f.y,f=f.x);var L=this._imageToViewportDelta(f,_);return H?(L.x+=this._xSpring.current.value,L.y+=this._ySpring.current.value):(L.x+=this._xSpring.target.value,L.y+=this._ySpring.target.value),L.rotate(this.getRotation(H),this._getRotationPoint(H))},imageToViewportRectangle:function(f,_,H,L,O){var N=f;N instanceof e.Rect?O=_:N=new e.Rect(f,_,H,L);var G=this.imageToViewportCoordinates(N.getTopLeft(),O),q=this._imageToViewportDelta(N.width,N.height,O);return new e.Rect(G.x,G.y,q.x,q.y,N.degrees+this.getRotation(O))},viewportToImageRectangle:function(f,_,H,L,O){var N=f;f instanceof e.Rect?O=_:N=new e.Rect(f,_,H,L);var G=this.viewportToImageCoordinates(N.getTopLeft(),O),q=this._viewportToImageDelta(N.width,N.height,O);return new e.Rect(G.x,G.y,q.x,q.y,N.degrees-this.getRotation(O))},viewerElementToImageCoordinates:function(f){var _=this.viewport.pointFromPixel(f,!0);return this.viewportToImageCoordinates(_)},imageToViewerElementCoordinates:function(f){var _=this.imageToViewportCoordinates(f);return this.viewport.pixelFromPoint(_,!0)},windowToImageCoordinates:function(f){var _=f.minus(n.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(_)},imageToWindowCoordinates:function(f){var _=this.imageToViewerElementCoordinates(f);return _.plus(n.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(f){var _=this._scaleSpring.current.value;return f=f.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new e.Rect((f.x-this._xSpring.current.value)/_,(f.y-this._ySpring.current.value)/_,f.width/_,f.height/_,f.degrees)},viewportToImageZoom:function(f){var _=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return _*f},imageToViewportZoom:function(f){var _=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return f/_},setPosition:function(f,_){var H=this._xSpring.target.value===f.x&&this._ySpring.target.value===f.y;if(_){if(H&&this._xSpring.current.value===f.x&&this._ySpring.current.value===f.y)return;this._xSpring.resetTo(f.x),this._ySpring.resetTo(f.y),this._needsDraw=!0}else{if(H)return;this._xSpring.springTo(f.x),this._ySpring.springTo(f.y),this._needsDraw=!0}H||this._raiseBoundsChange()},setWidth:function(f,_){this._setScale(f,_)},setHeight:function(f,_){this._setScale(f/this.normHeight,_)},setCroppingPolygons:function(f){var _=function(L){return L instanceof e.Point||typeof L.x=="number"&&typeof L.y=="number"},H=function(L){return L.map(function(O){try{if(_(O))return{x:O.x,y:O.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!e.isArray(f))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=f.map(function(L){return H(L)})}catch(L){e.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),e.console.error(L),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(f,_,H){_=_||e.Placement.CENTER;var L=e.Placement.properties[_],O=this.contentAspectX,N=0,G=0,q=1,$=1;if(this._clip&&(O=this._clip.getAspectRatio(),q=this._clip.width/this.source.dimensions.x,$=this._clip.height/this.source.dimensions.y,f.getAspectRatio()>O?(N=this._clip.x/this._clip.height*f.height,G=this._clip.y/this._clip.height*f.height):(N=this._clip.x/this._clip.width*f.width,G=this._clip.y/this._clip.width*f.width)),f.getAspectRatio()>O){var re=f.height/$,J=0;L.isHorizontallyCentered?J=(f.width-f.height*O)/2:L.isRight&&(J=f.width-f.height*O),this.setPosition(new e.Point(f.x-N+J,f.y-G),H),this.setHeight(re,H)}else{var fe=f.width/q,ue=0;L.isVerticallyCentered?ue=(f.height-f.width/O)/2:L.isBottom&&(ue=f.height-f.width/O),this.setPosition(new e.Point(f.x-N,f.y-G+ue),H),this.setWidth(fe,H)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(f){e.console.assert(!f||f instanceof e.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),f instanceof e.Rect?this._clip=f.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(f){this.flipped=!!f,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(f){f!==this.opacity&&(this.opacity=f,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(f){this._preload=!!f,this._needsDraw=!0},getRotation:function(f){return f?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(f,_){this._degreesSpring.target.value===f&&this._degreesSpring.isAtTargetValue()||(_?this._degreesSpring.resetTo(f):this._degreesSpring.springTo(f),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(f){return this.getBoundsNoRotate(f).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(f){f!==this.compositeOperation&&(this.compositeOperation=f,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(f,_){var H=this._scaleSpring.target.value===f;if(_){if(H&&this._scaleSpring.current.value===f)return;this._scaleSpring.resetTo(f),this._updateForScale(),this._needsDraw=!0}else{if(H)return;this._scaleSpring.springTo(f),this._updateForScale(),this._needsDraw=!0}H||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var f=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),_=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,H=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(_/this.minPixelRatio)/Math.log(2))));return H=Math.max(H,this.source.minLevel||0),f=Math.min(f,H),{lowestLevel:f,highestLevel:H}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var f=this.lastDrawn.pop();f.beingDrawn=!1}var _=this.viewport,H=this._viewportToTiledImageRectangle(_.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var L=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(H=H.intersection(L),H===null)return}for(var O=this._getLevelsInterval(),N=O.lowestLevel,G=O.highestLevel,q=null,$=!1,re=e.now(),J=G;J>=N;J--){var fe=!1,ue=_.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(J),!0).x*this._scaleSpring.current.value;if(J===N||!$&&ue>=this.minPixelRatio)fe=!0,$=!0;else if(!$)continue;var me=_.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(J),!1).x*this._scaleSpring.current.value,le=_.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,oe=this.immediateRender?1:le,ee=Math.min(1,(ue-.5)/.5),ye=oe/Math.abs(oe-me);if(q=i(this,$,fe,J,ee,ye,H,re,q),p(this.coverage,J))break}R(this,this.lastDrawn),q&&!q.context2D?(o(this,q,re),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(f,_,H){var L,O;this.wrapHorizontal?(L=e.positiveModulo(_.x,1),O=e.positiveModulo(H.x,1)):(L=Math.max(0,_.x),O=Math.min(1,H.x));var N,G,q=1/this.source.aspectRatio;this.wrapVertical?(N=e.positiveModulo(_.y,q),G=e.positiveModulo(H.y,q)):(N=Math.max(0,_.y),G=Math.min(q,H.y));var $=this.source.getTileAtPoint(f,new e.Point(L,N)),re=this.source.getTileAtPoint(f,new e.Point(O,G)),J=this.source.getNumTiles(f);return this.wrapHorizontal&&($.x+=J.x*Math.floor(_.x),re.x+=J.x*Math.floor(H.x)),this.wrapVertical&&($.y+=J.y*Math.floor(_.y/q),re.y+=J.y*Math.floor(H.y/q)),{topLeft:$,bottomRight:re}}});function i(f,_,H,L,O,N,G,q,$){var re=G.getBoundingBox().getTopLeft(),J=G.getBoundingBox().getBottomRight();f.viewer&&f.viewer.raiseEvent("update-level",{tiledImage:f,havedrawn:_,level:L,opacity:O,visibility:N,drawArea:G,topleft:re,bottomright:J,currenttime:q,best:$}),x(f.coverage,L),x(f.loadingCoverage,L);var fe=f._getCornerTiles(L,re,J),ue=fe.topLeft,me=fe.bottomRight,le=f.source.getNumTiles(L),oe=f.viewport.pixelFromPoint(f.viewport.getCenter());f.getFlip()&&(me.x+=1,f.wrapHorizontal||(me.x=Math.min(me.x,le.x-1)));for(var ee=ue.x;ee<=me.x;ee++)for(var ye=ue.y;ye<=me.y;ye++){var Y;if(f.getFlip()){var Ee=(le.x+ee%le.x)%le.x;Y=ee+le.x-Ee-Ee-1}else Y=ee;G.intersection(f.getTileBounds(L,Y,ye))!==null&&($=s(f,H,_,Y,ye,L,O,N,oe,le,q,$))}return $}function s(f,_,H,L,O,N,G,q,$,re,J,fe){var ue=r(L,O,N,f,f.source,f.tilesMatrix,J,re,f._worldWidthCurrent,f._worldHeightCurrent),me=H;f.viewer&&f.viewer.raiseEvent("update-tile",{tiledImage:f,tile:ue}),T(f.coverage,N,L,O,!1);var le=ue.loaded||ue.loading||m(f.loadingCoverage,N,L,O);if(T(f.loadingCoverage,N,L,O,le),!ue.exists||(_&&!me&&(m(f.coverage,N,L,O)?T(f.coverage,N,L,O,!0):me=!0),!me))return fe;if(c(ue,f.source.tileOverlap,f.viewport,$,q,f),!ue.loaded)if(ue.context2D)a(f,ue);else{var oe=f._tileCache.getImageRecord(ue.cacheKey);if(oe){var ee=oe.getImage();a(f,ue,ee)}}if(ue.loaded){var ye=h(f,ue,L,O,N,G,J);ye&&(f._needsDraw=!0)}else ue.loading?f._tilesLoading++:le||(fe=E(fe,ue));return fe}function r(f,_,H,L,O,N,G,q,$,re){var J,fe,ue,me,le,oe,ee,ye,Y;return N[H]||(N[H]={}),N[H][f]||(N[H][f]={}),(!N[H][f][_]||!N[H][f][_].flipped!=!L.flipped)&&(J=(q.x+f%q.x)%q.x,fe=(q.y+_%q.y)%q.y,ue=L.getTileBounds(H,f,_),me=O.getTileBounds(H,J,fe,!0),le=O.tileExists(H,J,fe),oe=O.getTileUrl(H,J,fe),L.loadTilesWithAjax?(ee=O.getTileAjaxHeaders(H,J,fe),e.isPlainObject(L.ajaxHeaders)&&(ee=e.extend({},L.ajaxHeaders,ee))):ee=null,ye=O.getContext2D?O.getContext2D(H,J,fe):void 0,Y=new e.Tile(H,f,_,ue,le,oe,ye,L.loadTilesWithAjax,ee,me),L.getFlip()?J===0&&(Y.isRightMost=!0):J===q.x-1&&(Y.isRightMost=!0),fe===q.y-1&&(Y.isBottomMost=!0),Y.flipped=L.flipped,N[H][f][_]=Y),Y=N[H][f][_],Y.lastTouchTime=G,Y}function o(f,_,H){_.loading=!0,f._imageLoader.addJob({src:_.url,loadWithAjax:_.loadWithAjax,ajaxHeaders:_.ajaxHeaders,crossOriginPolicy:f.crossOriginPolicy,ajaxWithCredentials:f.ajaxWithCredentials,callback:function(L,O,N){l(f,_,H,L,O,N)},abort:function(){_.loading=!1}})}function l(f,_,H,L,O,N){if(!L){e.console.log("Tile %s failed to load: %s - error: %s",_,_.url,O),f.viewer.raiseEvent("tile-load-failed",{tile:_,tiledImage:f,time:H,message:O,tileRequest:N}),_.loading=!1,_.exists=!1;return}if(Hf.visibility||_.visibility===f.visibility&&_.squaredDistance1&&q>f.smoothTileEdgesMinZoom&&!f.iOSDevice&&f.getRotation(!0)%360===0&&e.supportsCanvas&&(L=!0,O=H.getScaleForEdgeSmoothing(),N=H.getTranslationForEdgeSmoothing(O,f._drawer.getCanvasSize(!1),f._drawer.getCanvasSize(!0)));var $;L&&(O||($=f.viewport.viewportToViewerElementRectangle(f.getClippedBounds(!0)).getIntegerBoundingBox(),f._drawer.viewer.viewport.getFlip()&&(f.viewport.degrees!==0||f.getRotation(!0)%360!==0)&&($.x=f._drawer.viewer.container.clientWidth-($.x+$.width)),$=$.times(e.pixelDensityRatio)),f._drawer._clear(!0,$)),O||(f.viewport.degrees!==0&&f._drawer._offsetForRotation({degrees:f.viewport.degrees,useSketch:L}),f.getRotation(!0)%360!==0&&f._drawer._offsetForRotation({degrees:f.getRotation(!0),point:f.viewport.pixelFromPointNoRotate(f._getRotationPoint(!0),!0),useSketch:L}),f.viewport.degrees===0&&f.getRotation(!0)%360===0&&f._drawer.viewer.viewport.getFlip()&&f._drawer._flip());var re=!1;if(f._clip){f._drawer.saveContext(L);var J=f.imageToViewportRectangle(f._clip,!0);J=J.rotate(-f.getRotation(!0),f._getRotationPoint(!0));var fe=f._drawer.viewportToDrawerRectangle(J);O&&(fe=fe.times(O)),N&&(fe=fe.translate(N)),f._drawer.setClip(fe,L),re=!0}if(f._croppingPolygons){f._drawer.saveContext(L);try{var ue=f._croppingPolygons.map(function(ee){return ee.map(function(ye){var Y=f.imageToViewportCoordinates(ye.x,ye.y,!0).rotate(-f.getRotation(!0),f._getRotationPoint(!0)),Ee=f._drawer.viewportCoordToDrawerCoord(Y);return O&&(Ee=Ee.times(O)),Ee})});f._drawer.clipWithPolygons(ue,L)}catch(ee){e.console.error(ee)}re=!0}if(f.placeholderFillStyle&&f._hasOpaqueTile===!1){var me=f._drawer.viewportToDrawerRectangle(f.getBounds(!0));O&&(me=me.times(O)),N&&(me=me.translate(N));var le=null;typeof f.placeholderFillStyle=="function"?le=f.placeholderFillStyle(f,f._drawer.context):le=f.placeholderFillStyle,f._drawer.drawRectangle(me,le,L)}for(var oe=_.length-1;oe>=0;oe--)H=_[oe],f._drawer.drawTile(H,f._drawingHandler,L,O,N),H.beingDrawn=!0,f.viewer&&f.viewer.raiseEvent("tile-drawn",{tiledImage:f,tile:H});re&&f._drawer.restoreContext(L),O||(f.getRotation(!0)%360!==0&&f._drawer._restoreRotationChanges(L),f.viewport.degrees!==0&&f._drawer._restoreRotationChanges(L)),L&&(O&&(f.viewport.degrees!==0&&f._drawer._offsetForRotation({degrees:f.viewport.degrees,useSketch:!1}),f.getRotation(!0)%360!==0&&f._drawer._offsetForRotation({degrees:f.getRotation(!0),point:f.viewport.pixelFromPointNoRotate(f._getRotationPoint(!0),!0),useSketch:!1})),f._drawer.blendSketch({opacity:f.opacity,scale:O,translate:N,compositeOperation:f.compositeOperation,bounds:$}),O&&(f.getRotation(!0)%360!==0&&f._drawer._restoreRotationChanges(!1),f.viewport.degrees!==0&&f._drawer._restoreRotationChanges(!1))),O||f.viewport.degrees===0&&f.getRotation(!0)%360===0&&f._drawer.viewer.viewport.getFlip()&&f._drawer._flip(),M(f,_)}}function M(f,_){if(f.debugMode)for(var H=_.length-1;H>=0;H--){var L=_[H];try{f._drawer.drawDebugInfo(L,_.length,H,f)}catch(O){e.console.error(O)}}}}(n),function(e){var i=function(r){e.console.assert(r,"[TileCache.cacheTile] options is required"),e.console.assert(r.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(r.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=r.tile,this.tiledImage=r.tiledImage},s=function(r){e.console.assert(r,"[ImageRecord] options is required"),e.console.assert(r.image,"[ImageRecord] options.image is required"),this._image=r.image,this._tiles=[]};s.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var r=document.createElement("canvas");r.width=this._image.width,r.height=this._image.height,this._renderedContext=r.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(r){e.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=r},addTile:function(r){e.console.assert(r,"[ImageRecord.addTile] tile is required"),this._tiles.push(r)},removeTile:function(r){for(var o=0;othis._maxImageCacheCount){for(var c=null,h=-1,p=null,m,T,x,E,R,M,f=this._tilesLoaded.length-1;f>=0;f--)if(M=this._tilesLoaded[f],m=M.tile,!(m.level<=o||m.beingDrawn)){if(!c){c=m,h=f,p=M;continue}E=m.lastTouchTime,T=c.lastTouchTime,R=m.level,x=c.level,(Ex)&&(c=m,h=f,p=M)}c&&h>=0&&(this._unloadTile(p),l=h)}this._tilesLoaded[l]=new i({tile:r.tile,tiledImage:r.tiledImage})},clearTilesFor:function(r){e.console.assert(r,"[TileCache.clearTilesFor] tiledImage is required");for(var o,l=0;l=this._items.length)throw new Error("Index bigger than number of layers.");s===r||r===-1||(this._items.splice(r,1),this._items.splice(s,0,i),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:i,previousIndex:r,newIndex:s}))},removeItem:function(i){e.console.assert(i,"[World.removeItem] item is required");var s=e.indexOf(this._items,i);s!==-1&&(i.removeHandler("bounds-change",this._delegatedFigureSizes),i.removeHandler("clip-change",this._delegatedFigureSizes),i.destroy(),this._items.splice(s,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(i))},removeAll:function(){this.viewer._cancelPendingImages();var i,s;for(s=0;sE.height?R=a:R=a*(E.width/E.height),M=R*(E.height/E.width),f=new e.Point(m+(a-R)/2,T+(a-M)/2),x.setPosition(f,s),x.setWidth(R,s),r==="horizontal"?m+=h:T+=h;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var i=this._homeBounds?this._homeBounds.clone():null,s=this._contentSize?this._contentSize.clone():null,r=this._contentFactor||0;if(!this._items.length)this._homeBounds=new e.Rect(0,0,1,1),this._contentSize=new e.Point(1,1),this._contentFactor=1;else{var o=this._items[0],l=o.getBounds();this._contentFactor=o.getContentSize().x/l.width;for(var a=o.getClippedBounds().getBoundingBox(),c=a.x,h=a.y,p=a.x+a.width,m=a.y+a.height,T=1;T{t=i,n=s});return e.resolve=t,e.reject=n,e}const mf=.01,vf={directives:{clickOutside:En.directive},data(){return{filtersVisible:!1,loadingTimeout:null,promise:Cn(),tileSources:{},viewer:null,viewerState:{},zoomFactor:1.5}},computed:{filtersActive(){return Object.keys(this.$store.options.filters).length>0},saturation(){const t=this.$store.options.filters.saturate;return typeof t=="number"?t:1}},watch:{"$store.options.pages":function(t,n){const e=t.length!==n.length;this.loadImageInfo(e)}},mounted(){this.loadImageInfo(),this.updateFilterStyle(),this.$store.readyPromises.push(this.promise),this.$store.rootElement.addEventListener("keydown",this.onKeydown),this.$store.rootElement.addEventListener("keypress",this.onKeypress)},beforeUnmount(){this.viewer&&this.viewer.destroy(),this.$store.rootElement.removeEventListener("keydown",this.onKeydown),this.$store.rootElement.removeEventListener("keypress",this.onKeypress)},methods:{closeFilters(){this.filtersVisible=!1},initViewer(t){const n=[];let e=0,i,s=0;if(this.$store.options.pages.forEach((r,o)=>{let l=1;r<1?(l=0,i=o>0?this.$store.pageCount:1):i=r;const a=this.tileSources[i];if(!a)return;e||(e=a.width);const c=a.width/e;n.push({opacity:l,tileSource:a,width:c,x:s}),s+=c+mf}),this.viewer){this.viewer.addOnceHandler("open",()=>{if(this.viewerState.isReset||t)this.resetScan();else{if(this.viewer.viewport.applyConstraints(!0),!this.$store.options.optionsResetOnPageChange)return;this.$store.options.optionsResetOnPageChange.forEach(r=>{if(r==="filters")this.resetFilters();else if(r==="pan"){const o=this.viewer.viewport.getBounds();if(o.x<=0&&o.y<=0)return;const l=this.$store.options.pages[0]?0:1;this.viewer.viewport.panTo({x:o.x>0?o.width/2+l:this.$store.options.pan.x,y:o.y>0?o.height/2:this.$store.options.pan.y}),this.$store.updateOptions({pan:{}})}else r==="rotation"?(this.viewer.viewport.setRotation(0),this.$store.updateOptions({rotation:null})):r==="zoom"&&(this.viewer.viewport.goHome(),this.$store.updateOptions({zoom:null}))})}}),this.viewer.open(n);return}this.viewer=gf({animationTime:.4,element:this.$refs.image,immediateRender:!0,preload:!this.$store.isMobile(),preserveImageSizeOnResize:!0,preserveViewport:!0,showNavigationControl:!1,showZoomControl:!1,tileSources:n,visibilityRatio:.2,...this.$store.options.viewer}),this.viewer.innerTracker.keyHandler=null,this.viewer.gestureSettingsMouse.clickToZoom=!1,this.viewer.addHandler("animation-finish",()=>{if(this.viewerState.isReset){this.removeScanOptions();return}const r=this.viewer.viewport.getCenter();this.$store.updateOptions({pan:{x:Math.round(r.x*1e3)/1e3,y:Math.round(r.y*1e3)/1e3},zoom:Math.round(this.viewer.viewport.getZoom()*1e3)/1e3})}),this.viewer.addHandler("canvas-click",()=>{document.body.click()}),this.viewer.addHandler("open",()=>{this.startLoadingWatch(),this.$store.options.pan.x!==void 0||this.$store.options.pan.y!==void 0||this.$store.options.zoom?((this.$store.options.pan.x!==void 0||this.$store.options.pan.y!==void 0)&&this.viewer.viewport.panTo({x:this.$store.options.pan.x,y:this.$store.options.pan.y},!0),this.$store.options.zoom&&this.viewer.viewport.zoomTo(this.$store.options.zoom,null,!0)):this.viewer.viewport.goHome(),this.$store.options.rotation!==null&&this.viewer.viewport.setRotation(this.$store.options.rotation)}),this.viewer.addHandler("pan",this.updateViewerState),this.viewer.addHandler("resize",this.updateViewerState),this.viewer.addHandler("zoom",this.updateViewerState),this.viewer.addHandler("tile-load-failed",r=>{this.$store.addError(`Error loading image: ${r.message}`)}),this.$api.expose(this.resetScan),this.$api.expose(this.viewer,"viewer"),this.promise.resolve()},loadImageInfo(t=!1){this.stopLoadingWatch();const n=[];this.$store.options.pages.forEach(e=>{var s,r;if(e<1||this.tileSources[e])return;const i=(r=(s=this.$store.manifest.items[e-1].items)==null?void 0:s[0].items)==null?void 0:r[0].body;if(i.service){const o=i.service instanceof Array?i.service[0]:i.service,l=o.id||o["@id"],a=`${l}${l.at(-1)==="/"?"":"/"}info.json`;n.push(this.$store.fetchJson(a).then(c=>({...c,page:e}),c=>{let h;c.response&&c.response.statusText?h=c.response.statusText:c.message&&(h=c.message),this.$store.addError(`Error loading info file for page ${e}${h?`: ${h}`:""}`)}))}else this.tileSources[e]={type:"image",url:i.id,width:i.width,height:i.height}}),n.length?Promise.all(n).then(e=>{e.forEach(i=>{i&&(this.tileSources[i.page]=i)}),this.initViewer(t)}):this.initViewer(t)},onKeydown(t){t.key==="Escape"&&(this.filtersVisible=!1,this.$store.rootElement.focus()),[45,48,96].includes(t.keyCode)&&(t.shiftKey?this.resetScan(t):this.viewer.viewport.goHome())},onKeypress(t){if(!Pn(t))switch(t.key){case"r":case"R":this.rotateRight(t);break;case"i":this.filtersVisible=!this.filtersVisible,this.filtersVisible?this.$nextTick(()=>this.$refs.firstSlider.focus()):this.$store.rootElement.focus();break;case"I":this.resetFilters();break;case"+":case"=":case"W":this.viewer.viewport.zoomBy(1.1),this.viewer.viewport.applyConstraints();break;case"-":case"_":case"S":this.viewer.viewport.zoomBy(.9),this.viewer.viewport.applyConstraints();break;case"w":this.viewer.innerTracker.keyDownHandler({keyCode:38});break;case"s":this.viewer.innerTracker.keyDownHandler({keyCode:40});break;case"a":this.viewer.innerTracker.keyDownHandler({keyCode:37});break;case"d":this.viewer.innerTracker.keyDownHandler({keyCode:39});break}},removeScanOptions(){this.$store.updateOptions({pan:{},zoom:null})},resetFilters(){this.$refs.image.style.cssText="",this.$store.updateOptions({filters:{}})},resetScan(t){t&&(this.viewer.viewport.setRotation(0),this.$store.updateOptions({rotation:null}),this.filtersActive&&this.resetFilters()),this.viewer.viewport.goHome(),this.removeScanOptions()},rotateRight(t){const{viewport:n}=this.viewer,e=t&&t.shiftKey?0:(n.getRotation()+90)%360;n.setRotation(e),this.$store.updateOptions({rotation:e||null})},setFilter(t,n){const e=n.target.valueAsNumber;e===1?delete this.$store.options.filters[t]:this.$store.options.filters[t]=e,this.$store.updateOptions({filters:this.$store.options.filters}),this.updateFilterStyle()},startLoadingWatch(){this.$store.loading=0;for(let t=this.viewer.world.getItemCount()-1;t>=0;t-=1){const n=this.viewer.world.getItemAt(t);if(n&&n._tilesLoading){this.$store.loading=1;break}}this.loadingTimeout=setTimeout(this.startLoadingWatch,200)},stopLoadingWatch(){clearTimeout(this.loadingTimeout)},updateFilterStyle(){if(!this.filtersActive)return;const t=[];Object.keys(this.$store.options.filters).forEach(i=>{t.push(`${i}(${this.$store.options.filters[i]})`)});const{image:n}=this.$refs,e=t.join(" ");n.style.cssText=`filter: ${e}`},updateViewerState(){const t=this.viewer.viewport.getZoom();this.viewerState.isMaxZoom=t>=this.viewer.viewport.getMaxZoom(),this.viewerState.isMinZoom=t<=this.viewer.viewport.getMinZoom();const n=this.viewer.viewport.getHomeBounds(),e=this.viewer.viewport.getBounds();this.viewerState.isReset=Math.abs(n.height-e.height)<1e-9&&Math.abs(n.width-e.width)<1e-9&&Math.abs(n.x-e.x)<1e-9&&Math.abs(n.y-e.y)<1e-9},zoomIn(){this.viewer.viewport.zoomBy(this.zoomFactor)},zoomOut(){this.viewer.viewport.zoomBy(1/this.zoomFactor)}}},yf={class:"tify-scan"},wf={class:"tify-sr-only"},_f=["title"],Tf=["title"],xf={key:2,class:"tify-scan-buttons"},bf=["disabled","title"],Sf=["disabled","title"],Ef=["disabled","title"],Pf=["title"],Cf=["title","aria-controls","aria-expanded"],Rf=["id"],Lf={class:"tify-sr-only"},Hf=["value"],Of=["value"],Mf=["value"],Df=["disabled"],Af={ref:"image",class:"tify-scan-image"};function kf(t,n,e,i,s,r){const o=Pr,l=Er,a=tf,c=Xh,h=jh,p=Ih,m=Oh,T=Eh,x=wh,E=dh,R=ah,M=yn("click-outside");return k(),F("section",yf,[A("h2",wf,Z(t.$translate("Scan")),1),!t.$store.isCustomPageView&&!t.$store.isFirstPage?(k(),F("button",{key:0,type:"button",class:"tify-scan-page-button -previous",title:t.$translate("Previous page"),onClick:n[0]||(n[0]=f=>t.$store.goToPreviousPage())},[ie(o)],8,_f)):se("",!0),!t.$store.isCustomPageView&&!t.$store.isLastPage?(k(),F("button",{key:1,type:"button",class:"tify-scan-page-button -next",title:t.$translate("Next page"),onClick:n[1]||(n[1]=f=>t.$store.goToNextPage())},[ie(l)],8,Tf)):se("",!0),s.viewer?(k(),F("div",xf,[A("button",{type:"button",class:"tify-scan-button",disabled:s.viewerState.isMaxZoom,title:t.$translate("Zoom in"),onClick:n[2]||(n[2]=f=>r.zoomIn())},[ie(a)],8,bf),A("button",{type:"button",class:"tify-scan-button",disabled:s.viewerState.isReset,title:t.$translate("Reset"),onClick:n[3]||(n[3]=f=>r.resetScan(!!f.shiftKey))},[ie(c)],8,Sf),A("button",{type:"button",class:"tify-scan-button",disabled:s.viewerState.isMinZoom,title:t.$translate("Zoom out"),onClick:n[4]||(n[4]=f=>r.zoomOut())},[ie(h)],8,Ef),A("button",{type:"button",class:Te(["tify-scan-button",{"-active":t.$store.options.rotation}]),title:t.$translate("Rotate"),onClick:n[5]||(n[5]=f=>r.rotateRight(f))},[ie(p)],10,Pf),De((k(),F("div",{class:Te(["tify-scan-filters",{"-open":s.filtersVisible}])},[A("button",{type:"button",class:Te(["tify-scan-button",{"-active":r.filtersActive}]),title:t.$translate("Toggle image filters"),"aria-controls":t.$store.getId("filters"),"aria-expanded":s.filtersVisible?"true":"false",onClick:n[6]||(n[6]=f=>s.filtersVisible=!s.filtersVisible)},[ie(m)],10,Cf),De(A("div",{id:t.$store.getId("filters"),class:"tify-scan-filters-popup"},[A("h3",Lf,Z(t.$translate("Image filters")),1),A("p",null,[A("label",null,[ie(T),be(" "+Z(t.$translate("Brightness"))+" ",1),A("b",null,Z(Math.round((t.$store.options.filters.brightness||1)*100))+" %",1),A("input",{ref:"firstSlider",class:"tify-scan-range",max:"2",min:".5",step:".01",type:"range",value:t.$store.options.filters.brightness||1,onInput:n[7]||(n[7]=f=>r.setFilter("brightness",f))},null,40,Hf)])]),A("p",null,[A("label",null,[ie(x),be(" "+Z(t.$translate("Contrast"))+" ",1),A("b",null,Z(Math.round((t.$store.options.filters.contrast||1)*100))+" %",1),A("input",{class:"tify-scan-range",max:"2",min:".5",step:".01",type:"range",value:t.$store.options.filters.contrast||1,onInput:n[8]||(n[8]=f=>r.setFilter("contrast",f))},null,40,Of)])]),A("p",null,[A("label",null,[ie(E),be(" "+Z(t.$translate("Saturation"))+" ",1),A("b",null,Z(Math.round(r.saturation*100))+" %",1),A("input",{class:"tify-scan-range",max:"3",min:"0",step:".01",type:"range",value:r.saturation,onInput:n[9]||(n[9]=f=>r.setFilter("saturate",f))},null,40,Mf)])]),A("p",null,[A("button",{type:"button",class:"tify-scan-reset",disabled:!r.filtersActive,onClick:n[10]||(n[10]=f=>r.resetFilters())},[ie(R),be(" "+Z(t.$translate("Reset")),1)],8,Df)])],8,Rf),[[Ze,s.filtersVisible]])],2)),[[M,r.closeFilters]])])):se("",!0),A("div",Af,null,512)])}const Ff=ae(vf,[["render",kf]]),If={},Bf={class:"tify-icon",viewBox:"0 0 24 24"},zf=A("path",{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"},null,-1),Nf=[zf];function Vf(t,n){return k(),F("svg",Bf,Nf)}const Uf=ae(If,[["render",Vf]]),jf={},Wf={class:"tify-icon",viewBox:"0 0 24 24"},Gf=A("path",{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"},null,-1),qf=[Gf];function Zf(t,n){return k(),F("svg",Wf,qf)}const Kf=ae(jf,[["render",Zf]]),Xf={},Yf={class:"tify-icon",viewBox:"0 0 24 24"},Jf=A("path",{d:"M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z"},null,-1),Qf=[Jf];function $f(t,n){return k(),F("svg",Yf,Qf)}const ed=ae(Xf,[["render",$f]]),td={},id={class:"tify-icon",viewBox:"0 0 24 24"},nd=A("path",{d:"M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"},null,-1),sd=[nd];function rd(t,n){return k(),F("svg",id,sd)}const od=ae(td,[["render",rd]]),ad={},ld={class:"tify-icon",viewBox:"0 0 24 24"},cd=A("path",{d:"M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z"},null,-1),ud=[cd];function hd(t,n){return k(),F("svg",ld,ud)}const fd=ae(ad,[["render",hd]]),dd={},pd={class:"tify-icon",viewBox:"0 0 24 24"},gd=A("path",{d:"M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z"},null,-1),md=[gd];function vd(t,n){return k(),F("svg",pd,md)}const yd=ae(dd,[["render",vd]]),wd={},_d={class:"tify-icon",viewBox:"0 0 24 24"},Td=A("path",{d:"M3,9H17V7H3V9M3,13H17V11H3V13M3,17H17V15H3V17M19,17H21V15H19V17M19,7V9H21V7H19M19,13H21V11H19V13Z"},null,-1),xd=[Td];function bd(t,n){return k(),F("svg",_d,xd)}const Sd=ae(wd,[["render",bd]]),Ed={},Pd={class:"tify-icon",viewBox:"0 0 24 24"},Cd=A("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"},null,-1),Rd=[Cd];function Ld(t,n){return k(),F("svg",Pd,Rd)}const Hd=ae(Ed,[["render",Ld]]),Od={},Md={class:"tify-icon",viewBox:"0 0 24 24"},Dd=A("path",{d:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"},null,-1),Ad=[Dd];function kd(t,n){return k(),F("svg",Md,Ad)}const Fd=ae(Od,[["render",kd]]),Id={},Bd={class:"tify-icon",viewBox:"0 0 24 24"},zd=A("path",{d:"M12 16C13.1 16 14 16.9 14 18S13.1 20 12 20 10 19.1 10 18 10.9 16 12 16M12 10C13.1 10 14 10.9 14 12S13.1 14 12 14 10 13.1 10 12 10.9 10 12 10M12 4C13.1 4 14 4.9 14 6S13.1 8 12 8 10 7.1 10 6 10.9 4 12 4M6 16C7.1 16 8 16.9 8 18S7.1 20 6 20 4 19.1 4 18 4.9 16 6 16M6 10C7.1 10 8 10.9 8 12S7.1 14 6 14 4 13.1 4 12 4.9 10 6 10M6 4C7.1 4 8 4.9 8 6S7.1 8 6 8 4 7.1 4 6 4.9 4 6 4M18 16C19.1 16 20 16.9 20 18S19.1 20 18 20 16 19.1 16 18 16.9 16 18 16M18 10C19.1 10 20 10.9 20 12S19.1 14 18 14 16 13.1 16 12 16.9 10 18 10M18 4C19.1 4 20 4.9 20 6S19.1 8 18 8 16 7.1 16 6 16.9 4 18 4Z"},null,-1),Nd=[zd];function Vd(t,n){return k(),F("svg",Bd,Nd)}const Ud=ae(Id,[["render",Vd]]),jd={},Wd={class:"tify-icon",viewBox:"0 0 24 24"},Gd=A("path",{d:"M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7.41M16,6H18V18H16V6Z"},null,-1),qd=[Gd];function Zd(t,n){return k(),F("svg",Wd,qd)}const Kd=ae(jd,[["render",Zd]]),Xd={},Yd={class:"tify-icon",viewBox:"0 0 24 24"},Jd=A("path",{d:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z"},null,-1),Qd=[Jd];function $d(t,n){return k(),F("svg",Yd,Qd)}const ep=ae(Xd,[["render",$d]]),tp={},ip={class:"tify-icon",viewBox:"0 0 24 24"},np=A("path",{d:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z"},null,-1),sp=[np];function rp(t,n){return k(),F("svg",ip,sp)}const op=ae(tp,[["render",rp]]),ap={},lp={class:"tify-icon",viewBox:"0 0 24 24"},cp=A("path",{d:"M18.41,16.59L13.82,12L18.41,7.41L17,6L11,12L17,18L18.41,16.59M6,6H8V18H6V6Z"},null,-1),up=[cp];function hp(t,n){return k(),F("svg",lp,up)}const fp=ae(ap,[["render",hp]]),dp={},pp={class:"tify-header-button-group -pagination"},gp=["disabled","title"],mp=["disabled","title"],vp=["disabled","title"],yp=["disabled","title"],wp=["disabled","title"],_p=["disabled","title"];function Tp(t,n){const e=fp,i=op,s=Pr,r=Er,o=ep,l=Kd;return k(),F("div",pp,[A("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isFirstPage,title:t.$translate("First page"),onClick:n[0]||(n[0]=a=>t.$store.goToFirstPage())},[ie(e)],8,gp),t.$store.manifest.structures?(k(),F("button",{key:0,type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isFirstPage,title:t.$translate("Previous section"),onClick:n[1]||(n[1]=a=>t.$store.goToPreviousSection())},[ie(i)],8,mp)):se("",!0),A("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isFirstPage,title:t.$translate("Previous page"),onClick:n[2]||(n[2]=a=>t.$store.goToPreviousPage())},[ie(s)],8,vp),A("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isLastPage,title:t.$translate("Next page"),onClick:n[3]||(n[3]=a=>t.$store.goToNextPage())},[ie(r)],8,yp),t.$store.manifest.structures?(k(),F("button",{key:1,type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isLastSection,title:t.$translate("Next section"),onClick:n[4]||(n[4]=a=>t.$store.goToNextSection())},[ie(o)],8,wp)):se("",!0),A("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isLastPage,title:t.$translate("Last page"),onClick:n[5]||(n[5]=a=>t.$store.goToLastPage())},[ie(l)],8,_p)])}const xp=ae(dp,[["render",Tp]]),bp={},Sp={class:"tify-icon",viewBox:"0 0 24 24"},Ep=A("path",{d:"M6.5 20C8.2 20 10.65 20.65 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5C19.89 4.65 18.67 4.5 17.5 4.5C15.55 4.5 13.45 4.9 12 6C10.55 4.9 8.45 4.5 6.5 4.5C5.33 4.5 4.11 4.65 3 5C2.25 5.25 1.6 5.55 1 6V20.6C1 20.85 1.25 21.1 1.5 21.1C1.6 21.1 1.65 21.1 1.75 21.05C3.15 20.3 4.85 20 6.5 20M12 19.5V8C13.35 7.15 15.8 6.5 17.5 6.5C18.7 6.5 19.9 6.65 21 7V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5Z"},null,-1),Pp=[Ep];function Cp(t,n){return k(),F("svg",Sp,Pp)}const Rp=ae(bp,[["render",Cp]]),Lp={},Hp={class:"tify-icon",viewBox:"0 0 24 24"},Op=A("path",{d:"M16,5V11H21V5M10,11H15V5H10M16,18H21V12H16M10,18H15V12H10M4,18H9V12H4M4,11H9V5H4V11Z"},null,-1),Mp=[Op];function Dp(t,n){return k(),F("svg",Hp,Mp)}const Ap=ae(Lp,[["render",Dp]]),kp={directives:{clickOutside:En.directive},data(){return{filter:"",filteredCanvases:[],highlightIndex:0,isOpen:!1}},computed:{currentPageLabel(){const t=this.$store.options.pages[0]||1,n=this.$store.options.pages[0]?this.$store.options.pages[0]-1:0,e=this.$store.localize(this.$store.manifest.items[n].label);return this.$store.getPageLabel(t,e)}},watch:{filter(){this.updateFilteredCanvases(),this.$nextTick(()=>this.updateScroll())},isOpen(){this.isOpen&&(this.filter="",this.highlightIndex=this.$store.options.pages[0]-1)}},mounted(){this.updateFilteredCanvases(),this.$store.rootElement.addEventListener("keydown",this.onKeydown)},beforeUnmount(){this.$store.rootElement.removeEventListener("keydown",this.onKeydown)},methods:{closeDropdown(){this.isOpen=!1},onKeydown(t){if(!Pn(t)){if(t.key==="Escape"){this.closeDropdown();return}t.key==="x"&&(this.toggleDropdown(),t.preventDefault())}},onKeyDownArrow(){this.highlightIndex0&&(this.highlightIndex-=1,this.updateScroll())},setPage(t){this.closeDropdown(),this.$store.setPage(t),this.$store.isMobile()&&this.$store.updateOptions({view:"scan"})},toggleDropdown(){this.isOpen=!this.isOpen,this.isOpen&&this.$nextTick(()=>{this.$refs.search.focus(),this.updateScroll()})},updateFilteredCanvases(){const t=[],n=this.filter.toLowerCase();let e=-1;this.$store.manifest.items.forEach((i,s)=>{const o=this.$store.localize(i.label).toLowerCase().includes(n),l=(s+1).toFixed().includes(n);if(o||l){const a=i;a.page=s+1,a.page===this.$store.options.pages[0]&&(e=t.length),t.push(a)}}),this.highlightIndex=e<0?0:e,this.filteredCanvases=t},updateScroll(){const{list:t}=this.$refs;if(t&&t.children[this.highlightIndex]){const{offsetTop:n}=t.children[this.highlightIndex];t.scrollTop=n-(t.offsetHeight/2-t.children[0].offsetHeight)}}}},Fp={class:"tify-page-select"},Ip=["aria-controls","aria-expanded"],Bp={class:"tify-sr-only"},zp={class:"tify-sr-only"},Np=["id"],Vp={class:"tify-page-select-filter"},Up=["aria-label"],jp={ref:"list",class:"tify-page-select-list"},Wp=["onClick"];function Gp(t,n,e,i,s,r){const o=yn("click-outside");return De((k(),F("div",Fp,[A("button",{type:"button",class:"tify-page-select-button","aria-controls":t.$store.getId("dropdown"),"aria-expanded":s.isOpen?"true":"false",onClick:n[0]||(n[0]=l=>r.toggleDropdown())},[A("span",Bp,Z(t.$translate("Current page:")),1),be(" "+Z(r.currentPageLabel)+" ",1),A("span",zp,"/ "+Z(t.$translate("Toggle page select")),1)],8,Ip),De(A("div",{id:t.$store.getId("dropdown"),key:"dropdown",class:"tify-page-select-dropdown",onClick:n[6]||(n[6]=xt(()=>{},["stop"]))},[A("div",Vp,[De(A("input",{ref:"search","onUpdate:modelValue":n[1]||(n[1]=l=>s.filter=l),"aria-label":t.$translate("Filter pages"),type:"text",class:"tify-page-select-input",onKeyup:n[2]||(n[2]=Vt(l=>s.filteredCanvases[s.highlightIndex]&&t.$store.setPage(s.filteredCanvases[s.highlightIndex].page),["enter"])),onKeydown:[n[3]||(n[3]=Vt(xt(l=>s.filter?s.filter="":r.closeDropdown(),["prevent"]),["esc"])),n[4]||(n[4]=Vt(xt(l=>r.onKeyUpArrow(),["prevent"]),["up"])),n[5]||(n[5]=Vt(xt(l=>r.onKeyDownArrow(),["prevent"]),["down"]))]},null,40,Up),[[wr,s.filter]])]),A("ol",jp,[(k(!0),F(ve,null,Be(s.filteredCanvases,(l,a)=>(k(),F("li",{key:a,class:Te({"-current":t.$store.options.pages.includes(l.page),"-highlighted":s.highlightIndex===a})},[A("a",{href:"javascript:;",onClick:c=>r.setPage(l.page)},Z(t.$store.getPageLabel(l.page,t.$store.localize(l.label))),9,Wp)],2))),128))],512)],8,Np),[[Ze,s.isOpen]])])),[[o,r.closeDropdown]])}const qp=ae(kp,[["render",Gp]]),Zp={directives:{clickOutside:En.directive},props:{fulltextEnabled:Boolean,tocEnabled:Boolean},data(){return{controlsVisible:!1,fullscreenActive:!1,screen:this.$store.rootElement.parentNode}},computed:{fullscreenSupported(){return document.fullscreenElement===null||document.webkitFullscreenElement===null},title(){return this.$store.localize((this.$store.manifest||this.$store.collection||{}).label).replace(/(\S{1,10})\s+(\S{1,10})$/,"$1 $2")}},created(){this.$api.expose(this.setView),this.$api.expose(this.toggleDoublePage),this.$api.expose(this.toggleFullscreen)},mounted(){this.$store.rootElement.addEventListener("keydown",this.onKeyDown),["","moz","webkit"].forEach(n=>{document.addEventListener(`${n}fullscreenchange`,this.toggleFullscreenActive)})},beforeUnmount(){this.$store.rootElement.removeEventListener("keydown",this.onKeyDown)},methods:{closeControlsPopup(){this.controlsVisible=!1},detectFullscreen(){let t;switch(null){case document.fullscreenElement:t=document.fullscreenElement;break;case document.webkitFullscreenElement:t=document.webkitFullscreenElement;break;default:t=!1}return t},onKeyDown(t){if(Pn(t))return;if(t.key==="Escape"){this.controlsVisible=!1;return}switch(t.key){case"Backspace":this.$refs.switchViewSmall.offsetParent&&this.toggleView("scan");break;case"1":this.$store.manifest&&this.fulltextEnabled&&this.toggleView("fulltext");break;case"2":this.$store.manifest&&this.toggleView("thumbnails");break;case"3":this.$store.manifest&&this.tocEnabled&&this.toggleView("toc");break;case"4":this.toggleView("info");break;case"5":this.$store.manifest&&this.toggleView("export");break;case"6":this.$store.collection&&this.toggleView("collection");break;case"7":this.toggleView("help");break;case"b":this.$store.manifest&&this.toggleDoublePage();break;case"f":this.toggleFullscreen();break}if(!this.$store.manifest||this.$store.isCustomPageView)return;const{pages:n}=this.$store.options;switch(t.key){case"q":case",":n[0]>1&&this.$store.goToPreviousPage();break;case"e":case".":this.isLastPage||this.$store.goToNextPage();break;case"Q":n[0]>1&&this.$store.goToFirstPage();break;case"E":this.isLastPage||this.$store.goToLastPage();break}},setView(t){this.$store.updateOptions({view:t})},toggleControlsPopup(){this.controlsVisible=!this.controlsVisible},toggleDoublePage(t){const{pages:n}=this.$store.options;let e;if(n.length>1&&t!==!0||t===!1)e=[n[0]<1?1:n[0]];else if(n[0]<2)e=[0,1];else if(n[0]%2>0)e=[n[0]-1,n[0]];else{const i=n[0]1}]),title:t.$translate("Toggle double-page"),onClick:n[0]||(n[0]=(...L)=>r.toggleDoublePage&&r.toggleDoublePage(...L))},[t.$store.isCustomPageView?(k(),Ce(l,{key:0})):(k(),Ce(a,{key:1}))],10,$p)]),ie(c)],8,Jp)):se("",!0),De((k(),F("nav",{class:"tify-header-column -controls","aria-label":t.$translate("View")},[A("div",tg,[A("button",{type:"button","aria-controls":t.$store.getId("controls"),"aria-expanded":s.controlsVisible?"true":"false","aria-label":t.$translate("View"),class:"tify-header-button",title:t.$translate("View"),onClick:n[1]||(n[1]=(...L)=>r.toggleControlsPopup&&r.toggleControlsPopup(...L))},[ie(h)],8,ig)],512),A("div",{id:t.$store.getId("controls"),class:Te(["tify-header-popup",{"-visible":s.controlsVisible}])},[A("div",sg,[t.$store.manifest?(k(),F("button",{key:0,type:"button",class:Te(["tify-header-button -scan",{"-active":t.$store.options.view==="scan"}]),"aria-controls":t.$store.getId("scan"),"aria-expanded":t.$store.options.view==="scan"?"true":"false",onClick:n[2]||(n[2]=L=>r.toggleView("scan"))},[ie(p),be(" "+Z(t.$translate("Scan")),1)],10,rg)):se("",!0),e.fulltextEnabled?(k(),F("button",{key:1,type:"button",class:Te(["tify-header-button",{"-active":t.$store.options.view==="fulltext"}]),"aria-controls":t.$store.getId("fulltext"),"aria-expanded":t.$store.options.view==="fulltext"?"true":"false",onClick:n[3]||(n[3]=L=>r.toggleView("fulltext"))},[ie(m),be(" "+Z(t.$translate("Fulltext")),1)],10,og)):se("",!0),t.$store.manifest?(k(),F("button",{key:2,type:"button",class:Te(["tify-header-button",{"-active":t.$store.options.view==="thumbnails"}]),"aria-controls":t.$store.getId("thumbnails"),"aria-expanded":t.$store.options.view==="thumbnails"?"true":"false",onClick:n[4]||(n[4]=L=>r.toggleView("thumbnails"))},[ie(l),be(" "+Z(t.$translate("Pages")),1)],10,ag)):se("",!0),e.tocEnabled?(k(),F("button",{key:3,type:"button",class:Te(["tify-header-button",{"-active":t.$store.options.view==="toc"}]),"aria-controls":t.$store.getId("toc"),"aria-expanded":t.$store.options.view==="toc"?"true":"false",onClick:n[5]||(n[5]=L=>r.toggleView("toc"))},[ie(T),be(" "+Z(t.$translate("Contents")),1)],10,lg)):se("",!0),A("button",{type:"button",class:Te(["tify-header-button",{"-active":t.$store.options.view==="info"}]),"aria-controls":t.$store.getId("info"),"aria-expanded":t.$store.options.view==="info"?"true":"false",onClick:n[6]||(n[6]=L=>r.toggleView("info"))},[ie(x),be(" "+Z(t.$translate("Info")),1)],10,cg),t.$store.manifest?(k(),F("button",{key:4,type:"button",class:Te(["tify-header-button",{"-active":t.$store.options.view==="export"}]),"aria-controls":t.$store.getId("export"),"aria-expanded":t.$store.options.view==="export"?"true":"false",onClick:n[7]||(n[7]=L=>r.toggleView("export"))},[ie(E),be(" "+Z(t.$translate("Export")),1)],10,ug)):se("",!0),t.$store.collection?(k(),F("button",{key:5,type:"button",class:Te(["tify-header-button",{"-active":t.$store.options.view==="collection"}]),"aria-controls":t.$store.getId("collection"),"aria-expanded":t.$store.options==="collection"?"true":"false",onClick:n[8]||(n[8]=L=>r.toggleView("collection"))},[ie(R),be(" "+Z(t.$translate("Collection")),1)],10,hg)):se("",!0)]),r.fullscreenSupported?(k(),F("div",fg,[A("button",{type:"button",class:Te(["tify-header-button -icon-only",{"-active":t.$store.options.view==="help"}]),"aria-controls":t.$store.getId("help"),"aria-expanded":t.$store.options.view==="help"?"true":"false",title:t.$translate("Help"),onClick:n[9]||(n[9]=L=>r.toggleView("help"))},[ie(M),be(" "+Z(t.$translate("Help")),1)],10,dg),s.fullscreenActive?(k(),F("button",{key:1,type:"button",class:"tify-header-button -icon-only",title:t.$translate("Exit fullscreen"),onClick:n[11]||(n[11]=(...L)=>r.toggleFullscreen&&r.toggleFullscreen(...L))},[ie(_),be(" "+Z(t.$translate("Exit fullscreen")),1)],8,gg)):(k(),F("button",{key:0,type:"button",class:"tify-header-button -icon-only",title:t.$translate("Fullscreen"),onClick:n[10]||(n[10]=(...L)=>r.toggleFullscreen&&r.toggleFullscreen(...L))},[ie(f),be(" "+Z(t.$translate("Fullscreen")),1)],8,pg))])):se("",!0),t.$store.manifest?(k(),Ce(c,{key:1})):se("",!0)],10,ng)],8,eg)),[[H,r.closeControlsPopup]])])}const vg=ae(Zp,[["render",mg]]),yg={props:{readyPromise:{type:Object,default:null,required:!0}},data(){return{readyToRender:!1}},computed:{hasAnnotations(){var t,n;return(n=(t=this.$store.manifest)==null?void 0:t.items)==null?void 0:n.some(e=>"annotations"in e)},hasToc(){return this.$store.structures.length>0}},created(){this.$api.expose(this.setLanguage),this.$api.expose(this.$store.setPage)},mounted(){if(this.$store.rootElement=this.$el,!this.$store.options.manifestUrl){this.$store.addError('Missing option "manifestUrl"');return}this.updateBreakpoint(),new ResizeObserver(this.updateBreakpoint).observe(this.$el),Promise.all([this.$store.loadManifest(this.$store.options.manifestUrl),this.setLanguage(this.$store.options.language)]).then(()=>{this.readyToRender=!0,this.$nextTick(()=>{Promise.all(this.$store.readyPromises).then(()=>{setTimeout(this.readyPromise.resolve)})})},t=>{this.readyPromise.reject(t)})},beforeUnmount(){clearTimeout(this.$store.urlUpdateTimeout),window.removeEventListener("popstate",this.$store.initOptions)},methods:{setLanguage(t){const n=Cn();if(t==="en")return this.$store.options.language="en",this.$translate.setTranslation(null),n.resolve(t),n;if(this.$store.options.translationsDirUrl===null)return n.reject(new Error("Could not determine translationsDirUrl")),n;const e=`${this.$store.options.translationsDirUrl}/${t}.json`;return this.$store.fetchJson(e).then(i=>{this.$store.options.language=t,this.$translate.setTranslation(i),n.resolve(t)},i=>{const s=i.response?i.response.statusText:i.message;this.$store.addError(`Error loading translation for "${t}": ${s}`),n.resolve(this.$store.options.language)}),n},updateBreakpoint(){Object.keys(this.$store.options.breakpoints).forEach(t=>{this.$el.clientWidth<=this.$store.options.breakpoints[t]?this.$el.classList.add(`-${t}`):this.$el.classList.remove(`-${t}`)}),this.$el.clientHeight<520?this.$el.classList.add("-short"):this.$el.classList.remove("-short")}}},wg={class:"tify",tabindex:"-1"},_g={key:1,class:"tify-main"},Tg={key:2,class:"tify-loading",role:"status"},xg={class:"tify-sr-only"},bg={key:3,class:"tify-error"},Sg=["aria-label"],Eg={class:"tify-error-messages"};function Pg(t,n,e,i,s,r){const o=vg,l=Ff,a=th,c=Zu,h=Bu,p=Mu,m=Jc,T=oc,x=Ml,E=_r;return k(),F("article",wg,[s.readyToRender&&(t.$store.collection||t.$store.manifest)?(k(),Ce(o,{key:0,fulltextEnabled:r.hasAnnotations,tocEnabled:r.hasToc},null,8,["fulltextEnabled","tocEnabled"])):se("",!0),s.readyToRender?(k(),F("div",_g,[t.$store.manifest?(k(),F(ve,{key:0},[ie(l,{id:t.$store.getId("scan")},null,8,["id"]),r.hasAnnotations?De((k(),Ce(a,{key:0,id:t.$store.getId("fulltext")},null,8,["id"])),[[Ze,t.$store.options.view==="fulltext"]]):se("",!0),De(ie(c,{id:t.$store.getId("thumbnails")},null,8,["id"]),[[Ze,t.$store.options.view==="thumbnails"]]),r.hasToc?De((k(),Ce(h,{key:1,id:t.$store.getId("toc")},null,8,["id"])),[[Ze,t.$store.options.view==="toc"]]):se("",!0),De(ie(p,{id:t.$store.getId("export")},null,8,["id"]),[[Ze,t.$store.options.view==="export"]])],64)):se("",!0),t.$store.collection||t.$store.manifest?De((k(),Ce(m,{key:1,id:t.$store.getId("info")},null,8,["id"])),[[Ze,t.$store.options.view==="info"]]):se("",!0),t.$store.collection?De((k(),Ce(T,{key:2,id:t.$store.getId("collection")},null,8,["id"])),[[Ze,t.$store.options.view==="collection"]]):se("",!0),De(ie(x,{id:t.$store.getId("help")},null,8,["id"]),[[Ze,t.$store.options.view==="help"]])])):se("",!0),t.$store.loading?(k(),F("div",Tg,[A("span",xg,Z(t.$translate("Loading")),1)])):se("",!0),t.$store.errors.length?(k(),F("section",bg,[A("button",{type:"button",class:"tify-error-close","aria-label":t.$translate("Dismiss"),onClick:n[0]||(n[0]=R=>t.$store.clearErrors())},[ie(E)],8,Sg),A("div",Eg,[(k(!0),F(ve,null,Be(t.$store.errors,R=>(k(),F("p",{key:R},Z(R),1))),128))])])):se("",!0)])}const Cg=ae(yg,[["render",Pg]]);function Rg(t){return{expose(n,e){t[e||n.name.replace("bound ","")]=n}}}const Lg={install:(t,n)=>{t.config.globalProperties.$api=new Rg(n.instance)}},Hg={install:t=>{let n=null;t.config.globalProperties.$translate=(e,i)=>n&&n[e]?n[e]:i||e,t.config.globalProperties.$translate.setTranslation=e=>{n=e}}};var Og="http://library.stanford.edu/iiif/image-api/compliance.html#level0",Mg="http://library.stanford.edu/iiif/image-api/compliance.html#level1",Lr="http://library.stanford.edu/iiif/image-api/compliance.html#level2",Dg="http://library.stanford.edu/iiif/image-api/conformance.html#level0",Ag="http://library.stanford.edu/iiif/image-api/conformance.html#level1",Hr="http://library.stanford.edu/iiif/image-api/conformance.html#level2",kg="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",Fg="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",Or="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",Ig="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Bg="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",Mr="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",zg="http://iiif.io/api/image/1/level0.json",Ng="http://iiif.io/api/image/1/profiles/level0.json",Vg="http://iiif.io/api/image/1/level1.json",Ug="http://iiif.io/api/image/1/profiles/level1.json",Dr="http://iiif.io/api/image/1/level2.json",Ar="http://iiif.io/api/image/1/profiles/level2.json",jg="http://iiif.io/api/image/2/level0.json",Wg="http://iiif.io/api/image/2/profiles/level0.json",Gg="http://iiif.io/api/image/2/level1.json",qg="http://iiif.io/api/image/2/profiles/level1.json",kr="http://iiif.io/api/image/2/level2.json",Fr="http://iiif.io/api/image/2/profiles/level2.json",Zg="level0",Kg="level1",Ir="level2",Xg="http://iiif.io/api/image/2/level0",Yg="http://iiif.io/api/image/2/level1",Br="http://iiif.io/api/image/2/level2",Jg=[Br,Lr,Hr,Or,Mr,Dr,Ar,kr,Fr,Ir],Qg=[Xg,Yg,Br,Og,Mg,Lr,Dg,Ag,Hr,kg,Fg,Or,Ig,Bg,Mr,zg,Ng,Vg,Ug,Dr,Ar,jg,Wg,Gg,qg,kr,Fr,Zg,Kg,Ir],$g=Qg;function Je(t){for(let n in t)(typeof t[n]>"u"||t[n]===null)&&delete t[n];return t}function em(t){return Array.isArray(t)?t:t?[t]:[]}var tm=Object.defineProperty,im=(t,n,e)=>n in t?tm(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,ds=(t,n,e)=>(im(t,typeof n!="symbol"?n+"":n,e),e),ps=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function nm(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){let n=ps.indexOf(t["@type"]);if(n!==-1)return ps[n]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}var sm=class zr{constructor(n,e={}){ds(this,"traversals"),ds(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...n},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...e}}static all(n){return new zr({collection:[n],manifest:[n],canvas:[n],annotationList:[n],sequence:[n],annotation:[n],contentResource:[n],choice:[n],range:[n],service:[n],layer:[n]})}traverseCollection(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(n))),this.traversals.collection)}traverseCollectionItems(n){if(this.options.mergeMemberProperties){let e=[...(n.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(n.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...n.members||[]];delete n.collections,delete n.manifests,n.members=e}return n.manifests&&(n.manifests=n.manifests.map(e=>this.traverseManifest(typeof e=="string"?{"@id":e,"@type":"sc:Manifest"}:e))),n.collections&&(n.collections=n.collections.map(e=>this.traverseCollection(typeof e=="string"?{"@id":e,"@type":"sc:Collection"}:e))),n.members&&(n.members=n.members.map(e=>typeof e=="string"?e:this.traverseUnknown(e))),n}traverseManifest(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(n))),this.traversals.manifest)}traverseManifestItems(n){return n.sequences&&(n.sequences=n.sequences.map(e=>this.traverseSequence(e))),n.structures&&(n.structures=n.structures.map(e=>this.traverseRange(e))),n}traverseSequence(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(n))),this.traversals.sequence)}traverseSequenceItems(n){return n.canvases&&(n.canvases=n.canvases.map(e=>this.traverseCanvas(e))),n}traverseCanvas(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(n))),this.traversals.canvas)}traverseCanvasItems(n){return n.images&&(n.images=n.images.map(e=>this.traverseAnnotation(e))),n.otherContent&&(n.otherContent=n.otherContent.map(e=>this.traverseAnnotationList(e))),n}traverseRange(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(n))),this.traversals.range)}traverseRangeItems(n){if(this.options.mergeMemberProperties){let e=[...(n.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(n.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...n.members||[]];delete n.ranges,delete n.canvases,n.members=e.length?e.map(i=>this.traverseUnknown(i)):void 0}return n}traverseAnnotationList(n){let e=typeof n=="string"?{"@id":n,"@type":"sc:AnnotationList"}:n;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(e)),this.traversals.annotationList)}traverseAnnotationListItems(n){return n.resources&&(n.resources=n.resources.map(e=>this.traverseAnnotation(e))),n}traverseAnnotation(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(n))),this.traversals.annotation)}traverseAnnotationItems(n){return n.resource&&(Array.isArray(n.resource)?n.resource=n.resource.map(e=>this.traverseContentResource(e)):n.resource=this.traverseContentResource(n.resource)),n.on,n}traverseLayer(n){return this.traverseType(this.traverseLinking(this.traverseLayerItems(n)),this.traversals.layer)}traverseLayerItems(n){return n.otherContent&&(n.otherContent=n.otherContent.map(e=>this.traverseAnnotationList(e))),n}traverseChoice(n){return this.traverseType(this.traverseChoiceItems(n),this.traversals.choice)}traverseChoiceItems(n){return n.default&&n.default!=="rdf:nil"&&(n.default=this.traverseContentResource(n.default)),n.item&&n.item!=="rdf:nil"&&(n.item=n.item.map(e=>this.traverseContentResource(e))),n}traverseService(n){return this.traverseType(this.traverseLinking(n),this.traversals.service)}traverseContentResource(n){return n["@type"]==="oa:Choice"?this.traverseChoice(n):this.traverseType(this.traverseDescriptive(this.traverseLinking(n)),this.traversals.contentResource)}traverseUnknown(n){if(!n["@type"]||typeof n=="string")return n;switch(nm(n)){case"sc:Collection":return this.traverseCollection(n);case"sc:Manifest":return this.traverseManifest(n);case"sc:Canvas":return this.traverseCanvas(n);case"sc:Sequence":return this.traverseSequence(n);case"sc:Range":return this.traverseRange(n);case"oa:Annotation":return this.traverseAnnotation(n);case"sc:AnnotationList":return this.traverseAnnotationList(n);case"sc:Layer":return this.traverseLayer(n);case"Service":return this.traverseService(n);case"oa:Choice":return this.traverseChoice(n);case"ContentResource":return this.traverseContentResource(n)}return n.profile?this.traverseService(n):n}traverseImageResource(n){let e=Array.isArray(n),i=Array.isArray(n)?n:[n],s=[];for(let r of i)typeof r=="string"?s.push(this.traverseContentResource({"@id":r,"@type":"dctypes:Image"})):s.push(this.traverseContentResource(r));return!e&&!this.options.convertPropsToArray?s[0]:s}traverseDescriptive(n){return n.thumbnail&&(n.thumbnail=this.traverseImageResource(n.thumbnail)),n.logo&&(n.logo=this.traverseImageResource(n.logo)),n}traverseOneOrMoreServices(n){let e=Array.isArray(n),i=Array.isArray(n)?n:[n],s=[];for(let r of i)s.push(this.traverseService(r));return!e&&!this.options.convertPropsToArray?s[0]:s}traverseLinking(n){return n.related&&(n.related=this.traverseOneOrManyType(n.related,this.traversals.contentResource)),n.rendering&&(n.rendering=this.traverseOneOrManyType(n.rendering,this.traversals.contentResource)),n.service&&(n.service=this.traverseOneOrMoreServices(n.service)),n.seeAlso&&(n.seeAlso=this.traverseOneOrManyType(n.seeAlso,this.traversals.contentResource)),n.within&&(typeof n.within=="string"||(n.within=this.traverseOneOrManyType(n.within,this.traversals.contentResource))),n.startCanvas&&(typeof n.startCanvas=="string"?n.startCanvas=this.traverseType({"@id":n.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):n.startCanvas&&this.traverseType(n.startCanvas,this.traversals.canvas)),n.contentLayer&&(typeof n.contentLayer=="string"?n.contentLayer=this.traverseLayer({"@id":n.contentLayer,"@type":"sc:Layer"}):n.contentLayer=this.traverseLayer(n.contentLayer)),n}traverseOneOrManyType(n,e){if(!Array.isArray(n))if(this.options.convertPropsToArray)n=[n];else return this.traverseType(n,e);return n.map(i=>this.traverseType(i,e))}traverseType(n,e){return e.reduce((i,s)=>{let r=s(i);return typeof r>"u"&&!this.options.allowUndefinedReturn?i:r},n)}},rm="http://library.stanford.edu/iiif/image-api/compliance.html#level1",om="http://library.stanford.edu/iiif/image-api/compliance.html#level2",am="http://library.stanford.edu/iiif/image-api/conformance.html#level1",lm="http://library.stanford.edu/iiif/image-api/conformance.html#level2",cm="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",um="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",hm="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",fm="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",dm="http://iiif.io/api/image/1/level1.json",pm="http://iiif.io/api/image/1/profiles/level1.json",gm="http://iiif.io/api/image/1/level2.json",mm="http://iiif.io/api/image/1/profiles/level2.json",vm="http://iiif.io/api/image/2/level1.json",ym="http://iiif.io/api/image/2/profiles/level1.json",wm="http://iiif.io/api/image/2/level2.json",_m="http://iiif.io/api/image/2/profiles/level2.json",Tm="level1",xm="level2",bm="http://iiif.io/api/image/2/level1",Sm="http://iiif.io/api/image/2/level2",Em=[bm,Sm,rm,om,am,lm,cm,um,hm,fm,dm,pm,gm,mm,vm,ym,wm,_m,Tm,xm],$i={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function Pm(t){if(typeof t=="string")return[t];if(!t)return[];let n=Array.isArray(t)?t:[t],e=[];for(let i of n){if(typeof i=="string"){e.push(i);continue}e.push({"@language":i["@language"]||i.language,"@value":i["@value"]||i.value})}return e}function bt(t,n="none"){if(!t)return{};let e=Pm(t),i={};for(let s of e){if(typeof s=="string"){i[n]=i[n]?i[n]:[],i[n].push(s||"");continue}if(!s["@language"]){i[n]=i[n]?i[n]:[],i[n].push(s["@value"]||"");continue}let r=s["@language"];i[r]=i[r]?i[r]:[],i[r].push(s["@value"]||"")}return i}function Nr(t){if(Array.isArray(t))return Nr(t.find(n=>typeof n=="string"));if(Jg.indexOf(t)!==-1)return"level2";if(Em.indexOf(t)!==-1)return"level1";if($g.indexOf(t)!==-1)return"level0";if(typeof t=="string")return t}function Cm(t){let n=Array.isArray(t)?t:[t];for(let e of n)switch(e){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function Rm(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function gs(t){for(let n of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${n}:`))return t.slice(n.length+1);return t}var Lm=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Rn(t){let n=t["@id"]||t.id,e=t["@type"]||t.type,i=t.profile||void 0,s=t["@context"]||void 0;if(i){let r=Rm(i);if(r)return r}if(s){let r=Cm(s);if(r)return r}if(e){if(Array.isArray(e)){if(e.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(e.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";e=e[0]}for(let r of["sc","oa","dcterms","dctypes","iiif"])if(e.startsWith(`${r}:`)){e=e.slice(r.length+1);break}switch(e){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(e&&Lm.indexOf(e)!==-1)return e;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return n&&(n.endsWith(".jpg")||n.endsWith(".png")||n.endsWith(".jpeg"))?"Image":e||"unknown"}var Hm=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function Om(t){let n=t.match(Hm);return n?n[0]:t}function Mm(t,n="Rights/License",e="none"){let i=null,s=[],r=Array.isArray(t)?t:[t];for(let o of r){let l=o?Om(o):void 0;if(l&&(l.indexOf("creativecommons.org")!==-1||l.indexOf("rightsstatements.org")!==-1)){l.startsWith("https://")?i=`http://${l.slice(8)}`:i=l;continue}l&&s.push({label:{[e]:[n]},value:{[e]:[l]}})}return[i,s]}var Dm=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function Am(t){if(t){let n=Array.isArray(t)?t:[t],e=[];for(let i of n)i==="http://iiif.io/api/presentation/2/context.json"&&e.push("http://iiif.io/api/presentation/3/context.json"),Dm.indexOf(i)===-1&&e.push(i);if(n.length)return e.length===1?e[0]:e}}function km(t){return t?t.map(n=>({label:bt(n.label),value:bt(n.value)})):[]}var ms=0;function Vr(t,n){let e=encodeURI(t.id||t["@id"]||"").trim();return e&&n?`${e}/${n}`:e||(ms++,`http://example.org/${t["@type"]}${n?`/${n}`:""}/${ms}`)}function it(t){let n=[...t.behavior||[]];t.viewingHint&&n.push(t.viewingHint);let e;return Array.isArray(t.motivation)?e=t.motivation.map(gs):t.motivation&&(e=gs(t.motivation)),{"@context":t["@context"]?Am(t["@context"]):void 0,id:(t["@id"]||Vr(t)).trim(),type:Rn(t),behavior:n.length?n:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:e,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function nt(t){let[n,e]=Mm(t.license),i=[...t.metadata?km(t.metadata):[],...e];return{rights:n,metadata:i.length?i:void 0,label:t.label?bt(t.label):void 0,requiredStatement:t.attribution?{label:bt($i.attributionLabel),value:bt(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?bt(t.description):void 0,thumbnail:Fm(t.thumbnail)}}function Fm(t){return t&&(Array.isArray(t)?t:[t]).map(n=>typeof n=="string"?{id:n,type:"Image"}:(n.type==="unknown"&&(n.type="Image"),n))}function Im(t){if(!t.within)return;let n=Array.isArray(t.within)?t.within:[t.within],e=[];for(let i of n)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":e.push({id:i,type:"Collection"});break}}else i["@id"]&&e.push({id:i["@id"],type:Rn(i)});return e.length?e:void 0}function gt(t){let n=t.related?Array.isArray(t.related)?t.related:[t.related]:[],e=t.contentLayer;return{provider:t.logo||n.length?[{id:$i.providerId,type:"Agent",homepage:n.length?[n[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:bt($i.providerName)}]:void 0,partOf:Im(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?em(t.service):void 0,supplementary:e?[e]:void 0}}function Bm(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function zm(t){return Je({...it(t),...nt(t),...gt(t),items:t.members})}function Nm(t){let n=[],e=[],i;for(let r of t.sequences||[])r.canvases.length&&n.push(...r.canvases),r.behavior&&e.push(...r.behavior),r.startCanvas&&(i=r.startCanvas);let s=it(t);return e.length&&(s.behavior?s.behavior.push(...e):s.behavior=e),Je({...s,...nt(t),...gt(t),start:i,items:n,structures:Vm(t.structures)})}function Vm(t){if(!t)return t;let n=new Map;for(let i of t)n.set(i.id,i);let e=[];for(let i of t)if(i.items){let s=i.items.map(r=>typeof r=="string"?(e.push(r),n.get(r)||r):r&&r.id?(e.push(r.id),n.get(r.id)||r):r);i.items=s}return t.filter(i=>e.indexOf(i.id)===-1)}function Um(t){return Je({...it(t),...nt(t),...gt(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:Vr(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function jm(t){return Je({...it(t),...nt(t),...gt(t),items:t.resources&&t.resources.length?t.resources:void 0})}function Wm(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function Gm(t){function n(e){if(Array.isArray(e)){if(e.length>1)return{type:"List",items:e.map(n)};e=e[0]}if(typeof e=="string")return encodeURI(e).trim();if("@type"in e){let i;if(typeof e.full=="string")i=e.full;else if(e.full["@type"]==="dctypes:Image")i={id:e.full["@id"],type:"Image"};else if(e.full["@type"]==="sc:Canvas")i={id:e.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${e.full["@type"]}`);return{type:"SpecificResource",source:i,selector:en(e.selector)}}else return encodeURI(e["@id"]).trim()}return Je({...it(t),...nt(t),...gt(t),target:n(t.on),body:Array.isArray(t.resource)?t.resource.map(vs):vs(t.resource)})}function vs(t){return t.type==="Choice"?t:Ur(t)}function Ur(t){let n=t;return Je({...it(n),...nt(n),...gt(n),...Bm(n)})}function qm(t){let n=[];return t.default&&t.default!=="rdf:nil"&&n.push(t.default),t.item&&t.item!=="rdf:nil"&&n.push(...t.item),Je({...it(t),...nt(t),items:n})}function Zm(t){return Je({...it(t),...nt(t),...gt(t),items:t.members})}function Km(t){let{"@id":n,"@type":e,"@context":i,profile:s,...r}=t,o={};return n&&(o["@id"]=n),o["@type"]=Rn(t),o["@type"]==="unknown"&&(i&&i.length&&(o["@context"]=i),o["@type"]="Service"),s&&(o.profile=Nr(s)),Je({...o,...r})}function Xm(t){return Je({...it(t),...nt(t),...gt(t)})}var Ym=new sm({collection:[zm],manifest:[Nm],canvas:[Um],annotationList:[jm],sequence:[Wm],annotation:[Gm],contentResource:[Ur],choice:[qm],range:[Zm],service:[Km],layer:[Xm]});function Jm(t){return t&&t["@context"]&&(t["@context"]==="http://iiif.io/api/presentation/2/context.json"||t["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||t["@context"]==="http://www.shared-canvas.org/ns/context.json")||t["@context"]==="http://iiif.io/api/image/2/context.json"?Ym.traverseUnknown(t):t}function en(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[en(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(en)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}var Qm=Jm;function tn(t){const{related:n}=t,e=Qm(t);return n&&t["@context"]==="http://iiif.io/api/presentation/2/context.json"&&[].concat(n).forEach(i=>{e.homepage=e.homepage||[],e.homepage.push(typeof i=="string"?i:{id:i["@id"],label:i.label,format:i.format})}),e}function $m(t){const n=`tify-${Math.floor(Math.random()*Date.now())}`,e=_i({collection:null,errors:[],loading:0,manifest:t.manifest?tn(t.manifest):null,options:t.options||{},readyPromises:[],rootElement:t.rootElement||null,urlUpdateTimeout:null,currentStructure:$e(()=>{if(!(e.manifest.structures instanceof Array))return!1;const i=[];e.options.pages.forEach(l=>{l&&i.push(e.manifest.items[l-1].id)});const{length:s}=e.manifest.structures;let r,o;for(let l=0;li.includes(h.id))){const h=a.items.length;if((h=0?e.manifest.structures[r]:!1}),isCustomPageView:$e(()=>{const{pages:i}=e.options;return i?i.length>2||i.length===2&&(i[0]%2>0||i[1]!==i[0]+1)&&i[1]>0:!1}),isFirstPage:$e(()=>e.options.pages[0]<2),isLastPage:$e(()=>{const{pages:i}=e.options;return i[0]>=e.pageCount||i[i.length-1]>=e.pageCount}),isLastSection:$e(()=>{const{pages:i}=e.options,s=i.length-1;return(i[s]?i[s]:i[s-1])>=e.sections[e.sections.length-1].firstPage}),pageCount:$e(()=>{var i;return(i=e.manifest.items)==null?void 0:i.length}),sections:$e(()=>{const i=[];return e.manifest.structures&&e.manifest.structures.forEach(s=>{if(!s.items){i.push({firstPage:1,lastPage:e.pageCount});return}const r=s.items[0].id,o=e.manifest.items.findIndex(c=>c.id===r)+1,l=s.items[s.items.length-1].id,a=e.manifest.items.findIndex(c=>c.id===l)+1;i.push({firstPage:o,lastPage:a})}),i}),structures:$e(()=>{var a,c;if(!((a=e.manifest)!=null&&a.structures))return[];if(e.manifest.structures.some(h=>h.type==="Range"))return e.manifest.structures.length===1&&((c=e.manifest.structures[0].behavior)!=null&&c.includes("top"))?e.manifest.structures[0].items:e.manifest.structures;const i=[],s=e.manifest.items,r=e.manifest.structures.length;for(let h=0;hx.id===m)+1;const T=p.items.at(-1).id;if(p.lastPage=s.findIndex(x=>x.id===T)+1,!s[p.firstPage-1])continue}else s!=null&&s[0]&&(p.firstPage=1,p.lastPage=e.pageCount);p.level=0,p.pageCount=p.lastPage-p.firstPage+1,i.push(p)}let o=0;for(let h=0;h=p.firstPage&&T.lastPage<=p.lastPage&&(p.items=(p.items||[]).filter(x=>x.label),p.items.push(T),T.level+=1,o=Math.max(o,T.level))}}const l=(h,p=0)=>{for(let m=0;mp?h.splice(m,1):T.items&&l(T.items,p+1)}};for(let h=0;h(e.loading=0,Promise.reject(o)))).json().catch(o=>(e.loading=0,Promise.reject(o)));return e.loading>0&&(e.loading-=1),r},async fetchText(i){e.loading+=1;const r=await(await fetch(i).catch(o=>(e.loading=0,Promise.reject(o)))).text().catch(o=>(e.loading=0,Promise.reject(o)));return e.loading>0&&(e.loading-=1),r},getId(i){return n+(i?`-${i}`:"")},getPageLabel(i,s){return e.options.pageLabelFormat.replace("P",i).replace("L",s)},getStartPage(){if(!e.manifest.start||!e.manifest.items)return 1;const i=e.manifest.items.findIndex(s=>s.id===e.manifest.start.id);return i>=0?i+1:1},goToFirstPage(){e.setPage(1)},goToNextPage(){let i=e.options.pages[0]+1;e.options.pages.length>1&&i%2>0&&i=this.sections[o].firstPage||r&&r>=this.sections[o].firstPage;)o+=1;e.setPage(this.sections[o].firstPage)},goToLastPage(){e.setPage(e.pageCount)},goToPreviousPage(){let i=e.options.pages[0]-1;e.options.pages.length>1&&i%2>0&&i>0&&(i-=1),e.setPage(i)},goToPreviousSection(){const{pages:i}=e.options,s=i[0]?i[0]:i[1];let r=this.sections.length-1;for(;s<=this.sections[r].firstPage||s&&s<=this.sections[r].firstPage;)r-=1;e.setPage(this.sections[r].firstPage)},initOptions(i){let s={};if(e.options.urlQueryKey)try{const r=new URLSearchParams(window.location.search);s=JSON.parse(r.get(e.options.urlQueryKey))||{}}catch{}s.view===""&&e.isMobile()&&(s.view="scan"),s.pages&&!hs(s.pages,e.pageCount)&&(e.addError("Invalid pages, reset to start page"),s.pages=null),e.options.childManifestUrl=s.childManifestUrl||e.options.childManifestUrl,e.options.filters=s.filters||e.options.filters,e.options.pages=i&&i.type==="popstate"?s.pages||[e.getStartPage()]:s.pages||e.options.pages||[e.getStartPage()],e.options.pan=s.panX||s.panY?{x:s.panX,y:s.panY}:s.pan||e.options.pan,e.options.rotation=parseInt(s.rotation,10)||e.options.rotation,e.options.view=s.view||s.view===""?s.view:e.options.view,e.options.zoom=parseFloat(s.zoom)||e.options.zoom},isMobile(){return e.rootElement.offsetWidth{const l=tn(o);if(s.expectedType&&l.type!==s.expectedType){const c=`Expected manifest of type ${s.expectedType}, but got ${l.type}`;return e.addError(c),r.reject(c),r}if(e.manifest=null,await Us(),l.type==="Manifest")return e.manifest=l,e.initOptions(),window.addEventListener("popstate",e.initOptions),s.reset&&e.updateOptions({childManifestUrl:i,pages:[e.getStartPage()],pan:{},rotation:null,view:e.isMobile()?"scan":"collection",zoom:null}),r.resolve(),r;if(l.type==="Collection"){e.collection=l;const c=new URLSearchParams(window.location.search);let h={};try{h=JSON.parse(c.get(e.options.urlQueryKey))||{}}catch{}let p="";if(e.options.urlQueryParams.includes("childManifestUrl")&&h.childManifestUrl?p=h.childManifestUrl:e.collection.manifests&&e.options.childManifestAutoloaded&&(p=e.collection.manifests[0].id),p)await e.loadManifest(p,{expectedType:"Manifest"}),e.updateOptions({childManifestUrl:p});else{const m=h.view||e.options.view;e.updateOptions({view:["collection","help","info"].includes(m)?m:"collection"})}return r.resolve(),r}const a="Please provide a valid IIIF Presentation API manifest";return e.addError(a),r.reject(a),r},o=>{const a=`Error loading IIIF manifest: ${o.response&&(o.response.statusText||o.response.data)||o.message}`;return e.addError(a),r.reject(a),r})},localize(i){const r=" · ";if(!e.options.language)throw new Error("language not set");if(!i)return"";if(typeof i=="string")return i;const o=i[e.options.language]||i[e.options.fallbackLanguage]||Object.values(i)[0];return((o instanceof Array?o.join(r):o)||"").trim()||"—"},setPage(i){let s=i;if(i instanceof Array||(s=[i]),!hs(s,e.pageCount))throw new RangeError("Invalid pages");if(s.length===1&&e.options.pages&&e.options.pages[0]%2<1&&(e.options.pages[1]===e.options.pages[0]+1||e.options.pages[1]===0)){const r=s[0]%2>0?s[0]-1:s[0];s=[r,r===e.pageCount?0:r+1]}return e.updateOptions({pages:s}),s},updateOptions(i){Object.assign(e.options,i),clearTimeout(e.urlUpdateTimeout),e.options.urlQueryKey&&(e.urlUpdateTimeout=setTimeout(()=>{const s={};e.options.urlQueryParams.forEach(o=>{const l=e.options[o];l===null||o==="pages"&&l.length<2&&l[0]<2||typeof l=="object"&&!Object.keys(l).length?delete s[o]:s[o]=e.options[o]});const r=new URL(window.location);Object.keys(s).length?r.searchParams.set(e.options.urlQueryKey,JSON.stringify(s)):r.searchParams.delete(e.options.urlQueryKey),window.history&&(i.pages?(e.clearErrors(),window.history.pushState({},"",r)):window.history.replaceState({},"",r))},100))}});return e}const ev={convertManifest:tn,install:(t,n={})=>{t.config.globalProperties.$store=new $m(n)}};window.Tify=function(n={}){const e={breakpoints:{tiny:359,small:719,medium:959,large:1199},childManifestAutoloaded:!0,childManifestUrl:null,container:null,fallbackLanguage:"en",filters:{},language:"en",manifestUrl:null,optionsResetOnPageChange:["pan"],pageLabelFormat:"P : L",pages:null,pan:{},rotation:null,translationsDirUrl:null,urlQueryKey:null,urlQueryParams:["childManifestUrl","filters","pages","pan","rotation","view","zoom"],view:"",viewer:{},zoom:null};if(this.options={...e,...n},!this.options.translationsDirUrl){const l=[...document.getElementsByTagName("script")].find(a=>a.src.includes("/tify"));if(l){const{src:a}=l;this.options.translationsDirUrl=`${a.substring(0,a.lastIndexOf("/"))}/translations`}}let i=null;this.ready=new Promise((o,l)=>{i={resolve:o,reject:l}});const s=this;this.app=hl({render:()=>Ia(Cg,{readyPromise:i})}).use(Lg,{instance:s}).use(Hg).use(ev,{options:this.options});let r=!1;this.mount=o=>{if(r)throw new Error("TIFY is already mounted");const l=typeof o=="string"?document.querySelector(o):o;if(!l)throw new Error("Container element not found");window.getComputedStyle(l).position==="static"&&(l.style.position="relative"),this.app.mount(l),r=!0},this.destroy=()=>{this.app.unmount()},this.options.container&&this.mount(this.options.container)}; +function n(e){return new n.Viewer(e)}(function(e){e.version={versionStr:"3.0.0",major:parseInt("3",10),minor:parseInt("0",10),revision:parseInt("0",10)};var i={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},s=Object.prototype.toString,r=Object.prototype.hasOwnProperty;e.isFunction=function(o){return e.type(o)==="function"},e.isArray=Array.isArray||function(o){return e.type(o)==="array"},e.isWindow=function(o){return o&&typeof o=="object"&&"setInterval"in o},e.type=function(o){return o==null?String(o):i[s.call(o)]||"object"},e.isPlainObject=function(o){if(!o||n.type(o)!=="object"||o.nodeType||e.isWindow(o)||o.constructor&&!r.call(o,"constructor")&&!r.call(o.constructor.prototype,"isPrototypeOf"))return!1;var l;for(var a in o)l=a;return l===void 0||r.call(o,l)},e.isEmptyObject=function(o){for(var l in o)return!1;return!0},e.freezeObject=function(o){return Object.freeze?e.freezeObject=Object.freeze:e.freezeObject=function(l){return l},e.freezeObject(o)},e.supportsCanvas=function(){var o=document.createElement("canvas");return!!(e.isFunction(o.getContext)&&o.getContext("2d"))}(),e.isCanvasTainted=function(o){var l=!1;try{o.getContext("2d").getImageData(0,0,1,1)}catch{l=!0}return l},e.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),e.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),e.supportsEventListenerOptions=function(){var o=0;if(e.supportsAddEventListener)try{var l={get capture(){return o++,!1},get once(){return o++,!1},get passive(){return o++,!1}};window.addEventListener("test",null,l),window.removeEventListener("test",null,l)}catch{o=0}return o>=3}(),e.getCurrentPixelDensityRatio=function(){if(e.supportsCanvas){var o=document.createElement("canvas").getContext("2d"),l=window.devicePixelRatio||1,a=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;return Math.max(l,1)/a}else return 1},e.pixelDensityRatio=e.getCurrentPixelDensityRatio()})(n),function(e){e.extend=function(){var a,c,h,p,m,T,x=arguments[0]||{},S=arguments.length,C=!1,A=1;for(typeof x=="boolean"&&(C=x,x=arguments[1]||{},A=2),typeof x!="object"&&!n.isFunction(x)&&(x={}),S===A&&(x=this,--A);A=h.x&&c.x=h.y},getMousePosition:function(a){if(typeof a.pageX=="number")e.getMousePosition=function(c){var h=new e.Point;return h.x=c.pageX,h.y=c.pageY,h};else if(typeof a.clientX=="number")e.getMousePosition=function(c){var h=new e.Point;return h.x=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,h.y=c.clientY+document.body.scrollTop+document.documentElement.scrollTop,h};else throw new Error("Unknown event mouse position, no known technique.");return e.getMousePosition(a)},getPageScroll:function(){var a=document.documentElement||{},c=document.body||{};if(typeof window.pageXOffset=="number")e.getPageScroll=function(){return new e.Point(window.pageXOffset,window.pageYOffset)};else if(c.scrollLeft||c.scrollTop)e.getPageScroll=function(){return new e.Point(document.body.scrollLeft,document.body.scrollTop)};else if(a.scrollLeft||a.scrollTop)e.getPageScroll=function(){return new e.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new e.Point(0,0);return e.getPageScroll()},setPageScroll:function(a){if(typeof window.scrollTo<"u")e.setPageScroll=function(p){window.scrollTo(p.x,p.y)};else{var c=e.getPageScroll();if(c.x===a.x&&c.y===a.y)return;document.body.scrollLeft=a.x,document.body.scrollTop=a.y;var h=e.getPageScroll();if(h.x!==c.x&&h.y!==c.y){e.setPageScroll=function(p){document.body.scrollLeft=p.x,document.body.scrollTop=p.y};return}if(document.documentElement.scrollLeft=a.x,document.documentElement.scrollTop=a.y,h=e.getPageScroll(),h.x!==c.x&&h.y!==c.y){e.setPageScroll=function(p){document.documentElement.scrollLeft=p.x,document.documentElement.scrollTop=p.y};return}e.setPageScroll=function(p){}}e.setPageScroll(a)},getWindowSize:function(){var a=document.documentElement||{},c=document.body||{};if(typeof window.innerWidth=="number")e.getWindowSize=function(){return new e.Point(window.innerWidth,window.innerHeight)};else if(a.clientWidth||a.clientHeight)e.getWindowSize=function(){return new e.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(c.clientWidth||c.clientHeight)e.getWindowSize=function(){return new e.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return e.getWindowSize()},makeCenteredNode:function(a){a=e.getElement(a);var c=[e.makeNeutralElement("div"),e.makeNeutralElement("div"),e.makeNeutralElement("div")];return e.extend(c[0].style,{display:"table",height:"100%",width:"100%"}),e.extend(c[1].style,{display:"table-row"}),e.extend(c[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),c[0].appendChild(c[1]),c[1].appendChild(c[2]),c[2].appendChild(a),c[0]},makeNeutralElement:function(a){var c=document.createElement(a),h=c.style;return h.background="transparent none",h.border="none",h.margin="0px",h.padding="0px",h.position="static",c},now:function(){return Date.now?e.now=Date.now:e.now=function(){return new Date().getTime()},e.now()},makeTransparentImage:function(a){var c=e.makeNeutralElement("img");return c.src=a,c},setElementOpacity:function(a,c,h){var p,m;a=e.getElement(a),h&&!e.Browser.alpha&&(c=Math.round(c)),e.Browser.opacity?a.style.opacity=c<1?c:"":c<1?(p=Math.round(100*c),m="alpha(opacity="+p+")",a.style.filter=m):a.style.filter=""},setElementTouchActionNone:function(a){a=e.getElement(a),typeof a.style.touchAction<"u"?a.style.touchAction="none":typeof a.style.msTouchAction<"u"&&(a.style.msTouchAction="none")},setElementPointerEvents:function(a,c){a=e.getElement(a),typeof a.style.pointerEvents<"u"&&(a.style.pointerEvents=c)},setElementPointerEventsNone:function(a){e.setElementPointerEvents(a,"none")},addClass:function(a,c){a=e.getElement(a),a.className?(" "+a.className+" ").indexOf(" "+c+" ")===-1&&(a.className+=" "+c):a.className=c},indexOf:function(a,c,h){return Array.prototype.indexOf?this.indexOf=function(p,m,T){return p.indexOf(m,T)}:this.indexOf=function(p,m,T){var x,S=T||0,C;if(!p)throw new TypeError;if(C=p.length,C===0||S>=C)return-1;for(S<0&&(S=C-Math.abs(S)),x=S;x=200&&S.status<300||S.status===0&&x!=="http:"&&x!=="https:"?c(S):(e.console.log("AJAX request returned %d: %s",S.status,a),e.isFunction(h)&&h(S)))};try{if(S.open("GET",a,!0),T&&(S.responseType=T),m)for(var C in m)Object.prototype.hasOwnProperty.call(m,C)&&m[C]&&S.setRequestHeader(C,m[C]);p&&(S.withCredentials=!0),S.send(null)}catch(A){e.console.log("%s while making AJAX request: %s",A.name,A.message),S.onreadystatechange=function(){},e.isFunction(h)&&h(S,A)}return S},jsonp:function(a){var c,h=a.url,p=document.head||document.getElementsByTagName("head")[0]||document.documentElement,m=a.callbackName||"openseadragon"+e.now(),T=window[m],x="$1"+m+"$2",S=a.param||"callback",C=a.callback;h=h.replace(/(=)\?(&|$)|\?\?/i,x),h+=(/\?/.test(h)?"&":"?")+S+"="+m,window[m]=function(A){if(T)window[m]=T;else try{delete window[m]}catch{}C&&e.isFunction(C)&&C(A)},c=document.createElement("script"),(a.async!==void 0||a.async!==!1)&&(c.async="async"),a.scriptCharset&&(c.charset=a.scriptCharset),c.src=h,c.onload=c.onreadystatechange=function(A,f){(f||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,p&&c.parentNode&&p.removeChild(c),c=void 0)},p.insertBefore(c,p.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(a){if(window.DOMParser)e.parseXml=function(c){var h=null,p;return p=new DOMParser,h=p.parseFromString(c,"text/xml"),h};else if(window.ActiveXObject)e.parseXml=function(c){var h=null;return h=new ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(c),h};else throw new Error("Browser doesn't support XML DOM.");return e.parseXml(a)},parseJSON:function(a){return e.parseJSON=window.JSON.parse,e.parseJSON(a)},imageFormatSupported:function(a){return a=a||"",!!r[a.toLowerCase()]},setImageFormatsSupported:function(a){e.extend(r,a)}});var s=function(a){};e.console=window.console||{log:s,debug:s,info:s,warn:s,error:s,assert:s},e.Browser={vendor:e.BROWSERS.UNKNOWN,version:0,alpha:!0};var r={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},o={};(function(){var a=navigator.appVersion,c=navigator.userAgent,h;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(c.substring(c.indexOf("MSIE")+5,c.indexOf(";",c.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(c.indexOf("Edge")>=0?(e.Browser.vendor=e.BROWSERS.EDGE,e.Browser.version=parseFloat(c.substring(c.indexOf("Edge")+5))):c.indexOf("Edg")>=0?(e.Browser.vendor=e.BROWSERS.CHROMEEDGE,e.Browser.version=parseFloat(c.substring(c.indexOf("Edg")+4))):c.indexOf("Firefox")>=0?(e.Browser.vendor=e.BROWSERS.FIREFOX,e.Browser.version=parseFloat(c.substring(c.indexOf("Firefox")+8))):c.indexOf("Safari")>=0?(e.Browser.vendor=c.indexOf("Chrome")>=0?e.BROWSERS.CHROME:e.BROWSERS.SAFARI,e.Browser.version=parseFloat(c.substring(c.substring(0,c.indexOf("Safari")).lastIndexOf("/")+1,c.indexOf("Safari")))):(h=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),h.exec(c)!==null&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":e.Browser.vendor=e.BROWSERS.OPERA,e.Browser.version=parseFloat(a);break}var p=window.location.search.substring(1),m=p.split("&"),T,x,S;for(S=0;S0){var C=T.substring(0,x),A=T.substring(x+1);try{o[C]=decodeURIComponent(A)}catch{e.console.error("Ignoring malformed URL parameter: %s=%s",C,A)}}e.Browser.alpha=!(e.Browser.vendor===e.BROWSERS.CHROME&&e.Browser.version<2),e.Browser.opacity=!0,e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version<11&&e.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(a){var c=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,h=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame;if(c&&h)e.requestAnimationFrame=function(){return c.apply(a,arguments)},e.cancelAnimationFrame=function(){return h.apply(a,arguments)};else{var p=[],m=[],T=0,x;e.requestAnimationFrame=function(S){return p.push([++T,S]),x||(x=setInterval(function(){if(p.length){var C=e.now(),A=m;for(m=p,p=A;m.length;)m.shift()[1](C)}else clearInterval(x),x=void 0},1e3/50)),T},e.cancelAnimationFrame=function(S){var C,A;for(C=0,A=p.length;C8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",e.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",e.MouseTracker.wheelEventName],e.MouseTracker.wheelEventName==="DOMMouseScroll"&&e.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),e.MouseTracker.havePointerCapture=function(){var g=document.createElement("div");return e.isFunction(g.setPointerCapture)&&e.isFunction(g.releasePointerCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(e.MouseTracker.havePointerEvents=!1,e.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),e.MouseTracker.mousePointerId="legacy-mouse",e.MouseTracker.havePointerCapture=function(){var g=document.createElement("div");return e.isFunction(g.setCapture)&&e.isFunction(g.releaseCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&e.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&e.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),e.MouseTracker.GesturePointList=function(g){this._gPoints=[],this.type=g,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},e.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(g){return this._gPoints.push(g)},removeById:function(g){var d,y=this._gPoints.length;for(d=0;d1&&(this.type==="mouse"||this.type==="pen")&&(e.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(e.console.warn("GesturePointList.removeContact() Implausible contacts value"),this.contacts=0)}};function o(g){var d=i[g.hash],y,w,F,j,ne,he=d.activePointersLists.length;for(y=0;y0){for(ne=[],j=F.asArray(),w=0;wd.touches.length-F&&e.console.warn("Tracked touch contact count doesn't match event.touches.length");var he={originalEvent:d,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(R(g,he),w=0;w0&&d.removeContact(),w=d.removeById(y.id)):w=d.getLength(),w}function L(g,d){switch(d.eventType){case"pointermove":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasGestureHandlers,d.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!1,d.stopPropagation=!1;break;case"pointerdown":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasGestureHandlers,d.stopPropagation=!1;break;case"pointerup":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasGestureHandlers,d.stopPropagation=!1;break;case"wheel":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!1,d.preventGesture=!g.hasScrollHandler,d.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":d.isStoppable=!0,d.isCancelable=!1,d.preventDefault=!1,d.preventGesture=!1,d.stopPropagation=!1;break;case"click":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!!g.clickHandler,d.preventGesture=!1,d.stopPropagation=!1;break;case"dblclick":d.isStoppable=!0,d.isCancelable=!0,d.preventDefault=!!g.dblClickHandler,d.preventGesture=!1,d.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:d.isStoppable=!1,d.isCancelable=!1,d.preventDefault=!1,d.preventGesture=!1,d.stopPropagation=!1;break}}function R(g,d){d.eventSource=g,d.eventPhase=d.originalEvent&&typeof d.originalEvent.eventPhase<"u"?d.originalEvent.eventPhase:0,d.defaultPrevented=e.eventIsCanceled(d.originalEvent),d.shouldCapture=!1,d.shouldReleaseCapture=!1,d.userData=g.userData,L(g,d),g.preProcessEventHandler&&g.preProcessEventHandler(d)}function B(g,d,y){var w=g.getActivePointersListByType(d.type),F=w.getById(d.id);F?y&&!F.captured?(F.captured=!0,w.captureCount++):!y&&F.captured&&(F.captured=!1,w.captureCount--,w.captureCount<0&&(w.captureCount=0,e.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):e.console.warn("updatePointerCaptured() called on untracked pointer")}function k(g,d,y){var w=g.getActivePointersListByType(y.type),F;F=w.getById(y.id),F?(F.insideElement=!0,F.lastPos=F.currentPos,F.lastTime=F.currentTime,F.currentPos=y.currentPos,F.currentTime=y.currentTime,y=F):(y.captured=!1,y.insideElementPressed=!1,y.insideElement=!0,v(w,y)),g.enterHandler&&g.enterHandler({eventSource:g,pointerType:y.type,position:A(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData})}function N(g,d,y){var w=g.getActivePointersListByType(y.type),F,j;F=w.getById(y.id),F?(F.captured?(F.insideElement=!1,F.lastPos=F.currentPos,F.lastTime=F.currentTime,F.currentPos=y.currentPos,F.currentTime=y.currentTime):b(g,w,F),y=F):(y.captured=!1,y.insideElementPressed=!1),(g.leaveHandler||g.exitHandler)&&(j={eventSource:g,pointerType:y.type,position:y.currentPos&&A(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData},g.leaveHandler&&g.leaveHandler(j),g.exitHandler&&g.exitHandler(j))}function z(g,d,y){var w,F;w=g.getActivePointersListByType(y.type),F=w.getById(y.id),F?y=F:(y.captured=!1,y.insideElementPressed=!1),g.overHandler&&g.overHandler({eventSource:g,pointerType:y.type,position:A(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData})}function U(g,d,y){var w,F;w=g.getActivePointersListByType(y.type),F=w.getById(y.id),F?y=F:(y.captured=!1,y.insideElementPressed=!1),g.outHandler&&g.outHandler({eventSource:g,pointerType:y.type,position:y.currentPos&&A(y.currentPos,g.element),buttons:w.buttons,pointers:g.getActivePointerCount(),insideElementPressed:y.insideElementPressed,buttonDownAny:w.buttons!==0,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData})}function G(g,d,y,w){var F=i[g.hash],j=g.getActivePointersListByType(y.type),ne;if(typeof d.originalEvent.buttons<"u"?j.buttons=d.originalEvent.buttons:w===0?j.buttons|=1:w===1?j.buttons|=4:w===2?j.buttons|=2:w===3?j.buttons|=8:w===4?j.buttons|=16:w===5&&(j.buttons|=32),w!==0){d.shouldCapture=!1,d.shouldReleaseCapture=!1,g.nonPrimaryPressHandler&&!d.preventGesture&&!d.defaultPrevented&&(d.preventDefault=!0,g.nonPrimaryPressHandler({eventSource:g,pointerType:y.type,position:A(y.currentPos,g.element),button:w,buttons:j.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}));return}if(ne=j.getById(y.id),ne)ne.insideElementPressed=!0,ne.insideElement=!0,ne.originalTarget=d.originalEvent.target,ne.contactPos=y.currentPos,ne.contactTime=y.currentTime,ne.lastPos=ne.currentPos,ne.lastTime=ne.currentTime,ne.currentPos=y.currentPos,ne.currentTime=y.currentTime,y=ne;else{e.console.warn("pointerdown event on untracked pointer"),y.captured=!1,y.insideElementPressed=!0,y.insideElement=!0,y.originalTarget=d.originalEvent.target,v(j,y);return}j.addContact(),!d.preventGesture&&!d.defaultPrevented?(d.shouldCapture=!0,d.shouldReleaseCapture=!1,d.preventDefault=!0,(g.dragHandler||g.dragEndHandler||g.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.addPoint(g,y),j.contacts===1?g.pressHandler&&!d.preventGesture&&g.pressHandler({eventSource:g,pointerType:y.type,position:A(y.contactPos,g.element),buttons:j.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}):j.contacts===2&&g.pinchHandler&&y.type==="touch"&&(F.pinchGPoints=j.asArray(),F.lastPinchDist=F.currentPinchDist=F.pinchGPoints[0].currentPos.distanceTo(F.pinchGPoints[1].currentPos),F.lastPinchCenter=F.currentPinchCenter=f(F.pinchGPoints[0].currentPos,F.pinchGPoints[1].currentPos))):(d.shouldCapture=!1,d.shouldReleaseCapture=!1)}function X(g,d,y,w){var F=i[g.hash],j=g.getActivePointersListByType(y.type),ne,he,Q,Le=!1,Ce;if(typeof d.originalEvent.buttons<"u"?j.buttons=d.originalEvent.buttons:w===0?j.buttons^=-2:w===1?j.buttons^=-5:w===2?j.buttons^=-3:w===3?j.buttons^=-9:w===4?j.buttons^=-17:w===5&&(j.buttons^=-33),d.shouldCapture=!1,w!==0){d.shouldReleaseCapture=!1,g.nonPrimaryReleaseHandler&&!d.preventGesture&&!d.defaultPrevented&&(d.preventDefault=!0,g.nonPrimaryReleaseHandler({eventSource:g,pointerType:y.type,position:A(y.currentPos,g.element),button:w,buttons:j.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}));return}Q=j.getById(y.id),Q?(j.removeContact(),Q.captured&&(Le=!0),Q.lastPos=Q.currentPos,Q.lastTime=Q.currentTime,Q.currentPos=y.currentPos,Q.currentTime=y.currentTime,Q.insideElement||b(g,j,Q),ne=Q.currentPos,he=Q.currentTime):(e.console.warn("updatePointerUp(): pointerup on untracked gPoint"),y.captured=!1,y.insideElementPressed=!1,y.insideElement=!0,v(j,y),Q=y),!d.preventGesture&&!d.defaultPrevented&&(Le?(d.shouldReleaseCapture=!0,d.preventDefault=!0,(g.dragHandler||g.dragEndHandler||g.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.removePoint(g,Q),j.contacts===0?(g.releaseHandler&&g.releaseHandler({eventSource:g,pointerType:Q.type,position:A(ne,g.element),buttons:j.buttons,insideElementPressed:Q.insideElementPressed,insideElementReleased:Q.insideElement,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),g.dragEndHandler&&F.sentDragEvent&&g.dragEndHandler({eventSource:g,pointerType:Q.type,position:A(Q.currentPos,g.element),speed:Q.speed,direction:Q.direction,shift:d.originalEvent.shiftKey,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),F.sentDragEvent=!1,(g.clickHandler||g.dblClickHandler)&&Q.insideElement&&(Ce=he-Q.contactTime<=g.clickTimeThreshold&&Q.contactPos.distanceTo(ne)<=g.clickDistThreshold,g.clickHandler&&g.clickHandler({eventSource:g,pointerType:Q.type,position:A(Q.currentPos,g.element),quick:Ce,shift:d.originalEvent.shiftKey,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,originalTarget:Q.originalTarget,userData:g.userData}),g.dblClickHandler&&Ce&&(j.clicks++,j.clicks===1?(F.lastClickPos=ne,F.dblClickTimeOut=setTimeout(function(){j.clicks=0},g.dblClickTimeThreshold)):j.clicks===2&&(clearTimeout(F.dblClickTimeOut),j.clicks=0,F.lastClickPos.distanceTo(ne)<=g.dblClickDistThreshold&&g.dblClickHandler({eventSource:g,pointerType:Q.type,position:A(Q.currentPos,g.element),shift:d.originalEvent.shiftKey,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),F.lastClickPos=null)))):j.contacts===2&&g.pinchHandler&&Q.type==="touch"&&(F.pinchGPoints=j.asArray(),F.lastPinchDist=F.currentPinchDist=F.pinchGPoints[0].currentPos.distanceTo(F.pinchGPoints[1].currentPos),F.lastPinchCenter=F.currentPinchCenter=f(F.pinchGPoints[0].currentPos,F.pinchGPoints[1].currentPos))):(d.shouldReleaseCapture=!1,g.releaseHandler&&(g.releaseHandler({eventSource:g,pointerType:Q.type,position:A(ne,g.element),buttons:j.buttons,insideElementPressed:Q.insideElementPressed,insideElementReleased:Q.insideElement,isTouchEvent:Q.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),d.preventDefault=!0)))}function K(g,d,y){var w=i[g.hash],F=g.getActivePointersListByType(y.type),j,ne,he;if(typeof d.originalEvent.buttons<"u"&&(F.buttons=d.originalEvent.buttons),j=F.getById(y.id),j)j.lastPos=j.currentPos,j.lastTime=j.currentTime,j.currentPos=y.currentPos,j.currentTime=y.currentTime;else return;d.shouldCapture=!1,d.shouldReleaseCapture=!1,g.stopHandler&&y.type==="mouse"&&(clearTimeout(g.stopTimeOut),g.stopTimeOut=setTimeout(function(){pe(g,d.originalEvent,y.type)},g.stopDelay)),F.contacts===0?g.moveHandler&&g.moveHandler({eventSource:g,pointerType:y.type,position:A(y.currentPos,g.element),buttons:F.buttons,isTouchEvent:y.type==="touch",originalEvent:d.originalEvent,userData:g.userData}):F.contacts===1?(g.moveHandler&&(j=F.asArray()[0],g.moveHandler({eventSource:g,pointerType:j.type,position:A(j.currentPos,g.element),buttons:F.buttons,isTouchEvent:j.type==="touch",originalEvent:d.originalEvent,userData:g.userData})),g.dragHandler&&!d.preventGesture&&!d.defaultPrevented&&(j=F.asArray()[0],he=j.currentPos.minus(j.lastPos),g.dragHandler({eventSource:g,pointerType:j.type,position:A(j.currentPos,g.element),buttons:F.buttons,delta:he,speed:j.speed,direction:j.direction,shift:d.originalEvent.shiftKey,isTouchEvent:j.type==="touch",originalEvent:d.originalEvent,userData:g.userData}),d.preventDefault=!0,w.sentDragEvent=!0)):F.contacts===2&&(g.moveHandler&&(ne=F.asArray(),g.moveHandler({eventSource:g,pointerType:ne[0].type,position:A(f(ne[0].currentPos,ne[1].currentPos),g.element),buttons:F.buttons,isTouchEvent:ne[0].type==="touch",originalEvent:d.originalEvent,userData:g.userData})),g.pinchHandler&&y.type==="touch"&&!d.preventGesture&&!d.defaultPrevented&&(he=w.pinchGPoints[0].currentPos.distanceTo(w.pinchGPoints[1].currentPos),he!==w.currentPinchDist&&(w.lastPinchDist=w.currentPinchDist,w.currentPinchDist=he,w.lastPinchCenter=w.currentPinchCenter,w.currentPinchCenter=f(w.pinchGPoints[0].currentPos,w.pinchGPoints[1].currentPos),g.pinchHandler({eventSource:g,pointerType:"touch",gesturePoints:w.pinchGPoints,lastCenter:A(w.lastPinchCenter,g.element),center:A(w.currentPinchCenter,g.element),lastDistance:w.lastPinchDist,distance:w.currentPinchDist,shift:d.originalEvent.shiftKey,originalEvent:d.originalEvent,userData:g.userData}),d.preventDefault=!0)))}function te(g,d,y){var w=g.getActivePointersListByType(y.type),F;F=w.getById(y.id),F&&b(g,w,F)}function pe(g,d,y){g.stopHandler&&g.stopHandler({eventSource:g,pointerType:y,position:C(d,g.element),buttons:g.getActivePointersListByType(y).buttons,isTouchEvent:y==="touch",originalEvent:d,userData:g.userData})}}(n),function(e){e.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},e.Control=function(i,s,r){var o=i.parentNode;typeof s=="number"&&(e.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),s={anchor:s}),s.attachToViewer=typeof s.attachToViewer>"u"?!0:s.attachToViewer,this.autoFade=typeof s.autoFade>"u"?!0:s.autoFade,this.element=i,this.anchor=s.anchor,this.container=r,this.anchor===e.ControlAnchor.ABSOLUTE?(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof s.top=="number"?s.top+"px":s.top,this.wrapper.style.left=typeof s.left=="number"?s.left+"px":s.left,this.wrapper.style.height=typeof s.height=="number"?s.height+"px":s.height,this.wrapper.style.width=typeof s.width=="number"?s.width+"px":s.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===e.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),s.attachToViewer?this.anchor===e.ControlAnchor.TOP_RIGHT||this.anchor===e.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):o.appendChild(this.wrapper)},e.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==e.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(i){this.wrapper.style.display=i?this.anchor===e.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(i){this.element[e.SIGNAL]&&e.Browser.vendor===e.BROWSERS.IE?e.setElementOpacity(this.element,i,!0):e.setElementOpacity(this.wrapper,i,!0)}}}(n),function(e){e.ControlDock=function(s){var r=["topleft","topright","bottomright","bottomleft"],o,l;for(e.extend(!0,this,{id:"controldock-"+e.now()+"-"+Math.floor(Math.random()*1e6),container:e.makeNeutralElement("div"),controls:[]},s),this.container.onsubmit=function(){return!1},this.element&&(this.element=e.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),l=0;l=0)){switch(r.anchor){case e.ControlAnchor.TOP_RIGHT:o=this.controls.topright,s.style.position="relative",s.style.paddingRight="0px",s.style.paddingTop="0px";break;case e.ControlAnchor.BOTTOM_RIGHT:o=this.controls.bottomright,s.style.position="relative",s.style.paddingRight="0px",s.style.paddingBottom="0px";break;case e.ControlAnchor.BOTTOM_LEFT:o=this.controls.bottomleft,s.style.position="relative",s.style.paddingLeft="0px",s.style.paddingBottom="0px";break;case e.ControlAnchor.TOP_LEFT:o=this.controls.topleft,s.style.position="relative",s.style.paddingLeft="0px",s.style.paddingTop="0px";break;case e.ControlAnchor.ABSOLUTE:o=this.container,s.style.margin="0px",s.style.padding="0px";break;default:case e.ControlAnchor.NONE:o=this.container,s.style.margin="0px",s.style.padding="0px";break}this.controls.push(new e.Control(s,r,o)),s.style.display="inline-block"}},removeControl:function(s){s=e.getElement(s);var r=i(this,s);return r>=0&&(this.controls[r].destroy(),this.controls.splice(r,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var s;for(s=this.controls.length-1;s>=0;s--)if(this.controls[s].isVisible())return!0;return!1},setControlsEnabled:function(s){var r;for(r=this.controls.length-1;r>=0;r--)this.controls[r].setVisible(s);return this}};function i(s,r){var o=s.controls,l;for(l=o.length-1;l>=0;l--)if(o[l].element===r)return l;return-1}}(n),function(e){e.Placement=e.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(n),function(e){var i={},s=1;e.Viewer=function(u){var v=arguments,b=this,L;if(e.isPlainObject(u)||(u={id:v[0],xmlPath:v.length>1?v[1]:void 0,prefixUrl:v.length>2?v[2]:void 0,controls:v.length>3?v[3]:void 0,overlays:v.length>4?v[4]:void 0}),u.config&&(e.extend(!0,u,u.config),delete u.config),e.extend(!0,this,{id:u.id,hash:u.hash||s++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},e.DEFAULT_SETTINGS,u),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof i[this.hash]<"u"&&e.console.warn("Hash "+this.hash+" has already been used."),i[this.hash]={fsBoundsDelta:new e.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=e.now(),e.EventSource.call(this),this.addHandler("open-failed",function(R){var B=e.getString("Errors.OpenFailed",R.eventSource,R.message);b._showMessage(B)}),e.ControlDock.call(this,u),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=e.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(R){R.width="100%",R.height="100%",R.overflow="hidden",R.position="absolute",R.top="0px",R.left="0px"}(this.canvas.style),e.setElementTouchActionNone(this.canvas),u.tabIndex!==""&&(this.canvas.tabIndex=u.tabIndex===void 0?0:u.tabIndex),this.container.className="openseadragon-container",function(R){R.width="100%",R.height="100%",R.position="relative",R.overflow="hidden",R.left="0px",R.top="0px",R.textAlign="left"}(this.container.style),e.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new e.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:e.delegate(this,C),keyDownHandler:e.delegate(this,A),keyHandler:e.delegate(this,f),clickHandler:e.delegate(this,_),dblClickHandler:e.delegate(this,P),dragHandler:e.delegate(this,H),dragEndHandler:e.delegate(this,O),enterHandler:e.delegate(this,V),leaveHandler:e.delegate(this,W),pressHandler:e.delegate(this,q),releaseHandler:e.delegate(this,$),nonPrimaryPressHandler:e.delegate(this,oe),nonPrimaryReleaseHandler:e.delegate(this,J),scrollHandler:e.delegate(this,ue),pinchHandler:e.delegate(this,fe)}),this.outerTracker=new e.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:e.delegate(this,me),leaveHandler:e.delegate(this,le)}),this.toolbar&&(this.toolbar=new e.ControlDock({element:this.toolbar})),this.bindStandardControls(),i[this.hash].prevContainerSize=r(this.container),this.world=new e.World({viewer:this}),this.world.addHandler("add-item",function(R){b.source=b.world.getItemAt(0).source,i[b.hash].forceRedraw=!0,b._updateRequestId||(b._updateRequestId=c(b,ae))}),this.world.addHandler("remove-item",function(R){b.world.getItemCount()?b.source=b.world.getItemAt(0).source:b.source=null,i[b.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(R){b.viewport&&b.viewport._setContentBounds(b.world.getHomeBounds(),b.world.getContentFactor())}),this.world.addHandler("item-index-change",function(R){b.source=b.world.getItemAt(0).source}),this.viewport=new e.Viewport({containerSize:i[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new e.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:u.timeout}),this.tileCache=new e.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new e.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=e.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(L=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(L,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(L=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(L,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new e.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),L=0;L-1&&u.index=0&&u=0)return this;var B=l(this,R);return this.currentOverlays.push(B),B.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:u,location:R.location,placement:R.placement}),this},updateOverlay:function(u,v,b){var L;return u=e.getElement(u),L=a(this.currentOverlays,u),L>=0&&(this.currentOverlays[L].update(v,b),i[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:u,location:v,placement:b})),this},removeOverlay:function(u){var v;return u=e.getElement(u),v=a(this.currentOverlays,u),v>=0&&(this.currentOverlays[v].destroy(),this.currentOverlays.splice(v,1),i[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:u})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return i[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(u){var v;return u=e.getElement(u),v=a(this.currentOverlays,u),v>=0?this.currentOverlays[v]:null},_updateSequenceButtons:function(u){this.nextButton&&(!this.tileSources||this.tileSources.length-1===u?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(u>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(u){this._hideMessage();var v=e.makeNeutralElement("div");v.appendChild(document.createTextNode(u)),this.messageDiv=e.makeCenteredNode(v),e.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var u=this.messageDiv;u&&(u.parentNode.removeChild(u),delete this.messageDiv)},gestureSettingsByDeviceType:function(u){switch(u){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var u,v=this.currentOverlays.length;for(u=0;u1&&(this.referenceStrip=new e.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else e.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),e.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){e.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var u=e.pixelDensityRatio,v=e.getCurrentPixelDensityRatio();u!==v&&(e.pixelDensityRatio=v,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var u=this._sequenceIndex-1;this.navPrevNextWrap&&u<0&&(u+=this.tileSources.length),this.goToPage(u)},goToNextPage:function(){var u=this._sequenceIndex+1;this.navPrevNextWrap&&u>=this.tileSources.length&&(u=0),this.goToPage(u)}});function r(u){return u=e.getElement(u),new e.Point(u.clientWidth===0?1:u.clientWidth,u.clientHeight===0?1:u.clientHeight)}function o(u,v,b,L,R){var B=u;if(e.type(v)==="string"){if(v.match(/^\s*<.*>\s*$/))v=e.parseXml(v);else if(v.match(/^\s*[{[].*[}\]]\s*$/))try{var k=e.parseJSON(v);v=k}catch{}}function N(z,U){z.ready?L(z):(z.addHandler("ready",function(){L(z)}),z.addHandler("open-failed",function(G){R({message:G.message,source:U})}))}setTimeout(function(){if(e.type(v)==="string")v=new e.TileSource({url:v,crossOriginPolicy:b.crossOriginPolicy!==void 0?b.crossOriginPolicy:u.crossOriginPolicy,ajaxWithCredentials:u.ajaxWithCredentials,ajaxHeaders:b.ajaxHeaders?b.ajaxHeaders:u.ajaxHeaders,useCanvas:u.useCanvas,success:function(X){L(X.tileSource)}}),v.addHandler("open-failed",function(X){R(X)});else if(e.isPlainObject(v)||v.nodeType)if(v.crossOriginPolicy===void 0&&(b.crossOriginPolicy!==void 0||u.crossOriginPolicy!==void 0)&&(v.crossOriginPolicy=b.crossOriginPolicy!==void 0?b.crossOriginPolicy:u.crossOriginPolicy),v.ajaxWithCredentials===void 0&&(v.ajaxWithCredentials=u.ajaxWithCredentials),v.useCanvas===void 0&&(v.useCanvas=u.useCanvas),e.isFunction(v.getTileUrl)){var z=new e.TileSource(v);z.getTileUrl=v.getTileUrl,L(z)}else{var U=e.TileSource.determineType(B,v);if(!U){R({message:"Unable to load TileSource",source:v});return}var G=U.prototype.configure.apply(B,[v]);N(new U(G),v)}else N(v,v)})}function l(u,v){if(v instanceof e.Overlay)return v;var b=null;if(v.element)b=e.getElement(v.element);else{var L=v.id?v.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);b=e.getElement(v.id),b||(b=document.createElement("a"),b.href="#/overlay/"+L),b.id=L,e.addClass(b,v.className?v.className:"openseadragon-overlay")}var R=v.location,B=v.width,k=v.height;if(!R){var N=v.x,z=v.y;if(v.px!==void 0){var U=u.viewport.imageToViewportRectangle(new e.Rect(v.px,v.py,B||0,k||0));N=U.x,z=U.y,B=B!==void 0?U.width:void 0,k=k!==void 0?U.height:void 0}R=new e.Point(N,z)}var G=v.placement;return G&&e.type(G)==="string"&&(G=e.Placement[v.placement.toUpperCase()]),new e.Overlay({element:b,location:R,placement:G,onDraw:v.onDraw,checkResize:v.checkResize,width:B,height:k,rotationMode:v.rotationMode})}function a(u,v){var b;for(b=u.length-1;b>=0;b--)if(u[b].element===v)return b;return-1}function c(u,v){return e.requestAnimationFrame(function(){v(u)})}function h(u){e.requestAnimationFrame(function(){m(u)})}function p(u){u.autoHideControls&&(u.controlsShouldFade=!0,u.controlsFadeBeginTime=e.now()+u.controlsFadeDelay,window.setTimeout(function(){h(u)},u.controlsFadeDelay))}function m(u){var v,b,L,R;if(u.controlsShouldFade){for(v=e.now(),b=v-u.controlsFadeBeginTime,L=1-b/u.controlsFadeLength,L=Math.min(1,L),L=Math.max(0,L),R=u.controls.length-1;R>=0;R--)u.controls[R].autoFade&&u.controls[R].setOpacity(L);L>0&&h(u)}}function T(u){var v;for(u.controlsShouldFade=!1,v=u.controls.length-1;v>=0;v--)u.controls[v].setOpacity(1)}function x(){T(this)}function S(){p(this)}function C(u){var v={tracker:u.eventSource,position:u.position,originalEvent:u.originalEvent,preventDefault:u.preventDefault};this.raiseEvent("canvas-contextmenu",v),u.preventDefault=v.preventDefault}function A(u){var v={originalEvent:u.originalEvent,preventDefaultAction:!1,preventVerticalPan:u.preventVerticalPan,preventHorizontalPan:u.preventHorizontalPan};if(this.raiseEvent("canvas-key",v),!v.preventDefaultAction&&!u.ctrl&&!u.alt&&!u.meta)switch(u.keyCode){case 38:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 40:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 37:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 39:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;default:u.preventDefault=!1;break}else u.preventDefault=!1}function f(u){var v={originalEvent:u.originalEvent,preventDefaultAction:!1,preventVerticalPan:u.preventVerticalPan,preventHorizontalPan:u.preventHorizontalPan};if(this.raiseEvent("canvas-key",v),!v.preventDefaultAction&&!u.ctrl&&!u.alt&&!u.meta)switch(u.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 119:case 87:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-40))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 115:case 83:v.preventVerticalPan||(u.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,40))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 97:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-40,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 100:v.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(40,0))),this.viewport.applyConstraints()),u.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),u.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),u.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:u.preventDefault=!1;break}else u.preventDefault=!1}function _(u){var v,b=document.activeElement===this.canvas;b||this.canvas.focus(),this.viewport.flipped&&(u.position.x=this.viewport.getContainerSize().x-u.position.x);var L={tracker:u.eventSource,position:u.position,quick:u.quick,shift:u.shift,originalEvent:u.originalEvent,originalTarget:u.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",L),!L.preventDefaultAction&&this.viewport&&u.quick&&(v=this.gestureSettingsByDeviceType(u.pointerType),v.clickToZoom&&(this.viewport.zoomBy(u.shift?1/this.zoomPerClick:this.zoomPerClick,v.zoomToRefPoint?this.viewport.pointFromPixel(u.position,!0):null),this.viewport.applyConstraints()))}function P(u){var v,b={tracker:u.eventSource,position:u.position,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",b),!b.preventDefaultAction&&this.viewport&&(v=this.gestureSettingsByDeviceType(u.pointerType),v.dblClickToZoom&&(this.viewport.zoomBy(u.shift?1/this.zoomPerClick:this.zoomPerClick,v.zoomToRefPoint?this.viewport.pointFromPixel(u.position,!0):null),this.viewport.applyConstraints()))}function H(u){var v,b={tracker:u.eventSource,pointerType:u.pointerType,position:u.position,delta:u.delta,speed:u.speed,direction:u.direction,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",b),v=this.gestureSettingsByDeviceType(u.pointerType),v.dragToPan&&!b.preventDefaultAction&&this.viewport){if(this.panHorizontal||(u.delta.x=0),this.panVertical||(u.delta.y=0),this.viewport.flipped&&(u.delta.x=-u.delta.x),this.constrainDuringPan){var L=this.viewport.deltaPointsFromPixels(u.delta.negate());this.viewport.centerSpringX.target.value+=L.x,this.viewport.centerSpringY.target.value+=L.y;var R=this.viewport.getBounds(),B=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=L.x,this.viewport.centerSpringY.target.value-=L.y,R.x!==B.x&&(u.delta.x=0),R.y!==B.y&&(u.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(u.delta.negate()),v.flickEnabled&&!this.constrainDuringPan)}}function O(u){var v={tracker:u.eventSource,pointerType:u.pointerType,position:u.position,speed:u.speed,direction:u.direction,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",v),!v.preventDefaultAction&&this.viewport){var b=this.gestureSettingsByDeviceType(u.pointerType);if(b.flickEnabled&&u.speed>=b.flickMinSpeed){var L=0;this.panHorizontal&&(L=b.flickMomentum*u.speed*Math.cos(u.direction));var R=0;this.panVertical&&(R=b.flickMomentum*u.speed*Math.sin(u.direction));var B=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),k=this.viewport.pointFromPixel(new e.Point(B.x-L,B.y-R));this.viewport.panTo(k,!1)}this.viewport.applyConstraints()}}function V(u){this.raiseEvent("canvas-enter",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function W(u){this.raiseEvent("canvas-exit",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function q(u){this.raiseEvent("canvas-press",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,insideElementPressed:u.insideElementPressed,insideElementReleased:u.insideElementReleased,originalEvent:u.originalEvent})}function $(u){this.raiseEvent("canvas-release",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,insideElementPressed:u.insideElementPressed,insideElementReleased:u.insideElementReleased,originalEvent:u.originalEvent})}function oe(u){this.raiseEvent("canvas-nonprimary-press",{tracker:u.eventSource,position:u.position,pointerType:u.pointerType,button:u.button,buttons:u.buttons,originalEvent:u.originalEvent})}function J(u){this.raiseEvent("canvas-nonprimary-release",{tracker:u.eventSource,position:u.position,pointerType:u.pointerType,button:u.button,buttons:u.buttons,originalEvent:u.originalEvent})}function fe(u){var v,b,L,R,B={tracker:u.eventSource,pointerType:u.pointerType,gesturePoints:u.gesturePoints,lastCenter:u.lastCenter,center:u.center,lastDistance:u.lastDistance,distance:u.distance,shift:u.shift,originalEvent:u.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",B),this.viewport&&(v=this.gestureSettingsByDeviceType(u.pointerType),v.pinchToZoom&&(!B.preventDefaultPanAction||!B.preventDefaultZoomAction)&&(b=this.viewport.pointFromPixel(u.center,!0),B.preventDefaultZoomAction||this.viewport.zoomBy(u.distance/u.lastDistance,b,!0),v.zoomToRefPoint&&!B.preventDefaultPanAction&&(L=this.viewport.pointFromPixel(u.lastCenter,!0),R=L.minus(b),this.panHorizontal||(R.x=0),this.panVertical||(R.y=0),this.viewport.panBy(R,!0)),this.viewport.applyConstraints()),v.pinchRotate&&!B.preventDefaultRotateAction)){var k=Math.atan2(u.gesturePoints[0].currentPos.y-u.gesturePoints[1].currentPos.y,u.gesturePoints[0].currentPos.x-u.gesturePoints[1].currentPos.x),N=Math.atan2(u.gesturePoints[0].lastPos.y-u.gesturePoints[1].lastPos.y,u.gesturePoints[0].lastPos.x-u.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(k-N)*(180/Math.PI))}}function ue(u){var v,b,L,R,B;R=e.now(),B=R-this._lastScrollTime,B>this.minScrollDeltaTime?(this._lastScrollTime=R,v={tracker:u.eventSource,position:u.position,scroll:u.scroll,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",v),!v.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(u.position.x=this.viewport.getContainerSize().x-u.position.x),b=this.gestureSettingsByDeviceType(u.pointerType),b.scrollToZoom&&(L=Math.pow(this.zoomPerScroll,u.scroll),this.viewport.zoomBy(L,b.zoomToRefPoint?this.viewport.pointFromPixel(u.position,!0):null),this.viewport.applyConstraints())),u.preventDefault=v.preventDefault):u.preventDefault=!0}function me(u){i[this.hash].mouseInside=!0,T(this),this.raiseEvent("container-enter",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function le(u){u.pointers<1&&(i[this.hash].mouseInside=!1,i[this.hash].animating||p(this)),this.raiseEvent("container-exit",{tracker:u.eventSource,pointerType:u.pointerType,position:u.position,buttons:u.buttons,pointers:u.pointers,insideElementPressed:u.insideElementPressed,buttonDownAny:u.buttonDownAny,originalEvent:u.originalEvent})}function ae(u){ee(u),u.isOpen()?u._updateRequestId=c(u,ae):u._updateRequestId=!1}function ee(u){if(!(u._opening||!i[u.hash])){if(u.autoResize){var v=r(u.container),b=i[u.hash].prevContainerSize;if(!v.equals(b)){var L=u.viewport;if(u.preserveImageSizeOnResize){var R=b.x/v.x,B=L.getZoom()*R,k=L.getCenter();L.resize(v,!1),L.zoomTo(B,null,!0),L.panTo(k,!0)}else{var N=L.getBounds();L.resize(v,!0),L.fitBoundsWithConstraints(N,!0)}i[u.hash].prevContainerSize=v,i[u.hash].forceRedraw=!0}}var z=u.viewport.update(),U=u.world.update()||z;z&&u.raiseEvent("viewport-change"),u.referenceStrip&&(U=u.referenceStrip.update(u.viewport)||U),!i[u.hash].animating&&U&&(u.raiseEvent("animation-start"),T(u)),(U||i[u.hash].forceRedraw||u.world.needsDraw())&&(ye(u),u._drawOverlays(),u.navigator&&u.navigator.update(u.viewport),i[u.hash].forceRedraw=!1,U&&u.raiseEvent("animation")),i[u.hash].animating&&!U&&(u.raiseEvent("animation-finish"),i[u.hash].mouseInside||p(u)),i[u.hash].animating=U}}function ye(u){u.imageLoader.clear(),u.drawer.clear(),u.world.draw(),u.raiseEvent("update-viewport",{})}function Y(u,v){return u?u+v:v}function Pe(){i[this.hash].lastZoomTime=e.now(),i[this.hash].zoomFactor=this.zoomPerSecond,i[this.hash].zooming=!0,st(this)}function Ae(){i[this.hash].lastZoomTime=e.now(),i[this.hash].zoomFactor=1/this.zoomPerSecond,i[this.hash].zooming=!0,st(this)}function mt(){i[this.hash].zooming=!1}function st(u){e.requestAnimationFrame(e.delegate(u,Ht))}function Ht(){var u,v,b;i[this.hash].zooming&&this.viewport&&(u=e.now(),v=u-i[this.hash].lastZoomTime,b=Math.pow(i[this.hash].zoomFactor,v/1e3),this.viewport.zoomBy(b),this.viewport.applyConstraints(),i[this.hash].lastZoomTime=u,st(this))}function ke(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function $e(){this.viewport&&(i[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function rt(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function Ot(){this.viewport&&this.viewport.goHome()}function Ue(){this.isFullPage()&&!e.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function ot(){if(this.viewport){var u=this.viewport.getRotation();this.viewport.flipped?u=e.positiveModulo(u+this.rotationIncrement,360):u=e.positiveModulo(u-this.rotationIncrement,360),this.viewport.setRotation(u)}}function vt(){if(this.viewport){var u=this.viewport.getRotation();this.viewport.flipped?u=e.positiveModulo(u-this.rotationIncrement,360):u=e.positiveModulo(u+this.rotationIncrement,360),this.viewport.setRotation(u)}}function E(){this.viewport.toggleFlip()}}(n),function(e){e.Navigator=function(c){var h=c.viewer,p=this,m,T;c.id?(this.element=document.getElementById(c.id),c.controlOptions={anchor:e.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(c.id="navigator-"+e.now(),this.element=e.makeNeutralElement("div"),c.controlOptions={anchor:e.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:c.autoFade},c.position&&(c.position==="BOTTOM_RIGHT"?c.controlOptions.anchor=e.ControlAnchor.BOTTOM_RIGHT:c.position==="BOTTOM_LEFT"?c.controlOptions.anchor=e.ControlAnchor.BOTTOM_LEFT:c.position==="TOP_RIGHT"?c.controlOptions.anchor=e.ControlAnchor.TOP_RIGHT:c.position==="TOP_LEFT"?c.controlOptions.anchor=e.ControlAnchor.TOP_LEFT:c.position==="ABSOLUTE"&&(c.controlOptions.anchor=e.ControlAnchor.ABSOLUTE,c.controlOptions.top=c.top,c.controlOptions.left=c.left,c.controlOptions.height=c.height,c.controlOptions.width=c.width))),this.element.id=c.id,this.element.className+=" navigator",c=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.navigatorSizeRatio},c,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:c.autoResize,minZoomImageRatio:1,background:c.background,opacity:c.opacity,borderColor:c.borderColor,displayRegionColor:c.displayRegionColor}),c.minPixelRatio=this.minPixelRatio=h.minPixelRatio,e.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new e.Point(1,1),this.totalBorderWidths=new e.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),c.controlOptions.anchor!==e.ControlAnchor.NONE&&function(C,A){C.margin="0px",C.border=A+"px solid "+c.borderColor,C.padding="0px",C.background=c.background,C.opacity=c.opacity,C.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=e.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(C,A){C.position="relative",C.top="0px",C.left="0px",C.fontSize="0px",C.overflow="hidden",C.border=A+"px solid "+c.displayRegionColor,C.margin="0px",C.padding="0px",C.background="transparent",C.float="left",C.cssFloat="left",C.styleFloat="left",C.zIndex=999999999,C.cursor="default"}(this.displayRegion.style,this.borderWidth),e.setElementPointerEventsNone(this.displayRegion),e.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=e.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",e.setElementPointerEventsNone(this.displayRegionContainer),e.setElementTouchActionNone(this.displayRegionContainer),h.addControl(this.element,c.controlOptions),this._resizeWithViewer=c.controlOptions.anchor!==e.ControlAnchor.ABSOLUTE&&c.controlOptions.anchor!==e.ControlAnchor.NONE,c.width&&c.height?(this.setWidth(c.width),this.setHeight(c.height)):this._resizeWithViewer&&(m=e.getElementSize(h.element),this.element.style.height=Math.round(m.y*c.sizeRatio)+"px",this.element.style.width=Math.round(m.x*c.sizeRatio)+"px",this.oldViewerSize=m,T=e.getElementSize(this.element),this.elementArea=T.x*T.y),this.oldContainerSize=new e.Point(0,0),e.Viewer.apply(this,[c]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function x(C){l(p.displayRegionContainer,C),l(p.displayRegion,-C),p.viewport.setRotation(C)}if(c.navigatorRotate){var S=c.viewer.viewport?c.viewer.viewport.getRotation():c.viewer.degrees||0;x(S),c.viewer.addHandler("rotate",function(C){x(C.degrees)})}this.innerTracker.destroy(),this.innerTracker=new e.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:e.delegate(this,s),clickHandler:e.delegate(this,i),releaseHandler:e.delegate(this,r),scrollHandler:e.delegate(this,o),preProcessEventHandler:function(C){C.eventType==="wheel"&&(C.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",e.setElementPointerEventsNone(this.canvas),e.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){p.viewport&&p.viewport.goHome(!0)}),h.world.addHandler("item-index-change",function(C){window.setTimeout(function(){var A=p.world.getItemAt(C.previousIndex);p.world.setItemIndex(A,C.newIndex)},1)}),h.world.addHandler("remove-item",function(C){var A=C.item,f=p._getMatchingItem(A);f&&p.world.removeItem(f)}),this.update(h.viewport)},e.extend(e.Navigator.prototype,e.EventSource.prototype,e.Viewer.prototype,{updateSize:function(){if(this.viewport){var c=new e.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);c.equals(this.oldContainerSize)||(this.viewport.resize(c,!0),this.viewport.goHome(!0),this.oldContainerSize=c,this.drawer.clear(),this.world.draw())}},setWidth:function(c){this.width=c,this.element.style.width=typeof c=="number"?c+"px":c,this._resizeWithViewer=!1},setHeight:function(c){this.height=c,this.element.style.height=typeof c=="number"?c+"px":c,this._resizeWithViewer=!1},setFlip:function(c){return this.viewport.setFlip(c),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(c){a(this.displayRegion,c),a(this.canvas,c),a(this.element,c)},update:function(c){var h,p,m,T,x,S;if(h=e.getElementSize(this.viewer.element),this._resizeWithViewer&&h.x&&h.y&&!h.equals(this.oldViewerSize)&&(this.oldViewerSize=h,this.maintainSizeRatio||!this.elementArea?(p=h.x*this.sizeRatio,m=h.y*this.sizeRatio):(p=Math.sqrt(this.elementArea*(h.x/h.y)),m=this.elementArea/p),this.element.style.width=Math.round(p)+"px",this.element.style.height=Math.round(m)+"px",this.elementArea||(this.elementArea=p*m),this.updateSize()),c&&this.viewport){T=c.getBoundsNoRotate(!0),x=this.viewport.pixelFromPointNoRotate(T.getTopLeft(),!1),S=this.viewport.pixelFromPointNoRotate(T.getBottomRight(),!1).minus(this.totalBorderWidths);var C=this.displayRegion.style;C.display=this.world.getItemCount()?"block":"none",C.top=Math.round(x.y)+"px",C.left=Math.round(x.x)+"px";var A=Math.abs(x.x-S.x),f=Math.abs(x.y-S.y);C.width=Math.round(Math.max(A,0))+"px",C.height=Math.round(Math.max(f,0))+"px"}},addTiledImage:function(c){var h=this,p=c.originalTiledImage;delete c.original;var m=e.extend({},c,{success:function(T){var x=T.item;x._originalForNavigator=p,h._matchBounds(x,p,!0),h._matchOpacity(x,p),h._matchCompositeOperation(x,p);function S(){h._matchBounds(x,p)}function C(){h._matchOpacity(x,p)}function A(){h._matchCompositeOperation(x,p)}p.addHandler("bounds-change",S),p.addHandler("clip-change",S),p.addHandler("opacity-change",C),p.addHandler("composite-operation-change",A)}});return e.Viewer.prototype.addTiledImage.apply(this,[m])},destroy:function(){return e.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(c){for(var h=this.world.getItemCount(),p,m=0;m1||r.y>1));s++);return s-1},getTileAtPoint:function(s,r){var o=r.x>=0&&r.x<=1&&r.y>=0&&r.y<=1/this.aspectRatio;e.console.assert(o,"[TileSource.getTileAtPoint] must be called with a valid point.");var l=this.dimensions.x*this.getLevelScale(s),a=r.x*l,c=r.y*l,h=Math.floor(a/this.getTileWidth(s)),p=Math.floor(c/this.getTileHeight(s));r.x>=1&&(h=this.getNumTiles(s).x-1);var m=1e-15;return r.y>=1/this.aspectRatio-m&&(p=this.getNumTiles(s).y-1),new e.Point(h,p)},getTileBounds:function(s,r,o,l){var a=this.dimensions.times(this.getLevelScale(s)),c=this.getTileWidth(s),h=this.getTileHeight(s),p=r===0?0:c*r-this.tileOverlap,m=o===0?0:h*o-this.tileOverlap,T=c+(r===0?1:2)*this.tileOverlap,x=h+(o===0?1:2)*this.tileOverlap,S=1/a.x;return T=Math.min(T,a.x-p),x=Math.min(x,a.y-m),l?new e.Rect(0,0,T,x):new e.Rect(p*S,m*S,T*S,x*S)},getImageInfo:function(s){var r=this,o,l,a,c,h,p,m;s&&(h=s.split("/"),p=h[h.length-1],m=p.lastIndexOf("."),m>-1&&(h[h.length-1]=p.slice(0,m))),l=function(T){typeof T=="string"&&(T=e.parseXml(T));var x=e.TileSource.determineType(r,T,s);if(!x){r.raiseEvent("open-failed",{message:"Unable to load TileSource",source:s});return}c=x.prototype.configure.apply(r,[T,s]),c.ajaxWithCredentials===void 0&&(c.ajaxWithCredentials=r.ajaxWithCredentials),a=new x(c),r.ready=!0,r.raiseEvent("ready",{tileSource:a})},s.match(/\.js$/)?(o=s.split("/").pop().replace(".js",""),e.jsonp({url:s,async:!1,callbackName:o,callback:l})):e.makeAjaxRequest({url:s,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(T){var x=i(T);l(x)},error:function(T,x){var S;try{S="HTTP "+T.status+" attempting to load TileSource"}catch{var C;typeof x>"u"||!x.toString?C="Unknown error":C=x.toString(),S=C+" attempting to load TileSource"}r.raiseEvent("open-failed",{message:S,source:s})}})},supports:function(s,r){return!1},configure:function(s,r){throw new Error("Method not implemented.")},getTileUrl:function(s,r,o){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(s,r,o){return{}},tileExists:function(s,r,o){var l=this.getNumTiles(s);return s>=this.minLevel&&s<=this.maxLevel&&r>=0&&o>=0&&r=0;x--)for(S=this.displayRects[x],C=S.minLevel;C<=S.maxLevel;C++)this._levelRects[C]||(this._levelRects[C]=[]),this._levelRects[C].push(S);e.TileSource.apply(this,[A])},e.extend(e.DziTileSource.prototype,e.TileSource.prototype,{supports:function(r,o){var l;return r.Image?l=r.Image.xmlns:r.documentElement&&(r.documentElement.localName==="Image"||r.documentElement.tagName==="Image")&&(l=r.documentElement.namespaceURI),l=(l||"").toLowerCase(),l.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||l.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(r,o){var l;return e.isPlainObject(r)?l=s(this,r):l=i(this,r),o&&!l.tilesUrl&&(l.tilesUrl=o.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),o.search(/\.(dzi|xml|js)\?/)!==-1?l.queryParams=o.match(/\?.*/):l.queryParams=""),l},getTileUrl:function(r,o,l){return[this.tilesUrl,r,"/",o,"_",l,".",this.fileFormat,this.queryParams].join("")},tileExists:function(r,o,l){var a=this._levelRects[r],c,h,p,m,T,x,S;if(this.minLevel&&rthis.maxLevel)return!1;if(!a||!a.length)return!0;for(S=a.length-1;S>=0;S--)if(c=a[S],!(rc.maxLevel)&&(h=this.getLevelScale(r),p=c.x*h,m=c.y*h,T=p+c.width*h,x=m+c.height*h,p=Math.floor(p/this._tileWidth),m=Math.floor(m/this._tileWidth),T=Math.ceil(T/this._tileWidth),x=Math.ceil(x/this._tileWidth),p<=o&&o0?l.tileSize=Math.max.apply(null,T):l.tileSize=p}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,l.levels=s(this),e.extend(!0,l,{width:l.levels[l.levels.length-1].width,height:l.levels[l.levels.length-1].height,tileSize:Math.max(l.height,l.width),tileOverlap:0,minLevel:0,maxLevel:l.levels.length-1}),this.levels=l.levels):e.console.error("Nothing in the info.json to construct image pyramids from");if(!l.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)l.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var S=Math.max.apply(null,this.scale_factors);l.maxLevel=Math.round(Math.log(S)*Math.LOG2E)}e.TileSource.apply(this,[l])},e.extend(e.IIIFTileSource.prototype,e.TileSource.prototype,{supports:function(l,a){return l.protocol&&l.protocol==="http://iiif.io/api/image"||l["@context"]&&(l["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||l["@context"]==="http://iiif.io/api/image/1/context.json")||l.profile&&l.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||l.identifier&&l.width&&l.height?!0:!!(l.documentElement&&l.documentElement.tagName==="info"&&l.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(l,a){if(e.isPlainObject(l)){if(!l["@context"])l["@context"]="http://iiif.io/api/image/1.0/context.json",l["@id"]=a.replace("/info.json",""),l.version=1;else{var h=l["@context"];if(Array.isArray(h)){for(var p=0;p0&&l>=this.minLevel&&l<=this.maxLevel&&(a=this.levels[l].width/this.levels[this.maxLevel].width),a}return e.TileSource.prototype.getLevelScale.call(this,l)},getNumTiles:function(l){if(this.emulateLegacyImagePyramid){var a=this.getLevelScale(l);return a?new e.Point(1,1):new e.Point(0,0)}return e.TileSource.prototype.getNumTiles.call(this,l)},getTileAtPoint:function(l,a){return this.emulateLegacyImagePyramid?new e.Point(0,0):e.TileSource.prototype.getTileAtPoint.call(this,l,a)},getTileUrl:function(l,a,c){if(this.emulateLegacyImagePyramid){var h=null;return this.levels.length>0&&l>=this.minLevel&&l<=this.maxLevel&&(h=this.levels[l].url),h}var p="0",m=Math.pow(.5,this.maxLevel-l),T=Math.ceil(this.width*m),x=Math.ceil(this.height*m),S,C,A,f,_,P,H,O,V,W,q,$,oe,J;return S=this.getTileWidth(l),C=this.getTileHeight(l),A=Math.ceil(S/m),f=Math.ceil(C/m),this.version===1?oe="native."+this.tileFormat:oe="default."+this.tileFormat,T1&&l.profile[1].supports&&(p=l.profile[1].supports.indexOf("sizeByW")!==-1),l.version===3&&l.extraFeatures&&(p=l.extraFeatures.indexOf("sizeByWh")!==-1),!h||p}function s(l){for(var a=[],c=0;ch?p=c/256:p=h/256,a.maxLevel=Math.ceil(Math.log(p)/Math.log(2))-1,a.tileSize=256,a.width=c,a.height=h,e.TileSource.apply(this,[a])},e.extend(e.TmsTileSource.prototype,e.TileSource.prototype,{supports:function(i,s){return i.type&&i.type==="tiledmapservice"},configure:function(i,s){return i},getTileUrl:function(i,s,r){var o=this.getNumTiles(i).y-1;return this.tilesUrl+i+"/"+s+"/"+(o-r)+".png"}})}(n),function(e){e.ZoomifyTileSource=function(i){typeof i.tileSize>"u"&&(i.tileSize=256),typeof i.fileFormat>"u"&&(i.fileFormat="jpg",this.fileFormat=i.fileFormat);var s={x:i.width,y:i.height};for(i.imageSizes=[{x:i.width,y:i.height}],i.gridSize=[this._getGridSize(i.width,i.height,i.tileSize)];parseInt(s.x,10)>i.tileSize||parseInt(s.y,10)>i.tileSize;)s.x=Math.floor(s.x/2),s.y=Math.floor(s.y/2),i.imageSizes.push({x:s.x,y:s.y}),i.gridSize.push(this._getGridSize(s.x,s.y,i.tileSize));i.imageSizes.reverse(),i.gridSize.reverse(),i.minLevel=0,i.maxLevel=i.gridSize.length-1,n.TileSource.apply(this,[i])},e.extend(e.ZoomifyTileSource.prototype,e.TileSource.prototype,{_getGridSize:function(i,s,r){return{x:Math.ceil(i/r),y:Math.ceil(s/r)}},_calculateAbsoluteTileNumber:function(i,s,r){for(var o=0,l={},a=0;a0?(a=l.levels[l.levels.length-1].width,c=l.levels[l.levels.length-1].height):(a=0,c=0,e.console.error("No supported image formats found")),e.extend(!0,l,{width:a,height:c,tileSize:Math.max(c,a),tileOverlap:0,minLevel:0,maxLevel:l.levels.length>0?l.levels.length-1:0}),e.TileSource.apply(this,[l]),this.levels=l.levels},e.extend(e.LegacyTileSource.prototype,e.TileSource.prototype,{supports:function(o,l){return o.type&&o.type==="legacy-image-pyramid"||o.documentElement&&o.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(o,l){var a;return e.isPlainObject(o)?a=r(this,o):a=s(this,o),a},getLevelScale:function(o){var l=NaN;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(l=this.levels[o].width/this.levels[this.maxLevel].width),l},getNumTiles:function(o){var l=this.getLevelScale(o);return l?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(o,l,a){var c=null;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(c=this.levels[o].url),c}});function i(o){var l=[],a,c;for(c=0;c");return l.sort(function(h,p){return h.height-p.height})}function s(o,l){if(!l||!l.documentElement)throw new Error(e.getString("Errors.Xml"));var a=l.documentElement,c=a.tagName,h=null,p=[],m,T;if(c==="image")try{for(h={type:a.getAttribute("type"),levels:[]},p=a.getElementsByTagName("level"),T=0;T=this.minLevel&&i<=this.maxLevel&&(s=this.levels[i].width/this.levels[this.maxLevel].width),s},getNumTiles:function(i){var s=this.getLevelScale(i);return s?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(i,s,r){var o=null;return i>=this.minLevel&&i<=this.maxLevel&&(o=this.levels[i].url),o},getContext2D:function(i,s,r){var o=null;return i>=this.minLevel&&i<=this.maxLevel&&(o=this.levels[i].context2D),o},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var i=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!e.supportsCanvas||!this.useCanvas)return delete this._image,i;var s=this._image.naturalWidth,r=this._image.naturalHeight,o=document.createElement("canvas"),l=o.getContext("2d");if(o.width=s,o.height=r,l.drawImage(this._image,0,0,s,r),i[0].context2D=l,delete this._image,e.isCanvasTainted(o))return i;for(;s>=2&&r>=2;){s=Math.floor(s/2),r=Math.floor(r/2);var a=document.createElement("canvas"),c=a.getContext("2d");a.width=s,a.height=r,c.drawImage(o,0,0,s,r),i.splice(0,0,{context2D:c,width:s,height:r}),o=a,l=c}return i},_freeupCanvasMemory:function(){for(var i=0;i0&&i(c))}function r(c){c.shouldFade=!0,c.fadeBeginTime=e.now()+c.fadeDelay,window.setTimeout(function(){i(c)},c.fadeDelay)}function o(c){c.shouldFade=!1,c.imgGroup&&e.setElementOpacity(c.imgGroup,1,!0)}function l(c,h){c.element.disabled||(h>=e.ButtonState.GROUP&&c.currentState===e.ButtonState.REST&&(o(c),c.currentState=e.ButtonState.GROUP),h>=e.ButtonState.HOVER&&c.currentState===e.ButtonState.GROUP&&(c.imgHover&&(c.imgHover.style.visibility=""),c.currentState=e.ButtonState.HOVER),h>=e.ButtonState.DOWN&&c.currentState===e.ButtonState.HOVER&&(c.imgDown&&(c.imgDown.style.visibility=""),c.currentState=e.ButtonState.DOWN))}function a(c,h){c.element.disabled||(h<=e.ButtonState.HOVER&&c.currentState===e.ButtonState.DOWN&&(c.imgDown&&(c.imgDown.style.visibility="hidden"),c.currentState=e.ButtonState.HOVER),h<=e.ButtonState.GROUP&&c.currentState===e.ButtonState.HOVER&&(c.imgHover&&(c.imgHover.style.visibility="hidden"),c.currentState=e.ButtonState.GROUP),h<=e.ButtonState.REST&&c.currentState===e.ButtonState.GROUP&&(r(c),c.currentState=e.ButtonState.REST))}}(n),function(e){e.ButtonGroup=function(i){e.extend(!0,this,{buttons:[],clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},i);var s=this.buttons.concat([]),r=this,o;if(this.element=i.element||e.makeNeutralElement("div"),!i.group)for(this.element.style.display="inline-block",o=0;o=270?(a=this.getTopRight(),this.x=a.x,this.y=a.y,c=this.height,this.height=this.width,this.width=c,this.degrees-=270):this.degrees>=180?(a=this.getBottomRight(),this.x=a.x,this.y=a.y,this.degrees-=180):this.degrees>=90&&(a=this.getBottomLeft(),this.x=a.x,this.y=a.y,c=this.height,this.height=this.width,this.width=c,this.degrees-=90)},e.Rect.fromSummits=function(i,s,r){var o=i.distanceTo(s),l=i.distanceTo(r),a=s.minus(i),c=Math.atan(a.y/a.x);return a.x<0?c+=Math.PI:a.y<0&&(c+=2*Math.PI),new e.Rect(i.x,i.y,o,l,c/Math.PI*180)},e.Rect.prototype={clone:function(){return new e.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new e.Point(this.x,this.y)},getBottomRight:function(){return new e.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new e.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new e.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new e.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new e.Point(this.width,this.height)},equals:function(i){return i instanceof e.Rect&&this.x===i.x&&this.y===i.y&&this.width===i.width&&this.height===i.height&&this.degrees===i.degrees},times:function(i){return new e.Rect(this.x*i,this.y*i,this.width*i,this.height*i,this.degrees)},translate:function(i){return new e.Rect(this.x+i.x,this.y+i.y,this.width,this.height,this.degrees)},union:function(i){var s=this.getBoundingBox(),r=i.getBoundingBox(),o=Math.min(s.x,r.x),l=Math.min(s.y,r.y),a=Math.max(s.x+s.width,r.x+r.width),c=Math.max(s.y+s.height,r.y+r.height);return new e.Rect(o,l,a-o,c-l)},intersection:function(i){var s=1e-10,r=[],o=this.getTopLeft();i.containsPoint(o,s)&&r.push(o);var l=this.getTopRight();i.containsPoint(l,s)&&r.push(l);var a=this.getBottomLeft();i.containsPoint(a,s)&&r.push(a);var c=this.getBottomRight();i.containsPoint(c,s)&&r.push(c);var h=i.getTopLeft();this.containsPoint(h,s)&&r.push(h);var p=i.getTopRight();this.containsPoint(p,s)&&r.push(p);var m=i.getBottomLeft();this.containsPoint(m,s)&&r.push(m);var T=i.getBottomRight();this.containsPoint(T,s)&&r.push(T);for(var x=this._getSegments(),S=i._getSegments(),C=0;CV&&(V=oe.x),oe.yq&&(q=oe.y)}return new e.Rect(O,W,V-O,q-W)},_getSegments:function(){var i=this.getTopLeft(),s=this.getTopRight(),r=this.getBottomLeft(),o=this.getBottomRight();return[[i,s],[s,o],[o,r],[r,i]]},rotate:function(i,s){if(i=e.positiveModulo(i,360),i===0)return this.clone();s=s||this.getCenter();var r=this.getTopLeft().rotate(i,s),o=this.getTopRight().rotate(i,s),l=o.minus(r);l=l.apply(function(c){var h=1e-15;return Math.abs(c)=-s&&(i.x-o.x)*a.x+(i.y-o.y)*a.y<=s&&(i.x-r.x)*c.x+(i.y-r.y)*c.y>=-s&&(i.x-l.x)*c.x+(i.y-l.y)*c.y<=s},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(n),function(e){var i={};e.ReferenceStrip=function(m){var T=this,x=m.viewer,S=e.getElementSize(x.element),C,A,f;for(m.id||(m.id="referencestrip-"+e.now(),this.element=e.makeNeutralElement("div"),this.element.id=m.id,this.element.className="referencestrip"),m=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.referenceStripSizeRatio,position:e.DEFAULT_SETTINGS.referenceStripPosition,scroll:e.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold},m,{element:this.element}),e.extend(this,m),i[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,A=this.element.style,A.marginTop="0px",A.marginRight="0px",A.marginBottom="0px",A.marginLeft="0px",A.left="0px",A.bottom="0px",A.border="0px",A.background="#000",A.position="relative",e.setElementTouchActionNone(this.element),e.setElementOpacity(this.element,.8),this.viewer=x,this.tracker=new e.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:e.delegate(this,s),dragHandler:e.delegate(this,r),scrollHandler:e.delegate(this,o),enterHandler:e.delegate(this,a),leaveHandler:e.delegate(this,c),keyDownHandler:e.delegate(this,h),keyHandler:e.delegate(this,p),preProcessEventHandler:function(_){_.eventType==="wheel"&&(_.preventDefault=!0)}}),m.width&&m.height?(this.element.style.width=m.width+"px",this.element.style.height=m.height+"px",x.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):m.scroll==="horizontal"?(this.element.style.width=S.x*m.sizeRatio*x.tileSources.length+12*x.tileSources.length+"px",this.element.style.height=S.y*m.sizeRatio+"px",x.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=S.y*m.sizeRatio*x.tileSources.length+12*x.tileSources.length+"px",this.element.style.width=S.x*m.sizeRatio+"px",x.addControl(this.element,{anchor:e.ControlAnchor.TOP_LEFT})),this.panelWidth=S.x*this.sizeRatio+8,this.panelHeight=S.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},f=0;fA+x.x-this.panelWidth?(_=Math.min(_,S-x.x),this.element.style.marginLeft=-_+"px",l(this,x.x,-_)):_f+x.y-this.panelHeight?(_=Math.min(_,C-x.y),this.element.style.marginTop=-_+"px",l(this,x.y,-_)):_0?T>-(S-A.x)&&(this.element.style.marginLeft=T+m.delta.x*2+"px",l(this,A.x,T+m.delta.x*2)):-m.delta.x<0&&T<0&&(this.element.style.marginLeft=T+m.delta.x*2+"px",l(this,A.x,T+m.delta.x*2)):-m.delta.y>0?x>-(C-A.y)&&(this.element.style.marginTop=x+m.delta.y*2+"px",l(this,A.y,x+m.delta.y*2)):-m.delta.y<0&&x<0&&(this.element.style.marginTop=x+m.delta.y*2+"px",l(this,A.y,x+m.delta.y*2))}}function o(m){if(this.element){var T=Number(this.element.style.marginLeft.replace("px","")),x=Number(this.element.style.marginTop.replace("px","")),S=Number(this.element.style.width.replace("px","")),C=Number(this.element.style.height.replace("px","")),A=e.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?m.scroll>0?T>-(S-A.x)&&(this.element.style.marginLeft=T-m.scroll*60+"px",l(this,A.x,T-m.scroll*60)):m.scroll<0&&T<0&&(this.element.style.marginLeft=T-m.scroll*60+"px",l(this,A.x,T-m.scroll*60)):m.scroll<0?x>A.y-C&&(this.element.style.marginTop=x+m.scroll*60+"px",l(this,A.y,x+m.scroll*60)):m.scroll>0&&x<0&&(this.element.style.marginTop=x+m.scroll*60+"px",l(this,A.y,x+m.scroll*60)),m.preventDefault=!0}}function l(m,T,x){var S,C,A,f,_,P;for(m.scroll==="horizontal"?S=m.panelWidth:S=m.panelHeight,C=Math.ceil(T/S)+5,A=Math.ceil((Math.abs(x)+T)/S)+1,C=A-C,C=C<0?0:C,_=C;_1?r[1].springStiffness:5,animationTime:r.length>1?r[1].animationTime:1.5}),e.console.assert(typeof s.springStiffness=="number"&&s.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),e.console.assert(typeof s.animationTime=="number"&&s.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),s.exponential&&(this._exponential=!0,delete s.exponential),e.extend(!0,this,s),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:e.now()},e.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},e.Spring.prototype={resetTo:function(s){e.console.assert(!this._exponential||s!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=s,this.start.time=this.target.time=this.current.time=e.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(s){e.console.assert(!this._exponential||s!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=s,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(s){this.start.value+=s,this.target.value+=s,this._exponential&&(e.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(s){this._exponential=s,this._exponential&&(e.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=e.now();var s,r;this._exponential?(s=this.start._logValue,r=this.target._logValue):(s=this.start.value,r=this.target.value);var o=this.current.time>=this.target.time?r:s+(r-s)*i(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),l=this.current.value;return this._exponential?this.current.value=Math.exp(o):this.current.value=o,l!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function i(s,r){return(1-Math.exp(s*-r))/(1-Math.exp(-s))}}(n),function(e){function i(r){e.extend(!0,this,{timeout:e.DEFAULT_SETTINGS.timeout,jobId:null},r),this.image=null}i.prototype={errorMsg:null,start:function(){var r=this,o=this.abort;this.image=new Image,this.image.onload=function(){r.finish(!0)},this.image.onabort=this.image.onerror=function(){r.errorMsg="Image load aborted",r.finish(!1)},this.jobId=window.setTimeout(function(){r.errorMsg="Image load exceeded timeout ("+r.timeout+" ms)",r.finish(!1)},this.timeout),this.loadWithAjax?(this.request=e.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(l){var a;try{a=new window.Blob([l.response])}catch(m){var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(m.name==="TypeError"&&c){var h=new c;h.append(l.response),a=h.getBlob()}}a.size===0&&(r.errorMsg="Empty image response.",r.finish(!1));var p=(window.URL||window.webkitURL).createObjectURL(a);r.image.src=p},error:function(l){r.errorMsg="Image load aborted - XHR error",r.finish(!1)}}),this.abort=function(){r.request.abort(),typeof o=="function"&&o()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(r){this.image.onload=this.image.onerror=this.image.onabort=null,r||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},e.ImageLoader=function(r){e.extend(!0,this,{jobLimit:e.DEFAULT_SETTINGS.imageLoaderLimit,timeout:e.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},r)},e.ImageLoader.prototype={addJob:function(r){var o=this,l=function(h){s(o,h,r.callback)},a={src:r.src,loadWithAjax:r.loadWithAjax,ajaxHeaders:r.loadWithAjax?r.ajaxHeaders:null,crossOriginPolicy:r.crossOriginPolicy,ajaxWithCredentials:r.ajaxWithCredentials,callback:l,abort:r.abort,timeout:this.timeout},c=new i(a);!this.jobLimit||this.jobsInProgress0&&(a=r.jobQueue.shift(),a.start(),r.jobsInProgress++),l(o.image,o.errorMsg,o.request)}}(n),function(e){e.Tile=function(i,s,r,o,l,a,c,h,p,m){this.level=i,this.x=s,this.y=r,this.bounds=o,this.sourceBounds=m,this.exists=l,this.url=a,this.context2D=c,this.loadWithAjax=h,this.ajaxHeaders=p,this.ajaxHeaders?this.cacheKey=this.url+"+"+JSON.stringify(this.ajaxHeaders):this.cacheKey=this.url,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},e.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(i){if(!this.cacheImageRecord){e.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=e.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==i&&i.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),e.setElementOpacity(this.element,this.opacity)},drawCanvas:function(i,s,r,o){var l=this.position.times(e.pixelDensityRatio),a=this.size.times(e.pixelDensityRatio),c;if(!this.context2D&&!this.cacheImageRecord){e.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(c=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!c){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}i.save(),i.globalAlpha=this.opacity,typeof r=="number"&&r!==1&&(l=l.times(r),a=a.times(r)),o instanceof e.Point&&(l=l.plus(o)),i.globalAlpha===1&&this._hasTransparencyChannel()&&i.clearRect(l.x,l.y,a.x,a.y),s({context:i,tile:this,rendered:c});var h,p;this.sourceBounds?(h=Math.min(this.sourceBounds.width,c.canvas.width),p=Math.min(this.sourceBounds.height,c.canvas.height)):(h=c.canvas.width,p=c.canvas.height),i.translate(l.x+a.x/2,0),this.flipped&&i.scale(-1,1),i.drawImage(c.canvas,0,0,h,p,-a.x/2,l.y,a.x,a.y),i.restore()},getScaleForEdgeSmoothing:function(){var i;if(this.cacheImageRecord)i=this.cacheImageRecord.getRenderedContext();else if(this.context2D)i=this.context2D;else return e.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return i.canvas.width/(this.size.x*e.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(i,s,r){var o=Math.max(1,Math.ceil((r.x-s.x)/2)),l=Math.max(1,Math.ceil((r.y-s.y)/2));return new e.Point(o,l).minus(this.position.times(e.pixelDensityRatio).times(i||1).apply(function(a){return a%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(n),function(e){e.OverlayPlacement=e.Placement,e.OverlayRotationMode=e.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),e.Overlay=function(i,s,r){var o;e.isPlainObject(i)?o=i:o={element:i,location:s,placement:r},this.element=o.element,this.style=o.element.style,this._init(o)},e.Overlay.prototype={_init:function(i){this.location=i.location,this.placement=i.placement===void 0?e.Placement.TOP_LEFT:i.placement,this.onDraw=i.onDraw,this.checkResize=i.checkResize===void 0?!0:i.checkResize,this.width=i.width===void 0?null:i.width,this.height=i.height===void 0?null:i.height,this.rotationMode=i.rotationMode||e.OverlayRotationMode.EXACT,this.location instanceof e.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=e.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new e.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(i,s){var r=e.Placement.properties[this.placement];r&&(r.isHorizontallyCentered?i.x-=s.x/2:r.isRight&&(i.x-=s.x),r.isVerticallyCentered?i.y-=s.y/2:r.isBottom&&(i.y-=s.y))},destroy:function(){var i=this.element,s=this.style;i.parentNode&&(i.parentNode.removeChild(i),i.prevElementParent&&(s.display="none",document.body.appendChild(i))),this.onDraw=null,s.top="",s.left="",s.position="",this.width!==null&&(s.width=""),this.height!==null&&(s.height="");var r=e.getCssPropertyWithVendorPrefix("transformOrigin"),o=e.getCssPropertyWithVendorPrefix("transform");r&&o&&(s[r]="",s[o]="")},drawHTML:function(i,s){var r=this.element;r.parentNode!==i&&(r.prevElementParent=r.parentNode,r.prevNextSibling=r.nextSibling,i.appendChild(r),this.style.position="absolute",this.size=e.getElementSize(r));var o=this._getOverlayPositionAndSize(s),l=o.position,a=this.size=o.size,c=o.rotate;if(this.onDraw)this.onDraw(l,a,this.element);else{var h=this.style;h.left=l.x+"px",h.top=l.y+"px",this.width!==null&&(h.width=a.x+"px"),this.height!==null&&(h.height=a.y+"px");var p=e.getCssPropertyWithVendorPrefix("transformOrigin"),m=e.getCssPropertyWithVendorPrefix("transform");p&&m&&(c?(h[p]=this._getTransformOrigin(),h[m]="rotate("+c+"deg)"):(h[p]="",h[m]="")),h.display="block"}},_getOverlayPositionAndSize:function(i){var s=i.pixelFromPoint(this.location,!0),r=this._getSizeInPixels(i);this.adjust(s,r);var o=0;if(i.degrees&&this.rotationMode!==e.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var l=new e.Rect(s.x,s.y,r.x,r.y),a=this._getBoundingBox(l,i.degrees);s=a.getTopLeft(),r=a.getSize()}else o=i.degrees;return{position:s,size:r,rotate:o}},_getSizeInPixels:function(i){var s=this.size.x,r=this.size.y;if(this.width!==null||this.height!==null){var o=i.deltaPixelsFromPointsNoRotate(new e.Point(this.width||0,this.height||0),!0);this.width!==null&&(s=o.x),this.height!==null&&(r=o.y)}if(this.checkResize&&(this.width===null||this.height===null)){var l=this.size=e.getElementSize(this.element);this.width===null&&(s=l.x),this.height===null&&(r=l.y)}return new e.Point(s,r)},_getBoundingBox:function(i,s){var r=this._getPlacementPoint(i);return i.rotate(s,r).getBoundingBox()},_getPlacementPoint:function(i){var s=new e.Point(i.x,i.y),r=e.Placement.properties[this.placement];return r&&(r.isHorizontallyCentered?s.x+=i.width/2:r.isRight&&(s.x+=i.width),r.isVerticallyCentered?s.y+=i.height/2:r.isBottom&&(s.y+=i.height)),s},_getTransformOrigin:function(){var i="",s=e.Placement.properties[this.placement];return s&&(s.isLeft?i="left":s.isRight&&(i="right"),s.isTop?i+=" top":s.isBottom&&(i+=" bottom")),i},update:function(i,s){var r=e.isPlainObject(i)?i:{location:i,placement:s};this._init({location:r.location||this.location,placement:r.placement!==void 0?r.placement:this.placement,onDraw:r.onDraw||this.onDraw,checkResize:r.checkResize||this.checkResize,width:r.width!==void 0?r.width:this.width,height:r.height!==void 0?r.height:this.height,rotationMode:r.rotationMode||this.rotationMode})},getBounds:function(i){e.console.assert(i,"A viewport must now be passed to Overlay.getBounds.");var s=this.width,r=this.height;if(s===null||r===null){var o=i.deltaPointsFromPixelsNoRotate(this.size,!0);s===null&&(s=o.x),r===null&&(r=o.y)}var l=this.location.clone();return this.adjust(l,new e.Point(s,r)),this._adjustBoundsForRotation(i,new e.Rect(l.x,l.y,s,r))},_adjustBoundsForRotation:function(i,s){if(!i||i.degrees===0||this.rotationMode===e.OverlayRotationMode.EXACT)return s;if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return s;var r=this._getOverlayPositionAndSize(i);return i.viewerElementToViewportRectangle(new e.Rect(r.position.x,r.position.y,r.size.x,r.size.y))}return s.rotate(-i.degrees,this._getPlacementPoint(s))}}}(n),function(e){e.Drawer=function(i){e.console.assert(i.viewer,"[Drawer] options.viewer is required");var s=arguments;if(e.isPlainObject(i)||(i={source:s[0],viewport:s[1],element:s[2]}),e.console.assert(i.viewport,"[Drawer] options.viewport is required"),e.console.assert(i.element,"[Drawer] options.element is required"),i.source&&e.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=i.viewer,this.viewport=i.viewport,this.debugGridColor=typeof i.debugGridColor=="string"?[i.debugGridColor]:i.debugGridColor||e.DEFAULT_SETTINGS.debugGridColor,i.opacity&&e.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=e.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=e.getElement(i.element),this.canvas=e.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var r=this._calculateCanvasSize();this.canvas.width=r.x,this.canvas.height=r.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",e.setElementOpacity(this.canvas,this.opacity,!0),e.setElementPointerEventsNone(this.canvas),e.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},e.Drawer.prototype={addOverlay:function(i,s,r,o){return e.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(i,s,r,o),this},updateOverlay:function(i,s,r){return e.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(i,s,r),this},removeOverlay:function(i){return e.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(i),this},clearOverlays:function(){return e.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(i){var s=this.viewport.pixelFromPointNoRotate(i,!0);return new e.Point(s.x*e.pixelDensityRatio,s.y*e.pixelDensityRatio)},clipWithPolygons:function(i,s){if(this.useCanvas){var r=this._getContext(s);r.beginPath(),i.forEach(function(o){o.forEach(function(l,a){r[a===0?"moveTo":"lineTo"](l.x,l.y)})}),r.clip()}},setOpacity:function(i){e.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var s=this.viewer.world,r=0;rs&&(s=o)}return s},needsUpdate:function(){return e.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return e.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return e.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return e.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var i=this._calculateCanvasSize();if((this.canvas.width!==i.x||this.canvas.height!==i.y)&&(this.canvas.width=i.x,this.canvas.height=i.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var s=this._calculateSketchCanvasSize();this.sketchCanvas.width=s.x,this.sketchCanvas.height=s.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(i,s){if(this.useCanvas){var r=this._getContext(i);if(s)r.clearRect(s.x,s.y,s.width,s.height);else{var o=r.canvas;r.clearRect(0,0,o.width,o.height)}}},viewportToDrawerRectangle:function(i){var s=this.viewport.pixelFromPointNoRotate(i.getTopLeft(),!0),r=this.viewport.deltaPixelsFromPointsNoRotate(i.getSize(),!0);return new e.Rect(s.x*e.pixelDensityRatio,s.y*e.pixelDensityRatio,r.x*e.pixelDensityRatio,r.y*e.pixelDensityRatio)},drawTile:function(i,s,r,o,l){if(e.console.assert(i,"[Drawer.drawTile] tile is required"),e.console.assert(s,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var a=this._getContext(r);o=o||1,i.drawCanvas(a,s,o,l)}else i.drawHTML(this.canvas)},_getContext:function(i){var s=this.context;if(i){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var r=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=r.x,this.sketchCanvas.height=r.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var o=this;this.viewer.addHandler("rotate",function l(){if(o.viewport.getRotation()!==0){o.viewer.removeHandler("rotate",l);var a=o._calculateSketchCanvasSize();o.sketchCanvas.width=a.x,o.sketchCanvas.height=a.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}s=this.sketchContext}return s},saveContext:function(i){this.useCanvas&&this._getContext(i).save()},restoreContext:function(i){this.useCanvas&&this._getContext(i).restore()},setClip:function(i,s){if(this.useCanvas){var r=this._getContext(s);r.beginPath(),r.rect(i.x,i.y,i.width,i.height),r.clip()}},drawRectangle:function(i,s,r){if(this.useCanvas){var o=this._getContext(r);o.save(),o.fillStyle=s,o.fillRect(i.x,i.y,i.width,i.height),o.restore()}},blendSketch:function(i,s,r,o){var l=i;if(e.isPlainObject(l)||(l={opacity:i,scale:s,translate:r,compositeOperation:o}),!(!this.useCanvas||!this.sketchCanvas)){i=l.opacity,o=l.compositeOperation;var a=l.bounds;if(this.context.save(),this.context.globalAlpha=i,o&&(this.context.globalCompositeOperation=o),a)a.x<0&&(a.width+=a.x,a.x=0),a.x+a.width>this.canvas.width&&(a.width=this.canvas.width-a.x),a.y<0&&(a.height+=a.y,a.y=0),a.y+a.height>this.canvas.height&&(a.height=this.canvas.height-a.y),this.context.drawImage(this.sketchCanvas,a.x,a.y,a.width,a.height,a.x,a.y,a.width,a.height);else{s=l.scale||1,r=l.translate;var c=r instanceof e.Point?r:new e.Point(0,0),h=0,p=0;if(r){var m=this.sketchCanvas.width-this.canvas.width,T=this.sketchCanvas.height-this.canvas.height;h=Math.round(m/2),p=Math.round(T/2)}this.context.drawImage(this.sketchCanvas,c.x-h*s,c.y-p*s,(this.canvas.width+2*h)*s,(this.canvas.height+2*p)*s,-h,-p,this.canvas.width+2*h,this.canvas.height+2*p)}this.context.restore()}},drawDebugInfo:function(i,s,r,o){if(this.useCanvas){var l=this.viewer.world.getIndexOfItem(o)%this.debugGridColor.length,a=this.context;a.save(),a.lineWidth=2*e.pixelDensityRatio,a.font="small-caps bold "+13*e.pixelDensityRatio+"px arial",a.strokeStyle=this.debugGridColor[l],a.fillStyle=this.debugGridColor[l],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),o.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:o.getRotation(!0),point:o.viewport.pixelFromPointNoRotate(o._getRotationPoint(!0),!0)}),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),a.strokeRect(i.position.x*e.pixelDensityRatio,i.position.y*e.pixelDensityRatio,i.size.x*e.pixelDensityRatio,i.size.y*e.pixelDensityRatio);var c=(i.position.x+i.size.x/2)*e.pixelDensityRatio,h=(i.position.y+i.size.y/2)*e.pixelDensityRatio;a.translate(c,h),a.rotate(Math.PI/180*-this.viewport.degrees),a.translate(-c,-h),i.x===0&&i.y===0&&(a.fillText("Zoom: "+this.viewport.getZoom(),i.position.x*e.pixelDensityRatio,(i.position.y-30)*e.pixelDensityRatio),a.fillText("Pan: "+this.viewport.getBounds().toString(),i.position.x*e.pixelDensityRatio,(i.position.y-20)*e.pixelDensityRatio)),a.fillText("Level: "+i.level,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+20)*e.pixelDensityRatio),a.fillText("Column: "+i.x,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+30)*e.pixelDensityRatio),a.fillText("Row: "+i.y,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+40)*e.pixelDensityRatio),a.fillText("Order: "+r+" of "+s,(i.position.x+10)*e.pixelDensityRatio,(i.position.y+50)*e.pixelDensityRatio),a.fillText("Size: "+i.size.toString(),(i.position.x+10)*e.pixelDensityRatio,(i.position.y+60)*e.pixelDensityRatio),a.fillText("Position: "+i.position.toString(),(i.position.x+10)*e.pixelDensityRatio,(i.position.y+70)*e.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),o.getRotation(!0)%360!==0&&this._restoreRotationChanges(),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),a.restore()}},debugRect:function(i){if(this.useCanvas){var s=this.context;s.save(),s.lineWidth=2*e.pixelDensityRatio,s.strokeStyle=this.debugGridColor[0],s.fillStyle=this.debugGridColor[0],s.strokeRect(i.x*e.pixelDensityRatio,i.y*e.pixelDensityRatio,i.width*e.pixelDensityRatio,i.height*e.pixelDensityRatio),s.restore()}},setImageSmoothingEnabled:function(i){this.useCanvas&&(this._imageSmoothingEnabled=i,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(i){i.msImageSmoothingEnabled=this._imageSmoothingEnabled,i.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(i){var s=this._getContext(i).canvas;return new e.Point(s.width,s.height)},getCanvasCenter:function(){return new e.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(i){var s=i.point?i.point.times(e.pixelDensityRatio):this.getCanvasCenter(),r=this._getContext(i.useSketch);r.save(),r.translate(s.x,s.y),this.viewer.viewport.flipped?(r.rotate(Math.PI/180*-i.degrees),r.scale(-1,1)):r.rotate(Math.PI/180*i.degrees),r.translate(-s.x,-s.y)},_flip:function(i){i=i||{};var s=i.point?i.point.times(e.pixelDensityRatio):this.getCanvasCenter(),r=this._getContext(i.useSketch);r.translate(s.x,0),r.scale(-1,1),r.translate(-s.x,0)},_restoreRotationChanges:function(i){var s=this._getContext(i);s.restore()},_calculateCanvasSize:function(){var i=e.pixelDensityRatio,s=this.viewport.getContainerSize();return{x:Math.round(s.x*i),y:Math.round(s.y*i)}},_calculateSketchCanvasSize:function(){var i=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return i;var s=Math.ceil(Math.sqrt(i.x*i.x+i.y*i.y));return{x:s,y:s}}}}(n),function(e){e.Viewport=function(i){var s=arguments;s.length&&s[0]instanceof e.Point&&(i={containerSize:s[0],contentSize:s[1],config:s[2]}),i.config&&(e.extend(!0,i,i.config),delete i.config),this._margins=e.extend({left:0,top:0,right:0,bottom:0},i.margins||{}),delete i.margins,e.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:e.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:e.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:e.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:e.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:e.DEFAULT_SETTINGS.maxZoomLevel,degrees:e.DEFAULT_SETTINGS.degrees,flipped:e.DEFAULT_SETTINGS.flipped,homeFillsViewer:e.DEFAULT_SETTINGS.homeFillsViewer},i),this._updateContainerInnerSize(),this.centerSpringX=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new e.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new e.Rect(0,0,1,1),1),this.goHome(!0),this.update()},e.Viewport.prototype={resetContentSize:function(i){return e.console.assert(i,"[Viewport.resetContentSize] contentSize is required"),e.console.assert(i instanceof e.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),e.console.assert(i.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),e.console.assert(i.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new e.Rect(0,0,1,i.y/i.x),i.x),this},setHomeBounds:function(i,s){e.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(i,s)},_setContentBounds:function(i,s){e.console.assert(i,"[Viewport._setContentBounds] bounds is required"),e.console.assert(i instanceof e.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),e.console.assert(i.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),e.console.assert(i.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=i.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(s),this._contentBounds=i.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(s),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:s,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var i=this._contentAspectRatio/this.getAspectRatio(),s;return this.homeFillsViewer?s=i>=1?i:1:s=i>=1?1:i,s/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var i=this._contentBounds.getCenter(),s=1/this.getHomeZoom(),r=s/this.getAspectRatio();return new e.Rect(i.x-s/2,i.y-r/2,s,r)},goHome:function(i){return this.viewer&&this.viewer.raiseEvent("home",{immediately:i}),this.fitBounds(this.getHomeBounds(),i)},getMinZoom:function(){var i=this.getHomeZoom(),s=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*i;return s},getMaxZoom:function(){var i=this.maxZoomLevel;return i||(i=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,i/=this._contentBounds.width),Math.max(i,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new e.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return e.extend({},this._margins)},setMargins:function(i){e.console.assert(e.type(i)==="object","[Viewport.setMargins] margins must be an object"),this._margins=e.extend({left:0,top:0,right:0,bottom:0},i),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(i){return this.getBoundsNoRotate(i).rotate(-this.getRotation())},getBoundsNoRotate:function(i){var s=this.getCenter(i),r=1/this.getZoom(i),o=r/this.getAspectRatio();return new e.Rect(s.x-r/2,s.y-o/2,r,o)},getBoundsWithMargins:function(i){return this.getBoundsNoRotateWithMargins(i).rotate(-this.getRotation(),this.getCenter(i))},getBoundsNoRotateWithMargins:function(i){var s=this.getBoundsNoRotate(i),r=this._containerInnerSize.x*this.getZoom(i);return s.x-=this._margins.left/r,s.y-=this._margins.top/r,s.width+=(this._margins.left+this._margins.right)/r,s.height+=(this._margins.top+this._margins.bottom)/r,s},getCenter:function(i){var s=new e.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),r=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),o,l,a,c,h,p,m,T;return i?s:this.zoomPoint?(o=this.pixelFromPoint(this.zoomPoint,!0),l=this.getZoom(),a=1/l,c=a/this.getAspectRatio(),h=new e.Rect(s.x-a/2,s.y-c/2,a,c),p=this._pixelFromPoint(this.zoomPoint,h),m=p.minus(o),T=m.divide(this._containerInnerSize.x*l),r.plus(T)):r},getZoom:function(i){return i?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(i){return Math.max(Math.min(i,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(i){var s=new e.Rect(i.x,i.y,i.width,i.height);if(!this.wrapHorizontal){var r=this.visibilityRatio*s.width,o=s.x+s.width,l=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,a=this._contentBoundsNoRotate.x-o+r,c=l-s.x-r;r>this._contentBoundsNoRotate.width?s.x+=(a+c)/2:c<0?s.x+=c:a>0&&(s.x+=a)}if(!this.wrapVertical){var h=this.visibilityRatio*s.height,p=s.y+s.height,m=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,T=this._contentBoundsNoRotate.y-p+h,x=m-s.y-h;h>this._contentBoundsNoRotate.height?s.y+=(T+x)/2:x<0?s.y+=x:T>0&&(s.y+=T)}return s},_raiseConstraintsEvent:function(i){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:i})},applyConstraints:function(i){var s=this.getZoom(),r=this._applyZoomConstraints(s);s!==r&&this.zoomTo(r,this.zoomPoint,i);var o=this.getBoundsNoRotate(),l=this._applyBoundaryConstraints(o);return this._raiseConstraintsEvent(i),(o.x!==l.x||o.y!==l.y||i)&&this.fitBounds(l.rotate(-this.getRotation()),i),this},ensureVisible:function(i){return this.applyConstraints(i)},_fitBounds:function(i,s){s=s||{};var r=s.immediately||!1,o=s.constraints||!1,l=this.getAspectRatio(),a=i.getCenter(),c=new e.Rect(i.x,i.y,i.width,i.height,i.degrees+this.getRotation()).getBoundingBox();c.getAspectRatio()>=l?c.height=c.width/l:c.width=c.height*l,c.x=a.x-c.width/2,c.y=a.y-c.height/2;var h=1/c.width;if(o){var p=c.getAspectRatio(),m=this._applyZoomConstraints(h);h!==m&&(h=m,c.width=1/h,c.x=a.x-c.width/2,c.height=c.width/p,c.y=a.y-c.height/2),c=this._applyBoundaryConstraints(c),a=c.getCenter(),this._raiseConstraintsEvent(r)}if(r)return this.panTo(a,!0),this.zoomTo(h,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var T=this.getBounds(),x=this.getZoom();if(x===0||Math.abs(h/x-1)<1e-8)return this.zoomTo(h,!0),this.panTo(a,r);c=c.rotate(-this.getRotation());var S=c.getTopLeft().times(h).minus(T.getTopLeft().times(x)).divide(h-x);return this.zoomTo(h,S,r)},fitBounds:function(i,s){return this._fitBounds(i,{immediately:s,constraints:!1})},fitBoundsWithConstraints:function(i,s){return this._fitBounds(i,{immediately:s,constraints:!0})},fitVertically:function(i){var s=new e.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(s,i)},fitHorizontally:function(i){var s=new e.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(s,i)},getConstrainedBounds:function(i){var s,r;return s=this.getBounds(i),r=this._applyBoundaryConstraints(s),r},panBy:function(i,s){var r=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(r.plus(i),s)},panTo:function(i,s){return s?(this.centerSpringX.resetTo(i.x),this.centerSpringY.resetTo(i.y)):(this.centerSpringX.springTo(i.x),this.centerSpringY.springTo(i.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:i,immediately:s}),this},zoomBy:function(i,s,r){return this.zoomTo(this.zoomSpring.target.value*i,s,r)},zoomTo:function(i,s,r){var o=this;return this.zoomPoint=s instanceof e.Point&&!isNaN(s.x)&&!isNaN(s.y)?s:null,r?this._adjustCenterSpringsForZoomPoint(function(){o.zoomSpring.resetTo(i)}):this.zoomSpring.springTo(i),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:i,refPoint:s,immediately:r}),this},setRotation:function(i){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=e.positiveModulo(i,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:i}),this)},getRotation:function(){return this.degrees},resize:function(i,s){var r=this.getBoundsNoRotate(),o=r,l;return this.containerSize.x=i.x,this.containerSize.y=i.y,this._updateContainerInnerSize(),s&&(l=i.x/this.containerSize.x,o.width=r.width*l,o.height=o.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:i,maintain:s}),this.fitBounds(o,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new e.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var i=this;this._adjustCenterSpringsForZoomPoint(function(){i.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var s=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,s},_adjustCenterSpringsForZoomPoint:function(i){if(this.zoomPoint){var s=this.pixelFromPoint(this.zoomPoint,!0);i();var r=this.pixelFromPoint(this.zoomPoint,!0),o=r.minus(s),l=this.deltaPointsFromPixels(o,!0);this.centerSpringX.shiftBy(l.x),this.centerSpringY.shiftBy(l.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else i()},deltaPixelsFromPointsNoRotate:function(i,s){return i.times(this._containerInnerSize.x*this.getZoom(s))},deltaPixelsFromPoints:function(i,s){return this.deltaPixelsFromPointsNoRotate(i.rotate(this.getRotation()),s)},deltaPointsFromPixelsNoRotate:function(i,s){return i.divide(this._containerInnerSize.x*this.getZoom(s))},deltaPointsFromPixels:function(i,s){return this.deltaPointsFromPixelsNoRotate(i,s).rotate(-this.getRotation())},pixelFromPointNoRotate:function(i,s){return this._pixelFromPointNoRotate(i,this.getBoundsNoRotate(s))},pixelFromPoint:function(i,s){return this._pixelFromPoint(i,this.getBoundsNoRotate(s))},_pixelFromPointNoRotate:function(i,s){return i.minus(s.getTopLeft()).times(this._containerInnerSize.x/s.width).plus(new e.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(i,s){return this._pixelFromPointNoRotate(i.rotate(this.getRotation(),this.getCenter(!0)),s)},pointFromPixelNoRotate:function(i,s){var r=this.getBoundsNoRotate(s);return i.minus(new e.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/r.width).plus(r.getTopLeft())},pointFromPixel:function(i,s){return this.pointFromPixelNoRotate(i,s).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(i,s){var r=this._contentBoundsNoRotate.width;return new e.Point(i*this._contentSizeNoRotate.x/r,s*this._contentSizeNoRotate.x/r)},viewportToImageCoordinates:function(i,s){if(i instanceof e.Point)return this.viewportToImageCoordinates(i.x,i.y);if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(r===1){var o=this.viewer.world.getItemAt(0);return o.viewportToImageCoordinates(i,s,!0)}}return this._viewportToImageDelta(i-this._contentBoundsNoRotate.x,s-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(i,s){var r=this._contentBoundsNoRotate.width;return new e.Point(i/this._contentSizeNoRotate.x*r,s/this._contentSizeNoRotate.x*r)},imageToViewportCoordinates:function(i,s){if(i instanceof e.Point)return this.imageToViewportCoordinates(i.x,i.y);if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(r===1){var o=this.viewer.world.getItemAt(0);return o.imageToViewportCoordinates(i,s,!0)}}var l=this._imageToViewportDelta(i,s);return l.x+=this._contentBoundsNoRotate.x,l.y+=this._contentBoundsNoRotate.y,l},imageToViewportRectangle:function(i,s,r,o){var l=i;if(l instanceof e.Rect||(l=new e.Rect(i,s,r,o)),this.viewer){var a=this.viewer.world.getItemCount();if(a>1)e.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(a===1){var c=this.viewer.world.getItemAt(0);return c.imageToViewportRectangle(i,s,r,o,!0)}}var h=this.imageToViewportCoordinates(l.x,l.y),p=this._imageToViewportDelta(l.width,l.height);return new e.Rect(h.x,h.y,p.x,p.y,l.degrees)},viewportToImageRectangle:function(i,s,r,o){var l=i;if(l instanceof e.Rect||(l=new e.Rect(i,s,r,o)),this.viewer){var a=this.viewer.world.getItemCount();if(a>1)e.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(a===1){var c=this.viewer.world.getItemAt(0);return c.viewportToImageRectangle(i,s,r,o,!0)}}var h=this.viewportToImageCoordinates(l.x,l.y),p=this._viewportToImageDelta(l.width,l.height);return new e.Rect(h.x,h.y,p.x,p.y,l.degrees)},viewerElementToImageCoordinates:function(i){var s=this.pointFromPixel(i,!0);return this.viewportToImageCoordinates(s)},imageToViewerElementCoordinates:function(i){var s=this.imageToViewportCoordinates(i);return this.pixelFromPoint(s,!0)},windowToImageCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var s=i.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(s)},imageToWindowCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var s=this.imageToViewerElementCoordinates(i);return s.plus(e.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(i){return this.pointFromPixel(i,!0)},viewportToViewerElementCoordinates:function(i){return this.pixelFromPoint(i,!0)},viewerElementToViewportRectangle:function(i){return e.Rect.fromSummits(this.pointFromPixel(i.getTopLeft(),!0),this.pointFromPixel(i.getTopRight(),!0),this.pointFromPixel(i.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(i){return e.Rect.fromSummits(this.pixelFromPoint(i.getTopLeft(),!0),this.pixelFromPoint(i.getTopRight(),!0),this.pixelFromPoint(i.getBottomLeft(),!0))},windowToViewportCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var s=i.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(s)},viewportToWindowCoordinates:function(i){e.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var s=this.viewportToViewerElementCoordinates(i);return s.plus(e.getElementPosition(this.viewer.element))},viewportToImageZoom:function(i){if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)e.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(s===1){var r=this.viewer.world.getItemAt(0);return r.viewportToImageZoom(i)}}var o=this._contentSizeNoRotate.x,l=this._containerInnerSize.x,a=this._contentBoundsNoRotate.width,c=l/o*a;return i*c},imageToViewportZoom:function(i){if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)e.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(s===1){var r=this.viewer.world.getItemAt(0);return r.imageToViewportZoom(i)}}var o=this._contentSizeNoRotate.x,l=this._containerInnerSize.x,a=this._contentBoundsNoRotate.width,c=o/l/a;return i*c},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(i){return this.flipped===i?this:(this.flipped=i,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:i}),this)}}}(n),function(e){e.TiledImage=function(f){var _=this;e.console.assert(f.tileCache,"[TiledImage] options.tileCache is required"),e.console.assert(f.drawer,"[TiledImage] options.drawer is required"),e.console.assert(f.viewer,"[TiledImage] options.viewer is required"),e.console.assert(f.imageLoader,"[TiledImage] options.imageLoader is required"),e.console.assert(f.source,"[TiledImage] options.source is required"),e.console.assert(!f.clip||f.clip instanceof e.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),e.EventSource.call(this),this._tileCache=f.tileCache,delete f.tileCache,this._drawer=f.drawer,delete f.drawer,this._imageLoader=f.imageLoader,delete f.imageLoader,f.clip instanceof e.Rect&&(this._clip=f.clip.clone()),delete f.clip;var P=f.x||0;delete f.x;var H=f.y||0;delete f.y,this.normHeight=f.source.dimensions.y/f.source.dimensions.x,this.contentAspectX=f.source.dimensions.x/f.source.dimensions.y;var O=1;f.width?(O=f.width,delete f.width,f.height&&(e.console.error("specifying both width and height to a tiledImage is not supported"),delete f.height)):f.height&&(O=f.height/this.normHeight,delete f.height);var V=f.fitBounds;delete f.fitBounds;var W=f.fitBoundsPlacement||n.Placement.CENTER;delete f.fitBoundsPlacement;var q=f.degrees||0;delete f.degrees,e.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,immediateRender:e.DEFAULT_SETTINGS.immediateRender,blendTime:e.DEFAULT_SETTINGS.blendTime,alwaysBlend:e.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:e.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:e.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:e.DEFAULT_SETTINGS.iOSDevice,debugMode:e.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:e.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:e.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:e.DEFAULT_SETTINGS.placeholderFillStyle,opacity:e.DEFAULT_SETTINGS.opacity,preload:e.DEFAULT_SETTINGS.preload,compositeOperation:e.DEFAULT_SETTINGS.compositeOperation},f),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new e.Spring({initial:P,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new e.Spring({initial:H,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new e.Spring({initial:O,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new e.Spring({initial:q,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),V&&this.fitBounds(V,W,!0),this._drawingHandler=function($){_.viewer.raiseEvent("tile-drawing",e.extend({tiledImage:_},$))}},e.extend(e.TiledImage.prototype,e.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(f){f!==this._fullyLoaded&&(this._fullyLoaded=f,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=e.now(),this._needsDraw=!0},update:function(){var f=this._xSpring.update(),_=this._ySpring.update(),P=this._scaleSpring.update(),H=this._degreesSpring.update();return f||_||P||H?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(f){return this.getBoundsNoRotate(f).rotate(this.getRotation(f),this._getRotationPoint(f))},getBoundsNoRotate:function(f){return f?new e.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new e.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return e.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(f){var _=this.getBoundsNoRotate(f);if(this._clip){var P=f?this._worldWidthCurrent:this._worldWidthTarget,H=P/this.source.dimensions.x,O=this._clip.times(H);_=new e.Rect(_.x+O.x,_.y+O.y,O.width,O.height)}return _.rotate(this.getRotation(f),this._getRotationPoint(f))},getTileBounds:function(f,_,P){var H=this.source.getNumTiles(f),O=(H.x+_%H.x)%H.x,V=(H.y+P%H.y)%H.y,W=this.source.getTileBounds(f,O,V);return this.getFlip()&&(W.x=1-W.x-W.width),W.x+=(_-O)/H.x,W.y+=this._worldHeightCurrent/this._worldWidthCurrent*((P-V)/H.y),W},getContentSize:function(){return new e.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var f=this.imageToWindowCoordinates(new e.Point(0,0)),_=this.imageToWindowCoordinates(this.getContentSize());return new e.Point(_.x-f.x,_.y-f.y)},_viewportToImageDelta:function(f,_,P){var H=P?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(f*(this.source.dimensions.x/H),_*(this.source.dimensions.y*this.contentAspectX/H))},viewportToImageCoordinates:function(f,_,P){var H;return f instanceof e.Point?(P=_,H=f):H=new e.Point(f,_),H=H.rotate(-this.getRotation(P),this._getRotationPoint(P)),P?this._viewportToImageDelta(H.x-this._xSpring.current.value,H.y-this._ySpring.current.value):this._viewportToImageDelta(H.x-this._xSpring.target.value,H.y-this._ySpring.target.value)},_imageToViewportDelta:function(f,_,P){var H=P?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(f/this.source.dimensions.x*H,_/this.source.dimensions.y/this.contentAspectX*H)},imageToViewportCoordinates:function(f,_,P){f instanceof e.Point&&(P=_,_=f.y,f=f.x);var H=this._imageToViewportDelta(f,_);return P?(H.x+=this._xSpring.current.value,H.y+=this._ySpring.current.value):(H.x+=this._xSpring.target.value,H.y+=this._ySpring.target.value),H.rotate(this.getRotation(P),this._getRotationPoint(P))},imageToViewportRectangle:function(f,_,P,H,O){var V=f;V instanceof e.Rect?O=_:V=new e.Rect(f,_,P,H);var W=this.imageToViewportCoordinates(V.getTopLeft(),O),q=this._imageToViewportDelta(V.width,V.height,O);return new e.Rect(W.x,W.y,q.x,q.y,V.degrees+this.getRotation(O))},viewportToImageRectangle:function(f,_,P,H,O){var V=f;f instanceof e.Rect?O=_:V=new e.Rect(f,_,P,H);var W=this.viewportToImageCoordinates(V.getTopLeft(),O),q=this._viewportToImageDelta(V.width,V.height,O);return new e.Rect(W.x,W.y,q.x,q.y,V.degrees-this.getRotation(O))},viewerElementToImageCoordinates:function(f){var _=this.viewport.pointFromPixel(f,!0);return this.viewportToImageCoordinates(_)},imageToViewerElementCoordinates:function(f){var _=this.imageToViewportCoordinates(f);return this.viewport.pixelFromPoint(_,!0)},windowToImageCoordinates:function(f){var _=f.minus(n.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(_)},imageToWindowCoordinates:function(f){var _=this.imageToViewerElementCoordinates(f);return _.plus(n.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(f){var _=this._scaleSpring.current.value;return f=f.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new e.Rect((f.x-this._xSpring.current.value)/_,(f.y-this._ySpring.current.value)/_,f.width/_,f.height/_,f.degrees)},viewportToImageZoom:function(f){var _=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return _*f},imageToViewportZoom:function(f){var _=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return f/_},setPosition:function(f,_){var P=this._xSpring.target.value===f.x&&this._ySpring.target.value===f.y;if(_){if(P&&this._xSpring.current.value===f.x&&this._ySpring.current.value===f.y)return;this._xSpring.resetTo(f.x),this._ySpring.resetTo(f.y),this._needsDraw=!0}else{if(P)return;this._xSpring.springTo(f.x),this._ySpring.springTo(f.y),this._needsDraw=!0}P||this._raiseBoundsChange()},setWidth:function(f,_){this._setScale(f,_)},setHeight:function(f,_){this._setScale(f/this.normHeight,_)},setCroppingPolygons:function(f){var _=function(H){return H instanceof e.Point||typeof H.x=="number"&&typeof H.y=="number"},P=function(H){return H.map(function(O){try{if(_(O))return{x:O.x,y:O.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!e.isArray(f))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=f.map(function(H){return P(H)})}catch(H){e.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),e.console.error(H),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(f,_,P){_=_||e.Placement.CENTER;var H=e.Placement.properties[_],O=this.contentAspectX,V=0,W=0,q=1,$=1;if(this._clip&&(O=this._clip.getAspectRatio(),q=this._clip.width/this.source.dimensions.x,$=this._clip.height/this.source.dimensions.y,f.getAspectRatio()>O?(V=this._clip.x/this._clip.height*f.height,W=this._clip.y/this._clip.height*f.height):(V=this._clip.x/this._clip.width*f.width,W=this._clip.y/this._clip.width*f.width)),f.getAspectRatio()>O){var oe=f.height/$,J=0;H.isHorizontallyCentered?J=(f.width-f.height*O)/2:H.isRight&&(J=f.width-f.height*O),this.setPosition(new e.Point(f.x-V+J,f.y-W),P),this.setHeight(oe,P)}else{var fe=f.width/q,ue=0;H.isVerticallyCentered?ue=(f.height-f.width/O)/2:H.isBottom&&(ue=f.height-f.width/O),this.setPosition(new e.Point(f.x-V,f.y-W+ue),P),this.setWidth(fe,P)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(f){e.console.assert(!f||f instanceof e.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),f instanceof e.Rect?this._clip=f.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(f){this.flipped=!!f,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(f){f!==this.opacity&&(this.opacity=f,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(f){this._preload=!!f,this._needsDraw=!0},getRotation:function(f){return f?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(f,_){this._degreesSpring.target.value===f&&this._degreesSpring.isAtTargetValue()||(_?this._degreesSpring.resetTo(f):this._degreesSpring.springTo(f),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(f){return this.getBoundsNoRotate(f).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(f){f!==this.compositeOperation&&(this.compositeOperation=f,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(f,_){var P=this._scaleSpring.target.value===f;if(_){if(P&&this._scaleSpring.current.value===f)return;this._scaleSpring.resetTo(f),this._updateForScale(),this._needsDraw=!0}else{if(P)return;this._scaleSpring.springTo(f),this._updateForScale(),this._needsDraw=!0}P||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var f=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),_=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,P=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(_/this.minPixelRatio)/Math.log(2))));return P=Math.max(P,this.source.minLevel||0),f=Math.min(f,P),{lowestLevel:f,highestLevel:P}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var f=this.lastDrawn.pop();f.beingDrawn=!1}var _=this.viewport,P=this._viewportToTiledImageRectangle(_.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var H=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(P=P.intersection(H),P===null)return}for(var O=this._getLevelsInterval(),V=O.lowestLevel,W=O.highestLevel,q=null,$=!1,oe=e.now(),J=W;J>=V;J--){var fe=!1,ue=_.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(J),!0).x*this._scaleSpring.current.value;if(J===V||!$&&ue>=this.minPixelRatio)fe=!0,$=!0;else if(!$)continue;var me=_.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(J),!1).x*this._scaleSpring.current.value,le=_.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,ae=this.immediateRender?1:le,ee=Math.min(1,(ue-.5)/.5),ye=ae/Math.abs(ae-me);if(q=i(this,$,fe,J,ee,ye,P,oe,q),p(this.coverage,J))break}C(this,this.lastDrawn),q&&!q.context2D?(o(this,q,oe),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(f,_,P){var H,O;this.wrapHorizontal?(H=e.positiveModulo(_.x,1),O=e.positiveModulo(P.x,1)):(H=Math.max(0,_.x),O=Math.min(1,P.x));var V,W,q=1/this.source.aspectRatio;this.wrapVertical?(V=e.positiveModulo(_.y,q),W=e.positiveModulo(P.y,q)):(V=Math.max(0,_.y),W=Math.min(q,P.y));var $=this.source.getTileAtPoint(f,new e.Point(H,V)),oe=this.source.getTileAtPoint(f,new e.Point(O,W)),J=this.source.getNumTiles(f);return this.wrapHorizontal&&($.x+=J.x*Math.floor(_.x),oe.x+=J.x*Math.floor(P.x)),this.wrapVertical&&($.y+=J.y*Math.floor(_.y/q),oe.y+=J.y*Math.floor(P.y/q)),{topLeft:$,bottomRight:oe}}});function i(f,_,P,H,O,V,W,q,$){var oe=W.getBoundingBox().getTopLeft(),J=W.getBoundingBox().getBottomRight();f.viewer&&f.viewer.raiseEvent("update-level",{tiledImage:f,havedrawn:_,level:H,opacity:O,visibility:V,drawArea:W,topleft:oe,bottomright:J,currenttime:q,best:$}),x(f.coverage,H),x(f.loadingCoverage,H);var fe=f._getCornerTiles(H,oe,J),ue=fe.topLeft,me=fe.bottomRight,le=f.source.getNumTiles(H),ae=f.viewport.pixelFromPoint(f.viewport.getCenter());f.getFlip()&&(me.x+=1,f.wrapHorizontal||(me.x=Math.min(me.x,le.x-1)));for(var ee=ue.x;ee<=me.x;ee++)for(var ye=ue.y;ye<=me.y;ye++){var Y;if(f.getFlip()){var Pe=(le.x+ee%le.x)%le.x;Y=ee+le.x-Pe-Pe-1}else Y=ee;W.intersection(f.getTileBounds(H,Y,ye))!==null&&($=s(f,P,_,Y,ye,H,O,V,ae,le,q,$))}return $}function s(f,_,P,H,O,V,W,q,$,oe,J,fe){var ue=r(H,O,V,f,f.source,f.tilesMatrix,J,oe,f._worldWidthCurrent,f._worldHeightCurrent),me=P;f.viewer&&f.viewer.raiseEvent("update-tile",{tiledImage:f,tile:ue}),T(f.coverage,V,H,O,!1);var le=ue.loaded||ue.loading||m(f.loadingCoverage,V,H,O);if(T(f.loadingCoverage,V,H,O,le),!ue.exists||(_&&!me&&(m(f.coverage,V,H,O)?T(f.coverage,V,H,O,!0):me=!0),!me))return fe;if(c(ue,f.source.tileOverlap,f.viewport,$,q,f),!ue.loaded)if(ue.context2D)a(f,ue);else{var ae=f._tileCache.getImageRecord(ue.cacheKey);if(ae){var ee=ae.getImage();a(f,ue,ee)}}if(ue.loaded){var ye=h(f,ue,H,O,V,W,J);ye&&(f._needsDraw=!0)}else ue.loading?f._tilesLoading++:le||(fe=S(fe,ue));return fe}function r(f,_,P,H,O,V,W,q,$,oe){var J,fe,ue,me,le,ae,ee,ye,Y;return V[P]||(V[P]={}),V[P][f]||(V[P][f]={}),(!V[P][f][_]||!V[P][f][_].flipped!=!H.flipped)&&(J=(q.x+f%q.x)%q.x,fe=(q.y+_%q.y)%q.y,ue=H.getTileBounds(P,f,_),me=O.getTileBounds(P,J,fe,!0),le=O.tileExists(P,J,fe),ae=O.getTileUrl(P,J,fe),H.loadTilesWithAjax?(ee=O.getTileAjaxHeaders(P,J,fe),e.isPlainObject(H.ajaxHeaders)&&(ee=e.extend({},H.ajaxHeaders,ee))):ee=null,ye=O.getContext2D?O.getContext2D(P,J,fe):void 0,Y=new e.Tile(P,f,_,ue,le,ae,ye,H.loadTilesWithAjax,ee,me),H.getFlip()?J===0&&(Y.isRightMost=!0):J===q.x-1&&(Y.isRightMost=!0),fe===q.y-1&&(Y.isBottomMost=!0),Y.flipped=H.flipped,V[P][f][_]=Y),Y=V[P][f][_],Y.lastTouchTime=W,Y}function o(f,_,P){_.loading=!0,f._imageLoader.addJob({src:_.url,loadWithAjax:_.loadWithAjax,ajaxHeaders:_.ajaxHeaders,crossOriginPolicy:f.crossOriginPolicy,ajaxWithCredentials:f.ajaxWithCredentials,callback:function(H,O,V){l(f,_,P,H,O,V)},abort:function(){_.loading=!1}})}function l(f,_,P,H,O,V){if(!H){e.console.log("Tile %s failed to load: %s - error: %s",_,_.url,O),f.viewer.raiseEvent("tile-load-failed",{tile:_,tiledImage:f,time:P,message:O,tileRequest:V}),_.loading=!1,_.exists=!1;return}if(Pf.visibility||_.visibility===f.visibility&&_.squaredDistance1&&q>f.smoothTileEdgesMinZoom&&!f.iOSDevice&&f.getRotation(!0)%360===0&&e.supportsCanvas&&(H=!0,O=P.getScaleForEdgeSmoothing(),V=P.getTranslationForEdgeSmoothing(O,f._drawer.getCanvasSize(!1),f._drawer.getCanvasSize(!0)));var $;H&&(O||($=f.viewport.viewportToViewerElementRectangle(f.getClippedBounds(!0)).getIntegerBoundingBox(),f._drawer.viewer.viewport.getFlip()&&(f.viewport.degrees!==0||f.getRotation(!0)%360!==0)&&($.x=f._drawer.viewer.container.clientWidth-($.x+$.width)),$=$.times(e.pixelDensityRatio)),f._drawer._clear(!0,$)),O||(f.viewport.degrees!==0&&f._drawer._offsetForRotation({degrees:f.viewport.degrees,useSketch:H}),f.getRotation(!0)%360!==0&&f._drawer._offsetForRotation({degrees:f.getRotation(!0),point:f.viewport.pixelFromPointNoRotate(f._getRotationPoint(!0),!0),useSketch:H}),f.viewport.degrees===0&&f.getRotation(!0)%360===0&&f._drawer.viewer.viewport.getFlip()&&f._drawer._flip());var oe=!1;if(f._clip){f._drawer.saveContext(H);var J=f.imageToViewportRectangle(f._clip,!0);J=J.rotate(-f.getRotation(!0),f._getRotationPoint(!0));var fe=f._drawer.viewportToDrawerRectangle(J);O&&(fe=fe.times(O)),V&&(fe=fe.translate(V)),f._drawer.setClip(fe,H),oe=!0}if(f._croppingPolygons){f._drawer.saveContext(H);try{var ue=f._croppingPolygons.map(function(ee){return ee.map(function(ye){var Y=f.imageToViewportCoordinates(ye.x,ye.y,!0).rotate(-f.getRotation(!0),f._getRotationPoint(!0)),Pe=f._drawer.viewportCoordToDrawerCoord(Y);return O&&(Pe=Pe.times(O)),Pe})});f._drawer.clipWithPolygons(ue,H)}catch(ee){e.console.error(ee)}oe=!0}if(f.placeholderFillStyle&&f._hasOpaqueTile===!1){var me=f._drawer.viewportToDrawerRectangle(f.getBounds(!0));O&&(me=me.times(O)),V&&(me=me.translate(V));var le=null;typeof f.placeholderFillStyle=="function"?le=f.placeholderFillStyle(f,f._drawer.context):le=f.placeholderFillStyle,f._drawer.drawRectangle(me,le,H)}for(var ae=_.length-1;ae>=0;ae--)P=_[ae],f._drawer.drawTile(P,f._drawingHandler,H,O,V),P.beingDrawn=!0,f.viewer&&f.viewer.raiseEvent("tile-drawn",{tiledImage:f,tile:P});oe&&f._drawer.restoreContext(H),O||(f.getRotation(!0)%360!==0&&f._drawer._restoreRotationChanges(H),f.viewport.degrees!==0&&f._drawer._restoreRotationChanges(H)),H&&(O&&(f.viewport.degrees!==0&&f._drawer._offsetForRotation({degrees:f.viewport.degrees,useSketch:!1}),f.getRotation(!0)%360!==0&&f._drawer._offsetForRotation({degrees:f.getRotation(!0),point:f.viewport.pixelFromPointNoRotate(f._getRotationPoint(!0),!0),useSketch:!1})),f._drawer.blendSketch({opacity:f.opacity,scale:O,translate:V,compositeOperation:f.compositeOperation,bounds:$}),O&&(f.getRotation(!0)%360!==0&&f._drawer._restoreRotationChanges(!1),f.viewport.degrees!==0&&f._drawer._restoreRotationChanges(!1))),O||f.viewport.degrees===0&&f.getRotation(!0)%360===0&&f._drawer.viewer.viewport.getFlip()&&f._drawer._flip(),A(f,_)}}function A(f,_){if(f.debugMode)for(var P=_.length-1;P>=0;P--){var H=_[P];try{f._drawer.drawDebugInfo(H,_.length,P,f)}catch(O){e.console.error(O)}}}}(n),function(e){var i=function(r){e.console.assert(r,"[TileCache.cacheTile] options is required"),e.console.assert(r.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(r.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=r.tile,this.tiledImage=r.tiledImage},s=function(r){e.console.assert(r,"[ImageRecord] options is required"),e.console.assert(r.image,"[ImageRecord] options.image is required"),this._image=r.image,this._tiles=[]};s.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var r=document.createElement("canvas");r.width=this._image.width,r.height=this._image.height,this._renderedContext=r.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(r){e.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=r},addTile:function(r){e.console.assert(r,"[ImageRecord.addTile] tile is required"),this._tiles.push(r)},removeTile:function(r){for(var o=0;othis._maxImageCacheCount){for(var c=null,h=-1,p=null,m,T,x,S,C,A,f=this._tilesLoaded.length-1;f>=0;f--)if(A=this._tilesLoaded[f],m=A.tile,!(m.level<=o||m.beingDrawn)){if(!c){c=m,h=f,p=A;continue}S=m.lastTouchTime,T=c.lastTouchTime,C=m.level,x=c.level,(Sx)&&(c=m,h=f,p=A)}c&&h>=0&&(this._unloadTile(p),l=h)}this._tilesLoaded[l]=new i({tile:r.tile,tiledImage:r.tiledImage})},clearTilesFor:function(r){e.console.assert(r,"[TileCache.clearTilesFor] tiledImage is required");for(var o,l=0;l=this._items.length)throw new Error("Index bigger than number of layers.");s===r||r===-1||(this._items.splice(r,1),this._items.splice(s,0,i),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:i,previousIndex:r,newIndex:s}))},removeItem:function(i){e.console.assert(i,"[World.removeItem] item is required");var s=e.indexOf(this._items,i);s!==-1&&(i.removeHandler("bounds-change",this._delegatedFigureSizes),i.removeHandler("clip-change",this._delegatedFigureSizes),i.destroy(),this._items.splice(s,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(i))},removeAll:function(){this.viewer._cancelPendingImages();var i,s;for(s=0;sS.height?C=a:C=a*(S.width/S.height),A=C*(S.height/S.width),f=new e.Point(m+(a-C)/2,T+(a-A)/2),x.setPosition(f,s),x.setWidth(C,s),r==="horizontal"?m+=h:T+=h;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var i=this._homeBounds?this._homeBounds.clone():null,s=this._contentSize?this._contentSize.clone():null,r=this._contentFactor||0;if(!this._items.length)this._homeBounds=new e.Rect(0,0,1,1),this._contentSize=new e.Point(1,1),this._contentFactor=1;else{var o=this._items[0],l=o.getBounds();this._contentFactor=o.getContentSize().x/l.width;for(var a=o.getClippedBounds().getBoundingBox(),c=a.x,h=a.y,p=a.x+a.width,m=a.y+a.height,T=1;T{t=i,n=s});return e.resolve=t,e.reject=n,e}const ps=.01,Hf={directives:{clickOutside:Pn.directive},data(){return{defaultCanvasCss:"",filtersVisible:!1,loadingTimeout:null,overlays:[],promise:Rn(),tileSources:{},viewer:null,viewerState:{},zoomFactor:1.5}},computed:{filtersActive(){return Object.keys(this.$store.options.filters).length>0},saturation(){const t=this.$store.options.filters.saturate;return typeof t=="number"?t:1}},watch:{"$store.annotations":{handler(){this.updateOverlays()},deep:!0},"$store.options.annotationId":function(t){var r;if(this.updateOverlays(),!t)return;const n=this.viewer.viewport.getBounds(),e=(r=this.overlays.find(o=>o.id===t))==null?void 0:r.element;if(!e)return;const s=this.viewer.getOverlayById(e).getBounds(this.viewer.viewport);n.intersection(s)||this.viewer.viewport.fitBoundsWithConstraints(s)},"$store.options.pages":function(t,n){const e=t.length!==n.length;this.loadImageInfo(e)},"$store.options.view":function(){this.updateOverlays()}},mounted(){this.loadImageInfo(),this.$store.readyPromises.push(this.promise),this.$store.rootElement.addEventListener("keydown",this.onKeydown),this.$store.rootElement.addEventListener("keypress",this.onKeypress)},beforeUnmount(){this.viewer&&this.viewer.destroy(),this.$store.rootElement.removeEventListener("keydown",this.onKeydown),this.$store.rootElement.removeEventListener("keypress",this.onKeypress)},methods:{closeFilters(){this.filtersVisible=!1},initViewer(t){const n=[];let e=0,i,s=0;if(this.$store.options.pages.forEach((r,o)=>{let l=1;r<1?(l=0,i=o>0?this.$store.pageCount:1):i=r;const a=this.tileSources[i];if(!a)return;e||(e=a.width);const c=a.width/e;n.push({opacity:l,tileSource:a,width:c,x:s}),s+=c+ps}),this.viewer){this.viewer.addOnceHandler("open",()=>{if(this.viewerState.isReset||t)this.resetScan();else{if(this.viewer.viewport.applyConstraints(!0),!this.$store.options.optionsResetOnPageChange)return;this.$store.options.optionsResetOnPageChange.forEach(r=>{if(r==="filters")this.resetFilters();else if(r==="pan"){const o=this.viewer.viewport.getBounds();if(o.x<=0&&o.y<=0)return;const l=this.$store.options.pages[0]?0:1;this.viewer.viewport.panTo({x:o.x>0?o.width/2+l:this.$store.options.pan.x,y:o.y>0?o.height/2:this.$store.options.pan.y}),this.$store.updateOptions({pan:{}})}else r==="rotation"?(this.viewer.viewport.setRotation(0),this.$store.updateOptions({rotation:null})):r==="zoom"&&(this.viewer.viewport.goHome(),this.$store.updateOptions({zoom:null}))})}}),this.viewer.open(n);return}this.viewer=Bi({animationTime:.4,element:this.$refs.image,immediateRender:!0,preload:!this.$store.isMobile(),preserveImageSizeOnResize:!0,preserveViewport:!0,showNavigationControl:!1,showZoomControl:!1,tileSources:n,visibilityRatio:.2,...this.$store.options.viewer}),this.viewer.innerTracker.keyHandler=null,this.viewer.gestureSettingsMouse.clickToZoom=!1,this.viewer.addHandler("animation-finish",()=>{if(this.viewerState.isReset){this.removeScanOptions();return}const r=this.viewer.viewport.getCenter();this.$store.updateOptions({pan:{x:Math.round(r.x*1e3)/1e3,y:Math.round(r.y*1e3)/1e3},zoom:Math.round(this.viewer.viewport.getZoom()*1e3)/1e3})}),this.viewer.addHandler("canvas-click",()=>{document.body.click()}),this.viewer.addHandler("open",()=>{this.startLoadingWatch(),this.$store.options.pan.x!==void 0||this.$store.options.pan.y!==void 0||this.$store.options.zoom?((this.$store.options.pan.x!==void 0||this.$store.options.pan.y!==void 0)&&this.viewer.viewport.panTo({x:this.$store.options.pan.x,y:this.$store.options.pan.y},!0),this.$store.options.zoom&&this.viewer.viewport.zoomTo(this.$store.options.zoom,null,!0)):this.viewer.viewport.goHome(),this.$store.options.rotation!==null&&this.viewer.viewport.setRotation(this.$store.options.rotation),this.updateOverlays()}),this.viewer.addHandler("pan",this.updateViewerState),this.viewer.addHandler("resize",this.updateViewerState),this.viewer.addHandler("zoom",this.updateViewerState),this.viewer.addHandler("tile-load-failed",r=>{this.$store.addError(`Error loading image: ${r.message}`)}),this.defaultCanvasCss=this.viewer.drawer.canvas.style.cssText,this.updateFilterStyle(),this.$api.expose(this.resetScan),this.$api.expose(this.viewer,"viewer"),this.promise.resolve()},loadImageInfo(t=!1){this.stopLoadingWatch();const n=[];this.$store.options.pages.forEach(e=>{var s,r;if(e<1||this.tileSources[e])return;const i=(r=(s=this.$store.manifest.items[e-1].items)==null?void 0:s[0].items)==null?void 0:r[0].body;if(i.service){const o=i.service instanceof Array?i.service[0]:i.service,l=o.id||o["@id"],a=`${l}${l.at(-1)==="/"?"":"/"}info.json`;n.push(this.$store.fetchJson(a).then(c=>({...c,page:e}),c=>{let h;c.response&&c.response.statusText?h=c.response.statusText:c.message&&(h=c.message),this.$store.addError(`Error loading info file for page ${e}${h?`: ${h}`:""}`)}))}else this.tileSources[e]={type:"image",url:i.id,width:i.width,height:i.height}}),n.length?Promise.all(n).then(e=>{e.forEach(i=>{i&&(this.tileSources[i.page]=i)}),this.initViewer(t)}):this.initViewer(t)},onKeydown(t){t.key==="Escape"&&(this.filtersVisible=!1,this.$store.rootElement.focus()),[45,48,96].includes(t.keyCode)&&(t.shiftKey?this.resetScan(t):this.viewer.viewport.goHome())},onKeypress(t){if(!Cn(t))switch(t.key){case"r":case"R":this.rotateRight(t);break;case"i":this.filtersVisible=!this.filtersVisible,this.filtersVisible?this.$nextTick(()=>this.$refs.firstSlider.focus()):this.$store.rootElement.focus();break;case"I":this.resetFilters();break;case"+":case"=":case"W":this.viewer.viewport.zoomBy(1.1),this.viewer.viewport.applyConstraints();break;case"-":case"_":case"S":this.viewer.viewport.zoomBy(.9),this.viewer.viewport.applyConstraints();break;case"w":this.viewer.innerTracker.keyDownHandler({keyCode:38});break;case"s":this.viewer.innerTracker.keyDownHandler({keyCode:40});break;case"a":this.viewer.innerTracker.keyDownHandler({keyCode:37});break;case"d":this.viewer.innerTracker.keyDownHandler({keyCode:39});break}},removeScanOptions(){this.$store.updateOptions({pan:{},zoom:null})},resetFilters(){this.viewer.drawer.canvas.style.cssText=this.defaultCanvasCss,this.$store.updateOptions({filters:{}})},resetScan(t){t&&(this.viewer.viewport.setRotation(0),this.$store.updateOptions({rotation:null}),this.filtersActive&&this.resetFilters()),this.viewer.viewport.goHome(),this.removeScanOptions()},rotateRight(t){const{viewport:n}=this.viewer,e=t&&t.shiftKey?0:(n.getRotation()+90)%360;n.setRotation(e),this.$store.updateOptions({rotation:e||null})},setFilter(t,n){const e=n.target.valueAsNumber;e===1?delete this.$store.options.filters[t]:this.$store.options.filters[t]=e,this.$store.updateOptions({filters:this.$store.options.filters}),this.updateFilterStyle()},startLoadingWatch(){this.$store.loading=0;for(let t=this.viewer.world.getItemCount()-1;t>=0;t-=1){const n=this.viewer.world.getItemAt(t);if(n&&n._tilesLoading){this.$store.loading=1;break}}this.loadingTimeout=setTimeout(this.startLoadingWatch,200)},stopLoadingWatch(){clearTimeout(this.loadingTimeout)},toggleOverlays(){this.$store.updateOptions({annotationsVisible:this.$store.options.annotationsVisible!==!1?!1:null}),this.updateOverlays()},updateFilterStyle(){if(!this.filtersActive)return;const t=[];Object.keys(this.$store.options.filters).forEach(e=>{t.push(`${e}(${this.$store.options.filters[e]})`)});const n=t.join(" ");this.viewer.drawer.canvas.style.cssText=`${this.defaultCanvasCss} filter: ${n}`},updateOverlays(){if(!this.viewer||(this.viewer.clearOverlays(),this.overlays=[],!this.$store.annotationsActive)||this.$store.options.annotationsVisible===!1)return;let t,n=0;this.$store.options.pages.forEach((e,i)=>{var s,r,o;if((r=(s=this.$store.annotations[e])==null?void 0:s[0])!=null&&r.coords){if(!i)t=this.$store.manifest.items[e-1].width;else{const l=this.$store.options.pages[i-1],a=this.$store.manifest.items[l-1].width;n+=ps+a/t}(o=this.$store.annotations[e])==null||o.forEach(l=>{const a=document.createElement("a");a.className="tify-scan-overlay",a.className+=this.$store.options.annotationId===l.id?" -current":"",this.viewer.addOverlay({element:a,location:new Bi.Rect(l.coords[0]/t+n,l.coords[1]/t,l.coords[2]/t,l.coords[3]/t)}),new Bi.MouseTracker({element:a,clickHandler:()=>this.$store.toggleAnnotationId(l.id)});const c={id:l.id,element:a};this.overlays.push(c)})}})},updateViewerState(){const t=this.viewer.viewport.getZoom();this.viewerState.isMaxZoom=t>=this.viewer.viewport.getMaxZoom(),this.viewerState.isMinZoom=t<=this.viewer.viewport.getMinZoom();const n=this.viewer.viewport.getHomeBounds(),e=this.viewer.viewport.getBounds();this.viewerState.isReset=Math.abs(n.height-e.height)<1e-9&&Math.abs(n.width-e.width)<1e-9&&Math.abs(n.x-e.x)<1e-9&&Math.abs(n.y-e.y)<1e-9},zoomIn(){this.viewer.viewport.zoomBy(this.zoomFactor)},zoomOut(){this.viewer.viewport.zoomBy(1/this.zoomFactor)}}},Of={class:"tify-scan"},Mf={class:"tify-sr-only"},Df=["title"],Af=["title"],kf={key:2,class:"tify-scan-buttons"},If=["disabled","title"],Ff=["disabled","title"],Bf=["disabled","title"],zf=["title"],Vf=["title","aria-controls","aria-expanded"],Nf=["id"],Uf={class:"tify-sr-only"},jf=["value"],Wf=["value"],Gf=["value"],qf=["disabled"],Zf=["title"],Kf={ref:"image",class:"tify-scan-image"};function Xf(t,n,e,i,s,r){const o=Rr,l=Cr,a=vf,c=hf,h=rf,p=Qh,m=qh,T=Vh,x=Ah,S=Rh,C=xh,A=mh,f=uh,_=wn("click-outside");return M(),I("section",Of,[D("h2",Mf,Z(t.$translate("Scan")),1),!t.$store.isCustomPageView&&!t.$store.isFirstPage?(M(),I("button",{key:0,type:"button",class:"tify-scan-page-button -previous",title:t.$translate("Previous page"),onClick:n[0]||(n[0]=P=>t.$store.goToPreviousPage())},[ie(o)],8,Df)):se("",!0),!t.$store.isCustomPageView&&!t.$store.isLastPage?(M(),I("button",{key:1,type:"button",class:"tify-scan-page-button -next",title:t.$translate("Next page"),onClick:n[1]||(n[1]=P=>t.$store.goToNextPage())},[ie(l)],8,Af)):se("",!0),s.viewer?(M(),I("div",kf,[D("button",{type:"button",class:"tify-scan-button",disabled:s.viewerState.isMaxZoom,title:t.$translate("Zoom in"),onClick:n[2]||(n[2]=P=>r.zoomIn())},[ie(a)],8,If),D("button",{type:"button",class:"tify-scan-button",disabled:s.viewerState.isReset,title:t.$translate("Reset"),onClick:n[3]||(n[3]=P=>r.resetScan(!!P.shiftKey))},[ie(c)],8,Ff),D("button",{type:"button",class:"tify-scan-button",disabled:s.viewerState.isMinZoom,title:t.$translate("Zoom out"),onClick:n[4]||(n[4]=P=>r.zoomOut())},[ie(h)],8,Bf),D("button",{type:"button",class:_e(["tify-scan-button",{"-active":t.$store.options.rotation}]),title:t.$translate("Rotate"),onClick:n[5]||(n[5]=P=>r.rotateRight(P))},[ie(p)],10,zf),De((M(),I("div",{class:_e(["tify-scan-filters",{"-open":s.filtersVisible}])},[D("button",{type:"button",class:_e(["tify-scan-button",{"-active":r.filtersActive}]),title:t.$translate("Toggle image filters"),"aria-controls":t.$store.getId("filters"),"aria-expanded":s.filtersVisible?"true":"false",onClick:n[6]||(n[6]=P=>s.filtersVisible=!s.filtersVisible)},[ie(m)],10,Vf),De(D("div",{id:t.$store.getId("filters"),class:"tify-scan-filters-popup"},[D("h3",Uf,Z(t.$translate("Image filters")),1),D("p",null,[D("label",null,[ie(T),be(" "+Z(t.$translate("Brightness"))+" ",1),D("b",null,Z(Math.round((t.$store.options.filters.brightness||1)*100))+" %",1),D("input",{ref:"firstSlider",class:"tify-scan-range",max:"2",min:".5",step:".01",type:"range",value:t.$store.options.filters.brightness||1,onInput:n[7]||(n[7]=P=>r.setFilter("brightness",P))},null,40,jf)])]),D("p",null,[D("label",null,[ie(x),be(" "+Z(t.$translate("Contrast"))+" ",1),D("b",null,Z(Math.round((t.$store.options.filters.contrast||1)*100))+" %",1),D("input",{class:"tify-scan-range",max:"2",min:".5",step:".01",type:"range",value:t.$store.options.filters.contrast||1,onInput:n[8]||(n[8]=P=>r.setFilter("contrast",P))},null,40,Wf)])]),D("p",null,[D("label",null,[ie(S),be(" "+Z(t.$translate("Saturation"))+" ",1),D("b",null,Z(Math.round(r.saturation*100))+" %",1),D("input",{class:"tify-scan-range",max:"3",min:"0",step:".01",type:"range",value:r.saturation,onInput:n[9]||(n[9]=P=>r.setFilter("saturate",P))},null,40,Gf)])]),D("p",null,[D("button",{type:"button",class:"tify-scan-reset",disabled:!r.filtersActive,onClick:n[10]||(n[10]=P=>r.resetFilters())},[ie(C),be(" "+Z(t.$translate("Reset")),1)],8,qf)])],8,Nf),[[Ke,s.filtersVisible]])],2)),[[_,r.closeFilters]]),t.$store.annotations.length&&(t.$store.options.view==="fulltext"||t.$store.isMobile())?(M(),I("button",{key:0,type:"button",class:"tify-scan-button",title:t.$translate("Toggle annotations"),onClick:n[11]||(n[11]=P=>r.toggleOverlays())},[t.$store.options.annotationsVisible!==!1?(M(),Ee(A,{key:0})):(M(),Ee(f,{key:1}))],8,Zf)):se("",!0)])):se("",!0),D("div",Kf,null,512)])}const Yf=re(Hf,[["render",Xf]]),Jf={},Qf={class:"tify-icon",viewBox:"0 0 24 24"},$f=D("path",{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"},null,-1),ed=[$f];function td(t,n){return M(),I("svg",Qf,ed)}const id=re(Jf,[["render",td]]),nd={},sd={class:"tify-icon",viewBox:"0 0 24 24"},rd=D("path",{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"},null,-1),od=[rd];function ad(t,n){return M(),I("svg",sd,od)}const ld=re(nd,[["render",ad]]),cd={},ud={class:"tify-icon",viewBox:"0 0 24 24"},hd=D("path",{d:"M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z"},null,-1),fd=[hd];function dd(t,n){return M(),I("svg",ud,fd)}const pd=re(cd,[["render",dd]]),gd={},md={class:"tify-icon",viewBox:"0 0 24 24"},vd=D("path",{d:"M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"},null,-1),yd=[vd];function wd(t,n){return M(),I("svg",md,yd)}const _d=re(gd,[["render",wd]]),Td={},xd={class:"tify-icon",viewBox:"0 0 24 24"},bd=D("path",{d:"M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z"},null,-1),Ed=[bd];function Sd(t,n){return M(),I("svg",xd,Ed)}const Pd=re(Td,[["render",Sd]]),Cd={},Rd={class:"tify-icon",viewBox:"0 0 24 24"},Ld=D("path",{d:"M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z"},null,-1),Hd=[Ld];function Od(t,n){return M(),I("svg",Rd,Hd)}const Md=re(Cd,[["render",Od]]),Dd={},Ad={class:"tify-icon",viewBox:"0 0 24 24"},kd=D("path",{d:"M3,9H17V7H3V9M3,13H17V11H3V13M3,17H17V15H3V17M19,17H21V15H19V17M19,7V9H21V7H19M19,13H21V11H19V13Z"},null,-1),Id=[kd];function Fd(t,n){return M(),I("svg",Ad,Id)}const Bd=re(Dd,[["render",Fd]]),zd={},Vd={class:"tify-icon",viewBox:"0 0 24 24"},Nd=D("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"},null,-1),Ud=[Nd];function jd(t,n){return M(),I("svg",Vd,Ud)}const Wd=re(zd,[["render",jd]]),Gd={},qd={class:"tify-icon",viewBox:"0 0 24 24"},Zd=D("path",{d:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"},null,-1),Kd=[Zd];function Xd(t,n){return M(),I("svg",qd,Kd)}const Yd=re(Gd,[["render",Xd]]),Jd={},Qd={class:"tify-icon",viewBox:"0 0 24 24"},$d=D("path",{d:"M12 16C13.1 16 14 16.9 14 18S13.1 20 12 20 10 19.1 10 18 10.9 16 12 16M12 10C13.1 10 14 10.9 14 12S13.1 14 12 14 10 13.1 10 12 10.9 10 12 10M12 4C13.1 4 14 4.9 14 6S13.1 8 12 8 10 7.1 10 6 10.9 4 12 4M6 16C7.1 16 8 16.9 8 18S7.1 20 6 20 4 19.1 4 18 4.9 16 6 16M6 10C7.1 10 8 10.9 8 12S7.1 14 6 14 4 13.1 4 12 4.9 10 6 10M6 4C7.1 4 8 4.9 8 6S7.1 8 6 8 4 7.1 4 6 4.9 4 6 4M18 16C19.1 16 20 16.9 20 18S19.1 20 18 20 16 19.1 16 18 16.9 16 18 16M18 10C19.1 10 20 10.9 20 12S19.1 14 18 14 16 13.1 16 12 16.9 10 18 10M18 4C19.1 4 20 4.9 20 6S19.1 8 18 8 16 7.1 16 6 16.9 4 18 4Z"},null,-1),ep=[$d];function tp(t,n){return M(),I("svg",Qd,ep)}const ip=re(Jd,[["render",tp]]),np={},sp={class:"tify-icon",viewBox:"0 0 24 24"},rp=D("path",{d:"M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7.41M16,6H18V18H16V6Z"},null,-1),op=[rp];function ap(t,n){return M(),I("svg",sp,op)}const lp=re(np,[["render",ap]]),cp={},up={class:"tify-icon",viewBox:"0 0 24 24"},hp=D("path",{d:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z"},null,-1),fp=[hp];function dp(t,n){return M(),I("svg",up,fp)}const pp=re(cp,[["render",dp]]),gp={},mp={class:"tify-icon",viewBox:"0 0 24 24"},vp=D("path",{d:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z"},null,-1),yp=[vp];function wp(t,n){return M(),I("svg",mp,yp)}const _p=re(gp,[["render",wp]]),Tp={},xp={class:"tify-icon",viewBox:"0 0 24 24"},bp=D("path",{d:"M18.41,16.59L13.82,12L18.41,7.41L17,6L11,12L17,18L18.41,16.59M6,6H8V18H6V6Z"},null,-1),Ep=[bp];function Sp(t,n){return M(),I("svg",xp,Ep)}const Pp=re(Tp,[["render",Sp]]),Cp={},Rp={class:"tify-header-button-group -pagination"},Lp=["disabled","title"],Hp=["disabled","title"],Op=["disabled","title"],Mp=["disabled","title"],Dp=["disabled","title"],Ap=["disabled","title"];function kp(t,n){const e=Pp,i=_p,s=Rr,r=Cr,o=pp,l=lp;return M(),I("div",Rp,[D("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isFirstPage,title:t.$translate("First page"),onClick:n[0]||(n[0]=a=>t.$store.goToFirstPage())},[ie(e)],8,Lp),t.$store.manifest.structures?(M(),I("button",{key:0,type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isFirstPage,title:t.$translate("Previous section"),onClick:n[1]||(n[1]=a=>t.$store.goToPreviousSection())},[ie(i)],8,Hp)):se("",!0),D("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isFirstPage,title:t.$translate("Previous page"),onClick:n[2]||(n[2]=a=>t.$store.goToPreviousPage())},[ie(s)],8,Op),D("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isLastPage,title:t.$translate("Next page"),onClick:n[3]||(n[3]=a=>t.$store.goToNextPage())},[ie(r)],8,Mp),t.$store.manifest.structures?(M(),I("button",{key:1,type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isLastSection,title:t.$translate("Next section"),onClick:n[4]||(n[4]=a=>t.$store.goToNextSection())},[ie(o)],8,Dp)):se("",!0),D("button",{type:"button",class:"tify-header-button",disabled:t.$store.isCustomPageView||t.$store.isLastPage,title:t.$translate("Last page"),onClick:n[5]||(n[5]=a=>t.$store.goToLastPage())},[ie(l)],8,Ap)])}const Ip=re(Cp,[["render",kp]]),Fp={},Bp={class:"tify-icon",viewBox:"0 0 24 24"},zp=D("path",{d:"M6.5 20C8.2 20 10.65 20.65 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5C19.89 4.65 18.67 4.5 17.5 4.5C15.55 4.5 13.45 4.9 12 6C10.55 4.9 8.45 4.5 6.5 4.5C5.33 4.5 4.11 4.65 3 5C2.25 5.25 1.6 5.55 1 6V20.6C1 20.85 1.25 21.1 1.5 21.1C1.6 21.1 1.65 21.1 1.75 21.05C3.15 20.3 4.85 20 6.5 20M12 19.5V8C13.35 7.15 15.8 6.5 17.5 6.5C18.7 6.5 19.9 6.65 21 7V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5Z"},null,-1),Vp=[zp];function Np(t,n){return M(),I("svg",Bp,Vp)}const Up=re(Fp,[["render",Np]]),jp={},Wp={class:"tify-icon",viewBox:"0 0 24 24"},Gp=D("path",{d:"M16,5V11H21V5M10,11H15V5H10M16,18H21V12H16M10,18H15V12H10M4,18H9V12H4M4,11H9V5H4V11Z"},null,-1),qp=[Gp];function Zp(t,n){return M(),I("svg",Wp,qp)}const Kp=re(jp,[["render",Zp]]),Xp={directives:{clickOutside:Pn.directive},data(){return{filter:"",filteredCanvases:[],highlightIndex:0,isOpen:!1}},computed:{currentPageLabel(){const t=this.$store.options.pages[0]||1,n=this.$store.options.pages[0]?this.$store.options.pages[0]-1:0,e=this.$store.localize(this.$store.manifest.items[n].label);return this.$store.getPageLabel(t,e)}},watch:{filter(){this.updateFilteredCanvases(),this.$nextTick(()=>this.updateScroll())},isOpen(){this.isOpen&&(this.filter="",this.highlightIndex=this.$store.options.pages[0]-1)}},mounted(){this.updateFilteredCanvases(),this.$store.rootElement.addEventListener("keydown",this.onKeydown)},beforeUnmount(){this.$store.rootElement.removeEventListener("keydown",this.onKeydown)},methods:{closeDropdown(){this.isOpen=!1},onKeydown(t){if(!Cn(t)){if(t.key==="Escape"){this.closeDropdown();return}t.key==="x"&&(this.toggleDropdown(),t.preventDefault())}},onKeyDownArrow(){this.highlightIndex0&&(this.highlightIndex-=1,this.updateScroll())},setPage(t){this.closeDropdown(),this.$store.setPage(t),this.$store.isMobile()&&this.$store.updateOptions({view:"scan"})},toggleDropdown(){this.isOpen=!this.isOpen,this.isOpen&&this.$nextTick(()=>{this.$refs.search.focus(),this.updateScroll()})},updateFilteredCanvases(){const t=[],n=this.filter.toLowerCase();let e=-1;this.$store.manifest.items.forEach((i,s)=>{const o=this.$store.localize(i.label).toLowerCase().includes(n),l=(s+1).toFixed().includes(n);if(o||l){const a=i;a.page=s+1,a.page===this.$store.options.pages[0]&&(e=t.length),t.push(a)}}),this.highlightIndex=e<0?0:e,this.filteredCanvases=t},updateScroll(){const{list:t}=this.$refs;if(t&&t.children[this.highlightIndex]){const{offsetTop:n}=t.children[this.highlightIndex];t.scrollTop=n-(t.offsetHeight/2-t.children[0].offsetHeight)}}}},Yp={class:"tify-page-select"},Jp=["aria-controls","aria-expanded"],Qp={class:"tify-sr-only"},$p={class:"tify-sr-only"},eg=["id"],tg={class:"tify-page-select-filter"},ig=["aria-label"],ng={ref:"list",class:"tify-page-select-list"},sg=["onClick"];function rg(t,n,e,i,s,r){const o=wn("click-outside");return De((M(),I("div",Yp,[D("button",{type:"button",class:"tify-page-select-button","aria-controls":t.$store.getId("dropdown"),"aria-expanded":s.isOpen?"true":"false",onClick:n[0]||(n[0]=l=>r.toggleDropdown())},[D("span",Qp,Z(t.$translate("Current page:")),1),be(" "+Z(r.currentPageLabel)+" ",1),D("span",$p,"/ "+Z(t.$translate("Toggle page select")),1)],8,Jp),De(D("div",{id:t.$store.getId("dropdown"),key:"dropdown",class:"tify-page-select-dropdown",onClick:n[6]||(n[6]=xt(()=>{},["stop"]))},[D("div",tg,[De(D("input",{ref:"search","onUpdate:modelValue":n[1]||(n[1]=l=>s.filter=l),"aria-label":t.$translate("Filter pages"),type:"text",class:"tify-page-select-input",onKeyup:n[2]||(n[2]=At(l=>s.filteredCanvases[s.highlightIndex]&&t.$store.setPage(s.filteredCanvases[s.highlightIndex].page),["enter"])),onKeydown:[n[3]||(n[3]=At(xt(l=>s.filter?s.filter="":r.closeDropdown(),["prevent"]),["esc"])),n[4]||(n[4]=At(xt(l=>r.onKeyUpArrow(),["prevent"]),["up"])),n[5]||(n[5]=At(xt(l=>r.onKeyDownArrow(),["prevent"]),["down"]))]},null,40,ig),[[Tr,s.filter]])]),D("ol",ng,[(M(!0),I(ve,null,Be(s.filteredCanvases,(l,a)=>(M(),I("li",{key:a,class:_e({"-current":t.$store.options.pages.includes(l.page),"-highlighted":s.highlightIndex===a})},[D("a",{href:"javascript:;",onClick:c=>r.setPage(l.page)},Z(t.$store.getPageLabel(l.page,t.$store.localize(l.label))),9,sg)],2))),128))],512)],8,eg),[[Ke,s.isOpen]])])),[[o,r.closeDropdown]])}const og=re(Xp,[["render",rg]]),ag={directives:{clickOutside:Pn.directive},props:{fulltextEnabled:Boolean,tocEnabled:Boolean},data(){return{controlsVisible:!1,fullscreenActive:!1,screen:this.$store.rootElement.parentNode}},computed:{fullscreenSupported(){return document.fullscreenElement===null||document.webkitFullscreenElement===null},title(){return this.$store.localize((this.$store.manifest||this.$store.collection||{}).label).replace(/(\S{1,10})\s+(\S{1,10})$/,"$1 $2")}},created(){this.$api.expose(this.setView),this.$api.expose(this.toggleDoublePage),this.$api.expose(this.toggleFullscreen)},mounted(){this.$store.rootElement.addEventListener("keydown",this.onKeyDown),["","moz","webkit"].forEach(n=>{document.addEventListener(`${n}fullscreenchange`,this.toggleFullscreenActive)})},beforeUnmount(){this.$store.rootElement.removeEventListener("keydown",this.onKeyDown)},methods:{closeControlsPopup(){this.controlsVisible=!1},detectFullscreen(){let t;switch(null){case document.fullscreenElement:t=document.fullscreenElement;break;case document.webkitFullscreenElement:t=document.webkitFullscreenElement;break;default:t=!1}return t},onKeyDown(t){if(Cn(t))return;if(t.key==="Escape"){this.controlsVisible=!1;return}switch(t.key){case"Backspace":this.$refs.switchViewSmall.offsetParent&&this.toggleView("scan");break;case"1":this.$store.manifest&&this.fulltextEnabled&&this.toggleView("fulltext");break;case"2":this.$store.manifest&&this.toggleView("thumbnails");break;case"3":this.$store.manifest&&this.tocEnabled&&this.toggleView("toc");break;case"4":this.toggleView("info");break;case"5":this.$store.manifest&&this.toggleView("export");break;case"6":this.$store.collection&&this.toggleView("collection");break;case"7":this.toggleView("help");break;case"b":this.$store.manifest&&this.toggleDoublePage();break;case"f":this.toggleFullscreen();break}if(!this.$store.manifest||this.$store.isCustomPageView)return;const{pages:n}=this.$store.options;switch(t.key){case"q":case",":n[0]>1&&this.$store.goToPreviousPage();break;case"e":case".":this.isLastPage||this.$store.goToNextPage();break;case"Q":n[0]>1&&this.$store.goToFirstPage();break;case"E":this.isLastPage||this.$store.goToLastPage();break}},setView(t){this.$store.updateOptions({view:t})},toggleControlsPopup(){this.controlsVisible=!this.controlsVisible},toggleDoublePage(t){const{pages:n}=this.$store.options;let e;if(n.length>1&&t!==!0||t===!1)e=[n[0]<1?1:n[0]];else if(n[0]<2)e=[0,1];else if(n[0]%2>0)e=[n[0]-1,n[0]];else{const i=n[0]1}]),title:t.$translate("Toggle double-page"),onClick:n[0]||(n[0]=(...H)=>r.toggleDoublePage&&r.toggleDoublePage(...H))},[t.$store.isCustomPageView?(M(),Ee(l,{key:0})):(M(),Ee(a,{key:1}))],10,dg)]),ie(c)],8,hg)):se("",!0),De((M(),I("nav",{class:"tify-header-column -controls","aria-label":t.$translate("View")},[D("div",gg,[D("button",{type:"button","aria-controls":t.$store.getId("controls"),"aria-expanded":s.controlsVisible?"true":"false","aria-label":t.$translate("View"),class:"tify-header-button",title:t.$translate("View"),onClick:n[1]||(n[1]=(...H)=>r.toggleControlsPopup&&r.toggleControlsPopup(...H))},[ie(h)],8,mg)],512),D("div",{id:t.$store.getId("controls"),class:_e(["tify-header-popup",{"-visible":s.controlsVisible}])},[D("div",yg,[t.$store.manifest?(M(),I("button",{key:0,type:"button",class:_e(["tify-header-button -scan",{"-active":t.$store.options.view==="scan"}]),"aria-controls":t.$store.getId("scan"),"aria-expanded":t.$store.options.view==="scan"?"true":"false",onClick:n[2]||(n[2]=H=>r.toggleView("scan"))},[ie(p),be(" "+Z(t.$translate("Scan")),1)],10,wg)):se("",!0),e.fulltextEnabled?(M(),I("button",{key:1,type:"button",class:_e(["tify-header-button",{"-active":t.$store.options.view==="fulltext"}]),"aria-controls":t.$store.getId("fulltext"),"aria-expanded":t.$store.options.view==="fulltext"?"true":"false",onClick:n[3]||(n[3]=H=>r.toggleView("fulltext"))},[ie(m),be(" "+Z(t.$translate("Fulltext")),1)],10,_g)):se("",!0),t.$store.manifest?(M(),I("button",{key:2,type:"button",class:_e(["tify-header-button",{"-active":t.$store.options.view==="thumbnails"}]),"aria-controls":t.$store.getId("thumbnails"),"aria-expanded":t.$store.options.view==="thumbnails"?"true":"false",onClick:n[4]||(n[4]=H=>r.toggleView("thumbnails"))},[ie(l),be(" "+Z(t.$translate("Pages")),1)],10,Tg)):se("",!0),e.tocEnabled?(M(),I("button",{key:3,type:"button",class:_e(["tify-header-button",{"-active":t.$store.options.view==="toc"}]),"aria-controls":t.$store.getId("toc"),"aria-expanded":t.$store.options.view==="toc"?"true":"false",onClick:n[5]||(n[5]=H=>r.toggleView("toc"))},[ie(T),be(" "+Z(t.$translate("Contents")),1)],10,xg)):se("",!0),D("button",{type:"button",class:_e(["tify-header-button",{"-active":t.$store.options.view==="info"}]),"aria-controls":t.$store.getId("info"),"aria-expanded":t.$store.options.view==="info"?"true":"false",onClick:n[6]||(n[6]=H=>r.toggleView("info"))},[ie(x),be(" "+Z(t.$translate("Info")),1)],10,bg),t.$store.manifest?(M(),I("button",{key:4,type:"button",class:_e(["tify-header-button",{"-active":t.$store.options.view==="export"}]),"aria-controls":t.$store.getId("export"),"aria-expanded":t.$store.options.view==="export"?"true":"false",onClick:n[7]||(n[7]=H=>r.toggleView("export"))},[ie(S),be(" "+Z(t.$translate("Export")),1)],10,Eg)):se("",!0),t.$store.collection?(M(),I("button",{key:5,type:"button",class:_e(["tify-header-button",{"-active":t.$store.options.view==="collection"}]),"aria-controls":t.$store.getId("collection"),"aria-expanded":t.$store.options==="collection"?"true":"false",onClick:n[8]||(n[8]=H=>r.toggleView("collection"))},[ie(C),be(" "+Z(t.$translate("Collection")),1)],10,Sg)):se("",!0)]),r.fullscreenSupported?(M(),I("div",Pg,[D("button",{type:"button",class:_e(["tify-header-button -icon-only",{"-active":t.$store.options.view==="help"}]),"aria-controls":t.$store.getId("help"),"aria-expanded":t.$store.options.view==="help"?"true":"false",title:t.$translate("Help"),onClick:n[9]||(n[9]=H=>r.toggleView("help"))},[ie(A),be(" "+Z(t.$translate("Help")),1)],10,Cg),s.fullscreenActive?(M(),I("button",{key:1,type:"button",class:"tify-header-button -icon-only",title:t.$translate("Exit fullscreen"),onClick:n[11]||(n[11]=(...H)=>r.toggleFullscreen&&r.toggleFullscreen(...H))},[ie(_),be(" "+Z(t.$translate("Exit fullscreen")),1)],8,Lg)):(M(),I("button",{key:0,type:"button",class:"tify-header-button -icon-only",title:t.$translate("Fullscreen"),onClick:n[10]||(n[10]=(...H)=>r.toggleFullscreen&&r.toggleFullscreen(...H))},[ie(f),be(" "+Z(t.$translate("Fullscreen")),1)],8,Rg))])):se("",!0),t.$store.manifest?(M(),Ee(c,{key:1})):se("",!0)],10,vg)],8,pg)),[[P,r.closeControlsPopup]])])}const Og=re(ag,[["render",Hg]]),Mg={props:{readyPromise:{type:Object,default:null,required:!0}},data(){return{readyToRender:!1}},computed:{hasAnnotations(){var t,n;return(n=(t=this.$store.manifest)==null?void 0:t.items)==null?void 0:n.some(e=>"annotations"in e)},hasToc(){return this.$store.structures.length>0}},watch:{"$store.options.pages":function(){this.$store.annotationsActive&&this.$store.loadAnnotations()},"$store.options.view":function(){this.$store.annotationsActive&&this.$store.loadAnnotations()}},created(){this.$api.expose(this.setLanguage),this.$api.expose(this.$store.setPage)},mounted(){if(this.$store.rootElement=this.$el,!this.$store.options.manifestUrl){this.$store.addError('Missing option "manifestUrl"');return}this.updateBreakpoint(),new ResizeObserver(this.updateBreakpoint).observe(this.$el),Promise.all([this.$store.loadManifest(this.$store.options.manifestUrl),this.setLanguage(this.$store.options.language)]).then(()=>{this.readyToRender=!0,this.$nextTick(()=>{Promise.all(this.$store.readyPromises).then(()=>{setTimeout(this.readyPromise.resolve)})})},t=>{this.readyPromise.reject(t)})},beforeUnmount(){clearTimeout(this.$store.urlUpdateTimeout),window.removeEventListener("popstate",this.$store.initOptions)},methods:{setLanguage(t){const n=Rn();if(t==="en")return this.$store.options.language="en",this.$translate.setTranslation(null),n.resolve(t),n;if(this.$store.options.translationsDirUrl===null)return n.reject(new Error("Could not determine translationsDirUrl")),n;const e=`${this.$store.options.translationsDirUrl}/${t}.json`;return this.$store.fetchJson(e).then(i=>{this.$store.options.language=t,this.$translate.setTranslation(i),n.resolve(t)},i=>{const s=i.response?i.response.statusText:i.message;this.$store.addError(`Error loading translation for "${t}": ${s}`),n.resolve(this.$store.options.language)}),n},updateBreakpoint(){Object.keys(this.$store.options.breakpoints).forEach(t=>{this.$el.clientWidth<=this.$store.options.breakpoints[t]?this.$el.classList.add(`-${t}`):this.$el.classList.remove(`-${t}`)}),this.$el.clientHeight<520?this.$el.classList.add("-short"):this.$el.classList.remove("-short")}}},Dg={class:"tify",tabindex:"-1"},Ag={key:1,class:"tify-main"},kg={key:2,class:"tify-loading",role:"status"},Ig={class:"tify-sr-only"},Fg={key:3,class:"tify-error"},Bg=["aria-label"],zg={class:"tify-error-messages"};function Vg(t,n,e,i,s,r){const o=Og,l=Yf,a=sh,c=Xu,h=Vu,p=Au,m=$c,T=lc,x=Al,S=xr;return M(),I("article",Dg,[s.readyToRender&&(t.$store.collection||t.$store.manifest)?(M(),Ee(o,{key:0,fulltextEnabled:r.hasAnnotations,tocEnabled:r.hasToc},null,8,["fulltextEnabled","tocEnabled"])):se("",!0),s.readyToRender?(M(),I("div",Ag,[t.$store.manifest?(M(),I(ve,{key:0},[ie(l,{id:t.$store.getId("scan")},null,8,["id"]),r.hasAnnotations?De((M(),Ee(a,{key:0,id:t.$store.getId("fulltext")},null,8,["id"])),[[Ke,t.$store.options.view==="fulltext"]]):se("",!0),De(ie(c,{id:t.$store.getId("thumbnails")},null,8,["id"]),[[Ke,t.$store.options.view==="thumbnails"]]),r.hasToc?De((M(),Ee(h,{key:1,id:t.$store.getId("toc")},null,8,["id"])),[[Ke,t.$store.options.view==="toc"]]):se("",!0),De(ie(p,{id:t.$store.getId("export")},null,8,["id"]),[[Ke,t.$store.options.view==="export"]])],64)):se("",!0),t.$store.collection||t.$store.manifest?De((M(),Ee(m,{key:1,id:t.$store.getId("info")},null,8,["id"])),[[Ke,t.$store.options.view==="info"]]):se("",!0),t.$store.collection?De((M(),Ee(T,{key:2,id:t.$store.getId("collection")},null,8,["id"])),[[Ke,t.$store.options.view==="collection"]]):se("",!0),De(ie(x,{id:t.$store.getId("help")},null,8,["id"]),[[Ke,t.$store.options.view==="help"]])])):se("",!0),t.$store.loading?(M(),I("div",kg,[D("span",Ig,Z(t.$translate("Loading")),1)])):se("",!0),t.$store.errors.length?(M(),I("section",Fg,[D("button",{type:"button",class:"tify-error-close","aria-label":t.$translate("Dismiss"),onClick:n[0]||(n[0]=C=>t.$store.clearErrors())},[ie(S)],8,Bg),D("div",zg,[(M(!0),I(ve,null,Be(t.$store.errors,C=>(M(),I("p",{key:C},Z(C),1))),128))])])):se("",!0)])}const Ng=re(Mg,[["render",Vg]]);function Ug(t){return{expose(n,e){t[e||n.name.replace("bound ","")]=n}}}const jg={install:(t,n)=>{t.config.globalProperties.$api=new Ug(n.instance)}},Wg={install:t=>{let n=null;t.config.globalProperties.$translate=(e,i)=>n&&n[e]?n[e]:i||e,t.config.globalProperties.$translate.setTranslation=e=>{n=e}}};var Gg="http://library.stanford.edu/iiif/image-api/compliance.html#level0",qg="http://library.stanford.edu/iiif/image-api/compliance.html#level1",Or="http://library.stanford.edu/iiif/image-api/compliance.html#level2",Zg="http://library.stanford.edu/iiif/image-api/conformance.html#level0",Kg="http://library.stanford.edu/iiif/image-api/conformance.html#level1",Mr="http://library.stanford.edu/iiif/image-api/conformance.html#level2",Xg="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",Yg="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",Dr="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",Jg="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Qg="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",Ar="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",$g="http://iiif.io/api/image/1/level0.json",em="http://iiif.io/api/image/1/profiles/level0.json",tm="http://iiif.io/api/image/1/level1.json",im="http://iiif.io/api/image/1/profiles/level1.json",kr="http://iiif.io/api/image/1/level2.json",Ir="http://iiif.io/api/image/1/profiles/level2.json",nm="http://iiif.io/api/image/2/level0.json",sm="http://iiif.io/api/image/2/profiles/level0.json",rm="http://iiif.io/api/image/2/level1.json",om="http://iiif.io/api/image/2/profiles/level1.json",Fr="http://iiif.io/api/image/2/level2.json",Br="http://iiif.io/api/image/2/profiles/level2.json",am="level0",lm="level1",zr="level2",cm="http://iiif.io/api/image/2/level0",um="http://iiif.io/api/image/2/level1",Vr="http://iiif.io/api/image/2/level2",hm=[Vr,Or,Mr,Dr,Ar,kr,Ir,Fr,Br,zr],fm=[cm,um,Vr,Gg,qg,Or,Zg,Kg,Mr,Xg,Yg,Dr,Jg,Qg,Ar,$g,em,tm,im,kr,Ir,nm,sm,rm,om,Fr,Br,am,lm,zr],dm=fm;function Qe(t){for(let n in t)(typeof t[n]>"u"||t[n]===null)&&delete t[n];return t}function pm(t){return Array.isArray(t)?t:t?[t]:[]}var gm=Object.defineProperty,mm=(t,n,e)=>n in t?gm(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,gs=(t,n,e)=>(mm(t,typeof n!="symbol"?n+"":n,e),e),ms=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function vm(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){let n=ms.indexOf(t["@type"]);if(n!==-1)return ms[n]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}var ym=class Nr{constructor(n,e={}){gs(this,"traversals"),gs(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...n},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...e}}static all(n){return new Nr({collection:[n],manifest:[n],canvas:[n],annotationList:[n],sequence:[n],annotation:[n],contentResource:[n],choice:[n],range:[n],service:[n],layer:[n]})}traverseCollection(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(n))),this.traversals.collection)}traverseCollectionItems(n){if(this.options.mergeMemberProperties){let e=[...(n.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(n.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...n.members||[]];delete n.collections,delete n.manifests,n.members=e}return n.manifests&&(n.manifests=n.manifests.map(e=>this.traverseManifest(typeof e=="string"?{"@id":e,"@type":"sc:Manifest"}:e))),n.collections&&(n.collections=n.collections.map(e=>this.traverseCollection(typeof e=="string"?{"@id":e,"@type":"sc:Collection"}:e))),n.members&&(n.members=n.members.map(e=>typeof e=="string"?e:this.traverseUnknown(e))),n}traverseManifest(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(n))),this.traversals.manifest)}traverseManifestItems(n){return n.sequences&&(n.sequences=n.sequences.map(e=>this.traverseSequence(e))),n.structures&&(n.structures=n.structures.map(e=>this.traverseRange(e))),n}traverseSequence(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(n))),this.traversals.sequence)}traverseSequenceItems(n){return n.canvases&&(n.canvases=n.canvases.map(e=>this.traverseCanvas(e))),n}traverseCanvas(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(n))),this.traversals.canvas)}traverseCanvasItems(n){return n.images&&(n.images=n.images.map(e=>this.traverseAnnotation(e))),n.otherContent&&(n.otherContent=n.otherContent.map(e=>this.traverseAnnotationList(e))),n}traverseRange(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(n))),this.traversals.range)}traverseRangeItems(n){if(this.options.mergeMemberProperties){let e=[...(n.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(n.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...n.members||[]];delete n.ranges,delete n.canvases,n.members=e.length?e.map(i=>this.traverseUnknown(i)):void 0}return n}traverseAnnotationList(n){let e=typeof n=="string"?{"@id":n,"@type":"sc:AnnotationList"}:n;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(e)),this.traversals.annotationList)}traverseAnnotationListItems(n){return n.resources&&(n.resources=n.resources.map(e=>this.traverseAnnotation(e))),n}traverseAnnotation(n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(n))),this.traversals.annotation)}traverseAnnotationItems(n){return n.resource&&(Array.isArray(n.resource)?n.resource=n.resource.map(e=>this.traverseContentResource(e)):n.resource=this.traverseContentResource(n.resource)),n.on,n}traverseLayer(n){return this.traverseType(this.traverseLinking(this.traverseLayerItems(n)),this.traversals.layer)}traverseLayerItems(n){return n.otherContent&&(n.otherContent=n.otherContent.map(e=>this.traverseAnnotationList(e))),n}traverseChoice(n){return this.traverseType(this.traverseChoiceItems(n),this.traversals.choice)}traverseChoiceItems(n){return n.default&&n.default!=="rdf:nil"&&(n.default=this.traverseContentResource(n.default)),n.item&&n.item!=="rdf:nil"&&(n.item=n.item.map(e=>this.traverseContentResource(e))),n}traverseService(n){return this.traverseType(this.traverseLinking(n),this.traversals.service)}traverseContentResource(n){return n["@type"]==="oa:Choice"?this.traverseChoice(n):this.traverseType(this.traverseDescriptive(this.traverseLinking(n)),this.traversals.contentResource)}traverseUnknown(n){if(!n["@type"]||typeof n=="string")return n;switch(vm(n)){case"sc:Collection":return this.traverseCollection(n);case"sc:Manifest":return this.traverseManifest(n);case"sc:Canvas":return this.traverseCanvas(n);case"sc:Sequence":return this.traverseSequence(n);case"sc:Range":return this.traverseRange(n);case"oa:Annotation":return this.traverseAnnotation(n);case"sc:AnnotationList":return this.traverseAnnotationList(n);case"sc:Layer":return this.traverseLayer(n);case"Service":return this.traverseService(n);case"oa:Choice":return this.traverseChoice(n);case"ContentResource":return this.traverseContentResource(n)}return n.profile?this.traverseService(n):n}traverseImageResource(n){let e=Array.isArray(n),i=Array.isArray(n)?n:[n],s=[];for(let r of i)typeof r=="string"?s.push(this.traverseContentResource({"@id":r,"@type":"dctypes:Image"})):s.push(this.traverseContentResource(r));return!e&&!this.options.convertPropsToArray?s[0]:s}traverseDescriptive(n){return n.thumbnail&&(n.thumbnail=this.traverseImageResource(n.thumbnail)),n.logo&&(n.logo=this.traverseImageResource(n.logo)),n}traverseOneOrMoreServices(n){let e=Array.isArray(n),i=Array.isArray(n)?n:[n],s=[];for(let r of i)s.push(this.traverseService(r));return!e&&!this.options.convertPropsToArray?s[0]:s}traverseLinking(n){return n.related&&(n.related=this.traverseOneOrManyType(n.related,this.traversals.contentResource)),n.rendering&&(n.rendering=this.traverseOneOrManyType(n.rendering,this.traversals.contentResource)),n.service&&(n.service=this.traverseOneOrMoreServices(n.service)),n.seeAlso&&(n.seeAlso=this.traverseOneOrManyType(n.seeAlso,this.traversals.contentResource)),n.within&&(typeof n.within=="string"||(n.within=this.traverseOneOrManyType(n.within,this.traversals.contentResource))),n.startCanvas&&(typeof n.startCanvas=="string"?n.startCanvas=this.traverseType({"@id":n.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):n.startCanvas&&this.traverseType(n.startCanvas,this.traversals.canvas)),n.contentLayer&&(typeof n.contentLayer=="string"?n.contentLayer=this.traverseLayer({"@id":n.contentLayer,"@type":"sc:Layer"}):n.contentLayer=this.traverseLayer(n.contentLayer)),n}traverseOneOrManyType(n,e){if(!Array.isArray(n))if(this.options.convertPropsToArray)n=[n];else return this.traverseType(n,e);return n.map(i=>this.traverseType(i,e))}traverseType(n,e){return e.reduce((i,s)=>{let r=s(i);return typeof r>"u"&&!this.options.allowUndefinedReturn?i:r},n)}},wm="http://library.stanford.edu/iiif/image-api/compliance.html#level1",_m="http://library.stanford.edu/iiif/image-api/compliance.html#level2",Tm="http://library.stanford.edu/iiif/image-api/conformance.html#level1",xm="http://library.stanford.edu/iiif/image-api/conformance.html#level2",bm="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",Em="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",Sm="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",Pm="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",Cm="http://iiif.io/api/image/1/level1.json",Rm="http://iiif.io/api/image/1/profiles/level1.json",Lm="http://iiif.io/api/image/1/level2.json",Hm="http://iiif.io/api/image/1/profiles/level2.json",Om="http://iiif.io/api/image/2/level1.json",Mm="http://iiif.io/api/image/2/profiles/level1.json",Dm="http://iiif.io/api/image/2/level2.json",Am="http://iiif.io/api/image/2/profiles/level2.json",km="level1",Im="level2",Fm="http://iiif.io/api/image/2/level1",Bm="http://iiif.io/api/image/2/level2",zm=[Fm,Bm,wm,_m,Tm,xm,bm,Em,Sm,Pm,Cm,Rm,Lm,Hm,Om,Mm,Dm,Am,km,Im],en={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function Vm(t){if(typeof t=="string")return[t];if(!t)return[];let n=Array.isArray(t)?t:[t],e=[];for(let i of n){if(typeof i=="string"){e.push(i);continue}e.push({"@language":i["@language"]||i.language,"@value":i["@value"]||i.value})}return e}function bt(t,n="none"){if(!t)return{};let e=Vm(t),i={};for(let s of e){if(typeof s=="string"){i[n]=i[n]?i[n]:[],i[n].push(s||"");continue}if(!s["@language"]){i[n]=i[n]?i[n]:[],i[n].push(s["@value"]||"");continue}let r=s["@language"];i[r]=i[r]?i[r]:[],i[r].push(s["@value"]||"")}return i}function Ur(t){if(Array.isArray(t))return Ur(t.find(n=>typeof n=="string"));if(hm.indexOf(t)!==-1)return"level2";if(zm.indexOf(t)!==-1)return"level1";if(dm.indexOf(t)!==-1)return"level0";if(typeof t=="string")return t}function Nm(t){let n=Array.isArray(t)?t:[t];for(let e of n)switch(e){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function Um(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function vs(t){for(let n of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${n}:`))return t.slice(n.length+1);return t}var jm=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Ln(t){let n=t["@id"]||t.id,e=t["@type"]||t.type,i=t.profile||void 0,s=t["@context"]||void 0;if(i){let r=Um(i);if(r)return r}if(s){let r=Nm(s);if(r)return r}if(e){if(Array.isArray(e)){if(e.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(e.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";e=e[0]}for(let r of["sc","oa","dcterms","dctypes","iiif"])if(e.startsWith(`${r}:`)){e=e.slice(r.length+1);break}switch(e){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(e&&jm.indexOf(e)!==-1)return e;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return n&&(n.endsWith(".jpg")||n.endsWith(".png")||n.endsWith(".jpeg"))?"Image":e||"unknown"}var Wm=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function Gm(t){let n=t.match(Wm);return n?n[0]:t}function qm(t,n="Rights/License",e="none"){let i=null,s=[],r=Array.isArray(t)?t:[t];for(let o of r){let l=o?Gm(o):void 0;if(l&&(l.indexOf("creativecommons.org")!==-1||l.indexOf("rightsstatements.org")!==-1)){l.startsWith("https://")?i=`http://${l.slice(8)}`:i=l;continue}l&&s.push({label:{[e]:[n]},value:{[e]:[l]}})}return[i,s]}var Zm=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function Km(t){if(t){let n=Array.isArray(t)?t:[t],e=[];for(let i of n)i==="http://iiif.io/api/presentation/2/context.json"&&e.push("http://iiif.io/api/presentation/3/context.json"),Zm.indexOf(i)===-1&&e.push(i);if(n.length)return e.length===1?e[0]:e}}function Xm(t){return t?t.map(n=>({label:bt(n.label),value:bt(n.value)})):[]}var ys=0;function jr(t,n){let e=encodeURI(t.id||t["@id"]||"").trim();return e&&n?`${e}/${n}`:e||(ys++,`http://example.org/${t["@type"]}${n?`/${n}`:""}/${ys}`)}function it(t){let n=[...t.behavior||[]];t.viewingHint&&n.push(t.viewingHint);let e;return Array.isArray(t.motivation)?e=t.motivation.map(vs):t.motivation&&(e=vs(t.motivation)),{"@context":t["@context"]?Km(t["@context"]):void 0,id:(t["@id"]||jr(t)).trim(),type:Ln(t),behavior:n.length?n:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:e,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function nt(t){let[n,e]=qm(t.license),i=[...t.metadata?Xm(t.metadata):[],...e];return{rights:n,metadata:i.length?i:void 0,label:t.label?bt(t.label):void 0,requiredStatement:t.attribution?{label:bt(en.attributionLabel),value:bt(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?bt(t.description):void 0,thumbnail:Ym(t.thumbnail)}}function Ym(t){return t&&(Array.isArray(t)?t:[t]).map(n=>typeof n=="string"?{id:n,type:"Image"}:(n.type==="unknown"&&(n.type="Image"),n))}function Jm(t){if(!t.within)return;let n=Array.isArray(t.within)?t.within:[t.within],e=[];for(let i of n)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":e.push({id:i,type:"Collection"});break}}else i["@id"]&&e.push({id:i["@id"],type:Ln(i)});return e.length?e:void 0}function gt(t){let n=t.related?Array.isArray(t.related)?t.related:[t.related]:[],e=t.contentLayer;return{provider:t.logo||n.length?[{id:en.providerId,type:"Agent",homepage:n.length?[n[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:bt(en.providerName)}]:void 0,partOf:Jm(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?pm(t.service):void 0,supplementary:e?[e]:void 0}}function Qm(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function $m(t){return Qe({...it(t),...nt(t),...gt(t),items:t.members})}function ev(t){let n=[],e=[],i;for(let r of t.sequences||[])r.canvases.length&&n.push(...r.canvases),r.behavior&&e.push(...r.behavior),r.startCanvas&&(i=r.startCanvas);let s=it(t);return e.length&&(s.behavior?s.behavior.push(...e):s.behavior=e),Qe({...s,...nt(t),...gt(t),start:i,items:n,structures:tv(t.structures)})}function tv(t){if(!t)return t;let n=new Map;for(let i of t)n.set(i.id,i);let e=[];for(let i of t)if(i.items){let s=i.items.map(r=>typeof r=="string"?(e.push(r),n.get(r)||r):r&&r.id?(e.push(r.id),n.get(r.id)||r):r);i.items=s}return t.filter(i=>e.indexOf(i.id)===-1)}function iv(t){return Qe({...it(t),...nt(t),...gt(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:jr(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function nv(t){return Qe({...it(t),...nt(t),...gt(t),items:t.resources&&t.resources.length?t.resources:void 0})}function sv(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function rv(t){function n(e){if(Array.isArray(e)){if(e.length>1)return{type:"List",items:e.map(n)};e=e[0]}if(typeof e=="string")return encodeURI(e).trim();if("@type"in e){let i;if(typeof e.full=="string")i=e.full;else if(e.full["@type"]==="dctypes:Image")i={id:e.full["@id"],type:"Image"};else if(e.full["@type"]==="sc:Canvas")i={id:e.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${e.full["@type"]}`);return{type:"SpecificResource",source:i,selector:tn(e.selector)}}else return encodeURI(e["@id"]).trim()}return Qe({...it(t),...nt(t),...gt(t),target:n(t.on),body:Array.isArray(t.resource)?t.resource.map(ws):ws(t.resource)})}function ws(t){return t.type==="Choice"?t:Wr(t)}function Wr(t){let n=t;return Qe({...it(n),...nt(n),...gt(n),...Qm(n)})}function ov(t){let n=[];return t.default&&t.default!=="rdf:nil"&&n.push(t.default),t.item&&t.item!=="rdf:nil"&&n.push(...t.item),Qe({...it(t),...nt(t),items:n})}function av(t){return Qe({...it(t),...nt(t),...gt(t),items:t.members})}function lv(t){let{"@id":n,"@type":e,"@context":i,profile:s,...r}=t,o={};return n&&(o["@id"]=n),o["@type"]=Ln(t),o["@type"]==="unknown"&&(i&&i.length&&(o["@context"]=i),o["@type"]="Service"),s&&(o.profile=Ur(s)),Qe({...o,...r})}function cv(t){return Qe({...it(t),...nt(t),...gt(t)})}var uv=new ym({collection:[$m],manifest:[ev],canvas:[iv],annotationList:[nv],sequence:[sv],annotation:[rv],contentResource:[Wr],choice:[ov],range:[av],service:[lv],layer:[cv]});function hv(t){return t&&t["@context"]&&(t["@context"]==="http://iiif.io/api/presentation/2/context.json"||t["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||t["@context"]==="http://www.shared-canvas.org/ns/context.json")||t["@context"]==="http://iiif.io/api/image/2/context.json"?uv.traverseUnknown(t):t}function tn(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[tn(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(tn)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}var fv=hv;function nn(t){const{related:n}=t,e=fv(t);return n&&t["@context"]==="http://iiif.io/api/presentation/2/context.json"&&[].concat(n).forEach(i=>{e.homepage=e.homepage||[],e.homepage.push(typeof i=="string"?i:{id:i["@id"],label:i.label,format:i.format})}),e}function dv(t){const n=`tify-${Math.floor(Math.random()*Date.now())}`,e=wi({annotations:[],annotationsAvailable:null,collection:null,errors:[],loading:0,manifest:t.manifest?nn(t.manifest):null,options:t.options||{},readyPromises:[],rootElement:t.rootElement||null,urlUpdateTimeout:null,annotationsActive:Ze(()=>!!(e.options.view==="fulltext"||["scan",""].includes(e.options.view)&&e.options.annotationsVisible!==!1&&e.isMobile())),currentStructure:Ze(()=>{if(!(e.manifest.structures instanceof Array))return!1;const i=[];e.options.pages.forEach(l=>{l&&i.push(e.manifest.items[l-1].id)});const{length:s}=e.manifest.structures;let r,o;for(let l=0;li.includes(h.id))){const h=a.items.length;if((h=0?e.manifest.structures[r]:!1}),isCustomPageView:Ze(()=>{const{pages:i}=e.options;return i?i.length>2||i.length===2&&(i[0]%2>0||i[1]!==i[0]+1)&&i[1]>0:!1}),isFirstPage:Ze(()=>e.options.pages[0]<2),isLastPage:Ze(()=>{const{pages:i}=e.options;return i[0]>=e.pageCount||i[i.length-1]>=e.pageCount}),isLastSection:Ze(()=>{const{pages:i}=e.options,s=i.length-1;return(i[s]?i[s]:i[s-1])>=e.sections[e.sections.length-1].firstPage}),pageCount:Ze(()=>{var i;return(i=e.manifest.items)==null?void 0:i.length}),sections:Ze(()=>{const i=[];return e.manifest.structures&&e.manifest.structures.forEach(s=>{if(!s.items){i.push({firstPage:1,lastPage:e.pageCount});return}const r=s.items[0].id,o=e.manifest.items.findIndex(c=>c.id===r)+1,l=s.items[s.items.length-1].id,a=e.manifest.items.findIndex(c=>c.id===l)+1;i.push({firstPage:o,lastPage:a})}),i}),structures:Ze(()=>{var a,c;if(!((a=e.manifest)!=null&&a.structures))return[];if(e.manifest.structures.some(h=>h.type==="Range"))return e.manifest.structures.length===1&&((c=e.manifest.structures[0].behavior)!=null&&c.includes("top"))?e.manifest.structures[0].items:e.manifest.structures;const i=[],s=e.manifest.items,r=e.manifest.structures.length;for(let h=0;hx.id===m)+1;const T=p.items.at(-1).id;if(p.lastPage=s.findIndex(x=>x.id===T)+1,!s[p.firstPage-1])continue}else s!=null&&s[0]&&(p.firstPage=1,p.lastPage=e.pageCount);p.level=0,p.pageCount=p.lastPage-p.firstPage+1,i.push(p)}let o=0;for(let h=0;h=p.firstPage&&T.lastPage<=p.lastPage&&(p.items=(p.items||[]).filter(x=>x.label),p.items.push(T),T.level+=1,o=Math.max(o,T.level))}}const l=(h,p=0)=>{for(let m=0;mp?h.splice(m,1):T.items&&l(T.items,p+1)}};for(let h=0;h(e.loading=0,Promise.reject(o)))).json().catch(o=>(e.loading=0,Promise.reject(o)));return e.loading>0&&(e.loading-=1),r},async fetchText(i){e.loading+=1;const r=await(await fetch(i).catch(o=>(e.loading=0,Promise.reject(o)))).text().catch(o=>(e.loading=0,Promise.reject(o)));return e.loading>0&&(e.loading-=1),r},getId(i){return n+(i?`-${i}`:"")},getPageLabel(i,s){return e.options.pageLabelFormat.replace("P",i).replace("L",s)},getStartPage(){if(!e.manifest.start||!e.manifest.items)return 1;const i=e.manifest.items.findIndex(s=>s.id===e.manifest.start.id);return i>=0?i+1:1},goToFirstPage(){e.setPage(1)},goToNextPage(){let i=e.options.pages[0]+1;e.options.pages.length>1&&i%2>0&&i=this.sections[o].firstPage||r&&r>=this.sections[o].firstPage;)o+=1;e.setPage(this.sections[o].firstPage)},goToLastPage(){e.setPage(e.pageCount)},goToPreviousPage(){let i=e.options.pages[0]-1;e.options.pages.length>1&&i%2>0&&i>0&&(i-=1),e.setPage(i)},goToPreviousSection(){const{pages:i}=e.options,s=i[0]?i[0]:i[1];let r=this.sections.length-1;for(;s<=this.sections[r].firstPage||s&&s<=this.sections[r].firstPage;)r-=1;e.setPage(this.sections[r].firstPage)},loadAnnotations(){e.annotationsAvailable=null,e.annotations=[],e.options.pages.forEach(async i=>{if(i<1||e.annotations[i])return;const s=e.manifest.items[i-1];if(!("annotations"in s)){this.annotationsAvailable=!1;return}e.annotations[i]=[];let r=s.annotations[0].items;if(!r){const o=s.annotations[0].id;try{r=(await e.fetchJson(o)).resources}catch(l){const a=l.response?l.response.statusText:l.message;console.warn(`Could not load annotations: ${a}`),this.annotationsAvailable=!1;return}}r instanceof Array&&r.forEach(async(o,l)=>{var T,x,S,C,A,f,_,P,H,O;let a;const c=o.id||o["@id"]||((T=o.resource)==null?void 0:T.id)||((x=o.resource)==null?void 0:x["@id"]);if((S=o.resource)!=null&&S.chars?a=o.resource.chars:(A=(C=o.resource)==null?void 0:C[0])!=null&&A.chars?a=(_=(f=o.resource)==null?void 0:f[0])==null?void 0:_.chars:(P=o.resource)!=null&&P.label?a=`${o.resource.label}`:o.body?a=o.body.value:Sn(c)&&(a=await e.fetchText(c)),!a)return;this.annotationsAvailable=!0;const h={id:c,html:Pi(a)},p=((O=(H=o.on)==null?void 0:H.selector)==null?void 0:O.value)||(typeof o.on=="string"?o.on:null)||o.target,m=p==null?void 0:p.split("xywh=")[1];if(m){const V=m.split(",").map(W=>parseFloat(W));V.length===4&&(h.coords=V)}e.annotations[i][l]=h})})},initOptions(i){let s={};if(e.options.urlQueryKey)try{const r=new URLSearchParams(window.location.search);s=JSON.parse(r.get(e.options.urlQueryKey))||{}}catch{}s.view===""&&e.isMobile()&&(s.view="scan"),s.pages&&!fs(s.pages,e.pageCount)&&(e.addError("Invalid pages, reset to start page"),s.pages=null),e.options.annotationId=s.annotationId,e.options.childManifestUrl=s.childManifestUrl||e.options.childManifestUrl,e.options.filters=s.filters||e.options.filters,e.options.annotationsVisible=s.annotationsVisible,e.options.pages=i&&i.type==="popstate"?s.pages||[e.getStartPage()]:s.pages||e.options.pages||[e.getStartPage()],e.options.pan=s.panX||s.panY?{x:s.panX,y:s.panY}:s.pan||e.options.pan,e.options.rotation=parseInt(s.rotation,10)||e.options.rotation,e.options.view=s.view||s.view===""?s.view:e.options.view,e.options.zoom=parseFloat(s.zoom)||e.options.zoom},isMobile(){return e.rootElement.offsetWidth{const l=nn(o);if(s.expectedType&&l.type!==s.expectedType){const c=`Expected manifest of type ${s.expectedType}, but got ${l.type}`;return e.addError(c),r.reject(c),r}if(e.manifest=null,await Ws(),l.type==="Manifest")return e.manifest=l,e.initOptions(),window.addEventListener("popstate",e.initOptions),s.reset&&e.updateOptions({childManifestUrl:i,pages:[e.getStartPage()],pan:{},rotation:null,view:e.isMobile()?"scan":"collection",zoom:null}),r.resolve(),r;if(l.type==="Collection"){e.collection=l;const c=new URLSearchParams(window.location.search);let h={};try{h=JSON.parse(c.get(e.options.urlQueryKey))||{}}catch{}let p="";if(e.options.urlQueryParams.includes("childManifestUrl")&&h.childManifestUrl?p=h.childManifestUrl:e.collection.manifests&&e.options.childManifestAutoloaded&&(p=e.collection.manifests[0].id),p)await e.loadManifest(p,{expectedType:"Manifest"}),e.updateOptions({childManifestUrl:p});else{const m=h.view||e.options.view;e.updateOptions({view:["collection","help","info"].includes(m)?m:"collection"})}return r.resolve(),r}const a="Please provide a valid IIIF Presentation API manifest";return e.addError(a),r.reject(a),r},o=>{const a=`Error loading IIIF manifest: ${o.response&&(o.response.statusText||o.response.data)||o.message}`;return e.addError(a),r.reject(a),r})},localize(i){const r=" · ";if(!e.options.language)throw new Error("language not set");if(!i)return"";if(typeof i=="string")return i;const o=i[e.options.language]||i[e.options.fallbackLanguage]||Object.values(i)[0];return((o instanceof Array?o.join(r):o)||"").trim()||"—"},setPage(i){let s=i;if(i instanceof Array||(s=[i]),!fs(s,e.pageCount))throw new RangeError("Invalid pages");if(s.length===1&&e.options.pages&&e.options.pages[0]%2<1&&(e.options.pages[1]===e.options.pages[0]+1||e.options.pages[1]===0)){const r=s[0]%2>0?s[0]-1:s[0];s=[r,r===e.pageCount?0:r+1]}return e.updateOptions({pages:s}),s},toggleAnnotationId(i){const s={annotationId:e.options.annotationId===i?null:i,annotationsVisible:e.options.annotationId?null:e.annotationsVisible};s.annotationId&&e.isMobile()&&(s.view=["scan",""].includes(e.options.view)?"fulltext":"scan"),e.updateOptions(s)},updateOptions(i){Object.assign(e.options,i),clearTimeout(e.urlUpdateTimeout),e.options.urlQueryKey&&(e.urlUpdateTimeout=setTimeout(()=>{const s={};e.options.urlQueryParams.forEach(o=>{const l=e.options[o];l===null||o==="pages"&&l.length<2&&l[0]<2||typeof l=="object"&&!Object.keys(l).length?delete s[o]:s[o]=e.options[o]});const r=new URL(window.location);Object.keys(s).length?r.searchParams.set(e.options.urlQueryKey,JSON.stringify(s)):r.searchParams.delete(e.options.urlQueryKey),window.history&&(i.pages?(e.clearErrors(),window.history.pushState({},"",r)):window.history.replaceState({},"",r))},100))}});return e}const pv={convertManifest:nn,install:(t,n={})=>{t.config.globalProperties.$store=new dv(n)}};window.Tify=function(n={}){const e={annotationId:null,annotationsVisible:null,breakpoints:{tiny:359,small:719,medium:959,large:1199},childManifestAutoloaded:!0,childManifestUrl:null,container:null,fallbackLanguage:"en",filters:{},language:"en",manifestUrl:null,optionsResetOnPageChange:["pan"],pageLabelFormat:"P : L",pages:null,pan:{},rotation:null,translationsDirUrl:null,urlQueryKey:null,urlQueryParams:["annotationId","annotationsVisible","childManifestUrl","filters","pages","pan","rotation","view","zoom"],view:"",viewer:{},zoom:null};if(this.options={...e,...n},!this.options.translationsDirUrl){const l=[...document.getElementsByTagName("script")].find(a=>a.src.includes("/tify"));if(l){const{src:a}=l;this.options.translationsDirUrl=`${a.substring(0,a.lastIndexOf("/"))}/translations`}}let i=null;this.ready=new Promise((o,l)=>{i={resolve:o,reject:l}});const s=this;this.app=dl({render:()=>za(Ng,{readyPromise:i})}).use(jg,{instance:s}).use(Wg).use(pv,{options:this.options});let r=!1;this.mount=o=>{if(r)throw new Error("TIFY is already mounted");const l=typeof o=="string"?document.querySelector(o):o;if(!l)throw new Error("Container element not found");window.getComputedStyle(l).position==="static"&&(l.style.position="relative"),this.app.mount(l),r=!0},this.destroy=()=>{this.app.unmount()},this.options.container&&this.mount(this.options.container)}; diff --git a/translations/de.json b/translations/de.json index de3ae122..e11fda8f 100644 --- a/translations/de.json +++ b/translations/de.json @@ -60,6 +60,7 @@ "Source code": "Quellcode", "Table of Contents": "Inhaltsverzeichnis", "Title": "Titel", + "Toggle annotations": "Annotationen umschalten", "Toggle double-page": "Doppelseite umschalten", "Toggle image filters": "Bildfilter umschalten", "Toggle page select": "Seitenauswahl umschalten",