/**
 * Copyright 2018 The Pennsylvania State University
 * @license Apache-2.0, see License.md for full text.
 */
globalThis.AnchorBehaviors=globalThis.AnchorBehaviors||{},globalThis.AnchorBehaviors.getTarget=(r=null)=>{let getParams=()=>{let r=globalThis.location.hash.substring(1).replace(/^(.+)&?/,"id=$1")||globalThis.location.search.substring(1)||"",e=r?`{"${decodeURI(r).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')}"}`:"{}",o=e&&(r=>{try{JSON.parse(r)}catch(r){return!1}return!0})(e)?JSON.parse(e):{};globalThis.AnchorBehaviors.params=o};return globalThis.AnchorBehaviors.target||(globalThis.AnchorBehaviors.params||("complete"===globalThis.document.readyState&&getParams(),globalThis.onload=getParams()),globalThis.AnchorBehaviors.target=globalThis.document.getElementById(globalThis.AnchorBehaviors.params.id)||globalThis.document.getElementById(`#${globalThis.AnchorBehaviors.params.id}`)||globalThis.document.querySelector(`[resource="#${globalThis.AnchorBehaviors.params.id||globalThis.AnchorBehaviors.params.resource}"]`)||globalThis.document.querySelector(`[resource="${globalThis.AnchorBehaviors.params.id||globalThis.AnchorBehaviors.params.resource}"]`)||((r,e)=>{if(r&&(e.id||e.resource)){let o=r.id?r.id.replace(/#/g,""):null,a=r.resource?r.resource.replace(/#/g,""):null,l=e.id?e.id.replace(/#/g,""):null,s=e.resource?e.resource.replace(/#/g,""):null;if(o&&o===l||o&&o===s||a&&a===l||a&&a===s)return r}})(r,globalThis.AnchorBehaviors.params)||null,globalThis.AnchorBehaviors.target&&globalThis.AnchorBehaviors.target.scrollIntoView()),globalThis.AnchorBehaviors.target};