(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.bootstrap=factory());})(this,(function(){'use strict';const elementMap=new Map();const Data={set(element,key,instance){if(!elementMap.has(element)){elementMap.set(element,new Map());}
const instanceMap=elementMap.get(element);if(!instanceMap.has(key)&&instanceMap.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);return;}
instanceMap.set(key,instance);},get(element,key){if(elementMap.has(element)){return elementMap.get(element).get(key)||null;}
return null;},remove(element,key){if(!elementMap.has(element)){return;}
const instanceMap=elementMap.get(element);instanceMap.delete(key);if(instanceMap.size===0){elementMap.delete(element);}}};const MAX_UID=1000000;const MILLISECONDS_MULTIPLIER=1000;const TRANSITION_END='transitionend';const parseSelector=selector=>{if(selector&&window.CSS&&window.CSS.escape){selector=selector.replace(/#([^\s"#']+)/g,(match,id)=>`#${CSS.escape(id)}`);}
return selector;};const toType=object=>{if(object===null||object===undefined){return`${object}`;}
return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();};const getUID=prefix=>{do{prefix+=Math.floor(Math.random()*MAX_UID);}while(document.getElementById(prefix));return prefix;};const getTransitionDurationFromElement=element=>{if(!element){return 0;}
let{transitionDuration,transitionDelay}=window.getComputedStyle(element);const floatTransitionDuration=Number.parseFloat(transitionDuration);const floatTransitionDelay=Number.parseFloat(transitionDelay);if(!floatTransitionDuration&&!floatTransitionDelay){return 0;}
transitionDuration=transitionDuration.split(',')[0];transitionDelay=transitionDelay.split(',')[0];return(Number.parseFloat(transitionDuration)+Number.parseFloat(transitionDelay))*MILLISECONDS_MULTIPLIER;};const triggerTransitionEnd=element=>{element.dispatchEvent(new Event(TRANSITION_END));};const isElement$1=object=>{if(!object||typeof object!=='object'){return false;}
if(typeof object.jquery!=='undefined'){object=object[0];}
return typeof object.nodeType!=='undefined';};const getElement=object=>{if(isElement$1(object)){return object.jquery?object[0]:object;}
if(typeof object==='string'&&object.length>0){return document.querySelector(parseSelector(object));}
return null;};const isVisible=element=>{if(!isElement$1(element)||element.getClientRects().length===0){return false;}
const elementIsVisible=getComputedStyle(element).getPropertyValue('visibility')==='visible';const closedDetails=element.closest('details:not([open])');if(!closedDetails){return elementIsVisible;}
if(closedDetails!==element){const summary=element.closest('summary');if(summary&&summary.parentNode!==closedDetails){return false;}
if(summary===null){return false;}}
return elementIsVisible;};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;}
if(element.classList.contains('disabled')){return true;}
if(typeof element.disabled!=='undefined'){return element.disabled;}
return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const findShadowRoot=element=>{if(!document.documentElement.attachShadow){return null;}
if(typeof element.getRootNode==='function'){const root=element.getRootNode();return root instanceof ShadowRoot?root:null;}
if(element instanceof ShadowRoot){return element;}
if(!element.parentNode){return null;}
return findShadowRoot(element.parentNode);};const noop=()=>{};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{if(window.jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return window.jQuery;}
return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{for(const callback of DOMContentLoadedCallbacks){callback();}});}
DOMContentLoadedCallbacks.push(callback);}else{callback();}};const isRTL=()=>document.documentElement.dir==='rtl';const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const execute=(possibleCallback,args=[],defaultValue=possibleCallback)=>{return typeof possibleCallback==='function'?possibleCallback(...args):defaultValue;};const executeAfterTransition=(callback,transitionElement,waitForTransition=true)=>{if(!waitForTransition){execute(callback);return;}
const durationPadding=5;const emulatedDuration=getTransitionDurationFromElement(transitionElement)+durationPadding;let called=false;const handler=({target})=>{if(target!==transitionElement){return;}
called=true;transitionElement.removeEventListener(TRANSITION_END,handler);execute(callback);};transitionElement.addEventListener(TRANSITION_END,handler);setTimeout(()=>{if(!called){triggerTransitionEnd(transitionElement);}},emulatedDuration);};const getNextActiveElement=(list,activeElement,shouldGetNext,isCycleAllowed)=>{const listLength=list.length;let index=list.indexOf(activeElement);if(index===-1){return!shouldGetNext&&isCycleAllowed?list[listLength-1]:list[0];}
index+=shouldGetNext?1:-1;if(isCycleAllowed){index=(index+listLength)%listLength;}
return list[Math.max(0,Math.min(index,listLength-1))];};const namespaceRegex=/[^.]*(?=\..*)\.|.*/;const stripNameRegex=/\..*/;const stripUidRegex=/::\d+$/;const eventRegistry={};let uidEvent=1;const customEvents={mouseenter:'mouseover',mouseleave:'mouseout'};const nativeEvents=new Set(['click','dblclick','mouseup','mousedown','contextmenu','mousewheel','DOMMouseScroll','mouseover','mouseout','mousemove','selectstart','selectend','keydown','keypress','keyup','orientationchange','touchstart','touchmove','touchend','touchcancel','pointerdown','pointermove','pointerup','pointerleave','pointercancel','gesturestart','gesturechange','gestureend','focus','blur','change','reset','select','submit','focusin','focusout','load','unload','beforeunload','resize','move','DOMContentLoaded','readystatechange','error','abort','scroll']);function makeEventUid(element,uid){return uid&&`${uid}::${uidEvent++}`||element.uidEvent||uidEvent++;}
function getElementEvents(element){const uid=makeEventUid(element);element.uidEvent=uid;eventRegistry[uid]=eventRegistry[uid]||{};return eventRegistry[uid];}
function bootstrapHandler(element,fn){return function handler(event){hydrateObj(event,{delegateTarget:element});if(handler.oneOff){EventHandler.off(element,event.type,fn);}
return fn.apply(element,[event]);};}
function bootstrapDelegationHandler(element,selector,fn){return function handler(event){const domElements=element.querySelectorAll(selector);for(let{target}=event;target&&target!==this;target=target.parentNode){for(const domElement of domElements){if(domElement!==target){continue;}
hydrateObj(event,{delegateTarget:target});if(handler.oneOff){EventHandler.off(element,event.type,selector,fn);}
return fn.apply(target,[event]);}}};}
function findHandler(events,callable,delegationSelector=null){return Object.values(events).find(event=>event.callable===callable&&event.delegationSelector===delegationSelector);}
function normalizeParameters(originalTypeEvent,handler,delegationFunction){const isDelegated=typeof handler==='string';const callable=isDelegated?delegationFunction:handler||delegationFunction;let typeEvent=getTypeEvent(originalTypeEvent);if(!nativeEvents.has(typeEvent)){typeEvent=originalTypeEvent;}
return[isDelegated,callable,typeEvent];}
function addHandler(element,originalTypeEvent,handler,delegationFunction,oneOff){if(typeof originalTypeEvent!=='string'||!element){return;}
let[isDelegated,callable,typeEvent]=normalizeParameters(originalTypeEvent,handler,delegationFunction);if(originalTypeEvent in customEvents){const wrapFunction=fn=>{return function(event){if(!event.relatedTarget||event.relatedTarget!==event.delegateTarget&&!event.delegateTarget.contains(event.relatedTarget)){return fn.call(this,event);}};};callable=wrapFunction(callable);}
const events=getElementEvents(element);const handlers=events[typeEvent]||(events[typeEvent]={});const previousFunction=findHandler(handlers,callable,isDelegated?handler:null);if(previousFunction){previousFunction.oneOff=previousFunction.oneOff&&oneOff;return;}
const uid=makeEventUid(callable,originalTypeEvent.replace(namespaceRegex,''));const fn=isDelegated?bootstrapDelegationHandler(element,handler,callable):bootstrapHandler(element,callable);fn.delegationSelector=isDelegated?handler:null;fn.callable=callable;fn.oneOff=oneOff;fn.uidEvent=uid;handlers[uid]=fn;element.addEventListener(typeEvent,fn,isDelegated);}
function removeHandler(element,events,typeEvent,handler,delegationSelector){const fn=findHandler(events[typeEvent],handler,delegationSelector);if(!fn){return;}
element.removeEventListener(typeEvent,fn,Boolean(delegationSelector));delete events[typeEvent][fn.uidEvent];}
function removeNamespacedHandlers(element,events,typeEvent,namespace){const storeElementEvent=events[typeEvent]||{};for(const[handlerKey,event]of Object.entries(storeElementEvent)){if(handlerKey.includes(namespace)){removeHandler(element,events,typeEvent,event.callable,event.delegationSelector);}}}
function getTypeEvent(event){event=event.replace(stripNameRegex,'');return customEvents[event]||event;}
const EventHandler={on(element,event,handler,delegationFunction){addHandler(element,event,handler,delegationFunction,false);},one(element,event,handler,delegationFunction){addHandler(element,event,handler,delegationFunction,true);},off(element,originalTypeEvent,handler,delegationFunction){if(typeof originalTypeEvent!=='string'||!element){return;}
const[isDelegated,callable,typeEvent]=normalizeParameters(originalTypeEvent,handler,delegationFunction);const inNamespace=typeEvent!==originalTypeEvent;const events=getElementEvents(element);const storeElementEvent=events[typeEvent]||{};const isNamespace=originalTypeEvent.startsWith('.');if(typeof callable!=='undefined'){if(!Object.keys(storeElementEvent).length){return;}
removeHandler(element,events,typeEvent,callable,isDelegated?handler:null);return;}
if(isNamespace){for(const elementEvent of Object.keys(events)){removeNamespacedHandlers(element,events,elementEvent,originalTypeEvent.slice(1));}}
for(const[keyHandlers,event]of Object.entries(storeElementEvent)){const handlerKey=keyHandlers.replace(stripUidRegex,'');if(!inNamespace||originalTypeEvent.includes(handlerKey)){removeHandler(element,events,typeEvent,event.callable,event.delegationSelector);}}},trigger(element,event,args){if(typeof event!=='string'||!element){return null;}
const $=getjQuery();const typeEvent=getTypeEvent(event);const inNamespace=event!==typeEvent;let jQueryEvent=null;let bubbles=true;let nativeDispatch=true;let defaultPrevented=false;if(inNamespace&&$){jQueryEvent=$.Event(event,args);$(element).trigger(jQueryEvent);bubbles=!jQueryEvent.isPropagationStopped();nativeDispatch=!jQueryEvent.isImmediatePropagationStopped();defaultPrevented=jQueryEvent.isDefaultPrevented();}
const evt=hydrateObj(new Event(event,{bubbles,cancelable:true}),args);if(defaultPrevented){evt.preventDefault();}
if(nativeDispatch){element.dispatchEvent(evt);}
if(evt.defaultPrevented&&jQueryEvent){jQueryEvent.preventDefault();}
return evt;}};function hydrateObj(obj,meta={}){for(const[key,value]of Object.entries(meta)){try{obj[key]=value;}catch(_unused){Object.defineProperty(obj,key,{configurable:true,get(){return value;}});}}
return obj;}
function normalizeData(value){if(value==='true'){return true;}
if(value==='false'){return false;}
if(value===Number(value).toString()){return Number(value);}
if(value===''||value==='null'){return null;}
if(typeof value!=='string'){return value;}
try{return JSON.parse(decodeURIComponent(value));}catch(_unused){return value;}}
function normalizeDataKey(key){return key.replace(/[A-Z]/g,chr=>`-${chr.toLowerCase()}`);}
const Manipulator={setDataAttribute(element,key,value){element.setAttribute(`data-bs-${normalizeDataKey(key)}`,value);},removeDataAttribute(element,key){element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);},getDataAttributes(element){if(!element){return{};}
const attributes={};const bsKeys=Object.keys(element.dataset).filter(key=>key.startsWith('bs')&&!key.startsWith('bsConfig'));for(const key of bsKeys){let pureKey=key.replace(/^bs/,'');pureKey=pureKey.charAt(0).toLowerCase()+pureKey.slice(1,pureKey.length);attributes[pureKey]=normalizeData(element.dataset[key]);}
return attributes;},getDataAttribute(element,key){return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));}};class Config{static get Default(){return{};}
static get DefaultType(){return{};}
static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!');}
_getConfig(config){config=this._mergeConfigObj(config);config=this._configAfterMerge(config);this._typeCheckConfig(config);return config;}
_configAfterMerge(config){return config;}
_mergeConfigObj(config,element){const jsonConfig=isElement$1(element)?Manipulator.getDataAttribute(element,'config'):{};return{...this.constructor.Default,...(typeof jsonConfig==='object'?jsonConfig:{}),...(isElement$1(element)?Manipulator.getDataAttributes(element):{}),...(typeof config==='object'?config:{})};}
_typeCheckConfig(config,configTypes=this.constructor.DefaultType){for(const[property,expectedTypes]of Object.entries(configTypes)){const value=config[property];const valueType=isElement$1(value)?'element':toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}}}}
const VERSION='5.3.2';class BaseComponent extends Config{constructor(element,config){super();element=getElement(element);if(!element){return;}
this._element=element;this._config=this._getConfig(config);Data.set(this._element,this.constructor.DATA_KEY,this);}
dispose(){Data.remove(this._element,this.constructor.DATA_KEY);EventHandler.off(this._element,this.constructor.EVENT_KEY);for(const propertyName of Object.getOwnPropertyNames(this)){this[propertyName]=null;}}
_queueCallback(callback,element,isAnimated=true){executeAfterTransition(callback,element,isAnimated);}
_getConfig(config){config=this._mergeConfigObj(config,this._element);config=this._configAfterMerge(config);this._typeCheckConfig(config);return config;}
static getInstance(element){return Data.get(getElement(element),this.DATA_KEY);}
static getOrCreateInstance(element,config={}){return this.getInstance(element)||new this(element,typeof config==='object'?config:null);}
static get VERSION(){return VERSION;}
static get DATA_KEY(){return`bs.${this.NAME}`;}
static get EVENT_KEY(){return`.${this.DATA_KEY}`;}
static eventName(name){return`${name}${this.EVENT_KEY}`;}}
const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttribute=element.getAttribute('href');if(!hrefAttribute||!hrefAttribute.includes('#')&&!hrefAttribute.startsWith('.')){return null;}
if(hrefAttribute.includes('#')&&!hrefAttribute.startsWith('#')){hrefAttribute=`#${hrefAttribute.split('#')[1]}`;}
selector=hrefAttribute&&hrefAttribute!=='#'?parseSelector(hrefAttribute.trim()):null;}
return selector;};const SelectorEngine={find(selector,element=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(element,selector));},findOne(selector,element=document.documentElement){return Element.prototype.querySelector.call(element,selector);},children(element,selector){return[].concat(...element.children).filter(child=>child.matches(selector));},parents(element,selector){const parents=[];let ancestor=element.parentNode.closest(selector);while(ancestor){parents.push(ancestor);ancestor=ancestor.parentNode.closest(selector);}
return parents;},prev(element,selector){let previous=element.previousElementSibling;while(previous){if(previous.matches(selector)){return[previous];}
previous=previous.previousElementSibling;}
return[];},next(element,selector){let next=element.nextElementSibling;while(next){if(next.matches(selector)){return[next];}
next=next.nextElementSibling;}
return[];},focusableChildren(element){const focusables=['a','button','input','textarea','select','details','[tabindex]','[contenteditable="true"]'].map(selector=>`${selector}:not([tabindex^="-"])`).join(',');return this.find(focusables,element).filter(el=>!isDisabled(el)&&isVisible(el));},getSelectorFromElement(element){const selector=getSelector(element);if(selector){return SelectorEngine.findOne(selector)?selector:null;}
return null;},getElementFromSelector(element){const selector=getSelector(element);return selector?SelectorEngine.findOne(selector):null;},getMultipleElementsFromSelector(element){const selector=getSelector(element);return selector?SelectorEngine.find(selector):[];}};const enableDismissTrigger=(component,method='hide')=>{const clickEvent=`click.dismiss${component.EVENT_KEY}`;const name=component.NAME;EventHandler.on(document,clickEvent,`[data-bs-dismiss="${name}"]`,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
if(isDisabled(this)){return;}
const target=SelectorEngine.getElementFromSelector(this)||this.closest(`.${name}`);const instance=component.getOrCreateInstance(target);instance[method]();});};const NAME$f='alert';const DATA_KEY$a='bs.alert';const EVENT_KEY$b=`.${DATA_KEY$a}`;const EVENT_CLOSE=`close${EVENT_KEY$b}`;const EVENT_CLOSED=`closed${EVENT_KEY$b}`;const CLASS_NAME_FADE$5='fade';const CLASS_NAME_SHOW$8='show';class Alert extends BaseComponent{static get NAME(){return NAME$f;}
close(){const closeEvent=EventHandler.trigger(this._element,EVENT_CLOSE);if(closeEvent.defaultPrevented){return;}
this._element.classList.remove(CLASS_NAME_SHOW$8);const isAnimated=this._element.classList.contains(CLASS_NAME_FADE$5);this._queueCallback(()=>this._destroyElement(),this._element,isAnimated);}
_destroyElement(){this._element.remove();EventHandler.trigger(this._element,EVENT_CLOSED);this.dispose();}
static jQueryInterface(config){return this.each(function(){const data=Alert.getOrCreateInstance(this);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config](this);});}}
enableDismissTrigger(Alert,'close');defineJQueryPlugin(Alert);const NAME$e='button';const DATA_KEY$9='bs.button';const EVENT_KEY$a=`.${DATA_KEY$9}`;const DATA_API_KEY$6='.data-api';const CLASS_NAME_ACTIVE$3='active';const SELECTOR_DATA_TOGGLE$5='[data-bs-toggle="button"]';const EVENT_CLICK_DATA_API$6=`click${EVENT_KEY$a}${DATA_API_KEY$6}`;class Button extends BaseComponent{static get NAME(){return NAME$e;}
toggle(){this._element.setAttribute('aria-pressed',this._element.classList.toggle(CLASS_NAME_ACTIVE$3));}
static jQueryInterface(config){return this.each(function(){const data=Button.getOrCreateInstance(this);if(config==='toggle'){data[config]();}});}}
EventHandler.on(document,EVENT_CLICK_DATA_API$6,SELECTOR_DATA_TOGGLE$5,event=>{event.preventDefault();const button=event.target.closest(SELECTOR_DATA_TOGGLE$5);const data=Button.getOrCreateInstance(button);data.toggle();});defineJQueryPlugin(Button);const NAME$d='swipe';const EVENT_KEY$9='.bs.swipe';const EVENT_TOUCHSTART=`touchstart${EVENT_KEY$9}`;const EVENT_TOUCHMOVE=`touchmove${EVENT_KEY$9}`;const EVENT_TOUCHEND=`touchend${EVENT_KEY$9}`;const EVENT_POINTERDOWN=`pointerdown${EVENT_KEY$9}`;const EVENT_POINTERUP=`pointerup${EVENT_KEY$9}`;const POINTER_TYPE_TOUCH='touch';const POINTER_TYPE_PEN='pen';const CLASS_NAME_POINTER_EVENT='pointer-event';const SWIPE_THRESHOLD=40;const Default$c={endCallback:null,leftCallback:null,rightCallback:null};const DefaultType$c={endCallback:'(function|null)',leftCallback:'(function|null)',rightCallback:'(function|null)'};class Swipe extends Config{constructor(element,config){super();this._element=element;if(!element||!Swipe.isSupported()){return;}
this._config=this._getConfig(config);this._deltaX=0;this._supportPointerEvents=Boolean(window.PointerEvent);this._initEvents();}
static get Default(){return Default$c;}
static get DefaultType(){return DefaultType$c;}
static get NAME(){return NAME$d;}
dispose(){EventHandler.off(this._element,EVENT_KEY$9);}
_start(event){if(!this._supportPointerEvents){this._deltaX=event.touches[0].clientX;return;}
if(this._eventIsPointerPenTouch(event)){this._deltaX=event.clientX;}}
_end(event){if(this._eventIsPointerPenTouch(event)){this._deltaX=event.clientX-this._deltaX;}
this._handleSwipe();execute(this._config.endCallback);}
_move(event){this._deltaX=event.touches&&event.touches.length>1?0:event.touches[0].clientX-this._deltaX;}
_handleSwipe(){const absDeltaX=Math.abs(this._deltaX);if(absDeltaX<=SWIPE_THRESHOLD){return;}
const direction=absDeltaX/this._deltaX;this._deltaX=0;if(!direction){return;}
execute(direction>0?this._config.rightCallback:this._config.leftCallback);}
_initEvents(){if(this._supportPointerEvents){EventHandler.on(this._element,EVENT_POINTERDOWN,event=>this._start(event));EventHandler.on(this._element,EVENT_POINTERUP,event=>this._end(event));this._element.classList.add(CLASS_NAME_POINTER_EVENT);}else{EventHandler.on(this._element,EVENT_TOUCHSTART,event=>this._start(event));EventHandler.on(this._element,EVENT_TOUCHMOVE,event=>this._move(event));EventHandler.on(this._element,EVENT_TOUCHEND,event=>this._end(event));}}
_eventIsPointerPenTouch(event){return this._supportPointerEvents&&(event.pointerType===POINTER_TYPE_PEN||event.pointerType===POINTER_TYPE_TOUCH);}
static isSupported(){return'ontouchstart' in document.documentElement||navigator.maxTouchPoints>0;}}
const NAME$c='carousel';const DATA_KEY$8='bs.carousel';const EVENT_KEY$8=`.${DATA_KEY$8}`;const DATA_API_KEY$5='.data-api';const ARROW_LEFT_KEY$1='ArrowLeft';const ARROW_RIGHT_KEY$1='ArrowRight';const TOUCHEVENT_COMPAT_WAIT=500;const ORDER_NEXT='next';const ORDER_PREV='prev';const DIRECTION_LEFT='left';const DIRECTION_RIGHT='right';const EVENT_SLIDE=`slide${EVENT_KEY$8}`;const EVENT_SLID=`slid${EVENT_KEY$8}`;const EVENT_KEYDOWN$1=`keydown${EVENT_KEY$8}`;const EVENT_MOUSEENTER$1=`mouseenter${EVENT_KEY$8}`;const EVENT_MOUSELEAVE$1=`mouseleave${EVENT_KEY$8}`;const EVENT_DRAG_START=`dragstart${EVENT_KEY$8}`;const EVENT_LOAD_DATA_API$3=`load${EVENT_KEY$8}${DATA_API_KEY$5}`;const EVENT_CLICK_DATA_API$5=`click${EVENT_KEY$8}${DATA_API_KEY$5}`;const CLASS_NAME_CAROUSEL='carousel';const CLASS_NAME_ACTIVE$2='active';const CLASS_NAME_SLIDE='slide';const CLASS_NAME_END='carousel-item-end';const CLASS_NAME_START='carousel-item-start';const CLASS_NAME_NEXT='carousel-item-next';const CLASS_NAME_PREV='carousel-item-prev';const SELECTOR_ACTIVE='.active';const SELECTOR_ITEM='.carousel-item';const SELECTOR_ACTIVE_ITEM=SELECTOR_ACTIVE+SELECTOR_ITEM;const SELECTOR_ITEM_IMG='.carousel-item img';const SELECTOR_INDICATORS='.carousel-indicators';const SELECTOR_DATA_SLIDE='[data-bs-slide], [data-bs-slide-to]';const SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]';const KEY_TO_DIRECTION={[ARROW_LEFT_KEY$1]:DIRECTION_RIGHT,[ARROW_RIGHT_KEY$1]:DIRECTION_LEFT};const Default$b={interval:5000,keyboard:true,pause:'hover',ride:false,touch:true,wrap:true};const DefaultType$b={interval:'(number|boolean)',keyboard:'boolean',pause:'(string|boolean)',ride:'(boolean|string)',touch:'boolean',wrap:'boolean'};class Carousel extends BaseComponent{constructor(element,config){super(element,config);this._interval=null;this._activeElement=null;this._isSliding=false;this.touchTimeout=null;this._swipeHelper=null;this._indicatorsElement=SelectorEngine.findOne(SELECTOR_INDICATORS,this._element);this._addEventListeners();if(this._config.ride===CLASS_NAME_CAROUSEL){this.cycle();}}
static get Default(){return Default$b;}
static get DefaultType(){return DefaultType$b;}
static get NAME(){return NAME$c;}
next(){this._slide(ORDER_NEXT);}
nextWhenVisible(){if(!document.hidden&&isVisible(this._element)){this.next();}}
prev(){this._slide(ORDER_PREV);}
pause(){if(this._isSliding){triggerTransitionEnd(this._element);}
this._clearInterval();}
cycle(){this._clearInterval();this._updateInterval();this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval);}
_maybeEnableCycle(){if(!this._config.ride){return;}
if(this._isSliding){EventHandler.one(this._element,EVENT_SLID,()=>this.cycle());return;}
this.cycle();}
to(index){const items=this._getItems();if(index>items.length-1||index<0){return;}
if(this._isSliding){EventHandler.one(this._element,EVENT_SLID,()=>this.to(index));return;}
const activeIndex=this._getItemIndex(this._getActive());if(activeIndex===index){return;}
const order=index>activeIndex?ORDER_NEXT:ORDER_PREV;this._slide(order,items[index]);}
dispose(){if(this._swipeHelper){this._swipeHelper.dispose();}
super.dispose();}
_configAfterMerge(config){config.defaultInterval=config.interval;return config;}
_addEventListeners(){if(this._config.keyboard){EventHandler.on(this._element,EVENT_KEYDOWN$1,event=>this._keydown(event));}
if(this._config.pause==='hover'){EventHandler.on(this._element,EVENT_MOUSEENTER$1,()=>this.pause());EventHandler.on(this._element,EVENT_MOUSELEAVE$1,()=>this._maybeEnableCycle());}
if(this._config.touch&&Swipe.isSupported()){this._addTouchEventListeners();}}
_addTouchEventListeners(){for(const img of SelectorEngine.find(SELECTOR_ITEM_IMG,this._element)){EventHandler.on(img,EVENT_DRAG_START,event=>event.preventDefault());}
const endCallBack=()=>{if(this._config.pause!=='hover'){return;}
this.pause();if(this.touchTimeout){clearTimeout(this.touchTimeout);}
this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),TOUCHEVENT_COMPAT_WAIT+this._config.interval);};const swipeConfig={leftCallback:()=>this._slide(this._directionToOrder(DIRECTION_LEFT)),rightCallback:()=>this._slide(this._directionToOrder(DIRECTION_RIGHT)),endCallback:endCallBack};this._swipeHelper=new Swipe(this._element,swipeConfig);}
_keydown(event){if(/input|textarea/i.test(event.target.tagName)){return;}
const direction=KEY_TO_DIRECTION[event.key];if(direction){event.preventDefault();this._slide(this._directionToOrder(direction));}}
_getItemIndex(element){return this._getItems().indexOf(element);}
_setActiveIndicatorElement(index){if(!this._indicatorsElement){return;}
const activeIndicator=SelectorEngine.findOne(SELECTOR_ACTIVE,this._indicatorsElement);activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);activeIndicator.removeAttribute('aria-current');const newActiveIndicator=SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`,this._indicatorsElement);if(newActiveIndicator){newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2);newActiveIndicator.setAttribute('aria-current','true');}}
_updateInterval(){const element=this._activeElement||this._getActive();if(!element){return;}
const elementInterval=Number.parseInt(element.getAttribute('data-bs-interval'),10);this._config.interval=elementInterval||this._config.defaultInterval;}
_slide(order,element=null){if(this._isSliding){return;}
const activeElement=this._getActive();const isNext=order===ORDER_NEXT;const nextElement=element||getNextActiveElement(this._getItems(),activeElement,isNext,this._config.wrap);if(nextElement===activeElement){return;}
const nextElementIndex=this._getItemIndex(nextElement);const triggerEvent=eventName=>{return EventHandler.trigger(this._element,eventName,{relatedTarget:nextElement,direction:this._orderToDirection(order),from:this._getItemIndex(activeElement),to:nextElementIndex});};const slideEvent=triggerEvent(EVENT_SLIDE);if(slideEvent.defaultPrevented){return;}
if(!activeElement||!nextElement){return;}
const isCycling=Boolean(this._interval);this.pause();this._isSliding=true;this._setActiveIndicatorElement(nextElementIndex);this._activeElement=nextElement;const directionalClassName=isNext?CLASS_NAME_START:CLASS_NAME_END;const orderClassName=isNext?CLASS_NAME_NEXT:CLASS_NAME_PREV;nextElement.classList.add(orderClassName);reflow(nextElement);activeElement.classList.add(directionalClassName);nextElement.classList.add(directionalClassName);const completeCallBack=()=>{nextElement.classList.remove(directionalClassName,orderClassName);nextElement.classList.add(CLASS_NAME_ACTIVE$2);activeElement.classList.remove(CLASS_NAME_ACTIVE$2,orderClassName,directionalClassName);this._isSliding=false;triggerEvent(EVENT_SLID);};this._queueCallback(completeCallBack,activeElement,this._isAnimated());if(isCycling){this.cycle();}}
_isAnimated(){return this._element.classList.contains(CLASS_NAME_SLIDE);}
_getActive(){return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM,this._element);}
_getItems(){return SelectorEngine.find(SELECTOR_ITEM,this._element);}
_clearInterval(){if(this._interval){clearInterval(this._interval);this._interval=null;}}
_directionToOrder(direction){if(isRTL()){return direction===DIRECTION_LEFT?ORDER_PREV:ORDER_NEXT;}
return direction===DIRECTION_LEFT?ORDER_NEXT:ORDER_PREV;}
_orderToDirection(order){if(isRTL()){return order===ORDER_PREV?DIRECTION_LEFT:DIRECTION_RIGHT;}
return order===ORDER_PREV?DIRECTION_RIGHT:DIRECTION_LEFT;}
static jQueryInterface(config){return this.each(function(){const data=Carousel.getOrCreateInstance(this,config);if(typeof config==='number'){data.to(config);return;}
if(typeof config==='string'){if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config]();}});}}
EventHandler.on(document,EVENT_CLICK_DATA_API$5,SELECTOR_DATA_SLIDE,function(event){const target=SelectorEngine.getElementFromSelector(this);if(!target||!target.classList.contains(CLASS_NAME_CAROUSEL)){return;}
event.preventDefault();const carousel=Carousel.getOrCreateInstance(target);const slideIndex=this.getAttribute('data-bs-slide-to');if(slideIndex){carousel.to(slideIndex);carousel._maybeEnableCycle();return;}
if(Manipulator.getDataAttribute(this,'slide')==='next'){carousel.next();carousel._maybeEnableCycle();return;}
carousel.prev();carousel._maybeEnableCycle();});EventHandler.on(window,EVENT_LOAD_DATA_API$3,()=>{const carousels=SelectorEngine.find(SELECTOR_DATA_RIDE);for(const carousel of carousels){Carousel.getOrCreateInstance(carousel);}});defineJQueryPlugin(Carousel);const NAME$b='collapse';const DATA_KEY$7='bs.collapse';const EVENT_KEY$7=`.${DATA_KEY$7}`;const DATA_API_KEY$4='.data-api';const EVENT_SHOW$6=`show${EVENT_KEY$7}`;const EVENT_SHOWN$6=`shown${EVENT_KEY$7}`;const EVENT_HIDE$6=`hide${EVENT_KEY$7}`;const EVENT_HIDDEN$6=`hidden${EVENT_KEY$7}`;const EVENT_CLICK_DATA_API$4=`click${EVENT_KEY$7}${DATA_API_KEY$4}`;const CLASS_NAME_SHOW$7='show';const CLASS_NAME_COLLAPSE='collapse';const CLASS_NAME_COLLAPSING='collapsing';const CLASS_NAME_COLLAPSED='collapsed';const CLASS_NAME_DEEPER_CHILDREN=`:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;const CLASS_NAME_HORIZONTAL='collapse-horizontal';const WIDTH='width';const HEIGHT='height';const SELECTOR_ACTIVES='.collapse.show, .collapse.collapsing';const SELECTOR_DATA_TOGGLE$4='[data-bs-toggle="collapse"]';const Default$a={parent:null,toggle:true};const DefaultType$a={parent:'(null|element)',toggle:'boolean'};class Collapse extends BaseComponent{constructor(element,config){super(element,config);this._isTransitioning=false;this._triggerArray=[];const toggleList=SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);for(const elem of toggleList){const selector=SelectorEngine.getSelectorFromElement(elem);const filterElement=SelectorEngine.find(selector).filter(foundElement=>foundElement===this._element);if(selector!==null&&filterElement.length){this._triggerArray.push(elem);}}
this._initializeChildren();if(!this._config.parent){this._addAriaAndCollapsedClass(this._triggerArray,this._isShown());}
if(this._config.toggle){this.toggle();}}
static get Default(){return Default$a;}
static get DefaultType(){return DefaultType$a;}
static get NAME(){return NAME$b;}
toggle(){if(this._isShown()){this.hide();}else{this.show();}}
show(){if(this._isTransitioning||this._isShown()){return;}
let activeChildren=[];if(this._config.parent){activeChildren=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element=>element!==this._element).map(element=>Collapse.getOrCreateInstance(element,{toggle:false}));}
if(activeChildren.length&&activeChildren[0]._isTransitioning){return;}
const startEvent=EventHandler.trigger(this._element,EVENT_SHOW$6);if(startEvent.defaultPrevented){return;}
for(const activeInstance of activeChildren){activeInstance.hide();}
const dimension=this._getDimension();this._element.classList.remove(CLASS_NAME_COLLAPSE);this._element.classList.add(CLASS_NAME_COLLAPSING);this._element.style[dimension]=0;this._addAriaAndCollapsedClass(this._triggerArray,true);this._isTransitioning=true;const complete=()=>{this._isTransitioning=false;this._element.classList.remove(CLASS_NAME_COLLAPSING);this._element.classList.add(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW$7);this._element.style[dimension]='';EventHandler.trigger(this._element,EVENT_SHOWN$6);};const capitalizedDimension=dimension[0].toUpperCase()+dimension.slice(1);const scrollSize=`scroll${capitalizedDimension}`;this._queueCallback(complete,this._element,true);this._element.style[dimension]=`${this._element[scrollSize]}px`;}
hide(){if(this._isTransitioning||!this._isShown()){return;}
const startEvent=EventHandler.trigger(this._element,EVENT_HIDE$6);if(startEvent.defaultPrevented){return;}
const dimension=this._getDimension();this._element.style[dimension]=`${this._element.getBoundingClientRect()[dimension]}px`;reflow(this._element);this._element.classList.add(CLASS_NAME_COLLAPSING);this._element.classList.remove(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW$7);for(const trigger of this._triggerArray){const element=SelectorEngine.getElementFromSelector(trigger);if(element&&!this._isShown(element)){this._addAriaAndCollapsedClass([trigger],false);}}
this._isTransitioning=true;const complete=()=>{this._isTransitioning=false;this._element.classList.remove(CLASS_NAME_COLLAPSING);this._element.classList.add(CLASS_NAME_COLLAPSE);EventHandler.trigger(this._element,EVENT_HIDDEN$6);};this._element.style[dimension]='';this._queueCallback(complete,this._element,true);}
_isShown(element=this._element){return element.classList.contains(CLASS_NAME_SHOW$7);}
_configAfterMerge(config){config.toggle=Boolean(config.toggle);config.parent=getElement(config.parent);return config;}
_getDimension(){return this._element.classList.contains(CLASS_NAME_HORIZONTAL)?WIDTH:HEIGHT;}
_initializeChildren(){if(!this._config.parent){return;}
const children=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);for(const element of children){const selected=SelectorEngine.getElementFromSelector(element);if(selected){this._addAriaAndCollapsedClass([element],this._isShown(selected));}}}
_getFirstLevelChildren(selector){const children=SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);return SelectorEngine.find(selector,this._config.parent).filter(element=>!children.includes(element));}
_addAriaAndCollapsedClass(triggerArray,isOpen){if(!triggerArray.length){return;}
for(const element of triggerArray){element.classList.toggle(CLASS_NAME_COLLAPSED,!isOpen);element.setAttribute('aria-expanded',isOpen);}}
static jQueryInterface(config){const _config={};if(typeof config==='string'&&/show|hide/.test(config)){_config.toggle=false;}
return this.each(function(){const data=Collapse.getOrCreateInstance(this,_config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();}});}}
EventHandler.on(document,EVENT_CLICK_DATA_API$4,SELECTOR_DATA_TOGGLE$4,function(event){if(event.target.tagName==='A'||event.delegateTarget&&event.delegateTarget.tagName==='A'){event.preventDefault();}
for(const element of SelectorEngine.getMultipleElementsFromSelector(this)){Collapse.getOrCreateInstance(element,{toggle:false}).toggle();}});defineJQueryPlugin(Collapse);var top='top';var bottom='bottom';var right='right';var left='left';var auto='auto';var basePlacements=[top,bottom,right,left];var start='start';var end='end';var clippingParents='clippingParents';var viewport='viewport';var popper='popper';var reference='reference';var variationPlacements=basePlacements.reduce(function(acc,placement){return acc.concat([placement+"-"+start,placement+"-"+end]);},[]);var placements=[].concat(basePlacements,[auto]).reduce(function(acc,placement){return acc.concat([placement,placement+"-"+start,placement+"-"+end]);},[]);var beforeRead='beforeRead';var read='read';var afterRead='afterRead';var beforeMain='beforeMain';var main='main';var afterMain='afterMain';var beforeWrite='beforeWrite';var write='write';var afterWrite='afterWrite';var modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(element){return element?(element.nodeName||'').toLowerCase():null;}
function getWindow(node){if(node==null){return window;}
if(node.toString()!=='[object Window]'){var ownerDocument=node.ownerDocument;return ownerDocument?ownerDocument.defaultView||window:window;}
return node;}
function isElement(node){var OwnElement=getWindow(node).Element;return node instanceof OwnElement||node instanceof Element;}
function isHTMLElement(node){var OwnElement=getWindow(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement;}
function isShadowRoot(node){if(typeof ShadowRoot==='undefined'){return false;}
var OwnElement=getWindow(node).ShadowRoot;return node instanceof OwnElement||node instanceof ShadowRoot;}
function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];if(!isHTMLElement(element)||!getNodeName(element)){return;}
Object.assign(element.style,style);Object.keys(attributes).forEach(function(name){var value=attributes[name];if(value===false){element.removeAttribute(name);}else{element.setAttribute(name,value===true?'':value);}});});}
function effect$2(_ref2){var state=_ref2.state;var initialStyles={popper:{position:state.options.strategy,left:'0',top:'0',margin:'0'},arrow:{position:'absolute'},reference:{}};Object.assign(state.elements.popper.style,initialStyles.popper);state.styles=initialStyles;if(state.elements.arrow){Object.assign(state.elements.arrow.style,initialStyles.arrow);}
return function(){Object.keys(state.elements).forEach(function(name){var element=state.elements[name];var attributes=state.attributes[name]||{};var styleProperties=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]);var style=styleProperties.reduce(function(style,property){style[property]='';return style;},{});if(!isHTMLElement(element)||!getNodeName(element)){return;}
Object.assign(element.style,style);Object.keys(attributes).forEach(function(attribute){element.removeAttribute(attribute);});});};}
const applyStyles$1={name:'applyStyles',enabled:true,phase:'write',fn:applyStyles,effect:effect$2,requires:['computeStyles']};function getBasePlacement(placement){return placement.split('-')[0];}
var max=Math.max;var min=Math.min;var round=Math.round;function getUAString(){var uaData=navigator.userAgentData;if(uaData!=null&&uaData.brands&&Array.isArray(uaData.brands)){return uaData.brands.map(function(item){return item.brand+"/"+item.version;}).join(' ');}
return navigator.userAgent;}
function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString());}
function getBoundingClientRect(element,includeScale,isFixedStrategy){if(includeScale===void 0){includeScale=false;}
if(isFixedStrategy===void 0){isFixedStrategy=false;}
var clientRect=element.getBoundingClientRect();var scaleX=1;var scaleY=1;if(includeScale&&isHTMLElement(element)){scaleX=element.offsetWidth>0?round(clientRect.width)/element.offsetWidth||1:1;scaleY=element.offsetHeight>0?round(clientRect.height)/element.offsetHeight||1:1;}
var _ref=isElement(element)?getWindow(element):window,visualViewport=_ref.visualViewport;var addVisualOffsets=!isLayoutViewport()&&isFixedStrategy;var x=(clientRect.left+(addVisualOffsets&&visualViewport?visualViewport.offsetLeft:0))/scaleX;var y=(clientRect.top+(addVisualOffsets&&visualViewport?visualViewport.offsetTop:0))/scaleY;var width=clientRect.width/scaleX;var height=clientRect.height/scaleY;return{width:width,height:height,top:y,right:x+width,bottom:y+height,left:x,x:x,y:y};}
function getLayoutRect(element){var clientRect=getBoundingClientRect(element);var width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clientRect.width;}
if(Math.abs(clientRect.height-height)<=1){height=clientRect.height;}
return{x:element.offsetLeft,y:element.offsetTop,width:width,height:height};}
function contains(parent,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent.contains(child)){return true;}
else if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent.isSameNode(next)){return true;}
next=next.parentNode||next.host;}while(next);}
return false;}
function getComputedStyle$1(element){return getWindow(element).getComputedStyle(element);}
function isTableElement(element){return['table','td','th'].indexOf(getNodeName(element))>=0;}
function getDocumentElement(element){return((isElement(element)?element.ownerDocument:element.document)||window.document).documentElement;}
function getParentNode(element){if(getNodeName(element)==='html'){return element;}
return(element.assignedSlot||element.parentNode||(isShadowRoot(element)?element.host:null)||getDocumentElement(element));}
function getTrueOffsetParent(element){if(!isHTMLElement(element)||getComputedStyle$1(element).position==='fixed'){return null;}
return element.offsetParent;}
function getContainingBlock(element){var isFirefox=/firefox/i.test(getUAString());var isIE=/Trident/i.test(getUAString());if(isIE&&isHTMLElement(element)){var elementCss=getComputedStyle$1(element);if(elementCss.position==='fixed'){return null;}}
var currentNode=getParentNode(element);if(isShadowRoot(currentNode)){currentNode=currentNode.host;}
while(isHTMLElement(currentNode)&&['html','body'].indexOf(getNodeName(currentNode))<0){var css=getComputedStyle$1(currentNode);if(css.transform!=='none'||css.perspective!=='none'||css.contain==='paint'||['transform','perspective'].indexOf(css.willChange)!==-1||isFirefox&&css.willChange==='filter'||isFirefox&&css.filter&&css.filter!=='none'){return currentNode;}else{currentNode=currentNode.parentNode;}}
return null;}
function getOffsetParent(element){var window=getWindow(element);var offsetParent=getTrueOffsetParent(element);while(offsetParent&&isTableElement(offsetParent)&&getComputedStyle$1(offsetParent).position==='static'){offsetParent=getTrueOffsetParent(offsetParent);}
if(offsetParent&&(getNodeName(offsetParent)==='html'||getNodeName(offsetParent)==='body'&&getComputedStyle$1(offsetParent).position==='static')){return window;}
return offsetParent||getContainingBlock(element)||window;}
function getMainAxisFromPlacement(placement){return['top','bottom'].indexOf(placement)>=0?'x':'y';}
function within(min$1,value,max$1){return max(min$1,min(value,max$1));}
function withinMaxClamp(min,value,max){var v=within(min,value,max);return v>max?max:v;}
function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0};}
function mergePaddingObject(paddingObject){return Object.assign({},getFreshSideObject(),paddingObject);}
function expandToHashMap(value,keys){return keys.reduce(function(hashMap,key){hashMap[key]=value;return hashMap;},{});}
var toPaddingObject=function toPaddingObject(padding,state){padding=typeof padding==='function'?padding(Object.assign({},state.rects,{placement:state.placement})):padding;return mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));};function arrow(_ref){var _state$modifiersData$;var state=_ref.state,name=_ref.name,options=_ref.options;var arrowElement=state.elements.arrow;var popperOffsets=state.modifiersData.popperOffsets;var basePlacement=getBasePlacement(state.placement);var axis=getMainAxisFromPlacement(basePlacement);var isVertical=[left,right].indexOf(basePlacement)>=0;var len=isVertical?'height':'width';if(!arrowElement||!popperOffsets){return;}
var paddingObject=toPaddingObject(options.padding,state);var arrowRect=getLayoutRect(arrowElement);var minProp=axis==='y'?top:left;var maxProp=axis==='y'?bottom:right;var endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets[axis]-state.rects.popper[len];var startDiff=popperOffsets[axis]-state.rects.reference[axis];var arrowOffsetParent=getOffsetParent(arrowElement);var clientSize=arrowOffsetParent?axis==='y'?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;var centerToReference=endDiff/2-startDiff/2;var min=paddingObject[minProp];var max=clientSize-arrowRect[len]-paddingObject[maxProp];var center=clientSize/2-arrowRect[len]/2+centerToReference;var offset=within(min,center,max);var axisProp=axis;state.modifiersData[name]=(_state$modifiersData$={},_state$modifiersData$[axisProp]=offset,_state$modifiersData$.centerOffset=offset-center,_state$modifiersData$);}
function effect$1(_ref2){var state=_ref2.state,options=_ref2.options;var _options$element=options.element,arrowElement=_options$element===void 0?'[data-popper-arrow]':_options$element;if(arrowElement==null){return;}
if(typeof arrowElement==='string'){arrowElement=state.elements.popper.querySelector(arrowElement);if(!arrowElement){return;}}
if(!contains(state.elements.popper,arrowElement)){return;}
state.elements.arrow=arrowElement;}
const arrow$1={name:'arrow',enabled:true,phase:'main',fn:arrow,effect:effect$1,requires:['popperOffsets'],requiresIfExists:['preventOverflow']};function getVariation(placement){return placement.split('-')[1];}
var unsetSides={top:'auto',right:'auto',bottom:'auto',left:'auto'};function roundOffsetsByDPR(_ref,win){var x=_ref.x,y=_ref.y;var dpr=win.devicePixelRatio||1;return{x:round(x*dpr)/dpr||0,y:round(y*dpr)/dpr||0};}
function mapToStyles(_ref2){var _Object$assign2;var popper=_ref2.popper,popperRect=_ref2.popperRect,placement=_ref2.placement,variation=_ref2.variation,offsets=_ref2.offsets,position=_ref2.position,gpuAcceleration=_ref2.gpuAcceleration,adaptive=_ref2.adaptive,roundOffsets=_ref2.roundOffsets,isFixed=_ref2.isFixed;var _offsets$x=offsets.x,x=_offsets$x===void 0?0:_offsets$x,_offsets$y=offsets.y,y=_offsets$y===void 0?0:_offsets$y;var _ref3=typeof roundOffsets==='function'?roundOffsets({x:x,y:y}):{x:x,y:y};x=_ref3.x;y=_ref3.y;var hasX=offsets.hasOwnProperty('x');var hasY=offsets.hasOwnProperty('y');var sideX=left;var sideY=top;var win=window;if(adaptive){var offsetParent=getOffsetParent(popper);var heightProp='clientHeight';var widthProp='clientWidth';if(offsetParent===getWindow(popper)){offsetParent=getDocumentElement(popper);if(getComputedStyle$1(offsetParent).position!=='static'&&position==='absolute'){heightProp='scrollHeight';widthProp='scrollWidth';}}
offsetParent=offsetParent;if(placement===top||(placement===left||placement===right)&&variation===end){sideY=bottom;var offsetY=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.height:offsetParent[heightProp];y-=offsetY-popperRect.height;y*=gpuAcceleration?1:-1;}
if(placement===left||(placement===top||placement===bottom)&&variation===end){sideX=right;var offsetX=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.width:offsetParent[widthProp];x-=offsetX-popperRect.width;x*=gpuAcceleration?1:-1;}}
var commonStyles=Object.assign({position:position},adaptive&&unsetSides);var _ref4=roundOffsets===true?roundOffsetsByDPR({x:x,y:y},getWindow(popper)):{x:x,y:y};x=_ref4.x;y=_ref4.y;if(gpuAcceleration){var _Object$assign;return Object.assign({},commonStyles,(_Object$assign={},_Object$assign[sideY]=hasY?'0':'',_Object$assign[sideX]=hasX?'0':'',_Object$assign.transform=(win.devicePixelRatio||1)<=1?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign));}
return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":'',_Object$assign2[sideX]=hasX?x+"px":'',_Object$assign2.transform='',_Object$assign2));}
function computeStyles(_ref5){var state=_ref5.state,options=_ref5.options;var _options$gpuAccelerat=options.gpuAcceleration,gpuAcceleration=_options$gpuAccelerat===void 0?true:_options$gpuAccelerat,_options$adaptive=options.adaptive,adaptive=_options$adaptive===void 0?true:_options$adaptive,_options$roundOffsets=options.roundOffsets,roundOffsets=_options$roundOffsets===void 0?true:_options$roundOffsets;var commonStyles={placement:getBasePlacement(state.placement),variation:getVariation(state.placement),popper:state.elements.popper,popperRect:state.rects.popper,gpuAcceleration:gpuAcceleration,isFixed:state.options.strategy==='fixed'};if(state.modifiersData.popperOffsets!=null){state.styles.popper=Object.assign({},state.styles.popper,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.popperOffsets,position:state.options.strategy,adaptive:adaptive,roundOffsets:roundOffsets})));}
if(state.modifiersData.arrow!=null){state.styles.arrow=Object.assign({},state.styles.arrow,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.arrow,position:'absolute',adaptive:false,roundOffsets:roundOffsets})));}
state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-placement':state.placement});}
const computeStyles$1={name:'computeStyles',enabled:true,phase:'beforeWrite',fn:computeStyles,data:{}};var passive={passive:true};function effect(_ref){var state=_ref.state,instance=_ref.instance,options=_ref.options;var _options$scroll=options.scroll,scroll=_options$scroll===void 0?true:_options$scroll,_options$resize=options.resize,resize=_options$resize===void 0?true:_options$resize;var window=getWindow(state.elements.popper);var scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.addEventListener('scroll',instance.update,passive);});}
if(resize){window.addEventListener('resize',instance.update,passive);}
return function(){if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.removeEventListener('scroll',instance.update,passive);});}
if(resize){window.removeEventListener('resize',instance.update,passive);}};}
const eventListeners={name:'eventListeners',enabled:true,phase:'write',fn:function fn(){},effect:effect,data:{}};var hash$1={left:'right',right:'left',bottom:'top',top:'bottom'};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,function(matched){return hash$1[matched];});}
var hash={start:'end',end:'start'};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,function(matched){return hash[matched];});}
function getWindowScroll(node){var win=getWindow(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop};}
function getWindowScrollBarX(element){return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft;}
function getViewportRect(element,strategy){var win=getWindow(element);var html=getDocumentElement(element);var visualViewport=win.visualViewport;var width=html.clientWidth;var height=html.clientHeight;var x=0;var y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;var layoutViewport=isLayoutViewport();if(layoutViewport||!layoutViewport&&strategy==='fixed'){x=visualViewport.offsetLeft;y=visualViewport.offsetTop;}}
return{width:width,height:height,x:x+getWindowScrollBarX(element),y:y};}
function getDocumentRect(element){var _element$ownerDocumen;var html=getDocumentElement(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX(element);var y=-winScroll.scrollTop;if(getComputedStyle$1(body||html).direction==='rtl'){x+=max(html.clientWidth,body?body.clientWidth:0)-width;}
return{width:width,height:height,x:x,y:y};}
function isScrollParent(element){var _getComputedStyle=getComputedStyle$1(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return /auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX);}
function getScrollParent(node){if(['html','body','#document'].indexOf(getNodeName(node))>=0){return node.ownerDocument.body;}
if(isHTMLElement(node)&&isScrollParent(node)){return node;}
return getScrollParent(getParentNode(node));}
function listScrollParents(element,list){var _element$ownerDocumen;if(list===void 0){list=[];}
var scrollParent=getScrollParent(element);var isBody=scrollParent===((_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body);var win=getWindow(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode(target)));}
function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height});}
function getInnerBoundingClientRect(element,strategy){var rect=getBoundingClientRect(element,false,strategy==='fixed');rect.top=rect.top+element.clientTop;rect.left=rect.left+element.clientLeft;rect.bottom=rect.top+element.clientHeight;rect.right=rect.left+element.clientWidth;rect.width=element.clientWidth;rect.height=element.clientHeight;rect.x=rect.left;rect.y=rect.top;return rect;}
function getClientRectFromMixedType(element,clippingParent,strategy){return clippingParent===viewport?rectToClientRect(getViewportRect(element,strategy)):isElement(clippingParent)?getInnerBoundingClientRect(clippingParent,strategy):rectToClientRect(getDocumentRect(getDocumentElement(element)));}
function getClippingParents(element){var clippingParents=listScrollParents(getParentNode(element));var canEscapeClipping=['absolute','fixed'].indexOf(getComputedStyle$1(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement(element)?getOffsetParent(element):element;if(!isElement(clipperElement)){return[];}
return clippingParents.filter(function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName(clippingParent)!=='body';});}
function getClippingRect(element,boundary,rootBoundary,strategy){var mainClippingParents=boundary==='clippingParents'?getClippingParents(element):[].concat(boundary);var clippingParents=[].concat(mainClippingParents,[rootBoundary]);var firstClippingParent=clippingParents[0];var clippingRect=clippingParents.reduce(function(accRect,clippingParent){var rect=getClientRectFromMixedType(element,clippingParent,strategy);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect;},getClientRectFromMixedType(element,firstClippingParent,strategy));clippingRect.width=clippingRect.right-clippingRect.left;clippingRect.height=clippingRect.bottom-clippingRect.top;clippingRect.x=clippingRect.left;clippingRect.y=clippingRect.top;return clippingRect;}
function computeOffsets(_ref){var reference=_ref.reference,element=_ref.element,placement=_ref.placement;var basePlacement=placement?getBasePlacement(placement):null;var variation=placement?getVariation(placement):null;var commonX=reference.x+reference.width/2-element.width/2;var commonY=reference.y+reference.height/2-element.height/2;var offsets;switch(basePlacement){case top:offsets={x:commonX,y:reference.y-element.height};break;case bottom:offsets={x:commonX,y:reference.y+reference.height};break;case right:offsets={x:reference.x+reference.width,y:commonY};break;case left:offsets={x:reference.x-element.width,y:commonY};break;default:offsets={x:reference.x,y:reference.y};}
var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;if(mainAxis!=null){var len=mainAxis==='y'?'height':'width';switch(variation){case start:offsets[mainAxis]=offsets[mainAxis]-(reference[len]/2-element[len]/2);break;case end:offsets[mainAxis]=offsets[mainAxis]+(reference[len]/2-element[len]/2);break;}}
return offsets;}
function detectOverflow(state,options){if(options===void 0){options={};}
var _options=options,_options$placement=_options.placement,placement=_options$placement===void 0?state.placement:_options$placement,_options$strategy=_options.strategy,strategy=_options$strategy===void 0?state.strategy:_options$strategy,_options$boundary=_options.boundary,boundary=_options$boundary===void 0?clippingParents:_options$boundary,_options$rootBoundary=_options.rootBoundary,rootBoundary=_options$rootBoundary===void 0?viewport:_options$rootBoundary,_options$elementConte=_options.elementContext,elementContext=_options$elementConte===void 0?popper:_options$elementConte,_options$altBoundary=_options.altBoundary,altBoundary=_options$altBoundary===void 0?false:_options$altBoundary,_options$padding=_options.padding,padding=_options$padding===void 0?0:_options$padding;var paddingObject=mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));var altContext=elementContext===popper?reference:popper;var popperRect=state.rects.popper;var element=state.elements[altBoundary?altContext:elementContext];var clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary,strategy);var referenceClientRect=getBoundingClientRect(state.elements.reference);var popperOffsets=computeOffsets({reference:referenceClientRect,element:popperRect,strategy:'absolute',placement:placement});var popperClientRect=rectToClientRect(Object.assign({},popperRect,popperOffsets));var elementClientRect=elementContext===popper?popperClientRect:referenceClientRect;var overflowOffsets={top:clippingClientRect.top-elementClientRect.top+paddingObject.top,bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,left:clippingClientRect.left-elementClientRect.left+paddingObject.left,right:elementClientRect.right-clippingClientRect.right+paddingObject.right};var offsetData=state.modifiersData.offset;if(elementContext===popper&&offsetData){var offset=offsetData[placement];Object.keys(overflowOffsets).forEach(function(key){var multiply=[right,bottom].indexOf(key)>=0?1:-1;var axis=[top,bottom].indexOf(key)>=0?'y':'x';overflowOffsets[key]+=offset[axis]*multiply;});}
return overflowOffsets;}
function computeAutoPlacement(state,options){if(options===void 0){options={};}
var _options=options,placement=_options.placement,boundary=_options.boundary,rootBoundary=_options.rootBoundary,padding=_options.padding,flipVariations=_options.flipVariations,_options$allowedAutoP=_options.allowedAutoPlacements,allowedAutoPlacements=_options$allowedAutoP===void 0?placements:_options$allowedAutoP;var variation=getVariation(placement);var placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter(function(placement){return getVariation(placement)===variation;}):basePlacements;var allowedPlacements=placements$1.filter(function(placement){return allowedAutoPlacements.indexOf(placement)>=0;});if(allowedPlacements.length===0){allowedPlacements=placements$1;}
var overflows=allowedPlacements.reduce(function(acc,placement){acc[placement]=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding})[getBasePlacement(placement)];return acc;},{});return Object.keys(overflows).sort(function(a,b){return overflows[a]-overflows[b];});}
function getExpandedFallbackPlacements(placement){if(getBasePlacement(placement)===auto){return[];}
var oppositePlacement=getOppositePlacement(placement);return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)];}
function flip(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(state.modifiersData[name]._skip){return;}
var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?true:_options$altAxis,specifiedFallbackPlacements=options.fallbackPlacements,padding=options.padding,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,_options$flipVariatio=options.flipVariations,flipVariations=_options$flipVariatio===void 0?true:_options$flipVariatio,allowedAutoPlacements=options.allowedAutoPlacements;var preferredPlacement=state.options.placement;var basePlacement=getBasePlacement(preferredPlacement);var isBasePlacement=basePlacement===preferredPlacement;var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));var placements=[preferredPlacement].concat(fallbackPlacements).reduce(function(acc,placement){return acc.concat(getBasePlacement(placement)===auto?computeAutoPlacement(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding,flipVariations:flipVariations,allowedAutoPlacements:allowedAutoPlacements}):placement);},[]);var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var checksMap=new Map();var makeFallbackChecks=true;var firstFittingPlacement=placements[0];for(var i=0;i<placements.length;i++){var placement=placements[i];var _basePlacement=getBasePlacement(placement);var isStartVariation=getVariation(placement)===start;var isVertical=[top,bottom].indexOf(_basePlacement)>=0;var len=isVertical?'width':'height';var overflow=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,altBoundary:altBoundary,padding:padding});var mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;if(referenceRect[len]>popperRect[len]){mainVariationSide=getOppositePlacement(mainVariationSide);}
var altVariationSide=getOppositePlacement(mainVariationSide);var checks=[];if(checkMainAxis){checks.push(overflow[_basePlacement]<=0);}
if(checkAltAxis){checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0);}
if(checks.every(function(check){return check;})){firstFittingPlacement=placement;makeFallbackChecks=false;break;}
checksMap.set(placement,checks);}
if(makeFallbackChecks){var numberOfChecks=flipVariations?3:1;var _loop=function _loop(_i){var fittingPlacement=placements.find(function(placement){var checks=checksMap.get(placement);if(checks){return checks.slice(0,_i).every(function(check){return check;});}});if(fittingPlacement){firstFittingPlacement=fittingPlacement;return"break";}};for(var _i=numberOfChecks;_i>0;_i--){var _ret=_loop(_i);if(_ret==="break")break;}}
if(state.placement!==firstFittingPlacement){state.modifiersData[name]._skip=true;state.placement=firstFittingPlacement;state.reset=true;}}
const flip$1={name:'flip',enabled:true,phase:'main',fn:flip,requiresIfExists:['offset'],data:{_skip:false}};function getSideOffsets(overflow,rect,preventedOffsets){if(preventedOffsets===void 0){preventedOffsets={x:0,y:0};}
return{top:overflow.top-rect.height-preventedOffsets.y,right:overflow.right-rect.width+preventedOffsets.x,bottom:overflow.bottom-rect.height+preventedOffsets.y,left:overflow.left-rect.width-preventedOffsets.x};}
function isAnySideFullyClipped(overflow){return[top,right,bottom,left].some(function(side){return overflow[side]>=0;});}
function hide(_ref){var state=_ref.state,name=_ref.name;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var preventedOffsets=state.modifiersData.preventOverflow;var referenceOverflow=detectOverflow(state,{elementContext:'reference'});var popperAltOverflow=detectOverflow(state,{altBoundary:true});var referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect);var popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets);var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);state.modifiersData[name]={referenceClippingOffsets:referenceClippingOffsets,popperEscapeOffsets:popperEscapeOffsets,isReferenceHidden:isReferenceHidden,hasPopperEscaped:hasPopperEscaped};state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-reference-hidden':isReferenceHidden,'data-popper-escaped':hasPopperEscaped});}
const hide$1={name:'hide',enabled:true,phase:'main',requiresIfExists:['preventOverflow'],fn:hide};function distanceAndSkiddingToXY(placement,rects,offset){var basePlacement=getBasePlacement(placement);var invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1;var _ref=typeof offset==='function'?offset(Object.assign({},rects,{placement:placement})):offset,skidding=_ref[0],distance=_ref[1];skidding=skidding||0;distance=(distance||0)*invertDistance;return[left,right].indexOf(basePlacement)>=0?{x:distance,y:skidding}:{x:skidding,y:distance};}
function offset(_ref2){var state=_ref2.state,options=_ref2.options,name=_ref2.name;var _options$offset=options.offset,offset=_options$offset===void 0?[0,0]:_options$offset;var data=placements.reduce(function(acc,placement){acc[placement]=distanceAndSkiddingToXY(placement,state.rects,offset);return acc;},{});var _data$state$placement=data[state.placement],x=_data$state$placement.x,y=_data$state$placement.y;if(state.modifiersData.popperOffsets!=null){state.modifiersData.popperOffsets.x+=x;state.modifiersData.popperOffsets.y+=y;}
state.modifiersData[name]=data;}
const offset$1={name:'offset',enabled:true,phase:'main',requires:['popperOffsets'],fn:offset};function popperOffsets(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,strategy:'absolute',placement:state.placement});}
const popperOffsets$1={name:'popperOffsets',enabled:true,phase:'read',fn:popperOffsets,data:{}};function getAltAxis(axis){return axis==='x'?'y':'x';}
function preventOverflow(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?false:_options$altAxis,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,padding=options.padding,_options$tether=options.tether,tether=_options$tether===void 0?true:_options$tether,_options$tetherOffset=options.tetherOffset,tetherOffset=_options$tetherOffset===void 0?0:_options$tetherOffset;var overflow=detectOverflow(state,{boundary:boundary,rootBoundary:rootBoundary,padding:padding,altBoundary:altBoundary});var basePlacement=getBasePlacement(state.placement);var variation=getVariation(state.placement);var isBasePlacement=!variation;var mainAxis=getMainAxisFromPlacement(basePlacement);var altAxis=getAltAxis(mainAxis);var popperOffsets=state.modifiersData.popperOffsets;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var tetherOffsetValue=typeof tetherOffset==='function'?tetherOffset(Object.assign({},state.rects,{placement:state.placement})):tetherOffset;var normalizedTetherOffsetValue=typeof tetherOffsetValue==='number'?{mainAxis:tetherOffsetValue,altAxis:tetherOffsetValue}:Object.assign({mainAxis:0,altAxis:0},tetherOffsetValue);var offsetModifierState=state.modifiersData.offset?state.modifiersData.offset[state.placement]:null;var data={x:0,y:0};if(!popperOffsets){return;}
if(checkMainAxis){var _offsetModifierState$;var mainSide=mainAxis==='y'?top:left;var altSide=mainAxis==='y'?bottom:right;var len=mainAxis==='y'?'height':'width';var offset=popperOffsets[mainAxis];var min$1=offset+overflow[mainSide];var max$1=offset-overflow[altSide];var additive=tether?-popperRect[len]/2:0;var minLen=variation===start?referenceRect[len]:popperRect[len];var maxLen=variation===start?-popperRect[len]:-referenceRect[len];var arrowElement=state.elements.arrow;var arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{width:0,height:0};var arrowPaddingObject=state.modifiersData['arrow#persistent']?state.modifiersData['arrow#persistent'].padding:getFreshSideObject();var arrowPaddingMin=arrowPaddingObject[mainSide];var arrowPaddingMax=arrowPaddingObject[altSide];var arrowLen=within(0,referenceRect[len],arrowRect[len]);var minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis:minLen-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis;var maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis:maxLen+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis;var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);var clientOffset=arrowOffsetParent?mainAxis==='y'?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;var offsetModifierValue=(_offsetModifierState$=offsetModifierState==null?void 0:offsetModifierState[mainAxis])!=null?_offsetModifierState$:0;var tetherMin=offset+minOffset-offsetModifierValue-clientOffset;var tetherMax=offset+maxOffset-offsetModifierValue;var preventedOffset=within(tether?min(min$1,tetherMin):min$1,offset,tether?max(max$1,tetherMax):max$1);popperOffsets[mainAxis]=preventedOffset;data[mainAxis]=preventedOffset-offset;}
if(checkAltAxis){var _offsetModifierState$2;var _mainSide=mainAxis==='x'?top:left;var _altSide=mainAxis==='x'?bottom:right;var _offset=popperOffsets[altAxis];var _len=altAxis==='y'?'height':'width';var _min=_offset+overflow[_mainSide];var _max=_offset-overflow[_altSide];var isOriginSide=[top,left].indexOf(basePlacement)!==-1;var _offsetModifierValue=(_offsetModifierState$2=offsetModifierState==null?void 0:offsetModifierState[altAxis])!=null?_offsetModifierState$2:0;var _tetherMin=isOriginSide?_min:_offset-referenceRect[_len]-popperRect[_len]-_offsetModifierValue+normalizedTetherOffsetValue.altAxis;var _tetherMax=isOriginSide?_offset+referenceRect[_len]+popperRect[_len]-_offsetModifierValue-normalizedTetherOffsetValue.altAxis:_max;var _preventedOffset=tether&&isOriginSide?withinMaxClamp(_tetherMin,_offset,_tetherMax):within(tether?_tetherMin:_min,_offset,tether?_tetherMax:_max);popperOffsets[altAxis]=_preventedOffset;data[altAxis]=_preventedOffset-_offset;}
state.modifiersData[name]=data;}
const preventOverflow$1={name:'preventOverflow',enabled:true,phase:'main',fn:preventOverflow,requiresIfExists:['offset']};function getHTMLElementScroll(element){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop};}
function getNodeScroll(node){if(node===getWindow(node)||!isHTMLElement(node)){return getWindowScroll(node);}else{return getHTMLElementScroll(node);}}
function isElementScaled(element){var rect=element.getBoundingClientRect();var scaleX=round(rect.width)/element.offsetWidth||1;var scaleY=round(rect.height)/element.offsetHeight||1;return scaleX!==1||scaleY!==1;}
function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false;}
var isOffsetParentAnElement=isHTMLElement(offsetParent);var offsetParentIsScaled=isHTMLElement(offsetParent)&&isElementScaled(offsetParent);var documentElement=getDocumentElement(offsetParent);var rect=getBoundingClientRect(elementOrVirtualElement,offsetParentIsScaled,isFixed);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=='body'||isScrollParent(documentElement)){scroll=getNodeScroll(offsetParent);}
if(isHTMLElement(offsetParent)){offsets=getBoundingClientRect(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop;}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement);}}
return{x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height};}
function order(modifiers){var map=new Map();var visited=new Set();var result=[];modifiers.forEach(function(modifier){map.set(modifier.name,modifier);});function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);if(depModifier){sort(depModifier);}}});result.push(modifier);}
modifiers.forEach(function(modifier){if(!visited.has(modifier.name)){sort(modifier);}});return result;}
function orderModifiers(modifiers){var orderedModifiers=order(modifiers);return modifierPhases.reduce(function(acc,phase){return acc.concat(orderedModifiers.filter(function(modifier){return modifier.phase===phase;}));},[]);}
function debounce(fn){var pending;return function(){if(!pending){pending=new Promise(function(resolve){Promise.resolve().then(function(){pending=undefined;resolve(fn());});});}
return pending;};}
function mergeByName(modifiers){var merged=modifiers.reduce(function(merged,current){var existing=merged[current.name];merged[current.name]=existing?Object.assign({},existing,current,{options:Object.assign({},existing.options,current.options),data:Object.assign({},existing.data,current.data)}):current;return merged;},{});return Object.keys(merged).map(function(key){return merged[key];});}
var DEFAULT_OPTIONS={placement:'bottom',modifiers:[],strategy:'absolute'};function areValidElements(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}
return!args.some(function(element){return!(element&&typeof element.getBoundingClientRect==='function');});}
function popperGenerator(generatorOptions){if(generatorOptions===void 0){generatorOptions={};}
var _generatorOptions=generatorOptions,_generatorOptions$def=_generatorOptions.defaultModifiers,defaultModifiers=_generatorOptions$def===void 0?[]:_generatorOptions$def,_generatorOptions$def2=_generatorOptions.defaultOptions,defaultOptions=_generatorOptions$def2===void 0?DEFAULT_OPTIONS:_generatorOptions$def2;return function createPopper(reference,popper,options){if(options===void 0){options=defaultOptions;}
var state={placement:'bottom',orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,defaultOptions),modifiersData:{},elements:{reference:reference,popper:popper},attributes:{},styles:{}};var effectCleanupFns=[];var isDestroyed=false;var instance={state:state,setOptions:function setOptions(setOptionsAction){var options=typeof setOptionsAction==='function'?setOptionsAction(state.options):setOptionsAction;cleanupModifierEffects();state.options=Object.assign({},defaultOptions,state.options,options);state.scrollParents={reference:isElement(reference)?listScrollParents(reference):reference.contextElement?listScrollParents(reference.contextElement):[],popper:listScrollParents(popper)};var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers,state.options.modifiers)));state.orderedModifiers=orderedModifiers.filter(function(m){return m.enabled;});runModifierEffects();return instance.update();},forceUpdate:function forceUpdate(){if(isDestroyed){return;}
var _state$elements=state.elements,reference=_state$elements.reference,popper=_state$elements.popper;if(!areValidElements(reference,popper)){return;}
state.rects={reference:getCompositeRect(reference,getOffsetParent(popper),state.options.strategy==='fixed'),popper:getLayoutRect(popper)};state.reset=false;state.placement=state.options.placement;state.orderedModifiers.forEach(function(modifier){return state.modifiersData[modifier.name]=Object.assign({},modifier.data);});for(var index=0;index<state.orderedModifiers.length;index++){if(state.reset===true){state.reset=false;index=-1;continue;}
var _state$orderedModifie=state.orderedModifiers[index],fn=_state$orderedModifie.fn,_state$orderedModifie2=_state$orderedModifie.options,_options=_state$orderedModifie2===void 0?{}:_state$orderedModifie2,name=_state$orderedModifie.name;if(typeof fn==='function'){state=fn({state:state,options:_options,name:name,instance:instance})||state;}}},update:debounce(function(){return new Promise(function(resolve){instance.forceUpdate();resolve(state);});}),destroy:function destroy(){cleanupModifierEffects();isDestroyed=true;}};if(!areValidElements(reference,popper)){return instance;}
instance.setOptions(options).then(function(state){if(!isDestroyed&&options.onFirstUpdate){options.onFirstUpdate(state);}});function runModifierEffects(){state.orderedModifiers.forEach(function(_ref){var name=_ref.name,_ref$options=_ref.options,options=_ref$options===void 0?{}:_ref$options,effect=_ref.effect;if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});}
function cleanupModifierEffects(){effectCleanupFns.forEach(function(fn){return fn();});effectCleanupFns=[];}
return instance;};}
var createPopper$2=popperGenerator();var defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1];var createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1});var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});const Popper=Object.freeze(Object.defineProperty({__proto__:null,afterMain,afterRead,afterWrite,applyStyles:applyStyles$1,arrow:arrow$1,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,computeStyles:computeStyles$1,createPopper,createPopperBase:createPopper$2,createPopperLite:createPopper$1,detectOverflow,end,eventListeners,flip:flip$1,hide:hide$1,left,main,modifierPhases,offset:offset$1,placements,popper,popperGenerator,popperOffsets:popperOffsets$1,preventOverflow:preventOverflow$1,read,reference,right,start,top,variationPlacements,viewport,write},Symbol.toStringTag,{value:'Module'}));const NAME$a='dropdown';const DATA_KEY$6='bs.dropdown';const EVENT_KEY$6=`.${DATA_KEY$6}`;const DATA_API_KEY$3='.data-api';const ESCAPE_KEY$2='Escape';const TAB_KEY$1='Tab';const ARROW_UP_KEY$1='ArrowUp';const ARROW_DOWN_KEY$1='ArrowDown';const RIGHT_MOUSE_BUTTON=2;const EVENT_HIDE$5=`hide${EVENT_KEY$6}`;const EVENT_HIDDEN$5=`hidden${EVENT_KEY$6}`;const EVENT_SHOW$5=`show${EVENT_KEY$6}`;const EVENT_SHOWN$5=`shown${EVENT_KEY$6}`;const EVENT_CLICK_DATA_API$3=`click${EVENT_KEY$6}${DATA_API_KEY$3}`;const EVENT_KEYDOWN_DATA_API=`keydown${EVENT_KEY$6}${DATA_API_KEY$3}`;const EVENT_KEYUP_DATA_API=`keyup${EVENT_KEY$6}${DATA_API_KEY$3}`;const CLASS_NAME_SHOW$6='show';const CLASS_NAME_DROPUP='dropup';const CLASS_NAME_DROPEND='dropend';const CLASS_NAME_DROPSTART='dropstart';const CLASS_NAME_DROPUP_CENTER='dropup-center';const CLASS_NAME_DROPDOWN_CENTER='dropdown-center';const SELECTOR_DATA_TOGGLE$3='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)';const SELECTOR_DATA_TOGGLE_SHOWN=`${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`;const SELECTOR_MENU='.dropdown-menu';const SELECTOR_NAVBAR='.navbar';const SELECTOR_NAVBAR_NAV='.navbar-nav';const SELECTOR_VISIBLE_ITEMS='.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';const PLACEMENT_TOP=isRTL()?'top-end':'top-start';const PLACEMENT_TOPEND=isRTL()?'top-start':'top-end';const PLACEMENT_BOTTOM=isRTL()?'bottom-end':'bottom-start';const PLACEMENT_BOTTOMEND=isRTL()?'bottom-start':'bottom-end';const PLACEMENT_RIGHT=isRTL()?'left-start':'right-start';const PLACEMENT_LEFT=isRTL()?'right-start':'left-start';const PLACEMENT_TOPCENTER='top';const PLACEMENT_BOTTOMCENTER='bottom';const Default$9={autoClose:true,boundary:'clippingParents',display:'dynamic',offset:[0,2],popperConfig:null,reference:'toggle'};const DefaultType$9={autoClose:'(boolean|string)',boundary:'(string|element)',display:'string',offset:'(array|string|function)',popperConfig:'(null|object|function)',reference:'(string|element|object)'};class Dropdown extends BaseComponent{constructor(element,config){super(element,config);this._popper=null;this._parent=this._element.parentNode;this._menu=SelectorEngine.next(this._element,SELECTOR_MENU)[0]||SelectorEngine.prev(this._element,SELECTOR_MENU)[0]||SelectorEngine.findOne(SELECTOR_MENU,this._parent);this._inNavbar=this._detectNavbar();}
static get Default(){return Default$9;}
static get DefaultType(){return DefaultType$9;}
static get NAME(){return NAME$a;}
toggle(){return this._isShown()?this.hide():this.show();}
show(){if(isDisabled(this._element)||this._isShown()){return;}
const relatedTarget={relatedTarget:this._element};const showEvent=EventHandler.trigger(this._element,EVENT_SHOW$5,relatedTarget);if(showEvent.defaultPrevented){return;}
this._createPopper();if('ontouchstart' in document.documentElement&&!this._parent.closest(SELECTOR_NAVBAR_NAV)){for(const element of[].concat(...document.body.children)){EventHandler.on(element,'mouseover',noop);}}
this._element.focus();this._element.setAttribute('aria-expanded',true);this._menu.classList.add(CLASS_NAME_SHOW$6);this._element.classList.add(CLASS_NAME_SHOW$6);EventHandler.trigger(this._element,EVENT_SHOWN$5,relatedTarget);}
hide(){if(isDisabled(this._element)||!this._isShown()){return;}
const relatedTarget={relatedTarget:this._element};this._completeHide(relatedTarget);}
dispose(){if(this._popper){this._popper.destroy();}
super.dispose();}
update(){this._inNavbar=this._detectNavbar();if(this._popper){this._popper.update();}}
_completeHide(relatedTarget){const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE$5,relatedTarget);if(hideEvent.defaultPrevented){return;}
if('ontouchstart' in document.documentElement){for(const element of[].concat(...document.body.children)){EventHandler.off(element,'mouseover',noop);}}
if(this._popper){this._popper.destroy();}
this._menu.classList.remove(CLASS_NAME_SHOW$6);this._element.classList.remove(CLASS_NAME_SHOW$6);this._element.setAttribute('aria-expanded','false');Manipulator.removeDataAttribute(this._menu,'popper');EventHandler.trigger(this._element,EVENT_HIDDEN$5,relatedTarget);}
_getConfig(config){config=super._getConfig(config);if(typeof config.reference==='object'&&!isElement$1(config.reference)&&typeof config.reference.getBoundingClientRect!=='function'){throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);}
return config;}
_createPopper(){if(typeof Popper==='undefined'){throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');}
let referenceElement=this._element;if(this._config.reference==='parent'){referenceElement=this._parent;}else if(isElement$1(this._config.reference)){referenceElement=getElement(this._config.reference);}else if(typeof this._config.reference==='object'){referenceElement=this._config.reference;}
const popperConfig=this._getPopperConfig();this._popper=createPopper(referenceElement,this._menu,popperConfig);}
_isShown(){return this._menu.classList.contains(CLASS_NAME_SHOW$6);}
_getPlacement(){const parentDropdown=this._parent;if(parentDropdown.classList.contains(CLASS_NAME_DROPEND)){return PLACEMENT_RIGHT;}
if(parentDropdown.classList.contains(CLASS_NAME_DROPSTART)){return PLACEMENT_LEFT;}
if(parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)){return PLACEMENT_TOPCENTER;}
if(parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)){return PLACEMENT_BOTTOMCENTER;}
const isEnd=getComputedStyle(this._menu).getPropertyValue('--bs-position').trim()==='end';if(parentDropdown.classList.contains(CLASS_NAME_DROPUP)){return isEnd?PLACEMENT_TOPEND:PLACEMENT_TOP;}
return isEnd?PLACEMENT_BOTTOMEND:PLACEMENT_BOTTOM;}
_detectNavbar(){return this._element.closest(SELECTOR_NAVBAR)!==null;}
_getOffset(){const{offset}=this._config;if(typeof offset==='string'){return offset.split(',').map(value=>Number.parseInt(value,10));}
if(typeof offset==='function'){return popperData=>offset(popperData,this._element);}
return offset;}
_getPopperConfig(){const defaultBsPopperConfig={placement:this._getPlacement(),modifiers:[{name:'preventOverflow',options:{boundary:this._config.boundary}},{name:'offset',options:{offset:this._getOffset()}}]};if(this._inNavbar||this._config.display==='static'){Manipulator.setDataAttribute(this._menu,'popper','static');defaultBsPopperConfig.modifiers=[{name:'applyStyles',enabled:false}];}
return{...defaultBsPopperConfig,...execute(this._config.popperConfig,[defaultBsPopperConfig])};}
_selectMenuItem({key,target}){const items=SelectorEngine.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter(element=>isVisible(element));if(!items.length){return;}
getNextActiveElement(items,target,key===ARROW_DOWN_KEY$1,!items.includes(target)).focus();}
static jQueryInterface(config){return this.each(function(){const data=Dropdown.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}
static clearMenus(event){if(event.button===RIGHT_MOUSE_BUTTON||event.type==='keyup'&&event.key!==TAB_KEY$1){return;}
const openToggles=SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);for(const toggle of openToggles){const context=Dropdown.getInstance(toggle);if(!context||context._config.autoClose===false){continue;}
const composedPath=event.composedPath();const isMenuTarget=composedPath.includes(context._menu);if(composedPath.includes(context._element)||context._config.autoClose==='inside'&&!isMenuTarget||context._config.autoClose==='outside'&&isMenuTarget){continue;}
if(context._menu.contains(event.target)&&(event.type==='keyup'&&event.key===TAB_KEY$1||/input|select|option|textarea|form/i.test(event.target.tagName))){continue;}
const relatedTarget={relatedTarget:context._element};if(event.type==='click'){relatedTarget.clickEvent=event;}
context._completeHide(relatedTarget);}}
static dataApiKeydownHandler(event){const isInput=/input|textarea/i.test(event.target.tagName);const isEscapeEvent=event.key===ESCAPE_KEY$2;const isUpOrDownEvent=[ARROW_UP_KEY$1,ARROW_DOWN_KEY$1].includes(event.key);if(!isUpOrDownEvent&&!isEscapeEvent){return;}
if(isInput&&!isEscapeEvent){return;}
event.preventDefault();const getToggleButton=this.matches(SELECTOR_DATA_TOGGLE$3)?this:SelectorEngine.prev(this,SELECTOR_DATA_TOGGLE$3)[0]||SelectorEngine.next(this,SELECTOR_DATA_TOGGLE$3)[0]||SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3,event.delegateTarget.parentNode);const instance=Dropdown.getOrCreateInstance(getToggleButton);if(isUpOrDownEvent){event.stopPropagation();instance.show();instance._selectMenuItem(event);return;}
if(instance._isShown()){event.stopPropagation();instance.hide();getToggleButton.focus();}}}
EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE$3,Dropdown.dataApiKeydownHandler);EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_MENU,Dropdown.dataApiKeydownHandler);EventHandler.on(document,EVENT_CLICK_DATA_API$3,Dropdown.clearMenus);EventHandler.on(document,EVENT_KEYUP_DATA_API,Dropdown.clearMenus);EventHandler.on(document,EVENT_CLICK_DATA_API$3,SELECTOR_DATA_TOGGLE$3,function(event){event.preventDefault();Dropdown.getOrCreateInstance(this).toggle();});defineJQueryPlugin(Dropdown);const NAME$9='backdrop';const CLASS_NAME_FADE$4='fade';const CLASS_NAME_SHOW$5='show';const EVENT_MOUSEDOWN=`mousedown.bs.${NAME$9}`;const Default$8={className:'modal-backdrop',clickCallback:null,isAnimated:false,isVisible:true,rootElement:'body'};const DefaultType$8={className:'string',clickCallback:'(function|null)',isAnimated:'boolean',isVisible:'boolean',rootElement:'(element|string)'};class Backdrop extends Config{constructor(config){super();this._config=this._getConfig(config);this._isAppended=false;this._element=null;}
static get Default(){return Default$8;}
static get DefaultType(){return DefaultType$8;}
static get NAME(){return NAME$9;}
show(callback){if(!this._config.isVisible){execute(callback);return;}
this._append();const element=this._getElement();if(this._config.isAnimated){reflow(element);}
element.classList.add(CLASS_NAME_SHOW$5);this._emulateAnimation(()=>{execute(callback);});}
hide(callback){if(!this._config.isVisible){execute(callback);return;}
this._getElement().classList.remove(CLASS_NAME_SHOW$5);this._emulateAnimation(()=>{this.dispose();execute(callback);});}
dispose(){if(!this._isAppended){return;}
EventHandler.off(this._element,EVENT_MOUSEDOWN);this._element.remove();this._isAppended=false;}
_getElement(){if(!this._element){const backdrop=document.createElement('div');backdrop.className=this._config.className;if(this._config.isAnimated){backdrop.classList.add(CLASS_NAME_FADE$4);}
this._element=backdrop;}
return this._element;}
_configAfterMerge(config){config.rootElement=getElement(config.rootElement);return config;}
_append(){if(this._isAppended){return;}
const element=this._getElement();this._config.rootElement.append(element);EventHandler.on(element,EVENT_MOUSEDOWN,()=>{execute(this._config.clickCallback);});this._isAppended=true;}
_emulateAnimation(callback){executeAfterTransition(callback,this._getElement(),this._config.isAnimated);}}
const NAME$8='focustrap';const DATA_KEY$5='bs.focustrap';const EVENT_KEY$5=`.${DATA_KEY$5}`;const EVENT_FOCUSIN$2=`focusin${EVENT_KEY$5}`;const EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY$5}`;const TAB_KEY='Tab';const TAB_NAV_FORWARD='forward';const TAB_NAV_BACKWARD='backward';const Default$7={autofocus:true,trapElement:null};const DefaultType$7={autofocus:'boolean',trapElement:'element'};class FocusTrap extends Config{constructor(config){super();this._config=this._getConfig(config);this._isActive=false;this._lastTabNavDirection=null;}
static get Default(){return Default$7;}
static get DefaultType(){return DefaultType$7;}
static get NAME(){return NAME$8;}
activate(){if(this._isActive){return;}
if(this._config.autofocus){this._config.trapElement.focus();}
EventHandler.off(document,EVENT_KEY$5);EventHandler.on(document,EVENT_FOCUSIN$2,event=>this._handleFocusin(event));EventHandler.on(document,EVENT_KEYDOWN_TAB,event=>this._handleKeydown(event));this._isActive=true;}
deactivate(){if(!this._isActive){return;}
this._isActive=false;EventHandler.off(document,EVENT_KEY$5);}
_handleFocusin(event){const{trapElement}=this._config;if(event.target===document||event.target===trapElement||trapElement.contains(event.target)){return;}
const elements=SelectorEngine.focusableChildren(trapElement);if(elements.length===0){trapElement.focus();}else if(this._lastTabNavDirection===TAB_NAV_BACKWARD){elements[elements.length-1].focus();}else{elements[0].focus();}}
_handleKeydown(event){if(event.key!==TAB_KEY){return;}
this._lastTabNavDirection=event.shiftKey?TAB_NAV_BACKWARD:TAB_NAV_FORWARD;}}
const SELECTOR_FIXED_CONTENT='.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';const SELECTOR_STICKY_CONTENT='.sticky-top';const PROPERTY_PADDING='padding-right';const PROPERTY_MARGIN='margin-right';class ScrollBarHelper{constructor(){this._element=document.body;}
getWidth(){const documentWidth=document.documentElement.clientWidth;return Math.abs(window.innerWidth-documentWidth);}
hide(){const width=this.getWidth();this._disableOverFlow();this._setElementAttributes(this._element,PROPERTY_PADDING,calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_FIXED_CONTENT,PROPERTY_PADDING,calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_STICKY_CONTENT,PROPERTY_MARGIN,calculatedValue=>calculatedValue-width);}
reset(){this._resetElementAttributes(this._element,'overflow');this._resetElementAttributes(this._element,PROPERTY_PADDING);this._resetElementAttributes(SELECTOR_FIXED_CONTENT,PROPERTY_PADDING);this._resetElementAttributes(SELECTOR_STICKY_CONTENT,PROPERTY_MARGIN);}
isOverflowing(){return this.getWidth()>0;}
_disableOverFlow(){this._saveInitialAttribute(this._element,'overflow');this._element.style.overflow='hidden';}
_setElementAttributes(selector,styleProperty,callback){const scrollbarWidth=this.getWidth();const manipulationCallBack=element=>{if(element!==this._element&&window.innerWidth>element.clientWidth+scrollbarWidth){return;}
this._saveInitialAttribute(element,styleProperty);const calculatedValue=window.getComputedStyle(element).getPropertyValue(styleProperty);element.style.setProperty(styleProperty,`${callback(Number.parseFloat(calculatedValue))}px`);};this._applyManipulationCallback(selector,manipulationCallBack);}
_saveInitialAttribute(element,styleProperty){const actualValue=element.style.getPropertyValue(styleProperty);if(actualValue){Manipulator.setDataAttribute(element,styleProperty,actualValue);}}
_resetElementAttributes(selector,styleProperty){const manipulationCallBack=element=>{const value=Manipulator.getDataAttribute(element,styleProperty);if(value===null){element.style.removeProperty(styleProperty);return;}
Manipulator.removeDataAttribute(element,styleProperty);element.style.setProperty(styleProperty,value);};this._applyManipulationCallback(selector,manipulationCallBack);}
_applyManipulationCallback(selector,callBack){if(isElement$1(selector)){callBack(selector);return;}
for(const sel of SelectorEngine.find(selector,this._element)){callBack(sel);}}}
const NAME$7='modal';const DATA_KEY$4='bs.modal';const EVENT_KEY$4=`.${DATA_KEY$4}`;const DATA_API_KEY$2='.data-api';const ESCAPE_KEY$1='Escape';const EVENT_HIDE$4=`hide${EVENT_KEY$4}`;const EVENT_HIDE_PREVENTED$1=`hidePrevented${EVENT_KEY$4}`;const EVENT_HIDDEN$4=`hidden${EVENT_KEY$4}`;const EVENT_SHOW$4=`show${EVENT_KEY$4}`;const EVENT_SHOWN$4=`shown${EVENT_KEY$4}`;const EVENT_RESIZE$1=`resize${EVENT_KEY$4}`;const EVENT_CLICK_DISMISS=`click.dismiss${EVENT_KEY$4}`;const EVENT_MOUSEDOWN_DISMISS=`mousedown.dismiss${EVENT_KEY$4}`;const EVENT_KEYDOWN_DISMISS$1=`keydown.dismiss${EVENT_KEY$4}`;const EVENT_CLICK_DATA_API$2=`click${EVENT_KEY$4}${DATA_API_KEY$2}`;const CLASS_NAME_OPEN='modal-open';const CLASS_NAME_FADE$3='fade';const CLASS_NAME_SHOW$4='show';const CLASS_NAME_STATIC='modal-static';const OPEN_SELECTOR$1='.modal.show';const SELECTOR_DIALOG='.modal-dialog';const SELECTOR_MODAL_BODY='.modal-body';const SELECTOR_DATA_TOGGLE$2='[data-bs-toggle="modal"]';const Default$6={backdrop:true,focus:true,keyboard:true};const DefaultType$6={backdrop:'(boolean|string)',focus:'boolean',keyboard:'boolean'};class Modal extends BaseComponent{constructor(element,config){super(element,config);this._dialog=SelectorEngine.findOne(SELECTOR_DIALOG,this._element);this._backdrop=this._initializeBackDrop();this._focustrap=this._initializeFocusTrap();this._isShown=false;this._isTransitioning=false;this._scrollBar=new ScrollBarHelper();this._addEventListeners();}
static get Default(){return Default$6;}
static get DefaultType(){return DefaultType$6;}
static get NAME(){return NAME$7;}
toggle(relatedTarget){return this._isShown?this.hide():this.show(relatedTarget);}
show(relatedTarget){if(this._isShown||this._isTransitioning){return;}
const showEvent=EventHandler.trigger(this._element,EVENT_SHOW$4,{relatedTarget});if(showEvent.defaultPrevented){return;}
this._isShown=true;this._isTransitioning=true;this._scrollBar.hide();document.body.classList.add(CLASS_NAME_OPEN);this._adjustDialog();this._backdrop.show(()=>this._showElement(relatedTarget));}
hide(){if(!this._isShown||this._isTransitioning){return;}
const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE$4);if(hideEvent.defaultPrevented){return;}
this._isShown=false;this._isTransitioning=true;this._focustrap.deactivate();this._element.classList.remove(CLASS_NAME_SHOW$4);this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated());}
dispose(){EventHandler.off(window,EVENT_KEY$4);EventHandler.off(this._dialog,EVENT_KEY$4);this._backdrop.dispose();this._focustrap.deactivate();super.dispose();}
handleUpdate(){this._adjustDialog();}
_initializeBackDrop(){return new Backdrop({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()});}
_initializeFocusTrap(){return new FocusTrap({trapElement:this._element});}
_showElement(relatedTarget){if(!document.body.contains(this._element)){document.body.append(this._element);}
this._element.style.display='block';this._element.removeAttribute('aria-hidden');this._element.setAttribute('aria-modal',true);this._element.setAttribute('role','dialog');this._element.scrollTop=0;const modalBody=SelectorEngine.findOne(SELECTOR_MODAL_BODY,this._dialog);if(modalBody){modalBody.scrollTop=0;}
reflow(this._element);this._element.classList.add(CLASS_NAME_SHOW$4);const transitionComplete=()=>{if(this._config.focus){this._focustrap.activate();}
this._isTransitioning=false;EventHandler.trigger(this._element,EVENT_SHOWN$4,{relatedTarget});};this._queueCallback(transitionComplete,this._dialog,this._isAnimated());}
_addEventListeners(){EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS$1,event=>{if(event.key!==ESCAPE_KEY$1){return;}
if(this._config.keyboard){this.hide();return;}
this._triggerBackdropTransition();});EventHandler.on(window,EVENT_RESIZE$1,()=>{if(this._isShown&&!this._isTransitioning){this._adjustDialog();}});EventHandler.on(this._element,EVENT_MOUSEDOWN_DISMISS,event=>{EventHandler.one(this._element,EVENT_CLICK_DISMISS,event2=>{if(this._element!==event.target||this._element!==event2.target){return;}
if(this._config.backdrop==='static'){this._triggerBackdropTransition();return;}
if(this._config.backdrop){this.hide();}});});}
_hideModal(){this._element.style.display='none';this._element.setAttribute('aria-hidden',true);this._element.removeAttribute('aria-modal');this._element.removeAttribute('role');this._isTransitioning=false;this._backdrop.hide(()=>{document.body.classList.remove(CLASS_NAME_OPEN);this._resetAdjustments();this._scrollBar.reset();EventHandler.trigger(this._element,EVENT_HIDDEN$4);});}
_isAnimated(){return this._element.classList.contains(CLASS_NAME_FADE$3);}
_triggerBackdropTransition(){const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED$1);if(hideEvent.defaultPrevented){return;}
const isModalOverflowing=this._element.scrollHeight>document.documentElement.clientHeight;const initialOverflowY=this._element.style.overflowY;if(initialOverflowY==='hidden'||this._element.classList.contains(CLASS_NAME_STATIC)){return;}
if(!isModalOverflowing){this._element.style.overflowY='hidden';}
this._element.classList.add(CLASS_NAME_STATIC);this._queueCallback(()=>{this._element.classList.remove(CLASS_NAME_STATIC);this._queueCallback(()=>{this._element.style.overflowY=initialOverflowY;},this._dialog);},this._dialog);this._element.focus();}
_adjustDialog(){const isModalOverflowing=this._element.scrollHeight>document.documentElement.clientHeight;const scrollbarWidth=this._scrollBar.getWidth();const isBodyOverflowing=scrollbarWidth>0;if(isBodyOverflowing&&!isModalOverflowing){const property=isRTL()?'paddingLeft':'paddingRight';this._element.style[property]=`${scrollbarWidth}px`;}
if(!isBodyOverflowing&&isModalOverflowing){const property=isRTL()?'paddingRight':'paddingLeft';this._element.style[property]=`${scrollbarWidth}px`;}}
_resetAdjustments(){this._element.style.paddingLeft='';this._element.style.paddingRight='';}
static jQueryInterface(config,relatedTarget){return this.each(function(){const data=Modal.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config](relatedTarget);});}}
EventHandler.on(document,EVENT_CLICK_DATA_API$2,SELECTOR_DATA_TOGGLE$2,function(event){const target=SelectorEngine.getElementFromSelector(this);if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
EventHandler.one(target,EVENT_SHOW$4,showEvent=>{if(showEvent.defaultPrevented){return;}
EventHandler.one(target,EVENT_HIDDEN$4,()=>{if(isVisible(this)){this.focus();}});});const alreadyOpen=SelectorEngine.findOne(OPEN_SELECTOR$1);if(alreadyOpen){Modal.getInstance(alreadyOpen).hide();}
const data=Modal.getOrCreateInstance(target);data.toggle(this);});enableDismissTrigger(Modal);defineJQueryPlugin(Modal);const NAME$6='offcanvas';const DATA_KEY$3='bs.offcanvas';const EVENT_KEY$3=`.${DATA_KEY$3}`;const DATA_API_KEY$1='.data-api';const EVENT_LOAD_DATA_API$2=`load${EVENT_KEY$3}${DATA_API_KEY$1}`;const ESCAPE_KEY='Escape';const CLASS_NAME_SHOW$3='show';const CLASS_NAME_SHOWING$1='showing';const CLASS_NAME_HIDING='hiding';const CLASS_NAME_BACKDROP='offcanvas-backdrop';const OPEN_SELECTOR='.offcanvas.show';const EVENT_SHOW$3=`show${EVENT_KEY$3}`;const EVENT_SHOWN$3=`shown${EVENT_KEY$3}`;const EVENT_HIDE$3=`hide${EVENT_KEY$3}`;const EVENT_HIDE_PREVENTED=`hidePrevented${EVENT_KEY$3}`;const EVENT_HIDDEN$3=`hidden${EVENT_KEY$3}`;const EVENT_RESIZE=`resize${EVENT_KEY$3}`;const EVENT_CLICK_DATA_API$1=`click${EVENT_KEY$3}${DATA_API_KEY$1}`;const EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY$3}`;const SELECTOR_DATA_TOGGLE$1='[data-bs-toggle="offcanvas"]';const Default$5={backdrop:true,keyboard:true,scroll:false};const DefaultType$5={backdrop:'(boolean|string)',keyboard:'boolean',scroll:'boolean'};class Offcanvas extends BaseComponent{constructor(element,config){super(element,config);this._isShown=false;this._backdrop=this._initializeBackDrop();this._focustrap=this._initializeFocusTrap();this._addEventListeners();}
static get Default(){return Default$5;}
static get DefaultType(){return DefaultType$5;}
static get NAME(){return NAME$6;}
toggle(relatedTarget){return this._isShown?this.hide():this.show(relatedTarget);}
show(relatedTarget){if(this._isShown){return;}
const showEvent=EventHandler.trigger(this._element,EVENT_SHOW$3,{relatedTarget});if(showEvent.defaultPrevented){return;}
this._isShown=true;this._backdrop.show();if(!this._config.scroll){new ScrollBarHelper().hide();}
this._element.setAttribute('aria-modal',true);this._element.setAttribute('role','dialog');this._element.classList.add(CLASS_NAME_SHOWING$1);const completeCallBack=()=>{if(!this._config.scroll||this._config.backdrop){this._focustrap.activate();}
this._element.classList.add(CLASS_NAME_SHOW$3);this._element.classList.remove(CLASS_NAME_SHOWING$1);EventHandler.trigger(this._element,EVENT_SHOWN$3,{relatedTarget});};this._queueCallback(completeCallBack,this._element,true);}
hide(){if(!this._isShown){return;}
const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE$3);if(hideEvent.defaultPrevented){return;}
this._focustrap.deactivate();this._element.blur();this._isShown=false;this._element.classList.add(CLASS_NAME_HIDING);this._backdrop.hide();const completeCallback=()=>{this._element.classList.remove(CLASS_NAME_SHOW$3,CLASS_NAME_HIDING);this._element.removeAttribute('aria-modal');this._element.removeAttribute('role');if(!this._config.scroll){new ScrollBarHelper().reset();}
EventHandler.trigger(this._element,EVENT_HIDDEN$3);};this._queueCallback(completeCallback,this._element,true);}
dispose(){this._backdrop.dispose();this._focustrap.deactivate();super.dispose();}
_initializeBackDrop(){const clickCallback=()=>{if(this._config.backdrop==='static'){EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED);return;}
this.hide();};const isVisible=Boolean(this._config.backdrop);return new Backdrop({className:CLASS_NAME_BACKDROP,isVisible,isAnimated:true,rootElement:this._element.parentNode,clickCallback:isVisible?clickCallback:null});}
_initializeFocusTrap(){return new FocusTrap({trapElement:this._element});}
_addEventListeners(){EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS,event=>{if(event.key!==ESCAPE_KEY){return;}
if(this._config.keyboard){this.hide();return;}
EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED);});}
static jQueryInterface(config){return this.each(function(){const data=Offcanvas.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config](this);});}}
EventHandler.on(document,EVENT_CLICK_DATA_API$1,SELECTOR_DATA_TOGGLE$1,function(event){const target=SelectorEngine.getElementFromSelector(this);if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
if(isDisabled(this)){return;}
EventHandler.one(target,EVENT_HIDDEN$3,()=>{if(isVisible(this)){this.focus();}});const alreadyOpen=SelectorEngine.findOne(OPEN_SELECTOR);if(alreadyOpen&&alreadyOpen!==target){Offcanvas.getInstance(alreadyOpen).hide();}
const data=Offcanvas.getOrCreateInstance(target);data.toggle(this);});EventHandler.on(window,EVENT_LOAD_DATA_API$2,()=>{for(const selector of SelectorEngine.find(OPEN_SELECTOR)){Offcanvas.getOrCreateInstance(selector).show();}});EventHandler.on(window,EVENT_RESIZE,()=>{for(const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')){if(getComputedStyle(element).position!=='fixed'){Offcanvas.getOrCreateInstance(element).hide();}}});enableDismissTrigger(Offcanvas);defineJQueryPlugin(Offcanvas);const ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i;const DefaultAllowlist={'*':['class','dir','id','lang','role',ARIA_ATTRIBUTE_PATTERN],a:['target','href','title','rel'],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:['src','srcset','alt','title','width','height'],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};const uriAttributes=new Set(['background','cite','href','itemtype','longdesc','poster','src','xlink:href']);const SAFE_URL_PATTERN=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;const allowedAttribute=(attribute,allowedAttributeList)=>{const attributeName=attribute.nodeName.toLowerCase();if(allowedAttributeList.includes(attributeName)){if(uriAttributes.has(attributeName)){return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));}
return true;}
return allowedAttributeList.filter(attributeRegex=>attributeRegex instanceof RegExp).some(regex=>regex.test(attributeName));};function sanitizeHtml(unsafeHtml,allowList,sanitizeFunction){if(!unsafeHtml.length){return unsafeHtml;}
if(sanitizeFunction&&typeof sanitizeFunction==='function'){return sanitizeFunction(unsafeHtml);}
const domParser=new window.DOMParser();const createdDocument=domParser.parseFromString(unsafeHtml,'text/html');const elements=[].concat(...createdDocument.body.querySelectorAll('*'));for(const element of elements){const elementName=element.nodeName.toLowerCase();if(!Object.keys(allowList).includes(elementName)){element.remove();continue;}
const attributeList=[].concat(...element.attributes);const allowedAttributes=[].concat(allowList['*']||[],allowList[elementName]||[]);for(const attribute of attributeList){if(!allowedAttribute(attribute,allowedAttributes)){element.removeAttribute(attribute.nodeName);}}}
return createdDocument.body.innerHTML;}
const NAME$5='TemplateFactory';const Default$4={allowList:DefaultAllowlist,content:{},extraClass:'',html:false,sanitize:true,sanitizeFn:null,template:'<div></div>'};const DefaultType$4={allowList:'object',content:'object',extraClass:'(string|function)',html:'boolean',sanitize:'boolean',sanitizeFn:'(null|function)',template:'string'};const DefaultContentType={entry:'(string|element|function|null)',selector:'(string|element)'};class TemplateFactory extends Config{constructor(config){super();this._config=this._getConfig(config);}
static get Default(){return Default$4;}
static get DefaultType(){return DefaultType$4;}
static get NAME(){return NAME$5;}
getContent(){return Object.values(this._config.content).map(config=>this._resolvePossibleFunction(config)).filter(Boolean);}
hasContent(){return this.getContent().length>0;}
changeContent(content){this._checkContent(content);this._config.content={...this._config.content,...content};return this;}
toHtml(){const templateWrapper=document.createElement('div');templateWrapper.innerHTML=this._maybeSanitize(this._config.template);for(const[selector,text]of Object.entries(this._config.content)){this._setContent(templateWrapper,text,selector);}
const template=templateWrapper.children[0];const extraClass=this._resolvePossibleFunction(this._config.extraClass);if(extraClass){template.classList.add(...extraClass.split(' '));}
return template;}
_typeCheckConfig(config){super._typeCheckConfig(config);this._checkContent(config.content);}
_checkContent(arg){for(const[selector,content]of Object.entries(arg)){super._typeCheckConfig({selector,entry:content},DefaultContentType);}}
_setContent(template,content,selector){const templateElement=SelectorEngine.findOne(selector,template);if(!templateElement){return;}
content=this._resolvePossibleFunction(content);if(!content){templateElement.remove();return;}
if(isElement$1(content)){this._putElementInTemplate(getElement(content),templateElement);return;}
if(this._config.html){templateElement.innerHTML=this._maybeSanitize(content);return;}
templateElement.textContent=content;}
_maybeSanitize(arg){return this._config.sanitize?sanitizeHtml(arg,this._config.allowList,this._config.sanitizeFn):arg;}
_resolvePossibleFunction(arg){return execute(arg,[this]);}
_putElementInTemplate(element,templateElement){if(this._config.html){templateElement.innerHTML='';templateElement.append(element);return;}
templateElement.textContent=element.textContent;}}
const NAME$4='tooltip';const DISALLOWED_ATTRIBUTES=new Set(['sanitize','allowList','sanitizeFn']);const CLASS_NAME_FADE$2='fade';const CLASS_NAME_MODAL='modal';const CLASS_NAME_SHOW$2='show';const SELECTOR_TOOLTIP_INNER='.tooltip-inner';const SELECTOR_MODAL=`.${CLASS_NAME_MODAL}`;const EVENT_MODAL_HIDE='hide.bs.modal';const TRIGGER_HOVER='hover';const TRIGGER_FOCUS='focus';const TRIGGER_CLICK='click';const TRIGGER_MANUAL='manual';const EVENT_HIDE$2='hide';const EVENT_HIDDEN$2='hidden';const EVENT_SHOW$2='show';const EVENT_SHOWN$2='shown';const EVENT_INSERTED='inserted';const EVENT_CLICK$1='click';const EVENT_FOCUSIN$1='focusin';const EVENT_FOCUSOUT$1='focusout';const EVENT_MOUSEENTER='mouseenter';const EVENT_MOUSELEAVE='mouseleave';const AttachmentMap={AUTO:'auto',TOP:'top',RIGHT:isRTL()?'left':'right',BOTTOM:'bottom',LEFT:isRTL()?'right':'left'};const Default$3={allowList:DefaultAllowlist,animation:true,boundary:'clippingParents',container:false,customClass:'',delay:0,fallbackPlacements:['top','right','bottom','left'],html:false,offset:[0,6],placement:'top',popperConfig:null,sanitize:true,sanitizeFn:null,selector:false,template:'<div class="tooltip" role="tooltip">'+'<div class="tooltip-arrow"></div>'+'<div class="tooltip-inner"></div>'+'</div>',title:'',trigger:'hover focus'};const DefaultType$3={allowList:'object',animation:'boolean',boundary:'(string|element)',container:'(string|element|boolean)',customClass:'(string|function)',delay:'(number|object)',fallbackPlacements:'array',html:'boolean',offset:'(array|string|function)',placement:'(string|function)',popperConfig:'(null|object|function)',sanitize:'boolean',sanitizeFn:'(null|function)',selector:'(string|boolean)',template:'string',title:'(string|element|function)',trigger:'string'};class Tooltip extends BaseComponent{constructor(element,config){if(typeof Popper==='undefined'){throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');}
super(element,config);this._isEnabled=true;this._timeout=0;this._isHovered=null;this._activeTrigger={};this._popper=null;this._templateFactory=null;this._newContent=null;this.tip=null;this._setListeners();if(!this._config.selector){this._fixTitle();}}
static get Default(){return Default$3;}
static get DefaultType(){return DefaultType$3;}
static get NAME(){return NAME$4;}
enable(){this._isEnabled=true;}
disable(){this._isEnabled=false;}
toggleEnabled(){this._isEnabled=!this._isEnabled;}
toggle(){if(!this._isEnabled){return;}
this._activeTrigger.click=!this._activeTrigger.click;if(this._isShown()){this._leave();return;}
this._enter();}
dispose(){clearTimeout(this._timeout);EventHandler.off(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler);if(this._element.getAttribute('data-bs-original-title')){this._element.setAttribute('title',this._element.getAttribute('data-bs-original-title'));}
this._disposePopper();super.dispose();}
show(){if(this._element.style.display==='none'){throw new Error('Please use show on visible elements');}
if(!(this._isWithContent()&&this._isEnabled)){return;}
const showEvent=EventHandler.trigger(this._element,this.constructor.eventName(EVENT_SHOW$2));const shadowRoot=findShadowRoot(this._element);const isInTheDom=(shadowRoot||this._element.ownerDocument.documentElement).contains(this._element);if(showEvent.defaultPrevented||!isInTheDom){return;}
this._disposePopper();const tip=this._getTipElement();this._element.setAttribute('aria-describedby',tip.getAttribute('id'));const{container}=this._config;if(!this._element.ownerDocument.documentElement.contains(this.tip)){container.append(tip);EventHandler.trigger(this._element,this.constructor.eventName(EVENT_INSERTED));}
this._popper=this._createPopper(tip);tip.classList.add(CLASS_NAME_SHOW$2);if('ontouchstart' in document.documentElement){for(const element of[].concat(...document.body.children)){EventHandler.on(element,'mouseover',noop);}}
const complete=()=>{EventHandler.trigger(this._element,this.constructor.eventName(EVENT_SHOWN$2));if(this._isHovered===false){this._leave();}
this._isHovered=false;};this._queueCallback(complete,this.tip,this._isAnimated());}
hide(){if(!this._isShown()){return;}
const hideEvent=EventHandler.trigger(this._element,this.constructor.eventName(EVENT_HIDE$2));if(hideEvent.defaultPrevented){return;}
const tip=this._getTipElement();tip.classList.remove(CLASS_NAME_SHOW$2);if('ontouchstart' in document.documentElement){for(const element of[].concat(...document.body.children)){EventHandler.off(element,'mouseover',noop);}}
this._activeTrigger[TRIGGER_CLICK]=false;this._activeTrigger[TRIGGER_FOCUS]=false;this._activeTrigger[TRIGGER_HOVER]=false;this._isHovered=null;const complete=()=>{if(this._isWithActiveTrigger()){return;}
if(!this._isHovered){this._disposePopper();}
this._element.removeAttribute('aria-describedby');EventHandler.trigger(this._element,this.constructor.eventName(EVENT_HIDDEN$2));};this._queueCallback(complete,this.tip,this._isAnimated());}
update(){if(this._popper){this._popper.update();}}
_isWithContent(){return Boolean(this._getTitle());}
_getTipElement(){if(!this.tip){this.tip=this._createTipElement(this._newContent||this._getContentForTemplate());}
return this.tip;}
_createTipElement(content){const tip=this._getTemplateFactory(content).toHtml();if(!tip){return null;}
tip.classList.remove(CLASS_NAME_FADE$2,CLASS_NAME_SHOW$2);tip.classList.add(`bs-${this.constructor.NAME}-auto`);const tipId=getUID(this.constructor.NAME).toString();tip.setAttribute('id',tipId);if(this._isAnimated()){tip.classList.add(CLASS_NAME_FADE$2);}
return tip;}
setContent(content){this._newContent=content;if(this._isShown()){this._disposePopper();this.show();}}
_getTemplateFactory(content){if(this._templateFactory){this._templateFactory.changeContent(content);}else{this._templateFactory=new TemplateFactory({...this._config,content,extraClass:this._resolvePossibleFunction(this._config.customClass)});}
return this._templateFactory;}
_getContentForTemplate(){return{[SELECTOR_TOOLTIP_INNER]:this._getTitle()};}
_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute('data-bs-original-title');}
_initializeOnDelegatedTarget(event){return this.constructor.getOrCreateInstance(event.delegateTarget,this._getDelegateConfig());}
_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(CLASS_NAME_FADE$2);}
_isShown(){return this.tip&&this.tip.classList.contains(CLASS_NAME_SHOW$2);}
_createPopper(tip){const placement=execute(this._config.placement,[this,tip,this._element]);const attachment=AttachmentMap[placement.toUpperCase()];return createPopper(this._element,tip,this._getPopperConfig(attachment));}
_getOffset(){const{offset}=this._config;if(typeof offset==='string'){return offset.split(',').map(value=>Number.parseInt(value,10));}
if(typeof offset==='function'){return popperData=>offset(popperData,this._element);}
return offset;}
_resolvePossibleFunction(arg){return execute(arg,[this._element]);}
_getPopperConfig(attachment){const defaultBsPopperConfig={placement:attachment,modifiers:[{name:'flip',options:{fallbackPlacements:this._config.fallbackPlacements}},{name:'offset',options:{offset:this._getOffset()}},{name:'preventOverflow',options:{boundary:this._config.boundary}},{name:'arrow',options:{element:`.${this.constructor.NAME}-arrow`}},{name:'preSetPlacement',enabled:true,phase:'beforeMain',fn:data=>{this._getTipElement().setAttribute('data-popper-placement',data.state.placement);}}]};return{...defaultBsPopperConfig,...execute(this._config.popperConfig,[defaultBsPopperConfig])};}
_setListeners(){const triggers=this._config.trigger.split(' ');for(const trigger of triggers){if(trigger==='click'){EventHandler.on(this._element,this.constructor.eventName(EVENT_CLICK$1),this._config.selector,event=>{const context=this._initializeOnDelegatedTarget(event);context.toggle();});}else if(trigger!==TRIGGER_MANUAL){const eventIn=trigger===TRIGGER_HOVER?this.constructor.eventName(EVENT_MOUSEENTER):this.constructor.eventName(EVENT_FOCUSIN$1);const eventOut=trigger===TRIGGER_HOVER?this.constructor.eventName(EVENT_MOUSELEAVE):this.constructor.eventName(EVENT_FOCUSOUT$1);EventHandler.on(this._element,eventIn,this._config.selector,event=>{const context=this._initializeOnDelegatedTarget(event);context._activeTrigger[event.type==='focusin'?TRIGGER_FOCUS:TRIGGER_HOVER]=true;context._enter();});EventHandler.on(this._element,eventOut,this._config.selector,event=>{const context=this._initializeOnDelegatedTarget(event);context._activeTrigger[event.type==='focusout'?TRIGGER_FOCUS:TRIGGER_HOVER]=context._element.contains(event.relatedTarget);context._leave();});}}
this._hideModalHandler=()=>{if(this._element){this.hide();}};EventHandler.on(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler);}
_fixTitle(){const title=this._element.getAttribute('title');if(!title){return;}
if(!this._element.getAttribute('aria-label')&&!this._element.textContent.trim()){this._element.setAttribute('aria-label',title);}
this._element.setAttribute('data-bs-original-title',title);this._element.removeAttribute('title');}
_enter(){if(this._isShown()||this._isHovered){this._isHovered=true;return;}
this._isHovered=true;this._setTimeout(()=>{if(this._isHovered){this.show();}},this._config.delay.show);}
_leave(){if(this._isWithActiveTrigger()){return;}
this._isHovered=false;this._setTimeout(()=>{if(!this._isHovered){this.hide();}},this._config.delay.hide);}
_setTimeout(handler,timeout){clearTimeout(this._timeout);this._timeout=setTimeout(handler,timeout);}
_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(true);}
_getConfig(config){const dataAttributes=Manipulator.getDataAttributes(this._element);for(const dataAttribute of Object.keys(dataAttributes)){if(DISALLOWED_ATTRIBUTES.has(dataAttribute)){delete dataAttributes[dataAttribute];}}
config={...dataAttributes,...(typeof config==='object'&&config?config:{})};config=this._mergeConfigObj(config);config=this._configAfterMerge(config);this._typeCheckConfig(config);return config;}
_configAfterMerge(config){config.container=config.container===false?document.body:getElement(config.container);if(typeof config.delay==='number'){config.delay={show:config.delay,hide:config.delay};}
if(typeof config.title==='number'){config.title=config.title.toString();}
if(typeof config.content==='number'){config.content=config.content.toString();}
return config;}
_getDelegateConfig(){const config={};for(const[key,value]of Object.entries(this._config)){if(this.constructor.Default[key]!==value){config[key]=value;}}
config.selector=false;config.trigger='manual';return config;}
_disposePopper(){if(this._popper){this._popper.destroy();this._popper=null;}
if(this.tip){this.tip.remove();this.tip=null;}}
static jQueryInterface(config){return this.each(function(){const data=Tooltip.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
defineJQueryPlugin(Tooltip);const NAME$3='popover';const SELECTOR_TITLE='.popover-header';const SELECTOR_CONTENT='.popover-body';const Default$2={...Tooltip.Default,content:'',offset:[0,8],placement:'right',template:'<div class="popover" role="tooltip">'+'<div class="popover-arrow"></div>'+'<h3 class="popover-header"></h3>'+'<div class="popover-body"></div>'+'</div>',trigger:'click'};const DefaultType$2={...Tooltip.DefaultType,content:'(null|string|element|function)'};class Popover extends Tooltip{static get Default(){return Default$2;}
static get DefaultType(){return DefaultType$2;}
static get NAME(){return NAME$3;}
_isWithContent(){return this._getTitle()||this._getContent();}
_getContentForTemplate(){return{[SELECTOR_TITLE]:this._getTitle(),[SELECTOR_CONTENT]:this._getContent()};}
_getContent(){return this._resolvePossibleFunction(this._config.content);}
static jQueryInterface(config){return this.each(function(){const data=Popover.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
defineJQueryPlugin(Popover);const NAME$2='scrollspy';const DATA_KEY$2='bs.scrollspy';const EVENT_KEY$2=`.${DATA_KEY$2}`;const DATA_API_KEY='.data-api';const EVENT_ACTIVATE=`activate${EVENT_KEY$2}`;const EVENT_CLICK=`click${EVENT_KEY$2}`;const EVENT_LOAD_DATA_API$1=`load${EVENT_KEY$2}${DATA_API_KEY}`;const CLASS_NAME_DROPDOWN_ITEM='dropdown-item';const CLASS_NAME_ACTIVE$1='active';const SELECTOR_DATA_SPY='[data-bs-spy="scroll"]';const SELECTOR_TARGET_LINKS='[href]';const SELECTOR_NAV_LIST_GROUP='.nav, .list-group';const SELECTOR_NAV_LINKS='.nav-link';const SELECTOR_NAV_ITEMS='.nav-item';const SELECTOR_LIST_ITEMS='.list-group-item';const SELECTOR_LINK_ITEMS=`${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;const SELECTOR_DROPDOWN='.dropdown';const SELECTOR_DROPDOWN_TOGGLE$1='.dropdown-toggle';const Default$1={offset:null,rootMargin:'0px 0px -25%',smoothScroll:false,target:null,threshold:[0.1,0.5,1]};const DefaultType$1={offset:'(number|null)',rootMargin:'string',smoothScroll:'boolean',target:'element',threshold:'array'};class ScrollSpy extends BaseComponent{constructor(element,config){super(element,config);this._targetLinks=new Map();this._observableSections=new Map();this._rootElement=getComputedStyle(this._element).overflowY==='visible'?null:this._element;this._activeTarget=null;this._observer=null;this._previousScrollData={visibleEntryTop:0,parentScrollTop:0};this.refresh();}
static get Default(){return Default$1;}
static get DefaultType(){return DefaultType$1;}
static get NAME(){return NAME$2;}
refresh(){this._initializeTargetsAndObservables();this._maybeEnableSmoothScroll();if(this._observer){this._observer.disconnect();}else{this._observer=this._getNewObserver();}
for(const section of this._observableSections.values()){this._observer.observe(section);}}
dispose(){this._observer.disconnect();super.dispose();}
_configAfterMerge(config){config.target=getElement(config.target)||document.body;config.rootMargin=config.offset?`${config.offset}px 0px -30%`:config.rootMargin;if(typeof config.threshold==='string'){config.threshold=config.threshold.split(',').map(value=>Number.parseFloat(value));}
return config;}
_maybeEnableSmoothScroll(){if(!this._config.smoothScroll){return;}
EventHandler.off(this._config.target,EVENT_CLICK);EventHandler.on(this._config.target,EVENT_CLICK,SELECTOR_TARGET_LINKS,event=>{const observableSection=this._observableSections.get(event.target.hash);if(observableSection){event.preventDefault();const root=this._rootElement||window;const height=observableSection.offsetTop-this._element.offsetTop;if(root.scrollTo){root.scrollTo({top:height,behavior:'smooth'});return;}
root.scrollTop=height;}});}
_getNewObserver(){const options={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(entries=>this._observerCallback(entries),options);}
_observerCallback(entries){const targetElement=entry=>this._targetLinks.get(`#${entry.target.id}`);const activate=entry=>{this._previousScrollData.visibleEntryTop=entry.target.offsetTop;this._process(targetElement(entry));};const parentScrollTop=(this._rootElement||document.documentElement).scrollTop;const userScrollsDown=parentScrollTop>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=parentScrollTop;for(const entry of entries){if(!entry.isIntersecting){this._activeTarget=null;this._clearActiveClass(targetElement(entry));continue;}
const entryIsLowerThanPrevious=entry.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(userScrollsDown&&entryIsLowerThanPrevious){activate(entry);if(!parentScrollTop){return;}
continue;}
if(!userScrollsDown&&!entryIsLowerThanPrevious){activate(entry);}}}
_initializeTargetsAndObservables(){this._targetLinks=new Map();this._observableSections=new Map();const targetLinks=SelectorEngine.find(SELECTOR_TARGET_LINKS,this._config.target);for(const anchor of targetLinks){if(!anchor.hash||isDisabled(anchor)){continue;}
const observableSection=SelectorEngine.findOne(decodeURI(anchor.hash),this._element);if(isVisible(observableSection)){this._targetLinks.set(decodeURI(anchor.hash),anchor);this._observableSections.set(anchor.hash,observableSection);}}}
_process(target){if(this._activeTarget===target){return;}
this._clearActiveClass(this._config.target);this._activeTarget=target;target.classList.add(CLASS_NAME_ACTIVE$1);this._activateParents(target);EventHandler.trigger(this._element,EVENT_ACTIVATE,{relatedTarget:target});}
_activateParents(target){if(target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)){SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1,target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);return;}
for(const listGroup of SelectorEngine.parents(target,SELECTOR_NAV_LIST_GROUP)){for(const item of SelectorEngine.prev(listGroup,SELECTOR_LINK_ITEMS)){item.classList.add(CLASS_NAME_ACTIVE$1);}}}
_clearActiveClass(parent){parent.classList.remove(CLASS_NAME_ACTIVE$1);const activeNodes=SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`,parent);for(const node of activeNodes){node.classList.remove(CLASS_NAME_ACTIVE$1);}}
static jQueryInterface(config){return this.each(function(){const data=ScrollSpy.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
EventHandler.on(window,EVENT_LOAD_DATA_API$1,()=>{for(const spy of SelectorEngine.find(SELECTOR_DATA_SPY)){ScrollSpy.getOrCreateInstance(spy);}});defineJQueryPlugin(ScrollSpy);const NAME$1='tab';const DATA_KEY$1='bs.tab';const EVENT_KEY$1=`.${DATA_KEY$1}`;const EVENT_HIDE$1=`hide${EVENT_KEY$1}`;const EVENT_HIDDEN$1=`hidden${EVENT_KEY$1}`;const EVENT_SHOW$1=`show${EVENT_KEY$1}`;const EVENT_SHOWN$1=`shown${EVENT_KEY$1}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY$1}`;const EVENT_KEYDOWN=`keydown${EVENT_KEY$1}`;const EVENT_LOAD_DATA_API=`load${EVENT_KEY$1}`;const ARROW_LEFT_KEY='ArrowLeft';const ARROW_RIGHT_KEY='ArrowRight';const ARROW_UP_KEY='ArrowUp';const ARROW_DOWN_KEY='ArrowDown';const HOME_KEY='Home';const END_KEY='End';const CLASS_NAME_ACTIVE='active';const CLASS_NAME_FADE$1='fade';const CLASS_NAME_SHOW$1='show';const CLASS_DROPDOWN='dropdown';const SELECTOR_DROPDOWN_TOGGLE='.dropdown-toggle';const SELECTOR_DROPDOWN_MENU='.dropdown-menu';const NOT_SELECTOR_DROPDOWN_TOGGLE=`:not(${SELECTOR_DROPDOWN_TOGGLE})`;const SELECTOR_TAB_PANEL='.list-group, .nav, [role="tablist"]';const SELECTOR_OUTER='.nav-item, .list-group-item';const SELECTOR_INNER=`.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;const SELECTOR_DATA_TOGGLE='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';const SELECTOR_INNER_ELEM=`${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;const SELECTOR_DATA_TOGGLE_ACTIVE=`.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;class Tab extends BaseComponent{constructor(element){super(element);this._parent=this._element.closest(SELECTOR_TAB_PANEL);if(!this._parent){return;}
this._setInitialAttributes(this._parent,this._getChildren());EventHandler.on(this._element,EVENT_KEYDOWN,event=>this._keydown(event));}
static get NAME(){return NAME$1;}
show(){const innerElem=this._element;if(this._elemIsActive(innerElem)){return;}
const active=this._getActiveElem();const hideEvent=active?EventHandler.trigger(active,EVENT_HIDE$1,{relatedTarget:innerElem}):null;const showEvent=EventHandler.trigger(innerElem,EVENT_SHOW$1,{relatedTarget:active});if(showEvent.defaultPrevented||hideEvent&&hideEvent.defaultPrevented){return;}
this._deactivate(active,innerElem);this._activate(innerElem,active);}
_activate(element,relatedElem){if(!element){return;}
element.classList.add(CLASS_NAME_ACTIVE);this._activate(SelectorEngine.getElementFromSelector(element));const complete=()=>{if(element.getAttribute('role')!=='tab'){element.classList.add(CLASS_NAME_SHOW$1);return;}
element.removeAttribute('tabindex');element.setAttribute('aria-selected',true);this._toggleDropDown(element,true);EventHandler.trigger(element,EVENT_SHOWN$1,{relatedTarget:relatedElem});};this._queueCallback(complete,element,element.classList.contains(CLASS_NAME_FADE$1));}
_deactivate(element,relatedElem){if(!element){return;}
element.classList.remove(CLASS_NAME_ACTIVE);element.blur();this._deactivate(SelectorEngine.getElementFromSelector(element));const complete=()=>{if(element.getAttribute('role')!=='tab'){element.classList.remove(CLASS_NAME_SHOW$1);return;}
element.setAttribute('aria-selected',false);element.setAttribute('tabindex','-1');this._toggleDropDown(element,false);EventHandler.trigger(element,EVENT_HIDDEN$1,{relatedTarget:relatedElem});};this._queueCallback(complete,element,element.classList.contains(CLASS_NAME_FADE$1));}
_keydown(event){if(![ARROW_LEFT_KEY,ARROW_RIGHT_KEY,ARROW_UP_KEY,ARROW_DOWN_KEY,HOME_KEY,END_KEY].includes(event.key)){return;}
event.stopPropagation();event.preventDefault();const children=this._getChildren().filter(element=>!isDisabled(element));let nextActiveElement;if([HOME_KEY,END_KEY].includes(event.key)){nextActiveElement=children[event.key===HOME_KEY?0:children.length-1];}else{const isNext=[ARROW_RIGHT_KEY,ARROW_DOWN_KEY].includes(event.key);nextActiveElement=getNextActiveElement(children,event.target,isNext,true);}
if(nextActiveElement){nextActiveElement.focus({preventScroll:true});Tab.getOrCreateInstance(nextActiveElement).show();}}
_getChildren(){return SelectorEngine.find(SELECTOR_INNER_ELEM,this._parent);}
_getActiveElem(){return this._getChildren().find(child=>this._elemIsActive(child))||null;}
_setInitialAttributes(parent,children){this._setAttributeIfNotExists(parent,'role','tablist');for(const child of children){this._setInitialAttributesOnChild(child);}}
_setInitialAttributesOnChild(child){child=this._getInnerElement(child);const isActive=this._elemIsActive(child);const outerElem=this._getOuterElement(child);child.setAttribute('aria-selected',isActive);if(outerElem!==child){this._setAttributeIfNotExists(outerElem,'role','presentation');}
if(!isActive){child.setAttribute('tabindex','-1');}
this._setAttributeIfNotExists(child,'role','tab');this._setInitialAttributesOnTargetPanel(child);}
_setInitialAttributesOnTargetPanel(child){const target=SelectorEngine.getElementFromSelector(child);if(!target){return;}
this._setAttributeIfNotExists(target,'role','tabpanel');if(child.id){this._setAttributeIfNotExists(target,'aria-labelledby',`${child.id}`);}}
_toggleDropDown(element,open){const outerElem=this._getOuterElement(element);if(!outerElem.classList.contains(CLASS_DROPDOWN)){return;}
const toggle=(selector,className)=>{const element=SelectorEngine.findOne(selector,outerElem);if(element){element.classList.toggle(className,open);}};toggle(SELECTOR_DROPDOWN_TOGGLE,CLASS_NAME_ACTIVE);toggle(SELECTOR_DROPDOWN_MENU,CLASS_NAME_SHOW$1);outerElem.setAttribute('aria-expanded',open);}
_setAttributeIfNotExists(element,attribute,value){if(!element.hasAttribute(attribute)){element.setAttribute(attribute,value);}}
_elemIsActive(elem){return elem.classList.contains(CLASS_NAME_ACTIVE);}
_getInnerElement(elem){return elem.matches(SELECTOR_INNER_ELEM)?elem:SelectorEngine.findOne(SELECTOR_INNER_ELEM,elem);}
_getOuterElement(elem){return elem.closest(SELECTOR_OUTER)||elem;}
static jQueryInterface(config){return this.each(function(){const data=Tab.getOrCreateInstance(this);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
if(isDisabled(this)){return;}
Tab.getOrCreateInstance(this).show();});EventHandler.on(window,EVENT_LOAD_DATA_API,()=>{for(const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)){Tab.getOrCreateInstance(element);}});defineJQueryPlugin(Tab);const NAME='toast';const DATA_KEY='bs.toast';const EVENT_KEY=`.${DATA_KEY}`;const EVENT_MOUSEOVER=`mouseover${EVENT_KEY}`;const EVENT_MOUSEOUT=`mouseout${EVENT_KEY}`;const EVENT_FOCUSIN=`focusin${EVENT_KEY}`;const EVENT_FOCUSOUT=`focusout${EVENT_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const CLASS_NAME_FADE='fade';const CLASS_NAME_HIDE='hide';const CLASS_NAME_SHOW='show';const CLASS_NAME_SHOWING='showing';const DefaultType={animation:'boolean',autohide:'boolean',delay:'number'};const Default={animation:true,autohide:true,delay:5000};class Toast extends BaseComponent{constructor(element,config){super(element,config);this._timeout=null;this._hasMouseInteraction=false;this._hasKeyboardInteraction=false;this._setListeners();}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
show(){const showEvent=EventHandler.trigger(this._element,EVENT_SHOW);if(showEvent.defaultPrevented){return;}
this._clearTimeout();if(this._config.animation){this._element.classList.add(CLASS_NAME_FADE);}
const complete=()=>{this._element.classList.remove(CLASS_NAME_SHOWING);EventHandler.trigger(this._element,EVENT_SHOWN);this._maybeScheduleHide();};this._element.classList.remove(CLASS_NAME_HIDE);reflow(this._element);this._element.classList.add(CLASS_NAME_SHOW,CLASS_NAME_SHOWING);this._queueCallback(complete,this._element,this._config.animation);}
hide(){if(!this.isShown()){return;}
const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE);if(hideEvent.defaultPrevented){return;}
const complete=()=>{this._element.classList.add(CLASS_NAME_HIDE);this._element.classList.remove(CLASS_NAME_SHOWING,CLASS_NAME_SHOW);EventHandler.trigger(this._element,EVENT_HIDDEN);};this._element.classList.add(CLASS_NAME_SHOWING);this._queueCallback(complete,this._element,this._config.animation);}
dispose(){this._clearTimeout();if(this.isShown()){this._element.classList.remove(CLASS_NAME_SHOW);}
super.dispose();}
isShown(){return this._element.classList.contains(CLASS_NAME_SHOW);}
_maybeScheduleHide(){if(!this._config.autohide){return;}
if(this._hasMouseInteraction||this._hasKeyboardInteraction){return;}
this._timeout=setTimeout(()=>{this.hide();},this._config.delay);}
_onInteraction(event,isInteracting){switch(event.type){case'mouseover':case'mouseout':{this._hasMouseInteraction=isInteracting;break;}
case'focusin':case'focusout':{this._hasKeyboardInteraction=isInteracting;break;}}
if(isInteracting){this._clearTimeout();return;}
const nextElement=event.relatedTarget;if(this._element===nextElement||this._element.contains(nextElement)){return;}
this._maybeScheduleHide();}
_setListeners(){EventHandler.on(this._element,EVENT_MOUSEOVER,event=>this._onInteraction(event,true));EventHandler.on(this._element,EVENT_MOUSEOUT,event=>this._onInteraction(event,false));EventHandler.on(this._element,EVENT_FOCUSIN,event=>this._onInteraction(event,true));EventHandler.on(this._element,EVENT_FOCUSOUT,event=>this._onInteraction(event,false));}
_clearTimeout(){clearTimeout(this._timeout);this._timeout=null;}
static jQueryInterface(config){return this.each(function(){const data=Toast.getOrCreateInstance(this,config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config](this);}});}}
enableDismissTrigger(Toast);defineJQueryPlugin(Toast);const index_umd={Alert,Button,Carousel,Collapse,Dropdown,Modal,Offcanvas,Popover,ScrollSpy,Tab,Toast,Tooltip};return index_umd;}));;;
(function(global,factory){"use strict";if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document");}
return factory(w);};}else{factory(global);}})(typeof window!=="undefined"?window:this,function(window,noGlobal){"use strict";var arr=[];var getProto=Object.getPrototypeOf;var slice=arr.slice;var flat=arr.flat?function(array){return arr.flat.call(array);}:function(array){return arr.concat.apply([],array);};var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var fnToString=hasOwn.toString;var ObjectFunctionString=fnToString.call(Object);var support={};var isFunction=function isFunction(obj){return typeof obj==="function"&&typeof obj.nodeType!=="number"&&typeof obj.item!=="function";};var isWindow=function isWindow(obj){return obj!=null&&obj===obj.window;};var document=window.document;var preservedScriptAttributes={type:true,src:true,nonce:true,noModule:true};function DOMEval(code,node,doc){doc=doc||document;var i,val,script=doc.createElement("script");script.text=code;if(node){for(i in preservedScriptAttributes){val=node[i]||node.getAttribute&&node.getAttribute(i);if(val){script.setAttribute(i,val);}}}
doc.head.appendChild(script).parentNode.removeChild(script);}
function toType(obj){if(obj==null){return obj+"";}
return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj;}
var version="3.7.1",rhtmlSuffix=/HTML$/i,jQuery=function(selector,context){return new jQuery.fn.init(selector,context);};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,length:0,toArray:function(){return slice.call(this);},get:function(num){if(num==null){return slice.call(this);}
return num<0?this[num+this.length]:this[num];},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;return ret;},each:function(callback){return jQuery.each(this,callback);},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},slice:function(){return this.pushStack(slice.apply(this,arguments));},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},even:function(){return this.pushStack(jQuery.grep(this,function(_elem,i){return(i+1)%2;}));},odd:function(){return this.pushStack(jQuery.grep(this,function(_elem,i){return i%2;}));},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[]);},end:function(){return this.prevObject||this.constructor();},push:push,sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++;}
if(typeof target!=="object"&&!isFunction(target)){target={};}
if(i===length){target=this;i--;}
for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){copy=options[name];if(name==="__proto__"||target===copy){continue;}
if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=Array.isArray(copy)))){src=target[name];if(copyIsArray&&!Array.isArray(src)){clone=[];}else if(!copyIsArray&&!jQuery.isPlainObject(src)){clone={};}else{clone=src;}
copyIsArray=false;target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}
return target;};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,error:function(msg){throw new Error(msg);},noop:function(){},isPlainObject:function(obj){var proto,Ctor;if(!obj||toString.call(obj)!=="[object Object]"){return false;}
proto=getProto(obj);if(!proto){return true;}
Ctor=hasOwn.call(proto,"constructor")&&proto.constructor;return typeof Ctor==="function"&&fnToString.call(Ctor)===ObjectFunctionString;},isEmptyObject:function(obj){var name;for(name in obj){return false;}
return true;},globalEval:function(code,options,doc){DOMEval(code,{nonce:options&&options.nonce},doc);},each:function(obj,callback){var length,i=0;if(isArrayLike(obj)){length=obj.length;for(;i<length;i++){if(callback.call(obj[i],i,obj[i])===false){break;}}}else{for(i in obj){if(callback.call(obj[i],i,obj[i])===false){break;}}}
return obj;},text:function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=jQuery.text(node);}}
if(nodeType===1||nodeType===11){return elem.textContent;}
if(nodeType===9){return elem.documentElement.textContent;}
if(nodeType===3||nodeType===4){return elem.nodeValue;}
return ret;},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArrayLike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr);}else{push.call(ret,arr);}}
return ret;},inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i);},isXMLDoc:function(elem){var namespace=elem&&elem.namespaceURI,docElem=elem&&(elem.ownerDocument||elem).documentElement;return!rhtmlSuffix.test(namespace||docElem&&docElem.nodeName||"HTML");},merge:function(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j];}
first.length=i;return first;},grep:function(elems,callback,invert){var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i);if(callbackInverse!==callbackExpect){matches.push(elems[i]);}}
return matches;},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems)){length=elems.length;for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}}
return flat(ret);},guid:1,support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator];}
jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase();});function isArrayLike(obj){var length=!!obj&&"length" in obj&&obj.length,type=toType(obj);if(isFunction(obj)||isWindow(obj)){return false;}
return type==="array"||length===0||typeof length==="number"&&length>0&&(length-1)in obj;}
function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();}
var pop=arr.pop;var sort=arr.sort;var splice=arr.splice;var whitespace="[\\x20\\t\\r\\n\\f]";var rtrimCSS=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g");jQuery.contains=function(a,b){var bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(a.contains?a.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));};var rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function fcssescape(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD";}
return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ";}
return"\\"+ch;}
jQuery.escapeSelector=function(sel){return(sel+"").replace(rcssescape,fcssescape);};var preferredDoc=document,pushNative=push;(function(){var i,Expr,outermostContext,sortInput,hasDuplicate,push=pushNative,document,documentElement,documentIsHTML,rbuggyQSA,matches,expando=jQuery.expando,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),nonnativeSelectorCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true;}
return 0;},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|"+"loop|multiple|open|readonly|required|scoped",identifier="(?:\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+
whitespace+"*\\]",pseudos=":("+identifier+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rleadingCombinator=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+
whitespace+"*"),rdescend=new RegExp(whitespace+"|>"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp("^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+
whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+
whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\([^\\r\\n\\f])","g"),funescape=function(escape,nonHex){var high="0x"+escape.slice(1)-0x10000;if(nonHex){return nonHex;}
return high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);},unloadHandler=function(){setDocument();},inDisabledFieldset=addCombinator(function(elem){return elem.disabled===true&&nodeName(elem,"fieldset");},{dir:"parentNode",next:"legend"});function safeActiveElement(){try{return document.activeElement;}catch(err){}}
try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:function(target,els){pushNative.apply(target,slice.call(els));},call:function(target){pushNative.apply(target,slice.call(arguments,1));}};}
function find(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;results=results||[];if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results;}
if(!seed){setDocument(context);context=context||document;if(documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){if((elem=context.getElementById(m))){if(elem.id===m){push.call(results,elem);return results;}}else{return results;}}else{if(newContext&&(elem=newContext.getElementById(m))&&find.contains(context,elem)&&elem.id===m){push.call(results,elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}}
if(!nonnativeSelectorCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){newSelector=selector;newContext=context;if(nodeType===1&&(rdescend.test(selector)||rleadingCombinator.test(selector))){newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;if(newContext!=context||!support.scope){if((nid=context.getAttribute("id"))){nid=jQuery.escapeSelector(nid);}else{context.setAttribute("id",(nid=expando));}}
groups=tokenize(selector);i=groups.length;while(i--){groups[i]=(nid?"#"+nid:":scope")+" "+
toSelector(groups[i]);}
newSelector=groups.join(",");}
try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){nonnativeSelectorCache(selector,true);}finally{if(nid===expando){context.removeAttribute("id");}}}}}
return select(selector.replace(rtrimCSS,"$1"),context,results,seed);}
function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()];}
return(cache[key+" "]=value);}
return cache;}
function markFunction(fn){fn[expando]=true;return fn;}
function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el);}catch(e){return false;}finally{if(el.parentNode){el.parentNode.removeChild(el);}
el=null;}}
function createInputPseudo(type){return function(elem){return nodeName(elem,"input")&&elem.type===type;};}
function createButtonPseudo(type){return function(elem){return(nodeName(elem,"input")||nodeName(elem,"button"))&&elem.type===type;};}
function createDisabledPseudo(disabled){return function(elem){if("form" in elem){if(elem.parentNode&&elem.disabled===false){if("label" in elem){if("label" in elem.parentNode){return elem.parentNode.disabled===disabled;}else{return elem.disabled===disabled;}}
return elem.isDisabled===disabled||elem.isDisabled!==!disabled&&inDisabledFieldset(elem)===disabled;}
return elem.disabled===disabled;}else if("label" in elem){return elem.disabled===disabled;}
return false;};}
function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j]);}}});});}
function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context;}
function setDocument(node){var subWindow,doc=node?node.ownerDocument||node:preferredDoc;if(doc==document||doc.nodeType!==9||!doc.documentElement){return document;}
document=doc;documentElement=document.documentElement;documentIsHTML=!jQuery.isXMLDoc(document);matches=documentElement.matches||documentElement.webkitMatchesSelector||documentElement.msMatchesSelector;if(documentElement.msMatchesSelector&&preferredDoc!=document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow){subWindow.addEventListener("unload",unloadHandler);}
support.getById=assert(function(el){documentElement.appendChild(el).id=jQuery.expando;return!document.getElementsByName||!document.getElementsByName(jQuery.expando).length;});support.disconnectedMatch=assert(function(el){return matches.call(el,"*");});support.scope=assert(function(){return document.querySelectorAll(":scope");});support.cssHas=assert(function(){try{document.querySelector(":has(*,:jqfake)");return false;}catch(e){return true;}});if(support.getById){Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};Expr.find.ID=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[];}};}else{Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId;};};Expr.find.ID=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];}
elems=context.getElementsByName(id);i=0;while((elem=elems[i++])){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];}}}
return[];}};}
Expr.find.TAG=function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag);}else{return context.querySelectorAll(tag);}};Expr.find.CLASS=function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyQSA=[];assert(function(el){var input;documentElement.appendChild(el).innerHTML="<a id='"+expando+"' href='' disabled='disabled'></a>"+"<select id='"+expando+"-\r\\' disabled='disabled'>"+"<option selected=''></option></select>";if(!el.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");}
if(!el.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=");}
if(!el.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]");}
if(!el.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");}
input=document.createElement("input");input.setAttribute("type","hidden");el.appendChild(input).setAttribute("name","D");documentElement.appendChild(el).disabled=true;if(el.querySelectorAll(":disabled").length!==2){rbuggyQSA.push(":enabled",":disabled");}
input=document.createElement("input");input.setAttribute("name","");el.appendChild(input);if(!el.querySelectorAll("[name='']").length){rbuggyQSA.push("\\["+whitespace+"*name"+whitespace+"*="+
whitespace+"*(?:''|\"\")");}});if(!support.cssHas){rbuggyQSA.push(":has");}
rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));sortOrder=function(a,b){if(a===b){hasDuplicate=true;return 0;}
var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare;}
compare=(a.ownerDocument||a)==(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===document||a.ownerDocument==preferredDoc&&find.contains(preferredDoc,a)){return-1;}
if(b===document||b.ownerDocument==preferredDoc&&find.contains(preferredDoc,b)){return 1;}
return sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0;}
return compare&4?-1:1;};return document;}
find.matches=function(expr,elements){return find(expr,null,null,elements);};find.matchesSelector=function(elem,expr){setDocument(elem);if(documentIsHTML&&!nonnativeSelectorCache[expr+" "]&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){nonnativeSelectorCache(expr,true);}}
return find(expr,document,null,[elem]).length>0;};find.contains=function(context,elem){if((context.ownerDocument||context)!=document){setDocument(context);}
return jQuery.contains(context,elem);};find.attr=function(elem,name){if((elem.ownerDocument||elem)!=document){setDocument(elem);}
var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;if(val!==undefined){return val;}
return elem.getAttribute(name);};find.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};jQuery.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.sortStable;sortInput=!support.sortStable&&slice.call(results,0);sort.call(results,sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}}
while(j--){splice.call(results,duplicates[j],1);}}
sortInput=null;return results;};jQuery.fn.uniqueSort=function(){return this.pushStack(jQuery.uniqueSort(slice.apply(this)));};Expr=jQuery.expr={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";}
return match.slice(0,4);},CHILD:function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){find.error(match[0]);}
match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd");}else if(match[3]){find.error(match[0]);}
return match;},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr.CHILD.test(match[0])){return null;}
if(match[3]){match[2]=match[4]||match[5]||"";}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);}
return match.slice(0,3);}},filter:{TAG:function(nodeNameSelector){var expectedNodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return nodeName(elem,expectedNodeName);};},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"");});},ATTR:function(name,operator,check){return function(elem){var result=find.attr(elem,name);if(result==null){return operator==="!=";}
if(!operator){return true;}
result+="";if(operator==="="){return result===check;}
if(operator==="!="){return result!==check;}
if(operator==="^="){return check&&result.indexOf(check)===0;}
if(operator==="*="){return check&&result.indexOf(check)>-1;}
if(operator==="$="){return check&&result.slice(-check.length)===check;}
if(operator==="~="){return(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1;}
if(operator==="|="){return result===check||result.slice(0,check.length+1)===check+"-";}
return false;};},CHILD:function(type,what,_argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,_context,xml){var cache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?nodeName(node,name):node.nodeType===1){return false;}}
start=dir=type==="only"&&!start&&"nextSibling";}
return true;}
start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){outerCache=parent[expando]||(parent[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break;}}}else{if(useCache){outerCache=elem[expando]||(elem[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex;}
if(diff===false){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?nodeName(node,name):node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});outerCache[type]=[dirruns,diff];}
if(node===elem){break;}}}}}
diff-=last;return diff===first||(diff%first===0&&diff/first>=0);}};},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||find.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);}
if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf.call(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};}
return fn;}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrimCSS,"$1"));return matcher[expando]?markFunction(function(seed,matches,_context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,_context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop();};}),has:markFunction(function(selector){return function(elem){return find(selector,elem).length>0;};}),contains:markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||jQuery.text(elem)).indexOf(text)>-1;};}),lang:markFunction(function(lang){if(!ridentifier.test(lang||"")){find.error("unsupported lang: "+lang);}
lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},root:function(elem){return elem===documentElement;},focus:function(elem){return elem===safeActiveElement()&&document.hasFocus()&&!!(elem.type||elem.href||~elem.tabIndex);},enabled:createDisabledPseudo(false),disabled:createDisabledPseudo(true),checked:function(elem){return(nodeName(elem,"input")&&!!elem.checked)||(nodeName(elem,"option")&&!!elem.selected);},selected:function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;}
return elem.selected===true;},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false;}}
return true;},parent:function(elem){return!Expr.pseudos.empty(elem);},header:function(elem){return rheader.test(elem.nodeName);},input:function(elem){return rinputs.test(elem.nodeName);},button:function(elem){return nodeName(elem,"input")&&elem.type==="button"||nodeName(elem,"button");},text:function(elem){var attr;return nodeName(elem,"input")&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text");},first:createPositionalPseudo(function(){return[0];}),last:createPositionalPseudo(function(_matchIndexes,length){return[length-1];}),eq:createPositionalPseudo(function(_matchIndexes,length,argument){return[argument<0?argument+length:argument];}),even:createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i);}
return matchIndexes;}),odd:createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i);}
return matchIndexes;}),lt:createPositionalPseudo(function(matchIndexes,length,argument){var i;if(argument<0){i=argument+length;}else if(argument>length){i=length;}else{i=argument;}
for(;--i>=0;){matchIndexes.push(i);}
return matchIndexes;}),gt:createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i);}
return matchIndexes;})}};Expr.pseudos.nth=Expr.pseudos.eq;for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i);}
for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i);}
function setFilters(){}
setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0);}
soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar;}
groups.push((tokens=[]));}
matched=false;if((match=rleadingCombinator.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrimCSS," ")});soFar=soFar.slice(matched.length);}
for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length);}}
if(!matched){break;}}
if(parseOnly){return soFar.length;}
return soFar?find.error(selector):tokenCache(selector,groups).slice(0);}
function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value;}
return selector;}
function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&key==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml);}}
return false;}:function(elem,context,xml){var oldCache,outerCache,newCache=[dirruns,doneName];if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true;}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});if(skip&&nodeName(elem,skip)){elem=elem[dir]||elem;}else if((oldCache=outerCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return(newCache[2]=oldCache[2]);}else{outerCache[key]=newCache;if((newCache[2]=matcher(elem,context,xml))){return true;}}}}}
return false;};}
function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}}
return true;}:matchers[0];}
function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){find(selector,contexts[i],results);}
return results;}
function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if((elem=unmatched[i])){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i);}}}}
return newUnmatched;}
function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter);}
if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector);}
return markFunction(function(seed,results,context,xml){var temp,i,elem,matcherOut,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems;if(matcher){matcherOut=postFinder||(seed?preFilter:preexisting||postFilter)?[]:results;matcher(matcherIn,matcherOut,context,xml);}else{matcherOut=matcherIn;}
if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if((elem=temp[i])){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem);}}}
if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem));}}
postFinder(null,(matcherOut=[]),temp,xml);}
i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf.call(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});}
function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){var ret=(!leadingRelative&&(xml||context!=outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret;}];for(;i<len;i++){if((matcher=Expr.relative[tokens[i].type])){matchers=[addCombinator(elementMatcher(matchers),matcher)];}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break;}}
return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrimCSS,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens));}
matchers.push(matcher);}}
return elementMatcher(matchers);}
function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1),len=elems.length;if(outermost){outermostContext=context==document||context||outermost;}
for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!=document){setDocument(elem);xml=!documentIsHTML;}
while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){push.call(results,elem);break;}}
if(outermost){dirruns=dirrunsUnique;}}
if(bySet){if((elem=!matcher&&elem)){matchedCount--;}
if(seed){unmatched.push(elem);}}}
matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);}
if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results);}}}
setMatched=condense(setMatched);}
push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){jQuery.uniqueSort(results);}}
if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;}
return unmatched;};return bySet?markFunction(superMatcher):superMatcher;}
function compile(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector);}
i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}}
cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector;}
return cached;}
function select(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize((selector=compiled.selector||selector));results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;}else if(compiled){context=context.parentNode;}
selector=selector.slice(tokens.shift().value.length);}
i=matchExpr.needsContext.test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;}
if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results;}
break;}}}}
(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context);return results;}
support.sortStable=expando.split("").sort(sortOrder).join("")===expando;setDocument();support.sortDetached=assert(function(el){return el.compareDocumentPosition(document.createElement("fieldset"))&1;});jQuery.find=find;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.unique=jQuery.uniqueSort;find.compile=compile;find.select=select;find.setDocument=setDocument;find.tokenize=tokenize;find.escape=jQuery.escapeSelector;find.getText=jQuery.text;find.isXML=jQuery.isXMLDoc;find.selectors=jQuery.expr;find.support=jQuery.support;find.uniqueSort=jQuery.uniqueSort;})();var dir=function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break;}
matched.push(elem);}}
return matched;};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n);}}
return matched;};var rneedsContext=jQuery.expr.match.needsContext;var rsingleTag=(/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i);function winnow(elements,qualifier,not){if(isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}
if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});}
if(typeof qualifier!=="string"){return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not;});}
return jQuery.filter(qualifier,elements,not);}
jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";}
if(elems.length===1&&elem.nodeType===1){return jQuery.find.matchesSelector(elem,expr)?[elem]:[];}
return jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));};jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true;}}}));}
ret=this.pushStack([]);for(i=0;i<len;i++){jQuery.find(selector,self[i],ret);}
return len>1?jQuery.uniqueSort(ret):ret;},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this;}
root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);}
if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}}
return this;}else{elem=document.getElementById(match[2]);if(elem){this[0]=elem;this.length=1;}
return this;}}else if(!context||context.jquery){return(context||root).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery);}
return jQuery.makeArray(selector,this);};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets=typeof selectors!=="string"&&jQuery(selectors);if(!rneedsContext.test(selectors)){for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(targets?targets.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break;}}}}
return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;}
if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0]);}
return indexOf.call(this,elem.jquery?elem[0]:elem);},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){}
return cur;}
jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return dir(elem,"parentNode");},parentsUntil:function(elem,_i,until){return dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return dir(elem,"nextSibling");},prevAll:function(elem){return dir(elem,"previousSibling");},nextUntil:function(elem,_i,until){return dir(elem,"nextSibling",until);},prevUntil:function(elem,_i,until){return dir(elem,"previousSibling",until);},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem);},children:function(elem){return siblings(elem.firstChild);},contents:function(elem){if(elem.contentDocument!=null&&getProto(elem.contentDocument)){return elem.contentDocument;}
if(nodeName(elem,"template")){elem=elem.content||elem;}
return jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;}
if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched);}
if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched);}
if(rparentsprev.test(name)){matched.reverse();}}
return this.pushStack(matched);};});var rnothtmlwhite=(/[^\x20\t\r\n\f]+/g);function createOptions(options){var object={};jQuery.each(options.match(rnothtmlwhite)||[],function(_,flag){object[flag]=true;});return object;}
jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var
firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=locked||options.once;fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex<list.length){if(list[firingIndex].apply(memory[0],memory[1])===false&&options.stopOnFalse){firingIndex=list.length;memory=false;}}}
if(!options.memory){memory=false;}
firing=false;if(locked){if(memory){list=[];}else{list="";}}},self={add:function(){if(list){if(memory&&!firing){firingIndex=list.length-1;queue.push(memory);}
(function add(args){jQuery.each(args,function(_,arg){if(isFunction(arg)){if(!options.unique||!self.has(arg)){list.push(arg);}}else if(arg&&arg.length&&toType(arg)!=="string"){add(arg);}});})(arguments);if(memory&&!firing){fire();}}
return this;},remove:function(){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(index<=firingIndex){firingIndex--;}}});return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0;},empty:function(){if(list){list=[];}
return this;},disable:function(){locked=queue=[];list=memory="";return this;},disabled:function(){return!list;},lock:function(){locked=queue=[];if(!memory&&!firing){list=memory="";}
return this;},locked:function(){return!!locked;},fireWith:function(context,args){if(!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){fire();}}
return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};function Identity(v){return v;}
function Thrower(ex){throw ex;}
function adoptValue(value,resolve,reject,noValue){var method;try{if(value&&isFunction((method=value.promise))){method.call(value).done(resolve).fail(reject);}else if(value&&isFunction((method=value.then))){method.call(value,resolve,reject);}else{resolve.apply(undefined,[value].slice(noValue));}}catch(value){reject.apply(undefined,[value]);}}
jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},"catch":function(fn){return promise.then(null,fn);},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(_i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&isFunction(returned.promise)){returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);}else{newDefer[tuple[0]+"With"](this,fn?[returned]:arguments);}});});fns=null;}).promise();},then:function(onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(depth<maxDepth){return;}
returned=handler.apply(that,args);if(returned===deferred.promise()){throw new TypeError("Thenable self-resolution");}
then=returned&&(typeof returned==="object"||typeof returned==="function")&&returned.then;if(isFunction(then)){if(special){then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special));}else{maxDepth++;then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith));}}else{if(handler!==Identity){that=undefined;args=[returned];}
(special||deferred.resolveWith)(that,args);}},process=special?mightThrow:function(){try{mightThrow();}catch(e){if(jQuery.Deferred.exceptionHook){jQuery.Deferred.exceptionHook(e,process.error);}
if(depth+1>=maxDepth){if(handler!==Thrower){that=undefined;args=[e];}
deferred.rejectWith(that,args);}}};if(depth){process();}else{if(jQuery.Deferred.getErrorHook){process.error=jQuery.Deferred.getErrorHook();}else if(jQuery.Deferred.getStackHook){process.error=jQuery.Deferred.getStackHook();}
window.setTimeout(process);}};}
return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith));tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity));tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower));}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock);}
list.add(tuple[3].fire);deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?undefined:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);}
return deferred;},when:function(singleValue){var
remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),primary=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this;resolveValues[i]=arguments.length>1?slice.call(arguments):value;if(!(--remaining)){primary.resolveWith(resolveContexts,resolveValues);}};};if(remaining<=1){adoptValue(singleValue,primary.done(updateFunc(i)).resolve,primary.reject,!remaining);if(primary.state()==="pending"||isFunction(resolveValues[i]&&resolveValues[i].then)){return primary.then();}}
while(i--){adoptValue(resolveValues[i],updateFunc(i),primary.reject);}
return primary.promise();}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,asyncError){if(window.console&&window.console.warn&&error&&rerrorNames.test(error.name)){window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,asyncError);}};jQuery.readyException=function(error){window.setTimeout(function(){throw error;});};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){readyList.then(fn).catch(function(error){jQuery.readyException(error);});return this;};jQuery.extend({isReady:false,readyWait:1,ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return;}
jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;}
readyList.resolveWith(document,[jQuery]);}});jQuery.ready.then=readyList.then;function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready();}
if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready);}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed);}
var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(toType(key)==="object"){chainable=true;for(i in key){access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!isFunction(value)){raw=true;}
if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;fn=function(elem,_key,value){return bulk.call(jQuery(elem),value);};}}
if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));}}}
if(chainable){return elems;}
if(bulk){return fn.call(elems);}
return len?fn(elems[0],key):emptyGet;};var rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g;function fcamelCase(_all,letter){return letter.toUpperCase();}
function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);}
var acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!(+owner.nodeType);};function Data(){this.expando=jQuery.expando+Data.uid++;}
Data.uid=1;Data.prototype={cache:function(owner){var value=owner[this.expando];if(!value){value={};if(acceptData(owner)){if(owner.nodeType){owner[this.expando]=value;}else{Object.defineProperty(owner,this.expando,{value:value,configurable:true});}}}
return value;},set:function(owner,data,value){var prop,cache=this.cache(owner);if(typeof data==="string"){cache[camelCase(data)]=value;}else{for(prop in data){cache[camelCase(prop)]=data[prop];}}
return cache;},get:function(owner,key){return key===undefined?this.cache(owner):owner[this.expando]&&owner[this.expando][camelCase(key)];},access:function(owner,key,value){if(key===undefined||((key&&typeof key==="string")&&value===undefined)){return this.get(owner,key);}
this.set(owner,key,value);return value!==undefined?value:key;},remove:function(owner,key){var i,cache=owner[this.expando];if(cache===undefined){return;}
if(key!==undefined){if(Array.isArray(key)){key=key.map(camelCase);}else{key=camelCase(key);key=key in cache?[key]:(key.match(rnothtmlwhite)||[]);}
i=key.length;while(i--){delete cache[key[i]];}}
if(key===undefined||jQuery.isEmptyObject(cache)){if(owner.nodeType){owner[this.expando]=undefined;}else{delete owner[this.expando];}}},hasData:function(owner){var cache=owner[this.expando];return cache!==undefined&&!jQuery.isEmptyObject(cache);}};var dataPriv=new Data();var dataUser=new Data();var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;function getData(data){if(data==="true"){return true;}
if(data==="false"){return false;}
if(data==="null"){return null;}
if(data===+data+""){return+data;}
if(rbrace.test(data)){return JSON.parse(data);}
return data;}
function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$&").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=getData(data);}catch(e){}
dataUser.set(elem,key,data);}else{data=undefined;}}
return data;}
jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem);},data:function(elem,name,data){return dataUser.access(elem,name,data);},removeData:function(elem,name){dataUser.remove(elem,name);},_data:function(elem,name,data){return dataPriv.access(elem,name,data);},_removeData:function(elem,name){dataPriv.remove(elem,name);}});jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=dataUser.get(elem);if(elem.nodeType===1&&!dataPriv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=camelCase(name.slice(5));dataAttr(elem,name,data[name]);}}}
dataPriv.set(elem,"hasDataAttrs",true);}}
return data;}
if(typeof key==="object"){return this.each(function(){dataUser.set(this,key);});}
return access(this,function(value){var data;if(elem&&value===undefined){data=dataUser.get(elem,key);if(data!==undefined){return data;}
data=dataAttr(elem,key);if(data!==undefined){return data;}
return;}
this.each(function(){dataUser.set(this,key,value);});},null,value,arguments.length>1,null,true);},removeData:function(key){return this.each(function(){dataUser.remove(this,key);});}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||Array.isArray(data)){queue=dataPriv.access(elem,type,jQuery.makeArray(data));}else{queue.push(data);}}
return queue||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type);};if(fn==="inprogress"){fn=queue.shift();startLength--;}
if(fn){if(type==="fx"){queue.unshift("inprogress");}
delete hooks.stop;fn.call(elem,next,hooks);}
if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key]);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;}
if(arguments.length<setter){return jQuery.queue(this[0],type);}
return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},clearQueue:function(type){return this.queue(type||"fx",[]);},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements]);}};if(typeof type!=="string"){obj=type;type=undefined;}
type=type||"fx";while(i--){tmp=dataPriv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve);}}
resolve();return defer.promise(obj);}});var pnum=(/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;var rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i");var cssExpand=["Top","Right","Bottom","Left"];var documentElement=document.documentElement;var isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem);},composed={composed:true};if(documentElement.getRootNode){isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)||elem.getRootNode(composed)===elem.ownerDocument;};}
var isHiddenWithinTree=function(elem,el){elem=el||elem;return elem.style.display==="none"||elem.style.display===""&&isAttached(elem)&&jQuery.css(elem,"display")==="none";};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,maxIterations=20,currentValue=tween?function(){return tween.cur();}:function(){return jQuery.css(elem,prop,"");},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=elem.nodeType&&(jQuery.cssNumber[prop]||unit!=="px"&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){initial=initial/2;unit=unit||initialInUnit[3];initialInUnit=+initial||1;while(maxIterations--){jQuery.style(elem,prop,initialInUnit+unit);if((1-scale)*(1-(scale=currentValue()/initial||0.5))<=0){maxIterations=0;}
initialInUnit=initialInUnit/scale;}
initialInUnit=initialInUnit*2;jQuery.style(elem,prop,initialInUnit+unit);valueParts=valueParts||[];}
if(valueParts){initialInUnit=+initialInUnit||+initial||0;adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2];if(tween){tween.unit=unit;tween.start=initialInUnit;tween.end=adjusted;}}
return adjusted;}
var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];if(display){return display;}
temp=doc.body.appendChild(doc.createElement(nodeName));display=jQuery.css(temp,"display");temp.parentNode.removeChild(temp);if(display==="none"){display="block";}
defaultDisplayMap[nodeName]=display;return display;}
function showHide(elements,show){var display,elem,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue;}
display=elem.style.display;if(show){if(display==="none"){values[index]=dataPriv.get(elem,"display")||null;if(!values[index]){elem.style.display="";}}
if(elem.style.display===""&&isHiddenWithinTree(elem)){values[index]=getDefaultDisplay(elem);}}else{if(display!=="none"){values[index]="none";dataPriv.set(elem,"display",display);}}}
for(index=0;index<length;index++){if(values[index]!=null){elements[index].style.display=values[index];}}
return elements;}
jQuery.fn.extend({show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();}
return this.each(function(){if(isHiddenWithinTree(this)){jQuery(this).show();}else{jQuery(this).hide();}});}});var rcheckableType=(/^(?:checkbox|radio)$/i);var rtagName=(/<([a-z][^\/\0>\x20\t\r\n\f]*)/i);var rscriptType=(/^$|^module$|\/(?:java|ecma)script/i);(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue;div.innerHTML="<option></option>";support.option=!!div.lastChild;})();var wrapMap={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!support.option){wrapMap.optgroup=wrapMap.option=[1,"<select multiple='multiple'>","</select>"];}
function getAll(context,tag){var ret;if(typeof context.getElementsByTagName!=="undefined"){ret=context.getElementsByTagName(tag||"*");}else if(typeof context.querySelectorAll!=="undefined"){ret=context.querySelectorAll(tag||"*");}else{ret=[];}
if(tag===undefined||tag&&nodeName(context,tag)){return jQuery.merge([context],ret);}
return ret;}
function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"));}}
var rhtml=/<|&#?\w+;/;function buildFragment(elems,context,scripts,selection,ignored){var elem,tmp,tag,wrap,attached,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(toType(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem);}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem));}else{tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild;}
jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent="";}}}
fragment.textContent="";i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)>-1){if(ignored){ignored.push(elem);}
continue;}
attached=isAttached(elem);tmp=getAll(fragment.appendChild(elem),"script");if(attached){setGlobalEval(tmp);}
if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}}
return fragment;}
var rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return true;}
function returnFalse(){return false;}
function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;}
for(type in types){on(elem,type,selector,data,types[type],one);}
return elem;}
if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}}
if(fn===false){fn=returnFalse;}else if(!fn){return elem;}
if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);}
return elem.each(function(){jQuery.event.add(this,types,fn,data,selector);});}
jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(!acceptData(elem)){return;}
if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;}
if(selector){jQuery.find.matchesSelector(documentElement,selector);}
if(!handler.guid){handler.guid=jQuery.guid++;}
if(!(events=elemData.events)){events=elemData.events=Object.create(null);}
if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined;};}
types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle);}}}
if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}
if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);}
jQuery.event.global[type]=true;}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return;}
types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);}
continue;}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--;}
if(special.remove){special.remove.call(elem,handleObj);}}}
if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);}
delete events[type];}}
if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events");}},dispatch:function(nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),event=jQuery.event.fix(nativeEvent),handlers=(dataPriv.get(this,"events")||Object.create(null))[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;for(i=1;i<arguments.length;i++){args[i]=arguments[i];}
event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;}
handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.rnamespace||handleObj.namespace===false||event.rnamespace.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation();}}}}}
if(special.postDispatch){special.postDispatch.call(this,event);}
return event.result;},handlers:function(event,handlers){var i,handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&!(event.type==="click"&&event.button>=1)){for(;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&!(event.type==="click"&&cur.disabled===true)){matchedHandlers=[];matchedSelectors={};for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matchedSelectors[sel]===undefined){matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length;}
if(matchedSelectors[sel]){matchedHandlers.push(handleObj);}}
if(matchedHandlers.length){handlerQueue.push({elem:cur,handlers:matchedHandlers});}}}}
cur=this;if(delegateCount<handlers.length){handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)});}
return handlerQueue;},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:true,configurable:true,get:isFunction(hook)?function(){if(this.originalEvent){return hook(this.originalEvent);}}:function(){if(this.originalEvent){return this.originalEvent[name];}},set:function(value){Object.defineProperty(this,name,{enumerable:true,configurable:true,writable:true,value:value});}});},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent);},special:{load:{noBubble:true},click:{setup:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click",true);}
return false;},trigger:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click");}
return true;},_default:function(event){var target=event.target;return rcheckableType.test(target.type)&&target.click&&nodeName(target,"input")&&dataPriv.get(target,"click")||nodeName(target,"a");}},beforeunload:{postDispatch:function(event){if(event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result;}}}}};function leverageNative(el,type,isSetup){if(!isSetup){if(dataPriv.get(el,type)===undefined){jQuery.event.add(el,type,returnTrue);}
return;}
dataPriv.set(el,type,false);jQuery.event.add(el,type,{namespace:false,handler:function(event){var result,saved=dataPriv.get(this,type);if((event.isTrigger&1)&&this[type]){if(!saved){saved=slice.call(arguments);dataPriv.set(this,type,saved);this[type]();result=dataPriv.get(this,type);dataPriv.set(this,type,false);if(saved!==result){event.stopImmediatePropagation();event.preventDefault();return result;}}else if((jQuery.event.special[type]||{}).delegateType){event.stopPropagation();}}else if(saved){dataPriv.set(this,type,jQuery.event.trigger(saved[0],saved.slice(1),this));event.stopPropagation();event.isImmediatePropagationStopped=returnTrue;}}});}
jQuery.removeEvent=function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle);}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props);}
if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?returnTrue:returnFalse;this.target=(src.target&&src.target.nodeType===3)?src.target.parentNode:src.target;this.currentTarget=src.currentTarget;this.relatedTarget=src.relatedTarget;}else{this.type=src;}
if(props){jQuery.extend(this,props);}
this.timeStamp=src&&src.timeStamp||Date.now();this[jQuery.expando]=true;};jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:false,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(e&&!this.isSimulated){e.preventDefault();}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopPropagation();}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopImmediatePropagation();}
this.stopPropagation();}};jQuery.each({altKey:true,bubbles:true,cancelable:true,changedTouches:true,ctrlKey:true,detail:true,eventPhase:true,metaKey:true,pageX:true,pageY:true,shiftKey:true,view:true,"char":true,code:true,charCode:true,key:true,keyCode:true,button:true,buttons:true,clientX:true,clientY:true,offsetX:true,offsetY:true,pointerId:true,pointerType:true,screenX:true,screenY:true,targetTouches:true,toElement:true,touches:true,which:true},jQuery.event.addProp);jQuery.each({focus:"focusin",blur:"focusout"},function(type,delegateType){function focusMappedHandler(nativeEvent){if(document.documentMode){var handle=dataPriv.get(this,"handle"),event=jQuery.event.fix(nativeEvent);event.type=nativeEvent.type==="focusin"?"focus":"blur";event.isSimulated=true;handle(nativeEvent);if(event.target===event.currentTarget){handle(event);}}else{jQuery.event.simulate(delegateType,nativeEvent.target,jQuery.event.fix(nativeEvent));}}
jQuery.event.special[type]={setup:function(){var attaches;leverageNative(this,type,true);if(document.documentMode){attaches=dataPriv.get(this,delegateType);if(!attaches){this.addEventListener(delegateType,focusMappedHandler);}
dataPriv.set(this,delegateType,(attaches||0)+1);}else{return false;}},trigger:function(){leverageNative(this,type);return true;},teardown:function(){var attaches;if(document.documentMode){attaches=dataPriv.get(this,delegateType)-1;if(!attaches){this.removeEventListener(delegateType,focusMappedHandler);dataPriv.remove(this,delegateType);}else{dataPriv.set(this,delegateType,attaches);}}else{return false;}},_default:function(event){return dataPriv.get(event.target,type);},delegateType:delegateType};jQuery.event.special[delegateType]={setup:function(){var doc=this.ownerDocument||this.document||this,dataHolder=document.documentMode?this:doc,attaches=dataPriv.get(dataHolder,delegateType);if(!attaches){if(document.documentMode){this.addEventListener(delegateType,focusMappedHandler);}else{doc.addEventListener(type,focusMappedHandler,true);}}
dataPriv.set(dataHolder,delegateType,(attaches||0)+1);},teardown:function(){var doc=this.ownerDocument||this.document||this,dataHolder=document.documentMode?this:doc,attaches=dataPriv.get(dataHolder,delegateType)-1;if(!attaches){if(document.documentMode){this.removeEventListener(delegateType,focusMappedHandler);}else{doc.removeEventListener(type,focusMappedHandler,true);}
dataPriv.remove(dataHolder,delegateType);}else{dataPriv.set(dataHolder,delegateType,attaches);}}};});jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix;}
return ret;}};});jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn);},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1);},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this;}
if(typeof types==="object"){for(type in types){this.off(type,selector,types[type]);}
return this;}
if(selector===false||typeof selector==="function"){fn=selector;selector=undefined;}
if(fn===false){fn=returnFalse;}
return this.each(function(){jQuery.event.remove(this,types,fn,selector);});}});var
rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function manipulationTarget(elem,content){if(nodeName(elem,"table")&&nodeName(content.nodeType!==11?content:content.firstChild,"tr")){return jQuery(elem).children("tbody")[0]||elem;}
return elem;}
function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem;}
function restoreScript(elem){if((elem.type||"").slice(0,5)==="true/"){elem.type=elem.type.slice(5);}else{elem.removeAttribute("type");}
return elem;}
function cloneCopyEvent(src,dest){var i,l,type,pdataOld,udataOld,udataCur,events;if(dest.nodeType!==1){return;}
if(dataPriv.hasData(src)){pdataOld=dataPriv.get(src);events=pdataOld.events;if(events){dataPriv.remove(dest,"handle events");for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i]);}}}}
if(dataUser.hasData(src)){udataOld=dataUser.access(src);udataCur=jQuery.extend({},udataOld);dataUser.set(dest,udataCur);}}
function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){dest.checked=src.checked;}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue;}}
function domManip(collection,args,callback,ignored){args=flat(args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],valueIsFunction=isFunction(value);if(valueIsFunction||(l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value))){return collection.each(function(index){var self=collection.eq(index);if(valueIsFunction){args[0]=value.call(this,index,self.html());}
domManip(self,args,callback,ignored);});}
if(l){fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;}
if(first||ignored){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"));}}
callback.call(collection[i],node,i);}
if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src&&(node.type||"").toLowerCase()!=="module"){if(jQuery._evalUrl&&!node.noModule){jQuery._evalUrl(node.src,{nonce:node.nonce||node.getAttribute("nonce")},doc);}}else{DOMEval(node.textContent.replace(rcleanScript,""),node,doc);}}}}}}
return collection;}
function remove(elem,selector,keepData){var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;for(;(node=nodes[i])!=null;i++){if(!keepData&&node.nodeType===1){jQuery.cleanData(getAll(node));}
if(node.parentNode){if(keepData&&isAttached(node)){setGlobalEval(getAll(node,"script"));}
node.parentNode.removeChild(node);}}
return elem;}
jQuery.extend({htmlPrefilter:function(html){return html;},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=isAttached(elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i]);}}
if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i]);}}else{cloneCopyEvent(elem,clone);}}
destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));}
return clone;},cleanData:function(elems){var data,elem,type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if((data=elem[dataPriv.expando])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}}
elem[dataPriv.expando]=undefined;}
if(elem[dataUser.expando]){elem[dataUser.expando]=undefined;}}}}});jQuery.fn.extend({detach:function(selector){return remove(this,selector,true);},remove:function(selector){return remove(this,selector);},text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value;}});},null,value,arguments.length);},append:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent="";}}
return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML;}
if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value;}}
elem=0;}catch(e){}}
if(elem){this.empty().append(value);}},null,value,arguments.length);},replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){var parent=this.parentNode;if(jQuery.inArray(this,ignored)<0){jQuery.cleanData(getAll(this));if(parent){parent.replaceChild(elem,this);}}},ignored);}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);push.apply(ret,elems.get());}
return this.pushStack(ret);};});var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var rcustomProp=/^--/;var getStyles=function(elem){var view=elem.ownerDocument.defaultView;if(!view||!view.opener){view=window;}
return view.getComputedStyle(elem);};var swap=function(elem,options,callback){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
ret=callback.call(elem);for(name in options){elem.style[name]=old[name];}
return ret;};var rboxStyle=new RegExp(cssExpand.join("|"),"i");(function(){function computeStyleTests(){if(!div){return;}
container.style.cssText="position:absolute;left:-11111px;width:60px;"+"margin-top:1px;padding:0;border:0";div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;"+"margin:auto;border:1px;padding:1px;"+"width:60%;top:1%";documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);pixelPositionVal=divStyle.top!=="1%";reliableMarginLeftVal=roundPixelMeasures(divStyle.marginLeft)===12;div.style.right="60%";pixelBoxStylesVal=roundPixelMeasures(divStyle.right)===36;boxSizingReliableVal=roundPixelMeasures(divStyle.width)===36;div.style.position="absolute";scrollboxSizeVal=roundPixelMeasures(div.offsetWidth/3)===12;documentElement.removeChild(container);div=null;}
function roundPixelMeasures(measure){return Math.round(parseFloat(measure));}
var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableTrDimensionsVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return;}
div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";jQuery.extend(support,{boxSizingReliable:function(){computeStyleTests();return boxSizingReliableVal;},pixelBoxStyles:function(){computeStyleTests();return pixelBoxStylesVal;},pixelPosition:function(){computeStyleTests();return pixelPositionVal;},reliableMarginLeft:function(){computeStyleTests();return reliableMarginLeftVal;},scrollboxSize:function(){computeStyleTests();return scrollboxSizeVal;},reliableTrDimensions:function(){var table,tr,trChild,trStyle;if(reliableTrDimensionsVal==null){table=document.createElement("table");tr=document.createElement("tr");trChild=document.createElement("div");table.style.cssText="position:absolute;left:-11111px;border-collapse:separate";tr.style.cssText="box-sizing:content-box;border:1px solid";tr.style.height="1px";trChild.style.height="9px";trChild.style.display="block";documentElement.appendChild(table).appendChild(tr).appendChild(trChild);trStyle=window.getComputedStyle(tr);reliableTrDimensionsVal=(parseInt(trStyle.height,10)+
parseInt(trStyle.borderTopWidth,10)+
parseInt(trStyle.borderBottomWidth,10))===tr.offsetHeight;documentElement.removeChild(table);}
return reliableTrDimensionsVal;}});})();function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,isCustomProp=rcustomProp.test(name),style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name];if(isCustomProp&&ret){ret=ret.replace(rtrimCSS,"$1")||undefined;}
if(ret===""&&!isAttached(elem)){ret=jQuery.style(elem,name);}
if(!support.pixelBoxStyles()&&rnumnonpx.test(ret)&&rboxStyle.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth;}}
return ret!==undefined?ret+"":ret;}
function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return;}
return(this.get=hookFn).apply(this,arguments);}};}
var cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style,vendorProps={};function vendorPropName(name){var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}
function finalPropName(name){var final=jQuery.cssProps[name]||vendorProps[name];if(final){return final;}
if(name in emptyStyle){return name;}
return vendorProps[name]=vendorPropName(name)||name;}
var
rdisplayswap=/^(none|table(?!-c[ea]).+)/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"};function setPositiveNumber(_elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value;}
function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i=dimension==="width"?1:0,extra=0,delta=0,marginDelta=0;if(box===(isBorderBox?"border":"content")){return 0;}
for(;i<4;i+=2){if(box==="margin"){marginDelta+=jQuery.css(elem,box+cssExpand[i],true,styles);}
if(!isBorderBox){delta+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(box!=="padding"){delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}else{extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}else{if(box==="content"){delta-=jQuery.css(elem,"padding"+cssExpand[i],true,styles);}
if(box!=="margin"){delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}}
if(!isBorderBox&&computedVal>=0){delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-
computedVal-
delta-
extra-
0.5))||0;}
return delta+marginDelta;}
function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),boxSizingNeeded=!support.boxSizingReliable()||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",valueIsBorderBox=isBorderBox,val=curCSS(elem,dimension,styles),offsetProp="offset"+dimension[0].toUpperCase()+dimension.slice(1);if(rnumnonpx.test(val)){if(!extra){return val;}
val="auto";}
if((!support.boxSizingReliable()&&isBorderBox||!support.reliableTrDimensions()&&nodeName(elem,"tr")||val==="auto"||!parseFloat(val)&&jQuery.css(elem,"display",false,styles)==="inline")&&elem.getClientRects().length){isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";valueIsBorderBox=offsetProp in elem;if(valueIsBorderBox){val=elem[offsetProp];}}
val=parseFloat(val)||0;return(val+
boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val))+"px";}
jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{animationIterationCount:true,aspectRatio:true,borderImageSlice:true,columnCount:true,flexGrow:true,flexShrink:true,fontWeight:true,gridArea:true,gridColumn:true,gridColumnEnd:true,gridColumnStart:true,gridRow:true,gridRowEnd:true,gridRowStart:true,lineHeight:true,opacity:true,order:true,orphans:true,scale:true,widows:true,zIndex:true,zoom:true,fillOpacity:true,floodOpacity:true,stopOpacity:true,strokeMiterlimit:true,strokeOpacity:true},cssProps:{},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;}
var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(!isCustomProp){name=finalPropName(origName);}
hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rcssNum.exec(value))&&ret[1]){value=adjustCSS(elem,name,ret);type="number";}
if(value==null||value!==value){return;}
if(type==="number"&&!isCustomProp){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px");}
if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";}
if(!hooks||!("set" in hooks)||(value=hooks.set(elem,value,extra))!==undefined){if(isCustomProp){style.setProperty(name,value);}else{style[name]=value;}}}else{if(hooks&&"get" in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret;}
return style[name];}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name);if(!isCustomProp){name=finalPropName(origName);}
hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get" in hooks){val=hooks.get(elem,true,extra);}
if(val===undefined){val=curCSS(elem,name,styles);}
if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];}
if(extra===""||extra){num=parseFloat(val);return extra===true||isFinite(num)?num||0:val;}
return val;}});jQuery.each(["height","width"],function(_i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&(!elem.getClientRects().length||!elem.getBoundingClientRect().width)?swap(elem,cssShow,function(){return getWidthOrHeight(elem,dimension,extra);}):getWidthOrHeight(elem,dimension,extra);}},set:function(elem,value,extra){var matches,styles=getStyles(elem),scrollboxSizeBuggy=!support.scrollboxSize()&&styles.position==="absolute",boxSizingNeeded=scrollboxSizeBuggy||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",subtract=extra?boxModelAdjustment(elem,dimension,extra,isBorderBox,styles):0;if(isBorderBox&&scrollboxSizeBuggy){subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-
parseFloat(styles[dimension])-
boxModelAdjustment(elem,dimension,"border",false,styles)-
0.5);}
if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[dimension]=value;value=jQuery.css(elem,dimension);}
return setPositiveNumber(elem,value,subtract);}};});jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-
swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left;}))+"px";}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];}
return expanded;}};if(prefix!=="margin"){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber;}});jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(Array.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles);}
return map;}
return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name);},name,value,arguments.length>1);}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing);}
jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px");},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this);},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration);}else{this.pos=eased=percent;}
this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);}
if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);}
return this;}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop];}
result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween);}else if(tween.elem.nodeType===1&&(jQuery.cssHooks[tween.prop]||tween.elem.style[finalPropName(tween.prop)]!=null)){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit);}else{tween.elem[tween.prop]=tween.now;}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now;}}};jQuery.easing={linear:function(p){return p;},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2;},_default:"swing"};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var
fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){if(inProgress){if(document.hidden===false&&window.requestAnimationFrame){window.requestAnimationFrame(schedule);}else{window.setTimeout(schedule,jQuery.fx.interval);}
jQuery.fx.tick();}}
function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return(fxNow=Date.now());}
function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type;}
if(includeWidth){attrs.opacity=attrs.width=type;}
return attrs;}
function createTween(value,prop,animation){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if((tween=collection[index].call(animation,prop,value))){return tween;}}}
function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width" in props||"height" in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire();}};}
hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire();}});});}
for(prop in props){value=props[prop];if(rfxtypes.test(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=true;}else{continue;}}
orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop);}}
propTween=!jQuery.isEmptyObject(props);if(!propTween&&jQuery.isEmptyObject(orig)){return;}
if(isBox&&elem.nodeType===1){opts.overflow=[style.overflow,style.overflowX,style.overflowY];restoreDisplay=dataShow&&dataShow.display;if(restoreDisplay==null){restoreDisplay=dataPriv.get(elem,"display");}
display=jQuery.css(elem,"display");if(display==="none"){if(restoreDisplay){display=restoreDisplay;}else{showHide([elem],true);restoreDisplay=elem.style.display||restoreDisplay;display=jQuery.css(elem,"display");showHide([elem]);}}
if(display==="inline"||display==="inline-block"&&restoreDisplay!=null){if(jQuery.css(elem,"float")==="none"){if(!propTween){anim.done(function(){style.display=restoreDisplay;});if(restoreDisplay==null){display=style.display;restoreDisplay=display==="none"?"":display;}}
style.display="inline-block";}}}
if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2];});}
propTween=false;for(prop in orig){if(!propTween){if(dataShow){if("hidden" in dataShow){hidden=dataShow.hidden;}}else{dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay});}
if(toggle){dataShow.hidden=!hidden;}
if(hidden){showHide([elem],true);}
anim.done(function(){if(!hidden){showHide([elem]);}
dataPriv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop]);}});}
propTween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=propTween.start;if(hidden){propTween.end=propTween.start;propTween.start=0;}}}}
function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=camelCase(index);easing=specialEasing[name];value=props[index];if(Array.isArray(value)){easing=value[1];value=props[index]=value[0];}
if(index!==name){props[name]=value;delete props[index];}
hooks=jQuery.cssHooks[name];if(hooks&&"expand" in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing;}}}else{specialEasing[name]=easing;}}}
function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem;}),tick=function(){if(stopped){return false;}
var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent);}
deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining;}
if(!length){deferred.notifyWith(elem,[animation,1,0]);}
deferred.resolveWith(elem,[animation]);return false;},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween;},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this;}
stopped=true;for(;index<length;index++){animation.tweens[index].run(1);}
if(gotoEnd){deferred.notifyWith(elem,[animation,1,0]);deferred.resolveWith(elem,[animation,gotoEnd]);}else{deferred.rejectWith(elem,[animation,gotoEnd]);}
return this;}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=Animation.prefilters[index].call(animation,elem,props,animation.opts);if(result){if(isFunction(result.stop)){jQuery._queueHooks(animation.elem,animation.opts.queue).stop=result.stop.bind(result);}
return result;}}
jQuery.map(props,createTween,animation);if(isFunction(animation.opts.start)){animation.opts.start.call(elem,animation);}
animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation;}
jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);adjustCSS(tween.elem,prop,rcssNum.exec(value),tween);return tween;}]},tweener:function(props,callback){if(isFunction(props)){callback=props;props=["*"];}else{props=props.match(rnothtmlwhite);}
var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];Animation.tweeners[prop]=Animation.tweeners[prop]||[];Animation.tweeners[prop].unshift(callback);}},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){if(prepend){Animation.prefilters.unshift(callback);}else{Animation.prefilters.push(callback);}}});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!isFunction(easing)&&easing};if(jQuery.fx.off){opt.duration=0;}else{if(typeof opt.duration!=="number"){if(opt.duration in jQuery.fx.speeds){opt.duration=jQuery.fx.speeds[opt.duration];}else{opt.duration=jQuery.fx.speeds._default;}}}
if(opt.queue==null||opt.queue===true){opt.queue="fx";}
opt.old=opt.complete;opt.complete=function(){if(isFunction(opt.old)){opt.old.call(this);}
if(opt.queue){jQuery.dequeue(this,opt.queue);}};return opt;};jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback);},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||dataPriv.get(this,"finish")){anim.stop(true);}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation);},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd);};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined;}
if(clearQueue){this.queue(type||"fx",[]);}
return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index]);}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index]);}}}
for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1);}}
if(dequeue||!gotoEnd){jQuery.dequeue(this,type);}});},finish:function(type){if(type!==false){type=type||"fx";}
return this.each(function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true);}
for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1);}}
for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this);}}
delete data.finish;});}});jQuery.each(["toggle","show","hide"],function(_i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback);};});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback);};});jQuery.timers=[];jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;fxNow=Date.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1);}}
if(!timers.length){jQuery.fx.stop();}
fxNow=undefined;};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);jQuery.fx.start();};jQuery.fx.interval=13;jQuery.fx.start=function(){if(inProgress){return;}
inProgress=true;schedule();};jQuery.fx.stop=function(){inProgress=null;};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout);};});};(function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;input=document.createElement("input");input.value="t";input.type="radio";support.radioValue=input.value==="t";})();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;}
if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);}
if(nType!==1||!jQuery.isXMLDoc(elem)){hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:undefined);}
if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;}
if(hooks&&"set" in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
elem.setAttribute(name,value+"");return value;}
if(hooks&&"get" in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;}
return value;}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){elem.removeAttribute(name);}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else{elem.setAttribute(name,name);}
return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(_i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();if(!isXML){handle=attrHandle[lowercaseName];attrHandle[lowercaseName]=ret;ret=getter(elem,name,isXML)!=null?lowercaseName:null;attrHandle[lowercaseName]=handle;}
return ret;};});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name];});}});jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;}
if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];}
if(value!==undefined){if(hooks&&"set" in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
return(elem[name]=value);}
if(hooks&&"get" in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
return elem[name];},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");if(tabindex){return parseInt(tabindex,10);}
if(rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href){return 0;}
return-1;}}},propFix:{"for":"htmlFor","class":"className"}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex;}
return null;},set:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}};}
jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(" ");}
function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||"";}
function classesToArray(value){if(Array.isArray(value)){return value;}
if(typeof value==="string"){return value.match(rnothtmlwhite)||[];}
return[];}
jQuery.fn.extend({addClass:function(value){var classNames,cur,curValue,className,i,finalValue;if(isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)));});}
classNames=classesToArray(value);if(classNames.length){return this.each(function(){curValue=getClass(this);cur=this.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){for(i=0;i<classNames.length;i++){className=classNames[i];if(cur.indexOf(" "+className+" ")<0){cur+=className+" ";}}
finalValue=stripAndCollapse(cur);if(curValue!==finalValue){this.setAttribute("class",finalValue);}}});}
return this;},removeClass:function(value){var classNames,cur,curValue,className,i,finalValue;if(isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)));});}
if(!arguments.length){return this.attr("class","");}
classNames=classesToArray(value);if(classNames.length){return this.each(function(){curValue=getClass(this);cur=this.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){for(i=0;i<classNames.length;i++){className=classNames[i];while(cur.indexOf(" "+className+" ")>-1){cur=cur.replace(" "+className+" "," ");}}
finalValue=stripAndCollapse(cur);if(curValue!==finalValue){this.setAttribute("class",finalValue);}}});}
return this;},toggleClass:function(value,stateVal){var classNames,className,i,self,type=typeof value,isValidValue=type==="string"||Array.isArray(value);if(isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal);});}
if(typeof stateVal==="boolean"&&isValidValue){return stateVal?this.addClass(value):this.removeClass(value);}
classNames=classesToArray(value);return this.each(function(){if(isValidValue){self=jQuery(this);for(i=0;i<classNames.length;i++){className=classNames[i];if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,"__className__",className);}
if(this.setAttribute){this.setAttribute("class",className||value===false?"":dataPriv.get(this,"__className__")||"");}}});},hasClass:function(selector){var className,elem,i=0;className=" "+selector+" ";while((elem=this[i++])){if(elem.nodeType===1&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1){return true;}}
return false;}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get" in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;}
ret=elem.value;if(typeof ret==="string"){return ret.replace(rreturn,"");}
return ret==null?"":ret;}
return;}
valueIsFunction=isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;}
if(valueIsFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;}
if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(Array.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});}
hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set" in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:stripAndCollapse(jQuery.text(elem));}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one",values=one?null:[],max=one?index+1:options.length;if(index<0){i=max;}else{i=one?index:0;}
for(;i<max;i++){option=options[i];if((option.selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value;}
values.push(value);}}
return values;},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1){optionSet=true;}}
if(!optionSet){elem.selectedIndex=-1;}
return values;}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1);}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});var location=window.location;var nonce={guid:Date.now()};var rquery=(/\?/);jQuery.parseXML=function(data){var xml,parserErrorElem;if(!data||typeof data!=="string"){return null;}
try{xml=(new window.DOMParser()).parseFromString(data,"text/xml");}catch(e){}
parserErrorElem=xml&&xml.getElementsByTagName("parsererror")[0];if(!xml||parserErrorElem){jQuery.error("Invalid XML: "+(parserErrorElem?jQuery.map(parserErrorElem.childNodes,function(el){return el.textContent;}).join("\n"):data));}
return xml;};var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation();};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=lastElement=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;}
if(rfocusMorph.test(type+jQuery.event.triggered)){return;}
if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();}
ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;}
data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;}
if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;}
for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;}
if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}}
i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){lastElement=cur;event.type=i>1?bubbleType:special.bindType||type;handle=(dataPriv.get(cur,"events")||Object.create(null))[event.type]&&dataPriv.get(cur,"handle");if(handle){handle.apply(cur,data);}
handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault();}}}
event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(ontype&&isFunction(elem[type])&&!isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;}
jQuery.event.triggered=type;if(event.isPropagationStopped()){lastElement.addEventListener(type,stopPropagationCallback);}
elem[type]();if(event.isPropagationStopped()){lastElement.removeEventListener(type,stopPropagationCallback);}
jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}}
return event.result;},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true});jQuery.event.trigger(e,null,elem);}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true);}}});var
rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,add);}});}else if(!traditional&&toType(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}}
jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+
encodeURIComponent(value==null?"":value);};if(a==null){return"";}
if(Array.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}}
return s.join("&");};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type));}).map(function(_i,elem){var val=jQuery(this).val();if(val==null){return null;}
if(Array.isArray(val)){return jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};});}
return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});var
r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href;function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";}
var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};}
function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;}
return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");}
function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}}
if(deep){jQuery.extend(true,target,deep);}
return target;}
function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}}
if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}
if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;}
if(!firstDataType){firstDataType=type;}}
finalDataType=finalDataType||firstDataType;}
if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}
return responses[finalDataType];}}
function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}
current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}
if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}
prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}
break;}}}}
if(conv!==true){if(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}}
return{state:"success",data:response};}
jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;}
options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()+" "]=(responseHeaders[match[1].toLowerCase()+" "]||[]).concat(match[2]);}}
match=responseHeaders[key.toLowerCase()+" "];}
return match==null?null:match.join(", ");},getAllResponseHeaders:function(){return completed?responseHeadersString:null;},setRequestHeader:function(name,value){if(completed==null){name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name;requestHeaders[name]=value;}
return this;},overrideMimeType:function(type){if(completed==null){s.mimeType=type;}
return this;},statusCode:function(map){var code;if(map){if(completed){jqXHR.always(map[jqXHR.status]);}else{for(code in map){statusCode[code]=[statusCode[code],map[code]];}}}
return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);}
done(0,finalText);return this;}};deferred.promise(jqXHR);s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""];if(s.crossDomain==null){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host;}catch(e){s.crossDomain=true;}}
if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}
inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(completed){return jqXHR;}
fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");}
s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url.replace(rhash,"");if(!s.hasContent){uncached=s.url.slice(cacheURL.length);if(s.data&&(s.processData||typeof s.data==="string")){cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data;delete s.data;}
if(s.cache===false){cacheURL=cacheURL.replace(rantiCache,"$1");uncached=(rquery.test(cacheURL)?"&":"?")+"_="+(nonce.guid++)+
uncached;}
s.url=cacheURL+uncached;}else if(s.data&&s.processData&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0){s.data=s.data.replace(r20,"+");}
if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);}
if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}}
if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);}
jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+
(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);}
if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||completed)){return jqXHR.abort();}
strAbort="abort";completeDeferred.add(s.complete);jqXHR.done(s.success);jqXHR.fail(s.error);transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);}
if(completed){return jqXHR;}
if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout");},s.timeout);}
try{completed=false;transport.send(requestHeaders,done);}catch(e){if(completed){throw e;}
done(-1,e);}}
function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(completed){return;}
completed=true;if(timeoutTimer){window.clearTimeout(timeoutTimer);}
transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);}
if(!isSuccess&&jQuery.inArray("script",s.dataTypes)>-1&&jQuery.inArray("json",s.dataTypes)<0){s.converters["text script"]=function(){};}
response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;}
modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}}
if(status===204||s.type==="HEAD"){statusText="nocontent";}else if(status===304){statusText="notmodified";}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error;}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0;}}}
jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);}
jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);}
completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}}
return jqXHR;},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");}});jQuery.each(["get","post"],function(_i,method){jQuery[method]=function(url,data,callback,type){if(isFunction(data)){type=type||callback;callback=data;data=undefined;}
return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url));};});jQuery.ajaxPrefilter(function(s){var i;for(i in s.headers){if(i.toLowerCase()==="content-type"){s.contentType=s.headers[i]||"";}}});jQuery._evalUrl=function(url,options,doc){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:true,async:false,global:false,converters:{"text script":function(){}},dataFilter:function(response){jQuery.globalEval(response,options,doc);}});};jQuery.fn.extend({wrapAll:function(html){var wrap;if(this[0]){if(isFunction(html)){html=html.call(this[0]);}
wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}
wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild;}
return elem;}).append(this);}
return this;},wrapInner:function(html){if(isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}
return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each(function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html);});},unwrap:function(selector){this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes);});return this;}});jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem);};jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length);};jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest();}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&("withCredentials" in xhrSupported);support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i];}}
if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType);}
if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";}
for(i in headers){xhr.setRequestHeader(i,headers[i]);}
callback=function(type){return function(){if(callback){callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null;if(type==="abort"){xhr.abort();}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,"error");}else{complete(xhr.status,xhr.statusText);}}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,(xhr.responseType||"text")!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders());}}};};xhr.onload=callback();errorCallback=xhr.onerror=xhr.ontimeout=callback("error");if(xhr.onabort!==undefined){xhr.onabort=errorCallback;}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){window.setTimeout(function(){if(callback){errorCallback();}});}};}
callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null);}catch(e){if(callback){throw e;}}},abort:function(){if(callback){callback();}}};}});jQuery.ajaxPrefilter(function(s){if(s.crossDomain){s.contents.script=false;}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;}
if(s.crossDomain){s.type="GET";}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain||s.scriptAttrs){var script,callback;return{send:function(_,complete){script=jQuery("<script>").attr(s.scriptAttrs||{}).prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove();callback=null;if(evt){complete(evt.type==="error"?404:200,evt.type);}});document.head.appendChild(script[0]);},abort:function(){if(callback){callback();}}};}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(nonce.guid++));this[callback]=true;return callback;}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName);}else if(s.jsonp!==false){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName;}
s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called");}
return responseContainer[0];};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments;};jqXHR.always(function(){if(overwritten===undefined){jQuery(window).removeProp(callbackName);}else{window[callbackName]=overwritten;}
if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName);}
if(responseContainer&&isFunction(overwritten)){overwritten(responseContainer[0]);}
responseContainer=overwritten=undefined;});return"script";}});support.createHTMLDocument=(function(){var body=document.implementation.createHTMLDocument("").body;body.innerHTML="<form></form><form></form>";return body.childNodes.length===2;})();jQuery.parseHTML=function(data,context,keepScripts){if(typeof data!=="string"){return[];}
if(typeof context==="boolean"){keepScripts=context;context=false;}
var base,parsed,scripts;if(!context){if(support.createHTMLDocument){context=document.implementation.createHTMLDocument("");base=context.createElement("base");base.href=document.location.href;context.head.appendChild(base);}else{context=document;}}
parsed=rsingleTag.exec(data);scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])];}
parsed=buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove();}
return jQuery.merge([],parsed.childNodes);};jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");if(off>-1){selector=stripAndCollapse(url.slice(off));url=url.slice(0,off);}
if(isFunction(params)){callback=params;params=undefined;}else if(params&&typeof params==="object"){type="POST";}
if(self.length>0){jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText);}).always(callback&&function(jqXHR,status){self.each(function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR]);});});}
return this;};jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative";}
curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto")>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;}
if(isFunction(options)){options=options.call(elem,i,jQuery.extend({},curOffset));}
if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;}
if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;}
if("using" in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({offset:function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i);});}
var rect,win,elem=this[0];if(!elem){return;}
if(!elem.getClientRects().length){return{top:0,left:0};}
rect=elem.getBoundingClientRect();win=elem.ownerDocument.defaultView;return{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset};},position:function(){if(!this[0]){return;}
var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect();}else{offset=this.offset();doc=elem.ownerDocument;offsetParent=elem.offsetParent||doc.documentElement;while(offsetParent&&(offsetParent===doc.body||offsetParent===doc.documentElement)&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.parentNode;}
if(offsetParent&&offsetParent!==elem&&offsetParent.nodeType===1){parentOffset=jQuery(offsetParent).offset();parentOffset.top+=jQuery.css(offsetParent,"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",true);}}
return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent;while(offsetParent&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent;}
return offsetParent||documentElement;});}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win;if(isWindow(elem)){win=elem;}else if(elem.nodeType===9){win=elem.defaultView;}
if(val===undefined){return win?win[prop]:elem[method];}
if(win){win.scrollTo(!top?val:win.pageXOffset,top?val:win.pageYOffset);}else{elem[method]=val;}},method,val,arguments.length);};});jQuery.each(["top","left"],function(_i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed;}});});jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return access(this,function(elem,type,value){var doc;if(isWindow(elem)){return funcName.indexOf("outer")===0?elem["inner"+name]:elem.document.documentElement["client"+name];}
if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name]);}
return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra);},type,chainable?margin:undefined,chainable);};});});jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(_i,type){jQuery.fn[type]=function(fn){return this.on(type,fn);};});jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn);},unbind:function(types,fn){return this.off(types,null,fn);},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn);},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn);},hover:function(fnOver,fnOut){return this.on("mouseenter",fnOver).on("mouseleave",fnOut||fnOver);}});jQuery.each(("blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu").split(" "),function(_i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});var rtrim=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;jQuery.proxy=function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp;}
if(!isFunction(fn)){return undefined;}
args=slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)));};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy;};jQuery.holdReady=function(hold){if(hold){jQuery.readyWait++;}else{jQuery.ready(true);}};jQuery.isArray=Array.isArray;jQuery.parseJSON=JSON.parse;jQuery.nodeName=nodeName;jQuery.isFunction=isFunction;jQuery.isWindow=isWindow;jQuery.camelCase=camelCase;jQuery.type=toType;jQuery.now=Date.now;jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return(type==="number"||type==="string")&&!isNaN(obj-parseFloat(obj));};jQuery.trim=function(text){return text==null?"":(text+"").replace(rtrim,"$1");};if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery;});}
var
_jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$;}
if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;}
return jQuery;};if(typeof noGlobal==="undefined"){window.jQuery=window.$=jQuery;}
return jQuery;});;;
(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{factory(jQuery);}})(function($){"use strict";$.ui=$.ui||{};var version=$.ui.version="1.13.2";var widgetUuid=0;var widgetHasOwnProperty=Array.prototype.hasOwnProperty;var widgetSlice=Array.prototype.slice;$.cleanData=(function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove");}}
orig(elems);};})($.cleanData);$.widget=function(name,base,prototype){var existingConstructor,constructor,basePrototype;var proxiedPrototype={};var namespace=name.split(".")[0];name=name.split(".")[1];var fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}
if(Array.isArray(prototype)){prototype=$.extend.apply(null,[{}].concat(prototype));}
$.expr.pseudos[fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this||!this._createWidget){return new constructor(options,element);}
if(arguments.length){this._createWidget(options,element);}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(typeof value!=="function"){proxiedPrototype[prop]=value;return;}
proxiedPrototype[prop]=(function(){function _super(){return base.prototype[prop].apply(this,arguments);}
function _superApply(args){return base.prototype[prop].apply(this,args);}
return function(){var __super=this._super;var __superApply=this._superApply;var returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue;};})();});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?(basePrototype.widgetEventPrefix||name):name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto);});delete existingConstructor._childConstructors;}else{base._childConstructors.push(constructor);}
$.widget.bridge(name,constructor);return constructor;};$.widget.extend=function(target){var input=widgetSlice.call(arguments,1);var inputIndex=0;var inputLength=input.length;var key;var value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(widgetHasOwnProperty.call(input[inputIndex],key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}}
return target;};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string";var args=widgetSlice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined;}else{this.each(function(){var methodValue;var instance=$.data(this,fullName);if(options==="instance"){returnValue=instance;return false;}
if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'");}
if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));}
this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{$.data(this,fullName,new object(options,this));}});}
return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=widgetUuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=$();this.hoverable=$();this.focusable=$();this.classesElementLookup={};if(element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{remove:function(event){if(event.target===element){this.destroy();}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow);}
this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled);}
this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:function(){return{};},_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){var that=this;this._destroy();$.each(this.classesElementLookup,function(key,value){that._removeClass(value,key);});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace);},_destroy:$.noop,widget:function(){return this.element;},option:function(key,value){var options=key;var parts;var curOption;var i;if(arguments.length===0){return $.widget.extend({},this.options);}
if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]];}
key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key];}
curOption[key]=value;}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key];}
options[key]=value;}}
this._setOptions(options);return this;},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key]);}
return this;},_setOption:function(key,value){if(key==="classes"){this._setOptionClasses(value);}
this.options[key]=value;if(key==="disabled"){this._setOptionDisabled(value);}
return this;},_setOptionClasses:function(value){var classKey,elements,currentElements;for(classKey in value){currentElements=this.classesElementLookup[classKey];if(value[classKey]===this.options.classes[classKey]||!currentElements||!currentElements.length){continue;}
elements=$(currentElements.get());this._removeClass(currentElements,classKey);elements.addClass(this._classes({element:elements,keys:classKey,classes:value,add:true}));}},_setOptionDisabled:function(value){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!value);if(value){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus");}},enable:function(){return this._setOptions({disabled:false});},disable:function(){return this._setOptions({disabled:true});},_classes:function(options){var full=[];var that=this;options=$.extend({element:this.element,classes:this.options.classes||{}},options);function bindRemoveEvent(){var nodesToBind=[];options.element.each(function(_,element){var isTracked=$.map(that.classesElementLookup,function(elements){return elements;}).some(function(elements){return elements.is(element);});if(!isTracked){nodesToBind.push(element);}});that._on($(nodesToBind),{remove:"_untrackClassesElement"});}
function processClassString(classes,checkOption){var current,i;for(i=0;i<classes.length;i++){current=that.classesElementLookup[classes[i]]||$();if(options.add){bindRemoveEvent();current=$($.uniqueSort(current.get().concat(options.element.get())));}else{current=$(current.not(options.element).get());}
that.classesElementLookup[classes[i]]=current;full.push(classes[i]);if(checkOption&&options.classes[classes[i]]){full.push(options.classes[classes[i]]);}}}
if(options.keys){processClassString(options.keys.match(/\S+/g)||[],true);}
if(options.extra){processClassString(options.extra.match(/\S+/g)||[]);}
return full.join(" ");},_untrackClassesElement:function(event){var that=this;$.each(that.classesElementLookup,function(key,value){if($.inArray(event.target,value)!==-1){that.classesElementLookup[key]=$(value.not(event.target).get());}});this._off($(event.target));},_removeClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,false);},_addClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,true);},_toggleClass:function(element,keys,extra,add){add=(typeof add==="boolean")?add:extra;var shift=(typeof element==="string"||element===null),options={extra:shift?keys:extra,keys:shift?element:keys,element:shift?this.element:element,add:add};options.element.toggleClass(this._classes(options),add);return this;},_on:function(suppressDisabledCheck,element,handlers){var delegateElement;var instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=false;}
if(!handlers){handlers=element;element=this.element;delegateElement=this.widget();}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element);}
$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return;}
return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++;}
var match=event.match(/^([\w:-]*)\s*(.*)$/);var eventName=match[1]+instance.eventNamespace;var selector=match[2];if(selector){delegateElement.on(eventName,selector,handlerProxy);}else{element.on(eventName,handlerProxy);}});},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+
this.eventNamespace;element.off(eventName);this.bindings=$(this.bindings.not(element).get());this.focusable=$(this.focusable.not(element).get());this.hoverable=$(this.hoverable.not(element).get());},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
var instance=this;return setTimeout(handlerProxy,delay||0);},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){this._addClass($(event.currentTarget),null,"ui-state-hover");},mouseleave:function(event){this._removeClass($(event.currentTarget),null,"ui-state-hover");}});},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){this._addClass($(event.currentTarget),null,"ui-state-focus");},focusout:function(event){this._removeClass($(event.currentTarget),null,"ui-state-focus");}});},_trigger:function(type,event,data){var prop,orig;var callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop];}}}
this.element.trigger(event,data);return!(typeof callback==="function"&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented());}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options};}
var hasOptions;var effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options};}else if(options===true){options={};}
hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay);}
if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options);}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback);}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0]);}
next();});}};});var widget=$.widget;(function(){var cachedScrollbarWidth,max=Math.max,abs=Math.abs,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)];}
function parseCss(element,property){return parseInt($.css(element,property),10)||0;}
function isWindow(obj){return obj!=null&&obj===obj.window;}
function getDimensions(elem){var raw=elem[0];if(raw.nodeType===9){return{width:elem.width(),height:elem.height(),offset:{top:0,left:0}};}
if(isWindow(raw)){return{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}};}
if(raw.preventDefault){return{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}};}
return{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()};}
$.position={scrollbarWidth:function(){if(cachedScrollbarWidth!==undefined){return cachedScrollbarWidth;}
var w1,w2,div=$("<div style="+"'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>"+"<div style='height:300px;width:auto;'></div></div>"),innerDiv=div.children()[0];$("body").append(div);w1=innerDiv.offsetWidth;div.css("overflow","scroll");w2=innerDiv.offsetWidth;if(w1===w2){w2=div[0].clientWidth;}
div.remove();return(cachedScrollbarWidth=w1-w2);},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX=overflowX==="scroll"||(overflowX==="auto"&&within.width<within.element[0].scrollWidth),hasOverflowY=overflowY==="scroll"||(overflowY==="auto"&&within.height<within.element[0].scrollHeight);return{width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0};},getWithinInfo:function(element){var withinElement=$(element||window),isElemWindow=isWindow(withinElement[0]),isDocument=!!withinElement[0]&&withinElement[0].nodeType===9,hasOffset=!isElemWindow&&!isDocument;return{element:withinElement,isWindow:isElemWindow,isDocument:isDocument,offset:hasOffset?$(element).offset():{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:withinElement.outerWidth(),height:withinElement.outerHeight()};}};$.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments);}
options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=typeof options.of==="string"?$(document).find(options.of):$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};dimensions=getDimensions(target);if(target[0].preventDefault){options.at="left top";}
targetWidth=dimensions.width;targetHeight=dimensions.height;targetOffset=dimensions.offset;basePosition=$.extend({},targetOffset);$.each(["my","at"],function(){var pos=(options[this]||"").split(" "),horizontalOffset,verticalOffset;if(pos.length===1){pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"];}
pos[0]=rhorizontal.test(pos[0])?pos[0]:"center";pos[1]=rvertical.test(pos[1])?pos[1]:"center";horizontalOffset=roffset.exec(pos[0]);verticalOffset=roffset.exec(pos[1]);offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0];options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]];});if(collision.length===1){collision[1]=collision[0];}
if(options.at[0]==="right"){basePosition.left+=targetWidth;}else if(options.at[0]==="center"){basePosition.left+=targetWidth/2;}
if(options.at[1]==="bottom"){basePosition.top+=targetHeight;}else if(options.at[1]==="center"){basePosition.top+=targetHeight/2;}
atOffset=getOffsets(offsets.at,targetWidth,targetHeight);basePosition.left+=atOffset[0];basePosition.top+=atOffset[1];return this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+
scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+
scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());if(options.my[0]==="right"){position.left-=elemWidth;}else if(options.my[0]==="center"){position.left-=elemWidth/2;}
if(options.my[1]==="bottom"){position.top-=elemHeight;}else if(options.my[1]==="center"){position.top-=elemHeight/2;}
position.left+=myOffset[0];position.top+=myOffset[1];collisionPosition={marginLeft:marginLeft,marginTop:marginTop};$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem});}});if(options.using){using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?"left":left>0?"right":"center",vertical:bottom<0?"top":top>0?"bottom":"middle"};if(targetWidth<elemWidth&&abs(left+right)<targetWidth){feedback.horizontal="center";}
if(targetHeight<elemHeight&&abs(top+bottom)<targetHeight){feedback.vertical="middle";}
if(max(abs(left),abs(right))>max(abs(top),abs(bottom))){feedback.important="horizontal";}else{feedback.important="vertical";}
options.using.call(this,props,feedback);};}
elem.offset($.extend(position,{using:using}));});};$.ui.position={fit:{left:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset,newOverRight;if(data.collisionWidth>outerWidth){if(overLeft>0&&overRight<=0){newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-
withinOffset;position.left+=overLeft-newOverRight;}else if(overRight>0&&overLeft<=0){position.left=withinOffset;}else{if(overLeft>overRight){position.left=withinOffset+outerWidth-data.collisionWidth;}else{position.left=withinOffset;}}}else if(overLeft>0){position.left+=overLeft;}else if(overRight>0){position.left-=overRight;}else{position.left=max(position.left-collisionPosLeft,position.left);}},top:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset,newOverBottom;if(data.collisionHeight>outerHeight){if(overTop>0&&overBottom<=0){newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-
withinOffset;position.top+=overTop-newOverBottom;}else if(overBottom>0&&overTop<=0){position.top=withinOffset;}else{if(overTop>overBottom){position.top=withinOffset+outerHeight-data.collisionHeight;}else{position.top=withinOffset;}}}else if(overTop>0){position.top+=overTop;}else if(overBottom>0){position.top-=overBottom;}else{position.top=max(position.top-collisionPosTop,position.top);}}},flip:{left:function(position,data){var within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:data.at[0]==="right"?-data.targetWidth:0,offset=-2*data.offset[0],newOverRight,newOverLeft;if(overLeft<0){newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-
outerWidth-withinOffset;if(newOverRight<0||newOverRight<abs(overLeft)){position.left+=myOffset+atOffset+offset;}}else if(overRight>0){newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+
atOffset+offset-offsetLeft;if(newOverLeft>0||abs(newOverLeft)<overRight){position.left+=myOffset+atOffset+offset;}}},top:function(position,data){var within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top=data.my[1]==="top",myOffset=top?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:data.at[1]==="bottom"?-data.targetHeight:0,offset=-2*data.offset[1],newOverTop,newOverBottom;if(overTop<0){newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-
outerHeight-withinOffset;if(newOverBottom<0||newOverBottom<abs(overTop)){position.top+=myOffset+atOffset+offset;}}else if(overBottom>0){newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+
offset-offsetTop;if(newOverTop>0||abs(newOverTop)<overBottom){position.top+=myOffset+atOffset+offset;}}}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments);$.ui.position.fit.left.apply(this,arguments);},top:function(){$.ui.position.flip.top.apply(this,arguments);$.ui.position.fit.top.apply(this,arguments);}}};})();var position=$.ui.position;var data=$.extend($.expr.pseudos,{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);}});var disableSelection=$.fn.extend({disableSelection:(function(){var eventType="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(eventType+".ui-disableSelection",function(event){event.preventDefault();});};})(),enableSelection:function(){return this.off(".ui-disableSelection");}});var jQuery=$;var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor "+"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",class2type={},toString=class2type.toString,rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]];}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1]*2.55,execResult[2]*2.55,execResult[3]*2.55,execResult[4]];}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16),execResult[4]?(parseInt(execResult[4],16)/255).toFixed(2):1];}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16),execResult[4]?(parseInt(execResult[4]+execResult[4],16)/255).toFixed(2):1];}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,execResult[4]];}}],color=jQuery.Color=function(color,green,blue,alpha){return new jQuery.Color.fn.parse(color,green,blue,alpha);},spaces={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},propTypes={"byte":{floor:true,max:255},"percent":{max:1},"degrees":{mod:360,floor:true}},support=color.support={},supportElem=jQuery("<p>")[0],colors,each=jQuery.each;supportElem.style.cssText="background-color:rgba(1,1,1,.5)";support.rgba=supportElem.style.backgroundColor.indexOf("rgba")>-1;each(spaces,function(spaceName,space){space.cache="_"+spaceName;space.props.alpha={idx:3,type:"percent",def:1};});jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase();});function getType(obj){if(obj==null){return obj+"";}
return typeof obj==="object"?class2type[toString.call(obj)]||"object":typeof obj;}
function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};if(value==null){return(allowEmpty||!prop.def)?null:prop.def;}
value=type.floor?~~value:parseFloat(value);if(isNaN(value)){return prop.def;}
if(type.mod){return(value+type.mod)%type.mod;}
return Math.min(type.max,Math.max(0,value));}
function stringParse(string){var inst=color(),rgba=inst._rgba=[];string=string.toLowerCase();each(stringParsers,function(_i,parser){var parsed,match=parser.re.exec(string),values=match&&parser.parse(match),spaceName=parser.space||"rgba";if(values){parsed=inst[spaceName](values);inst[spaces[spaceName].cache]=parsed[spaces[spaceName].cache];rgba=inst._rgba=parsed._rgba;return false;}});if(rgba.length){if(rgba.join()==="0,0,0,0"){jQuery.extend(rgba,colors.transparent);}
return inst;}
return colors[string];}
color.fn=jQuery.extend(color.prototype,{parse:function(red,green,blue,alpha){if(red===undefined){this._rgba=[null,null,null,null];return this;}
if(red.jquery||red.nodeType){red=jQuery(red).css(green);green=undefined;}
var inst=this,type=getType(red),rgba=this._rgba=[];if(green!==undefined){red=[red,green,blue,alpha];type="array";}
if(type==="string"){return this.parse(stringParse(red)||colors._default);}
if(type==="array"){each(spaces.rgba.props,function(_key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop);});return this;}
if(type==="object"){if(red instanceof color){each(spaces,function(_spaceName,space){if(red[space.cache]){inst[space.cache]=red[space.cache].slice();}});}else{each(spaces,function(_spaceName,space){var cache=space.cache;each(space.props,function(key,prop){if(!inst[cache]&&space.to){if(key==="alpha"||red[key]==null){return;}
inst[cache]=space.to(inst._rgba);}
inst[cache][prop.idx]=clamp(red[key],prop,true);});if(inst[cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0){if(inst[cache][3]==null){inst[cache][3]=1;}
if(space.from){inst._rgba=space.from(inst[cache]);}}});}
return this;}},is:function(compare){var is=color(compare),same=true,inst=this;each(spaces,function(_,space){var localCache,isCache=is[space.cache];if(isCache){localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[];each(space.props,function(_,prop){if(isCache[prop.idx]!=null){same=(isCache[prop.idx]===localCache[prop.idx]);return same;}});}
return same;});return same;},_space:function(){var used=[],inst=this;each(spaces,function(spaceName,space){if(inst[space.cache]){used.push(spaceName);}});return used.pop();},transition:function(other,distance){var end=color(other),spaceName=end._space(),space=spaces[spaceName],startColor=this.alpha()===0?color("transparent"):this,start=startColor[space.cache]||space.to(startColor._rgba),result=start.slice();end=end[space.cache];each(space.props,function(_key,prop){var index=prop.idx,startValue=start[index],endValue=end[index],type=propTypes[prop.type]||{};if(endValue===null){return;}
if(startValue===null){result[index]=endValue;}else{if(type.mod){if(endValue-startValue>type.mod/2){startValue+=type.mod;}else if(startValue-endValue>type.mod/2){startValue-=type.mod;}}
result[index]=clamp((endValue-startValue)*distance+startValue,prop);}});return this[spaceName](result);},blend:function(opaque){if(this._rgba[3]===1){return this;}
var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,function(v,i){return(1-a)*blend[i]+a*v;}));},toRgbaString:function(){var prefix="rgba(",rgba=jQuery.map(this._rgba,function(v,i){if(v!=null){return v;}
return i>2?1:0;});if(rgba[3]===1){rgba.pop();prefix="rgb(";}
return prefix+rgba.join()+")";},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){if(v==null){v=i>2?1:0;}
if(i&&i<3){v=Math.round(v*100)+"%";}
return v;});if(hsla[3]===1){hsla.pop();prefix="hsl(";}
return prefix+hsla.join()+")";},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();if(includeAlpha){rgba.push(~~(alpha*255));}
return"#"+jQuery.map(rgba,function(v){v=(v||0).toString(16);return v.length===1?"0"+v:v;}).join("");},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString();}});color.fn.parse.prototype=color.fn;function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}
if(h*2<1){return q;}
if(h*3<2){return p+(q-p)*((2/3)-h)*6;}
return p;}
spaces.hsla.to=function(rgba){if(rgba[0]==null||rgba[1]==null||rgba[2]==null){return[null,null,null,rgba[3]];}
var r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,a=rgba[3],max=Math.max(r,g,b),min=Math.min(r,g,b),diff=max-min,add=max+min,l=add*0.5,h,s;if(min===max){h=0;}else if(r===max){h=(60*(g-b)/diff)+360;}else if(g===max){h=(60*(b-r)/diff)+120;}else{h=(60*(r-g)/diff)+240;}
if(diff===0){s=0;}else if(l<=0.5){s=diff/add;}else{s=diff/(2-add);}
return[Math.round(h)%360,s,l,a==null?1:a];};spaces.hsla.from=function(hsla){if(hsla[0]==null||hsla[1]==null||hsla[2]==null){return[null,null,null,hsla[3]];}
var h=hsla[0]/360,s=hsla[1],l=hsla[2],a=hsla[3],q=l<=0.5?l*(1+s):l+s-l*s,p=2*l-q;return[Math.round(hue2rgb(p,q,h+(1/3))*255),Math.round(hue2rgb(p,q,h)*255),Math.round(hue2rgb(p,q,h-(1/3))*255),a];};each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]){this[cache]=to(this._rgba);}
if(value===undefined){return this[cache].slice();}
var ret,type=getType(value),arr=(type==="array"||type==="object")?value:arguments,local=this[cache].slice();each(props,function(key,prop){var val=arr[type==="object"?key:prop.idx];if(val==null){val=local[prop.idx];}
local[prop.idx]=clamp(val,prop);});if(from){ret=color(from(local));ret[cache]=local;return ret;}else{return color(local);}};each(props,function(key,prop){if(color.fn[key]){return;}
color.fn[key]=function(value){var local,cur,match,fn,vtype=getType(value);if(key==="alpha"){fn=this._hsla?"hsla":"rgba";}else{fn=spaceName;}
local=this[fn]();cur=local[prop.idx];if(vtype==="undefined"){return cur;}
if(vtype==="function"){value=value.call(this,cur);vtype=getType(value);}
if(value==null&&prop.empty){return this;}
if(vtype==="string"){match=rplusequals.exec(value);if(match){value=cur+parseFloat(match[2])*(match[1]==="+"?1:-1);}}
local[prop.idx]=value;return this[fn](local);};});});color.hook=function(hook){var hooks=hook.split(" ");each(hooks,function(_i,hook){jQuery.cssHooks[hook]={set:function(elem,value){var parsed,curElem,backgroundColor="";if(value!=="transparent"&&(getType(value)!=="string"||(parsed=stringParse(value)))){value=color(parsed||value);if(!support.rgba&&value._rgba[3]!==1){curElem=hook==="backgroundColor"?elem.parentNode:elem;while((backgroundColor===""||backgroundColor==="transparent")&&curElem&&curElem.style){try{backgroundColor=jQuery.css(curElem,"backgroundColor");curElem=curElem.parentNode;}catch(e){}}
value=value.blend(backgroundColor&&backgroundColor!=="transparent"?backgroundColor:"_default");}
value=value.toRgbaString();}
try{elem.style[hook]=value;}catch(e){}}};jQuery.fx.step[hook]=function(fx){if(!fx.colorInit){fx.start=color(fx.elem,hook);fx.end=color(fx.end);fx.colorInit=true;}
jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos));};});};color.hook(stepHooks);jQuery.cssHooks.borderColor={expand:function(value){var expanded={};each(["Top","Right","Bottom","Left"],function(_i,part){expanded["border"+part+"Color"]=value;});return expanded;}};colors=jQuery.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"};var dataSpace="ui-effects-",dataSpaceStyle="ui-effects-style",dataSpaceAnimated="ui-effects-animated";$.effects={effect:{}};(function(){var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop){$.fx.step[prop]=function(fx){if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){jQuery.style(fx.elem,prop,fx.end);fx.setAttr=true;}};});function camelCase(string){return string.replace(/-([\da-z])/gi,function(all,letter){return letter.toUpperCase();});}
function getElementStyles(elem){var key,len,style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]]){len=style.length;while(len--){key=style[len];if(typeof style[key]==="string"){styles[camelCase(key)]=style[key];}}}else{for(key in style){if(typeof style[key]==="string"){styles[key]=style[key];}}}
return styles;}
function styleDifference(oldStyle,newStyle){var diff={},name,value;for(name in newStyle){value=newStyle[name];if(oldStyle[name]!==value){if(!shorthandStyles[name]){if($.fx.step[name]||!isNaN(parseFloat(value))){diff[name]=value;}}}}
return diff;}
if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};}
$.effects.animateClass=function(value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(){var animated=$(this),baseClass=animated.attr("class")||"",applyClassChange,allAnimations=o.children?animated.find("*").addBack():animated;allAnimations=allAnimations.map(function(){var el=$(this);return{el:el,start:getElementStyles(this)};});applyClassChange=function(){$.each(classAnimationActions,function(i,action){if(value[action]){animated[action+"Class"](value[action]);}});};applyClassChange();allAnimations=allAnimations.map(function(){this.end=getElementStyles(this.el[0]);this.diff=styleDifference(this.start,this.end);return this;});animated.attr("class",baseClass);allAnimations=allAnimations.map(function(){var styleInfo=this,dfd=$.Deferred(),opts=$.extend({},o,{queue:false,complete:function(){dfd.resolve(styleInfo);}});this.el.animate(this.diff,opts);return dfd.promise();});$.when.apply($,allAnimations.get()).done(function(){applyClassChange();$.each(arguments,function(){var el=this.el;$.each(this.diff,function(key){el.css(key,"");});});o.complete.call(animated[0]);});});};$.fn.extend({addClass:(function(orig){return function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{add:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.addClass),removeClass:(function(orig){return function(classNames,speed,easing,callback){return arguments.length>1?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.removeClass),toggleClass:(function(orig){return function(classNames,force,speed,easing,callback){if(typeof force==="boolean"||force===undefined){if(!speed){return orig.apply(this,arguments);}else{return $.effects.animateClass.call(this,(force?{add:classNames}:{remove:classNames}),speed,easing,callback);}}else{return $.effects.animateClass.call(this,{toggle:classNames},force,speed,easing);}};})($.fn.toggleClass),switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,callback);}});})();(function(){if($.expr&&$.expr.pseudos&&$.expr.pseudos.animated){$.expr.pseudos.animated=(function(orig){return function(elem){return!!$(elem).data(dataSpaceAnimated)||orig(elem);};})($.expr.pseudos.animated);}
if($.uiBackCompat!==false){$.extend($.effects,{save:function(element,set){var i=0,length=set.length;for(;i<length;i++){if(set[i]!==null){element.data(dataSpace+set[i],element[0].style[set[i]]);}}},restore:function(element,set){var val,i=0,length=set.length;for(;i<length;i++){if(set[i]!==null){val=element.data(dataSpace+set[i]);element.css(set[i],val);}}},setMode:function(el,mode){if(mode==="toggle"){mode=el.is(":hidden")?"show":"hide";}
return mode;},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper")){return element.parent();}
var props={width:element.outerWidth(true),height:element.outerHeight(true),"float":element.css("float")},wrapper=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id;}catch(e){active=document.body;}
element.wrap(wrapper);if(element[0]===active||$.contains(element[0],active)){$(active).trigger("focus");}
wrapper=element.parent();if(element.css("position")==="static"){wrapper.css({position:"relative"});element.css({position:"relative"});}else{$.extend(props,{position:element.css("position"),zIndex:element.css("z-index")});$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos);if(isNaN(parseInt(props[pos],10))){props[pos]="auto";}});element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"});}
element.css(size);return wrapper.css(props).show();},removeWrapper:function(element){var active=document.activeElement;if(element.parent().is(".ui-effects-wrapper")){element.parent().replaceWith(element);if(element[0]===active||$.contains(element[0],active)){$(active).trigger("focus");}}
return element;}});}
$.extend($.effects,{version:"1.13.2",define:function(name,mode,effect){if(!effect){effect=mode;mode="effect";}
$.effects.effect[name]=effect;$.effects.effect[name].mode=mode;return effect;},scaledDimensions:function(element,percent,direction){if(percent===0){return{height:0,width:0,outerHeight:0,outerWidth:0};}
var x=direction!=="horizontal"?((percent||100)/100):1,y=direction!=="vertical"?((percent||100)/100):1;return{height:element.height()*y,width:element.width()*x,outerHeight:element.outerHeight()*y,outerWidth:element.outerWidth()*x};},clipToBox:function(animation){return{width:animation.clip.right-animation.clip.left,height:animation.clip.bottom-animation.clip.top,left:animation.clip.left,top:animation.clip.top};},unshift:function(element,queueLength,count){var queue=element.queue();if(queueLength>1){queue.splice.apply(queue,[1,0].concat(queue.splice(queueLength,count)));}
element.dequeue();},saveStyle:function(element){element.data(dataSpaceStyle,element[0].style.cssText);},restoreStyle:function(element){element[0].style.cssText=element.data(dataSpaceStyle)||"";element.removeData(dataSpaceStyle);},mode:function(element,mode){var hidden=element.is(":hidden");if(mode==="toggle"){mode=hidden?"show":"hide";}
if(hidden?mode==="hide":mode==="show"){mode="none";}
return mode;},getBaseline:function(origin,original){var y,x;switch(origin[0]){case"top":y=0;break;case"middle":y=0.5;break;case"bottom":y=1;break;default:y=origin[0]/original.height;}
switch(origin[1]){case"left":x=0;break;case"center":x=0.5;break;case"right":x=1;break;default:x=origin[1]/original.width;}
return{x:x,y:y};},createPlaceholder:function(element){var placeholder,cssPosition=element.css("position"),position=element.position();element.css({marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight());if(/^(static|relative)/.test(cssPosition)){cssPosition="absolute";placeholder=$("<"+element[0].nodeName+">").insertAfter(element).css({display:/^(inline|ruby)/.test(element.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight"),"float":element.css("float")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass("ui-effects-placeholder");element.data(dataSpace+"placeholder",placeholder);}
element.css({position:cssPosition,left:position.left,top:position.top});return placeholder;},removePlaceholder:function(element){var dataKey=dataSpace+"placeholder",placeholder=element.data(dataKey);if(placeholder){placeholder.remove();element.removeData(dataKey);}},cleanUp:function(element){$.effects.restoreStyle(element);$.effects.removePlaceholder(element);},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){var unit=element.cssUnit(x);if(unit[0]>0){value[x]=unit[0]*factor+unit[1];}});return value;}});function _normalizeArguments(effect,options,speed,callback){if($.isPlainObject(effect)){options=effect;effect=effect.effect;}
effect={effect:effect};if(options==null){options={};}
if(typeof options==="function"){callback=options;speed=null;options={};}
if(typeof options==="number"||$.fx.speeds[options]){callback=speed;speed=options;options={};}
if(typeof speed==="function"){callback=speed;speed=null;}
if(options){$.extend(effect,options);}
speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed==="number"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect;}
function standardAnimationOption(option){if(!option||typeof option==="number"||$.fx.speeds[option]){return true;}
if(typeof option==="string"&&!$.effects.effect[option]){return true;}
if(typeof option==="function"){return true;}
if(typeof option==="object"&&!option.effect){return true;}
return false;}
$.fn.extend({effect:function(){var args=_normalizeArguments.apply(this,arguments),effectMethod=$.effects.effect[args.effect],defaultMode=effectMethod.mode,queue=args.queue,queueName=queue||"fx",complete=args.complete,mode=args.mode,modes=[],prefilter=function(next){var el=$(this),normalizedMode=$.effects.mode(el,mode)||defaultMode;el.data(dataSpaceAnimated,true);modes.push(normalizedMode);if(defaultMode&&(normalizedMode==="show"||(normalizedMode===defaultMode&&normalizedMode==="hide"))){el.show();}
if(!defaultMode||normalizedMode!=="none"){$.effects.saveStyle(el);}
if(typeof next==="function"){next();}};if($.fx.off||!effectMethod){if(mode){return this[mode](args.duration,complete);}else{return this.each(function(){if(complete){complete.call(this);}});}}
function run(next){var elem=$(this);function cleanup(){elem.removeData(dataSpaceAnimated);$.effects.cleanUp(elem);if(args.mode==="hide"){elem.hide();}
done();}
function done(){if(typeof complete==="function"){complete.call(elem[0]);}
if(typeof next==="function"){next();}}
args.mode=modes.shift();if($.uiBackCompat!==false&&!defaultMode){if(elem.is(":hidden")?mode==="hide":mode==="show"){elem[mode]();done();}else{effectMethod.call(elem[0],args,done);}}else{if(args.mode==="none"){elem[mode]();done();}else{effectMethod.call(elem[0],args,cleanup);}}}
return queue===false?this.each(prefilter).each(run):this.queue(queueName,prefilter).queue(queueName,run);},show:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="show";return this.effect.call(this,args);}};})($.fn.show),hide:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="hide";return this.effect.call(this,args);}};})($.fn.hide),toggle:(function(orig){return function(option){if(standardAnimationOption(option)||typeof option==="boolean"){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="toggle";return this.effect.call(this,args);}};})($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];$.each(["em","px","%","pt"],function(i,unit){if(style.indexOf(unit)>0){val=[parseFloat(style),unit];}});return val;},cssClip:function(clipObj){if(clipObj){return this.css("clip","rect("+clipObj.top+"px "+clipObj.right+"px "+
clipObj.bottom+"px "+clipObj.left+"px)");}
return parseClip(this.css("clip"),this);},transfer:function(options,done){var element=$(this),target=$(options.to),targetFixed=target.css("position")==="fixed",body=$("body"),fixTop=targetFixed?body.scrollTop():0,fixLeft=targetFixed?body.scrollLeft():0,endPosition=target.offset(),animation={top:endPosition.top-fixTop,left:endPosition.left-fixLeft,height:target.innerHeight(),width:target.innerWidth()},startPosition=element.offset(),transfer=$("<div class='ui-effects-transfer'></div>");transfer.appendTo("body").addClass(options.className).css({top:startPosition.top-fixTop,left:startPosition.left-fixLeft,height:element.innerHeight(),width:element.innerWidth(),position:targetFixed?"fixed":"absolute"}).animate(animation,options.duration,options.easing,function(){transfer.remove();if(typeof done==="function"){done();}});}});function parseClip(str,element){var outerWidth=element.outerWidth(),outerHeight=element.outerHeight(),clipRegex=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,values=clipRegex.exec(str)||["",0,outerWidth,outerHeight,0];return{top:parseFloat(values[1])||0,right:values[2]==="auto"?outerWidth:parseFloat(values[2]),bottom:values[3]==="auto"?outerHeight:parseFloat(values[3]),left:parseFloat(values[4])||0};}
$.fx.step.clip=function(fx){if(!fx.clipInit){fx.start=$(fx.elem).cssClip();if(typeof fx.end==="string"){fx.end=parseClip(fx.end,fx.elem);}
fx.clipInit=true;}
$(fx.elem).cssClip({top:fx.pos*(fx.end.top-fx.start.top)+fx.start.top,right:fx.pos*(fx.end.right-fx.start.right)+fx.start.right,bottom:fx.pos*(fx.end.bottom-fx.start.bottom)+fx.start.bottom,left:fx.pos*(fx.end.left-fx.start.left)+fx.start.left});};})();(function(){var baseEasings={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,name){baseEasings[name]=function(p){return Math.pow(p,i+2);};});$.extend(baseEasings,{Sine:function(p){return 1-Math.cos(p*Math.PI/2);},Circ:function(p){return 1-Math.sqrt(1-p*p);},Elastic:function(p){return p===0||p===1?p:-Math.pow(2,8*(p-1))*Math.sin(((p-1)*80-7.5)*Math.PI/15);},Back:function(p){return p*p*(3*p-2);},Bounce:function(p){var pow2,bounce=4;while(p<((pow2=Math.pow(2,--bounce))-1)/11){}
return 1/Math.pow(4,3-bounce)-7.5625*Math.pow((pow2*3-2)/22-p,2);}});$.each(baseEasings,function(name,easeIn){$.easing["easeIn"+name]=easeIn;$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p);};$.easing["easeInOut"+name]=function(p){return p<0.5?easeIn(p*2)/2:1-easeIn(p* -2+2)/2;};});})();var effect=$.effects;var effectsEffectBlind=$.effects.define("blind","hide",function(options,done){var map={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},element=$(this),direction=options.direction||"up",start=element.cssClip(),animate={clip:$.extend({},start)},placeholder=$.effects.createPlaceholder(element);animate.clip[map[direction][0]]=animate.clip[map[direction][1]];if(options.mode==="show"){element.cssClip(animate.clip);if(placeholder){placeholder.css($.effects.clipToBox(animate));}
animate.clip=start;}
if(placeholder){placeholder.animate($.effects.clipToBox(animate),options.duration,options.easing);}
element.animate(animate,{queue:false,duration:options.duration,easing:options.easing,complete:done});});var effectsEffectBounce=$.effects.define("bounce",function(options,done){var upAnim,downAnim,refValue,element=$(this),mode=options.mode,hide=mode==="hide",show=mode==="show",direction=options.direction||"up",distance=options.distance,times=options.times||5,anims=times*2+(show||hide?1:0),speed=options.duration/anims,easing=options.easing,ref=(direction==="up"||direction==="down")?"top":"left",motion=(direction==="up"||direction==="left"),i=0,queuelen=element.queue().length;$.effects.createPlaceholder(element);refValue=element.css(ref);if(!distance){distance=element[ref==="top"?"outerHeight":"outerWidth"]()/3;}
if(show){downAnim={opacity:1};downAnim[ref]=refValue;element.css("opacity",0).css(ref,motion?-distance*2:distance*2).animate(downAnim,speed,easing);}
if(hide){distance=distance/Math.pow(2,times-1);}
downAnim={};downAnim[ref]=refValue;for(;i<times;i++){upAnim={};upAnim[ref]=(motion?"-=":"+=")+distance;element.animate(upAnim,speed,easing).animate(downAnim,speed,easing);distance=hide?distance*2:distance/2;}
if(hide){upAnim={opacity:0};upAnim[ref]=(motion?"-=":"+=")+distance;element.animate(upAnim,speed,easing);}
element.queue(done);$.effects.unshift(element,queuelen,anims+1);});var effectsEffectClip=$.effects.define("clip","hide",function(options,done){var start,animate={},element=$(this),direction=options.direction||"vertical",both=direction==="both",horizontal=both||direction==="horizontal",vertical=both||direction==="vertical";start=element.cssClip();animate.clip={top:vertical?(start.bottom-start.top)/2:start.top,right:horizontal?(start.right-start.left)/2:start.right,bottom:vertical?(start.bottom-start.top)/2:start.bottom,left:horizontal?(start.right-start.left)/2:start.left};$.effects.createPlaceholder(element);if(options.mode==="show"){element.cssClip(animate.clip);animate.clip=start;}
element.animate(animate,{queue:false,duration:options.duration,easing:options.easing,complete:done});});var effectsEffectDrop=$.effects.define("drop","hide",function(options,done){var distance,element=$(this),mode=options.mode,show=mode==="show",direction=options.direction||"left",ref=(direction==="up"||direction==="down")?"top":"left",motion=(direction==="up"||direction==="left")?"-=":"+=",oppositeMotion=(motion==="+=")?"-=":"+=",animation={opacity:0};$.effects.createPlaceholder(element);distance=options.distance||element[ref==="top"?"outerHeight":"outerWidth"](true)/2;animation[ref]=motion+distance;if(show){element.css(animation);animation[ref]=oppositeMotion+distance;animation.opacity=1;}
element.animate(animation,{queue:false,duration:options.duration,easing:options.easing,complete:done});});var effectsEffectExplode=$.effects.define("explode","hide",function(options,done){var i,j,left,top,mx,my,rows=options.pieces?Math.round(Math.sqrt(options.pieces)):3,cells=rows,element=$(this),mode=options.mode,show=mode==="show",offset=element.show().css("visibility","hidden").offset(),width=Math.ceil(element.outerWidth()/cells),height=Math.ceil(element.outerHeight()/rows),pieces=[];function childComplete(){pieces.push(this);if(pieces.length===rows*cells){animComplete();}}
for(i=0;i<rows;i++){top=offset.top+i*height;my=i-(rows-1)/2;for(j=0;j<cells;j++){left=offset.left+j*width;mx=j-(cells-1)/2;element.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*width,top:-i*height}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:width,height:height,left:left+(show?mx*width:0),top:top+(show?my*height:0),opacity:show?0:1}).animate({left:left+(show?0:mx*width),top:top+(show?0:my*height),opacity:show?1:0},options.duration||500,options.easing,childComplete);}}
function animComplete(){element.css({visibility:"visible"});$(pieces).remove();done();}});var effectsEffectFade=$.effects.define("fade","toggle",function(options,done){var show=options.mode==="show";$(this).css("opacity",show?0:1).animate({opacity:show?1:0},{queue:false,duration:options.duration,easing:options.easing,complete:done});});var effectsEffectFold=$.effects.define("fold","hide",function(options,done){var element=$(this),mode=options.mode,show=mode==="show",hide=mode==="hide",size=options.size||15,percent=/([0-9]+)%/.exec(size),horizFirst=!!options.horizFirst,ref=horizFirst?["right","bottom"]:["bottom","right"],duration=options.duration/2,placeholder=$.effects.createPlaceholder(element),start=element.cssClip(),animation1={clip:$.extend({},start)},animation2={clip:$.extend({},start)},distance=[start[ref[0]],start[ref[1]]],queuelen=element.queue().length;if(percent){size=parseInt(percent[1],10)/100*distance[hide?0:1];}
animation1.clip[ref[0]]=size;animation2.clip[ref[0]]=size;animation2.clip[ref[1]]=0;if(show){element.cssClip(animation2.clip);if(placeholder){placeholder.css($.effects.clipToBox(animation2));}
animation2.clip=start;}
element.queue(function(next){if(placeholder){placeholder.animate($.effects.clipToBox(animation1),duration,options.easing).animate($.effects.clipToBox(animation2),duration,options.easing);}
next();}).animate(animation1,duration,options.easing).animate(animation2,duration,options.easing).queue(done);$.effects.unshift(element,queuelen,4);});var effectsEffectHighlight=$.effects.define("highlight","show",function(options,done){var element=$(this),animation={backgroundColor:element.css("backgroundColor")};if(options.mode==="hide"){animation.opacity=0;}
$.effects.saveStyle(element);element.css({backgroundImage:"none",backgroundColor:options.color||"#ffff99"}).animate(animation,{queue:false,duration:options.duration,easing:options.easing,complete:done});});var effectsEffectSize=$.effects.define("size",function(options,done){var baseline,factor,temp,element=$(this),cProps=["fontSize"],vProps=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],hProps=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],mode=options.mode,restore=mode!=="effect",scale=options.scale||"both",origin=options.origin||["middle","center"],position=element.css("position"),pos=element.position(),original=$.effects.scaledDimensions(element),from=options.from||original,to=options.to||$.effects.scaledDimensions(element,0);$.effects.createPlaceholder(element);if(mode==="show"){temp=from;from=to;to=temp;}
factor={from:{y:from.height/original.height,x:from.width/original.width},to:{y:to.height/original.height,x:to.width/original.width}};if(scale==="box"||scale==="both"){if(factor.from.y!==factor.to.y){from=$.effects.setTransition(element,vProps,factor.from.y,from);to=$.effects.setTransition(element,vProps,factor.to.y,to);}
if(factor.from.x!==factor.to.x){from=$.effects.setTransition(element,hProps,factor.from.x,from);to=$.effects.setTransition(element,hProps,factor.to.x,to);}}
if(scale==="content"||scale==="both"){if(factor.from.y!==factor.to.y){from=$.effects.setTransition(element,cProps,factor.from.y,from);to=$.effects.setTransition(element,cProps,factor.to.y,to);}}
if(origin){baseline=$.effects.getBaseline(origin,original);from.top=(original.outerHeight-from.outerHeight)*baseline.y+pos.top;from.left=(original.outerWidth-from.outerWidth)*baseline.x+pos.left;to.top=(original.outerHeight-to.outerHeight)*baseline.y+pos.top;to.left=(original.outerWidth-to.outerWidth)*baseline.x+pos.left;}
delete from.outerHeight;delete from.outerWidth;element.css(from);if(scale==="content"||scale==="both"){vProps=vProps.concat(["marginTop","marginBottom"]).concat(cProps);hProps=hProps.concat(["marginLeft","marginRight"]);element.find("*[width]").each(function(){var child=$(this),childOriginal=$.effects.scaledDimensions(child),childFrom={height:childOriginal.height*factor.from.y,width:childOriginal.width*factor.from.x,outerHeight:childOriginal.outerHeight*factor.from.y,outerWidth:childOriginal.outerWidth*factor.from.x},childTo={height:childOriginal.height*factor.to.y,width:childOriginal.width*factor.to.x,outerHeight:childOriginal.height*factor.to.y,outerWidth:childOriginal.width*factor.to.x};if(factor.from.y!==factor.to.y){childFrom=$.effects.setTransition(child,vProps,factor.from.y,childFrom);childTo=$.effects.setTransition(child,vProps,factor.to.y,childTo);}
if(factor.from.x!==factor.to.x){childFrom=$.effects.setTransition(child,hProps,factor.from.x,childFrom);childTo=$.effects.setTransition(child,hProps,factor.to.x,childTo);}
if(restore){$.effects.saveStyle(child);}
child.css(childFrom);child.animate(childTo,options.duration,options.easing,function(){if(restore){$.effects.restoreStyle(child);}});});}
element.animate(to,{queue:false,duration:options.duration,easing:options.easing,complete:function(){var offset=element.offset();if(to.opacity===0){element.css("opacity",from.opacity);}
if(!restore){element.css("position",position==="static"?"relative":position).offset(offset);$.effects.saveStyle(element);}
done();}});});var effectsEffectScale=$.effects.define("scale",function(options,done){var el=$(this),mode=options.mode,percent=parseInt(options.percent,10)||(parseInt(options.percent,10)===0?0:(mode!=="effect"?0:100)),newOptions=$.extend(true,{from:$.effects.scaledDimensions(el),to:$.effects.scaledDimensions(el,percent,options.direction||"both"),origin:options.origin||["middle","center"]},options);if(options.fade){newOptions.from.opacity=1;newOptions.to.opacity=0;}
$.effects.effect.size.call(this,newOptions,done);});var effectsEffectPuff=$.effects.define("puff","hide",function(options,done){var newOptions=$.extend(true,{},options,{fade:true,percent:parseInt(options.percent,10)||150});$.effects.effect.scale.call(this,newOptions,done);});var effectsEffectPulsate=$.effects.define("pulsate","show",function(options,done){var element=$(this),mode=options.mode,show=mode==="show",hide=mode==="hide",showhide=show||hide,anims=((options.times||5)*2)+(showhide?1:0),duration=options.duration/anims,animateTo=0,i=1,queuelen=element.queue().length;if(show||!element.is(":visible")){element.css("opacity",0).show();animateTo=1;}
for(;i<anims;i++){element.animate({opacity:animateTo},duration,options.easing);animateTo=1-animateTo;}
element.animate({opacity:animateTo},duration,options.easing);element.queue(done);$.effects.unshift(element,queuelen,anims+1);});var effectsEffectShake=$.effects.define("shake",function(options,done){var i=1,element=$(this),direction=options.direction||"left",distance=options.distance||20,times=options.times||3,anims=times*2+1,speed=Math.round(options.duration/anims),ref=(direction==="up"||direction==="down")?"top":"left",positiveMotion=(direction==="up"||direction==="left"),animation={},animation1={},animation2={},queuelen=element.queue().length;$.effects.createPlaceholder(element);animation[ref]=(positiveMotion?"-=":"+=")+distance;animation1[ref]=(positiveMotion?"+=":"-=")+distance*2;animation2[ref]=(positiveMotion?"-=":"+=")+distance*2;element.animate(animation,speed,options.easing);for(;i<times;i++){element.animate(animation1,speed,options.easing).animate(animation2,speed,options.easing);}
element.animate(animation1,speed,options.easing).animate(animation,speed/2,options.easing).queue(done);$.effects.unshift(element,queuelen,anims+1);});var effectsEffectSlide=$.effects.define("slide","show",function(options,done){var startClip,startRef,element=$(this),map={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},mode=options.mode,direction=options.direction||"left",ref=(direction==="up"||direction==="down")?"top":"left",positiveMotion=(direction==="up"||direction==="left"),distance=options.distance||element[ref==="top"?"outerHeight":"outerWidth"](true),animation={};$.effects.createPlaceholder(element);startClip=element.cssClip();startRef=element.position()[ref];animation[ref]=(positiveMotion?-1:1)*distance+startRef;animation.clip=element.cssClip();animation.clip[map[direction][1]]=animation.clip[map[direction][0]];if(mode==="show"){element.cssClip(animation.clip);element.css(ref,animation[ref]);animation.clip=startClip;animation[ref]=startRef;}
element.animate(animation,{queue:false,duration:options.duration,easing:options.easing,complete:done});});var effect;if($.uiBackCompat!==false){effect=$.effects.define("transfer",function(options,done){$(this).transfer(options,done);});}
var effectsEffectTransfer=effect;$.ui.focusable=function(element,hasTabindex){var map,mapName,img,focusableIfVisible,fieldset,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false;}
img=$("img[usemap='#"+mapName+"']");return img.length>0&&img.is(":visible");}
if(/^(input|select|textarea|button|object)$/.test(nodeName)){focusableIfVisible=!element.disabled;if(focusableIfVisible){fieldset=$(element).closest("fieldset")[0];if(fieldset){focusableIfVisible=!fieldset.disabled;}}}else if("a"===nodeName){focusableIfVisible=element.href||hasTabindex;}else{focusableIfVisible=hasTabindex;}
return focusableIfVisible&&$(element).is(":visible")&&visible($(element));};function visible(element){var visibility=element.css("visibility");while(visibility==="inherit"){element=element.parent();visibility=element.css("visibility");}
return visibility==="visible";}
$.extend($.expr.pseudos,{focusable:function(element){return $.ui.focusable(element,$.attr(element,"tabindex")!=null);}});var focusable=$.ui.focusable;var form=$.fn._form=function(){return typeof this[0].form==="string"?this.closest("form"):$(this[0].form);};var formResetMixin=$.ui.formResetMixin={_formResetHandler:function(){var form=$(this);setTimeout(function(){var instances=form.data("ui-form-reset-instances");$.each(instances,function(){this.refresh();});});},_bindFormResetHandler:function(){this.form=this.element._form();if(!this.form.length){return;}
var instances=this.form.data("ui-form-reset-instances")||[];if(!instances.length){this.form.on("reset.ui-form-reset",this._formResetHandler);}
instances.push(this);this.form.data("ui-form-reset-instances",instances);},_unbindFormResetHandler:function(){if(!this.form.length){return;}
var instances=this.form.data("ui-form-reset-instances");instances.splice($.inArray(this,instances),1);if(instances.length){this.form.data("ui-form-reset-instances",instances);}else{this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset");}}};if(!$.expr.pseudos){$.expr.pseudos=$.expr[":"];}
if(!$.uniqueSort){$.uniqueSort=$.unique;}
if(!$.escapeSelector){var rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;var fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD";}
return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ";}
return"\\"+ch;};$.escapeSelector=function(sel){return(sel+"").replace(rcssescape,fcssescape);};}
if(!$.fn.even||!$.fn.odd){$.fn.extend({even:function(){return this.filter(function(i){return i%2===0;});},odd:function(){return this.filter(function(i){return i%2===1;});}});};var keycode=$.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38};var labels=$.fn.labels=function(){var ancestor,selector,id,labels,ancestors;if(!this.length){return this.pushStack([]);}
if(this[0].labels&&this[0].labels.length){return this.pushStack(this[0].labels);}
labels=this.eq(0).parents("label");id=this.attr("id");if(id){ancestor=this.eq(0).parents().last();ancestors=ancestor.add(ancestor.length?ancestor.siblings():this.siblings());selector="label[for='"+$.escapeSelector(id)+"']";labels=labels.add(ancestors.find(selector).addBack(selector));}
return this.pushStack(labels);};var scrollParent=$.fn.scrollParent=function(includeHidden){var position=this.css("position"),excludeStaticParent=position==="absolute",overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);if(excludeStaticParent&&parent.css("position")==="static"){return false;}
return overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+
parent.css("overflow-x"));}).eq(0);return position==="fixed"||!scrollParent.length?$(this[0].ownerDocument||document):scrollParent;};var tabbable=$.extend($.expr.pseudos,{tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),hasTabindex=tabIndex!=null;return(!hasTabindex||tabIndex>=0)&&$.ui.focusable(element,hasTabindex);}});var uniqueId=$.fn.extend({uniqueId:(function(){var uuid=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid);}});};})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){$(this).removeAttr("id");}});}});var widgetsAccordion=$.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:false,event:"click",header:function(elem){return elem.find("> li > :first-child").add(elem.find("> :not(li)").even());},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var options=this.options;this.prevShow=this.prevHide=$();this._addClass("ui-accordion","ui-widget ui-helper-reset");this.element.attr("role","tablist");if(!options.collapsible&&(options.active===false||options.active==null)){options.active=0;}
this._processPanels();if(options.active<0){options.active+=this.headers.length;}
this._refresh();},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?$():this.active.next()};},_createIcons:function(){var icon,children,icons=this.options.icons;if(icons){icon=$("<span>");this._addClass(icon,"ui-accordion-header-icon","ui-icon "+icons.header);icon.prependTo(this.headers);children=this.active.children(".ui-accordion-header-icon");this._removeClass(children,icons.header)._addClass(children,null,icons.activeHeader)._addClass(this.headers,"ui-accordion-icons");}},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons");this.headers.children(".ui-accordion-header-icon").remove();},_destroy:function(){var contents;this.element.removeAttr("role");this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId();this._destroyIcons();contents=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId();if(this.options.heightStyle!=="content"){contents.css("height","");}},_setOption:function(key,value){if(key==="active"){this._activate(value);return;}
if(key==="event"){if(this.options.event){this._off(this.headers,this.options.event);}
this._setupEvents(value);}
this._super(key,value);if(key==="collapsible"&&!value&&this.options.active===false){this._activate(0);}
if(key==="icons"){this._destroyIcons();if(value){this._createIcons();}}},_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",value);this._toggleClass(null,"ui-state-disabled",!!value);this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!value);},_keydown:function(event){if(event.altKey||event.ctrlKey){return;}
var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;case keyCode.HOME:toFocus=this.headers[0];break;case keyCode.END:toFocus=this.headers[length-1];break;}
if(toFocus){$(event.target).attr("tabIndex",-1);$(toFocus).attr("tabIndex",0);$(toFocus).trigger("focus");event.preventDefault();}},_panelKeyDown:function(event){if(event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){$(event.currentTarget).prev().trigger("focus");}},refresh:function(){var options=this.options;this._processPanels();if((options.active===false&&options.collapsible===true)||!this.headers.length){options.active=false;this.active=$();}else if(options.active===false){this._activate(0);}else if(this.active.length&&!$.contains(this.element[0],this.active[0])){if(this.headers.length===this.headers.find(".ui-state-disabled").length){options.active=false;this.active=$();}else{this._activate(Math.max(0,options.active-1));}}else{options.active=this.headers.index(this.active);}
this._destroyIcons();this._refresh();},_processPanels:function(){var prevHeaders=this.headers,prevPanels=this.panels;if(typeof this.options.header==="function"){this.headers=this.options.header(this.element);}else{this.headers=this.element.find(this.options.header);}
this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default");this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide();this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content");if(prevPanels){this._off(prevHeaders.not(this.headers));this._off(prevPanels.not(this.panels));}},_refresh:function(){var maxHeight,options=this.options,heightStyle=options.heightStyle,parent=this.element.parent();this.active=this._findActive(options.active);this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed");this._addClass(this.active.next(),"ui-accordion-content-active");this.active.next().show();this.headers.attr("role","tab").each(function(){var header=$(this),headerId=header.uniqueId().attr("id"),panel=header.next(),panelId=panel.uniqueId().attr("id");header.attr("aria-controls",panelId);panel.attr("aria-labelledby",headerId);}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0);}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"});}
this._createIcons();this._setupEvents(options.event);if(heightStyle==="fill"){maxHeight=parent.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;}
maxHeight-=elem.outerHeight(true);});this.headers.each(function(){maxHeight-=$(this).outerHeight(true);});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-
$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.headers.next().each(function(){var isVisible=$(this).is(":visible");if(!isVisible){$(this).show();}
maxHeight=Math.max(maxHeight,$(this).css("height","").height());if(!isVisible){$(this).hide();}}).height(maxHeight);}},_activate:function(index){var active=this._findActive(index)[0];if(active===this.active[0]){return;}
active=active||this.active[0];this._eventHandler({target:active,currentTarget:active,preventDefault:$.noop});},_findActive:function(selector){return typeof selector==="number"?this.headers.eq(selector):$();},_setupEvents:function(event){var events={keydown:"_keydown"};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});}
this._off(this.headers.add(this.headers.next()));this._on(this.headers,events);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers);},_eventHandler:function(event){var activeChildren,clickedChildren,options=this.options,active=this.active,clicked=$(event.currentTarget),clickedIsActive=clicked[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():clicked.next(),toHide=active.next(),eventData={oldHeader:active,oldPanel:toHide,newHeader:collapsing?$():clicked,newPanel:toShow};event.preventDefault();if((clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;}
options.active=collapsing?false:this.headers.index(clicked);this.active=clickedIsActive?$():clicked;this._toggle(eventData);this._removeClass(active,"ui-accordion-header-active","ui-state-active");if(options.icons){activeChildren=active.children(".ui-accordion-header-icon");this._removeClass(activeChildren,null,options.icons.activeHeader)._addClass(activeChildren,null,options.icons.header);}
if(!clickedIsActive){this._removeClass(clicked,"ui-accordion-header-collapsed")._addClass(clicked,"ui-accordion-header-active","ui-state-active");if(options.icons){clickedChildren=clicked.children(".ui-accordion-header-icon");this._removeClass(clickedChildren,null,options.icons.header)._addClass(clickedChildren,null,options.icons.activeHeader);}
this._addClass(clicked.next(),"ui-accordion-content-active");}},_toggle:function(data){var toShow=data.newPanel,toHide=this.prevShow.length?this.prevShow:data.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=toShow;this.prevHide=toHide;if(this.options.animate){this._animate(toShow,toHide,data);}else{toHide.hide();toShow.show();this._toggleComplete(data);}
toHide.attr({"aria-hidden":"true"});toHide.prev().attr({"aria-selected":"false","aria-expanded":"false"});if(toShow.length&&toHide.length){toHide.prev().attr({"tabIndex":-1,"aria-expanded":"false"});}else if(toShow.length){this.headers.filter(function(){return parseInt($(this).attr("tabIndex"),10)===0;}).attr("tabIndex",-1);}
toShow.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_animate:function(toShow,toHide,data){var total,easing,duration,that=this,adjust=0,boxSizing=toShow.css("box-sizing"),down=toShow.length&&(!toHide.length||(toShow.index()<toHide.index())),animate=this.options.animate||{},options=down&&animate.down||animate,complete=function(){that._toggleComplete(data);};if(typeof options==="number"){duration=options;}
if(typeof options==="string"){easing=options;}
easing=easing||options.easing||animate.easing;duration=duration||options.duration||animate.duration;if(!toHide.length){return toShow.animate(this.showProps,duration,easing,complete);}
if(!toShow.length){return toHide.animate(this.hideProps,duration,easing,complete);}
total=toShow.show().outerHeight();toHide.animate(this.hideProps,{duration:duration,easing:easing,step:function(now,fx){fx.now=Math.round(now);}});toShow.hide().animate(this.showProps,{duration:duration,easing:easing,complete:complete,step:function(now,fx){fx.now=Math.round(now);if(fx.prop!=="height"){if(boxSizing==="content-box"){adjust+=fx.now;}}else if(that.options.heightStyle!=="content"){fx.now=Math.round(total-toHide.outerHeight()-adjust);adjust=0;}}});},_toggleComplete:function(data){var toHide=data.oldPanel,prev=toHide.prev();this._removeClass(toHide,"ui-accordion-content-active");this._removeClass(prev,"ui-accordion-header-active")._addClass(prev,"ui-accordion-header-collapsed");if(toHide.length){toHide.parent()[0].className=toHide.parent()[0].className;}
this._trigger("activate",null,data);}});var safeActiveElement=$.ui.safeActiveElement=function(document){var activeElement;try{activeElement=document.activeElement;}catch(error){activeElement=document.body;}
if(!activeElement){activeElement=document.body;}
if(!activeElement.nodeName){activeElement=document.body;}
return activeElement;};var widgetsMenu=$.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=false;this.lastMousePosition={x:null,y:null};this.element.uniqueId().attr({role:this.options.role,tabIndex:0});this._addClass("ui-menu","ui-widget ui-widget-content");this._on({"mousedown .ui-menu-item":function(event){event.preventDefault();this._activateItem(event);},"click .ui-menu-item":function(event){var target=$(event.target);var active=$($.ui.safeActiveElement(this.document[0]));if(!this.mouseHandled&&target.not(".ui-state-disabled").length){this.select(event);if(!event.isPropagationStopped()){this.mouseHandled=true;}
if(target.has(".ui-menu").length){this.expand(event);}else if(!this.element.is(":focus")&&active.closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer);}}}},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){var item=this.active||this._menuItems().first();if(!keepActiveItem){this.focus(event,item);}},blur:function(event){this._delay(function(){var notContained=!$.contains(this.element[0],$.ui.safeActiveElement(this.document[0]));if(notContained){this.collapseAll(event);}});},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(event){if(this._closeOnDocumentClick(event)){this.collapseAll(event,true);}
this.mouseHandled=false;}});},_activateItem:function(event){if(this.previousFilter){return;}
if(event.clientX===this.lastMousePosition.x&&event.clientY===this.lastMousePosition.y){return;}
this.lastMousePosition={x:event.clientX,y:event.clientY};var actualTarget=$(event.target).closest(".ui-menu-item"),target=$(event.currentTarget);if(actualTarget[0]!==target[0]){return;}
if(target.is(".ui-state-active")){return;}
this._removeClass(target.siblings().children(".ui-state-active"),null,"ui-state-active");this.focus(event,target);},_destroy:function(){var items=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),submenus=items.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled "+"tabIndex").removeUniqueId().show();submenus.children().each(function(){var elem=$(this);if(elem.data("ui-menu-submenu-caret")){elem.remove();}});},_keydown:function(event){var match,prev,character,skip,preventDefault=true;switch(event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);break;case $.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(event);}
break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=false;prev=this.previousFilter||"";skip=false;character=event.keyCode>=96&&event.keyCode<=105?(event.keyCode-96).toString():String.fromCharCode(event.keyCode);clearTimeout(this.filterTimer);if(character===prev){skip=true;}else{character=prev+character;}
match=this._filterMenuItems(character);match=skip&&match.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):match;if(!match.length){character=String.fromCharCode(event.keyCode);match=this._filterMenuItems(character);}
if(match.length){this.focus(event,match);this.previousFilter=character;this.filterTimer=this._delay(function(){delete this.previousFilter;},1000);}else{delete this.previousFilter;}}
if(preventDefault){event.preventDefault();}},_activate:function(event){if(this.active&&!this.active.is(".ui-state-disabled")){if(this.active.children("[aria-haspopup='true']").length){this.expand(event);}else{this.select(event);}}},refresh:function(){var menus,items,newSubmenus,newItems,newWrappers,that=this,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length);newSubmenus=submenus.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.prev(),submenuCaret=$("<span>").data("ui-menu-submenu-caret",true);that._addClass(submenuCaret,"ui-menu-icon","ui-icon "+icon);item.attr("aria-haspopup","true").prepend(submenuCaret);menu.attr("aria-labelledby",item.attr("id"));});this._addClass(newSubmenus,"ui-menu","ui-widget ui-widget-content ui-front");menus=submenus.add(this.element);items=menus.find(this.options.items);items.not(".ui-menu-item").each(function(){var item=$(this);if(that._isDivider(item)){that._addClass(item,"ui-menu-divider","ui-widget-content");}});newItems=items.not(".ui-menu-item, .ui-menu-divider");newWrappers=newItems.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()});this._addClass(newItems,"ui-menu-item")._addClass(newWrappers,"ui-menu-item-wrapper");items.filter(".ui-state-disabled").attr("aria-disabled","true");if(this.active&&!$.contains(this.element[0],this.active[0])){this.blur();}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role];},_setOption:function(key,value){if(key==="icons"){var icons=this.element.find(".ui-menu-icon");this._removeClass(icons,null,this.options.icons.submenu)._addClass(icons,null,value.submenu);}
this._super(key,value);},_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",String(value));this._toggleClass(null,"ui-state-disabled",!!value);},focus:function(event,item){var nested,focused,activeParent;this.blur(event,event&&event.type==="focus");this._scrollIntoView(item);this.active=item.first();focused=this.active.children(".ui-menu-item-wrapper");this._addClass(focused,null,"ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",focused.attr("id"));}
activeParent=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper");this._addClass(activeParent,null,"ui-state-active");if(event&&event.type==="keydown"){this._close();}else{this.timer=this._delay(function(){this._close();},this.delay);}
nested=item.children(".ui-menu");if(nested.length&&event&&(/^mouse/.test(event.type))){this._startOpening(nested);}
this.activeMenu=item.parent();this._trigger("focus",event,{item:item});},_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;if(this._hasScroll()){borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0;paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0;offset=item.offset().top-this.activeMenu.offset().top-borderTop-paddingTop;scroll=this.activeMenu.scrollTop();elementHeight=this.activeMenu.height();itemHeight=item.outerHeight();if(offset<0){this.activeMenu.scrollTop(scroll+offset);}else if(offset+itemHeight>elementHeight){this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight);}}},blur:function(event,fromFocus){if(!fromFocus){clearTimeout(this.timer);}
if(!this.active){return;}
this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active");this._trigger("blur",event,{item:this.active});this.active=null;},_startOpening:function(submenu){clearTimeout(this.timer);if(submenu.attr("aria-hidden")!=="true"){return;}
this.timer=this._delay(function(){this._close();this._open(submenu);},this.delay);},_open:function(submenu){var position=$.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden","true");submenu.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(position);},collapseAll:function(event,all){clearTimeout(this.timer);this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(this.element.find(".ui-menu"));if(!currentMenu.length){currentMenu=this.element;}
this._close(currentMenu);this.blur(event);this._removeClass(currentMenu.find(".ui-state-active"),null,"ui-state-active");this.activeMenu=currentMenu;},all?0:this.delay);},_close:function(startMenu){if(!startMenu){startMenu=this.active?this.active.parent():this.element;}
startMenu.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false");},_closeOnDocumentClick:function(event){return!$(event.target).closest(".ui-menu").length;},_isDivider:function(item){return!/[^\-\u2014\u2013\s]/.test(item.text());},collapse:function(event){var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(newItem&&newItem.length){this._close();this.focus(event,newItem);}},expand:function(event){var newItem=this.active&&this._menuItems(this.active.children(".ui-menu")).first();if(newItem&&newItem.length){this._open(newItem.parent());this._delay(function(){this.focus(event,newItem);});}},next:function(event){this._move("next","first",event);},previous:function(event){this._move("prev","last",event);},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length;},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length;},_menuItems:function(menu){return(menu||this.element).find(this.options.items).filter(".ui-menu-item");},_move:function(direction,filter,event){var next;if(this.active){if(direction==="first"||direction==="last"){next=this.active
[direction==="first"?"prevAll":"nextAll"](".ui-menu-item").last();}else{next=this.active
[direction+"All"](".ui-menu-item").first();}}
if(!next||!next.length||!this.active){next=this._menuItems(this.activeMenu)[filter]();}
this.focus(event,next);},nextPage:function(event){var item,base,height;if(!this.active){this.next(event);return;}
if(this.isLastItem()){return;}
if(this._hasScroll()){base=this.active.offset().top;height=this.element.innerHeight();if($.fn.jquery.indexOf("3.2.")===0){height+=this.element[0].offsetHeight-this.element.outerHeight();}
this.active.nextAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base-height<0;});this.focus(event,item);}else{this.focus(event,this._menuItems(this.activeMenu)
[!this.active?"first":"last"]());}},previousPage:function(event){var item,base,height;if(!this.active){this.next(event);return;}
if(this.isFirstItem()){return;}
if(this._hasScroll()){base=this.active.offset().top;height=this.element.innerHeight();if($.fn.jquery.indexOf("3.2.")===0){height+=this.element[0].offsetHeight-this.element.outerHeight();}
this.active.prevAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base+height>0;});this.focus(event,item);}else{this.focus(event,this._menuItems(this.activeMenu).first());}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight");},select:function(event){this.active=this.active||$(event.target).closest(".ui-menu-item");var ui={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(event,true);}
this._trigger("select",event,ui);},_filterMenuItems:function(character){var escapedCharacter=character.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),regex=new RegExp("^"+escapedCharacter,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return regex.test(String.prototype.trim.call($(this).children(".ui-menu-item-wrapper").text()));});}});$.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea=nodeName==="textarea",isInput=nodeName==="input";this.isMultiLine=isTextarea||!isInput&&this._isContentEditable(this.element);this.valueMethod=this.element[isTextarea||isInput?"val":"text"];this.isNewMenu=true;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly")){suppressKeyPress=true;suppressInput=true;suppressKeyPressRepeat=true;return;}
suppressKeyPress=false;suppressInput=false;suppressKeyPressRepeat=false;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=true;this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=true;this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=true;this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=true;this._keyEvent("next",event);break;case keyCode.ENTER:if(this.menu.active){suppressKeyPress=true;event.preventDefault();this.menu.select(event);}
break;case keyCode.TAB:if(this.menu.active){this.menu.select(event);}
break;case keyCode.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term);}
this.close(event);event.preventDefault();}
break;default:suppressKeyPressRepeat=true;this._searchTimeout(event);break;}},keypress:function(event){if(suppressKeyPress){suppressKeyPress=false;if(!this.isMultiLine||this.menu.element.is(":visible")){event.preventDefault();}
return;}
if(suppressKeyPressRepeat){return;}
var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event);break;}},input:function(event){if(suppressInput){suppressInput=false;event.preventDefault();return;}
this._searchTimeout(event);},focus:function(){this.selectedItem=null;this.previous=this._value();},blur:function(event){clearTimeout(this.searching);this.close(event);this._change(event);}});this._initSource();this.menu=$("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({"unselectable":"on"}).menu("instance");this._addClass(this.menu.element,"ui-autocomplete","ui-front");this._on(this.menu.element,{mousedown:function(event){event.preventDefault();},menufocus:function(event,ui){var label,item;if(this.isNewMenu){this.isNewMenu=false;if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent);});return;}}
item=ui.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",event,{item:item})){if(event.originalEvent&&/^key/.test(event.originalEvent.type)){this._value(item.value);}}
label=ui.item.attr("aria-label")||item.value;if(label&&String.prototype.trim.call(label).length){clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(label));},100);}},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");this.previous=previous;this._delay(function(){this.previous=previous;this.selectedItem=item;});}
if(false!==this._trigger("select",event,{item:item})){this._value(item.value);}
this.term=this._value();this.close(event);this.selectedItem=item;}});this.liveRegion=$("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_destroy:function(){clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove();},_setOption:function(key,value){this._super(key,value);if(key==="source"){this._initSource();}
if(key==="appendTo"){this.menu.element.appendTo(this._appendTo());}
if(key==="disabled"&&value&&this.xhr){this.xhr.abort();}},_isEventTargetInWidget:function(event){var menuElement=this.menu.element[0];return event.target===this.element[0]||event.target===menuElement||$.contains(menuElement,event.target);},_closeOnClickOutside:function(event){if(!this._isEventTargetInWidget(event)){this.close();}},_appendTo:function(){var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0);}
if(!element||!element[0]){element=this.element.closest(".ui-front, dialog");}
if(!element.length){element=this.document[0].body;}
return element;},_initSource:function(){var array,url,that=this;if(Array.isArray(this.options.source)){array=this.options.source;this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term));};}else if(typeof this.options.source==="string"){url=this.options.source;this.source=function(request,response){if(that.xhr){that.xhr.abort();}
that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data);},error:function(){response([]);}});};}else{this.source=this.options.source;}},_searchTimeout:function(event){clearTimeout(this.searching);this.searching=this._delay(function(){var equalValues=this.term===this._value(),menuVisible=this.menu.element.is(":visible"),modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;if(!equalValues||(equalValues&&!menuVisible&&!modifierKey)){this.selectedItem=null;this.search(null,event);}},this.options.delay);},search:function(value,event){value=value!=null?value:this._value();this.term=this._value();if(value.length<this.options.minLength){return this.close(event);}
if(this._trigger("search",event)===false){return;}
return this._search(value);},_search:function(value){this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:value},this._response());},_response:function(){var index=++this.requestIndex;return function(content){if(index===this.requestIndex){this.__response(content);}
this.pending--;if(!this.pending){this._removeClass("ui-autocomplete-loading");}}.bind(this);},__response:function(content){if(content){content=this._normalize(content);}
this._trigger("response",null,{content:content});if(!this.options.disabled&&content&&content.length&&!this.cancelSearch){this._suggest(content);this._trigger("open");}else{this._close();}},close:function(event){this.cancelSearch=true;this._close(event);},_close:function(event){this._off(this.document,"mousedown");if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",event);}},_change:function(event){if(this.previous!==this._value()){this._trigger("change",event,{item:this.selectedItem});}},_normalize:function(items){if(items.length&&items[0].label&&items[0].value){return items;}
return $.map(items,function(item){if(typeof item==="string"){return{label:item,value:item};}
return $.extend({},item,{label:item.label||item.value,value:item.value||item.label});});},_suggest:function(items){var ul=this.menu.element.empty();this._renderMenu(ul,items);this.isNewMenu=true;this.menu.refresh();ul.show();this._resizeMenu();ul.position($.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next();}
this._on(this.document,{mousedown:"_closeOnClickOutside"});},_resizeMenu:function(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth()));},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){that._renderItemData(ul,item);});},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item);},_renderItem:function(ul,item){return $("<li>").append($("<div>").text(item.label)).appendTo(ul);},_move:function(direction,event){if(!this.menu.element.is(":visible")){this.search(null,event);return;}
if(this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)){if(!this.isMultiLine){this._value(this.term);}
this.menu.blur();return;}
this.menu[direction](event);},widget:function(){return this.menu.element;},_value:function(){return this.valueMethod.apply(this.element,arguments);},_keyEvent:function(keyEvent,event){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(keyEvent,event);event.preventDefault();}},_isContentEditable:function(element){if(!element.length){return false;}
var editable=element.prop("contentEditable");if(editable==="inherit"){return this._isContentEditable(element.parent());}
return editable==="true";}});$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value);});}});$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate.";}}},__response:function(content){var message;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return;}
if(content&&content.length){message=this.options.messages.results(content.length);}else{message=this.options.messages.noResults;}
clearTimeout(this.liveRegionTimer);this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(message));},100);}});var widgetsAutocomplete=$.ui.autocomplete;var controlgroupCornerRegex=/ui-corner-([a-z]){2,6}/g;var widgetsControlgroup=$.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:true,items:{"button":"input[type=button], input[type=submit], input[type=reset], button, a","controlgroupLabel":".ui-controlgroup-label","checkboxradio":"input[type='checkbox'], input[type='radio']","selectmenu":"select","spinner":".ui-spinner-input"}},_create:function(){this._enhance();},_enhance:function(){this.element.attr("role","toolbar");this.refresh();},_destroy:function(){this._callChildMethod("destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");if(this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap();}},_initWidgets:function(){var that=this,childWidgets=[];$.each(this.options.items,function(widget,selector){var labels;var options={};if(!selector){return;}
if(widget==="controlgroupLabel"){labels=that.element.find(selector);labels.each(function(){var element=$(this);if(element.children(".ui-controlgroup-label-contents").length){return;}
element.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>");});that._addClass(labels,null,"ui-widget ui-widget-content ui-state-default");childWidgets=childWidgets.concat(labels.get());return;}
if(!$.fn[widget]){return;}
if(that["_"+widget+"Options"]){options=that["_"+widget+"Options"]("middle");}else{options={classes:{}};}
that.element.find(selector).each(function(){var element=$(this);var instance=element[widget]("instance");var instanceOptions=$.widget.extend({},options);if(widget==="button"&&element.parent(".ui-spinner").length){return;}
if(!instance){instance=element[widget]()[widget]("instance");}
if(instance){instanceOptions.classes=that._resolveClassesValues(instanceOptions.classes,instance);}
element[widget](instanceOptions);var widgetElement=element[widget]("widget");$.data(widgetElement[0],"ui-controlgroup-data",instance?instance:element[widget]("instance"));childWidgets.push(widgetElement[0]);});});this.childWidgets=$($.uniqueSort(childWidgets));this._addClass(this.childWidgets,"ui-controlgroup-item");},_callChildMethod:function(method){this.childWidgets.each(function(){var element=$(this),data=element.data("ui-controlgroup-data");if(data&&data[method]){data[method]();}});},_updateCornerClass:function(element,position){var remove="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";var add=this._buildSimpleOptions(position,"label").classes.label;this._removeClass(element,null,remove);this._addClass(element,null,add);},_buildSimpleOptions:function(position,key){var direction=this.options.direction==="vertical";var result={classes:{}};result.classes[key]={"middle":"","first":"ui-corner-"+(direction?"top":"left"),"last":"ui-corner-"+(direction?"bottom":"right"),"only":"ui-corner-all"}[position];return result;},_spinnerOptions:function(position){var options=this._buildSimpleOptions(position,"ui-spinner");options.classes["ui-spinner-up"]="";options.classes["ui-spinner-down"]="";return options;},_buttonOptions:function(position){return this._buildSimpleOptions(position,"ui-button");},_checkboxradioOptions:function(position){return this._buildSimpleOptions(position,"ui-checkboxradio-label");},_selectmenuOptions:function(position){var direction=this.options.direction==="vertical";return{width:direction?"auto":false,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(direction?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(direction?"top":"left")},last:{"ui-selectmenu-button-open":direction?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(direction?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[position]};},_resolveClassesValues:function(classes,instance){var result={};$.each(classes,function(key){var current=instance.options.classes[key]||"";current=String.prototype.trim.call(current.replace(controlgroupCornerRegex,""));result[key]=(current+" "+classes[key]).replace(/\s+/g," ");});return result;},_setOption:function(key,value){if(key==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction);}
this._super(key,value);if(key==="disabled"){this._callChildMethod(value?"disable":"enable");return;}
this.refresh();},refresh:function(){var children,that=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"){this._addClass(null,"ui-helper-clearfix");}
this._initWidgets();children=this.childWidgets;if(this.options.onlyVisible){children=children.filter(":visible");}
if(children.length){$.each(["first","last"],function(index,value){var instance=children[value]().data("ui-controlgroup-data");if(instance&&that["_"+instance.widgetName+"Options"]){var options=that["_"+instance.widgetName+"Options"](children.length===1?"only":value);options.classes=that._resolveClassesValues(options.classes,instance);instance.element[instance.widgetName](options);}else{that._updateCornerClass(children[value](),value);}});this._callChildMethod("refresh");}}});$.widget("ui.checkboxradio",[$.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:true,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var disabled,labels,labelContents;var options=this._super()||{};this._readType();labels=this.element.labels();this.label=$(labels[labels.length-1]);if(!this.label.length){$.error("No label found for checkboxradio widget");}
this.originalLabel="";labelContents=this.label.contents().not(this.element[0]);if(labelContents.length){this.originalLabel+=labelContents.clone().wrapAll("<div></div>").parent().html();}
if(this.originalLabel){options.label=this.originalLabel;}
disabled=this.element[0].disabled;if(disabled!=null){options.disabled=disabled;}
return options;},_create:function(){var checked=this.element[0].checked;this._bindFormResetHandler();if(this.options.disabled==null){this.options.disabled=this.element[0].disabled;}
this._setOption("disabled",this.options.disabled);this._addClass("ui-checkboxradio","ui-helper-hidden-accessible");this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget");if(this.type==="radio"){this._addClass(this.label,"ui-checkboxradio-radio-label");}
if(this.options.label&&this.options.label!==this.originalLabel){this._updateLabel();}else if(this.originalLabel){this.options.label=this.originalLabel;}
this._enhance();if(checked){this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active");}
this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus");},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus");}});},_readType:function(){var nodeName=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type;if(nodeName!=="input"||!/radio|checkbox/.test(this.type)){$.error("Can't create checkboxradio on element.nodeName="+nodeName+" and element.type="+this.type);}},_enhance:function(){this._updateIcon(this.element[0].checked);},widget:function(){return this.label;},_getRadioGroup:function(){var group;var name=this.element[0].name;var nameSelector="input[name='"+$.escapeSelector(name)+"']";if(!name){return $([]);}
if(this.form.length){group=$(this.form[0].elements).filter(nameSelector);}else{group=$(nameSelector).filter(function(){return $(this)._form().length===0;});}
return group.not(this.element);},_toggleClasses:function(){var checked=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked);if(this.options.icon&&this.type==="checkbox"){this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",checked)._toggleClass(this.icon,null,"ui-icon-blank",!checked);}
if(this.type==="radio"){this._getRadioGroup().each(function(){var instance=$(this).checkboxradio("instance");if(instance){instance._removeClass(instance.label,"ui-checkboxradio-checked","ui-state-active");}});}},_destroy:function(){this._unbindFormResetHandler();if(this.icon){this.icon.remove();this.iconSpace.remove();}},_setOption:function(key,value){if(key==="label"&&!value){return;}
this._super(key,value);if(key==="disabled"){this._toggleClass(this.label,null,"ui-state-disabled",value);this.element[0].disabled=value;return;}
this.refresh();},_updateIcon:function(checked){var toAdd="ui-icon ui-icon-background ";if(this.options.icon){if(!this.icon){this.icon=$("<span>");this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,"ui-checkboxradio-icon-space");}
if(this.type==="checkbox"){toAdd+=checked?"ui-icon-check ui-state-checked":"ui-icon-blank";this._removeClass(this.icon,null,checked?"ui-icon-blank":"ui-icon-check");}else{toAdd+="ui-icon-blank";}
this._addClass(this.icon,"ui-checkboxradio-icon",toAdd);if(!checked){this._removeClass(this.icon,null,"ui-icon-check ui-state-checked");}
this.icon.prependTo(this.label).after(this.iconSpace);}else if(this.icon!==undefined){this.icon.remove();this.iconSpace.remove();delete this.icon;}},_updateLabel:function(){var contents=this.label.contents().not(this.element[0]);if(this.icon){contents=contents.not(this.icon[0]);}
if(this.iconSpace){contents=contents.not(this.iconSpace[0]);}
contents.remove();this.label.append(this.options.label);},refresh:function(){var checked=this.element[0].checked,isDisabled=this.element[0].disabled;this._updateIcon(checked);this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked);if(this.options.label!==null){this._updateLabel();}
if(isDisabled!==this.options.disabled){this._setOptions({"disabled":isDisabled});}}}]);var widgetsCheckboxradio=$.ui.checkboxradio;$.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:true},_getCreateOptions:function(){var disabled,options=this._super()||{};this.isInput=this.element.is("input");disabled=this.element[0].disabled;if(disabled!=null){options.disabled=disabled;}
this.originalLabel=this.isInput?this.element.val():this.element.html();if(this.originalLabel){options.label=this.originalLabel;}
return options;},_create:function(){if(!this.option.showLabel&!this.options.icon){this.options.showLabel=true;}
if(this.options.disabled==null){this.options.disabled=this.element[0].disabled||false;}
this.hasTitle=!!this.element.attr("title");if(this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(this.options.label);}else{this.element.html(this.options.label);}}
this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is("a")){this._on({"keyup":function(event){if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();if(this.element[0].click){this.element[0].click();}else{this.element.trigger("click");}}}});}},_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button");}
if(this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip();}},_updateTooltip:function(){this.title=this.element.attr("title");if(!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label);}},_updateIcon:function(option,value){var icon=option!=="iconPosition",position=icon?this.options.iconPosition:value,displayBlock=position==="top"||position==="bottom";if(!this.icon){this.icon=$("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(!this.options.showLabel){this._addClass("ui-button-icon-only");}}else if(icon){this._removeClass(this.icon,null,this.options.icon);}
if(icon){this._addClass(this.icon,null,value);}
this._attachIcon(position);if(displayBlock){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){this.iconSpace.remove();}}else{if(!this.iconSpace){this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,"ui-button-icon-space");}
this._removeClass(this.icon,null,"ui-wiget-icon-block");this._attachIconSpace(position);}},_destroy:function(){this.element.removeAttr("role");if(this.icon){this.icon.remove();}
if(this.iconSpace){this.iconSpace.remove();}
if(!this.hasTitle){this.element.removeAttr("title");}},_attachIconSpace:function(iconPosition){this.icon[/^(?:end|bottom)/.test(iconPosition)?"before":"after"](this.iconSpace);},_attachIcon:function(iconPosition){this.element[/^(?:end|bottom)/.test(iconPosition)?"append":"prepend"](this.icon);},_setOptions:function(options){var newShowLabel=options.showLabel===undefined?this.options.showLabel:options.showLabel,newIcon=options.icon===undefined?this.options.icon:options.icon;if(!newShowLabel&&!newIcon){options.showLabel=true;}
this._super(options);},_setOption:function(key,value){if(key==="icon"){if(value){this._updateIcon(key,value);}else if(this.icon){this.icon.remove();if(this.iconSpace){this.iconSpace.remove();}}}
if(key==="iconPosition"){this._updateIcon(key,value);}
if(key==="showLabel"){this._toggleClass("ui-button-icon-only",null,!value);this._updateTooltip();}
if(key==="label"){if(this.isInput){this.element.val(value);}else{this.element.html(value);if(this.icon){this._attachIcon(this.options.iconPosition);this._attachIconSpace(this.options.iconPosition);}}}
this._super(key,value);if(key==="disabled"){this._toggleClass(null,"ui-state-disabled",value);this.element[0].disabled=value;if(value){this.element.trigger("blur");}}},refresh:function(){var isDisabled=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");if(isDisabled!==this.options.disabled){this._setOptions({disabled:isDisabled});}
this._updateTooltip();}});if($.uiBackCompat!==false){$.widget("ui.button",$.ui.button,{options:{text:true,icons:{primary:null,secondary:null}},_create:function(){if(this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text;}
if(!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel;}
if(!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(this.options.icons.primary){this.options.icon=this.options.icons.primary;}else{this.options.icon=this.options.icons.secondary;this.options.iconPosition="end";}}else if(this.options.icon){this.options.icons.primary=this.options.icon;}
this._super();},_setOption:function(key,value){if(key==="text"){this._super("showLabel",value);return;}
if(key==="showLabel"){this.options.text=value;}
if(key==="icon"){this.options.icons.primary=value;}
if(key==="icons"){if(value.primary){this._super("icon",value.primary);this._super("iconPosition","beginning");}else if(value.secondary){this._super("icon",value.secondary);this._super("iconPosition","end");}}
this._superApply(arguments);}});$.fn.button=(function(orig){return function(options){var isMethodCall=typeof options==="string";var args=Array.prototype.slice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined;}else{this.each(function(){var methodValue;var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(options==="instance"){returnValue=instance;return false;}
if(!instance){return $.error("cannot call methods on button"+" prior to initialization; "+"attempted to call method '"+options+"'");}
if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for button"+" widget instance");}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));}
this.each(function(){var type=$(this).attr("type");var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,"ui-"+name);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{if(name==="button"){orig.call($(this),options);return;}
$(this).checkboxradio($.extend({icon:false},options));}});}
return returnValue;};})($.fn.button);$.fn.buttonset=function(){if(!$.ui.controlgroup){$.error("Controlgroup widget missing");}
if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]);}
if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(this,[arguments[0],"items.button"]);}
if(typeof arguments[0]==="object"&&arguments[0].items){arguments[0].items={button:arguments[0].items};}
return this.controlgroup.apply(this,arguments);};}
var widgetsButton=$.ui.button;$.extend($.ui,{datepicker:{version:"1.13.2"}});var datepicker_instActive;function datepicker_getZindex(elem){var position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}}
elem=elem.parent();}
return 0;}
function Datepicker(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};$.extend(this._defaults,this.regional[""]);this.regional.en=$.extend(true,{},this.regional[""]);this.regional["en-US"]=$.extend(true,{},this.regional.en);this.dpDiv=datepicker_bindHover($("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));}
$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv;},setDefaults:function(settings){datepicker_extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var nodeName,inline,inst;nodeName=target.nodeName.toLowerCase();inline=(nodeName==="div"||nodeName==="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid;}
inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{});if(nodeName==="input"){this._connectDatepicker(target,inst);}else if(inline){this._inlineDatepicker(target,inst);}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:datepicker_bindHover($("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return;}
this._attachments(input,inst);input.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp);this._autoSize(inst);$.data(target,"datepicker",inst);if(inst.settings.disabled){this._disableDatepicker(target);}},_attachments:function(input,inst){var showOn,buttonText,buttonImage,appendText=this._get(inst,"appendText"),isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove();}
if(appendText){inst.append=$("<span>").addClass(this._appendClass).text(appendText);input[isRTL?"before":"after"](inst.append);}
input.off("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove();}
showOn=this._get(inst,"showOn");if(showOn==="focus"||showOn==="both"){input.on("focus",this._showDatepicker);}
if(showOn==="button"||showOn==="both"){buttonText=this._get(inst,"buttonText");buttonImage=this._get(inst,"buttonImage");if(this._get(inst,"buttonImageOnly")){inst.trigger=$("<img>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText});}else{inst.trigger=$("<button type='button'>").addClass(this._triggerClass);if(buttonImage){inst.trigger.html($("<img>").attr({src:buttonImage,alt:buttonText,title:buttonText}));}else{inst.trigger.text(buttonText);}}
input[isRTL?"before":"after"](inst.trigger);inst.trigger.on("click",function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]){$.datepicker._hideDatepicker();}else if($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]){$.datepicker._hideDatepicker();$.datepicker._showDatepicker(input[0]);}else{$.datepicker._showDatepicker(input[0]);}
return false;});}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var findMax,max,maxI,i,date=new Date(2009,12-1,20),dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){findMax=function(names){max=0;maxI=0;for(i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i;}}
return maxI;};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?"dayNames":"dayNamesShort")))+20-date.getDay());}
inst.input.attr("size",this._formatDate(inst,date).length);}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return;}
divSpan.addClass(this.markerClassName).append(inst.dpDiv);$.data(target,"datepicker",inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){this._disableDatepicker(target);}
inst.dpDiv.css("display","block");},_dialogDatepicker:function(input,date,onSelect,settings,pos){var id,browserWidth,browserHeight,scrollX,scrollY,inst=this._dialogInst;if(!inst){this.uuid+=1;id="dp"+this.uuid;this._dialogInput=$("<input type='text' id='"+id+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.on("keydown",this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],"datepicker",inst);}
datepicker_extendRemove(inst.settings,settings||{});date=(date&&date.constructor===Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){browserWidth=document.documentElement.clientWidth;browserHeight=document.documentElement.clientHeight;scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];}
this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv);}
$.data(this._dialogInput[0],"datepicker",inst);return this;},_destroyDatepicker:function(target){var nodeName,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();$.removeData(target,"datepicker");if(nodeName==="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp);}else if(nodeName==="div"||nodeName==="span"){$target.removeClass(this.markerClassName).empty();}
if(datepicker_instActive===inst){datepicker_instActive=null;this._curInst=null;}},_enableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false;}).end().filter("img").css({opacity:"1.0",cursor:""});}else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false);}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});},_disableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");if(!$target.hasClass(this.markerClassName)){return;}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true;}).end().filter("img").css({opacity:"0.5",cursor:"default"});}else if(nodeName==="div"||nodeName==="span"){inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true);}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value===target?null:value);});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target){return false;}
for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]===target){return true;}}
return false;},_getInst:function(target){try{return $.data(target,"datepicker");}catch(err){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(target,name,value){var settings,date,minDate,maxDate,inst=this._getInst(target);if(arguments.length===2&&typeof name==="string"){return(name==="defaults"?$.extend({},$.datepicker._defaults):(inst?(name==="all"?$.extend({},inst.settings):this._get(inst,name)):null));}
settings=name||{};if(typeof name==="string"){settings={};settings[name]=value;}
if(inst){if(this._curInst===inst){this._hideDatepicker();}
date=this._getDateDatepicker(target,true);minDate=this._getMinMaxDate(inst,"min");maxDate=this._getMinMaxDate(inst,"max");datepicker_extendRemove(inst.settings,settings);if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){inst.settings.minDate=this._formatDate(inst,minDate);}
if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){inst.settings.maxDate=this._formatDate(inst,maxDate);}
if("disabled" in settings){if(settings.disabled){this._disableDatepicker(target);}else{this._enableDatepicker(target);}}
this._attachments($(target),inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);this._updateDatepicker(inst);}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value);},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst);}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault);}
return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var onSelect,dateStr,sel,inst=$.datepicker._getInst(event.target),handled=true,isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:sel=$("td."+$.datepicker._dayOverClass+":not(."+
$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);}
onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){dateStr=$.datepicker._formatDate(inst);onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else{$.datepicker._hideDatepicker();}
return false;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target);}
handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target);}
handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D");}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");}
break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D");}
handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D");}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");}
break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D");}
handled=event.ctrlKey||event.metaKey;break;default:handled=false;}}else if(event.keyCode===36&&event.ctrlKey){$.datepicker._showDatepicker(this);}else{handled=false;}
if(handled){event.preventDefault();event.stopPropagation();}},_doKeyPress:function(event){var chars,chr,inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));chr=String.fromCharCode(event.charCode==null?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1);}},_doKeyUp:function(event){var date,inst=$.datepicker._getInst(event.target);if(inst.input.val()!==inst.lastVal){try{date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst);}}catch(err){}}
return true;},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!=="input"){input=$("input",input.parentNode)[0];}
if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput===input){return;}
var inst,beforeShow,beforeShowSettings,isFixed,offset,showAnim,duration;inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!==inst){$.datepicker._curInst.dpDiv.stop(true,true);if(inst&&$.datepicker._datepickerShowing){$.datepicker._hideDatepicker($.datepicker._curInst.input[0]);}}
beforeShow=$.datepicker._get(inst,"beforeShow");beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{};if(beforeShowSettings===false){return;}
datepicker_extendRemove(inst.settings,beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value="";}
if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;}
isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")==="fixed";return!isFixed;});offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){showAnim=$.datepicker._get(inst,"showAnim");duration=$.datepicker._get(inst,"duration");inst.dpDiv.css("z-index",datepicker_getZindex($(input))+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects.effect[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration);}else{inst.dpDiv[showAnim||"show"](showAnim?duration:null);}
if($.datepicker._shouldFocusInput(inst)){inst.input.trigger("focus");}
$.datepicker._curInst=inst;}},_updateDatepicker:function(inst){this.maxRows=4;datepicker_instActive=inst;inst.dpDiv.empty().append(this._generateHTML(inst));this._attachHandlers(inst);var origyearshtml,numMonths=this._getNumberOfMonths(inst),cols=numMonths[1],width=17,activeCell=inst.dpDiv.find("."+this._dayOverClass+" a"),onUpdateDatepicker=$.datepicker._get(inst,"onUpdateDatepicker");if(activeCell.length>0){datepicker_handleMouseover.apply(activeCell.get(0));}
inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em");}
inst.dpDiv[(numMonths[0]!==1||numMonths[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)){inst.input.trigger("focus");}
if(inst.yearshtml){origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year").first().replaceWith(inst.yearshtml);}
origyearshtml=inst.yearshtml=null;},0);}
if(onUpdateDatepicker){onUpdateDatepicker.apply((inst.input?inst.input[0]:null),[inst]);}},_shouldFocusInput:function(inst){return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus");},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth(),dpHeight=inst.dpDiv.outerHeight(),inputWidth=inst.input?inst.input.outerWidth():0,inputHeight=inst.input?inst.input.outerHeight():0,viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft()),viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left===inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top===(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset;},_findPos:function(obj){var position,inst=this._getInst(obj),isRTL=this._get(inst,"isRTL");while(obj&&(obj.type==="hidden"||obj.nodeType!==1||$.expr.pseudos.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"];}
position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input){var showAnim,duration,postProcess,onClose,inst=this._curInst;if(!inst||(input&&inst!==$.data(input,"datepicker"))){return;}
if(this._datepickerShowing){showAnim=this._get(inst,"showAnim");duration=this._get(inst,"duration");postProcess=function(){$.datepicker._tidyDialog(inst);};if($.effects&&($.effects.effect[showAnim]||$.effects[showAnim])){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess);}else{inst.dpDiv[(showAnim==="slideDown"?"slideUp":(showAnim==="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess);}
if(!showAnim){postProcess();}
this._datepickerShowing=false;onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst]);}
this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv);}}
this._inDialog=false;}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar");},_checkExternalClick:function(event){if(!$.datepicker._curInst){return;}
var $target=$(event.target),inst=$.datepicker._getInst($target[0]);if((($target[0].id!==$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length===0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)))||($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!==inst)){$.datepicker._hideDatepicker();}},_adjustDate:function(id,offset,period){var target=$(id),inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return;}
this._adjustInstDate(inst,offset,period);this._updateDatepicker(inst);},_gotoToday:function(id){var date,target=$(id),inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;}else{date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();}
this._notifyChange(inst);this._adjustDate(target);},_selectMonthYear:function(id,select,period){var target=$(id),inst=this._getInst(target[0]);inst["selected"+(period==="M"?"Month":"Year")]=inst["draw"+(period==="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target);},_selectDay:function(id,month,year,td){var inst,target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return;}
inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=parseInt($("a",td).attr("data-date"));inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));},_clearDate:function(id){var target=$(id);this._selectDate(target,"");},_selectDate:function(id,dateStr){var onSelect,target=$(id),inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr);}
this._updateAlternate(inst);onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);}else if(inst.input){inst.input.trigger("change");}
if(inst.inline){this._updateDatepicker(inst);}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!=="object"){inst.input.trigger("focus");}
this._lastInput=null;}},_updateAlternate:function(inst){var altFormat,date,dateStr,altField=this._get(inst,"altField");if(altField){altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(document).find(altField).val(dateStr);}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""];},iso8601Week:function(date){var time,checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1;},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments";}
value=(typeof value==="object"?value.toString():value+"");if(value===""){return null;}
var iFormat,dim,extra,iValue=0,shortYearCutoffTemp=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,shortYearCutoff=(typeof shortYearCutoffTemp!=="string"?shortYearCutoffTemp:new Date().getFullYear()%100+parseInt(shortYearCutoffTemp,10)),dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,year=-1,month=-1,day=-1,doy=-1,literal=false,date,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;},getNumber=function(match){var isDoubled=lookAhead(match),size=(match==="@"?14:(match==="!"?20:(match==="y"&&isDoubled?4:(match==="o"?3:2)))),minSize=(match==="y"?size:1),digits=new RegExp("^\\d{"+minSize+","+size+"}"),num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue;}
iValue+=num[0].length;return parseInt(num[0],10);},getName=function(match,shortNames,longNames){var index=-1,names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]];}).sort(function(a,b){return-(a[1].length-b[1].length);});$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()===name.toLowerCase()){index=pair[0];iValue+=name.length;return false;}});if(index!==-1){return index+1;}else{throw"Unknown name at position "+iValue;}},checkLiteral=function(){if(value.charAt(iValue)!==format.charAt(iFormat)){throw"Unexpected literal at position "+iValue;}
iValue++;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{checkLiteral();}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":date=new Date((getNumber("!")-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral();}else{literal=true;}
break;default:checkLiteral();}}}
if(iValue<value.length){extra=value.substr(iValue);if(!/^\s+/.test(extra)){throw"Extra/unparsed characters found in date: "+extra;}}
if(year===-1){year=new Date().getFullYear();}else if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+
(year<=shortYearCutoff?0:-100);}
if(doy>-1){month=1;day=doy;do{dim=this._getDaysInMonth(year,month-1);if(day<=dim){break;}
month++;day-=dim;}while(true);}
date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!==year||date.getMonth()+1!==month||date.getDate()!==day){throw"Invalid date";}
return date;},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+
Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return"";}
var iFormat,dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;},formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num;}}
return num;},formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);},output="",literal=false;if(date){for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{output+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getFullYear()%100<10?"0":"")+date.getFullYear()%100);break;case"@":output+=date.getTime();break;case"!":output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'";}else{literal=true;}
break;default:output+=format.charAt(iFormat);}}}}
return output;},_possibleChars:function(format){var iFormat,chars="",literal=false,lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)===match);if(matches){iFormat++;}
return matches;};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false;}else{chars+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'";}else{literal=true;}
break;default:chars+=format.charAt(iFormat);}}}
return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst,noDefault){if(inst.input.val()===inst.lastVal){return;}
var dateFormat=this._get(inst,"dateFormat"),dates=inst.lastVal=inst.input?inst.input.val():null,defaultDate=this._getDefaultDate(inst),date=defaultDate,settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate;}catch(event){dates=(noDefault?"":dates);}
inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst);},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date()));},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;},offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst));}catch(e){}
var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date(),year=date.getFullYear(),month=date.getMonth(),day=date.getDate(),pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;}
matches=pattern.exec(offset);}
return new Date(year,month,day);},newDate=(date==null||date===""?defaultDate:(typeof date==="string"?offsetString(date):(typeof date==="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()==="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0);}
return this._daylightSavingAdjust(newDate);},_daylightSavingAdjust:function(date){if(!date){return null;}
date.setHours(date.getHours()>12?date.getHours()+2:0);return date;},_setDate:function(inst,date,noChange){var clear=!date,origMonth=inst.selectedMonth,origYear=inst.selectedYear,newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=newDate.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((origMonth!==inst.selectedMonth||origYear!==inst.selectedYear)&&!noChange){this._notifyChange(inst);}
this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst));}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()==="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate;},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths"),id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){$.datepicker._adjustDate(id,-stepMonths,"M");},next:function(){$.datepicker._adjustDate(id,+stepMonths,"M");},hide:function(){$.datepicker._hideDatepicker();},today:function(){$.datepicker._gotoToday(id);},selectDay:function(){$.datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false;},selectMonth:function(){$.datepicker._selectMonthYear(id,this,"M");return false;},selectYear:function(){$.datepicker._selectMonthYear(id,this,"Y");return false;}};$(this).on(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")]);});},_generateHTML:function(inst){var maxDraw,prevText,prev,nextText,next,currentText,gotoDate,controls,buttonPanel,firstDay,showWeek,dayNames,dayNamesMin,monthNames,monthNamesShort,beforeShowDay,showOtherMonths,selectOtherMonths,defaultDate,html,dow,row,group,col,selectedDate,cornerClass,calender,thead,day,daysInMonth,leadDays,curRows,numRows,printDate,dRow,tbody,daySettings,otherMonth,unselectable,tempDate=new Date(),today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate())),isRTL=this._get(inst,"isRTL"),showButtonPanel=this._get(inst,"showButtonPanel"),hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext"),navigationAsDateFormat=this._get(inst,"navigationAsDateFormat"),numMonths=this._getNumberOfMonths(inst),showCurrentAtPos=this._get(inst,"showCurrentAtPos"),stepMonths=this._get(inst,"stepMonths"),isMultiMonth=(numMonths[0]!==1||numMonths[1]!==1),currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay))),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),drawMonth=inst.drawMonth-showCurrentAtPos,drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--;}
if(maxDate){maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}}
inst.drawMonth=drawMonth;inst.drawYear=drawYear;prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));if(this._canAdjustMonth(inst,-1,drawYear,drawMonth)){prev=$("<a>").attr({"class":"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:prevText}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+
(isRTL?"e":"w")).text(prevText))[0].outerHTML;}else if(hideIfNoPrevNext){prev="";}else{prev=$("<a>").attr({"class":"ui-datepicker-prev ui-corner-all ui-state-disabled",title:prevText}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+
(isRTL?"e":"w")).text(prevText))[0].outerHTML;}
nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));if(this._canAdjustMonth(inst,+1,drawYear,drawMonth)){next=$("<a>").attr({"class":"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:nextText}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+
(isRTL?"w":"e")).text(nextText))[0].outerHTML;}else if(hideIfNoPrevNext){next="";}else{next=$("<a>").attr({"class":"ui-datepicker-next ui-corner-all ui-state-disabled",title:nextText}).append($("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+
(isRTL?"w":"e")).text(nextText))[0].outerHTML;}
currentText=this._get(inst,"currentText");gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));controls="";if(!inst.inline){controls=$("<button>").attr({type:"button","class":"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(inst,"closeText"))[0].outerHTML;}
buttonPanel="";if(showButtonPanel){buttonPanel=$("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(isRTL?controls:"").append(this._isInRange(inst,gotoDate)?$("<button>").attr({type:"button","class":"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(currentText):"").append(isRTL?"":controls)[0].outerHTML;}
firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);showWeek=this._get(inst,"showWeek");dayNames=this._get(inst,"dayNames");dayNamesMin=this._get(inst,"dayNamesMin");monthNames=this._get(inst,"monthNames");monthNamesShort=this._get(inst,"monthNamesShort");beforeShowDay=this._get(inst,"beforeShowDay");showOtherMonths=this._get(inst,"showOtherMonths");selectOtherMonths=this._get(inst,"selectOtherMonths");defaultDate=this._getDefaultDate(inst);html="";for(row=0;row<numMonths[0];row++){group="";this.maxRows=4;for(col=0;col<numMonths[1];col++){selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));cornerClass=" ui-corner-all";calender="";if(isMultiMonth){calender+="<div class='ui-datepicker-group";if(numMonths[1]>1){switch(col){case 0:calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break;}}
calender+="'>";}
calender+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+cornerClass+"'>"+
(/all|left/.test(cornerClass)&&row===0?(isRTL?next:prev):"")+
(/all|right/.test(cornerClass)&&row===0?(isRTL?prev:next):"")+
this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";thead=(showWeek?"<th class='ui-datepicker-week-col'>"+this._get(inst,"weekHeader")+"</th>":"");for(dow=0;dow<7;dow++){day=(dow+firstDay)%7;thead+="<th scope='col'"+((dow+firstDay+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+dayNames[day]+"'>"+dayNamesMin[day]+"</span></th>";}
calender+=thead+"</tr></thead><tbody>";daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);}
leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;curRows=Math.ceil((leadDays+daysInMonth)/7);numRows=(isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows);this.maxRows=numRows;printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(dRow=0;dRow<numRows;dRow++){calender+="<tr>";tbody=(!showWeek?"":"<td class='ui-datepicker-week-col'>"+
this._get(inst,"calculateWeek")(printDate)+"</td>");for(dow=0;dow<7;dow++){daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);otherMonth=(printDate.getMonth()!==drawMonth);unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+="<td class='"+
((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+
(otherMonth?" ui-datepicker-other-month":"")+
((printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime())?" "+this._dayOverClass:"")+
(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+
(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+
(printDate.getTime()===currentDate.getTime()?" "+this._currentClass:"")+
(printDate.getTime()===today.getTime()?" ui-datepicker-today":""))+"'"+
((!otherMonth||showOtherMonths)&&daySettings[2]?" title='"+daySettings[2].replace(/'/g,"&#39;")+"'":"")+
(unselectable?"":" data-handler='selectDay' data-event='click' data-month='"+printDate.getMonth()+"' data-year='"+printDate.getFullYear()+"'")+">"+
(otherMonth&&!showOtherMonths?"&#xa0;":(unselectable?"<span class='ui-state-default'>"+printDate.getDate()+"</span>":"<a class='ui-state-default"+
(printDate.getTime()===today.getTime()?" ui-state-highlight":"")+
(printDate.getTime()===currentDate.getTime()?" ui-state-active":"")+
(otherMonth?" ui-priority-secondary":"")+"' href='#' aria-current='"+(printDate.getTime()===currentDate.getTime()?"true":"false")+"' data-date='"+printDate.getDate()+"'>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);}
calender+=tbody+"</tr>";}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
calender+="</tbody></table>"+(isMultiMonth?"</div>"+
((numMonths[0]>0&&col===numMonths[1]-1)?"<div class='ui-datepicker-row-break'></div>":""):"");group+=calender;}
html+=group;}
html+=buttonPanel;inst._keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var inMinYear,inMaxYear,month,years,thisYear,determineYear,year,endYear,changeMonth=this._get(inst,"changeMonth"),changeYear=this._get(inst,"changeYear"),showMonthAfterYear=this._get(inst,"showMonthAfterYear"),selectMonthLabel=this._get(inst,"selectMonthLabel"),selectYearLabel=this._get(inst,"selectYearLabel"),html="<div class='ui-datepicker-title'>",monthHtml="";if(secondary||!changeMonth){monthHtml+="<span class='ui-datepicker-month'>"+monthNames[drawMonth]+"</span>";}else{inMinYear=(minDate&&minDate.getFullYear()===drawYear);inMaxYear=(maxDate&&maxDate.getFullYear()===drawYear);monthHtml+="<select class='ui-datepicker-month' aria-label='"+selectMonthLabel+"' data-handler='selectMonth' data-event='change'>";for(month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+="<option value='"+month+"'"+
(month===drawMonth?" selected='selected'":"")+">"+monthNamesShort[month]+"</option>";}}
monthHtml+="</select>";}
if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear)?"&#xa0;":"");}
if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){html+="<span class='ui-datepicker-year'>"+drawYear+"</span>";}else{years=this._get(inst,"yearRange").split(":");thisYear=new Date().getFullYear();determineYear=function(value){var year=(value.match(/c[+\-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+\-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year);};year=determineYear(years[0]);endYear=Math.max(year,determineYear(years[1]||""));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);inst.yearshtml+="<select class='ui-datepicker-year' aria-label='"+selectYearLabel+"' data-handler='selectYear' data-event='change'>";for(;year<=endYear;year++){inst.yearshtml+="<option value='"+year+"'"+
(year===drawYear?" selected='selected'":"")+">"+year+"</option>";}
inst.yearshtml+="</select>";html+=inst.yearshtml;inst.yearshtml=null;}}
html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")+monthHtml;}
html+="</div>";return html;},_adjustInstDate:function(inst,offset,period){var year=inst.selectedYear+(period==="Y"?offset:0),month=inst.selectedMonth+(period==="M"?offset:0),day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period==="D"?offset:0),date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period==="M"||period==="Y"){this._notifyChange(inst);}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),newDate=(minDate&&date<minDate?minDate:date);return(maxDate&&newDate>maxDate?maxDate:newDate);},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths==="number"?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null);},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst),date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));}
return this._isInRange(inst,date);},_isInRange:function(inst,date){var yearSplit,currentYear,minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),minYear=null,maxYear=null,years=this._get(inst,"yearRange");if(years){yearSplit=years.split(":");currentYear=new Date().getFullYear();minYear=parseInt(yearSplit[0],10);maxYear=parseInt(yearSplit[1],10);if(yearSplit[0].match(/[+\-].*/)){minYear+=currentYear;}
if(yearSplit[1].match(/[+\-].*/)){maxYear+=currentYear;}}
return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime())&&(!minYear||date.getFullYear()>=minYear)&&(!maxYear||date.getFullYear()<=maxYear));},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!=="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")};},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;}
var date=(day?(typeof day==="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst));}});function datepicker_bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.on("mouseout",selector,function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).removeClass("ui-datepicker-prev-hover");}
if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).removeClass("ui-datepicker-next-hover");}}).on("mouseover",selector,datepicker_handleMouseover);}
function datepicker_handleMouseover(){if(!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline?datepicker_instActive.dpDiv.parent()[0]:datepicker_instActive.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){$(this).addClass("ui-datepicker-prev-hover");}
if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).addClass("ui-datepicker-next-hover");}}}
function datepicker_extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=props[name];}}
return target;}
$.fn.datepicker=function(options){if(!this.length){return this;}
if(!$.datepicker.initialized){$(document).on("mousedown",$.datepicker._checkExternalClick);$.datepicker.initialized=true;}
if($("#"+$.datepicker._mainDivId).length===0){$("body").append($.datepicker.dpDiv);}
var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options==="string"&&(options==="isDisabled"||options==="getDate"||options==="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));}
if(options==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));}
return this.each(function(){if(typeof options==="string"){$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs));}else{$.datepicker._attachDatepicker(this,options);}});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.13.2";var widgetsDatepicker=$.datepicker;var ie=$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var mouseHandled=false;$(document).on("mouseup",function(){mouseHandled=false;});var widgetsMouse=$.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.on("mousedown."+this.widgetName,function(event){return that._mouseDown(event);}).on("click."+this.widgetName,function(event){if(true===$.data(event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);}},_mouseDown:function(event){if(mouseHandled){return;}
this._mouseMoved=false;if(this._mouseStarted){this._mouseUp(event);}
this._mouseDownEvent=event;var that=this,btnIsLeft=(event.which===1),elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
if(true===$.data(event.target,this.widgetName+".preventClickEvent")){$.removeData(event.target,this.widgetName+".preventClickEvent");}
this._mouseMoveDelegate=function(event){return that._mouseMove(event);};this._mouseUpDelegate=function(event){return that._mouseUp(event);};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();mouseHandled=true;return true;},_mouseMove:function(event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button){return this._mouseUp(event);}else if(!event.which){if(event.originalEvent.altKey||event.originalEvent.ctrlKey||event.originalEvent.metaKey||event.originalEvent.shiftKey){this.ignoreMissingWhich=true;}else if(!this.ignoreMissingWhich){return this._mouseUp(event);}}}
if(event.which||event.button){this._mouseMoved=true;}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);if(this._mouseStarted){this._mouseDrag(event);}else{this._mouseUp(event);}}
return!this._mouseStarted;},_mouseUp:function(event){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(event.target===this._mouseDownEvent.target){$.data(event.target,this.widgetName+".preventClickEvent",true);}
this._mouseStop(event);}
if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer;}
this.ignoreMissingWhich=false;mouseHandled=false;event.preventDefault();},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(){return this.mouseDelayMet;},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}});var plugin=$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(!set){return;}
if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11)){return;}
for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}};var safeBlur=$.ui.safeBlur=function(element){if(element&&element.nodeName.toLowerCase()!=="body"){$(element).trigger("blur");}};$.widget("ui.draggable",$.ui.mouse,{version:"1.13.2",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative();}
if(this.options.addClasses){this._addClass("ui-draggable");}
this._setHandleClassName();this._mouseInit();},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._removeHandleClassName();this._setHandleClassName();}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return;}
this._removeHandleClassName();this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0){return false;}
this.handle=this._getHandle(event);if(!this.handle){return false;}
this._blurActiveElement(event);this._blockFrames(o.iframeFix===true?"iframe":o.iframeFix);return true;},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_blurActiveElement:function(event){var activeElement=$.ui.safeActiveElement(this.document[0]),target=$(event.target);if(target.closest(activeElement).length){return;}
$.ui.safeBlur(activeElement);},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this;}
this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return $(this).css("position")==="fixed";}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(event);this.originalPosition=this.position=this._generatePosition(event,false);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt){this._adjustOffsetFromHelper(o.cursorAt);}
this._setContainment();if(this._trigger("start",event)===false){this._clear();return false;}
this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}
this._mouseDrag(event,true);if($.ui.ddmanager){$.ui.ddmanager.dragStart(this,event);}
return true;},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top};},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset();}
this.position=this._generatePosition(event,true);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp(new $.Event("mouseup",event));return false;}
this.position=ui.position;}
this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);}
return false;},_mouseStop:function(event){var that=this,dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event);}
if(this.dropped){dropped=this.dropped;this.dropped=false;}
if((this.options.revert==="invalid"&&!dropped)||(this.options.revert==="valid"&&dropped)||this.options.revert===true||(typeof this.options.revert==="function"&&this.options.revert.call(this.element,dropped))){$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(that._trigger("stop",event)!==false){that._clear();}});}else{if(this._trigger("stop",event)!==false){this._clear();}}
return false;},_mouseUp:function(event){this._unblockFrames();if($.ui.ddmanager){$.ui.ddmanager.dragStop(this,event);}
if(this.handleElement.is(event.target)){this.element.trigger("focus");}
return $.ui.mouse.prototype._mouseUp.call(this,event);},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new $.Event("mouseup",{target:this.element[0]}));}else{this._clear();}
return this;},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:true;},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle");},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle");},_createHelper:function(event){var o=this.options,helperIsFunction=typeof o.helper==="function",helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):(o.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo==="parent"?this.element[0].parentNode:o.appendTo));}
if(helperIsFunction&&helper[0]===this.element[0]){this._setPositionRelative();}
if(helper[0]!==this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute");}
return helper;},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative";}},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");}
if(Array.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};}
if("left" in obj){this.offset.click.left=obj.left+this.margins.left;}
if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;}
if("top" in obj){this.offset.click.top=obj.top+this.margins.top;}
if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_isRootNode:function(element){return(/(html|body)/i).test(element.tagName)||element===this.document[0];},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if(this._isRootNode(this.offsetParent[0])){po={top:0,left:0};}
return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0};}
var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+
(!scrollIsRootNode?this.scrollParent.scrollTop():0),left:p.left-(parseInt(this.helper.css("left"),10)||0)+
(!scrollIsRootNode?this.scrollParent.scrollLeft():0)};},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];this.relativeContainer=null;if(!o.containment){this.containment=null;return;}
if(o.containment==="window"){this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-
this.helperProportions.width-this.margins.left,$(window).scrollTop()+
($(window).height()||document.body.parentNode.scrollHeight)-
this.helperProportions.height-this.margins.top];return;}
if(o.containment==="document"){this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-
this.helperProportions.height-this.margins.top];return;}
if(o.containment.constructor===Array){this.containment=o.containment;return;}
if(o.containment==="parent"){o.containment=this.helper[0].parentNode;}
c=$(o.containment);ce=c[0];if(!ce){return;}
isUserScrollable=/(scroll|auto)/.test(c.css("overflow"));this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+
(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+
(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-
(parseInt(c.css("borderRightWidth"),10)||0)-
(parseInt(c.css("paddingRight"),10)||0)-
this.helperProportions.width-
this.margins.left-
this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-
(parseInt(c.css("borderBottomWidth"),10)||0)-
(parseInt(c.css("paddingBottom"),10)||0)-
this.helperProportions.height-
this.margins.top-
this.margins.bottom];this.relativeContainer=c;},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;}
var mod=d==="absolute"?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:(pos.top+
this.offset.relative.top*mod+
this.offset.parent.top*mod-
((this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))*mod)),left:(pos.left+
this.offset.relative.left*mod+
this.offset.parent.left*mod-
((this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left))*mod))};},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;if(!scrollIsRootNode||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()};}
if(constrainPosition){if(this.containment){if(this.relativeContainer){co=this.relativeContainer.offset();containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top];}else{containment=this.containment;}
if(event.pageX-this.offset.click.left<containment[0]){pageX=containment[0]+this.offset.click.left;}
if(event.pageY-this.offset.click.top<containment[1]){pageY=containment[1]+this.offset.click.top;}
if(event.pageX-this.offset.click.left>containment[2]){pageX=containment[2]+this.offset.click.left;}
if(event.pageY-this.offset.click.top>containment[3]){pageY=containment[3]+this.offset.click.top;}}
if(o.grid){top=o.grid[1]?this.originalPageY+Math.round((pageY-
this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;pageY=containment?((top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3])?top:((top-this.offset.click.top>=containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=o.grid[0]?this.originalPageX+
Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;pageX=containment?((left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2])?left:((left-this.offset.click.left>=containment[0])?left-o.grid[0]:left+o.grid[0])):left;}
if(o.axis==="y"){pageX=this.originalPageX;}
if(o.axis==="x"){pageY=this.originalPageY;}}
return{top:(pageY-
this.offset.click.top-
this.offset.relative.top-
this.offset.parent.top+
(this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))),left:(pageX-
this.offset.click.left-
this.offset.relative.left-
this.offset.parent.left+
(this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left)))};},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove();}
this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy();}},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui,this],true);if(/^(drag|start|stop)/.test(type)){this.positionAbs=this._convertPositionTo("absolute");ui.offset=this.positionAbs;}
return $.Widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs};}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[];$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");if(sortable&&!sortable.options.disabled){draggable.sortables.push(sortable);sortable.refreshPositions();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=false;$.each(draggable.sortables,function(){var sortable=this;if(sortable.isOver){sortable.isOver=0;draggable.cancelHelperRemoval=true;sortable.cancelHelperRemoval=false;sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")};sortable._mouseStop(event);sortable.options.helper=sortable.options._helper;}else{sortable.cancelHelperRemoval=true;sortable._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=false,sortable=this;sortable.positionAbs=draggable.positionAbs;sortable.helperProportions=draggable.helperProportions;sortable.offset.click=draggable.offset.click;if(sortable._intersectsWith(sortable.containerCache)){innermostIntersecting=true;$.each(draggable.sortables,function(){this.positionAbs=draggable.positionAbs;this.helperProportions=draggable.helperProportions;this.offset.click=draggable.offset.click;if(this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])){innermostIntersecting=false;}
return innermostIntersecting;});}
if(innermostIntersecting){if(!sortable.isOver){sortable.isOver=1;draggable._parent=ui.helper.parent();sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",true);sortable.options._helper=sortable.options.helper;sortable.options.helper=function(){return ui.helper[0];};event.target=sortable.currentItem[0];sortable._mouseCapture(event,true);sortable._mouseStart(event,true,true);sortable.offset.click.top=draggable.offset.click.top;sortable.offset.click.left=draggable.offset.click.left;sortable.offset.parent.left-=draggable.offset.parent.left-
sortable.offset.parent.left;sortable.offset.parent.top-=draggable.offset.parent.top-
sortable.offset.parent.top;draggable._trigger("toSortable",event);draggable.dropped=sortable.element;$.each(draggable.sortables,function(){this.refreshPositions();});draggable.currentItem=draggable.element;sortable.fromOutside=draggable;}
if(sortable.currentItem){sortable._mouseDrag(event);ui.position=sortable.position;}}else{if(sortable.isOver){sortable.isOver=0;sortable.cancelHelperRemoval=true;sortable.options._revert=sortable.options.revert;sortable.options.revert=false;sortable._trigger("out",event,sortable._uiHash(sortable));sortable._mouseStop(event,true);sortable.options.revert=sortable.options._revert;sortable.options.helper=sortable.options._helper;if(sortable.placeholder){sortable.placeholder.remove();}
ui.helper.appendTo(draggable._parent);draggable._refreshOffsets(event);ui.position=draggable._generatePosition(event,true);draggable._trigger("fromSortable",event);draggable.dropped=false;$.each(draggable.sortables,function(){this.refreshPositions();});}}});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;if(t.css("cursor")){o._cursor=t.css("cursor");}
t.css("cursor",o.cursor);},stop:function(event,ui,instance){var o=instance.options;if(o._cursor){$("body").css("cursor",o._cursor);}}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("opacity")){o._opacity=t.css("opacity");}
t.css("opacity",o.opacity);},stop:function(event,ui,instance){var o=instance.options;if(o._opacity){$(ui.helper).css("opacity",o._opacity);}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false);}
if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset();}},drag:function(event,ui,i){var o=i.options,scrolled=false,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];if(scrollParent!==document&&scrollParent.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((i.overflowOffset.top+scrollParent.offsetHeight)-event.pageY<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed;}else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed;}}
if(!o.axis||o.axis!=="y"){if((i.overflowOffset.left+scrollParent.offsetWidth)-event.pageX<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed;}else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed;}}}else{if(!o.axis||o.axis!=="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}}
if(!o.axis||o.axis!=="y"){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event);}}});$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[];$(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var $t=$(this),$o=$t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});}});},drag:function(event,ui,inst){var ts,bs,ls,rs,l,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--){l=inst.snapElements[i].left-inst.margins.left;r=l+inst.snapElements[i].width;t=inst.snapElements[i].top-inst.margins.top;b=t+inst.snapElements[i].height;if(x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)){if(inst.snapElements[i].snapping){if(inst.options.snap.release){inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item}));}}
inst.snapElements[i].snapping=false;continue;}
if(o.snapMode!=="inner"){ts=Math.abs(t-y2)<=d;bs=Math.abs(b-y1)<=d;ls=Math.abs(l-x2)<=d;rs=Math.abs(r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top;}
if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top;}
if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left;}
if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left;}}
first=(ts||bs||ls||rs);if(o.snapMode!=="outer"){ts=Math.abs(t-y1)<=d;bs=Math.abs(b-y2)<=d;ls=Math.abs(l-x1)<=d;rs=Math.abs(r-x2)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top;}
if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top;}
if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left;}
if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left;}}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){if(inst.options.snap.snap){inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item}));}}
inst.snapElements[i].snapping=(ts||bs||ls||rs||first);}}});$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-
(parseInt($(b).css("zIndex"),10)||0);});if(!group.length){return;}
min=parseInt($(group[0]).css("zIndex"),10)||0;$(group).each(function(i){$(this).css("zIndex",min+i);});this.css("zIndex",(min+group.length));}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("zIndex")){o._zIndex=t.css("zIndex");}
t.css("zIndex",o.zIndex);},stop:function(event,ui,instance){var o=instance.options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex);}}});var widgetsDraggable=$.ui.draggable;$.widget("ui.resizable",$.ui.mouse,{version:"1.13.2",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(value){return parseFloat(value)||0;},_isNumber:function(value){return!isNaN(parseFloat(value));},_hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return false;}
var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true;}
try{el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;}catch(e){}
return has;},_create:function(){var margins,o=this.options,that=this;this._addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap($("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;margins={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(margins);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(margins);this._proportionallyResize();}
this._setupHandles();if(o.autoHide){$(this.element).on("mouseenter",function(){if(o.disabled){return;}
that._removeClass("ui-resizable-autohide");that._handles.show();}).on("mouseleave",function(){if(o.disabled){return;}
if(!that.resizing){that._addClass("ui-resizable-autohide");that._handles.hide();}});}
this._mouseInit();},_destroy:function(){this._mouseDestroy();this._addedHandles.remove();var wrapper,_destroy=function(exp){$(exp).removeData("resizable").removeData("ui-resizable").off(".resizable");};if(this.elementIsWrapper){_destroy(this.element);wrapper=this.element;this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper);wrapper.remove();}
this.originalElement.css("resize",this.originalResizeStyle);_destroy(this.originalElement);return this;},_setOption:function(key,value){this._super(key,value);switch(key){case"handles":this._removeHandles();this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!value;break;default:break;}},_setupHandles:function(){var o=this.options,handle,i,n,hname,axis,that=this;this.handles=o.handles||(!$(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=$();this._addedHandles=$();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw";}
n=this.handles.split(",");this.handles={};for(i=0;i<n.length;i++){handle=String.prototype.trim.call(n[i]);hname="ui-resizable-"+handle;axis=$("<div>");this._addClass(axis,"ui-resizable-handle "+hname);axis.css({zIndex:o.zIndex});this.handles[handle]=".ui-resizable-"+handle;if(!this.element.children(this.handles[handle]).length){this.element.append(axis);this._addedHandles=this._addedHandles.add(axis);}}}
this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=this.element.children(this.handles[i]).first().show();}else if(this.handles[i].jquery||this.handles[i].nodeType){this.handles[i]=$(this.handles[i]);this._on(this.handles[i],{"mousedown":that._mouseDown});}
if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){axis=$(this.handles[i],this.element);padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize();}
this._handles=this._handles.add(this.handles[i]);}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!that.resizing){if(this.className){axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);}
that.axis=axis&&axis[1]?axis[1]:"se";}});if(o.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide");}},_removeHandles:function(){this._addedHandles.remove();},_mouseCapture:function(event){var i,handle,capture=false;for(i in this.handles){handle=$(this.handles[i])[0];if(handle===event.target||$.contains(handle,event.target)){capture=true;}}
return!this.options.disabled&&capture;},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;this.resizing=true;this._renderProxy();curleft=this._num(this.helper.css("left"));curtop=this._num(this.helper.css("top"));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;}
this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalPosition={left:curleft,top:curtop};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio==="number")?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",cursor==="auto"?this.axis+"-resize":cursor);this._addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0,trigger=this._change[a];this._updatePrevProperties();if(!trigger){return false;}
data=trigger.apply(this,[event,dx,dy]);this._updateVirtualBoundaries(event.shiftKey);if(this._aspectRatio||event.shiftKey){data=this._updateRatio(data,event);}
data=this._respectSize(data,event);this._updateCache(data);this._propagate("resize",event);props=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize();}
if(!$.isEmptyObject(props)){this._updatePrevProperties();this._trigger("resize",event,this.ui());this._applyChanges();}
return false;},_mouseStop:function(event){this.resizing=false;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;if(this._helper){pr=this._proportionallyResizeElements;ista=pr.length&&(/textarea/i).test(pr[0].nodeName);soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height;soffsetw=ista?0:that.sizeDiff.width;s={width:(that.helper.width()-soffsetw),height:(that.helper.height()-soffseth)};left=(parseFloat(that.element.css("left"))+
(that.position.left-that.originalPosition.left))||null;top=(parseFloat(that.element.css("top"))+
(that.position.top-that.originalPosition.top))||null;if(!o.animate){this.element.css($.extend(s,{top:top,left:left}));}
that.helper.height(that.size.height);that.helper.width(that.size.width);if(this._helper&&!o.animate){this._proportionallyResize();}}
$("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper){this.helper.remove();}
return false;},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height};},_applyChanges:function(){var props={};if(this.position.top!==this.prevPosition.top){props.top=this.position.top+"px";}
if(this.position.left!==this.prevPosition.left){props.left=this.position.left+"px";}
if(this.size.width!==this.prevSize.width){props.width=this.size.width+"px";}
if(this.size.height!==this.prevSize.height){props.height=this.size.height+"px";}
this.helper.css(props);return props;},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||forceAspectRatio){pMinWidth=b.minHeight*this.aspectRatio;pMinHeight=b.minWidth/this.aspectRatio;pMaxWidth=b.maxHeight*this.aspectRatio;pMaxHeight=b.maxWidth/this.aspectRatio;if(pMinWidth>b.minWidth){b.minWidth=pMinWidth;}
if(pMinHeight>b.minHeight){b.minHeight=pMinHeight;}
if(pMaxWidth<b.maxWidth){b.maxWidth=pMaxWidth;}
if(pMaxHeight<b.maxHeight){b.maxHeight=pMaxHeight;}}
this._vBoundaries=b;},_updateCache:function(data){this.offset=this.helper.offset();if(this._isNumber(data.left)){this.position.left=data.left;}
if(this._isNumber(data.top)){this.position.top=data.top;}
if(this._isNumber(data.height)){this.size.height=data.height;}
if(this._isNumber(data.width)){this.size.width=data.width;}},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;if(this._isNumber(data.height)){data.width=(data.height*this.aspectRatio);}else if(this._isNumber(data.width)){data.height=(data.width/this.aspectRatio);}
if(a==="sw"){data.left=cpos.left+(csize.width-data.width);data.top=null;}
if(a==="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);}
return data;},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=this._isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=this._isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=this._isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=this._isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height),dw=this.originalPosition.left+this.originalSize.width,dh=this.originalPosition.top+this.originalSize.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw){data.width=o.minWidth;}
if(isminh){data.height=o.minHeight;}
if(ismaxw){data.width=o.maxWidth;}
if(ismaxh){data.height=o.maxHeight;}
if(isminw&&cw){data.left=dw-o.minWidth;}
if(ismaxw&&cw){data.left=dw-o.maxWidth;}
if(isminh&&ch){data.top=dh-o.minHeight;}
if(ismaxh&&ch){data.top=dh-o.maxHeight;}
if(!data.width&&!data.height&&!data.left&&data.top){data.top=null;}else if(!data.width&&!data.height&&!data.top&&data.left){data.left=null;}
return data;},_getPaddingPlusBorderDimensions:function(element){var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];for(;i<4;i++){widths[i]=(parseFloat(borders[i])||0);widths[i]+=(parseFloat(paddings[i])||0);}
return{height:widths[0]+widths[2],width:widths[1]+widths[3]};},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return;}
var prel,i=0,element=this.helper||this.element;for(;i<this._proportionallyResizeElements.length;i++){prel=this._proportionallyResizeElements[i];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(prel);}
prel.css({height:(element.height()-this.outerDimensions.height)||0,width:(element.width()-this.outerDimensions.width)||0});}},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$("<div></div>").css({overflow:"hidden"});this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx){return{width:this.originalSize.width+dx};},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);if(n!=="resize"){this._trigger(n,event,this.ui());}},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}});$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:(that.size.width-soffsetw),height:(that.size.height-soffseth)},left=(parseFloat(that.element.css("left"))+
(that.position.left-that.originalPosition.left))||null,top=(parseFloat(that.element.css("top"))+
(that.position.top-that.originalPosition.top))||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseFloat(that.element.css("width")),height:parseFloat(that.element.css("height")),top:parseFloat(that.element.css("top")),left:parseFloat(that.element.css("left"))};if(pr&&pr.length){$(pr[0]).css({width:data.width,height:data.height});}
that._updateCache(data);that._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce){return;}
that.containerElement=$(ce);if(/document/.test(oc)||oc===document){that.containerOffset={left:0,top:0};that.containerPosition={left:0,top:0};that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}else{element=$(ce);p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name));});that.containerOffset=element.offset();that.containerPosition=element.position();that.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};co=that.containerOffset;ch=that.containerSize.height;cw=that.containerSize.width;width=(that._hasScroll(ce,"left")?ce.scrollWidth:cw);height=(that._hasScroll(ce)?ce.scrollHeight:ch);that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=true;if(ce[0]!==document&&(/static/).test(ce.css("position"))){cop=co;}
if(cp.left<(that._helper?co.left:0)){that.size.width=that.size.width+
(that._helper?(that.position.left-co.left):(that.position.left-cop.left));if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false;}
that.position.left=o.helper?co.left:0;}
if(cp.top<(that._helper?co.top:0)){that.size.height=that.size.height+
(that._helper?(that.position.top-co.top):that.position.top);if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false;}
that.position.top=that._helper?co.top:0;}
isParent=that.containerElement.get(0)===that.element.parent().get(0);isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position"));if(isParent&&isOffsetRelative){that.offset.left=that.parentData.left+that.position.left;that.offset.top=that.parentData.top+that.position.top;}else{that.offset.left=that.element.offset().left;that.offset.top=that.element.offset().top;}
woset=Math.abs(that.sizeDiff.width+
(that._helper?that.offset.left-cop.left:(that.offset.left-co.left)));hoset=Math.abs(that.sizeDiff.height+
(that._helper?that.offset.top-cop.top:(that.offset.top-co.top)));if(woset+that.size.width>=that.parentData.width){that.size.width=that.parentData.width-woset;if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false;}}
if(hoset+that.size.height>=that.parentData.height){that.size.height=that.parentData.height-hoset;if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false;}}
if(!continueResize){that.position.left=that.prevPosition.left;that.position.top=that.prevPosition.top;that.size.width=that.prevSize.width;that.size.height=that.prevSize.height;}},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;if(that._helper&&!o.animate&&(/relative/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}
if(that._helper&&!o.animate&&(/static/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}}});$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseFloat(el.width()),height:parseFloat(el.height()),left:parseFloat(el.css("left")),top:parseFloat(el.css("top"))});});},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:(that.size.height-os.height)||0,width:(that.size.width-os.width)||0,top:(that.position.top-op.top)||0,left:(that.position.left-op.left)||0};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[prop]=sum||null;}});el.css(style);});},stop:function(){$(this).removeData("ui-resizable-alsoresize");}});$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),cs=that.size;that.ghost=that.originalElement.clone();that.ghost.css({opacity:0.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0});that._addClass(that.ghost,"ui-resizable-ghost");if($.uiBackCompat!==false&&typeof that.options.ghost==="string"){that.ghost.addClass(this.options.ghost);}
that.ghost.appendTo(that.helper);},resize:function(){var that=$(this).resizable("instance");if(that.ghost){that.ghost.css({position:"relative",height:that.size.height,width:that.size.width});}},stop:function(){var that=$(this).resizable("instance");if(that.ghost&&that.helper){that.helper.get(0).removeChild(that.ghost.get(0));}}});$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid=typeof o.grid==="number"?[o.grid,o.grid]:o.grid,gridX=(grid[0]||1),gridY=(grid[1]||1),ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&(o.maxWidth<newWidth),isMaxHeight=o.maxHeight&&(o.maxHeight<newHeight),isMinWidth=o.minWidth&&(o.minWidth>newWidth),isMinHeight=o.minHeight&&(o.minHeight>newHeight);o.grid=grid;if(isMinWidth){newWidth+=gridX;}
if(isMinHeight){newHeight+=gridY;}
if(isMaxWidth){newWidth-=gridX;}
if(isMaxHeight){newHeight-=gridY;}
if(/^(se|s|e)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;}else if(/^(ne)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.top=op.top-oy;}else if(/^(sw)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.left=op.left-ox;}else{if(newHeight-gridY<=0||newWidth-gridX<=0){outerDimensions=that._getPaddingPlusBorderDimensions(this);}
if(newHeight-gridY>0){that.size.height=newHeight;that.position.top=op.top-oy;}else{newHeight=gridY-outerDimensions.height;that.size.height=newHeight;that.position.top=op.top+os.height-newHeight;}
if(newWidth-gridX>0){that.size.width=newWidth;that.position.left=op.left-ox;}else{newWidth=gridX-outerDimensions.width;that.size.width=newWidth;that.position.left=op.left+os.width-newWidth;}}}});var widgetsResizable=$.ui.resizable;$.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:true,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:true,closeText:"Close",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0){$(this).css("top",pos.top-topOffset);}}},resizable:true,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};this.originalTitle=this.element.attr("title");if(this.options.title==null&&this.originalTitle!=null){this.options.title=this.originalTitle;}
if(this.options.disabled){this.options.disabled=false;}
this._createWrapper();this.element.show().removeAttr("title").appendTo(this.uiDialog);this._addClass("ui-dialog-content","ui-widget-content");this._createTitlebar();this._createButtonPane();if(this.options.draggable&&$.fn.draggable){this._makeDraggable();}
if(this.options.resizable&&$.fn.resizable){this._makeResizable();}
this._isOpen=false;this._trackFocus();},_init:function(){if(this.options.autoOpen){this.open();}},_appendTo:function(){var element=this.options.appendTo;if(element&&(element.jquery||element.nodeType)){return $(element);}
return this.document.find(element||"body").eq(0);},_destroy:function(){var next,originalPosition=this.originalPosition;this._untrackInstance();this._destroyOverlay();this.element.removeUniqueId().css(this.originalCss).detach();this.uiDialog.remove();if(this.originalTitle){this.element.attr("title",this.originalTitle);}
next=originalPosition.parent.children().eq(originalPosition.index);if(next.length&&next[0]!==this.element[0]){next.before(this.element);}else{originalPosition.parent.append(this.element);}},widget:function(){return this.uiDialog;},disable:$.noop,enable:$.noop,close:function(event){var that=this;if(!this._isOpen||this._trigger("beforeClose",event)===false){return;}
this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(!this.opener.filter(":focusable").trigger("focus").length){$.ui.safeBlur($.ui.safeActiveElement(this.document[0]));}
this._hide(this.uiDialog,this.options.hide,function(){that._trigger("close",event);});},isOpen:function(){return this._isOpen;},moveToTop:function(){this._moveToTop();},_moveToTop:function(event,silent){var moved=false,zIndices=this.uiDialog.siblings(".ui-front:visible").map(function(){return+$(this).css("z-index");}).get(),zIndexMax=Math.max.apply(null,zIndices);if(zIndexMax>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",zIndexMax+1);moved=true;}
if(moved&&!silent){this._trigger("focus",event);}
return moved;},open:function(){var that=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable();}
return;}
this._isOpen=true;this.opener=$($.ui.safeActiveElement(this.document[0]));this._size();this._position();this._createOverlay();this._moveToTop(null,true);if(this.overlay){this.overlay.css("z-index",this.uiDialog.css("z-index")-1);}
this._show(this.uiDialog,this.options.show,function(){that._focusTabbable();that._trigger("focus");});this._makeFocusTarget();this._trigger("open");},_focusTabbable:function(){var hasFocus=this._focusedElement;if(!hasFocus){hasFocus=this.element.find("[autofocus]");}
if(!hasFocus.length){hasFocus=this.element.find(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialogButtonPane.find(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialogTitlebarClose.filter(":tabbable");}
if(!hasFocus.length){hasFocus=this.uiDialog;}
hasFocus.eq(0).trigger("focus");},_restoreTabbableFocus:function(){var activeElement=$.ui.safeActiveElement(this.document[0]),isActive=this.uiDialog[0]===activeElement||$.contains(this.uiDialog[0],activeElement);if(!isActive){this._focusTabbable();}},_keepFocus:function(event){event.preventDefault();this._restoreTabbableFocus();this._delay(this._restoreTabbableFocus);},_createWrapper:function(){this.uiDialog=$("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front");this._on(this.uiDialog,{keydown:function(event){if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){event.preventDefault();this.close(event);return;}
if(event.keyCode!==$.ui.keyCode.TAB||event.isDefaultPrevented()){return;}
var tabbables=this.uiDialog.find(":tabbable"),first=tabbables.first(),last=tabbables.last();if((event.target===last[0]||event.target===this.uiDialog[0])&&!event.shiftKey){this._delay(function(){first.trigger("focus");});event.preventDefault();}else if((event.target===first[0]||event.target===this.uiDialog[0])&&event.shiftKey){this._delay(function(){last.trigger("focus");});event.preventDefault();}},mousedown:function(event){if(this._moveToTop(event)){this._focusTabbable();}}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")});}},_createTitlebar:function(){var uiDialogTitle;this.uiDialogTitlebar=$("<div>");this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix");this._on(this.uiDialogTitlebar,{mousedown:function(event){if(!$(event.target).closest(".ui-dialog-titlebar-close")){this.uiDialog.trigger("focus");}}});this.uiDialogTitlebarClose=$("<button type='button'></button>").button({label:$("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:false}).appendTo(this.uiDialogTitlebar);this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close");this._on(this.uiDialogTitlebarClose,{click:function(event){event.preventDefault();this.close(event);}});uiDialogTitle=$("<span>").uniqueId().prependTo(this.uiDialogTitlebar);this._addClass(uiDialogTitle,"ui-dialog-title");this._title(uiDialogTitle);this.uiDialogTitlebar.prependTo(this.uiDialog);this.uiDialog.attr({"aria-labelledby":uiDialogTitle.attr("id")});},_title:function(title){if(this.options.title){title.text(this.options.title);}else{title.html("&#160;");}},_createButtonPane:function(){this.uiDialogButtonPane=$("<div>");this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix");this.uiButtonSet=$("<div>").appendTo(this.uiDialogButtonPane);this._addClass(this.uiButtonSet,"ui-dialog-buttonset");this._createButtons();},_createButtons:function(){var that=this,buttons=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if($.isEmptyObject(buttons)||(Array.isArray(buttons)&&!buttons.length)){this._removeClass(this.uiDialog,"ui-dialog-buttons");return;}
$.each(buttons,function(name,props){var click,buttonOptions;props=typeof props==="function"?{click:props,text:name}:props;props=$.extend({type:"button"},props);click=props.click;buttonOptions={icon:props.icon,iconPosition:props.iconPosition,showLabel:props.showLabel,icons:props.icons,text:props.text};delete props.click;delete props.icon;delete props.iconPosition;delete props.showLabel;delete props.icons;if(typeof props.text==="boolean"){delete props.text;}
$("<button></button>",props).button(buttonOptions).appendTo(that.uiButtonSet).on("click",function(){click.apply(that.element[0],arguments);});});this._addClass(this.uiDialog,"ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog);},_makeDraggable:function(){var that=this,options=this.options;function filteredUi(ui){return{position:ui.position,offset:ui.offset};}
this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){that._addClass($(this),"ui-dialog-dragging");that._blockFrames();that._trigger("dragStart",event,filteredUi(ui));},drag:function(event,ui){that._trigger("drag",event,filteredUi(ui));},stop:function(event,ui){var left=ui.offset.left-that.document.scrollLeft(),top=ui.offset.top-that.document.scrollTop();options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" "+"top"+(top>=0?"+":"")+top,of:that.window};that._removeClass($(this),"ui-dialog-dragging");that._unblockFrames();that._trigger("dragStop",event,filteredUi(ui));}});},_makeResizable:function(){var that=this,options=this.options,handles=options.resizable,position=this.uiDialog.css("position"),resizeHandles=typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw";function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size};}
this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui){that._addClass($(this),"ui-dialog-resizing");that._blockFrames();that._trigger("resizeStart",event,filteredUi(ui));},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui));},stop:function(event,ui){var offset=that.uiDialog.offset(),left=offset.left-that.document.scrollLeft(),top=offset.top-that.document.scrollTop();options.height=that.uiDialog.height();options.width=that.uiDialog.width();options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" "+"top"+(top>=0?"+":"")+top,of:that.window};that._removeClass($(this),"ui-dialog-resizing");that._unblockFrames();that._trigger("resizeStop",event,filteredUi(ui));}}).css("position",position);},_trackFocus:function(){this._on(this.widget(),{focusin:function(event){this._makeFocusTarget();this._focusedElement=$(event.target);}});},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this);},_untrackInstance:function(){var instances=this._trackingInstances(),exists=$.inArray(this,instances);if(exists!==-1){instances.splice(exists,1);}},_trackingInstances:function(){var instances=this.document.data("ui-dialog-instances");if(!instances){instances=[];this.document.data("ui-dialog-instances",instances);}
return instances;},_minHeight:function(){var options=this.options;return options.height==="auto"?options.minHeight:Math.min(options.minHeight,options.height);},_position:function(){var isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show();}
this.uiDialog.position(this.options.position);if(!isVisible){this.uiDialog.hide();}},_setOptions:function(options){var that=this,resize=false,resizableOptions={};$.each(options,function(key,value){that._setOption(key,value);if(key in that.sizeRelatedOptions){resize=true;}
if(key in that.resizableRelatedOptions){resizableOptions[key]=value;}});if(resize){this._size();this._position();}
if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",resizableOptions);}},_setOption:function(key,value){var isDraggable,isResizable,uiDialog=this.uiDialog;if(key==="disabled"){return;}
this._super(key,value);if(key==="appendTo"){this.uiDialog.appendTo(this._appendTo());}
if(key==="buttons"){this._createButtons();}
if(key==="closeText"){this.uiDialogTitlebarClose.button({label:$("<a>").text(""+this.options.closeText).html()});}
if(key==="draggable"){isDraggable=uiDialog.is(":data(ui-draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy");}
if(!isDraggable&&value){this._makeDraggable();}}
if(key==="position"){this._position();}
if(key==="resizable"){isResizable=uiDialog.is(":data(ui-resizable)");if(isResizable&&!value){uiDialog.resizable("destroy");}
if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value);}
if(!isResizable&&value!==false){this._makeResizable();}}
if(key==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));}},_size:function(){var nonContentHeight,minContentHeight,maxContentHeight,options=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(options.minWidth>options.width){options.width=options.minWidth;}
nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).outerHeight();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);maxContentHeight=typeof options.maxHeight==="number"?Math.max(0,options.maxHeight-nonContentHeight):"none";if(options.height==="auto"){this.element.css({minHeight:minContentHeight,maxHeight:maxContentHeight,height:"auto"});}else{this.element.height(Math.max(0,options.height-nonContentHeight));}
if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight());}},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("<div>").css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(iframe.parent()).offset(iframe.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_allowInteraction:function(event){if($(event.target).closest(".ui-dialog").length){return true;}
return!!$(event.target).closest(".ui-datepicker").length;},_createOverlay:function(){if(!this.options.modal){return;}
var jqMinor=$.fn.jquery.substring(0,4);var isOpening=true;this._delay(function(){isOpening=false;});if(!this.document.data("ui-dialog-overlays")){this.document.on("focusin.ui-dialog",function(event){if(isOpening){return;}
var instance=this._trackingInstances()[0];if(!instance._allowInteraction(event)){event.preventDefault();instance._focusTabbable();if(jqMinor==="3.4."||jqMinor==="3.5."){instance._delay(instance._restoreTabbableFocus);}}}.bind(this));}
this.overlay=$("<div>").appendTo(this._appendTo());this._addClass(this.overlay,null,"ui-widget-overlay ui-front");this._on(this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1);},_destroyOverlay:function(){if(!this.options.modal){return;}
if(this.overlay){var overlays=this.document.data("ui-dialog-overlays")-1;if(!overlays){this.document.off("focusin.ui-dialog");this.document.removeData("ui-dialog-overlays");}else{this.document.data("ui-dialog-overlays",overlays);}
this.overlay.remove();this.overlay=null;}}});if($.uiBackCompat!==false){$.widget("ui.dialog",$.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super();this.uiDialog.addClass(this.options.dialogClass);},_setOption:function(key,value){if(key==="dialogClass"){this.uiDialog.removeClass(this.options.dialogClass).addClass(value);}
this._superApply(arguments);}});}
var widgetsDialog=$.ui.dialog;$.widget("ui.droppable",{version:"1.13.2",widgetEventPrefix:"drop",options:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=false;this.isout=true;this.accept=typeof accept==="function"?accept:function(d){return d.is(accept);};this.proportions=function(){if(arguments.length){proportions=arguments[0];}else{return proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};}};this._addToManager(o.scope);if(o.addClasses){this._addClass("ui-droppable");}},_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[];$.ui.ddmanager.droppables[scope].push(this);},_splice:function(drop){var i=0;for(;i<drop.length;i++){if(drop[i]===this){drop.splice(i,1);}}},_destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);},_setOption:function(key,value){if(key==="accept"){this.accept=typeof value==="function"?value:function(d){return d.is(value);};}else if(key==="scope"){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);this._addToManager(value);}
this._super(key,value);},_activate:function(event){var draggable=$.ui.ddmanager.current;this._addActiveClass();if(draggable){this._trigger("activate",event,this.ui(draggable));}},_deactivate:function(event){var draggable=$.ui.ddmanager.current;this._removeActiveClass();if(draggable){this._trigger("deactivate",event,this.ui(draggable));}},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._addHoverClass();this._trigger("over",event,this.ui(draggable));}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._removeHoverClass();this._trigger("out",event,this.ui(draggable));}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current,childrenIntersection=false;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return false;}
this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$(this).droppable("instance");if(inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(inst.element[0],(draggable.currentItem||draggable.element))&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance,event)){childrenIntersection=true;return false;}});if(childrenIntersection){return false;}
if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",event,this.ui(draggable));return this.element;}
return false;},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,offset:c.positionAbs};},_addHoverClass:function(){this._addClass("ui-droppable-hover");},_removeHoverClass:function(){this._removeClass("ui-droppable-hover");},_addActiveClass:function(){this._addClass("ui-droppable-active");},_removeActiveClass:function(){this._removeClass("ui-droppable-active");}});$.ui.intersect=(function(){function isOverAxis(x,reference,size){return(x>=reference)&&(x<(reference+size));}
return function(draggable,droppable,toleranceMode,event){if(!droppable.offset){return false;}
var x1=(draggable.positionAbs||draggable.position.absolute).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return(l<=x1&&x2<=r&&t<=y1&&y2<=b);case"intersect":return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);case"pointer":return isOverAxis(event.pageY,t,droppable.proportions().height)&&isOverAxis(event.pageX,l,droppable.proportions().width);case"touch":return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));default:return false;}};})();$.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].accept.call(m[i].element[0],(t.currentItem||t.element)))){continue;}
for(j=0;j<list.length;j++){if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop;}}
m[i].visible=m[i].element.css("display")!=="none";if(!m[i].visible){continue;}
if(type==="mousedown"){m[i]._activate.call(m[i],event);}
m[i].offset=m[i].element.offset();m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight});}},drop:function(draggable,event){var dropped=false;$.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){if(!this.options){return;}
if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance,event)){dropped=this._drop.call(this,event)||dropped;}
if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=true;this.isover=false;this._deactivate.call(this,event);}});return dropped;},dragStart:function(draggable,event){draggable.element.parentsUntil("body").on("scroll.droppable",function(){if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}});},drag:function(draggable,event){if(draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}
$.each($.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return;}
var parentInstance,scope,parent,intersects=$.ui.intersect(draggable,this,this.options.tolerance,event),c=!intersects&&this.isover?"isout":(intersects&&!this.isover?"isover":null);if(!c){return;}
if(this.options.greedy){scope=this.options.scope;parent=this.element.parents(":data(ui-droppable)").filter(function(){return $(this).droppable("instance").options.scope===scope;});if(parent.length){parentInstance=$(parent[0]).droppable("instance");parentInstance.greedyChild=(c==="isover");}}
if(parentInstance&&c==="isover"){parentInstance.isover=false;parentInstance.isout=true;parentInstance._out.call(parentInstance,event);}
this[c]=true;this[c==="isout"?"isover":"isout"]=false;this[c==="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c==="isout"){parentInstance.isout=false;parentInstance.isover=true;parentInstance._over.call(parentInstance,event);}});},dragStop:function(draggable,event){draggable.element.parentsUntil("body").off("scroll.droppable");if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}}};if($.uiBackCompat!==false){$.widget("ui.droppable",$.ui.droppable,{options:{hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass);}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass);}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass);}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass);}}});}
var widgetsDroppable=$.ui.droppable;var widgetsProgressbar=$.widget("ui.progressbar",{version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue();this.element.attr({role:"progressbar","aria-valuemin":this.min});this._addClass("ui-progressbar","ui-widget ui-widget-content");this.valueDiv=$("<div>").appendTo(this.element);this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header");this._refreshValue();},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow");this.valueDiv.remove();},value:function(newValue){if(newValue===undefined){return this.options.value;}
this.options.value=this._constrainedValue(newValue);this._refreshValue();},_constrainedValue:function(newValue){if(newValue===undefined){newValue=this.options.value;}
this.indeterminate=newValue===false;if(typeof newValue!=="number"){newValue=0;}
return this.indeterminate?false:Math.min(this.options.max,Math.max(this.min,newValue));},_setOptions:function(options){var value=options.value;delete options.value;this._super(options);this.options.value=this._constrainedValue(value);this._refreshValue();},_setOption:function(key,value){if(key==="max"){value=Math.max(this.min,value);}
this._super(key,value);},_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",value);this._toggleClass(null,"ui-state-disabled",!!value);},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min);},_refreshValue:function(){var value=this.options.value,percentage=this._percentage();this.valueDiv.toggle(this.indeterminate||value>this.min).width(percentage.toFixed(0)+"%");this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,value===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate);if(this.indeterminate){this.element.removeAttr("aria-valuenow");if(!this.overlayDiv){this.overlayDiv=$("<div>").appendTo(this.valueDiv);this._addClass(this.overlayDiv,"ui-progressbar-overlay");}}else{this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":value});if(this.overlayDiv){this.overlayDiv.remove();this.overlayDiv=null;}}
if(this.oldValue!==value){this.oldValue=value;this._trigger("change");}
if(value===this.options.max){this._trigger("complete");}}});var widgetsSelectable=$.widget("ui.selectable",$.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var that=this;this._addClass("ui-selectable");this.dragged=false;this.refresh=function(){that.elementPos=$(that.element[0]).offset();that.selectees=$(that.options.filter,that.element[0]);that._addClass(that.selectees,"ui-selectee");that.selectees.each(function(){var $this=$(this),selecteeOffset=$this.offset(),pos={left:selecteeOffset.left-that.elementPos.left,top:selecteeOffset.top-that.elementPos.top};$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:false,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")});});};this.refresh();this._mouseInit();this.helper=$("<div>");this._addClass(this.helper,"ui-selectable-helper");},_destroy:function(){this.selectees.removeData("selectable-item");this._mouseDestroy();},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY];this.elementPos=$(this.element[0]).offset();if(this.options.disabled){return;}
this.selectees=$(options.filter,this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);this.helper.css({"left":event.pageX,"top":event.pageY,"width":0,"height":0});if(options.autoRefresh){this.refresh();}
this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!event.metaKey&&!event.ctrlKey){that._removeClass(selectee.$element,"ui-selected");selectee.selected=false;that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}});$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");if(selectee){doSelect=(!event.metaKey&&!event.ctrlKey)||!selectee.$element.hasClass("ui-selected");that._removeClass(selectee.$element,doSelect?"ui-unselecting":"ui-selected")._addClass(selectee.$element,doSelect?"ui-selecting":"ui-unselecting");selectee.unselecting=!doSelect;selectee.selecting=doSelect;selectee.selected=doSelect;if(doSelect){that._trigger("selecting",event,{selecting:selectee.element});}else{that._trigger("unselecting",event,{unselecting:selectee.element});}
return false;}});},_mouseDrag:function(event){this.dragged=true;if(this.options.disabled){return;}
var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;if(x1>x2){tmp=x2;x2=x1;x1=tmp;}
if(y1>y2){tmp=y2;y2=y1;y1=tmp;}
this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=false,offset={};if(!selectee||selectee.element===that.element[0]){return;}
offset.left=selectee.left+that.elementPos.left;offset.right=selectee.right+that.elementPos.left;offset.top=selectee.top+that.elementPos.top;offset.bottom=selectee.bottom+that.elementPos.top;if(options.tolerance==="touch"){hit=(!(offset.left>x2||offset.right<x1||offset.top>y2||offset.bottom<y1));}else if(options.tolerance==="fit"){hit=(offset.left>x1&&offset.right<x2&&offset.top>y1&&offset.bottom<y2);}
if(hit){if(selectee.selected){that._removeClass(selectee.$element,"ui-selected");selectee.selected=false;}
if(selectee.unselecting){that._removeClass(selectee.$element,"ui-unselecting");selectee.unselecting=false;}
if(!selectee.selecting){that._addClass(selectee.$element,"ui-selecting");selectee.selecting=true;that._trigger("selecting",event,{selecting:selectee.element});}}else{if(selectee.selecting){if((event.metaKey||event.ctrlKey)&&selectee.startselected){that._removeClass(selectee.$element,"ui-selecting");selectee.selecting=false;that._addClass(selectee.$element,"ui-selected");selectee.selected=true;}else{that._removeClass(selectee.$element,"ui-selecting");selectee.selecting=false;if(selectee.startselected){that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=true;}
that._trigger("unselecting",event,{unselecting:selectee.element});}}
if(selectee.selected){if(!event.metaKey&&!event.ctrlKey&&!selectee.startselected){that._removeClass(selectee.$element,"ui-selected");selectee.selected=false;that._addClass(selectee.$element,"ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}}}});return false;},_mouseStop:function(event){var that=this;this.dragged=false;$(".ui-unselecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(selectee.$element,"ui-unselecting");selectee.unselecting=false;selectee.startselected=false;that._trigger("unselected",event,{unselected:selectee.element});});$(".ui-selecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(selectee.$element,"ui-selecting")._addClass(selectee.$element,"ui-selected");selectee.selecting=false;selectee.selected=true;selectee.startselected=true;that._trigger("selected",event,{selected:selectee.element});});this._trigger("stop",event);this.helper.remove();return false;}});var widgetsSelectmenu=$.widget("ui.selectmenu",[$.ui.formResetMixin,{version:"1.13.2",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:false,change:null,close:null,focus:null,open:null,select:null},_create:function(){var selectmenuId=this.element.uniqueId().attr("id");this.ids={element:selectmenuId,button:selectmenuId+"-button",menu:selectmenuId+"-menu"};this._drawButton();this._drawMenu();this._bindFormResetHandler();this._rendered=false;this.menuItems=$();},_drawButton:function(){var icon,that=this,item=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button);this._on(this.labels,{click:function(event){this.button.trigger("focus");event.preventDefault();}});this.element.hide();this.button=$("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element);this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget");icon=$("<span>").appendTo(this.button);this._addClass(icon,"ui-selectmenu-icon","ui-icon "+this.options.icons.button);this.buttonItem=this._renderButtonItem(item).appendTo(this.button);if(this.options.width!==false){this._resizeButton();}
this._on(this.button,this._buttonEvents);this.button.one("focusin",function(){if(!that._rendered){that._refreshMenu();}});},_drawMenu:function(){var that=this;this.menu=$("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=$("<div>").append(this.menu);this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front");this.menuWrap.appendTo(this._appendTo());this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(event,ui){event.preventDefault();that._setSelection();that._select(ui.item.data("ui-selectmenu-item"),event);},focus:function(event,ui){var item=ui.item.data("ui-selectmenu-item");if(that.focusIndex!=null&&item.index!==that.focusIndex){that._trigger("focus",event,{item:item});if(!that.isOpen){that._select(item,event);}}
that.focusIndex=item.index;that.button.attr("aria-activedescendant",that.menuItems.eq(item.index).attr("id"));}}).menu("instance");this.menuInstance._off(this.menu,"mouseleave");this.menuInstance._closeOnDocumentClick=function(){return false;};this.menuInstance._isDivider=function(){return false;};},refresh:function(){this._refreshMenu();this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{}));if(this.options.width===null){this._resizeButton();}},_refreshMenu:function(){var item,options=this.element.find("option");this.menu.empty();this._parseOptions(options);this._renderMenu(this.menu,this.items);this.menuInstance.refresh();this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper");this._rendered=true;if(!options.length){return;}
item=this._getSelectedItem();this.menuInstance.focus(null,item);this._setAria(item.data("ui-selectmenu-item"));this._setOption("disabled",this.element.prop("disabled"));},open:function(event){if(this.options.disabled){return;}
if(!this._rendered){this._refreshMenu();}else{this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active");this.menuInstance.focus(null,this._getSelectedItem());}
if(!this.menuItems.length){return;}
this.isOpen=true;this._toggleAttr();this._resizeMenu();this._position();this._on(this.document,this._documentClick);this._trigger("open",event);},_position:function(){this.menuWrap.position($.extend({of:this.button},this.options.position));},close:function(event){if(!this.isOpen){return;}
this.isOpen=false;this._toggleAttr();this.range=null;this._off(this.document);this._trigger("close",event);},widget:function(){return this.button;},menuWidget:function(){return this.menu;},_renderButtonItem:function(item){var buttonItem=$("<span>");this._setText(buttonItem,item.label);this._addClass(buttonItem,"ui-selectmenu-text");return buttonItem;},_renderMenu:function(ul,items){var that=this,currentOptgroup="";$.each(items,function(index,item){var li;if(item.optgroup!==currentOptgroup){li=$("<li>",{text:item.optgroup});that._addClass(li,"ui-selectmenu-optgroup","ui-menu-divider"+
(item.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""));li.appendTo(ul);currentOptgroup=item.optgroup;}
that._renderItemData(ul,item);});},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-selectmenu-item",item);},_renderItem:function(ul,item){var li=$("<li>"),wrapper=$("<div>",{title:item.element.attr("title")});if(item.disabled){this._addClass(li,null,"ui-state-disabled");}
this._setText(wrapper,item.label);return li.append(wrapper).appendTo(ul);},_setText:function(element,value){if(value){element.text(value);}else{element.html("&#160;");}},_move:function(direction,event){var item,next,filter=".ui-menu-item";if(this.isOpen){item=this.menuItems.eq(this.focusIndex).parent("li");}else{item=this.menuItems.eq(this.element[0].selectedIndex).parent("li");filter+=":not(.ui-state-disabled)";}
if(direction==="first"||direction==="last"){next=item[direction==="first"?"prevAll":"nextAll"](filter).eq(-1);}else{next=item[direction+"All"](filter).eq(0);}
if(next.length){this.menuInstance.focus(event,next);}},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li");},_toggle:function(event){this[this.isOpen?"close":"open"](event);},_setSelection:function(){var selection;if(!this.range){return;}
if(window.getSelection){selection=window.getSelection();selection.removeAllRanges();selection.addRange(this.range);}else{this.range.select();}
this.button.trigger("focus");},_documentClick:{mousedown:function(event){if(!this.isOpen){return;}
if(!$(event.target).closest(".ui-selectmenu-menu, #"+
$.escapeSelector(this.ids.button)).length){this.close(event);}}},_buttonEvents:{mousedown:function(){var selection;if(window.getSelection){selection=window.getSelection();if(selection.rangeCount){this.range=selection.getRangeAt(0);}}else{this.range=document.selection.createRange();}},click:function(event){this._setSelection();this._toggle(event);},keydown:function(event){var preventDefault=true;switch(event.keyCode){case $.ui.keyCode.TAB:case $.ui.keyCode.ESCAPE:this.close(event);preventDefault=false;break;case $.ui.keyCode.ENTER:if(this.isOpen){this._selectFocusedItem(event);}
break;case $.ui.keyCode.UP:if(event.altKey){this._toggle(event);}else{this._move("prev",event);}
break;case $.ui.keyCode.DOWN:if(event.altKey){this._toggle(event);}else{this._move("next",event);}
break;case $.ui.keyCode.SPACE:if(this.isOpen){this._selectFocusedItem(event);}else{this._toggle(event);}
break;case $.ui.keyCode.LEFT:this._move("prev",event);break;case $.ui.keyCode.RIGHT:this._move("next",event);break;case $.ui.keyCode.HOME:case $.ui.keyCode.PAGE_UP:this._move("first",event);break;case $.ui.keyCode.END:case $.ui.keyCode.PAGE_DOWN:this._move("last",event);break;default:this.menu.trigger(event);preventDefault=false;}
if(preventDefault){event.preventDefault();}}},_selectFocusedItem:function(event){var item=this.menuItems.eq(this.focusIndex).parent("li");if(!item.hasClass("ui-state-disabled")){this._select(item.data("ui-selectmenu-item"),event);}},_select:function(item,event){var oldIndex=this.element[0].selectedIndex;this.element[0].selectedIndex=item.index;this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(item));this._setAria(item);this._trigger("select",event,{item:item});if(item.index!==oldIndex){this._trigger("change",event,{item:item});}
this.close(event);},_setAria:function(item){var id=this.menuItems.eq(item.index).attr("id");this.button.attr({"aria-labelledby":id,"aria-activedescendant":id});this.menu.attr("aria-activedescendant",id);},_setOption:function(key,value){if(key==="icons"){var icon=this.button.find("span.ui-icon");this._removeClass(icon,null,this.options.icons.button)._addClass(icon,null,value.button);}
this._super(key,value);if(key==="appendTo"){this.menuWrap.appendTo(this._appendTo());}
if(key==="width"){this._resizeButton();}},_setOptionDisabled:function(value){this._super(value);this.menuInstance.option("disabled",value);this.button.attr("aria-disabled",value);this._toggleClass(this.button,null,"ui-state-disabled",value);this.element.prop("disabled",value);if(value){this.button.attr("tabindex",-1);this.close();}else{this.button.attr("tabindex",0);}},_appendTo:function(){var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0);}
if(!element||!element[0]){element=this.element.closest(".ui-front, dialog");}
if(!element.length){element=this.document[0].body;}
return element;},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen);this._removeClass(this.button,"ui-selectmenu-button-"+
(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+
(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen);this.menu.attr("aria-hidden",!this.isOpen);},_resizeButton:function(){var width=this.options.width;if(width===false){this.button.css("width","");return;}
if(width===null){width=this.element.show().outerWidth();this.element.hide();}
this.button.outerWidth(width);},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1));},_getCreateOptions:function(){var options=this._super();options.disabled=this.element.prop("disabled");return options;},_parseOptions:function(options){var that=this,data=[];options.each(function(index,item){if(item.hidden){return;}
data.push(that._parseOption($(item),index));});this.items=data;},_parseOption:function(option,index){var optgroup=option.parent("optgroup");return{element:option,index:index,value:option.val(),label:option.text(),optgroup:optgroup.attr("label")||"",disabled:optgroup.prop("disabled")||option.prop("disabled")};},_destroy:function(){this._unbindFormResetHandler();this.menuWrap.remove();this.button.remove();this.element.show();this.element.removeUniqueId();this.labels.attr("for",this.ids.element);}}]);var widgetsSlider=$.widget("ui.slider",$.ui.mouse,{version:"1.13.2",widgetEventPrefix:"slide",options:{animate:false,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content");this._refresh();this._animateOff=false;},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue();},_createHandles:function(){var i,handleCount,options=this.options,existingHandles=this.element.find(".ui-slider-handle"),handle="<span tabindex='0'></span>",handles=[];handleCount=(options.values&&options.values.length)||1;if(existingHandles.length>handleCount){existingHandles.slice(handleCount).remove();existingHandles=existingHandles.slice(0,handleCount);}
for(i=existingHandles.length;i<handleCount;i++){handles.push(handle);}
this.handles=existingHandles.add($(handles.join("")).appendTo(this.element));this._addClass(this.handles,"ui-slider-handle","ui-state-default");this.handle=this.handles.eq(0);this.handles.each(function(i){$(this).data("ui-slider-handle-index",i).attr("tabIndex",0);});},_createRange:function(){var options=this.options;if(options.range){if(options.range===true){if(!options.values){options.values=[this._valueMin(),this._valueMin()];}else if(options.values.length&&options.values.length!==2){options.values=[options.values[0],options.values[0]];}else if(Array.isArray(options.values)){options.values=options.values.slice(0);}}
if(!this.range||!this.range.length){this.range=$("<div>").appendTo(this.element);this._addClass(this.range,"ui-slider-range");}else{this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max");this.range.css({"left":"","bottom":""});}
if(options.range==="min"||options.range==="max"){this._addClass(this.range,"ui-slider-range-"+options.range);}}else{if(this.range){this.range.remove();}
this.range=null;}},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles);},_destroy:function(){this.handles.remove();if(this.range){this.range.remove();}
this._mouseDestroy();},_mouseCapture:function(event){var position,normValue,distance,closestHandle,index,allowed,offset,mouseOverHandle,that=this,o=this.options;if(o.disabled){return false;}
this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:event.pageX,y:event.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;this.handles.each(function(i){var thisDistance=Math.abs(normValue-that.values(i));if((distance>thisDistance)||(distance===thisDistance&&(i===that._lastChangedValue||that.values(i)===o.min))){distance=thisDistance;closestHandle=$(this);index=i;}});allowed=this._start(event,index);if(allowed===false){return false;}
this._mouseSliding=true;this._handleIndex=index;this._addClass(closestHandle,null,"ui-state-active");closestHandle.trigger("focus");offset=closestHandle.offset();mouseOverHandle=!$(event.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top-
(closestHandle.height()/2)-
(parseInt(closestHandle.css("borderTopWidth"),10)||0)-
(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+
(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue);}
this._animateOff=true;return true;},_mouseStart:function(){return true;},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false;},_mouseStop:function(event){this._removeClass(this.handles,null,"ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false;},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal";},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-
(this._clickOffset?this._clickOffset.left:0);}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-
(this._clickOffset?this._clickOffset.top:0);}
percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1){percentMouse=1;}
if(percentMouse<0){percentMouse=0;}
if(this.orientation==="vertical"){percentMouse=1-percentMouse;}
valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse);},_uiHash:function(index,value,values){var uiHash={handle:this.handles[index],handleIndex:index,value:value!==undefined?value:this.value()};if(this._hasMultipleValues()){uiHash.value=value!==undefined?value:this.values(index);uiHash.values=values||this.values();}
return uiHash;},_hasMultipleValues:function(){return this.options.values&&this.options.values.length;},_start:function(event,index){return this._trigger("start",event,this._uiHash(index));},_slide:function(event,index,newVal){var allowed,otherVal,currentValue=this.value(),newValues=this.values();if(this._hasMultipleValues()){otherVal=this.values(index?0:1);currentValue=this.values(index);if(this.options.values.length===2&&this.options.range===true){newVal=index===0?Math.min(otherVal,newVal):Math.max(otherVal,newVal);}
newValues[index]=newVal;}
if(newVal===currentValue){return;}
allowed=this._trigger("slide",event,this._uiHash(index,newVal,newValues));if(allowed===false){return;}
if(this._hasMultipleValues()){this.values(index,newVal);}else{this.value(newVal);}},_stop:function(event,index){this._trigger("stop",event,this._uiHash(index));},_change:function(event,index){if(!this._keySliding&&!this._mouseSliding){this._lastChangedValue=index;this._trigger("change",event,this._uiHash(index));}},value:function(newValue){if(arguments.length){this.options.value=this._trimAlignValue(newValue);this._refreshValue();this._change(null,0);return;}
return this._value();},values:function(index,newValue){var vals,newValues,i;if(arguments.length>1){this.options.values[index]=this._trimAlignValue(newValue);this._refreshValue();this._change(null,index);return;}
if(arguments.length){if(Array.isArray(arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(newValues[i]);this._change(null,i);}
this._refreshValue();}else{if(this._hasMultipleValues()){return this._values(index);}else{return this.value();}}}else{return this._values();}},_setOption:function(key,value){var i,valsLength=0;if(key==="range"&&this.options.range===true){if(value==="min"){this.options.value=this._values(0);this.options.values=null;}else if(value==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null;}}
if(Array.isArray(this.options.values)){valsLength=this.options.values.length;}
this._super(key,value);switch(key){case"orientation":this._detectOrientation();this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation);this._refreshValue();if(this.options.range){this._refreshRange(value);}
this.handles.css(value==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=valsLength-1;i>=0;i--){this._change(null,i);}
this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break;}},_setOptionDisabled:function(value){this._super(value);this._toggleClass(null,"ui-state-disabled",!!value);},_value:function(){var val=this.options.value;val=this._trimAlignValue(val);return val;},_values:function(index){var val,vals,i;if(arguments.length){val=this.options.values[index];val=this._trimAlignValue(val);return val;}else if(this._hasMultipleValues()){vals=this.options.values.slice();for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(vals[i]);}
return vals;}else{return[];}},_trimAlignValue:function(val){if(val<=this._valueMin()){return this._valueMin();}
if(val>=this._valueMax()){return this._valueMax();}
var step=(this.options.step>0)?this.options.step:1,valModStep=(val-this._valueMin())%step,alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=(valModStep>0)?step:(-step);}
return parseFloat(alignValue.toFixed(5));},_calculateNewMax:function(){var max=this.options.max,min=this._valueMin(),step=this.options.step,aboveMin=Math.round((max-min)/step)*step;max=aboveMin+min;if(max>this.options.max){max-=step;}
this.max=parseFloat(max.toFixed(this._precision()));},_precision:function(){var precision=this._precisionOf(this.options.step);if(this.options.min!==null){precision=Math.max(precision,this._precisionOf(this.options.min));}
return precision;},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");return decimal===-1?0:str.length-decimal-1;},_valueMin:function(){return this.options.min;},_valueMax:function(){return this.max;},_refreshRange:function(orientation){if(orientation==="vertical"){this.range.css({"width":"","left":""});}
if(orientation==="horizontal"){this.range.css({"height":"","bottom":""});}},_refreshValue:function(){var lastValPercent,valPercent,value,valueMin,valueMax,oRange=this.options.range,o=this.options,that=this,animate=(!this._animateOff)?o.animate:false,_set={};if(this._hasMultipleValues()){this.handles.each(function(i){valPercent=(that.values(i)-that._valueMin())/(that._valueMax()-
that._valueMin())*100;_set[that.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(that.options.range===true){if(that.orientation==="horizontal"){if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate);}
if(i===1){that.range[animate?"animate":"css"]({width:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate});}}else{if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({bottom:(valPercent)+"%"},o.animate);}
if(i===1){that.range[animate?"animate":"css"]({height:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate});}}}
lastValPercent=valPercent;});}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;_set[this.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate);}
if(oRange==="max"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:(100-valPercent)+"%"},o.animate);}
if(oRange==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate);}
if(oRange==="max"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:(100-valPercent)+"%"},o.animate);}}},_handleEvents:{keydown:function(event){var allowed,curVal,newVal,step,index=$(event.target).data("ui-slider-handle-index");switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:event.preventDefault();if(!this._keySliding){this._keySliding=true;this._addClass($(event.target),null,"ui-state-active");allowed=this._start(event,index);if(allowed===false){return;}}
break;}
step=this.options.step;if(this._hasMultipleValues()){curVal=newVal=this.values(index);}else{curVal=newVal=this.value();}
switch(event.keyCode){case $.ui.keyCode.HOME:newVal=this._valueMin();break;case $.ui.keyCode.END:newVal=this._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=this._trimAlignValue(curVal+((this._valueMax()-this._valueMin())/this.numPages));break;case $.ui.keyCode.PAGE_DOWN:newVal=this._trimAlignValue(curVal-((this._valueMax()-this._valueMin())/this.numPages));break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===this._valueMax()){return;}
newVal=this._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===this._valueMin()){return;}
newVal=this._trimAlignValue(curVal-step);break;}
this._slide(event,index,newVal);},keyup:function(event){var index=$(event.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(event,index);this._change(event,index);this._removeClass($(event.target),null,"ui-state-active");}}}});var widgetsSortable=$.widget("ui.sortable",$.ui.mouse,{version:"1.13.2",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return(x>=reference)&&(x<(reference+size));},_isFloating:function(item){return(/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display"));},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true;},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._setHandleClassName();}},_setHandleClassName:function(){var that=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");$.each(this.items,function(){that._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle");});},_destroy:function(){this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData(this.widgetName+"-item");}
return this;},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=false,that=this;if(this.reverting){return false;}
if(this.options.disabled||this.options.type==="static"){return false;}
this._refreshItems(event);$(event.target).parents().each(function(){if($.data(this,that.widgetName+"-item")===that){currentItem=$(this);return false;}});if($.data(event.target,that.widgetName+"-item")===that){currentItem=$(event.target);}
if(!currentItem){return false;}
if(this.options.handle&&!overrideHandle){$(this.options.handle,currentItem).find("*").addBack().each(function(){if(this===event.target){validHandle=true;}});if(!validHandle){return false;}}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;this.currentContainer=this;this.refreshPositions();this.appendTo=$(o.appendTo!=="parent"?o.appendTo:this.currentItem.parent());this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");if(o.cursorAt){this._adjustOffsetFromHelper(o.cursorAt);}
this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide();}
this._createPlaceholder();this.scrollParent=this.placeholder.scrollParent();$.extend(this.offset,{parent:this._getParentOffset()});if(o.containment){this._setContainment();}
if(o.cursor&&o.cursor!=="auto"){body=this.document.find("body");this.storedCursor=body.css("cursor");body.css("cursor",o.cursor);this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body);}
if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex");}
this.helper.css("zIndex",o.zIndex);}
if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity");}
this.helper.css("opacity",o.opacity);}
if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset();}
this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions();}
if(!noActivation){for(i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,this._uiHash(this));}}
if($.ui.ddmanager){$.ui.ddmanager.current=this;}
if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}
this.dragging=true;this._addClass(this.helper,"ui-sortable-helper");if(!this.helper.parent().is(this.appendTo)){this.helper.detach().appendTo(this.appendTo);this.offset.parent=this._getParentOffset();}
this.position=this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute");this._mouseDrag(event);return true;},_scroll:function(event){var o=this.options,scrolled=false;if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-
event.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;}else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;}
if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-
event.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;}else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(event.pageY-this.document.scrollTop()<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed);}else if(this.window.height()-(event.pageY-this.document.scrollTop())<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed);}
if(event.pageX-this.document.scrollLeft()<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed);}else if(this.window.width()-(event.pageX-this.document.scrollLeft())<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed);}}
return scrolled;},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options;this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px";}
if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px";}
if(o.scroll){if(this._scroll(event)!==false){this._refreshItemPositions(true);if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}}}
this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()};for(i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];intersection=this._intersectsWithPointer(item);if(!intersection){continue;}
if(item.instance!==this.currentContainer){continue;}
if(itemElement!==this.currentItem[0]&&this.placeholder[intersection===1?"next":"prev"]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],itemElement):true)){this.direction=intersection===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;}
this._trigger("change",event,this._uiHash());break;}}
this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);}
this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event){return;}
if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event);}
if(this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};if(!axis||axis==="x"){animation.left=cur.left-this.offset.parent.left-this.margins.left+
(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft);}
if(!axis||axis==="y"){animation.top=cur.top-this.offset.parent.top-this.margins.top+
(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop);}
this.reverting=true;$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event);});}else{this._clear(event,noPropagation);}
return false;},cancel:function(){if(this.dragging){this._mouseUp(new $.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper");}else{this.currentItem.show();}
for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,this._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,this._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0]);}
if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove();}
$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}}
return this;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[\-=_](.+)/));if(res){str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]));}});if(!str.length&&o.key){str.push(o.key+"=");}
return str.join("&");},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"");});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight=(this.options.axis==="x")||((y1+dyClick)>t&&(y1+dyClick)<b),isOverElementWidth=(this.options.axis==="y")||((x1+dxClick)>l&&(x1+dxClick)<r),isOverElement=isOverElementHeight&&isOverElementWidth;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var verticalDirection,horizontalDirection,isOverElementHeight=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth;if(!isOverElement){return false;}
verticalDirection=this.dragDirection.vertical;horizontalDirection=this.dragDirection.horizontal;return this.floating?((horizontalDirection==="right"||verticalDirection==="down")?2:1):(verticalDirection&&(verticalDirection==="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=this._isOverAxis(this.positionAbs.top+
this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=this._isOverAxis(this.positionAbs.left+
this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this.dragDirection.vertical,horizontalDirection=this.dragDirection.horizontal;if(this.floating&&horizontalDirection){return((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!==0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!==0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this._setHandleClassName();this.refreshPositions();return this;},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([typeof inst.options.items==="function"?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);}}}}
queries.push([typeof this.options.items==="function"?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function addItems(){items.push(this);}
for(i=queries.length-1;i>=0;i--){queries[i][0].each(addItems);}
return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++){if(list[j]===item.item[0]){return false;}}
return true;});},_refreshItems:function(event){this.items=[];this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[typeof this.options.items==="function"?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([typeof inst.options.items==="function"?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}}}}
for(i=queries.length-1;i>=0;i--){targetData=queries[i][1];_queries=queries[i][0];for(j=0,queriesLength=_queries.length;j<queriesLength;j++){item=$(_queries[j]);item.data(this.widgetName+"-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});}}},_refreshItemPositions:function(fast){var i,item,t,p;for(i=this.items.length-1;i>=0;i--){item=this.items[i];if(this.currentContainer&&item.instance!==this.currentContainer&&item.item[0]!==this.currentItem[0]){continue;}
t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();}
p=t.offset();item.left=p.left;item.top=p.top;}},refreshPositions:function(fast){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):false;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}
this._refreshItemPositions(fast);var i,p;if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(i=this.containers.length-1;i>=0;i--){p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();}}
return this;},_createPlaceholder:function(that){that=that||this;var className,nodeName,o=that.options;if(!o.placeholder||o.placeholder.constructor===String){className=o.placeholder;nodeName=that.currentItem[0].nodeName.toLowerCase();o.placeholder={element:function(){var element=$("<"+nodeName+">",that.document[0]);that._addClass(element,"ui-sortable-placeholder",className||that.currentItem[0].className)._removeClass(element,"ui-sortable-helper");if(nodeName==="tbody"){that._createTrPlaceholder(that.currentItem.find("tr").eq(0),$("<tr>",that.document[0]).appendTo(element));}else if(nodeName==="tr"){that._createTrPlaceholder(that.currentItem,element);}else if(nodeName==="img"){element.attr("src",that.currentItem.attr("src"));}
if(!className){element.css("visibility","hidden");}
return element;},update:function(container,p){if(className&&!o.forcePlaceholderSize){return;}
if(!p.height()||(o.forcePlaceholderSize&&(nodeName==="tbody"||nodeName==="tr"))){p.height(that.currentItem.innerHeight()-
parseInt(that.currentItem.css("paddingTop")||0,10)-
parseInt(that.currentItem.css("paddingBottom")||0,10));}
if(!p.width()){p.width(that.currentItem.innerWidth()-
parseInt(that.currentItem.css("paddingLeft")||0,10)-
parseInt(that.currentItem.css("paddingRight")||0,10));}}};}
that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem));that.currentItem.after(that.placeholder);o.placeholder.update(that,that.placeholder);},_createTrPlaceholder:function(sourceTr,targetTr){var that=this;sourceTr.children().each(function(){$("<td>&#160;</td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(targetTr);});},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--){if($.contains(this.currentItem[0],this.containers[i].element[0])){continue;}
if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0])){continue;}
innermostContainer=this.containers[i];innermostIndex=i;}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(!innermostContainer){return;}
if(this.containers.length===1){if(!this.containers[innermostIndex].containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}}else{dist=10000;itemWithLeastDistance=null;floating=innermostContainer.floating||this._isFloating(this.currentItem);posProperty=floating?"left":"top";sizeProperty=floating?"width":"height";axis=floating?"pageX":"pageY";for(j=this.items.length-1;j>=0;j--){if(!$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])){continue;}
if(this.items[j].item[0]===this.currentItem[0]){continue;}
cur=this.items[j].item.offset()[posProperty];nearBottom=false;if(event[axis]-cur>this.items[j][sizeProperty]/2){nearBottom=true;}
if(Math.abs(event[axis]-cur)<dist){dist=Math.abs(event[axis]-cur);itemWithLeastDistance=this.items[j];this.direction=nearBottom?"up":"down";}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return;}
if(this.currentContainer===this.containers[innermostIndex]){if(!this.currentContainer.containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash());this.currentContainer.containerCache.over=1;}
return;}
if(itemWithLeastDistance){this._rearrange(event,itemWithLeastDistance,null,true);}else{this._rearrange(event,null,this.containers[innermostIndex].element,true);}
this._trigger("change",event,this._uiHash());this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));this.currentContainer=this.containers[innermostIndex];this.options.placeholder.update(this.currentContainer,this.placeholder);this.scrollParent=this.placeholder.scrollParent();if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset();}
this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}},_createHelper:function(event){var o=this.options,helper=typeof o.helper==="function"?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper==="clone"?this.currentItem.clone():this.currentItem);if(!helper.parents("body").length){this.appendTo[0].appendChild(helper[0]);}
if(helper[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};}
if(!helper[0].style.width||o.forceHelperSize){helper.width(this.currentItem.width());}
if(!helper[0].style.height||o.forceHelperSize){helper.height(this.currentItem.height());}
return helper;},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");}
if(Array.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};}
if("left" in obj){this.offset.click.left=obj.left+this.margins.left;}
if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;}
if("top" in obj){this.offset.click.top=obj.top+this.margins.top;}
if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){po={top:0,left:0};}
return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+
this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+
this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var ce,co,over,o=this.options;if(o.containment==="parent"){o.containment=this.helper[0].parentNode;}
if(o.containment==="document"||o.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,o.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(o.containment==="document"?(this.document.height()||document.body.parentNode.scrollHeight):this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];}
if(!(/^(document|window|parent)$/).test(o.containment)){ce=$(o.containment)[0];co=$(o.containment).offset();over=($(ce).css("overflow")!=="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+
(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+
(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-
(parseInt($(ce).css("borderLeftWidth"),10)||0)-
(parseInt($(ce).css("paddingRight"),10)||0)-
this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-
(parseInt($(ce).css("borderTopWidth"),10)||0)-
(parseInt($(ce).css("paddingBottom"),10)||0)-
this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;}
var mod=d==="absolute"?1:-1,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+
this.offset.relative.top*mod+
this.offset.parent.top*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+
this.offset.relative.left*mod+
this.offset.parent.left*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left;}
if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top;}
if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left;}
if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top;}}
if(o.grid){top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?((top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3])?top:((top-this.offset.click.top>=this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?((left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2])?left:((left-this.offset.click.left>=this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY-
this.offset.click.top-
this.offset.relative.top-
this.offset.parent.top+
((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX-
this.offset.click.left-
this.offset.relative.left-
this.offset.parent.left+
((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){if(a){a[0].appendChild(this.placeholder[0]);}else{i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?i.item[0]:i.item[0].nextSibling));}
this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){if(counter===this.counter){this.refreshPositions(!hardRefresh);}});},_clear:function(event,noPropagation){this.reverting=false;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem);}
this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]="";}}
this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper");}else{this.currentItem.show();}
if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});}
if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});}
if(this!==this.currentContainer){if(!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.currentContainer));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.currentContainer));}}
function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}
for(i=this.containers.length-1;i>=0;i--){if(!noPropagation){delayedTriggers.push(delayEvent("deactivate",this,this.containers[i]));}
if(this.containers[i].containerCache.over){delayedTriggers.push(delayEvent("out",this,this.containers[i]));this.containers[i].containerCache.over=0;}}
if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove();}
if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity);}
if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex);}
this.dragging=false;if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());}
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove();}
this.helper=null;}
if(!noPropagation){for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);}
this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return!this.cancelHelperRemoval;},_trigger:function(){if($.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null};}});function spinnerModifier(fn){return function(){var previous=this.element.val();fn.apply(this,arguments);this._refresh();if(previous!==this.element.val()){this._trigger("change");}};}
$.widget("ui.spinner",{version:"1.13.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:true,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max);this._setOption("min",this.options.min);this._setOption("step",this.options.step);if(this.value()!==""){this._value(this.element.val(),true);}
this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_getCreateOptions:function(){var options=this._super();var element=this.element;$.each(["min","max","step"],function(i,option){var value=element.attr(option);if(value!=null&&value.length){options[option]=value;}});return options;},_events:{keydown:function(event){if(this._start(event)&&this._keydown(event)){event.preventDefault();}},keyup:"_stop",focus:function(){this.previous=this.element.val();},blur:function(event){if(this.cancelBlur){delete this.cancelBlur;return;}
this._stop();this._refresh();if(this.previous!==this.element.val()){this._trigger("change",event);}},mousewheel:function(event,delta){var activeElement=$.ui.safeActiveElement(this.document[0]);var isActive=this.element[0]===activeElement;if(!isActive||!delta){return;}
if(!this.spinning&&!this._start(event)){return false;}
this._spin((delta>0?1:-1)*this.options.step,event);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){if(this.spinning){this._stop(event);}},100);event.preventDefault();},"mousedown .ui-spinner-button":function(event){var previous;previous=this.element[0]===$.ui.safeActiveElement(this.document[0])?this.previous:this.element.val();function checkFocus(){var isActive=this.element[0]===$.ui.safeActiveElement(this.document[0]);if(!isActive){this.element.trigger("focus");this.previous=previous;this._delay(function(){this.previous=previous;});}}
event.preventDefault();checkFocus.call(this);this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;checkFocus.call(this);});if(this._start(event)===false){return;}
this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event);},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(event){if(!$(event.currentTarget).hasClass("ui-state-active")){return;}
if(this._start(event)===false){return false;}
this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event);},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>");},_draw:function(){this._enhance();this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content");this._addClass("ui-spinner-input");this.element.attr("role","spinbutton");this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",true).button({classes:{"ui-button":""}});this._removeClass(this.buttons,"ui-corner-all");this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up");this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down");this.buttons.first().button({"icon":this.options.icons.up,"showLabel":false});this.buttons.last().button({"icon":this.options.icons.down,"showLabel":false});if(this.buttons.height()>Math.ceil(this.uiSpinner.height()*0.5)&&this.uiSpinner.height()>0){this.uiSpinner.height(this.uiSpinner.height());}},_keydown:function(event){var options=this.options,keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.UP:this._repeat(null,1,event);return true;case keyCode.DOWN:this._repeat(null,-1,event);return true;case keyCode.PAGE_UP:this._repeat(null,options.page,event);return true;case keyCode.PAGE_DOWN:this._repeat(null,-options.page,event);return true;}
return false;},_start:function(event){if(!this.spinning&&this._trigger("start",event)===false){return false;}
if(!this.counter){this.counter=1;}
this.spinning=true;return true;},_repeat:function(i,steps,event){i=i||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,steps,event);},i);this._spin(steps*this.options.step,event);},_spin:function(step,event){var value=this.value()||0;if(!this.counter){this.counter=1;}
value=this._adjustValue(value+step*this._increment(this.counter));if(!this.spinning||this._trigger("spin",event,{value:value})!==false){this._value(value);this.counter++;}},_increment:function(i){var incremental=this.options.incremental;if(incremental){return typeof incremental==="function"?incremental(i):Math.floor(i*i*i/50000-i*i/500+17*i/200+1);}
return 1;},_precision:function(){var precision=this._precisionOf(this.options.step);if(this.options.min!==null){precision=Math.max(precision,this._precisionOf(this.options.min));}
return precision;},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");return decimal===-1?0:str.length-decimal-1;},_adjustValue:function(value){var base,aboveMin,options=this.options;base=options.min!==null?options.min:0;aboveMin=value-base;aboveMin=Math.round(aboveMin/options.step)*options.step;value=base+aboveMin;value=parseFloat(value.toFixed(this._precision()));if(options.max!==null&&value>options.max){return options.max;}
if(options.min!==null&&value<options.min){return options.min;}
return value;},_stop:function(event){if(!this.spinning){return;}
clearTimeout(this.timer);clearTimeout(this.mousewheelTimer);this.counter=0;this.spinning=false;this._trigger("stop",event);},_setOption:function(key,value){var prevValue,first,last;if(key==="culture"||key==="numberFormat"){prevValue=this._parse(this.element.val());this.options[key]=value;this.element.val(this._format(prevValue));return;}
if(key==="max"||key==="min"||key==="step"){if(typeof value==="string"){value=this._parse(value);}}
if(key==="icons"){first=this.buttons.first().find(".ui-icon");this._removeClass(first,null,this.options.icons.up);this._addClass(first,null,value.up);last=this.buttons.last().find(".ui-icon");this._removeClass(last,null,this.options.icons.down);this._addClass(last,null,value.down);}
this._super(key,value);},_setOptionDisabled:function(value){this._super(value);this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!value);this.element.prop("disabled",!!value);this.buttons.button(value?"disable":"enable");},_setOptions:spinnerModifier(function(options){this._super(options);}),_parse:function(val){if(typeof val==="string"&&val!==""){val=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(val,10,this.options.culture):+val;}
return val===""||isNaN(val)?null:val;},_format:function(value){if(value===""){return"";}
return window.Globalize&&this.options.numberFormat?Globalize.format(value,this.options.numberFormat,this.options.culture):value;},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())});},isValid:function(){var value=this.value();if(value===null){return false;}
return value===this._adjustValue(value);},_value:function(value,allowAny){var parsed;if(value!==""){parsed=this._parse(value);if(parsed!==null){if(!allowAny){parsed=this._adjustValue(parsed);}
value=this._format(parsed);}}
this.element.val(value);this._refresh();},_destroy:function(){this.element.prop("disabled",false).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow");this.uiSpinner.replaceWith(this.element);},stepUp:spinnerModifier(function(steps){this._stepUp(steps);}),_stepUp:function(steps){if(this._start()){this._spin((steps||1)*this.options.step);this._stop();}},stepDown:spinnerModifier(function(steps){this._stepDown(steps);}),_stepDown:function(steps){if(this._start()){this._spin((steps||1)* -this.options.step);this._stop();}},pageUp:spinnerModifier(function(pages){this._stepUp((pages||1)*this.options.page);}),pageDown:spinnerModifier(function(pages){this._stepDown((pages||1)*this.options.page);}),value:function(newVal){if(!arguments.length){return this._parse(this.element.val());}
spinnerModifier(this._value).call(this,newVal);},widget:function(){return this.uiSpinner;}});if($.uiBackCompat!==false){$.widget("ui.spinner",$.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());},_uiSpinnerHtml:function(){return"<span>";},_buttonHtml:function(){return"<a></a><a></a>";}});}
var widgetsSpinner=$.ui.spinner;$.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(function(){var rhash=/#.*$/;return function(anchor){var anchorUrl,locationUrl;anchorUrl=anchor.href.replace(rhash,"");locationUrl=location.href.replace(rhash,"");try{anchorUrl=decodeURIComponent(anchorUrl);}catch(error){}
try{locationUrl=decodeURIComponent(locationUrl);}catch(error){}
return anchor.hash.length>1&&anchorUrl===locationUrl;};})(),_create:function(){var that=this,options=this.options;this.running=false;this._addClass("ui-tabs","ui-widget ui-widget-content");this._toggleClass("ui-tabs-collapsible",null,options.collapsible);this._processTabs();options.active=this._initialActive();if(Array.isArray(options.disabled)){options.disabled=$.uniqueSort(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"),function(li){return that.tabs.index(li);}))).sort();}
if(this.options.active!==false&&this.anchors.length){this.active=this._findActive(options.active);}else{this.active=$();}
this._refresh();if(this.active.length){this.load(options.active);}},_initialActive:function(){var active=this.options.active,collapsible=this.options.collapsible,locationHash=location.hash.substring(1);if(active===null){if(locationHash){this.tabs.each(function(i,tab){if($(tab).attr("aria-controls")===locationHash){active=i;return false;}});}
if(active===null){active=this.tabs.index(this.tabs.filter(".ui-tabs-active"));}
if(active===null||active===-1){active=this.tabs.length?0:false;}}
if(active!==false){active=this.tabs.index(this.tabs.eq(active));if(active===-1){active=collapsible?false:0;}}
if(!collapsible&&active===false&&this.anchors.length){active=0;}
return active;},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?$():this._getPanelForTab(this.active)};},_tabKeydown:function(event){var focusedTab=$($.ui.safeActiveElement(this.document[0])).closest("li"),selectedIndex=this.tabs.index(focusedTab),goingForward=true;if(this._handlePageNav(event)){return;}
switch(event.keyCode){case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:selectedIndex++;break;case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:goingForward=false;selectedIndex--;break;case $.ui.keyCode.END:selectedIndex=this.anchors.length-1;break;case $.ui.keyCode.HOME:selectedIndex=0;break;case $.ui.keyCode.SPACE:event.preventDefault();clearTimeout(this.activating);this._activate(selectedIndex);return;case $.ui.keyCode.ENTER:event.preventDefault();clearTimeout(this.activating);this._activate(selectedIndex===this.options.active?false:selectedIndex);return;default:return;}
event.preventDefault();clearTimeout(this.activating);selectedIndex=this._focusNextTab(selectedIndex,goingForward);if(!event.ctrlKey&&!event.metaKey){focusedTab.attr("aria-selected","false");this.tabs.eq(selectedIndex).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",selectedIndex);},this.delay);}},_panelKeydown:function(event){if(this._handlePageNav(event)){return;}
if(event.ctrlKey&&event.keyCode===$.ui.keyCode.UP){event.preventDefault();this.active.trigger("focus");}},_handlePageNav:function(event){if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true;}
if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true;}},_findNextTab:function(index,goingForward){var lastTabIndex=this.tabs.length-1;function constrain(){if(index>lastTabIndex){index=0;}
if(index<0){index=lastTabIndex;}
return index;}
while($.inArray(constrain(),this.options.disabled)!==-1){index=goingForward?index+1:index-1;}
return index;},_focusNextTab:function(index,goingForward){index=this._findNextTab(index,goingForward);this.tabs.eq(index).trigger("focus");return index;},_setOption:function(key,value){if(key==="active"){this._activate(value);return;}
this._super(key,value);if(key==="collapsible"){this._toggleClass("ui-tabs-collapsible",null,value);if(!value&&this.options.active===false){this._activate(0);}}
if(key==="event"){this._setupEvents(value);}
if(key==="heightStyle"){this._setupHeightStyle(value);}},_sanitizeSelector:function(hash){return hash?hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):"";},refresh:function(){var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab);});this._processTabs();if(options.active===false||!this.anchors.length){options.active=false;this.active=$();}else if(this.active.length&&!$.contains(this.tablist[0],this.active[0])){if(this.tabs.length===options.disabled.length){options.active=false;this.active=$();}else{this._activate(this._findNextTab(Math.max(0,options.active-1),false));}}else{options.active=this.tabs.index(this.active);}
this._refresh();},_refresh:function(){this._setOptionDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0);}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});this._addClass(this.active,"ui-tabs-active","ui-state-active");this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"});}},_processTabs:function(){var that=this,prevTabs=this.tabs,prevAnchors=this.anchors,prevPanels=this.panels;this.tablist=this._getList().attr("role","tablist");this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header");this.tablist.on("mousedown"+this.eventNamespace,"> li",function(event){if($(this).is(".ui-state-disabled")){event.preventDefault();}}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){if($(this).closest("li").is(".ui-state-disabled")){this.blur();}});this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1});this._addClass(this.tabs,"ui-tabs-tab","ui-state-default");this.anchors=this.tabs.map(function(){return $("a",this)[0];}).attr({tabIndex:-1});this._addClass(this.anchors,"ui-tabs-anchor");this.panels=$();this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr("id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");if(that._isLocal(anchor)){selector=anchor.hash;panelId=selector.substring(1);panel=that.element.find(that._sanitizeSelector(selector));}else{panelId=tab.attr("aria-controls")||$({}).uniqueId()[0].id;selector="#"+panelId;panel=that.element.find(selector);if(!panel.length){panel=that._createPanel(panelId);panel.insertAfter(that.panels[i-1]||that.tablist);}
panel.attr("aria-live","polite");}
if(panel.length){that.panels=that.panels.add(panel);}
if(originalAriaControls){tab.data("ui-tabs-aria-controls",originalAriaControls);}
tab.attr({"aria-controls":panelId,"aria-labelledby":anchorId});panel.attr("aria-labelledby",anchorId);});this.panels.attr("role","tabpanel");this._addClass(this.panels,"ui-tabs-panel","ui-widget-content");if(prevTabs){this._off(prevTabs.not(this.tabs));this._off(prevAnchors.not(this.anchors));this._off(prevPanels.not(this.panels));}},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0);},_createPanel:function(id){return $("<div>").attr("id",id).data("ui-tabs-destroy",true);},_setOptionDisabled:function(disabled){var currentItem,li,i;if(Array.isArray(disabled)){if(!disabled.length){disabled=false;}else if(disabled.length===this.anchors.length){disabled=true;}}
for(i=0;(li=this.tabs[i]);i++){currentItem=$(li);if(disabled===true||$.inArray(i,disabled)!==-1){currentItem.attr("aria-disabled","true");this._addClass(currentItem,null,"ui-state-disabled");}else{currentItem.removeAttr("aria-disabled");this._removeClass(currentItem,null,"ui-state-disabled");}}
this.options.disabled=disabled;this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,disabled===true);},_setupEvents:function(event){var events={};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});}
this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(event){event.preventDefault();}});this._on(this.anchors,events);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs);},_setupHeightStyle:function(heightStyle){var maxHeight,parent=this.element.parent();if(heightStyle==="fill"){maxHeight=parent.height();maxHeight-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;}
maxHeight-=elem.outerHeight(true);});this.element.children().not(this.panels).each(function(){maxHeight-=$(this).outerHeight(true);});this.panels.each(function(){$(this).height(Math.max(0,maxHeight-
$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height());}).height(maxHeight);}},_eventHandler:function(event){var options=this.options,active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():this._getPanelForTab(tab),toHide=!active.length?$():this._getPanelForTab(active),eventData={oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};event.preventDefault();if(tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading")||this.running||(clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;}
options.active=collapsing?false:this.tabs.index(tab);this.active=clickedIsActive?$():tab;if(this.xhr){this.xhr.abort();}
if(!toHide.length&&!toShow.length){$.error("jQuery UI Tabs: Mismatching fragment identifier.");}
if(toShow.length){this.load(this.tabs.index(tab),event);}
this._toggle(event,eventData);},_toggle:function(event,eventData){var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=true;function complete(){that.running=false;that._trigger("activate",event,eventData);}
function show(){that._addClass(eventData.newTab.closest("li"),"ui-tabs-active","ui-state-active");if(toShow.length&&that.options.show){that._show(toShow,that.options.show,complete);}else{toShow.show();complete();}}
if(toHide.length&&this.options.hide){this._hide(toHide,this.options.hide,function(){that._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active");show();});}else{this._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active");toHide.hide();show();}
toHide.attr("aria-hidden","true");eventData.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(toShow.length&&toHide.length){eventData.oldTab.attr("tabIndex",-1);}else if(toShow.length){this.tabs.filter(function(){return $(this).attr("tabIndex")===0;}).attr("tabIndex",-1);}
toShow.attr("aria-hidden","false");eventData.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_activate:function(index){var anchor,active=this._findActive(index);if(active[0]===this.active[0]){return;}
if(!active.length){active=this.active;}
anchor=active.find(".ui-tabs-anchor")[0];this._eventHandler({target:anchor,currentTarget:anchor,preventDefault:$.noop});},_findActive:function(index){return index===false?$():this.tabs.eq(index);},_getIndex:function(index){if(typeof index==="string"){index=this.anchors.index(this.anchors.filter("[href$='"+
$.escapeSelector(index)+"']"));}
return index;},_destroy:function(){if(this.xhr){this.xhr.abort();}
this.tablist.removeAttr("role").off(this.eventNamespace);this.anchors.removeAttr("role tabIndex").removeUniqueId();this.tabs.add(this.panels).each(function(){if($.data(this,"ui-tabs-destroy")){$(this).remove();}else{$(this).removeAttr("role tabIndex "+"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded");}});this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");if(prev){li.attr("aria-controls",prev).removeData("ui-tabs-aria-controls");}else{li.removeAttr("aria-controls");}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","");}},enable:function(index){var disabled=this.options.disabled;if(disabled===false){return;}
if(index===undefined){disabled=false;}else{index=this._getIndex(index);if(Array.isArray(disabled)){disabled=$.map(disabled,function(num){return num!==index?num:null;});}else{disabled=$.map(this.tabs,function(li,num){return num!==index?num:null;});}}
this._setOptionDisabled(disabled);},disable:function(index){var disabled=this.options.disabled;if(disabled===true){return;}
if(index===undefined){disabled=true;}else{index=this._getIndex(index);if($.inArray(index,disabled)!==-1){return;}
if(Array.isArray(disabled)){disabled=$.merge([index],disabled).sort();}else{disabled=[index];}}
this._setOptionDisabled(disabled);},load:function(index,event){index=this._getIndex(index);var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(tab),eventData={tab:tab,panel:panel},complete=function(jqXHR,status){if(status==="abort"){that.panels.stop(false,true);}
that._removeClass(tab,"ui-tabs-loading");panel.removeAttr("aria-busy");if(jqXHR===that.xhr){delete that.xhr;}};if(this._isLocal(anchor[0])){return;}
this.xhr=$.ajax(this._ajaxSettings(anchor,event,eventData));if(this.xhr&&this.xhr.statusText!=="canceled"){this._addClass(tab,"ui-tabs-loading");panel.attr("aria-busy","true");this.xhr.done(function(response,status,jqXHR){setTimeout(function(){panel.html(response);that._trigger("load",event,eventData);complete(jqXHR,status);},1);}).fail(function(jqXHR,status){setTimeout(function(){complete(jqXHR,status);},1);});}},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href").replace(/#.*$/,""),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData));}};},_getPanelForTab:function(tab){var id=$(tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id));}});if($.uiBackCompat!==false){$.widget("ui.tabs",$.ui.tabs,{_processTabs:function(){this._superApply(arguments);this._addClass(this.tabs,"ui-tab");}});}
var widgetsTabs=$.ui.tabs;$.widget("ui.tooltip",{version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var title=$(this).attr("title");return $("<a>").text(title).html();},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,track:false,close:null,open:null},_addDescribedBy:function(elem,id){var describedby=(elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id);elem.data("ui-tooltip-id",id).attr("aria-describedby",String.prototype.trim.call(describedby.join(" ")));},_removeDescribedBy:function(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr("aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);if(index!==-1){describedby.splice(index,1);}
elem.removeData("ui-tooltip-id");describedby=String.prototype.trim.call(describedby.join(" "));if(describedby){elem.attr("aria-describedby",describedby);}else{elem.removeAttr("aria-describedby");}},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};this.liveRegion=$("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this.disabledTitles=$([]);},_setOption:function(key,value){var that=this;this._super(key,value);if(key==="content"){$.each(this.tooltips,function(id,tooltipData){that._updateContent(tooltipData.element);});}},_setOptionDisabled:function(value){this[value?"_disable":"_enable"]();},_disable:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur");event.target=event.currentTarget=tooltipData.element[0];that.close(event,true);});this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var element=$(this);if(element.is("[title]")){return element.data("ui-tooltip-title",element.attr("title")).removeAttr("title");}}));},_enable:function(){this.disabledTitles.each(function(){var element=$(this);if(element.data("ui-tooltip-title")){element.attr("title",element.data("ui-tooltip-title"));}});this.disabledTitles=$([]);},open:function(event){var that=this,target=$(event?event.target:this.element).closest(this.options.items);if(!target.length||target.data("ui-tooltip-id")){return;}
if(target.attr("title")){target.data("ui-tooltip-title",target.attr("title"));}
target.data("ui-tooltip-open",true);if(event&&event.type==="mouseover"){target.parents().each(function(){var parent=$(this),blurEvent;if(parent.data("ui-tooltip-open")){blurEvent=$.Event("blur");blurEvent.target=blurEvent.currentTarget=this;that.close(blurEvent,true);}
if(parent.attr("title")){parent.uniqueId();that.parents[this.id]={element:this,title:parent.attr("title")};parent.attr("title","");}});}
this._registerCloseHandlers(event,target);this._updateContent(target,event);},_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,eventType=event?event.type:null;if(typeof contentOption==="string"||contentOption.nodeType||contentOption.jquery){return this._open(event,target,contentOption);}
content=contentOption.call(target[0],function(response){that._delay(function(){if(!target.data("ui-tooltip-open")){return;}
if(event){event.type=eventType;}
this._open(event,target,response);});});if(content){this._open(event,target,content);}},_open:function(event,target,content){var tooltipData,tooltip,delayedShow,a11yContent,positionOption=$.extend({},this.options.position);if(!content){return;}
tooltipData=this._find(target);if(tooltipData){tooltipData.tooltip.find(".ui-tooltip-content").html(content);return;}
if(target.is("[title]")){if(event&&event.type==="mouseover"){target.attr("title","");}else{target.removeAttr("title");}}
tooltipData=this._tooltip(target);tooltip=tooltipData.tooltip;this._addDescribedBy(target,tooltip.attr("id"));tooltip.find(".ui-tooltip-content").html(content);this.liveRegion.children().hide();a11yContent=$("<div>").html(tooltip.find(".ui-tooltip-content").html());a11yContent.removeAttr("name").find("[name]").removeAttr("name");a11yContent.removeAttr("id").find("[id]").removeAttr("id");a11yContent.appendTo(this.liveRegion);function position(event){positionOption.of=event;if(tooltip.is(":hidden")){return;}
tooltip.position(positionOption);}
if(this.options.track&&event&&/^mouse/.test(event.type)){this._on(this.document,{mousemove:position});position(event);}else{tooltip.position($.extend({of:target},this.options.position));}
tooltip.hide();this._show(tooltip,this.options.show);if(this.options.track&&this.options.show&&this.options.show.delay){delayedShow=this.delayedShow=setInterval(function(){if(tooltip.is(":visible")){position(positionOption.of);clearInterval(delayedShow);}},13);}
this._trigger("open",event,{tooltip:tooltip});},_registerCloseHandlers:function(event,target){var events={keyup:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0];this.close(fakeEvent,true);}}};if(target[0]!==this.element[0]){events.remove=function(){var targetElement=this._find(target);if(targetElement){this._removeTooltip(targetElement.tooltip);}};}
if(!event||event.type==="mouseover"){events.mouseleave="close";}
if(!event||event.type==="focusin"){events.focusout="close";}
this._on(true,target,events);},close:function(event){var tooltip,that=this,target=$(event?event.currentTarget:this.element),tooltipData=this._find(target);if(!tooltipData){target.removeData("ui-tooltip-open");return;}
tooltip=tooltipData.tooltip;if(tooltipData.closing){return;}
clearInterval(this.delayedShow);if(target.data("ui-tooltip-title")&&!target.attr("title")){target.attr("title",target.data("ui-tooltip-title"));}
this._removeDescribedBy(target);tooltipData.hiding=true;tooltip.stop(true);this._hide(tooltip,this.options.hide,function(){that._removeTooltip($(this));});target.removeData("ui-tooltip-open");this._off(target,"mouseleave focusout keyup");if(target[0]!==this.element[0]){this._off(target,"remove");}
this._off(this.document,"mousemove");if(event&&event.type==="mouseleave"){$.each(this.parents,function(id,parent){$(parent.element).attr("title",parent.title);delete that.parents[id];});}
tooltipData.closing=true;this._trigger("close",event,{tooltip:tooltip});if(!tooltipData.hiding){tooltipData.closing=false;}},_tooltip:function(element){var tooltip=$("<div>").attr("role","tooltip"),content=$("<div>").appendTo(tooltip),id=tooltip.uniqueId().attr("id");this._addClass(content,"ui-tooltip-content");this._addClass(tooltip,"ui-tooltip","ui-widget ui-widget-content");tooltip.appendTo(this._appendTo(element));return this.tooltips[id]={element:element,tooltip:tooltip};},_find:function(target){var id=target.data("ui-tooltip-id");return id?this.tooltips[id]:null;},_removeTooltip:function(tooltip){clearInterval(this.delayedShow);tooltip.remove();delete this.tooltips[tooltip.attr("id")];},_appendTo:function(target){var element=target.closest(".ui-front, dialog");if(!element.length){element=this.document[0].body;}
return element;},_destroy:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur"),element=tooltipData.element;event.target=event.currentTarget=element[0];that.close(event,true);$("#"+id).remove();if(element.data("ui-tooltip-title")){if(!element.attr("title")){element.attr("title",element.data("ui-tooltip-title"));}
element.removeData("ui-tooltip-title");}});this.liveRegion.remove();}});if($.uiBackCompat!==false){$.widget("ui.tooltip",$.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var tooltipData=this._superApply(arguments);if(this.options.tooltipClass){tooltipData.tooltip.addClass(this.options.tooltipClass);}
return tooltipData;}});}
var widgetsTooltip=$.ui.tooltip;});;;
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else if(typeof module==="object"&&module.exports){module.exports=factory(require("jquery"));}else{factory(jQuery);}}(function($){$.extend($.fn,{validate:function(options){if(!this.length){if(options&&options.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.");}
return;}
var validator=$.data(this[0],"validator");if(validator){return validator;}
this.attr("novalidate","novalidate");validator=new $.validator(options,this[0]);$.data(this[0],"validator",validator);if(validator.settings.onsubmit){this.on("click.validate",":submit",function(event){validator.submitButton=event.currentTarget;if($(this).hasClass("cancel")){validator.cancelSubmit=true;}
if($(this).attr("formnovalidate")!==undefined){validator.cancelSubmit=true;}});this.on("submit.validate",function(event){if(validator.settings.debug){event.preventDefault();}
function handle(){var hidden,result;if(validator.submitButton&&(validator.settings.submitHandler||validator.formSubmitted)){hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm);}
if(validator.settings.submitHandler&&!validator.settings.debug){result=validator.settings.submitHandler.call(validator,validator.currentForm,event);if(hidden){hidden.remove();}
if(result!==undefined){return result;}
return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){var valid,validator,errorList;if($(this[0]).is("form")){valid=this.validate().form();}else{errorList=[];valid=true;validator=$(this[0].form).validate();this.each(function(){valid=validator.element(this)&&valid;if(!valid){errorList=errorList.concat(validator.errorList);}});validator.errorList=errorList;}
return valid;},rules:function(command,argument){var element=this[0],isContentEditable=typeof this.attr("contenteditable")!=="undefined"&&this.attr("contenteditable")!=="false",settings,staticRules,existingRules,data,param,filtered;if(element==null){return;}
if(!element.form&&isContentEditable){element.form=this.closest("form")[0];element.name=this.attr("name");}
if(element.form==null){return;}
if(command){settings=$.data(element.form,"validator").settings;staticRules=settings.rules;existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));delete existingRules.messages;staticRules[element.name]=existingRules;if(argument.messages){settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);}
break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
data=$.validator.normalizeRules($.extend({},$.validator.classRules(element),$.validator.attributeRules(element),$.validator.dataRules(element),$.validator.staticRules(element)),element);if(data.required){param=data.required;delete data.required;data=$.extend({required:param},data);}
if(data.remote){param=data.remote;delete data.remote;data=$.extend(data,{remote:param});}
return data;}});var trim=function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");};$.extend($.expr.pseudos||$.expr[":"],{blank:function(a){return!trim(""+$(a).val());},filled:function(a){var val=$(a).val();return val!==null&&!!trim(""+val);},unchecked:function(a){return!$(a).prop("checked");}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length===1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};}
if(params===undefined){return source;}
if(arguments.length>2&&params.constructor!==Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!==Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),function(){return n;});});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:false,focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);}
this.hideThese(this.errorsFor(element));}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element,event){var excludedKeys=[16,17,18,20,35,36,37,38,39,40,45,144,225];if(event.which===9&&this.elementValue(element)===""||$.inArray(event.keyCode,excludedKeys)!==-1){return;}else if(element.name in this.submitted||element.name in this.invalid){this.element(element);}},onclick:function(element){if(element.name in this.submitted){this.element(element);}else if(element.parentNode.name in this.submitted){this.element(element.parentNode);}},highlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).addClass(errorClass).removeClass(validClass);}else{$(element).addClass(errorClass).removeClass(validClass);}},unhighlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).removeClass(errorClass).addClass(validClass);}else{$(element).removeClass(errorClass).addClass(validClass);}}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}."),step:$.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var currentForm=this.currentForm,groups=(this.groups={}),rules;$.each(this.settings.groups,function(key,value){if(typeof value==="string"){value=value.split(/\s/);}
$.each(value,function(index,name){groups[name]=key;});});rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var isContentEditable=typeof $(this).attr("contenteditable")!=="undefined"&&$(this).attr("contenteditable")!=="false";if(!this.form&&isContentEditable){this.form=$(this).closest("form")[0];this.name=$(this).attr("name");}
if(currentForm!==this.form){return;}
var validator=$.data(this.form,"validator"),eventType="on"+event.type.replace(/^validate/,""),settings=validator.settings;if(settings[eventType]&&!$(this).is(settings.ignore)){settings[eventType].call(validator,this,event);}}
$(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], "+"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], "+"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], "+"[type='radio'], [type='checkbox'], [contenteditable], [type='button']",delegate).on("click.validate","select, option, [type='radio'], [type='checkbox']",delegate);if(this.settings.invalidHandler){$(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler);}},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()){$(this.currentForm).triggerHandler("invalid-form",[this]);}
this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){var cleanElement=this.clean(element),checkElement=this.validationTargetFor(cleanElement),v=this,result=true,rs,group;if(checkElement===undefined){delete this.invalid[cleanElement.name];}else{this.prepareElement(checkElement);this.currentElements=$(checkElement);group=this.groups[checkElement.name];if(group){$.each(this.groups,function(name,testgroup){if(testgroup===group&&name!==checkElement.name){cleanElement=v.validationTargetFor(v.clean(v.findByName(name)));if(cleanElement&&cleanElement.name in v.invalid){v.currentElements.push(cleanElement);result=v.check(cleanElement)&&result;}}});}
rs=this.check(checkElement)!==false;result=result&&rs;if(rs){this.invalid[checkElement.name]=false;}else{this.invalid[checkElement.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();$(element).attr("aria-invalid",!rs);}
return result;},showErrors:function(errors){if(errors){var validator=this;$.extend(this.errorMap,errors);this.errorList=$.map(this.errorMap,function(message,name){return{message:message,element:validator.findByName(name)[0]};});this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList);}else{this.defaultShowErrors();}},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm();}
this.invalid={};this.submitted={};this.prepareForm();this.hideErrors();var elements=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(elements);},resetElements:function(elements){var i;if(this.settings.unhighlight){for(i=0;elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,"");this.findByName(elements[i].name).removeClass(this.settings.validClass);}}else{elements.removeClass(this.settings.errorClass).removeClass(this.settings.validClass);}},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0,i;for(i in obj){if(obj[i]!==undefined&&obj[i]!==null&&obj[i]!==false){count++;}}
return count;},hideErrors:function(){this.hideThese(this.toHide);},hideThese:function(errors){errors.not(this.containers).text("");this.addWrapper(errors).hide();},valid:function(){return this.size()===0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name===lastActive.name;}).length===1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var name=this.name||$(this).attr("name");var isContentEditable=typeof $(this).attr("contenteditable")!=="undefined"&&$(this).attr("contenteditable")!=="false";if(!name&&validator.settings.debug&&window.console){console.error("%o has no name assigned",this);}
if(isContentEditable){this.form=$(this).closest("form")[0];this.name=name;}
if(this.form!==validator.currentForm){return false;}
if(name in rulesCache||!validator.objectLength($(this).rules())){return false;}
rulesCache[name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){var errorClass=this.settings.errorClass.split(" ").join(".");return $(this.settings.errorElement+"."+errorClass,this.errorContext);},resetInternals:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);},reset:function(){this.resetInternals();this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},elementValue:function(element){var $element=$(element),type=element.type,isContentEditable=typeof $element.attr("contenteditable")!=="undefined"&&$element.attr("contenteditable")!=="false",val,idx;if(type==="radio"||type==="checkbox"){return this.findByName(element.name).filter(":checked").val();}else if(type==="number"&&typeof element.validity!=="undefined"){return element.validity.badInput?"NaN":$element.val();}
if(isContentEditable){val=$element.text();}else{val=$element.val();}
if(type==="file"){if(val.substr(0,12)==="C:\\fakepath\\"){return val.substr(12);}
idx=val.lastIndexOf("/");if(idx>=0){return val.substr(idx+1);}
idx=val.lastIndexOf("\\");if(idx>=0){return val.substr(idx+1);}
return val;}
if(typeof val==="string"){return val.replace(/\r/g,"");}
return val;},check:function(element){element=this.validationTargetFor(this.clean(element));var rules=$(element).rules(),rulesCount=$.map(rules,function(n,i){return i;}).length,dependencyMismatch=false,val=this.elementValue(element),result,method,rule,normalizer;this.abortRequest(element);if(typeof rules.normalizer==="function"){normalizer=rules.normalizer;}else if(typeof this.settings.normalizer==="function"){normalizer=this.settings.normalizer;}
if(normalizer){val=normalizer.call(element,val);delete rules.normalizer;}
for(method in rules){rule={method:method,parameters:rules[method]};try{result=$.validator.methods[method].call(this,val,element,rule.parameters);if(result==="dependency-mismatch"&&rulesCount===1){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result==="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method.",e);}
if(e instanceof TypeError){e.message+=".  Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method.";}
throw e;}}
if(dependencyMismatch){return;}
if(this.objectLength(rules)){this.successList.push(element);}
return true;},customDataMessage:function(element,method){return $(element).data("msg"+method.charAt(0).toUpperCase()+
method.substring(1).toLowerCase())||$(element).data("msg");},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined){return arguments[i];}}
return undefined;},defaultMessage:function(element,rule){if(typeof rule==="string"){rule={method:rule};}
var message=this.findDefined(this.customMessage(element.name,rule.method),this.customDataMessage(element,rule.method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[rule.method],"<strong>Warning: No message defined for "+element.name+"</strong>"),theregex=/\$?\{(\d+)\}/g;if(typeof message==="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters);}
return message;},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule);this.errorList.push({message:message,element:element,method:rule.method});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));}
return toToggle;},defaultShowErrors:function(){var i,elements,error;for(i=0;this.errorList[i];i++){error=this.errorList[i];if(this.settings.highlight){this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);}
this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var place,group,errorID,v,error=this.errorsFor(element),elementID=this.idOrName(element),describedBy=$(element).attr("aria-describedby");if(error.length){error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);if(this.settings&&this.settings.escapeHtml){error.text(message||"");}else{error.html(message||"");}}else{error=$("<"+this.settings.errorElement+">").attr("id",elementID+"-error").addClass(this.settings.errorClass);if(this.settings&&this.settings.escapeHtml){error.text(message||"");}else{error.html(message||"");}
place=error;if(this.settings.wrapper){place=error.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(this.labelContainer.length){this.labelContainer.append(place);}else if(this.settings.errorPlacement){this.settings.errorPlacement.call(this,place,$(element));}else{place.insertAfter(element);}
if(error.is("label")){error.attr("for",elementID);}else if(error.parents("label[for='"+this.escapeCssMeta(elementID)+"']").length===0){errorID=error.attr("id");if(!describedBy){describedBy=errorID;}else if(!describedBy.match(new RegExp("\\b"+this.escapeCssMeta(errorID)+"\\b"))){describedBy+=" "+errorID;}
$(element).attr("aria-describedby",describedBy);group=this.groups[element.name];if(group){v=this;$.each(v.groups,function(name,testgroup){if(testgroup===group){$("[name='"+v.escapeCssMeta(name)+"']",v.currentForm).attr("aria-describedby",error.attr("id"));}});}}}
if(!message&&this.settings.success){error.text("");if(typeof this.settings.success==="string"){error.addClass(this.settings.success);}else{this.settings.success(error,element);}}
this.toShow=this.toShow.add(error);},errorsFor:function(element){var name=this.escapeCssMeta(this.idOrName(element)),describer=$(element).attr("aria-describedby"),selector="label[for='"+name+"'], label[for='"+name+"'] *";if(describer){selector=selector+", #"+this.escapeCssMeta(describer).replace(/\s+/g,", #");}
return this.errors().filter(selector);},escapeCssMeta:function(string){if(string===undefined){return"";}
return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},validationTargetFor:function(element){if(this.checkable(element)){element=this.findByName(element.name);}
return $(element).not(this.settings.ignore)[0];},checkable:function(element){return(/radio|checkbox/i).test(element.type);},findByName:function(name){return $(this.currentForm).find("[name='"+this.escapeCssMeta(name)+"']");},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length;}}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch";},elementAjaxPort:function(element){return"validate"+element.name;},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;$(element).addClass(this.settings.pendingClass);this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0;}
delete this.pending[element.name];$(element).removeClass(this.settings.pendingClass);if(valid&&this.pendingRequest===0&&this.formSubmitted&&this.form()&&this.pendingRequest===0){$(this.currentForm).trigger("submit");if(this.submitButton){$("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove();}
this.formSubmitted=false;}else if(!valid&&this.pendingRequest===0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},abortRequest:function(element){var port;if(this.pending[element.name]){port=this.elementAjaxPort(element);$.ajaxAbort(port);this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0;}
delete this.pending[element.name];$(element).removeClass(this.settings.pendingClass);}},previousValue:function(element,method){method=typeof method==="string"&&method||"remote";return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,{method:method})});},destroy:function(){this.resetForm();$(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur");}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},number:{number:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){if(className.constructor===String){this.classRuleSettings[className]=rules;}else{$.extend(this.classRuleSettings,className);}},classRules:function(element){var rules={},classes=$(element).attr("class");if(classes){$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});}
return rules;},normalizeAttributeRule:function(rules,type,method,value){if(/min|max|step/.test(method)&&(type===null||/number|range|text/.test(type))){value=Number(value);if(isNaN(value)){value=undefined;}}
if(value||value===0){rules[method]=value;}else if(type===method&&type!=="range"){rules[type==="date"?"dateISO":method]=true;}},attributeRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){if(method==="required"){value=element.getAttribute(method);if(value===""){value=true;}
value=!!value;}else{value=$element.attr(method);}
this.normalizeAttributeRule(rules,type,method,value);}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},dataRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){value=$element.data("rule"+method.charAt(0).toUpperCase()+method.substring(1).toLowerCase());if(value===""){value=true;}
this.normalizeAttributeRule(rules,type,method,value);}
return rules;},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{$.data(element.form,"validator").resetElements($(element));delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=typeof parameter==="function"&&rule!=="normalizer"?parameter(element):parameter;});$.each(["minlength","maxlength"],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(["rangelength","range"],function(){var parts;if(rules[this]){if(Array.isArray(rules[this])){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}else if(typeof rules[this]==="string"){parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/);rules[this]=[Number(parts[0]),Number(parts[1])];}}});if($.validator.autoCreateRanges){if(rules.min!=null&&rules.max!=null){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength!=null&&rules.maxlength!=null){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
return rules;},normalizeRule:function(data){if(typeof data==="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!==undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element)){return"dependency-mismatch";}
if(element.nodeName.toLowerCase()==="select"){var val=$(element).val();return val&&val.length>0;}
if(this.checkable(element)){return this.getLength(value,element)>0;}
return value!==undefined&&value!==null&&value.length>0;},email:function(value,element){return this.optional(element)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);},url:function(value,element){return this.optional(element)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);},date:(function(){var called=false;return function(value,element){if(!called){called=true;if(this.settings.debug&&window.console){console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\n"+"Please don't use it, since it relies on the Date constructor, which\n"+"behaves very differently across browsers and locales. Use `dateISO`\n"+"instead or one of the locale specific methods in `localizations/`\n"+"and `additional-methods.js`.");}}
return this.optional(element)||!/Invalid|NaN/.test(new Date(value).toString());};}()),dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);},number:function(value,element){return this.optional(element)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},minlength:function(value,element,param){var length=Array.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length>=param;},maxlength:function(value,element,param){var length=Array.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length<=param;},rangelength:function(value,element,param){var length=Array.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},step:function(value,element,param){var type=$(element).attr("type"),errorMessage="Step attribute on input type "+type+" is not supported.",supportedTypes=["text","number","range"],re=new RegExp("\\b"+type+"\\b"),notSupported=type&&!re.test(supportedTypes.join()),decimalPlaces=function(num){var match=(""+num).match(/(?:\.(\d+))?$/);if(!match){return 0;}
return match[1]?match[1].length:0;},toInt=function(num){return Math.round(num*Math.pow(10,decimals));},valid=true,decimals;if(notSupported){throw new Error(errorMessage);}
decimals=decimalPlaces(param);if(decimalPlaces(value)>decimals||toInt(value)%toInt(param)!==0){valid=false;}
return this.optional(element)||valid;},equalTo:function(value,element,param){var target=$(param);if(this.settings.onfocusout&&target.not(".validate-equalTo-blur").length){target.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){$(element).valid();});}
return value===target.val();},remote:function(value,element,param,method){if(this.optional(element)){return"dependency-mismatch";}
method=typeof method==="string"&&method||"remote";var previous=this.previousValue(element,method),validator,data,optionDataString;if(!this.settings.messages[element.name]){this.settings.messages[element.name]={};}
previous.originalMessage=previous.originalMessage||this.settings.messages[element.name][method];this.settings.messages[element.name][method]=previous.message;param=typeof param==="string"&&{url:param}||param;optionDataString=$.param($.extend({data:value},param.data));if(previous.old===optionDataString){return previous.valid;}
previous.old=optionDataString;validator=this;this.startRequest(element);data={};data[element.name]=value;$.ajax($.extend(true,{mode:"abort",port:this.elementAjaxPort(element),dataType:"json",data:data,context:validator.currentForm,success:function(response){var valid=response===true||response==="true",errors,message,submitted;validator.settings.messages[element.name][method]=previous.originalMessage;if(valid){submitted=validator.formSubmitted;validator.toHide=validator.errorsFor(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.invalid[element.name]=false;validator.showErrors();}else{errors={};message=response||validator.defaultMessage(element,{method:method,parameters:value});errors[element.name]=previous.message=message;validator.invalid[element.name]=true;validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}}});var pendingRequests={},ajax;if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;if(settings.mode==="abort"){$.ajaxAbort(port);pendingRequests[port]=xhr;}});}else{ajax=$.ajax;$.ajax=function(settings){var mode=("mode" in settings?settings:$.ajaxSettings).mode,port=("port" in settings?settings:$.ajaxSettings).port;if(mode==="abort"){$.ajaxAbort(port);pendingRequests[port]=ajax.apply(this,arguments);return pendingRequests[port];}
return ajax.apply(this,arguments);};}
$.ajaxAbort=function(port){if(pendingRequests[port]){pendingRequests[port].abort();delete pendingRequests[port];}};return $;}));;;
(function(factory){if(typeof define==='function'&&define.amd){define("jquery.validate.unobtrusive",['jquery-validation'],factory);}else if(typeof module==='object'&&module.exports){module.exports=factory(require('jquery-validation'));}else{jQuery.validator.unobtrusive=factory(jQuery);}}(function($){var $jQval=$.validator,adapters,data_validation="unobtrusiveValidation";function setValidationValues(options,ruleName,value){options.rules[ruleName]=value;if(options.message){options.messages[ruleName]=options.message;}}
function splitAndTrim(value){return value.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g);}
function escapeAttributeValue(value){return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1");}
function getModelPrefix(fieldName){return fieldName.substr(0,fieldName.lastIndexOf(".")+1);}
function appendModelPrefix(value,prefix){if(value.indexOf("*.")===0){value=value.replace("*.",prefix);}
return value;}
function onError(error,inputElement){var container=$(this).find("[data-valmsg-for='"+escapeAttributeValue(inputElement[0].name)+"']"),replaceAttrValue=container.attr("data-valmsg-replace"),replace=replaceAttrValue?$.parseJSON(replaceAttrValue)!==false:null;container.removeClass("field-validation-valid").addClass("field-validation-error");error.data("unobtrusiveContainer",container);if(replace){container.empty();error.removeClass("input-validation-error").appendTo(container);}
else{error.hide();}}
function onErrors(event,validator){var container=$(this).find("[data-valmsg-summary=true]"),list=container.find("ul");if(list&&list.length&&validator.errorList.length){list.empty();container.addClass("validation-summary-errors").removeClass("validation-summary-valid");$.each(validator.errorList,function(){$("<li />").html(this.message).appendTo(list);});}}
function onSuccess(error){var container=error.data("unobtrusiveContainer");if(container){var replaceAttrValue=container.attr("data-valmsg-replace"),replace=replaceAttrValue?$.parseJSON(replaceAttrValue):null;container.addClass("field-validation-valid").removeClass("field-validation-error");error.removeData("unobtrusiveContainer");if(replace){container.empty();}}}
function onReset(event){var $form=$(this),key='__jquery_unobtrusive_validation_form_reset';if($form.data(key)){return;}
$form.data(key,true);try{$form.data("validator").resetForm();}finally{$form.removeData(key);}
$form.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");$form.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer");}
function validationInfo(form){var $form=$(form),result=$form.data(data_validation),onResetProxy=$.proxy(onReset,form),defaultOptions=$jQval.unobtrusive.options||{},execInContext=function(name,args){var func=defaultOptions[name];func&&$.isFunction(func)&&func.apply(form,args);};if(!result){result={options:{errorClass:defaultOptions.errorClass||"input-validation-error",errorElement:defaultOptions.errorElement||"span",errorPlacement:function(){onError.apply(form,arguments);execInContext("errorPlacement",arguments);},invalidHandler:function(){onErrors.apply(form,arguments);execInContext("invalidHandler",arguments);},messages:{},rules:{},success:function(){onSuccess.apply(form,arguments);execInContext("success",arguments);}},attachValidation:function(){$form.off("reset."+data_validation,onResetProxy).on("reset."+data_validation,onResetProxy).validate(this.options);},validate:function(){$form.validate();return $form.valid();}};$form.data(data_validation,result);}
return result;}
$jQval.unobtrusive={adapters:[],parseElement:function(element,skipAttach){var $element=$(element),form=$element.parents("form")[0],valInfo,rules,messages;if(!form){return;}
valInfo=validationInfo(form);valInfo.options.rules[element.name]=rules={};valInfo.options.messages[element.name]=messages={};$.each(this.adapters,function(){var prefix="data-val-"+this.name,message=$element.attr(prefix),paramValues={};if(message!==undefined){prefix+="-";$.each(this.params,function(){paramValues[this]=$element.attr(prefix+this);});this.adapt({element:element,form:form,message:message,params:paramValues,rules:rules,messages:messages});}});$.extend(rules,{"__dummy__":true});if(!skipAttach){valInfo.attachValidation();}},parse:function(selector){var $selector=$(selector),$forms=$selector.parents().addBack().filter("form").add($selector.find("form")).has("[data-val=true]");$selector.find("[data-val=true]").each(function(){$jQval.unobtrusive.parseElement(this,true);});$forms.each(function(){var info=validationInfo(this);if(info){info.attachValidation();}});}};adapters=$jQval.unobtrusive.adapters;adapters.add=function(adapterName,params,fn){if(!fn){fn=params;params=[];}
this.push({name:adapterName,params:params,adapt:fn});return this;};adapters.addBool=function(adapterName,ruleName){return this.add(adapterName,function(options){setValidationValues(options,ruleName||adapterName,true);});};adapters.addMinMax=function(adapterName,minRuleName,maxRuleName,minMaxRuleName,minAttribute,maxAttribute){return this.add(adapterName,[minAttribute||"min",maxAttribute||"max"],function(options){var min=options.params.min,max=options.params.max;if(min&&max){setValidationValues(options,minMaxRuleName,[min,max]);}
else if(min){setValidationValues(options,minRuleName,min);}
else if(max){setValidationValues(options,maxRuleName,max);}});};adapters.addSingleVal=function(adapterName,attribute,ruleName){return this.add(adapterName,[attribute||"val"],function(options){setValidationValues(options,ruleName||adapterName,options.params[attribute]);});};$jQval.addMethod("__dummy__",function(value,element,params){return true;});$jQval.addMethod("regex",function(value,element,params){var match;if(this.optional(element)){return true;}
match=new RegExp(params).exec(value);return(match&&(match.index===0)&&(match[0].length===value.length));});$jQval.addMethod("nonalphamin",function(value,element,nonalphamin){var match;if(nonalphamin){match=value.match(/\W/g);match=match&&match.length>=nonalphamin;}
return match;});if($jQval.methods.extension){adapters.addSingleVal("accept","mimtype");adapters.addSingleVal("extension","extension");}else{adapters.addSingleVal("extension","extension","accept");}
adapters.addSingleVal("regex","pattern");adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");adapters.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");adapters.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength");adapters.add("equalto",["other"],function(options){var prefix=getModelPrefix(options.element.name),other=options.params.other,fullOtherName=appendModelPrefix(other,prefix),element=$(options.form).find(":input").filter("[name='"+escapeAttributeValue(fullOtherName)+"']")[0];setValidationValues(options,"equalTo",element);});adapters.add("required",function(options){if(options.element.tagName.toUpperCase()!=="INPUT"||options.element.type.toUpperCase()!=="CHECKBOX"){setValidationValues(options,"required",true);}});adapters.add("remote",["url","type","additionalfields"],function(options){var value={url:options.params.url,type:options.params.type||"GET",data:{}},prefix=getModelPrefix(options.element.name);$.each(splitAndTrim(options.params.additionalfields||options.element.name),function(i,fieldName){var paramName=appendModelPrefix(fieldName,prefix);value.data[paramName]=function(){var field=$(options.form).find(":input").filter("[name='"+escapeAttributeValue(paramName)+"']");if(field.is(":checkbox")){return field.filter(":checked").val()||field.filter(":hidden").val()||'';}
else if(field.is(":radio")){return field.filter(":checked").val()||'';}
return field.val();};});setValidationValues(options,"remote",value);});adapters.add("password",["min","nonalphamin","regex"],function(options){if(options.params.min){setValidationValues(options,"minlength",options.params.min);}
if(options.params.nonalphamin){setValidationValues(options,"nonalphamin",options.params.nonalphamin);}
if(options.params.regex){setValidationValues(options,"regex",options.params.regex);}});adapters.add("fileextensions",["extensions"],function(options){setValidationValues(options,"extension",options.params.extensions);});$(function(){$jQval.unobtrusive.parse(document);});return $jQval.unobtrusive;}));;;
(function(){"use strict";window.ng=window.ng||{};window.ng.util=window.ng.util||{};ng.util.getCookie=function(cookieName){var name=cookieName+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)===" ")c=c.substring(1);if(c.indexOf(name)===0)return c.substring(name.length,c.length);}
return"";}
ng.util.setCookie=function(cookieName,cookieValue,expiryInHours,path,domain,sameSite){sameSite=sameSite||"lax";var cookieString=cookieName+"="+cookieValue;if(expiryInHours){var d=new Date();d.setTime(d.getTime()+expiryInHours*60*60*1000);cookieString+=";expires="+d.toUTCString();}
if(path){cookieString+=";path="+path;}
if(domain){cookieString+=";domain="+domain;}
if(sameSite){cookieString+=";samesite="+sameSite;}
document.cookie=cookieString;}
ng.util.getUrlParam=function(paramName){"use strict";var values=[];if(window.location&&typeof window.location.href==="string"){var src=window.location.href;var re=new RegExp("[\?&]"+paramName+"=([^&#]*)","g");var result;while((result=re.exec(src))!==null){values.push(decodeURIComponent(result[1].replace(/\+/g," ")));}}
if(values.length===0){return null;}else if(values.length===1){return values[0];}else{return values;}}
ng.util.setUrlParam=function(url,name,value){"use strict";if(typeof url!=="string"||typeof name!=="string"||typeof value!="string")return url;var parts,anchor,parameters;parts=url.split("#");if(parts.length===2){anchor=parts[1];}
parts=parts[0].split("?");if(parts.length===2){parameters=parts[1];}
parameters=parameters?parameters+"&"+name+"="+encodeURIComponent(value):name+"="+encodeURIComponent(value);url=parts[0]+(parameters?"?"+parameters:"")+(anchor?"#"+anchor:"");return url;}
ng.util.addOrUpdateUrlParam=function(url,pName,pValue){"use strict";if(typeof url!=="string"||typeof pName!=="string")return url;var parts,anchor,parameters;parts=url.split("#");if(parts.length===2){anchor=parts[1];}
parts=parts[0].split("?");if(parts.length===2){parameters=parts[1];}
pValue=encodeURIComponent(pValue);if(parameters!==undefined&&parameters!==''){var foundParamName=0;var obj=parameters.split('&');let i=0;for(;i<obj.length;i++){if(obj[i].startsWith(pName+'=')){let pair=obj[i].split('=');pair[1]=pValue;obj[i]=pair.join('=');foundParamName=1;break;}}
if(foundParamName===0){obj.push(pName+'='+pValue);}
parameters=obj.join('&');}
else{parameters=pName+'='+pValue;}
url=parts[0]+(parameters?"?"+parameters:"")+(anchor?"#"+anchor:"");return url;};ng.util.urlContains=function(str){return window.location&&window.location.href.toLowerCase().indexOf(str.toLowerCase())>-1;}
ng.util.urlMatches=function(re){return window.location&&re.test(window.location.href);}
ng.util.trapFocusOn=function($container,$firstItem,$lastItem){var firstFocusableElem=$firstItem[0];var lastFocusableElem=$lastItem[0];var KEYCODE_TAB=9;ng.util.trapFocusOff($container);$container.on("keydown.trapFocus",function(e){if(e.keyCode===KEYCODE_TAB){if(e.shiftKey){if(document.activeElement===firstFocusableElem){lastFocusableElem.focus();e.preventDefault();}}else{if(document.activeElement===lastFocusableElem){firstFocusableElem.focus();e.preventDefault();}}}});}
ng.util.trapFocusOff=function($container){$container.off("keydown.trapFocus");}
ng.util.addModalKeyboardInteraction=function(modal,closeCallback){var KEYCODE_TAB=9;var KEYCODE_ESC=27;modal.on("keydown.modal",function(e){if(e.keyCode===KEYCODE_TAB){var tabbable=getTabbable(modal);var firstTabbable=tabbable.first();var lastTabbable=tabbable.last();if(e.shiftKey){if(document.activeElement===firstTabbable[0]){lastTabbable.trigger("focus");e.preventDefault();}}else{if(document.activeElement===lastTabbable[0]){firstTabbable.trigger("focus");e.preventDefault();}}}
else if(e.keyCode===KEYCODE_ESC){closeCallback(modal);}});return getTabbable(modal);}
function getFocusable(container){var selector="input:visible:not(:disabled), select:visible:not(:disabled), textarea:visible:not(:disabled), button:visible:not(:disabled), object:visible:not(:disabled), a[href]:visible, area[href]:visible, *[tabindex]:visible";return $(selector,container);}
function getTabbable(container){var focusable=getFocusable(container);return focusable.filter(function(idx,ele){return ele.tabIndex>=0;});}
ng.util.getTabbable=getTabbable;ng.util.sessionSet=function(key,value){try{sessionStorage.setItem(key,JSON.stringify(value));return true;}catch(err){console.log(err);return false;}}
ng.util.sessionGet=function(key){try{return JSON.parse(sessionStorage.getItem(key));}catch(err){console.log(err);return null;}}
ng.util.sessionRemove=function(key){try{sessionStorage.removeItem(key);return true;}catch(err){console.log(err);return false;}}})();;;
(function(){"use strict";window.ng=window.ng||{};window.ng.ui=window.ng.ui||{};ng.ui.ShowPageLoadingOverlay=function(){$('.page-loading-overlay').show();setTimeout(function(){let txt=$('.page-loading-overlay .h2').html();$('.page-loading-overlay .h2').html('<span role="status">'+txt+'</span>');},100);};ng.ui.HidePageLoadingOverlay=function(){$('.page-loading-overlay').hide();};ng.ui.openImageViewer=function(config){const outerId="overlay";const innerId="overlayImage";const $container=$(config.container);const $opener=$(config.opener);$container.append("<div id='"+outerId+"'><div id='"+innerId+"' tabindex='0'></div></div>");const windowHeight=$(window).height();if(windowHeight){$("#"+outerId).height(windowHeight);}
const overlayConfig={"ngtvLayout":outerId,"id":innerId,"closeId":outerId,"window":{"showManifestUrl":false},"windows":[{"manifestId":config.manifest,"size":"full","canvasIndex":config.index}],"workspace":{"compareModeAvailable":config.compareModeAvailable}};document.addEventListener('tv-opened',viewerOpened);document.addEventListener('tv-closing',viewerClosing);const{TheViewer}=TheViewerLib;TheViewer.TheViewer(overlayConfig);function viewerOpened(){const viewerContainer=$("#"+innerId);viewerContainer[0].focus({preventScroll:true});}
function viewerClosing(){$opener[0].focus({preventScroll:true});document.removeEventListener('tv-opened',viewerOpened);document.removeEventListener('tv-closing',viewerClosing);}};})();;;
function attachPopup(popup){"use strict";var matchingLinks=[];if(popup.matchUrl){matchingLinks=$("a").filter(function(){return $(this).attr("href")&&$(this).attr("href").toLowerCase().indexOf(popup.matchUrl.toLowerCase())>=0;});}
if(matchingLinks.length>0){var cookieName=popup.id;loadPopup(popup,cookieName);matchingLinks.on("click",function(){$(this).addClass(popup.id+"-opener");return!showPopup(popup,cookieName,$(this));});}}
function loadPopup(popup,cookieName){"use strict";var setTheCookie=false;var popupID=popup.id;if($("#"+popupID).length===0){$.get("/custom/popups/membership/popup.html?v=20191107",function(popupHtml){$(popupHtml).attr("id",popupID).appendTo("body");var $popup=$("#"+popupID);$(".title",$popup).html(popup.title).attr("id",popupID+"-title");$(".subtitle",$popup).text(popup.subtitle);$(".popup",$popup).attr("aria-labelledby",popupID+"-title");if(popup.button1Text){$(".btp-membership-button",$popup).text(popup.button1Text);$(".btp-membership-button",$popup).attr("href",popup.button1Url);}else{$(".btp-membership-button",$popup).hide();}
if(popup.button2Text){$(".btp-tickets-button",$popup).text(popup.button2Text);$(".btp-tickets-button",$popup).attr("href",popup.button2Url);}else{$(".btp-tickets-button",$popup).hide();}
$(".btp-membership-button",$popup).attr("data-btpid",popupID);$(".btp-tickets-button",$popup).attr("data-btpid",popupID);$(".btp-close-button",$popup).attr("data-btpid",popupID);var imageStyles="<style>#"+popupID+" .popup .image {background-image: url("+popup.mobileImage+");} @media (min-width: 992px) {#"+popupID+" .popup .image {background-image: url("+popup.desktopImage+");}}</style>";$(imageStyles).appendTo("head");if(setTheCookie){ng.util.setCookie(cookieName,"1",0,"/");}
$(".popup-screen, .btp-close-button",$popup).on("click",function(){hidePopup($popup);});$(".button a",$popup).on("click",function(){hidePopup($popup);if(setTheCookie){ng.util.setCookie(cookieName,"1",0,"/");}
return true;});});}}
function showPopup(popup,cookieName,$clickedLink){"use strict";var checkTheCookie=false;var showSpeed=400;if(checkTheCookie&&ng.util.getCookie(cookieName)==="1"){return false;}
var popupID=popup.id;var $popup=$("#"+popupID);if($popup.length===0){return false;}else{var isSignedIn=ng.util.getCookie("ngSessUid")>0;var isMember=ng.util.getCookie("ngSessMember").length>0;if(isSignedIn&&isMember){var memberUrl=popup.button1Url;var pattern=/\/account\/login\?returnurl=/i;if(pattern.test(memberUrl)){memberUrl=memberUrl.replace(pattern,"");memberUrl=decodeURIComponent(memberUrl);}
$clickedLink.attr("href",memberUrl).attr("target","_blank");return false;}
if(isSignedIn&&!isMember){$clickedLink.attr("target","_blank");return false;}
$popup.addClass("visible").fadeIn(showSpeed,function(){$(".btn",$popup).filter(":visible").first().trigger("focus");});ng.util.addModalKeyboardInteraction($popup,hidePopup);if(!popup.button2Url){var originalUrl=$clickedLink.attr("href");$(".btp-tickets-button",$popup).attr("href",originalUrl);}
return true;}}
function hidePopup($popup){"use strict";var popupID=$popup.attr("id");if($popup.length>0){$popup.hide().removeClass("visible");}
$("."+popupID+"-opener").trigger("focus").removeClass(popupID+"-opener");}
$(window).on("load",function(){"use strict";setTimeout(function(){if(window.location&&window.location.hash){const fragmentID=window.location.hash.substring(1);if(fragmentID.indexOf("=")>-1){return;}
if($("#"+fragmentID).hasClass('for-collapse')){if(!$("#"+fragmentID+'-content').hasClass('show')){$("#"+fragmentID+'-content').collapse('show');}}
const $destination=$("#"+fragmentID);if($destination.length>0){const $readMore=$destination.closest(".read-more-overflow");if($readMore.length>0){$readMore.readMore("remove");}}
const extraFixedTop=$(".extra-fixed-top").outerHeight(true);scrollToFragment(fragmentID,extraFixedTop);}},25);});$("a[href^='#']").on("click.shared",function(e){"use strict";if($(this).parents(".modal").length>0){return;}
e.preventDefault();var fragmentID=this.hash.substring(1);window.location.hash=fragmentID;scrollToFragment(fragmentID);});function scrollToFragment(fragmentId,extraFixedTop){"use strict";extraFixedTop=extraFixedTop||0;if(fragmentId){if($(".top-bar").length>0)
extraFixedTop+=$(".top-bar").outerHeight(true);if($(".secondary-menu-bar").length>0)
extraFixedTop+=$(".secondary-menu-bar").outerHeight(true);if(fragmentId==="top"){$(document).scrollTop(0);$("#top").trigger("blur");}else{var fragment=$("#"+fragmentId+", a[name='"+fragmentId+"']").first();if(fragment.length>0){var newScrollTop=fragment.offset().top-extraFixedTop-10;$(document).scrollTop(newScrollTop);}}}}
$(function(){"use strict";window.addEventListener("resize",resizeThrottler,false);var wWidth=window.innerWidth;var wHeight=window.innerHeight;var resizeTimeout;function resizeThrottler(){if(!resizeTimeout){resizeTimeout=setTimeout(function(){resizeTimeout=null;let wChange=(wWidth-window.innerWidth)!=0;let hChange=(wHeight-window.innerHeight)!=0;wWidth=window.innerWidth;wHeight=window.innerHeight;actualResizeHandler(wChange,hChange);},67);}}
function actualResizeHandler(widthChange,heightChange){if(typeof adjustTopBar==="function")adjustTopBar();if(typeof adjustAudioPlayerPosition==="function")adjustAudioPlayerPosition();if(typeof adjustCatalogueEntryLayout==="function")adjustCatalogueEntryLayout();if(heightChange){if(typeof adjustPaintingCanvasSize==="function")adjustPaintingCanvasSize();}
if(widthChange){if(typeof resetCardSliders==="function")resetCardSliders();if(typeof resetPageSliderElementals==="function")resetPageSliderElementals();if(typeof resetCardSliderElementals==="function")resetCardSliderElementals();if(typeof adjustSecondaryMenu==="function")adjustSecondaryMenu();if(typeof adjustBrowseEventsPanel==="function")adjustBrowseEventsPanel();if(typeof adjustEventListingFilter==="function")adjustEventListingFilter();if(typeof adjustExhibitionVenues==="function")adjustExhibitionVenues();if(typeof adjustTablists==="function")adjustTablists();if(typeof updateCarouselElementals==="function")updateCarouselElementals();if(typeof adjustVideoPlayer==="function")adjustVideoPlayer();}}});$(function(){"use strict";if(window.innerWidth&&window.innerWidth<1200){$(".read-more:visible").readMore();}});(function($){$.fn.readMore=function(action,showReadLess){const defaultMaxHeight=500;const minHeight=120;const tolerance=200;return this.each(function(){let block=$(this);if(action==="remove"){remove(block,showReadLess);}else{add(block,showReadLess);}
function add(block,showReadLess){let maxHeight=parseInt(block.data("maxHeight"));if(isNaN(maxHeight)){maxHeight=defaultMaxHeight;}
block.addClass("read-more");let currentHeight=block.outerHeight();if(currentHeight>maxHeight+tolerance){let topMargin=parseInt(block.css("marginTop"));let bottomMargin=parseInt(block.css("marginBottom"));if(isNaN(topMargin)){topMargin=0;}
if(isNaN(bottomMargin)){bottomMargin=0;}
let newHeight=maxHeight-topMargin-bottomMargin;if(newHeight>=minHeight){block.addClass("read-more-overflow");block.outerHeight(newHeight);block.append("<div class='read-more-fade'></div><div class='read-more-popover more'><button>Read more</button></div>");block.find(".read-more-popover.more button").on("click",function(){remove(block,showReadLess);});}}}
function remove(block,showReadLess){if(block.length>0&&block.hasClass("read-more-overflow")){block.removeClass("read-more-overflow");block.outerHeight("auto");block.find(".read-more-fade, .read-more-popover").remove();if(showReadLess===true){block.addClass("read-more-overflow");block.append("<div class='read-more-popover less'><button>Read less</button></div>");block.find(".read-more-popover.less button").on("click",function(){$(this).parent().remove();add(block,showReadLess);block[0].scrollIntoView(false);});}}}});};}(jQuery));$(function(){"use strict";var urlParamName="promo";var cookieName="ngPromo";var tnewHostLive="my.nationalgallery.org.uk";var tnewHostTest="nglo-tnew-test.tnhs.cloud";var promo;promo=ng.util.getUrlParam(urlParamName);if(promo){ng.util.setCookie(cookieName,promo,7*24,"/");}
promo=ng.util.getCookie(cookieName);if(promo){$("a[href]").each(function(){var href=$(this).attr("href");if(href&&(href.indexOf(tnewHostLive)>-1||href.indexOf(tnewHostTest)>-1)){href=ng.util.setUrlParam(href,urlParamName,promo);$(this).attr("href",href);}});if(typeof btPopup!=="undefined"&&btPopup.MembershipLink){btPopup.MembershipLink=ng.util.setUrlParam(btPopup.MembershipLink,urlParamName,promo);}}});(function($){$.validator.unobtrusive.adapters.add("regexwithoptions",["pattern","flags"],function(options){options.messages['regexwithoptions']=options.message;options.rules['regexwithoptions']=options.params;});$.validator.addMethod("regexwithoptions",function(value,element,params){var match;if(this.optional(element)){return true;}
var reg=new RegExp(params.pattern,params.flags);match=reg.exec(value);return(match&&(match.index===0)&&(match[0].length===value.length));});})(jQuery);$(function(){$(".umbraco-forms-form .umbraco-forms-indicator").attr("aria-label","(required)");$(".umbraco-forms-form .field-validation-valid").attr("role","alert");});;;
(function(){"use strict";if($("#CybotCookiebotDialog").length){CookiebotOnDialogDisplay();}else{window.addEventListener("CookiebotOnDialogDisplay",function(e){window.setTimeout(function(){CookiebotOnDialogDisplay();},250);},false);}
window.addEventListener("CookiebotOnConsentReady",function(e){CookiebotOnDialogHide();},false);$(".cookiebot-renew").on("click",function(){if(typeof Cookiebot!=="undefined"){Cookiebot.renew();}});function CookiebotOnDialogDisplay(){$("#CybotCookiebotDialog").before("<div id='CookiebotDialogScreen'></div>");$("body").addClass("modal-open");$("#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll").trigger("focus");}
function CookiebotOnDialogHide(){$("#CookiebotDialogScreen").remove();$("body").removeClass("modal-open");}})();;;
window.adjustTopBar=function(){"use strict";var maxHeight=100;var menuPadding=0;var menus=$(".top-bar .menu .content");var searchFormPadding=0;var searchForm=$(".top-bar .search-form .content");if($(window).width()<992){var menu1=menus.first();if(menu1.length>0){menuPadding=parseInt(menu1.css("padding-top"),10)+parseInt(menu1.css("padding-bottom"),10);}
if(searchForm.length>0){searchFormPadding=parseInt(searchForm.css("padding-top"),10)+parseInt(searchForm.css("padding-bottom"),10);searchForm.height($(window).height()-$(".top-bar .icons").height()-searchFormPadding);}
maxHeight=$(window).height()-$(".top-bar .icons").height()-menuPadding;menus.height(maxHeight);}else{if(searchForm.length>0){searchForm.height("");}
menus.each(function(){maxHeight=Math.max(maxHeight,$(this).height());});menus.height(maxHeight);}}
$(function(){"use strict";var DEBUG=false;var DEBUG_SIGN_IN=false;adjustTopBar();disableTabAccessToMenuAndSearch();if($(".secondary-menu-bar").length>0){$(".top-bar").addClass("with-secondary-menu-bar");}
var isLive=document&&document.location&&document.location.hostname&&document.location.hostname.indexOf('nationalgallery.org.uk')>-1;if(isLive){if($('[data-session-state="RequireTessSession"]').length>0){ensureTessSession();}}
var retryGetSessionState=5;if(isLive||DEBUG){manageSessionInfo();}
$("#TopBarMenuButton").on("click",function(){var button=$(this);var menu=$(".top-bar .menu.level-1");if(!button.hasClass("open")){openMenuDialog(button,menu);}else{closeMenuDialog();}});$(".top-bar .menu-opener").on("click",function(){var button=$(this);var menuId=button.data("open");var menu=$(".top-bar").find("#"+menuId);openSubMenu(button,menu);});$(".top-bar .menu-heading").on("click",function(){var button=$(this);var menu=button.closest(".menu");closeSubMenu(button,menu);});$("#TopBarSearchButton1").on("click",function(){var button=$(this);var searchForm=$(".top-bar .search-form");if(!button.hasClass("open")){openSearchDialog(button,searchForm);}else{closeSearchDialog();}});$(".top-bar .search-form .close-button").on("click",function(){closeSearchDialog();});$('.top-bar .sign-in .dropdown-toggle').on("click",function(){closeSearchDialog();closeMenuDialog();});$(document).on("click",function(e){if($(e.target).closest(".top-bar").length===0){closeSearchDialog();closeMenuDialog();}});function openMenuDialog(trigger,menu){if(menu.hasClass("open")){return;}
closeSearchDialog();addMainOverlay();trigger.addClass("open").attr("aria-expanded","true");showMenu(menu);enableTabAccess($(".top-bar .menu .level-1-content"));$("a, button",menu).filter(":visible").first().trigger("focus");var $firstItem=$("#TopBarMenuButton").first();var $lastItem=$("a, button",".top-bar .menu .level-1-content").last();ng.util.trapFocusOn($(".top-bar"),$firstItem,$lastItem);menu.on("keydown",function(e){var KEYCODE_ESC=27;if(e.keyCode===KEYCODE_ESC){closeMenuDialog();}});$("button",menu).filter(":visible").on("blur",function(){var button=$(this);if(button.attr("aria-expanded")==="true"){var menuId=button.data("open");var menu=$(".top-bar").find("#"+menuId);$("a, button",menu).filter(":visible").first().trigger("focus");}});$("a, button",menu).filter(":visible").last().on("blur",function(){trigger.trigger("focus");});}
function closeMenuDialog(){var menuDialog=$(".top-bar .menu.level-1");if(!menuDialog.hasClass("open")){return;}
hideMenu(menuDialog);menuDialog.find(".menu-item-wrapper").removeClass("active").removeClass("inactive");var menuButton=$("#TopBarMenuButton");menuButton.removeClass("open").attr("aria-expanded","false");var levelTwoMenus=$(".top-bar .menu.level-2");hideMenu(levelTwoMenus);removeMainOverlay();disableTabAccessToMenuAndSearch();ng.util.trapFocusOff($(".top-bar"));menuButton.trigger("focus");}
function openSubMenu(trigger,menu){if(menu.hasClass("open")){return;}
trigger.attr("aria-expanded","true");var menus=$(".top-bar .menu.level-2");menus.removeClass("open");showMenu(menu);enableTabAccess(menu);var menuItems=$(".top-bar .menu.level-1 .menu-item-wrapper");menuItems.removeClass("active");menuItems.addClass("inactive");trigger.parent().removeClass("inactive");trigger.parent().addClass("active");if($(window).width()<992){disableTabAccess($(".top-bar .menu .level-1-content"));}
$("a, button",menu).filter(":visible").first().trigger("focus");$("a, button",menu).filter(":visible").last().on("blur",function(){let nextTopLevelClickable=trigger.parent().next().find("a, button");if(nextTopLevelClickable){nextTopLevelClickable.trigger("focus");}});var $firstItem=$("#TopBarMenuButton").first();var $lastItem=$("a, button",menu).last();ng.util.trapFocusOn($(".top-bar"),$firstItem,$lastItem);}
function closeSubMenu(trigger,menu){if(!menu.hasClass("open")){return;}
trigger.attr("aria-expanded","false");hideMenu(menu);disableTabAccess(menu);var menuItems=$(".top-bar .menu.level-1 .menu-item-wrapper");var activeMenuItem=menuItems.filter(".active").first();menuItems.removeClass("active").removeClass("inactive");if($(window).width()<992){enableTabAccess($(".top-bar .menu .level-1-content"));}
activeMenuItem.find("a, button").filter(":visible").first().trigger("focus");var $firstItem=$("#TopBarMenuButton").first();var $lastItem=$("a, button",".top-bar .menu .level-1-content").last();ng.util.trapFocusOn($(".top-bar"),$firstItem,$lastItem);}
function showMenu(menu){var properties;if(window.matchMedia("(min-width: 992px)").matches){menu.css({left:""});properties={top:$(".top-bar").height()};}else{menu.css({top:""});properties={left:0}}
menu.css({visibility:"visible"}).animate(properties,300,function(){$(this).attr("aria-hidden","false").addClass("open");});}
function hideMenu(menu){var properties;if(window.matchMedia("(min-width: 992px)").matches){menu.css({left:""});properties={top:"-100%"};}else{menu.css({top:""});properties={left:"-100%"}}
menu.animate(properties,300,function(){$(this).css({visibility:""}).attr("aria-hidden","true").removeClass("open");});}
function openSearchDialog(trigger,searchDialog){if(searchDialog.hasClass("open")){return;}
closeMenuDialog();addMainOverlay();trigger.addClass("open").attr("aria-expanded","true");searchDialog.addClass("open").attr("aria-hidden","false");enableTabAccessToSearch();var textBox=searchDialog.find(".textbox");textBox.prop("autocomplete","off").trigger("focus").prop("autocomplete","on");var $firstItem=$("#TopBarMenuButton").first();var $lastItem=searchDialog.find(".submit-button");ng.util.trapFocusOn($(".top-bar"),$firstItem,$lastItem);searchDialog.on("keydown",function(e){var KEYCODE_ESC=27;if(e.keyCode===KEYCODE_ESC){closeSearchDialog();}});}
function closeSearchDialog(){var searchDialog=$(".top-bar .search-form");if(!searchDialog.hasClass("open")){return;}
searchDialog.removeClass("open").attr("aria-hidden","true");var searchButton=$("#TopBarSearchButton1");searchButton.removeClass("open").attr("aria-expanded","false");removeMainOverlay();disableTabAccessToMenuAndSearch();ng.util.trapFocusOff($(".top-bar"));searchButton.trigger("focus");}
function addMainOverlay(){$(".main").addClass("main-overlay");$(".main, footer").attr("aria-hidden","true");}
function removeMainOverlay(){$(".main").removeClass("main-overlay");$(".main, footer").removeAttr("aria-hidden");}
function disableTabAccessToMenuAndSearch(){disableTabAccess($(".top-bar .menu, .top-bar .search-form"));}
function enableTabAccessToSearch(){enableTabAccess($(".top-bar .search-form"));}
function disableTabAccess($container){$container.find("a, button, input").attr("tabindex","-1");}
function enableTabAccess($container){$container.find("a, button, input").removeAttr("tabindex");}
function ensureTessSession(){var request=new XMLHttpRequest();request.withCredentials=true;request.overrideMimeType("application/json");request.open("GET",tNewApiSessionUrl,true);request.send(null);}
function manageSessionInfo(){getSessionState();setInterval(getSessionState,10000);}
function getSessionState(){if(DEBUG){if(DEBUG_SIGN_IN){updateSessionData('JG',1,'M',4000000);return;}else{updateSessionData('',0,'',0);return;}}
var sessionSharingOn=ng.util.getCookie(sSharingCookieName);if(sessionSharingOn==="Y"){if(retryGetSessionState>0){$.ajax({url:'/umbraco/Surface/Session/GetSessionState',cache:false,type:"GET",success:function(data){if(data===null){updateSessionData('',0,'',0);retryGetSessionState=retryGetSessionState-1;}else{var isAuth=data["isAuthenticated"]===true;var initials=isAuth?data["initials"]:"";var uid=data["constituentId"]!==undefined?+(data["constituentId"]):0;var memStatus=isAuth?data["membershipStatus"]:"";var itemsInBasket=data["numberOfItemsInCart"]!==undefined?+(data["numberOfItemsInCart"]):0;updateSessionData(initials,itemsInBasket,memStatus,uid);retryGetSessionState=0;}},error:function(){updateSessionData('',0,'',0);retryGetSessionState=retryGetSessionState-1;}});}}
else{updateSessionData('',0,'',0);}}
function updateSessionData(userInitials,itemsInBasket,membershipStatus,uid){ng.util.setCookie(sDataInitials,userInitials,0,"/");ng.util.setCookie(sDataBasketCount,itemsInBasket,0,"/");ng.util.setCookie(sDataMembershipStatus,membershipStatus,0,"/");ng.util.setCookie(sDataUserId,uid,0,"/");adjustViewForSession(userInitials,itemsInBasket);}
function adjustViewForSession(userInitials,itemsInBasket){$('.sessionUserInitials').html(userInitials);if(userInitials===''){$('.top-bar .authenticated-user').hide();$('.top-bar .anonymous-user').show();}
else{$('.top-bar .anonymous-user').hide();$('.top-bar .authenticated-user').show();}
if(itemsInBasket>0){$('.sessionUserBasketState').show();$('.sessionUserBasketItemsCount').show();}
else{$('.sessionUserBasketState').hide();$('.sessionUserBasketItemsCount').hide();}
var accountStatusText="";if(userInitials===""){accountStatusText+="You are not signed in.";}else{accountStatusText+="You are signed in.";}
if(itemsInBasket>0){accountStatusText+=" You have "+itemsInBasket+" item"+(itemsInBasket>1?"s":"")+" in your basket.";}
$(".top-bar #AccountStatusText").html(accountStatusText);}});;;
;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports!=='undefined'){module.exports=factory(require('jquery'));}else{factory(jQuery);}}(function($){'use strict';var Slick=window.Slick||{};Slick=(function(){var instanceUid=0;function Slick(element,settings){var _=this,dataSettings;_.defaults={accessibility:true,adaptiveHeight:false,appendArrows:$(element),appendDots:$(element),arrows:true,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:false,autoplaySpeed:3000,centerMode:false,centerPadding:'50px',cssEase:'ease',customPaging:function(slider,i){return $('<button type="button" />').text(i+1);},dots:false,dotsClass:'slick-dots',draggable:true,easing:'linear',edgeFriction:0.35,fade:false,focusOnSelect:false,focusOnChange:false,infinite:true,initialSlide:0,lazyLoad:'ondemand',mobileFirst:false,pauseOnHover:true,pauseOnFocus:true,pauseOnDotsHover:false,respondTo:'window',responsive:null,rows:1,rtl:false,slide:'',slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:true,swipeToSlide:false,touchMove:true,touchThreshold:5,useCSS:true,useTransform:true,variableWidth:false,vertical:false,verticalSwiping:false,waitForAnimate:true,zIndex:1000};_.initials={animating:false,dragging:false,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:false,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:false,slideOffset:0,swipeLeft:null,swiping:false,$list:null,touchObject:{},transformsEnabled:false,unslicked:false};$.extend(_,_.initials);_.activeBreakpoint=null;_.animType=null;_.animProp=null;_.breakpoints=[];_.breakpointSettings=[];_.cssTransitions=false;_.focussed=false;_.interrupted=false;_.hidden='hidden';_.paused=true;_.positionProp=null;_.respondTo=null;_.rowCount=1;_.shouldClick=true;_.$slider=$(element);_.$slidesCache=null;_.transformType=null;_.transitionType=null;_.visibilityChange='visibilitychange';_.windowWidth=0;_.windowTimer=null;dataSettings=$(element).data('slick')||{};_.options=$.extend({},_.defaults,settings,dataSettings);_.currentSlide=_.options.initialSlide;_.originalSettings=_.options;if(typeof document.mozHidden!=='undefined'){_.hidden='mozHidden';_.visibilityChange='mozvisibilitychange';}else if(typeof document.webkitHidden!=='undefined'){_.hidden='webkitHidden';_.visibilityChange='webkitvisibilitychange';}
_.autoPlay=$.proxy(_.autoPlay,_);_.autoPlayClear=$.proxy(_.autoPlayClear,_);_.autoPlayIterator=$.proxy(_.autoPlayIterator,_);_.changeSlide=$.proxy(_.changeSlide,_);_.clickHandler=$.proxy(_.clickHandler,_);_.selectHandler=$.proxy(_.selectHandler,_);_.setPosition=$.proxy(_.setPosition,_);_.swipeHandler=$.proxy(_.swipeHandler,_);_.dragHandler=$.proxy(_.dragHandler,_);_.keyHandler=$.proxy(_.keyHandler,_);_.instanceUid=instanceUid++;_.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;_.registerBreakpoints();_.init(true);}
return Slick;}());Slick.prototype.activateADA=function(){var _=this;_.$slideTrack.find('.slick-active').attr({'aria-hidden':'false'}).find('a, input, button, select').attr({'tabindex':'0'});};Slick.prototype.addSlide=Slick.prototype.slickAdd=function(markup,index,addBefore){var _=this;if(typeof(index)==='boolean'){addBefore=index;index=null;}else if(index<0||(index>=_.slideCount)){return false;}
_.unload();if(typeof(index)==='number'){if(index===0&&_.$slides.length===0){$(markup).appendTo(_.$slideTrack);}else if(addBefore){$(markup).insertBefore(_.$slides.eq(index));}else{$(markup).insertAfter(_.$slides.eq(index));}}else{if(addBefore===true){$(markup).prependTo(_.$slideTrack);}else{$(markup).appendTo(_.$slideTrack);}}
_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slides.each(function(index,element){$(element).attr('data-slick-index',index);});_.$slidesCache=_.$slides;_.reinit();};Slick.prototype.animateHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.animate({height:targetHeight},_.options.speed);}};Slick.prototype.animateSlide=function(targetLeft,callback){var animProps={},_=this;_.animateHeight();if(_.options.rtl===true&&_.options.vertical===false){targetLeft=-targetLeft;}
if(_.transformsEnabled===false){if(_.options.vertical===false){_.$slideTrack.animate({left:targetLeft},_.options.speed,_.options.easing,callback);}else{_.$slideTrack.animate({top:targetLeft},_.options.speed,_.options.easing,callback);}}else{if(_.cssTransitions===false){if(_.options.rtl===true){_.currentLeft=-(_.currentLeft);}
$({animStart:_.currentLeft}).animate({animStart:targetLeft},{duration:_.options.speed,easing:_.options.easing,step:function(now){now=Math.ceil(now);if(_.options.vertical===false){animProps[_.animType]='translate('+
now+'px, 0px)';_.$slideTrack.css(animProps);}else{animProps[_.animType]='translate(0px,'+
now+'px)';_.$slideTrack.css(animProps);}},complete:function(){if(callback){callback.call();}}});}else{_.applyTransition();targetLeft=Math.ceil(targetLeft);if(_.options.vertical===false){animProps[_.animType]='translate3d('+targetLeft+'px, 0px, 0px)';}else{animProps[_.animType]='translate3d(0px,'+targetLeft+'px, 0px)';}
_.$slideTrack.css(animProps);if(callback){setTimeout(function(){_.disableTransition();callback.call();},_.options.speed);}}}};Slick.prototype.getNavTarget=function(){var _=this,asNavFor=_.options.asNavFor;if(asNavFor&&asNavFor!==null){asNavFor=$(asNavFor).not(_.$slider);}
return asNavFor;};Slick.prototype.asNavFor=function(index){var _=this,asNavFor=_.getNavTarget();if(asNavFor!==null&&typeof asNavFor==='object'){asNavFor.each(function(){var target=$(this).slick('getSlick');if(!target.unslicked){target.slideHandler(index,true);}});}};Slick.prototype.applyTransition=function(slide){var _=this,transition={};if(_.options.fade===false){transition[_.transitionType]=_.transformType+' '+_.options.speed+'ms '+_.options.cssEase;}else{transition[_.transitionType]='opacity '+_.options.speed+'ms '+_.options.cssEase;}
if(_.options.fade===false){_.$slideTrack.css(transition);}else{_.$slides.eq(slide).css(transition);}};Slick.prototype.autoPlay=function(){var _=this;_.autoPlayClear();if(_.slideCount>_.options.slidesToShow){_.autoPlayTimer=setInterval(_.autoPlayIterator,_.options.autoplaySpeed);}};Slick.prototype.autoPlayClear=function(){var _=this;if(_.autoPlayTimer){clearInterval(_.autoPlayTimer);}};Slick.prototype.autoPlayIterator=function(){var _=this,slideTo=_.currentSlide+_.options.slidesToScroll;if(!_.paused&&!_.interrupted&&!_.focussed){if(_.options.infinite===false){if(_.direction===1&&(_.currentSlide+1)===(_.slideCount-1)){_.direction=0;}
else if(_.direction===0){slideTo=_.currentSlide-_.options.slidesToScroll;if(_.currentSlide-1===0){_.direction=1;}}}
_.slideHandler(slideTo);}};Slick.prototype.buildArrows=function(){var _=this;if(_.options.arrows===true){_.$prevArrow=$(_.options.prevArrow).addClass('slick-arrow');_.$nextArrow=$(_.options.nextArrow).addClass('slick-arrow');if(_.slideCount>_.options.slidesToShow){_.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');_.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.prependTo(_.options.appendArrows);}
if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.appendTo(_.options.appendArrows);}
if(_.options.infinite!==true){_.$prevArrow.addClass('slick-disabled').attr('aria-disabled','true');}}else{_.$prevArrow.add(_.$nextArrow).addClass('slick-hidden').attr({'aria-disabled':'true','tabindex':'-1'});}}};Slick.prototype.buildDots=function(){var _=this,i,dot;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$slider.addClass('slick-dotted');dot=$('<ul />').addClass(_.options.dotsClass);for(i=0;i<=_.getDotCount();i+=1){dot.append($('<li />').append(_.options.customPaging.call(this,_,i)));}
_.$dots=dot.appendTo(_.options.appendDots);_.$dots.find('li').first().addClass('slick-active');}};Slick.prototype.buildOut=function(){var _=this;_.$slides=_.$slider.children(_.options.slide+':not(.slick-cloned)').addClass('slick-slide');_.slideCount=_.$slides.length;_.$slides.each(function(index,element){$(element).attr('data-slick-index',index).data('originalStyling',$(element).attr('style')||'');});_.$slider.addClass('slick-slider');_.$slideTrack=(_.slideCount===0)?$('<div class="slick-track"/>').appendTo(_.$slider):_.$slides.wrapAll('<div class="slick-track"/>').parent();_.$list=_.$slideTrack.wrap('<div class="slick-list"/>').parent();_.$slideTrack.css('opacity',0);if(_.options.centerMode===true||_.options.swipeToSlide===true){_.options.slidesToScroll=1;}
$('img[data-lazy]',_.$slider).not('[src]').addClass('slick-loading');_.setupInfinite();_.buildArrows();_.buildDots();_.updateDots();_.setSlideClasses(typeof _.currentSlide==='number'?_.currentSlide:0);if(_.options.draggable===true){_.$list.addClass('draggable');}};Slick.prototype.buildRows=function(){var _=this,a,b,c,newSlides,numOfSlides,originalSlides,slidesPerSection;newSlides=document.createDocumentFragment();originalSlides=_.$slider.children();if(_.options.rows>0){slidesPerSection=_.options.slidesPerRow*_.options.rows;numOfSlides=Math.ceil(originalSlides.length/slidesPerSection);for(a=0;a<numOfSlides;a++){var slide=document.createElement('div');for(b=0;b<_.options.rows;b++){var row=document.createElement('div');for(c=0;c<_.options.slidesPerRow;c++){var target=(a*slidesPerSection+((b*_.options.slidesPerRow)+c));if(originalSlides.get(target)){row.appendChild(originalSlides.get(target));}}
slide.appendChild(row);}
newSlides.appendChild(slide);}
_.$slider.empty().append(newSlides);_.$slider.children().children().children().css({'width':(100/_.options.slidesPerRow)+'%','display':'inline-block'});}};Slick.prototype.checkResponsive=function(initial,forceUpdate){var _=this,breakpoint,targetBreakpoint,respondToWidth,triggerBreakpoint=false;var sliderWidth=_.$slider.width();var windowWidth=window.innerWidth||$(window).width();if(_.respondTo==='window'){respondToWidth=windowWidth;}else if(_.respondTo==='slider'){respondToWidth=sliderWidth;}else if(_.respondTo==='min'){respondToWidth=Math.min(windowWidth,sliderWidth);}
if(_.options.responsive&&_.options.responsive.length&&_.options.responsive!==null){targetBreakpoint=null;for(breakpoint in _.breakpoints){if(_.breakpoints.hasOwnProperty(breakpoint)){if(_.originalSettings.mobileFirst===false){if(respondToWidth<_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint];}}else{if(respondToWidth>_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint];}}}}
if(targetBreakpoint!==null){if(_.activeBreakpoint!==null){if(targetBreakpoint!==_.activeBreakpoint||forceUpdate){_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==='unslick'){_.unslick(targetBreakpoint);}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide;}
_.refresh(initial);}
triggerBreakpoint=targetBreakpoint;}}else{_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==='unslick'){_.unslick(targetBreakpoint);}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide;}
_.refresh(initial);}
triggerBreakpoint=targetBreakpoint;}}else{if(_.activeBreakpoint!==null){_.activeBreakpoint=null;_.options=_.originalSettings;if(initial===true){_.currentSlide=_.options.initialSlide;}
_.refresh(initial);triggerBreakpoint=targetBreakpoint;}}
if(!initial&&triggerBreakpoint!==false){_.$slider.trigger('breakpoint',[_,triggerBreakpoint]);}}};Slick.prototype.changeSlide=function(event,dontAnimate){var _=this,$target=$(event.currentTarget),indexOffset,slideOffset,unevenOffset;if($target.is('a')){event.preventDefault();}
if(!$target.is('li')){$target=$target.closest('li');}
unevenOffset=(_.slideCount%_.options.slidesToScroll!==0);indexOffset=unevenOffset?0:(_.slideCount-_.currentSlide)%_.options.slidesToScroll;switch(event.data.message){case'previous':slideOffset=indexOffset===0?_.options.slidesToScroll:_.options.slidesToShow-indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide-slideOffset,false,dontAnimate);}
break;case'next':slideOffset=indexOffset===0?_.options.slidesToScroll:indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide+slideOffset,false,dontAnimate);}
break;case'index':var index=event.data.index===0?0:event.data.index||$target.index()*_.options.slidesToScroll;_.slideHandler(_.checkNavigable(index),false,dontAnimate);$target.children().trigger('focus');break;default:return;}};Slick.prototype.checkNavigable=function(index){var _=this,navigables,prevNavigable;navigables=_.getNavigableIndexes();prevNavigable=0;if(index>navigables[navigables.length-1]){index=navigables[navigables.length-1];}else{for(var n in navigables){if(index<navigables[n]){index=prevNavigable;break;}
prevNavigable=navigables[n];}}
return index;};Slick.prototype.cleanUpEvents=function(){var _=this;if(_.options.dots&&_.$dots!==null){$('li',_.$dots).off('click.slick',_.changeSlide).off('mouseenter.slick',$.proxy(_.interrupt,_,true)).off('mouseleave.slick',$.proxy(_.interrupt,_,false));if(_.options.accessibility===true){_.$dots.off('keydown.slick',_.keyHandler);}}
_.$slider.off('focus.slick blur.slick');if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow&&_.$prevArrow.off('click.slick',_.changeSlide);_.$nextArrow&&_.$nextArrow.off('click.slick',_.changeSlide);if(_.options.accessibility===true){_.$prevArrow&&_.$prevArrow.off('keydown.slick',_.keyHandler);_.$nextArrow&&_.$nextArrow.off('keydown.slick',_.keyHandler);}}
_.$list.off('touchstart.slick mousedown.slick',_.swipeHandler);_.$list.off('touchmove.slick mousemove.slick',_.swipeHandler);_.$list.off('touchend.slick mouseup.slick',_.swipeHandler);_.$list.off('touchcancel.slick mouseleave.slick',_.swipeHandler);_.$list.off('click.slick',_.clickHandler);$(document).off(_.visibilityChange,_.visibility);_.cleanUpSlideEvents();if(_.options.accessibility===true){_.$list.off('keydown.slick',_.keyHandler);}
if(_.options.focusOnSelect===true){$(_.$slideTrack).children().off('click.slick',_.selectHandler);}
$(window).off('orientationchange.slick.slick-'+_.instanceUid,_.orientationChange);$(window).off('resize.slick.slick-'+_.instanceUid,_.resize);$('[draggable!=true]',_.$slideTrack).off('dragstart',_.preventDefault);$(window).off('load.slick.slick-'+_.instanceUid,_.setPosition);};Slick.prototype.cleanUpSlideEvents=function(){var _=this;_.$list.off('mouseenter.slick',$.proxy(_.interrupt,_,true));_.$list.off('mouseleave.slick',$.proxy(_.interrupt,_,false));};Slick.prototype.cleanUpRows=function(){var _=this,originalSlides;if(_.options.rows>0){originalSlides=_.$slides.children().children();originalSlides.removeAttr('style');_.$slider.empty().append(originalSlides);}};Slick.prototype.clickHandler=function(event){var _=this;if(_.shouldClick===false){event.stopImmediatePropagation();event.stopPropagation();event.preventDefault();}};Slick.prototype.destroy=function(refresh){var _=this;_.autoPlayClear();_.touchObject={};_.cleanUpEvents();$('.slick-cloned',_.$slider).detach();if(_.$dots){_.$dots.remove();}
if(_.$prevArrow&&_.$prevArrow.length){_.$prevArrow.removeClass('slick-disabled slick-arrow slick-hidden').removeAttr('aria-hidden aria-disabled tabindex').css('display','');if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove();}}
if(_.$nextArrow&&_.$nextArrow.length){_.$nextArrow.removeClass('slick-disabled slick-arrow slick-hidden').removeAttr('aria-hidden aria-disabled tabindex').css('display','');if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove();}}
if(_.$slides){_.$slides.removeClass('slick-slide slick-active slick-center slick-visible slick-current').removeAttr('aria-hidden').removeAttr('data-slick-index').each(function(){$(this).attr('style',$(this).data('originalStyling'));});_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.detach();_.$list.detach();_.$slider.append(_.$slides);}
_.cleanUpRows();_.$slider.removeClass('slick-slider');_.$slider.removeClass('slick-initialized');_.$slider.removeClass('slick-dotted');_.unslicked=true;if(!refresh){_.$slider.trigger('destroy',[_]);}};Slick.prototype.disableTransition=function(slide){var _=this,transition={};transition[_.transitionType]='';if(_.options.fade===false){_.$slideTrack.css(transition);}else{_.$slides.eq(slide).css(transition);}};Slick.prototype.fadeSlide=function(slideIndex,callback){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).css({zIndex:_.options.zIndex});_.$slides.eq(slideIndex).animate({opacity:1},_.options.speed,_.options.easing,callback);}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:1,zIndex:_.options.zIndex});if(callback){setTimeout(function(){_.disableTransition(slideIndex);callback.call();},_.options.speed);}}};Slick.prototype.fadeSlideOut=function(slideIndex){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).animate({opacity:0,zIndex:_.options.zIndex-2},_.options.speed,_.options.easing);}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:0,zIndex:_.options.zIndex-2});}};Slick.prototype.filterSlides=Slick.prototype.slickFilter=function(filter){var _=this;if(filter!==null){_.$slidesCache=_.$slides;_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.filter(filter).appendTo(_.$slideTrack);_.reinit();}};Slick.prototype.focusHandler=function(){var _=this;_.$slider.off('focus.slick blur.slick').on('focus.slick blur.slick','*',function(event){event.stopImmediatePropagation();var $sf=$(this);setTimeout(function(){if(_.options.pauseOnFocus){_.focussed=$sf.is(':focus');_.autoPlay();}},0);});};Slick.prototype.getCurrent=Slick.prototype.slickCurrentSlide=function(){var _=this;return _.currentSlide;};Slick.prototype.getDotCount=function(){var _=this;var breakPoint=0;var counter=0;var pagerQty=0;if(_.options.infinite===true){if(_.slideCount<=_.options.slidesToShow){++pagerQty;}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow;}}}else if(_.options.centerMode===true){pagerQty=_.slideCount;}else if(!_.options.asNavFor){pagerQty=1+Math.ceil((_.slideCount-_.options.slidesToShow)/_.options.slidesToScroll);}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow;}}
return pagerQty-1;};Slick.prototype.getLeft=function(slideIndex){var _=this,targetLeft,verticalHeight,verticalOffset=0,targetSlide,coef;_.slideOffset=0;verticalHeight=_.$slides.first().outerHeight(true);if(_.options.infinite===true){if(_.slideCount>_.options.slidesToShow){_.slideOffset=(_.slideWidth*_.options.slidesToShow)* -1;coef=-1
if(_.options.vertical===true&&_.options.centerMode===true){if(_.options.slidesToShow===2){coef=-1.5;}else if(_.options.slidesToShow===1){coef=-2}}
verticalOffset=(verticalHeight*_.options.slidesToShow)*coef;}
if(_.slideCount%_.options.slidesToScroll!==0){if(slideIndex+_.options.slidesToScroll>_.slideCount&&_.slideCount>_.options.slidesToShow){if(slideIndex>_.slideCount){_.slideOffset=((_.options.slidesToShow-(slideIndex-_.slideCount))*_.slideWidth)* -1;verticalOffset=((_.options.slidesToShow-(slideIndex-_.slideCount))*verticalHeight)* -1;}else{_.slideOffset=((_.slideCount%_.options.slidesToScroll)*_.slideWidth)* -1;verticalOffset=((_.slideCount%_.options.slidesToScroll)*verticalHeight)* -1;}}}}else{if(slideIndex+_.options.slidesToShow>_.slideCount){_.slideOffset=((slideIndex+_.options.slidesToShow)-_.slideCount)*_.slideWidth;verticalOffset=((slideIndex+_.options.slidesToShow)-_.slideCount)*verticalHeight;}}
if(_.slideCount<=_.options.slidesToShow){_.slideOffset=0;verticalOffset=0;}
if(_.options.centerMode===true&&_.slideCount<=_.options.slidesToShow){_.slideOffset=((_.slideWidth*Math.floor(_.options.slidesToShow))/2)-((_.slideWidth*_.slideCount)/2);}else if(_.options.centerMode===true&&_.options.infinite===true){_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)-_.slideWidth;}else if(_.options.centerMode===true){_.slideOffset=0;_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2);}
if(_.options.vertical===false){targetLeft=((slideIndex*_.slideWidth)* -1)+_.slideOffset;}else{targetLeft=((slideIndex*verticalHeight)* -1)+verticalOffset;}
if(_.options.variableWidth===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex);}else{targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex+_.options.slidesToShow);}
if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())* -1;}else{targetLeft=0;}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft* -1:0;}
if(_.options.centerMode===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex);}else{targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex+_.options.slidesToShow+1);}
if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())* -1;}else{targetLeft=0;}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft* -1:0;}
targetLeft+=(_.$list.width()-targetSlide.outerWidth())/2;}}
return targetLeft;};Slick.prototype.getOption=Slick.prototype.slickGetOption=function(option){var _=this;return _.options[option];};Slick.prototype.getNavigableIndexes=function(){var _=this,breakPoint=0,counter=0,indexes=[],max;if(_.options.infinite===false){max=_.slideCount;}else{breakPoint=_.options.slidesToScroll* -1;counter=_.options.slidesToScroll* -1;max=_.slideCount*2;}
while(breakPoint<max){indexes.push(breakPoint);breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow;}
return indexes;};Slick.prototype.getSlick=function(){return this;};Slick.prototype.getSlideCount=function(){var _=this,slidesTraversed,swipedSlide,centerOffset;centerOffset=_.options.centerMode===true?_.slideWidth*Math.floor(_.options.slidesToShow/2):0;if(_.options.swipeToSlide===true){_.$slideTrack.find('.slick-slide').each(function(index,slide){if(slide.offsetLeft-centerOffset+($(slide).outerWidth()/2)>(_.swipeLeft* -1)){swipedSlide=slide;return false;}});slidesTraversed=Math.abs($(swipedSlide).attr('data-slick-index')-_.currentSlide)||1;return slidesTraversed;}else{return _.options.slidesToScroll;}};Slick.prototype.goTo=Slick.prototype.slickGoTo=function(slide,dontAnimate){var _=this;_.changeSlide({data:{message:'index',index:parseInt(slide)}},dontAnimate);};Slick.prototype.init=function(creation){var _=this;if(!$(_.$slider).hasClass('slick-initialized')){$(_.$slider).addClass('slick-initialized');_.buildRows();_.buildOut();_.setProps();_.startLoad();_.loadSlider();_.initializeEvents();_.updateArrows();_.updateDots();_.checkResponsive(true);_.focusHandler();}
if(creation){_.$slider.trigger('init',[_]);}
if(_.options.accessibility===true){_.initADA();}
if(_.options.autoplay){_.paused=false;_.autoPlay();}};Slick.prototype.initADA=function(){var _=this,numDotGroups=Math.ceil(_.slideCount/_.options.slidesToShow),tabControlIndexes=_.getNavigableIndexes().filter(function(val){return(val>=0)&&(val<_.slideCount);});_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({'aria-hidden':'true','tabindex':'-1'}).find('a, input, button, select').attr({'tabindex':'-1'});if(_.$dots!==null){_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i){var slideControlIndex=tabControlIndexes.indexOf(i);$(this).attr({'role':'tabpanel','id':'slick-slide'+_.instanceUid+i,'tabindex':-1});if(slideControlIndex!==-1){var ariaButtonControl='slick-slide-control'+_.instanceUid+slideControlIndex
if($('#'+ariaButtonControl).length){$(this).attr({'aria-describedby':ariaButtonControl});}}});_.$dots.attr('role','tablist').find('li').each(function(i){var mappedSlideIndex=tabControlIndexes[i];$(this).attr({'role':'presentation'});$(this).find('button').first().attr({'role':'tab','id':'slick-slide-control'+_.instanceUid+i,'aria-controls':'slick-slide'+_.instanceUid+mappedSlideIndex,'aria-label':(i+1)+' of '+numDotGroups,'aria-selected':null,'tabindex':'-1'});}).eq(_.currentSlide).find('button').attr({'aria-selected':'true','tabindex':'0'}).end();}
for(var i=_.currentSlide,max=i+_.options.slidesToShow;i<max;i++){if(_.options.focusOnChange){_.$slides.eq(i).attr({'tabindex':'0'});}else{_.$slides.eq(i).removeAttr('tabindex');}}
_.activateADA();};Slick.prototype.initArrowEvents=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.off('click.slick').on('click.slick',{message:'previous'},_.changeSlide);_.$nextArrow.off('click.slick').on('click.slick',{message:'next'},_.changeSlide);if(_.options.accessibility===true){_.$prevArrow.on('keydown.slick',_.keyHandler);_.$nextArrow.on('keydown.slick',_.keyHandler);}}};Slick.prototype.initDotEvents=function(){var _=this;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){$('li',_.$dots).on('click.slick',{message:'index'},_.changeSlide);if(_.options.accessibility===true){_.$dots.on('keydown.slick',_.keyHandler);}}
if(_.options.dots===true&&_.options.pauseOnDotsHover===true&&_.slideCount>_.options.slidesToShow){$('li',_.$dots).on('mouseenter.slick',$.proxy(_.interrupt,_,true)).on('mouseleave.slick',$.proxy(_.interrupt,_,false));}};Slick.prototype.initSlideEvents=function(){var _=this;if(_.options.pauseOnHover){_.$list.on('mouseenter.slick',$.proxy(_.interrupt,_,true));_.$list.on('mouseleave.slick',$.proxy(_.interrupt,_,false));}};Slick.prototype.initializeEvents=function(){var _=this;_.initArrowEvents();_.initDotEvents();_.initSlideEvents();_.$list.on('touchstart.slick mousedown.slick',{action:'start'},_.swipeHandler);_.$list.on('touchmove.slick mousemove.slick',{action:'move'},_.swipeHandler);_.$list.on('touchend.slick mouseup.slick',{action:'end'},_.swipeHandler);_.$list.on('touchcancel.slick mouseleave.slick',{action:'end'},_.swipeHandler);_.$list.on('click.slick',_.clickHandler);$(document).on(_.visibilityChange,$.proxy(_.visibility,_));if(_.options.accessibility===true){_.$list.on('keydown.slick',_.keyHandler);}
if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on('click.slick',_.selectHandler);}
$(window).on('orientationchange.slick.slick-'+_.instanceUid,$.proxy(_.orientationChange,_));$(window).on('resize.slick.slick-'+_.instanceUid,$.proxy(_.resize,_));$('[draggable!=true]',_.$slideTrack).on('dragstart',_.preventDefault);$(window).on('load.slick.slick-'+_.instanceUid,_.setPosition);$(_.setPosition);};Slick.prototype.initUI=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.show();_.$nextArrow.show();}
if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.show();}};Slick.prototype.keyHandler=function(event){var _=this;if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')){if(event.keyCode===37&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?'next':'previous'}});}else if(event.keyCode===39&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?'previous':'next'}});}}};Slick.prototype.lazyLoad=function(){var _=this,loadRange,cloneRange,rangeStart,rangeEnd;function loadImages(imagesScope){$('img[data-lazy]',imagesScope).each(function(){var image=$(this),imageSource=$(this).attr('data-lazy'),imageSrcSet=$(this).attr('data-srcset'),imageSizes=$(this).attr('data-sizes')||_.$slider.attr('data-sizes'),imageToLoad=document.createElement('img');imageToLoad.onload=function(){image.animate({opacity:0},100,function(){if(imageSrcSet){image.attr('srcset',imageSrcSet);if(imageSizes){image.attr('sizes',imageSizes);}}
image.attr('src',imageSource).animate({opacity:1},200,function(){image.removeAttr('data-lazy data-srcset data-sizes').removeClass('slick-loading');});_.$slider.trigger('lazyLoaded',[_,image,imageSource]);});};imageToLoad.onerror=function(){image.removeAttr('data-lazy').removeClass('slick-loading').addClass('slick-lazyload-error');_.$slider.trigger('lazyLoadError',[_,image,imageSource]);};imageToLoad.src=imageSource;});}
if(_.options.centerMode===true){if(_.options.infinite===true){rangeStart=_.currentSlide+(_.options.slidesToShow/2+1);rangeEnd=rangeStart+_.options.slidesToShow+2;}else{rangeStart=Math.max(0,_.currentSlide-(_.options.slidesToShow/2+1));rangeEnd=2+(_.options.slidesToShow/2+1)+_.currentSlide;}}else{rangeStart=_.options.infinite?_.options.slidesToShow+_.currentSlide:_.currentSlide;rangeEnd=Math.ceil(rangeStart+_.options.slidesToShow);if(_.options.fade===true){if(rangeStart>0)rangeStart--;if(rangeEnd<=_.slideCount)rangeEnd++;}}
loadRange=_.$slider.find('.slick-slide').slice(rangeStart,rangeEnd);if(_.options.lazyLoad==='anticipated'){var prevSlide=rangeStart-1,nextSlide=rangeEnd,$slides=_.$slider.find('.slick-slide');for(var i=0;i<_.options.slidesToScroll;i++){if(prevSlide<0)prevSlide=_.slideCount-1;loadRange=loadRange.add($slides.eq(prevSlide));loadRange=loadRange.add($slides.eq(nextSlide));prevSlide--;nextSlide++;}}
loadImages(loadRange);if(_.slideCount<=_.options.slidesToShow){cloneRange=_.$slider.find('.slick-slide');loadImages(cloneRange);}else
if(_.currentSlide>=_.slideCount-_.options.slidesToShow){cloneRange=_.$slider.find('.slick-cloned').slice(0,_.options.slidesToShow);loadImages(cloneRange);}else if(_.currentSlide===0){cloneRange=_.$slider.find('.slick-cloned').slice(_.options.slidesToShow* -1);loadImages(cloneRange);}};Slick.prototype.loadSlider=function(){var _=this;_.setPosition();_.$slideTrack.css({opacity:1});_.$slider.removeClass('slick-loading');_.initUI();if(_.options.lazyLoad==='progressive'){_.progressiveLazyLoad();}};Slick.prototype.next=Slick.prototype.slickNext=function(){var _=this;_.changeSlide({data:{message:'next'}});};Slick.prototype.orientationChange=function(){var _=this;_.checkResponsive();_.setPosition();};Slick.prototype.pause=Slick.prototype.slickPause=function(){var _=this;_.autoPlayClear();_.paused=true;};Slick.prototype.play=Slick.prototype.slickPlay=function(){var _=this;_.autoPlay();_.options.autoplay=true;_.paused=false;_.focussed=false;_.interrupted=false;};Slick.prototype.postSlide=function(index){var _=this;if(!_.unslicked){_.$slider.trigger('afterChange',[_,index]);_.animating=false;if(_.slideCount>_.options.slidesToShow){_.setPosition();}
_.swipeLeft=null;if(_.options.autoplay){_.autoPlay();}
if(_.options.accessibility===true){_.initADA();if(_.options.focusOnChange){var $currentSlide=$(_.$slides.get(_.currentSlide));$currentSlide.attr('tabindex',0).focus();}}}};Slick.prototype.prev=Slick.prototype.slickPrev=function(){var _=this;_.changeSlide({data:{message:'previous'}});};Slick.prototype.preventDefault=function(event){event.preventDefault();};Slick.prototype.progressiveLazyLoad=function(tryCount){tryCount=tryCount||1;var _=this,$imgsToLoad=$('img[data-lazy]',_.$slider),image,imageSource,imageSrcSet,imageSizes,imageToLoad;if($imgsToLoad.length){image=$imgsToLoad.first();imageSource=image.attr('data-lazy');imageSrcSet=image.attr('data-srcset');imageSizes=image.attr('data-sizes')||_.$slider.attr('data-sizes');imageToLoad=document.createElement('img');imageToLoad.onload=function(){if(imageSrcSet){image.attr('srcset',imageSrcSet);if(imageSizes){image.attr('sizes',imageSizes);}}
image.attr('src',imageSource).removeAttr('data-lazy data-srcset data-sizes').removeClass('slick-loading');if(_.options.adaptiveHeight===true){_.setPosition();}
_.$slider.trigger('lazyLoaded',[_,image,imageSource]);_.progressiveLazyLoad();};imageToLoad.onerror=function(){if(tryCount<3){setTimeout(function(){_.progressiveLazyLoad(tryCount+1);},500);}else{image.removeAttr('data-lazy').removeClass('slick-loading').addClass('slick-lazyload-error');_.$slider.trigger('lazyLoadError',[_,image,imageSource]);_.progressiveLazyLoad();}};imageToLoad.src=imageSource;}else{_.$slider.trigger('allImagesLoaded',[_]);}};Slick.prototype.refresh=function(initializing){var _=this,currentSlide,lastVisibleIndex;lastVisibleIndex=_.slideCount-_.options.slidesToShow;if(!_.options.infinite&&(_.currentSlide>lastVisibleIndex)){_.currentSlide=lastVisibleIndex;}
if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0;}
currentSlide=_.currentSlide;_.destroy(true);$.extend(_,_.initials,{currentSlide:currentSlide});_.init();if(!initializing){_.changeSlide({data:{message:'index',index:currentSlide}},false);}};Slick.prototype.registerBreakpoints=function(){var _=this,breakpoint,currentBreakpoint,l,responsiveSettings=_.options.responsive||null;if($.type(responsiveSettings)==='array'&&responsiveSettings.length){_.respondTo=_.options.respondTo||'window';for(breakpoint in responsiveSettings){l=_.breakpoints.length-1;if(responsiveSettings.hasOwnProperty(breakpoint)){currentBreakpoint=responsiveSettings[breakpoint].breakpoint;while(l>=0){if(_.breakpoints[l]&&_.breakpoints[l]===currentBreakpoint){_.breakpoints.splice(l,1);}
l--;}
_.breakpoints.push(currentBreakpoint);_.breakpointSettings[currentBreakpoint]=responsiveSettings[breakpoint].settings;}}
_.breakpoints.sort(function(a,b){return(_.options.mobileFirst)?a-b:b-a;});}};Slick.prototype.reinit=function(){var _=this;_.$slides=_.$slideTrack.children(_.options.slide).addClass('slick-slide');_.slideCount=_.$slides.length;if(_.currentSlide>=_.slideCount&&_.currentSlide!==0){_.currentSlide=_.currentSlide-_.options.slidesToScroll;}
if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0;}
_.registerBreakpoints();_.setProps();_.setupInfinite();_.buildArrows();_.updateArrows();_.initArrowEvents();_.buildDots();_.updateDots();_.initDotEvents();_.cleanUpSlideEvents();_.initSlideEvents();_.checkResponsive(false,true);if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on('click.slick',_.selectHandler);}
_.setSlideClasses(typeof _.currentSlide==='number'?_.currentSlide:0);_.setPosition();_.focusHandler();_.paused=!_.options.autoplay;_.autoPlay();_.$slider.trigger('reInit',[_]);};Slick.prototype.resize=function(){var _=this;if($(window).width()!==_.windowWidth){clearTimeout(_.windowDelay);_.windowDelay=window.setTimeout(function(){_.windowWidth=$(window).width();_.checkResponsive();if(!_.unslicked){_.setPosition();}},50);}};Slick.prototype.removeSlide=Slick.prototype.slickRemove=function(index,removeBefore,removeAll){var _=this;if(typeof(index)==='boolean'){removeBefore=index;index=removeBefore===true?0:_.slideCount-1;}else{index=removeBefore===true?--index:index;}
if(_.slideCount<1||index<0||index>_.slideCount-1){return false;}
_.unload();if(removeAll===true){_.$slideTrack.children().remove();}else{_.$slideTrack.children(this.options.slide).eq(index).remove();}
_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slidesCache=_.$slides;_.reinit();};Slick.prototype.setCSS=function(position){var _=this,positionProps={},x,y;if(_.options.rtl===true){position=-position;}
x=_.positionProp=='left'?Math.ceil(position)+'px':'0px';y=_.positionProp=='top'?Math.ceil(position)+'px':'0px';positionProps[_.positionProp]=position;if(_.transformsEnabled===false){_.$slideTrack.css(positionProps);}else{positionProps={};if(_.cssTransitions===false){positionProps[_.animType]='translate('+x+', '+y+')';_.$slideTrack.css(positionProps);}else{positionProps[_.animType]='translate3d('+x+', '+y+', 0px)';_.$slideTrack.css(positionProps);}}};Slick.prototype.setDimensions=function(){var _=this;if(_.options.vertical===false){if(_.options.centerMode===true){_.$list.css({padding:('0px '+_.options.centerPadding)});}}else{_.$list.height(_.$slides.first().outerHeight(true)*_.options.slidesToShow);if(_.options.centerMode===true){_.$list.css({padding:(_.options.centerPadding+' 0px')});}}
_.listWidth=_.$list.width();_.listHeight=_.$list.height();if(_.options.vertical===false&&_.options.variableWidth===false){_.slideWidth=Math.ceil(_.listWidth/_.options.slidesToShow);_.$slideTrack.width(Math.ceil((_.slideWidth*_.$slideTrack.children('.slick-slide').length)));}else if(_.options.variableWidth===true){_.$slideTrack.width(5000*_.slideCount);}else{_.slideWidth=Math.ceil(_.listWidth);_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true)*_.$slideTrack.children('.slick-slide').length)));}
var offset=_.$slides.first().outerWidth(true)-_.$slides.first().width();if(_.options.variableWidth===false)_.$slideTrack.children('.slick-slide').width(_.slideWidth-offset);};Slick.prototype.setFade=function(){var _=this,targetLeft;_.$slides.each(function(index,element){targetLeft=(_.slideWidth*index)* -1;if(_.options.rtl===true){$(element).css({position:'relative',right:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0});}else{$(element).css({position:'relative',left:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0});}});_.$slides.eq(_.currentSlide).css({zIndex:_.options.zIndex-1,opacity:1});};Slick.prototype.setHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.css('height',targetHeight);}};Slick.prototype.setOption=Slick.prototype.slickSetOption=function(){var _=this,l,item,option,value,refresh=false,type;if($.type(arguments[0])==='object'){option=arguments[0];refresh=arguments[1];type='multiple';}else if($.type(arguments[0])==='string'){option=arguments[0];value=arguments[1];refresh=arguments[2];if(arguments[0]==='responsive'&&$.type(arguments[1])==='array'){type='responsive';}else if(typeof arguments[1]!=='undefined'){type='single';}}
if(type==='single'){_.options[option]=value;}else if(type==='multiple'){$.each(option,function(opt,val){_.options[opt]=val;});}else if(type==='responsive'){for(item in value){if($.type(_.options.responsive)!=='array'){_.options.responsive=[value[item]];}else{l=_.options.responsive.length-1;while(l>=0){if(_.options.responsive[l].breakpoint===value[item].breakpoint){_.options.responsive.splice(l,1);}
l--;}
_.options.responsive.push(value[item]);}}}
if(refresh){_.unload();_.reinit();}};Slick.prototype.setPosition=function(){var _=this;_.setDimensions();_.setHeight();if(_.options.fade===false){_.setCSS(_.getLeft(_.currentSlide));}else{_.setFade();}
_.$slider.trigger('setPosition',[_]);};Slick.prototype.setProps=function(){var _=this,bodyStyle=document.body.style;_.positionProp=_.options.vertical===true?'top':'left';if(_.positionProp==='top'){_.$slider.addClass('slick-vertical');}else{_.$slider.removeClass('slick-vertical');}
if(bodyStyle.WebkitTransition!==undefined||bodyStyle.MozTransition!==undefined||bodyStyle.msTransition!==undefined){if(_.options.useCSS===true){_.cssTransitions=true;}}
if(_.options.fade){if(typeof _.options.zIndex==='number'){if(_.options.zIndex<3){_.options.zIndex=3;}}else{_.options.zIndex=_.defaults.zIndex;}}
if(bodyStyle.OTransform!==undefined){_.animType='OTransform';_.transformType='-o-transform';_.transitionType='OTransition';if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false;}
if(bodyStyle.MozTransform!==undefined){_.animType='MozTransform';_.transformType='-moz-transform';_.transitionType='MozTransition';if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.MozPerspective===undefined)_.animType=false;}
if(bodyStyle.webkitTransform!==undefined){_.animType='webkitTransform';_.transformType='-webkit-transform';_.transitionType='webkitTransition';if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false;}
if(bodyStyle.msTransform!==undefined){_.animType='msTransform';_.transformType='-ms-transform';_.transitionType='msTransition';if(bodyStyle.msTransform===undefined)_.animType=false;}
if(bodyStyle.transform!==undefined&&_.animType!==false){_.animType='transform';_.transformType='transform';_.transitionType='transition';}
_.transformsEnabled=_.options.useTransform&&(_.animType!==null&&_.animType!==false);};Slick.prototype.setSlideClasses=function(index){var _=this,centerOffset,allSlides,indexOffset,remainder;allSlides=_.$slider.find('.slick-slide').removeClass('slick-active slick-center slick-current').attr('aria-hidden','true');_.$slides.eq(index).addClass('slick-current');if(_.options.centerMode===true){var evenCoef=_.options.slidesToShow%2===0?1:0;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.infinite===true){if(index>=centerOffset&&index<=(_.slideCount-1)-centerOffset){_.$slides.slice(index-centerOffset+evenCoef,index+centerOffset+1).addClass('slick-active').attr('aria-hidden','false');}else{indexOffset=_.options.slidesToShow+index;allSlides.slice(indexOffset-centerOffset+1+evenCoef,indexOffset+centerOffset+2).addClass('slick-active').attr('aria-hidden','false');}
if(index===0){allSlides.eq(allSlides.length-1-_.options.slidesToShow).addClass('slick-center');}else if(index===_.slideCount-1){allSlides.eq(_.options.slidesToShow).addClass('slick-center');}}
_.$slides.eq(index).addClass('slick-center');}else{if(index>=0&&index<=(_.slideCount-_.options.slidesToShow)){_.$slides.slice(index,index+_.options.slidesToShow).addClass('slick-active').attr('aria-hidden','false');}else if(allSlides.length<=_.options.slidesToShow){allSlides.addClass('slick-active').attr('aria-hidden','false');}else{remainder=_.slideCount%_.options.slidesToShow;indexOffset=_.options.infinite===true?_.options.slidesToShow+index:index;if(_.options.slidesToShow==_.options.slidesToScroll&&(_.slideCount-index)<_.options.slidesToShow){allSlides.slice(indexOffset-(_.options.slidesToShow-remainder),indexOffset+remainder).addClass('slick-active').attr('aria-hidden','false');}else{allSlides.slice(indexOffset,indexOffset+_.options.slidesToShow).addClass('slick-active').attr('aria-hidden','false');}}}
if(_.options.lazyLoad==='ondemand'||_.options.lazyLoad==='anticipated'){_.lazyLoad();}};Slick.prototype.setupInfinite=function(){var _=this,i,slideIndex,infiniteCount;if(_.options.fade===true){_.options.centerMode=false;}
if(_.options.infinite===true&&_.options.fade===false){slideIndex=null;if(_.slideCount>_.options.slidesToShow){if(_.options.centerMode===true){infiniteCount=_.options.slidesToShow+1;}else{infiniteCount=_.options.slidesToShow;}
for(i=_.slideCount;i>(_.slideCount-
infiniteCount);i-=1){slideIndex=i-1;$(_.$slides[slideIndex]).clone(true).attr('id','').attr('data-slick-index',slideIndex-_.slideCount).prependTo(_.$slideTrack).addClass('slick-cloned');}
for(i=0;i<infiniteCount+_.slideCount;i+=1){slideIndex=i;$(_.$slides[slideIndex]).clone(true).attr('id','').attr('data-slick-index',slideIndex+_.slideCount).appendTo(_.$slideTrack).addClass('slick-cloned');}
_.$slideTrack.find('.slick-cloned').find('[id]').each(function(){$(this).attr('id','');});}}};Slick.prototype.interrupt=function(toggle){var _=this;if(!toggle){_.autoPlay();}
_.interrupted=toggle;};Slick.prototype.selectHandler=function(event){var _=this;var targetElement=$(event.target).is('.slick-slide')?$(event.target):$(event.target).parents('.slick-slide');var index=parseInt(targetElement.attr('data-slick-index'));if(!index)index=0;if(_.slideCount<=_.options.slidesToShow){_.slideHandler(index,false,true);return;}
_.slideHandler(index);};Slick.prototype.slideHandler=function(index,sync,dontAnimate){var targetSlide,animSlide,oldSlide,slideLeft,targetLeft=null,_=this,navTarget;sync=sync||false;if(_.animating===true&&_.options.waitForAnimate===true){return;}
if(_.options.fade===true&&_.currentSlide===index){return;}
if(sync===false){_.asNavFor(index);}
targetSlide=index;targetLeft=_.getLeft(targetSlide);slideLeft=_.getLeft(_.currentSlide);_.currentLeft=_.swipeLeft===null?slideLeft:_.swipeLeft;if(_.options.infinite===false&&_.options.centerMode===false&&(index<0||index>_.getDotCount()*_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide);});}else{_.postSlide(targetSlide);}}
return;}else if(_.options.infinite===false&&_.options.centerMode===true&&(index<0||index>(_.slideCount-_.options.slidesToScroll))){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide);});}else{_.postSlide(targetSlide);}}
return;}
if(_.options.autoplay){clearInterval(_.autoPlayTimer);}
if(targetSlide<0){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=_.slideCount-(_.slideCount%_.options.slidesToScroll);}else{animSlide=_.slideCount+targetSlide;}}else if(targetSlide>=_.slideCount){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=0;}else{animSlide=targetSlide-_.slideCount;}}else{animSlide=targetSlide;}
_.animating=true;_.$slider.trigger('beforeChange',[_,_.currentSlide,animSlide]);oldSlide=_.currentSlide;_.currentSlide=animSlide;_.setSlideClasses(_.currentSlide);if(_.options.asNavFor){navTarget=_.getNavTarget();navTarget=navTarget.slick('getSlick');if(navTarget.slideCount<=navTarget.options.slidesToShow){navTarget.setSlideClasses(_.currentSlide);}}
_.updateDots();_.updateArrows();if(_.options.fade===true){if(dontAnimate!==true){_.fadeSlideOut(oldSlide);_.fadeSlide(animSlide,function(){_.postSlide(animSlide);});}else{_.postSlide(animSlide);}
_.animateHeight();return;}
if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(targetLeft,function(){_.postSlide(animSlide);});}else{_.postSlide(animSlide);}};Slick.prototype.startLoad=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.hide();_.$nextArrow.hide();}
if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.hide();}
_.$slider.addClass('slick-loading');};Slick.prototype.swipeDirection=function(){var xDist,yDist,r,swipeAngle,_=this;xDist=_.touchObject.startX-_.touchObject.curX;yDist=_.touchObject.startY-_.touchObject.curY;r=Math.atan2(yDist,xDist);swipeAngle=Math.round(r*180/Math.PI);if(swipeAngle<0){swipeAngle=360-Math.abs(swipeAngle);}
if((swipeAngle<=45)&&(swipeAngle>=0)){return(_.options.rtl===false?'left':'right');}
if((swipeAngle<=360)&&(swipeAngle>=315)){return(_.options.rtl===false?'left':'right');}
if((swipeAngle>=135)&&(swipeAngle<=225)){return(_.options.rtl===false?'right':'left');}
if(_.options.verticalSwiping===true){if((swipeAngle>=35)&&(swipeAngle<=135)){return'down';}else{return'up';}}
return'vertical';};Slick.prototype.swipeEnd=function(event){var _=this,slideCount,direction;_.dragging=false;_.swiping=false;if(_.scrolling){_.scrolling=false;return false;}
_.interrupted=false;_.shouldClick=(_.touchObject.swipeLength>10)?false:true;if(_.touchObject.curX===undefined){return false;}
if(_.touchObject.edgeHit===true){_.$slider.trigger('edge',[_,_.swipeDirection()]);}
if(_.touchObject.swipeLength>=_.touchObject.minSwipe){direction=_.swipeDirection();switch(direction){case'left':case'down':slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide+_.getSlideCount()):_.currentSlide+_.getSlideCount();_.currentDirection=0;break;case'right':case'up':slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide-_.getSlideCount()):_.currentSlide-_.getSlideCount();_.currentDirection=1;break;default:}
if(direction!='vertical'){_.slideHandler(slideCount);_.touchObject={};_.$slider.trigger('swipe',[_,direction]);}}else{if(_.touchObject.startX!==_.touchObject.curX){_.slideHandler(_.currentSlide);_.touchObject={};}}};Slick.prototype.swipeHandler=function(event){var _=this;if((_.options.swipe===false)||('ontouchend' in document&&_.options.swipe===false)){return;}else if(_.options.draggable===false&&event.type.indexOf('mouse')!==-1){return;}
_.touchObject.fingerCount=event.originalEvent&&event.originalEvent.touches!==undefined?event.originalEvent.touches.length:1;_.touchObject.minSwipe=_.listWidth/_.options.touchThreshold;if(_.options.verticalSwiping===true){_.touchObject.minSwipe=_.listHeight/_.options.touchThreshold;}
switch(event.data.action){case'start':_.swipeStart(event);break;case'move':_.swipeMove(event);break;case'end':_.swipeEnd(event);break;}};Slick.prototype.swipeMove=function(event){var _=this,edgeWasHit=false,curLeft,swipeDirection,swipeLength,positionOffset,touches,verticalSwipeLength;touches=event.originalEvent!==undefined?event.originalEvent.touches:null;if(!_.dragging||_.scrolling||touches&&touches.length!==1){return false;}
curLeft=_.getLeft(_.currentSlide);_.touchObject.curX=touches!==undefined?touches[0].pageX:event.clientX;_.touchObject.curY=touches!==undefined?touches[0].pageY:event.clientY;_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curX-_.touchObject.startX,2)));verticalSwipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curY-_.touchObject.startY,2)));if(!_.options.verticalSwiping&&!_.swiping&&verticalSwipeLength>4){_.scrolling=true;return false;}
if(_.options.verticalSwiping===true){_.touchObject.swipeLength=verticalSwipeLength;}
swipeDirection=_.swipeDirection();if(event.originalEvent!==undefined&&_.touchObject.swipeLength>4){_.swiping=true;event.preventDefault();}
positionOffset=(_.options.rtl===false?1:-1)*(_.touchObject.curX>_.touchObject.startX?1:-1);if(_.options.verticalSwiping===true){positionOffset=_.touchObject.curY>_.touchObject.startY?1:-1;}
swipeLength=_.touchObject.swipeLength;_.touchObject.edgeHit=false;if(_.options.infinite===false){if((_.currentSlide===0&&swipeDirection==='right')||(_.currentSlide>=_.getDotCount()&&swipeDirection==='left')){swipeLength=_.touchObject.swipeLength*_.options.edgeFriction;_.touchObject.edgeHit=true;}}
if(_.options.vertical===false){_.swipeLeft=curLeft+swipeLength*positionOffset;}else{_.swipeLeft=curLeft+(swipeLength*(_.$list.height()/_.listWidth))*positionOffset;}
if(_.options.verticalSwiping===true){_.swipeLeft=curLeft+swipeLength*positionOffset;}
if(_.options.fade===true||_.options.touchMove===false){return false;}
if(_.animating===true){_.swipeLeft=null;return false;}
_.setCSS(_.swipeLeft);};Slick.prototype.swipeStart=function(event){var _=this,touches;_.interrupted=true;if(_.touchObject.fingerCount!==1||_.slideCount<=_.options.slidesToShow){_.touchObject={};return false;}
if(event.originalEvent!==undefined&&event.originalEvent.touches!==undefined){touches=event.originalEvent.touches[0];}
_.touchObject.startX=_.touchObject.curX=touches!==undefined?touches.pageX:event.clientX;_.touchObject.startY=_.touchObject.curY=touches!==undefined?touches.pageY:event.clientY;_.dragging=true;};Slick.prototype.unfilterSlides=Slick.prototype.slickUnfilter=function(){var _=this;if(_.$slidesCache!==null){_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.appendTo(_.$slideTrack);_.reinit();}};Slick.prototype.unload=function(){var _=this;$('.slick-cloned',_.$slider).remove();if(_.$dots){_.$dots.remove();}
if(_.$prevArrow&&_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove();}
if(_.$nextArrow&&_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove();}
_.$slides.removeClass('slick-slide slick-active slick-visible slick-current').attr('aria-hidden','true').css('width','');};Slick.prototype.unslick=function(fromBreakpoint){var _=this;_.$slider.trigger('unslick',[_,fromBreakpoint]);_.destroy();};Slick.prototype.updateArrows=function(){var _=this,centerOffset;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow&&!_.options.infinite){_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled','false');_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled','false');if(_.currentSlide===0){_.$prevArrow.addClass('slick-disabled').attr('aria-disabled','true');_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled','false');}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow&&_.options.centerMode===false){_.$nextArrow.addClass('slick-disabled').attr('aria-disabled','true');_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled','false');}else if(_.currentSlide>=_.slideCount-1&&_.options.centerMode===true){_.$nextArrow.addClass('slick-disabled').attr('aria-disabled','true');_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled','false');}}};Slick.prototype.updateDots=function(){var _=this;if(_.$dots!==null){_.$dots.find('li').removeClass('slick-active').end();_.$dots.find('li').eq(Math.floor(_.currentSlide/_.options.slidesToScroll)).addClass('slick-active');}};Slick.prototype.visibility=function(){var _=this;if(_.options.autoplay){if(document[_.hidden]){_.interrupted=true;}else{_.interrupted=false;}}};$.fn.slick=function(){var _=this,opt=arguments[0],args=Array.prototype.slice.call(arguments,1),l=_.length,i,ret;for(i=0;i<l;i++){if(typeof opt=='object'||typeof opt=='undefined')
_[i].slick=new Slick(_[i],opt);else
ret=_[i].slick[opt].apply(_[i].slick,args);if(typeof ret!='undefined')return ret;}
return _;};}));;;
(function(mt,bn){typeof exports=="object"&&typeof module<"u"?bn(exports,require("./viewer/containers/ngop/ThumbnailNavigation"),require("./viewer/containers/ngop/WindowSideBarAnnotationsPanel"),require("./viewer/containers/ngop/WindowSideBarInfoPanel"),require("./viewer/containers/ngop/WindowSideBarCanvasPanel"),require("./viewer/containers/ngop/AttributionPanel"),require("./viewer/containers/ngop/LayersPanel"),require("./viewer/containers/ngop/CustomPanel"),require("./viewer/containers/ngop/WindowSideBarCollectionPanel"),require("./viewer/components/ngop/App")):typeof define=="function"&&define.amd?define(["exports","./viewer/containers/ngop/ThumbnailNavigation","./viewer/containers/ngop/WindowSideBarAnnotationsPanel","./viewer/containers/ngop/WindowSideBarInfoPanel","./viewer/containers/ngop/WindowSideBarCanvasPanel","./viewer/containers/ngop/AttributionPanel","./viewer/containers/ngop/LayersPanel","./viewer/containers/ngop/CustomPanel","./viewer/containers/ngop/WindowSideBarCollectionPanel","./viewer/components/ngop/App"],bn):(mt=typeof globalThis<"u"?globalThis:mt||self,bn(mt.TheViewerLib={},mt.ThumbnailNavigation,mt.WindowSideBarAnnotationsPanel,mt.WindowSideBarInfoPanel,mt.WindowSideBarCanvasPanel,mt.AttributionPanel,mt.LayersPanel,mt.CustomPanel,mt.WindowSideBarCollectionPanel,mt.TheApp))})(this,function(mt,bn,jo,ID,AD,DD,MD,ND,LD,kD){"use strict";var Rve=Object.defineProperty;var Ive=(mt,bn,jo)=>bn in mt?Rve(mt,bn,{enumerable:!0,configurable:!0,writable:!0,value:jo}):mt[bn]=jo;var Mt=(mt,bn,jo)=>Ive(mt,typeof bn!="symbol"?bn+"":bn,jo);function FD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var J=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function He(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Cn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var aw={exports:{}},Cu={},sw={exports:{}},Oe={};var ds=Symbol.for("react.element"),BD=Symbol.for("react.portal"),jD=Symbol.for("react.fragment"),WD=Symbol.for("react.strict_mode"),zD=Symbol.for("react.profiler"),HD=Symbol.for("react.provider"),UD=Symbol.for("react.context"),VD=Symbol.for("react.forward_ref"),GD=Symbol.for("react.suspense"),$D=Symbol.for("react.memo"),qD=Symbol.for("react.lazy"),lw=Symbol.iterator;function ZD(e){return e===null||typeof e!="object"?null:(e=lw&&e[lw]||e["@@iterator"],typeof e=="function"?e:null)}var uw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cw=Object.assign,dw={};function Wo(e,t,n){this.props=e,this.context=t,this.refs=dw,this.updater=n||uw}Wo.prototype.isReactComponent={},Wo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Wo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fw(){}fw.prototype=Wo.prototype;function np(e,t,n){this.props=e,this.context=t,this.refs=dw,this.updater=n||uw}var rp=np.prototype=new fw;rp.constructor=np,cw(rp,Wo.prototype),rp.isPureReactComponent=!0;var hw=Array.isArray,pw=Object.prototype.hasOwnProperty,ip={current:null},gw={key:!0,ref:!0,__self:!0,__source:!0};function mw(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)pw.call(t,r)&&!gw.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:ds,type:e,key:o,ref:a,props:i,_owner:ip.current}}function KD(e,t){return{$$typeof:ds,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function op(e){return typeof e=="object"&&e!==null&&e.$$typeof===ds}function YD(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vw=/\/+/g;function ap(e,t){return typeof e=="object"&&e!==null&&e.key!=null?YD(""+e.key):t.toString(36)}function Pu(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case ds:case BD:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+ap(a,0):r,hw(i)?(n="",e!=null&&(n=e.replace(vw,"$&/")+"/"),Pu(i,t,n,"",function(u){return u})):i!=null&&(op(i)&&(i=KD(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(vw,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",hw(e))for(var s=0;s<e.length;s++){o=e[s];var l=r+ap(o,s);a+=Pu(o,t,n,l,i)}else if(l=ZD(e),typeof l=="function")for(e=l.call(e),s=0;!(o=e.next()).done;)o=o.value,l=r+ap(o,s++),a+=Pu(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Ou(e,t,n){if(e==null)return e;var r=[],i=0;return Pu(e,r,"","",function(o){return t.call(n,o,i++)}),r}function XD(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var nn={current:null},Ru={transition:null},QD={ReactCurrentDispatcher:nn,ReactCurrentBatchConfig:Ru,ReactCurrentOwner:ip};function yw(){throw Error("act(...) is not supported in production builds of React.")}Oe.Children={map:Ou,forEach:function(e,t,n){Ou(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ou(e,function(){t++}),t},toArray:function(e){return Ou(e,function(t){return t})||[]},only:function(e){if(!op(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Oe.Component=Wo,Oe.Fragment=jD,Oe.Profiler=zD,Oe.PureComponent=np,Oe.StrictMode=WD,Oe.Suspense=GD,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QD,Oe.act=yw,Oe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=cw({},e.props),i=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=ip.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)pw.call(t,l)&&!gw.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:ds,type:e.type,key:i,ref:o,props:r,_owner:a}},Oe.createContext=function(e){return e={$$typeof:UD,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:HD,_context:e},e.Consumer=e},Oe.createElement=mw,Oe.createFactory=function(e){var t=mw.bind(null,e);return t.type=e,t},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(e){return{$$typeof:VD,render:e}},Oe.isValidElement=op,Oe.lazy=function(e){return{$$typeof:qD,_payload:{_status:-1,_result:e},_init:XD}},Oe.memo=function(e,t){return{$$typeof:$D,type:e,compare:t===void 0?null:t}},Oe.startTransition=function(e){var t=Ru.transition;Ru.transition={};try{e()}finally{Ru.transition=t}},Oe.unstable_act=yw,Oe.useCallback=function(e,t){return nn.current.useCallback(e,t)},Oe.useContext=function(e){return nn.current.useContext(e)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(e){return nn.current.useDeferredValue(e)},Oe.useEffect=function(e,t){return nn.current.useEffect(e,t)},Oe.useId=function(){return nn.current.useId()},Oe.useImperativeHandle=function(e,t,n){return nn.current.useImperativeHandle(e,t,n)},Oe.useInsertionEffect=function(e,t){return nn.current.useInsertionEffect(e,t)},Oe.useLayoutEffect=function(e,t){return nn.current.useLayoutEffect(e,t)},Oe.useMemo=function(e,t){return nn.current.useMemo(e,t)},Oe.useReducer=function(e,t,n){return nn.current.useReducer(e,t,n)},Oe.useRef=function(e){return nn.current.useRef(e)},Oe.useState=function(e){return nn.current.useState(e)},Oe.useSyncExternalStore=function(e,t,n){return nn.current.useSyncExternalStore(e,t,n)},Oe.useTransition=function(){return nn.current.useTransition()},Oe.version="18.3.1",sw.exports=Oe;var x=sw.exports;const Cr=He(x),sp=FD({__proto__:null,default:Cr},[x]);var JD=x,eM=Symbol.for("react.element"),tM=Symbol.for("react.fragment"),nM=Object.prototype.hasOwnProperty,rM=JD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,iM={key:!0,ref:!0,__self:!0,__source:!0};function ww(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)nM.call(t,r)&&!iM.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:eM,type:e,key:o,ref:a,props:i,_owner:rM.current}}Cu.Fragment=tM,Cu.jsx=ww,Cu.jsxs=ww,aw.exports=Cu;var S=aw.exports,_w={exports:{}},Pn={},Tw={exports:{}},Ew={};(function(e){function t(H,Y){var ae=H.length;H.push(Y);e:for(;0<ae;){var Te=ae-1>>>1,Se=H[Te];if(0<i(Se,Y))H[Te]=Y,H[ae]=Se,ae=Te;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var Y=H[0],ae=H.pop();if(ae!==Y){H[0]=ae;e:for(var Te=0,Se=H.length,oe=Se>>>1;Te<oe;){var be=2*(Te+1)-1,te=H[be],q=be+1,ee=H[q];if(0>i(te,ae))q<Se&&0>i(ee,te)?(H[Te]=ee,H[q]=ae,Te=q):(H[Te]=te,H[be]=ae,Te=be);else if(q<Se&&0>i(ee,ae))H[Te]=ee,H[q]=ae,Te=q;else break e}}return Y}function i(H,Y){var ae=H.sortIndex-Y.sortIndex;return ae!==0?ae:H.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,h=!1,g=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(H){for(var Y=n(u);Y!==null;){if(Y.callback===null)r(u);else if(Y.startTime<=H)r(u),Y.sortIndex=Y.expirationTime,t(l,Y);else break;Y=n(u)}}function b(H){if(p=!1,E(H),!g)if(n(l)!==null)g=!0,re(R);else{var Y=n(u);Y!==null&&fe(b,Y.startTime-H)}}function R(H,Y){g=!1,p&&(p=!1,m(D),D=-1),h=!0;var ae=f;try{for(E(Y),d=n(l);d!==null&&(!(d.expirationTime>Y)||H&&!B());){var Te=d.callback;if(typeof Te=="function"){d.callback=null,f=d.priorityLevel;var Se=Te(d.expirationTime<=Y);Y=e.unstable_now(),typeof Se=="function"?d.callback=Se:d===n(l)&&r(l),E(Y)}else r(l);d=n(l)}if(d!==null)var oe=!0;else{var be=n(u);be!==null&&fe(b,be.startTime-Y),oe=!1}return oe}finally{d=null,f=ae,h=!1}}var M=!1,C=null,D=-1,F=5,L=-1;function B(){return!(e.unstable_now()-L<F)}function z(){if(C!==null){var H=e.unstable_now();L=H;var Y=!0;try{Y=C(!0,H)}finally{Y?$():(M=!1,C=null)}}else M=!1}var $;if(typeof y=="function")$=function(){y(z)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,X=de.port2;de.port1.onmessage=z,$=function(){X.postMessage(null)}}else $=function(){v(z,0)};function re(H){C=H,M||(M=!0,$())}function fe(H,Y){D=v(function(){H(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_continueExecution=function(){g||h||(g=!0,re(R))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(H){switch(f){case 1:case 2:case 3:var Y=3;break;default:Y=f}var ae=f;f=Y;try{return H()}finally{f=ae}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,Y){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ae=f;f=H;try{return Y()}finally{f=ae}},e.unstable_scheduleCallback=function(H,Y,ae){var Te=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Te+ae:Te):ae=Te,H){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=ae+Se,H={id:c++,callback:Y,priorityLevel:H,startTime:ae,expirationTime:Se,sortIndex:-1},ae>Te?(H.sortIndex=ae,t(u,H),n(l)===null&&H===n(u)&&(p?(m(D),D=-1):p=!0,fe(b,ae-Te))):(H.sortIndex=Se,t(l,H),g||h||(g=!0,re(R))),H},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(H){var Y=f;return function(){var ae=f;f=Y;try{return H.apply(this,arguments)}finally{f=ae}}}})(Ew),Tw.exports=Ew;var oM=Tw.exports;var aM=x,On=oM;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var xw=new Set,fs={};function Ki(e,t){zo(e,t),zo(e+"Capture",t)}function zo(e,t){for(fs[e]=t,e=0;e<t.length;e++)xw.add(t[e])}var Hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lp=Object.prototype.hasOwnProperty,sM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Sw={},bw={};function lM(e){return lp.call(bw,e)?!0:lp.call(Sw,e)?!1:sM.test(e)?bw[e]=!0:(Sw[e]=!0,!1)}function uM(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function cM(e,t,n,r){if(t===null||typeof t>"u"||uM(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function rn(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Nt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nt[e]=new rn(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Nt[t]=new rn(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nt[e]=new rn(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nt[e]=new rn(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Nt[e]=new rn(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Nt[e]=new rn(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Nt[e]=new rn(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Nt[e]=new rn(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Nt[e]=new rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var up=/[\-:]([a-z])/g;function cp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(up,cp);Nt[t]=new rn(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(up,cp);Nt[t]=new rn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(up,cp);Nt[t]=new rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Nt[e]=new rn(e,1,!1,e.toLowerCase(),null,!1,!1)}),Nt.xlinkHref=new rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Nt[e]=new rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function dp(e,t,n,r){var i=Nt.hasOwnProperty(t)?Nt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(cM(t,n,i,r)&&(n=null),r||i===null?lM(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ur=aM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Iu=Symbol.for("react.element"),Ho=Symbol.for("react.portal"),Uo=Symbol.for("react.fragment"),fp=Symbol.for("react.strict_mode"),hp=Symbol.for("react.profiler"),Cw=Symbol.for("react.provider"),Pw=Symbol.for("react.context"),pp=Symbol.for("react.forward_ref"),gp=Symbol.for("react.suspense"),mp=Symbol.for("react.suspense_list"),vp=Symbol.for("react.memo"),si=Symbol.for("react.lazy"),Ow=Symbol.for("react.offscreen"),Rw=Symbol.iterator;function hs(e){return e===null||typeof e!="object"?null:(e=Rw&&e[Rw]||e["@@iterator"],typeof e=="function"?e:null)}var st=Object.assign,yp;function ps(e){if(yp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yp=t&&t[1]||""}return`
`+yp+e}var wp=!1;function _p(e,t){if(!e||wp)return"";wp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
`),o=r.stack.split(`
`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{wp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ps(e):""}function dM(e){switch(e.tag){case 5:return ps(e.type);case 16:return ps("Lazy");case 13:return ps("Suspense");case 19:return ps("SuspenseList");case 0:case 2:case 15:return e=_p(e.type,!1),e;case 11:return e=_p(e.type.render,!1),e;case 1:return e=_p(e.type,!0),e;default:return""}}function Tp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Uo:return"Fragment";case Ho:return"Portal";case hp:return"Profiler";case fp:return"StrictMode";case gp:return"Suspense";case mp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pw:return(e.displayName||"Context")+".Consumer";case Cw:return(e._context.displayName||"Context")+".Provider";case pp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vp:return t=e.displayName||null,t!==null?t:Tp(e.type)||"Memo";case si:t=e._payload,e=e._init;try{return Tp(e(t))}catch{}}return null}function fM(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Tp(t);case 8:return t===fp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function li(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Iw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hM(e){var t=Iw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Au(e){e._valueTracker||(e._valueTracker=hM(e))}function Aw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Iw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Du(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ep(e,t){var n=t.checked;return st({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Dw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=li(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mw(e,t){t=t.checked,t!=null&&dp(e,"checked",t,!1)}function xp(e,t){Mw(e,t);var n=li(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Sp(e,t.type,n):t.hasOwnProperty("defaultValue")&&Sp(e,t.type,li(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Nw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Sp(e,t,n){(t!=="number"||Du(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gs=Array.isArray;function Vo(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+li(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function bp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return st({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Lw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(gs(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:li(n)}}function kw(e,t){var n=li(t.value),r=li(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Fw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Bw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Cp(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Bw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mu,jw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML" in e)e.innerHTML=t;else{for(Mu=Mu||document.createElement("div"),Mu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ms(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pM=["Webkit","ms","Moz","O"];Object.keys(vs).forEach(function(e){pM.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vs[t]=vs[e]})});function Ww(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||vs.hasOwnProperty(e)&&vs[e]?(""+t).trim():t+"px"}function zw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Ww(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var gM=st({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Pp(e,t){if(t){if(gM[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html" in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Op(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rp=null;function Ip(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ap=null,Go=null,$o=null;function Hw(e){if(e=js(e)){if(typeof Ap!="function")throw Error(K(280));var t=e.stateNode;t&&(t=nc(t),Ap(e.stateNode,e.type,t))}}function Uw(e){Go?$o?$o.push(e):$o=[e]:Go=e}function Vw(){if(Go){var e=Go,t=$o;if($o=Go=null,Hw(e),t)for(e=0;e<t.length;e++)Hw(t[e])}}function Gw(e,t){return e(t)}function $w(){}var Dp=!1;function qw(e,t,n){if(Dp)return e(t,n);Dp=!0;try{return Gw(e,t,n)}finally{Dp=!1,(Go!==null||$o!==null)&&($w(),Vw())}}function ys(e,t){var n=e.stateNode;if(n===null)return null;var r=nc(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var Mp=!1;if(Hr)try{var ws={};Object.defineProperty(ws,"passive",{get:function(){Mp=!0}}),window.addEventListener("test",ws,ws),window.removeEventListener("test",ws,ws)}catch{Mp=!1}function mM(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var _s=!1,Nu=null,Lu=!1,Np=null,vM={onError:function(e){_s=!0,Nu=e}};function yM(e,t,n,r,i,o,a,s,l){_s=!1,Nu=null,mM.apply(vM,arguments)}function wM(e,t,n,r,i,o,a,s,l){if(yM.apply(this,arguments),_s){if(_s){var u=Nu;_s=!1,Nu=null}else throw Error(K(198));Lu||(Lu=!0,Np=u)}}function Yi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Zw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Kw(e){if(Yi(e)!==e)throw Error(K(188))}function _M(e){var t=e.alternate;if(!t){if(t=Yi(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Kw(i),e;if(o===r)return Kw(i),t;o=o.sibling}throw Error(K(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function Yw(e){return e=_M(e),e!==null?Xw(e):null}function Xw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xw(e);if(t!==null)return t;e=e.sibling}return null}var Qw=On.unstable_scheduleCallback,Jw=On.unstable_cancelCallback,TM=On.unstable_shouldYield,EM=On.unstable_requestPaint,vt=On.unstable_now,xM=On.unstable_getCurrentPriorityLevel,Lp=On.unstable_ImmediatePriority,e_=On.unstable_UserBlockingPriority,ku=On.unstable_NormalPriority,SM=On.unstable_LowPriority,t_=On.unstable_IdlePriority,Fu=null,Pr=null;function bM(e){if(Pr&&typeof Pr.onCommitFiberRoot=="function")try{Pr.onCommitFiberRoot(Fu,e,void 0,(e.current.flags&128)===128)}catch{}}var fr=Math.clz32?Math.clz32:OM,CM=Math.log,PM=Math.LN2;function OM(e){return e>>>=0,e===0?32:31-(CM(e)/PM|0)|0}var Bu=64,ju=4194304;function Ts(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Ts(s):(o&=a,o!==0&&(r=Ts(o)))}else a=n&~i,a!==0?r=Ts(a):o!==0&&(r=Ts(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-fr(t),i=1<<n,r|=e[n],t&=~i;return r}function RM(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function IM(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-fr(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=RM(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function kp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function n_(){var e=Bu;return Bu<<=1,!(Bu&4194240)&&(Bu=64),e}function Fp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Es(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fr(t),e[t]=n}function AM(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-fr(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function Bp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-fr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ve=0;function r_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var i_,jp,o_,a_,s_,Wp=!1,zu=[],ui=null,ci=null,di=null,xs=new Map,Ss=new Map,fi=[],DM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function l_(e,t){switch(e){case"focusin":case"focusout":ui=null;break;case"dragenter":case"dragleave":ci=null;break;case"mouseover":case"mouseout":di=null;break;case"pointerover":case"pointerout":xs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ss.delete(t.pointerId)}}function bs(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=js(t),t!==null&&jp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function MM(e,t,n,r,i){switch(t){case"focusin":return ui=bs(ui,e,t,n,r,i),!0;case"dragenter":return ci=bs(ci,e,t,n,r,i),!0;case"mouseover":return di=bs(di,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return xs.set(o,bs(xs.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Ss.set(o,bs(Ss.get(o)||null,e,t,n,r,i)),!0}return!1}function u_(e){var t=Xi(e.target);if(t!==null){var n=Yi(t);if(n!==null){if(t=n.tag,t===13){if(t=Zw(n),t!==null){e.blockedOn=t,s_(e.priority,function(){o_(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hp(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Rp=r,n.target.dispatchEvent(r),Rp=null}else return t=js(n),t!==null&&jp(t),e.blockedOn=n,!1;t.shift()}return!0}function c_(e,t,n){Hu(e)&&n.delete(t)}function NM(){Wp=!1,ui!==null&&Hu(ui)&&(ui=null),ci!==null&&Hu(ci)&&(ci=null),di!==null&&Hu(di)&&(di=null),xs.forEach(c_),Ss.forEach(c_)}function Cs(e,t){e.blockedOn===t&&(e.blockedOn=null,Wp||(Wp=!0,On.unstable_scheduleCallback(On.unstable_NormalPriority,NM)))}function Ps(e){function t(i){return Cs(i,e)}if(0<zu.length){Cs(zu[0],e);for(var n=1;n<zu.length;n++){var r=zu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ui!==null&&Cs(ui,e),ci!==null&&Cs(ci,e),di!==null&&Cs(di,e),xs.forEach(t),Ss.forEach(t),n=0;n<fi.length;n++)r=fi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<fi.length&&(n=fi[0],n.blockedOn===null);)u_(n),n.blockedOn===null&&fi.shift()}var qo=Ur.ReactCurrentBatchConfig,Uu=!0;function LM(e,t,n,r){var i=Ve,o=qo.transition;qo.transition=null;try{Ve=1,zp(e,t,n,r)}finally{Ve=i,qo.transition=o}}function kM(e,t,n,r){var i=Ve,o=qo.transition;qo.transition=null;try{Ve=4,zp(e,t,n,r)}finally{Ve=i,qo.transition=o}}function zp(e,t,n,r){if(Uu){var i=Hp(e,t,n,r);if(i===null)og(e,t,r,Vu,n),l_(e,r);else if(MM(i,e,t,n,r))r.stopPropagation();else if(l_(e,r),t&4&&-1<DM.indexOf(e)){for(;i!==null;){var o=js(i);if(o!==null&&i_(o),o=Hp(e,t,n,r),o===null&&og(e,t,r,Vu,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else og(e,t,r,null,n)}}var Vu=null;function Hp(e,t,n,r){if(Vu=null,e=Ip(r),e=Xi(e),e!==null)if(t=Yi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Zw(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Vu=e,null}function d_(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(xM()){case Lp:return 1;case e_:return 4;case ku:case SM:return 16;case t_:return 536870912;default:return 16}default:return 16}}var hi=null,Up=null,Gu=null;function f_(){if(Gu)return Gu;var e,t=Up,n=t.length,r,i="value" in hi?hi.value:hi.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return Gu=i.slice(e,1<r?1-r:void 0)}function $u(e){var t=e.keyCode;return"charCode" in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function qu(){return!0}function h_(){return!1}function Rn(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?qu:h_,this.isPropagationStopped=h_,this}return st(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=qu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=qu)},persist:function(){},isPersistent:qu}),t}var Zo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vp=Rn(Zo),Os=st({},Zo,{view:0,detail:0}),FM=Rn(Os),Gp,$p,Rs,Zu=st({},Os,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX" in e?e.movementX:(e!==Rs&&(Rs&&e.type==="mousemove"?(Gp=e.screenX-Rs.screenX,$p=e.screenY-Rs.screenY):$p=Gp=0,Rs=e),Gp)},movementY:function(e){return"movementY" in e?e.movementY:$p}}),p_=Rn(Zu),BM=st({},Zu,{dataTransfer:0}),jM=Rn(BM),WM=st({},Os,{relatedTarget:0}),qp=Rn(WM),zM=st({},Zo,{animationName:0,elapsedTime:0,pseudoElement:0}),HM=Rn(zM),UM=st({},Zo,{clipboardData:function(e){return"clipboardData" in e?e.clipboardData:window.clipboardData}}),VM=Rn(UM),GM=st({},Zo,{data:0}),g_=Rn(GM),$M={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qM={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ZM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KM(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ZM[e])?!!t[e]:!1}function Zp(){return KM}var YM=st({},Os,{key:function(e){if(e.key){var t=$M[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$u(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qM[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zp,charCode:function(e){return e.type==="keypress"?$u(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$u(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),XM=Rn(YM),QM=st({},Zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m_=Rn(QM),JM=st({},Os,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zp}),eN=Rn(JM),tN=st({},Zo,{propertyName:0,elapsedTime:0,pseudoElement:0}),nN=Rn(tN),rN=st({},Zu,{deltaX:function(e){return"deltaX" in e?e.deltaX:"wheelDeltaX" in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY" in e?e.deltaY:"wheelDeltaY" in e?-e.wheelDeltaY:"wheelDelta" in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iN=Rn(rN),oN=[9,13,27,32],Kp=Hr&&"CompositionEvent" in window,Is=null;Hr&&"documentMode" in document&&(Is=document.documentMode);var aN=Hr&&"TextEvent" in window&&!Is,v_=Hr&&(!Kp||Is&&8<Is&&11>=Is),y_=" ",w_=!1;function __(e,t){switch(e){case"keyup":return oN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T_(e){return e=e.detail,typeof e=="object"&&"data" in e?e.data:null}var Ko=!1;function sN(e,t){switch(e){case"compositionend":return T_(t);case"keypress":return t.which!==32?null:(w_=!0,y_);case"textInput":return e=t.data,e===y_&&w_?null:e;default:return null}}function lN(e,t){if(Ko)return e==="compositionend"||!Kp&&__(e,t)?(e=f_(),Gu=Up=hi=null,Ko=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return v_&&t.locale!=="ko"?null:t.data;default:return null}}var uN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function E_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uN[e.type]:t==="textarea"}function x_(e,t,n,r){Uw(r),t=Ju(t,"onChange"),0<t.length&&(n=new Vp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var As=null,Ds=null;function cN(e){z_(e,0)}function Ku(e){var t=ea(e);if(Aw(t))return e}function dN(e,t){if(e==="change")return t}var S_=!1;if(Hr){var Yp;if(Hr){var Xp="oninput" in document;if(!Xp){var b_=document.createElement("div");b_.setAttribute("oninput","return;"),Xp=typeof b_.oninput=="function"}Yp=Xp}else Yp=!1;S_=Yp&&(!document.documentMode||9<document.documentMode)}function C_(){As&&(As.detachEvent("onpropertychange",P_),Ds=As=null)}function P_(e){if(e.propertyName==="value"&&Ku(Ds)){var t=[];x_(t,Ds,e,Ip(e)),qw(cN,t)}}function fN(e,t,n){e==="focusin"?(C_(),As=t,Ds=n,As.attachEvent("onpropertychange",P_)):e==="focusout"&&C_()}function hN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ku(Ds)}function pN(e,t){if(e==="click")return Ku(t)}function gN(e,t){if(e==="input"||e==="change")return Ku(t)}function mN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hr=typeof Object.is=="function"?Object.is:mN;function Ms(e,t){if(hr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!lp.call(t,i)||!hr(e[i],t[i]))return!1}return!0}function O_(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function R_(e,t){var n=O_(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=O_(n)}}function I_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?I_(e,t.parentNode):"contains" in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function A_(){for(var e=window,t=Du();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Du(e.document)}return t}function Qp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function vN(e){var t=A_(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&I_(n.ownerDocument.documentElement,n)){if(r!==null&&Qp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart" in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=R_(n,o);var a=R_(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var yN=Hr&&"documentMode" in document&&11>=document.documentMode,Yo=null,Jp=null,Ns=null,eg=!1;function D_(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;eg||Yo==null||Yo!==Du(r)||(r=Yo,"selectionStart" in r&&Qp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ns&&Ms(Ns,r)||(Ns=r,r=Ju(Jp,"onSelect"),0<r.length&&(t=new Vp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Yo)))}function Yu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xo={animationend:Yu("Animation","AnimationEnd"),animationiteration:Yu("Animation","AnimationIteration"),animationstart:Yu("Animation","AnimationStart"),transitionend:Yu("Transition","TransitionEnd")},tg={},M_={};Hr&&(M_=document.createElement("div").style,"AnimationEvent" in window||(delete Xo.animationend.animation,delete Xo.animationiteration.animation,delete Xo.animationstart.animation),"TransitionEvent" in window||delete Xo.transitionend.transition);function Xu(e){if(tg[e])return tg[e];if(!Xo[e])return e;var t=Xo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in M_)return tg[e]=t[n];return e}var N_=Xu("animationend"),L_=Xu("animationiteration"),k_=Xu("animationstart"),F_=Xu("transitionend"),B_=new Map,j_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function pi(e,t){B_.set(e,t),Ki(t,[e])}for(var ng=0;ng<j_.length;ng++){var rg=j_[ng],wN=rg.toLowerCase(),_N=rg[0].toUpperCase()+rg.slice(1);pi(wN,"on"+_N)}pi(N_,"onAnimationEnd"),pi(L_,"onAnimationIteration"),pi(k_,"onAnimationStart"),pi("dblclick","onDoubleClick"),pi("focusin","onFocus"),pi("focusout","onBlur"),pi(F_,"onTransitionEnd"),zo("onMouseEnter",["mouseout","mouseover"]),zo("onMouseLeave",["mouseout","mouseover"]),zo("onPointerEnter",["pointerout","pointerover"]),zo("onPointerLeave",["pointerout","pointerover"]),Ki("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ki("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ki("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ki("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ki("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ki("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ls="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),TN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ls));function W_(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,wM(r,t,void 0,e),e.currentTarget=null}function z_(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;W_(i,s,u),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;W_(i,s,u),o=l}}}if(Lu)throw e=Np,Lu=!1,Np=null,e}function tt(e,t){var n=t[dg];n===void 0&&(n=t[dg]=new Set);var r=e+"__bubble";n.has(r)||(H_(t,e,2,!1),n.add(r))}function ig(e,t,n){var r=0;t&&(r|=4),H_(n,e,r,t)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function ks(e){if(!e[Qu]){e[Qu]=!0,xw.forEach(function(n){n!=="selectionchange"&&(TN.has(n)||ig(n,!1,e),ig(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qu]||(t[Qu]=!0,ig("selectionchange",!1,t))}}function H_(e,t,n,r){switch(d_(t)){case 1:var i=LM;break;case 4:i=kM;break;default:i=zp}n=i.bind(null,t,n,e),i=void 0,!Mp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function og(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Xi(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}qw(function(){var u=o,c=Ip(n),d=[];e:{var f=B_.get(e);if(f!==void 0){var h=Vp,g=e;switch(e){case"keypress":if($u(n)===0)break e;case"keydown":case"keyup":h=XM;break;case"focusin":g="focus",h=qp;break;case"focusout":g="blur",h=qp;break;case"beforeblur":case"afterblur":h=qp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=p_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=jM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=eN;break;case N_:case L_:case k_:h=HM;break;case F_:h=nN;break;case"scroll":h=FM;break;case"wheel":h=iN;break;case"copy":case"cut":case"paste":h=VM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=m_}var p=(t&4)!==0,v=!p&&e==="scroll",m=p?f!==null?f+"Capture":null:f;p=[];for(var y=u,E;y!==null;){E=y;var b=E.stateNode;if(E.tag===5&&b!==null&&(E=b,m!==null&&(b=ys(y,m),b!=null&&p.push(Fs(y,b,E)))),v)break;y=y.return}0<p.length&&(f=new h(f,g,null,n,c),d.push({event:f,listeners:p}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Rp&&(g=n.relatedTarget||n.fromElement)&&(Xi(g)||g[Vr]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=u,g=g?Xi(g):null,g!==null&&(v=Yi(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=u),h!==g)){if(p=p_,b="onMouseLeave",m="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(p=m_,b="onPointerLeave",m="onPointerEnter",y="pointer"),v=h==null?f:ea(h),E=g==null?f:ea(g),f=new p(b,y+"leave",h,n,c),f.target=v,f.relatedTarget=E,b=null,Xi(c)===u&&(p=new p(m,y+"enter",g,n,c),p.target=E,p.relatedTarget=v,b=p),v=b,h&&g)t:{for(p=h,m=g,y=0,E=p;E;E=Qo(E))y++;for(E=0,b=m;b;b=Qo(b))E++;for(;0<y-E;)p=Qo(p),y--;for(;0<E-y;)m=Qo(m),E--;for(;y--;){if(p===m||m!==null&&p===m.alternate)break t;p=Qo(p),m=Qo(m)}p=null}else p=null;h!==null&&U_(d,f,h,p,!1),g!==null&&v!==null&&U_(d,v,g,p,!0)}}e:{if(f=u?ea(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var R=dN;else if(E_(f))if(S_)R=gN;else{R=hN;var M=fN}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(R=pN);if(R&&(R=R(e,u))){x_(d,R,n,c);break e}M&&M(e,f,u),e==="focusout"&&(M=f._wrapperState)&&M.controlled&&f.type==="number"&&Sp(f,"number",f.value)}switch(M=u?ea(u):window,e){case"focusin":(E_(M)||M.contentEditable==="true")&&(Yo=M,Jp=u,Ns=null);break;case"focusout":Ns=Jp=Yo=null;break;case"mousedown":eg=!0;break;case"contextmenu":case"mouseup":case"dragend":eg=!1,D_(d,n,c);break;case"selectionchange":if(yN)break;case"keydown":case"keyup":D_(d,n,c)}var C;if(Kp)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else Ko?__(e,n)&&(D="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(v_&&n.locale!=="ko"&&(Ko||D!=="onCompositionStart"?D==="onCompositionEnd"&&Ko&&(C=f_()):(hi=c,Up="value" in hi?hi.value:hi.textContent,Ko=!0)),M=Ju(u,D),0<M.length&&(D=new g_(D,e,null,n,c),d.push({event:D,listeners:M}),C?D.data=C:(C=T_(n),C!==null&&(D.data=C)))),(C=aN?sN(e,n):lN(e,n))&&(u=Ju(u,"onBeforeInput"),0<u.length&&(c=new g_("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}z_(d,t)})}function Fs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ju(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=ys(e,n),o!=null&&r.unshift(Fs(e,o,i)),o=ys(e,t),o!=null&&r.push(Fs(e,o,i))),e=e.return}return r}function Qo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function U_(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=ys(n,o),l!=null&&a.unshift(Fs(n,l,s))):i||(l=ys(n,o),l!=null&&a.push(Fs(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var EN=/\r\n?/g,xN=/\u0000|\uFFFD/g;function V_(e){return(typeof e=="string"?e:""+e).replace(EN,`
`).replace(xN,"")}function ec(e,t,n){if(t=V_(t),V_(e)!==t&&n)throw Error(K(425))}function tc(){}var ag=null,sg=null;function lg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ug=typeof setTimeout=="function"?setTimeout:void 0,SN=typeof clearTimeout=="function"?clearTimeout:void 0,G_=typeof Promise=="function"?Promise:void 0,bN=typeof queueMicrotask=="function"?queueMicrotask:typeof G_<"u"?function(e){return G_.resolve(null).then(e).catch(CN)}:ug;function CN(e){setTimeout(function(){throw e})}function cg(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Ps(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ps(t)}function gi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $_(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Jo=Math.random().toString(36).slice(2),Or="__reactFiber$"+Jo,Bs="__reactProps$"+Jo,Vr="__reactContainer$"+Jo,dg="__reactEvents$"+Jo,PN="__reactListeners$"+Jo,ON="__reactHandles$"+Jo;function Xi(e){var t=e[Or];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Vr]||n[Or]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$_(e);e!==null;){if(n=e[Or])return n;e=$_(e)}return t}e=n,n=e.parentNode}return null}function js(e){return e=e[Or]||e[Vr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ea(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function nc(e){return e[Bs]||null}var fg=[],ta=-1;function mi(e){return{current:e}}function nt(e){0>ta||(e.current=fg[ta],fg[ta]=null,ta--)}function Xe(e,t){ta++,fg[ta]=e.current,e.current=t}var vi={},Gt=mi(vi),fn=mi(!1),Qi=vi;function na(e,t){var n=e.type.contextTypes;if(!n)return vi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function hn(e){return e=e.childContextTypes,e!=null}function rc(){nt(fn),nt(Gt)}function q_(e,t,n){if(Gt.current!==vi)throw Error(K(168));Xe(Gt,t),Xe(fn,n)}function Z_(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(K(108,fM(e)||"Unknown",i));return st({},n,r)}function ic(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vi,Qi=Gt.current,Xe(Gt,e),Xe(fn,fn.current),!0}function K_(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=Z_(e,t,Qi),r.__reactInternalMemoizedMergedChildContext=e,nt(fn),nt(Gt),Xe(Gt,e)):nt(fn),Xe(fn,n)}var Gr=null,oc=!1,hg=!1;function Y_(e){Gr===null?Gr=[e]:Gr.push(e)}function RN(e){oc=!0,Y_(e)}function yi(){if(!hg&&Gr!==null){hg=!0;var e=0,t=Ve;try{var n=Gr;for(Ve=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Gr=null,oc=!1}catch(i){throw Gr!==null&&(Gr=Gr.slice(e+1)),Qw(Lp,yi),i}finally{Ve=t,hg=!1}}return null}var ra=[],ia=0,ac=null,sc=0,$n=[],qn=0,Ji=null,$r=1,qr="";function eo(e,t){ra[ia++]=sc,ra[ia++]=ac,ac=e,sc=t}function X_(e,t,n){$n[qn++]=$r,$n[qn++]=qr,$n[qn++]=Ji,Ji=e;var r=$r;e=qr;var i=32-fr(r)-1;r&=~(1<<i),n+=1;var o=32-fr(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,$r=1<<32-fr(t)+i|n<<i|r,qr=o+e}else $r=1<<o|n<<i|r,qr=e}function pg(e){e.return!==null&&(eo(e,1),X_(e,1,0))}function gg(e){for(;e===ac;)ac=ra[--ia],ra[ia]=null,sc=ra[--ia],ra[ia]=null;for(;e===Ji;)Ji=$n[--qn],$n[qn]=null,qr=$n[--qn],$n[qn]=null,$r=$n[--qn],$n[qn]=null}var In=null,An=null,ot=!1,pr=null;function Q_(e,t){var n=Xn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function J_(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,In=e,An=gi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,In=e,An=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ji!==null?{id:$r,overflow:qr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,In=e,An=null,!0):!1;default:return!1}}function mg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vg(e){if(ot){var t=An;if(t){var n=t;if(!J_(e,t)){if(mg(e))throw Error(K(418));t=gi(n.nextSibling);var r=In;t&&J_(e,t)?Q_(r,n):(e.flags=e.flags&-4097|2,ot=!1,In=e)}}else{if(mg(e))throw Error(K(418));e.flags=e.flags&-4097|2,ot=!1,In=e}}}function eT(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;In=e}function lc(e){if(e!==In)return!1;if(!ot)return eT(e),ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!lg(e.type,e.memoizedProps)),t&&(t=An)){if(mg(e))throw tT(),Error(K(418));for(;t;)Q_(e,t),t=gi(t.nextSibling)}if(eT(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){An=gi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}An=null}}else An=In?gi(e.stateNode.nextSibling):null;return!0}function tT(){for(var e=An;e;)e=gi(e.nextSibling)}function oa(){An=In=null,ot=!1}function yg(e){pr===null?pr=[e]:pr.push(e)}var IN=Ur.ReactCurrentBatchConfig;function Ws(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function uc(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function nT(e){var t=e._init;return t(e._payload)}function rT(e){function t(m,y){if(e){var E=m.deletions;E===null?(m.deletions=[y],m.flags|=16):E.push(y)}}function n(m,y){if(!e)return null;for(;y!==null;)t(m,y),y=y.sibling;return null}function r(m,y){for(m=new Map;y!==null;)y.key!==null?m.set(y.key,y):m.set(y.index,y),y=y.sibling;return m}function i(m,y){return m=Ci(m,y),m.index=0,m.sibling=null,m}function o(m,y,E){return m.index=E,e?(E=m.alternate,E!==null?(E=E.index,E<y?(m.flags|=2,y):E):(m.flags|=2,y)):(m.flags|=1048576,y)}function a(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,y,E,b){return y===null||y.tag!==6?(y=um(E,m.mode,b),y.return=m,y):(y=i(y,E),y.return=m,y)}function l(m,y,E,b){var R=E.type;return R===Uo?c(m,y,E.props.children,b,E.key):y!==null&&(y.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===si&&nT(R)===y.type)?(b=i(y,E.props),b.ref=Ws(m,y,E),b.return=m,b):(b=Mc(E.type,E.key,E.props,null,m.mode,b),b.ref=Ws(m,y,E),b.return=m,b)}function u(m,y,E,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==E.containerInfo||y.stateNode.implementation!==E.implementation?(y=cm(E,m.mode,b),y.return=m,y):(y=i(y,E.children||[]),y.return=m,y)}function c(m,y,E,b,R){return y===null||y.tag!==7?(y=lo(E,m.mode,b,R),y.return=m,y):(y=i(y,E),y.return=m,y)}function d(m,y,E){if(typeof y=="string"&&y!==""||typeof y=="number")return y=um(""+y,m.mode,E),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Iu:return E=Mc(y.type,y.key,y.props,null,m.mode,E),E.ref=Ws(m,null,y),E.return=m,E;case Ho:return y=cm(y,m.mode,E),y.return=m,y;case si:var b=y._init;return d(m,b(y._payload),E)}if(gs(y)||hs(y))return y=lo(y,m.mode,E,null),y.return=m,y;uc(m,y)}return null}function f(m,y,E,b){var R=y!==null?y.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return R!==null?null:s(m,y,""+E,b);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Iu:return E.key===R?l(m,y,E,b):null;case Ho:return E.key===R?u(m,y,E,b):null;case si:return R=E._init,f(m,y,R(E._payload),b)}if(gs(E)||hs(E))return R!==null?null:c(m,y,E,b,null);uc(m,E)}return null}function h(m,y,E,b,R){if(typeof b=="string"&&b!==""||typeof b=="number")return m=m.get(E)||null,s(y,m,""+b,R);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Iu:return m=m.get(b.key===null?E:b.key)||null,l(y,m,b,R);case Ho:return m=m.get(b.key===null?E:b.key)||null,u(y,m,b,R);case si:var M=b._init;return h(m,y,E,M(b._payload),R)}if(gs(b)||hs(b))return m=m.get(E)||null,c(y,m,b,R,null);uc(y,b)}return null}function g(m,y,E,b){for(var R=null,M=null,C=y,D=y=0,F=null;C!==null&&D<E.length;D++){C.index>D?(F=C,C=null):F=C.sibling;var L=f(m,C,E[D],b);if(L===null){C===null&&(C=F);break}e&&C&&L.alternate===null&&t(m,C),y=o(L,y,D),M===null?R=L:M.sibling=L,M=L,C=F}if(D===E.length)return n(m,C),ot&&eo(m,D),R;if(C===null){for(;D<E.length;D++)C=d(m,E[D],b),C!==null&&(y=o(C,y,D),M===null?R=C:M.sibling=C,M=C);return ot&&eo(m,D),R}for(C=r(m,C);D<E.length;D++)F=h(C,m,D,E[D],b),F!==null&&(e&&F.alternate!==null&&C.delete(F.key===null?D:F.key),y=o(F,y,D),M===null?R=F:M.sibling=F,M=F);return e&&C.forEach(function(B){return t(m,B)}),ot&&eo(m,D),R}function p(m,y,E,b){var R=hs(E);if(typeof R!="function")throw Error(K(150));if(E=R.call(E),E==null)throw Error(K(151));for(var M=R=null,C=y,D=y=0,F=null,L=E.next();C!==null&&!L.done;D++,L=E.next()){C.index>D?(F=C,C=null):F=C.sibling;var B=f(m,C,L.value,b);if(B===null){C===null&&(C=F);break}e&&C&&B.alternate===null&&t(m,C),y=o(B,y,D),M===null?R=B:M.sibling=B,M=B,C=F}if(L.done)return n(m,C),ot&&eo(m,D),R;if(C===null){for(;!L.done;D++,L=E.next())L=d(m,L.value,b),L!==null&&(y=o(L,y,D),M===null?R=L:M.sibling=L,M=L);return ot&&eo(m,D),R}for(C=r(m,C);!L.done;D++,L=E.next())L=h(C,m,D,L.value,b),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?D:L.key),y=o(L,y,D),M===null?R=L:M.sibling=L,M=L);return e&&C.forEach(function(z){return t(m,z)}),ot&&eo(m,D),R}function v(m,y,E,b){if(typeof E=="object"&&E!==null&&E.type===Uo&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Iu:e:{for(var R=E.key,M=y;M!==null;){if(M.key===R){if(R=E.type,R===Uo){if(M.tag===7){n(m,M.sibling),y=i(M,E.props.children),y.return=m,m=y;break e}}else if(M.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===si&&nT(R)===M.type){n(m,M.sibling),y=i(M,E.props),y.ref=Ws(m,M,E),y.return=m,m=y;break e}n(m,M);break}else t(m,M);M=M.sibling}E.type===Uo?(y=lo(E.props.children,m.mode,b,E.key),y.return=m,m=y):(b=Mc(E.type,E.key,E.props,null,m.mode,b),b.ref=Ws(m,y,E),b.return=m,m=b)}return a(m);case Ho:e:{for(M=E.key;y!==null;){if(y.key===M)if(y.tag===4&&y.stateNode.containerInfo===E.containerInfo&&y.stateNode.implementation===E.implementation){n(m,y.sibling),y=i(y,E.children||[]),y.return=m,m=y;break e}else{n(m,y);break}else t(m,y);y=y.sibling}y=cm(E,m.mode,b),y.return=m,m=y}return a(m);case si:return M=E._init,v(m,y,M(E._payload),b)}if(gs(E))return g(m,y,E,b);if(hs(E))return p(m,y,E,b);uc(m,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,y!==null&&y.tag===6?(n(m,y.sibling),y=i(y,E),y.return=m,m=y):(n(m,y),y=um(E,m.mode,b),y.return=m,m=y),a(m)):n(m,y)}return v}var aa=rT(!0),iT=rT(!1),cc=mi(null),dc=null,sa=null,wg=null;function _g(){wg=sa=dc=null}function Tg(e){var t=cc.current;nt(cc),e._currentValue=t}function Eg(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function la(e,t){dc=e,wg=sa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pn=!0),e.firstContext=null)}function Zn(e){var t=e._currentValue;if(wg!==e)if(e={context:e,memoizedValue:t,next:null},sa===null){if(dc===null)throw Error(K(308));sa=e,dc.dependencies={lanes:0,firstContext:e}}else sa=sa.next=e;return t}var to=null;function xg(e){to===null?to=[e]:to.push(e)}function oT(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,xg(t)):(n.next=i.next,i.next=n),t.interleaved=n,Zr(e,r)}function Zr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var wi=!1;function Sg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aT(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _i(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ke&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Zr(e,n)}return i=r.interleaved,i===null?(t.next=t,xg(r)):(t.next=i.next,i.next=t),r.interleaved=t,Zr(e,n)}function fc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bp(e,n)}}function sT(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hc(e,t,n,r){var i=e.updateQueue;wi=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,c=u=l=null,s=o;do{var f=s.lane,h=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,p=s;switch(f=t,h=n,p.tag){case 1:if(g=p.payload,typeof g=="function"){d=g.call(h,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,f=typeof g=="function"?g.call(h,d,f):g,f==null)break e;d=st({},d,f);break e;case 2:wi=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);io|=a,e.lanes=a,e.memoizedState=d}}function lT(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(K(191,i));i.call(r)}}}var zs={},Rr=mi(zs),Hs=mi(zs),Us=mi(zs);function no(e){if(e===zs)throw Error(K(174));return e}function bg(e,t){switch(Xe(Us,t),Xe(Hs,e),Xe(Rr,zs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Cp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Cp(t,e)}nt(Rr),Xe(Rr,t)}function ua(){nt(Rr),nt(Hs),nt(Us)}function uT(e){no(Us.current);var t=no(Rr.current),n=Cp(t,e.type);t!==n&&(Xe(Hs,e),Xe(Rr,n))}function Cg(e){Hs.current===e&&(nt(Rr),nt(Hs))}var lt=mi(0);function pc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pg=[];function Og(){for(var e=0;e<Pg.length;e++)Pg[e]._workInProgressVersionPrimary=null;Pg.length=0}var gc=Ur.ReactCurrentDispatcher,Rg=Ur.ReactCurrentBatchConfig,ro=0,ut=null,bt=null,Rt=null,mc=!1,Vs=!1,Gs=0,AN=0;function $t(){throw Error(K(321))}function Ig(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hr(e[n],t[n]))return!1;return!0}function Ag(e,t,n,r,i,o){if(ro=o,ut=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gc.current=e===null||e.memoizedState===null?LN:kN,e=n(r,i),Vs){o=0;do{if(Vs=!1,Gs=0,25<=o)throw Error(K(301));o+=1,Rt=bt=null,t.updateQueue=null,gc.current=FN,e=n(r,i)}while(Vs)}if(gc.current=wc,t=bt!==null&&bt.next!==null,ro=0,Rt=bt=ut=null,mc=!1,t)throw Error(K(300));return e}function Dg(){var e=Gs!==0;return Gs=0,e}function Ir(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?ut.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function Kn(){if(bt===null){var e=ut.alternate;e=e!==null?e.memoizedState:null}else e=bt.next;var t=Rt===null?ut.memoizedState:Rt.next;if(t!==null)Rt=t,bt=e;else{if(e===null)throw Error(K(310));bt=e,e={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Rt===null?ut.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function $s(e,t){return typeof t=="function"?t(e):t}function Mg(e){var t=Kn(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=bt,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,u=o;do{var c=u.lane;if((ro&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=d,a=r):l=l.next=d,ut.lanes|=c,io|=c}u=u.next}while(u!==null&&u!==o);l===null?a=r:l.next=s,hr(r,t.memoizedState)||(pn=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,ut.lanes|=o,io|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ng(e){var t=Kn(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);hr(o,t.memoizedState)||(pn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function cT(){}function dT(e,t){var n=ut,r=Kn(),i=t(),o=!hr(r.memoizedState,i);if(o&&(r.memoizedState=i,pn=!0),r=r.queue,Lg(pT.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Rt!==null&&Rt.memoizedState.tag&1){if(n.flags|=2048,qs(9,hT.bind(null,n,r,i,t),void 0,null),It===null)throw Error(K(349));ro&30||fT(n,t,i)}return i}function fT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ut.updateQueue,t===null?(t={lastEffect:null,stores:null},ut.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hT(e,t,n,r){t.value=n,t.getSnapshot=r,gT(t)&&mT(e)}function pT(e,t,n){return n(function(){gT(t)&&mT(e)})}function gT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hr(e,n)}catch{return!0}}function mT(e){var t=Zr(e,1);t!==null&&yr(t,e,1,-1)}function vT(e){var t=Ir();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:e},t.queue=e,e=e.dispatch=NN.bind(null,ut,e),[t.memoizedState,e]}function qs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ut.updateQueue,t===null?(t={lastEffect:null,stores:null},ut.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function yT(){return Kn().memoizedState}function vc(e,t,n,r){var i=Ir();ut.flags|=e,i.memoizedState=qs(1|t,n,void 0,r===void 0?null:r)}function yc(e,t,n,r){var i=Kn();r=r===void 0?null:r;var o=void 0;if(bt!==null){var a=bt.memoizedState;if(o=a.destroy,r!==null&&Ig(r,a.deps)){i.memoizedState=qs(t,n,o,r);return}}ut.flags|=e,i.memoizedState=qs(1|t,n,o,r)}function wT(e,t){return vc(8390656,8,e,t)}function Lg(e,t){return yc(2048,8,e,t)}function _T(e,t){return yc(4,2,e,t)}function TT(e,t){return yc(4,4,e,t)}function ET(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xT(e,t,n){return n=n!=null?n.concat([e]):null,yc(4,4,ET.bind(null,t,e),n)}function kg(){}function ST(e,t){var n=Kn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ig(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bT(e,t){var n=Kn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ig(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function CT(e,t,n){return ro&21?(hr(n,t)||(n=n_(),ut.lanes|=n,io|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,pn=!0),e.memoizedState=n)}function DN(e,t){var n=Ve;Ve=n!==0&&4>n?n:4,e(!0);var r=Rg.transition;Rg.transition={};try{e(!1),t()}finally{Ve=n,Rg.transition=r}}function PT(){return Kn().memoizedState}function MN(e,t,n){var r=Si(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},OT(e))RT(t,n);else if(n=oT(e,t,n,r),n!==null){var i=an();yr(n,e,r,i),IT(n,t,r)}}function NN(e,t,n){var r=Si(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(OT(e))RT(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,hr(s,a)){var l=t.interleaved;l===null?(i.next=i,xg(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=oT(e,t,i,r),n!==null&&(i=an(),yr(n,e,r,i),IT(n,t,r))}}function OT(e){var t=e.alternate;return e===ut||t!==null&&t===ut}function RT(e,t){Vs=mc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function IT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bp(e,n)}}var wc={readContext:Zn,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useInsertionEffect:$t,useLayoutEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useMutableSource:$t,useSyncExternalStore:$t,useId:$t,unstable_isNewReconciler:!1},LN={readContext:Zn,useCallback:function(e,t){return Ir().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:wT,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vc(4194308,4,ET.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vc(4194308,4,e,t)},useInsertionEffect:function(e,t){return vc(4,2,e,t)},useMemo:function(e,t){var n=Ir();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ir();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=MN.bind(null,ut,e),[r.memoizedState,e]},useRef:function(e){var t=Ir();return e={current:e},t.memoizedState=e},useState:vT,useDebugValue:kg,useDeferredValue:function(e){return Ir().memoizedState=e},useTransition:function(){var e=vT(!1),t=e[0];return e=DN.bind(null,e[1]),Ir().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ut,i=Ir();if(ot){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),It===null)throw Error(K(349));ro&30||fT(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,wT(pT.bind(null,r,o,e),[e]),r.flags|=2048,qs(9,hT.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ir(),t=It.identifierPrefix;if(ot){var n=qr,r=$r;n=(r&~(1<<32-fr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Gs++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=AN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},kN={readContext:Zn,useCallback:ST,useContext:Zn,useEffect:Lg,useImperativeHandle:xT,useInsertionEffect:_T,useLayoutEffect:TT,useMemo:bT,useReducer:Mg,useRef:yT,useState:function(){return Mg($s)},useDebugValue:kg,useDeferredValue:function(e){var t=Kn();return CT(t,bt.memoizedState,e)},useTransition:function(){var e=Mg($s)[0],t=Kn().memoizedState;return[e,t]},useMutableSource:cT,useSyncExternalStore:dT,useId:PT,unstable_isNewReconciler:!1},FN={readContext:Zn,useCallback:ST,useContext:Zn,useEffect:Lg,useImperativeHandle:xT,useInsertionEffect:_T,useLayoutEffect:TT,useMemo:bT,useReducer:Ng,useRef:yT,useState:function(){return Ng($s)},useDebugValue:kg,useDeferredValue:function(e){var t=Kn();return bt===null?t.memoizedState=e:CT(t,bt.memoizedState,e)},useTransition:function(){var e=Ng($s)[0],t=Kn().memoizedState;return[e,t]},useMutableSource:cT,useSyncExternalStore:dT,useId:PT,unstable_isNewReconciler:!1};function gr(e,t){if(e&&e.defaultProps){t=st({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Fg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:st({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={isMounted:function(e){return(e=e._reactInternals)?Yi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=an(),i=Si(e),o=Kr(r,i);o.payload=t,n!=null&&(o.callback=n),t=_i(e,o,i),t!==null&&(yr(t,e,i,r),fc(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=an(),i=Si(e),o=Kr(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=_i(e,o,i),t!==null&&(yr(t,e,i,r),fc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=an(),r=Si(e),i=Kr(n,r);i.tag=2,t!=null&&(i.callback=t),t=_i(e,i,r),t!==null&&(yr(t,e,r,n),fc(t,e,r))}};function AT(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!Ms(n,r)||!Ms(i,o):!0}function DT(e,t,n){var r=!1,i=vi,o=t.contextType;return typeof o=="object"&&o!==null?o=Zn(o):(i=hn(t)?Qi:Gt.current,r=t.contextTypes,o=(r=r!=null)?na(e,i):vi),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_c,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function MT(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function Bg(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Sg(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Zn(o):(o=hn(t)?Qi:Gt.current,i.context=na(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Fg(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&_c.enqueueReplaceState(i,i.state,null),hc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ca(e,t){try{var n="",r=t;do n+=dM(r),r=r.return;while(r);var i=n}catch(o){i=`
Error generating stack: `+o.message+`
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function jg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Wg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var BN=typeof WeakMap=="function"?WeakMap:Map;function NT(e,t,n){n=Kr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Pc||(Pc=!0,tm=r),Wg(e,t)},n}function LT(e,t,n){n=Kr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Wg(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Wg(e,t),typeof r!="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function kT(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new BN;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=QN.bind(null,e,t,n),t.then(e,e))}function FT(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function BT(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Kr(-1,1),t.tag=2,_i(n,t,1))),n.lanes|=1),e)}var jN=Ur.ReactCurrentOwner,pn=!1;function on(e,t,n,r){t.child=e===null?iT(t,null,n,r):aa(t,e.child,n,r)}function jT(e,t,n,r,i){n=n.render;var o=t.ref;return la(t,i),r=Ag(e,t,n,r,o,i),n=Dg(),e!==null&&!pn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Yr(e,t,i)):(ot&&n&&pg(t),t.flags|=1,on(e,t,r,i),t.child)}function WT(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!lm(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,zT(e,t,o,r,i)):(e=Mc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ms,n(a,r)&&e.ref===t.ref)return Yr(e,t,i)}return t.flags|=1,e=Ci(o,r),e.ref=t.ref,e.return=t,t.child=e}function zT(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Ms(o,r)&&e.ref===t.ref)if(pn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(pn=!0);else return t.lanes=e.lanes,Yr(e,t,i)}return zg(e,t,n,r,i)}function HT(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(fa,Dn),Dn|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Xe(fa,Dn),Dn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Xe(fa,Dn),Dn|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,Xe(fa,Dn),Dn|=r;return on(e,t,i,n),t.child}function UT(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zg(e,t,n,r,i){var o=hn(n)?Qi:Gt.current;return o=na(t,o),la(t,i),n=Ag(e,t,n,r,o,i),r=Dg(),e!==null&&!pn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Yr(e,t,i)):(ot&&r&&pg(t),t.flags|=1,on(e,t,n,i),t.child)}function VT(e,t,n,r,i){if(hn(n)){var o=!0;ic(t)}else o=!1;if(la(t,i),t.stateNode===null)Ec(e,t),DT(t,n,r),Bg(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Zn(u):(u=hn(n)?Qi:Gt.current,u=na(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&MT(t,a,r,u),wi=!1;var f=t.memoizedState;a.state=f,hc(t,r,a,i),l=t.memoizedState,s!==r||f!==l||fn.current||wi?(typeof c=="function"&&(Fg(t,n,c,r),l=t.memoizedState),(s=wi||AT(t,n,s,r,f,l,u))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,aT(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:gr(t.type,s),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zn(l):(l=hn(n)?Qi:Gt.current,l=na(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==d||f!==l)&&MT(t,a,r,l),wi=!1,f=t.memoizedState,a.state=f,hc(t,r,a,i);var g=t.memoizedState;s!==d||f!==g||fn.current||wi?(typeof h=="function"&&(Fg(t,n,h,r),g=t.memoizedState),(u=wi||AT(t,n,u,r,f,g,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Hg(e,t,n,r,o,i)}function Hg(e,t,n,r,i,o){UT(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&K_(t,n,!1),Yr(e,t,o);r=t.stateNode,jN.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=aa(t,e.child,null,o),t.child=aa(t,null,s,o)):on(e,t,s,o),t.memoizedState=r.state,i&&K_(t,n,!0),t.child}function GT(e){var t=e.stateNode;t.pendingContext?q_(e,t.pendingContext,t.pendingContext!==t.context):t.context&&q_(e,t.context,!1),bg(e,t.containerInfo)}function $T(e,t,n,r,i){return oa(),yg(i),t.flags|=256,on(e,t,n,r),t.child}var Ug={dehydrated:null,treeContext:null,retryLane:0};function Vg(e){return{baseLanes:e,cachePool:null,transitions:null}}function qT(e,t,n){var r=t.pendingProps,i=lt.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Xe(lt,i&1),e===null)return vg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=Nc(a,r,0,null),e=lo(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Vg(n),t.memoizedState=Ug,e):Gg(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return WN(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Ci(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=Ci(s,o):(o=lo(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?Vg(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=Ug,r}return o=e.child,e=o.sibling,r=Ci(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Gg(e,t){return t=Nc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Tc(e,t,n,r){return r!==null&&yg(r),aa(t,e.child,null,n),e=Gg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function WN(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=jg(Error(K(422))),Tc(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Nc({mode:"visible",children:r.children},i,0,null),o=lo(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&aa(t,e.child,null,a),t.child.memoizedState=Vg(a),t.memoizedState=Ug,o);if(!(t.mode&1))return Tc(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(K(419)),r=jg(o,r,void 0),Tc(e,t,a,r)}if(s=(a&e.childLanes)!==0,pn||s){if(r=It,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Zr(e,i),yr(r,e,i,-1))}return sm(),r=jg(Error(K(421))),Tc(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=JN.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,An=gi(i.nextSibling),In=t,ot=!0,pr=null,e!==null&&($n[qn++]=$r,$n[qn++]=qr,$n[qn++]=Ji,$r=e.id,qr=e.overflow,Ji=t),t=Gg(t,r.children),t.flags|=4096,t)}function ZT(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Eg(e.return,t,n)}function $g(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function KT(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(on(e,t,r.children,n),r=lt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ZT(e,n,t);else if(e.tag===19)ZT(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Xe(lt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&pc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$g(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&pc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$g(t,!0,n,null,o);break;case"together":$g(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ec(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Yr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),io|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=Ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zN(e,t,n){switch(t.tag){case 3:GT(t),oa();break;case 5:uT(t);break;case 1:hn(t.type)&&ic(t);break;case 4:bg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Xe(cc,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Xe(lt,lt.current&1),t.flags|=128,null):n&t.child.childLanes?qT(e,t,n):(Xe(lt,lt.current&1),e=Yr(e,t,n),e!==null?e.sibling:null);Xe(lt,lt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return KT(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Xe(lt,lt.current),r)break;return null;case 22:case 23:return t.lanes=0,HT(e,t,n)}return Yr(e,t,n)}var YT,qg,XT,QT;YT=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},qg=function(){},XT=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,no(Rr.current);var o=null;switch(n){case"input":i=Ep(e,i),r=Ep(e,r),o=[];break;case"select":i=st({},i,{value:void 0}),r=st({},r,{value:void 0}),o=[];break;case"textarea":i=bp(e,i),r=bp(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=tc)}Pp(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(fs.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(fs.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&tt("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},QT=function(e,t,n,r){n!==r&&(t.flags|=4)};function Zs(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function qt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function HN(e,t,n){var r=t.pendingProps;switch(gg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(t),null;case 1:return hn(t.type)&&rc(),qt(t),null;case 3:return r=t.stateNode,ua(),nt(fn),nt(Gt),Og(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(lc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pr!==null&&(im(pr),pr=null))),qg(e,t),qt(t),null;case 5:Cg(t);var i=no(Us.current);if(n=t.type,e!==null&&t.stateNode!=null)XT(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return qt(t),null}if(e=no(Rr.current),lc(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Or]=t,r[Bs]=o,e=(t.mode&1)!==0,n){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(i=0;i<Ls.length;i++)tt(Ls[i],r);break;case"source":tt("error",r);break;case"img":case"image":case"link":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"input":Dw(r,o),tt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},tt("invalid",r);break;case"textarea":Lw(r,o),tt("invalid",r)}Pp(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&ec(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&ec(r.textContent,s,e),i=["children",""+s]):fs.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&tt("scroll",r)}switch(n){case"input":Au(r),Nw(r,o,!0);break;case"textarea":Au(r),Fw(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=tc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Bw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Or]=t,e[Bs]=r,YT(e,t,!1,!1),t.stateNode=e;e:{switch(a=Op(n,r),n){case"dialog":tt("cancel",e),tt("close",e),i=r;break;case"iframe":case"object":case"embed":tt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ls.length;i++)tt(Ls[i],e);i=r;break;case"source":tt("error",e),i=r;break;case"img":case"image":case"link":tt("error",e),tt("load",e),i=r;break;case"details":tt("toggle",e),i=r;break;case"input":Dw(e,r),i=Ep(e,r),tt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=st({},r,{value:void 0}),tt("invalid",e);break;case"textarea":Lw(e,r),i=bp(e,r),tt("invalid",e);break;default:i=r}Pp(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?zw(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&jw(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ms(e,l):typeof l=="number"&&ms(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(fs.hasOwnProperty(o)?l!=null&&o==="onScroll"&&tt("scroll",e):l!=null&&dp(e,o,l,a))}switch(n){case"input":Au(e),Nw(e,r,!1);break;case"textarea":Au(e),Fw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+li(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Vo(e,!!r.multiple,o,!1):r.defaultValue!=null&&Vo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=tc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qt(t),null;case 6:if(e&&t.stateNode!=null)QT(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=no(Us.current),no(Rr.current),lc(t)){if(r=t.stateNode,n=t.memoizedProps,r[Or]=t,(o=r.nodeValue!==n)&&(e=In,e!==null))switch(e.tag){case 3:ec(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ec(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Or]=t,t.stateNode=r}return qt(t),null;case 13:if(nt(lt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ot&&An!==null&&t.mode&1&&!(t.flags&128))tT(),oa(),t.flags|=98560,o=!1;else if(o=lc(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(K(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(K(317));o[Or]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qt(t),o=!1}else pr!==null&&(im(pr),pr=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||lt.current&1?Ct===0&&(Ct=3):sm())),t.updateQueue!==null&&(t.flags|=4),qt(t),null);case 4:return ua(),qg(e,t),e===null&&ks(t.stateNode.containerInfo),qt(t),null;case 10:return Tg(t.type._context),qt(t),null;case 17:return hn(t.type)&&rc(),qt(t),null;case 19:if(nt(lt),o=t.memoizedState,o===null)return qt(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)Zs(o,!1);else{if(Ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=pc(e),a!==null){for(t.flags|=128,Zs(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Xe(lt,lt.current&1|2),t.child}e=e.sibling}o.tail!==null&&vt()>ha&&(t.flags|=128,r=!0,Zs(o,!1),t.lanes=4194304)}else{if(!r)if(e=pc(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Zs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!ot)return qt(t),null}else 2*vt()-o.renderingStartTime>ha&&n!==1073741824&&(t.flags|=128,r=!0,Zs(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=vt(),t.sibling=null,n=lt.current,Xe(lt,r?n&1|2:n&1),t):(qt(t),null);case 22:case 23:return am(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Dn&1073741824&&(qt(t),t.subtreeFlags&6&&(t.flags|=8192)):qt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function UN(e,t){switch(gg(t),t.tag){case 1:return hn(t.type)&&rc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(),nt(fn),nt(Gt),Og(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cg(t),null;case 13:if(nt(lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(lt),null;case 4:return ua(),null;case 10:return Tg(t.type._context),null;case 22:case 23:return am(),null;case 24:return null;default:return null}}var xc=!1,Zt=!1,VN=typeof WeakSet=="function"?WeakSet:Set,ue=null;function da(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ft(e,t,r)}else n.current=null}function Zg(e,t,n){try{n()}catch(r){ft(e,t,r)}}var JT=!1;function GN(e,t){if(ag=Uu,e=A_(),Qp(e)){if("selectionStart" in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=a),f===o&&++c===r&&(l=a),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(sg={focusedElem:e,selectionRange:n},Uu=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,v=g.memoizedState,m=t.stateNode,y=m.getSnapshotBeforeUpdate(t.elementType===t.type?p:gr(t.type,p),v);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(b){ft(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return g=JT,JT=!1,g}function Ks(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Zg(t,n,o)}i=i.next}while(i!==r)}}function Sc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Kg(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function eE(e){var t=e.alternate;t!==null&&(e.alternate=null,eE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Or],delete t[Bs],delete t[dg],delete t[PN],delete t[ON])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function tE(e){return e.tag===5||e.tag===3||e.tag===4}function nE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tc));else if(r!==4&&(e=e.child,e!==null))for(Yg(e,t,n),e=e.sibling;e!==null;)Yg(e,t,n),e=e.sibling}function Xg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Xg(e,t,n),e=e.sibling;e!==null;)Xg(e,t,n),e=e.sibling}var Lt=null,mr=!1;function Ti(e,t,n){for(n=n.child;n!==null;)rE(e,t,n),n=n.sibling}function rE(e,t,n){if(Pr&&typeof Pr.onCommitFiberUnmount=="function")try{Pr.onCommitFiberUnmount(Fu,n)}catch{}switch(n.tag){case 5:Zt||da(n,t);case 6:var r=Lt,i=mr;Lt=null,Ti(e,t,n),Lt=r,mr=i,Lt!==null&&(mr?(e=Lt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Lt.removeChild(n.stateNode));break;case 18:Lt!==null&&(mr?(e=Lt,n=n.stateNode,e.nodeType===8?cg(e.parentNode,n):e.nodeType===1&&cg(e,n),Ps(e)):cg(Lt,n.stateNode));break;case 4:r=Lt,i=mr,Lt=n.stateNode.containerInfo,mr=!0,Ti(e,t,n),Lt=r,mr=i;break;case 0:case 11:case 14:case 15:if(!Zt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Zg(n,t,a),i=i.next}while(i!==r)}Ti(e,t,n);break;case 1:if(!Zt&&(da(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ft(n,t,s)}Ti(e,t,n);break;case 21:Ti(e,t,n);break;case 22:n.mode&1?(Zt=(r=Zt)||n.memoizedState!==null,Ti(e,t,n),Zt=r):Ti(e,t,n);break;default:Ti(e,t,n)}}function iE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new VN),t.forEach(function(r){var i=eL.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function vr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:Lt=s.stateNode,mr=!1;break e;case 3:Lt=s.stateNode.containerInfo,mr=!0;break e;case 4:Lt=s.stateNode.containerInfo,mr=!0;break e}s=s.return}if(Lt===null)throw Error(K(160));rE(o,a,i),Lt=null,mr=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){ft(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)oE(t,e),t=t.sibling}function oE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vr(t,e),Ar(e),r&4){try{Ks(3,e,e.return),Sc(3,e)}catch(p){ft(e,e.return,p)}try{Ks(5,e,e.return)}catch(p){ft(e,e.return,p)}}break;case 1:vr(t,e),Ar(e),r&512&&n!==null&&da(n,n.return);break;case 5:if(vr(t,e),Ar(e),r&512&&n!==null&&da(n,n.return),e.flags&32){var i=e.stateNode;try{ms(i,"")}catch(p){ft(e,e.return,p)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&Mw(i,o),Op(s,a);var u=Op(s,o);for(a=0;a<l.length;a+=2){var c=l[a],d=l[a+1];c==="style"?zw(i,d):c==="dangerouslySetInnerHTML"?jw(i,d):c==="children"?ms(i,d):dp(i,c,d,u)}switch(s){case"input":xp(i,o);break;case"textarea":kw(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Vo(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Vo(i,!!o.multiple,o.defaultValue,!0):Vo(i,!!o.multiple,o.multiple?[]:"",!1))}i[Bs]=o}catch(p){ft(e,e.return,p)}}break;case 6:if(vr(t,e),Ar(e),r&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(p){ft(e,e.return,p)}}break;case 3:if(vr(t,e),Ar(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ps(t.containerInfo)}catch(p){ft(e,e.return,p)}break;case 4:vr(t,e),Ar(e);break;case 13:vr(t,e),Ar(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(em=vt())),r&4&&iE(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Zt=(u=Zt)||c,vr(t,e),Zt=u):vr(t,e),Ar(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(ue=e,c=e.child;c!==null;){for(d=ue=c;ue!==null;){switch(f=ue,h=f.child,f.tag){case 0:case 11:case 14:case 15:Ks(4,f,f.return);break;case 1:da(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(p){ft(r,n,p)}}break;case 5:da(f,f.return);break;case 22:if(f.memoizedState!==null){lE(d);continue}}h!==null?(h.return=f,ue=h):lE(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=Ww("display",a))}catch(p){ft(e,e.return,p)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(p){ft(e,e.return,p)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:vr(t,e),Ar(e),r&4&&iE(e);break;case 21:break;default:vr(t,e),Ar(e)}}function Ar(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(tE(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ms(i,""),r.flags&=-33);var o=nE(e);Xg(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=nE(e);Yg(e,s,a);break;default:throw Error(K(161))}}catch(l){ft(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $N(e,t,n){ue=e,aE(e)}function aE(e,t,n){for(var r=(e.mode&1)!==0;ue!==null;){var i=ue,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||xc;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||Zt;s=xc;var u=Zt;if(xc=a,(Zt=l)&&!u)for(ue=i;ue!==null;)a=ue,l=a.child,a.tag===22&&a.memoizedState!==null?uE(i):l!==null?(l.return=a,ue=l):uE(i);for(;o!==null;)ue=o,aE(o),o=o.sibling;ue=i,xc=s,Zt=u}sE(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ue=o):sE(e)}}function sE(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Zt||Sc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Zt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:gr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&lT(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lT(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ps(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Zt||t.flags&512&&Kg(t)}catch(f){ft(t,t.return,f)}}if(t===e){ue=null;break}if(n=t.sibling,n!==null){n.return=t.return,ue=n;break}ue=t.return}}function lE(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ue=n;break}ue=t.return}}function uE(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Sc(4,t)}catch(l){ft(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){ft(t,i,l)}}var o=t.return;try{Kg(t)}catch(l){ft(t,o,l)}break;case 5:var a=t.return;try{Kg(t)}catch(l){ft(t,a,l)}}}catch(l){ft(t,t.return,l)}if(t===e){ue=null;break}var s=t.sibling;if(s!==null){s.return=t.return,ue=s;break}ue=t.return}}var qN=Math.ceil,bc=Ur.ReactCurrentDispatcher,Qg=Ur.ReactCurrentOwner,Yn=Ur.ReactCurrentBatchConfig,ke=0,It=null,Tt=null,kt=0,Dn=0,fa=mi(0),Ct=0,Ys=null,io=0,Cc=0,Jg=0,Xs=null,gn=null,em=0,ha=1/0,Xr=null,Pc=!1,tm=null,Ei=null,Oc=!1,xi=null,Rc=0,Qs=0,nm=null,Ic=-1,Ac=0;function an(){return ke&6?vt():Ic!==-1?Ic:Ic=vt()}function Si(e){return e.mode&1?ke&2&&kt!==0?kt&-kt:IN.transition!==null?(Ac===0&&(Ac=n_()),Ac):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:d_(e.type)),e):1}function yr(e,t,n,r){if(50<Qs)throw Qs=0,nm=null,Error(K(185));Es(e,n,r),(!(ke&2)||e!==It)&&(e===It&&(!(ke&2)&&(Cc|=n),Ct===4&&bi(e,kt)),mn(e,r),n===1&&ke===0&&!(t.mode&1)&&(ha=vt()+500,oc&&yi()))}function mn(e,t){var n=e.callbackNode;IM(e,t);var r=Wu(e,e===It?kt:0);if(r===0)n!==null&&Jw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Jw(n),t===1)e.tag===0?RN(dE.bind(null,e)):Y_(dE.bind(null,e)),bN(function(){!(ke&6)&&yi()}),n=null;else{switch(r_(r)){case 1:n=Lp;break;case 4:n=e_;break;case 16:n=ku;break;case 536870912:n=t_;break;default:n=ku}n=wE(n,cE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cE(e,t){if(Ic=-1,Ac=0,ke&6)throw Error(K(327));var n=e.callbackNode;if(pa()&&e.callbackNode!==n)return null;var r=Wu(e,e===It?kt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Dc(e,r);else{t=r;var i=ke;ke|=2;var o=hE();(It!==e||kt!==t)&&(Xr=null,ha=vt()+500,ao(e,t));do try{YN();break}catch(s){fE(e,s)}while(!0);_g(),bc.current=o,ke=i,Tt!==null?t=0:(It=null,kt=0,t=Ct)}if(t!==0){if(t===2&&(i=kp(e),i!==0&&(r=i,t=rm(e,i))),t===1)throw n=Ys,ao(e,0),bi(e,r),mn(e,vt()),n;if(t===6)bi(e,r);else{if(i=e.current.alternate,!(r&30)&&!ZN(i)&&(t=Dc(e,r),t===2&&(o=kp(e),o!==0&&(r=o,t=rm(e,o))),t===1))throw n=Ys,ao(e,0),bi(e,r),mn(e,vt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:so(e,gn,Xr);break;case 3:if(bi(e,r),(r&130023424)===r&&(t=em+500-vt(),10<t)){if(Wu(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){an(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ug(so.bind(null,e,gn,Xr),t);break}so(e,gn,Xr);break;case 4:if(bi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-fr(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=vt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qN(r/1960))-r,10<r){e.timeoutHandle=ug(so.bind(null,e,gn,Xr),r);break}so(e,gn,Xr);break;case 5:so(e,gn,Xr);break;default:throw Error(K(329))}}}return mn(e,vt()),e.callbackNode===n?cE.bind(null,e):null}function rm(e,t){var n=Xs;return e.current.memoizedState.isDehydrated&&(ao(e,t).flags|=256),e=Dc(e,t),e!==2&&(t=gn,gn=n,t!==null&&im(t)),e}function im(e){gn===null?gn=e:gn.push.apply(gn,e)}function ZN(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!hr(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bi(e,t){for(t&=~Jg,t&=~Cc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-fr(t),r=1<<n;e[n]=-1,t&=~r}}function dE(e){if(ke&6)throw Error(K(327));pa();var t=Wu(e,0);if(!(t&1))return mn(e,vt()),null;var n=Dc(e,t);if(e.tag!==0&&n===2){var r=kp(e);r!==0&&(t=r,n=rm(e,r))}if(n===1)throw n=Ys,ao(e,0),bi(e,t),mn(e,vt()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,so(e,gn,Xr),mn(e,vt()),null}function om(e,t){var n=ke;ke|=1;try{return e(t)}finally{ke=n,ke===0&&(ha=vt()+500,oc&&yi())}}function oo(e){xi!==null&&xi.tag===0&&!(ke&6)&&pa();var t=ke;ke|=1;var n=Yn.transition,r=Ve;try{if(Yn.transition=null,Ve=1,e)return e()}finally{Ve=r,Yn.transition=n,ke=t,!(ke&6)&&yi()}}function am(){Dn=fa.current,nt(fa)}function ao(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,SN(n)),Tt!==null)for(n=Tt.return;n!==null;){var r=n;switch(gg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&rc();break;case 3:ua(),nt(fn),nt(Gt),Og();break;case 5:Cg(r);break;case 4:ua();break;case 13:nt(lt);break;case 19:nt(lt);break;case 10:Tg(r.type._context);break;case 22:case 23:am()}n=n.return}if(It=e,Tt=e=Ci(e.current,null),kt=Dn=t,Ct=0,Ys=null,Jg=Cc=io=0,gn=Xs=null,to!==null){for(t=0;t<to.length;t++)if(n=to[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}to=null}return e}function fE(e,t){do{var n=Tt;try{if(_g(),gc.current=wc,mc){for(var r=ut.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}mc=!1}if(ro=0,Rt=bt=ut=null,Vs=!1,Gs=0,Qg.current=null,n===null||n.return===null){Ct=1,Ys=t,Tt=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=kt,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=FT(a);if(h!==null){h.flags&=-257,BT(h,a,s,o,t),h.mode&1&&kT(o,u,t),t=h,l=u;var g=t.updateQueue;if(g===null){var p=new Set;p.add(l),t.updateQueue=p}else g.add(l);break e}else{if(!(t&1)){kT(o,u,t),sm();break e}l=Error(K(426))}}else if(ot&&s.mode&1){var v=FT(a);if(v!==null){!(v.flags&65536)&&(v.flags|=256),BT(v,a,s,o,t),yg(ca(l,s));break e}}o=l=ca(l,s),Ct!==4&&(Ct=2),Xs===null?Xs=[o]:Xs.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=NT(o,l,t);sT(o,m);break e;case 1:s=l;var y=o.type,E=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Ei===null||!Ei.has(E)))){o.flags|=65536,t&=-t,o.lanes|=t;var b=LT(o,s,t);sT(o,b);break e}}o=o.return}while(o!==null)}gE(n)}catch(R){t=R,Tt===n&&n!==null&&(Tt=n=n.return);continue}break}while(!0)}function hE(){var e=bc.current;return bc.current=wc,e===null?wc:e}function sm(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),It===null||!(io&268435455)&&!(Cc&268435455)||bi(It,kt)}function Dc(e,t){var n=ke;ke|=2;var r=hE();(It!==e||kt!==t)&&(Xr=null,ao(e,t));do try{KN();break}catch(i){fE(e,i)}while(!0);if(_g(),ke=n,bc.current=r,Tt!==null)throw Error(K(261));return It=null,kt=0,Ct}function KN(){for(;Tt!==null;)pE(Tt)}function YN(){for(;Tt!==null&&!TM();)pE(Tt)}function pE(e){var t=yE(e.alternate,e,Dn);e.memoizedProps=e.pendingProps,t===null?gE(e):Tt=t,Qg.current=null}function gE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=UN(n,t),n!==null){n.flags&=32767,Tt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ct=6,Tt=null;return}}else if(n=HN(n,t,Dn),n!==null){Tt=n;return}if(t=t.sibling,t!==null){Tt=t;return}Tt=t=e}while(t!==null);Ct===0&&(Ct=5)}function so(e,t,n){var r=Ve,i=Yn.transition;try{Yn.transition=null,Ve=1,XN(e,t,n,r)}finally{Yn.transition=i,Ve=r}return null}function XN(e,t,n,r){do pa();while(xi!==null);if(ke&6)throw Error(K(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(AM(e,o),e===It&&(Tt=It=null,kt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Oc||(Oc=!0,wE(ku,function(){return pa(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Yn.transition,Yn.transition=null;var a=Ve;Ve=1;var s=ke;ke|=4,Qg.current=null,GN(e,n),oE(n,e),vN(sg),Uu=!!ag,sg=ag=null,e.current=n,$N(n),EM(),ke=s,Ve=a,Yn.transition=o}else e.current=n;if(Oc&&(Oc=!1,xi=e,Rc=i),o=e.pendingLanes,o===0&&(Ei=null),bM(n.stateNode),mn(e,vt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Pc)throw Pc=!1,e=tm,tm=null,e;return Rc&1&&e.tag!==0&&pa(),o=e.pendingLanes,o&1?e===nm?Qs++:(Qs=0,nm=e):Qs=0,yi(),null}function pa(){if(xi!==null){var e=r_(Rc),t=Yn.transition,n=Ve;try{if(Yn.transition=null,Ve=16>e?16:e,xi===null)var r=!1;else{if(e=xi,xi=null,Rc=0,ke&6)throw Error(K(331));var i=ke;for(ke|=4,ue=e.current;ue!==null;){var o=ue,a=o.child;if(ue.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(ue=u;ue!==null;){var c=ue;switch(c.tag){case 0:case 11:case 15:Ks(8,c,o)}var d=c.child;if(d!==null)d.return=c,ue=d;else for(;ue!==null;){c=ue;var f=c.sibling,h=c.return;if(eE(c),c===u){ue=null;break}if(f!==null){f.return=h,ue=f;break}ue=h}}}var g=o.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var v=p.sibling;p.sibling=null,p=v}while(p!==null)}}ue=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,ue=a;else e:for(;ue!==null;){if(o=ue,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ks(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,ue=m;break e}ue=o.return}}var y=e.current;for(ue=y;ue!==null;){a=ue;var E=a.child;if(a.subtreeFlags&2064&&E!==null)E.return=a,ue=E;else e:for(a=y;ue!==null;){if(s=ue,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Sc(9,s)}}catch(R){ft(s,s.return,R)}if(s===a){ue=null;break e}var b=s.sibling;if(b!==null){b.return=s.return,ue=b;break e}ue=s.return}}if(ke=i,yi(),Pr&&typeof Pr.onPostCommitFiberRoot=="function")try{Pr.onPostCommitFiberRoot(Fu,e)}catch{}r=!0}return r}finally{Ve=n,Yn.transition=t}}return!1}function mE(e,t,n){t=ca(n,t),t=NT(e,t,1),e=_i(e,t,1),t=an(),e!==null&&(Es(e,1,t),mn(e,t))}function ft(e,t,n){if(e.tag===3)mE(e,e,n);else for(;t!==null;){if(t.tag===3){mE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ei===null||!Ei.has(r))){e=ca(n,e),e=LT(t,e,1),t=_i(t,e,1),e=an(),t!==null&&(Es(t,1,e),mn(t,e));break}}t=t.return}}function QN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=an(),e.pingedLanes|=e.suspendedLanes&n,It===e&&(kt&n)===n&&(Ct===4||Ct===3&&(kt&130023424)===kt&&500>vt()-em?ao(e,0):Jg|=n),mn(e,t)}function vE(e,t){t===0&&(e.mode&1?(t=ju,ju<<=1,!(ju&130023424)&&(ju=4194304)):t=1);var n=an();e=Zr(e,t),e!==null&&(Es(e,t,n),mn(e,n))}function JN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vE(e,n)}function eL(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),vE(e,n)}var yE;yE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fn.current)pn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pn=!1,zN(e,t,n);pn=!!(e.flags&131072)}else pn=!1,ot&&t.flags&1048576&&X_(t,sc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ec(e,t),e=t.pendingProps;var i=na(t,Gt.current);la(t,n),i=Ag(null,t,r,e,i,n);var o=Dg();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,hn(r)?(o=!0,ic(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Sg(t),i.updater=_c,t.stateNode=i,i._reactInternals=t,Bg(t,r,e,n),t=Hg(null,t,r,!0,o,n)):(t.tag=0,ot&&o&&pg(t),on(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ec(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=nL(r),e=gr(r,e),i){case 0:t=zg(null,t,r,e,n);break e;case 1:t=VT(null,t,r,e,n);break e;case 11:t=jT(null,t,r,e,n);break e;case 14:t=WT(null,t,r,gr(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gr(r,i),zg(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gr(r,i),VT(e,t,r,i,n);case 3:e:{if(GT(t),e===null)throw Error(K(387));r=t.pendingProps,o=t.memoizedState,i=o.element,aT(e,t),hc(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=ca(Error(K(423)),t),t=$T(e,t,r,n,i);break e}else if(r!==i){i=ca(Error(K(424)),t),t=$T(e,t,r,n,i);break e}else for(An=gi(t.stateNode.containerInfo.firstChild),In=t,ot=!0,pr=null,n=iT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oa(),r===i){t=Yr(e,t,n);break e}on(e,t,r,n)}t=t.child}return t;case 5:return uT(t),e===null&&vg(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,lg(r,i)?a=null:o!==null&&lg(r,o)&&(t.flags|=32),UT(e,t),on(e,t,a,n),t.child;case 6:return e===null&&vg(t),null;case 13:return qT(e,t,n);case 4:return bg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=aa(t,null,r,n):on(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gr(r,i),jT(e,t,r,i,n);case 7:return on(e,t,t.pendingProps,n),t.child;case 8:return on(e,t,t.pendingProps.children,n),t.child;case 12:return on(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Xe(cc,r._currentValue),r._currentValue=a,o!==null)if(hr(o.value,a)){if(o.children===i.children&&!fn.current){t=Yr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Kr(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Eg(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(K(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Eg(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}on(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,la(t,n),i=Zn(i),r=r(i),t.flags|=1,on(e,t,r,n),t.child;case 14:return r=t.type,i=gr(r,t.pendingProps),i=gr(r.type,i),WT(e,t,r,i,n);case 15:return zT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gr(r,i),Ec(e,t),t.tag=1,hn(r)?(e=!0,ic(t)):e=!1,la(t,n),DT(t,r,i),Bg(t,r,i,n),Hg(null,t,r,!0,e,n);case 19:return KT(e,t,n);case 22:return HT(e,t,n)}throw Error(K(156,t.tag))};function wE(e,t){return Qw(e,t)}function tL(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(e,t,n,r){return new tL(e,t,n,r)}function lm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nL(e){if(typeof e=="function")return lm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pp)return 11;if(e===vp)return 14}return 2}function Ci(e,t){var n=e.alternate;return n===null?(n=Xn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Mc(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")lm(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Uo:return lo(n.children,i,o,t);case fp:a=8,i|=8;break;case hp:return e=Xn(12,n,t,i|2),e.elementType=hp,e.lanes=o,e;case gp:return e=Xn(13,n,t,i),e.elementType=gp,e.lanes=o,e;case mp:return e=Xn(19,n,t,i),e.elementType=mp,e.lanes=o,e;case Ow:return Nc(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cw:a=10;break e;case Pw:a=9;break e;case pp:a=11;break e;case vp:a=14;break e;case si:a=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Xn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function lo(e,t,n,r){return e=Xn(7,e,r,t),e.lanes=n,e}function Nc(e,t,n,r){return e=Xn(22,e,r,t),e.elementType=Ow,e.lanes=n,e.stateNode={isHidden:!1},e}function um(e,t,n){return e=Xn(6,e,null,t),e.lanes=n,e}function cm(e,t,n){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rL(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fp(0),this.expirationTimes=Fp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function dm(e,t,n,r,i,o,a,s,l){return e=new rL(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Xn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sg(o),e}function iL(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ho,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function _E(e){if(!e)return vi;e=e._reactInternals;e:{if(Yi(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(hn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(hn(n))return Z_(e,n,t)}return t}function TE(e,t,n,r,i,o,a,s,l){return e=dm(n,r,!0,e,i,o,a,s,l),e.context=_E(null),n=e.current,r=an(),i=Si(n),o=Kr(r,i),o.callback=t??null,_i(n,o,i),e.current.lanes=i,Es(e,i,r),mn(e,r),e}function Lc(e,t,n,r){var i=t.current,o=an(),a=Si(i);return n=_E(n),t.context===null?t.context=n:t.pendingContext=n,t=Kr(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=_i(i,t,a),e!==null&&(yr(e,i,a,o),fc(e,i,a)),a}function kc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function EE(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fm(e,t){EE(e,t),(e=e.alternate)&&EE(e,t)}function oL(){return null}var xE=typeof reportError=="function"?reportError:function(e){console.error(e)};function hm(e){this._internalRoot=e}Fc.prototype.render=hm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));Lc(e,t,null,null)},Fc.prototype.unmount=hm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oo(function(){Lc(null,e,null,null)}),t[Vr]=null}};function Fc(e){this._internalRoot=e}Fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=a_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fi.length&&t!==0&&t<fi[n].priority;n++);fi.splice(n,0,e),n===0&&u_(e)}};function pm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function SE(){}function aL(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=kc(a);o.call(u)}}var a=TE(t,r,e,0,null,!1,!1,"",SE);return e._reactRootContainer=a,e[Vr]=a.current,ks(e.nodeType===8?e.parentNode:e),oo(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=kc(l);s.call(u)}}var l=dm(e,0,!1,null,null,!1,!1,"",SE);return e._reactRootContainer=l,e[Vr]=l.current,ks(e.nodeType===8?e.parentNode:e),oo(function(){Lc(t,l,n,r)}),l}function jc(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=kc(a);s.call(l)}}Lc(t,a,e,i)}else a=aL(n,t,e,i,r);return kc(a)}i_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ts(t.pendingLanes);n!==0&&(Bp(t,n|1),mn(t,vt()),!(ke&6)&&(ha=vt()+500,yi()))}break;case 13:oo(function(){var r=Zr(e,1);if(r!==null){var i=an();yr(r,e,1,i)}}),fm(e,1)}},jp=function(e){if(e.tag===13){var t=Zr(e,134217728);if(t!==null){var n=an();yr(t,e,134217728,n)}fm(e,134217728)}},o_=function(e){if(e.tag===13){var t=Si(e),n=Zr(e,t);if(n!==null){var r=an();yr(n,e,t,r)}fm(e,t)}},a_=function(){return Ve},s_=function(e,t){var n=Ve;try{return Ve=e,t()}finally{Ve=n}},Ap=function(e,t,n){switch(t){case"input":if(xp(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=nc(r);if(!i)throw Error(K(90));Aw(r),xp(r,i)}}}break;case"textarea":kw(e,n);break;case"select":t=n.value,t!=null&&Vo(e,!!n.multiple,t,!1)}},Gw=om,$w=oo;var sL={usingClientEntryPoint:!1,Events:[js,ea,nc,Uw,Vw,om]},Js={findFiberByHostInstance:Xi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lL={bundleType:Js.bundleType,version:Js.version,rendererPackageName:Js.rendererPackageName,rendererConfig:Js.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ur.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yw(e),e===null?null:e.stateNode},findFiberByHostInstance:Js.findFiberByHostInstance||oL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wc.isDisabled&&Wc.supportsFiber)try{Fu=Wc.inject(lL),Pr=Wc}catch{}}Pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sL,Pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pm(t))throw Error(K(200));return iL(e,t,null,n)},Pn.createRoot=function(e,t){if(!pm(e))throw Error(K(299));var n=!1,r="",i=xE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=dm(e,1,!1,null,null,n,!1,r,i),e[Vr]=t.current,ks(e.nodeType===8?e.parentNode:e),new hm(t)},Pn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=Yw(t),e=e===null?null:e.stateNode,e},Pn.flushSync=function(e){return oo(e)},Pn.hydrate=function(e,t,n){if(!Bc(t))throw Error(K(200));return jc(null,e,t,!0,n)},Pn.hydrateRoot=function(e,t,n){if(!pm(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=xE;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=TE(t,null,e,1,n??null,i,!1,o,a),e[Vr]=t.current,ks(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Fc(t)},Pn.render=function(e,t,n){if(!Bc(t))throw Error(K(200));return jc(null,e,t,!1,n)},Pn.unmountComponentAtNode=function(e){if(!Bc(e))throw Error(K(40));return e._reactRootContainer?(oo(function(){jc(null,null,e,!1,function(){e._reactRootContainer=null,e[Vr]=null})}),!0):!1},Pn.unstable_batchedUpdates=om,Pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bc(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return jc(e,t,n,!1,r)},Pn.version="18.3.1-next-f1338f8080-20240426";function bE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bE)}catch(e){console.error(e)}}bE(),_w.exports=Pn;var zc=_w.exports;const Hc=He(zc);var CE,PE=zc;CE=PE.createRoot,PE.hydrateRoot;var uL={};var el=x;function cL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dL=typeof Object.is=="function"?Object.is:cL,fL=el.useSyncExternalStore,hL=el.useRef,pL=el.useEffect,gL=el.useMemo,mL=el.useDebugValue;uL.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=hL(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=gL(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&a.hasValue){var g=a.value;if(i(g,h))return d=g}return d=h}if(g=d,dL(c,h))return g;var p=r(h);return i!==void 0&&i(g,p)?(c=h,g):(c=h,d=p)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var s=fL(e,o[0],o[1]);return pL(function(){a.hasValue=!0,a.value=s},[s]),mL(s),s};var vL=x.version.startsWith("19"),yL=Symbol.for(vL?"react.transitional.element":"react.element"),wL=Symbol.for("react.portal"),_L=Symbol.for("react.fragment"),TL=Symbol.for("react.strict_mode"),EL=Symbol.for("react.profiler"),xL=Symbol.for("react.consumer"),SL=Symbol.for("react.context"),OE=Symbol.for("react.forward_ref"),bL=Symbol.for("react.suspense"),CL=Symbol.for("react.suspense_list"),gm=Symbol.for("react.memo"),PL=Symbol.for("react.lazy"),OL=OE,RL=gm;function IL(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case yL:switch(e=e.type,e){case _L:case EL:case TL:case bL:case CL:return e;default:switch(e=e&&e.$$typeof,e){case SL:case OE:case PL:case gm:return e;case xL:return e;default:return t}}case wL:return t}}}function AL(e){return IL(e)===gm}function DL(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:o,areStatePropsEqual:a}){let s=!1,l,u,c,d,f;function h(y,E){return l=y,u=E,c=e(l,u),d=t(r,u),f=n(c,d,u),s=!0,f}function g(){return c=e(l,u),t.dependsOnOwnProps&&(d=t(r,u)),f=n(c,d,u),f}function p(){return e.dependsOnOwnProps&&(c=e(l,u)),t.dependsOnOwnProps&&(d=t(r,u)),f=n(c,d,u),f}function v(){const y=e(l,u),E=!a(y,c);return c=y,E&&(f=n(c,d,u)),f}function m(y,E){const b=!o(E,u),R=!i(y,l,E,u);return l=y,u=E,b&&R?g():b?p():R?v():f}return function(E,b){return s?m(E,b):h(E,b)}}function ML(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){const o=t(e,i),a=n(e,i),s=r(e,i);return DL(o,a,s,e,i)}function NL(e,t){const n={};for(const r in e){const i=e[r];typeof i=="function"&&(n[r]=(...o)=>t(i(...o)))}return n}function mm(e){return function(n){const r=e(n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function RE(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function IE(e,t){return function(r,{displayName:i}){const o=function(s,l){return o.dependsOnOwnProps?o.mapToProps(s,l):o.mapToProps(s,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(s,l){o.mapToProps=e,o.dependsOnOwnProps=RE(e);let u=o(s,l);return typeof u=="function"&&(o.mapToProps=u,o.dependsOnOwnProps=RE(u),u=o(s,l)),u},o}}function vm(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function LL(e){return e&&typeof e=="object"?mm(t=>NL(e,t)):e?typeof e=="function"?IE(e):vm(e,"mapDispatchToProps"):mm(t=>({dispatch:t}))}function kL(e){return e?typeof e=="function"?IE(e):vm(e,"mapStateToProps"):mm(()=>({}))}function FL(e,t,n){return{...n,...e,...t}}function BL(e){return function(n,{displayName:r,areMergedPropsEqual:i}){let o=!1,a;return function(l,u,c){const d=e(l,u,c);return o?i(d,a)||(a=d):(o=!0,a=d),a}}}function jL(e){return e?typeof e=="function"?BL(e):vm(e,"mergeProps"):()=>FL}function WL(e){e()}function zL(){let e=null,t=null;return{clear(){e=null,t=null},notify(){WL(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var AE={notify(){},get:()=>[]};function DE(e,t){let n,r=AE,i=0,o=!1;function a(p){c();const v=r.subscribe(p);let m=!1;return()=>{m||(m=!0,v(),d())}}function s(){r.notify()}function l(){g.onStateChange&&g.onStateChange()}function u(){return o}function c(){i++,n||(n=t?t.addNestedSub(l):e.subscribe(l),r=zL())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=AE)}function f(){o||(o=!0,c())}function h(){o&&(o=!1,d())}const g={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:u,trySubscribe:f,tryUnsubscribe:h,getListeners:()=>r};return g}var HL=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",UL=HL(),VL=()=>typeof navigator<"u"&&navigator.product==="ReactNative",GL=VL(),$L=()=>UL||GL?x.useLayoutEffect:x.useEffect,Uc=$L();function ME(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ym(e,t){if(ME(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!ME(e[n[i]],t[n[i]]))return!1;return!0}var qL={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ZL={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},KL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},NE={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},YL={[OL]:KL,[RL]:NE};function LE(e){return AL(e)?NE:YL[e.$$typeof]||qL}var XL=Object.defineProperty,QL=Object.getOwnPropertyNames,kE=Object.getOwnPropertySymbols,JL=Object.getOwnPropertyDescriptor,ek=Object.getPrototypeOf,FE=Object.prototype;function wm(e,t){if(typeof t!="string"){if(FE){const o=ek(t);o&&o!==FE&&wm(e,o)}let n=QL(t);kE&&(n=n.concat(kE(t)));const r=LE(e),i=LE(t);for(let o=0;o<n.length;++o){const a=n[o];if(!ZL[a]&&!(i&&i[a])&&!(r&&r[a])){const s=JL(t,a);try{XL(e,a,s)}catch{}}}}return e}var _m=Symbol.for("react-redux-context"),Tm=typeof globalThis<"u"?globalThis:{};function tk(){if(!x.createContext)return{};const e=Tm[_m]??(Tm[_m]=new Map);let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var BE=tk(),nk=[null,null];function rk(e,t,n){Uc(()=>e(...t),n)}function ik(e,t,n,r,i,o){e.current=r,n.current=!1,i.current&&(i.current=null,o())}function ok(e,t,n,r,i,o,a,s,l,u,c){if(!e)return()=>{};let d=!1,f=null;const h=()=>{if(d||!s.current)return;const p=t.getState();let v,m;try{v=r(p,i.current)}catch(y){m=y,f=y}m||(f=null),v===o.current?a.current||u():(o.current=v,l.current=v,a.current=!0,c())};return n.onStateChange=h,n.trySubscribe(),h(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}function ak(e,t){return e===t}function sk(e,t,n,{pure:r,areStatesEqual:i=ak,areOwnPropsEqual:o=ym,areStatePropsEqual:a=ym,areMergedPropsEqual:s=ym,forwardRef:l=!1,context:u=BE}={}){const c=u,d=kL(e),f=LL(t),h=jL(n),g=!!e;return v=>{const m=v.displayName||v.name||"Component",y=`Connect(${m})`,E={shouldHandleStateChanges:g,displayName:y,wrappedComponentName:m,WrappedComponent:v,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:h,areStatesEqual:i,areStatePropsEqual:a,areOwnPropsEqual:o,areMergedPropsEqual:s};function b(C){const[D,F,L]=x.useMemo(()=>{const{reactReduxForwardedRef:Ae,...Ze}=C;return[C.context,Ae,Ze]},[C]),B=x.useMemo(()=>{let Ae=c;return D!=null&&D.Consumer,Ae},[D,c]),z=x.useContext(B),$=!!C.store&&!!C.store.getState&&!!C.store.dispatch,de=!!z&&!!z.store,X=$?C.store:z.store,re=de?z.getServerState:X.getState,fe=x.useMemo(()=>ML(X.dispatch,E),[X]),[H,Y]=x.useMemo(()=>{if(!g)return nk;const Ae=DE(X,$?void 0:z.subscription),Ze=Ae.notifyNestedSubs.bind(Ae);return[Ae,Ze]},[X,$,z]),ae=x.useMemo(()=>$?z:{...z,subscription:H},[$,z,H]),Te=x.useRef(void 0),Se=x.useRef(L),oe=x.useRef(void 0),be=x.useRef(!1),te=x.useRef(!1),q=x.useRef(void 0);Uc(()=>(te.current=!0,()=>{te.current=!1}),[]);const ee=x.useMemo(()=>()=>oe.current&&L===Se.current?oe.current:fe(X.getState(),L),[X,L]),se=x.useMemo(()=>Ze=>H?ok(g,X,H,fe,Se,Te,be,te,oe,Y,Ze):()=>{},[H]);rk(ik,[Se,Te,be,L,oe,Y]);let ce;try{ce=x.useSyncExternalStore(se,ee,re?()=>fe(re(),L):ee)}catch(Ae){throw q.current&&(Ae.message+=`
The error may be correlated with this previous error:
${q.current.stack}
`),Ae}Uc(()=>{q.current=void 0,oe.current=void 0,Te.current=ce});const Be=x.useMemo(()=>x.createElement(v,{...ce,ref:F}),[F,v,ce]);return x.useMemo(()=>g?x.createElement(B.Provider,{value:ae},Be):Be,[B,Be,ae])}const M=x.memo(b);if(M.WrappedComponent=v,M.displayName=b.displayName=y,l){const D=x.forwardRef(function(L,B){return x.createElement(M,{...L,reactReduxForwardedRef:B})});return D.displayName=y,D.WrappedComponent=v,wm(D,v)}return wm(M,v)}}var Qe=sk;function lk(e){const{children:t,context:n,serverState:r,store:i}=e,o=x.useMemo(()=>{const l=DE(i);return{store:i,subscription:l,getServerState:r?()=>r:void 0}},[i,r]),a=x.useMemo(()=>i.getState(),[i]);Uc(()=>{const{subscription:l}=o;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[o,a]);const s=n||BE;return x.createElement(s.Provider,{value:o},t)}var Em=lk;function uk(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var xm=uk,ck=typeof J=="object"&&J&&J.Object===Object&&J,jE=ck,dk=jE,fk=typeof self=="object"&&self&&self.Object===Object&&self,hk=dk||fk||Function("return this")(),sn=hk,pk=sn,gk=pk.Symbol,ga=gk,WE=ga,zE=Object.prototype,mk=zE.hasOwnProperty,vk=zE.toString,tl=WE?WE.toStringTag:void 0;function yk(e){var t=mk.call(e,tl),n=e[tl];try{e[tl]=void 0;var r=!0}catch{}var i=vk.call(e);return r&&(t?e[tl]=n:delete e[tl]),i}var wk=yk,_k=Object.prototype,Tk=_k.toString;function Ek(e){return Tk.call(e)}var xk=Ek,HE=ga,Sk=wk,bk=xk,Ck="[object Null]",Pk="[object Undefined]",UE=HE?HE.toStringTag:void 0;function Ok(e){return e==null?e===void 0?Pk:Ck:UE&&UE in Object(e)?Sk(e):bk(e)}var Pi=Ok;function Rk(e){return e!=null&&typeof e=="object"}var Mn=Rk,Ik=Pi,Ak=Mn,Dk="[object Arguments]";function Mk(e){return Ak(e)&&Ik(e)==Dk}var Nk=Mk,VE=Nk,Lk=Mn,GE=Object.prototype,kk=GE.hasOwnProperty,Fk=GE.propertyIsEnumerable,Bk=VE(function(){return arguments}())?VE:function(e){return Lk(e)&&kk.call(e,"callee")&&!Fk.call(e,"callee")},Vc=Bk,jk=Array.isArray,Ft=jk,$E=ga,Wk=Vc,zk=Ft,qE=$E?$E.isConcatSpreadable:void 0;function Hk(e){return zk(e)||Wk(e)||!!(qE&&e&&e[qE])}var Uk=Hk,Vk=xm,Gk=Uk;function ZE(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=Gk),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?ZE(s,t-1,n,r,i):Vk(i,s):r||(i[i.length]=s)}return i}var Gc=ZE,$k=Gc;function qk(e){var t=e==null?0:e.length;return t?$k(e,1):[]}var Sm=qk;const Pe=He(Sm);for(var Bt=[],bm=0;bm<256;++bm)Bt.push((bm+256).toString(16).slice(1));function Zk(e,t=0){return(Bt[e[t+0]]+Bt[e[t+1]]+Bt[e[t+2]]+Bt[e[t+3]]+"-"+Bt[e[t+4]]+Bt[e[t+5]]+"-"+Bt[e[t+6]]+Bt[e[t+7]]+"-"+Bt[e[t+8]]+Bt[e[t+9]]+"-"+Bt[e[t+10]]+Bt[e[t+11]]+Bt[e[t+12]]+Bt[e[t+13]]+Bt[e[t+14]]+Bt[e[t+15]]).toLowerCase()}var $c,Kk=new Uint8Array(16);function Yk(){if(!$c&&($c=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $c(Kk)}var Xk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const KE={randomUUID:Xk};function Dr(e,t,n){if(KE.randomUUID&&!t&&!e)return KE.randomUUID();e=e||{};var r=e.random||(e.rng||Yk)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Zk(r)}const nl={v600:"#7A7A7A",v700:"#595959",v800:"#4E4E4E"},YE={v50:"#F8F7F5",v300:"#E6E5DE"},Cm={original:"#494B4F",ligther:"#5B5D60",darker:"#414347"},Pm={original:"#3B3C40",lighter:"#4E4F53",darker:"#353639"},Om={v200:"#FFFABF",v600:"#FFEA00"},wr={v500:"#272727",v600:"#252525",v700:"#232323",v800:"#1E1E1E",v900:"#121212"},qc={v500:"#4D68B7"},uo={createGenerateClassNameOptions:{productionPrefix:"ngtv"},annotations:{htmlSanitizationRuleSet:"iiif",filteredMotivations:["oa:commenting","oa:tagging","sc:painting","commenting","tagging"]},thumbnails:{preferredFormats:["jpg","png","webp","tif"]},state:{},windows:[],requests:{preprocessors:[],postprocessors:[]},audioOptions:{controls:!0,crossOrigin:"anonymous"},videoOptions:{controls:!0,crossOrigin:"anonymous"},ngtvLayout:"",debugMode:!1,selectedTheme:"",thumbnailNavigation:{defaultPosition:"off"},window:{size:"full",focalPt:{left:.5,top:.5},showManifestUrl:!0},workspace:{id:Dr(),type:"mosaic",compareModeAvailable:!0},theme:{spacing:4,breakpoints:{values:{xs:0,sm:576,md:768,lg:992,xl:1200}},typography:{body1:{fontSize:"1rem",letterSpacing:"0.0125rem",lineHeight:"1.5"},body2:{fontSize:"0.875rem",letterSpacing:"0.0125rem",lineHeight:"1.5"},button:{fontSize:"1rem",letterSpacing:"0.0125rem",lineHeight:"1.2",textTransform:"uppercase"},caption:{fontSize:"0.79rem",letterSpacing:"0.0125rem",lineHeight:"1.5"},overline:{fontSize:"0.79rem",fontWeight:500,letterSpacing:"0.0125rem",lineHeight:"1.5",textTransform:"uppercase"},h1:{fontSize:"2.027rem",fontWeight:300,letterSpacing:"0.0125rem",lineHeight:"1.2"},h2:{fontSize:"1.802rem",fontWeight:300,letterSpacing:"0.0125rem",lineHeight:"1.2"},h3:{fontSize:"1.602rem",fontWeight:300,letterSpacing:"0.0125rem",lineHeight:"1.2"},h4:{fontSize:"1.424rem",fontWeight:300,letterSpacing:"0.0125rem",lineHeight:"1.3"},h5:{fontSize:"1.266rem",fontWeight:300,letterSpacing:"0.0125rem",lineHeight:"1.3"},h6:{fontSize:"1.125rem",fontWeight:300,letterSpacing:"0.0125rem",lineHeight:"1.3"},subtitle2:{fontSize:"0.875rem",fontWeight:500,letterSpacing:"0.0125rem",lineHeight:"1.5"}},components:{MuiMenuItem:{variants:[{props:{variant:"multiline"},style:{whiteSpace:"normal"}}]},CompanionWindow:{styleOverrides:{closeButton:{order:4},contents:{overflowY:"auto",wordBreak:"break-word"},controls:({ownerState:e})=>({alignItems:"center",display:"flex",flexFlow:"row wrap",flexGrow:1,justifyContent:(e==null?void 0:e.position)==="bottom"||(e==null?void 0:e.position)==="far-bottom"?"flex-end":"flex-start",minHeight:48,order:3}),positionButton:{marginLeft:-16,order:-100,width:24},resize:({ownerState:e})=>({display:"flex",flexDirection:"column",minHeight:50,minWidth:(e==null?void 0:e.position)==="left"?235:100,position:"relative"}),root:({ownerState:e})=>({boxShadow:"none",boxSizing:"border-box",display:"flex",flexDirection:"column",minHeight:0,...(e==null?void 0:e.position)==="right"&&{borderLeft:"0.5px solid rgba(0, 0, 0, 0.125)"},...(e==null?void 0:e.position)==="left"&&{borderRight:"0.5px solid rgba(0, 0, 0, 0.125)"},...(e==null?void 0:e.position)==="bottom"&&{borderTop:"0.5px solid rgba(0, 0, 0, 0.125)"}}),title:({theme:e})=>({...e.typography.subtitle1,alignSelf:"center",flexGrow:1,width:160,paddingInlineStart:e.spacing(2)}),toolbar:({theme:e})=>({alignItems:"flex-start",backgroundColor:e.palette.shades.light,flexWrap:"wrap",justifyContent:"space-between",minHeight:"max-content",paddingInlineStart:0})}},CompanionWindowSection:{styleOverrides:{root:{borderBlockEnd:".5px solid rgba(0, 0, 0, 0.25)"}}},IIIFHtmlContent:{styleOverrides:{root:({theme:e})=>({"& a":{color:e.palette.primary.main,textDecoration:"underline"}})}},IIIFThumbnail:{styleOverrides:{root:({ownerState:e})=>({...(e==null?void 0:e.variant)==="inside"&&{display:"inline-block",height:"inherit",position:"relative"}}),label:({ownerState:e})=>({overflow:"hidden",textOverflow:"ellipsis",lineHeight:"1.5em",wordBreak:"break-word",...(e==null?void 0:e.variant)==="inside"&&{color:"#ffffff",WebkitLineClamp:1,whiteSpace:"nowrap"},...(e==null?void 0:e.variant)==="outside"&&{display:"-webkit-box",maxHeight:"3em",MozBoxOrient:"vertical",WebkitLineClamp:2},...(e==null?void 0:e.variant)==="inside"&&{background:"linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0) 100%)",bottom:"5px",boxSizing:"border-box",left:"0px",padding:"4px",position:"absolute",width:"100%"}}),image:({ownerState:e})=>({...(e==null?void 0:e.border)&&{border:"1px solid rgba(0, 0, 0, 0.125)"}})}},ThemeIcon:{styleOverrides:{icon:({ownerState:e})=>({color:(e==null?void 0:e.value)==="dark"?"#000000":void 0})}},MuiAccordion:{variants:[{props:{variant:"compact"},style:{"& .MuiAccordionSummary-root":{minHeight:"unset",padding:0},"& .MuiAccordionSummary-content":{margin:0},"& .MuiAccordionDetails-root":{padding:0}}}]},MuiButton:{styleOverrides:{inlineText:{lineHeight:"1.2",padding:0,textAlign:"inherit",textTransform:"none"},inlineTextSecondary:({theme:e})=>({color:e.palette.secondary.main})}},MuiButtonBase:{defaultProps:{disableRipple:!0}},MuiDialog:{variants:[{props:{variant:"contained"},style:{position:"absolute","& .MuiBackdrop-root":{position:"absolute"}}}]},MuiFab:{styleOverrides:{root:{transition:"none"}}},MuiLink:{defaultProps:{underline:"always"}},MuiSvgIcon:{styleOverrides:{root:{overflow:"visible"}}},MuiListSubheader:{styleOverrides:{root:{'&[role="presentation"]:focus':{outline:0}}}},MuiTooltip:{styleOverrides:{tooltipPlacementLeft:{"@media (min-width:600px)":{margin:"0 !important"}},tooltipPlacementRight:{"@media (min-width:600px)":{margin:"0 !important"}},tooltipPlacementTop:{"@media (min-width:600px)":{margin:"0 !important"}},tooltipPlacementBottom:{"@media (min-width:600px)":{margin:"0 !important"}}}},MuiTouchRipple:{styleOverrides:{childPulsate:{animation:"none"},rippleVisible:{animation:"none"}}},MuiTab:{styleOverrides:{root:{"& svg":{flexShrink:0}}}}},palette:{mode:"light",primary:{main:"#1967d2"},secondary:{main:"#1967d2"},shades:{dark:"#eeeeee",main:"#ffffff",light:"#f5f5f5"},error:{main:"#b00020"},notification:{main:"#ffa224"},hitCounter:{default:"#bdbdbd"},highlights:{primary:"#ffff00",secondary:"#00BFFF"},section_divider:"rgba(0, 0, 0, 0.25)",annotations:{chipBackground:"#e0e0e0",hidden:{globalAlpha:0},default:{strokeStyle:"#00BFFF",globalAlpha:1},hovered:{strokeStyle:"#BF00FF",globalAlpha:1},selected:{strokeStyle:"#ffff00",globalAlpha:1}},search:{default:{fillStyle:"#00BFFF",globalAlpha:.3},hovered:{fillStyle:"#00FFFF",globalAlpha:.3},selected:{fillStyle:"#ffff00",globalAlpha:.3}},txtColour:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF"},urlColour:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF"},btnBg:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF",active:"#D32F2F"},btnDarkBg:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF",active:"#D32F2F"},btnTxt:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF"},btnBorder:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF",active:"#D32F2F"},btnDarkBorder:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF",active:"#D32F2F"},btnOutline:{light:"#101010",main:"#101010",dark:"#101010",contrastText:"#FFFFFF",active:"#101010"},canvasBg:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF"}},custom:{standardOutline:"-webkit-focus-ring-color auto 1px",dialog:{backsplashColour:"rgba(59,60,64, 0.6)",backsplashColourThin:"rgba(59,60,64, 0.25)",background:"#FFFFFF",txtColour:wr.v500,tabTxtColour:nl.v700,tabTxtColourActive:qc.v500,underline:YE.v300,checkboxColour:wr.v800,darkBackground:wr.v700,darkTxtColour:"#FFFFFF",darkTabTxtColour:YE.v50,darkTabTxtColourActive:Om.v200,darkHeadingTxtColour:"#272626"},banner:{zoomCtrlsBg:wr.v800,zoomCtrlsColour:"#FFFFFF"}}},themes:{light:{palette:{mode:"light",txtColour:{light:"#000000",main:"#000000",dark:"#000000",contrastText:"#FFFFFF"},urlColour:{light:"#4D68B7",main:"#4D68B7",dark:"#4D68B7"},btnBg:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",active:"#D32F2F"},btnDarkBg:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",active:"#D32F2F"},btnTxt:{light:"#000000",main:"#000000",dark:"#000000"},btnBorder:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",active:"#D32F2F"},btnDarkBorder:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",active:"#D32F2F"},btnOutline:{light:"#101010",main:"#101010",dark:"#101010",contrastText:"#FFFFFF",active:"#101010"},canvasBg:{light:"#FFCDD2",main:"#E57373",dark:"#D32F2F",contrastText:"#FFFFFF"}}},dark:{palette:{mode:"dark",primary:{main:"#4db6ac"},secondary:{main:"#4db6ac"},shades:{dark:"#000000",main:"#424242",light:"#616161"},txtColour:{light:wr.v600,main:wr.v700,dark:wr.v800},urlColour:{light:qc.v500,main:qc.v500,dark:qc.v500},btnBg:{light:nl.v700,main:Cm.original,dark:Cm.darker,active:Cm.original},btnDarkBg:{light:wr.v700,main:wr.v800,dark:wr.v900,active:wr.v800},btnTxt:{light:"#FFFFFF",main:"#FFFFFF",dark:"#FFFFFF"},btnBorder:{light:nl.v600,main:nl.v700,dark:nl.v800,active:Om.v600},btnDarkBorder:{light:"#FFFFFF",main:"#FFFFFF",dark:"#FFFFFF",active:Om.v600},btnOutline:{light:"#101010",main:"#101010",dark:"#101010",contrastText:"#FFFFFF",active:"#101010"},canvasBg:{light:Pm.lighter,main:Pm.original,dark:Pm.darker,contrastText:"#FFFFFF"}}}}},ve=e=>Pe([e]).map(t=>[uo.createGenerateClassNameOptions.productionPrefix,t].join("-")).join(" ");function At(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Qk=typeof Symbol=="function"&&Symbol.observable||"@@observable",XE=Qk,Rm=()=>Math.random().toString(36).substring(7).split("").join("."),Jk={INIT:`@@redux/INIT${Rm()}`,REPLACE:`@@redux/REPLACE${Rm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Rm()}`},Zc=Jk;function QE(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function JE(e,t,n){if(typeof e!="function")throw new Error(At(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(At(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(At(1));return n(JE)(e,t)}let r=e,i=t,o=new Map,a=o,s=0,l=!1;function u(){a===o&&(a=new Map,o.forEach((v,m)=>{a.set(m,v)}))}function c(){if(l)throw new Error(At(3));return i}function d(v){if(typeof v!="function")throw new Error(At(4));if(l)throw new Error(At(5));let m=!0;u();const y=s++;return a.set(y,v),function(){if(m){if(l)throw new Error(At(6));m=!1,u(),a.delete(y),o=null}}}function f(v){if(!QE(v))throw new Error(At(7));if(typeof v.type>"u")throw new Error(At(8));if(typeof v.type!="string")throw new Error(At(17));if(l)throw new Error(At(9));try{l=!0,i=r(i,v)}finally{l=!1}return(o=a).forEach(y=>{y()}),v}function h(v){if(typeof v!="function")throw new Error(At(10));r=v,f({type:Zc.REPLACE})}function g(){const v=d;return{subscribe(m){if(typeof m!="object"||m===null)throw new Error(At(11));function y(){const b=m;b.next&&b.next(c())}return y(),{unsubscribe:v(y)}},[XE](){return this}}}return f({type:Zc.INIT}),{dispatch:f,subscribe:d,getState:c,replaceReducer:h,[XE]:g}}function e3(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Zc.INIT})>"u")throw new Error(At(12));if(typeof n(void 0,{type:Zc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(At(13))})}function Im(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const a=t[o];typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let i;try{e3(n)}catch(o){i=o}return function(a={},s){if(i)throw i;let l=!1;const u={};for(let c=0;c<r.length;c++){const d=r[c],f=n[d],h=a[d],g=f(h,s);if(typeof g>"u")throw s&&s.type,new Error(At(14));u[d]=g,l=l||g!==h}return l=l||r.length!==Object.keys(a).length,l?u:a}}function ex(e,t){return function(...n){return t(e.apply(this,n))}}function tx(e,t){if(typeof e=="function")return ex(e,t);if(typeof e!="object"||e===null)throw new Error(At(16));const n={};for(const r in e){const i=e[r];typeof i=="function"&&(n[r]=ex(i,t))}return n}function Me(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function t3(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(At(15))};const a={getState:i.getState,dispatch:(l,...u)=>o(l,...u)},s=e.map(l=>l(a));return o=Me(...s)(i.dispatch),{...i,dispatch:o}}}function n3(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function r3(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function i3(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var nx=e=>Array.isArray(e)?e:[e];function o3(e){const t=Array.isArray(e[0])?e[0]:e;return i3(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function a3(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var s3=class{constructor(e){this.value=e}deref(){return this.value}},l3=typeof WeakRef<"u"?WeakRef:s3,u3=0,rx=1;function Kc(){return{s:u3,v:void 0,o:null,p:null}}function ix(e,t={}){let n=Kc();const{resultEqualityCheck:r}=t;let i,o=0;function a(){var d;let s=n;const{length:l}=arguments;for(let f=0,h=l;f<h;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let p=s.o;p===null&&(s.o=p=new WeakMap);const v=p.get(g);v===void 0?(s=Kc(),p.set(g,s)):s=v}else{let p=s.p;p===null&&(s.p=p=new Map);const v=p.get(g);v===void 0?(s=Kc(),p.set(g,s)):s=v}}const u=s;let c;if(s.s===rx)c=s.v;else if(c=e.apply(null,arguments),o++,r){const f=((d=i==null?void 0:i.deref)==null?void 0:d.call(i))??i;f!=null&&r(f,c)&&(c=f,o!==0&&o--),i=typeof c=="object"&&c!==null||typeof c=="function"?new l3(c):c}return u.s=rx,u.v=c,c}return a.clearCache=()=>{n=Kc(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function c3(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,a=0,s,l={},u=i.pop();typeof u=="object"&&(l=u,u=i.pop()),n3(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...n,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:h=ix,argsMemoizeOptions:g=[],devModeChecks:p={}}=c,v=nx(f),m=nx(g),y=o3(i),E=d(function(){return o++,u.apply(null,arguments)},...v),b=h(function(){a++;const M=a3(y,arguments);return s=E.apply(null,M),s},...m);return Object.assign(b,{resultFunc:u,memoizedResultFunc:E,dependencies:y,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:d,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var U=c3(ix),d3=Object.assign((e,t=U)=>{r3(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((a,s,l)=>(a[n[l]]=s,a),{}))},{withTypes:()=>d3});function f3(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}var ox=f3;function h3(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(n(o[l],l,o)===!1)break}return t}}var p3=h3,g3=p3,m3=g3(),v3=m3;function y3(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var w3=y3,Yc={exports:{}};function _3(){return!1}var T3=_3;Yc.exports,function(e,t){var n=sn,r=T3,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;e.exports=u}(Yc,Yc.exports);var Xc=Yc.exports,Am,ax;function Qc(){if(ax)return Am;ax=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??e,!!i&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return Am=n,Am}var E3=9007199254740991;function x3(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=E3}var Dm=x3,S3=Pi,b3=Dm,C3=Mn,P3="[object Arguments]",O3="[object Array]",R3="[object Boolean]",I3="[object Date]",A3="[object Error]",D3="[object Function]",M3="[object Map]",N3="[object Number]",L3="[object Object]",k3="[object RegExp]",F3="[object Set]",B3="[object String]",j3="[object WeakMap]",W3="[object ArrayBuffer]",z3="[object DataView]",H3="[object Float32Array]",U3="[object Float64Array]",V3="[object Int8Array]",G3="[object Int16Array]",$3="[object Int32Array]",q3="[object Uint8Array]",Z3="[object Uint8ClampedArray]",K3="[object Uint16Array]",Y3="[object Uint32Array]",rt={};rt[H3]=rt[U3]=rt[V3]=rt[G3]=rt[$3]=rt[q3]=rt[Z3]=rt[K3]=rt[Y3]=!0,rt[P3]=rt[O3]=rt[W3]=rt[R3]=rt[z3]=rt[I3]=rt[A3]=rt[D3]=rt[M3]=rt[N3]=rt[L3]=rt[k3]=rt[F3]=rt[B3]=rt[j3]=!1;function X3(e){return C3(e)&&b3(e.length)&&!!rt[S3(e)]}var Q3=X3;function J3(e){return function(t){return e(t)}}var Jc=J3,ed={exports:{}};ed.exports,function(e,t){var n=jE,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s}(ed,ed.exports);var Mm=ed.exports,eF=Q3,tF=Jc,sx=Mm,lx=sx&&sx.isTypedArray,nF=lx?tF(lx):eF,Nm=nF,rF=w3,iF=Vc,oF=Ft,aF=Xc,sF=Qc(),lF=Nm,uF=Object.prototype,cF=uF.hasOwnProperty;function dF(e,t){var n=oF(e),r=!n&&iF(e),i=!n&&!r&&aF(e),o=!n&&!r&&!i&&lF(e),a=n||r||i||o,s=a?rF(e.length,String):[],l=s.length;for(var u in e)(t||cF.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||sF(u,l)))&&s.push(u);return s}var ux=dF,fF=Object.prototype;function hF(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||fF;return e===n}var td=hF;function pF(e,t){return function(n){return e(t(n))}}var cx=pF,gF=cx,mF=gF(Object.keys,Object),vF=mF,yF=td,wF=vF,_F=Object.prototype,TF=_F.hasOwnProperty;function EF(e){if(!yF(e))return wF(e);var t=[];for(var n in Object(e))TF.call(e,n)&&n!="constructor"&&t.push(n);return t}var Lm=EF;function xF(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Qn=xF;const km=He(Qn);var SF=Pi,bF=Qn,CF="[object AsyncFunction]",PF="[object Function]",OF="[object GeneratorFunction]",RF="[object Proxy]";function IF(e){if(!bF(e))return!1;var t=SF(e);return t==PF||t==OF||t==CF||t==RF}var nd=IF;const Fm=He(nd);var AF=nd,DF=Dm;function MF(e){return e!=null&&DF(e.length)&&!AF(e)}var rl=MF,NF=ux,LF=Lm,kF=rl;function FF(e){return kF(e)?NF(e):LF(e)}var co=FF,BF=v3,jF=co;function WF(e,t){return e&&BF(e,t,jF)}var zF=WF,HF=rl;function UF(e,t){return function(n,r){if(n==null)return n;if(!HF(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var VF=UF,GF=zF,$F=VF,qF=$F(GF),dx=qF,ZF=dx;function KF(e,t){var n=[];return ZF(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}var YF=KF;function XF(){this.__data__=[],this.size=0}var QF=XF;function JF(e,t){return e===t||e!==e&&t!==t}var Bm=JF,e4=Bm;function t4(e,t){for(var n=e.length;n--;)if(e4(e[n][0],t))return n;return-1}var rd=t4,n4=rd,r4=Array.prototype,i4=r4.splice;function o4(e){var t=this.__data__,n=n4(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():i4.call(t,n,1),--this.size,!0}var a4=o4,s4=rd;function l4(e){var t=this.__data__,n=s4(t,e);return n<0?void 0:t[n][1]}var u4=l4,c4=rd;function d4(e){return c4(this.__data__,e)>-1}var f4=d4,h4=rd;function p4(e,t){var n=this.__data__,r=h4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var g4=p4,m4=QF,v4=a4,y4=u4,w4=f4,_4=g4;function ma(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ma.prototype.clear=m4,ma.prototype.delete=v4,ma.prototype.get=y4,ma.prototype.has=w4,ma.prototype.set=_4;var id=ma,T4=id;function E4(){this.__data__=new T4,this.size=0}var x4=E4;function S4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var b4=S4;function C4(e){return this.__data__.get(e)}var P4=C4;function O4(e){return this.__data__.has(e)}var R4=O4,I4=sn,A4=I4["__core-js_shared__"],D4=A4,jm=D4,fx=function(){var e=/[^.]+$/.exec(jm&&jm.keys&&jm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function M4(e){return!!fx&&fx in e}var N4=M4,L4=Function.prototype,k4=L4.toString;function F4(e){if(e!=null){try{return k4.call(e)}catch{}try{return e+""}catch{}}return""}var hx=F4,B4=nd,j4=N4,W4=Qn,z4=hx,H4=/[\\^$.*+?()[\]{}|]/g,U4=/^\[object .+?Constructor\]$/,V4=Function.prototype,G4=Object.prototype,$4=V4.toString,q4=G4.hasOwnProperty,Z4=RegExp("^"+$4.call(q4).replace(H4,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function K4(e){if(!W4(e)||j4(e))return!1;var t=B4(e)?Z4:U4;return t.test(z4(e))}var Y4=K4;function X4(e,t){return e==null?void 0:e[t]}var Q4=X4,J4=Y4,e5=Q4;function t5(e,t){var n=e5(e,t);return J4(n)?n:void 0}var fo=t5,n5=fo,r5=sn,i5=n5(r5,"Map"),Wm=i5,o5=fo,a5=o5(Object,"create"),od=a5,px=od;function s5(){this.__data__=px?px(null):{},this.size=0}var l5=s5;function u5(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var c5=u5,d5=od,f5="__lodash_hash_undefined__",h5=Object.prototype,p5=h5.hasOwnProperty;function g5(e){var t=this.__data__;if(d5){var n=t[e];return n===f5?void 0:n}return p5.call(t,e)?t[e]:void 0}var m5=g5,v5=od,y5=Object.prototype,w5=y5.hasOwnProperty;function _5(e){var t=this.__data__;return v5?t[e]!==void 0:w5.call(t,e)}var T5=_5,E5=od,x5="__lodash_hash_undefined__";function S5(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=E5&&t===void 0?x5:t,this}var b5=S5,C5=l5,P5=c5,O5=m5,R5=T5,I5=b5;function va(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}va.prototype.clear=C5,va.prototype.delete=P5,va.prototype.get=O5,va.prototype.has=R5,va.prototype.set=I5;var A5=va,gx=A5,D5=id,M5=Wm;function N5(){this.size=0,this.__data__={hash:new gx,map:new(M5||D5),string:new gx}}var L5=N5;function k5(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var F5=k5,B5=F5;function j5(e,t){var n=e.__data__;return B5(t)?n[typeof t=="string"?"string":"hash"]:n.map}var ad=j5,W5=ad;function z5(e){var t=W5(this,e).delete(e);return this.size-=t?1:0,t}var H5=z5,U5=ad;function V5(e){return U5(this,e).get(e)}var G5=V5,$5=ad;function q5(e){return $5(this,e).has(e)}var Z5=q5,K5=ad;function Y5(e,t){var n=K5(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var X5=Y5,Q5=L5,J5=H5,eB=G5,tB=Z5,nB=X5;function ya(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ya.prototype.clear=Q5,ya.prototype.delete=J5,ya.prototype.get=eB,ya.prototype.has=tB,ya.prototype.set=nB;var zm=ya,rB=id,iB=Wm,oB=zm,aB=200;function sB(e,t){var n=this.__data__;if(n instanceof rB){var r=n.__data__;if(!iB||r.length<aB-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oB(r)}return n.set(e,t),this.size=n.size,this}var lB=sB,uB=id,cB=x4,dB=b4,fB=P4,hB=R4,pB=lB;function wa(e){var t=this.__data__=new uB(e);this.size=t.size}wa.prototype.clear=cB,wa.prototype.delete=dB,wa.prototype.get=fB,wa.prototype.has=hB,wa.prototype.set=pB;var Hm=wa,gB="__lodash_hash_undefined__";function mB(e){return this.__data__.set(e,gB),this}var vB=mB;function yB(e){return this.__data__.has(e)}var wB=yB,_B=zm,TB=vB,EB=wB;function sd(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new _B;++t<n;)this.add(e[t])}sd.prototype.add=sd.prototype.push=TB,sd.prototype.has=EB;var Um=sd;function xB(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var SB=xB;function bB(e,t){return e.has(t)}var Vm=bB,CB=Um,PB=SB,OB=Vm,RB=1,IB=2;function AB(e,t,n,r,i,o){var a=n&RB,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=n&IB?new CB:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var g=e[d],p=t[d];if(r)var v=a?r(p,g,d,t,e,o):r(g,p,d,e,t,o);if(v!==void 0){if(v)continue;f=!1;break}if(h){if(!PB(t,function(m,y){if(!OB(h,y)&&(g===m||i(g,m,n,r,o)))return h.push(y)})){f=!1;break}}else if(!(g===p||i(g,p,n,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}var mx=AB,DB=sn,MB=DB.Uint8Array,vx=MB;function NB(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var LB=NB;function kB(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Gm=kB,yx=ga,wx=vx,FB=Bm,BB=mx,jB=LB,WB=Gm,zB=1,HB=2,UB="[object Boolean]",VB="[object Date]",GB="[object Error]",$B="[object Map]",qB="[object Number]",ZB="[object RegExp]",KB="[object Set]",YB="[object String]",XB="[object Symbol]",QB="[object ArrayBuffer]",JB="[object DataView]",_x=yx?yx.prototype:void 0,$m=_x?_x.valueOf:void 0;function e6(e,t,n,r,i,o,a){switch(n){case JB:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case QB:return!(e.byteLength!=t.byteLength||!o(new wx(e),new wx(t)));case UB:case VB:case qB:return FB(+e,+t);case GB:return e.name==t.name&&e.message==t.message;case ZB:case YB:return e==t+"";case $B:var s=jB;case KB:var l=r&zB;if(s||(s=WB),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=HB,a.set(e,t);var c=BB(s(e),s(t),r,i,o,a);return a.delete(e),c;case XB:if($m)return $m.call(e)==$m.call(t)}return!1}var t6=e6,n6=xm,r6=Ft;function i6(e,t,n){var r=t(e);return r6(e)?r:n6(r,n(e))}var Tx=i6;function o6(){return[]}var Ex=o6,a6=ox,s6=Ex,l6=Object.prototype,u6=l6.propertyIsEnumerable,xx=Object.getOwnPropertySymbols,c6=xx?function(e){return e==null?[]:(e=Object(e),a6(xx(e),function(t){return u6.call(e,t)}))}:s6,qm=c6,d6=Tx,f6=qm,h6=co;function p6(e){return d6(e,h6,f6)}var Sx=p6,bx=Sx,g6=1,m6=Object.prototype,v6=m6.hasOwnProperty;function y6(e,t,n,r,i,o){var a=n&g6,s=bx(e),l=s.length,u=bx(t),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in t:v6.call(t,f)))return!1}var h=o.get(e),g=o.get(t);if(h&&g)return h==t&&g==e;var p=!0;o.set(e,t),o.set(t,e);for(var v=a;++d<l;){f=s[d];var m=e[f],y=t[f];if(r)var E=a?r(y,m,f,t,e,o):r(m,y,f,e,t,o);if(!(E===void 0?m===y||i(m,y,n,r,o):E)){p=!1;break}v||(v=f=="constructor")}if(p&&!v){var b=e.constructor,R=t.constructor;b!=R&&"constructor" in e&&"constructor" in t&&!(typeof b=="function"&&b instanceof b&&typeof R=="function"&&R instanceof R)&&(p=!1)}return o.delete(e),o.delete(t),p}var w6=y6,_6=fo,T6=sn,E6=_6(T6,"DataView"),x6=E6,S6=fo,b6=sn,C6=S6(b6,"Promise"),P6=C6,O6=fo,R6=sn,I6=O6(R6,"Set"),Cx=I6,A6=fo,D6=sn,M6=A6(D6,"WeakMap"),Px=M6,Zm=x6,Km=Wm,Ym=P6,Xm=Cx,Qm=Px,Ox=Pi,_a=hx,Rx="[object Map]",N6="[object Object]",Ix="[object Promise]",Ax="[object Set]",Dx="[object WeakMap]",Mx="[object DataView]",L6=_a(Zm),k6=_a(Km),F6=_a(Ym),B6=_a(Xm),j6=_a(Qm),ho=Ox;(Zm&&ho(new Zm(new ArrayBuffer(1)))!=Mx||Km&&ho(new Km)!=Rx||Ym&&ho(Ym.resolve())!=Ix||Xm&&ho(new Xm)!=Ax||Qm&&ho(new Qm)!=Dx)&&(ho=function(e){var t=Ox(e),n=t==N6?e.constructor:void 0,r=n?_a(n):"";if(r)switch(r){case L6:return Mx;case k6:return Rx;case F6:return Ix;case B6:return Ax;case j6:return Dx}return t});var Ta=ho,Jm=Hm,W6=mx,z6=t6,H6=w6,Nx=Ta,Lx=Ft,kx=Xc,U6=Nm,V6=1,Fx="[object Arguments]",Bx="[object Array]",ld="[object Object]",G6=Object.prototype,jx=G6.hasOwnProperty;function $6(e,t,n,r,i,o){var a=Lx(e),s=Lx(t),l=a?Bx:Nx(e),u=s?Bx:Nx(t);l=l==Fx?ld:l,u=u==Fx?ld:u;var c=l==ld,d=u==ld,f=l==u;if(f&&kx(e)){if(!kx(t))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new Jm),a||U6(e)?W6(e,t,n,r,i,o):z6(e,t,l,n,r,i,o);if(!(n&V6)){var h=c&&jx.call(e,"__wrapped__"),g=d&&jx.call(t,"__wrapped__");if(h||g){var p=h?e.value():e,v=g?t.value():t;return o||(o=new Jm),i(p,v,n,r,o)}}return f?(o||(o=new Jm),H6(e,t,n,r,i,o)):!1}var q6=$6,Z6=q6,Wx=Mn;function zx(e,t,n,r,i){return e===t?!0:e==null||t==null||!Wx(e)&&!Wx(t)?e!==e&&t!==t:Z6(e,t,n,r,zx,i)}var ev=zx,K6=Hm,Y6=ev,X6=1,Q6=2;function J6(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],u=e[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in e))return!1}else{var d=new K6;if(r)var f=r(u,c,l,e,t,d);if(!(f===void 0?Y6(c,u,X6|Q6,r,d):f))return!1}}return!0}var ej=J6,tj=Qn;function nj(e){return e===e&&!tj(e)}var Hx=nj,rj=Hx,ij=co;function oj(e){for(var t=ij(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,rj(i)]}return t}var aj=oj;function sj(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Ux=sj,lj=ej,uj=aj,cj=Ux;function dj(e){var t=uj(e);return t.length==1&&t[0][2]?cj(t[0][0],t[0][1]):function(n){return n===e||lj(n,e,t)}}var fj=dj,hj=Pi,pj=Mn,gj="[object Symbol]";function mj(e){return typeof e=="symbol"||pj(e)&&hj(e)==gj}var il=mj,vj=Ft,yj=il,wj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_j=/^\w*$/;function Tj(e,t){if(vj(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||yj(e)?!0:_j.test(e)||!wj.test(e)||t!=null&&e in Object(t)}var tv=Tj,Vx=zm,Ej="Expected a function";function nv(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ej);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(nv.Cache||Vx),n}nv.Cache=Vx;var xj=nv,Sj=xj,bj=500;function Cj(e){var t=Sj(e,function(r){return n.size===bj&&n.clear(),r}),n=t.cache;return t}var Pj=Cj,Oj=Pj,Rj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ij=/\\(\\)?/g,Aj=Oj(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Rj,function(n,r,i,o){t.push(i?o.replace(Ij,"$1"):r||n)}),t}),Gx=Aj;function Dj(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Ea=Dj,$x=ga,Mj=Ea,Nj=Ft,Lj=il,kj=1/0,qx=$x?$x.prototype:void 0,Zx=qx?qx.toString:void 0;function Kx(e){if(typeof e=="string")return e;if(Nj(e))return Mj(e,Kx)+"";if(Lj(e))return Zx?Zx.call(e):"";var t=e+"";return t=="0"&&1/e==-kj?"-0":t}var Fj=Kx,Bj=Fj;function jj(e){return e==null?"":Bj(e)}var ud=jj,Wj=Ft,zj=tv,Hj=Gx,Uj=ud;function Vj(e,t){return Wj(e)?e:zj(e,t)?[e]:Hj(Uj(e))}var xa=Vj,Gj=il,$j=1/0;function qj(e){if(typeof e=="string"||Gj(e))return e;var t=e+"";return t=="0"&&1/e==-$j?"-0":t}var po=qj,Zj=xa,Kj=po;function Yj(e,t){t=Zj(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Kj(t[n++])];return n&&n==r?e:void 0}var ol=Yj,Xj=ol;function Qj(e,t,n){var r=e==null?void 0:Xj(e,t);return r===void 0?n:r}var Yx=Qj;function Jj(e,t){return e!=null&&t in Object(e)}var eW=Jj,tW=xa,nW=Vc,rW=Ft,iW=Qc(),oW=Dm,aW=po;function sW(e,t,n){t=tW(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=aW(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&oW(i)&&iW(a,i)&&(rW(e)||nW(e)))}var lW=sW,uW=eW,cW=lW;function dW(e,t){return e!=null&&cW(e,t,uW)}var fW=dW,hW=ev,pW=Yx,gW=fW,mW=tv,vW=Hx,yW=Ux,wW=po,_W=1,TW=2;function EW(e,t){return mW(e)&&vW(t)?yW(wW(e),t):function(n){var r=pW(n,e);return r===void 0&&r===t?gW(n,e):hW(t,r,_W|TW)}}var xW=EW;function SW(e){return e}var al=SW;function bW(e){return function(t){return t==null?void 0:t[e]}}var CW=bW,PW=ol;function OW(e){return function(t){return PW(t,e)}}var RW=OW,IW=CW,AW=RW,DW=tv,MW=po;function NW(e){return DW(e)?IW(MW(e)):AW(e)}var LW=NW,kW=fj,FW=xW,BW=al,jW=Ft,WW=LW;function zW(e){return typeof e=="function"?e:e==null?BW:typeof e=="object"?jW(e)?FW(e[0],e[1]):kW(e):WW(e)}var cd=zW,HW=ox,UW=YF,VW=cd,GW=Ft;function $W(e,t){var n=GW(e)?HW:UW;return n(e,VW(t))}var qW=$W;const dd=He(qW);function ZW(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}var KW=ZW;const go=He(KW);class YW{constructor(t={}){this.resource=t}isOnlyTag(){return this.motivations.length===1&&this.motivations[0]==="oa:tagging"}get id(){return this._id=this._id||this.resource["@id"]||this.resources[0]&&this.resources[0]["@id"]||Dr(),this._id}get targetId(){const t=this.on[0];switch(typeof t){case"string":return t.replace(/#?xywh=(.*)$/,"");case"object":return t.full.replace(/#?xywh=(.*)$/,"");default:return null}}get motivations(){return Pe(go(new Array(this.resource.motivation)))}get resources(){return Pe(go(new Array(this.resource.resource)))}get on(){return Pe(go(new Array(this.resource.on)))}get tags(){return this.isOnlyTag()?this.resources.map(t=>t.chars):this.resources.filter(t=>t["@type"]==="oa:Tag").map(t=>t.chars)}get chars(){return this.resources.filter(t=>t["@type"]!=="oa:Tag").map(t=>t.chars).join(" ")}get selector(){const t=this.on[0];switch(typeof t){case"string":return t;case"object":return t.selector["@type"]==="oa:Choice"?t.selector.default:t.selector;default:return null}}get svgSelector(){const t=this.on[0];switch(typeof t){case"string":return null;case"object":return t.selector&&t.selector.item&&t.selector.item["@type"]==="oa:SvgSelector"?t.selector.item:null;default:return null}}get fragmentSelector(){const{selector:t}=this;let n;switch(typeof t){case"string":n=t.match(/xywh=(.*)$/);break;case"object":n=t.value.match(/xywh=(.*)$/);break;default:return null}return n&&n[1].split(",").map(r=>parseInt(r,10))}}let Xx=class{constructor(t,n){this.json=t,this.target=n}get id(){return this.json["@id"]}present(){return this.resources&&this.resources.length>0}get resources(){return this._resources=this._resources||(!this.json||!this.json.resources?[]:Pe([this.json.resources]).map(t=>new YW(t))),this._resources}};class XW{constructor(t={}){this.resource=t}isOnlyTag(){return this.motivations.length===1&&this.motivations[0]==="tagging"}get id(){return this._id=this._id||this.resource.id||Dr(),this._id}get targetId(){const t=this.target[0];switch(typeof t){case"string":return t.replace(/#?xywh=(.*)$/,"");case"object":return t.source&&t.source.id||t.source||t.id;default:return null}}get motivations(){return Pe(go(new Array(this.resource.motivation)))}get body(){return Pe(go(new Array(this.resource.body)))}get resources(){return this.body}get tags(){return this.isOnlyTag()?this.body.map(t=>t.value):this.body.filter(t=>t.purpose==="tagging").map(t=>t.value)}get target(){return Pe(go(new Array(this.resource.target)))}get chars(){return this.isOnlyTag()?null:this.body.filter(t=>t.purpose!=="tagging").map(t=>t.value).join(" ")}get selector(){const t=this.target[0];switch(typeof t){case"string":return t;case"object":return Pe(go(new Array(t.selector)));default:return null}}get svgSelector(){const{selector:t}=this;switch(typeof t){case"string":return null;case"object":return t.find(n=>n.type&&n.type==="SvgSelector");default:return null}}get fragmentSelector(){const{selector:t}=this;let n,r;switch(typeof t){case"string":n=t.match(/xywh=(.*)$/);break;case"object":r=t.find(i=>i.type&&i.type==="FragmentSelector"),n=r&&r.value.match(/xywh=(.*)$/);break;default:return null}return n&&n[1].split(",").map(i=>parseInt(i,10))}}let QW=class{constructor(t,n){this.json=t,this.target=n}get id(){return this.json.id}present(){return this.items&&this.items.length>0}get items(){return this._items=this._items||(!this.json||!this.json.items?[]:Pe([this.json.items]).map(t=>new XW(t))),this._items}get resources(){return this.items}};class Qx{static determineAnnotation(t,n){return t?t.type==="AnnotationPage"?new QW(t,n):new Xx(t,n):null}}function Pt(e){return uo.state.slice?e[uo.state.slice]:e}class JW{constructor(t,n="single"){this.canvases=t,this.viewType=n,this._groupings=null}getCanvases(t){switch(this.viewType){case"book":return this.groupings()[Math.ceil(t/2)];default:return this.groupings()[t]}}groupings(){if(this._groupings)return this._groupings;if(this.viewType==="scroll")return[this.canvases];if(this.viewType!=="book")return this.canvases.map(n=>[n]);const t=[];return this.canvases.forEach((n,r)=>{if(r===0){t.push([n]);return}r%2!==0?t.push([n]):t[Math.ceil(r/2)].push(n)}),this._groupings=t,t}}var e9=Gc,t9=1/0;function n9(e){var t=e==null?0:e.length;return t?e9(e,t9):[]}var r9=n9;const Oi=He(r9);var Jx=function(){function e(t){this.__jsonld=t,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return e.prototype.getProperty=function(t){var n=null;return this.__jsonld&&(n=this.__jsonld[t],n||(n=this.__jsonld["@"+t])),n},e}(),ne={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.BOOKMARKING="oa:bookmarking",t.CLASSIFYING="oa:classifying",t.COMMENTING="oa:commenting",t.DESCRIBING="oa:describing",t.EDITING="oa:editing",t.HIGHLIGHTING="oa:highlighting",t.IDENTIFYING="oa:identifying",t.LINKING="oa:linking",t.MODERATING="oa:moderating",t.PAINTING="sc:painting",t.QUESTIONING="oa:questioning",t.REPLYING="oa:replying",t.TAGGING="oa:tagging",t.TRANSCRIBING="oad:transcribing"}(e.AnnotationMotivation||(e.AnnotationMotivation={})),function(t){t.AUTO_ADVANCE="auto-advance",t.CONTINUOUS="continuous",t.FACING_PAGES="facing-pages",t.HIDDEN="hidden",t.INDIVIDUALS="individuals",t.MULTI_PART="multi-part",t.NO_NAV="no-nav",t.NON_PAGED="non-paged",t.PAGED="paged",t.REPEAT="repeat",t.SEQUENCE="sequence",t.THUMBNAIL_NAV="thumbnail-nav",t.TOGETHER="together",t.UNORDERED="unordered"}(e.Behavior||(e.Behavior={})),function(t){t.CANVAS="canvas",t.CHOICE="choice",t.OA_CHOICE="oa:choice",t.CONTENT_AS_TEXT="contentastext",t.DATASET="dataset",t.DOCUMENT="document",t.IMAGE="image",t.MODEL="model",t.MOVING_IMAGE="movingimage",t.PDF="pdf",t.PHYSICAL_OBJECT="physicalobject",t.SOUND="sound",t.TEXT="text",t.TEXTUALBODY="textualbody",t.VIDEO="video"}(e.ExternalResourceType||(e.ExternalResourceType={})),function(t){t.ANNOTATION="annotation",t.CANVAS="canvas",t.COLLECTION="collection",t.MANIFEST="manifest",t.RANGE="range",t.SEQUENCE="sequence"}(e.IIIFResourceType||(e.IIIFResourceType={})),function(t){t.AUDIO_MP4="audio/mp4",t.CORTO="application/corto",t.DICOM="application/dicom",t.DRACO="application/draco",t.EPUB="application/epub+zip",t.GIRDER="image/vnd.kitware.girder",t.GLB="model/gltf-binary",t.GLTF="model/gltf+json",t.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',t.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',t.JPG="image/jpeg",t.M3U8="application/vnd.apple.mpegurl",t.MP3="audio/mp3",t.MPEG_DASH="application/dash+xml",t.OBJ="text/plain",t.OPF="application/oebps-package+xml",t.PDF="application/pdf",t.PLY="application/ply",t.THREEJS="application/vnd.threejs+json",t.USDZ="model/vnd.usd+zip",t.VIDEO_MP4="video/mp4",t.WAV="audio/wav",t.WEBM="video/webm"}(e.MediaType||(e.MediaType={})),function(t){t.DOC="application/msword",t.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",t.PDF="application/pdf"}(e.RenderingFormat||(e.RenderingFormat={})),function(t){t.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",t.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",t.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",t.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",t.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",t.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",t.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",t.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",t.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",t.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",t.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",t.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",t.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",t.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",t.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",t.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",t.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",t.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",t.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",t.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",t.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",t.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",t.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",t.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",t.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",t.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",t.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",t.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",t.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",t.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",t.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",t.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",t.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",t.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",t.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",t.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",t.SEARCH_0="http://iiif.io/api/search/0/search",t.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",t.SEARCH_1="http://iiif.io/api/search/1/search",t.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",t.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",t.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",t.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",t.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",t.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",t.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",t.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(e.ServiceProfile||(e.ServiceProfile={})),function(t){t.IMAGE_SERVICE_2="ImageService2",t.IMAGE_SERVICE_3="ImageService3"}(e.ServiceType||(e.ServiceType={})),function(t){t.BOTTOM_TO_TOP="bottom-to-top",t.LEFT_TO_RIGHT="left-to-right",t.RIGHT_TO_LEFT="right-to-left",t.TOP_TO_BOTTOM="top-to-bottom"}(e.ViewingDirection||(e.ViewingDirection={})),function(t){t.CONTINUOUS="continuous",t.INDIVIDUALS="individuals",t.NON_PAGED="non-paged",t.PAGED="paged",t.TOP="top"}(e.ViewingHint||(e.ViewingHint={}))})(ne);var i9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qr=function(e){i9(t,e);function t(n,r){var i=e.call(this,n)||this;return i.options=r,i}return t.prototype.getIIIFResourceType=function(){return pe.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var n=this.getProperty("label");return n?jt.parse(n,this.options.locale):new jt([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var n=this.getProperty("metadata"),r=[];if(!n)return r;for(var i=0;i<n.length;i++){var o=n[i],a=new pd(this.options.locale);a.parse(o),r.push(a)}return r},t.prototype.getRendering=function(n){for(var r=this.getRenderings(),i=0;i<r.length;i++){var o=r[i];if(o.getFormat()===n)return o}return null},t.prototype.getRenderings=function(){var n;this.__jsonld?n=this.__jsonld.rendering:n=this.rendering;var r=[];if(!n)return r;Array.isArray(n)||(n=[n]);for(var i=0;i<n.length;i++){var o=n[i];r.push(new S9(o,this.options))}return r},t.prototype.getRequiredStatement=function(){var n=null,r=this.getProperty("requiredStatement");return r&&(n=new pd(this.options.locale),n.parse(r)),n},t.prototype.getService=function(n){return pe.getService(this,n)},t.prototype.getServices=function(){return pe.getServices(this)},t.prototype.getThumbnail=function(){var n=this.getProperty("thumbnail");return Array.isArray(n)&&(n=n[0]),n?new I9(n,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.SEQUENCE},t}(Jx),o9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fd=function(e){o9(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.getFormat=function(){var n=this.getProperty("format");return n?n.toLowerCase():null},t.prototype.getResources=function(){var n=[];if(!this.__jsonld.resources)return n;for(var r=0;r<this.__jsonld.resources.length;r++){var i=this.__jsonld.resources[r],o=new sl(i,this.options);n.push(o)}return n},t.prototype.getType=function(){var n=this.getProperty("type");return n?pe.normaliseType(n):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},t.prototype.getMaxHeight=function(){var n=this.getProperty("maxHeight");return n?null:this.getMaxWidth()},t}(Qr),a9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eS=function(e){a9(t,e);function t(n,r){var i=e.call(this,n,r)||this;i.index=-1,i.isLoaded=!1;var o={defaultLabel:"-",locale:"en-GB",resource:i,pessimisticAccessControl:!1};return i.options=Object.assign(o,r),i}return t.prototype.getAttribution=function(){var n=this.getProperty("attribution");return n?jt.parse(n,this.options.locale):new jt([],this.options.locale)},t.prototype.getDescription=function(){var n=this.getProperty("description");return n?jt.parse(n,this.options.locale):new jt([],this.options.locale)},t.prototype.getHomepage=function(){var n=this.getProperty("homepage");return n?typeof n=="string"?n:(Array.isArray(n)&&n.length&&(n=n[0]),n["@id"]||n.id):null},t.prototype.getIIIFResourceType=function(){return pe.normaliseType(this.getProperty("type"))},t.prototype.getLogo=function(){var n=this.getProperty("logo");if(!n){var r=this.getProperty("provider");if(!r)return null;var i=r.find(function(o){return o.logo!==void 0});i&&i.logo!==void 0?n=i.logo:n=null}return n?typeof n=="string"?n:(Array.isArray(n)&&n.length&&(n=n[0]),n["@id"]||(n==null?void 0:n.id)):null},t.prototype.getLicense=function(){return pe.getLocalisedValue(this.getProperty("license"),this.options.locale)},t.prototype.getRights=function(){var n=this.getProperty("rights");return n?typeof n=="string"?n:(Array.isArray(n)&&n.length&&(n=n[0]),n["@id"]||n.id):null},t.prototype.getNavDate=function(){return new Date(this.getProperty("navDate"))},t.prototype.getRelated=function(){return this.getProperty("related")},t.prototype.getSeeAlso=function(){return this.getProperty("seeAlso")},t.prototype.getTrackingLabel=function(){var n=this.getService(ne.ServiceProfile.TRACKING_EXTENSIONS);return n?n.getProperty("trackingLabel"):""},t.prototype.getDefaultTree=function(){return this.defaultTree=new gd("root"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var n=null,r=this.getProperty("requiredStatement");if(r)n=new pd(this.options.locale),n.parse(r);else{var i=this.getAttribution();i&&i.length&&(n=new pd(this.options.locale),n.value=i)}return n},t.prototype.isCollection=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===ne.IIIFResourceType.MANIFEST},t.prototype.load=function(){var n=this;return new Promise(function(r){if(n.isLoaded)r(n);else{var i=n.options;i.navDate=n.getNavDate();var o=n.__jsonld.id;o||(o=n.__jsonld["@id"]),pe.loadManifest(o).then(function(a){n.parentLabel=n.getLabel().getValue(i.locale);var s=iS.parse(a,i);n=Object.assign(n,s),n.index=i.index,r(n)})}})},t}(Qr),s9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sl=function(e){s9(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.getBody=function(){var n=[],r=this.getProperty("body");if(r)if(Array.isArray(r))for(var i=0;i<r.length;i++){var o=r[i];if(o.items)for(var a=0;a<o.items.length;a++){var s=o.items[a];n.push(new hd(s,this.options))}else n.push(new hd(o,this.options))}else if(r.items)for(var i=0;i<r.items.length;i++){var o=r.items[i];n.push(new hd(o,this.options))}else n.push(new hd(r,this.options));return n},t.prototype.getMotivation=function(){var n=this.getProperty("motivation");return n||null},t.prototype.getOn=function(){return this.getProperty("on")},t.prototype.getTarget=function(){return this.getProperty("target")},t.prototype.getResource=function(){return new fd(this.getProperty("resource"),this.options)},t}(Qr),l9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hd=function(e){l9(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.getFormat=function(){var n=this.getProperty("format");return n?pe.getMediaType(n):null},t.prototype.getType=function(){var n=this.getProperty("type");return n?pe.normaliseType(this.getProperty("type")):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t}(Qr),u9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c9=function(e){u9(t,e);function t(n,r,i){var o=e.call(this,r)||this;return o.label=n,o.options=i,o}return t.prototype.getIIIFResourceType=function(){return pe.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){return this.label},t.prototype.getResources=function(){var n=this,r=this.getProperty("resources");return r.map(function(i){return new sl(i,n.options)})},t.prototype.load=function(){var n=this;return new Promise(function(r,i){if(n.isLoaded)r(n);else{var o=n.__jsonld.id;o||(o=n.__jsonld["@id"]),pe.loadManifest(o).then(function(a){n.__jsonld=a,n.context=n.getProperty("context"),n.id=n.getProperty("id"),n.isLoaded=!0,r(n)}).catch(i)}})},t}(Jx),d9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tS=function(e){d9(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.getItems=function(){return this.getProperty("items")},t}(Qr),f9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ll=function(e){f9(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.getCanonicalImageUri=function(n){var r=null,i="full",o=0,a="default",s=n,l;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])r=this.externalResource.data["@id"],s||(s=this.externalResource.data.width),this.externalResource.data["@context"]&&(this.externalResource.data["@context"].indexOf("/1.0/context.json")>-1||this.externalResource.data["@context"].indexOf("/1.1/context.json")>-1||this.externalResource.data["@context"].indexOf("/1/context.json")>-1)&&(a="native");else{var u=void 0;if(u=this.getImages(),u&&u.length){var c=u[0],d=c.getResource(),f=d.getServices();s||(s=d.getWidth());var h=f?f.find(function(y){return pe.isImageProfile(y.getProfile())||pe.isImageServiceType(y.getIIIFResourceType())}):null;if(h)r=h.id,a=pe.getImageQuality(h.getProfile());else if(s===d.getWidth())return d.id}if(u=this.getContent(),u&&u.length){var c=u[0],g=c.getBody(),p=g[0],f=p.getServices();s||(s=p.getWidth());var h=f?f.find(function(R){return pe.isImageServiceType(R.getIIIFResourceType())}):null;if(h)r=h.id,a=pe.getImageQuality(h.getProfile());else if(s===p.getWidth())return p.id}if(!r){var v=this.getProperty("thumbnail");if(v){if(typeof v=="string")return v;if(v["@id"])return v["@id"];if(v.length)return v[0].id}}}l=s+",",r&&r.endsWith("/")&&(r=r.substr(0,r.length-1));var m=[r,i,l,o,a+".jpg"].join("/");return m},t.prototype.getMaxDimensions=function(){var n=null,r;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(r=this.externalResource.data.profile,Array.isArray(r)&&(r=r.filter(function(i){var o;return(o=i.maxWidth)!==null&&o!==void 0?o:i.maxwidth})[0],r&&(n=new P9(r.maxWidth,r.maxHeight?r.maxHeight:r.maxWidth)))),n},t.prototype.getContent=function(){var n=[],r=this.__jsonld.items||this.__jsonld.content;if(!r)return n;var i=null;if(r.length&&(i=new tS(r[0],this.options)),!i)return n;for(var o=i.getItems(),a=0;a<o.length;a++){var s=o[a],l=new sl(s,this.options);n.push(l)}return n},t.prototype.getDuration=function(){return this.getProperty("duration")},t.prototype.getImages=function(){var n=[];if(!this.__jsonld.images)return n;for(var r=0;r<this.__jsonld.images.length;r++){var i=this.__jsonld.images[r],o=new sl(i,this.options);n.push(o)}return n},t.prototype.getIndex=function(){return this.getProperty("index")},t.prototype.getOtherContent=function(){var n=this,r=Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")],i=function(a,s){return typeof a!="string"||typeof s!="string"?!1:a.toLowerCase()===a.toLowerCase()},o=r.filter(function(a){return a&&i(a["@type"],"sc:AnnotationList")}).map(function(a,s){return new c9(a.label||"Annotation list ".concat(s),a,n.options)}).map(function(a){return a.load()});return Promise.all(o)},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},Object.defineProperty(t.prototype,"imageResources",{get:function(){var n=this,r=Oi([this.getImages().map(function(i){return i.getResource()}),this.getContent().map(function(i){return i.getBody()})]);return Pe(r.map(function(i){switch(i.getProperty("type").toLowerCase()){case ne.ExternalResourceType.CHOICE:case ne.ExternalResourceType.OA_CHOICE:return new t({images:Pe([i.getProperty("default"),i.getProperty("item")]).map(function(o){return{resource:o}})},n.options).getImages().map(function(o){return o.getResource()});default:return i}}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resourceAnnotations",{get:function(){return Oi([this.getImages(),this.getContent()])},enumerable:!1,configurable:!0}),t.prototype.resourceAnnotation=function(n){return this.resourceAnnotations.find(function(r){return r.getResource().id===n||Pe(new Array(r.getBody())).some(function(i){return i.id===n})})},t.prototype.onFragment=function(n){var r=this.resourceAnnotation(n);if(r){var i=r.getProperty("on"),o=r.getProperty("target");if(!(!i||!o)){var a=(i||o).match(/xywh=(.*)$/);if(a)return a[1].split(",").map(function(s){return parseInt(s,10)})}}},Object.defineProperty(t.prototype,"iiifImageResources",{get:function(){return this.imageResources.filter(function(n){return n&&n.getServices()[0]&&n.getServices()[0].id})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageServiceIds",{get:function(){return this.iiifImageResources.map(function(n){return n.getServices()[0].id})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!1,configurable:!0}),t}(fd),h9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p9=function(e){h9(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.items=[],i._collections=null,i._manifests=null,n.__collection=i,i}return t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter(function(n){return n.isCollection()})},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter(function(n){return n.isManifest()})},t.prototype.getCollectionByIndex=function(n){for(var r=this.getCollections(),i,o=0;o<r.length;o++){var a=r[o];a.index===n&&(i=a)}if(i)return i.options.index=n,i.load();throw new Error("Collection index not found")},t.prototype.getManifestByIndex=function(n){for(var r=this.getManifests(),i,o=0;o<r.length;o++){var a=r[o];a.index===n&&(i=a)}if(i)return i.options.index=n,i.load();throw new Error("Manifest index not found")},t.prototype.getTotalCollections=function(){return this.getCollections().length},t.prototype.getTotalManifests=function(){return this.getManifests().length},t.prototype.getTotalItems=function(){return this.items.length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):ne.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getBehavior=function(){var n=this.getProperty("behavior");return Array.isArray(n)&&(n=n[0]),n||null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getDefaultTree=function(){return e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=pe.normaliseType(Mr.COLLECTION),this._parseManifests(this),this._parseCollections(this),pe.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._parseManifests=function(n){if(n.getManifests()&&n.getManifests().length)for(var r=0;r<n.getManifests().length;r++){var i=n.getManifests()[r],o=i.getDefaultTree();o.label=i.parentLabel||i.getLabel().getValue(this.options.locale)||"manifest "+(r+1),o.navDate=i.getNavDate(),o.data.id=i.id,o.data.type=pe.normaliseType(Mr.MANIFEST),n.defaultTree.addNode(o)}},t.prototype._parseCollections=function(n){if(n.getCollections()&&n.getCollections().length)for(var r=0;r<n.getCollections().length;r++){var i=n.getCollections()[r],o=i.getDefaultTree();o.label=i.parentLabel||i.getLabel().getValue(this.options.locale)||"collection "+(r+1),o.navDate=i.getNavDate(),o.data.id=i.id,o.data.type=pe.normaliseType(Mr.COLLECTION),n.defaultTree.addNode(o)}},t}(eS),rv=function(){function e(t,n){this.start=t,this.end=n}return e.prototype.getLength=function(){return this.end-this.start},e}(),pd=function(){function e(t){this.defaultLocale=t}return e.prototype.parse=function(t){this.resource=t,this.label=jt.parse(this.resource.label,this.defaultLocale),this.value=jt.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(t){return this.label===null?null:(Array.isArray(t)&&!t.length&&(t=void 0),this.label.getValue(t||this.defaultLocale))},e.prototype.setLabel=function(t){this.label===null&&(this.label=new jt([])),this.label.setValue(t,this.defaultLocale)},e.prototype.getValue=function(t,n){return n===void 0&&(n="<br/>"),this.value===null?null:(Array.isArray(t)&&!t.length&&(t=void 0),this.value.getValue(t||this.defaultLocale,n))},e.prototype.getValues=function(t){return this.value===null?[]:(Array.isArray(t)&&!t.length&&(t=void 0),this.value.getValues(t||this.defaultLocale))},e.prototype.setValue=function(t){this.value===null&&(this.value=new jt([])),this.value.setValue(t,this.defaultLocale)},e}(),g9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){g9(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.getValue=function(n,r){return n.getValue(r,"<br/>")},t.getValues=function(n,r){return n.getValues(r)},t})(Array);var he={};Object.defineProperty(he,"__esModule",{value:!0}),he.CONTINUE=100,he.SWITCHING_PROTOCOLS=101,he.PROCESSING=102;var Sa=he.OK=200;he.CREATED=201,he.ACCEPTED=202,he.NON_AUTHORITATIVE_INFORMATION=203,he.NO_CONTENT=204,he.RESET_CONTENT=205,he.PARTIAL_CONTENT=206,he.MULTI_STATUS=207,he.MULTIPLE_CHOICES=300,he.MOVED_PERMANENTLY=301;var ul=he.MOVED_TEMPORARILY=302;he.SEE_OTHER=303,he.NOT_MODIFIED=304,he.USE_PROXY=305,he.TEMPORARY_REDIRECT=307,he.BAD_REQUEST=400;var m9=he.UNAUTHORIZED=401;he.PAYMENT_REQUIRED=402,he.FORBIDDEN=403,he.NOT_FOUND=404,he.METHOD_NOT_ALLOWED=405,he.NOT_ACCEPTABLE=406,he.PROXY_AUTHENTICATION_REQUIRED=407,he.REQUEST_TIME_OUT=408,he.CONFLICT=409,he.GONE=410,he.LENGTH_REQUIRED=411,he.PRECONDITION_FAILED=412,he.REQUEST_ENTITY_TOO_LARGE=413,he.REQUEST_URI_TOO_LARGE=414,he.UNSUPPORTED_MEDIA_TYPE=415,he.REQUESTED_RANGE_NOT_SATISFIABLE=416,he.EXPECTATION_FAILED=417,he.IM_A_TEAPOT=418,he.UNPROCESSABLE_ENTITY=422,he.LOCKED=423,he.FAILED_DEPENDENCY=424,he.UNORDERED_COLLECTION=425,he.UPGRADE_REQUIRED=426,he.PRECONDITION_REQUIRED=428,he.TOO_MANY_REQUESTS=429,he.REQUEST_HEADER_FIELDS_TOO_LARGE=431,he.INTERNAL_SERVER_ERROR=500,he.NOT_IMPLEMENTED=501,he.BAD_GATEWAY=502,he.SERVICE_UNAVAILABLE=503,he.GATEWAY_TIME_OUT=504,he.HTTP_VERSION_NOT_SUPPORTED=505,he.VARIANT_ALSO_NEGOTIATES=506,he.INSUFFICIENT_STORAGE=507,he.BANDWIDTH_LIMIT_EXCEEDED=509,he.NOT_EXTENDED=510,he.NETWORK_AUTHENTICATION_REQUIRED=511;function v9(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(c){return s[c.toLowerCase()]},has:function(c){return c.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(c,d,f){o.push(d=d.toLowerCase()),a.push([d,f]),s[d]=s[d]?s[d]+","+f:f}),n(l())},i.onerror=r,i.withCredentials=t.credentials=="include",t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})}const nS=Cn(Object.freeze(Object.defineProperty({__proto__:null,default:v9},Symbol.toStringTag,{value:"Module"})));self.fetch||(self.fetch=nS.default||nS);var iv=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{u(r.next(c))}catch(d){a(d)}}function l(c){try{u(r.throw(c))}catch(d){a(d)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})},ov=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},pe=function(){function e(){}return e.getMediaType=function(t){return t=t.toLowerCase(),t=t.split(";")[0],t.trim()},e.getImageQuality=function(t){return t===ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||t===ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||t===ne.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||t===ne.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||t===ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||t===ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||t===ne.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||t===ne.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||t===ne.ServiceProfile.IMAGE_1_LEVEL_1||t===ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||t===ne.ServiceProfile.IMAGE_1_LEVEL_2||t===ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},e.getInexactLocale=function(t){return t.indexOf("-")!==-1?t.substr(0,t.indexOf("-")):t},e.getLocalisedValue=function(t,n){if(!Array.isArray(t))return t;for(var r=0;r<t.length;r++){var i=t[r],o=i["@language"];if(n===o)return i["@value"]}for(var a=n.substr(0,n.indexOf("-")),r=0;r<t.length;r++){var s=t[r],l=s["@language"];if(l===a)return s["@value"]}return null},e.generateTreeNodeIds=function(t,n){n===void 0&&(n=0);var r;t.parentNode?r=t.parentNode.id+"-"+n:r="0",t.id=r;for(var i=0;i<t.nodes.length;i++){var o=t.nodes[i];e.generateTreeNodeIds(o,i)}},e.normaliseType=function(t){if(t=(t||"").toLowerCase(),t.indexOf(":")!==-1){var n=t.split(":");return n[1]}return t},e.normaliseUrl=function(t){return t=t.substr(t.indexOf("://")),t.indexOf("#")!==-1&&(t=t.split("#")[0]),t},e.normalisedUrlsMatch=function(t,n){return e.normaliseUrl(t)===e.normaliseUrl(n)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isImageServiceType=function(t){return t!==null&&t.toLowerCase()===ne.ServiceType.IMAGE_SERVICE_2.toLowerCase()||t===ne.ServiceType.IMAGE_SERVICE_3.toLowerCase()},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,ne.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(t,n){return iS.parse(t,n)},e.checkStatus=function(t){if(t.ok)return t;var n=new Error(t.statusText);return n.response=t,Promise.reject(n)},e.loadManifest=function(t){return new Promise(function(n,r){fetch(t).then(e.checkStatus).then(function(i){return i.json()}).then(function(i){n(i)}).catch(function(i){r()})})},e.loadExternalResourcesAuth1=function(t,n,r,i,o,a,s,l){return new Promise(function(u,c){var d=t.map(function(f){return e.loadExternalResourceAuth1(f,n,r,i,o,a,s,l)});Promise.all(d).then(function(){u(t)}).catch(function(f){c(f)})})},e.loadExternalResourceAuth1=function(t,n,r,i,o,a,s,l){return iv(this,void 0,void 0,function(){var u;return ov(this,function(c){switch(c.label){case 0:return[4,i(t)];case 1:return u=c.sent(),u?[4,t.getData(u)]:[3,6];case 2:return c.sent(),t.status!==Sa?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,n,r,o,a,s,l)];case 4:c.sent(),c.label=5;case 5:if(t.status===Sa||t.status===ul)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return c.sent(),t.status===ul||t.status===m9?[4,e.doAuthChain(t,n,r,o,a,s,l)]:[3,9];case 8:c.sent(),c.label=9;case 9:if(t.status===Sa||t.status===ul)return[2,t];throw e.createAuthorizationFailedError()}})})},e.doAuthChain=function(t,n,r,i,o,a,s){return iv(this,void 0,void 0,function(){var l,u,c,d,f,h,g,p,p;return ov(this,function(v){switch(v.label){case 0:return t.isAccessControlled()?(l=t.externalService,l&&(l.options=t.options),u=t.kioskService,u&&(u.options=t.options),c=t.clickThroughService,c&&(c.options=t.options),d=t.loginService,d&&(d.options=t.options),!t.isResponseHandled&&t.status===ul?[4,a(t)]:[3,2]):[2,t];case 1:return v.sent(),[2,t];case 2:return f=null,h=null,f=l,f?(h=f,[4,e.attemptResourceWithToken(t,r,f)]):[3,4];case 3:return v.sent(),[2,t];case 4:return f=u,f?(h=f,g=n(f),g?[4,i(g)]:[3,7]):[3,7];case 5:return v.sent(),[4,e.attemptResourceWithToken(t,r,f)];case 6:return v.sent(),[2,t];case 7:return f=c,f?(h=f,[4,o(t,f)]):[3,11];case 8:return p=v.sent(),p?[4,i(p)]:[3,11];case 9:return v.sent(),[4,e.attemptResourceWithToken(t,r,f)];case 10:return v.sent(),[2,t];case 11:return f=d,f?(h=f,[4,o(t,f)]):[3,15];case 12:return p=v.sent(),p?[4,i(p)]:[3,15];case 13:return v.sent(),[4,e.attemptResourceWithToken(t,r,f)];case 14:return v.sent(),[2,t];case 15:return h&&s(t,h),[2]}})})},e.attemptResourceWithToken=function(t,n,r){return iv(this,void 0,void 0,function(){var i,o;return ov(this,function(a){switch(a.label){case 0:return i=r.getService(ne.ServiceProfile.AUTH_1_TOKEN),i?[4,n(t,i)]:[3,3];case 1:return o=a.sent(),o&&o.accessToken?[4,t.getData(o)]:[3,3];case 2:return a.sent(),[2,t];case 3:return[2]}})})},e.loadExternalResourcesAuth09=function(t,n,r,i,o,a,s,l,u,c){return new Promise(function(d,f){var h=t.map(function(g){return e.loadExternalResourceAuth09(g,n,r,i,o,a,s,l,u,c)});Promise.all(h).then(function(){d(t)}).catch(function(g){f(g)})})},e.loadExternalResourceAuth09=function(t,n,r,i,o,a,s,l,u,c){return new Promise(function(d,f){c&&c.pessimisticAccessControl?t.getData().then(function(){t.isAccessControlled()?t.clickThroughService?(d(r(t)),d(i(t))):o(t).then(function(){a(t,!0).then(function(h){t.getData(h).then(function(){d(u(t))}).catch(function(g){f(e.createInternalServerError(g))})}).catch(function(h){f(e.createInternalServerError(h))})}).catch(function(h){f(e.createInternalServerError(h))}):d(t)}).catch(function(h){f(e.createInternalServerError(h))}):l(t,n).then(function(h){h?t.getData(h).then(function(){t.status===Sa?d(u(t)):e.authorize(t,n,r,i,o,a,s,l).then(function(){d(u(t))}).catch(function(g){f(e.createAuthorizationFailedError())})}).catch(function(g){f(e.createAuthorizationFailedError())}):e.authorize(t,n,r,i,o,a,s,l).then(function(){d(u(t))}).catch(function(g){f(e.createAuthorizationFailedError())})}).catch(function(h){f(e.createAuthorizationFailedError())})})},e.createError=function(t,n){var r=new Error;return r.message=n,r.name=String(t),r},e.createAuthorizationFailedError=function(){return e.createError(cl.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(cl.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(cl.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,n,r,i,o,a,s,l){return new Promise(function(u,c){t.getData().then(function(){t.isAccessControlled()?l(t,n).then(function(d){d?t.getData(d).then(function(){t.status===Sa?u(t):e.showAuthInteraction(t,n,r,i,o,a,s,u,c)}).catch(function(f){c(e.createInternalServerError(f))}):a(t,!1).then(function(f){f?s(t,f,n).then(function(){t.getData(f).then(function(){t.status===Sa?u(t):e.showAuthInteraction(t,n,r,i,o,a,s,u,c)}).catch(function(h){c(e.createInternalServerError(h))})}).catch(function(h){c(e.createInternalServerError(h))}):e.showAuthInteraction(t,n,r,i,o,a,s,u,c)})}).catch(function(d){c(e.createInternalServerError(d))}):u(t)})})},e.showAuthInteraction=function(t,n,r,i,o,a,s,l,u){t.status===ul&&!t.isResponseHandled?l(t):t.clickThroughService&&!t.isResponseHandled?r(t).then(function(){a(t,!0).then(function(c){s(t,c,n).then(function(){t.getData(c).then(function(){l(t)}).catch(function(d){u(e.createInternalServerError(d))})}).catch(function(d){u(e.createInternalServerError(d))})}).catch(function(c){u(e.createInternalServerError(c))})}):o(t).then(function(){a(t,!0).then(function(c){s(t,c,n).then(function(){t.getData(c).then(function(){l(t)}).catch(function(d){u(e.createInternalServerError(d))})}).catch(function(d){u(e.createInternalServerError(d))})}).catch(function(c){u(e.createInternalServerError(c))})})},e.getService=function(t,n){for(var r=this.getServices(t),i=0;i<r.length;i++){var o=r[i];if(o.getProfile()===n)return o}return null},e.getResourceById=function(t,n){return e.traverseAndFind(t.__jsonld,"@id",n)},e.traverseAndFind=function(t,n,r){if(t.hasOwnProperty(n)&&t[n]===r)return t;for(var i=0;i<Object.keys(t).length;i++)if(typeof t[Object.keys(t)[i]]=="object"){var o=e.traverseAndFind(t[Object.keys(t)[i]],n,r);if(o!=null)return o}},e.getServices=function(t,n){var r=n===void 0?{}:n,i=r.onlyService,o=i===void 0?!1:i,a=r.onlyServices,s=a===void 0?!1:a,l=r.skipParentResources,u=l===void 0?!1:l,c=[];!u&&t&&t.options&&t.options.resource&&t.options.resource!==t&&c.push.apply(c,e.getServices(t.options.resource,{onlyServices:!0}));var d=s?[]:(t.__jsonld||t).service||[];if(Array.isArray(d)||(d=[d]),o||d.push.apply(d,(t.__jsonld||t).services||[]),d.length===0)return c;for(var f=0;f<d.length;f++){var h=d[f];if(typeof h=="string"){var g=this.getResourceById(t.options.resource,h);g&&c.push(new oS(g.__jsonld||g,t.options))}else c.push(new oS(h,t.options))}return c},e.getTemporalComponent=function(t){var n=/t=([^&]+)/g.exec(t),r=null;return n&&n[1]&&(r=n[1].split(",")),r},e}(),y9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ba=function(){function e(t,n,r){r===void 0&&(r="none"),Array.isArray(t)&&t.length===1?this._value=t[0]:this._value=t,(n==="none"||n==="@none")&&(n=void 0),this._locale=n,this._defaultLocale=r}return e.parseV2Value=function(t,n){return typeof t=="string"?new e(t,void 0,n):t["@value"]?new e(t["@value"],t["@language"],n):null},Object.defineProperty(e.prototype,"value",{get:function(){return Array.isArray(this._value)?this._value.join("<br/>"):this._value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){return this._locale===void 0?this._defaultLocale:this._locale},enumerable:!1,configurable:!0}),e.prototype.addValue=function(t){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(t)?this._value=this._value.concat(t):this._value.push(t)},e}(),jt=function(e){y9(t,e);function t(n,r){n===void 0&&(n=[]);var i=e.apply(this,n)||this;return i.__proto__=t.prototype,i._defaultLocale=r,i}return t.parse=function(n,r){if(!n)return new t([],r);if(Array.isArray(n)){var i=n.map(function(a){return ba.parseV2Value(a,r)}).filter(function(a){return a!==null}),o=i.reduce(function(a,s){var l=s._locale;return l||(l="none"),a[l]?a[l].addValue(s._value):a[l]=s,a},{});return new t(Object.values(o),r)}else{if(typeof n=="string")return new t([new ba(n,void 0,r)],r);if(n["@language"]){var i=ba.parseV2Value(n);return new t(i!==null?[i]:[],r)}else if(n["@value"]){var i=ba.parseV2Value(n);return new t(i!==null?[i]:[],r)}else return new t(Object.keys(n).map(function(a){var s=n[a];if(!Array.isArray(s))throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");return new ba(s,a,r)}),r)}},t.prototype.getSuitableLocale=function(n){for(var r=Array.from(this.values()).map(function(h){return h._locale}).filter(function(h){return h!==void 0}),i=function(h){var g=r.find(function(p){return p===h});if(g)return{value:g}},o=0,a=n;o<a.length;o++){var s=a[o],l=i(s);if(typeof l=="object")return l.value}for(var u=function(h){var g=r.find(function(p){return pe.getInexactLocale(p)===pe.getInexactLocale(h)});if(g)return{value:g}},c=0,d=n;c<d.length;c++){var s=d[c],f=u(s);if(typeof f=="object")return f.value}},t.prototype.setValue=function(n,r){var i=void 0;if(!r)i=this.find(function(a){return a._locale===void 0});else{var o=this.getSuitableLocale([r]);o&&(i=this.find(function(a){return a._locale===o}))}i?i._value=n:this.push(new ba(n,r,this._defaultLocale))},t.prototype.getValue=function(n,r){var i=this.getValues(n);return i.length===0?null:r?i.join(r):i[0]},t.prototype.getValues=function(n){if(!this.length)return[];var r;if(n?Array.isArray(n)?r=n:r=[n]:r=[],this.length===1&&this[0]._locale===void 0){var i=this[0]._value;return Array.isArray(i)?i:[i]}var o=this.getSuitableLocale(r);if(o){var i=this.find(function(u){return u._locale===o})._value;return Array.isArray(i)?i:[i]}var a=!this.find(function(l){return l._locale===void 0});if(a){var i=this[0]._value;return Array.isArray(i)?i:[i]}var s=this.find(function(l){return l._locale===void 0});return s?Array.isArray(s._value)?s._value:[s._value]:[]},t}(Array),w9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_9=function(e){w9(t,e);function t(n,r){var i=e.call(this,n,r)||this;if(i.index=0,i._allRanges=null,i.items=[],i._topRanges=[],i.__jsonld.structures&&i.__jsonld.structures.length)for(var o=i._getTopRanges(),a=0;a<o.length;a++){var s=o[a];i._parseRanges(s,String(a))}return i}return t.prototype.getPosterCanvas=function(){var n=this.getProperty("posterCanvas");return n&&(n=new ll(n,this.options)),n},t.prototype.getAccompanyingCanvas=function(){var n=this.getProperty("accompanyingCanvas");return n&&(n=new ll(n,this.options)),n},t.prototype.getBehavior=function(){var n=this.getProperty("behavior");return Array.isArray(n)&&(n=n[0]),n||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=pe.normaliseType(Mr.MANIFEST),!this.isLoaded)return this.defaultTree;var n=this.getTopRanges();return n.length&&n[0].getTree(this.defaultTree),pe.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var n=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var r=0;r<this.__jsonld.structures.length;r++){var i=this.__jsonld.structures[r];i.viewingHint===ne.ViewingHint.TOP&&n.push(i)}if(!n.length){var o={};o.ranges=this.__jsonld.structures,n.push(o)}}return n},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(n){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var r=0;r<this.__jsonld.structures.length;r++){var i=this.__jsonld.structures[r];if(i["@id"]===n||i.id===n)return i}return null},t.prototype._parseRanges=function(n,r,i){var o,a=null;if(typeof n=="string"&&(a=n,n=this._getRangeById(a)),!n){console.warn("Range:",a,"does not exist");return}o=new E9(n,this.options),o.parentRange=i,o.path=r,i?i.items.push(o):this._topRanges.push(o);var s=n.items||n.members;if(s)for(var l=0;l<s.length;l++){var u=s[l];if(u["@type"]&&u["@type"].toLowerCase()==="sc:range"||u.type&&u.type.toLowerCase()==="range")this._parseRanges(u,r+"/"+l,o);else if(u["@type"]&&u["@type"].toLowerCase()==="sc:canvas"||u.type&&u.type.toLowerCase()==="canvas"){o.canvases||(o.canvases=[]);var c=u.id||u["@id"];o.canvases.push(c)}}else if(n.ranges)for(var l=0;l<n.ranges.length;l++)this._parseRanges(n.ranges[l],r+"/"+l,o)},t.prototype.getAllRanges=function(){if(this._allRanges!=null)return this._allRanges;this._allRanges=[];for(var n=this.getTopRanges(),r=function(a){var s=n[a];s.id&&i._allRanges.push(s);var l=function(c,d){c.add(d);var f=d.getRanges();return f.length?f.reduce(l,c):c},u=Array.from(s.getRanges().reduce(l,new Set));i._allRanges=i._allRanges.concat(u)},i=this,o=0;o<n.length;o++)r(o);return this._allRanges},t.prototype.getRangeById=function(n){for(var r=this.getAllRanges(),i=0;i<r.length;i++){var o=r[i];if(o.id===n)return o}return null},t.prototype.getRangeByPath=function(n){for(var r=this.getAllRanges(),i=0;i<r.length;i++){var o=r[i];if(o.path===n)return o}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var n=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(n)for(var r=0;r<n.length;r++){var i=n[r],o=new rS(i,this.options);this.items.push(o)}else if(this.__jsonld.items){var o=new rS(this.__jsonld.items,this.options);this.items.push(o)}return this.items},t.prototype.getSequenceByIndex=function(n){return this.getSequences()[n]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var n=this.getService(ne.ServiceProfile.UI_EXTENSIONS);return n?n.getProperty("manifestType"):av.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var n=this.getViewingHint();if(n)return n===ne.ViewingHint.PAGED;var r=this.getBehavior();return r?r===ne.Behavior.PAGED:!1},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(eS),av;(function(e){e.EMPTY="",e.MANUSCRIPT="manuscript",e.MONOGRAPH="monograph"})(av||(av={}));var T9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E9=function(e){T9(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i._ranges=null,i.canvases=null,i.items=[],i}return t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var n=[],r=[],i=0,o=this.canvases;i<o.length;i++){var a=o[i];if(a){var s=a.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,a],l=s[1],u=s[2],c=s[3];l&&(n.push(parseFloat(u)),r.push(parseFloat(c)))}}if(n.length&&r.length)return new rv(Math.min.apply(Math,n),Math.max.apply(Math,r))}else{for(var d=this.getRanges(),n=[],r=[],f=0,h=d;f<h.length;f++){var g=h[f],p=g.getDuration();p&&(n.push(p.start),r.push(p.end))}if(n.length&&r.length)return new rv(Math.min.apply(Math,n),Math.max.apply(Math,r))}var v,m;if(this.canvases&&this.canvases.length)for(var y=0;y<this.canvases.length;y++){var a=this.canvases[y],E=pe.getTemporalComponent(a);E&&E.length>1&&(y===0&&(v=Number(E[0])),y===this.canvases.length-1&&(m=Number(E[1])))}else for(var d=this.getRanges(),y=0;y<d.length;y++){var g=d[y],p=g.getDuration();p&&(y===0&&(v=p.start),y===d.length-1&&(m=p.end))}if(v!==void 0&&m!==void 0)return new rv(v,m)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter(function(n){return n.isRange()})},t.prototype.getBehavior=function(){var n=this.getProperty("behavior");return Array.isArray(n)&&(n=n[0]),n||null},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getTree=function(n){n.data=this,this.treeNode=n;var r=this.getRanges();if(r&&r.length)for(var i=0;i<r.length;i++){var o=r[i],a=new gd;n.addNode(a),this._parseTreeNode(a,o)}return pe.generateTreeNodeIds(n),n},t.prototype.spansTime=function(n){var r=this.getDuration();return!!(r&&n>=r.start&&n<=r.end)},t.prototype._parseTreeNode=function(n,r){n.label=r.getLabel().getValue(this.options.locale),n.data=r,n.data.type=pe.normaliseType(Mr.RANGE),r.treeNode=n;var i=r.getRanges();if(i&&i.length)for(var o=0;o<i.length;o++){var a=i[o],s=a.getBehavior();if(s!==ne.Behavior.NO_NAV){var l=new gd;n.addNode(l),this._parseTreeNode(l,a)}}},t}(Qr),x9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),S9=function(e){x9(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.getFormat=function(){return this.getProperty("format")},t}(Qr),b9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rS=function(e){b9(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.items=[],i._thumbnails=null,i}return t.prototype.getCanvases=function(){if(this.items.length)return this.items;var n=this.__jsonld.canvases||this.__jsonld.elements;if(n)for(var r=0;r<n.length;r++){var i=n[r],o=new ll(i,this.options);o.index=r,this.items.push(o)}else if(this.__jsonld)for(var r=0;r<this.__jsonld.length;r++){var i=this.__jsonld[r],o=new ll(i,this.options);o.index=r,this.items.push(o)}return this.items},t.prototype.getCanvasById=function(n){for(var r=0;r<this.getTotalCanvases();r++){var i=this.getCanvasByIndex(r),o=pe.normaliseUrl(i.id);if(pe.normaliseUrl(n)===o)return i}return null},t.prototype.getCanvasByIndex=function(n){return this.getCanvases()[n]},t.prototype.getCanvasIndexById=function(n){for(var r=0;r<this.getTotalCanvases();r++){var i=this.getCanvasByIndex(r);if(i.id===n)return r}return null},t.prototype.getCanvasIndexByLabel=function(n,r){n=n.trim(),isNaN(n)||(n=parseInt(n,10).toString(),r&&(n+="r"));for(var i=/(\d*)\D+(\d*)/,o,a,s,l,u,c=0;c<this.getTotalCanvases();c++){var d=this.getCanvasByIndex(c);if(d.getLabel().getValue(this.options.locale)===n)return c;if(o=i.exec(n),!!o&&(l=o[1],u=o[2],!!u&&(s="^"+l+"\\D+"+u+"$",a=new RegExp(s),a.test(d.getLabel().toString()))))return c}return-1},t.prototype.getLastCanvasLabel=function(n){for(var r=this.getTotalCanvases()-1;r>=0;r--){var i=this.getCanvasByIndex(r),o=i.getLabel().getValue(this.options.locale);if(n){var a=/^[a-zA-Z0-9]*$/;if(a.test(o))return o}else if(o)return o}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(n,r){var i;if(r){var o=this.getPagedIndices(n),a=this.getViewingDirection();a&&a===ne.ViewingDirection.RIGHT_TO_LEFT?i=o[0]+1:i=o[o.length-1]+1}else i=n+1;return i>this.getLastPageIndex()?-1:i},t.prototype.getPagedIndices=function(n,r){var i=[];if(!r)i.push(n);else{this.isFirstCanvas(n)||this.isLastCanvas(n)?i=[n]:n%2?i=[n,n+1]:i=[n-1,n];var o=this.getViewingDirection();o&&o===ne.ViewingDirection.RIGHT_TO_LEFT&&(i=i.reverse())}return i},t.prototype.getPrevPageIndex=function(n,r){var i;if(r){var o=this.getPagedIndices(n),a=this.getViewingDirection();a&&a===ne.ViewingDirection.RIGHT_TO_LEFT?i=o[o.length-1]-1:i=o[0]-1}else i=n-1;return i},t.prototype.getStartCanvasIndex=function(){var n=this.getStartCanvas();if(n)for(var r=0;r<this.getTotalCanvases();r++){var i=this.getCanvasByIndex(r);if(i.id===n)return r}return 0},t.prototype.getThumbs=function(n,r){for(var i=[],o=this.getTotalCanvases(),a=0;a<o;a++){var s=this.getCanvasByIndex(a),l=new O9(n,s);i.push(l)}return i},t.prototype.getThumbnails=function(){if(this._thumbnails!=null)return this._thumbnails;this._thumbnails=[];for(var n=this.getCanvases(),r=0;r<n.length;r++){var i=n[r].getThumbnail();i&&this._thumbnails.push(i)}return this._thumbnails},t.prototype.getStartCanvas=function(){return this.getProperty("startCanvas")},t.prototype.getTotalCanvases=function(){return this.getCanvases().length},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.isCanvasIndexOutOfRange=function(n){return n>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(n){return n===0},t.prototype.isLastCanvas=function(n){return n===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var n=this.getViewingHint();return n?n===ne.ViewingHint.PAGED:!1},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2===0},t}(Qr),iS=function(){function e(){}return e.parse=function(t,n){return typeof t=="string"&&(t=JSON.parse(t)),this.parseJson(t,n)},e.parseJson=function(t,n){var r;if(n&&n.navDate&&!isNaN(n.navDate.getTime())&&(t.navDate=n.navDate.toString()),t["@type"])switch(t["@type"]){case"sc:Collection":r=this.parseCollection(t,n);break;case"sc:Manifest":r=this.parseManifest(t,n);break;default:return null}else switch(t.type){case"Collection":r=this.parseCollection(t,n);break;case"Manifest":r=this.parseManifest(t,n);break;default:return null}return r.isLoaded=!0,r},e.parseCollection=function(t,n){var r=new p9(t,n);return n?(r.index=n.index||0,n.resource&&(r.parentCollection=n.resource.parentCollection)):r.index=0,this.parseCollections(r,n),this.parseManifests(r,n),this.parseItems(r,n),r},e.parseCollections=function(t,n){var r;if(t.__jsonld.collections?r=t.__jsonld.collections:t.__jsonld.items&&(r=t.__jsonld.items.filter(function(a){return a.type.toLowerCase()==="collection"})),r)for(var i=0;i<r.length;i++){n&&(n.index=i);var o=this.parseCollection(r[i],n);o.index=i,o.parentCollection=t,t.items.push(o)}},e.parseManifest=function(t,n){var r=new _9(t,n);return r},e.parseManifests=function(t,n){var r;if(t.__jsonld.manifests?r=t.__jsonld.manifests:t.__jsonld.items&&(r=t.__jsonld.items.filter(function(a){return a.type.toLowerCase()==="manifest"})),r)for(var i=0;i<r.length;i++){var o=this.parseManifest(r[i],n);o.index=i,o.parentCollection=t,t.items.push(o)}},e.parseItem=function(t,n){if(t["@type"]){if(t["@type"].toLowerCase()==="sc:manifest")return this.parseManifest(t,n);if(t["@type"].toLowerCase()==="sc:collection")return this.parseCollection(t,n)}else if(t.type){if(t.type.toLowerCase()==="manifest")return this.parseManifest(t,n);if(t.type.toLowerCase()==="collection")return this.parseCollection(t,n)}return null},e.parseItems=function(t,n){var r=t.__jsonld.members||t.__jsonld.items;if(r)for(var i=function(l){n&&(n.index=l);var u=o.parseItem(r[l],n);if(!u)return{value:void 0};if(t.items.filter(function(c){return c.id===u.id})[0])return"continue";u.index=l,u.parentCollection=t,t.items.push(u)},o=this,a=0;a<r.length;a++){var s=i(a);if(typeof s=="object")return s.value}},e}(),C9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oS=function(e){C9(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.getProfile=function(){var n=this.getProperty("profile");return n||(n=this.getProperty("dcterms:conformsTo")),Array.isArray(n)?n[0]:n},t.prototype.getConfirmLabel=function(){return pe.getLocalisedValue(this.getProperty("confirmLabel"),this.options.locale)},t.prototype.getDescription=function(){return pe.getLocalisedValue(this.getProperty("description"),this.options.locale)},t.prototype.getFailureDescription=function(){return pe.getLocalisedValue(this.getProperty("failureDescription"),this.options.locale)},t.prototype.getFailureHeader=function(){return pe.getLocalisedValue(this.getProperty("failureHeader"),this.options.locale)},t.prototype.getHeader=function(){return pe.getLocalisedValue(this.getProperty("header"),this.options.locale)},t.prototype.getServiceLabel=function(){return pe.getLocalisedValue(this.getProperty("label"),this.options.locale)},t.prototype.getInfoUri=function(){var n=this.id;return n.endsWith("/")||(n+="/"),n+="info.json",n},t}(Qr),P9=function(){function e(t,n){this.width=t,this.height=n}return e}(),cl;(function(e){e[e.AUTHORIZATION_FAILED=1]="AUTHORIZATION_FAILED",e[e.FORBIDDEN=2]="FORBIDDEN",e[e.INTERNAL_SERVER_ERROR=3]="INTERNAL_SERVER_ERROR",e[e.RESTRICTED=4]="RESTRICTED"})(cl||(cl={}));var O9=function(){function e(t,n){this.data=n,this.index=n.index,this.width=t;var r=n.getHeight()/n.getWidth();r?this.height=Math.floor(this.width*r):this.height=t,this.uri=n.getCanonicalImageUri(t),this.label=n.getLabel().getValue(),this.viewingHint=n.getViewingHint()}return e}(),R9=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),I9=function(e){R9(t,e);function t(n,r){return e.call(this,n,r)||this}return t}(fd),gd=function(){function e(t,n){this.label=t,this.data=n||{},this.nodes=[]}return e.prototype.addNode=function(t){this.nodes.push(t),t.parentNode=this},e.prototype.isCollection=function(){return this.data.type===pe.normaliseType(Mr.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===pe.normaliseType(Mr.MANIFEST)},e.prototype.isRange=function(){return this.data.type===pe.normaliseType(Mr.RANGE)},e}(),Mr;(function(e){e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range"})(Mr||(Mr={}));class Wt{constructor(t){this.canvas=t}get id(){return this.canvas.id}getWidth(){return this.canvas.getWidth()}getHeight(){return this.canvas.getHeight()}get aspectRatio(){return this.canvas.getWidth()/this.canvas.getHeight()}get annotationListUris(){return Pe(new Array(this.canvas.__jsonld.otherContent)).filter(t=>t&&(typeof t=="string"||t["@type"]==="sc:AnnotationList")).map(t=>typeof t=="string"?t:t["@id"])}get canvasAnnotationPages(){return Pe(new Array(this.canvas.__jsonld.annotations)).filter(t=>t&&t.type==="AnnotationPage")}get imageResource(){return this.imageResources[0]}get imageResources(){const t=Oi([this.canvas.getImages().map(n=>n.getResource()),this.canvas.getContent().map(n=>n.getBody())]);return Pe(t.map(n=>{switch(n.getProperty("type")){case"oa:Choice":return new ll({images:Pe([n.getProperty("default"),n.getProperty("item")]).map(r=>({resource:r}))},this.canvas.options).getImages().map(r=>r.getResource());default:return n}}))}get videoResources(){const t=Oi([this.canvas.getContent().map(n=>n.getBody())]);return Pe(t.filter(n=>n.getProperty("type")==="Video"))}get audioResources(){const t=Oi([this.canvas.getContent().map(n=>n.getBody())]);return Pe(t.filter(n=>n.getProperty("type")==="Sound"))}get v2VttContent(){const t=Oi([this.canvas.getContent().map(n=>n.getBody())]);return Pe(t.filter(n=>n.getProperty("format")==="text/vtt"))}get v3VttContent(){const t=Oi(this.canvasAnnotationPages.map(n=>new tS(n,this.canvas.options).getItems().map(i=>new sl(i,this.canvas.options).getBody())));return Pe(t.filter(n=>n.getProperty("format")==="text/vtt"))}get resourceAnnotations(){return Oi([this.canvas.getImages(),this.canvas.getContent()])}resourceAnnotation(t){return this.resourceAnnotations.find(n=>n.getResource().id===t||Pe(new Array(n.getBody())).some(r=>r.id===t))}onFragment(t){const n=this.resourceAnnotation(t);if(!n)return;const r=n.getProperty("on"),i=n.getProperty("target"),o=(r||i).match(/xywh=(.*)$/);if(o)return o[1].split(",").map(a=>parseInt(a,10))}get iiifImageResources(){return this.imageResources.filter(t=>t&&t.getServices()[0]&&t.getServices()[0].id)}get imageServiceIds(){return this.iiifImageResources.map(t=>t.getServices()[0].id)}get service(){return this.canvas.__jsonld.service}hasLabelOrCaption(){const t=this.canvas&&this.canvas.getLabel().length>0,n=this.getCaption().length>0;return t||n}getCanvasLabel(){const t=this.getLabel(),n=this.getCaption();return t===""&&n===""?"No details available":t}getLabel(){return this.canvas&&this.canvas.getLabel().length>0?this.canvas.getLabel().getValue():""}getScreenReaderOrder(t){return this.canvas?String(this.canvas.index+1)+" of "+String(t)+": ":String(t)+" images: "}getOrder(t){return this.canvas?String(this.canvas.index+1)+"/"+String(t)+" - ":""}getCaption(){if(this.canvas){const n=this.canvas.getMetadata().find(r=>r.getLabel().toLowerCase()==="caption");if(n)return n.getValue()}return""}downloadImageGET(){if(this.canvas){const n=this.canvas.getRenderings().find(r=>r.getLabel().getValue().toLowerCase()==="download url");if(n){const i=this.canvas.getMetadata().find(o=>o.getLabel().toLowerCase()==="download filename");return{url:n.id,filename:i?i.getValue():"image.jpg"}}}return null}downloadImagePOST(){if(this.canvas){const t=this.canvas.getMetadata(),n=t.find(o=>o.getLabel().toLowerCase()==="download url"),r=t.find(o=>o.getLabel().toLowerCase()==="download post data"),i=t.find(o=>o.getLabel().toLowerCase()==="download post data content type");if(n&&r&&i){const o=t.find(a=>a.getLabel().toLowerCase()==="download filename");return{url:n.getValue(),formData:r.getValue(),contentType:i.getValue(),filename:o?o.getValue():"image.jpg"}}}return null}hasDownloadImage(){return this.canvas?this.downloadImageGET()!=null||this.downloadImagePOST()!=null:!1}getLicensingUrl(){if(this.canvas){const n=this.canvas.getMetadata().find(r=>r.getLabel().toLowerCase()==="license image url");if(n)return n.getValue()}return""}}function A9(e){return Object.values(Pt(e).windows).map(t=>t.manifestId)}function mo(e){return Pt(e).windows||{}}function yt(e,{windowId:t}){return mo(e)[t]}const md=U([e=>Pt(e).viewers,(e,{windowId:t})=>t],(e,t)=>e[t]);function Nn(e){return Pt(e).workspace}const Ca=U([Nn],({windowIds:e})=>e||[]);function vd(e){return Pt(e).manifests||{}}function dl(e,{manifestId:t,windowId:n}){const r=vd(e);return r&&r[t||n&&(yt(e,{windowId:n})||{}).manifestId]}function D9(e){return Pt(e).catalog||{}}function M9(e){return typeof e=="string"||typeof e=="number"}var N9=function(){function e(){this._cache={}}var t=e.prototype;return t.set=function(r,i){this._cache[r]=i},t.get=function(r){return this._cache[r]},t.remove=function(r){delete this._cache[r]},t.clear=function(){this._cache={}},t.isValidCacheKey=function(r){return M9(r)},e}(),L9=N9,k9=function(){return!0};function F9(e){var t=[].concat(e),n=t[t.length-1],r,i=void 0;return typeof n=="function"||(i=t.pop()),r=t.pop(),{inputSelectors:Array.isArray(t[0])?t[0]:[].concat(t),resultFunc:r,createSelectorOptions:i}}function B9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=F9(t),i=r.inputSelectors,o=r.resultFunc,a=r.createSelectorOptions;return function(s){var l=typeof s=="function"?{keySelector:s}:Object.assign({},s),u=0,c=function(){return u++,o.apply(void 0,arguments)},d=[i,c];a&&d.push(a);var f=l.cacheObject||new L9,h=l.selectorCreator||U,g=f.isValidCacheKey||k9;l.keySelectorCreator&&(l.keySelector=l.keySelectorCreator({keySelector:l.keySelector,inputSelectors:i,resultFunc:o}));var p=function(){var m=l.keySelector.apply(l,arguments);if(g(m)){var y=f.get(m);return y===void 0&&(y=h.apply(void 0,d),f.set(m,y)),y.apply(void 0,arguments)}console.warn('[re-reselect] Invalid cache key "'+m+'" has been returned by keySelector function.')};return p.getMatchingSelector=function(){var v=l.keySelector.apply(l,arguments);return f.get(v)},p.removeMatchingSelector=function(){var v=l.keySelector.apply(l,arguments);f.remove(v)},p.clearCache=function(){f.clear()},p.resultFunc=o,p.dependencies=i,p.cache=f,p.recomputations=function(){return u},p.resetRecomputations=function(){return u=0},p.keySelector=l.keySelector,p}}class aS{constructor(t){this.manifest=t}get startCanvas(){let t;const n=this.manifest.getSequences()[0];if(n){if(t=n.getProperty("startCanvas"),!t){const r=this.manifest.getProperty("start")||n.getProperty("start");t=r&&(r.id||r.source)}return t&&n.getCanvasById(t)||void 0}}canvasAt(t){const n=this.manifest.getSequences()[0],r=n&&n.getCanvases();return r&&r[t]}}function vo(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function j9(e){const t=e.getProfile();return t.endsWith("#level1")||t.endsWith("#level2")?!1:t==="level0"?!0:pe.isLevel0ImageProfile(t)}function W9(e){const t=e.getProfile();return t.endsWith("#level0")||t.endsWith("#level1")?!1:t==="level2"?!0:pe.isLevel2ImageProfile(t)}function z9(e){const t=e.getProperty("type")||[];return vo(t).some(n=>n.startsWith("ImageService"))}function sv(e){const t=e&&e.getServices().find(n=>z9(n)||pe.isImageProfile(n.getProfile()));if(t)return t}class Pa{constructor(t,n={}){this.resource=t,this.iiifOpts=n}static staticImageUrl(t){return{height:t.getProperty("height"),url:t.id,width:t.getProperty("width")}}static getPreferredImage(t){const n=new Wt(t);return n.iiifImageResources[0]||n.imageResource}static selectBestImageSize(t,n){const r=vo(t.getProperty("sizes"));let i={default:!0,height:t.getProperty("height")||Number.MAX_SAFE_INTEGER,width:t.getProperty("width")||Number.MAX_SAFE_INTEGER};const o=a=>a.width*a.height-n;if(i=r.reduce((a,s)=>{const l=o(s);return l<0?a:Math.abs(l)<Math.abs(o(a))?s:a},i),i.width*i.height>n*6&&(i=r.reduce((a,s)=>Math.abs(o(s))<Math.abs(o(a))?s:a,i)),!i.default)return i}iiifThumbnailUrl(t){let n,r,i,a=120,s=120;const{maxHeight:l,maxWidth:u}=this.iiifOpts;l&&(a=Math.max(l,120)),u&&(s=Math.max(u,120));const c=sv(t);if(!c)return Pa.staticImageUrl(t);const d=t.getWidth()&&t.getHeight()&&t.getWidth()/t.getHeight(),f=u&&l?u*l:a*s,h=Pa.selectBestImageSize(c,f);if(h)r=h.width,i=h.height,n=`${r},${i}`;else if(j9(c)){if(!c.getProperty("height")&&!c.getProperty("width"))return Pa.staticImageUrl(t)}else l&&u?W9(c)?(n=`!${s},${a}`,r=s,i=a,d&&d>1&&(i=Math.round(s/d)),d&&d<1&&(r=Math.round(a*d))):s/a<d?(n=`${s},`,r=s,d&&(i=Math.round(s/d))):(n=`,${a}`,i=a,d&&(r=Math.round(a*d))):l&&!u?(n=`,${a}`,i=a,d&&(r=Math.round(a*d))):!l&&u?(n=`${s},`,r=s,d&&(i=Math.round(s/d))):(n=",120",i=120,d&&(r=Math.round(i*d)));const g="full",p=pe.getImageQuality(c.getProfile()),v=c.id.replace(/\/+$/,""),m=this.getFormat(c);return{height:i,url:[v,g,n,0,`${p}.${m}`].join("/"),width:r}}getFormat(t){const{preferredFormats:n=[]}=this.iiifOpts,r=t.getProperty("preferredFormats");if(!r)return"jpg";const i=r.filter(o=>n.includes(o));return i[0]?i[0]:!r.includes("jpg")&&n.includes("jpg")?"jpg":r[0]?r[0]:"jpg"}getSourceContentResource(t){const n=t.getThumbnail();if(n)return typeof n.__jsonld=="string"?n.__jsonld:!t.isCollection()&&!t.isManifest()&&!t.isCanvas()&&t.getType()==="image"&&sv(t)&&!sv(n)?t:n;if(t.isCollection()){const r=t.getManifests()[0];return r?this.getSourceContentResource(r):void 0}if(t.isManifest()){const r=new aS(t),i=r.startCanvas||r.canvasAt(0);return i?this.getSourceContentResource(i):void 0}if(t.isCanvas()){const r=Pa.getPreferredImage(t);return r?this.getSourceContentResource(r):void 0}if(t.getType()==="image")return t}get(){if(!this.resource)return;const t=this.getSourceContentResource(this.resource);if(t)return typeof t=="string"?{url:t}:this.iiifThumbnailUrl(t)}}function lv(e,t){return new Pa(e,t).get()}var H9=fo,U9=function(){try{var e=H9(Object,"defineProperty");return e({},"",{}),e}catch{}}(),sS=U9,lS=sS;function V9(e,t,n){t=="__proto__"&&lS?lS(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var yd=V9;function G9(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}var $9=G9,q9=dx;function Z9(e,t,n,r){return q9(e,function(i,o,a){t(r,i,n(i),a)}),r}var K9=Z9,Y9=$9,X9=K9,Q9=cd,J9=Ft;function e8(e,t){return function(n,r){var i=J9(n)?Y9:X9,o=t?t():{};return i(n,e,Q9(r),o)}}var uS=e8,t8=yd,n8=uS,r8=Object.prototype,i8=r8.hasOwnProperty,o8=n8(function(e,t,n){i8.call(e,n)?e[n].push(t):t8(e,n,[t])}),a8=o8;const cS=He(a8);function fl(e){return Pt(e).companionWindows||{}}const wd=U([fl,(e,{companionWindowId:t})=>t],(e,t)=>t&&e[t]),s8=U([yt,fl],(e,t)=>e&&t[e.thumbnailNavigationId]&&t[e.thumbnailNavigationId].position),l8=U([mo,fl],(e,t)=>(Object.keys(e)||[]).reduce((n,r)=>({...n,[r]:cS(e[r].companionWindowIds,i=>t[i]&&t[i].position)}),{})),u8=U([mo,fl],(e,t)=>(Object.keys(e)||[]).reduce((n,r)=>({...n,[r]:cS(e[r].companionWindowIds.map(i=>t[i]),i=>i.position)}),{})),uv=U([(e,{windowId:t})=>t,u8],(e,t)=>t[e]||{}),c8=U([(e,{windowId:t})=>t,l8],(e,t)=>t[e]||{}),d8=U([uv,(e,{position:t})=>t],(e,t)=>e[t]||fS),dS=U([uv,(e,{content:t})=>t],(e,t)=>[].concat(...Object.values(e)).filter(n=>n.content===t)),fS=[],cv=U([c8,(e,{position:t})=>t],(e,t)=>e[t]||fS),f8=U([(e,{position:t})=>t,yt],(e,t)=>{if(!t)return!1;const{companionAreaOpen:n,sideBarOpen:r}=t;return e!=="left"?!0:!!(n&&r)}),h8=U([uv],e=>{let t=0,n=0;return[].concat(...Object.values(e)).forEach(r=>{r.position.match(/right/)&&(t+=235),r.position.match(/bottom/)&&(n+=201)}),{height:n,width:t}});var p8=function(t){return g8(t)&&!m8(t)};function g8(e){return!!e&&typeof e=="object"}function m8(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||w8(e)}var v8=typeof Symbol=="function"&&Symbol.for,y8=v8?Symbol.for("react.element"):60103;function w8(e){return e.$$typeof===y8}function _8(e){return Array.isArray(e)?[]:{}}function hl(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Oa(_8(e),e,t):e}function T8(e,t,n){return e.concat(t).map(function(r){return hl(r,n)})}function E8(e,t){if(!t.customMerge)return Oa;var n=t.customMerge(e);return typeof n=="function"?n:Oa}function x8(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function hS(e){return Object.keys(e).concat(x8(e))}function pS(e,t){try{return t in e}catch{return!1}}function S8(e,t){return pS(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function b8(e,t,n){var r={};return n.isMergeableObject(e)&&hS(e).forEach(function(i){r[i]=hl(e[i],n)}),hS(t).forEach(function(i){S8(e,i)||(pS(e,i)&&n.isMergeableObject(t[i])?r[i]=E8(i,n)(e[i],t[i],n):r[i]=hl(t[i],n))}),r}function Oa(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||T8,n.isMergeableObject=n.isMergeableObject||p8,n.cloneUnlessOtherwiseSpecified=hl;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):b8(e,t,n):hl(t,n)}Oa.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Oa(r,i,n)},{})};var C8=Oa,P8=C8;const pl=He(P8);function Ie(e){return Pt(e||{}).config||{}}const O8=U([Nn,Ie],(e,t)=>e.showZoomControls===void 0?t.workspace.showZoomControls:e.showZoomControls),R8=U([Nn,Ie],(e,t)=>e.showZoomControls===void 0?t.workspace.showNavigationArrows:e.showNavigationArrows),_d=U([Ie],({theme:e,themes:t,selectedTheme:n})=>pl(e,t[n]||{})),I8=U([Ie],({themes:e})=>Object.keys(e)),gS=U([Ie],({requests:e})=>e||{});function mS(e,t){if(!e)return;const n=pe.parseManifest(e,t?{locale:t}:void 0);return n!=null&&typeof n.getSequences!="function"&&(n.getSequences=()=>[]),n}const Td=U([wd,Ie],(e={},t={})=>e.locale||t.language),dv=U([dl],e=>({...e,missing:!e})),fv=U([dl],e=>e&&e.error),A8=B9(dl,Td,(e,t)=>e&&mS(e.json,t))((e,{companionWindowId:t,manifestId:n,windowId:r})=>[n,r,Td(e,{companionWindowId:t})].join(" - ")),ct=U(A8,(e,{json:t})=>t,Td,(e,t,n)=>t&&mS(t,n)||e),Ri=U([ct],e=>e&&e.options&&e.options.locale&&e.options.locale.replace(/-.*$/,""));function Ii(e){return U([ct],t=>t&&t.getProperty(e))}const vS=U([Ii("provider")],e=>e),D8=U([Ii("provider"),Ri],(e,t)=>e&&e[0].label&&jt.parse(e[0].label,t).getValue()),yS=U([vS],e=>{var n;const t=e&&e[0]&&e[0].logo&&e[0].logo[0];return t?(n=lv(new fd(t)))==null?void 0:n.url:null}),M8=U([ct,yS],(e,t)=>t||e&&e.getLogo()),N8=U([Ii("homepage"),Ri],(e,t)=>e&&vo(e).map(n=>({label:jt.parse(n.label,t).getValue(),value:n.id||n["@id"]}))),L8=U([ct],e=>e&&e.getRenderings().map(t=>({label:t.getLabel().getValue(),value:t.id}))),wS=U([Ii("seeAlso"),Ri],(e,t)=>e&&vo(e).map(n=>({format:n.format,label:jt.parse(n.label,t).getValue(),value:n.id||n["@id"]}))),k8=wS,F8=U([Ii("related"),Ri],(e,t)=>e&&vo(e).map(n=>typeof n=="string"?{value:n}:{format:n.format,label:jt.parse(n.label,t).getValue(),value:n.id||n["@id"]})),B8=U([ct],e=>e&&vo(e.getRequiredStatement()).filter(t=>t.getValues().some(n=>n)).map(t=>({label:t.label&&t.label.getValue()||null,values:t.getValues()}))),j8=U([Ii("rights"),Ii("license"),Ri],(e,t,n)=>{const r=e||t;return vo(jt.parse(r,n).getValues())});function W8(e,t){const n=ct(e,t),{thumbnails:r={}}=Ie(e);if(!n)return;const i=lv(n,{maxHeight:80,maxWidth:120,preferredFormats:r.preferredFormats});return i&&i.url}const Ra=U([ct],e=>e&&e.getLabel().getValue()),z8=U([Td,ct],(e,t)=>t&&t.getDescription().getValue(e)),H8=U([Ii("summary"),Ri],(e,t)=>e&&jt.parse(e,t).getValue(t)),_S=U([ct],e=>e&&e.id);function TS(e){return e&&e.getMetadata().map(t=>({label:t.getLabel(),values:t.getValues()}))}const U8=U([ct],e=>e&&TS(e));function ES(e){const t=[];return Array.isArray(e)?t.push(...e.filter(n=>typeof n=="object"&&n["@language"]).map(n=>n["@language"])):e&&typeof e=="object"&&e["@language"]&&t.push(e["@language"]),t}function V8(e){if(!e)return[];const t=e.getProperty("metadata")||[],n={};for(let r=0;r<t.length;r+=1){const i=t[r];ES(i.label).forEach(o=>{n[o]=!0}),ES(i.value).forEach(o=>{n[o]=!0})}return Object.keys(n)}const G8=U([ct],e=>V8(e)),hv=U([ct],e=>{if(!e)return null;const t=e.getService("http://iiif.io/api/search/0/search")||e.getService("http://iiif.io/api/search/1/search");return t||null}),$8=U([hv],e=>{const t=e&&(e.getService("http://iiif.io/api/search/0/autocomplete")||e.getService("http://iiif.io/api/search/1/autocomplete"));return t&&t}),pv=U([ct],e=>{if(!e||!e.getTopRanges)return null;const t=e.getTopRanges(),n=t.filter(o=>o.getProperty("viewingHint")==="top");let r=[];return n.length===0&&t.length===1&&(r=t[0].getRanges().filter(o=>o.getBehavior()==="sequence")),[].concat(e.getSequences(),r)}),Nr=U([pv,yt,(e,{sequenceId:t})=>t],(e,t,n)=>{if(!e)return null;if(n||t&&t.sequenceId){const r=e.find(i=>i.id===(n||t.sequenceId));if(r)return r}return e[0]}),q8=U([yt,Nr],(e,t)=>(t&&e&&e.canvasId&&t.getCanvasById(e.canvasId)||{}).index||0),gv=U([Nr,ct],(e,t)=>{if(!t)return null;const n=e&&e.getViewingHint()||t.getViewingHint();return n||null}),xS=U([yt,Nr,ct],(e,t,n)=>{const r=e&&e.viewingDirection||t&&t.getViewingDirection()||n&&n.getViewingDirection();return r||null}),mv=U([Nr,ct],(e,t)=>{if(!t||!e)return[];const n=e&&e.getProperty("behavior");if(n)return Array.isArray(n)?n:[n];const r=t.getProperty("behavior");return r?Array.isArray(r)?r:[r]:[]}),vv=U([Nr,ct],(e,t)=>e&&e.getProperty("type")&&e.isRange()?e.getTree(new gd("root")):t&&t.getDefaultTree()),_r=U([Ie,yt],({window:e},t={})=>({...e,...t}));function Z8(e){const t={};return Object.keys(mo(e)).forEach(n=>{t[n]=Ra(e,{windowId:n})}),t}const K8=U([mo],e=>Object.values(e).filter(t=>t.maximized===!0).map(t=>t.id)),yv=U([yt,_r,gv,mv],(e,{views:t=[],defaultView:n},r,i)=>{if(e&&e.view)return e.view;const o=(t||[]).find(a=>a.behaviors&&a.behaviors.some(s=>r===s||i.includes(s)));return o&&o.key||n}),Y8=U([gv,mv,_r],(e,t,{views:n=[],defaultView:r})=>(n||[]).reduce((i,o)=>((o.key===r||!o.behaviors||o.behaviors.some(a=>e===a||t.includes(a)))&&i.push(o.key),i),[])),X8=U([yt,e=>Ca(e).length>1,_r],(e,t,n)=>n.allowDragging&&t&&e&&e.maximized===!1),Ia=e=>Pt(e).infoResponses,Lr=U([Nr],e=>e&&e.getCanvases()||[]),Ai=U([Nr,(e,{canvasId:t})=>t],(e,t)=>{if(!(!e||!t))return e.getCanvasById(t)}),Ed=U([Nr,yt],(e,t)=>{if(!(!e||!t))return t.canvasId?e.getCanvasById(t.canvasId):e.getCanvasByIndex(0)}),Di=U([yt],e=>e&&(e.visibleCanvases||e.canvasId&&[e.canvasId])||[]),Mi=U([Di,Lr],(e,t)=>(t||[]).filter(n=>e.includes(n.id))),xd=U([Lr,yv],(e,t)=>e&&new JW(e,t).groupings()),wv=U([xd,(e,{canvasId:t})=>t],(e,t)=>e&&e.find(n=>n.some(r=>r.id===t))||[]),SS=U([xd,Ed],(e,t,n)=>{if(!e||!t)return;const r=e.findIndex(o=>o.some(a=>a.id===t.id));return r<0||r+1>=e.length?void 0:e[r+1]}),bS=U([xd,Ed],(e,t,n)=>{if(!e||!t)return;const r=e.findIndex(o=>o.some(a=>a.id===t.id));return r<1?void 0:e[r-1]}),CS=U([Ai],e=>e&&(e.getLabel().length>0?e.getLabel().getValue():String(e.index+1))),Q8=U([Ai],e=>e&&e.getProperty("description")),Sd=U([Mi],e=>Pe(e.map(t=>new Wt(t).imageResources)).filter(t=>t.getServices().length<1)),_v=U([Mi],e=>Pe(e.map(t=>new Wt(t).videoResources))),Tv=U([Mi],e=>Pe(e.map(t=>{const n=new Wt(t);return n.v3VttContent.length?n.v3VttContent:n.v2VttContent}))),Ev=U([Mi],e=>Pe(e.map(t=>new Wt(t).audioResources))),PS=U([(e,{infoId:t})=>t,Ai,Ia],(e,t,n)=>{let r=e;if(!e){if(!t)return;const o=new Wt(t).iiifImageResources[0];r=o&&o.getServices()[0].id}return r&&n[r]&&!n[r].isFetching&&n[r]}),bd=e=>Pt(e).annotations,OS=U([Ie,(e,{motivations:t})=>t],(e,t)=>t||e.annotations.filteredMotivations),J8=U([Ai,bd],(e,t)=>!t||!e?[]:t[e.id]?Pe(Object.values(t[e.id])):[]),ez=U([J8],e=>dd(Object.values(e).map(t=>t&&Qx.determineAnnotation(t.json)),t=>t&&t.present())),tz=U([(e,{canvasId:t,...n})=>t?[t]:Di(e,n),bd],(e,t)=>!t||e.length===0?[]:Pe(e.map(n=>t[n]&&Object.values(t[n])))),xv=U([tz],e=>dd(Object.values(e).map(t=>t&&Qx.determineAnnotation(t.json)),t=>t&&t.present())),nz=U([ez,OS],(e,t)=>dd(Pe(e.map(n=>n.resources)),n=>n.motivations.some(r=>t.includes(r)))),rz=U([xv,OS],(e,t)=>dd(Pe(e.map(n=>n.resources)),n=>n.motivations.some(r=>t.includes(r)))),RS=U([yt],({selectedAnnotationId:e})=>e),iz=U([xv,RS],(e,t)=>e.map(n=>({id:n["@id"]||n.id,resources:n.resources.filter(r=>t===r.id)})).filter(n=>n.resources.length>0));function oz(e){return Pt(e).elasticLayout}const az=U([Nn],e=>e.isFullscreenEnabled);function sz(e){const[t]=Pt(e).errors.items;return Pt(e).errors[t]}const IS=U([Nn],({type:e})=>e),AS=U([Nn],({focusedWindowId:e})=>e),lz=(e,{windowId:t})=>AS(e)===t,Cd=U([(e,{windowId:t})=>t,e=>Pt(e).searches],(e,t)=>!e||!t?{}:t[e]),gl=U([Cd,(e,{companionWindowId:t})=>t],(e,t)=>{if(!(!e||!t))return e[t]}),Sv=U([gl],e=>e?Object.values(e.data):[]),uz=U([gl],e=>e&&e.query),cz=U([Sv],e=>e.some(t=>t.isFetching)),dz=U([gl],e=>{var n,r;if(!e||!e.data)return;const t=Object.values(e.data).find(i=>!i.isFetching&&i.json&&i.json.within);return(r=(n=t==null?void 0:t.json)==null?void 0:n.within)==null?void 0:r.total}),fz=U([gl],e=>{if(!e||!e.data)return;const t=Object.values(e.data).find(n=>!n.isFetching&&n.json&&n.json.next&&!e.data[n.json.next]);return t&&t.json&&t.json.next}),hz=U([Sv],e=>Pe(e.map(t=>!t||!t.json||t.isFetching||!t.json.hits?[]:t.json.hits))),pz=U([hz,Lr,(e,{companionWindowId:t,windowId:n})=>r=>bv(e,{annotationUri:r,companionWindowId:t,windowId:n})],(e,t,n)=>{if(!t||t.length===0)return[];if(!e||e.length===0)return[];const r=t.map(i=>i.id);return[].concat(e).sort((i,o)=>{const a=n(i.annotations[0]),s=n(o.annotations[0]);return r.indexOf(a.targetId)-r.indexOf(s.targetId)})}),DS=e=>{const t=e.map(n=>{if(!n||!n.json||n.isFetching||!n.json.resources)return;const r=new Xx(n.json);return{id:r.id,resources:r.resources}}).filter(Boolean);return{id:(t.find(n=>n.id)||{}).id,resources:Pe(t.map(n=>n.resources))}},Pd=U([Sv],e=>e&&DS(e));function MS(e,t){if(!e||!e.resources||e.length===0)return[];if(!t||t.length===0)return[];const n=t.map(r=>r.id);return[].concat(e.resources).sort((r,i)=>n.indexOf(r.targetId)-n.indexOf(i.targetId))}const gz=U([Pd,Lr],(e,t)=>MS(e,t)),NS=U([Cd],e=>e?Object.values(e).map(n=>Object.values(n.data)).map(n=>DS(n)).filter(n=>n.resources.length>0):[]),mz=U([yt,gl],(e,t)=>t&&t.selectedContentSearchAnnotationIds||[]),bv=U([Pd,(e,{annotationUri:t})=>t],(e,t)=>e.resources.find(n=>n.id===t)),vz=U([bv,Ri],(e,t)=>e&&e.resource&&e.resource.label?jt.parse(e.resource.label,t).getValues():[]),yz=U([NS,(e,{annotationId:t})=>t],(e,t)=>Pe(e.map(r=>r.resources)).find(r=>r.id===t)),LS=U([yz,(e,{windowId:t})=>n=>Ai(e,{canvasId:n,windowId:t})],(e,t)=>{const n=e&&e.targetId;return n&&t(n)});function wz(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Cv=wz,_z=Cv,kS=Math.max;function Tz(e,t,n){return t=kS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=kS(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),_z(e,this,s)}}var FS=Tz;function Ez(e){return function(){return e}}var xz=Ez,Sz=xz,BS=sS,bz=al,Cz=BS?function(e,t){return BS(e,"toString",{configurable:!0,enumerable:!1,value:Sz(t),writable:!0})}:bz,Pz=Cz,Oz=800,Rz=16,Iz=Date.now;function Az(e){var t=0,n=0;return function(){var r=Iz(),i=Rz-(r-n);if(n=r,i>0){if(++t>=Oz)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var jS=Az,Dz=Pz,Mz=jS,Nz=Mz(Dz),Pv=Nz,Lz=al,kz=FS,Fz=Pv;function Bz(e,t){return Fz(kz(e,t,Lz),e+"")}var Od=Bz;function jz(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var Wz=jz;function zz(e){return e!==e}var Hz=zz;function Uz(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Vz=Uz,Gz=Wz,$z=Hz,qz=Vz;function Zz(e,t,n){return t===t?qz(e,t,n):Gz(e,$z,n)}var Kz=Zz,Yz=Kz;function Xz(e,t){var n=e==null?0:e.length;return!!n&&Yz(e,t,0)>-1}var Ov=Xz;function Qz(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var WS=Qz;function Jz(){}var ml=Jz,Rv=Cx,e7=ml,t7=Gm,n7=1/0,r7=Rv&&1/t7(new Rv([,-0]))[1]==n7?function(e){return new Rv(e)}:e7,i7=r7,o7=Um,a7=Ov,s7=WS,l7=Vm,u7=i7,c7=Gm,d7=200;function f7(e,t,n){var r=-1,i=a7,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=s7;else if(o>=d7){var u=t?null:u7(e);if(u)return c7(u);a=!1,i=l7,l=new o7}else l=t?[]:s;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var h7=f7,p7=rl,g7=Mn;function m7(e){return g7(e)&&p7(e)}var Iv=m7,v7=Gc,y7=Od,w7=h7,_7=Iv,T7=y7(function(e){return w7(v7(e,1,_7,!0))}),E7=T7;const x7=He(E7);var S7=Um,b7=Ov,C7=WS,P7=Ea,O7=Jc,R7=Vm,I7=200;function A7(e,t,n,r){var i=-1,o=b7,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=P7(t,O7(n))),r?(o=C7,a=!1):t.length>=I7&&(o=R7,a=!1,t=new S7(t));e:for(;++i<s;){var c=e[i],d=n==null?c:n(c);if(c=r||c!==0?c:0,a&&d===d){for(var f=u;f--;)if(t[f]===d)continue e;l.push(c)}else o(t,d,r)||l.push(c)}return l}var zS=A7,D7=zS,M7=Od,N7=Iv,L7=M7(function(e,t){return N7(e)?D7(e,t):[]}),k7=L7;const HS=He(k7);function F7(e,t){const n=e.getCanvasIds();for(let r=0;r<n.length;r+=1)if(pe.normalisedUrlsMatch(n[r],t))return!0;return!1}function US(e){return e.parentNode===void 0?[]:e.parentNode.parentNode===void 0?[e.parentNode.id]:[...US(e.parentNode),e.parentNode.id]}function VS(e,t){return e.reduce((n,r)=>{const i=[];i.push(...n);const o=t.reduce((s,l)=>s||F7(r.data,l),!1),a=r.nodes.length>0?VS(r.nodes,t):[];return i.push(...a),(o||a.length>0)&&i.push({containsVisibleCanvas:o,descendantsContainVisibleCanvas:a.length>0,id:r.id,leaf:r.nodes.length===0,parentIds:US(r)}),i},[])}const Av=U([vv,Di],(e,t)=>t.length===0||!e?[]:VS(e.nodes,t)),GS=U([Av],e=>e.map(t=>t.id)),B7=U([Av],e=>e.reduce((t,n)=>n.leaf||!n.descendantsContainVisibleCanvas?t:[...t,n.id],[])),j7=U([Av],e=>e.reduce((t,n)=>n.containsVisibleCanvas?[...t,n]:t,[]));function yo(e,{companionWindowId:t},n){const r=wd(e,{companionWindowId:t});return r.tocNodes?Object.keys(r.tocNodes).reduce((i,o)=>r.tocNodes[o].expanded===n?[...i,o]:i,[]):[]}function W7(e,{companionWindowId:t,windowId:n}){const r=B7(e,{companionWindowId:t,windowId:n}),i=yo(e,{companionWindowId:t},!0),o=yo(e,{companionWindowId:t},!1);return HS(x7(i,r),...o)}function z7(e,{...t}){const n=j7(e,{...t}),r=yo(e,t,!1);if(n&&n.length>0){for(let i=0;i<n[0].parentIds.length;i+=1)if(r.indexOf(n[0].parentIds[i])!==-1)return n[0].parentIds[i];return n[0].id}return null}const H7=U([vv],e=>e&&e.nodes&&e.nodes.length>0?"tableOfContents":"item"),$S=U([Ai],e=>e?new Wt(e).imageResources:[]),qS=Object.freeze([]),Dv=U([e=>Pt(e).layers,(e,{windowId:t})=>t],(e,t)=>e&&e[t]||qS),ZS=U([Dv,(e,{canvasId:t})=>t],(e,t)=>e[t]),U7=U([$S,ZS],(e,t)=>t?e.sort((r,i)=>t[r.id]&&t[r.id].index!==void 0&&t[i.id]&&t[i.id].index!==void 0?t[r.id].index-t[i.id].index:t[r.id]&&t[r.id].index!==void 0?-1:t[i.id]&&t[i.id].index!==void 0?1:0):e),KS=U([Di,Dv],(e,t)=>e.reduce((n,r)=>(n[r]=t[r],n),{})),YS=U([Ie],({auth:{serviceProfiles:e=[]}={}})=>e),Rd=e=>Pt(e).accessTokens||{},Id=e=>Pt(e).auth||{},V7=U([Mi,Ia,YS,Id,(e,{iiifResources:t})=>t],(e,t={},n,r,i)=>{let o=i;if(!o&&e&&(o=Pe(e.map(s=>new Wt(s).iiifImageResources.map(c=>{const d=c.getServices()[0],f=t[d.id];return f&&f.json?{...f.json,options:{}}:d})))),!o)return[];if(o.length===0)return[];const a=o.map(s=>{let l;const u=pe.getServices(s);for(const c of n){const d=u.filter(f=>c.profile===f.getProfile());for(const f of d)if(l=f,!r[f.id]||r[f.id].isFetching||r[f.id].ok)return f}return l});return Object.values(a.reduce((s,l)=>(l&&!s[l.id]&&(s[l.id]=l),s),{}))}),G7="text/plain",$7="us-ascii",Mv=(e,t)=>t.some(n=>n instanceof RegExp?n.test(e):n===e),q7=new Set(["https:","http:","file:"]),Z7=e=>{try{const{protocol:t}=new URL(e);return t.endsWith(":")&&!t.includes(".")&&!q7.has(t)}catch{return!1}},K7=(e,{stripHash:t})=>{var d;const n=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(e);if(!n)throw new Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:o}=n.groups;const a=r.split(";");o=t?"":o;let s=!1;a[a.length-1]==="base64"&&(a.pop(),s=!0);const l=((d=a.shift())==null?void 0:d.toLowerCase())??"",c=[...a.map(f=>{let[h,g=""]=f.split("=").map(p=>p.trim());return h==="charset"&&(g=g.toLowerCase(),g===$7)?"":`${h}${g?`=${g}`:""}`}).filter(Boolean)];return s&&c.push("base64"),(c.length>0||l&&l!==G7)&&c.unshift(l),`data:${c.join(";")},${s?i.trim():i}${o?`#${o}`:""}`};function Aa(e,t){if(t={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...t},typeof t.defaultProtocol=="string"&&!t.defaultProtocol.endsWith(":")&&(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return K7(e,t);if(Z7(e))return e;const n=e.startsWith("//");!n&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));const i=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&i.protocol==="https:"&&(i.protocol="http:"),t.forceHttps&&i.protocol==="http:"&&(i.protocol="https:"),t.stripAuthentication&&(i.username="",i.password=""),t.stripHash?i.hash="":t.stripTextFragment&&(i.hash=i.hash.replace(/#?:~:text.*?$/i,"")),i.pathname){const a=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let s=0,l="";for(;;){const c=a.exec(i.pathname);if(!c)break;const d=c[0],f=c.index,h=i.pathname.slice(s,f);l+=h.replace(/\/{2,}/g,"/"),l+=d,s=f+d.length}const u=i.pathname.slice(s,i.pathname.length);l+=u.replace(/\/{2,}/g,"/"),i.pathname=l}if(i.pathname)try{i.pathname=decodeURI(i.pathname)}catch{}if(t.removeDirectoryIndex===!0&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let a=i.pathname.split("/");const s=a[a.length-1];Mv(s,t.removeDirectoryIndex)&&(a=a.slice(0,-1),i.pathname=a.slice(1).join("/")+"/")}if(i.hostname&&(i.hostname=i.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(i.hostname)&&(i.hostname=i.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(const a of[...i.searchParams.keys()])Mv(a,t.removeQueryParameters)&&i.searchParams.delete(a);if(!Array.isArray(t.keepQueryParameters)&&t.removeQueryParameters===!0&&(i.search=""),Array.isArray(t.keepQueryParameters)&&t.keepQueryParameters.length>0)for(const a of[...i.searchParams.keys()])Mv(a,t.keepQueryParameters)||i.searchParams.delete(a);if(t.sortQueryParameters){i.searchParams.sort();try{i.search=decodeURIComponent(i.search)}catch{}}t.removeTrailingSlash&&(i.pathname=i.pathname.replace(/\/$/,"")),t.removeExplicitPort&&i.port&&(i.port="");const o=e;return e=i.toString(),!t.removeSingleSlash&&i.pathname==="/"&&!o.endsWith("/")&&i.hash===""&&(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||i.pathname==="/")&&i.hash===""&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),n&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}class XS{constructor(t,n,r="left-to-right"){this.canvases=t.map(i=>new Wt(i)),this.layers=n,this.viewingDirection=r,this._canvasDimensions=null}get canvasIds(){return this.canvases.map(t=>t.id)}get canvasDimensions(){if(this._canvasDimensions)return this._canvasDimensions;const[t,n]=this.canvasDirection,r=Math.min(...n===0?this.canvases.map(u=>u.getHeight()):this.canvases.map(u=>u.getWidth()));let i=0,o=0;const a=this.canvases.reduce((u,c)=>{let d=0,f=0;return isNaN(c.aspectRatio)||(n===0?(d=r,f=Math.floor(r*c.aspectRatio)):(f=r,d=Math.floor(r*(1/c.aspectRatio)))),u.push({canvas:c,height:d,width:f,x:i,y:o}),i+=t*f,o+=n*d,u},[]),s=n===0?r:Math.abs(o),l=t===0?r:Math.abs(i);return this._canvasDimensions=a.reduce((u,c)=>(u.push({...c,x:t===-1?c.x+l-c.width:c.x,y:n===-1?c.y+s-c.height:c.y}),u),[]),this._canvasDimensions}contentResourceToWorldCoordinates(t){const n=this.canvases.findIndex(u=>u.imageResources.find(c=>c.id===t.id)),r=this.canvases[n];if(!r)return[];const[i,o,a,s]=this.canvasToWorldCoordinates(r.id),l=r.onFragment(t.id);return l?[i+l[0],o+l[1],l[2],l[3]]:[i,o,a,s]}canvasToWorldCoordinates(t){const n=this.canvasDimensions.find(r=>r.canvas.id===t);return[n.x,n.y,n.width,n.height]}get canvasDirection(){switch(this.viewingDirection){case"left-to-right":return[1,0];case"right-to-left":return[-1,0];case"top-to-bottom":return[0,1];case"bottom-to-top":return[0,-1];default:return[1,0]}}contentResource(t){const n=this.canvases.find(r=>r.imageServiceIds.some(i=>i&&t&&Aa(i,{stripAuthentication:!1})===Aa(t,{stripAuthentication:!1})));if(n)return n.imageResources.find(r=>Aa(r.getServices()[0].id,{stripAuthentication:!1})===Aa(t,{stripAuthentication:!1}))}getLayerMetadata(t){if(!this.layers)return;const n=this.canvases.find(a=>a.imageResources.find(s=>s.id===t.id));if(!n)return;const r=n.imageResources.findIndex(a=>a.id===t.id),i=this.layers[n.canvas.id],o=i&&i[t.id];return{index:r,opacity:1,total:n.imageResources.length,visibility:!0,...o}}layerOpacityOfImageResource(t){const n=this.getLayerMetadata(t);return n?n.visibility?n.opacity:0:1}layerIndexOfImageResource(t){const n=this.getLayerMetadata(t);if(n)return n.total-n.index-1}offsetByCanvas(t){const n=this.canvasToWorldCoordinates(t);return{x:n[0],y:n[1]}}worldBounds(){const t=Math.max(0,...this.canvasDimensions.map(r=>r.x+r.width)),n=Math.max(0,...this.canvasDimensions.map(r=>r.y+r.height));return[0,0,t,n]}canvasAtPoint(t){const n=this.canvasDimensions.find(r=>r.x<=t.x&&t.x<=r.x+r.width&&r.y<=t.y&&t.y<=r.y+r.height);return n&&n.canvas}}const QS=U([Mi,KS,xS],(e,t,n)=>new XS(e,t,n)),Y7=Object.freeze(Object.defineProperty({__proto__:null,getAccessTokens:Rd,getAllowedWindowViewTypes:Y8,getAnnotationResourcesByMotivation:rz,getAnnotationResourcesByMotivationForCanvas:nz,getAnnotations:bd,getAuth:Id,getAuthProfiles:YS,getCanvas:Ai,getCanvasDescription:Q8,getCanvasForAnnotation:LS,getCanvasGrouping:wv,getCanvasGroupings:xd,getCanvasIndex:q8,getCanvasLabel:CS,getCanvasLayers:$S,getCanvases:Lr,getCatalog:D9,getCompanionAreaVisibility:f8,getCompanionWindow:wd,getCompanionWindowIdsForPosition:cv,getCompanionWindows:fl,getCompanionWindowsForContent:dS,getCompanionWindowsForPosition:d8,getConfig:Ie,getCurrentCanvas:Ed,getCurrentCanvasWorld:QS,getDefaultSidebarVariant:H7,getDestructuredMetadata:TS,getElasticLayout:oz,getExpandedNodeIds:W7,getFocusedWindowId:AS,getFullScreenEnabled:az,getLatestError:sz,getLayers:ZS,getLayersForVisibleCanvases:KS,getLayersForWindow:Dv,getManifest:dl,getManifestAutocompleteService:$8,getManifestDescription:z8,getManifestError:fv,getManifestHomepage:N8,getManifestLocale:Ri,getManifestLogo:M8,getManifestMetadata:U8,getManifestProvider:vS,getManifestProviderName:D8,getManifestRelated:F8,getManifestRelatedContent:k8,getManifestRenderings:L8,getManifestSearchService:hv,getManifestSeeAlso:wS,getManifestStatus:dv,getManifestSummary:H8,getManifestThumbnail:W8,getManifestTitle:Ra,getManifestUrl:_S,getManifestoInstance:ct,getManifests:vd,getManuallyExpandedNodeIds:yo,getMaximizedWindowsIds:K8,getMetadataLocales:G8,getNextCanvasGrouping:SS,getNextSearchId:fz,getNodeIdToScrollTo:z7,getPresentAnnotationsOnSelectedCanvases:xv,getPreviousCanvasGrouping:bS,getProviderLogo:yS,getRequestsConfig:gS,getRequiredStatement:B8,getResourceAnnotationForSearchHit:bv,getResourceAnnotationLabel:vz,getRights:j8,getSearchAnnotationsForCompanionWindow:Pd,getSearchAnnotationsForWindow:NS,getSearchForWindow:Cd,getSearchIsFetching:cz,getSearchNumTotal:dz,getSearchQuery:uz,getSelectedAnnotationId:RS,getSelectedAnnotationsOnCanvases:iz,getSelectedContentSearchAnnotationIds:mz,getSequence:Nr,getSequenceBehaviors:mv,getSequenceTreeStructure:vv,getSequenceViewingDirection:xS,getSequenceViewingHint:gv,getSequences:pv,getShowNavigationArrows:R8,getShowZoomControlsConfig:O8,getSortedLayers:U7,getSortedSearchAnnotationsForCompanionWindow:gz,getSortedSearchHitsForCompanionWindow:pz,getStateSegment:Pt,getTheme:_d,getThemeIds:I8,getThumbnailNavigationPosition:s8,getViewer:md,getVisibleCanvasAudioResources:Ev,getVisibleCanvasCaptions:Tv,getVisibleCanvasIds:Di,getVisibleCanvasNonTiledResources:Sd,getVisibleCanvasVideoResources:_v,getVisibleCanvases:Mi,getVisibleNodeIds:GS,getWindow:yt,getWindowConfig:_r,getWindowDraggability:X8,getWindowIds:Ca,getWindowManifests:A9,getWindowTitles:Z8,getWindowViewType:yv,getWindows:mo,getWorkspace:Nn,getWorkspaceType:IS,isFocused:lz,selectCompanionWindowDimensions:h8,selectCurrentAuthServices:V7,selectInfoResponse:PS,selectInfoResponses:Ia,sortSearchAnnotationsByCanvasOrder:MS},Symbol.toStringTag,{value:"Module"}));var JS={exports:{}},X7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Q7=X7,J7=Q7;function eb(){}function tb(){}tb.resetWarningCache=eb;var eH=function(){function e(r,i,o,a,s,l){if(l!==J7){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:tb,resetWarningCache:eb};return n.PropTypes=n,n};JS.exports=eH();var tH=JS.exports;const A=He(tH);var nH=!1;function rH(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function iH(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var oH=function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!nH:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(iH(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=rH(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Kt="-ms-",Ad="-moz-",We="-webkit-",nb="comm",Nv="rule",Lv="decl",aH="@import",rb="@keyframes",sH="@layer",lH=Math.abs,Dd=String.fromCharCode,uH=Object.assign;function cH(e,t){return zt(e,0)^45?(((t<<2^zt(e,0))<<2^zt(e,1))<<2^zt(e,2))<<2^zt(e,3):0}function ib(e){return e.trim()}function dH(e,t){return(e=t.exec(e))?e[0]:e}function ze(e,t,n){return e.replace(t,n)}function kv(e,t){return e.indexOf(t)}function zt(e,t){return e.charCodeAt(t)|0}function vl(e,t,n){return e.slice(t,n)}function kr(e){return e.length}function Fv(e){return e.length}function Md(e,t){return t.push(e),e}function fH(e,t){return e.map(t).join("")}var Nd=1,Da=1,ob=0,vn=0,Et=0,Ma="";function Ld(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:Nd,column:Da,length:a,return:""}}function yl(e,t){return uH(Ld("",null,null,"",null,null,0),e,{length:-e.length},t)}function hH(){return Et}function pH(){return Et=vn>0?zt(Ma,--vn):0,Da--,Et===10&&(Da=1,Nd--),Et}function Ln(){return Et=vn<ob?zt(Ma,vn++):0,Da++,Et===10&&(Da=1,Nd++),Et}function Fr(){return zt(Ma,vn)}function kd(){return vn}function wl(e,t){return vl(Ma,e,t)}function _l(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ab(e){return Nd=Da=1,ob=kr(Ma=e),vn=0,[]}function sb(e){return Ma="",e}function Fd(e){return ib(wl(vn-1,Bv(e===91?e+2:e===40?e+1:e)))}function gH(e){for(;(Et=Fr())&&Et<33;)Ln();return _l(e)>2||_l(Et)>3?"":" "}function mH(e,t){for(;--t&&Ln()&&!(Et<48||Et>102||Et>57&&Et<65||Et>70&&Et<97););return wl(e,kd()+(t<6&&Fr()==32&&Ln()==32))}function Bv(e){for(;Ln();)switch(Et){case e:return vn;case 34:case 39:e!==34&&e!==39&&Bv(Et);break;case 40:e===41&&Bv(e);break;case 92:Ln();break}return vn}function vH(e,t){for(;Ln()&&e+Et!==57;)if(e+Et===84&&Fr()===47)break;return"/*"+wl(t,vn-1)+"*"+Dd(e===47?e:Ln())}function yH(e){for(;!_l(Fr());)Ln();return wl(e,vn)}function wH(e){return sb(Bd("",null,null,null,[""],e=ab(e),0,[0],e))}function Bd(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,d=a,f=0,h=0,g=0,p=1,v=1,m=1,y=0,E="",b=i,R=o,M=r,C=E;v;)switch(g=y,y=Ln()){case 40:if(g!=108&&zt(C,d-1)==58){kv(C+=ze(Fd(y),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:C+=Fd(y);break;case 9:case 10:case 13:case 32:C+=gH(g);break;case 92:C+=mH(kd()-1,7);continue;case 47:switch(Fr()){case 42:case 47:Md(_H(vH(Ln(),kd()),t,n),l);break;default:C+="/"}break;case 123*p:s[u++]=kr(C)*m;case 125*p:case 59:case 0:switch(y){case 0:case 125:v=0;case 59+c:m==-1&&(C=ze(C,/\f/g,"")),h>0&&kr(C)-d&&Md(h>32?ub(C+";",r,n,d-1):ub(ze(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(Md(M=lb(C,t,n,u,c,i,s,E,b=[],R=[],d),o),y===123)if(c===0)Bd(C,t,M,M,b,o,d,s,R);else switch(f===99&&zt(C,3)===110?100:f){case 100:case 108:case 109:case 115:Bd(e,M,M,r&&Md(lb(e,M,M,0,0,i,s,E,i,b=[],d),R),i,R,d,s,r?b:R);break;default:Bd(C,M,M,M,[""],R,0,s,R)}}u=c=h=0,p=m=1,E=C="",d=a;break;case 58:d=1+kr(C),h=g;default:if(p<1){if(y==123)--p;else if(y==125&&p++==0&&pH()==125)continue}switch(C+=Dd(y),y*p){case 38:m=c>0?1:(C+="\f",-1);break;case 44:s[u++]=(kr(C)-1)*m,m=1;break;case 64:Fr()===45&&(C+=Fd(Ln())),f=Fr(),c=d=kr(E=C+=yH(kd())),y++;break;case 45:g===45&&kr(C)==2&&(p=0)}}return o}function lb(e,t,n,r,i,o,a,s,l,u,c){for(var d=i-1,f=i===0?o:[""],h=Fv(f),g=0,p=0,v=0;g<r;++g)for(var m=0,y=vl(e,d+1,d=lH(p=a[g])),E=e;m<h;++m)(E=ib(p>0?f[m]+" "+y:ze(y,/&\f/g,f[m])))&&(l[v++]=E);return Ld(e,t,n,i===0?Nv:s,l,u,c)}function _H(e,t,n){return Ld(e,t,n,nb,Dd(hH()),vl(e,2,-2),0)}function ub(e,t,n,r){return Ld(e,t,n,Lv,vl(e,0,r),vl(e,r+1,-1),r)}function Na(e,t){for(var n="",r=Fv(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function TH(e,t,n,r){switch(e.type){case sH:if(e.children.length)break;case aH:case Lv:return e.return=e.return||e.value;case nb:return"";case rb:return e.return=e.value+"{"+Na(e.children,r)+"}";case Nv:e.value=e.props.join(",")}return kr(n=Na(e.children,r))?e.return=e.value+"{"+n+"}":""}function EH(e){var t=Fv(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function xH(e){return function(t){t.root||(t=t.return)&&e(t)}}function cb(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var SH=function(t,n,r){for(var i=0,o=0;i=o,o=Fr(),i===38&&o===12&&(n[r]=1),!_l(o);)Ln();return wl(t,vn)},bH=function(t,n){var r=-1,i=44;do switch(_l(i)){case 0:i===38&&Fr()===12&&(n[r]=1),t[r]+=SH(vn-1,n,r);break;case 2:t[r]+=Fd(i);break;case 4:if(i===44){t[++r]=Fr()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Dd(i)}while(i=Ln());return t},CH=function(t,n){return sb(bH(ab(t),n))},db=new WeakMap,PH=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!db.get(r))&&!i){db.set(t,!0);for(var o=[],a=CH(n,o),s=r.props,l=0,u=0;l<a.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=o[l]?a[l].replace(/&\f/g,s[c]):s[c]+" "+a[l]}}},OH=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function fb(e,t){switch(cH(e,t)){case 5103:return We+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return We+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return We+e+Ad+e+Kt+e+e;case 6828:case 4268:return We+e+Kt+e+e;case 6165:return We+e+Kt+"flex-"+e+e;case 5187:return We+e+ze(e,/(\w+).+(:[^]+)/,We+"box-$1$2"+Kt+"flex-$1$2")+e;case 5443:return We+e+Kt+"flex-item-"+ze(e,/flex-|-self/,"")+e;case 4675:return We+e+Kt+"flex-line-pack"+ze(e,/align-content|flex-|-self/,"")+e;case 5548:return We+e+Kt+ze(e,"shrink","negative")+e;case 5292:return We+e+Kt+ze(e,"basis","preferred-size")+e;case 6060:return We+"box-"+ze(e,"-grow","")+We+e+Kt+ze(e,"grow","positive")+e;case 4554:return We+ze(e,/([^-])(transform)/g,"$1"+We+"$2")+e;case 6187:return ze(ze(ze(e,/(zoom-|grab)/,We+"$1"),/(image-set)/,We+"$1"),e,"")+e;case 5495:case 3959:return ze(e,/(image-set\([^]*)/,We+"$1$`$1");case 4968:return ze(ze(e,/(.+:)(flex-)?(.*)/,We+"box-pack:$3"+Kt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+We+e+e;case 4095:case 3583:case 4068:case 2532:return ze(e,/(.+)-inline(.+)/,We+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(kr(e)-1-t>6)switch(zt(e,t+1)){case 109:if(zt(e,t+4)!==45)break;case 102:return ze(e,/(.+:)(.+)-([^]+)/,"$1"+We+"$2-$3$1"+Ad+(zt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~kv(e,"stretch")?fb(ze(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zt(e,t+1)!==115)break;case 6444:switch(zt(e,kr(e)-3-(~kv(e,"!important")&&10))){case 107:return ze(e,":",":"+We)+e;case 101:return ze(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+We+(zt(e,14)===45?"inline-":"")+"box$3$1"+We+"$2$3$1"+Kt+"$2box$3")+e}break;case 5936:switch(zt(e,t+11)){case 114:return We+e+Kt+ze(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return We+e+Kt+ze(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return We+e+Kt+ze(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return We+e+Kt+e+e}return e}var RH=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Lv:t.return=fb(t.value,t.length);break;case rb:return Na([yl(t,{value:ze(t.value,"@","@"+We)})],i);case Nv:if(t.length)return fH(t.props,function(o){switch(dH(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Na([yl(t,{props:[ze(o,/:(read-\w+)/,":"+Ad+"$1")]})],i);case"::placeholder":return Na([yl(t,{props:[ze(o,/:(plac\w+)/,":"+We+"input-$1")]}),yl(t,{props:[ze(o,/:(plac\w+)/,":"+Ad+"$1")]}),yl(t,{props:[ze(o,/:(plac\w+)/,Kt+"input-$1")]})],i)}return""})}},IH=[RH],jd=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var v=p.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||IH,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var v=p.getAttribute("data-emotion").split(" "),m=1;m<v.length;m++)o[v[m]]=!0;s.push(p)});var l,u=[PH,OH];{var c,d=[TH,xH(function(p){c.insert(p)})],f=EH(u.concat(i,d)),h=function(v){return Na(wH(v),f)};l=function(v,m,y,E){c=y,h(v?v+"{"+m.styles+"}":m.styles),E&&(g.inserted[m.name]=!0)}}var g={key:n,sheet:new oH({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return g.sheet.hydrate(s),g};function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(null,arguments)}const AH=Object.freeze(Object.defineProperty({__proto__:null,get default(){return j}},Symbol.toStringTag,{value:"Module"}));var hb={exports:{}},Ge={};var Dt=typeof Symbol=="function"&&Symbol.for,jv=Dt?Symbol.for("react.element"):60103,Wv=Dt?Symbol.for("react.portal"):60106,Wd=Dt?Symbol.for("react.fragment"):60107,zd=Dt?Symbol.for("react.strict_mode"):60108,Hd=Dt?Symbol.for("react.profiler"):60114,Ud=Dt?Symbol.for("react.provider"):60109,Vd=Dt?Symbol.for("react.context"):60110,zv=Dt?Symbol.for("react.async_mode"):60111,Gd=Dt?Symbol.for("react.concurrent_mode"):60111,$d=Dt?Symbol.for("react.forward_ref"):60112,qd=Dt?Symbol.for("react.suspense"):60113,DH=Dt?Symbol.for("react.suspense_list"):60120,Zd=Dt?Symbol.for("react.memo"):60115,Kd=Dt?Symbol.for("react.lazy"):60116,MH=Dt?Symbol.for("react.block"):60121,NH=Dt?Symbol.for("react.fundamental"):60117,LH=Dt?Symbol.for("react.responder"):60118,kH=Dt?Symbol.for("react.scope"):60119;function kn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case jv:switch(e=e.type,e){case zv:case Gd:case Wd:case Hd:case zd:case qd:return e;default:switch(e=e&&e.$$typeof,e){case Vd:case $d:case Kd:case Zd:case Ud:return e;default:return t}}case Wv:return t}}}function pb(e){return kn(e)===Gd}Ge.AsyncMode=zv,Ge.ConcurrentMode=Gd,Ge.ContextConsumer=Vd,Ge.ContextProvider=Ud,Ge.Element=jv,Ge.ForwardRef=$d,Ge.Fragment=Wd,Ge.Lazy=Kd,Ge.Memo=Zd,Ge.Portal=Wv,Ge.Profiler=Hd,Ge.StrictMode=zd,Ge.Suspense=qd,Ge.isAsyncMode=function(e){return pb(e)||kn(e)===zv},Ge.isConcurrentMode=pb,Ge.isContextConsumer=function(e){return kn(e)===Vd},Ge.isContextProvider=function(e){return kn(e)===Ud},Ge.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===jv},Ge.isForwardRef=function(e){return kn(e)===$d},Ge.isFragment=function(e){return kn(e)===Wd},Ge.isLazy=function(e){return kn(e)===Kd},Ge.isMemo=function(e){return kn(e)===Zd},Ge.isPortal=function(e){return kn(e)===Wv},Ge.isProfiler=function(e){return kn(e)===Hd},Ge.isStrictMode=function(e){return kn(e)===zd},Ge.isSuspense=function(e){return kn(e)===qd},Ge.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Wd||e===Gd||e===Hd||e===zd||e===qd||e===DH||typeof e=="object"&&e!==null&&(e.$$typeof===Kd||e.$$typeof===Zd||e.$$typeof===Ud||e.$$typeof===Vd||e.$$typeof===$d||e.$$typeof===NH||e.$$typeof===LH||e.$$typeof===kH||e.$$typeof===MH)},Ge.typeOf=kn,hb.exports=Ge;var FH=hb.exports,gb=FH,BH={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jH={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mb={};mb[gb.ForwardRef]=BH,mb[gb.Memo]=jH;var WH=!0;function vb(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var Hv=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||WH===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Uv=function(t,n,r){Hv(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function zH(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var HH={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},UH=!1,VH=/[A-Z]|^ms/g,GH=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yb=function(t){return t.charCodeAt(1)===45},wb=function(t){return t!=null&&typeof t!="boolean"},Vv=cb(function(e){return yb(e)?e:e.replace(VH,"-$&").toLowerCase()}),_b=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(GH,function(r,i,o){return Br={name:i,styles:o,next:Br},i})}return HH[t]!==1&&!yb(t)&&typeof n=="number"&&n!==0?n+"px":n},$H="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Tl(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Br={name:i.name,styles:i.styles,next:Br},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Br={name:a.name,styles:a.styles,next:Br},a=a.next;var s=o.styles+";";return s}return qH(e,t,n)}case"function":{if(e!==void 0){var l=Br,u=n(e);return Br=l,Tl(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function qH(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Tl(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?r+=o+"{"+t[s]+"}":wb(s)&&(r+=Vv(o)+":"+_b(o,s)+";")}else{if(o==="NO_COMPONENT_SELECTOR"&&UH)throw new Error($H);if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)wb(a[l])&&(r+=Vv(o)+":"+_b(o,a[l])+";");else{var u=Tl(e,t,a);switch(o){case"animation":case"animationName":{r+=Vv(o)+":"+u+";";break}default:r+=o+"{"+u+"}"}}}}return r}var Tb=/label:\s*([^\s;{]+)\s*(;|$)/g,Br;function Yd(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Br=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=Tl(n,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Tl(n,t,e[s]),r){var l=o;i+=l[s]}Tb.lastIndex=0;for(var u="",c;(c=Tb.exec(i))!==null;)u+="-"+c[1];var d=zH(i)+u;return{name:d,styles:i,next:Br}}var ZH=function(t){return t()},Eb=sp.useInsertionEffect?sp.useInsertionEffect:!1,xb=Eb||ZH,Sb=Eb||x.useLayoutEffect,KH=!1,bb=x.createContext(typeof HTMLElement<"u"?jd({key:"css"}):null),Gv=bb.Provider,$v=function(t){return x.forwardRef(function(n,r){var i=x.useContext(bb);return t(n,i,r)})},La=x.createContext({}),qv={}.hasOwnProperty,Zv="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",YH=function(t,n){var r={};for(var i in n)qv.call(n,i)&&(r[i]=n[i]);return r[Zv]=t,r},XH=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Hv(n,r,i),xb(function(){return Uv(n,r,i)}),null},QH=$v(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[Zv],o=[r],a="";typeof e.className=="string"?a=vb(t.registered,o,e.className):e.className!=null&&(a=e.className+" ");var s=Yd(o,void 0,x.useContext(La));a+=t.key+"-"+s.name;var l={};for(var u in e)qv.call(e,u)&&u!=="css"&&u!==Zv&&!KH&&(l[u]=e[u]);return l.className=a,n&&(l.ref=n),x.createElement(x.Fragment,null,x.createElement(XH,{cache:t,serialized:s,isStringTag:typeof i=="string"}),x.createElement(i,l))}),JH=QH,Cb=function(t,n){var r=arguments;if(n==null||!qv.call(n,"css"))return x.createElement.apply(void 0,r);var i=r.length,o=new Array(i);o[0]=JH,o[1]=YH(t,n);for(var a=2;a<i;a++)o[a]=r[a];return x.createElement.apply(null,o)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(Cb||(Cb={}));var eU=$v(function(e,t){var n=e.styles,r=Yd([n],void 0,x.useContext(La)),i=x.useRef();return Sb(function(){var o=t.key+"-global",a=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[t]),Sb(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(r.next!==void 0&&Uv(t,r.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}t.insert("",r,a,!1)},[t,r.name]),null});function Pb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Yd(t)}function Xd(){var e=Pb.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function El(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}const tU=Object.freeze(Object.defineProperty({__proto__:null,default:El},Symbol.toStringTag,{value:"Module"})),xl="$$material";function Ne(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var nU=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,rU=cb(function(e){return nU.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),iU=!1,oU=rU,aU=function(t){return t!=="theme"},Ob=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?oU:aU},Rb=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},sU=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Hv(n,r,i),xb(function(){return Uv(n,r,i)}),null},lU=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=Rb(t,n,r),l=s||Ob(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{var f=c[0];d.push(f[0]);for(var h=c.length,g=1;g<h;g++)d.push(c[g],f[g])}var p=$v(function(v,m,y){var E=u&&v.as||i,b="",R=[],M=v;if(v.theme==null){M={};for(var C in v)M[C]=v[C];M.theme=x.useContext(La)}typeof v.className=="string"?b=vb(m.registered,R,v.className):v.className!=null&&(b=v.className+" ");var D=Yd(d.concat(R),m.registered,M);b+=m.key+"-"+D.name,a!==void 0&&(b+=" "+a);var F=u&&s===void 0?Ob(E):l,L={};for(var B in v)u&&B==="as"||F(B)&&(L[B]=v[B]);return L.className=b,y&&(L.ref=y),x.createElement(x.Fragment,null,x.createElement(sU,{cache:m,serialized:D,isStringTag:typeof E=="string"}),x.createElement(E,L))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=d,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return a===void 0&&iU?"NO_COMPONENT_SELECTOR":"."+a}}),p.withComponent=function(v,m){var y=e(v,j({},n,m,{shouldForwardProp:Rb(p,m,!0)}));return y.apply(void 0,d)},p}},uU=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Kv=lU.bind(null);uU.forEach(function(e){Kv[e]=Kv(e)});let Yv;typeof document=="object"&&(Yv=jd({key:"css",prepend:!0}));function Xv(e){const{injectFirst:t,children:n}=e;return t&&Yv?S.jsx(Gv,{value:Yv,children:n}):n}function cU(e){return e==null||Object.keys(e).length===0}function Ib(e){const{styles:t,defaultTheme:n={}}=e,r=typeof t=="function"?i=>t(cU(i)?n:i):t;return S.jsx(eU,{styles:r})}function Ab(e,t){return Kv(e,t)}const Db=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},dU=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:Ib,StyledEngineProvider:Xv,ThemeContext:La,css:Pb,default:Ab,internal_processStyles:Db,keyframes:Xd},Symbol.toStringTag,{value:"Module"}));function Jr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Mb(e){if(x.isValidElement(e)||!Jr(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Mb(e[n])}),t}function Jn(e,t,n={clone:!0}){const r=n.clone?j({},e):e;return Jr(e)&&Jr(t)&&Object.keys(t).forEach(i=>{x.isValidElement(t[i])?r[i]=t[i]:Jr(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Jr(e[i])?r[i]=Jn(e[i],t[i],n):n.clone?r[i]=Jr(t[i])?Mb(t[i]):t[i]:r[i]=t[i]}),r}const fU=Object.freeze(Object.defineProperty({__proto__:null,default:Jn,isPlainObject:Jr},Symbol.toStringTag,{value:"Module"})),hU=["values","unit","step"],pU=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>j({},n,{[r.key]:r.val}),{})};function Nb(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=Ne(e,hU),o=pU(t),a=Object.keys(o);function s(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-r/100}${n})`}function u(f,h){const g=a.indexOf(h);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n}) and (max-width:${(g!==-1&&typeof t[a[g]]=="number"?t[a[g]]:h)-r/100}${n})`}function c(f){return a.indexOf(f)+1<a.length?u(f,a[a.indexOf(f)+1]):s(f)}function d(f){const h=a.indexOf(f);return h===0?s(a[1]):h===a.length-1?l(a[h]):u(f,a[a.indexOf(f)+1]).replace("@media","@media not all and")}return j({keys:a,values:o,up:s,down:l,between:u,only:c,not:d,unit:n},i)}const gU={borderRadius:4};function Sl(e,t){return t?Jn(e,t,{clone:!1}):e}const Qv={xs:0,sm:600,md:900,lg:1200,xl:1536},Lb={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Qv[e]}px)`};function Tr(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Lb;return t.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(t[l]),a),{})}if(typeof t=="object"){const o=r.breakpoints||Lb;return Object.keys(t).reduce((a,s)=>{if(Object.keys(o.values||Qv).indexOf(s)!==-1){const l=o.up(s);a[l]=n(t[s],s)}else{const l=s;a[l]=t[l]}return a},{})}return n(t)}function kb(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function Fb(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function mU(e,...t){const n=kb(e),r=[n,...t].reduce((i,o)=>Jn(i,o),{});return Fb(Object.keys(n),r)}function vU(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((i,o)=>{o<e.length&&(n[i]=!0)}):r.forEach(i=>{e[i]!=null&&(n[i]=!0)}),n}function Jv({values:e,breakpoints:t,base:n}){const r=n||vU(e,t),i=Object.keys(r);if(i.length===0)return e;let o;return i.reduce((a,s,l)=>(Array.isArray(e)?(a[s]=e[l]!=null?e[l]:e[o],o=l):typeof e=="object"?(a[s]=e[s]!=null?e[s]:e[o],o=s):a[s]=e,a),{})}function Ce(e){if(typeof e!="string")throw new Error(El(7));return e.charAt(0).toUpperCase()+e.slice(1)}const yU=Object.freeze(Object.defineProperty({__proto__:null,default:Ce},Symbol.toStringTag,{value:"Module"}));function Qd(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Jd(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Qd(e,n)||r,t&&(i=t(i,r,e)),i}function wt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const s=a[t],l=a.theme,u=Qd(l,r)||{};return Tr(a,s,d=>{let f=Jd(u,i,d);return d===f&&typeof d=="string"&&(f=Jd(u,i,`${t}${d==="default"?"":Ce(d)}`,d)),n===!1?f:{[n]:f}})};return o.propTypes={},o.filterProps=[t],o}function wU(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const _U={m:"margin",p:"padding"},TU={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Bb={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},EU=wU(e=>{if(e.length>2)if(Bb[e])e=Bb[e];else return[e];const[t,n]=e.split(""),r=_U[t],i=TU[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),ey=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],ty=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...ey,...ty];function bl(e,t,n,r){var i;const o=(i=Qd(e,t,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function ny(e){return bl(e,"spacing",8)}function wo(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),r=e(n);return t>=0?r:typeof r=="number"?-r:`-${r}`}function xU(e,t){return n=>e.reduce((r,i)=>(r[i]=wo(t,n),r),{})}function SU(e,t,n,r){if(t.indexOf(n)===-1)return null;const i=EU(n),o=xU(i,r),a=e[n];return Tr(e,a,o)}function jb(e,t){const n=ny(e.theme);return Object.keys(e).map(r=>SU(e,t,r,n)).reduce(Sl,{})}function ht(e){return jb(e,ey)}ht.propTypes={},ht.filterProps=ey;function pt(e){return jb(e,ty)}pt.propTypes={},pt.filterProps=ty;function bU(e=8){if(e.mui)return e;const t=ny({spacing:e}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=t(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function ef(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?Sl(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function er(e){return typeof e!="number"?e:`${e}px solid`}function tr(e,t){return wt({prop:e,themeKey:"borders",transform:t})}const CU=tr("border",er),PU=tr("borderTop",er),OU=tr("borderRight",er),RU=tr("borderBottom",er),IU=tr("borderLeft",er),AU=tr("borderColor"),DU=tr("borderTopColor"),MU=tr("borderRightColor"),NU=tr("borderBottomColor"),LU=tr("borderLeftColor"),kU=tr("outline",er),FU=tr("outlineColor"),tf=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=bl(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:wo(t,r)});return Tr(e,e.borderRadius,n)}return null};tf.propTypes={},tf.filterProps=["borderRadius"],ef(CU,PU,OU,RU,IU,AU,DU,MU,NU,LU,tf,kU,FU);const nf=e=>{if(e.gap!==void 0&&e.gap!==null){const t=bl(e.theme,"spacing",8),n=r=>({gap:wo(t,r)});return Tr(e,e.gap,n)}return null};nf.propTypes={},nf.filterProps=["gap"];const rf=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=bl(e.theme,"spacing",8),n=r=>({columnGap:wo(t,r)});return Tr(e,e.columnGap,n)}return null};rf.propTypes={},rf.filterProps=["columnGap"];const of=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=bl(e.theme,"spacing",8),n=r=>({rowGap:wo(t,r)});return Tr(e,e.rowGap,n)}return null};of.propTypes={},of.filterProps=["rowGap"];const BU=wt({prop:"gridColumn"}),jU=wt({prop:"gridRow"}),WU=wt({prop:"gridAutoFlow"}),zU=wt({prop:"gridAutoColumns"}),HU=wt({prop:"gridAutoRows"}),UU=wt({prop:"gridTemplateColumns"}),VU=wt({prop:"gridTemplateRows"}),GU=wt({prop:"gridTemplateAreas"}),$U=wt({prop:"gridArea"});ef(nf,rf,of,BU,jU,WU,zU,HU,UU,VU,GU,$U);function ka(e,t){return t==="grey"?t:e}const qU=wt({prop:"color",themeKey:"palette",transform:ka}),ZU=wt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:ka}),KU=wt({prop:"backgroundColor",themeKey:"palette",transform:ka});ef(qU,ZU,KU);function Fn(e){return e<=1&&e!==0?`${e*100}%`:e}const YU=wt({prop:"width",transform:Fn}),ry=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,i;const o=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||Qv[n];return o?((i=e.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:Fn(n)}};return Tr(e,e.maxWidth,t)}return null};ry.filterProps=["maxWidth"];const XU=wt({prop:"minWidth",transform:Fn}),QU=wt({prop:"height",transform:Fn}),JU=wt({prop:"maxHeight",transform:Fn}),eV=wt({prop:"minHeight",transform:Fn});wt({prop:"size",cssProperty:"width",transform:Fn}),wt({prop:"size",cssProperty:"height",transform:Fn});const tV=wt({prop:"boxSizing"});ef(YU,ry,XU,QU,JU,eV,tV);const Cl={border:{themeKey:"borders",transform:er},borderTop:{themeKey:"borders",transform:er},borderRight:{themeKey:"borders",transform:er},borderBottom:{themeKey:"borders",transform:er},borderLeft:{themeKey:"borders",transform:er},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:er},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:tf},color:{themeKey:"palette",transform:ka},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:ka},backgroundColor:{themeKey:"palette",transform:ka},p:{style:pt},pt:{style:pt},pr:{style:pt},pb:{style:pt},pl:{style:pt},px:{style:pt},py:{style:pt},padding:{style:pt},paddingTop:{style:pt},paddingRight:{style:pt},paddingBottom:{style:pt},paddingLeft:{style:pt},paddingX:{style:pt},paddingY:{style:pt},paddingInline:{style:pt},paddingInlineStart:{style:pt},paddingInlineEnd:{style:pt},paddingBlock:{style:pt},paddingBlockStart:{style:pt},paddingBlockEnd:{style:pt},m:{style:ht},mt:{style:ht},mr:{style:ht},mb:{style:ht},ml:{style:ht},mx:{style:ht},my:{style:ht},margin:{style:ht},marginTop:{style:ht},marginRight:{style:ht},marginBottom:{style:ht},marginLeft:{style:ht},marginX:{style:ht},marginY:{style:ht},marginInline:{style:ht},marginInlineStart:{style:ht},marginInlineEnd:{style:ht},marginBlock:{style:ht},marginBlockStart:{style:ht},marginBlockEnd:{style:ht},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:nf},rowGap:{style:of},columnGap:{style:rf},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Fn},maxWidth:{style:ry},minWidth:{transform:Fn},height:{transform:Fn},maxHeight:{transform:Fn},minHeight:{transform:Fn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function nV(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function rV(e,t){return typeof e=="function"?e(t):e}function Wb(){function e(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:c,style:d}=s;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const f=Qd(i,u)||{};return d?d(a):Tr(a,r,g=>{let p=Jd(f,c,g);return g===p&&typeof g=="string"&&(p=Jd(f,c,`${n}${g==="default"?"":Ce(g)}`,g)),l===!1?p:{[l]:p}})}function t(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:Cl;function s(l){let u=l;if(typeof l=="function")u=l(o);else if(typeof l!="object")return l;if(!u)return null;const c=kb(o.breakpoints),d=Object.keys(c);let f=c;return Object.keys(u).forEach(h=>{const g=rV(u[h],o);if(g!=null)if(typeof g=="object")if(a[h])f=Sl(f,e(h,g,o,a));else{const p=Tr({theme:o},g,v=>({[h]:v}));nV(p,g)?f[h]=t({sx:g,theme:o}):f=Sl(f,p)}else f=Sl(f,e(h,g,o,a))}),Fb(d,f)}return Array.isArray(i)?i.map(s):s(i)}return t}const Pl=Wb();Pl.filterProps=["sx"];function zb(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const iV=["breakpoints","palette","spacing","shape"];function Ol(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=Ne(e,iV),s=Nb(n),l=bU(i);let u=Jn({breakpoints:s,direction:"ltr",components:{},palette:j({mode:"light"},r),spacing:l,shape:j({},gU,o)},a);return u.applyStyles=zb,u=t.reduce((c,d)=>Jn(c,d),u),u.unstable_sxConfig=j({},Cl,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(d){return Pl({sx:d,theme:this})},u}const oV=Object.freeze(Object.defineProperty({__proto__:null,default:Ol,private_createBreakpoints:Nb,unstable_applyStyles:zb},Symbol.toStringTag,{value:"Module"}));function aV(e){return Object.keys(e).length===0}function Hb(e=null){const t=x.useContext(La);return!t||aV(t)?e:t}const sV=Ol();function iy(e=sV){return Hb(e)}function lV({styles:e,themeId:t,defaultTheme:n={}}){const r=iy(n),i=typeof e=="function"?e(t&&r[t]||r):e;return S.jsx(Ib,{styles:i})}const uV=["sx"],cV=e=>{var t,n;const r={systemProps:{},otherProps:{}},i=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:Cl;return Object.keys(e).forEach(o=>{i[o]?r.systemProps[o]=e[o]:r.otherProps[o]=e[o]}),r};function oy(e){const{sx:t}=e,n=Ne(e,uV),{systemProps:r,otherProps:i}=cV(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...a)=>{const s=t(...a);return Jr(s)?j({},r,s):r}:o=j({},r,t),j({},i,{sx:o})}const dV=Object.freeze(Object.defineProperty({__proto__:null,default:Pl,extendSxProp:oy,unstable_createStyleFunctionSx:Wb,unstable_defaultSxConfig:Cl},Symbol.toStringTag,{value:"Module"})),Ub=e=>e,fV=(()=>{let e=Ub;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Ub}}})();function Vb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Vb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $e(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Vb(e))&&(r&&(r+=" "),r+=t);return r}const hV={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function ln(e,t,n="Mui"){const r=hV[t];return r?`${n}-${r}`:`${fV.generate(e)}-${t}`}function yn(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=ln(e,i,n)}),r}var Gb={exports:{}},Ye={};var ay=Symbol.for("react.transitional.element"),sy=Symbol.for("react.portal"),af=Symbol.for("react.fragment"),sf=Symbol.for("react.strict_mode"),lf=Symbol.for("react.profiler"),uf=Symbol.for("react.consumer"),cf=Symbol.for("react.context"),df=Symbol.for("react.forward_ref"),ff=Symbol.for("react.suspense"),hf=Symbol.for("react.suspense_list"),pf=Symbol.for("react.memo"),gf=Symbol.for("react.lazy"),pV=Symbol.for("react.offscreen"),gV=Symbol.for("react.client.reference");function nr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ay:switch(e=e.type,e){case af:case lf:case sf:case ff:case hf:return e;default:switch(e=e&&e.$$typeof,e){case cf:case df:case gf:case pf:return e;case uf:return e;default:return t}}case sy:return t}}}Ye.ContextConsumer=uf,Ye.ContextProvider=cf,Ye.Element=ay,Ye.ForwardRef=df,Ye.Fragment=af,Ye.Lazy=gf,Ye.Memo=pf,Ye.Portal=sy,Ye.Profiler=lf,Ye.StrictMode=sf,Ye.Suspense=ff,Ye.SuspenseList=hf,Ye.isContextConsumer=function(e){return nr(e)===uf},Ye.isContextProvider=function(e){return nr(e)===cf},Ye.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ay},Ye.isForwardRef=function(e){return nr(e)===df},Ye.isFragment=function(e){return nr(e)===af},Ye.isLazy=function(e){return nr(e)===gf},Ye.isMemo=function(e){return nr(e)===pf},Ye.isPortal=function(e){return nr(e)===sy},Ye.isProfiler=function(e){return nr(e)===lf},Ye.isStrictMode=function(e){return nr(e)===sf},Ye.isSuspense=function(e){return nr(e)===ff},Ye.isSuspenseList=function(e){return nr(e)===hf},Ye.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===af||e===lf||e===sf||e===ff||e===hf||e===pV||typeof e=="object"&&e!==null&&(e.$$typeof===gf||e.$$typeof===pf||e.$$typeof===cf||e.$$typeof===uf||e.$$typeof===df||e.$$typeof===gV||e.getModuleId!==void 0)},Ye.typeOf=nr,Gb.exports=Ye;var $b=Gb.exports;const mV=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function qb(e){const t=`${e}`.match(mV);return t&&t[1]||""}function Zb(e,t=""){return e.displayName||e.name||qb(e)||t}function Kb(e,t,n){const r=Zb(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function vV(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return Zb(e,"Component");if(typeof e=="object")switch(e.$$typeof){case $b.ForwardRef:return Kb(e,e.render,"ForwardRef");case $b.Memo:return Kb(e,e.type,"memo");default:return}}}const yV=Object.freeze(Object.defineProperty({__proto__:null,default:vV,getFunctionName:qb},Symbol.toStringTag,{value:"Module"})),wV=["ownerState"],_V=["variants"],TV=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function EV(e){return Object.keys(e).length===0}function xV(e){return typeof e=="string"&&e.charCodeAt(0)>96}function ly(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const SV=Ol(),bV=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function mf({defaultTheme:e,theme:t,themeId:n}){return EV(t)?e:t[n]||t}function CV(e){return e?(t,n)=>n[e]:null}function vf(e,t){let{ownerState:n}=t,r=Ne(t,wV);const i=typeof e=="function"?e(j({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>vf(o,j({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=Ne(i,_V);return o.forEach(l=>{let u=!0;typeof l.props=="function"?u=l.props(j({ownerState:n},r,n)):Object.keys(l.props).forEach(c=>{(n==null?void 0:n[c])!==l.props[c]&&r[c]!==l.props[c]&&(u=!1)}),u&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style(j({ownerState:n},r,n)):l.style))}),s}return i}function PV(e={}){const{themeId:t,defaultTheme:n=SV,rootShouldForwardProp:r=ly,slotShouldForwardProp:i=ly}=e,o=a=>Pl(j({},a,{theme:mf(j({},a,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(a,s={})=>{Db(a,R=>R.filter(M=>!(M!=null&&M.__mui_systemSx)));const{name:l,slot:u,skipVariantsResolver:c,skipSx:d,overridesResolver:f=CV(bV(u))}=s,h=Ne(s,TV),g=c!==void 0?c:u&&u!=="Root"&&u!=="root"||!1,p=d||!1;let v,m=ly;u==="Root"||u==="root"?m=r:u?m=i:xV(a)&&(m=void 0);const y=Ab(a,j({shouldForwardProp:m,label:v},h)),E=R=>typeof R=="function"&&R.__emotion_real!==R||Jr(R)?M=>vf(R,j({},M,{theme:mf({theme:M.theme,defaultTheme:n,themeId:t})})):R,b=(R,...M)=>{let C=E(R);const D=M?M.map(E):[];l&&f&&D.push(B=>{const z=mf(j({},B,{defaultTheme:n,themeId:t}));if(!z.components||!z.components[l]||!z.components[l].styleOverrides)return null;const $=z.components[l].styleOverrides,de={};return Object.entries($).forEach(([X,re])=>{de[X]=vf(re,j({},B,{theme:z}))}),f(B,de)}),l&&!g&&D.push(B=>{var z;const $=mf(j({},B,{defaultTheme:n,themeId:t})),de=$==null||(z=$.components)==null||(z=z[l])==null?void 0:z.variants;return vf({variants:de},j({},B,{theme:$}))}),p||D.push(o);const F=D.length-M.length;if(Array.isArray(R)&&F>0){const B=new Array(F).fill("");C=[...R,...B],C.raw=[...R.raw,...B]}const L=y(C,...D);return a.muiName&&(L.muiName=a.muiName),L};return y.withConfig&&(b.withConfig=y.withConfig),b}}const OV=PV();function yf(e,t){const n=j({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=j({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=j({},o),Object.keys(i).forEach(a=>{n[r][a]=yf(i[a],o[a])}))}else n[r]===void 0&&(n[r]=e[r])}),n}function RV(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:yf(t.components[n].defaultProps,r)}function IV({props:e,name:t,defaultTheme:n,themeId:r}){let i=iy(n);return r&&(i=i[r]||i),RV({theme:i,name:t,props:e})}const Rl=typeof window<"u"?x.useLayoutEffect:x.useEffect;function AV(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const DV=Object.freeze(Object.defineProperty({__proto__:null,default:AV},Symbol.toStringTag,{value:"Module"}));function Yb(e){return e&&e.ownerDocument||document}function uy(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let Xb=0;function MV(e){const[t,n]=x.useState(e),r=e||t;return x.useEffect(()=>{t==null&&(Xb+=1,n(`mui-${Xb}`))},[t]),r}const Qb=sp.useId;function NV(e){if(Qb!==void 0){const t=Qb();return e??t}return MV(e)}function Jb({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=x.useRef(e!==void 0),[o,a]=x.useState(t),s=i?e:o,l=x.useCallback(u=>{i||a(u)},[]);return[s,l]}function Fa(e){const t=x.useRef(e);return Rl(()=>{t.current=e}),x.useRef((...n)=>(0,t.current)(...n)).current}function Ni(...e){return x.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{uy(n,t)})},e)}const eC={};function LV(e,t){const n=x.useRef(eC);return n.current===eC&&(n.current=e(t)),n}const kV=[];function FV(e){x.useEffect(e,kV)}class Il{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Il}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Ba(){const e=LV(Il.create).current;return FV(e.disposeEffect),e}let wf=!0,cy=!1;const BV=new Il,jV={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function WV(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&jV[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function zV(e){e.metaKey||e.altKey||e.ctrlKey||(wf=!0)}function dy(){wf=!1}function HV(){this.visibilityState==="hidden"&&cy&&(wf=!0)}function UV(e){e.addEventListener("keydown",zV,!0),e.addEventListener("mousedown",dy,!0),e.addEventListener("pointerdown",dy,!0),e.addEventListener("touchstart",dy,!0),e.addEventListener("visibilitychange",HV,!0)}function VV(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return wf||WV(t)}function tC(){const e=x.useCallback(i=>{i!=null&&UV(i.ownerDocument)},[]),t=x.useRef(!1);function n(){return t.current?(cy=!0,BV.start(100,()=>{cy=!1}),t.current=!1,!0):!1}function r(i){return VV(i)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}const nC=e=>{const t=x.useRef({});return x.useEffect(()=>{t.current=e}),t.current};function wn(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((o,a)=>{if(a){const s=t(a);s!==""&&o.push(s),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}function GV(e){return typeof e=="string"}function Al(e,t,n){return e===void 0||GV(e)?t:j({},t,{ownerState:j({},t.ownerState,n)})}function $V(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function rC(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function qV(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const h=$e(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),g=j({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),p=j({},n,i,r);return h.length>0&&(p.className=h),Object.keys(g).length>0&&(p.style=g),{props:p,internalRef:void 0}}const a=$V(j({},i,r)),s=rC(r),l=rC(i),u=t(a),c=$e(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d=j({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),f=j({},u,n,l,s);return c.length>0&&(f.className=c),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:u.ref}}function ZV(e,t,n){return typeof e=="function"?e(t,n):e}const KV=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function fy(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=e,a=Ne(e,KV),s=o?{}:ZV(r,i),{props:l,internalRef:u}=qV(j({},a,{externalSlotProps:s})),c=Ni(u,s==null?void 0:s.ref,(t=e.additionalProps)==null?void 0:t.ref);return Al(n,j({},l,{ref:c}),i)}function hy(e){if(parseInt(x.version,10)>=19){var t;return(e==null||(t=e.props)==null?void 0:t.ref)||null}return(e==null?void 0:e.ref)||null}const iC=x.createContext(null);function oC(){return x.useContext(iC)}const YV=typeof Symbol=="function"&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";function XV(e,t){return typeof t=="function"?t(e):j({},e,t)}function QV(e){const{children:t,theme:n}=e,r=oC(),i=x.useMemo(()=>{const o=r===null?n:XV(r,n);return o!=null&&(o[YV]=r!==null),o},[n,r]);return S.jsx(iC.Provider,{value:i,children:t})}const JV=["value"],aC=x.createContext();function eG(e){let{value:t}=e,n=Ne(e,JV);return S.jsx(aC.Provider,j({value:t??!0},n))}const tG=()=>{const e=x.useContext(aC);return e??!1},sC=x.createContext(void 0);function nG({value:e,children:t}){return S.jsx(sC.Provider,{value:e,children:t})}function rG(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?yf(i.defaultProps,r):!i.styleOverrides&&!i.variants?yf(i,r):r}function iG({props:e,name:t}){const n=x.useContext(sC);return rG({props:e,name:t,theme:{components:n}})}const lC={};function uC(e,t,n,r=!1){return x.useMemo(()=>{const i=e&&t[e]||t;if(typeof n=="function"){const o=n(i),a=e?j({},t,{[e]:o}):o;return r?()=>a:a}return e?j({},t,{[e]:n}):j({},t,n)},[e,t,n,r])}function oG(e){const{children:t,theme:n,themeId:r}=e,i=Hb(lC),o=oC()||lC,a=uC(r,i,n),s=uC(r,o,n,!0),l=a.direction==="rtl";return S.jsx(QV,{theme:s,children:S.jsx(La.Provider,{value:a,children:S.jsx(eG,{value:l,children:S.jsx(nG,{value:a==null?void 0:a.components,children:t})})})})}const aG=["component","direction","spacing","divider","children","className","useFlexGap"],sG=Ol(),lG=OV("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function uG(e){return IV({props:e,name:"MuiStack",defaultTheme:sG})}function cG(e,t){const n=x.Children.toArray(e).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o<n.length-1&&r.push(x.cloneElement(t,{key:`separator-${o}`})),r),[])}const dG=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],fG=({ownerState:e,theme:t})=>{let n=j({display:"flex",flexDirection:"column"},Tr({theme:t},Jv({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r})));if(e.spacing){const r=ny(t),i=Object.keys(t.breakpoints.values).reduce((l,u)=>((typeof e.spacing=="object"&&e.spacing[u]!=null||typeof e.direction=="object"&&e.direction[u]!=null)&&(l[u]=!0),l),{}),o=Jv({values:e.direction,base:i}),a=Jv({values:e.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,u,c)=>{if(!o[l]){const f=u>0?o[c[u-1]]:"column";o[l]=f}}),n=Jn(n,Tr({theme:t},a,(l,u)=>e.useFlexGap?{gap:wo(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${dG(u?o[u]:e.direction)}`]:wo(r,l)}}))}return n=mU(t.breakpoints,n),n};function hG(e={}){const{createStyledComponent:t=lG,useThemeProps:n=uG,componentName:r="MuiStack"}=e,i=()=>wn({root:["root"]},l=>ln(r,l),{}),o=t(fG);return x.forwardRef(function(l,u){const c=n(l),d=oy(c),{component:f="div",direction:h="column",spacing:g=0,divider:p,children:v,className:m,useFlexGap:y=!1}=d,E=Ne(d,aG),b={direction:h,spacing:g,useFlexGap:y},R=i();return S.jsx(o,j({as:f,ownerState:b,ref:u,className:$e(R.root,m)},E,{children:p?cG(v,p):v}))})}function pG(e,t){return j({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}var _t={},cC={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(cC);var dC=cC.exports;const gG=Cn(tU),mG=Cn(DV);var fC=dC;Object.defineProperty(_t,"__esModule",{value:!0});var _o=_t.alpha=vC;_t.blend=RG,_t.colorChannel=void 0;var vG=_t.darken=gy;_t.decomposeColor=rr,_t.emphasize=yC;var yG=_t.getContrastRatio=SG;_t.getLuminance=_f,_t.hexToRgb=pC,_t.hslToRgb=mC;var wG=_t.lighten=my;_t.private_safeAlpha=bG,_t.private_safeColorChannel=void 0,_t.private_safeDarken=CG,_t.private_safeEmphasize=OG,_t.private_safeLighten=PG,_t.recomposeColor=ja,_t.rgbToHex=xG;var hC=fC(gG),_G=fC(mG);function py(e,t=0,n=1){return(0,_G.default)(e,t,n)}function pC(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function TG(e){const t=e.toString(16);return t.length===1?`0${t}`:t}function rr(e){if(e.type)return e;if(e.charAt(0)==="#")return rr(pC(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,hC.default)(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,hC.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const gC=e=>{const t=rr(e);return t.values.slice(0,3).map((n,r)=>t.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};_t.colorChannel=gC;const EG=(e,t)=>{try{return gC(e)}catch{return e}};_t.private_safeColorChannel=EG;function ja(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function xG(e){if(e.indexOf("#")===0)return e;const{values:t}=rr(e);return`#${t.map((n,r)=>TG(r===3?Math.round(255*n):n)).join("")}`}function mC(e){e=rr(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=(u,c=(u+n/30)%12)=>i-o*Math.max(Math.min(c-3,9-c,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(s+="a",l.push(t[3])),ja({type:s,values:l})}function _f(e){e=rr(e);let t=e.type==="hsl"||e.type==="hsla"?rr(mC(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function SG(e,t){const n=_f(e),r=_f(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function vC(e,t){return e=rr(e),t=py(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,ja(e)}function bG(e,t,n){try{return vC(e,t)}catch{return e}}function gy(e,t){if(e=rr(e),t=py(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]*=1-t;return ja(e)}function CG(e,t,n){try{return gy(e,t)}catch{return e}}function my(e,t){if(e=rr(e),t=py(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return ja(e)}function PG(e,t,n){try{return my(e,t)}catch{return e}}function yC(e,t=.15){return _f(e)>.5?gy(e,t):my(e,t)}function OG(e,t,n){try{return yC(e,t)}catch{return e}}function RG(e,t,n,r=1){const i=(l,u)=>Math.round((l**(1/r)*(1-n)+u**(1/r)*n)**r),o=rr(e),a=rr(t),s=[i(o.values[0],a.values[0]),i(o.values[1],a.values[1]),i(o.values[2],a.values[2])];return ja({type:"rgb",values:s})}const Dl={black:"#000",white:"#fff"},IG={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Wa={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},za={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Ml={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Ha={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ua={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Va={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},AG=["mode","contrastThreshold","tonalOffset"],wC={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Dl.white,default:Dl.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},vy={text:{primary:Dl.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Dl.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function _C(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=wG(e.main,i):t==="dark"&&(e.dark=vG(e.main,o)))}function DG(e="light"){return e==="dark"?{main:Ha[200],light:Ha[50],dark:Ha[400]}:{main:Ha[700],light:Ha[400],dark:Ha[800]}}function MG(e="light"){return e==="dark"?{main:Wa[200],light:Wa[50],dark:Wa[400]}:{main:Wa[500],light:Wa[300],dark:Wa[700]}}function NG(e="light"){return e==="dark"?{main:za[500],light:za[300],dark:za[700]}:{main:za[700],light:za[400],dark:za[800]}}function LG(e="light"){return e==="dark"?{main:Ua[400],light:Ua[300],dark:Ua[700]}:{main:Ua[700],light:Ua[500],dark:Ua[900]}}function kG(e="light"){return e==="dark"?{main:Va[400],light:Va[300],dark:Va[700]}:{main:Va[800],light:Va[500],dark:Va[900]}}function FG(e="light"){return e==="dark"?{main:Ml[400],light:Ml[300],dark:Ml[700]}:{main:"#ed6c02",light:Ml[500],dark:Ml[900]}}function BG(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,i=Ne(e,AG),o=e.primary||DG(t),a=e.secondary||MG(t),s=e.error||NG(t),l=e.info||LG(t),u=e.success||kG(t),c=e.warning||FG(t);function d(p){return yG(p,vy.text.primary)>=n?vy.text.primary:wC.text.primary}const f=({color:p,name:v,mainShade:m=500,lightShade:y=300,darkShade:E=700})=>{if(p=j({},p),!p.main&&p[m]&&(p.main=p[m]),!p.hasOwnProperty("main"))throw new Error(El(11,v?` (${v})`:"",m));if(typeof p.main!="string")throw new Error(El(12,v?` (${v})`:"",JSON.stringify(p.main)));return _C(p,"light",y,r),_C(p,"dark",E,r),p.contrastText||(p.contrastText=d(p.main)),p},h={dark:vy,light:wC};return Jn(j({common:j({},Dl),mode:t,primary:f({color:o,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:s,name:"error"}),warning:f({color:c,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:u,name:"success"}),grey:IG,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r},h[t]),i)}const jG=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function WG(e){return Math.round(e*1e5)/1e5}const TC={textTransform:"uppercase"},EC='"Roboto", "Helvetica", "Arial", sans-serif';function zG(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:r=EC,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:u=16,allVariants:c,pxToRem:d}=n,f=Ne(n,jG),h=i/14,g=d||(m=>`${m/u*h}rem`),p=(m,y,E,b,R)=>j({fontFamily:r,fontWeight:m,fontSize:g(y),lineHeight:E},r===EC?{letterSpacing:`${WG(b/y)}em`}:{},R,c),v={h1:p(o,96,1.167,-1.5),h2:p(o,60,1.2,-.5),h3:p(a,48,1.167,0),h4:p(a,34,1.235,.25),h5:p(a,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(a,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(a,16,1.5,.15),body2:p(a,14,1.43,.15),button:p(s,14,1.75,.4,TC),caption:p(a,12,1.66,.4),overline:p(a,12,2.66,1,TC),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Jn(j({htmlFontSize:u,pxToRem:g,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},v),f,{clone:!1})}const HG=.2,UG=.14,VG=.12;function at(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${HG})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${UG})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${VG})`].join(",")}const GG=["none",at(0,2,1,-1,0,1,1,0,0,1,3,0),at(0,3,1,-2,0,2,2,0,0,1,5,0),at(0,3,3,-2,0,3,4,0,0,1,8,0),at(0,2,4,-1,0,4,5,0,0,1,10,0),at(0,3,5,-1,0,5,8,0,0,1,14,0),at(0,3,5,-1,0,6,10,0,0,1,18,0),at(0,4,5,-2,0,7,10,1,0,2,16,1),at(0,5,5,-3,0,8,10,1,0,3,14,2),at(0,5,6,-3,0,9,12,1,0,3,16,2),at(0,6,6,-3,0,10,14,1,0,4,18,3),at(0,6,7,-4,0,11,15,1,0,4,20,3),at(0,7,8,-4,0,12,17,2,0,5,22,4),at(0,7,8,-4,0,13,19,2,0,5,24,4),at(0,7,9,-4,0,14,21,2,0,5,26,4),at(0,8,9,-5,0,15,22,2,0,6,28,5),at(0,8,10,-5,0,16,24,2,0,6,30,5),at(0,8,11,-5,0,17,26,2,0,6,32,5),at(0,9,11,-5,0,18,28,2,0,7,34,6),at(0,9,12,-6,0,19,29,2,0,7,36,6),at(0,10,13,-6,0,20,31,3,0,8,38,7),at(0,10,13,-6,0,21,33,3,0,8,40,7),at(0,10,14,-6,0,22,35,3,0,8,42,7),at(0,11,14,-7,0,23,36,3,0,9,44,8),at(0,11,15,-7,0,24,38,3,0,9,46,8)],$G=["duration","easing","delay"],qG={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},ZG={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function xC(e){return`${Math.round(e)}ms`}function KG(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function YG(e){const t=j({},qG,e.easing),n=j({},ZG,e.duration);return j({getAutoHeightDuration:KG,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=t.easeInOut,delay:l=0}=o;return Ne(o,$G),(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof a=="string"?a:xC(a)} ${s} ${typeof l=="string"?l:xC(l)}`).join(",")}},e,{easing:t,duration:n})}const XG={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},QG=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function yy(e={},...t){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=e,a=Ne(e,QG);if(e.vars)throw new Error(El(18));const s=BG(r),l=Ol(e);let u=Jn(l,{mixins:pG(l.breakpoints,n),palette:s,shadows:GG.slice(),typography:zG(s,o),transitions:YG(i),zIndex:j({},XG)});return u=Jn(u,a),u=t.reduce((c,d)=>Jn(c,d),u),u.unstable_sxConfig=j({},Cl,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(d){return Pl({sx:d,theme:this})},u}const wy=yy();function SC(){const e=iy(wy);return e[xl]||e}var Nl={};const JG=Cn(AH);var _y={exports:{}},bC;function e$(){return bC||(bC=1,function(e){function t(n,r){if(n==null)return{};var i={};for(var o in n)if({}.hasOwnProperty.call(n,o)){if(r.includes(o))continue;i[o]=n[o]}return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(_y)),_y.exports}const CC=Cn(dU),t$=Cn(fU),n$=Cn(yU),r$=Cn(yV),i$=Cn(oV),o$=Cn(dV);var Ga=dC;Object.defineProperty(Nl,"__esModule",{value:!0});var a$=Nl.default=w$;Nl.shouldForwardProp=Tf,Nl.systemDefaultTheme=void 0;var ir=Ga(JG),Ty=Ga(e$()),PC=h$(CC),s$=t$;Ga(n$),Ga(r$);var l$=Ga(i$),u$=Ga(o$);const c$=["ownerState"],d$=["variants"],f$=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function OC(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(OC=function(r){return r?n:t})(e)}function h$(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=OC(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function p$(e){return Object.keys(e).length===0}function g$(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Tf(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const m$=Nl.systemDefaultTheme=(0,l$.default)(),v$=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function Ef({defaultTheme:e,theme:t,themeId:n}){return p$(t)?e:t[n]||t}function y$(e){return e?(t,n)=>n[e]:null}function xf(e,t){let{ownerState:n}=t,r=(0,Ty.default)(t,c$);const i=typeof e=="function"?e((0,ir.default)({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>xf(o,(0,ir.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=(0,Ty.default)(i,d$);return o.forEach(l=>{let u=!0;typeof l.props=="function"?u=l.props((0,ir.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(c=>{(n==null?void 0:n[c])!==l.props[c]&&r[c]!==l.props[c]&&(u=!1)}),u&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style((0,ir.default)({ownerState:n},r,n)):l.style))}),s}return i}function w$(e={}){const{themeId:t,defaultTheme:n=m$,rootShouldForwardProp:r=Tf,slotShouldForwardProp:i=Tf}=e,o=a=>(0,u$.default)((0,ir.default)({},a,{theme:Ef((0,ir.default)({},a,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(a,s={})=>{(0,PC.internal_processStyles)(a,R=>R.filter(M=>!(M!=null&&M.__mui_systemSx)));const{name:l,slot:u,skipVariantsResolver:c,skipSx:d,overridesResolver:f=y$(v$(u))}=s,h=(0,Ty.default)(s,f$),g=c!==void 0?c:u&&u!=="Root"&&u!=="root"||!1,p=d||!1;let v,m=Tf;u==="Root"||u==="root"?m=r:u?m=i:g$(a)&&(m=void 0);const y=(0,PC.default)(a,(0,ir.default)({shouldForwardProp:m,label:v},h)),E=R=>typeof R=="function"&&R.__emotion_real!==R||(0,s$.isPlainObject)(R)?M=>xf(R,(0,ir.default)({},M,{theme:Ef({theme:M.theme,defaultTheme:n,themeId:t})})):R,b=(R,...M)=>{let C=E(R);const D=M?M.map(E):[];l&&f&&D.push(B=>{const z=Ef((0,ir.default)({},B,{defaultTheme:n,themeId:t}));if(!z.components||!z.components[l]||!z.components[l].styleOverrides)return null;const $=z.components[l].styleOverrides,de={};return Object.entries($).forEach(([X,re])=>{de[X]=xf(re,(0,ir.default)({},B,{theme:z}))}),f(B,de)}),l&&!g&&D.push(B=>{var z;const $=Ef((0,ir.default)({},B,{defaultTheme:n,themeId:t})),de=$==null||(z=$.components)==null||(z=z[l])==null?void 0:z.variants;return xf({variants:de},(0,ir.default)({},B,{theme:$}))}),p||D.push(o);const F=D.length-M.length;if(Array.isArray(R)&&F>0){const B=new Array(F).fill("");C=[...R,...B],C.raw=[...R.raw,...B]}const L=y(C,...D);return a.muiName&&(L.muiName=a.muiName),L};return y.withConfig&&(b.withConfig=y.withConfig),b}}function _$(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Ey=e=>_$(e)&&e!=="classes",ie=a$({themeId:xl,defaultTheme:wy,rootShouldForwardProp:Ey}),T$=["theme"];function RC(e){let{theme:t}=e,n=Ne(e,T$);const r=t[xl];return S.jsx(oG,j({},n,{themeId:r?xl:void 0,theme:r||t}))}const IC=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)};let AC=class extends x.Component{render(){const{children:t,theme:n}=this.props,r=jd({key:"mui"});return S.jsx(Xv,{injectFirst:!0,children:S.jsx(Gv,{value:r,children:S.jsx(RC,{theme:yy(n),children:t})})})}};AC.propTypes={children:A.node,theme:A.object.isRequired};const E$=Me(Qe(e=>({theme:_d(e)})))(AC),xy=x.createContext({current:document.body}),Sf=e=>{function t(r,i){const o=x.useContext(xy),[a,s]=x.useState();x.useEffect(()=>{s(o)},[o]);const l={...r,...i?{ref:i}:{}};return S.jsx(e,{container:a,...l})}const n=x.forwardRef(t);return n.displayName=`WithWorkspaceContext(${e.displayName||e.name||"Component"})`,n},x$=x.lazy(()=>Promise.resolve().then(()=>Hie));class S$ extends x.Component{constructor(t){super(t),this.areaRef=x.createRef()}render(){return S.jsx(E$,{children:S.jsx(xy.Provider,{value:this.areaRef,children:S.jsx(x.Suspense,{fallback:S.jsx("div",{}),children:S.jsx(x$,{areaRef:this.areaRef})})})})}}const DC=x.createContext();var b$=yd,C$=Bm,P$=Object.prototype,O$=P$.hasOwnProperty;function R$(e,t,n){var r=e[t];(!(O$.call(e,t)&&C$(r,n))||n===void 0&&!(t in e))&&b$(e,t,n)}var Sy=R$,by,MC;function Cy(){if(MC)return by;MC=1;var e=Sy,t=xa,n=Qc(),r=Qn,i=po;function o(a,s,l,u){if(!r(a))return a;s=t(s,a);for(var c=-1,d=s.length,f=d-1,h=a;h!=null&&++c<d;){var g=i(s[c]),p=l;if(g==="__proto__"||g==="constructor"||g==="prototype")return a;if(c!=f){var v=h[g];p=u?u(v,g,h):void 0,p===void 0&&(p=r(v)?v:n(s[c+1])?[]:{})}e(h,g,p),h=h[g]}return a}return by=o,by}var Py,NC;function I$(){if(NC)return Py;NC=1;var e=ol,t=Cy();function n(r,i,o,a){return t(r,i,o(e(r,i)),a)}return Py=n,Py}var Oy,LC;function A$(){if(LC)return Oy;LC=1;var e=al;function t(n){return typeof n=="function"?n:e}return Oy=t,Oy}var Ry,kC;function FC(){if(kC)return Ry;kC=1;var e=I$(),t=A$();function n(r,i,o){return r==null?r:e(r,i,t(o))}return Ry=n,Ry}var D$=FC();const M$=He(D$),BC={annotations:jo,attribution:DD,canvas:AD,collection:LD,custom:ND,info:ID,layers:MD,thumbnailNavigation:bn};function N$(e){return e.reduce((t,n)=>M$(t,[n.target,n.mode],r=>[...r||[],n]),{})}function L$(e){return e.map(t=>({...t,component:F$(t)}))}function k$(e){return e.filter(t=>t.companionWindowKey).forEach(t=>{BC[t.companionWindowKey]=t.component}),BC}function F$(e){return!e.mapStateToProps&&!e.mapDispatchToProps?e.component:Qe(e.mapStateToProps,e.mapDispatchToProps,...e.connectOptions||[])(e.component)}function jC({plugins:e=[],children:t=null}){const[n,r]=x.useState({});return x.useEffect(()=>{const i=L$(e);k$(i),r(N$(i))},[e]),S.jsx(DC.Provider,{value:n,children:t})}jC.propTypes={children:A.node,plugins:A.array};var WC=Px,B$=WC&&new WC,zC=B$,j$=al,HC=zC,W$=HC?function(e,t){return HC.set(e,t),e}:j$,UC=W$,z$=Qn,VC=Object.create,H$=function(){function e(){}return function(t){if(!z$(t))return{};if(VC)return VC(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),bf=H$,U$=bf,V$=Qn;function G$(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=U$(e.prototype),r=e.apply(n,t);return V$(r)?r:n}}var Cf=G$,$$=Cf,q$=sn,Z$=1;function K$(e,t,n){var r=t&Z$,i=$$(e);function o(){var a=this&&this!==q$&&this instanceof o?i:e;return a.apply(r?n:this,arguments)}return o}var Y$=K$,X$=Math.max;function Q$(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,l=t.length,u=X$(o-a,0),c=Array(l+u),d=!r;++s<l;)c[s]=t[s];for(;++i<a;)(d||i<o)&&(c[n[i]]=e[i]);for(;u--;)c[s++]=e[i++];return c}var GC=Q$,J$=Math.max;function eq(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,l=-1,u=t.length,c=J$(o-s,0),d=Array(c+u),f=!r;++i<c;)d[i]=e[i];for(var h=i;++l<u;)d[h+l]=t[l];for(;++a<s;)(f||i<o)&&(d[h+n[a]]=e[i++]);return d}var $C=eq;function tq(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var nq=tq;function rq(){}var Iy=rq,iq=bf,oq=Iy,aq=4294967295;function Pf(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=aq,this.__views__=[]}Pf.prototype=iq(oq.prototype),Pf.prototype.constructor=Pf;var Ay=Pf,qC=zC,sq=ml,lq=qC?function(e){return qC.get(e)}:sq,ZC=lq,uq={},cq=uq,KC=cq,dq=Object.prototype,fq=dq.hasOwnProperty;function hq(e){for(var t=e.name+"",n=KC[t],r=fq.call(KC,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}var pq=hq,gq=bf,mq=Iy;function Of(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Of.prototype=gq(mq.prototype),Of.prototype.constructor=Of;var YC=Of;function vq(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Rf=vq,yq=Ay,wq=YC,_q=Rf;function Tq(e){if(e instanceof yq)return e.clone();var t=new wq(e.__wrapped__,e.__chain__);return t.__actions__=_q(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Eq=Tq,xq=Ay,XC=YC,Sq=Iy,bq=Ft,Cq=Mn,Pq=Eq,Oq=Object.prototype,Rq=Oq.hasOwnProperty;function If(e){if(Cq(e)&&!bq(e)&&!(e instanceof xq)){if(e instanceof XC)return e;if(Rq.call(e,"__wrapped__"))return Pq(e)}return new XC(e)}If.prototype=Sq.prototype,If.prototype.constructor=If;var Iq=If,Aq=Ay,Dq=ZC,Mq=pq,Nq=Iq;function Lq(e){var t=Mq(e),n=Nq[t];if(typeof n!="function"||!(t in Aq.prototype))return!1;if(e===n)return!0;var r=Dq(n);return!!r&&e===r[0]}var kq=Lq,Fq=UC,Bq=jS,jq=Bq(Fq),QC=jq,Wq=/\{\n\/\* \[wrapped with (.+)\] \*/,zq=/,? & /;function Hq(e){var t=e.match(Wq);return t?t[1].split(zq):[]}var Uq=Hq,Vq=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Gq(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Vq,`{
/* [wrapped with `+t+`] */
`)}var $q=Gq;function qq(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Dy=qq,Zq=Dy,Kq=Ov,Yq=1,Xq=2,Qq=8,Jq=16,eZ=32,tZ=64,nZ=128,rZ=256,iZ=512,oZ=[["ary",nZ],["bind",Yq],["bindKey",Xq],["curry",Qq],["curryRight",Jq],["flip",iZ],["partial",eZ],["partialRight",tZ],["rearg",rZ]];function aZ(e,t){return Zq(oZ,function(n){var r="_."+n[0];t&n[1]&&!Kq(e,r)&&e.push(r)}),e.sort()}var sZ=aZ,lZ=Uq,uZ=$q,cZ=Pv,dZ=sZ;function fZ(e,t,n){var r=t+"";return cZ(e,uZ(r,dZ(lZ(r),n)))}var JC=fZ,hZ=kq,pZ=QC,gZ=JC,mZ=1,vZ=2,yZ=4,wZ=8,e2=32,t2=64;function _Z(e,t,n,r,i,o,a,s,l,u){var c=t&wZ,d=c?a:void 0,f=c?void 0:a,h=c?o:void 0,g=c?void 0:o;t|=c?e2:t2,t&=~(c?t2:e2),t&yZ||(t&=~(mZ|vZ));var p=[e,t,i,h,d,g,f,s,l,u],v=n.apply(void 0,p);return hZ(e)&&pZ(v,p),v.placeholder=r,gZ(v,e,t)}var n2=_Z;function TZ(e){var t=e;return t.placeholder}var r2=TZ,EZ=Rf,xZ=Qc(),SZ=Math.min;function bZ(e,t){for(var n=e.length,r=SZ(t.length,n),i=EZ(e);r--;){var o=t[r];e[r]=xZ(o,n)?i[o]:void 0}return e}var CZ=bZ,i2="__lodash_placeholder__";function PZ(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];(a===t||a===i2)&&(e[n]=i2,o[i++]=n)}return o}var My=PZ,OZ=GC,RZ=$C,IZ=nq,o2=Cf,AZ=n2,DZ=r2,MZ=CZ,NZ=My,LZ=sn,kZ=1,FZ=2,BZ=8,jZ=16,WZ=128,zZ=512;function a2(e,t,n,r,i,o,a,s,l,u){var c=t&WZ,d=t&kZ,f=t&FZ,h=t&(BZ|jZ),g=t&zZ,p=f?void 0:o2(e);function v(){for(var m=arguments.length,y=Array(m),E=m;E--;)y[E]=arguments[E];if(h)var b=DZ(v),R=IZ(y,b);if(r&&(y=OZ(y,r,i,h)),o&&(y=RZ(y,o,a,h)),m-=R,h&&m<u){var M=NZ(y,b);return AZ(e,t,a2,v.placeholder,n,y,M,s,l,u-m)}var C=d?n:this,D=f?C[e]:e;return m=y.length,s?y=MZ(y,s):g&&m>1&&y.reverse(),c&&l<m&&(y.length=l),this&&this!==LZ&&this instanceof v&&(D=p||o2(D)),D.apply(C,y)}return v}var s2=a2,HZ=Cv,UZ=Cf,VZ=s2,GZ=n2,$Z=r2,qZ=My,ZZ=sn;function KZ(e,t,n){var r=UZ(e);function i(){for(var o=arguments.length,a=Array(o),s=o,l=$Z(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==l&&a[o-1]!==l?[]:qZ(a,l);if(o-=u.length,o<n)return GZ(e,t,VZ,i.placeholder,void 0,a,u,void 0,void 0,n-o);var c=this&&this!==ZZ&&this instanceof i?r:e;return HZ(c,this,a)}return i}var YZ=KZ,XZ=Cv,QZ=Cf,JZ=sn,eK=1;function tK(e,t,n,r){var i=t&eK,o=QZ(e);function a(){for(var s=-1,l=arguments.length,u=-1,c=r.length,d=Array(c+l),f=this&&this!==JZ&&this instanceof a?o:e;++u<c;)d[u]=r[u];for(;l--;)d[u++]=arguments[++s];return XZ(f,i?n:this,d)}return a}var nK=tK,rK=GC,iK=$C,l2=My,u2="__lodash_placeholder__",Ny=1,oK=2,aK=4,c2=8,Ll=128,d2=256,sK=Math.min;function lK(e,t){var n=e[1],r=t[1],i=n|r,o=i<(Ny|oK|Ll),a=r==Ll&&n==c2||r==Ll&&n==d2&&e[7].length<=t[8]||r==(Ll|d2)&&t[7].length<=t[8]&&n==c2;if(!(o||a))return e;r&Ny&&(e[2]=t[2],i|=n&Ny?0:aK);var s=t[3];if(s){var l=e[3];e[3]=l?rK(l,s,t[4]):s,e[4]=l?l2(e[3],u2):t[4]}return s=t[5],s&&(l=e[5],e[5]=l?iK(l,s,t[6]):s,e[6]=l?l2(e[5],u2):t[6]),s=t[7],s&&(e[7]=s),r&Ll&&(e[8]=e[8]==null?t[8]:sK(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var uK=lK,cK=/\s/;function dK(e){for(var t=e.length;t--&&cK.test(e.charAt(t)););return t}var fK=dK,hK=fK,pK=/^\s+/;function gK(e){return e&&e.slice(0,hK(e)+1).replace(pK,"")}var mK=gK,vK=mK,f2=Qn,yK=il,h2=NaN,wK=/^[-+]0x[0-9a-f]+$/i,_K=/^0b[01]+$/i,TK=/^0o[0-7]+$/i,EK=parseInt;function xK(e){if(typeof e=="number")return e;if(yK(e))return h2;if(f2(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=f2(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=vK(e);var n=_K.test(e);return n||TK.test(e)?EK(e.slice(2),n?2:8):wK.test(e)?h2:+e}var Ly=xK,SK=Ly,p2=1/0,bK=17976931348623157e292;function CK(e){if(!e)return e===0?e:0;if(e=SK(e),e===p2||e===-p2){var t=e<0?-1:1;return t*bK}return e===e?e:0}var PK=CK,OK=PK;function RK(e){var t=OK(e),n=t%1;return t===t?n?t-n:t:0}var kl=RK,IK=UC,AK=Y$,DK=YZ,MK=s2,NK=nK,LK=ZC,kK=uK,FK=QC,BK=JC,g2=kl,jK="Expected a function",m2=1,WK=2,ky=8,Fy=16,By=32,v2=64,y2=Math.max;function zK(e,t,n,r,i,o,a,s){var l=t&WK;if(!l&&typeof e!="function")throw new TypeError(jK);var u=r?r.length:0;if(u||(t&=~(By|v2),r=i=void 0),a=a===void 0?a:y2(g2(a),0),s=s===void 0?s:g2(s),u-=i?i.length:0,t&v2){var c=r,d=i;r=i=void 0}var f=l?void 0:LK(e),h=[e,t,n,r,i,c,d,o,a,s];if(f&&kK(h,f),e=h[0],t=h[1],n=h[2],r=h[3],i=h[4],s=h[9]=h[9]===void 0?l?0:e.length:y2(h[9]-u,0),!s&&t&(ky|Fy)&&(t&=~(ky|Fy)),!t||t==m2)var g=AK(e,t,n);else t==ky||t==Fy?g=DK(e,t,s):(t==By||t==(m2|By))&&!i.length?g=NK(e,t,n,r):g=MK.apply(void 0,h);var p=f?IK:FK;return BK(p(g,h),e,t)}var jy=zK,HK=jy,UK=8;function Wy(e,t,n){t=n?void 0:t;var r=HK(e,UK,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=Wy.placeholder,r}Wy.placeholder={};var w2=Wy;const VK=He(w2);var GK=Lm,$K=Ta,qK=Vc,ZK=Ft,KK=rl,YK=Xc,XK=td,QK=Nm,JK="[object Map]",eY="[object Set]",tY=Object.prototype,nY=tY.hasOwnProperty;function rY(e){if(e==null)return!0;if(KK(e)&&(ZK(e)||typeof e=="string"||typeof e.splice=="function"||YK(e)||QK(e)||qK(e)))return!e.length;var t=$K(e);if(t==JK||t==eY)return!e.size;if(XK(e))return!GK(e).length;for(var n in e)if(nY.call(e,n))return!1;return!0}var _2=rY;const Af=He(_2);function iY(e,t){function n(i,o){const a=x.useContext(DC),s={...i,...o?{ref:o}:{}},l=(a||{})[e];if(Af(l)||Af(l.wrap)&&Af(l.add))return S.jsx(t,{...s});const u=(l.add||[]).map(f=>f.component),c=S.jsx(t,{...s,PluginComponents:u});if(Af(l.wrap))return c;const d=(f,h)=>{const g=h.component;return S.jsx(g,{targetProps:s,...s,PluginComponents:u,TargetComponent:t,children:f})};return l.wrap.slice().reverse().reduce(d,S.jsx(t,{...s}))}const r=x.forwardRef(n);return r.displayName=`WithPlugins(${e})`,r}const gt=VK(iY);let T2=class extends x.Component{render(){const{children:t,theme:n}=this.props,r=jd({key:"mui"});return S.jsx(Xv,{injectFirst:!0,children:S.jsx(Gv,{value:r,children:S.jsx(RC,{theme:yy(n),children:t})})})}};T2.propTypes={children:A.node,theme:A.object.isRequired};const oY=Me(Qe(e=>({theme:_d(e)})),gt("AppProviders_PW"))(T2),aY=x.lazy(()=>Promise.resolve().then(()=>Vme));class E2 extends x.Component{constructor(t){super(t),this.areaRef=x.createRef()}render(){const{plugins:t=[],closeTheApp:n=()=>{}}=this.props;return S.jsx(jC,{plugins:t,children:S.jsx(oY,{children:S.jsx(xy.Provider,{value:this.areaRef,children:S.jsx(x.Suspense,{fallback:S.jsx("div",{}),children:S.jsx(aY,{areaRef:this.areaRef,closeTheApp:n})})})})})}}E2.propTypes={plugins:A.array,closeTheApp:A.func};class Df extends x.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){this.props.isDebugMode&&console.log("TV app error occurred:",t,n)}render(){return this.state.hasError?S.jsx("div",{}):this.props.children}}Df.propTypes={children:A.element,isDebugMode:A.bool};var sY=Pi,lY=Ft,uY=Mn,cY="[object String]";function dY(e){return typeof e=="string"||!lY(e)&&uY(e)&&sY(e)==cY}var fY=dY;const x2=He(fY);function hY(e){return e===void 0}var pY=hY;const To=He(pY);function gY(e){return e===null}var mY=gY;const S2=He(mY);var vY=Ea;function yY(e,t){return vY(t,function(n){return e[n]})}var wY=yY,_Y=wY,TY=co;function EY(e){return e==null?[]:_Y(e,TY(e))}var zy=EY;const xY=He(zy),b2=e=>[SY,bY,CY,PY,OY,RY,IY].every(t=>t(e)),SY=e=>km(e),bY=e=>{const{name:t}=e;return To(t)||x2(t)},CY=e=>{const{mode:t,target:n}=e;return To(t)?To(n):x2(n)},PY=e=>{const{mode:t}=e;return To(t)||["add","wrap"].some(n=>n===t)},OY=e=>{const{mapStateToProps:t}=e;return To(t)||S2(t)||Fm(t)},RY=e=>{const{mapDispatchToProps:t}=e;return To(t)||S2(t)||Fm(t)||km(t)},IY=e=>{const{reducers:t}=e;return To(t)||km(t)&&xY(t).every(Fm)};function C2(e){const{validPlugins:t,invalidPlugins:n}=AY(e);return DY(n),t}function AY(e){const t=[],n=[];return e.forEach(r=>{Array.isArray(r)?r.every(o=>b2(o))?n.push(...r):t.push(...r):b2(r)?n.push(r):t.push(r)}),{invalidPlugins:t,validPlugins:n}}function DY(e){e.forEach(t=>console.log(`Plugin ${t.name} is not valid and was rejected.`))}function MY(e){return e&&e.reduce((t,n)=>({...t,...n.reducers}),{})}function NY(e){return e&&e.reduce((t,n)=>pl(t,n.config||{}),{})}function LY(e){return e&&e.filter(t=>t.saga).map(t=>t.saga)}var P2=Symbol.for("immer-nothing"),O2=Symbol.for("immer-draftable"),Bn=Symbol.for("immer-state");function Er(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var $a=Object.getPrototypeOf;function qa(e){return!!e&&!!e[Bn]}function Eo(e){var t;return e?R2(e)||Array.isArray(e)||!!e[O2]||!!((t=e.constructor)!=null&&t[O2])||Lf(e)||kf(e):!1}var kY=Object.prototype.constructor.toString();function R2(e){if(!e||typeof e!="object")return!1;const t=$a(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===kY}function Mf(e,t){Nf(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Nf(e){const t=e[Bn];return t?t.type_:Array.isArray(e)?1:Lf(e)?2:kf(e)?3:0}function Hy(e,t){return Nf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function I2(e,t,n){const r=Nf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function FY(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Lf(e){return e instanceof Map}function kf(e){return e instanceof Set}function xo(e){return e.copy_||e.base_}function Uy(e,t){if(Lf(e))return new Map(e);if(kf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=R2(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Bn];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const a=i[o],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create($a(e),r)}else{const r=$a(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Vy(e,t=!1){return Ff(e)||qa(e)||!Eo(e)||(Nf(e)>1&&(e.set=e.add=e.clear=e.delete=BY),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Vy(r,!0))),e}function BY(){Er(2)}function Ff(e){return Object.isFrozen(e)}var jY={};function So(e){const t=jY[e];return t||Er(0,e),t}var Fl;function A2(){return Fl}function WY(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function D2(e,t){t&&(So("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Gy(e){$y(e),e.drafts_.forEach(zY),e.drafts_=null}function $y(e){e===Fl&&(Fl=e.parent_)}function M2(e){return Fl=WY(Fl,e)}function zY(e){const t=e[Bn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function N2(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Bn].modified_&&(Gy(t),Er(4)),Eo(e)&&(e=Bf(t,e),t.parent_||jf(t,e)),t.patches_&&So("Patches").generateReplacementPatches_(n[Bn].base_,e,t.patches_,t.inversePatches_)):e=Bf(t,n,[]),Gy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==P2?e:void 0}function Bf(e,t,n){if(Ff(t))return t;const r=t[Bn];if(!r)return Mf(t,(i,o)=>L2(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return jf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,a=!1;r.type_===3&&(o=new Set(i),i.clear(),a=!0),Mf(o,(s,l)=>L2(e,r,i,s,l,n,a)),jf(e,i,!1),n&&e.patches_&&So("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function L2(e,t,n,r,i,o,a){if(qa(i)){const s=o&&t&&t.type_!==3&&!Hy(t.assigned_,r)?o.concat(r):void 0,l=Bf(e,i,s);if(I2(n,r,l),qa(l))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(Eo(i)&&!Ff(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Bf(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&jf(e,i)}}function jf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Vy(t,n)}function HY(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:A2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=qy;n&&(i=[r],o=Bl);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}var qy={get(e,t){if(t===Bn)return e;const n=xo(e);if(!Hy(n,t))return UY(e,n,t);const r=n[t];return e.finalized_||!Eo(r)?r:r===Zy(e.base_,t)?(Yy(e),e.copy_[t]=Xy(r,e)):r},has(e,t){return t in xo(e)},ownKeys(e){return Reflect.ownKeys(xo(e))},set(e,t,n){const r=k2(xo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Zy(xo(e),t),o=i==null?void 0:i[Bn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(FY(n,i)&&(n!==void 0||Hy(e.base_,t)))return!0;Yy(e),Ky(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Zy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Yy(e),Ky(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=xo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Er(11)},getPrototypeOf(e){return $a(e.base_)},setPrototypeOf(){Er(12)}},Bl={};Mf(qy,(e,t)=>{Bl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Bl.deleteProperty=function(e,t){return Bl.set.call(this,e,t,void 0)},Bl.set=function(e,t,n){return qy.set.call(this,e[0],t,n,e[0])};function Zy(e,t){const n=e[Bn];return(n?xo(n):e)[t]}function UY(e,t,n){var i;const r=k2(t,n);return r?"value" in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function k2(e,t){if(!(t in e))return;let n=$a(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=$a(n)}}function Ky(e){e.modified_||(e.modified_=!0,e.parent_&&Ky(e.parent_))}function Yy(e){e.copy_||(e.copy_=Uy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VY=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const a=this;return function(l=o,...u){return a.produce(l,c=>n.call(this,c,...u))}}typeof n!="function"&&Er(6),r!==void 0&&typeof r!="function"&&Er(7);let i;if(Eo(t)){const o=M2(this),a=Xy(t,void 0);let s=!0;try{i=n(a),s=!1}finally{s?Gy(o):$y(o)}return D2(o,r),N2(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===P2&&(i=void 0),this.autoFreeze_&&Vy(i,!0),r){const o=[],a=[];So("Patches").generateReplacementPatches_(t,i,o,a),r(o,a)}return i}else Er(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,l=>t(l,...s));let r,i;return[this.produce(t,n,(a,s)=>{r=a,i=s}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Eo(e)||Er(8),qa(e)&&(e=GY(e));const t=M2(this),n=Xy(e,void 0);return n[Bn].isManual_=!0,$y(t),n}finishDraft(e,t){const n=e&&e[Bn];(!n||!n.isManual_)&&Er(9);const{scope_:r}=n;return D2(r,t),N2(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=So("Patches").applyPatches_;return qa(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Xy(e,t){const n=Lf(e)?So("MapSet").proxyMap_(e,t):kf(e)?So("MapSet").proxySet_(e,t):HY(e,t);return(t?t.scope_:A2()).drafts_.push(n),n}function GY(e){return qa(e)||Er(10,e),F2(e)}function F2(e){if(!Eo(e)||Ff(e))return e;const t=e[Bn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Uy(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Uy(e,!0);return Mf(n,(r,i)=>{I2(n,r,F2(i))}),t&&(t.finalized_=!1),n}var jn=new VY;jn.produce,jn.produceWithPatches.bind(jn),jn.setAutoFreeze.bind(jn),jn.setUseStrictShallowCopy.bind(jn),jn.applyPatches.bind(jn),jn.createDraft.bind(jn),jn.finishDraft.bind(jn);function B2(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var j2=B2(),$Y=B2,qY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Me:Me.apply(null,arguments)},W2=class bu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,bu.prototype)}static get[Symbol.species](){return bu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new bu(...t[0].concat(this)):new bu(...t.concat(this))}};function ZY(e){return typeof e=="boolean"}var KY=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new W2;return n&&(ZY(n)?a.push(j2):a.push($Y(n.extraArgument))),a},YY="RTK_autoBatch",z2=e=>t=>{setTimeout(t,e)},XY=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,a=!1;const s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:z2(10):e.type==="callback"?e.queueNotification:z2(e.timeout),u=()=>{a=!1,o&&(o=!1,s.forEach(c=>c()))};return Object.assign({},r,{subscribe(c){const d=()=>i&&c(),f=r.subscribe(d);return s.add(c),()=>{f(),s.delete(c)}},dispatch(c){var d;try{return i=!((d=c==null?void 0:c.meta)!=null&&d[YY]),o=!i,o&&(a||(a=!0,l(u))),r.dispatch(c)}finally{i=!0}}})},QY=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new W2(e);return r&&i.push(XY(typeof r=="object"?r:void 0)),i};function JY(e){const t=KY(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:a=void 0}=e||{};let s;if(typeof n=="function")s=n;else if(QE(n))s=Im(n);else throw new Error(eX(1));let l;typeof r=="function"?l=r(t):l=t();let u=Me;i&&(u=qY({trace:!1,...typeof i=="object"&&i}));const c=t3(...l),d=QY(c);let f=typeof a=="function"?a(d):d();const h=u(...f);return JE(s,o,h)}function eX(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var xr=function(t){return"@@redux-saga/"+t},H2=xr("CANCEL_PROMISE"),U2=xr("CHANNEL_END"),V2=xr("IO"),G2=xr("MATCH"),$2=xr("MULTICAST"),q2=xr("SAGA_ACTION"),tX=xr("SELF_CANCELLATION"),nX=xr("TASK"),Za=xr("TASK_CANCEL"),Z2=xr("TERMINATE"),rX=xr("LOCATION"),K2=function(t){return t==null},Wf=function(t){return t!=null},_n=function(t){return typeof t=="function"},Qy=function(t){return typeof t=="string"},Li=Array.isArray,zf=function(t){return t&&_n(t.then)},Jy=function(t){return t&&_n(t.next)&&_n(t.throw)},Y2=function e(t){return t&&(Qy(t)||Q2(t)||_n(t)||Li(t)&&t.every(e))},e0=function(t){return t&&_n(t.take)&&_n(t.close)},X2=function(t){return _n(t)&&t.hasOwnProperty("toString")},Q2=function(t){return!!t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype},iX=function(t){return e0(t)&&t[$2]},oX=2147483647;function aX(e,t){t===void 0&&(t=!0);var n,r=new Promise(function(i){n=setTimeout(i,Math.min(oX,e),t)});return r[H2]=function(){clearTimeout(n)},r}var sX=function(t){return function(){return t}},lX=sX(!0),un=function(){},J2=function(t){return t},t0=function(t,n){j(t,n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(n).forEach(function(r){t[r]=n[r]})},uX=function(t,n){var r;return(r=[]).concat.apply(r,n.map(t))};function Hf(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function cX(e){var t=!1;return function(){t||(t=!0,e())}}var dX=function(t){throw t},fX=function(t){return{value:t,done:!0}};function n0(e,t,n){t===void 0&&(t=dX),n===void 0&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:fX,isSagaIterator:!0};return typeof Symbol<"u"&&(r[Symbol.iterator]=function(){return r}),r}function hX(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var eP=function(t){return Array.apply(null,new Array(t))},pX=function(t){return function(n){return t(Object.defineProperty(n,q2,{value:!0}))}},tP=function(t){return t===Z2},nP=function(t){return t===Za},rP=function(t){return tP(t)||nP(t)};function iP(e,t){var n=Object.keys(e),r=n.length,i=0,o,a=Li(e)?eP(r):{},s={};function l(){i===r&&(o=!0,t(a))}return n.forEach(function(u){var c=function(f,h){o||(h||rP(f)?(t.cancel(),t(f,h)):(a[u]=f,i++,l()))};c.cancel=un,s[u]=c}),t.cancel=function(){o||(o=!0,n.forEach(function(u){return s[u].cancel()}))},s}function r0(e){return{name:e.name||"anonymous",location:oP(e)}}function oP(e){return e[rX]}function gX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}var mX="Channel's Buffer overflow!",vX=1,yX=3,aP=4;function wX(e,t){e===void 0&&(e=10);var n=new Array(e),r=0,i=0,o=0,a=function(c){n[i]=c,i=(i+1)%e,r++},s=function(){if(r!=0){var c=n[o];return n[o]=null,r--,o=(o+1)%e,c}},l=function(){for(var c=[];r;)c.push(s());return c};return{isEmpty:function(){return r==0},put:function(c){if(r<e)a(c);else{var d;switch(t){case vX:throw new Error(mX);case yX:n[i]=c,i=(i+1)%e,o=i;break;case aP:d=2*e,n=l(),r=n.length,i=n.length,o=0,n.length=d,e=d,a(c);break}}},take:s,flush:l}}var _X=function(t){return wX(t,aP)},Uf="TAKE",sP="PUT",lP="ALL",TX="RACE",uP="CALL",EX="CPS",i0="FORK",xX="JOIN",SX="CANCEL",cP="SELECT",bX="ACTION_CHANNEL",CX="CANCELLED",PX="FLUSH",OX="GET_CONTEXT",RX="SET_CONTEXT",ei=function(t,n){var r;return r={},r[V2]=!0,r.combinator=!1,r.type=t,r.payload=n,r},IX=function(t){return ei(i0,j({},t.payload,{detached:!0}))};function AX(e,t){if(e===void 0&&(e="*"),Y2(e))return Wf(t)&&console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"),ei(Uf,{pattern:e});if(iX(e)&&Wf(t)&&Y2(t))return ei(Uf,{channel:e,pattern:t});if(e0(e))return Wf(t)&&console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."),ei(Uf,{channel:e})}function Fe(e,t){return K2(t)&&(t=e,e=void 0),ei(sP,{channel:e,action:t})}function cn(e){var t=ei(lP,e);return t.combinator=!0,t}function dP(e,t){var n=null,r;return _n(e)?r=e:(Li(e)?(n=e[0],r=e[1]):(n=e.context,r=e.fn),n&&Qy(r)&&_n(n[r])&&(r=n[r])),{context:n,fn:r,args:t}}function Je(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ei(uP,dP(e,n))}function o0(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ei(i0,dP(e,n))}function DX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return IX(o0.apply(void 0,[e].concat(n)))}function Ue(e){e===void 0&&(e=J2);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ei(cP,{selector:e,args:n})}var MX=Je.bind(null,aX);function NX(){var e={};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}var fP=[],Vf=0;function LX(e){try{a0(),e()}finally{gP()}}function hP(e){fP.push(e),Vf||(a0(),mP())}function pP(e){try{return a0(),e()}finally{mP()}}function a0(){Vf++}function gP(){Vf--}function mP(){gP();for(var e;!Vf&&(e=fP.shift())!==void 0;)LX(e)}var kX=function(t){return function(n){return t.some(function(r){return s0(r)(n)})}},FX=function(t){return function(n){return t(n)}},vP=function(t){return function(n){return n.type===String(t)}},BX=function(t){return function(n){return n.type===t}},yP=function(){return lX};function s0(e){var t=e==="*"?yP:Qy(e)?vP:Li(e)?kX:X2(e)?vP:_n(e)?FX:Q2(e)?BX:null;if(t===null)throw new Error("invalid pattern: "+e);return t(e)}var jl={type:U2},l0=function(t){return t&&t.type===U2};function jX(e){e===void 0&&(e=_X());var t=!1,n=[];function r(s){if(!t){if(n.length===0)return e.put(s);var l=n.shift();l(s)}}function i(s){t&&e.isEmpty()?s(jl):e.isEmpty()?(n.push(s),s.cancel=function(){Hf(n,s)}):s(e.take())}function o(s){if(t&&e.isEmpty()){s(jl);return}s(e.flush())}function a(){if(!t){t=!0;var s=n;n=[];for(var l=0,u=s.length;l<u;l++){var c=s[l];c(jl)}}}return{take:i,put:r,flush:o,close:a}}function WX(){var e,t=!1,n=[],r=n,i=function(){r===n&&(r=n.slice())},o=function(){t=!0;var s=n=r;r=[],s.forEach(function(l){l(jl)})};return e={},e[$2]=!0,e.put=function(s){if(!t){if(l0(s)){o();return}for(var l=n=r,u=0,c=l.length;u<c;u++){var d=l[u];d[G2](s)&&(d.cancel(),d(s))}}},e.take=function(s,l){if(l===void 0&&(l=yP),t){s(jl);return}s[G2]=l,i(),r.push(s),s.cancel=cX(function(){i(),Hf(r,s)})},e.close=o,e}function wP(){var e=WX(),t=e.put;return e.put=function(n){if(n[q2]){t(n);return}hP(function(){t(n)})},e}var bo=0,ti=1,Gf=2,_P=3;function u0(e,t){var n=e[H2];_n(n)&&(t.cancel=n),e.then(t,function(r){t(r,!0)})}var Wl=0,TP=function(){return++Wl},Ht;function zX(e,t){return e.isSagaIterator?{name:e.meta.name}:r0(t)}function HX(e){var t=e.context,n=e.fn,r=e.args;try{var i=n.apply(t,r);if(Jy(i))return i;var o=!1,a=function(l){return o?{value:l,done:!0}:(o=!0,{value:i,done:!zf(i)})};return n0(a)}catch(s){return n0(function(){throw s})}}function UX(e,t,n){var r=t.channel,i=t.action,o=t.resolve;hP(function(){var a;try{a=(r?r.put:e.dispatch)(i)}catch(s){n(s,!0);return}o&&zf(a)?u0(a,n):n(a)})}function VX(e,t,n){var r=t.channel,i=r===void 0?e.channel:r,o=t.pattern,a=t.maybe,s=function(u){if(u instanceof Error){n(u,!0);return}if(l0(u)&&!a){n(Z2);return}n(u)};try{i.take(s,Wf(o)?s0(o):null)}catch(l){n(l,!0);return}n.cancel=s.cancel}function GX(e,t,n,r){var i=t.context,o=t.fn,a=t.args,s=r.task;try{var l=o.apply(i,a);if(zf(l)){u0(l,n);return}if(Jy(l)){$f(e,l,s.context,Wl,r0(o),!1,n);return}n(l)}catch(u){n(u,!0)}}function $X(e,t,n){var r=t.context,i=t.fn,o=t.args;try{var a=function(l,u){K2(l)?n(u):n(l,!0)};i.apply(r,o.concat(a)),a.cancel&&(n.cancel=a.cancel)}catch(s){n(s,!0)}}function qX(e,t,n,r){var i=t.context,o=t.fn,a=t.args,s=t.detached,l=r.task,u=HX({context:i,fn:o,args:a}),c=zX(u,o);pP(function(){var d=$f(e,u,l.context,Wl,c,s,void 0);s?n(d):d.isRunning()?(l.queue.addTask(d),n(d)):d.isAborted()?l.queue.abort(d.error()):n(d)})}function ZX(e,t,n,r){var i=r.task,o=function(l,u){if(l.isRunning()){var c={task:i,cb:u};u.cancel=function(){l.isRunning()&&Hf(l.joiners,c)},l.joiners.push(c)}else l.isAborted()?u(l.error(),!0):u(l.result())};if(Li(t)){if(t.length===0){n([]);return}var a=iP(t,n);t.forEach(function(s,l){o(s,a[l])})}else o(t,n)}function c0(e){e.isRunning()&&e.cancel()}function KX(e,t,n,r){var i=r.task;t===tX?c0(i):Li(t)?t.forEach(c0):c0(t),n()}function YX(e,t,n,r){var i=r.digestEffect,o=Wl,a=Object.keys(t);if(a.length===0){n(Li(t)?[]:{});return}var s=iP(t,n);a.forEach(function(l){i(t[l],o,s[l],l)})}function XX(e,t,n,r){var i=r.digestEffect,o=Wl,a=Object.keys(t),s=Li(t)?eP(a.length):{},l={},u=!1;a.forEach(function(c){var d=function(h,g){u||(g||rP(h)?(n.cancel(),n(h,g)):(n.cancel(),u=!0,s[c]=h,n(s)))};d.cancel=un,l[c]=d}),n.cancel=function(){u||(u=!0,a.forEach(function(c){return l[c].cancel()}))},a.forEach(function(c){u||i(t[c],o,l[c],c)})}function QX(e,t,n){var r=t.selector,i=t.args;try{var o=r.apply(void 0,[e.getState()].concat(i));n(o)}catch(a){n(a,!0)}}function JX(e,t,n){var r=t.pattern,i=t.buffer,o=jX(i),a=s0(r),s=function u(c){l0(c)||e.channel.take(u,a),o.put(c)},l=o.close;o.close=function(){s.cancel(),l()},e.channel.take(s,a),n(o)}function eQ(e,t,n,r){var i=r.task;n(i.isCancelled())}function tQ(e,t,n){t.flush(n)}function nQ(e,t,n,r){var i=r.task;n(i.context[t])}function rQ(e,t,n,r){var i=r.task;t0(i.context,t),n()}var iQ=(Ht={},Ht[Uf]=VX,Ht[sP]=UX,Ht[lP]=YX,Ht[TX]=XX,Ht[uP]=GX,Ht[EX]=$X,Ht[i0]=qX,Ht[xX]=ZX,Ht[SX]=KX,Ht[cP]=QX,Ht[bX]=JX,Ht[CX]=eQ,Ht[PX]=tQ,Ht[OX]=nQ,Ht[RX]=rQ,Ht);function oQ(e,t,n){var r=[],i,o=!1;l(e);var a=function(){return r};function s(c){t(),u(),n(c,!0)}function l(c){r.push(c),c.cont=function(d,f){o||(Hf(r,c),c.cont=un,f?s(d):(c===e&&(i=d),r.length||(o=!0,n(i))))}}function u(){o||(o=!0,r.forEach(function(c){c.cont=un,c.cancel()}),r=[])}return{addTask:l,cancelAll:u,abort:s,getTasks:a}}function EP(e,t){return e+"?"+t}function aQ(e){var t=oP(e);if(t){var n=t.code,r=t.fileName,i=t.lineNumber,o=n+"  "+EP(r,i);return o}return""}function xP(e){var t=e.name,n=e.location;return n?t+"  "+EP(n.fileName,n.lineNumber):t}function sQ(e){var t=uX(function(n){return n.cancelledTasks},e);return t.length?["Tasks cancelled due to error:"].concat(t).join(`
`):""}var d0=null,zl=[],lQ=function(t){t.crashedEffect=d0,zl.push(t)},SP=function(){d0=null,zl.length=0},uQ=function(t){d0=t},cQ=function(){var t=zl[0],n=zl.slice(1),r=t.crashedEffect?aQ(t.crashedEffect):null,i="The above error occurred in task "+xP(t.meta)+(r?` 
 when executing effect `+r:"");return[i].concat(n.map(function(o){return"    created by "+xP(o.meta)}),[sQ(zl)]).join(`
`)};function dQ(e,t,n,r,i,o,a){var s;a===void 0&&(a=un);var l=bo,u,c,d=null,f=[],h=Object.create(n),g=oQ(t,function(){f.push.apply(f,g.getTasks().map(function(R){return R.meta.name}))},v);function p(){l===bo&&(l=ti,g.cancelAll(),v(Za,!1))}function v(b,R){if(!R)b===Za?l=ti:l!==ti&&(l=_P),u=b,d&&d.resolve(b);else{if(l=Gf,lQ({meta:i,cancelledTasks:f}),E.isRoot){var M=cQ();SP(),e.onError(b,{sagaStack:M})}c=b,d&&d.reject(b)}E.cont(b,R),E.joiners.forEach(function(C){C.cb(b,R)}),E.joiners=null}function m(b){t0(h,b)}function y(){return d||(d=NX(),l===Gf?d.reject(c):l!==bo&&d.resolve(u)),d.promise}var E=(s={},s[nX]=!0,s.id=r,s.meta=i,s.isRoot=o,s.context=h,s.joiners=[],s.queue=g,s.cancel=p,s.cont=a,s.end=v,s.setContext=m,s.toPromise=y,s.isRunning=function(){return l===bo},s.isCancelled=function(){return l===ti||l===bo&&t.status===ti},s.isAborted=function(){return l===Gf},s.result=function(){return u},s.error=function(){return c},s);return E}function $f(e,t,n,r,i,o,a){var s=e.finalizeRunEffect(h);f.cancel=un;var l={meta:i,cancel:d,status:bo},u=dQ(e,l,n,r,i,o,a),c={task:u,digestEffect:g};function d(){l.status===bo&&(l.status=ti,f(Za))}return a&&(a.cancel=u.cancel),f(),u;function f(p,v){try{var m;v?(m=t.throw(p),SP()):nP(p)?(l.status=ti,f.cancel(),m=_n(t.return)?t.return(Za):{done:!0,value:Za}):tP(p)?m=_n(t.return)?t.return():{done:!0}:m=t.next(p),m.done?(l.status!==ti&&(l.status=_P),l.cont(m.value)):g(m.value,r,f)}catch(y){if(l.status===ti)throw y;l.status=Gf,l.cont(y,!0)}}function h(p,v,m){if(zf(p))u0(p,m);else if(Jy(p))$f(e,p,u.context,v,i,!1,m);else if(p&&p[V2]){var y=iQ[p.type];y(e,p.payload,m,c)}else m(p)}function g(p,v,m,y){y===void 0&&(y="");var E=TP();e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:E,parentEffectId:v,label:y,effect:p});var b;function R(M,C){b||(b=!0,m.cancel=un,e.sagaMonitor&&(C?e.sagaMonitor.effectRejected(E,M):e.sagaMonitor.effectResolved(E,M)),C&&uQ(p),m(M,C))}R.cancel=un,m.cancel=function(){b||(b=!0,R.cancel(),R.cancel=un,e.sagaMonitor&&e.sagaMonitor.effectCancelled(E))},s(p,E,R)}}function fQ(e,t){for(var n=e.channel,r=n===void 0?wP():n,i=e.dispatch,o=e.getState,a=e.context,s=a===void 0?{}:a,l=e.sagaMonitor,u=e.effectMiddlewares,c=e.onError,d=c===void 0?hX:c,f=arguments.length,h=new Array(f>2?f-2:0),g=2;g<f;g++)h[g-2]=arguments[g];var p=t.apply(void 0,h),v=TP();l&&(l.rootSagaStarted=l.rootSagaStarted||un,l.effectTriggered=l.effectTriggered||un,l.effectResolved=l.effectResolved||un,l.effectRejected=l.effectRejected||un,l.effectCancelled=l.effectCancelled||un,l.actionDispatched=l.actionDispatched||un,l.rootSagaStarted({effectId:v,saga:t,args:h}));var m;if(u){var y=gX.apply(void 0,u);m=function(R){return function(M,C,D){var F=function(B){return R(B,C,D)};return y(F)(M)}}}else m=J2;var E={channel:r,dispatch:pX(i),getState:o,sagaMonitor:l,onError:d,finalizeRunEffect:m};return pP(function(){var b=$f(E,p,s,v,r0(t),!0,void 0);return l&&l.effectResolved(v,b),b})}function hQ(e){var t={},n=t.context,r=n===void 0?{}:n,i=t.channel,o=i===void 0?wP():i,a=t.sagaMonitor,s=Ne(t,["context","channel","sagaMonitor"]),l;function u(c){var d=c.getState,f=c.dispatch;return l=fQ.bind(null,j({},s,{context:r,channel:o,dispatch:f,getState:d,sagaMonitor:a})),function(h){return function(g){a&&a.actionDispatched&&a.actionDispatched(g);var p=h(g);return o.put(g),p}}}return u.run=function(){return l.apply(void 0,arguments)},u.setContext=function(c){t0(r,c)},u}var pQ=Sy,gQ=yd;function mQ(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?gQ(n,s,l):pQ(n,s,l)}return n}var Hl=mQ,vQ=Hl,yQ=co;function wQ(e,t){return e&&vQ(t,yQ(t),e)}var bP=wQ;function _Q(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var TQ=_Q,EQ=Qn,xQ=td,SQ=TQ,bQ=Object.prototype,CQ=bQ.hasOwnProperty;function PQ(e){if(!EQ(e))return SQ(e);var t=xQ(e),n=[];for(var r in e)r=="constructor"&&(t||!CQ.call(e,r))||n.push(r);return n}var OQ=PQ,RQ=ux,IQ=OQ,AQ=rl;function DQ(e){return AQ(e)?RQ(e,!0):IQ(e)}var f0=DQ,MQ=Hl,NQ=f0;function LQ(e,t){return e&&MQ(t,NQ(t),e)}var kQ=LQ,qf={exports:{}};qf.exports,function(e,t){var n=sn,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,f=s?s(d):new u.constructor(d);return u.copy(f),f}e.exports=l}(qf,qf.exports);var FQ=qf.exports,BQ=Hl,jQ=qm;function WQ(e,t){return BQ(e,jQ(e),t)}var zQ=WQ,HQ=cx,UQ=HQ(Object.getPrototypeOf,Object),h0=UQ,VQ=xm,GQ=h0,$Q=qm,qQ=Ex,ZQ=Object.getOwnPropertySymbols,KQ=ZQ?function(e){for(var t=[];e;)VQ(t,$Q(e)),e=GQ(e);return t}:qQ,CP=KQ,YQ=Hl,XQ=CP;function QQ(e,t){return YQ(e,XQ(e),t)}var JQ=QQ,eJ=Tx,tJ=CP,nJ=f0;function rJ(e){return eJ(e,nJ,tJ)}var p0=rJ,iJ=Object.prototype,oJ=iJ.hasOwnProperty;function aJ(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&oJ.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var sJ=aJ,PP=vx;function lJ(e){var t=new e.constructor(e.byteLength);return new PP(t).set(new PP(e)),t}var g0=lJ,uJ=g0;function cJ(e,t){var n=t?uJ(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var dJ=cJ,fJ=/\w*$/;function hJ(e){var t=new e.constructor(e.source,fJ.exec(e));return t.lastIndex=e.lastIndex,t}var pJ=hJ,OP=ga,RP=OP?OP.prototype:void 0,IP=RP?RP.valueOf:void 0;function gJ(e){return IP?Object(IP.call(e)):{}}var mJ=gJ,vJ=g0;function yJ(e,t){var n=t?vJ(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var wJ=yJ,_J=g0,TJ=dJ,EJ=pJ,xJ=mJ,SJ=wJ,bJ="[object Boolean]",CJ="[object Date]",PJ="[object Map]",OJ="[object Number]",RJ="[object RegExp]",IJ="[object Set]",AJ="[object String]",DJ="[object Symbol]",MJ="[object ArrayBuffer]",NJ="[object DataView]",LJ="[object Float32Array]",kJ="[object Float64Array]",FJ="[object Int8Array]",BJ="[object Int16Array]",jJ="[object Int32Array]",WJ="[object Uint8Array]",zJ="[object Uint8ClampedArray]",HJ="[object Uint16Array]",UJ="[object Uint32Array]";function VJ(e,t,n){var r=e.constructor;switch(t){case MJ:return _J(e);case bJ:case CJ:return new r(+e);case NJ:return TJ(e,n);case LJ:case kJ:case FJ:case BJ:case jJ:case WJ:case zJ:case HJ:case UJ:return SJ(e,n);case PJ:return new r;case OJ:case AJ:return new r(e);case RJ:return EJ(e);case IJ:return new r;case DJ:return xJ(e)}}var GJ=VJ,$J=bf,qJ=h0,ZJ=td;function KJ(e){return typeof e.constructor=="function"&&!ZJ(e)?$J(qJ(e)):{}}var YJ=KJ,XJ=Ta,QJ=Mn,JJ="[object Map]";function eee(e){return QJ(e)&&XJ(e)==JJ}var tee=eee,nee=tee,ree=Jc,AP=Mm,DP=AP&&AP.isMap,iee=DP?ree(DP):nee,oee=iee,aee=Ta,see=Mn,lee="[object Set]";function uee(e){return see(e)&&aee(e)==lee}var cee=uee,dee=cee,fee=Jc,MP=Mm,NP=MP&&MP.isSet,hee=NP?fee(NP):dee,pee=hee,gee=Hm,mee=Dy,vee=Sy,yee=bP,wee=kQ,_ee=FQ,Tee=Rf,Eee=zQ,xee=JQ,See=Sx,bee=p0,Cee=Ta,Pee=sJ,Oee=GJ,Ree=YJ,Iee=Ft,Aee=Xc,Dee=oee,Mee=Qn,Nee=pee,Lee=co,kee=f0,Fee=1,Bee=2,jee=4,LP="[object Arguments]",Wee="[object Array]",zee="[object Boolean]",Hee="[object Date]",Uee="[object Error]",kP="[object Function]",Vee="[object GeneratorFunction]",Gee="[object Map]",$ee="[object Number]",FP="[object Object]",qee="[object RegExp]",Zee="[object Set]",Kee="[object String]",Yee="[object Symbol]",Xee="[object WeakMap]",Qee="[object ArrayBuffer]",Jee="[object DataView]",ete="[object Float32Array]",tte="[object Float64Array]",nte="[object Int8Array]",rte="[object Int16Array]",ite="[object Int32Array]",ote="[object Uint8Array]",ate="[object Uint8ClampedArray]",ste="[object Uint16Array]",lte="[object Uint32Array]",et={};et[LP]=et[Wee]=et[Qee]=et[Jee]=et[zee]=et[Hee]=et[ete]=et[tte]=et[nte]=et[rte]=et[ite]=et[Gee]=et[$ee]=et[FP]=et[qee]=et[Zee]=et[Kee]=et[Yee]=et[ote]=et[ate]=et[ste]=et[lte]=!0,et[Uee]=et[kP]=et[Xee]=!1;function Zf(e,t,n,r,i,o){var a,s=t&Fee,l=t&Bee,u=t&jee;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!Mee(e))return e;var c=Iee(e);if(c){if(a=Pee(e),!s)return Tee(e,a)}else{var d=Cee(e),f=d==kP||d==Vee;if(Aee(e))return _ee(e,s);if(d==FP||d==LP||f&&!i){if(a=l||f?{}:Ree(e),!s)return l?xee(e,wee(a,e)):Eee(e,yee(a,e))}else{if(!et[d])return i?e:{};a=Oee(e,d,s)}}o||(o=new gee);var h=o.get(e);if(h)return h;o.set(e,a),Nee(e)?e.forEach(function(v){a.add(Zf(v,t,n,v,e,o))}):Dee(e)&&e.forEach(function(v,m){a.set(m,Zf(v,t,n,m,e,o))});var g=u?l?bee:See:l?kee:Lee,p=c?void 0:g(e);return mee(p||e,function(v,m){p&&(m=v,v=e[m]),vee(a,m,Zf(v,t,n,m,e,o))}),a}var m0=Zf;function ute(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var BP=ute;function cte(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var Kf=cte,dte=ol,fte=Kf;function hte(e,t){return t.length<2?e:dte(e,fte(t,0,-1))}var pte=hte,gte=xa,mte=BP,vte=pte,yte=po;function wte(e,t){return t=gte(t,e),e=vte(e,t),e==null||delete e[yte(mte(t))]}var _te=wte,Tte=Pi,Ete=h0,xte=Mn,Ste="[object Object]",bte=Function.prototype,Cte=Object.prototype,jP=bte.toString,Pte=Cte.hasOwnProperty,Ote=jP.call(Object);function Rte(e){if(!xte(e)||Tte(e)!=Ste)return!1;var t=Ete(e);if(t===null)return!0;var n=Pte.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&jP.call(n)==Ote}var WP=Rte,Ite=WP;function Ate(e){return Ite(e)?void 0:e}var Dte=Ate,Mte=Sm,Nte=FS,Lte=Pv;function kte(e){return Lte(Nte(e,void 0,Mte),e+"")}var zP=kte,Fte=Ea,Bte=m0,jte=_te,Wte=xa,zte=Hl,Hte=Dte,Ute=zP,Vte=p0,Gte=1,$te=2,qte=4,Zte=Ute(function(e,t){var n={};if(e==null)return n;var r=!1;t=Fte(t,function(o){return o=Wte(o,e),r||(r=o.length>1),o}),zte(e,Vte(e),n),r&&(n=Bte(n,Gte|$te|qte,Hte));for(var i=t.length;i--;)jte(n,t[i]);return n}),Kte=Zte;const ni=He(Kte),N={ADD_COMPANION_WINDOW:"mirador/ADD_COMPANION_WINDOW",UPDATE_COMPANION_WINDOW:"mirador/UPDATE_COMPANION_WINDOW",REMOVE_COMPANION_WINDOW:"mirador/REMOVE_COMPANION_WINDOW",TOGGLE_TOC_NODE:"mirador/TOGGLE_TOC_NODE",UPDATE_WINDOW:"mirador/UPDATE_WINDOW",REQUEST_CANVAS_ANNOTATIONS:"mirador/REQUEST_CANVAS_ANNOTATIONS",HOVER_ANNOTATION:"mirador/HOVER_ANNOTATION",REQUEST_ANNOTATION:"mirador/REQUEST_ANNOTATION",RECEIVE_ANNOTATION:"mirador/RECEIVE_ANNOTATION",RECEIVE_ANNOTATION_FAILURE:"mirador/RECEIVE_ANNOTATION_FAILURE",DESELECT_ANNOTATION:"mirador/DESELECT_ANNOTATION",SELECT_ANNOTATION:"mirador/SELECT_ANNOTATION",TOGGLE_ANNOTATION_DISPLAY:"mirador/TOGGLE_ANNOTATION_DISPLAY",FOCUS_WINDOW:"mirador/FOCUS_WINDOW",SET_WORKSPACE_FULLSCREEN:"mirador/SET_WORKSPACE_FULLSCREEN",SET_WORKSPACE_VIEWPORT_POSITION:"mirador/SET_WORKSPACE_VIEWPORT_POSITION",ADD_MANIFEST:"mirador/ADD_MANIFEST",ADD_WINDOW:"mirador/ADD_WINDOW",ADD_ERROR:"mirador/ADD_ERROR",IMPORT_CONFIG:"mirador/IMPORT_CONFIG",SET_CANVAS:"mirador/SET_CANVAS",MAXIMIZE_WINDOW:"mirador/MAXIMIZE_WINDOW",MINIMIZE_WINDOW:"mirador/MINIMIZE_WINDOW",UPDATE_WINDOW_POSITION:"mirador/UPDATE_WINDOW_POSITION",SET_WINDOW_SIZE:"mirador/SET_WINDOW_SIZE",REMOVE_WINDOW:"mirador/REMOVE_WINDOW",PICK_WINDOWING_SYSTEM:"mirador/PICK_WINDOWING_SYSTEM",REQUEST_MANIFEST:"mirador/REQUEST_MANIFEST",RECEIVE_MANIFEST:"mirador/RECEIVE_MANIFEST",RECEIVE_MANIFEST_FAILURE:"mirador/RECEIVE_MANIFEST_FAILURE",REMOVE_ERROR:"mirador/REMOVE_ERROR",SET_CONFIG:"mirador/SET_CONFIG",UPDATE_WORKSPACE:"mirador/UPDATE_WORKSPACE",SET_WINDOW_THUMBNAIL_POSITION:"mirador/SET_WINDOW_THUMBNAIL_POSITION",SET_WINDOW_VIEW_TYPE:"mirador/SET_WINDOW_VIEW_TYPE",SET_WORKSPACE_ADD_VISIBILITY:"mirador/SET_WORKSPACE_ADD_VISIBILITY",TOGGLE_WINDOW_SIDE_BAR:"mirador/TOGGLE_WINDOW_SIDE_BAR",TOGGLE_ZOOM_CONTROLS:"mirador/TOGGLE_ZOOM_CONTROLS",UPDATE_CONFIG:"mirador/UPDATE_CONFIG",REMOVE_MANIFEST:"mirador/REMOVE_MANIFEST",REQUEST_INFO_RESPONSE:"mirador/REQUEST_INFO_RESPONSE",RECEIVE_INFO_RESPONSE:"mirador/RECEIVE_INFO_RESPONSE",RECEIVE_DEGRADED_INFO_RESPONSE:"mirador/RECEIVE_DEGRADED_INFO_RESPONSE",RECEIVE_INFO_RESPONSE_FAILURE:"mirador/RECEIVE_INFO_RESPONSE_FAILURE",REMOVE_INFO_RESPONSE:"mirador/REMOVE_INFO_RESPONSE",UPDATE_WORKSPACE_MOSAIC_LAYOUT:"mirador/UPDATE_WORKSPACE_MOSAIC_LAYOUT",UPDATE_VIEWPORT:"mirador/UPDATE_VIEWPORT",ADD_AUTHENTICATION_REQUEST:"mirador/ADD_AUTHENTICATION_REQUEST",RESOLVE_AUTHENTICATION_REQUEST:"mirador/RESOLVE_AUTHENTICATION_REQUEST",REQUEST_ACCESS_TOKEN:"mirador/REQUEST_ACCESS_TOKEN",RECEIVE_ACCESS_TOKEN:"mirador/RECEIVE_ACCESS_TOKEN",RECEIVE_ACCESS_TOKEN_FAILURE:"mirador/RECEIVE_ACCESS_TOKEN_FAILURE",RESET_AUTHENTICATION_STATE:"mirador/RESET_AUTHENTICATION_STATE",CLEAR_ACCESS_TOKEN_QUEUE:"mirador/CLEAR_ACCESS_TOKEN_QUEUE",REQUEST_SEARCH:"mirador/REQUEST_SEARCH",RECEIVE_SEARCH:"mirador/RECEIVE_SEARCH",RECEIVE_SEARCH_FAILURE:"mirador/RECEIVE_SEARCH_FAILURE",REMOVE_SEARCH:"mirador/REMOVE_SEARCH",SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS:"mirador/SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS",UPDATE_LAYERS:"mirador/UPDATE_LAYERS",ADD_RESOURCE:"mirador/ADD_RESOURCE",REMOVE_RESOURCE:"mirador/REMOVE_RESOURCE",SHOW_COLLECTION_DIALOG:"mirador/SHOW_COLLECTION_DIALOG",HIDE_COLLECTION_DIALOG:"mirador/HIDE_COLLECTION_DIALOG"};function HP(e={},t){switch(t.type){case N.RESOLVE_AUTHENTICATION_REQUEST:return{...e,[t.tokenServiceId]:{authId:t.id,id:t.tokenServiceId,isFetching:!0}};case N.REQUEST_ACCESS_TOKEN:return{...e,[t.serviceId]:{authId:t.authId,id:t.serviceId,isFetching:!0}};case N.RECEIVE_ACCESS_TOKEN:return{...e,[t.serviceId]:{...e[t.serviceId],isFetching:!1,json:t.json}};case N.RECEIVE_ACCESS_TOKEN_FAILURE:return{...e,[t.serviceId]:{...e[t.serviceId],error:t.error,isFetching:!1}};case N.RESET_AUTHENTICATION_STATE:return ni(e,t.tokenServiceId);case N.RECEIVE_INFO_RESPONSE:return!t.tokenServiceId||e[t.tokenServiceId].success?e:{...e,[t.tokenServiceId]:{...e[t.tokenServiceId],success:!0}};default:return e}}var UP={};(function(e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,n=e.aliasToReal,r={};for(var i in n){var o=n[i];t.call(r,o)?r[o].push(i):r[o]=[i]}return r}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(UP);var v0,VP;function y0(){return VP||(VP=1,v0={}),v0}var Ot=UP,Yte=y0(),GP=Array.prototype.push;function Xte(e,t){return t==2?function(n,r){return e.apply(void 0,arguments)}:function(n){return e.apply(void 0,arguments)}}function w0(e,t){return t==2?function(n,r){return e(n,r)}:function(n){return e(n)}}function $P(e){for(var t=e?e.length:0,n=Array(t);t--;)n[t]=e[t];return n}function Qte(e){return function(t){return e({},t)}}function Jte(e,t){return function(){for(var n=arguments.length,r=n-1,i=Array(n);n--;)i[n]=arguments[n];var o=i[t],a=i.slice(0,t);return o&&GP.apply(a,o),t!=r&&GP.apply(a,i.slice(t+1)),e.apply(this,a)}}function _0(e,t){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var i=r[0]=t.apply(void 0,r);return e.apply(void 0,r),i}}}function T0(e,t,n,r){var i=typeof t=="function",o=t===Object(t);if(o&&(r=n,n=t,t=void 0),n==null)throw new TypeError;r||(r={});var a={cap:"cap" in r?r.cap:!0,curry:"curry" in r?r.curry:!0,fixed:"fixed" in r?r.fixed:!0,immutable:"immutable" in r?r.immutable:!0,rearg:"rearg" in r?r.rearg:!0},s=i?n:Yte,l="curry" in r&&r.curry,u="fixed" in r&&r.fixed,c="rearg" in r&&r.rearg,d=i?n.runInContext():void 0,f=i?n:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},h=f.ary,g=f.assign,p=f.clone,v=f.curry,m=f.forEach,y=f.isArray,E=f.isError,b=f.isFunction,R=f.isWeakMap,M=f.keys,C=f.rearg,D=f.toInteger,F=f.toPath,L=M(Ot.aryMethod),B={castArray:function(te){return function(){var q=arguments[0];return y(q)?te($P(q)):te.apply(void 0,arguments)}},iteratee:function(te){return function(){var q=arguments[0],ee=arguments[1],se=te(q,ee),ce=se.length;return a.cap&&typeof ee=="number"?(ee=ee>2?ee-2:1,ce&&ce<=ee?se:w0(se,ee)):se}},mixin:function(te){return function(q){var ee=this;if(!b(ee))return te(ee,Object(q));var se=[];return m(M(q),function(ce){b(q[ce])&&se.push([ce,ee.prototype[ce]])}),te(ee,Object(q)),m(se,function(ce){var Be=ce[1];b(Be)?ee.prototype[ce[0]]=Be:delete ee.prototype[ce[0]]}),ee}},nthArg:function(te){return function(q){var ee=q<0?1:D(q)+1;return v(te(q),ee)}},rearg:function(te){return function(q,ee){var se=ee?ee.length:0;return v(te(q,ee),se)}},runInContext:function(te){return function(q){return T0(e,te(q),r)}}};function z(te,q){if(a.cap){var ee=Ot.iterateeRearg[te];if(ee)return ae(q,ee);var se=!i&&Ot.iterateeAry[te];if(se)return Y(q,se)}return q}function $(te,q,ee){return l||a.curry&&ee>1?v(q,ee):q}function de(te,q,ee){if(a.fixed&&(u||!Ot.skipFixed[te])){var se=Ot.methodSpread[te],ce=se&&se.start;return ce===void 0?h(q,ee):Jte(q,ce)}return q}function X(te,q,ee){return a.rearg&&ee>1&&(c||!Ot.skipRearg[te])?C(q,Ot.methodRearg[te]||Ot.aryRearg[ee]):q}function re(te,q){q=F(q);for(var ee=-1,se=q.length,ce=se-1,Be=p(Object(te)),qe=Be;qe!=null&&++ee<se;){var Ae=q[ee],Ze=qe[Ae];Ze!=null&&!(b(Ze)||E(Ze)||R(Ze))&&(qe[Ae]=p(ee==ce?Ze:Object(Ze))),qe=qe[Ae]}return Be}function fe(te){return oe.runInContext.convert(te)(void 0)}function H(te,q){var ee=Ot.aliasToReal[te]||te,se=Ot.remap[ee]||ee,ce=r;return function(Be){var qe=i?d:f,Ae=i?d[se]:q,Ze=g(g({},ce),Be);return T0(qe,ee,Ae,Ze)}}function Y(te,q){return Te(te,function(ee){return typeof ee=="function"?w0(ee,q):ee})}function ae(te,q){return Te(te,function(ee){var se=q.length;return Xte(C(w0(ee,se),q),se)})}function Te(te,q){return function(){var ee=arguments.length;if(!ee)return te();for(var se=Array(ee);ee--;)se[ee]=arguments[ee];var ce=a.rearg?0:ee-1;return se[ce]=q(se[ce]),te.apply(void 0,se)}}function Se(te,q,ee){var se,ce=Ot.aliasToReal[te]||te,Be=q,qe=B[ce];return qe?Be=qe(q):a.immutable&&(Ot.mutate.array[ce]?Be=_0(q,$P):Ot.mutate.object[ce]?Be=_0(q,Qte(q)):Ot.mutate.set[ce]&&(Be=_0(q,re))),m(L,function(Ae){return m(Ot.aryMethod[Ae],function(Ze){if(ce==Ze){var Vn=Ot.methodSpread[ce],xt=Vn&&Vn.afterRearg;return se=xt?de(ce,X(ce,Be,Ae),Ae):X(ce,de(ce,Be,Ae),Ae),se=z(ce,se),se=$(ce,se,Ae),!1}}),!se}),se||(se=Be),se==q&&(se=l?v(se,1):function(){return q.apply(this,arguments)}),se.convert=H(ce,q),se.placeholder=q.placeholder=ee,se}if(!o)return Se(t,n,s);var oe=n,be=[];return m(L,function(te){m(Ot.aryMethod[te],function(q){var ee=oe[Ot.remap[q]||q];ee&&be.push([q,Se(q,ee,oe)])})}),m(M(oe),function(te){var q=oe[te];if(typeof q=="function"){for(var ee=be.length;ee--;)if(be[ee][0]==te)return;q.convert=H(te,q),be.push([te,q])}}),m(be,function(te){oe[te[0]]=te[1]}),oe.convert=fe,oe.placeholder=oe,m(M(oe),function(te){m(Ot.realToAlias[te]||[],function(q){oe[q]=oe[te]})}),oe}var ene=T0,tne=jy,nne=128;function rne(e,t,n){return t=n?void 0:t,t=e&&t==null?e.length:t,tne(e,nne,void 0,void 0,void 0,void 0,t)}var ine=rne,one=m0,ane=4;function sne(e){return one(e,ane)}var qP=sne,lne=Pi,une=Mn,cne=WP,dne="[object DOMException]",fne="[object Error]";function hne(e){if(!une(e))return!1;var t=lne(e);return t==fne||t==dne||typeof e.message=="string"&&typeof e.name=="string"&&!cne(e)}var pne=hne,gne=Ta,mne=Mn,vne="[object WeakMap]";function yne(e){return mne(e)&&gne(e)==vne}var wne=yne,_ne=m0,Tne=cd,Ene=1;function xne(e){return Tne(typeof e=="function"?e:_ne(e,Ene))}var Sne=xne,bne=jy,Cne=zP,Pne=256,One=Cne(function(e,t){return bne(e,Pne,void 0,void 0,void 0,t)}),Rne=One,Ine=Ea,Ane=Rf,Dne=Ft,Mne=il,Nne=Gx,Lne=po,kne=ud;function Fne(e){return Dne(e)?Ine(e,Lne):Mne(e)?[e]:Ane(Nne(kne(e)))}var Bne=Fne,jne={ary:ine,assign:bP,clone:qP,curry:w2,forEach:Dy,isArray:Ft,isError:pne,isFunction:nd,isWeakMap:wne,iteratee:Sne,keys:Lm,rearg:Rne,toInteger:kl,toPath:Bne},Wne=ene,zne=jne;function Hne(e,t,n){return Wne(zne,e,t,n)}var ZP=Hne,E0,KP;function YP(){if(KP)return E0;KP=1;var e=Cy();function t(n,r,i){return n==null?n:e(n,r,i)}return E0=t,E0}var Une=ZP,XP=Une("set",YP());XP.placeholder=y0();var Vne=XP;const x0=He(Vne);var Gne=ZP,QP=Gne("update",FC());QP.placeholder=y0();var $ne=QP;const Yf=He($ne);function JP(e={},t){switch(t.type){case N.ADD_COMPANION_WINDOW:return x0([t.id],t.payload,e);case N.ADD_WINDOW:return{...e,...(t.companionWindows||[]).reduce((n,r)=>(n[r.id]={...e[r.id],...r,windowId:t.id},n),{})};case N.REMOVE_WINDOW:return Object.keys(e).reduce((n,r)=>(e[r].windowId!==t.windowId&&(n[r]=e[r]),n),{});case N.UPDATE_COMPANION_WINDOW:return Yf([t.id],n=>({...n||{},...t.payload}),e);case N.REMOVE_COMPANION_WINDOW:return ni(e,t.id);case N.TOGGLE_TOC_NODE:return Yf([t.id,"tocNodes"],n=>({...n||{},...t.payload}),e);default:return e}}const qne={items:[]},eO=(e=qne,t)=>{let n;switch(t.type){case N.ADD_ERROR:return{...e,[t.id]:{id:t.id,message:t.message},items:[...e.items,t.id]};case N.RECEIVE_INFO_RESPONSE_FAILURE:return{...e,[t.infoId]:{id:t.infoId,message:t.error},items:[...e.items,t.infoId]};case N.RECEIVE_SEARCH_FAILURE:return{...e,[t.searchId]:{id:t.searchId,message:t.error},items:[...e.items,t.searchId]};case N.REMOVE_ERROR:return n=Object.keys(e).reduce((r,i)=>(i!==t.id&&(r[i]=e[i]),r),{}),n.items=HS(n.items,t.id),n;default:return e}};function Zne(e){return e.x!==void 0&&e.y!==void 0&&e.width!==void 0&&e.height!==void 0}function Kne(e,t){return t.x-t.width/2>e.x-e.width/2&&t.y-t.height/2>e.y-e.height/2&&t.x+t.width/2<e.x+e.width/2&&t.y+t.height/2<e.y+e.height/2}const tO=(e={...uo.workspace,windowIds:[]},t)=>{let n,r,i;switch(t.type){case N.UPDATE_WORKSPACE:return{...e,...t.config};case N.FOCUS_WINDOW:return{...e,focusedWindowId:t.windowId,viewportPosition:{...e.viewportPosition,...t.position}};case N.ADD_WINDOW:return{...e,focusedWindowId:t.window.id,windowIds:[...e.windowIds||[],t.window.id]};case N.REMOVE_WINDOW:return i=(e.windowIds||[]).filter(o=>o!==t.windowId),{...e,focusedWindowId:t.windowId===e.focusedWindowId?i[i.length-1]:e.focusedWindowId,windowIds:i};case N.SET_WORKSPACE_FULLSCREEN:return{...e,isFullscreenEnabled:t.isFullscreenEnabled};case N.TOGGLE_ZOOM_CONTROLS:return{...e,showZoomControls:t.showZoomControls};case N.UPDATE_WORKSPACE_MOSAIC_LAYOUT:return{...e,layout:t.layout};case N.SET_WORKSPACE_ADD_VISIBILITY:return{...e,isWorkspaceAddVisible:t.isWorkspaceAddVisible};case N.SET_WORKSPACE_VIEWPORT_POSITION:return n={},r={...e.viewportPosition,...t.payload.position},Zne(r)&&!Kne({height:e.height,width:e.width,x:0,y:0},r)&&(n={height:e.height*2,width:e.width*2}),{...e,...n,viewportPosition:r};case N.SET_CONFIG:case N.IMPORT_CONFIG:case N.UPDATE_CONFIG:return{...e,...t.config.workspace};default:return e}},nO=(e={},t)=>{switch(t.type){case N.ADD_WINDOW:return{...e,[t.window.id]:t.window};case N.MAXIMIZE_WINDOW:return{...e,[t.windowId]:{...e[t.windowId],maximized:!0}};case N.MINIMIZE_WINDOW:return{...e,[t.windowId]:{...e[t.windowId],maximized:!1}};case N.UPDATE_WINDOW:return Yf([t.id],n=>({...n||{},...t.payload}),e);case N.REMOVE_WINDOW:return ni(e,[t.windowId]);case N.TOGGLE_WINDOW_SIDE_BAR:return{...e,[t.windowId]:{...e[t.windowId],sideBarOpen:!e[t.windowId].sideBarOpen}};case N.SET_WINDOW_VIEW_TYPE:return{...e,[t.windowId]:{...e[t.windowId],view:t.viewType}};case N.UPDATE_WINDOW_POSITION:return{...e,[t.payload.windowId]:{...e[t.payload.windowId],x:t.payload.position.x,y:t.payload.position.y}};case N.SET_WINDOW_SIZE:return{...e,[t.payload.windowId]:{...e[t.payload.windowId],height:t.payload.size.height,width:t.payload.size.width,x:t.payload.size.x,y:t.payload.size.y}};case N.SET_CANVAS:return e[t.windowId]?Yf([t.windowId],n=>({...n||{},canvasId:t.canvasId,visibleCanvases:t.visibleCanvases||[]}),e):e;case N.ADD_COMPANION_WINDOW:return{...e,[t.windowId]:{...e[t.windowId],companionWindowIds:e[t.windowId].companionWindowIds.concat([t.id]),...t.payload.position==="left"?{companionAreaOpen:!0,sideBarPanel:t.payload.content}:{}}};case N.UPDATE_COMPANION_WINDOW:return t.payload.position!=="left"?e:{...e,[t.windowId]:{...e[t.windowId],companionAreaOpen:!0}};case N.REMOVE_COMPANION_WINDOW:return{...e,[t.windowId]:{...e[t.windowId],companionWindowIds:e[t.windowId].companionWindowIds.filter(n=>n!==t.id)}};case N.SELECT_ANNOTATION:return{...e,[t.windowId]:{...e[t.windowId],selectedAnnotationId:t.annotationId}};case N.DESELECT_ANNOTATION:return{...e,[t.windowId]:{...e[t.windowId],selectedAnnotationId:void 0}};case N.HOVER_ANNOTATION:return{...e,[t.windowId]:{...e[t.windowId],hoveredAnnotationIds:t.annotationIds}};case N.TOGGLE_ANNOTATION_DISPLAY:return{...e,[t.windowId]:{...e[t.windowId],highlightAllAnnotations:!e[t.windowId].highlightAllAnnotations}};case N.REQUEST_SEARCH:return{...e,[t.windowId]:{...e[t.windowId],suggestedSearches:void 0}};case N.SHOW_COLLECTION_DIALOG:return{...e,[t.windowId]:{...e[t.windowId],collectionDialogOn:!0,collectionManifestId:t.manifestId,collectionPath:t.collectionPath}};case N.HIDE_COLLECTION_DIALOG:return{...e,[t.windowId]:{...e[t.windowId],collectionDialogOn:!1}};default:return e}},rO=(e={},t)=>{switch(t.type){case N.REQUEST_MANIFEST:return{[t.manifestId]:{...e[t.manifestId],...t.properties,id:t.manifestId},...ni(e,t.manifestId)};case N.RECEIVE_MANIFEST:return{...e,[t.manifestId]:{...e[t.manifestId],error:null,id:t.manifestId,isFetching:!1,json:t.manifestJson}};case N.RECEIVE_MANIFEST_FAILURE:return{...e,[t.manifestId]:{...e[t.manifestId],error:t.error,id:t.manifestId,isFetching:!1}};case N.REMOVE_MANIFEST:return Object.keys(e).reduce((n,r)=>(r!==t.manifestId&&(n[r]=e[r]),n),{});default:return e}},iO=(e={},t)=>{switch(t.type){case N.REQUEST_INFO_RESPONSE:return{...e,[t.infoId]:{id:t.infoId,isFetching:!0}};case N.RECEIVE_INFO_RESPONSE:return{...e,[t.infoId]:{degraded:!1,id:t.infoId,isFetching:!1,json:t.infoJson,tokenServiceId:t.tokenServiceId}};case N.RECEIVE_DEGRADED_INFO_RESPONSE:return{...e,[t.infoId]:{degraded:!0,id:t.infoId,isFetching:!1,json:t.infoJson,tokenServiceId:t.tokenServiceId}};case N.RECEIVE_INFO_RESPONSE_FAILURE:return{...e,[t.infoId]:{error:t.error,id:t.infoId,isFetching:!1,tokenServiceId:t.tokenServiceId}};case N.REMOVE_INFO_RESPONSE:return Object.keys(e).reduce((n,r)=>(r!==t.infoId&&(n[r]=e[r]),n),{});default:return e}},Yne={...uo},Xne=(e,t)=>t,oO=(e=Yne,t)=>{switch(t.type){case N.UPDATE_CONFIG:case N.IMPORT_CONFIG:return pl(e,t.config,{arrayMerge:Xne});case N.SET_CONFIG:return t.config;default:return e}},aO=(e={},t)=>{switch(t.type){case N.UPDATE_VIEWPORT:return{...e,[t.windowId]:{...e[t.windowId],...t.payload}};case N.REMOVE_WINDOW:return ni(e,t.windowId);case N.SET_WINDOW_VIEW_TYPE:return x0([t.windowId],null,e);case N.SET_CANVAS:return t.preserveViewport?e:x0([t.windowId],null,e);default:return e}},sO=(e={},t)=>{switch(t.type){case N.REQUEST_ANNOTATION:return{...e,[t.targetId]:{...e[t.targetId],[t.annotationId]:{id:t.annotationId,isFetching:!0}}};case N.RECEIVE_ANNOTATION:return{...e,[t.targetId]:{...e[t.targetId],[t.annotationId]:{id:t.annotationId,isFetching:!1,json:t.annotationJson}}};case N.RECEIVE_ANNOTATION_FAILURE:return{...e,[t.targetId]:{...e[t.targetId],[t.annotationId]:{error:t.error,id:t.annotationId,isFetching:!1}}};default:return e}},lO=(e={},t)=>{switch(t.type){case N.ADD_AUTHENTICATION_REQUEST:return{...e,[t.id]:{id:t.id,isFetching:!0,profile:t.profile,windowId:t.windowId}};case N.RESOLVE_AUTHENTICATION_REQUEST:return{...e,[t.id]:{...e[t.id],isFetching:!1,ok:t.ok}};case N.RECEIVE_ACCESS_TOKEN:return t.authId?{...e,[t.authId]:{...e[t.authId],ok:!0}}:e;case N.RESET_AUTHENTICATION_STATE:return ni(e,t.id);default:return e}},uO=(e={},t)=>{const n=(e[t.windowId]||{})[t.companionWindowId]||{};switch(t.type){case N.REQUEST_SEARCH:return n.query!==t.query?{...e,[t.windowId]:{...e[t.windowId],[t.companionWindowId]:{...n,data:{[t.searchId]:{isFetching:!0}},query:t.query,selectedContentSearchAnnotation:[]}}}:{...e,[t.windowId]:{...e[t.windowId],[t.companionWindowId]:{...n,data:{...n.data,[t.searchId]:{isFetching:!0}}}}};case N.RECEIVE_SEARCH:return{...e,[t.windowId]:{...e[t.windowId],[t.companionWindowId]:{...n,data:{...n.data,[t.searchId]:{isFetching:!1,json:t.searchJson}}}}};case N.RECEIVE_SEARCH_FAILURE:return{...e,[t.windowId]:{...e[t.windowId],[t.companionWindowId]:{...n,data:{...n.data,[t.searchId]:{error:t.error,isFetching:!1}}}}};case N.REMOVE_SEARCH:return{...e,[t.windowId]:Object.keys(e[t.windowId]).reduce((r,i)=>(i!==t.companionWindowId&&(r[i]=e[t.windowId][i]),r),{})};case N.SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS:return{...e,[t.windowId]:{...e[t.windowId],[t.companionWindowId]:{...n,selectedContentSearchAnnotationIds:t.annotationIds}}};case N.SELECT_ANNOTATION:return e[t.windowId]?{...e,[t.windowId]:Object.keys(e[t.windowId]).reduce((r,i)=>{const o=e[t.windowId][i];return o.data&&Object.values(o.data).filter(s=>s.json&&s.json.resources).some(s=>Pe([s.json.resources]).some(l=>l["@id"]===t.annotationId))?r[i]={...o,selectedContentSearchAnnotationIds:[t.annotationId]}:r[i]=o,r},{})}:e;case N.REMOVE_WINDOW:return ni(e,t.windowId);case N.REMOVE_COMPANION_WINDOW:return e[t.windowId]?{...e,[t.windowId]:{...ni(e[t.windowId],t.id)}}:e;default:return e}},cO=(e={},t)=>{switch(t.type){case N.UPDATE_LAYERS:return{...e,[t.windowId]:{...e[t.windowId],[t.canvasId]:pl((e[t.windowId]||{})[t.canvasId]||{},t.payload)}};case N.REMOVE_WINDOW:return ni(e,[t.windowId]);default:return e}},dO=(e=[],t)=>{switch(t.type){case N.ADD_RESOURCE:return e.some(n=>n.manifestId===t.manifestId)?e:[{manifestId:t.manifestId,...t.payload},...e];case N.ADD_WINDOW:return e.some(n=>n.manifestId===t.window.manifestId)?e:[{manifestId:t.window.manifestId},...e];case N.UPDATE_WINDOW:return!t.payload.manifestId||e.some(n=>n.manifestId===t.payload.manifestId)?e:[{manifestId:t.payload.manifestId},...e];case N.REMOVE_RESOURCE:return e.filter(n=>n.manifestId!==t.manifestId);case N.IMPORT_CONFIG:return t.config.catalog||[];default:return e}},Qne=Object.freeze(Object.defineProperty({__proto__:null,accessTokensReducer:HP,annotationsReducer:sO,authReducer:lO,catalogReducer:dO,companionWindowsReducer:JP,configReducer:oO,errorsReducer:eO,infoResponsesReducer:iO,layersReducer:cO,manifestsReducer:rO,searchesReducer:uO,viewersReducer:aO,windowsReducer:nO,workspaceReducer:tO},Symbol.toStringTag,{value:"Module"}));function Jne(e){return Im({accessTokens:HP,annotations:sO,auth:lO,catalog:dO,companionWindows:JP,config:oO,errors:eO,infoResponses:iO,layers:cO,manifests:rO,searches:uO,viewers:aO,windows:nO,workspace:tO,...e})}var fO=function(t){return{done:!0,value:t}},S0={};function ere(e){return e0(e)?"channel":X2(e)?String(e):_n(e)?e.name:String(e)}function tre(e,t,n){var r,i,o,a=t;function s(l,u){if(a===S0)return fO(l);if(u&&!i)throw a=S0,u;r&&r(l);var c=u?e[i](u):e[a]();return a=c.nextState,o=c.effect,r=c.stateUpdater,i=c.errorState,a===S0?fO(l):o}return n0(s,function(l){return s(null,l)},n)}function nre(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o={done:!1,value:AX(e)},a=function(c){return{done:!1,value:o0.apply(void 0,[t].concat(r,[c]))}},s,l=function(c){return s=c};return tre({q1:function(){return{nextState:"q2",effect:o,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:a(s)}}},"q1","takeEvery("+ere(e)+", "+t.name+")")}function dt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return o0.apply(void 0,[nre,e,t].concat(r))}const hO={content:null,position:null};function pO(e,t,n=hO){const r=`cw-${Dr()}`;return{id:r,payload:{...n,...t,id:r,windowId:e},type:N.ADD_COMPANION_WINDOW,windowId:e}}function gO(e,t,n=hO){return(r,i)=>{const o=i(),{position:a}=t,s=a==="left"&&cv(o,{position:a,windowId:e})[0];r(s?b0(e,s,t):pO(e,t,n))}}function b0(e,t,n){return{id:t,payload:n,type:N.UPDATE_COMPANION_WINDOW,windowId:e}}function rre(e,t){return{id:t,type:N.REMOVE_COMPANION_WINDOW,windowId:e}}function ire(e,t,n){return(r,i)=>{const o=i(),a=yo(o,{companionWindowId:t},!1),s=yo(o,{companionWindowId:t},!0),l=GS(o,{id:t,windowId:e}),u=a.indexOf(n)!==-1||s.indexOf(n)===-1&&l.indexOf(n)===-1;return r({id:t,payload:{[n]:{expanded:u}},type:N.TOGGLE_TOC_NODE,windowId:e})}}function ore(e,t,n){return(r,i)=>{const o=i(),a=yo(o,{companionWindowId:t},!0),s={};return a.forEach(l=>{s[l]={expanded:!1}}),n.forEach(l=>{s[l]={expanded:!0}}),r({id:t,payload:s,type:N.TOGGLE_TOC_NODE,windowId:e})}}function mO(e){return{config:e,type:N.IMPORT_CONFIG}}function are(e){return{config:e,type:N.SET_CONFIG}}function sre(e){return{config:e,type:N.UPDATE_CONFIG}}function lre(e){return{id:`error-${Dr()}`,message:e,type:N.ADD_ERROR}}function ure(e){return{id:e,type:N.REMOVE_ERROR}}function Xf(e,t=!1){return{pan:t,type:N.FOCUS_WINDOW,windowId:e}}function C0({companionWindows:e,manifest:t,...n}){return(r,i)=>{const{config:o,workspace:{windowIds:a=[]}}=Pt(i());a.length;const s=n.id||`window-${Dr()}`,l=`cw-${Dr()}`,u=[{content:"thumbnailNavigation",default:!0,id:l,position:n.thumbnailNavigationPosition||o.thumbnailNavigation.defaultPosition,windowId:s},...(e||[]).map((d,f)=>({...d,id:`cw-${Dr()}`}))];(n.sideBarPanel||o.window.defaultSideBarPanel||o.window.sideBarPanel)&&u.unshift({content:n.sideBarPanel||n.defaultSearchQuery&&"search"||o.window.defaultSideBarPanel||o.window.sideBarPanel,default:!0,id:`cw-${Dr()}`,position:"left",windowId:s});const c={canvasId:void 0,collectionIndex:0,companionAreaOpen:!0,companionWindowIds:u.map(d=>d.id),draggingEnabled:!0,highlightAllAnnotations:o.window.highlightAllAnnotations||!1,id:s,manifestId:null,maximized:!1,rangeId:null,rotation:null,selectedAnnotations:{},sideBarOpen:o.window.sideBarOpenByDefault!==void 0?o.window.sideBarOpenByDefault||!!n.defaultSearchQuery:o.window.sideBarOpen||!!n.defaultSearchQuery,sideBarPanel:n.sideBarPanel||o.window.defaultSideBarPanel||o.window.sideBarPanel,thumbnailNavigationId:l};r({companionWindows:u,manifest:t,type:N.ADD_WINDOW,window:{...c,...n}})}}function Qf(e,t){return{id:e,payload:t,type:N.UPDATE_WINDOW}}function cre(e,t){return{type:N.MAXIMIZE_WINDOW,windowId:e}}function dre(e){return{type:N.MINIMIZE_WINDOW,windowId:e}}function fre(e,t){return{id:e,payload:{companionAreaOpen:t},type:N.UPDATE_WINDOW}}function Jf(e){return{type:N.REMOVE_WINDOW,windowId:e}}function hre(e){return{type:N.TOGGLE_WINDOW_SIDE_BAR,windowId:e}}function pre(e,t){return(n,r)=>{const{windows:i}=r(),{thumbnailNavigationId:o}=i[e];n({id:o,payload:{position:t},type:N.UPDATE_COMPANION_WINDOW})}}function gre(e,t){return{type:N.SET_WINDOW_VIEW_TYPE,viewType:t,windowId:e}}function vO(e,t=[],n){return{collectionPath:t,manifestId:e,type:N.SHOW_COLLECTION_DIALOG,windowId:n}}function mre(e){return{type:N.HIDE_COLLECTION_DIALOG,windowId:e}}function yO(e,t){return{manifestId:e,properties:t,type:N.REQUEST_MANIFEST}}function eh(e,t){return{manifestId:e,manifestJson:t,type:N.RECEIVE_MANIFEST}}function wO(e,t){return{error:t,manifestId:e,type:N.RECEIVE_MANIFEST_FAILURE}}function vre(e,t){return yO(e,{...t,isFetching:!0})}function yre(e){return{manifestId:e,type:N.REMOVE_MANIFEST}}function _O(e,t,n){return{imageResource:t,infoId:e,type:N.REQUEST_INFO_RESPONSE,windowId:n}}function TO(e,t,n,r){return{infoId:e,infoJson:t,ok:n,tokenServiceId:r,type:N.RECEIVE_INFO_RESPONSE}}function EO(e,t,n,r,i){return{infoId:e,infoJson:t,ok:n,tokenServiceId:r,type:N.RECEIVE_DEGRADED_INFO_RESPONSE,windowId:i}}function xO(e,t,n){return{error:t,infoId:e,tokenServiceId:n,type:N.RECEIVE_INFO_RESPONSE_FAILURE}}function SO({imageId:e,imageResource:t,windowId:n}){const r=t&&t.getServices()[0],i=e||r.id;return _O(i,r,n)}function wre(e){return{infoId:e,type:N.REMOVE_INFO_RESPONSE}}function ki(e,t,n=void 0,r={}){return(i,o)=>{const a=o();let s=n;s||(s=(wv(a,{canvasId:t,windowId:e})||[]).map(u=>u.id)),i({...r,canvasId:t,type:N.SET_CANVAS,visibleCanvases:s,windowId:e})}}function _re(e){return(t,n)=>{const r=n(),i=SS(r,{windowId:e}),o=(i||[]).map(a=>a.id);i&&t(ki(e,o[0],o))}}function Tre(e){return(t,n)=>{const r=n(),i=bS(r,{windowId:e}),o=(i||[]).map(a=>a.id);i&&t(ki(e,o[0],o))}}function P0(e,t){return{payload:t,type:N.UPDATE_VIEWPORT,windowId:e}}function Ere(e){return{config:e,type:N.UPDATE_WORKSPACE}}function xre(e){return{showZoomControls:e,type:N.TOGGLE_ZOOM_CONTROLS}}function bO(e){return{layout:e,type:N.UPDATE_WORKSPACE_MOSAIC_LAYOUT}}function Sre(e){return{isWorkspaceAddVisible:e,type:N.SET_WORKSPACE_ADD_VISIBILITY}}function CO({x:e,y:t}){return{payload:{position:{x:e,y:t}},type:N.SET_WORKSPACE_VIEWPORT_POSITION}}function bre({width:e,height:t}){return{payload:{position:{height:t,width:e}},type:N.SET_WORKSPACE_VIEWPORT_POSITION}}function PO(e,t){return{canvasId:t,type:N.REQUEST_CANVAS_ANNOTATIONS,windowId:e}}function O0(e,t){return{annotationId:t,targetId:e,type:N.REQUEST_ANNOTATION}}function R0(e,t,n){return{annotationId:t,annotationJson:n,targetId:e,type:N.RECEIVE_ANNOTATION}}function OO(e,t,n){return{annotationId:t,error:n,targetId:e,type:N.RECEIVE_ANNOTATION_FAILURE}}function RO(e,t){return{annotationId:t,type:N.SELECT_ANNOTATION,windowId:e}}function Cre(e,t){return{annotationId:t,type:N.DESELECT_ANNOTATION,windowId:e}}function Pre(e){return{type:N.TOGGLE_ANNOTATION_DISPLAY,windowId:e}}function Ore(e,t){return{annotationIds:t,type:N.HOVER_ANNOTATION,windowId:e}}function IO(e,t,n=void 0){return{id:t,profile:n,type:N.ADD_AUTHENTICATION_REQUEST,windowId:e}}function I0(e,t,n){return{id:e,tokenServiceId:t,type:N.RESOLVE_AUTHENTICATION_REQUEST,...n}}function A0(e,t){return{authId:t,serviceId:e,type:N.REQUEST_ACCESS_TOKEN}}function AO(e,t,n){return{authId:e,json:n,serviceId:t,type:N.RECEIVE_ACCESS_TOKEN}}function DO(e,t,n){return{authId:e,error:n,serviceId:t,type:N.RECEIVE_ACCESS_TOKEN_FAILURE}}function Rre(e,t,n){return n.accessToken?AO(e,t,n):DO(e,t,n)}function MO({authServiceId:e,tokenServiceId:t}){return{id:e,tokenServiceId:t,type:N.RESET_AUTHENTICATION_STATE}}function NO(e,t,n,r){return{companionWindowId:t,query:r,searchId:n,type:N.REQUEST_SEARCH,windowId:e}}function LO(e,t,n,r){return{companionWindowId:t,searchId:n,searchJson:r,type:N.RECEIVE_SEARCH,windowId:e}}function kO(e,t,n,r){return{companionWindowId:t,error:r,searchId:n,type:N.RECEIVE_SEARCH_FAILURE,windowId:e}}function Ire(e,t){return{companionWindowId:t,type:N.REMOVE_SEARCH,windowId:e}}function FO(e,t,n,r){return NO(e,t,n,r)}function BO(e,t,n){return{annotationIds:n,companionWindowId:t,type:N.SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS,windowId:e}}function Are(e,t,n){return{canvasId:t,payload:n,type:N.UPDATE_LAYERS,windowId:e}}function Dre(e,t=void 0,n){return{manifestId:e,manifestJson:t,payload:n,type:N.ADD_RESOURCE}}function Mre(e){return{manifestId:e,type:N.REMOVE_RESOURCE}}const Nre=Object.freeze(Object.defineProperty({__proto__:null,addAuthenticationRequest:IO,addCompanionWindow:pO,addError:lre,addOrUpdateCompanionWindow:gO,addResource:Dre,addWindow:C0,deselectAnnotation:Cre,expandNodes:ore,fetchInfoResponse:SO,fetchManifest:vre,fetchSearch:FO,focusWindow:Xf,hideCollectionDialog:mre,hoverAnnotation:Ore,importConfig:mO,maximizeWindow:cre,minimizeWindow:dre,receiveAccessToken:AO,receiveAccessTokenFailure:DO,receiveAnnotation:R0,receiveAnnotationFailure:OO,receiveDegradedInfoResponse:EO,receiveInfoResponse:TO,receiveInfoResponseFailure:xO,receiveManifest:eh,receiveManifestFailure:wO,receiveSearch:LO,receiveSearchFailure:kO,removeCompanionWindow:rre,removeError:ure,removeInfoResponse:wre,removeManifest:yre,removeResource:Mre,removeSearch:Ire,removeWindow:Jf,requestAccessToken:A0,requestAnnotation:O0,requestCanvasAnnotations:PO,requestInfoResponse:_O,requestManifest:yO,requestSearch:NO,resetAuthenticationState:MO,resolveAccessTokenRequest:Rre,resolveAuthenticationRequest:I0,selectAnnotation:RO,setCanvas:ki,setCompanionAreaOpen:fre,setConfig:are,setContentSearchCurrentAnnotation:BO,setNextCanvas:_re,setPreviousCanvas:Tre,setWindowThumbnailPosition:pre,setWindowViewType:gre,setWorkspaceAddVisibility:Sre,setWorkspaceViewportDimensions:bre,setWorkspaceViewportPosition:CO,showCollectionDialog:vO,toggleAnnotationDisplay:Pre,toggleNode:ire,toggleWindowSideBar:hre,toggleZoomControls:xre,updateCompanionWindow:b0,updateConfig:sre,updateLayers:Are,updateViewport:P0,updateWindow:Qf,updateWorkspace:Ere,updateWorkspaceMosaicLayout:bO},Symbol.toStringTag,{value:"Module"}));function Lre(e,t,{success:n,degraded:r,failure:i}){return fetch(e,t).then(o=>o.json().then(a=>o.status===401?(r||n)({json:a,response:o}):o.ok?n({json:a,response:o}):i({error:o.statusText,json:a,response:o})).catch(a=>i({error:a,response:o}))).catch(o=>i({error:o}))}function*th(e,t,{success:n,degraded:r,failure:i}){const{preprocessors:o=[],postprocessors:a=[]}=yield Ue(gS);try{const s=o.reduce((u,c)=>c(e,u)||u,t);let l=yield Je(Lre,e,s,{degraded:r,failure:i,success:n});return l=a.reduce((u,c)=>c(e,u)||u,l),l}catch(s){return i({error:s})}}function*jO(e,t,n,{degraded:r,failure:i,success:o}){const a={...n};let s;if(t){const h=yield Je(WO,t);s=h&&h.id,h&&h.json&&(a.headers={Authorization:`Bearer ${h.json.accessToken}`,...n.headers})}const{error:l,json:u,response:c}=yield Je(th,e,a,{failure:h=>h,success:h=>h});if(l){yield Fe(i({error:l,json:u,response:c,tokenServiceId:s}));return}const d=u["@id"]||u.id;if(c.ok){if(Aa(d,{stripAuthentication:!1})===Aa(e.replace(/info\.json$/,""),{stripAuthentication:!1})){yield Fe(o({json:u,response:c,tokenServiceId:s}));return}}else if(c.status!==401){yield Fe(i({error:l,json:u,response:c,tokenServiceId:s}));return}const f=yield Je(WO,u);if(f&&f.id!==s){yield Je(jO,e,u,n,{degraded:r,failure:i,success:o});return}yield Fe((r||o)({json:u,response:c,tokenServiceId:s}))}function*D0({manifestId:e}){const n=yield Je(th,e,{},{failure:({error:r,json:i,response:o})=>wO(e,typeof r=="object"?String(r):r),success:({json:r,response:i})=>eh(e,r)});yield Fe(n)}function*WO(e){const t=e&&e.__jsonld?e:{...e,options:{}},n=pe.getServices(t).filter(i=>i.getProfile().match(/http:\/\/iiif.io\/api\/auth\//));if(n.length===0)return;const r=yield Ue(Rd);if(r)for(let i=0;i<n.length;i+=1){const o=n[i],a=pe.getService(o,"http://iiif.io/api/auth/1/token")||pe.getService(o,"http://iiif.io/api/auth/0/token"),s=a&&r[a.id];if(s&&s.json)return s}}function*zO({imageResource:e,infoId:t,windowId:n}){let r=e;r||(r=yield Ue(PS,{infoId:t}));const i={degraded:({json:o,response:a,tokenServiceId:s})=>EO(t,o,a.ok,s,n),failure:({error:o,json:a,response:s,tokenServiceId:l})=>xO(t,o,l),success:({json:o,response:a,tokenServiceId:s})=>TO(t,o,a.ok,s)};yield Je(jO,`${t.replace(/\/$/,"")}/info.json`,r,{},i)}function*kre({windowId:e,companionWindowId:t,query:n,searchId:r}){const o=yield Je(th,r,{},{failure:({error:a,json:s,response:l})=>kO(e,t,r,a),success:({json:a,response:s})=>LO(e,t,r,a)});yield Fe(o)}function*Fre({targetId:e,annotationId:t}){const r=yield Je(th,t,{},{failure:({error:i,json:o,response:a})=>OO(e,t,i),success:({json:i,response:o})=>R0(e,t,i)});yield Fe(r)}function*Bre({manifestId:e,manifestJson:t}){if(t){yield Fe(eh(e,t));return}if(!e)return;(yield Ue(vd)||{})[e]||(yield*D0({manifestId:e}))}function*M0(...e){const t=yield Ue(vd);for(let n=0;n<e.length;n+=1){const r=e[n];t[r]||(yield Je(D0,{manifestId:r}))}}function*jre(){yield cn([dt(N.REQUEST_MANIFEST,D0),dt(N.REQUEST_INFO_RESPONSE,zO),dt(N.REQUEST_SEARCH,kre),dt(N.REQUEST_ANNOTATION,Fre),dt(N.ADD_RESOURCE,Bre)])}function*HO(e){const{collectionPath:t,id:n,manifestId:r}=e.payload||e.window;r&&(e.manifest?yield Fe(eh(r,e.manifest)):yield Je(M0,r,...t||[]),yield Je(Ure,e),yield Je(Vre,e),t||(yield Je(zre,{manifestId:r,windowId:e.id||e.window.id})),yield Je(Xre,r,n))}function*Wre(e){const t=e.id;if(!e||!e.payload||!e.payload.sequenceId)return;const n=yield Ue(Lr,{windowId:t});if(!n||!n[0]||!n[0].id)return;const r=yield Je(ki,t,n[0].id);yield Fe(r)}function*zre({manifestId:e,windowId:t}){const n=yield Ue(ct,{manifestId:e});if(n){const r=n.getProperty("partOf"),i=Array.isArray(r)?r[0]:r;i&&i.id&&(yield Fe(Qf(t,{collectionPath:[i.id]})))}}function*Hre(e){const{collectionPath:t}=e.payload;t&&(yield Je(M0,...t))}function*Ure(e){const{canvasId:t,canvasIndex:n,manifestId:r}=e.payload||e.window,i=e.id||e.window.id;if(t){const o=yield Je(ki,i,t,null,{preserveViewport:!!e.payload});yield Fe(o)}else{const o=yield Ue(ct,{manifestId:r});if(o){const a=new aS(o),s=a.startCanvas||a.canvasAt(n||0)||a.canvasAt(0);if(s){const l=yield Je(ki,i,s.id);yield Fe(l)}}}}function*Vre(e){if(!e.window||!e.window.defaultSearchQuery)return;const{id:t,defaultSearchQuery:n}=e.window,r=yield Ue(hv,{windowId:t}),o=(yield Ue(cv,{position:"left",windowId:t}))[0];if(r&&o){const a=r&&`${r.id}?q=${n}`;yield Fe(FO(t,o,a,n))}}function Gre(e,{canvasIds:t,companionWindowIds:n,windowId:r}){return n.reduce((o,a)=>{const u=Pd(e,{companionWindowId:a,windowId:r}).resources.find(c=>t.includes(c.targetId));return u&&(o[a]=[u.id]),o},{})}function*$re({annotationId:e,windowId:t,visibleCanvases:n}){const r=yield Ue(Cd,{windowId:t}),i=Object.keys(r||{});if(i.length===0)return;const o=yield Ue(Gre,{canvasIds:n,companionWindowIds:i,windowId:t});yield cn(Object.keys(o).map(a=>Fe(BO(t,a,o[a])))),Object.values(o).length>0&&(yield Fe(RO(t,Object.values(o)[0][0])))}function*qre({pan:e,windowId:t}){if(!e)return;const{x:n,y:r,width:i,height:o}={},{viewportPosition:{width:a,height:s}}=yield Ue(Nn);yield Fe(CO({x:n+i/2-a/2,y:r+o/2-s/2}))}function*Zre({windowId:e}){const{canvasId:t}=yield Ue(yt,{windowId:e}),n=yield Ue(wv,{canvasId:t,windowId:e});yield Fe(Qf(e,{visibleCanvases:(n||[]).map(r=>r.id)}))}function*Kre({annotationId:e,windowId:t}){const n=yield Ue(Di,{windowId:t}),r=yield Ue(LS,{annotationId:e,windowId:t});if(!r||n.includes(r.id))return;const i=yield Je(ki,t,r.id);yield Fe(i)}function*Yre({visibleCanvases:e,windowId:t}){const n=yield Ue(Lr,{windowId:t}),r=yield Ue(Ia),i=(n||[]).filter(o=>e.includes(o.id));yield cn(i.map(o=>{const a=new Wt(o);return cn(a.iiifImageResources.map(s=>!r[s.getServices()[0].id]&&Fe(SO({imageResource:s,windowId:t}))).filter(Boolean))}))}function*Xre(e,t){const n=yield Ue(ct,{manifestId:e});n&&n.isCollection()&&(yield Fe(vO(e,[],t)))}function*Qre(){yield cn([dt(N.ADD_WINDOW,HO),dt(N.UPDATE_WINDOW,HO),dt(N.UPDATE_WINDOW,Wre),dt(N.SET_CANVAS,$re),dt(N.SET_CANVAS,Yre),dt(N.UPDATE_COMPANION_WINDOW,Hre),dt(N.SET_WINDOW_VIEW_TYPE,Zre),dt(N.SELECT_ANNOTATION,Kre),dt(N.FOCUS_WINDOW,qre)])}function*Jre({config:{thumbnailNavigation:e,windows:t}}){if(!t||t.length===0)return;const n=yield cn(t.map(r=>{const i=`window-${Dr()}`,o=r.manifestId||r.loadedManifest;return Je(C0,{id:i,manifestId:o,thumbnailNavigationPosition:e&&e.defaultPosition,...r})}));yield cn(n.map(r=>Fe(r)))}function*eie(e){const{collectionPath:t,manifestId:n}=e;yield Je(M0,n,...t)}function*tie(){yield cn([dt(N.IMPORT_CONFIG,Jre),dt(N.SHOW_COLLECTION_DIALOG,eie)])}function*nie({canvasId:e,windowId:t}){const n=yield Ue(Ai,{canvasId:e,windowId:t}),r=yield Ue(bd),i=new Wt(n);return yield cn([...i.annotationListUris.filter(o=>!(r[n.id]&&r[n.id][o])).map(o=>Fe(O0(n.id,o))),...i.canvasAnnotationPages.filter(o=>!(r[n.id]&&r[n.id][o.id])).map(o=>o.items?Fe(R0(n.id,o.id,o)):Fe(O0(n.id,o.id)))])}function*rie({visibleCanvases:e=[],windowId:t}){return yield cn(e.map(n=>Fe(PO(t,n))))}function*iie(){yield cn([dt(N.REQUEST_CANVAS_ANNOTATIONS,nie),dt(N.SET_CANVAS,rie)])}function*oie({tokenServiceId:e}){yield MX(2e3),yield Je(UO,{serviceId:e})}function*UO({serviceId:e}){const t=yield Ue(mo),n=yield cn(Object.keys(t).map(s=>Ue(Mi,{windowId:s}))),r=Pe(Pe(n).map(s=>new Wt(s).imageServiceIds)),i=yield Ue(Ia),o=s=>pe.getServices(s).some(u=>{const c=pe.getService(u,"http://iiif.io/api/auth/1/token")||pe.getService(u,"http://iiif.io/api/auth/0/token");return c&&c.id===e}),a=Object.values(i).filter(s=>s.json&&o(s.json));yield cn(a.map(({id:s})=>r.includes(s)?Je(zO,{infoId:s}):Fe({infoId:s,type:N.REMOVE_INFO_RESPONSE})))}function*aie({infoJson:e,windowId:t}){const n=yield Ue(Id),{auth:{serviceProfiles:r=[]}={}}=yield Ue(Ie),i=r.filter(s=>s.external||s.kiosk),o=pe.getServices(e).filter(s=>!n[s.id]).find(s=>i.some(l=>l.profile===s.getProfile()));if(!o)return;const a=i.find(s=>s.profile===o.getProfile());if(a.kiosk)yield Fe(IO(t,o.id,o.getProfile()));else if(a.external){const s=pe.getService(o,"http://iiif.io/api/auth/1/token")||pe.getService(o,"http://iiif.io/api/auth/0/token");if(!s)return;yield Fe(I0(o.id,s.id)),yield Fe(A0(s.id,o.id))}}function*sie({infoJson:e,windowId:t,tokenServiceId:n}){if(!n)return;const r=pe.getServices(e).find(a=>{const s=pe.getService(a,"http://iiif.io/api/auth/1/token")||pe.getService(a,"http://iiif.io/api/auth/0/token");return s&&s.id===n});if(!r)return;const o=(yield Ue(Rd))[n];o&&o.success&&(yield Fe(A0(n,r.id)))}function*lie({serviceId:e}){const t=yield Ue(Rd),n=yield Ue(Id),r=t[e];if(!r)return;const i=n[r.authId];i&&(r.success?yield Fe(MO({authServiceId:i.id,tokenServiceId:r.id})):yield Fe(I0(i.id,r.id,{ok:!1})))}function*uie(){yield cn([dt(N.RECEIVE_DEGRADED_INFO_RESPONSE,sie),dt(N.RECEIVE_ACCESS_TOKEN_FAILURE,lie),dt(N.RECEIVE_DEGRADED_INFO_RESPONSE,aie),dt(N.RECEIVE_ACCESS_TOKEN,UO),dt(N.RESET_AUTHENTICATION_STATE,oie)])}function*cie(e){for(;;)try{yield Je(e);break}catch(t){console.log(t)}}function VO(e=[]){return function*(){const n=[iie,tie,jre,Qre,uie,...e];yield cn(n.map(r=>DX(cie,r)))}}const die=Object.freeze(Object.defineProperty({__proto__:null,default:VO},Symbol.toStringTag,{value:"Module"}));function GO(e,t=[]){const n=Jne(e),r=uo.state.slice?Im({[uo.state.slice]:n}):n,i=hQ(),o=JY({reducer:r,middleware:a=>a({serializableCheck:!1}).concat(j2,i)});return i.run(VO(t)),o}function fie(e,t=[]){const n=C2(t),r=GO(MY(n),LY(n));return r.dispatch(mO(pl(NY(n),e))),r}class hie{constructor(t,n={}){if(t.debugMode&&console.log({config:t,viewerConfig:n}),this.plugins=C2(n.plugins||[]),this.config=t,this.store=n.store||fie(this.config,this.plugins),t.id){this.container=document.getElementById(t.id);const r=document.createElement("div");r.style.width="100%",r.style.height="100%",r.style.position="relative",r.className="ngtv-wrapper",this.container.parentNode.insertBefore(r,this.container),r.appendChild(this.container),this.root=CE(this.container),this.root.render(this.render()),this.config.ngtvLayout==="overlay"&&this.initFocusTrap(),document.dispatchEvent(new CustomEvent("tv-opened"))}}initFocusTrap(){if(!this.container)return;const t=n=>{if(n.key!=="Tab"&&n.key!=="ArrowLeft"&&n.key!=="ArrowRight")return;const r='a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])',o=`.${ve("window")}`,s=Array.from(this.container.querySelectorAll(o)).flatMap(h=>{const g=ve("pop-up"),p=`.${g}`,v=`.${g}.open`,m=h.querySelector(v);return Array.from(h.querySelectorAll(r)).filter(E=>!E.hasAttribute("disabled")&&E.tabIndex!==-1?m?E.closest(v)===m:!E.closest(p):!1).filter(E=>{if(E.type==="radio"){const b=document.querySelectorAll(`input[name='${E.name}']`),R=Array.from(b).find(M=>M.checked);return R?R===E:b[0]===E}else return E.type==="button"?E.getAttribute("role")==="tab"?E.classList.contains("active"):!0:E})});if(this.config.debugMode&&console.log({focusableElements:s}),s.length===0)return;const l=document.activeElement;let c=s.indexOf(l),d=0;const f=s.length;if(n.key==="Tab"){do n.shiftKey?c=c>0?c-1:s.length-1:c=c<s.length-1?c+1:0,d++;while(s[c].classList.contains("state-disabled")&&d<f);n.preventDefault(),this.config.debugMode&&console.log({focusOn:s[c]}),s[c].focus()}if(l.getAttribute("role")==="tab"&&(n.key==="ArrowRight"||n.key==="ArrowLeft")){const h=l.closest('[role="tablist"]');if(!h)return;const g=Array.from(h.querySelectorAll('[role="tab"]')),p=g.indexOf(l);if(p===-1)return;let v=p;n.key==="ArrowRight"?v=(p+1)%g.length:n.key==="ArrowLeft"&&(v=(p-1+g.length)%g.length);const m=g[v];n.preventDefault(),m.focus(),m.click()}};this.container.addEventListener("keydown",t),this.cleanupFocusTrap=()=>{this.container.removeEventListener("keydown",t)}}deactivateFocusTrap(){this.cleanupFocusTrap&&(this.cleanupFocusTrap(),this.cleanupFocusTrap=null)}render(t={}){const n=this.closeThisApp.bind(this);return this.config.ngtvLayout==="banner"?S.jsx(Df,{children:S.jsx(Em,{store:this.store,children:S.jsx(S$,{...t})})}):this.config.ngtvLayout==="overlay"?S.jsx(Df,{children:S.jsx(Em,{store:this.store,children:S.jsx(E2,{...t,closeTheApp:n})})}):S.jsx(Df,{children:S.jsx(Em,{store:this.store,children:S.jsx(kD,{plugins:this.plugins,...t,closeTheApp:n})})})}unmount(){this.deactivateFocusTrap(),this.root&&this.root.unmount()}closeThisApp(){document.dispatchEvent(new CustomEvent("tv-closing")),this.root&&this.unmount(),this.config.closeId&&(document.getElementById(this.config.closeId).remove(),this.root=null,this.container=null),document.dispatchEvent(new CustomEvent("tv-closed"))}}const $O={preload:!1,visibilityRatio:.5,minPixelRatio:.5,minZoomImageRatio:.9,maxZoomPixelRatio:1.1,smoothTileEdgesMinZoom:1.1,autoResize:!0,preserveImageSizeOnResize:!0,showZoomControl:!1,immediateRender:!1,mouseNavEnabled:!0,imageLoaderLimit:0,maxImageCacheCount:200,opacity:1,degrees:0,flipped:!1,panHorizontal:!0,panVertical:!0,constrainDuringPan:!1,wrapHorizontal:!1,wrapVertical:!1,imageSmoothingEnabled:!0,alwaysBlend:!1,blendTime:.1,clickTimeThreshold:300,clickDistThreshold:5,dblClickTimeThreshold:300,dblClickDistThreshold:20,springStiffness:6.5,minScrollDeltaTime:50,rotationIncrement:90,animationTime:1.2,timeout:3e4,tileRetryMax:0,tileRetryDelay:2500,sequenceMode:!1,showNavigationControl:!1,showNavigator:!1,collectionMode:!1,crossOriginPolicy:"Anonymous",ajaxWithCredentials:!1,loadTilesWithAjax:!1,ajaxHeaders:{},splitHashDataForPost:!1,debugMode:!1,silenceMultiImageWarnings:!1,pixelsPerWheelLine:40,pixelsPerArrowPress:40,zoomPerClick:1.8,zoomPerScroll:1.1,zoomPerDblClickDrag:1.2,zoomPerSecond:1,gestureSettingsMouse:{dragToPan:!0,scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsTouch:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!0,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsPen:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsUnknown:{dragToPan:!0,scrollToZoom:!0,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!1,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1}},pie={visibilityRatio:.85,defaultZoomLevel:0,immediateRender:!0,blendTime:0,minPixelRatio:.75,minZoomImageRatio:.75,maxZoomPixelRatio:1,showNavigationControl:!0,showZoomControl:!0,showHomeControl:!1,showFullPageControl:!1},gie={visibilityRatio:1,minZoomImageRatio:.75,maxZoomPixelRatio:1,smoothTileEdgesMinZoom:1.1,immediateRender:!0,blendTime:0,minPixelRatio:.75};function mie(e){const t={...e};return(e.ngtvLayout==="banner"||e.ngtvLayout==="overlay")&&(t.windows=e.windows.slice(0,1)),t}function vie(e,t){if(!e.windows||e.windows.length===0){console.log("An error occurred: Initial config error: Must pass at least one item in windows array in config.");return}var n=mie(e);if(e.ngtvLayout!=="banner"&&e.ngtvLayout!=="overlay"){console.log('An error occurred: Initial config error: Only supported modes are "banner" and "overlay".');return}e.debugMode&&console.log({location:"In src/viewer/TheViewer: validated input config",validConfig:n});var r={};n.ngtvLayout==="banner"?r={selectedTheme:"dark",osdConfig:{...$O,...pie,...n.osdConfig}}:n.ngtvLayout==="overlay"&&(r={selectedTheme:"dark",window:{showManifestUrl:e.window!==void 0&&e.window.showManifestUrl!==void 0?e.window.showManifestUrl:!0},osdConfig:{...$O,...gie,...n.osdConfig}});let i;Array.isArray(t)?i={plugins:t}:i=t;var o={...n,...r};return e.debugMode&&console.log({location:"In src/viewer/TheViewer: create TVViewer instance config",finalConfig:o,struct:i}),new hie(o,i)}const yie={...{TheViewer:vie},...{actions:Nre,configureTVStore:GO,reducers:Qne,sagas:die,selectors:Y7}};function Tn(e){return iG(e)}function wie(e){return ln("MuiPaper",e)}yn("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const _ie=["className","component","elevation","square","variant"],Tie=e=>{const{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return wn(o,wie,i)},Eie=ie("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return j({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&j({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${_o("#fff",IC(t.elevation))}, ${_o("#fff",IC(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),nh=x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,u=Ne(r,_ie),c=j({},r,{component:o,elevation:a,square:s,variant:l}),d=Tie(c);return S.jsx(Eie,j({as:o,ownerState:c,className:$e(d.root,i),ref:n},u))});var Ut={},xie=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ut,"__esModule",{value:!0});var N0=Ut.MosaicWindowContext=Ut.MosaicContext=void 0,qO=xie(x);Ut.MosaicContext=qO.default.createContext(void 0),N0=Ut.MosaicWindowContext=qO.default.createContext(void 0);var ZO={exports:{}};(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(o=i(o,r(s)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var s in o)t.call(o,s)&&o[s]&&(a=i(a,s));return a}function i(o,a){return a?o?o+" "+a:o+a:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ZO);var Wn=ZO.exports;const je=He(Wn);var Sie=sn,bie=function(){return Sie.Date.now()},Cie=bie,Pie=Qn,L0=Cie,KO=Ly,Oie="Expected a function",Rie=Math.max,Iie=Math.min;function Aie(e,t,n){var r,i,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(Oie);t=KO(t)||0,Pie(n)&&(c=!!n.leading,d="maxWait" in n,o=d?Rie(KO(n.maxWait)||0,t):o,f="trailing" in n?!!n.trailing:f);function h(M){var C=r,D=i;return r=i=void 0,u=M,a=e.apply(D,C),a}function g(M){return u=M,s=setTimeout(m,t),c?h(M):a}function p(M){var C=M-l,D=M-u,F=t-C;return d?Iie(F,o-D):F}function v(M){var C=M-l,D=M-u;return l===void 0||C>=t||C<0||d&&D>=o}function m(){var M=L0();if(v(M))return y(M);s=setTimeout(m,p(M))}function y(M){return s=void 0,f&&r?h(M):(r=i=void 0,a)}function E(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function b(){return s===void 0?a:y(L0())}function R(){var M=L0(),C=v(M);if(r=arguments,i=this,l=M,C){if(s===void 0)return g(l);if(d)return clearTimeout(s),s=setTimeout(m,t),h(l)}return s===void 0&&(s=setTimeout(m,t)),a}return R.cancel=E,R.flush=b,R}var YO=Aie;const Ul=He(YO),XO=ie("div")(({theme:e})=>({position:"relative",width:"100%",height:"100%",backgroundColor:e.custom.dialog.backsplashColour})),QO=ie("div")({position:"absolute",bottom:0,left:0,right:0,top:0}),JO=ie("div",{shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",backgroundPosition:"center",backgroundSize:"cover",backgroundRepeat:"no-repeat",...(e==null?void 0:e.imgPath)&&{backgroundImage:`url(${e.imgPath})`},"& img":{maxWidth:"100%",maxHeight:"100%",padding:"1rem"}}));let eR=class extends x.Component{constructor(t){super(t)}render(){const{loadSize:t,nonTiledImages:n,focalPoint:r}=this.props,i=(r.left*100).toString()+"%",o=(r.top*100).toString()+"%";return t==="cover"?S.jsx(XO,{className:je(ve("static-img-container")),children:S.jsx(QO,{children:S.jsx(JO,{layoutDef:{imgPath:n[0].id},style:{backgroundPositionX:i,backgroundPositionY:o}})})}):S.jsx(XO,{className:je(ve("static-img-container")),children:S.jsx(QO,{children:S.jsx(JO,{layoutDef:{},children:S.jsx("img",{src:n[0].id,alt:""})})})})}};eR.propTypes={loadSize:A.string,windowId:A.string,nonTiledImages:A.array,altText:A.string,focalPoint:A.shape({left:A.number,top:A.number})};const Die=Me(Qe((e,{windowId:t})=>{const n=yt(e,{windowId:t}),r=Ie(e).window;return{loadSize:n.size===void 0?r.size:n.size,nonTiledImages:Sd(e,{windowId:t}),altText:Ra(e,{windowId:t}),focalPoint:n.focalPt===void 0?r.focalPt:n.focalPt}}))(eR),tR=x.lazy(()=>Promise.resolve().then(()=>ove));tR.displayName="WindowViewer";const nR=ie("div")({display:"flex",flex:1,position:"relative"});let rR=class extends x.Component{constructor(t){super(t),this.state={meWidth:0,meHeight:0},this.onResizeHandler=Ul(this.onResizeHandler.bind(this),67),this.componentRef=x.createRef()}componentDidMount(){window.addEventListener("resize",this.onResizeHandler),this.onResizeHandler()}componentWillUnmount(){window.removeEventListener("resize",this.onResizeHandler)}onResizeHandler(){if(this.componentRef.current){const t=this.componentRef.current.getBoundingClientRect();this.setState({meWidth:t.width,meHeight:t.height})}}render(){const{className:t=void 0,isFetching:n=!1,windowId:r,isNonZoomableSource:i=!1}=this.props;if(n===!1){if(i===!0)return S.jsx(nR,{className:je(ve("primary-display"),t),children:S.jsx(Die,{windowId:r})});{const{meWidth:o,meHeight:a}=this.state;return S.jsx(nR,{className:je(ve("primary-window"),t),ref:this.componentRef,children:S.jsx(tR,{windowId:r,windowWidth:o,windowHeight:a})})}}return null}};rR.propTypes={className:A.string,isFetching:A.bool,windowId:A.string.isRequired,isNonZoomableSource:A.bool};const Mie=Me(Qe((e,{windowId:t})=>({isNonZoomableSource:Sd(e,{windowId:t}).length>0})))(rR);let iR=class extends x.Component{render(){const{error:t,metadata:n=null,isDebugMode:r}=this.props;if(r)return console.log(`TV error occurred: 
Error name: `+t.name+`
Error message: `+t.message+`
Stack trace:`+t.stack+`
Metadata: `+JSON.stringify(n,null,2)),S.jsx(S.Fragment,{})}};iR.propTypes={error:A.object.isRequired,metadata:A.object,isDebugMode:A.bool};const rh=Me(Qe((e,{companionWindowId:t,windowId:n})=>({metadata:{companionWindow:t&&wd(e,{companionWindowId:t}),manifest:dl(e,{windowId:n}),viewer:md(e,{windowId:n}),window:yt(e,{windowId:n})},isDebugMode:Ie(e).debugMode})),gt("ErrorContent"))(iR),Nie=ie(nh)(({theme:e})=>({display:"flex",flex:"1",flexDirection:"column",minHeight:0,backgroundColor:e.palette.canvasBg.main,backgroundImage:"none",boxShadow:"none",borderRadius:0,height:"100%",overflow:"hidden",width:"100%"})),Lie=ie(Mie)({display:"flex",flex:"1",flexDirection:"row",minHeight:0,height:"300px",position:"relative"});let k0=class extends x.Component{constructor(t){super(t),this.state={}}static getDerivedStateFromError(t){return{error:t,hasError:!0}}render(){const{focusWindow:t=()=>{},label:n=null,isFetching:r=!1,windowId:i,manifestError:o}=this.props,{error:a,hasError:s}=this.state;return s?S.jsx(rh,{error:a,windowId:i}):S.jsxs(Nie,{id:i,"aria-label":`Window: ${n}`,className:ve("window"),component:"section",elevation:1,onFocus:t,children:[o&&S.jsx(rh,{error:{stack:o},windowId:i}),S.jsx(Lie,{windowId:i,isFetching:r})]})}};k0.contextType=N0,k0.propTypes={focusWindow:A.func,isFetching:A.bool,label:A.string,manifestError:A.string,windowId:A.string.isRequired};const kie=Me(Qe((e,{windowId:t})=>({isFetching:dv(e,{windowId:t}).isFetching,label:Ra(e,{windowId:t}),manifestError:fv(e,{windowId:t})}),(e,{windowId:t})=>({focusWindow:()=>e(Xf(t))})))(k0),Fie=ie("div")({height:"100%",position:"relative",width:"100%"});let oR=class extends x.Component{render(){const{workspaceId:t,windowIds:n=[]}=this.props;return S.jsx(Fie,{ownerState:this.props,className:ve("workspace"),children:n.map(r=>S.jsx(kie,{windowId:r},`${r}-${t}`))})}};oR.propTypes={windowIds:A.arrayOf(A.string),workspaceId:A.string.isRequired};const Bie=Me(Qe(e=>({windowIds:Ca(e),workspaceId:Nn(e).id})))(oR),jie=ie("div")(({theme:e})=>({position:"absolute",bottom:0,left:0,right:0,top:0,display:"flex",flexDirection:"column",[e.breakpoints.up("sm")]:{flexDirection:"row"}})),Wie=ie("div")({flexGrow:1,position:"relative"}),zie=ie("p")({width:"1px !important",height:"1px !important",padding:"0 !important",margin:"-1px !important",overflow:"hidden !important",clip:"rect(0, 0, 0, 0) !important",whiteSpace:"nowrap !important",border:"0 !important"});let aR=class extends x.Component{render(){const{areaRef:t=null}=this.props;return S.jsx(jie,{ownerState:this.props,className:ve("workspace-area"),children:S.jsxs(Wie,{className:ve("viewer-area"),"aria-label":"Workspace",...t?{ref:t}:{},children:[S.jsx(zie,{children:"This is an image viewer. Image is displayed within canvas area. You can use mouse, touch, or keyboard to manipulate the image. With keyboard, while focused on canvas area, use arrows to pan the image, and use a combination of Shift and either arrow up or down to zoom in and out."}),S.jsx(Bie,{})]})})}};aR.propTypes={areaRef:A.shape({current:A.instanceOf(Element)})};const Hie=Object.freeze(Object.defineProperty({__proto__:null,default:aR},Symbol.toStringTag,{value:"Module"}));function Uie(e){return ln("MuiToolbar",e)}yn("MuiToolbar",["root","gutters","regular","dense"]);const Vie=["className","component","disableGutters","variant"],Gie=e=>{const{classes:t,disableGutters:n,variant:r}=e;return wn({root:["root",!n&&"gutters",r]},Uie,t)},$ie=ie("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(({theme:e,ownerState:t})=>j({position:"relative",display:"flex",alignItems:"center"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},t.variant==="dense"&&{minHeight:48}),({theme:e,ownerState:t})=>t.variant==="regular"&&e.mixins.toolbar),sR=x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:a=!1,variant:s="regular"}=r,l=Ne(r,Vie),u=j({},r,{component:o,disableGutters:a,variant:s}),c=Gie(u);return S.jsx($ie,j({as:o,className:$e(c.root,i),ref:n,ownerState:u},l))});function qie(e){return ln("MuiAppBar",e)}yn("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Zie=["className","color","enableColorOnDark","position"],Kie=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${Ce(t)}`,`position${Ce(n)}`]};return wn(i,qie,r)},ih=(e,t)=>e?`${e==null?void 0:e.replace(")","")}, ${t})`:t,Yie=ie(nh,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ce(n.position)}`],t[`color${Ce(n.color)}`]]}})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return j({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},t.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},t.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="static"&&{position:"static"},t.position==="relative"&&{position:"relative"},!e.vars&&j({},t.color==="default"&&{backgroundColor:n,color:e.palette.getContrastText(n)},t.color&&t.color!=="default"&&t.color!=="inherit"&&t.color!=="transparent"&&{backgroundColor:e.palette[t.color].main,color:e.palette[t.color].contrastText},t.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!t.enableColorOnDark&&{backgroundColor:null,color:null},t.color==="transparent"&&j({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&j({},t.color==="default"&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette.AppBar.defaultBg:ih(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":t.enableColorOnDark?e.vars.palette.text.primary:ih(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},t.color&&!t.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette[t.color].main:ih(e.vars.palette.AppBar.darkBg,e.vars.palette[t.color].main),"--AppBar-color":t.enableColorOnDark?e.vars.palette[t.color].contrastText:ih(e.vars.palette.AppBar.darkColor,e.vars.palette[t.color].contrastText)},!["inherit","transparent"].includes(t.color)&&{backgroundColor:"var(--AppBar-background)"},{color:t.color==="inherit"?"inherit":"var(--AppBar-color)"},t.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),lR=x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:a=!1,position:s="fixed"}=r,l=Ne(r,Zie),u=j({},r,{color:o,position:s,enableColorOnDark:a}),c=Kie(u);return S.jsx(Yie,j({square:!0,component:"header",ownerState:u,elevation:4,className:$e(c.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),Xie=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M11.2667 1.0125C11.2667 0.453312 11.7099 0 12.2567 0C12.8034 0 13.2467 0.453312 13.2467 1.0125V22.9875C13.2467 23.5467 12.8034 24 12.2567 24C11.7099 24 11.2667 23.5467 11.2667 22.9875V1.0125Z",fill:"white"}),x.createElement("path",{d:"M22.01 10.5C22.5568 10.5 23 10.9533 23 11.5125C23 12.0717 22.5568 12.525 22.01 12.525L1.99 12.525C1.44324 12.525 1 12.0717 1 11.5125C1 10.9533 1.44324 10.5 1.99 10.5L22.01 10.5Z",fill:"white"})),Qie=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M11.2667 1.0125C11.2667 0.453312 11.7099 0 12.2567 0C12.8034 0 13.2467 0.453312 13.2467 1.0125V22.9875C13.2467 23.5467 12.8034 24 12.2567 24C11.7099 24 11.2667 23.5467 11.2667 22.9875V1.0125Z",fill:"black"}),x.createElement("path",{d:"M22.01 10.5C22.5568 10.5 23 10.9533 23 11.5125C23 12.0717 22.5568 12.525 22.01 12.525L1.99 12.525C1.44324 12.525 1 12.0717 1 11.5125C1 10.9533 1.44324 10.5 1.99 10.5L22.01 10.5Z",fill:"black"})),Jie=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M11.2667 1.0125C11.2667 0.453312 11.7099 0 12.2567 0C12.8034 0 13.2467 0.453312 13.2467 1.0125V22.9875C13.2467 23.5467 12.8034 24 12.2567 24C11.7099 24 11.2667 23.5467 11.2667 22.9875V1.0125Z",fill:"#7A7A7A"}),x.createElement("path",{d:"M22.01 10.5C22.5568 10.5 23 10.9533 23 11.5125C23 12.0717 22.5568 12.525 22.01 12.525L1.99 12.525C1.44324 12.525 1 12.0717 1 11.5125C1 10.9533 1.44324 10.5 1.99 10.5L22.01 10.5Z",fill:"#7A7A7A"}));function uR({theme:e,state:t,...n}){const r=t==="disabled"&&e==="dark"?Jie:e==="light"?Qie:Xie;return S.jsx(r,{...n})}uR.propTypes={theme:A.string.isRequired,state:A.string};const eoe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("rect",{y:11,width:24,height:2,rx:1,fill:"white"})),toe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("rect",{y:11,width:24,height:2,rx:1,fill:"black"})),noe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("rect",{y:11,width:24,height:2,rx:1,fill:"#7A7A7A"}));function cR({theme:e,state:t,...n}){const r=t==="disabled"&&e==="dark"?noe:e==="light"?toe:eoe;return S.jsx(r,{...n})}cR.propTypes={theme:A.string.isRequired,state:A.string};const roe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{id:"Path",fillRule:"evenodd",clipRule:"evenodd",d:"M1 12C1 6.11841 5.78499 1.25 11.6667 1.25C17.5484 1.25 22.3333 6.11841 22.3333 12C22.3333 17.8816 17.5484 22.75 11.6667 22.75C5.78499 22.75 1 17.8816 1 12Z",stroke:"white"}),x.createElement("path",{id:"Path_2",fillRule:"evenodd",clipRule:"evenodd",d:"M10.5781 17.9883H12.4219V9.61881H10.5781V17.9883Z",fill:"white"}),x.createElement("path",{id:"Path_3",fillRule:"evenodd",clipRule:"evenodd",d:"M10.5781 8.09152H12.4219V6.01172H10.5781V8.09152Z",fill:"white"})),ioe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 12C1 6.11841 5.78499 1.25 11.6667 1.25C17.5484 1.25 22.3333 6.11841 22.3333 12C22.3333 17.8816 17.5484 22.75 11.6667 22.75C5.78499 22.75 1 17.8816 1 12Z",stroke:"black"}),x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5781 17.9883H12.4219V9.61881H10.5781V17.9883Z",fill:"black"}),x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5781 8.09152H12.4219V6.01172H10.5781V8.09152Z",fill:"black"}));function dR({theme:e,...t}){const n=e==="light"?ioe:roe;return S.jsx(n,{...t})}dR.propTypes={theme:A.string.isRequired};const ooe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M24.5 10.6625V22.2017C24.5 23.184 23.6967 23.9828 22.6985 23.9993C22.6878 24 22.6763 24 22.6656 24H2.33439C2.32522 24 2.31605 24 2.30688 23.9993C1.30637 23.985 0.5 23.1855 0.5 22.2017V10.682C0.5 10.186 0.91121 9.78283 1.4172 9.78283C1.67096 9.78283 1.90025 9.88323 2.06611 10.0466C2.23197 10.2092 2.33439 10.434 2.33439 10.682V22.2864H22.6656V10.6625C22.6656 10.4137 22.768 10.1889 22.9346 10.0264C23.1005 9.86375 23.3298 9.76335 23.5828 9.76335C24.0896 9.76335 24.5 10.1657 24.5 10.6625Z",fill:"white"}),x.createElement("path",{d:"M22.6985 23.9993L22.6656 24C22.6763 24 22.6878 24 22.6985 23.9993Z",fill:"white"}),x.createElement("path",{d:"M17.6355 14.4202L13.1825 18.7856C12.9991 18.9655 12.7576 19.0531 12.5168 19.0486C12.5405 19.0479 12.5642 19.0464 12.5879 19.0449C12.5627 19.0471 12.5375 19.0479 12.5122 19.0486H12.5C12.4702 19.0486 12.4411 19.0471 12.4121 19.0449C12.3831 19.0419 12.354 19.0374 12.325 19.0322C12.3158 19.0307 12.3059 19.0284 12.2967 19.0262C12.2883 19.0247 12.2799 19.0224 12.2707 19.0202C12.2562 19.0164 12.2417 19.0127 12.2271 19.0082C12.2134 19.0037 12.1989 18.9992 12.1851 18.9939C12.1752 18.9909 12.1652 18.9872 12.1553 18.9827C12.1431 18.9782 12.1316 18.973 12.1201 18.9677C12.0911 18.955 12.062 18.9407 12.0345 18.9243C12.0269 18.9205 12.02 18.916 12.0131 18.9115C11.9963 18.901 11.9795 18.8905 11.9634 18.8786C11.9611 18.8786 11.9596 18.8763 11.9581 18.8748C11.9474 18.8673 11.9367 18.8598 11.9268 18.8508C11.9008 18.8313 11.8755 18.8089 11.8518 18.7856L7.39885 14.4202C7.04038 14.0688 7.04038 13.4993 7.39885 13.1479C7.57771 12.9726 7.81236 12.8849 8.04701 12.8849C8.28166 12.8849 8.51631 12.9726 8.69592 13.1479L11.5828 15.9788V0.899157C11.5828 0.402373 11.994 0 12.5 0C12.7538 0 12.9831 0.100406 13.1489 0.263003C13.3148 0.425601 13.4172 0.65039 13.4172 0.899157V16.0125L16.3385 13.1479C16.5173 12.9726 16.7527 12.8849 16.9866 12.8849C17.2205 12.8849 17.4559 12.9726 17.6355 13.1479C17.994 13.4993 17.994 14.0688 17.6355 14.4202Z",fill:"white"})),aoe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M24.5 10.6625V22.2017C24.5 23.184 23.6967 23.9828 22.6985 23.9993C22.6878 24 22.6763 24 22.6656 24H2.33439C2.32522 24 2.31605 24 2.30688 23.9993C1.30637 23.985 0.5 23.1855 0.5 22.2017V10.682C0.5 10.186 0.91121 9.78283 1.4172 9.78283C1.67096 9.78283 1.90025 9.88323 2.06611 10.0466C2.23197 10.2092 2.33439 10.434 2.33439 10.682V22.2864H22.6656V10.6625C22.6656 10.4137 22.768 10.1889 22.9346 10.0264C23.1005 9.86375 23.3298 9.76335 23.5828 9.76335C24.0896 9.76335 24.5 10.1657 24.5 10.6625Z",fill:"black"}),x.createElement("path",{d:"M22.6985 23.9993L22.6656 24C22.6763 24 22.6878 24 22.6985 23.9993Z",fill:"black"}),x.createElement("path",{d:"M17.6355 14.4202L13.1825 18.7856C12.9991 18.9655 12.7576 19.0531 12.5168 19.0486C12.5405 19.0479 12.5642 19.0464 12.5879 19.0449C12.5627 19.0471 12.5375 19.0479 12.5122 19.0486H12.5C12.4702 19.0486 12.4411 19.0471 12.4121 19.0449C12.3831 19.0419 12.354 19.0374 12.325 19.0322C12.3158 19.0307 12.3059 19.0284 12.2967 19.0262C12.2883 19.0247 12.2799 19.0224 12.2707 19.0202C12.2562 19.0164 12.2417 19.0127 12.2271 19.0082C12.2134 19.0037 12.1989 18.9992 12.1851 18.9939C12.1752 18.9909 12.1652 18.9872 12.1553 18.9827C12.1431 18.9782 12.1316 18.973 12.1201 18.9677C12.0911 18.955 12.062 18.9407 12.0345 18.9243C12.0269 18.9205 12.02 18.916 12.0131 18.9115C11.9963 18.901 11.9795 18.8905 11.9634 18.8786C11.9611 18.8786 11.9596 18.8763 11.9581 18.8748C11.9474 18.8673 11.9367 18.8598 11.9268 18.8508C11.9008 18.8313 11.8755 18.8089 11.8518 18.7856L7.39885 14.4202C7.04038 14.0688 7.04038 13.4993 7.39885 13.1479C7.57771 12.9726 7.81236 12.8849 8.04701 12.8849C8.28166 12.8849 8.51631 12.9726 8.69592 13.1479L11.5828 15.9788V0.899157C11.5828 0.402373 11.994 0 12.5 0C12.7538 0 12.9831 0.100406 13.1489 0.263003C13.3148 0.425601 13.4172 0.65039 13.4172 0.899157V16.0125L16.3385 13.1479C16.5173 12.9726 16.7527 12.8849 16.9866 12.8849C17.2205 12.8849 17.4559 12.9726 17.6355 13.1479C17.994 13.4993 17.994 14.0688 17.6355 14.4202Z",fill:"black"})),soe=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M24.5 10.6625V22.2017C24.5 23.184 23.6967 23.9828 22.6985 23.9993C22.6878 24 22.6763 24 22.6656 24H2.33439C2.32522 24 2.31605 24 2.30688 23.9993C1.30637 23.985 0.5 23.1855 0.5 22.2017V10.682C0.5 10.186 0.91121 9.78283 1.4172 9.78283C1.67096 9.78283 1.90025 9.88323 2.06611 10.0466C2.23197 10.2092 2.33439 10.434 2.33439 10.682V22.2864H22.6656V10.6625C22.6656 10.4137 22.768 10.1889 22.9346 10.0264C23.1005 9.86375 23.3298 9.76335 23.5828 9.76335C24.0896 9.76335 24.5 10.1657 24.5 10.6625Z",fill:"#4D68B7"}),x.createElement("path",{d:"M22.6985 23.9993L22.6656 24C22.6763 24 22.6878 24 22.6985 23.9993Z",fill:"#4D68B7"}),x.createElement("path",{d:"M17.6355 14.4202L13.1825 18.7856C12.9991 18.9655 12.7576 19.0531 12.5168 19.0486C12.5405 19.0479 12.5642 19.0464 12.5879 19.0449C12.5627 19.0471 12.5375 19.0479 12.5122 19.0486H12.5C12.4702 19.0486 12.4411 19.0471 12.4121 19.0449C12.3831 19.0419 12.354 19.0374 12.325 19.0322C12.3158 19.0307 12.3059 19.0284 12.2967 19.0262C12.2883 19.0247 12.2799 19.0224 12.2707 19.0202C12.2562 19.0164 12.2417 19.0127 12.2271 19.0082C12.2134 19.0037 12.1989 18.9992 12.1851 18.9939C12.1752 18.9909 12.1652 18.9872 12.1553 18.9827C12.1431 18.9782 12.1316 18.973 12.1201 18.9677C12.0911 18.955 12.062 18.9407 12.0345 18.9243C12.0269 18.9205 12.02 18.916 12.0131 18.9115C11.9963 18.901 11.9795 18.8905 11.9634 18.8786C11.9611 18.8786 11.9596 18.8763 11.9581 18.8748C11.9474 18.8673 11.9367 18.8598 11.9268 18.8508C11.9008 18.8313 11.8755 18.8089 11.8518 18.7856L7.39885 14.4202C7.04038 14.0688 7.04038 13.4993 7.39885 13.1479C7.57771 12.9726 7.81236 12.8849 8.04701 12.8849C8.28166 12.8849 8.51631 12.9726 8.69592 13.1479L11.5828 15.9788V0.899157C11.5828 0.402373 11.994 0 12.5 0C12.7538 0 12.9831 0.100406 13.1489 0.263003C13.3148 0.425601 13.4172 0.65039 13.4172 0.899157V16.0125L16.3385 13.1479C16.5173 12.9726 16.7527 12.8849 16.9866 12.8849C17.2205 12.8849 17.4559 12.9726 17.6355 13.1479C17.994 13.4993 17.994 14.0688 17.6355 14.4202Z",fill:"#4D68B7"}));function F0({theme:e,appearance:t,...n}){const r=t==="link"?soe:e==="light"?aoe:ooe;return S.jsx(r,{...n})}F0.propTypes={theme:A.string.isRequired,appearance:A.string};const loe=ie("button")(({ownerState:e,theme:t})=>({padding:"4px 12px",fontSize:"16px",lineHeight:1,boxShadow:"none",borderStyle:"solid",borderWidth:"2px",borderRadius:"4px",color:t.palette.btnTxt.main,borderColor:t.palette.btnBorder.main,backgroundColor:t.palette.btnBg.main,"&:hover":{backgroundColor:t.palette.btnBg.light},"&:focus:focus-visible, &:focus-visible, &:focus":{outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"1px",outlineColor:t.palette.btnOutline.main,WebkitOutlineColor:"-webkit-focus-ring-color"},...e.active&&{backgroundColor:t.palette.btnBg.active,borderColor:t.palette.btnBorder.active},...e.appearance==="tab"&&{padding:"4px 2px 0px 2px",height:"37px",fontWeight:700,borderWidth:0,backgroundColor:"transparent",borderBottomWidth:"2px",borderRadius:0,borderBottomColor:e.theme==="light"?t.custom.dialog.background:t.custom.dialog.darkBackground,color:e.theme==="light"?t.custom.dialog.tabTxtColour:t.custom.dialog.darkTabTxtColour,"&:not(:last-child)":{marginRight:"20px"},"&:not([disabled]):not(.state-disabled):hover":{backgroundColor:"transparent"},"&:not([disabled]):not(.state-disabled):focus, &:not([disabled]):not(.state-disabled):focus:focus-visible, &:not([disabled]):not(.state-disabled):focus-visible":{backgroundColor:"transparent",outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"1px",outlineColor:t.palette.btnOutline.main,WebkitOutlineColor:"-webkit-focus-ring-color"},"&.active":{color:e.theme==="light"?t.custom.dialog.tabTxtColourActive:t.custom.dialog.darkTabTxtColourActive,borderBottomColor:e.theme==="light"?t.custom.dialog.tabTxtColourActive:t.custom.dialog.darkTabTxtColourActive}}}));function fR({label:e,size:t,active:n=!1,appearance:r="",theme:i,labelSm:o="",sx:a={},...s}){return S.jsxs(loe,{className:je(ve("btn-txt"),ve("btn-"+t)),type:"button",role:r==="tab"?"tab":void 0,"aria-selected":r==="tab"&&n?!0:void 0,ownerState:{active:n,size:t,appearance:r,theme:i},sx:a,...s,children:[o===""&&S.jsx(S.Fragment,{children:e}),o!==""&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"d-sm-none",children:e}),S.jsx("span",{className:"d-none d-sm-inline",children:o})]})]})}fR.propTypes={label:A.string.isRequired,size:A.string,appearance:A.string,active:A.bool,sx:A.object,theme:A.string,labelSm:A.string};const Ka=Me(Sf,gt("TVTxtBtn"))(fR);function B0(e,t){return B0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},B0(e,t)}function hR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,B0(e,t)}const pR={disabled:!1},oh=Cr.createContext(null);var uoe=function(t){return t.scrollTop},Vl="unmounted",Co="exited",Po="entering",Ya="entered",j0="exiting",ri=function(e){hR(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Co,o.appearStatus=Po):l=Ya:r.unmountOnExit||r.mountOnEnter?l=Vl:l=Co,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Vl?{status:Co}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Po&&a!==Ya&&(o=Po):(a===Po||a===Ya)&&(o=j0)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Po){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Hc.findDOMNode(this);a&&uoe(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Co&&this.setState({status:Vl})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Hc.findDOMNode(this),s],u=l[0],c=l[1],d=this.getTimeouts(),f=s?d.appear:d.enter;if(!i&&!a||pR.disabled){this.safeSetState({status:Ya},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:Po},function(){o.props.onEntering(u,c),o.onTransitionEnd(f,function(){o.safeSetState({status:Ya},function(){o.props.onEntered(u,c)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Hc.findDOMNode(this);if(!o||pR.disabled){this.safeSetState({status:Co},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:j0},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Co},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Hc.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Vl)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=Ne(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Cr.createElement(oh.Provider,{value:null},typeof a=="function"?a(i,s):Cr.cloneElement(Cr.Children.only(a),s))},t}(Cr.Component);ri.contextType=oh,ri.propTypes={};function Xa(){}ri.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xa,onEntering:Xa,onEntered:Xa,onExit:Xa,onExiting:Xa,onExited:Xa},ri.UNMOUNTED=Vl,ri.EXITED=Co,ri.ENTERING=Po,ri.ENTERED=Ya,ri.EXITING=j0;function coe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W0(e,t){var n=function(o){return t&&x.isValidElement(o)?t(o):o},r=Object.create(null);return e&&x.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function doe(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),i=[];for(var o in e)o in t?i.length&&(r[o]=i,i=[]):i.push(o);var a,s={};for(var l in t){if(r[l])for(a=0;a<r[l].length;a++){var u=r[l][a];s[r[l][a]]=n(u)}s[l]=n(l)}for(a=0;a<i.length;a++)s[i[a]]=n(i[a]);return s}function Oo(e,t,n){return n[t]!=null?n[t]:e.props[t]}function foe(e,t){return W0(e.children,function(n){return x.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Oo(n,"appear",e),enter:Oo(n,"enter",e),exit:Oo(n,"exit",e)})})}function hoe(e,t,n){var r=W0(e.children),i=doe(t,r);return Object.keys(i).forEach(function(o){var a=i[o];if(x.isValidElement(a)){var s=o in t,l=o in r,u=t[o],c=x.isValidElement(u)&&!u.props.in;l&&(!s||c)?i[o]=x.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:Oo(a,"exit",e),enter:Oo(a,"enter",e)}):!l&&s&&!c?i[o]=x.cloneElement(a,{in:!1}):l&&s&&x.isValidElement(u)&&(i[o]=x.cloneElement(a,{onExited:n.bind(null,a),in:u.props.in,exit:Oo(a,"exit",e),enter:Oo(a,"enter",e)}))}}),i}var poe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},goe={component:"div",childFactory:function(t){return t}},z0=function(e){hR(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=o.handleExited.bind(coe(o));return o.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},o}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,o){var a=o.children,s=o.handleExited,l=o.firstRender;return{children:l?foe(i,s):hoe(i,a,s),firstRender:!1}},n.handleExited=function(i,o){var a=W0(this.props.children);i.key in a||(i.props.onExited&&i.props.onExited(o),this.mounted&&this.setState(function(s){var l=j({},s.children);return delete l[i.key],{children:l}}))},n.render=function(){var i=this.props,o=i.component,a=i.childFactory,s=Ne(i,["component","childFactory"]),l=this.state.contextValue,u=poe(this.state.children).map(a);return delete s.appear,delete s.enter,delete s.exit,o===null?Cr.createElement(oh.Provider,{value:l},u):Cr.createElement(oh.Provider,{value:l},Cr.createElement(o,s,u))},t}(Cr.Component);z0.propTypes={},z0.defaultProps=goe;const moe=e=>e.scrollTop;function gR(e,t){var n,r;const{timeout:i,easing:o,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[t.mode]:o,delay:a.transitionDelay}}const voe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function H0(e){return`scale(${e}, ${e**2})`}const yoe={entering:{opacity:1,transform:H0(1)},entered:{opacity:1,transform:"none"}},U0=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),V0=x.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:a,in:s,onEnter:l,onEntered:u,onEntering:c,onExit:d,onExited:f,onExiting:h,style:g,timeout:p="auto",TransitionComponent:v=ri}=t,m=Ne(t,voe),y=Ba(),E=x.useRef(),b=SC(),R=x.useRef(null),M=Ni(R,hy(o),n),C=X=>re=>{if(X){const fe=R.current;re===void 0?X(fe):X(fe,re)}},D=C(c),F=C((X,re)=>{moe(X);const{duration:fe,delay:H,easing:Y}=gR({style:g,timeout:p,easing:a},{mode:"enter"});let ae;p==="auto"?(ae=b.transitions.getAutoHeightDuration(X.clientHeight),E.current=ae):ae=fe,X.style.transition=[b.transitions.create("opacity",{duration:ae,delay:H}),b.transitions.create("transform",{duration:U0?ae:ae*.666,delay:H,easing:Y})].join(","),l&&l(X,re)}),L=C(u),B=C(h),z=C(X=>{const{duration:re,delay:fe,easing:H}=gR({style:g,timeout:p,easing:a},{mode:"exit"});let Y;p==="auto"?(Y=b.transitions.getAutoHeightDuration(X.clientHeight),E.current=Y):Y=re,X.style.transition=[b.transitions.create("opacity",{duration:Y,delay:fe}),b.transitions.create("transform",{duration:U0?Y:Y*.666,delay:U0?fe:fe||Y*.333,easing:H})].join(","),X.style.opacity=0,X.style.transform=H0(.75),d&&d(X)}),$=C(f),de=X=>{p==="auto"&&y.start(E.current||0,X),r&&r(R.current,X)};return S.jsx(v,j({appear:i,in:s,nodeRef:R,onEnter:F,onEntered:L,onEntering:D,onExit:z,onExited:$,onExiting:B,addEndListener:de,timeout:p==="auto"?null:p},m,{children:(X,re)=>x.cloneElement(o,j({style:j({opacity:0,transform:H0(.75),visibility:X==="exited"&&!s?"hidden":void 0},yoe[X],g,o.props.style),ref:M},re))}))});V0.muiSupportAuto=!0;var G0={};Object.defineProperty(G0,"__esModule",{value:!0});var mR=G0.default=void 0,woe=Toe(x),_oe=CC;function vR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vR=function(r){return r?n:t})(e)}function Toe(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vR(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Eoe(e){return Object.keys(e).length===0}function xoe(e=null){const t=woe.useContext(_oe.ThemeContext);return!t||Eoe(t)?e:t}mR=G0.default=xoe;var En="top",or="bottom",ar="right",xn="left",$0="auto",Gl=[En,or,ar,xn],Qa="start",$l="end",Soe="clippingParents",yR="viewport",ql="popper",boe="reference",wR=Gl.reduce(function(e,t){return e.concat([t+"-"+Qa,t+"-"+$l])},[]),_R=[].concat(Gl,[$0]).reduce(function(e,t){return e.concat([t,t+"-"+Qa,t+"-"+$l])},[]),Coe="beforeRead",Poe="read",Ooe="afterRead",Roe="beforeMain",Ioe="main",Aoe="afterMain",Doe="beforeWrite",Moe="write",Noe="afterWrite",Loe=[Coe,Poe,Ooe,Roe,Ioe,Aoe,Doe,Moe,Noe];function jr(e){return e?(e.nodeName||"").toLowerCase():null}function zn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ro(e){var t=zn(e).Element;return e instanceof t||e instanceof Element}function sr(e){var t=zn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function q0(e){if(typeof ShadowRoot>"u")return!1;var t=zn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function koe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!sr(o)||!jr(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function Foe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!sr(i)||!jr(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Boe={name:"applyStyles",enabled:!0,phase:"write",fn:koe,effect:Foe,requires:["computeStyles"]};function Wr(e){return e.split("-")[0]}var Io=Math.max,ah=Math.min,Ja=Math.round;function Z0(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function TR(){return!/^((?!chrome|android).)*safari/i.test(Z0())}function es(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&sr(e)&&(i=e.offsetWidth>0&&Ja(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ja(r.height)/e.offsetHeight||1);var a=Ro(e)?zn(e):window,s=a.visualViewport,l=!TR()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function K0(e){var t=es(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function ER(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&q0(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ii(e){return zn(e).getComputedStyle(e)}function joe(e){return["table","td","th"].indexOf(jr(e))>=0}function Fi(e){return((Ro(e)?e.ownerDocument:e.document)||window.document).documentElement}function sh(e){return jr(e)==="html"?e:e.assignedSlot||e.parentNode||(q0(e)?e.host:null)||Fi(e)}function xR(e){return!sr(e)||ii(e).position==="fixed"?null:e.offsetParent}function Woe(e){var t=/firefox/i.test(Z0()),n=/Trident/i.test(Z0());if(n&&sr(e)){var r=ii(e);if(r.position==="fixed")return null}var i=sh(e);for(q0(i)&&(i=i.host);sr(i)&&["html","body"].indexOf(jr(i))<0;){var o=ii(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Zl(e){for(var t=zn(e),n=xR(e);n&&joe(n)&&ii(n).position==="static";)n=xR(n);return n&&(jr(n)==="html"||jr(n)==="body"&&ii(n).position==="static")?t:n||Woe(e)||t}function Y0(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Kl(e,t,n){return Io(e,ah(t,n))}function zoe(e,t,n){var r=Kl(e,t,n);return r>n?n:r}function SR(){return{top:0,right:0,bottom:0,left:0}}function bR(e){return Object.assign({},SR(),e)}function CR(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Hoe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,bR(typeof t!="number"?t:CR(t,Gl))};function Uoe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Wr(n.placement),l=Y0(s),u=[xn,ar].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var d=Hoe(i.padding,n),f=K0(o),h=l==="y"?En:xn,g=l==="y"?or:ar,p=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],v=a[l]-n.rects.reference[l],m=Zl(o),y=m?l==="y"?m.clientHeight||0:m.clientWidth||0:0,E=p/2-v/2,b=d[h],R=y-f[c]-d[g],M=y/2-f[c]/2+E,C=Kl(b,M,R),D=l;n.modifiersData[r]=(t={},t[D]=C,t.centerOffset=C-M,t)}}function Voe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||ER(t.elements.popper,i)&&(t.elements.arrow=i))}const Goe={name:"arrow",enabled:!0,phase:"main",fn:Uoe,effect:Voe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ts(e){return e.split("-")[1]}var $oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qoe(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ja(n*i)/i||0,y:Ja(r*i)/i||0}}function PR(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=a.x,h=f===void 0?0:f,g=a.y,p=g===void 0?0:g,v=typeof c=="function"?c({x:h,y:p}):{x:h,y:p};h=v.x,p=v.y;var m=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),E=xn,b=En,R=window;if(u){var M=Zl(n),C="clientHeight",D="clientWidth";if(M===zn(n)&&(M=Fi(n),ii(M).position!=="static"&&s==="absolute"&&(C="scrollHeight",D="scrollWidth")),M=M,i===En||(i===xn||i===ar)&&o===$l){b=or;var F=d&&M===R&&R.visualViewport?R.visualViewport.height:M[C];p-=F-r.height,p*=l?1:-1}if(i===xn||(i===En||i===or)&&o===$l){E=ar;var L=d&&M===R&&R.visualViewport?R.visualViewport.width:M[D];h-=L-r.width,h*=l?1:-1}}var B=Object.assign({position:s},u&&$oe),z=c===!0?qoe({x:h,y:p},zn(n)):{x:h,y:p};if(h=z.x,p=z.y,l){var $;return Object.assign({},B,($={},$[b]=y?"0":"",$[E]=m?"0":"",$.transform=(R.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",$))}return Object.assign({},B,(t={},t[b]=y?p+"px":"",t[E]=m?h+"px":"",t.transform="",t))}function Zoe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Wr(t.placement),variation:ts(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,PR(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,PR(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Koe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Zoe,data:{}};var lh={passive:!0};function Yoe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=zn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,lh)}),s&&l.addEventListener("resize",n.update,lh),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,lh)}),s&&l.removeEventListener("resize",n.update,lh)}}const Xoe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Yoe,data:{}};var Qoe={left:"right",right:"left",bottom:"top",top:"bottom"};function uh(e){return e.replace(/left|right|bottom|top/g,function(t){return Qoe[t]})}var Joe={start:"end",end:"start"};function OR(e){return e.replace(/start|end/g,function(t){return Joe[t]})}function X0(e){var t=zn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Q0(e){return es(Fi(e)).left+X0(e).scrollLeft}function eae(e,t){var n=zn(e),r=Fi(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=TR();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Q0(e),y:l}}function tae(e){var t,n=Fi(e),r=X0(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Io(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Io(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Q0(e),l=-r.scrollTop;return ii(i||n).direction==="rtl"&&(s+=Io(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function J0(e){var t=ii(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function RR(e){return["html","body","#document"].indexOf(jr(e))>=0?e.ownerDocument.body:sr(e)&&J0(e)?e:RR(sh(e))}function Yl(e,t){var n;t===void 0&&(t=[]);var r=RR(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=zn(r),a=i?[o].concat(o.visualViewport||[],J0(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Yl(sh(a)))}function e1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function nae(e,t){var n=es(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function IR(e,t,n){return t===yR?e1(eae(e,n)):Ro(t)?nae(t,n):e1(tae(Fi(e)))}function rae(e){var t=Yl(sh(e)),n=["absolute","fixed"].indexOf(ii(e).position)>=0,r=n&&sr(e)?Zl(e):e;return Ro(r)?t.filter(function(i){return Ro(i)&&ER(i,r)&&jr(i)!=="body"}):[]}function iae(e,t,n,r){var i=t==="clippingParents"?rae(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=IR(e,u,r);return l.top=Io(c.top,l.top),l.right=ah(c.right,l.right),l.bottom=ah(c.bottom,l.bottom),l.left=Io(c.left,l.left),l},IR(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function AR(e){var t=e.reference,n=e.element,r=e.placement,i=r?Wr(r):null,o=r?ts(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case En:l={x:a,y:t.y-n.height};break;case or:l={x:a,y:t.y+t.height};break;case ar:l={x:t.x+t.width,y:s};break;case xn:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Y0(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Qa:l[u]=l[u]-(t[c]/2-n[c]/2);break;case $l:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Xl(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?Soe:s,u=n.rootBoundary,c=u===void 0?yR:u,d=n.elementContext,f=d===void 0?ql:d,h=n.altBoundary,g=h===void 0?!1:h,p=n.padding,v=p===void 0?0:p,m=bR(typeof v!="number"?v:CR(v,Gl)),y=f===ql?boe:ql,E=e.rects.popper,b=e.elements[g?y:f],R=iae(Ro(b)?b:b.contextElement||Fi(e.elements.popper),l,c,a),M=es(e.elements.reference),C=AR({reference:M,element:E,strategy:"absolute",placement:i}),D=e1(Object.assign({},E,C)),F=f===ql?D:M,L={top:R.top-F.top+m.top,bottom:F.bottom-R.bottom+m.bottom,left:R.left-F.left+m.left,right:F.right-R.right+m.right},B=e.modifiersData.offset;if(f===ql&&B){var z=B[i];Object.keys(L).forEach(function($){var de=[ar,or].indexOf($)>=0?1:-1,X=[En,or].indexOf($)>=0?"y":"x";L[$]+=z[X]*de})}return L}function oae(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?_R:l,c=ts(r),d=c?s?wR:wR.filter(function(g){return ts(g)===c}):Gl,f=d.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=d);var h=f.reduce(function(g,p){return g[p]=Xl(e,{placement:p,boundary:i,rootBoundary:o,padding:a})[Wr(p)],g},{});return Object.keys(h).sort(function(g,p){return h[g]-h[p]})}function aae(e){if(Wr(e)===$0)return[];var t=uh(e);return[OR(e),t,OR(t)]}function sae(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,g=h===void 0?!0:h,p=n.allowedAutoPlacements,v=t.options.placement,m=Wr(v),y=m===v,E=l||(y||!g?[uh(v)]:aae(v)),b=[v].concat(E).reduce(function(be,te){return be.concat(Wr(te)===$0?oae(t,{placement:te,boundary:c,rootBoundary:d,padding:u,flipVariations:g,allowedAutoPlacements:p}):te)},[]),R=t.rects.reference,M=t.rects.popper,C=new Map,D=!0,F=b[0],L=0;L<b.length;L++){var B=b[L],z=Wr(B),$=ts(B)===Qa,de=[En,or].indexOf(z)>=0,X=de?"width":"height",re=Xl(t,{placement:B,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),fe=de?$?ar:xn:$?or:En;R[X]>M[X]&&(fe=uh(fe));var H=uh(fe),Y=[];if(o&&Y.push(re[z]<=0),s&&Y.push(re[fe]<=0,re[H]<=0),Y.every(function(be){return be})){F=B,D=!1;break}C.set(B,Y)}if(D)for(var ae=g?3:1,Te=function(te){var q=b.find(function(ee){var se=C.get(ee);if(se)return se.slice(0,te).every(function(ce){return ce})});if(q)return F=q,"break"},Se=ae;Se>0;Se--){var oe=Te(Se);if(oe==="break")break}t.placement!==F&&(t.modifiersData[r]._skip=!0,t.placement=F,t.reset=!0)}}const lae={name:"flip",enabled:!0,phase:"main",fn:sae,requiresIfExists:["offset"],data:{_skip:!1}};function DR(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function MR(e){return[En,ar,or,xn].some(function(t){return e[t]>=0})}function uae(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Xl(t,{elementContext:"reference"}),s=Xl(t,{altBoundary:!0}),l=DR(a,r),u=DR(s,i,o),c=MR(l),d=MR(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const cae={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:uae};function dae(e,t,n){var r=Wr(e),i=[xn,En].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[xn,ar].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function fae(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=_R.reduce(function(c,d){return c[d]=dae(d,t.rects,o),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const hae={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:fae};function pae(e){var t=e.state,n=e.name;t.modifiersData[n]=AR({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const gae={name:"popperOffsets",enabled:!0,phase:"read",fn:pae,data:{}};function mae(e){return e==="x"?"y":"x"}function vae(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,g=n.tetherOffset,p=g===void 0?0:g,v=Xl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),m=Wr(t.placement),y=ts(t.placement),E=!y,b=Y0(m),R=mae(b),M=t.modifiersData.popperOffsets,C=t.rects.reference,D=t.rects.popper,F=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,L=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),B=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,z={x:0,y:0};if(M){if(o){var $,de=b==="y"?En:xn,X=b==="y"?or:ar,re=b==="y"?"height":"width",fe=M[b],H=fe+v[de],Y=fe-v[X],ae=h?-D[re]/2:0,Te=y===Qa?C[re]:D[re],Se=y===Qa?-D[re]:-C[re],oe=t.elements.arrow,be=h&&oe?K0(oe):{width:0,height:0},te=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:SR(),q=te[de],ee=te[X],se=Kl(0,C[re],be[re]),ce=E?C[re]/2-ae-se-q-L.mainAxis:Te-se-q-L.mainAxis,Be=E?-C[re]/2+ae+se+ee+L.mainAxis:Se+se+ee+L.mainAxis,qe=t.elements.arrow&&Zl(t.elements.arrow),Ae=qe?b==="y"?qe.clientTop||0:qe.clientLeft||0:0,Ze=($=B==null?void 0:B[b])!=null?$:0,Vn=fe+ce-Ze-Ae,xt=fe+Be-Ze,Sn=Kl(h?ah(H,Vn):H,fe,h?Io(Y,xt):Y);M[b]=Sn,z[b]=Sn-fe}if(s){var w,O=b==="x"?En:xn,k=b==="x"?or:ar,V=M[R],Q=R==="y"?"height":"width",le=V+v[O],G=V-v[k],me=[En,xn].indexOf(m)!==-1,xe=(w=B==null?void 0:B[R])!=null?w:0,De=me?le:V-C[Q]-D[Q]-xe+L.altAxis,we=me?V+C[Q]+D[Q]-xe-L.altAxis:G,Ke=h&&me?zoe(De,V,we):Kl(h?De:le,V,h?we:G);M[R]=Ke,z[R]=Ke-V}t.modifiersData[r]=z}}const yae={name:"preventOverflow",enabled:!0,phase:"main",fn:vae,requiresIfExists:["offset"]};function wae(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _ae(e){return e===zn(e)||!sr(e)?X0(e):wae(e)}function Tae(e){var t=e.getBoundingClientRect(),n=Ja(t.width)/e.offsetWidth||1,r=Ja(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Eae(e,t,n){n===void 0&&(n=!1);var r=sr(t),i=sr(t)&&Tae(t),o=Fi(t),a=es(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((jr(t)!=="body"||J0(o))&&(s=_ae(t)),sr(t)?(l=es(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Q0(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function xae(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Sae(e){var t=xae(e);return Loe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function bae(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Cae(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var NR={placement:"bottom",modifiers:[],strategy:"absolute"};function LR(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Pae(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?NR:i;return function(s,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},NR,o),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(m){var y=typeof m=="function"?m(c.options):m;p(),c.options=Object.assign({},o,c.options,y),c.scrollParents={reference:Ro(s)?Yl(s):s.contextElement?Yl(s.contextElement):[],popper:Yl(l)};var E=Sae(Cae([].concat(r,c.options.modifiers)));return c.orderedModifiers=E.filter(function(b){return b.enabled}),g(),h.update()},forceUpdate:function(){if(!f){var m=c.elements,y=m.reference,E=m.popper;if(LR(y,E)){c.rects={reference:Eae(y,Zl(E),c.options.strategy==="fixed"),popper:K0(E)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(L){return c.modifiersData[L.name]=Object.assign({},L.data)});for(var b=0;b<c.orderedModifiers.length;b++){if(c.reset===!0){c.reset=!1,b=-1;continue}var R=c.orderedModifiers[b],M=R.fn,C=R.options,D=C===void 0?{}:C,F=R.name;typeof M=="function"&&(c=M({state:c,options:D,name:F,instance:h})||c)}}}},update:bae(function(){return new Promise(function(v){h.forceUpdate(),v(c)})}),destroy:function(){p(),f=!0}};if(!LR(s,l))return h;h.setOptions(u).then(function(v){!f&&u.onFirstUpdate&&u.onFirstUpdate(v)});function g(){c.orderedModifiers.forEach(function(v){var m=v.name,y=v.options,E=y===void 0?{}:y,b=v.effect;if(typeof b=="function"){var R=b({state:c,name:m,instance:h,options:E}),M=function(){};d.push(R||M)}})}function p(){d.forEach(function(v){return v()}),d=[]}return h}}var Oae=[Xoe,gae,Koe,Boe,hae,lae,yae,Goe,cae],Rae=Pae({defaultModifiers:Oae});function Iae(e){return typeof e=="function"?e():e}const Aae=x.forwardRef(function(t,n){const{children:r,container:i,disablePortal:o=!1}=t,[a,s]=x.useState(null),l=Ni(x.isValidElement(r)?hy(r):null,n);if(Rl(()=>{o||s(Iae(i)||document.body)},[i,o]),Rl(()=>{if(a&&!o)return uy(n,a),()=>{uy(n,null)}},[n,a,o]),o){if(x.isValidElement(r)){const u={ref:l};return x.cloneElement(r,u)}return S.jsx(x.Fragment,{children:r})}return S.jsx(x.Fragment,{children:a&&zc.createPortal(r,a)})});function Dae(e){return ln("MuiPopper",e)}yn("MuiPopper",["root"]);const Mae=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],Nae=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function Lae(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function t1(e){return typeof e=="function"?e():e}function kae(e){return e.nodeType!==void 0}const Fae=e=>{const{classes:t}=e;return wn({root:["root"]},Dae,t)},Bae={},jae=x.forwardRef(function(t,n){var r;const{anchorEl:i,children:o,direction:a,disablePortal:s,modifiers:l,open:u,placement:c,popperOptions:d,popperRef:f,slotProps:h={},slots:g={},TransitionProps:p}=t,v=Ne(t,Mae),m=x.useRef(null),y=Ni(m,n),E=x.useRef(null),b=Ni(E,f),R=x.useRef(b);Rl(()=>{R.current=b},[b]),x.useImperativeHandle(f,()=>E.current,[]);const M=Lae(c,a),[C,D]=x.useState(M),[F,L]=x.useState(t1(i));x.useEffect(()=>{E.current&&E.current.forceUpdate()}),x.useEffect(()=>{i&&L(t1(i))},[i]),Rl(()=>{if(!F||!u)return;const X=H=>{D(H.placement)};let re=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:H})=>{X(H)}}];l!=null&&(re=re.concat(l)),d&&d.modifiers!=null&&(re=re.concat(d.modifiers));const fe=Rae(F,m.current,j({placement:M},d,{modifiers:re}));return R.current(fe),()=>{fe.destroy(),R.current(null)}},[F,s,l,u,d,M]);const B={placement:C};p!==null&&(B.TransitionProps=p);const z=Fae(t),$=(r=g.root)!=null?r:"div",de=fy({elementType:$,externalSlotProps:h.root,externalForwardedProps:v,additionalProps:{role:"tooltip",ref:y},ownerState:t,className:z.root});return S.jsx($,j({},de,{children:typeof o=="function"?o(B):o}))}),Wae=x.forwardRef(function(t,n){const{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:u,open:c,placement:d="bottom",popperOptions:f=Bae,popperRef:h,style:g,transition:p=!1,slotProps:v={},slots:m={}}=t,y=Ne(t,Nae),[E,b]=x.useState(!0),R=()=>{b(!1)},M=()=>{b(!0)};if(!l&&!c&&(!p||E))return null;let C;if(o)C=o;else if(r){const L=t1(r);C=L&&kae(L)?Yb(L).body:Yb(null).body}const D=!c&&l&&(!p||E)?"none":void 0,F=p?{in:c,onEnter:R,onExited:M}:void 0;return S.jsx(Aae,{disablePortal:s,container:C,children:S.jsx(jae,j({anchorEl:r,direction:a,disablePortal:s,modifiers:u,ref:n,open:p?!E:c,placement:d,popperOptions:f,popperRef:h,slotProps:v,slots:m},y,{style:j({position:"fixed",top:0,left:0,display:D},g),TransitionProps:F,children:i}))})}),zae=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],Hae=ie(Wae,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),kR=x.forwardRef(function(t,n){var r;const i=mR(),o=Tn({props:t,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:u,container:c,disablePortal:d,keepMounted:f,modifiers:h,open:g,placement:p,popperOptions:v,popperRef:m,transition:y,slots:E,slotProps:b}=o,R=Ne(o,zae),M=(r=E==null?void 0:E.root)!=null?r:l==null?void 0:l.Root,C=j({anchorEl:a,container:c,disablePortal:d,keepMounted:f,modifiers:h,open:g,placement:p,popperOptions:v,popperRef:m,transition:y},R);return S.jsx(Hae,j({as:s,direction:i==null?void 0:i.direction,slots:{root:M},slotProps:b??u},C,{ref:n}))});function Uae(e){return ln("MuiTooltip",e)}const Bi=yn("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Vae=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function Gae(e){return Math.round(e*1e5)/1e5}const $ae=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${Ce(o.split("-")[0])}`],arrow:["arrow"]};return wn(a,Uae,t)},qae=ie(kR,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(({theme:e,ownerState:t,open:n})=>j({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Bi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Bi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Bi.arrow}`]:j({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Bi.arrow}`]:j({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),Zae=ie("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${Ce(n.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>j({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:_o(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Gae(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Bi.popper}[data-popper-placement*="left"] &`]:j({transformOrigin:"right center"},t.isRtl?j({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):j({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Bi.popper}[data-popper-placement*="right"] &`]:j({transformOrigin:"left center"},t.isRtl?j({marginRight:"14px"},t.touch&&{marginRight:"24px"}):j({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Bi.popper}[data-popper-placement*="top"] &`]:j({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Bi.popper}[data-popper-placement*="bottom"] &`]:j({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),Kae=ie("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:_o(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let ch=!1;const FR=new Il;let Ql={x:0,y:0};function dh(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const BR=x.forwardRef(function(t,n){var r,i,o,a,s,l,u,c,d,f,h,g,p,v,m,y,E,b,R;const M=Tn({props:t,name:"MuiTooltip"}),{arrow:C=!1,children:D,components:F={},componentsProps:L={},describeChild:B=!1,disableFocusListener:z=!1,disableHoverListener:$=!1,disableInteractive:de=!1,disableTouchListener:X=!1,enterDelay:re=100,enterNextDelay:fe=0,enterTouchDelay:H=700,followCursor:Y=!1,id:ae,leaveDelay:Te=0,leaveTouchDelay:Se=1500,onClose:oe,onOpen:be,open:te,placement:q="bottom",PopperComponent:ee,PopperProps:se={},slotProps:ce={},slots:Be={},title:qe,TransitionComponent:Ae=V0,TransitionProps:Ze}=M,Vn=Ne(M,Vae),xt=x.isValidElement(D)?D:S.jsx("span",{children:D}),Sn=SC(),w=tG(),[O,k]=x.useState(),[V,Q]=x.useState(null),le=x.useRef(!1),G=de||Y,me=Ba(),xe=Ba(),De=Ba(),we=Ba(),[Ke,_]=Jb({controlled:te,default:!1,name:"Tooltip",state:"open"});let T=Ke;const P=NV(ae),I=x.useRef(),W=Fa(()=>{I.current!==void 0&&(document.body.style.WebkitUserSelect=I.current,I.current=void 0),we.clear()});x.useEffect(()=>W,[W]);const Z=Re=>{FR.clear(),ch=!0,_(!0),be&&!T&&be(Re)},ge=Fa(Re=>{FR.start(800+Te,()=>{ch=!1}),_(!1),oe&&T&&oe(Re),me.start(Sn.transitions.duration.shortest,()=>{le.current=!1})}),Le=Re=>{le.current&&Re.type!=="touchstart"||(O&&O.removeAttribute("title"),xe.clear(),De.clear(),re||ch&&fe?xe.start(ch?fe:re,()=>{Z(Re)}):Z(Re))},ye=Re=>{xe.clear(),De.start(Te,()=>{ge(Re)})},{isFocusVisibleRef:tn,onBlur:St,onFocus:Zi,ref:ep}=tC(),[,_u]=x.useState(!1),Tu=Re=>{St(Re),tn.current===!1&&(_u(!1),ye(Re))},xD=Re=>{O||k(Re.currentTarget),Zi(Re),tn.current===!0&&(_u(!0),Le(Re))},SD=Re=>{le.current=!0;const Gn=xt.props;Gn.onTouchStart&&Gn.onTouchStart(Re)},_ve=Re=>{SD(Re),De.clear(),me.clear(),W(),I.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",we.start(H,()=>{document.body.style.WebkitUserSelect=I.current,Le(Re)})},Tve=Re=>{xt.props.onTouchEnd&&xt.props.onTouchEnd(Re),W(),De.start(Se,()=>{ge(Re)})};x.useEffect(()=>{if(!T)return;function Re(Gn){(Gn.key==="Escape"||Gn.key==="Esc")&&ge(Gn)}return document.addEventListener("keydown",Re),()=>{document.removeEventListener("keydown",Re)}},[ge,T]);const Eve=Ni(hy(xt),ep,k,n);!qe&&qe!==0&&(T=!1);const rw=x.useRef(),xve=Re=>{const Gn=xt.props;Gn.onMouseMove&&Gn.onMouseMove(Re),Ql={x:Re.clientX,y:Re.clientY},rw.current&&rw.current.update()},Eu={},iw=typeof qe=="string";B?(Eu.title=!T&&iw&&!$?qe:null,Eu["aria-describedby"]=T?P:null):(Eu["aria-label"]=iw?qe:null,Eu["aria-labelledby"]=T&&!iw?P:null);const br=j({},Eu,Vn,xt.props,{className:$e(Vn.className,xt.props.className),onTouchStart:SD,ref:Eve},Y?{onMouseMove:xve}:{}),xu={};X||(br.onTouchStart=_ve,br.onTouchEnd=Tve),$||(br.onMouseOver=dh(Le,br.onMouseOver),br.onMouseLeave=dh(ye,br.onMouseLeave),G||(xu.onMouseOver=Le,xu.onMouseLeave=ye)),z||(br.onFocus=dh(xD,br.onFocus),br.onBlur=dh(Tu,br.onBlur),G||(xu.onFocus=xD,xu.onBlur=Tu));const Sve=x.useMemo(()=>{var Re;let Gn=[{name:"arrow",enabled:!!V,options:{element:V,padding:4}}];return(Re=se.popperOptions)!=null&&Re.modifiers&&(Gn=Gn.concat(se.popperOptions.modifiers)),j({},se.popperOptions,{modifiers:Gn})},[V,se]),Su=j({},M,{isRtl:w,arrow:C,disableInteractive:G,placement:q,PopperComponentProp:ee,touch:le.current}),ow=$ae(Su),bD=(r=(i=Be.popper)!=null?i:F.Popper)!=null?r:qae,CD=(o=(a=(s=Be.transition)!=null?s:F.Transition)!=null?a:Ae)!=null?o:V0,PD=(l=(u=Be.tooltip)!=null?u:F.Tooltip)!=null?l:Zae,OD=(c=(d=Be.arrow)!=null?d:F.Arrow)!=null?c:Kae,bve=Al(bD,j({},se,(f=ce.popper)!=null?f:L.popper,{className:$e(ow.popper,se==null?void 0:se.className,(h=(g=ce.popper)!=null?g:L.popper)==null?void 0:h.className)}),Su),Cve=Al(CD,j({},Ze,(p=ce.transition)!=null?p:L.transition),Su),Pve=Al(PD,j({},(v=ce.tooltip)!=null?v:L.tooltip,{className:$e(ow.tooltip,(m=(y=ce.tooltip)!=null?y:L.tooltip)==null?void 0:m.className)}),Su),Ove=Al(OD,j({},(E=ce.arrow)!=null?E:L.arrow,{className:$e(ow.arrow,(b=(R=ce.arrow)!=null?R:L.arrow)==null?void 0:b.className)}),Su);return S.jsxs(x.Fragment,{children:[x.cloneElement(xt,br),S.jsx(bD,j({as:ee??kR,placement:q,anchorEl:Y?{getBoundingClientRect:()=>({top:Ql.y,left:Ql.x,right:Ql.x,bottom:Ql.y,width:0,height:0})}:O,popperRef:rw,open:O?T:!1,id:P,transition:!0},xu,bve,{popperOptions:Sve,children:({TransitionProps:Re})=>S.jsx(CD,j({timeout:Sn.transitions.duration.shorter},Re,Cve,{children:S.jsxs(PD,j({},Pve,{children:[qe,C?S.jsx(OD,j({},Ove,{ref:Q})):null]}))}))}))]})}),Yae=ie("button")(({ownerState:e,theme:t})=>({padding:"7px",fontSize:"16px",lineHeight:"14px",boxShadow:"none",borderStyle:"solid",borderWidth:"2px",borderRadius:"4px",borderColor:t.palette.btnBorder.main,backgroundColor:t.palette.btnBg.main,"&:not([disabled]):not(.state-disabled):hover":{backgroundColor:t.palette.btnBg.light},"&:not([disabled]):not(.state-disabled):active":{backgroundColor:t.palette.btnBg.light},"&:not([disabled]):not(.state-disabled):focus, &:not([disabled]):not(.state-disabled):focus:focus-visible, &:not([disabled]):not(.state-disabled):focus-visible":{outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"1px",outlineColor:t.palette.btnOutline.main,WebkitOutlineColor:"-webkit-focus-ring-color"},"&[disabled]":{},"&.state-disabled":{cursor:"default"},...e.active&&{backgroundColor:t.palette.btnBg.active,borderColor:t.palette.btnBorder.active},...e.size==="sm"&&{width:"24px",height:"24px",padding:"0",borderWidth:"1px",lineHeight:"6px"},...e.size==="lg"&&{width:"32px",height:"32px"},"& svg":{width:"100%",height:"100%"},"&.ultra-dark":{backgroundColor:t.palette.btnDarkBg.main,borderColor:t.palette.btnDarkBorder.main,"&:not([disabled]):not(.state-disabled):hover":{backgroundColor:t.palette.btnDarkBg.light},"&:not([disabled]):not(.state-disabled):focus, &:not([disabled]):not(.state-disabled):focus:focus-visible, &:not([disabled]):not(.state-disabled):focus-visible":{backgroundColor:t.palette.btnDarkBg.light},...e.active&&{backgroundColor:t.palette.btnDarkBg.active,borderColor:t.palette.btnDarkBorder.active}},...e.appearance==="borderless"&&{borderColor:"transparent",backgroundColor:"transparent","&:not([disabled]):not(.state-disabled):hover":{backgroundColor:"transparent"},"&:not([disabled]):not(.state-disabled):focus, &:not([disabled]):not(.state-disabled):focus:focus-visible, &:not([disabled]):not(.state-disabled):focus-visible":{backgroundColor:"transparent",outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"1px",outlineColor:e.colourScheme==="dark"?"#FFFFFF":t.palette.btnOutline.main,WebkitOutlineColor:"-webkit-focus-ring-color"},padding:"2px",...e.size==="sm"&&{width:"22px",height:"22px"},...e.size==="lg"&&{width:"26px",height:"26px"},"&[disabled]":{opacity:.5},"&.state-disabled":{opacity:.5,cursor:"default"}},"& .visually-hidden":{width:"1px !important",height:"1px !important",padding:"0 !important",margin:"-1px !important",overflow:"hidden !important",clip:"rect(0, 0, 0, 0) !important",whiteSpace:"nowrap !important",border:"0 !important"}}));function jR({label:e,children:t,size:n,active:r=!1,sx:i={},container:o=null,TooltipProps:a={},appearance:s="button",tooltipOff:l=!1,colourScheme:u="",className:c,...d}){const f=S.jsxs(Yae,{className:je(ve("btn-icon"),ve("btn-"+n),c),type:"button",ownerState:{active:r,appearance:s,size:n,colourScheme:u},sx:i,...d,children:[t,l&&S.jsx("span",{className:"visually-hidden",children:e})]});return d.disabled||l?f:S.jsx(BR,{PopperProps:{container:o==null?void 0:o.current},title:e,...a,children:f})}jR.propTypes={label:A.string.isRequired,children:A.element.isRequired,size:A.string,active:A.bool,sx:A.object,TooltipProps:A.object,container:A.shape({current:A.instanceOf(Element)}),appearance:A.string,colourScheme:A.string,className:A.string,tooltipOff:A.bool};const Sr=Me(Sf,gt("TVIconBtn"))(jR),Xae=ie(lR,{name:"WindowSmartBar",slot:"root"})(({theme:e})=>({backgroundColor:e.palette.canvasBg.main,boxShadow:"none",height:"64px",[e.breakpoints.up("md")]:{height:"72px"},zIndex:1100})),Qae=ie(sR,{name:"WindowSmartBar",slot:"toolbar",shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({backgroundColor:t.palette.canvasBg.main,boxSizing:"border-box",borderWidth:"0",height:"100%",padding:"16px 20px",position:"relative",[t.breakpoints.up("sm")]:{paddingLeft:"20px",paddingRight:"20px"},[t.breakpoints.up("md")]:{paddingBottom:"24px",display:"flex",justifyContent:"center",paddingLeft:"32px",paddingRight:"32px"},[t.breakpoints.up("xl")]:{paddingLeft:e.visibleWindows===1?"64px":"32px",paddingRight:e.visibleWindows===1?"64px":"32px"}})),Jae=ie("div",{shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({position:"absolute",right:"20px",top:"16px",display:"flex",[t.breakpoints.up("md")]:{right:"32px"},[t.breakpoints.up("xl")]:{right:e.visibleWindows===1?"64px":"32px"}})),ese=ie("div")({display:"flex"});let WR=class extends x.Component{constructor(t){super(t),this.state={downloadBtnVisible:!0,compareBtnVisible:!1,zoomInEnabled:!0,zoomOutEnabled:!0},this.handleZoomInClick=this.handleZoomInClick.bind(this),this.handleZoomOutClick=this.handleZoomOutClick.bind(this),this.handleActionCompare=this.handleActionCompare.bind(this)}componentDidMount(){this.updateAvailableOptions()}componentDidUpdate(t){(t.windowWidth!==this.props.windowWidth||t.visibleWindows!==this.props.visibleWindows)&&this.updateAvailableOptions(),(t.viewer==null&&this.props.viewer!=null||t.viewer!=null&&this.props.viewer==null||t.viewer&&this.props.viewer&&t.viewer.zoom!==this.props.viewer.zoom)&&this.updateZoomButtonsState()}updateZoomButtonsState(){const{viewer:t}=this.props;t?this.setState({zoomInEnabled:t.maxZoom>t.zoom,zoomOutEnabled:t.minZoom<t.zoom}):this.setState({zoomInEnabled:!0,zoomOutEnabled:!0})}updateAvailableOptions(){const{windowWidth:t,visibleWindows:n,downloadIsOpen:r,handleCloseDownload:i,closeLastWindow:o}=this.props,a=t>=768||n>1,s=t>1200&&n===1;!a&&r&&i(),t>0&&t<600&&n>1&&o(),this.setState({downloadBtnVisible:a,compareBtnVisible:s})}handleZoomInClick(){const{windowId:t,updateViewport:n,viewer:r}=this.props,i=Math.min(r.zoom*1.8,r.maxZoom);i.toPrecision(17)!==r.zoom.toPrecision(17)&&n(t,{zoom:i})}handleZoomOutClick(){const{windowId:t,updateViewport:n,viewer:r}=this.props,i=Math.max(r.zoom/1.8,r.minZoom);i.toPrecision(17)!==r.zoom.toPrecision(17)&&n(t,{zoom:i})}handleActionCompare(){const{addWindow:t,manifestId:n}=this.props;t({manifestId:n})}render(){const{windowId:t,focusWindow:n=()=>{},component:r="nav",selectedTheme:i,handleOpenInfo:o=()=>{},handleShowCanvasPicker:a=()=>{},handleOpenDownload:s=()=>{},allowCanvasPicker:l=!1,canvasPickerOpen:u=!1,downloadIsOpen:c=!1,infoIsOpen:d=!1,zoomBtnsVisible:f=!0,visibleWindows:h=1,allowCompareMode:g=!1,infoBtnVisible:p=!0}=this.props,{downloadBtnVisible:v,compareBtnVisible:m,zoomInEnabled:y,zoomOutEnabled:E}=this.state,b=d||c||u?-1:0,R=d||c||u||!f?-1:0;return S.jsx(Xae,{component:r,"aria-label":"Window controls",position:"relative",children:S.jsxs(Qae,{className:je(ve("window-smart-bar")),variant:"dense",layoutDef:{visibleWindows:h},onMouseDown:n,children:[S.jsxs(ese,{className:je(ve("smart-bar-manifest-ctrl")),children:[p&&S.jsx(Sr,{label:"Info",size:"lg",tabIndex:b,active:d,onClick:o,sx:{padding:"6px"},children:S.jsx(dR,{theme:i})}),v&&S.jsx(Sr,{label:"Download",size:"lg",tabIndex:b,sx:{marginLeft:"24px"},onClick:s,active:c,children:S.jsx(F0,{theme:i})}),l&&S.jsx(Ka,{label:"Select image",size:"lg",tabIndex:b,sx:{marginLeft:"24px"},active:u,onClick:a}),g&&m&&S.jsx(Ka,{label:"Compare images",size:"lg",tabIndex:b,sx:{marginLeft:"24px"},onClick:this.handleActionCompare})]}),S.jsxs(Jae,{className:je(ve("smart-bar-zoom-ctrl")),layoutDef:{visibleWindows:h},style:{display:f?"block":"none"},children:[S.jsx(Sr,{label:"Zoom out",size:"lg",tabIndex:R,sx:{marginRight:"8px"},id:`${t}-zoom-out`,onClick:this.handleZoomOutClick,className:E?"":"state-disabled",children:S.jsx(cR,{theme:i,state:E?"":"disabled"})}),S.jsx(Sr,{label:"Zoom in",size:"lg",tabIndex:R,id:`${t}-zoom-in`,onClick:this.handleZoomInClick,className:y?"":"state-disabled",children:S.jsx(uR,{theme:i,state:y?"":"disabled"})})]})]})})}};WR.propTypes={windowId:A.string.isRequired,manifestId:A.string,component:A.elementType,selectedTheme:A.string,windowWidth:A.number,zoomBtnsVisible:A.bool,infoBtnVisible:A.bool,allowCompareMode:A.bool.isRequired,visibleWindows:A.number,removeWindowId:A.string,closeLastWindow:A.func,allowCanvasPicker:A.bool.isRequired,canvasPickerOpen:A.bool,handleShowCanvasPicker:A.func,infoIsOpen:A.bool,handleOpenInfo:A.func,downloadIsOpen:A.bool,handleOpenDownload:A.func,handleCloseDownload:A.func,addWindow:A.func.isRequired,updateViewport:A.func,viewer:A.shape({x:A.number,y:A.number,zoom:A.number,maxZoom:A.number,minZoom:A.number}),focusWindow:A.func};const tse=Me(Qe((e,{windowId:t})=>{const n=_r(e,{windowId:t}),r=Ca(e);return{allowCompareMode:Ie(e).workspace.compareModeAvailable,selectedTheme:Ie(e).selectedTheme,viewer:md(e,{windowId:t}),allowCanvasPicker:Lr(e,{windowId:t}).length>1,manifestId:n.manifestId,visibleWindows:r.length}},(e,{windowId:t})=>({focusWindow:()=>e(Xf(t)),updateViewport:tx(P0,e),addWindow:tx(C0,e)})),gt("WindowSmartBar"))(WR),nse=x.lazy(()=>Promise.resolve().then(()=>uve)),zR=x.lazy(()=>Promise.resolve().then(()=>fve)),rse=x.lazy(()=>Promise.resolve().then(()=>mve));zR.displayName="WindowViewer_PW";const ise=ie("div")(()=>({display:"flex",flex:1,position:"relative"}));let n1=class extends x.Component{constructor(t){super(t),this.state={meWidth:0,meHeight:0},this.onResizeHandler=Ul(this.onResizeHandler.bind(this),67),this.componentRef=x.createRef()}componentDidMount(){window.addEventListener("resize",this.onResizeHandler),this.onResizeHandler()}componentDidUpdate(t){t.parentWidth!==this.props.parentWidth&&this.onResizeHandler()}componentWillUnmount(){window.removeEventListener("resize",this.onResizeHandler)}onResizeHandler(){if(this.componentRef.current){const t=this.componentRef.current.getBoundingClientRect();this.setState({meWidth:t.width,meHeight:t.height})}}renderViewer(){const{audioResources:t=[],isFetching:n,videoResources:r=[],windowId:i,canTabIn:o,handleZoomBtnVisibility:a,windowExists:s=!0}=this.props,{meWidth:l,meHeight:u}=this.state;if(n===!1){if(r.length>0)return S.jsx(rse,{windowId:i});if(t.length>0)return S.jsx(nse,{windowId:i});if(s)return S.jsx(zR,{windowId:i,canTabIn:o,windowWidth:l,windowHeight:u,handleZoomBtnVisibility:a})}return null}render(){const{children:t,className:n}=this.props;return S.jsx(ise,{className:je(ve("primary-window"),n),ref:this.componentRef,children:S.jsx(x.Suspense,{fallback:S.jsx("div",{}),children:t||this.renderViewer()})})}};n1.propTypes={windowExists:A.bool,audioResources:A.arrayOf(A.object),children:A.node,className:A.string,isFetching:A.bool,videoResources:A.arrayOf(A.object),windowId:A.string.isRequired,canTabIn:A.bool,handleZoomBtnVisibility:A.func,parentWidth:A.number},n1.defaultProps={children:void 0,className:void 0,isCollection:!1,isCollectionDialogVisible:!1,isFetching:!1,view:void 0};const ose=Me(Qe((e,{windowId:t})=>{var r;const n=ct(e,{windowId:t});return{windowExists:yt(e,{windowId:t})!=null,audioResources:Ev(e,{windowId:t})||[],isCollection:n&&n.isCollection(),isCollectionDialogVisible:((r=yt(e,{windowId:t}))==null?void 0:r.collectionDialogOn)||!1,videoResources:_v(e,{windowId:t})||[]}},null),gt("PrimaryWindow_PW"))(n1),r1=x.forwardRef((e,t)=>{const{PluginComponents:n}=e,{classes:r,...i}=e;return n?n.map((o,a)=>x.isValidElement(o)?x.cloneElement(o,{...i,ref:t}):x.createElement(o,{ref:t,...i,key:a})):null});function ase(e){return ln("MuiTypography",e)}yn("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const sse=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],lse=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=e,s={root:["root",o,e.align!=="inherit"&&`align${Ce(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return wn(s,ase,a)},use=ie("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Ce(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>j({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),HR={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},cse={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},dse=e=>cse[e]||e,dn=x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiTypography"}),i=dse(r.color),o=oy(j({},r,{color:i})),{align:a="inherit",className:s,component:l,gutterBottom:u=!1,noWrap:c=!1,paragraph:d=!1,variant:f="body1",variantMapping:h=HR}=o,g=Ne(o,sse),p=j({},o,{align:a,color:i,className:s,component:l,gutterBottom:u,noWrap:c,paragraph:d,variant:f,variantMapping:h}),v=l||(d?"p":h[f]||HR[f])||"span",m=lse(p);return S.jsx(use,j({as:v,ref:n,ownerState:p,className:$e(m.root,s)},g))}),fse=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M22.0844 23.67C22.5225 24.1099 23.2329 24.1099 23.671 23.67C24.1092 23.2301 24.1092 22.5168 23.671 22.0769L2.01039 0.329929C1.57221 -0.109976 0.861853 -0.109976 0.423673 0.329929C-0.0145072 0.769835 -0.014507 1.48314 0.423673 1.92305L22.0844 23.67Z",fill:"white"}),x.createElement("path",{d:"M23.576 1.92305C24.0142 1.48315 24.0142 0.769839 23.576 0.329933C23.1378 -0.109974 22.4275 -0.109974 21.9893 0.329934L0.328717 22.0769C-0.109463 22.5168 -0.109463 23.2301 0.328717 23.67C0.766896 24.1099 1.47726 24.1099 1.91544 23.67L23.576 1.92305Z",fill:"white"})),hse=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M22.0844 23.67C22.5225 24.1099 23.2329 24.1099 23.671 23.67C24.1092 23.2301 24.1092 22.5168 23.671 22.0769L2.01039 0.329929C1.57221 -0.109976 0.861853 -0.109976 0.423673 0.329929C-0.0145072 0.769835 -0.014507 1.48314 0.423673 1.92305L22.0844 23.67Z",fill:"#272626"}),x.createElement("path",{d:"M23.576 1.92305C24.0142 1.48315 24.0142 0.769839 23.576 0.329933C23.1378 -0.109974 22.4275 -0.109974 21.9893 0.329934L0.328717 22.0769C-0.109463 22.5168 -0.109463 23.2301 0.328717 23.67C0.766896 24.1099 1.47726 24.1099 1.91544 23.67L23.576 1.92305Z",fill:"#272626"}));function Jl({theme:e,...t}){const n=e==="light"?hse:fse;return S.jsx(n,{...t})}Jl.propTypes={theme:A.string.isRequired};const pse=ie("div",{shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({position:"absolute",bottom:0,left:0,right:0,top:0,backgroundColor:e.colourScheme==="light"?t.custom.dialog.backsplashColour:t.custom.dialog.backsplashColourThin,visibility:"hidden","&.open":{visibility:"visible"},zIndex:1101})),gse=ie("div",{shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({position:"relative",boxSizing:"border-box",display:"flex",flexDirection:"column",padding:"20px",paddingBottom:"64px",height:"100%",width:"100%",[t.breakpoints.up("md")]:{padding:"32px",paddingBottom:"72px"},justifyContent:e.dock==="bottom"?"end":"center",alignItems:"center"})),mse=ie("div",{shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({backgroundColor:e.colourScheme==="light"?t.custom.dialog.background:t.custom.dialog.darkBackground,color:e.colourScheme==="light"?t.custom.dialog.txtColour:t.custom.dialog.darkTxtColour,width:"100%",maxWidth:"calc(100% - 40px)",borderRadius:e.borderRadius,height:"auto",maxHeight:"calc(100% - 40px)",[t.breakpoints.up("md")]:{maxWidth:e.dialogSize==="sm"?"420px":"720px"}})),vse=ie("div",{shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({position:"relative",display:"flex",alignItems:"center",color:e.colourScheme==="light"?t.custom.dialog.txtColour:t.custom.dialog.darkTxtColour,borderBottom:"1px solid",borderColor:t.custom.dialog.underline,height:e.colourScheme==="light"?"48px":"56px",marginLeft:"16px",marginRight:"16px",[t.breakpoints.up("md")]:{marginLeft:e.dialogSize==="sm"?"16px":"24px",marginRight:e.dialogSize==="sm"?"16px":"24px"},paddingBottom:e.dialogSize==="sm"?"0":"4px","& h2":{fontSize:e.dialogSize==="sm"?"20.25px":"22.78px",fontWeight:300,color:e.colourScheme==="light"?t.custom.dialog.darkHeadingTxtColour:t.custom.dialog.darkTxtColour,paddingTop:e.colourScheme==="light"?"12px":"16px"},"& .MuiTabs-root":{height:"47px",minHeight:"47px",marginLeft:"-2px"},"& .MuiTabs-flexContainer":{padding:"2px",paddingTop:"8px"},"& .MuiTabs-indicator":{backgroundColor:t.custom.dialog.tabTxtColourActive},"& .tab-title-wrap":{padding:"4px"},"& .tab-title":{paddingLeft:"2px",paddingRight:"2px",paddingBottom:"4px",paddingTop:"4px",height:"37px",minHeight:"37px",marginRight:"20px",minWidth:"50px",fontSize:"16px",fontWeight:700,textTransform:"none",color:e.colourScheme==="light"?t.custom.dialog.tabTxtColour:t.custom.dialog.darkTabTxtColour,"&.Mui-selected":{color:e.colourScheme==="light"?t.custom.dialog.tabTxtColourActive:t.custom.dialog.darkTabTxtColourActive},"&:focus":{outline:t.custom.standardOutline}}})),yse=ie("div",{shouldForwardProp:e=>e!=="layoutDef"})(({layoutDef:e,theme:t})=>({fontSize:"1rem",lineHeight:"1.2",whiteSpace:"normal",overflowY:"auto",flexBasis:"auto",padding:"16px",paddingTop:e.colourScheme==="light"?"16px":"8px",[t.breakpoints.up("md")]:{paddingTop:e.colourScheme==="light"?"16px":"20px",paddingLeft:e.dialogSize==="sm"?"16px":"24px",paddingRight:e.dialogSize==="sm"?"16px":"24px"},"& .tab-content > p:first-of-type":{marginTop:0},"& .tab-content > p:last-of-type":{marginBottom:0},"& > .MuiTypography-root > p:first-of-type":{marginTop:0},"& > .MuiTypography-root > p:last-of-type":{marginBottom:0},"& a":{borderRadius:"2px","&:focus-visible, &:focus:focus-visible, &:focus":{outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"1px",outlineColor:e.colourScheme==="light"?t.palette.btnOutline.main:"#FFFFFF",WebkitOutlineColor:"-webkit-focus-ring-color"}}}));class fh extends x.Component{constructor(n){super(n);Mt(this,"focusFirstElement",()=>{const n=this.props.windowId+"-"+this.props.label+"-close";document.getElementById(n).focus()});this.dialogRef=x.createRef(),this.previousFocus=null}componentDidMount(){}componentDidUpdate(n){n.open!==this.props.open&&(this.props.open?(this.previousFocus=document.activeElement,this.focusFirstElement()):this.previousFocus&&this.previousFocus.focus())}render(){const{open:n=!1,titleElement:r,contentElement:i,windowId:o,label:a,handleClose:s=()=>{},layoutDef:l}=this.props;return S.jsx(pse,{id:`${o}-${a}`,layoutDef:l,className:je(ve("pop-up"),n?"open":"",ve("pop-up-")+a),role:"dialog","aria-modal":"true","aria-labelledby":`${o}-${a}-title`,ref:this.dialogRef,children:S.jsx(gse,{layoutDef:l,children:S.jsx(mse,{layoutDef:l,children:S.jsxs("div",{style:{maxHeight:"100%",display:"flex",flexDirection:"column"},children:[S.jsxs(vse,{className:je(ve("pop-up-title")),layoutDef:l,children:[S.jsx(dn,{component:"div",id:`${o}-${a}-title`,sx:{paddingRight:"32px"},children:n&&r}),S.jsx(Sr,{label:"Close",size:"sm",appearance:"borderless",colourScheme:l.colourScheme,sx:{position:"absolute",right:"0",top:"calc((100% - 16px) / 2)"},onClick:s,id:`${o}-${a}-close`,children:S.jsx(Jl,{theme:l.colourScheme})})]}),S.jsx(yse,{className:je(ve("pop-up-content")),layoutDef:l,children:n&&i})]})})})})}}fh.propTypes={open:A.bool,titleElement:A.element.isRequired,contentElement:A.element.isRequired,windowId:A.string,label:A.string.isRequired,handleClose:A.func,layoutDef:A.object};const wse=e=>x.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{id:"IIIF-logo-colored-text 2",clipPath:"url(#clip0_976_28660)"},x.createElement("g",{id:"g10"},x.createElement("g",{id:"g12"},x.createElement("path",{id:"path14",d:"M0.282104 5.09163L3.35221 6.2321L3.3468 14.4479L0.282104 13.3182V5.09163Z",fill:"#2873AB"}),x.createElement("path",{id:"path16",d:"M3.4772 3.09674C3.82936 4.13846 3.36273 4.98291 2.43492 4.98291C1.50715 4.98291 0.469574 4.13846 0.117413 3.09674C-0.234713 2.05511 0.231917 1.21066 1.15969 1.21066C2.08749 1.21066 3.12504 2.05511 3.4772 3.09674Z",fill:"#2873AB"}),x.createElement("path",{id:"path18",d:"M7.25835 5.09163L4.18823 6.2321L4.19364 14.4479L7.25835 13.3182V5.09163Z",fill:"#ED1D33"}),x.createElement("path",{id:"path20",d:"M4.04332 3.09674C3.69118 4.13846 4.15781 4.98291 5.08559 4.98291C6.01337 4.98291 7.05094 4.13846 7.40313 3.09674C7.75524 2.05511 7.28863 1.21066 6.36086 1.21066C5.43304 1.21066 4.39547 2.05511 4.04332 3.09674Z",fill:"#ED1D33"}),x.createElement("path",{id:"path22",d:"M8.04382 5.09163L11.1139 6.2321L11.1085 14.4479L8.04382 13.3182V5.09163Z",fill:"#2873AB"}),x.createElement("path",{id:"path24",d:"M11.2588 3.09674C11.611 4.13846 11.1444 4.98291 10.2166 4.98291C9.28872 4.98291 8.2512 4.13846 7.89904 3.09674C7.54689 2.05511 8.01354 1.21066 8.94128 1.21066C9.8691 1.21066 10.9066 2.05511 11.2588 3.09674Z",fill:"#2873AB"}),x.createElement("path",{id:"path26",d:"M16.0002 0.199955V3.02142C16.0002 3.02142 15.0057 2.63226 14.8867 3.63761C14.8759 4.70782 14.8867 5.09158 14.8867 5.09158L16.0002 4.72944V7.20498L14.8819 7.60496V13.3776L11.8274 14.5127V4.30784C11.8274 4.30784 11.7626 0.632364 16.0002 0.199955Z",fill:"#ED1D33"})))));function _se({...e}){return S.jsx(wse,{...e})}let UR=class extends x.Component{constructor(n){super(n);Mt(this,"handleTabSwitch",n=>{this.setState({activeTab:n}),this.props.handleTabSwitch(n)});this.state={activeTab:n.loadedTab||0}}componentDidUpdate(n){n.open&&!this.props.open&&this.setState({activeTab:0})}render(){const{windowId:n,open:r=!1,handleClose:i=()=>{},showIIIFmanifest:o=!0,selectedTheme:a,label:s,caption:l,manifestUrl:u=""}=this.props,{activeTab:c}=this.state;return S.jsx(fh,{windowId:n,label:"info-panel",selectedTheme:a,open:r,handleClose:i,titleElement:o?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:je(ve("tab-nav"),"d-none d-md-block"),"aria-label":"Tabbed options",role:"tablist",children:[S.jsx(Ka,{appearance:"tab",label:"Info",labelSm:"Information",size:"lg",theme:"light",onClick:()=>this.handleTabSwitch(0),id:n+"-info-0",className:je(ve("tab-btn"),c===0?"active":""),sx:{marginTop:"10px"}}),S.jsx(Ka,{appearance:"tab",label:"Manifest",labelSm:"IIIF Manifest",size:"lg",theme:"light",onClick:()=>this.handleTabSwitch(1),id:n+"-info-1",className:je(ve("tab-btn"),c===1?"active":""),sx:{marginTop:"10px"}})]}),S.jsx(dn,{className:"d-md-none",component:"h2",children:"Information"})]}):S.jsx(dn,{component:"h2",children:"Information"}),contentElement:o?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"d-none d-md-block",children:[c===0&&S.jsx("div",{className:je(ve("tab-content")),role:"tabpanel","aria-labelledby":n+"-info-0",style:{fontSize:"1rem",letterSpacing:"0.0125rem",lineHeight:"1.2"},children:S.jsxs("p",{children:[s,s&&l&&S.jsx("br",{}),l]})}),c===1&&S.jsxs("div",{className:je(ve("tab-content")),role:"tabpanel","aria-labelledby":n+"-info-1",style:{fontSize:"1rem",letterSpacing:"0.0125rem",lineHeight:"1.2"},children:[S.jsx("p",{children:"The International Image Interoperability Framework (IIIF) is a set of technology standards intended to make it easier for researchers, students and the public at large to view, manipulate, compare and annotate digital images on the web."}),S.jsx("p",{children:"When you see the IIIF logo in a search result or record for an image, you know that it is available to use with IIIF-compatible viewers."}),S.jsxs("div",{style:{display:"flex",marginTop:"1rem"},children:[S.jsx("div",{style:{marginRight:"0.75rem"},children:S.jsx(_se,{})}),S.jsx("div",{children:S.jsx("a",{href:u,children:"IIIF manifest URL"})})]})]})]}),S.jsx(dn,{className:"d-md-none",component:"div",variant:"body1",sx:{lineHeight:"1.2"},children:S.jsxs("p",{children:[s,s&&l&&S.jsx("br",{}),l]})})]}):S.jsx(dn,{component:"div",variant:"body1",sx:{lineHeight:"1.2"},children:S.jsxs("p",{children:[s,s&&l&&S.jsx("br",{}),l]})}),layoutDef:{dock:"center",colourScheme:"light",dialogSize:"sm",borderRadius:"4px"}})}};UR.propTypes={showIIIFmanifest:A.bool,manifestUrl:A.string,windowId:A.string,selectedTheme:A.string,open:A.bool,loadedTab:A.number,handleClose:A.func,handleTabSwitch:A.func,label:A.string,caption:A.string};const Tse=Me(Qe((e,{windowId:t})=>({manifestUrl:_S(e,{windowId:t}),selectedTheme:Ie(e).selectedTheme,showIIIFmanifest:_r(e,{windowId:t}).showManifestUrl})))(UR),Ese=x.createContext(void 0);function VR(){return x.useContext(Ese)}function xse(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:u}=e,[c,d]=x.useState(!1),f=$e(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},g=$e(n.child,c&&n.childLeaving,r&&n.childPulsate);return!s&&!c&&d(!0),x.useEffect(()=>{if(!s&&l!=null){const p=setTimeout(l,u);return()=>{clearTimeout(p)}}},[l,s,u]),S.jsx("span",{className:f,style:h,children:S.jsx("span",{className:g})})}const lr=yn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Sse=["center","classes","className"];let hh=e=>e,GR,$R,qR,ZR;const i1=550,bse=80,Cse=Xd(GR||(GR=hh`
  0% {
    transform: scale(0);
    opacity: 0.1;
  }
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
`)),Pse=Xd($R||($R=hh`
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
`)),Ose=Xd(qR||(qR=hh`
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
`)),Rse=ie("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Ise=ie(xse,{name:"MuiTouchRipple",slot:"Ripple"})(ZR||(ZR=hh`
  opacity: 0;
  position: absolute;
  &.${0} {
    opacity: 0.3;
    transform: scale(1);
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }
  &.${0} {
    animation-duration: ${0}ms;
  }
  & .${0} {
    opacity: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
  }
  & .${0} {
    opacity: 0;
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }
  & .${0} {
    position: absolute;
    /* @noflip */
    left: 0px;
    top: 0;
    animation-name: ${0};
    animation-duration: 2500ms;
    animation-timing-function: ${0};
    animation-iteration-count: infinite;
    animation-delay: 200ms;
  }
`),lr.rippleVisible,Cse,i1,({theme:e})=>e.transitions.easing.easeInOut,lr.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,lr.child,lr.childLeaving,Pse,i1,({theme:e})=>e.transitions.easing.easeInOut,lr.childPulsate,Ose,({theme:e})=>e.transitions.easing.easeInOut),Ase=x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=Ne(r,Sse),[l,u]=x.useState([]),c=x.useRef(0),d=x.useRef(null);x.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=x.useRef(!1),h=Ba(),g=x.useRef(null),p=x.useRef(null),v=x.useCallback(b=>{const{pulsate:R,rippleX:M,rippleY:C,rippleSize:D,cb:F}=b;u(L=>[...L,S.jsx(Ise,{classes:{ripple:$e(o.ripple,lr.ripple),rippleVisible:$e(o.rippleVisible,lr.rippleVisible),ripplePulsate:$e(o.ripplePulsate,lr.ripplePulsate),child:$e(o.child,lr.child),childLeaving:$e(o.childLeaving,lr.childLeaving),childPulsate:$e(o.childPulsate,lr.childPulsate)},timeout:i1,pulsate:R,rippleX:M,rippleY:C,rippleSize:D},c.current)]),c.current+=1,d.current=F},[o]),m=x.useCallback((b={},R={},M=()=>{})=>{const{pulsate:C=!1,center:D=i||R.pulsate,fakeElement:F=!1}=R;if((b==null?void 0:b.type)==="mousedown"&&f.current){f.current=!1;return}(b==null?void 0:b.type)==="touchstart"&&(f.current=!0);const L=F?null:p.current,B=L?L.getBoundingClientRect():{width:0,height:0,left:0,top:0};let z,$,de;if(D||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)z=Math.round(B.width/2),$=Math.round(B.height/2);else{const{clientX:X,clientY:re}=b.touches&&b.touches.length>0?b.touches[0]:b;z=Math.round(X-B.left),$=Math.round(re-B.top)}if(D)de=Math.sqrt((2*B.width**2+B.height**2)/3),de%2===0&&(de+=1);else{const X=Math.max(Math.abs((L?L.clientWidth:0)-z),z)*2+2,re=Math.max(Math.abs((L?L.clientHeight:0)-$),$)*2+2;de=Math.sqrt(X**2+re**2)}b!=null&&b.touches?g.current===null&&(g.current=()=>{v({pulsate:C,rippleX:z,rippleY:$,rippleSize:de,cb:M})},h.start(bse,()=>{g.current&&(g.current(),g.current=null)})):v({pulsate:C,rippleX:z,rippleY:$,rippleSize:de,cb:M})},[i,v,h]),y=x.useCallback(()=>{m({},{pulsate:!0})},[m]),E=x.useCallback((b,R)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&g.current){g.current(),g.current=null,h.start(0,()=>{E(b,R)});return}g.current=null,u(M=>M.length>0?M.slice(1):M),d.current=R},[h]);return x.useImperativeHandle(n,()=>({pulsate:y,start:m,stop:E}),[y,m,E]),S.jsx(Rse,j({className:$e(lr.root,o.root,a),ref:p},s,{children:S.jsx(z0,{component:null,exit:!0,children:l})}))});function Dse(e){return ln("MuiButtonBase",e)}const Mse=yn("MuiButtonBase",["root","disabled","focusVisible"]),Nse=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Lse=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,a=wn({root:["root",t&&"disabled",n&&"focusVisible"]},Dse,i);return n&&r&&(a.root+=` ${r}`),a},kse=ie("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Mse.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),KR=x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:a,className:s,component:l="button",disabled:u=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:h="a",onBlur:g,onClick:p,onContextMenu:v,onDragLeave:m,onFocus:y,onFocusVisible:E,onKeyDown:b,onKeyUp:R,onMouseDown:M,onMouseLeave:C,onMouseUp:D,onTouchEnd:F,onTouchMove:L,onTouchStart:B,tabIndex:z=0,TouchRippleProps:$,touchRippleRef:de,type:X}=r,re=Ne(r,Nse),fe=x.useRef(null),H=x.useRef(null),Y=Ni(H,de),{isFocusVisibleRef:ae,onFocus:Te,onBlur:Se,ref:oe}=tC(),[be,te]=x.useState(!1);u&&be&&te(!1),x.useImperativeHandle(i,()=>({focusVisible:()=>{te(!0),fe.current.focus()}}),[]);const[q,ee]=x.useState(!1);x.useEffect(()=>{ee(!0)},[]);const se=q&&!c&&!u;x.useEffect(()=>{be&&f&&!c&&q&&H.current.pulsate()},[c,f,be,q]);function ce(_,T,P=d){return Fa(I=>(T&&T(I),!P&&H.current&&H.current[_](I),!0))}const Be=ce("start",M),qe=ce("stop",v),Ae=ce("stop",m),Ze=ce("stop",D),Vn=ce("stop",_=>{be&&_.preventDefault(),C&&C(_)}),xt=ce("start",B),Sn=ce("stop",F),w=ce("stop",L),O=ce("stop",_=>{Se(_),ae.current===!1&&te(!1),g&&g(_)},!1),k=Fa(_=>{fe.current||(fe.current=_.currentTarget),Te(_),ae.current===!0&&(te(!0),E&&E(_)),y&&y(_)}),V=()=>{const _=fe.current;return l&&l!=="button"&&!(_.tagName==="A"&&_.href)},Q=x.useRef(!1),le=Fa(_=>{f&&!Q.current&&be&&H.current&&_.key===" "&&(Q.current=!0,H.current.stop(_,()=>{H.current.start(_)})),_.target===_.currentTarget&&V()&&_.key===" "&&_.preventDefault(),b&&b(_),_.target===_.currentTarget&&V()&&_.key==="Enter"&&!u&&(_.preventDefault(),p&&p(_))}),G=Fa(_=>{f&&_.key===" "&&H.current&&be&&!_.defaultPrevented&&(Q.current=!1,H.current.stop(_,()=>{H.current.pulsate(_)})),R&&R(_),p&&_.target===_.currentTarget&&V()&&_.key===" "&&!_.defaultPrevented&&p(_)});let me=l;me==="button"&&(re.href||re.to)&&(me=h);const xe={};me==="button"?(xe.type=X===void 0?"button":X,xe.disabled=u):(!re.href&&!re.to&&(xe.role="button"),u&&(xe["aria-disabled"]=u));const De=Ni(n,oe,fe),we=j({},r,{centerRipple:o,component:l,disabled:u,disableRipple:c,disableTouchRipple:d,focusRipple:f,tabIndex:z,focusVisible:be}),Ke=Lse(we);return S.jsxs(kse,j({as:me,className:$e(Ke.root,s),ownerState:we,onBlur:O,onClick:p,onContextMenu:qe,onFocus:k,onKeyDown:le,onKeyUp:G,onMouseDown:Be,onMouseLeave:Vn,onMouseUp:Ze,onDragLeave:Ae,onTouchEnd:Sn,onTouchMove:w,onTouchStart:xt,ref:De,tabIndex:u?-1:z,type:X},xe,re,{children:[a,se?S.jsx(Ase,j({ref:Y,center:o},$)):null]}))});function Fse(e){return ln("PrivateSwitchBase",e)}yn("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Bse=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],jse=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Ce(i)}`],input:["input"]};return wn(o,Fse,t)},Wse=ie(KR)(({ownerState:e})=>j({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),zse=ie("input",{shouldForwardProp:Ey})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Hse=x.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:o,className:a,defaultChecked:s,disabled:l,disableFocusRipple:u=!1,edge:c=!1,icon:d,id:f,inputProps:h,inputRef:g,name:p,onBlur:v,onChange:m,onFocus:y,readOnly:E,required:b=!1,tabIndex:R,type:M,value:C}=t,D=Ne(t,Bse),[F,L]=Jb({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),B=VR(),z=Y=>{y&&y(Y),B&&B.onFocus&&B.onFocus(Y)},$=Y=>{v&&v(Y),B&&B.onBlur&&B.onBlur(Y)},de=Y=>{if(Y.nativeEvent.defaultPrevented)return;const ae=Y.target.checked;L(ae),m&&m(Y,ae)};let X=l;B&&typeof X>"u"&&(X=B.disabled);const re=M==="checkbox"||M==="radio",fe=j({},t,{checked:F,disabled:X,disableFocusRipple:u,edge:c}),H=jse(fe);return S.jsxs(Wse,j({component:"span",className:$e(H.root,a),centerRipple:!0,focusRipple:!u,disabled:X,tabIndex:null,role:void 0,onFocus:z,onBlur:$,ownerState:fe,ref:n},D,{children:[S.jsx(zse,j({autoFocus:r,checked:i,defaultChecked:s,className:H.input,disabled:X,id:re?f:void 0,name:p,onChange:de,readOnly:E,ref:g,required:b,ownerState:fe,tabIndex:R,type:M},M==="checkbox"&&C===void 0?{}:{value:C},h)),F?o:d]}))});function Use(e){return ln("MuiSvgIcon",e)}yn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Vse=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Gse=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ce(t)}`,`fontSize${Ce(n)}`]};return wn(i,Use,r)},$se=ie("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ce(n.color)}`],t[`fontSize${Ce(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,i,o,a,s,l,u,c,d,f,h,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=e.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=e.typography)==null||(a=o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem",medium:((s=e.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((u=e.typography)==null||(c=u.pxToRem)==null?void 0:c.call(u,35))||"2.1875rem"}[t.fontSize],color:(d=(f=(e.vars||e).palette)==null||(f=f[t.color])==null?void 0:f.main)!=null?d:{action:(h=(e.vars||e).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(g=(e.vars||e).palette)==null||(g=g.action)==null?void 0:g.disabled,inherit:void 0}[t.color]}}),o1=x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:d,viewBox:f="0 0 24 24"}=r,h=Ne(r,Vse),g=x.isValidElement(i)&&i.type==="svg",p=j({},r,{color:a,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:f,hasSvgAsChild:g}),v={};c||(v.viewBox=f);const m=Gse(p);return S.jsxs($se,j({as:s,className:$e(m.root,o),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n},v,h,g&&i.props,{ownerState:p,children:[g?i.props.children:i,d?S.jsx("title",{children:d}):null]}))});o1.muiName="SvgIcon";function a1(e,t){function n(r,i){return S.jsx(o1,j({"data-testid":`${t}Icon`,ref:i},r,{children:e}))}return n.muiName=o1.muiName,x.memo(x.forwardRef(n))}const qse=a1(S.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Zse=a1(S.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Kse=a1(S.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Yse(e){return ln("MuiCheckbox",e)}const s1=yn("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Xse=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],Qse=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${Ce(r)}`,`size${Ce(i)}`]},a=wn(o,Yse,t);return j({},t,a)},Jse=ie(Hse,{shouldForwardProp:e=>Ey(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Ce(n.size)}`],n.color!=="default"&&t[`color${Ce(n.color)}`]]}})(({theme:e,ownerState:t})=>j({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:_o(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${s1.checked}, &.${s1.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${s1.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),ele=S.jsx(Zse,{}),tle=S.jsx(qse,{}),nle=S.jsx(Kse,{}),rle=x.forwardRef(function(t,n){var r,i;const o=Tn({props:t,name:"MuiCheckbox"}),{checkedIcon:a=ele,color:s="primary",icon:l=tle,indeterminate:u=!1,indeterminateIcon:c=nle,inputProps:d,size:f="medium",className:h}=o,g=Ne(o,Xse),p=u?c:l,v=u?c:a,m=j({},o,{color:s,indeterminate:u,size:f}),y=Qse(m);return S.jsx(Jse,j({type:"checkbox",inputProps:j({"data-indeterminate":u},d),icon:x.cloneElement(p,{fontSize:(r=p.props.fontSize)!=null?r:f}),checkedIcon:x.cloneElement(v,{fontSize:(i=v.props.fontSize)!=null?i:f}),ownerState:m,ref:n,className:$e(y.root,h)},g,{classes:y}))}),ile=hG({createStyledComponent:ie("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Tn({props:e,name:"MuiStack"})});function ole(e){return ln("MuiFormControlLabel",e)}const eu=yn("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function ale({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const sle=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],lle=e=>{const{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,a={root:["root",n&&"disabled",`labelPlacement${Ce(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return wn(a,ole,t)},ule=ie("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${eu.label}`]:t.label},t.root,t[`labelPlacement${Ce(n.labelPlacement)}`]]}})(({theme:e,ownerState:t})=>j({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${eu.disabled}`]:{cursor:"default"}},t.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},t.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},t.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${eu.label}`]:{[`&.${eu.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),cle=ie("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${eu.error}`]:{color:(e.vars||e).palette.error.main}})),dle=x.forwardRef(function(t,n){var r,i;const o=Tn({props:t,name:"MuiFormControlLabel"}),{className:a,componentsProps:s={},control:l,disabled:u,disableTypography:c,label:d,labelPlacement:f="end",required:h,slotProps:g={}}=o,p=Ne(o,sle),v=VR(),m=(r=u??l.props.disabled)!=null?r:v==null?void 0:v.disabled,y=h??l.props.required,E={disabled:m,required:y};["checked","name","onChange","value","inputRef"].forEach(F=>{typeof l.props[F]>"u"&&typeof o[F]<"u"&&(E[F]=o[F])});const b=ale({props:o,muiFormControl:v,states:["error"]}),R=j({},o,{disabled:m,labelPlacement:f,required:y,error:b.error}),M=lle(R),C=(i=g.typography)!=null?i:s.typography;let D=d;return D!=null&&D.type!==dn&&!c&&(D=S.jsx(dn,j({component:"span"},C,{className:$e(M.label,C==null?void 0:C.className),children:D}))),S.jsxs(ule,j({className:$e(M.root,a),ownerState:R,ref:n},p,{children:[x.cloneElement(l,E),y?S.jsxs(ile,{display:"block",children:[D,S.jsxs(cle,{ownerState:R,"aria-hidden":!0,className:M.asterisk,children:[" ","*"]})]}):D]}))}),fle=ie("button")(({ownerState:e,theme:t})=>({display:"flex",padding:"7px",fontSize:"16px",lineHeight:1,boxShadow:"none",borderStyle:"solid",borderWidth:"2px",borderRadius:"4px",color:t.palette.btnTxt.main,borderColor:t.palette.btnBorder.main,backgroundColor:t.palette.btnBg.main,"&:hover":{backgroundColor:t.palette.btnBg.light},"&:focus:focus-visible, &:focus-visible, &:focus":{outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"1px",outlineColor:t.palette.btnOutline.main,WebkitOutlineColor:"-webkit-focus-ring-color"},...e.active&&{backgroundColor:t.palette.btnBg.active,borderColor:t.palette.btnBorder.active},"& svg":{width:"16px",height:"16px",marginRight:"16px"},...e.size==="sm"&&{paddingTop:"5px",paddingBottom:"3px",height:"24px","& svg":{marginTop:"-1px"}},...e.size==="lg"&&{height:"32px"},...e.appearance==="link"&&{height:"24px",padding:"2px",color:t.palette.txtColour.main,border:"none","& svg":{width:"16px",height:"16px",marginRight:"16px",marginTop:"-1px"},backgroundColor:"transparent","&:hover":{backgroundColor:"transparent","&:not([disabled])":{cursor:"pointer"}},"&:focus:focus-visible, &:focus-visible, &:focus":{backgroundColor:"transparent",outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"1px",outlineColor:t.palette.btnOutline.main,WebkitOutlineColor:"-webkit-focus-ring-color"}}}));function YR({label:e,children:t,size:n,active:r=!1,sx:i={},appearance:o="button",...a}){return S.jsxs(fle,{className:je(ve("btn"),ve("btn-"+n)),type:"button",ownerState:{active:r,appearance:o,size:n},sx:i,...a,children:[t,e]})}YR.propTypes={label:A.string.isRequired,children:A.element.isRequired,size:A.string,active:A.bool,sx:A.object,appearance:A.string};const hle=Me(Sf,gt("TVBtn"))(YR);let XR=class extends x.Component{constructor(n){super(n);Mt(this,"handleCheckboxChange",n=>{this.setState({acceptTerms:n.target.checked})});Mt(this,"handleTabSwitch",n=>{this.setState({activeTab:n}),this.props.handleTabSwitch(n)});Mt(this,"handleDownload",async n=>{try{const r=n.downloadImageGET();if(r){const i=await fetch(r.url,{method:"GET"});if(!i.ok)throw new Error("Network response was not ok");const o=await i.blob(),a=window.URL.createObjectURL(o),s=document.createElement("a");s.href=a,s.download=r.filename,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}else{const i=n.downloadImagePOST(),a=await(await fetch(i.url,{method:"POST",headers:{"Content-Type":i.contentType},body:i.formData})).blob(),s=window.URL.createObjectURL(a),l=document.createElement("a");l.href=s,l.download=i.filename,document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(s)}}catch(r){console.error("Error downloading image:",r)}});this.state={acceptTerms:!1,activeTab:n.loadedTab||0}}componentDidUpdate(n){n.open&&!this.props.open&&this.setState({acceptTerms:!1,activeTab:0})}render(){const{windowId:n,open:r=!1,handleClose:i=()=>{},selectedTheme:o,currentCanvas:a,theme:s={}}=this.props,{activeTab:l,acceptTerms:u}=this.state,c=new Wt(a),d=c.getLicensingUrl(),f=c.hasDownloadImage(),h=f?S.jsxs("div",{className:je(ve("tab-nav")),"aria-label":"Tabbed options",role:"tablist",children:[S.jsx(Ka,{appearance:"tab",label:"Download image",size:"lg",theme:"light",onClick:()=>this.handleTabSwitch(0),id:n+"-dld-0",className:je(ve("tab-btn"),l===0?"active":""),sx:{marginTop:"10px"}}),S.jsx(Ka,{appearance:"tab",label:"License image",size:"lg",theme:"light",onClick:()=>this.handleTabSwitch(1),id:n+"-dld-1",className:je(ve("tab-btn"),l===1?"active":""),sx:{marginTop:"10px"}})]}):S.jsx(dn,{component:"h2",children:"Download unavailable"}),g=f?S.jsxs("div",{children:[l===0&&S.jsxs("div",{className:je(ve("tab-content")),role:"tabpanel","aria-labelledby":n+"-dld-0",style:{fontSize:"1rem",letterSpacing:"0.0125rem",lineHeight:"1.5"},children:[S.jsxs("p",{children:["This image is licensed for non-commercial use under a ",S.jsx("a",{href:"http://creativecommons.org/licenses/by-nc-nd/4.0/",children:"Creative Commons agreement"}),"."]}),S.jsx("p",{children:"Examples of non-commercial use are:"}),S.jsxs("ul",{children:[S.jsx("li",{children:"Research, private study, or for internal circulation within an educational organisation (such as a school, college or university)"}),S.jsx("li",{children:"Non-profit publications, personal websites, blogs, and social media"})]}),S.jsxs("p",{children:["You must agree to the ",S.jsx("a",{href:"http://creativecommons.org/licenses/by-nc-nd/4.0/",children:"Creative Commons terms and conditions"})," to download this image."]}),S.jsxs("div",{children:[S.jsx("div",{style:{borderBottom:"1px solid",borderColor:s.custom.dialog.underline,marginBottom:"14px",marginTop:"14px"},children:S.jsx(dle,{control:S.jsx(rle,{checked:u,onChange:this.handleCheckboxChange,name:"acceptTerms",color:"primary",sx:{color:s.custom.dialog.checkboxColour,"&.Mui-checked":{color:s.custom.dialog.checkboxColour},"& .MuiSvgIcon-root":{fontSize:24},"&.Mui-focusVisible":{borderRadius:"4px",outline:s.custom.standardOutline}}}),label:"I've read and agree to the terms and conditions.",sx:{marginLeft:"-3px",paddingBottom:"14px","& span.MuiCheckbox-sizeMedium":{padding:"0",marginRight:"10px",marginLeft:"4px"}}})}),S.jsx("div",{style:{marginLeft:"1px"},children:S.jsx(hle,{label:"Download image",size:"sm",appearance:"link",disabled:!u,onClick:()=>this.handleDownload(c),sx:{color:s.palette.urlColour.main,"&[disabled]":{color:s.palette.txtColour.main},"& svg":{width:"18px"}},children:S.jsx(F0,{theme:"light",appearance:u?"link":""})})})]})]}),l===1&&S.jsxs("div",{className:je(ve("tab-content")),role:"tabpanel","aria-labelledby":n+"-dld-1",style:{fontSize:"1rem",letterSpacing:"0.0125rem",lineHeight:"1.5"},children:[d.length>0&&S.jsxs(S.Fragment,{children:[S.jsxs("p",{children:["License and download a high-resolution image for reproductions up to A3 size from ",S.jsx("a",{href:"http://www.nationalgalleryimages.co.uk/",children:"the National Gallery Picture Library"}),"."]}),S.jsx("div",{className:je(ve("download-dialog-license-btn")),style:{marginTop:"1rem"},children:S.jsx("a",{href:d,children:"License image"})})]}),d.length==0&&S.jsxs(S.Fragment,{children:[S.jsxs("p",{children:["If you require a license for commercial use of this image, please use ",S.jsx("a",{href:"http://www.nationalgalleryimages.co.uk/",children:"the National Gallery Picture Library"})," or contact them using the following:"]}),S.jsxs("ul",{style:{marginTop:"1rem",marginBottom:"0"},children:[S.jsxs("li",{children:["Email: ",S.jsx("a",{href:"mailto:picture.library@nationalgallery.org.uk",children:"picture.library@nationalgallery.org.uk"})]}),S.jsx("li",{children:"Telephone: +44 (0)20 7747 5994"}),S.jsx("li",{children:"Fax: +44 (0)20 7747 5999"})]})]})]})]}):S.jsxs(dn,{component:"div",variant:"body1",children:[S.jsx(dn,{variant:"h6",style:{marginBottom:"8px"},children:"Why can't I download this image?"}),S.jsxs(dn,{component:"div",children:[S.jsx("p",{children:"The National Gallery has endeavoured to make as many images of the collection as possible available for non-commercial use. However, an image of this painting is not available to download. This may be due to third party copyright restrictions."}),S.jsxs("p",{children:["If you require a license for commercial use of this image, please use ",S.jsx("a",{href:"http://www.nationalgalleryimages.co.uk/",children:"the National Gallery Picture Library"})," or contact them using the following:"]}),S.jsxs("ul",{children:[S.jsxs("li",{children:["Email: ",S.jsx("a",{href:"mailto:picture.library@nationalgallery.org.uk",children:"picture.library@nationalgallery.org.uk"})]}),S.jsx("li",{children:"Telephone: +44 (0)20 7747 5994"}),S.jsx("li",{children:"Fax: +44 (0)20 7747 5999"})]})]})]});return S.jsx(fh,{windowId:n,label:"download-panel",selectedTheme:o,open:r,handleClose:i,titleElement:h,contentElement:g,layoutDef:{dock:"center",colourScheme:"light",dialogSize:"sm",borderRadius:"4px"}})}};XR.propTypes={windowId:A.string,selectedTheme:A.string,open:A.bool,loadedTab:A.number,handleClose:A.func,handleTabSwitch:A.func,theme:A.object,currentCanvas:A.object};const ple=Me(Qe((e,{windowId:t})=>({selectedTheme:Ie(e).selectedTheme,showIIIFmanifest:_r(e,{windowId:t}).showManifestUrl,theme:_d(e)})))(XR);var l1=new Map,ph=new WeakMap,QR=0,gle=void 0;function mle(e){return e?(ph.has(e)||(QR+=1,ph.set(e,QR.toString())),ph.get(e)):"0"}function vle(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?mle(e.root):e[t]}`).toString()}function yle(e){const t=vle(e);let n=l1.get(t);if(!n){const r=new Map;let i;const o=new IntersectionObserver(a=>{a.forEach(s=>{var l;const u=s.isIntersecting&&i.some(c=>s.intersectionRatio>=c);e.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=u),(l=r.get(s.target))==null||l.forEach(c=>{c(u,s)})})},e);i=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:r},l1.set(t,n)}return n}function wle(e,t,n={},r=gle){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const l=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:o,elements:a}=yle(n),s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),o.observe(e),function(){s.splice(s.indexOf(t),1),s.length===0&&(a.delete(e),o.unobserve(e)),a.size===0&&(o.disconnect(),l1.delete(i))}}function _le({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:a,initialInView:s,fallbackInView:l,onChange:u}={}){var c;const[d,f]=x.useState(null),h=x.useRef(u),[g,p]=x.useState({inView:!!s,entry:void 0});h.current=u,x.useEffect(()=>{if(a||!d)return;let E;return E=wle(d,(b,R)=>{p({inView:b,entry:R}),h.current&&h.current(b,R),R.isIntersecting&&o&&E&&(E(),E=void 0)},{root:i,rootMargin:r,threshold:e,trackVisibility:n,delay:t},l),()=>{E&&E()}},[Array.isArray(e)?e.toString():e,d,i,r,o,a,n,l,t]);const v=(c=g.entry)==null?void 0:c.target,m=x.useRef(void 0);!d&&v&&!o&&!a&&m.current!==v&&(m.current=v,p({inView:!!s,entry:void 0}));const y=[f,g.inView,g.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}const Tle=ie("div",{name:"IIIFCanvasPickerThumbnail",slot:"root"})({width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),Ele=ie("img",{name:"IIIFCanvasPickerThumbnail",slot:"image"})(()=>({height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%"})),JR=({border:e=!1,placeholder:t,style:n={},thumbnail:r=null,resource:i,maxHeight:o,maxWidth:a,thumbnailsConfig:s={},...l})=>{const{ref:u,inView:c}=_le(),[d,f]=x.useState(!1);x.useEffect(()=>{d||!c||f(!0)},[c,d]);const h=x.useMemo(()=>{if(r)return r;const p=lv(i,{...s,maxHeight:o,maxWidth:a});if(p&&p.url)return p},[i,r,a,o,s]);x.useMemo(()=>{const p={height:void 0,maxHeight:void 0,maxWidth:void 0,width:void 0};if(!h)return{...n,height:o,width:a};const{height:v,width:m}=h;if(v&&m)if(o&&v>o||a&&m>a){const y=m/v;o&&a?a/o<y?(p.height=Math.round(a/y),p.width=a):(p.height=o,p.width=Math.round(o*y)):o?(p.height=o,p.maxWidth=Math.round(o*y)):a&&(p.width=a,p.maxHeight=Math.round(a/y))}else p.width=m,p.height=v;else v&&!m?p.height=o:!v&&m?p.width=a:(p.width=a,p.height=o);return{...p,...n}},[h,a,o,n]);const{url:g=t}=d&&(r||h)||{};return S.jsx(Ele,{ownerState:{border:e},ref:u,alt:"",role:"presentation",src:g,...l})};JR.propTypes={border:A.bool,maxHeight:A.number.isRequired,maxWidth:A.number.isRequired,placeholder:A.string.isRequired,resource:A.object.isRequired,style:A.object,thumbnail:A.shape({height:A.number,url:A.string.isRequired,width:A.number}),thumbnailsConfig:A.object};class tu extends x.Component{static getUseableLabel(t,n){return t&&t.getLabel&&t.getLabel().length>0?t.getLabel().getValue():String(n+1)}label(){const{label:t,resource:n}=this.props;return t||tu.getUseableLabel(n)}render(){const{border:t,children:n,imagePlaceholder:r,maxHeight:i,maxWidth:o,resource:a,style:s,thumbnail:l,thumbnailsConfig:u}=this.props;return S.jsxs(Tle,{ownerState:this.props,children:[S.jsx(JR,{placeholder:r,thumbnail:l,resource:a,maxHeight:i,maxWidth:o,thumbnailsConfig:u,style:s,border:t}),n]})}}tu.propTypes={border:A.bool,children:A.node,imagePlaceholder:A.string,label:A.string,maxHeight:A.number,maxWidth:A.number,resource:A.object.isRequired,style:A.object,thumbnail:A.shape({height:A.number,url:A.string.isRequired,width:A.number}),thumbnailsConfig:A.object,variant:A.oneOf(["inside","outside"])},tu.defaultProps={border:!1,children:null,imagePlaceholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mMMDQmtBwADgwF/Op8FmAAAAABJRU5ErkJggg==",label:void 0,maxHeight:null,maxWidth:null,style:{},thumbnail:null,thumbnailsConfig:{},variant:null};const xle=Me(Qe(e=>({thumbnailsConfig:Ie(e).thumbnails})),gt("IIIFCanvasPickerThumbnail"))(tu),Sle=ie("div")(({theme:e})=>({width:"72px",height:"52px",backgroundColor:"#3B3C40",padding:"4px",border:"1px solid #3B3C40",[e.breakpoints.up("md")]:{width:"80px",height:"56px"},"&.selected":{border:"1px solid #FFF155",borderRadius:"2px"}}));let eI=class extends x.Component{render(){const{canvas:t,label:n,selected:r}=this.props;return S.jsx(Sle,{className:je(ve("thumbnail"),r?"selected":""),children:S.jsx(xle,{label:n,resource:t,maxHeight:56,maxWidth:80})})}};eI.propTypes={canvas:A.object.isRequired,label:A.string.isRequired,selected:A.bool};const ble=Me(Qe((e,{data:t})=>({...Ie(e).canvasNavigation||{}}),null),gt("CanvasPickerThumbnail"))(eI),Cle=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{transform:"scale(-1, 1) translate(-24, 0)"},x.createElement("path",{d:"M7.95027 21.3688C7.57432 21.7173 6.98535 21.6969 6.63478 21.3231C6.2842 20.9493 6.30477 20.3637 6.68071 20.0151L16.0497 11.328C16.4257 10.9794 17.0146 10.9998 17.3652 11.3736C17.7158 11.7475 17.6952 12.3331 17.3193 12.6817L7.95027 21.3688Z",fill:"#FFFFFF"}),x.createElement("path",{d:"M7.95027 2.63124C7.57432 2.28265 6.98535 2.3031 6.63478 2.67691C6.2842 3.05073 6.30477 3.63634 6.68071 3.98493L16.0497 12.672C16.4257 13.0206 17.0146 13.0002 17.3652 12.6264C17.7158 12.2525 17.6952 11.6669 17.3193 11.3183L7.95027 2.63124Z",fill:"#FFFFFF"}))),Ple=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{transform:"scale(-1, 1) translate(-24, 0)"},x.createElement("path",{d:"M7.95027 21.3688C7.57432 21.7173 6.98535 21.6969 6.63478 21.3231C6.2842 20.9493 6.30477 20.3637 6.68071 20.0151L16.0497 11.328C16.4257 10.9794 17.0146 10.9998 17.3652 11.3736C17.7158 11.7475 17.6952 12.3331 17.3193 12.6817L7.95027 21.3688Z",fill:"#000000"}),x.createElement("path",{d:"M7.95027 2.63124C7.57432 2.28265 6.98535 2.3031 6.63478 2.67691C6.2842 3.05073 6.30477 3.63634 6.68071 3.98493L16.0497 12.672C16.4257 13.0206 17.0146 13.0002 17.3652 12.6264C17.7158 12.2525 17.6952 11.6669 17.3193 11.3183L7.95027 2.63124Z",fill:"#000000"}))),Ole=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{transform:"scale(-1, 1) translate(-24, 0)"},x.createElement("path",{d:"M7.95027 21.3688C7.57432 21.7173 6.98535 21.6969 6.63478 21.3231C6.2842 20.9493 6.30477 20.3637 6.68071 20.0151L16.0497 11.328C16.4257 10.9794 17.0146 10.9998 17.3652 11.3736C17.7158 11.7475 17.6952 12.3331 17.3193 12.6817L7.95027 21.3688Z",fill:"#FFF155"}),x.createElement("path",{d:"M7.95027 2.63124C7.57432 2.28265 6.98535 2.3031 6.63478 2.67691C6.2842 3.05073 6.30477 3.63634 6.68071 3.98493L16.0497 12.672C16.4257 13.0206 17.0146 13.0002 17.3652 12.6264C17.7158 12.2525 17.6952 11.6669 17.3193 11.3183L7.95027 2.63124Z",fill:"#FFF155"})));function tI({theme:e,appearance:t,...n}){const r=t==="yellow"?Ole:e==="light"?Ple:Cle;return S.jsx(r,{...n})}tI.propTypes={theme:A.string.isRequired,appearance:A.string};const Rle=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M7.95027 21.3688C7.57432 21.7173 6.98535 21.6969 6.63478 21.3231C6.2842 20.9493 6.30477 20.3637 6.68071 20.0151L16.0497 11.328C16.4257 10.9794 17.0146 10.9998 17.3652 11.3736C17.7158 11.7475 17.6952 12.3331 17.3193 12.6817L7.95027 21.3688Z",fill:"#FFFFFF"}),x.createElement("path",{d:"M7.95027 2.63124C7.57432 2.28265 6.98535 2.3031 6.63478 2.67691C6.2842 3.05073 6.30477 3.63634 6.68071 3.98493L16.0497 12.672C16.4257 13.0206 17.0146 13.0002 17.3652 12.6264C17.7158 12.2525 17.6952 11.6669 17.3193 11.3183L7.95027 2.63124Z",fill:"#FFFFFF"})),Ile=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M7.95027 21.3688C7.57432 21.7173 6.98535 21.6969 6.63478 21.3231C6.2842 20.9493 6.30477 20.3637 6.68071 20.0151L16.0497 11.328C16.4257 10.9794 17.0146 10.9998 17.3652 11.3736C17.7158 11.7475 17.6952 12.3331 17.3193 12.6817L7.95027 21.3688Z",fill:"#000000"}),x.createElement("path",{d:"M7.95027 2.63124C7.57432 2.28265 6.98535 2.3031 6.63478 2.67691C6.2842 3.05073 6.30477 3.63634 6.68071 3.98493L16.0497 12.672C16.4257 13.0206 17.0146 13.0002 17.3652 12.6264C17.7158 12.2525 17.6952 11.6669 17.3193 11.3183L7.95027 2.63124Z",fill:"#000000"})),Ale=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M7.95027 21.3688C7.57432 21.7173 6.98535 21.6969 6.63478 21.3231C6.2842 20.9493 6.30477 20.3637 6.68071 20.0151L16.0497 11.328C16.4257 10.9794 17.0146 10.9998 17.3652 11.3736C17.7158 11.7475 17.6952 12.3331 17.3193 12.6817L7.95027 21.3688Z",fill:"#FFF155"}),x.createElement("path",{d:"M7.95027 2.63124C7.57432 2.28265 6.98535 2.3031 6.63478 2.67691C6.2842 3.05073 6.30477 3.63634 6.68071 3.98493L16.0497 12.672C16.4257 13.0206 17.0146 13.0002 17.3652 12.6264C17.7158 12.2525 17.6952 11.6669 17.3193 11.3183L7.95027 2.63124Z",fill:"#FFF155"}));function nI({theme:e,appearance:t,...n}){const r=t==="yellow"?Ale:e==="light"?Ile:Rle;return S.jsx(r,{...n})}nI.propTypes={theme:A.string.isRequired,appearance:A.string};const Dle=ie("div")({display:"flex",flexDirection:"row",margin:0,padding:0,overflow:"hidden",paddingTop:"4px",paddingBottom:"2px"}),Mle=ie("label")(({theme:e})=>({cursor:"pointer",display:"flex",alignItems:"center",marginLeft:"6px",marginRight:"6px",padding:"2px","&:focus-within":{outline:e.custom.standardOutline}})),Nle=ie("input")({transform:"scale(0)",opacity:0,position:"absolute"});let rI=class extends x.Component{constructor(t){super(t),this.containerRef=x.createRef(),this.state={visibleStartIndex:0,itemsToShow:2},this.handleSequenceChange=this.handleSequenceChange.bind(this),this.handleVariantChange=this.handleVariantChange.bind(this),this.handleNext=this.handleNext.bind(this),this.handlePrev=this.handlePrev.bind(this)}componentDidMount(){this.updateItemsToShow()}componentDidUpdate(t){t.windowWidth!==this.props.windowWidth&&this.updateItemsToShow()}getItemsToShow(t){return t<576?2:t<768?4:6}updateItemsToShow(){this.setState({itemsToShow:this.getItemsToShow(this.props.windowWidth)})}handleNext(){this.setState((t,n)=>{const{canvases:r}=n,{visibleStartIndex:i,itemsToShow:o}=t;return i+o<r.length?{visibleStartIndex:i+1}:null})}handlePrev(){this.setState(t=>t.visibleStartIndex>0?{visibleStartIndex:t.visibleStartIndex-1}:null)}getIdAndLabelOfCanvases(){const{canvases:t}=this.props;return t.map((n,r)=>({id:n.id,label:new Wt(n).getCanvasLabel()}))}handleSequenceChange(t){const{updateSequence:n}=this.props;n(t.target.value)}handleVariantChange(t,n){const{updateVariant:r}=this.props;r(n)}render(){const{windowId:t,canvases:n,setCanvas:r,selectedCanvasIds:i}=this.props,{visibleStartIndex:o,itemsToShow:a}=this.state,s=n.length>a,u=this.getIdAndLabelOfCanvases(n).slice(o,o+a);return S.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[S.jsx("div",{style:{width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"start"},children:s&&S.jsx(Sr,{label:o===0?"You have reached the start - no previous images":"Previous image",size:"lg",appearance:"borderless",colourScheme:"dark",tooltipOff:!0,onClick:this.handlePrev,className:o===0?"state-disabled":"",children:S.jsx(tI,{theme:"dark",appearance:o===0?"":"yellow"})})}),S.jsx(Dle,{children:u.map((c,d)=>{const f=()=>{r(t,c.id)},h=i.indexOf(c.id)!==-1;return S.jsxs(Mle,{children:[S.jsx(Nle,{type:"radio",name:"canvasPicker-"+t,value:c.id,checked:h,onChange:f}),S.jsx(ble,{label:c.label,canvas:n[d+o],selected:h})]},c.id)})}),S.jsx("div",{style:{width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"end"},children:s&&S.jsx(Sr,{label:o+a>=n.length?"You have reached the end - no further images":"Next image",size:"lg",appearance:"borderless",colourScheme:"dark",tooltipOff:!0,onClick:this.handleNext,className:o+a>=n.length?"state-disabled":"",children:S.jsx(nI,{theme:"dark",appearance:o+a>=n.length?"":"yellow"})})})]})}};rI.propTypes={updateSequence:A.func,updateVariant:A.func,windowId:A.string,canvases:A.array.isRequired,selectedCanvasIds:A.arrayOf(A.string),windowWidth:A.number,setCanvas:A.func};const Lle=Me(Qe((e,{id:t,windowId:n})=>{const r=yt(e,{windowId:n}),{config:i}=e,o=r.collectionPath||[],a=o&&o[o.length-1],s=Nr(e,{windowId:n});return{collection:a&&ct(e,{manifestId:a}),config:i,sequenceId:s&&s.id,sequences:pv(e,{windowId:n}),selectedTheme:Ie(e).selectedTheme,canvases:Lr(e,{windowId:n}),selectedCanvasIds:Di(e,{windowId:n})}},(e,{id:t,windowId:n})=>({showMultipart:()=>e(gO(n,{content:"collection",position:"right"})),updateSequence:r=>e(Qf(n,{sequenceId:r})),updateVariant:r=>e(b0(n,t,{variant:r})),setCanvas:(...r)=>e(ki(...r))}),null,{forwardRef:!0}),gt("CanvasPicker"))(rI),kle=ie(dn)(({theme:e})=>({marginBottom:"16px",display:"-webkit-box",lineHeight:"1.2",WebkitBoxOrient:"vertical",WebkitLineClamp:6,textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:8,textOverflow:"ellipsis"},[e.breakpoints.up("md")]:{paddingLeft:"56px",paddingRight:"56px"},"& .visually-hidden":{width:"1px !important",height:"1px !important",padding:"0 !important",margin:"-1px !important",overflow:"hidden !important",clip:"rect(0, 0, 0, 0) !important",whiteSpace:"nowrap !important",border:"0 !important"}}));let iI=class extends x.Component{render(){const{windowId:t,open:n=!1,handleClose:r=()=>{},selectedTheme:i,currentCanvas:o,windowWidth:a,canvasCount:s}=this.props,l=new Wt(o),u=l.getCanvasLabel(),c=l.getCaption();return S.jsx(fh,{windowId:t,label:"canvas-picker",selectedTheme:i,open:n,handleClose:r,titleElement:S.jsx(dn,{component:"h2",children:"Select image"}),contentElement:S.jsxs(dn,{component:"div",children:[S.jsxs(kle,{component:"div",variant:"body1",children:[s>1&&S.jsxs(S.Fragment,{children:[S.jsx("span",{"aria-hidden":"true",children:l.getOrder(s)}),S.jsx("span",{className:"visually-hidden",children:l.getScreenReaderOrder(s)})]}),u,u&&c&&S.jsx("br",{}),c]}),S.jsx(Lle,{id:`${t}-canvas-picker-content`,windowId:t,windowWidth:a})]}),layoutDef:{dock:"bottom",colourScheme:"dark",dialogSize:"lg",borderRadius:"0"}})}};iI.propTypes={showIIIFmanifest:A.bool,windowId:A.string,selectedTheme:A.string,open:A.bool,loadedTab:A.number,handleClose:A.func,handleTabSwitch:A.func,windowWidth:A.number,currentCanvas:A.object,canvasCount:A.number};const Fle=Me(Qe((e,{windowId:t})=>({selectedTheme:Ie(e).selectedTheme,showIIIFmanifest:_r(e,{windowId:t}).showManifestUrl})))(iI),oI={display:"flex",flex:"1",flexDirection:"row",minHeight:0},aI={display:"flex",flex:"1",flexDirection:"column",minHeight:0},Ble=ie(nh,{name:"Window",slot:"root"})(({ownerState:e,theme:t})=>({...aI,backgroundColor:t.palette.canvasBg.main,backgroundImage:"none",boxShadow:"none",borderRadius:0,height:"100%",overflow:"hidden",width:"100%"})),jle=ie("div",{name:"Window",slot:"row"})({...oI}),Wle=ie("div",{name:"Window",slot:"column"})(()=>({...aI})),zle=ie(ose,{name:"Window",slot:"primary"})(()=>({...oI,height:"300px",position:"relative"})),Hle=ie("div")(({theme:e})=>({width:"100%",height:"64px",position:"relative",[e.breakpoints.up("md")]:{height:"72px"}})),Ule=ie(Sr)(({theme:e})=>({position:"absolute",zIndex:1099,top:"16px",right:"20px",[e.breakpoints.up("md")]:{top:"24px",right:"32px"}}));let u1=class extends x.Component{constructor(n){super(n);Mt(this,"callCloseTheViewer",()=>{const{closeTheViewer:n}=this.props;n()});Mt(this,"showDownloadDialog",()=>{this.setState({downloadTabFocus:0,downloadDialogOpen:!0})});Mt(this,"hideDownloadDialog",()=>{this.setState({downloadDialogOpen:!1})});Mt(this,"changeDownloadTab",n=>{this.setState({downloadTabFocus:n})});Mt(this,"showInfoDialog",()=>{this.setState({infoTabFocus:0,infoDialogOpen:!0})});Mt(this,"hideInfoDialog",()=>{this.setState({infoDialogOpen:!1})});Mt(this,"changeInfoTab",n=>{this.setState({infoTabFocus:n})});Mt(this,"showCanvasPicker",()=>{this.setState({canvasPickerOpen:!0})});Mt(this,"hideCanvasPicker",()=>{this.setState({canvasPickerOpen:!1})});Mt(this,"changeZoomBtnsVisible",n=>{this.setState({zoomBtnsVisible:n})});this.state={componentWidth:0,canvasPickerOpen:!1,infoDialogOpen:!1,infoTabFocus:0,downloadDialogOpen:!1,downloadTabFocus:0,closeWindowVisible:!1,zoomBtnsVisible:!0},this.onResizeHandler=Ul(this.onResizeHandler.bind(this),67),this.componentRef=x.createRef(),this.closeThisWindow=this.closeThisWindow.bind(this)}static getDerivedStateFromError(n){return{error:n,hasError:!0}}componentDidMount(){window.addEventListener("resize",this.onResizeHandler),this.onResizeHandler()}componentDidUpdate(n){n.visibleWindows!==this.props.visibleWindows&&this.onResizeHandler()}componentWillUnmount(){window.removeEventListener("resize",this.onResizeHandler)}onResizeHandler(){if(this.componentRef.current){const n=this.componentRef.current.getBoundingClientRect();this.setState({componentWidth:n.width})}}closeThisWindow(){const{windowId:n,removeWindow:r}=this.props;r(n);const o=`.${ve("top-bar-placeholder")} button:first-child`,a=document.querySelector(o);a&&a.focus()}render(){const{focusWindow:n=()=>{},isFetching:r=!1,windowId:i,manifestError:o=null,selectedTheme:a,visibleWindows:s,canvases:l,selectedCanvasIds:u,showIIIFmanifest:c,closeLastWindow:d}=this.props,{error:f,hasError:h,infoDialogOpen:g,infoTabFocus:p,canvasPickerOpen:v,downloadTabFocus:m,downloadDialogOpen:y,componentWidth:E,zoomBtnsVisible:b}=this.state;if(h)return S.jsx(rh,{error:f,windowId:i});const R=g||v||y?-1:0,M=l.some(B=>new Wt(B).hasLabelOrCaption()),C=l.find(B=>B.id===u[0]),D=new Wt(C),F=D.getCanvasLabel(),L=D.getCaption();return S.jsxs(Ble,{ref:this.componentRef,onFocus:n,ownerState:this.props,component:"section",elevation:1,id:i,className:ve("window"),"aria-label":`Window: ${F}`,children:[o&&S.jsx(rh,{error:{stack:o},windowId:i}),S.jsxs(Hle,{className:ve("top-bar-placeholder"),children:[s>1&&S.jsx(Sr,{label:"Close this window",size:"lg",tabIndex:R,onClick:this.closeThisWindow,sx:{position:"absolute",zIndex:1100,top:"24px",right:"32px"},children:S.jsx(Jl,{theme:a})}),S.jsx(Ule,{label:"Close the viewer",size:"lg",tabIndex:R,onClick:this.callCloseTheViewer,children:S.jsx(Jl,{theme:a})})]}),S.jsx(jle,{children:S.jsx(Wle,{children:S.jsx(zle,{windowId:i,isFetching:r,canTabIn:R===0,handleZoomBtnVisibility:this.changeZoomBtnsVisible,parentWidth:E})})}),l.length>1&&S.jsx(Fle,{windowId:i,windowWidth:E,currentCanvas:C,canvasCount:l.length,open:v,handleClose:this.hideCanvasPicker}),(M||c)&&S.jsx(Tse,{windowId:i,label:F,caption:L,open:g,handleClose:this.hideInfoDialog,loadedTab:p,handleTabSwitch:this.changeInfoTab}),S.jsx(ple,{windowId:i,currentCanvas:C,open:y,handleClose:this.hideDownloadDialog,loadedTab:m,handleTabSwitch:this.changeDownloadTab}),S.jsx(tse,{windowId:i,windowWidth:E,handleOpenInfo:this.showInfoDialog,infoIsOpen:g,infoBtnVisible:M||c,handleShowCanvasPicker:this.showCanvasPicker,canvasPickerOpen:v,handleOpenDownload:this.showDownloadDialog,downloadIsOpen:y,handleCloseDownload:this.hideDownloadDialog,closeLastWindow:d,zoomBtnsVisible:b}),S.jsx(r1,{...this.props})]})}};u1.contextType=N0,u1.propTypes={showIIIFmanifest:A.bool,focusWindow:A.func,removeWindow:A.func,isFetching:A.bool,manifestError:A.string,windowId:A.string.isRequired,selectedTheme:A.string,visibleWindows:A.number,closeTheViewer:A.func,canvases:A.array.isRequired,selectedCanvasIds:A.arrayOf(A.string),closeLastWindow:A.func};const sI=Me(Qe((e,{windowId:t})=>({isFetching:dv(e,{windowId:t}).isFetching,label:Ra(e,{windowId:t}),manifestError:fv(e,{windowId:t}),view:yv(e,{windowId:t}),selectedCanvasIds:Di(e,{windowId:t}),selectedTheme:Ie(e).selectedTheme,visibleWindows:Ca(e).length,canvases:Lr(e,{windowId:t}),showIIIFmanifest:_r(e,{windowId:t}).showManifestUrl}),(e,{windowId:t})=>({focusWindow:()=>e(Xf(t)),removeWindow:n=>e(Jf(n))})),gt("Window_PW"))(u1);function Vle(e){return S.jsx(lV,j({},e,{defaultTheme:wy,themeId:xl}))}var ns={},rs={},Gle=yd,$le=uS,qle=Object.prototype,Zle=qle.hasOwnProperty,Kle=$le(function(e,t,n){Zle.call(e,n)?++e[n]:Gle(e,n,1)}),Yle=Kle,Xle=ol,Qle=Cy(),Jle=xa;function eue(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Xle(e,a);n(s,a)&&Qle(o,Jle(a,e),s)}return o}var tue=eue,nue=Ea,rue=cd,iue=tue,oue=p0;function aue(e,t){if(e==null)return{};var n=nue(oue(e),function(r){return[r]});return t=rue(t),iue(e,n,function(r,i){return t(r,i[0])})}var sue=aue;function lI(e){let t=null;return()=>(t==null&&(t=e()),t)}function lue(e,t){return e.filter(n=>n!==t)}function uue(e,t){const n=new Set,r=o=>n.add(o);e.forEach(r),t.forEach(r);const i=[];return n.forEach(o=>i.push(o)),i}class cue{enter(t){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=uue(this.entered.filter(r),[t]),n===0&&this.entered.length>0}leave(t){const n=this.entered.length;return this.entered=lue(this.entered.filter(this.isNodeInDocument),t),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class due{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,n){return n===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const uI="__NATIVE_FILE__",cI="__NATIVE_URL__",dI="__NATIVE_TEXT__",fI="__NATIVE_HTML__",hI=Object.freeze(Object.defineProperty({__proto__:null,FILE:uI,HTML:fI,TEXT:dI,URL:cI},Symbol.toStringTag,{value:"Module"}));function c1(e,t,n){const r=t.reduce((i,o)=>i||e.getData(o),"");return r??n}const d1={[uI]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[fI]:{exposeProperties:{html:(e,t)=>c1(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[cI]:{exposeProperties:{urls:(e,t)=>c1(e,t,"").split(`
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[dI]:{exposeProperties:{text:(e,t)=>c1(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function fue(e,t){const n=d1[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new due(n);return r.loadDataTransfer(t),r}function f1(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(d1).filter(n=>{const r=d1[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const hue=lI(()=>/firefox/i.test(navigator.userAgent)),pI=lI(()=>!!window.safari);class gI{interpolate(t){const{xs:n,ys:r,c1s:i,c2s:o,c3s:a}=this;let s=n.length-1;if(t===n[s])return r[s];let l=0,u=a.length-1,c;for(;l<=u;){c=Math.floor(.5*(l+u));const h=n[c];if(h<t)l=c+1;else if(h>t)u=c-1;else return r[c]}s=Math.max(0,u);const d=t-n[s],f=d*d;return r[s]+i[s]*d+o[s]*f+a[s]*d*f}constructor(t,n){const{length:r}=t,i=[];for(let h=0;h<r;h++)i.push(h);i.sort((h,g)=>t[h]<t[g]?-1:1);const o=[],a=[];let s,l;for(let h=0;h<r-1;h++)s=t[h+1]-t[h],l=n[h+1]-n[h],o.push(s),a.push(l/s);const u=[a[0]];for(let h=0;h<o.length-1;h++){const g=a[h],p=a[h+1];if(g*p<=0)u.push(0);else{s=o[h];const v=o[h+1],m=s+v;u.push(3*m/((m+v)/g+(m+s)/p))}}u.push(a[a.length-1]);const c=[],d=[];let f;for(let h=0;h<u.length-1;h++){f=a[h];const g=u[h],p=1/o[h],v=g+u[h+1]-f-f;c.push((f-g-v)*p),d.push(v*p*p)}this.xs=t,this.ys=n,this.c1s=u,this.c2s=c,this.c3s=d}}const pue=1;function mI(e){const t=e.nodeType===pue?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function gh(e){return{x:e.clientX,y:e.clientY}}function gue(e){var t;return e.nodeName==="IMG"&&(hue()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function mue(e,t,n,r){let i=e?t.width:n,o=e?t.height:r;return pI()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function vue(e,t,n,r,i){const o=gue(t),s=mI(o?e:t),l={x:n.x-s.x,y:n.y-s.y},{offsetWidth:u,offsetHeight:c}=e,{anchorX:d,anchorY:f}=r,{dragPreviewWidth:h,dragPreviewHeight:g}=mue(o,t,u,c),p=()=>{let M=new gI([0,.5,1],[l.y,l.y/c*g,l.y+g-c]).interpolate(f);return pI()&&o&&(M+=(window.devicePixelRatio-1)*g),M},v=()=>new gI([0,.5,1],[l.x,l.x/u*h,l.x+h-u]).interpolate(d),{offsetX:m,offsetY:y}=i,E=m===0||m,b=y===0||y;return{x:E?m:v(),y:b?y:p()}}let yue=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,n){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=n}};function wue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){wue(e,i,n[i])})}return e}class _ue{profile(){var t,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,n,r){this.sourceNodes.set(t,n),this.sourceNodeOptions.set(t,r);const i=a=>this.handleDragStart(a,t),o=a=>this.handleSelectStart(a);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",o),n.setAttribute("draggable","false")}}connectDropTarget(t,n){const r=a=>this.handleDragEnter(a,t),i=a=>this.handleDragOver(a,t),o=a=>this.handleDrop(a,t);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",o),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(t);return vI({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(t);return vI({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(hI).some(n=>hI[n]===t)}beginDragNativeItem(t,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=fue(t,n),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,n){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(t,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(t,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(t,n){this.dropTargetIds.unshift(n)}constructor(t,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const o=this.sourceNodes.get(i);return o&&mI(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const a=gh(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:s}=i,l=f1(s);if(this.monitor.isDragging()){if(s&&typeof s.setDragImage=="function"){const c=this.monitor.getSourceId(),d=this.sourceNodes.get(c),f=this.sourcePreviewNodes.get(c)||d;if(f){const{anchorX:h,anchorY:g,offsetX:p,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),E=vue(d,f,a,{anchorX:h,anchorY:g},{offsetX:p,offsetY:v});s.setDragImage(f,E.x,E.y)}}try{s==null||s.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(s&&!s.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:s}=i,l=f1(s);l&&this.beginDragNativeItem(l,s)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,o.length>0&&this.actions.hover(o,{clientOffset:gh(i)}),o.some(s=>this.monitor.canDropOnTarget(s))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=gh(i),this.scheduleHover(o),(o||[]).some(s=>this.monitor.canDropOnTarget(s))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;i.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else f1(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:gh(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))},this.options=new yue(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new cue(this.isNodeInDocument)}}const Tue=function(t,n,r){return new _ue(t,n,r)};function Ee(e,t,...n){if(Eue()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let r;if(t===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(t.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Eue(){return typeof process<"u"&&process.env.NODE_ENV==="production"}var ji;(function(e){e.mouse="mouse",e.touch="touch",e.keyboard="keyboard"})(ji||(ji={}));class xue{get delay(){var t;return(t=this.args.delay)!==null&&t!==void 0?t:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var t;return(t=this.args.ignoreContextMenu)!==null&&t!==void 0?t:!1}get enableHoverOutsideTarget(){var t;return(t=this.args.enableHoverOutsideTarget)!==null&&t!==void 0?t:!1}get enableKeyboardEvents(){var t;return(t=this.args.enableKeyboardEvents)!==null&&t!==void 0?t:!1}get enableMouseEvents(){var t;return(t=this.args.enableMouseEvents)!==null&&t!==void 0?t:!1}get enableTouchEvents(){var t;return(t=this.args.enableTouchEvents)!==null&&t!==void 0?t:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var t,n,r,i;return(i=(r=(t=this.args)===null||t===void 0?void 0:t.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var t,n,r,i;return(i=(r=(t=this.args)===null||t===void 0?void 0:t.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var t;if(!((t=this.context)===null||t===void 0)&&t.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var t;return((t=this.args)===null||t===void 0?void 0:t.rootElement)||this.document}constructor(t,n){this.args=t,this.context=n}}function Sue(e,t,n,r){return Math.sqrt(Math.pow(Math.abs(n-e),2)+Math.pow(Math.abs(r-t),2))}function bue(e,t,n,r,i){if(!i)return!1;const o=Math.atan2(r-t,n-e)*180/Math.PI+180;for(let a=0;a<i.length;++a){const s=i[a];if(s&&(s.start==null||o>=s.start)&&(s.end==null||o<=s.end))return!0}return!1}const Cue={Left:1,Right:2,Center:4},Pue={Left:0,Center:1,Right:2};function h1(e){return e.button===void 0||e.button===Pue.Left}function Oue(e){return e.buttons===void 0||(e.buttons&Cue.Left)===0}function yI(e){return!!e.targetTouches}const Rue=1;function Iue(e){const t=e.nodeType===Rue?e:e.parentElement;if(!t)return;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function Aue(e,t){if(e.targetTouches.length===1)return mh(e.targetTouches[0]);if(t&&e.touches.length===1&&e.touches[0].target===t.target)return mh(e.touches[0])}function mh(e,t){return yI(e)?Aue(e,t):{x:e.clientX,y:e.clientY}}const wI=(()=>{let e=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return e=!0,!0}}))}catch{}return e})(),nu={[ji.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[ji.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[ji.keyboard]:{keydown:"keydown"}};class ru{profile(){var t;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get document(){return this.options.document}setup(){const t=this.options.rootElement;t&&(Ee(!ru.isSetUp,"Cannot have two Touch backends at the same time."),ru.isSetUp=!0,this.addEventListener(t,"start",this.getTopMoveStartHandler()),this.addEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(t,"move",this.handleTopMove),this.addEventListener(t,"move",this.handleTopMoveCapture,!0),this.addEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(t,"keydown",this.handleCancelOnEscape,!0))}teardown(){const t=this.options.rootElement;t&&(ru.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(t,"start",this.handleTopMoveStart),this.removeEventListener(t,"move",this.handleTopMoveCapture,!0),this.removeEventListener(t,"move",this.handleTopMove),this.removeEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(t,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(t,n,r,i=!1){const o=wI?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(a){const s=nu[a][n];s&&t.addEventListener(s,r,o)})}removeEventListener(t,n,r,i=!1){const o=wI?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(a){const s=nu[a][n];s&&t.removeEventListener(s,r,o)})}connectDragSource(t,n){const r=this.handleMoveStart.bind(this,t);return this.sourceNodes.set(t,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(t),this.removeEventListener(n,"start",r)}}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDropTarget(t,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=o=>{if(!this.document||!r||!this.monitor.isDragging())return;let a;switch(o.type){case nu.mouse.move:a={x:o.clientX,y:o.clientY};break;case nu.touch.move:var s,l;a={x:((s=o.touches[0])===null||s===void 0?void 0:s.clientX)||0,y:((l=o.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const u=a!=null?this.document.elementFromPoint(a.x,a.y):void 0,c=u&&n.contains(u);if(u===n||c)return this.handleMove(o,t)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(t,n),()=>{this.document&&(this.targetNodes.delete(t),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(t){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=t,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{t&&!t.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!t||!t.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(t.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(t,n,r){this.getSourceClientOffset=i=>{const o=this.sourceNodes.get(i);return o&&Iue(o)},this.handleTopMoveStartCapture=i=>{h1(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!h1(i))return;const o=mh(i);o&&(yI(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=o),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!h1(i))return;const o=i.type===nu.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),o),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,o)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(o)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:o,dragOverTargetIds:a}=this,s=this.options.enableHoverOutsideTarget,l=mh(i,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&bue(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&o&&Sue(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(o,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const u=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(u),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const c=(a||[]).map(g=>this.targetNodes.get(g)).filter(g=>!!g),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,c):this.document.elementsFromPoint(l.x,l.y),f=[];for(const g in d){if(!d.hasOwnProperty(g))continue;let p=d[g];for(p!=null&&f.push(p);p;)p=p.parentElement,p&&f.indexOf(p)===-1&&f.push(p)}const h=f.filter(g=>c.indexOf(g)>-1).map(g=>this._getDropTargetId(g)).filter(g=>!!g).filter((g,p,v)=>v.indexOf(g)===p);if(s)for(const g in this.targetNodes){const p=this.targetNodes.get(g);if(u&&p&&p.contains(u)&&h.indexOf(g)===-1){h.unshift(g);break}}h.reverse(),this.actions.hover(h,{clientOffset:l})},this._getDropTargetId=i=>{const o=this.targetNodes.keys();let a=o.next();for(;a.done===!1;){const s=a.value;if(i===this.targetNodes.get(s))return s;a=o.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!Oue(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new xue(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(ji.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(ji.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(ji.keyboard)}}const Due=function(t,n={},r={}){return new ru(t,n,r)};var _I=e=>{throw TypeError(e)},TI=(e,t,n)=>t.has(e)||_I("Cannot "+n),_e=(e,t,n)=>(TI(e,t,"read from private field"),n?n.call(e):t.get(e)),ur=(e,t,n)=>t.has(e)?_I("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ao=(e,t,n,r)=>(TI(e,t,"write to private field"),t.set(e,n),n),Wi,Mue=class{constructor(){ur(this,Wi),this.register=e=>{_e(this,Wi).push(e)},this.unregister=e=>{for(;_e(this,Wi).indexOf(e)!==-1;)_e(this,Wi).splice(_e(this,Wi).indexOf(e),1)},this.backendChanged=e=>{for(let t of _e(this,Wi))t.backendChanged(e)},Ao(this,Wi,[])}};Wi=new WeakMap;var Hn,iu,Un,oi,Do,p1,g1,m1,vh,yh,ou,EI=class tp{constructor(t,n,r){if(ur(this,Hn),ur(this,iu),ur(this,Un),ur(this,oi),ur(this,Do),ur(this,p1,(i,o,a)=>{if(!a.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(a)}`);let s=a.backend(i,o,a.options),l=a.id,u=!a.id&&s&&s.constructor;if(u&&(l=s.constructor.name),!l)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(a)}
        see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(u&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
        This might be unsupported in the future, please specify 'id' explicitely for every backend.`),_e(this,Un)[l])throw new Error(`You must specify a unique 'id' property in your Backend entry:
        ${JSON.stringify(a)} (conflicts with: ${JSON.stringify(_e(this,Un)[l])})`);return{id:l,instance:s,preview:a.preview??!1,transition:a.transition,skipDispatchOnTransition:a.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(tp.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");tp.isSetUp=!0,_e(this,g1).call(this,window),_e(this,Un)[_e(this,Hn)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(tp.isSetUp=!1,_e(this,m1).call(this,window),_e(this,Un)[_e(this,Hn)].instance.teardown())},this.connectDragSource=(i,o,a)=>_e(this,ou).call(this,"connectDragSource",i,o,a),this.connectDragPreview=(i,o,a)=>_e(this,ou).call(this,"connectDragPreview",i,o,a),this.connectDropTarget=(i,o,a)=>_e(this,ou).call(this,"connectDropTarget",i,o,a),this.profile=()=>_e(this,Un)[_e(this,Hn)].instance.profile(),this.previewEnabled=()=>_e(this,Un)[_e(this,Hn)].preview,this.previewsList=()=>_e(this,iu),this.backendsList=()=>_e(this,oi),ur(this,g1,i=>{for(let o of _e(this,oi))o.transition&&i.addEventListener(o.transition.event,_e(this,vh))}),ur(this,m1,i=>{for(let o of _e(this,oi))o.transition&&i.removeEventListener(o.transition.event,_e(this,vh))}),ur(this,vh,i=>{var a;let o=_e(this,Hn);if(_e(this,oi).some(s=>s.id!==_e(this,Hn)&&s.transition&&s.transition.check(i)?(Ao(this,Hn,s.id),!0):!1),_e(this,Hn)!==o){_e(this,Un)[o].instance.teardown();for(let[c,d]of Object.entries(_e(this,Do)))d.unsubscribe(),d.unsubscribe=_e(this,yh).call(this,d.func,...d.args);_e(this,iu).backendChanged(this);let s=_e(this,Un)[_e(this,Hn)];if(s.instance.setup(),s.skipDispatchOnTransition)return;let l=i.constructor,u=new l(i.type,i);(a=i.target)==null||a.dispatchEvent(u)}}),ur(this,yh,(i,o,a,s)=>_e(this,Un)[_e(this,Hn)].instance[i](o,a,s)),ur(this,ou,(i,o,a,s)=>{let l=`${i}_${o}`,u=_e(this,yh).call(this,i,o,a,s);return _e(this,Do)[l]={func:i,args:[o,a,s],unsubscribe:u},()=>{_e(this,Do)[l].unsubscribe(),delete _e(this,Do)[l]}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
        see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);Ao(this,iu,new Mue),Ao(this,Un,{}),Ao(this,oi,[]);for(let i of r.backends){let o=_e(this,p1).call(this,t,n,i);_e(this,Un)[o.id]=o,_e(this,oi).push(o)}Ao(this,Hn,_e(this,oi)[0].id),Ao(this,Do,{})}};Hn=new WeakMap,iu=new WeakMap,Un=new WeakMap,oi=new WeakMap,Do=new WeakMap,p1=new WeakMap,g1=new WeakMap,m1=new WeakMap,vh=new WeakMap,yh=new WeakMap,ou=new WeakMap,EI.isSetUp=!1;var Nue=EI,xI=(e,t,n)=>new Nue(e,t,n),au=(e,t)=>({event:e,check:t}),SI=au("touchstart",e=>{let t=e;return t.touches!==null&&t.touches!==void 0}),Lue=au("dragstart",e=>e.type.indexOf("drag")!==-1||e.type.indexOf("drop")!==-1),kue=au("mousedown",e=>e.type.indexOf("touch")===-1&&e.type.indexOf("mouse")!==-1),bI=au("pointerdown",e=>e.pointerType==="mouse"),Fue={backends:[{id:"html5",backend:Tue,transition:bI},{id:"touch",backend:Due,options:{enableMouseEvents:!0},preview:!0,transition:SI}]};const Bue=Cn(Object.freeze(Object.defineProperty({__proto__:null,HTML5toTouch:Fue},Symbol.toStringTag,{value:"Module"}))),su=x.createContext({dragDropManager:void 0});function cr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var CI=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),v1=function(){return Math.random().toString(36).substring(7).split("").join(".")},PI={INIT:"@@redux/INIT"+v1(),REPLACE:"@@redux/REPLACE"+v1(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+v1()}};function jue(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function OI(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(cr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(cr(1));return n(OI)(e,t)}if(typeof e!="function")throw new Error(cr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(cr(3));return o}function d(p){if(typeof p!="function")throw new Error(cr(4));if(l)throw new Error(cr(5));var v=!0;return u(),s.push(p),function(){if(v){if(l)throw new Error(cr(6));v=!1,u();var y=s.indexOf(p);s.splice(y,1),a=null}}}function f(p){if(!jue(p))throw new Error(cr(7));if(typeof p.type>"u")throw new Error(cr(8));if(l)throw new Error(cr(9));try{l=!0,o=i(o,p)}finally{l=!1}for(var v=a=s,m=0;m<v.length;m++){var y=v[m];y()}return p}function h(p){if(typeof p!="function")throw new Error(cr(10));i=p,f({type:PI.REPLACE})}function g(){var p,v=d;return p={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(cr(11));function E(){y.next&&y.next(c())}E();var b=v(E);return{unsubscribe:b}}},p[CI]=function(){return this},p}return f({type:PI.INIT}),r={dispatch:f,subscribe:d,getState:c,replaceReducer:h},r[CI]=g,r}function Wue(e,t,n){return t.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,e)}function zue(e,t){return e.filter(n=>n!==t)}function RI(e){return typeof e=="object"}function Hue(e,t){const n=new Map,r=o=>{n.set(o,n.has(o)?n.get(o)+1:1)};e.forEach(r),t.forEach(r);const i=[];return n.forEach((o,a)=>{o===1&&i.push(a)}),i}function Uue(e,t){return e.filter(n=>t.indexOf(n)>-1)}const y1="dnd-core/INIT_COORDS",wh="dnd-core/BEGIN_DRAG",w1="dnd-core/PUBLISH_DRAG_SOURCE",_h="dnd-core/HOVER",Th="dnd-core/DROP",Eh="dnd-core/END_DRAG";function II(e,t){return{type:y1,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Vue={type:y1,payload:{clientOffset:null,sourceClientOffset:null}};function Gue(e){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:o,getSourceClientOffset:a}=r,s=e.getMonitor(),l=e.getRegistry();e.dispatch(II(o)),$ue(n,s,l);const u=Kue(n,s);if(u==null){e.dispatch(Vue);return}let c=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");que(a),c=a(u)}e.dispatch(II(o,c));const f=l.getSource(u).beginDrag(s,u);if(f==null)return;Zue(f),l.pinSource(u);const h=l.getSourceType(u);return{type:wh,payload:{itemType:h,item:f,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!i}}}}function $ue(e,t,n){Ee(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){Ee(n.getSource(r),"Expected sourceIds to be registered.")})}function que(e){Ee(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Zue(e){Ee(RI(e),"Item must be an object.")}function Kue(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Yue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Yue(e,i,n[i])})}return e}function Que(e){return function(n={}){const r=e.getMonitor(),i=e.getRegistry();Jue(r),nce(r).forEach((a,s)=>{const l=ece(a,s,i,r),u={type:Th,payload:{dropResult:Xue({},n,l)}};e.dispatch(u)})}}function Jue(e){Ee(e.isDragging(),"Cannot call drop while not dragging."),Ee(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ece(e,t,n,r){const i=n.getTarget(e);let o=i?i.drop(r,e):void 0;return tce(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function tce(e){Ee(typeof e>"u"||RI(e),"Drop result must either be an object or undefined.")}function nce(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function rce(e){return function(){const n=e.getMonitor(),r=e.getRegistry();ice(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:Eh}}}function ice(e){Ee(e.isDragging(),"Cannot call endDrag while not dragging.")}function _1(e,t){return t===null?e===null:Array.isArray(e)?e.some(n=>n===t):e===t}function oce(e){return function(n,{clientOffset:r}={}){ace(n);const i=n.slice(0),o=e.getMonitor(),a=e.getRegistry(),s=o.getItemType();return lce(i,a,s),sce(i,o,a),uce(i,o,a),{type:_h,payload:{targetIds:i,clientOffset:r||null}}}}function ace(e){Ee(Array.isArray(e),"Expected targetIds to be an array.")}function sce(e,t,n){Ee(t.isDragging(),"Cannot call hover while not dragging."),Ee(!t.didDrop(),"Cannot call hover after drop.");for(let r=0;r<e.length;r++){const i=e[r];Ee(e.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const o=n.getTarget(i);Ee(o,"Expected targetIds to be registered.")}}function lce(e,t,n){for(let r=e.length-1;r>=0;r--){const i=e[r],o=t.getTargetType(i);_1(o,n)||e.splice(r,1)}}function uce(e,t,n){e.forEach(function(r){n.getTarget(r).hover(t,r)})}function cce(e){return function(){if(e.getMonitor().isDragging())return{type:w1}}}function dce(e){return{beginDrag:Gue(e),publishDragSource:cce(e),hover:oce(e),drop:Que(e),endDrag:rce(e)}}class fce{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:n}=this.store;function r(o){return(...a)=>{const s=o.apply(t,a);typeof s<"u"&&n(s)}}const i=dce(this);return Object.keys(i).reduce((o,a)=>{const s=i[a];return o[a]=r(s),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}}function hce(e,t){return{x:e.x+t.x,y:e.y+t.y}}function AI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function pce(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:AI(hce(t,r),n)}function gce(e){const{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:AI(t,n)}const lu=[],T1=[];lu.__IS_NONE__=!0,T1.__IS_ALL__=!0;function mce(e,t){return e===lu?!1:e===T1||typeof t>"u"?!0:Uue(t,e).length>0}class vce{subscribeToStateChange(t,n={}){const{handlerIds:r}=n;Ee(typeof t=="function","listener must be a function."),Ee(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const o=()=>{const a=this.store.getState(),s=a.stateId;try{s===i||s===i+1&&!mce(a.dirtyHandlerIds,r)||t()}finally{i=s}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Ee(typeof t=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,t())};return this.store.subscribe(r)}canDragSource(t){if(!t)return!1;const n=this.registry.getSource(t);return Ee(n,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:n.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const n=this.registry.getTarget(t);if(Ee(n,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(t),i=this.getItemType();return _1(r,i)&&n.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const n=this.registry.getSource(t,!0);if(Ee(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(t),i=this.getItemType();return r!==i?!1:n.isDragging(this,t)}isOverTarget(t,n={shallow:!1}){if(!t)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),o=this.getItemType();if(o&&!_1(i,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(t);return r?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return pce(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return gce(this.store.getState().dragOffset)}constructor(t,n){this.store=t,this.registry=n}}const DI=typeof global<"u"?global:self,MI=DI.MutationObserver||DI.WebKitMutationObserver;function NI(e){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),e()}}}function yce(e){let t=1;const n=new MI(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const wce=typeof MI=="function"?yce:NI;class _ce{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let r=0,i=t.length-this.index;r<i;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=wce(this.flush),this.requestErrorThrow=NI(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Tce{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class Ece{create(t){const n=this.freeTasks,r=n.length?n.pop():new Tce(this.onError,i=>n[n.length]=i);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const LI=new _ce,xce=new Ece(LI.registerPendingError);function Sce(e){LI.enqueueTask(xce.create(e))}const E1="dnd-core/ADD_SOURCE",x1="dnd-core/ADD_TARGET",S1="dnd-core/REMOVE_SOURCE",xh="dnd-core/REMOVE_TARGET";function bce(e){return{type:E1,payload:{sourceId:e}}}function Cce(e){return{type:x1,payload:{targetId:e}}}function Pce(e){return{type:S1,payload:{sourceId:e}}}function Oce(e){return{type:xh,payload:{targetId:e}}}function Rce(e){Ee(typeof e.canDrag=="function","Expected canDrag to be a function."),Ee(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Ee(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Ice(e){Ee(typeof e.canDrop=="function","Expected canDrop to be a function."),Ee(typeof e.hover=="function","Expected hover to be a function."),Ee(typeof e.drop=="function","Expected beginDrag to be a function.")}function b1(e,t){if(t&&Array.isArray(e)){e.forEach(n=>b1(n,!1));return}Ee(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var dr;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(dr||(dr={}));let Ace=0;function Dce(){return Ace++}function Mce(e){const t=Dce().toString();switch(e){case dr.SOURCE:return`S${t}`;case dr.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function kI(e){switch(e[0]){case"S":return dr.SOURCE;case"T":return dr.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function FI(e,t){const n=e.entries();let r=!1;do{const{done:i,value:[,o]}=n.next();if(o===t)return!0;r=!!i}while(!r);return!1}class Nce{addSource(t,n){b1(t),Rce(n);const r=this.addHandler(dr.SOURCE,t,n);return this.store.dispatch(bce(r)),r}addTarget(t,n){b1(t,!0),Ice(n);const r=this.addHandler(dr.TARGET,t,n);return this.store.dispatch(Cce(r)),r}containsHandler(t){return FI(this.dragSources,t)||FI(this.dropTargets,t)}getSource(t,n=!1){return Ee(this.isSourceId(t),"Expected a valid source ID."),n&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Ee(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Ee(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Ee(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return kI(t)===dr.SOURCE}isTargetId(t){return kI(t)===dr.TARGET}removeSource(t){Ee(this.getSource(t),"Expected an existing source."),this.store.dispatch(Pce(t)),Sce(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Ee(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Oce(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const n=this.getSource(t);Ee(n,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=n}unpinSource(){Ee(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,n,r){const i=Mce(t);return this.types.set(i,n),t===dr.SOURCE?this.dragSources.set(i,r):t===dr.TARGET&&this.dropTargets.set(i,r),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Lce=(e,t)=>e===t;function kce(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Fce(e,t,n=Lce){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Bce(e=lu,t){switch(t.type){case _h:break;case E1:case x1:case xh:case S1:return lu;case wh:case w1:case Eh:case Th:default:return T1}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=Hue(n,r);if(!(i.length>0||!Fce(n,r)))return lu;const a=r[r.length-1],s=n[n.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function jce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){jce(e,i,n[i])})}return e}const BI={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function zce(e=BI,t){const{payload:n}=t;switch(t.type){case y1:case wh:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case _h:return kce(e.clientOffset,n.clientOffset)?e:Wce({},e,{clientOffset:n.clientOffset});case Eh:case Th:return BI;default:return e}}function Hce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function is(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Hce(e,i,n[i])})}return e}const Uce={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Vce(e=Uce,t){const{payload:n}=t;switch(t.type){case wh:return is({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case w1:return is({},e,{isSourcePublic:!0});case _h:return is({},e,{targetIds:n.targetIds});case xh:return e.targetIds.indexOf(n.targetId)===-1?e:is({},e,{targetIds:zue(e.targetIds,n.targetId)});case Th:return is({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Eh:return is({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Gce(e=0,t){switch(t.type){case E1:case x1:return e+1;case S1:case xh:return e-1;default:return e}}function $ce(e=0){return e+1}function qce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){qce(e,i,n[i])})}return e}function Kce(e={},t){return{dirtyHandlerIds:Bce(e.dirtyHandlerIds,{type:t.type,payload:Zce({},t.payload,{prevTargetIds:Wue(e,"dragOperation.targetIds",[])})}),dragOffset:zce(e.dragOffset,t),refCount:Gce(e.refCount,t),dragOperation:Vce(e.dragOperation,t),stateId:$ce(e.stateId)}}function Yce(e,t=void 0,n={},r=!1){const i=Xce(r),o=new vce(i,new Nce(i)),a=new fce(i,o),s=e(a,t,n);return a.receiveBackend(s),a}function Xce(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return OI(Kce,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function Qce(e,t){if(e==null)return{};var n=Jce(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jce(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}let jI=0;const Sh=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var WI=x.memo(function(t){var{children:n}=t,r=Qce(t,["children"]);const[i,o]=ede(r);return x.useEffect(()=>{if(o){const a=zI();return++jI,()=>{--jI===0&&(a[Sh]=null)}}},[]),S.jsx(su.Provider,{value:i,children:n})});function ede(e){if("manager" in e)return[{dragDropManager:e.manager},!1];const t=tde(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}function tde(e,t=zI(),n,r){const i=t;return i[Sh]||(i[Sh]={dragDropManager:Yce(e,t,n,r)}),i[Sh]}function zI(){return typeof global<"u"?global:window}const nde=x.memo(function({connect:t,src:n}){return x.useEffect(()=>{if(typeof Image>"u")return;let r=!1;const i=new Image;return i.src=n,i.onload=()=>{t(i),r=!0},()=>{r&&t(null)}}),null});var rde=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n};const ide=He(rde),Mo=typeof window<"u"?x.useLayoutEffect:x.useEffect;function HI(e,t,n){const[r,i]=x.useState(()=>t(e)),o=x.useCallback(()=>{const a=t(e);ide(r,a)||(i(a),n&&n())},[r,e,n]);return Mo(o),[r,o]}function ode(e,t,n){const[r,i]=HI(e,t,n);return Mo(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),r}function UI(e,t,n){return ode(t,e||(()=>({})),()=>n.reconnect())}function VI(e,t){const n=[...t||[]];return t==null&&typeof e!="function"&&n.push(e),x.useMemo(()=>typeof e=="function"?e():e,n)}function ade(e){return x.useMemo(()=>e.hooks.dragSource(),[e])}function sde(e){return x.useMemo(()=>e.hooks.dragPreview(),[e])}let C1=!1,P1=!1;class lde{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Ee(!C1,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return C1=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{C1=!1}}isDragging(){if(!this.sourceId)return!1;Ee(!P1,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return P1=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{P1=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let O1=!1;class ude{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;Ee(!O1,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return O1=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{O1=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function cde(e,t,n){const r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function dde(e,t,n){const r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function R1(e,t,n,r){let i;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l<o.length;l++){const u=o[l];if(!s(u))return!1;const c=e[u],d=t[u];if(i=void 0,i===!1||i===void 0&&c!==d)return!1}return!0}function I1(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fde(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function hde(e){return(t=null,n=null)=>{if(!x.isValidElement(t)){const o=t;return e(o,n),o}const r=t;return fde(r),pde(r,n?o=>e(o,n):e)}}function GI(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const i=hde(r);t[n]=()=>i}}),t}function $I(e,t){typeof e=="function"?e(t):e.current=t}function pde(e,t){const n=e.ref;return Ee(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?x.cloneElement(e,{ref:r=>{$I(n,r),$I(t,r)}}):x.cloneElement(e,{ref:t})}class gde{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,r=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!R1(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!R1(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=GI({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,I1(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,I1(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class mde{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!R1(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=GI({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,I1(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function zi(){const{dragDropManager:e}=x.useContext(su);return Ee(e!=null,"Expected drag drop context"),e}function vde(e,t){const n=zi(),r=x.useMemo(()=>new gde(n.getBackend()),[n]);return Mo(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),Mo(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function yde(){const e=zi();return x.useMemo(()=>new lde(e),[e])}class wde{beginDrag(){const t=this.spec,n=this.monitor;let r=null;return typeof t.item=="object"?r=t.item:typeof t.item=="function"?r=t.item(n):r={},r??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(n):!0}isDragging(t,n){const r=this.spec,i=this.monitor,{isDragging:o}=r;return o?o(i):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,r=this.connector,{end:i}=t;i&&i(n.getItem(),n),r.reconnect()}constructor(t,n,r){this.spec=t,this.monitor=n,this.connector=r}}function _de(e,t,n){const r=x.useMemo(()=>new wde(e,t,n),[t,n]);return x.useEffect(()=>{r.spec=e},[e]),r}function Tde(e){return x.useMemo(()=>{const t=e.type;return Ee(t!=null,"spec.type must be defined"),t},[e])}function Ede(e,t,n){const r=zi(),i=_de(e,t,n),o=Tde(e);Mo(function(){if(o!=null){const[s,l]=dde(o,i,r);return t.receiveHandlerId(s),n.receiveHandlerId(s),l}},[r,t,n,i,o])}function qI(e,t){const n=VI(e,t);Ee(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=yde(),i=vde(n.options,n.previewOptions);return Ede(n,r,i),[UI(n.collect,r,i),ade(i),sde(i)]}function ZI(e){const n=zi().getMonitor(),[r,i]=HI(n,e);return x.useEffect(()=>n.subscribeToOffsetChange(i)),x.useEffect(()=>n.subscribeToStateChange(i)),r}function xde(e){return x.useMemo(()=>e.hooks.dropTarget(),[e])}function Sde(e){const t=zi(),n=x.useMemo(()=>new mde(t.getBackend()),[t]);return Mo(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function bde(){const e=zi();return x.useMemo(()=>new ude(e),[e])}function Cde(e){const{accept:t}=e;return x.useMemo(()=>(Ee(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Pde{canDrop(){const t=this.spec,n=this.monitor;return t.canDrop?t.canDrop(n.getItem(),n):!0}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}}function Ode(e,t){const n=x.useMemo(()=>new Pde(e,t),[t]);return x.useEffect(()=>{n.spec=e},[e]),n}function Rde(e,t,n){const r=zi(),i=Ode(e,t),o=Cde(e);Mo(function(){const[s,l]=cde(o,i,r);return t.receiveHandlerId(s),n.receiveHandlerId(s),l},[r,t,i,n,o.map(a=>a.toString()).join("|")])}function KI(e,t){const n=VI(e,t),r=bde(),i=Sde(n.options);return Rde(n,r,i),[UI(n.collect,r,i),xde(i)]}const bh=Cn(Object.freeze(Object.defineProperty({__proto__:null,DndContext:su,DndProvider:WI,DragPreviewImage:nde,useDrag:qI,useDragDropManager:zi,useDragLayer:ZI,useDrop:KI},Symbol.toStringTag,{value:"Module"})));var A1=x.createContext(void 0),D1=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Ide=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Ade=e=>{let t=e.getInitialClientOffset(),n=e.getInitialSourceClientOffset();return t===null||n===null?{x:0,y:0}:D1(t,n)},Dde=(e,t)=>{switch(e){case"left":case"top-start":case"bottom-start":return 0;case"right":case"top-end":case"bottom-end":return t.width;default:return t.width/2}},Mde=(e,t)=>{switch(e){case"top":case"top-start":case"top-end":return 0;case"bottom":case"bottom-start":case"bottom-end":return t.height;default:return t.height/2}},Nde=(e,t,n="center",r={x:0,y:0})=>{let i=e.getClientOffset();if(i===null)return null;if(!t.current||!t.current.getBoundingClientRect)return D1(i,Ade(e));let o=t.current.getBoundingClientRect(),a={x:Dde(n,o),y:Mde(n,o)};return Ide(D1(i,a),r)},Lde=e=>{let t=`translate(${e.x.toFixed(1)}px, ${e.y.toFixed(1)}px)`;return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:t,WebkitTransform:t}},YI=e=>{let t=x.useRef(null),n=ZI(r=>({currentOffset:Nde(r,t,e==null?void 0:e.placement,e==null?void 0:e.padding),isDragging:r.isDragging(),itemType:r.getItemType(),item:r.getItem(),monitor:r}));return!n.isDragging||n.currentOffset===null?{display:!1}:{display:!0,itemType:n.itemType,item:n.item,style:Lde(n.currentOffset),monitor:n.monitor,ref:t}},kde=e=>{let t=YI({placement:e.placement,padding:e.padding});if(!t.display)return null;let{display:n,...r}=t,i;return"children" in e?typeof e.children=="function"?i=e.children(r):i=e.children:i=e.generator(r),S.jsx(A1.Provider,{value:r,children:i})},XI=x.createContext(null),Fde=({portal:e,...t})=>{let[n,r]=x.useState(null);return S.jsxs(XI.Provider,{value:e??n,children:[S.jsx(WI,{backend:xI,...t}),e?null:S.jsx("div",{ref:r})]})},QI=()=>{let[e,t]=x.useState(!1),n=x.useContext(su);return x.useEffect(()=>{var o;let r=(o=n==null?void 0:n.dragDropManager)==null?void 0:o.getBackend(),i={backendChanged:a=>{t(a.previewEnabled())}};return t(r.previewEnabled()),r.previewsList().register(i),()=>{r.previewsList().unregister(i)}},[n,n.dragDropManager]),e},JI=e=>{let t=QI(),n=x.useContext(XI);if(!t)return null;let r=S.jsx(kde,{...e});return n!==null?zc.createPortal(r,n):r};JI.Context=A1;var Bde=(e,t,n,r)=>{let i=n.getBackend();n.receiveBackend(r);let o=t(e);return n.receiveBackend(i),o},eA=(e,t)=>{var s;let n=x.useContext(su),r=(s=n==null?void 0:n.dragDropManager)==null?void 0:s.getBackend();if(r===void 0)throw new Error("could not find backend, make sure you are using a <DndProvider />");let i=t(e),o={},a=r.backendsList();for(let l of a)o[l.id]=Bde(e,t,n.dragDropManager,l.instance);return[i,o]},jde=e=>eA(e,qI),Wde=e=>eA(e,KI),zde=e=>{let t=QI(),n=YI(e);return t?n:{display:!1}};const Hde=Cn(Object.freeze(Object.defineProperty({__proto__:null,DndProvider:Fde,HTML5DragTransition:Lue,MouseTransition:kue,MultiBackend:xI,PointerTransition:bI,Preview:JI,PreviewContext:A1,TouchTransition:SI,createTransition:au,useMultiDrag:jde,useMultiDrop:Wde,usePreview:zde},Symbol.toStringTag,{value:"Module"})));var tA={},Ch={},Ph={};Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.default=Vde;let Oh;const Ude=new Uint8Array(16);function Vde(){if(!Oh&&(Oh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oh(Ude)}var Hi={},No={},Rh={};Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.default=void 0;var Gde=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Rh.default=Gde,Object.defineProperty(No,"__esModule",{value:!0}),No.default=void 0;var $de=qde(Rh);function qde(e){return e&&e.__esModule?e:{default:e}}function Zde(e){return typeof e=="string"&&$de.default.test(e)}var Kde=Zde;No.default=Kde,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0,Hi.unsafeStringify=nA;var Yde=Xde(No);function Xde(e){return e&&e.__esModule?e:{default:e}}const Vt=[];for(let e=0;e<256;++e)Vt.push((e+256).toString(16).slice(1));function nA(e,t=0){return Vt[e[t+0]]+Vt[e[t+1]]+Vt[e[t+2]]+Vt[e[t+3]]+"-"+Vt[e[t+4]]+Vt[e[t+5]]+"-"+Vt[e[t+6]]+Vt[e[t+7]]+"-"+Vt[e[t+8]]+Vt[e[t+9]]+"-"+Vt[e[t+10]]+Vt[e[t+11]]+Vt[e[t+12]]+Vt[e[t+13]]+Vt[e[t+14]]+Vt[e[t+15]]}function Qde(e,t=0){const n=nA(e,t);if(!(0,Yde.default)(n))throw TypeError("Stringified UUID is invalid");return n}var Jde=Qde;Hi.default=Jde,Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.default=void 0;var efe=nfe(Ph),tfe=Hi;function nfe(e){return e&&e.__esModule?e:{default:e}}let rA,M1,N1=0,L1=0;function rfe(e,t,n){let r=t&&n||0;const i=t||new Array(16);e=e||{};let o=e.node||rA,a=e.clockseq!==void 0?e.clockseq:M1;if(o==null||a==null){const f=e.random||(e.rng||efe.default)();o==null&&(o=rA=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),a==null&&(a=M1=(f[6]<<8|f[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:L1+1;const u=s-N1+(l-L1)/1e4;if(u<0&&e.clockseq===void 0&&(a=a+1&16383),(u<0||s>N1)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");N1=s,L1=l,M1=a,s+=122192928e5;const c=((s&268435455)*1e4+l)%4294967296;i[r++]=c>>>24&255,i[r++]=c>>>16&255,i[r++]=c>>>8&255,i[r++]=c&255;const d=s/4294967296*1e4&268435455;i[r++]=d>>>8&255,i[r++]=d&255,i[r++]=d>>>24&15|16,i[r++]=d>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(let f=0;f<6;++f)i[r+f]=o[f];return t||(0,tfe.unsafeStringify)(i)}var ife=rfe;Ch.default=ife;var Ih={},Ui={},uu={};Object.defineProperty(uu,"__esModule",{value:!0}),uu.default=void 0;var ofe=afe(No);function afe(e){return e&&e.__esModule?e:{default:e}}function sfe(e){if(!(0,ofe.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}var lfe=sfe;uu.default=lfe,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.URL=Ui.DNS=void 0,Ui.default=hfe;var ufe=Hi,cfe=dfe(uu);function dfe(e){return e&&e.__esModule?e:{default:e}}function ffe(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}const iA="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Ui.DNS=iA;const oA="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Ui.URL=oA;function hfe(e,t,n){function r(i,o,a,s){var l;if(typeof i=="string"&&(i=ffe(i)),typeof o=="string"&&(o=(0,cfe.default)(o)),((l=o)===null||l===void 0?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+i.length);if(u.set(o),u.set(i,o.length),u=n(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let c=0;c<16;++c)a[s+c]=u[c];return a}return(0,ufe.unsafeStringify)(u)}try{r.name=e}catch{}return r.DNS=iA,r.URL=oA,r}var Ah={};Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.default=void 0;function pfe(e){if(typeof e=="string"){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return gfe(mfe(vfe(e),e.length*8))}function gfe(e){const t=[],n=e.length*32,r="0123456789abcdef";for(let i=0;i<n;i+=8){const o=e[i>>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(o&15),16);t.push(a)}return t}function aA(e){return(e+64>>>9<<4)+14+1}function mfe(e,t){e[t>>5]|=128<<t%32,e[aA(t)-1]=t;let n=1732584193,r=-271733879,i=-1732584194,o=271733878;for(let a=0;a<e.length;a+=16){const s=n,l=r,u=i,c=o;n=Yt(n,r,i,o,e[a],7,-680876936),o=Yt(o,n,r,i,e[a+1],12,-389564586),i=Yt(i,o,n,r,e[a+2],17,606105819),r=Yt(r,i,o,n,e[a+3],22,-1044525330),n=Yt(n,r,i,o,e[a+4],7,-176418897),o=Yt(o,n,r,i,e[a+5],12,1200080426),i=Yt(i,o,n,r,e[a+6],17,-1473231341),r=Yt(r,i,o,n,e[a+7],22,-45705983),n=Yt(n,r,i,o,e[a+8],7,1770035416),o=Yt(o,n,r,i,e[a+9],12,-1958414417),i=Yt(i,o,n,r,e[a+10],17,-42063),r=Yt(r,i,o,n,e[a+11],22,-1990404162),n=Yt(n,r,i,o,e[a+12],7,1804603682),o=Yt(o,n,r,i,e[a+13],12,-40341101),i=Yt(i,o,n,r,e[a+14],17,-1502002290),r=Yt(r,i,o,n,e[a+15],22,1236535329),n=Xt(n,r,i,o,e[a+1],5,-165796510),o=Xt(o,n,r,i,e[a+6],9,-1069501632),i=Xt(i,o,n,r,e[a+11],14,643717713),r=Xt(r,i,o,n,e[a],20,-373897302),n=Xt(n,r,i,o,e[a+5],5,-701558691),o=Xt(o,n,r,i,e[a+10],9,38016083),i=Xt(i,o,n,r,e[a+15],14,-660478335),r=Xt(r,i,o,n,e[a+4],20,-405537848),n=Xt(n,r,i,o,e[a+9],5,568446438),o=Xt(o,n,r,i,e[a+14],9,-1019803690),i=Xt(i,o,n,r,e[a+3],14,-187363961),r=Xt(r,i,o,n,e[a+8],20,1163531501),n=Xt(n,r,i,o,e[a+13],5,-1444681467),o=Xt(o,n,r,i,e[a+2],9,-51403784),i=Xt(i,o,n,r,e[a+7],14,1735328473),r=Xt(r,i,o,n,e[a+12],20,-1926607734),n=Qt(n,r,i,o,e[a+5],4,-378558),o=Qt(o,n,r,i,e[a+8],11,-2022574463),i=Qt(i,o,n,r,e[a+11],16,1839030562),r=Qt(r,i,o,n,e[a+14],23,-35309556),n=Qt(n,r,i,o,e[a+1],4,-1530992060),o=Qt(o,n,r,i,e[a+4],11,1272893353),i=Qt(i,o,n,r,e[a+7],16,-155497632),r=Qt(r,i,o,n,e[a+10],23,-1094730640),n=Qt(n,r,i,o,e[a+13],4,681279174),o=Qt(o,n,r,i,e[a],11,-358537222),i=Qt(i,o,n,r,e[a+3],16,-722521979),r=Qt(r,i,o,n,e[a+6],23,76029189),n=Qt(n,r,i,o,e[a+9],4,-640364487),o=Qt(o,n,r,i,e[a+12],11,-421815835),i=Qt(i,o,n,r,e[a+15],16,530742520),r=Qt(r,i,o,n,e[a+2],23,-995338651),n=Jt(n,r,i,o,e[a],6,-198630844),o=Jt(o,n,r,i,e[a+7],10,1126891415),i=Jt(i,o,n,r,e[a+14],15,-1416354905),r=Jt(r,i,o,n,e[a+5],21,-57434055),n=Jt(n,r,i,o,e[a+12],6,1700485571),o=Jt(o,n,r,i,e[a+3],10,-1894986606),i=Jt(i,o,n,r,e[a+10],15,-1051523),r=Jt(r,i,o,n,e[a+1],21,-2054922799),n=Jt(n,r,i,o,e[a+8],6,1873313359),o=Jt(o,n,r,i,e[a+15],10,-30611744),i=Jt(i,o,n,r,e[a+6],15,-1560198380),r=Jt(r,i,o,n,e[a+13],21,1309151649),n=Jt(n,r,i,o,e[a+4],6,-145523070),o=Jt(o,n,r,i,e[a+11],10,-1120210379),i=Jt(i,o,n,r,e[a+2],15,718787259),r=Jt(r,i,o,n,e[a+9],21,-343485551),n=Vi(n,s),r=Vi(r,l),i=Vi(i,u),o=Vi(o,c)}return[n,r,i,o]}function vfe(e){if(e.length===0)return[];const t=e.length*8,n=new Uint32Array(aA(t));for(let r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function Vi(e,t){const n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function yfe(e,t){return e<<t|e>>>32-t}function Dh(e,t,n,r,i,o){return Vi(yfe(Vi(Vi(t,e),Vi(r,o)),i),n)}function Yt(e,t,n,r,i,o,a){return Dh(t&n|~t&r,e,t,i,o,a)}function Xt(e,t,n,r,i,o,a){return Dh(t&r|n&~r,e,t,i,o,a)}function Qt(e,t,n,r,i,o,a){return Dh(t^n^r,e,t,i,o,a)}function Jt(e,t,n,r,i,o,a){return Dh(n^(t|~r),e,t,i,o,a)}var wfe=pfe;Ah.default=wfe,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.default=void 0;var _fe=sA(Ui),Tfe=sA(Ah);function sA(e){return e&&e.__esModule?e:{default:e}}var Efe=(0,_fe.default)("v3",48,Tfe.default);Ih.default=Efe;var Mh={},Nh={};Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.default=void 0;var xfe={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Nh.default=xfe,Object.defineProperty(Mh,"__esModule",{value:!0}),Mh.default=void 0;var lA=uA(Nh),Sfe=uA(Ph),bfe=Hi;function uA(e){return e&&e.__esModule?e:{default:e}}function Cfe(e,t,n){if(lA.default.randomUUID&&!t&&!e)return lA.default.randomUUID();e=e||{};const r=e.random||(e.rng||Sfe.default)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return(0,bfe.unsafeStringify)(r)}var Pfe=Cfe;Mh.default=Pfe;var Lh={},kh={};Object.defineProperty(kh,"__esModule",{value:!0}),kh.default=void 0;function Ofe(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function k1(e,t){return e<<t|e>>>32-t}function Rfe(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){const a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const r=e.length/4+2,i=Math.ceil(r/16),o=new Array(i);for(let a=0;a<i;++a){const s=new Uint32Array(16);for(let l=0;l<16;++l)s[l]=e[a*64+l*4]<<24|e[a*64+l*4+1]<<16|e[a*64+l*4+2]<<8|e[a*64+l*4+3];o[a]=s}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<i;++a){const s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=o[a][h];for(let h=16;h<80;++h)s[h]=k1(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let l=n[0],u=n[1],c=n[2],d=n[3],f=n[4];for(let h=0;h<80;++h){const g=Math.floor(h/20),p=k1(l,5)+Ofe(g,u,c,d)+f+t[g]+s[h]>>>0;f=d,d=c,c=k1(u,30)>>>0,u=l,l=p}n[0]=n[0]+l>>>0,n[1]=n[1]+u>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+d>>>0,n[4]=n[4]+f>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var Ife=Rfe;kh.default=Ife,Object.defineProperty(Lh,"__esModule",{value:!0}),Lh.default=void 0;var Afe=cA(Ui),Dfe=cA(kh);function cA(e){return e&&e.__esModule?e:{default:e}}var Mfe=(0,Afe.default)("v5",80,Dfe.default);Lh.default=Mfe;var Fh={};Object.defineProperty(Fh,"__esModule",{value:!0}),Fh.default=void 0;var Nfe="00000000-0000-0000-0000-000000000000";Fh.default=Nfe;var Bh={};Object.defineProperty(Bh,"__esModule",{value:!0}),Bh.default=void 0;var Lfe=kfe(No);function kfe(e){return e&&e.__esModule?e:{default:e}}function Ffe(e){if(!(0,Lfe.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var Bfe=Ffe;Bh.default=Bfe,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.default}});var t=c(Ch),n=c(Ih),r=c(Mh),i=c(Lh),o=c(Fh),a=c(Bh),s=c(No),l=c(Hi),u=c(uu);function c(d){return d&&d.__esModule?d:{default:d}}}(tA);var jh={},Wh={};function jfe(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}var Wfe=jfe,zfe=Wfe,F1=Ly;function Hfe(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=F1(n),n=n===n?n:0),t!==void 0&&(t=F1(t),t=t===t?t:0),zfe(F1(e),t,n)}var Ufe=Hfe,Vfe=YO,Gfe=Qn,$fe="Expected a function";function qfe(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError($fe);return Gfe(n)&&(r="leading" in n?!!n.leading:r,i="trailing" in n?!!n.trailing:i),Vfe(e,t,{leading:r,maxWait:t,trailing:i})}var Zfe=qfe,B1={},zh={};Object.defineProperty(zh,"__esModule",{value:!0}),zh.assertNever=void 0;function Kfe(e){throw new Error("Unhandled case: "+JSON.stringify(e))}zh.assertNever=Kfe,function(e){var t=J&&J.__assign||function(){return t=Object.assign||function(r){for(var i,o=1,a=arguments.length;o<a;o++){i=arguments[o];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])}return r},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.BoundingBox=void 0;var n=zh;(function(r){function i(){return{top:0,right:0,bottom:0,left:0}}r.empty=i;function o(u,c,d){var f=a(u,c,d);return d==="column"?{first:t(t({},u),{bottom:100-f}),second:t(t({},u),{top:f})}:d==="row"?{first:t(t({},u),{right:100-f}),second:t(t({},u),{left:f})}:(0,n.assertNever)(d)}r.split=o;function a(u,c,d){var f=u.top,h=u.right,g=u.bottom,p=u.left;if(d==="column"){var v=100-f-g;return v*c/100+f}else if(d==="row"){var m=100-h-p;return m*c/100+p}else return(0,n.assertNever)(d)}r.getAbsoluteSplitPercentage=a;function s(u,c,d){var f=u.top,h=u.right,g=u.bottom,p=u.left;if(d==="column"){var v=100-f-g;return(c-f)/v*100}else if(d==="row"){var m=100-h-p;return(c-p)/m*100}else return(0,n.assertNever)(d)}r.getRelativeSplitPercentage=s;function l(u){var c=u.top,d=u.right,f=u.bottom,h=u.left;return{top:"".concat(c,"%"),right:"".concat(d,"%"),bottom:"".concat(f,"%"),left:"".concat(h,"%")}}r.asStyles=l})(e.BoundingBox||(e.BoundingBox={}))}(B1);var Yfe=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hh=J&&J.__assign||function(){return Hh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Hh.apply(this,arguments)},Uh=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wh,"__esModule",{value:!0}),Wh.Split=void 0;var Xfe=Uh(Wn),Qfe=Uh(Ufe),Jfe=Uh(Zfe),Vh=Uh(x),j1=B1,ehe=1e3/30,Gh={capture:!0,passive:!1},the=function(e){Yfe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.rootElement=Vh.default.createRef(),n.listenersBound=!1,n.onMouseDown=function(r){!dA(r)&&r.button!==0||(r.preventDefault(),n.bindListeners())},n.onMouseUp=function(r){n.unbindListeners();var i=n.calculateRelativePercentage(r);n.props.onRelease(i)},n.onMouseMove=function(r){r.preventDefault(),n.throttledUpdatePercentage(r)},n.throttledUpdatePercentage=(0,Jfe.default)(function(r){var i=n.calculateRelativePercentage(r);i!==n.props.splitPercentage&&n.props.onChange(i)},ehe),n}return t.prototype.render=function(){var n=this.props.direction;return Vh.default.createElement("div",{className:(0,Xfe.default)("mosaic-split",{"-row":n==="row","-column":n==="column"}),ref:this.rootElement,onMouseDown:this.onMouseDown,style:this.computeStyle()},Vh.default.createElement("div",{className:"mosaic-split-line"}))},t.prototype.componentDidMount=function(){this.rootElement.current.addEventListener("touchstart",this.onMouseDown,Gh)},t.prototype.componentWillUnmount=function(){this.unbindListeners(),this.rootElement.current&&this.rootElement.current.ownerDocument.removeEventListener("touchstart",this.onMouseDown,Gh)},t.prototype.bindListeners=function(){this.listenersBound||(this.rootElement.current.ownerDocument.addEventListener("mousemove",this.onMouseMove,!0),this.rootElement.current.ownerDocument.addEventListener("touchmove",this.onMouseMove,Gh),this.rootElement.current.ownerDocument.addEventListener("mouseup",this.onMouseUp,!0),this.rootElement.current.ownerDocument.addEventListener("touchend",this.onMouseUp,!0),this.listenersBound=!0)},t.prototype.unbindListeners=function(){this.rootElement.current&&(this.rootElement.current.ownerDocument.removeEventListener("mousemove",this.onMouseMove,!0),this.rootElement.current.ownerDocument.removeEventListener("touchmove",this.onMouseMove,Gh),this.rootElement.current.ownerDocument.removeEventListener("mouseup",this.onMouseUp,!0),this.rootElement.current.ownerDocument.removeEventListener("touchend",this.onMouseUp,!0),this.listenersBound=!1)},t.prototype.computeStyle=function(){var n,r=this.props,i=r.boundingBox,o=r.direction,a=r.splitPercentage,s=o==="column"?"top":"left",l=j1.BoundingBox.getAbsoluteSplitPercentage(i,a,o);return Hh(Hh({},j1.BoundingBox.asStyles(i)),(n={},n[s]="".concat(l,"%"),n))},t.prototype.calculateRelativePercentage=function(n){var r=this.props,i=r.minimumPaneSizePercentage,o=r.direction,a=r.boundingBox,s=this.rootElement.current.parentElement.getBoundingClientRect(),l=dA(n)?n.changedTouches[0]:n,u;o==="column"?u=(l.clientY-s.top)/s.height*100:u=(l.clientX-s.left)/s.width*100;var c=j1.BoundingBox.getRelativeSplitPercentage(a,u,o);return(0,Qfe.default)(c,i,100-i)},t.defaultProps={onChange:function(){},onRelease:function(){},minimumPaneSizePercentage:20},t}(Vh.default.PureComponent);Wh.Split=the;function dA(e){return e.changedTouches!=null}var zr={};(function(e){var t=J&&J.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.getAndAssertNodeAtPathExists=e.getNodeAtPath=e.getLeaves=e.getPathToCorner=e.getOtherDirection=e.getOtherBranch=e.createBalancedTreeFromLeaves=e.isParent=e.Corner=void 0;var n=t(qP),r=t(Yx);function i(g,p){if(p===void 0&&(p="row"),a(g)){var v=u(p);return{direction:p,first:i(g.first,v),second:i(g.second,v)}}else return g}var o;(function(g){g[g.TOP_LEFT=1]="TOP_LEFT",g[g.TOP_RIGHT=2]="TOP_RIGHT",g[g.BOTTOM_LEFT=3]="BOTTOM_LEFT",g[g.BOTTOM_RIGHT=4]="BOTTOM_RIGHT"})(o=e.Corner||(e.Corner={}));function a(g){return g.direction!=null}e.isParent=a;function s(g,p){if(p===void 0&&(p="row"),g.length===0)return null;for(var v=(0,n.default)(g),m=[];v.length>1;){for(;v.length>0;)v.length>1?m.push({direction:"row",first:v.shift(),second:v.shift()}):m.unshift(v.shift());v=m,m=[]}return i(v[0],p)}e.createBalancedTreeFromLeaves=s;function l(g){if(g==="first")return"second";if(g==="second")return"first";throw new Error("Branch '".concat(g,"' not a valid branch"))}e.getOtherBranch=l;function u(g){return g==="row"?"column":"row"}e.getOtherDirection=u;function c(g,p){for(var v=g,m=[];a(v);)v.direction==="row"&&(p===o.TOP_LEFT||p===o.BOTTOM_LEFT)||v.direction==="column"&&(p===o.TOP_LEFT||p===o.TOP_RIGHT)?(m.push("first"),v=v.first):(m.push("second"),v=v.second);return m}e.getPathToCorner=c;function d(g){return g==null?[]:a(g)?d(g.first).concat(d(g.second)):[g]}e.getLeaves=d;function f(g,p){return p.length>0?(0,r.default)(g,p,null):g}e.getNodeAtPath=f;function h(g,p){if(g==null)throw new Error("Root is empty, cannot fetch path");var v=f(g,p);if(v==null)throw new Error("Path [".concat(p.join(", "),"] did not resolve to a node"));return v}e.getAndAssertNodeAtPathExists=h})(zr);var nhe=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$h=J&&J.__assign||function(){return $h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$h.apply(this,arguments)},fA=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jh,"__esModule",{value:!0}),jh.MosaicRoot=void 0;var rhe=fA(Sm),qh=fA(x),ihe=Ut,ohe=Wh,W1=B1,ahe=zr,she=function(e){nhe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onResize=function(r,i,o){n.context.mosaicActions.updateTree([{path:i,spec:{splitPercentage:{$set:r}}}],o)},n}return t.prototype.render=function(){var n=this.props.root;return qh.default.createElement("div",{className:"mosaic-root"},this.renderRecursively(n,W1.BoundingBox.empty(),[]))},t.prototype.renderRecursively=function(n,r,i){if((0,ahe.isParent)(n)){var o=n.splitPercentage==null?50:n.splitPercentage,a=W1.BoundingBox.split(r,o,n.direction),s=a.first,l=a.second;return(0,rhe.default)([this.renderRecursively(n.first,s,i.concat("first")),this.renderSplit(n.direction,r,o,i),this.renderRecursively(n.second,l,i.concat("second"))].filter(lhe))}else return qh.default.createElement("div",{key:n,className:"mosaic-tile",style:$h({},W1.BoundingBox.asStyles(r))},this.props.renderTile(n,i))},t.prototype.renderSplit=function(n,r,i,o){var a=this,s=this.props.resize;return s!=="DISABLED"?qh.default.createElement(ohe.Split,$h({key:o.join(",")+"splitter"},s,{boundingBox:r,splitPercentage:i,direction:n,onChange:function(l){return a.onResize(l,o,!0)},onRelease:function(l){return a.onResize(l,o,!1)}})):null},t.contextType=ihe.MosaicContext,t}(qh.default.PureComponent);jh.MosaicRoot=she;function lhe(e){return e!==null}var cu={},Gi={};function uhe(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var che=uhe;function dhe(e){return function(t){return e==null?void 0:e[t]}}var fhe=dhe,hhe=fhe,phe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"},ghe=hhe(phe),mhe=ghe,vhe=mhe,yhe=ud,whe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_he="\\u0300-\\u036f",The="\\ufe20-\\ufe2f",Ehe="\\u20d0-\\u20ff",xhe=_he+The+Ehe,She="["+xhe+"]",bhe=RegExp(She,"g");function Che(e){return e=yhe(e),e&&e.replace(whe,vhe).replace(bhe,"")}var Phe=Che,Ohe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Rhe(e){return e.match(Ohe)||[]}var Ihe=Rhe,Ahe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Dhe(e){return Ahe.test(e)}var Mhe=Dhe,hA="\\ud800-\\udfff",Nhe="\\u0300-\\u036f",Lhe="\\ufe20-\\ufe2f",khe="\\u20d0-\\u20ff",Fhe=Nhe+Lhe+khe,pA="\\u2700-\\u27bf",gA="a-z\\xdf-\\xf6\\xf8-\\xff",Bhe="\\xac\\xb1\\xd7\\xf7",jhe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Whe="\\u2000-\\u206f",zhe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mA="A-Z\\xc0-\\xd6\\xd8-\\xde",Hhe="\\ufe0e\\ufe0f",vA=Bhe+jhe+Whe+zhe,yA="['’]",wA="["+vA+"]",Uhe="["+Fhe+"]",_A="\\d+",Vhe="["+pA+"]",TA="["+gA+"]",EA="[^"+hA+vA+_A+pA+gA+mA+"]",Ghe="\\ud83c[\\udffb-\\udfff]",$he="(?:"+Uhe+"|"+Ghe+")",qhe="[^"+hA+"]",xA="(?:\\ud83c[\\udde6-\\uddff]){2}",SA="[\\ud800-\\udbff][\\udc00-\\udfff]",os="["+mA+"]",Zhe="\\u200d",bA="(?:"+TA+"|"+EA+")",Khe="(?:"+os+"|"+EA+")",CA="(?:"+yA+"(?:d|ll|m|re|s|t|ve))?",PA="(?:"+yA+"(?:D|LL|M|RE|S|T|VE))?",OA=$he+"?",RA="["+Hhe+"]?",Yhe="(?:"+Zhe+"(?:"+[qhe,xA,SA].join("|")+")"+RA+OA+")*",Xhe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Qhe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Jhe=RA+OA+Yhe,epe="(?:"+[Vhe,xA,SA].join("|")+")"+Jhe,tpe=RegExp([os+"?"+TA+"+"+CA+"(?="+[wA,os,"$"].join("|")+")",Khe+"+"+PA+"(?="+[wA,os+bA,"$"].join("|")+")",os+"?"+bA+"+"+CA,os+"+"+PA,Qhe,Xhe,_A,epe].join("|"),"g");function npe(e){return e.match(tpe)||[]}var rpe=npe,ipe=Ihe,ope=Mhe,ape=ud,spe=rpe;function lpe(e,t,n){return e=ape(e),t=n?void 0:t,t===void 0?ope(e)?spe(e):ipe(e):e.match(t)||[]}var upe=lpe,cpe=che,dpe=Phe,fpe=upe,hpe="['’]",ppe=RegExp(hpe,"g");function gpe(e){return function(t){return cpe(fpe(dpe(t).replace(ppe,"")),e,"")}}var mpe=gpe,vpe=mpe,ype=vpe(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),wpe=ype;(function(e){var t=J&&J.__createBinding||(Object.create?function(u,c,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(c,d);(!h||("get" in h?!c.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(u,f,h)}:function(u,c,d,f){f===void 0&&(f=d),u[f]=c[d]}),n=J&&J.__setModuleDefault||(Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c}),r=J&&J.__importStar||function(u){if(u&&u.__esModule)return u;var c={};if(u!=null)for(var d in u)d!=="default"&&Object.prototype.hasOwnProperty.call(u,d)&&t(c,u,d);return n(c,u),c},i=J&&J.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalBlueprint=void 0;var o=i(Wn),a=i(wpe),s=r(x),l=Ut;(function(u){u.Icon=function(f){var h=f.icon,g=f.className,p=f.size,v=p===void 0?"standard":p,m=s.useContext(l.MosaicContext).blueprintNamespace;return s.createElement("span",{className:(0,o.default)(g,d(m,h),"".concat(m,"-icon-").concat(v))})};function c(f){for(var h=[],g=1;g<arguments.length;g++)h[g-1]=arguments[g];return h.map(function(p){return"".concat(f,"-").concat((0,a.default)(p))}).join(" ")}u.getClasses=c;function d(f,h){return"".concat(f,"-icon-").concat((0,a.default)(h))}u.getIconClass=d})(e.OptionalBlueprint||(e.OptionalBlueprint={}))})(Gi);var _pe=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),z1=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cu,"__esModule",{value:!0}),cu.MosaicZeroState=void 0;var IA=z1(Wn),Tpe=z1(ml),Lo=z1(x),Epe=Ut,as=Gi,xpe=function(e){_pe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.replace=function(){return Promise.resolve(n.props.createNode()).then(function(r){return n.context.mosaicActions.replaceWith([],r)}).catch(Tpe.default)},n}return t.prototype.render=function(){return Lo.default.createElement("div",{className:(0,IA.default)("mosaic-zero-state",as.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"NON_IDEAL_STATE"))},Lo.default.createElement("div",{className:as.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"NON_IDEAL_STATE_VISUAL")},Lo.default.createElement(as.OptionalBlueprint.Icon,{className:"default-zero-state-icon",size:"large",icon:"APPLICATIONS"})),Lo.default.createElement("h4",{className:as.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"HEADING")},"No Windows Present"),Lo.default.createElement("div",null,this.props.createNode&&Lo.default.createElement("button",{className:(0,IA.default)(as.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"BUTTON"),as.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"ADD")),onClick:this.replace},"Add New Window")))},t.contextType=Epe.MosaicContext,t}(Lo.default.PureComponent);cu.MosaicZeroState=xpe;var AA={},ss={};Object.defineProperty(ss,"__esModule",{value:!0}),ss.MosaicDropTargetPosition=void 0,ss.MosaicDropTargetPosition={TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right"};var du={},ko={};Object.defineProperty(ko,"__esModule",{value:!0}),ko.MosaicDragType=void 0,ko.MosaicDragType={WINDOW:"MosaicWindow"};var Spe=J&&J.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get" in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),bpe=J&&J.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Cpe=J&&J.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Spe(t,e,n);return bpe(t,e),t},Ppe=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(du,"__esModule",{value:!0}),du.MosaicDropTarget=void 0;var Ope=Ppe(Wn),DA=Cpe(x),Rpe=bh,Ipe=Ut,Ape=ko;function Dpe(e){var t=e.path,n=e.position,r=(0,DA.useContext)(Ipe.MosaicContext).mosaicId,i=(0,Rpe.useDrop)({accept:Ape.MosaicDragType.WINDOW,drop:function(u,c){return r===(u==null?void 0:u.mosaicId)?{path:t,position:n}:{}},collect:function(u){return{isOver:u.isOver(),draggedMosaicId:(u.getItem()||{}).mosaicId}}}),o=i[0],a=o.isOver,s=o.draggedMosaicId,l=i[1];return DA.default.createElement("div",{ref:l,className:(0,Ope.default)("drop-target",n,{"drop-target-hover":a&&s===r})})}du.MosaicDropTarget=Dpe,function(e){var t=J&&J.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.RootDropTargets=void 0;var n=t(Wn),r=t(zy),i=t(x),o=bh,a=ss,s=du,l=ko;e.RootDropTargets=i.default.memo(function(){var c=(0,o.useDrop)({accept:l.MosaicDragType.WINDOW,collect:function(f){return{isDragging:f.getItem()!==null&&f.getItemType()===l.MosaicDragType.WINDOW}}})[0].isDragging,d=u(c,0);return i.default.createElement("div",{className:(0,n.default)("drop-target-container",{"-dragging":d})},(0,r.default)(a.MosaicDropTargetPosition).map(function(f){return i.default.createElement(s.MosaicDropTarget,{position:f,path:[],key:f})}))}),e.RootDropTargets.displayName="RootDropTargets";function u(c,d){var f=i.default.useRef(c),h=i.default.useState(0),g=h[1],p=function(v){f.current=v,g(function(m){return m+1})};return c||(f.current=!1),i.default.useEffect(function(){if(!(f.current===c||!c)){var v=window.setTimeout(function(){return p(!0)},d);return function(){window.clearTimeout(v)}}},[c]),f.current}}(AA);var en={},H1={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(C){return typeof C=="object"&&!("toString" in C)?Object.prototype.toString.call(C).slice(8,-1):C}var r=typeof process=="object"&&!0;function i(C,D){if(!C)throw r?new Error("Invariant failed"):new Error(D())}t.invariant=i;var o=Object.prototype.hasOwnProperty,a=Array.prototype.splice,s=Object.prototype.toString;function l(C){return s.call(C).slice(8,-1)}var u=Object.assign||function(C,D){return c(D).forEach(function(F){o.call(D,F)&&(C[F]=D[F])}),C},c=typeof Object.getOwnPropertySymbols=="function"?function(C){return Object.keys(C).concat(Object.getOwnPropertySymbols(C))}:function(C){return Object.keys(C)};function d(C){return Array.isArray(C)?u(C.constructor(C.length),C):l(C)==="Map"?new Map(C):l(C)==="Set"?new Set(C):C&&typeof C=="object"?u(Object.create(Object.getPrototypeOf(C)),C):C}var f=function(){function C(){this.commands=u({},h),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(D,F){return D===F},this.update.newContext=function(){return new C().update}}return Object.defineProperty(C.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(D){this.update.isEquals=D},enumerable:!0,configurable:!0}),C.prototype.extend=function(D,F){this.commands[D]=F},C.prototype.update=function(D,F){var L=this,B=typeof F=="function"?{$apply:F}:F;Array.isArray(D)&&Array.isArray(B)||i(!Array.isArray(B),function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."}),i(typeof B=="object"&&B!==null,function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the "+("following commands: "+Object.keys(L.commands).join(", ")+".")});var z=D;return c(B).forEach(function($){if(o.call(L.commands,$)){var de=D===z;z=L.commands[$](B[$],z,B,D),de&&L.isEquals(z,D)&&(z=D)}else{var X=l(D)==="Map"?L.update(D.get($),B[$]):L.update(D[$],B[$]),re=l(z)==="Map"?z.get($):z[$];(!L.isEquals(X,re)||typeof X>"u"&&!o.call(D,$))&&(z===D&&(z=d(D)),l(z)==="Map"?z.set($,X):z[$]=X)}}),z},C}();t.Context=f;var h={$push:function(C,D,F){return p(D,F,"$push"),C.length?D.concat(C):D},$unshift:function(C,D,F){return p(D,F,"$unshift"),C.length?C.concat(D):D},$splice:function(C,D,F,L){return m(D,F),C.forEach(function(B){y(B),D===L&&B.length&&(D=d(L)),a.apply(D,B)}),D},$set:function(C,D,F){return b(F),C},$toggle:function(C,D){v(C,"$toggle");var F=C.length?d(D):D;return C.forEach(function(L){F[L]=!D[L]}),F},$unset:function(C,D,F,L){return v(C,"$unset"),C.forEach(function(B){Object.hasOwnProperty.call(D,B)&&(D===L&&(D=d(L)),delete D[B])}),D},$add:function(C,D,F,L){return M(D,"$add"),v(C,"$add"),l(D)==="Map"?C.forEach(function(B){var z=B[0],$=B[1];D===L&&D.get(z)!==$&&(D=d(L)),D.set(z,$)}):C.forEach(function(B){D===L&&!D.has(B)&&(D=d(L)),D.add(B)}),D},$remove:function(C,D,F,L){return M(D,"$remove"),v(C,"$remove"),C.forEach(function(B){D===L&&D.has(B)&&(D=d(L)),D.delete(B)}),D},$merge:function(C,D,F,L){return R(D,C),c(C).forEach(function(B){C[B]!==D[B]&&(D===L&&(D=d(L)),D[B]=C[B])}),D},$apply:function(C,D){return E(C),C(D)}},g=new f;t.isEquals=g.update.isEquals,t.extend=g.extend,t.default=g.update,t.default.default=e.exports=u(t.default,t);function p(C,D,F){i(Array.isArray(C),function(){return"update(): expected target of "+n(F)+" to be an array; got "+n(C)+"."}),v(D[F],F)}function v(C,D){i(Array.isArray(C),function(){return"update(): expected spec of "+n(D)+" to be an array; got "+n(C)+". Did you forget to wrap your parameter in an array?"})}function m(C,D){i(Array.isArray(C),function(){return"Expected $splice target to be an array; got "+n(C)}),y(D.$splice)}function y(C){i(Array.isArray(C),function(){return"update(): expected spec of $splice to be an array of arrays; got "+n(C)+". Did you forget to wrap your parameters in an array?"})}function E(C){i(typeof C=="function",function(){return"update(): expected spec of $apply to be a function; got "+n(C)+"."})}function b(C){i(Object.keys(C).length===1,function(){return"Cannot have more than one key in an object with $set"})}function R(C,D){i(D&&typeof D=="object",function(){return"update(): $merge expects a spec of type 'object'; got "+n(D)}),i(C&&typeof C=="object",function(){return"update(): $merge expects a target of type 'object'; got "+n(C)})}function M(C,D){var F=l(C);i(F==="Map"||F==="Set",function(){return"update(): "+n(D)+" expects a target of type Set or Map; got "+n(F)})}})(H1,H1.exports);var Mpe=H1.exports,Npe=Kf,Lpe=kl;function kpe(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===void 0?1:Lpe(t),Npe(e,t<0?0:t,r)):[]}var Fpe=kpe,Bpe=Kf,jpe=kl;function Wpe(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===void 0?1:jpe(t),t=r-t,Bpe(e,0,t<0?0:t)):[]}var U1=Wpe;const zpe=He(U1);var Hpe=ev;function Upe(e,t){return Hpe(e,t)}var V1=Upe;const G1=He(V1);var Vpe=Kf,Gpe=kl;function $pe(e,t,n){return e&&e.length?(t=n||t===void 0?1:Gpe(t),Vpe(e,0,t<0?0:t)):[]}var qpe=$pe,Fo=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0}),en.createExpandUpdate=en.createHideUpdate=en.createDragToUpdates=BA=en.createRemoveUpdate=$1=en.updateTree=en.buildSpecFromUpdate=void 0;var Zpe=Fo(Mpe),Kpe=Fo(Fpe),MA=Fo(U1),Ype=Fo(V1),NA=Fo(BP),Xpe=Fo(YP()),LA=Fo(qpe),Zh=ss,Kh=zr;function kA(e){return e.path.length>0?(0,Xpe.default)({},e.path,e.spec):e.spec}en.buildSpecFromUpdate=kA;function FA(e,t){var n=e;return t.forEach(function(r){n=(0,Zpe.default)(n,kA(r))}),n}var $1=en.updateTree=FA;function q1(e,t){var n=(0,MA.default)(t),r=(0,NA.default)(t),i=n.concat((0,Kh.getOtherBranch)(r)),o=(0,Kh.getAndAssertNodeAtPathExists)(e,i);return{path:n,spec:{$set:o}}}var BA=en.createRemoveUpdate=q1;function jA(e,t,n){return(0,Ype.default)((0,LA.default)(e,n),(0,LA.default)(t,n))}function Qpe(e,t,n,r){var i=(0,Kh.getAndAssertNodeAtPathExists)(e,n),o=[],a=jA(t,n,n.length);if(a)i=FA(i,[q1(i,(0,Kpe.default)(t,n.length))]);else{o.push(q1(e,t));var s=jA(t,n,t.length-1);s&&n.splice(t.length-1,1)}var l=(0,Kh.getAndAssertNodeAtPathExists)(e,t),u,c;r===Zh.MosaicDropTargetPosition.LEFT||r===Zh.MosaicDropTargetPosition.TOP?(u=l,c=i):(u=i,c=l);var d="column";return(r===Zh.MosaicDropTargetPosition.LEFT||r===Zh.MosaicDropTargetPosition.RIGHT)&&(d="row"),o.push({path:n,spec:{$set:{first:u,second:c,direction:d}}}),o}en.createDragToUpdates=Qpe;function Jpe(e){var t=(0,MA.default)(e),n=(0,NA.default)(e),r;return n==="first"?r=0:r=100,{path:t,spec:{splitPercentage:{$set:r}}}}en.createHideUpdate=Jpe;function ege(e,t){for(var n,r={},i=e.length-1;i>=0;i--){var o=e[i],a=o==="first"?t:100-t;r=(n={splitPercentage:{$set:a}},n[o]=r,n)}return{spec:r,path:[]}}en.createExpandUpdate=ege;var WA=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yh=J&&J.__assign||function(){return Yh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Yh.apply(this,arguments)},fu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rs,"__esModule",{value:!0}),rs.Mosaic=rs.MosaicWithoutDragDropContext=void 0;var tge=fu(Wn);fu(Yle),fu(co),fu(sue);var nge=Bue,ai=fu(x),rge=bh,ige=Hde,oge=tA,age=Ut,sge=jh,lge=cu,uge=AA,Xh=en,cge=70;function Z1(e){return e.initialValue!=null}var zA=function(e){WA(t,e);function t(){var n=this,r;return n=e.apply(this,arguments)||this,n.state={currentNode:null,lastInitialValue:null,mosaicId:(r=n.props.mosaicId)!==null&&r!==void 0?r:(0,oge.v4)()},n.updateRoot=function(i,o){o===void 0&&(o=!1);var a=n.getRoot()||{};n.replaceRoot((0,Xh.updateTree)(a,i),o)},n.replaceRoot=function(i,o){o===void 0&&(o=!1),n.props.onChange(i),!o&&n.props.onRelease&&n.props.onRelease(i),Z1(n.props)&&n.setState({currentNode:i})},n.actions={updateTree:n.updateRoot,remove:function(i){i.length===0?n.replaceRoot(null):n.updateRoot([(0,Xh.createRemoveUpdate)(n.getRoot(),i)])},expand:function(i,o){return o===void 0&&(o=cge),n.updateRoot([(0,Xh.createExpandUpdate)(i,o)])},getRoot:function(){return n.getRoot()},hide:function(i){return n.updateRoot([(0,Xh.createHideUpdate)(i)])},replaceWith:function(i,o){return n.updateRoot([{path:i,spec:{$set:o}}])}},n.childContext={mosaicActions:n.actions,mosaicId:n.state.mosaicId,blueprintNamespace:n.props.blueprintNamespace},n}return t.getDerivedStateFromProps=function(n,r){return n.mosaicId&&(r.mosaicId,n.mosaicId),Z1(n)&&n.initialValue!==r.lastInitialValue?{lastInitialValue:n.initialValue,currentNode:n.initialValue}:null},t.prototype.render=function(){var n=this.props.className;return ai.default.createElement(age.MosaicContext.Provider,{value:this.childContext},ai.default.createElement("div",{className:(0,tge.default)(n,"mosaic mosaic-drop-target")},this.renderTree(),ai.default.createElement(uge.RootDropTargets,null)))},t.prototype.getRoot=function(){return Z1(this.props)?this.state.currentNode:this.props.value},t.prototype.renderTree=function(){var n=this.getRoot();if(this.validateTree(n),n==null)return this.props.zeroStateView;var r=this.props,i=r.renderTile,o=r.resize;return ai.default.createElement(sge.MosaicRoot,{root:n,renderTile:i,resize:o})},t.prototype.validateTree=function(n){},t.defaultProps={onChange:function(){},zeroStateView:ai.default.createElement(lge.MosaicZeroState,null),className:"mosaic-blueprint-theme",blueprintNamespace:"bp3"},t}(ai.default.PureComponent);rs.MosaicWithoutDragDropContext=zA;var dge=function(e){WA(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(){return ai.default.createElement(rge.DndProvider,Yh({backend:ige.MultiBackend,options:nge.HTML5toTouch},this.props.dragAndDropManager&&{manager:this.props.dragAndDropManager}),ai.default.createElement(zA,Yh({},this.props)))},t}(ai.default.PureComponent);rs.Mosaic=dge;var ls={},fge="Expected a function";function hge(e,t,n){if(typeof e!="function")throw new TypeError(fge);return setTimeout(function(){e.apply(void 0,n)},t)}var pge=hge,gge=pge,mge=Od,vge=mge(function(e,t){return gge(e,1,t)}),yge=vge,Bo={},hu={},us={};(function(e){var t=J&&J.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.createDefaultToolbarButton=e.DefaultToolbarButton=void 0;var n=t(Wn),r=t(x),i=Ut,o=Gi,a=function(l){var u=l.title,c=l.className,d=l.onClick,f=l.text,h=r.default.useContext(i.MosaicContext).blueprintNamespace;return r.default.createElement("button",{title:u,onClick:d,className:(0,n.default)("mosaic-default-control",o.OptionalBlueprint.getClasses(h,"BUTTON","MINIMAL"),c)},f&&r.default.createElement("span",{className:"control-text"},f))};e.DefaultToolbarButton=a;var s=function(l,u,c,d){return r.default.createElement(e.DefaultToolbarButton,{title:l,className:u,onClick:c,text:d})};e.createDefaultToolbarButton=s})(us);var wge=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HA=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hu,"__esModule",{value:!0}),hu.ExpandButton=void 0;var _ge=HA(Wn),K1=HA(x),UA=Ut,Tge=Gi,Ege=us,xge=function(e){wge(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(){var n=this;return K1.default.createElement(UA.MosaicContext.Consumer,null,function(r){var i=r.mosaicActions;return K1.default.createElement(Ege.DefaultToolbarButton,{title:"Expand",className:(0,_ge.default)("expand-button",Tge.OptionalBlueprint.getIconClass(n.context.blueprintNamespace,"MAXIMIZE")),onClick:n.createExpand(i)})})},t.prototype.createExpand=function(n){var r=this;return function(){n.expand(r.context.mosaicWindowActions.getPath()),r.props.onClick&&r.props.onClick()}},t.contextType=UA.MosaicWindowContext,t}(K1.default.PureComponent);hu.ExpandButton=xge;var pu={},Sge=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),VA=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pu,"__esModule",{value:!0}),pu.RemoveButton=void 0;var bge=VA(Wn),Y1=VA(x),GA=Ut,Cge=Gi,Pge=us,Oge=function(e){Sge(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(){var n=this;return Y1.default.createElement(GA.MosaicContext.Consumer,null,function(r){var i=r.mosaicActions,o=r.blueprintNamespace;return Y1.default.createElement(Pge.DefaultToolbarButton,{title:"Close Window",className:(0,bge.default)("close-button",Cge.OptionalBlueprint.getIconClass(o,"CROSS")),onClick:n.createRemove(i)})})},t.prototype.createRemove=function(n){var r=this;return function(){n.remove(r.context.mosaicWindowActions.getPath()),r.props.onClick&&r.props.onClick()}},t.contextType=GA.MosaicWindowContext,t}(Y1.default.PureComponent);pu.RemoveButton=Oge;var gu={},Rge=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),X1=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gu,"__esModule",{value:!0}),gu.ReplaceButton=void 0;var Ige=X1(Wn),Age=X1(ml),$A=X1(x),Dge=Ut,Mge=Gi,Nge=us,Lge=function(e){Rge(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.replace=function(){n.context.mosaicWindowActions.replaceWithNew().then(function(){n.props.onClick&&n.props.onClick()}).catch(Age.default)},n}return t.prototype.render=function(){return $A.default.createElement(Nge.DefaultToolbarButton,{title:"Replace Window",className:(0,Ige.default)("replace-button",Mge.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"EXCHANGE")),onClick:this.replace})},t.contextType=Dge.MosaicWindowContext,t}($A.default.PureComponent);gu.ReplaceButton=Lge;var mu={},kge=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q1=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mu,"__esModule",{value:!0}),mu.SplitButton=void 0;var Fge=Q1(Wn),Bge=Q1(ml),qA=Q1(x),jge=Ut,Wge=Gi,zge=us,Hge=function(e){kge(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.split=function(){n.context.mosaicWindowActions.split().then(function(){n.props.onClick&&n.props.onClick()}).catch(Bge.default)},n}return t.prototype.render=function(){return qA.default.createElement(zge.DefaultToolbarButton,{title:"Split Window",className:(0,Fge.default)("split-button",Wge.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"ADD_COLUMN_RIGHT")),onClick:this.split})},t.contextType=jge.MosaicWindowContext,t}(qA.default.PureComponent);mu.SplitButton=Hge;var Uge=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.DEFAULT_CONTROLS_WITHOUT_CREATION=Bo.DEFAULT_CONTROLS_WITH_CREATION=void 0;var $i=Uge(x),ZA=hu,KA=pu,Vge=gu,Gge=mu;Bo.DEFAULT_CONTROLS_WITH_CREATION=$i.default.Children.toArray([$i.default.createElement(Vge.ReplaceButton,null),$i.default.createElement(Gge.SplitButton,null),$i.default.createElement(ZA.ExpandButton,null),$i.default.createElement(KA.RemoveButton,null)]),Bo.DEFAULT_CONTROLS_WITHOUT_CREATION=$i.default.Children.toArray([$i.default.createElement(ZA.ExpandButton,null),$i.default.createElement(KA.RemoveButton,null)]);var vu={},$ge=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qge=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vu,"__esModule",{value:!0}),vu.Separator=void 0;var YA=qge(x),Zge=function(e){$ge(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(){return YA.default.createElement("div",{className:"separator"})},t}(YA.default.PureComponent);vu.Separator=Zge;var XA=J&&J.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qh=J&&J.__assign||function(){return Qh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qh.apply(this,arguments)},Kge=J&&J.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get" in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Yge=J&&J.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xge=J&&J.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Kge(t,e,n);return Yge(t,e),t},cs=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ls,"__esModule",{value:!0}),ls.MosaicWindow=ls.InternalMosaicWindow=void 0;var yu=cs(Wn),Qge=cs(yge),Jge=cs(U1),eme=cs(_2),tme=cs(V1),nme=cs(zy),it=Xge(x),QA=bh,JA=Bo,rme=vu,J1=Ut,ime=ss,ome=du,eD=ko,ame=en,sme=zr,wu=Gi,tD=function(e){XA(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={additionalControlsOpen:!1},n.rootElement=null,n.renderDropTarget=function(r){var i=n.props.path;return it.default.createElement(ome.MosaicDropTarget,{position:r,path:i,key:r})},n.split=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n.checkCreateNode();var o=n.props,a=o.createNode,s=o.path,l=n.context.mosaicActions,u=l.getRoot(),c=n.rootElement.offsetWidth>n.rootElement.offsetHeight?"row":"column";return Promise.resolve(a.apply(void 0,r)).then(function(d){return l.replaceWith(s,{direction:c,second:d,first:(0,sme.getAndAssertNodeAtPathExists)(u,s)})})},n.swap=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n.checkCreateNode();var o=n.context.mosaicActions,a=n.props,s=a.createNode,l=a.path;return Promise.resolve(s.apply(void 0,r)).then(function(u){return o.replaceWith(l,u)})},n.setAdditionalControlsOpen=function(r){var i,o,a=r==="toggle"?!n.state.additionalControlsOpen:r;n.setState({additionalControlsOpen:a}),(o=(i=n.props).onAdditionalControlsToggle)===null||o===void 0||o.call(i,a)},n.getPath=function(){return n.props.path},n.connectDragSource=function(r){var i=n.props.connectDragSource;return i(r)},n.childContext={blueprintNamespace:n.context.blueprintNamespace,mosaicWindowActions:{split:n.split,replaceWithNew:n.swap,setAdditionalControlsOpen:n.setAdditionalControlsOpen,getPath:n.getPath,connectDragSource:n.connectDragSource}},n}return t.prototype.render=function(){var n=this,r=this.props,i=r.className,o=r.isOver,a=r.renderPreview,s=r.additionalControls,l=r.connectDropTarget,u=r.connectDragPreview,c=r.draggedMosaicId,d=r.disableAdditionalControlsOverlay;return it.default.createElement(J1.MosaicWindowContext.Provider,{value:this.childContext},l(it.default.createElement("div",{className:(0,yu.default)("mosaic-window mosaic-drop-target",i,{"drop-target-hover":o&&c===this.context.mosaicId,"additional-controls-open":this.state.additionalControlsOpen}),ref:function(f){return n.rootElement=f}},this.renderToolbar(),it.default.createElement("div",{className:"mosaic-window-body"},this.props.children),!d&&it.default.createElement("div",{className:"mosaic-window-body-overlay",onClick:function(){n.setAdditionalControlsOpen(!1)}}),it.default.createElement("div",{className:"mosaic-window-additional-actions-bar"},s),u(a(this.props)),it.default.createElement("div",{className:"drop-target-container"},(0,nme.default)(ime.MosaicDropTargetPosition).map(this.renderDropTarget)))))},t.prototype.getToolbarControls=function(){var n=this.props,r=n.toolbarControls,i=n.createNode;return r||(i?JA.DEFAULT_CONTROLS_WITH_CREATION:JA.DEFAULT_CONTROLS_WITHOUT_CREATION)},t.prototype.renderToolbar=function(){var n,r=this,i=this.props,o=i.title,a=i.draggable,s=i.additionalControls,l=i.additionalControlButtonText,u=i.path,c=i.renderToolbar,d=this.state.additionalControlsOpen,f=this.getToolbarControls(),h=a&&u.length>0,g=h?this.props.connectDragSource:function(y){return y};if(c){var p=g(c(this.props,a));return it.default.createElement("div",{className:(0,yu.default)("mosaic-window-toolbar",{draggable:h})},p)}var v=g(it.default.createElement("div",{title:o,className:"mosaic-window-title"},o)),m=!(0,eme.default)(s);return it.default.createElement("div",{className:(0,yu.default)("mosaic-window-toolbar",{draggable:h})},v,it.default.createElement("div",{className:(0,yu.default)("mosaic-window-controls",wu.OptionalBlueprint.getClasses("BUTTON_GROUP"))},m&&it.default.createElement("button",{onClick:function(){return r.setAdditionalControlsOpen(!d)},className:(0,yu.default)(wu.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"BUTTON","MINIMAL"),wu.OptionalBlueprint.getIconClass(this.context.blueprintNamespace,"MORE"),(n={},n[wu.OptionalBlueprint.getClasses(this.context.blueprintNamespace,"ACTIVE")]=d,n))},it.default.createElement("span",{className:"control-text"},l)),m&&it.default.createElement(rme.Separator,null),f))},t.prototype.checkCreateNode=function(){if(this.props.createNode==null)throw new Error("Operation invalid unless `createNode` is defined")},t.defaultProps={additionalControlButtonText:"More",draggable:!0,renderPreview:function(n){var r=n.title;return it.default.createElement("div",{className:"mosaic-preview"},it.default.createElement("div",{className:"mosaic-window-toolbar"},it.default.createElement("div",{className:"mosaic-window-title"},r)),it.default.createElement("div",{className:"mosaic-window-body"},it.default.createElement("h4",null,r),it.default.createElement(wu.OptionalBlueprint.Icon,{className:"default-preview-icon",size:"large",icon:"APPLICATION"})))},renderToolbar:null},t.contextType=J1.MosaicContext,t}(it.default.Component);ls.InternalMosaicWindow=tD;function lme(e){var t=(0,it.useContext)(J1.MosaicContext),n=t.mosaicActions,r=t.mosaicId,i=(0,QA.useDrag)({type:eD.MosaicDragType.WINDOW,item:function(f){e.onDragStart&&e.onDragStart();var h=(0,Qge.default)(function(){return n.hide(e.path)});return{mosaicId:r,hideTimer:h}},end:function(f,h){var g=f.hideTimer;window.clearTimeout(g);var p=e.path,v=h.getDropResult()||{},m=v.position,y=v.path;m!=null&&y!=null&&!(0,tme.default)(y,p)?(n.updateTree((0,ame.createDragToUpdates)(n.getRoot(),p,y,m)),e.onDragEnd&&e.onDragEnd("drop")):(n.updateTree([{path:(0,Jge.default)(p),spec:{splitPercentage:{$set:void 0}}}]),e.onDragEnd&&e.onDragEnd("reset"))}}),o=i[1],a=i[2],s=(0,QA.useDrop)({accept:eD.MosaicDragType.WINDOW,collect:function(f){var h;return{isOver:f.isOver(),draggedMosaicId:(h=f.getItem())===null||h===void 0?void 0:h.mosaicId}}}),l=s[0],u=l.isOver,c=l.draggedMosaicId,d=s[1];return it.default.createElement(tD,Qh({},e,{connectDragPreview:a,connectDragSource:o,connectDropTarget:d,isOver:u,draggedMosaicId:c}))}var ume=function(e){XA(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(){return it.default.createElement(lme,Qh({},this.props))},t}(it.default.PureComponent);ls.MosaicWindow=ume,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_CONTROLS_WITHOUT_CREATION=e.DEFAULT_CONTROLS_WITH_CREATION=e.RemoveButton=e.SplitButton=e.ReplaceButton=e.ExpandButton=e.Separator=e.MosaicZeroState=e.DefaultToolbarButton=e.createDefaultToolbarButton=e.MosaicWindow=e.isParent=e.getPathToCorner=e.getOtherDirection=e.getOtherBranch=e.getNodeAtPath=e.getLeaves=e.getAndAssertNodeAtPathExists=e.Corner=e.createBalancedTreeFromLeaves=e.updateTree=e.createRemoveUpdate=e.createHideUpdate=e.createExpandUpdate=e.createDragToUpdates=e.buildSpecFromUpdate=e.MosaicWindowContext=e.MosaicContext=e.MosaicDragType=e.MosaicWithoutDragDropContext=e.Mosaic=void 0;var t=rs;Object.defineProperty(e,"Mosaic",{enumerable:!0,get:function(){return t.Mosaic}}),Object.defineProperty(e,"MosaicWithoutDragDropContext",{enumerable:!0,get:function(){return t.MosaicWithoutDragDropContext}});var n=ko;Object.defineProperty(e,"MosaicDragType",{enumerable:!0,get:function(){return n.MosaicDragType}});var r=Ut;Object.defineProperty(e,"MosaicContext",{enumerable:!0,get:function(){return r.MosaicContext}}),Object.defineProperty(e,"MosaicWindowContext",{enumerable:!0,get:function(){return r.MosaicWindowContext}});var i=en;Object.defineProperty(e,"buildSpecFromUpdate",{enumerable:!0,get:function(){return i.buildSpecFromUpdate}}),Object.defineProperty(e,"createDragToUpdates",{enumerable:!0,get:function(){return i.createDragToUpdates}}),Object.defineProperty(e,"createExpandUpdate",{enumerable:!0,get:function(){return i.createExpandUpdate}}),Object.defineProperty(e,"createHideUpdate",{enumerable:!0,get:function(){return i.createHideUpdate}}),Object.defineProperty(e,"createRemoveUpdate",{enumerable:!0,get:function(){return i.createRemoveUpdate}}),Object.defineProperty(e,"updateTree",{enumerable:!0,get:function(){return i.updateTree}});var o=zr;Object.defineProperty(e,"createBalancedTreeFromLeaves",{enumerable:!0,get:function(){return o.createBalancedTreeFromLeaves}}),Object.defineProperty(e,"Corner",{enumerable:!0,get:function(){return o.Corner}}),Object.defineProperty(e,"getAndAssertNodeAtPathExists",{enumerable:!0,get:function(){return o.getAndAssertNodeAtPathExists}}),Object.defineProperty(e,"getLeaves",{enumerable:!0,get:function(){return o.getLeaves}}),Object.defineProperty(e,"getNodeAtPath",{enumerable:!0,get:function(){return o.getNodeAtPath}}),Object.defineProperty(e,"getOtherBranch",{enumerable:!0,get:function(){return o.getOtherBranch}}),Object.defineProperty(e,"getOtherDirection",{enumerable:!0,get:function(){return o.getOtherDirection}}),Object.defineProperty(e,"getPathToCorner",{enumerable:!0,get:function(){return o.getPathToCorner}}),Object.defineProperty(e,"isParent",{enumerable:!0,get:function(){return o.isParent}});var a=ls;Object.defineProperty(e,"MosaicWindow",{enumerable:!0,get:function(){return a.MosaicWindow}});var s=us;Object.defineProperty(e,"createDefaultToolbarButton",{enumerable:!0,get:function(){return s.createDefaultToolbarButton}}),Object.defineProperty(e,"DefaultToolbarButton",{enumerable:!0,get:function(){return s.DefaultToolbarButton}});var l=cu;Object.defineProperty(e,"MosaicZeroState",{enumerable:!0,get:function(){return l.MosaicZeroState}});var u=vu;Object.defineProperty(e,"Separator",{enumerable:!0,get:function(){return u.Separator}});var c=hu;Object.defineProperty(e,"ExpandButton",{enumerable:!0,get:function(){return c.ExpandButton}});var d=gu;Object.defineProperty(e,"ReplaceButton",{enumerable:!0,get:function(){return d.ReplaceButton}});var f=mu;Object.defineProperty(e,"SplitButton",{enumerable:!0,get:function(){return f.SplitButton}});var h=pu;Object.defineProperty(e,"RemoveButton",{enumerable:!0,get:function(){return h.RemoveButton}});var g=Bo;Object.defineProperty(e,"DEFAULT_CONTROLS_WITH_CREATION",{enumerable:!0,get:function(){return g.DEFAULT_CONTROLS_WITH_CREATION}}),Object.defineProperty(e,"DEFAULT_CONTROLS_WITHOUT_CREATION",{enumerable:!0,get:function(){return g.DEFAULT_CONTROLS_WITHOUT_CREATION}})}(ns);var cme=zS,dme=Gc,fme=Od,nD=Iv,hme=fme(function(e,t){return nD(e)?cme(e,dme(t,1,nD,!0)):[]}),pme=hme;const rD=He(pme),gme=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M22.9895 2.5H1.01053C0.452428 2.5 0 2.90004 0 3.3935C0 3.88697 0.452428 4.28701 1.01053 4.28701H22.9895C23.5476 4.28701 24 3.88697 24 3.3935C24 2.90004 23.5476 2.5 22.9895 2.5Z",fill:"white"}),x.createElement("path",{d:"M22.9895 11.1065H1.01053C0.452428 11.1065 0 11.5065 0 12C0 12.4935 0.452428 12.8935 1.01053 12.8935H22.9895C23.5476 12.8935 24 12.4935 24 12C24 11.5065 23.5476 11.1065 22.9895 11.1065Z",fill:"white"}),x.createElement("path",{d:"M22.9895 19.713H1.01053C0.452428 19.713 0 20.113 0 20.6065C0 21.1 0.452428 21.5 1.01053 21.5H22.9895C23.5476 21.5 24 21.1 24 20.6065C24 20.113 23.5476 19.713 22.9895 19.713Z",fill:"white"})),mme=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M22.9895 2.5H1.01053C0.452428 2.5 0 2.90004 0 3.3935C0 3.88697 0.452428 4.28701 1.01053 4.28701H22.9895C23.5476 4.28701 24 3.88697 24 3.3935C24 2.90004 23.5476 2.5 22.9895 2.5Z",fill:"black"}),x.createElement("path",{d:"M22.9895 11.1065H1.01053C0.452428 11.1065 0 11.5065 0 12C0 12.4935 0.452428 12.8935 1.01053 12.8935H22.9895C23.5476 12.8935 24 12.4935 24 12C24 11.5065 23.5476 11.1065 22.9895 11.1065Z",fill:"black"}),x.createElement("path",{d:"M22.9895 19.713H1.01053C0.452428 19.713 0 20.113 0 20.6065C0 21.1 0.452428 21.5 1.01053 21.5H22.9895C23.5476 21.5 24 21.1 24 20.6065C24 20.113 23.5476 19.713 22.9895 19.713Z",fill:"black"}));function iD({theme:e,...t}){const n=e==="light"?mme:gme;return S.jsx(n,{...t})}iD.propTypes={theme:A.string.isRequired};function vme(e){const{badgeContent:t,invisible:n=!1,max:r=99,showZero:i=!1}=e,o=nC({badgeContent:t,max:r});let a=n;n===!1&&t===0&&!i&&(a=!0);const{badgeContent:s,max:l=r}=a?o:e,u=s&&Number(s)>l?`${l}+`:s;return{badgeContent:s,invisible:a,max:l,displayValue:u}}function yme(e){return ln("MuiBadge",e)}const qi=yn("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),wme=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],ew=10,tw=4,_me=e=>{const{color:t,anchorOrigin:n,invisible:r,overlap:i,variant:o,classes:a={}}=e,s={root:["root"],badge:["badge",o,r&&"invisible",`anchorOrigin${Ce(n.vertical)}${Ce(n.horizontal)}`,`anchorOrigin${Ce(n.vertical)}${Ce(n.horizontal)}${Ce(i)}`,`overlap${Ce(i)}`,t!=="default"&&`color${Ce(t)}`]};return wn(s,yme,a)},Tme=ie("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),Eme=ie("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${Ce(n.anchorOrigin.vertical)}${Ce(n.anchorOrigin.horizontal)}${Ce(n.overlap)}`],n.color!=="default"&&t[`color${Ce(n.color)}`],n.invisible&&t.invisible]}})(({theme:e})=>{var t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:ew*2,lineHeight:1,padding:"0 6px",height:ew*2,borderRadius:ew,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.keys(((t=e.vars)!=null?t:e).palette).filter(n=>{var r,i;return((r=e.vars)!=null?r:e).palette[n].main&&((i=e.vars)!=null?i:e).palette[n].contrastText}).map(n=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText}})),{props:{variant:"dot"},style:{borderRadius:tw,height:tw*2,minWidth:tw*2,padding:0}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${qi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]}}),xme=x.forwardRef(function(t,n){var r,i,o,a,s,l;const u=Tn({props:t,name:"MuiBadge"}),{anchorOrigin:c={vertical:"top",horizontal:"right"},className:d,component:f,components:h={},componentsProps:g={},children:p,overlap:v="rectangular",color:m="default",invisible:y=!1,max:E=99,badgeContent:b,slots:R,slotProps:M,showZero:C=!1,variant:D="standard"}=u,F=Ne(u,wme),{badgeContent:L,invisible:B,max:z,displayValue:$}=vme({max:E,invisible:y,badgeContent:b,showZero:C}),de=nC({anchorOrigin:c,color:m,overlap:v,variant:D,badgeContent:b}),X=B||L==null&&D!=="dot",{color:re=m,overlap:fe=v,anchorOrigin:H=c,variant:Y=D}=X?de:u,ae=Y!=="dot"?$:void 0,Te=j({},u,{badgeContent:L,invisible:X,max:z,displayValue:ae,showZero:C,anchorOrigin:H,color:re,overlap:fe,variant:Y}),Se=_me(Te),oe=(r=(i=R==null?void 0:R.root)!=null?i:h.Root)!=null?r:Tme,be=(o=(a=R==null?void 0:R.badge)!=null?a:h.Badge)!=null?o:Eme,te=(s=M==null?void 0:M.root)!=null?s:g.root,q=(l=M==null?void 0:M.badge)!=null?l:g.badge,ee=fy({elementType:oe,externalSlotProps:te,externalForwardedProps:F,additionalProps:{ref:n,as:f},ownerState:Te,className:$e(te==null?void 0:te.className,Se.root,d)}),se=fy({elementType:be,externalSlotProps:q,ownerState:Te,className:$e(Se.badge,q==null?void 0:q.className)});return S.jsxs(oe,j({},ee,{children:[p,S.jsx(be,j({},se,{children:ae}))]}))});function Sme(e){return ln("MuiIconButton",e)}const bme=yn("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Cme=["edge","children","className","color","disabled","disableFocusRipple","size"],Pme=e=>{const{classes:t,disabled:n,color:r,edge:i,size:o}=e,a={root:["root",n&&"disabled",r!=="default"&&`color${Ce(r)}`,i&&`edge${Ce(i)}`,`size${Ce(o)}`]};return wn(a,Sme,t)},Ome=ie(KR,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Ce(n.color)}`],n.edge&&t[`edge${Ce(n.edge)}`],t[`size${Ce(n.size)}`]]}})(({theme:e,ownerState:t})=>j({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:_o(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var n;const r=(n=(e.vars||e).palette)==null?void 0:n[t.color];return j({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&j({color:r==null?void 0:r.main},!t.disableRipple&&{"&:hover":j({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:_o(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${bme.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),Rme=ie(x.forwardRef(function(t,n){const r=Tn({props:t,name:"MuiIconButton"}),{edge:i=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:u=!1,size:c="medium"}=r,d=Ne(r,Cme),f=j({},r,{edge:i,color:s,disabled:l,disableFocusRipple:u,size:c}),h=Pme(f);return S.jsx(Ome,j({className:$e(h.root,a),centerRipple:!0,focusRipple:!u,disabled:l,ref:n},d,{ownerState:f,children:o}))}),{name:"TVMenuBtn",slot:"root"})(({ownerState:e,theme:t})=>({...e.selected&&{backgroundColor:t.palette.action.selected}}));function oD({"aria-label":e,badge:t=!1,children:n,container:r=null,dispatch:i=()=>{},BadgeProps:o={},TooltipProps:a={},sx:s={},selected:l=!1,...u}){const c=S.jsx(Rme,{ownerState:{selected:l},...u,sx:s,size:"large",children:t?S.jsx(xme,{overlap:"rectangular",...o,children:n}):n});return u.disabled?c:S.jsx(BR,{PopperProps:{container:r==null?void 0:r.current},title:e,...a,children:c})}oD.propTypes={"aria-label":A.string.isRequired,badge:A.bool,BadgeProps:A.object,children:A.element.isRequired,container:A.shape({current:A.instanceOf(Element)}),dispatch:A.func,selected:A.bool,sx:A.object,TooltipProps:A.object};const aD=Me(Sf,gt("TVMenuBtn"))(oD),Ime=ie(aD)(()=>({marginLeft:"auto"}));let sD=class extends x.Component{render(){const{allowClose:t=!0,allowWindowSideBar:n=!0,ariaLabel:r=!0,children:i=null,label:o="",removeWindow:a=()=>{},windowId:s,selectedTheme:l}=this.props;return S.jsxs(nh,{component:"section",elevation:1,id:s,className:je(ve("placeholder-window")),sx:{backgroundColor:"shades.dark",borderRadius:0,display:"flex",flexDirection:"column",height:"100%",minHeight:0,overflow:"hidden",width:"100%"},"aria-label":o&&r?`Window: ${o}`:null,children:[S.jsx(lR,{position:"relative",color:"default",enableColorOnDark:!0,children:S.jsxs(sR,{disableGutters:!0,className:je(ve("window-top-bar")),sx:{backgroundColor:"shades.main",borderTop:"2px solid transparent",minHeight:32,paddingLeft:.5,paddingRight:.5},variant:"dense",children:[n&&S.jsx(aD,{"aria-label":"Toggle sidebar",disabled:!0,children:S.jsx(iD,{theme:l})}),S.jsx(dn,{variant:"h2",noWrap:!0,color:"inherit",sx:{flexGrow:1,paddingLeft:.5,typography:"h6"},children:o}),t&&a&&S.jsx(Ime,{"aria-label":"Close window",className:je(ve("window-close")),onClick:a,TooltipProps:{tabIndex:r?0:-1},children:S.jsx(Jl,{theme:l})})]})}),i]})}};sD.propTypes={allowClose:A.bool,allowWindowSideBar:A.bool,ariaLabel:A.bool,children:A.node,label:A.string,removeWindow:A.func,windowId:A.string.isRequired,selectedTheme:A.string};const Ame=Me(Qe((e,{windowId:t})=>({allowClose:_r(e,{windowId:t}).allowClose,allowWindowSideBar:_r(e,{windowId:t}).allowWindowSideBar,selectedTheme:Ie(e).selectedTheme}),(e,{windowId:t})=>({removeWindow:()=>e(Jf(t))})),gt("MinimalWindow_PW"))(sD);function lD({title:e="",windowId:t}){return S.jsx(Ame,{windowId:`${t}-preview`,label:e,ariaLabel:!1})}lD.propTypes={title:A.string,windowId:A.string.isRequired};const Dme=Me(Qe((e,{windowId:t})=>({title:Ra(e,{windowId:t})}),null),gt("MosaicRenderPreview_PW"))(lD);class uD{constructor(t){this.layout=t}pathToCorner(t=zr.Corner.TOP_RIGHT){return zr.getPathToCorner(this.layout,t)}pathToParent(t){return zr.getNodeAtPath(this.layout,zpe(t))}nodeAtPath(t){return zr.getNodeAtPath(this.layout,t)}addWindows(t){t.forEach((n,r)=>{const i=this.pathToCorner(),o=this.pathToParent(i),a=this.nodeAtPath(i),s=o?zr.getOtherDirection(o.direction):"row";let l,u;s==="row"?(l=a,u=t[r]):(l=t[r],u=a);const c={path:i,spec:{$set:{direction:s,first:l,second:u}}};this.layout=$1(this.layout,[c])})}removeWindows(t,n){const r=t.map(i=>BA(this.layout,n[i]));this.layout=$1(this.layout,r)}}const Mme={".mosaic":{height:"100%",width:"100%"},".mosaic, .mosaic > *":{boxSizing:"border-box"},".mosaic .mosaic-zero-state":{position:"absolute",top:6,right:6,bottom:6,left:6,width:"auto",height:"auto",zIndex:"1"},".mosaic-root":{position:"absolute",top:3,right:3,bottom:3,left:3},".mosaic-split":{position:"absolute",zIndex:"1",touchAction:"none"},".mosaic-split:hover":{background:"black"},".mosaic-split .mosaic-split-line":{position:"absolute"},".mosaic-split.-row":{marginLeft:-3,width:6,cursor:"ew-resize"},".mosaic-split.-row .mosaic-split-line":{top:"0",bottom:"0",left:3,right:3},".mosaic-split.-column":{marginTop:-3,height:6,cursor:"ns-resize"},".mosaic-split.-column .mosaic-split-line":{top:3,bottom:3,left:"0",right:"0"},".mosaic-tile":{position:"absolute",margin:3},".mosaic-tile > *":{height:"100%",width:"100%"},".mosaic-drop-target":{position:"relative"},".mosaic-drop-target.drop-target-hover .drop-target-container":{display:"block"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.left":{right:"calc(100% -  10px )"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.right":{left:"calc(100% -  10px )"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.bottom":{top:"calc(100% -  10px )"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.top":{bottom:"calc(100% -  10px )"},".mosaic-drop-target .drop-target-container":{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"none"},".mosaic-drop-target .drop-target-container.-dragging":{display:"block"},".mosaic-drop-target .drop-target-container .drop-target":{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",background:"rgba(0, 0, 0, 0.2)",border:"2px solid black",opacity:"0",zIndex:"5"},".mosaic-drop-target .drop-target-container .drop-target.left":{right:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.right":{left:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.bottom":{top:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.top":{bottom:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover":{opacity:"1"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.left":{right:"calc(100% -  50% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.right":{left:"calc(100% -  50% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.bottom":{top:"calc(100% -  50% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.top":{bottom:"calc(100% -  50% )"},".mosaic-window, .mosaic-preview":{position:"relative",display:"flex",fallbacks:[{display:"-webkit-box"}],webkitBoxOrient:"vertical",webkitBoxDirection:"normal",flexDirection:"column",overflow:"hidden",boxShadow:"0 0 1px rgba(0, 0, 0, 0.2)"},".mosaic-window .mosaic-window-toolbar, .mosaic-preview .mosaic-window-toolbar":{zIndex:"4",display:"flex",fallbacks:[{display:"-webkit-box"}],webkitBoxPack:"justify",justifyContent:"space-between",webkitBoxAlign:"center",alignItems:"center",flexShrink:"0",height:30,background:"white",boxShadow:"0 1px 1px rgba(0, 0, 0, 0.2)"},".mosaic-window .mosaic-window-toolbar.draggable, .mosaic-preview .mosaic-window-toolbar.draggable":{cursor:"move"},".mosaic-window .mosaic-window-title, .mosaic-preview .mosaic-window-title":{paddingLeft:15,webkitBoxFlex:"1",flex:"1",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minHeight:18},".mosaic-window .mosaic-window-controls, .mosaic-preview .mosaic-window-controls":{display:"flex",fallbacks:[{display:"-webkit-box"}],height:"100%"},".mosaic-window .mosaic-window-controls .separator, .mosaic-preview .mosaic-window-controls .separator":{height:20,borderLeft:"1px solid black",margin:"5px 4px"},".mosaic-window .mosaic-window-body, .mosaic-preview .mosaic-window-body":{position:"relative",webkitBoxFlex:"1",flex:"1",height:"0",background:"white",zIndex:"1",overflow:"hidden"},".mosaic-window .mosaic-window-additional-actions-bar, .mosaic-preview .mosaic-window-additional-actions-bar":{position:"absolute",top:30,right:"0",bottom:"initial",left:"0",height:"0",overflow:"hidden",background:"white",webkitBoxPack:"end",justifyContent:"flex-end",display:"flex",fallbacks:[{display:"-webkit-box"}],zIndex:"3"},".mosaic-window .mosaic-window-additional-actions-bar .bp3-button, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button":{margin:"0"},".mosaic-window .mosaic-window-additional-actions-bar .bp3-button:after, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button:after":{display:"none"},".mosaic-window .mosaic-window-body-overlay, .mosaic-preview .mosaic-window-body-overlay":{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",opacity:"0",background:"white",display:"none",zIndex:"2"},".mosaic-window.additional-controls-open .mosaic-window-additional-actions-bar, .mosaic-preview.additional-controls-open .mosaic-window-additional-actions-bar":{height:30},".mosaic-window.additional-controls-open .mosaic-window-body-overlay, .mosaic-preview.additional-controls-open .mosaic-window-body-overlay":{display:"block"},".mosaic-window .mosaic-preview, .mosaic-preview .mosaic-preview":{height:"100%",width:"100%",position:"absolute",zIndex:"0",border:"1px solid black",maxHeight:400},".mosaic-window .mosaic-preview .mosaic-window-body, .mosaic-preview .mosaic-preview .mosaic-window-body":{display:"flex",fallbacks:[{display:"-webkit-box"}],webkitBoxOrient:"vertical",webkitBoxDirection:"normal",flexDirection:"column",webkitBoxAlign:"center",alignItems:"center",webkitBoxPack:"center",justifyContent:"center"},".mosaic-window .mosaic-preview h4, .mosaic-preview .mosaic-preview h4":{marginBottom:10},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.close-button:before":{content:"'Close'"},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.split-button:before":{content:"'Split'"},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.replace-button:before":{content:"'Replace'"},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.expand-button:before":{content:"'Expand'"}},Nme={".mosaic":{height:"100%",width:"100%"},".mosaic, .mosaic > *":{boxSizing:"border-box"},".mosaic .mosaic-zero-state":{position:"absolute",top:6,right:6,bottom:6,left:6,width:"auto",height:"auto",zIndex:"1"},".mosaic-root":{position:"absolute",top:0,right:0,bottom:0,left:0},".mosaic-split":{touchAction:"none",pointerEvents:"none",position:"absolute",zIndex:"10"},".mosaic-split .mosaic-split-line":{position:"absolute"},".mosaic-split.-row":{width:"1px",background:"rgba(255, 255, 255, 0.20)"},".mosaic-split.-row .mosaic-split-line":{top:"0",bottom:"0",left:"0",right:"0"},".mosaic-split.-column":{height:"1px",background:"rgba(255, 255, 255, 0.20)"},".mosaic-split.-column .mosaic-split-line":{top:"0",bottom:"0",left:"0",right:"0"},".mosaic-tile":{position:"absolute",margin:0},".mosaic-tile > *":{height:"100%",width:"100%"},".mosaic-drop-target":{position:"relative"},".mosaic-drop-target.drop-target-hover .drop-target-container":{display:"block"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.left":{right:"calc(100% -  10px )"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.right":{left:"calc(100% -  10px )"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.bottom":{top:"calc(100% -  10px )"},".mosaic-drop-target.mosaic > .drop-target-container .drop-target.top":{bottom:"calc(100% -  10px )"},".mosaic-drop-target .drop-target-container":{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"none"},".mosaic-drop-target .drop-target-container.-dragging":{display:"block"},".mosaic-drop-target .drop-target-container .drop-target":{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",background:"rgba(0, 0, 0, 0.2)",border:"2px solid black",opacity:"0",zIndex:"5"},".mosaic-drop-target .drop-target-container .drop-target.left":{right:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.right":{left:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.bottom":{top:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.top":{bottom:"calc(100% -  30% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover":{opacity:"1"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.left":{right:"calc(100% -  50% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.right":{left:"calc(100% -  50% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.bottom":{top:"calc(100% -  50% )"},".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.top":{bottom:"calc(100% -  50% )"},".mosaic-window, .mosaic-preview":{position:"relative",display:"flex",fallbacks:[{display:"-webkit-box"}],webkitBoxOrient:"vertical",webkitBoxDirection:"normal",flexDirection:"column",overflow:"hidden",boxShadow:"0 0 1px rgba(0, 0, 0, 0.2)"},".mosaic-window .mosaic-window-toolbar, .mosaic-preview .mosaic-window-toolbar":{zIndex:"4",display:"flex",fallbacks:[{display:"-webkit-box"}],webkitBoxPack:"justify",justifyContent:"space-between",webkitBoxAlign:"center",alignItems:"center",flexShrink:"0",height:30,background:"white",boxShadow:"0 1px 1px rgba(0, 0, 0, 0.2)"},".mosaic-window .mosaic-window-toolbar.draggable, .mosaic-preview .mosaic-window-toolbar.draggable":{cursor:"move"},".mosaic-window .mosaic-window-title, .mosaic-preview .mosaic-window-title":{paddingLeft:15,webkitBoxFlex:"1",flex:"1",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minHeight:18},".mosaic-window .mosaic-window-controls, .mosaic-preview .mosaic-window-controls":{display:"flex",fallbacks:[{display:"-webkit-box"}],height:"100%"},".mosaic-window .mosaic-window-controls .separator, .mosaic-preview .mosaic-window-controls .separator":{height:20,borderLeft:"1px solid black",margin:"5px 4px"},".mosaic-window .mosaic-window-body, .mosaic-preview .mosaic-window-body":{position:"relative",webkitBoxFlex:"1",flex:"1",height:"0",background:"white",zIndex:"1",overflow:"hidden"},".mosaic-window .mosaic-window-additional-actions-bar, .mosaic-preview .mosaic-window-additional-actions-bar":{position:"absolute",top:30,right:"0",bottom:"initial",left:"0",height:"0",overflow:"hidden",background:"white",webkitBoxPack:"end",justifyContent:"flex-end",display:"flex",fallbacks:[{display:"-webkit-box"}],zIndex:"3"},".mosaic-window .mosaic-window-additional-actions-bar .bp3-button, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button":{margin:"0"},".mosaic-window .mosaic-window-additional-actions-bar .bp3-button:after, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button:after":{display:"none"},".mosaic-window .mosaic-window-body-overlay, .mosaic-preview .mosaic-window-body-overlay":{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",opacity:"0",background:"white",display:"none",zIndex:"2"},".mosaic-window.additional-controls-open .mosaic-window-additional-actions-bar, .mosaic-preview.additional-controls-open .mosaic-window-additional-actions-bar":{height:30},".mosaic-window.additional-controls-open .mosaic-window-body-overlay, .mosaic-preview.additional-controls-open .mosaic-window-body-overlay":{display:"block"},".mosaic-window .mosaic-preview, .mosaic-preview .mosaic-preview":{height:"100%",width:"100%",position:"absolute",zIndex:"0",border:"1px solid black",maxHeight:400},".mosaic-window .mosaic-preview .mosaic-window-body, .mosaic-preview .mosaic-preview .mosaic-window-body":{display:"flex",fallbacks:[{display:"-webkit-box"}],webkitBoxOrient:"vertical",webkitBoxDirection:"normal",flexDirection:"column",webkitBoxAlign:"center",alignItems:"center",webkitBoxPack:"center",justifyContent:"center"},".mosaic-window .mosaic-preview h4, .mosaic-preview .mosaic-preview h4":{marginBottom:10},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.close-button:before":{content:"'Close'"},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.split-button:before":{content:"'Split'"},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.replace-button:before":{content:"'Replace'"},".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.expand-button:before":{content:"'Expand'"}},Lme=ie(ns.Mosaic)({"& .mosaic-preview":{boxShadow:"none"},"& .mosaic-tile":{boxShadow:"none"},"& .mosaic-window":{boxShadow:"none"},"& .mosaic-window-toolbar":{display:"none !important"}});let cD=class RD extends x.Component{constructor(t){super(t),this.tileRenderer=this.tileRenderer.bind(this),this.mosaicChange=this.mosaicChange.bind(this),this.determineWorkspaceLayout=this.determineWorkspaceLayout.bind(this),this.zeroStateView=S.jsx("div",{}),this.windowPaths={},this.toolbarControls=[],this.additionalControls=[]}componentDidMount(){const{updateWorkspaceMosaicLayout:t}=this.props,n=this.determineWorkspaceLayout();n&&t(n)}componentDidUpdate(t){const{windowIds:n=[],layout:r,updateWorkspaceMosaicLayout:i}=this.props,o=t.windowIds;if(!n.every(a=>o.includes(a))){const a=this.determineWorkspaceLayout();G1(a,r)||i(a);return}if(!o.every(a=>n.includes(a))){if(n.length===0){i(null);return}const a=rD(o,n),s=new uD(r);s.removeWindows(a,this.windowPaths),i(s.layout)}}bookkeepPath(t,n){this.windowPaths[t]=n}determineWorkspaceLayout(){const{windowIds:t=[],layout:n}=this.props,r=ns.getLeaves(n);if(!t.every(i=>r.includes(i))){if(r.length<2)return ns.createBalancedTreeFromLeaves(t);const i=rD(t,r),o=new uD(n);return o.addWindows(i),o.layout}return r.every(i=>t.includes(i))?n:ns.createBalancedTreeFromLeaves(t)}static renderPreview(t){return S.jsx("div",{className:"mosaic-preview","aria-hidden":!0,children:S.jsx(Dme,{windowId:t.windowId})})}tileRenderer(t,n){const{windowIds:r=[],workspaceId:i,closeTheViewer:o,closeLastWindow:a}=this.props;return r.includes(t)?(this.bookkeepPath(t,n),S.jsx(ns.MosaicWindow,{toolbarControls:this.toolbarControls,additionalControls:this.additionalControls,path:n,windowId:t,renderPreview:RD.renderPreview,children:S.jsx(sI,{windowId:t,closeTheViewer:o,closeLastWindow:a},`${t}-${i}`)})):null}mosaicChange(t){const{updateWorkspaceMosaicLayout:n}=this.props;n(t)}render(){const{layout:t,ngtvLayout:n}=this.props;return S.jsxs(S.Fragment,{children:[S.jsx(Vle,{styles:n==="ngop"?Mme:Nme}),S.jsx(Lme,{ref:this.componentRef,renderTile:this.tileRenderer,initialValue:t||this.determineWorkspaceLayout(),onChange:this.mosaicChange,className:je("ngtv-mosaic"),zeroStateView:this.zeroStateView})]})}};cD.propTypes={layout:A.oneOfType([A.object,A.string]),updateWorkspaceMosaicLayout:A.func.isRequired,windowIds:A.arrayOf(A.string),workspaceId:A.string.isRequired,ngtvLayout:A.string,closeTheViewer:A.func,closeLastWindow:A.func};const kme=Me(Qe(e=>({layout:Nn(e).layout,windowIds:Nn(e).windowIds,workspaceId:Nn(e).id,ngtvLayout:Ie(e).ngtvLayout}),{updateWorkspaceMosaicLayout:bO}),gt("WorkspaceMosaic_PW"))(cD),Fme=ie("div")({height:"100%",position:"relative",width:"100%"});let dD=class extends x.Component{constructor(t){super(t),this.callingLastWindowClose=!1,this.closeLastWindow=this.closeLastWindow.bind(this)}async closeLastWindow(){if(!this.callingLastWindowClose){this.callingLastWindowClose=!0;try{if(this.props.windowIds.length>1){const t=this.props.windowIds.slice(-1)[0];await this.props.removeWindow(t);const r=`.${ve("top-bar-placeholder")} button:first-child`,i=document.querySelector(r);if(!i)return;i.focus()}}finally{this.callingLastWindowClose=!1}}}workspaceByType(){const{workspaceId:t,workspaceType:n,windowIds:r=[],closeTheApp:i=()=>{}}=this.props;switch(n){case"mosaic":return S.jsx(kme,{closeLastWindow:this.closeLastWindow,closeTheViewer:i});default:return r.map(o=>S.jsx(sI,{windowId:o,closeLastWindow:this.closeLastWindow,closeTheViewer:i},`${o}-${t}`))}}render(){return S.jsx(Fme,{ownerState:this.props,className:ve("workspace"),children:this.workspaceByType()})}};dD.propTypes={windowIds:A.arrayOf(A.string),workspaceId:A.string.isRequired,workspaceType:A.string.isRequired,removeWindow:A.func,closeId:A.string,closeTheApp:A.func};const Bme=Me(Qe(e=>({windowIds:Ca(e),workspaceId:Nn(e).id,workspaceType:IS(e),closeId:Ie(e).closeId}),e=>({removeWindow:t=>e(Jf(t))})),gt("Workspace_PW"))(dD),fD=({PluginComponents:e=[]})=>S.jsx("div",{className:ve("background-plugin-area"),style:{display:"none"},children:S.jsx(r1,{PluginComponents:e})});fD.propTypes={PluginComponents:A.array};const jme=gt("BackgroundPluginArea")(fD),Wme=ie("div")(({theme:e})=>({position:"absolute",bottom:0,left:0,right:0,top:0,display:"flex",flexDirection:"column",[e.breakpoints.up("sm")]:{flexDirection:"row"}})),zme=ie("div")({flexGrow:1,position:"relative"}),Hme=ie("p")({width:"1px !important",height:"1px !important",padding:"0 !important",margin:"-1px !important",overflow:"hidden !important",clip:"rect(0, 0, 0, 0) !important",whiteSpace:"nowrap !important",border:"0 !important"});let hD=class extends x.Component{render(){const{areaRef:t=null,closeTheApp:n=()=>{}}=this.props;return S.jsx(Wme,{ownerState:this.props,className:ve("workspace-area"),children:S.jsxs(zme,{className:ve("viewer-area"),"aria-label":"Workspace",...t?{ref:t}:{},children:[S.jsx(Hme,{children:"This is an image viewer. Image is displayed within canvas area. You can use mouse, touch, or keyboard to manipulate the image. With keyboard, while focused on canvas area, use arrows to pan the image, and use a combination of Shift and either arrow up or down to zoom in and out. Depending on the information we have and size of device you are using, canvas is followed by buttons that give you access to additional functionality, such as image information dialog, download dialog, select dialog that allows you to pick a different image to load into canvas, or compare images mode that shows two images side by side."}),S.jsx(Bme,{closeTheApp:n}),S.jsx(jme,{})]})})}};hD.propTypes={closeTheApp:A.func,areaRef:A.shape({current:A.instanceOf(Element)})};const Ume=Me(gt("WorkspaceArea_PW"))(hD),Vme=Object.freeze(Object.defineProperty({__proto__:null,default:Ume},Symbol.toStringTag,{value:"Module"})),Gme=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{transform:"translate(6, 6)"},x.createElement("path",{d:"M0.996094 5.99976H10.9961",stroke:"white",strokeLinecap:"round",strokeWidth:1.5}),x.createElement("path",{d:"M5.99609 0.999756L5.99609 10.9998",stroke:"white",strokeLinecap:"round",strokeWidth:1.5}))),$me=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{transform:"translate(6, 6)"},x.createElement("path",{d:"M0.996094 5.99976H10.9961",stroke:"black",strokeLinecap:"round",strokeWidth:1.5}),x.createElement("path",{d:"M5.99609 0.999756L5.99609 10.9998",stroke:"black",strokeLinecap:"round",strokeWidth:1.5})));function pD({theme:e,...t}){const n=e==="light"?$me:Gme;return S.jsx(n,{...t})}pD.propTypes={theme:A.string.isRequired};const qme=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{transform:"translate(6, 6)"},x.createElement("path",{d:"M0.996094 5.99976H10.9961",stroke:"white",strokeLinecap:"round",strokeWidth:1.5}))),Zme=e=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("g",{transform:"translate(6, 6)"},x.createElement("path",{d:"M0.996094 5.99976H10.9961",stroke:"black",strokeLinecap:"round",strokeWidth:1.5})));function gD({theme:e,...t}){const n=e==="light"?Zme:qme;return S.jsx(n,{...t})}gD.propTypes={theme:A.string.isRequired};const Kme=ie("div")(({theme:e})=>({pointerEvents:"none",position:"absolute",bottom:"0",right:"0",left:"0",height:"74px",display:"none",[e.breakpoints.up("md")]:{display:"block"}})),Yme=ie("div")({pointerEvents:"none",position:"relative",width:"100%",height:"100%"}),Xme=ie("div")({pointerEvents:"none",boxSizing:"border-box",position:"relative",marginLeft:"auto",marginRight:"auto",height:"100%",width:"100%",paddingLeft:"2rem",paddingRight:"2rem",maxWidth:"76rem"}),Qme=ie("div")({pointerEvents:"none",position:"relative",width:"100%",height:"100%"}),Jme=ie("div")(({theme:e})=>({position:"absolute",bottom:"32px",right:"0",zIndex:100,backgroundColor:e.custom.banner.zoomCtrlsBg,display:"flex",flexDirection:"row",padding:"8px",borderRadius:"4px"})),eve=ie("div")({width:"130px",position:"relative",marginLeft:"13px",marginRight:"13px"}),tve=ie("div")(({theme:e})=>({position:"absolute",backgroundColor:e.custom.banner.zoomCtrlsColour,height:"2px",top:"13px",left:"-5px",right:"-5px"})),nve=ie("div")(({theme:e})=>({width:"10px",height:"10px",borderRadius:"50%",backgroundColor:e.custom.banner.zoomCtrlsColour,position:"absolute",top:"9px",transition:"left 0.1s ease-in-out",marginLeft:"-5px"})),rve=x.lazy(()=>Promise.resolve().then(()=>ED));let mD=class extends x.Component{constructor(n){super(n);Mt(this,"handleZoomLevelChange",n=>{this.setState({currZoomLevel:n}),this.indicatorDotRef.current&&(this.indicatorDotRef.current.style.left=`${n}%`)});Mt(this,"changeZoomBtnsVisible",n=>{this.setState({zoomBtnsVisible:n})});this.state={currZoomLevel:0,zoomBtnsVisible:!0},this.indicatorDotRef=x.createRef()}static getDerivedStateFromError(n){return this.props.isDebugMode&&console.log(`TV > Window viewer error occurred: 
Error name: `+n.name+`
Error message: `+n.message+`
Stack trace:`+n.stack),{hasError:!0}}render(){const{windowId:n,selectedTheme:r,windowWidth:i,windowHeight:o}=this.props,{currZoomLevel:a,hasError:s,zoomBtnsVisible:l}=this.state;return s?null:S.jsxs(x.Suspense,{fallback:S.jsx("div",{}),children:[S.jsx(rve,{windowId:n,windowWidth:i,windowHeight:o,handleZoomBtnVisibility:this.changeZoomBtnsVisible,zoomPercentageChange:this.handleZoomLevelChange}),S.jsx(Kme,{className:ve("zoom-controls"),children:S.jsx(Yme,{className:ve("zoom-controls-container"),style:{display:l?"block":"none"},children:S.jsx(Xme,{className:ve("zoom-controls-pw-container"),children:S.jsx(Qme,{className:ve("zoom-controls-inner"),children:S.jsxs(Jme,{className:ve("zoom-controls-panel"),children:[S.jsx(Sr,{label:"Zoom out",id:`${n}-zoom-out`,size:"sm",className:"ultra-dark",children:S.jsx(gD,{theme:r})}),S.jsxs(eve,{className:ve("zoom-indicator"),children:[S.jsx(tve,{}),S.jsx(nve,{ref:this.indicatorDotRef,style:{left:`${a}%`}})]}),S.jsx(Sr,{label:"Zoom in",id:`${n}-zoom-in`,size:"sm",className:"ultra-dark",children:S.jsx(pD,{theme:r})})]})})})})})]})}};mD.propTypes={windowWidth:A.number,windowHeight:A.number,windowId:A.string.isRequired,selectedTheme:A.string,isDebugMode:A.bool};const ive=Me(Qe(e=>({selectedTheme:Ie(e).selectedTheme,isDebugMode:Ie(e).debugMode})))(mD),ove=Object.freeze(Object.defineProperty({__proto__:null,default:ive},Symbol.toStringTag,{value:"Module"})),ave=ie("div")({alignItems:"center",display:"flex",width:"100%"}),sve=ie("audio")({width:"100%"});function vD(e){const{captions:t=[],audioOptions:n={},audioResources:r=[]}=e;return S.jsx(ave,{children:S.jsxs(sve,{...n,children:[r.map(i=>S.jsx(x.Fragment,{children:S.jsx("source",{src:i.id,type:i.getFormat()})},i.id)),t.map(i=>S.jsx(x.Fragment,{children:S.jsx("track",{src:i.id,label:i.getDefaultLabel(),srcLang:i.getProperty("language")})},i.id))]})})}vD.propTypes={audioOptions:A.object,audioResources:A.arrayOf(A.object),captions:A.arrayOf(A.object)};const lve=Me(Qe((e,{windowId:t})=>({audioOptions:Ie(e).audioOptions,audioResources:Ev(e,{windowId:t})||[],captions:Tv(e,{windowId:t})||[]}),null),gt("AudioViewer"))(vD),uve=Object.freeze(Object.defineProperty({__proto__:null,default:lve},Symbol.toStringTag,{value:"Module"})),cve=x.lazy(()=>Promise.resolve().then(()=>ED));let yD=class extends x.Component{constructor(t){super(t),this.state={}}static getDerivedStateFromError(t){return this.props.isDebugMode&&console.log(`TV > Window viewer error occurred: 
Error name: `+t.name+`
Error message: `+t.message+`
Stack trace:`+t.stack),{hasError:!0}}render(){const{windowId:t,canTabIn:n,windowWidth:r,windowHeight:i,handleZoomBtnVisibility:o}=this.props,{hasError:a}=this.state;return a?null:S.jsx(x.Suspense,{fallback:S.jsx("div",{}),children:S.jsx(cve,{windowId:t,canTabIn:n,windowWidth:r,windowHeight:i,handleZoomBtnVisibility:o})})}};yD.propTypes={windowId:A.string.isRequired,canTabIn:A.bool,windowWidth:A.number,windowHeight:A.number,handleZoomBtnVisibility:A.func,isDebugMode:A.bool};const dve=Me(Qe(e=>({isDebugMode:Ie(e).debugMode}),null),gt("WindowViewer_PW"))(yD),fve=Object.freeze(Object.defineProperty({__proto__:null,default:dve},Symbol.toStringTag,{value:"Module"})),hve=ie("div")(()=>({alignItems:"center",display:"flex",width:"100%"})),pve=ie("video")(()=>({maxHeight:"100%",width:"100%"}));let wD=class extends x.Component{render(){const{captions:t=[],videoOptions:n={},videoResources:r=[]}=this.props;return S.jsx(hve,{children:S.jsxs(pve,{...n,children:[r.map(i=>S.jsx(x.Fragment,{children:S.jsx("source",{src:i.id,type:i.getFormat()})},i.id)),t.map(i=>S.jsx(x.Fragment,{children:S.jsx("track",{src:i.id,label:i.getDefaultLabel(),srcLang:i.getProperty("language")})},i.id))]})})}};wD.propTypes={captions:A.arrayOf(A.object),videoOptions:A.object,videoResources:A.arrayOf(A.object)};const gve=Me(Qe((e,{windowId:t})=>({captions:Tv(e,{windowId:t})||[],videoOptions:Ie(e).videoOptions,videoResources:_v(e,{windowId:t})||[]}),null),gt("VideoViewer"))(wD),mve=Object.freeze(Object.defineProperty({__proto__:null,default:gve},Symbol.toStringTag,{value:"Module"}));var _D={exports:{}};(function(e){function t(n){return new t.Viewer(n)}(function(n){n.version={versionStr:"5.0.1",major:parseInt("5",10),minor:parseInt("0",10),revision:parseInt("1",10)};var r={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object AsyncFunction]":"function","[object Promise]":"promise","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;n.isFunction=function(a){return n.type(a)==="function"},n.isArray=Array.isArray||function(a){return n.type(a)==="array"},n.isWindow=function(a){return a&&typeof a=="object"&&"setInterval" in a},n.type=function(a){return a==null?String(a):r[i.call(a)]||"object"},n.isPlainObject=function(a){if(!a||t.type(a)!=="object"||a.nodeType||n.isWindow(a)||a.constructor&&!o.call(a,"constructor")&&!o.call(a.constructor.prototype,"isPrototypeOf"))return!1;var s;for(var l in a)s=l;return s===void 0||o.call(a,s)},n.isEmptyObject=function(a){for(var s in a)return!1;return!0},n.freezeObject=function(a){return Object.freeze?n.freezeObject=Object.freeze:n.freezeObject=function(s){return s},n.freezeObject(a)},n.supportsCanvas=function(){var a=document.createElement("canvas");return!!(n.isFunction(a.getContext)&&a.getContext("2d"))}(),n.isCanvasTainted=function(a){var s=!1;try{a.getContext("2d").getImageData(0,0,1,1)}catch{s=!0}return s},n.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),n.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),n.supportsEventListenerOptions=function(){var a=0;if(n.supportsAddEventListener)try{var s={get capture(){return a++,!1},get once(){return a++,!1},get passive(){return a++,!1}};window.addEventListener("test",null,s),window.removeEventListener("test",null,s)}catch{a=0}return a>=3}(),n.getCurrentPixelDensityRatio=function(){if(n.supportsCanvas){var a=document.createElement("canvas").getContext("2d"),s=window.devicePixelRatio||1,l=a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1;return Math.max(s,1)/l}else return 1},n.pixelDensityRatio=n.getCurrentPixelDensityRatio()})(t),function(n){n.extend=function(){var l,u,c,d,f,h,g=arguments[0]||{},p=arguments.length,v=!1,m=1;for(typeof g=="boolean"&&(v=g,g=arguments[1]||{},m=2),typeof g!="object"&&!t.isFunction(g)&&(g={}),p===m&&(g=this,--m);m<p;m++)if(l=arguments[m],l!==null||l!==void 0)for(u in l){var y=Object.getOwnPropertyDescriptor(l,u);if(y!==void 0){if(y.get||y.set){Object.defineProperty(g,u,y);continue}d=y.value}else{n.console.warn('Could not copy inherited property "'+u+'".');continue}g!==d&&(v&&d&&(t.isPlainObject(d)||(f=t.isArray(d)))?(c=g[u],f?(f=!1,h=c&&t.isArray(c)?c:[]):h=c&&t.isPlainObject(c)?c:{},g[u]=t.extend(v,h,d)):d!==void 0&&(g[u]=d))}return g};var r=function(){if(typeof navigator!="object")return!1;var l=navigator.userAgent;return typeof l!="string"?!1:l.indexOf("iPhone")!==-1||l.indexOf("iPad")!==-1||l.indexOf("iPod")!==-1};n.extend(n,{DEFAULT_SETTINGS:{xmlPath:null,tileSources:null,tileHost:null,initialPage:0,crossOriginPolicy:!1,ajaxWithCredentials:!1,loadTilesWithAjax:!1,ajaxHeaders:{},splitHashDataForPost:!1,panHorizontal:!0,panVertical:!0,constrainDuringPan:!1,wrapHorizontal:!1,wrapVertical:!1,visibilityRatio:.5,minPixelRatio:.5,defaultZoomLevel:0,minZoomLevel:null,maxZoomLevel:null,homeFillsViewer:!1,clickTimeThreshold:300,clickDistThreshold:5,dblClickTimeThreshold:300,dblClickDistThreshold:20,springStiffness:6.5,animationTime:1.2,gestureSettingsMouse:{dragToPan:!0,scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsTouch:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!0,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsPen:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!0,dblClickToZoom:!1,dblClickDragToZoom:!1,pinchToZoom:!1,zoomToRefPoint:!0,flickEnabled:!1,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},gestureSettingsUnknown:{dragToPan:!0,scrollToZoom:!1,clickToZoom:!1,dblClickToZoom:!0,dblClickDragToZoom:!1,pinchToZoom:!0,zoomToRefPoint:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25,pinchRotate:!1},zoomPerClick:2,zoomPerScroll:1.2,zoomPerDblClickDrag:1.2,zoomPerSecond:1,blendTime:0,alwaysBlend:!1,autoHideControls:!0,immediateRender:!1,minZoomImageRatio:.9,maxZoomPixelRatio:1.1,smoothTileEdgesMinZoom:1.1,iOSDevice:r(),pixelsPerWheelLine:40,pixelsPerArrowPress:40,autoResize:!0,preserveImageSizeOnResize:!1,minScrollDeltaTime:50,rotationIncrement:90,maxTilesPerFrame:1,showSequenceControl:!0,sequenceControlAnchor:null,preserveViewport:!1,preserveOverlays:!1,navPrevNextWrap:!1,showNavigationControl:!0,navigationControlAnchor:null,showZoomControl:!0,showHomeControl:!0,showFullPageControl:!0,showRotationControl:!1,showFlipControl:!1,controlsFadeDelay:2e3,controlsFadeLength:1500,mouseNavEnabled:!0,showNavigator:!1,navigatorElement:null,navigatorId:null,navigatorPosition:null,navigatorSizeRatio:.2,navigatorMaintainSizeRatio:!1,navigatorTop:null,navigatorLeft:null,navigatorHeight:null,navigatorWidth:null,navigatorAutoResize:!0,navigatorAutoFade:!0,navigatorRotate:!0,navigatorBackground:"#000",navigatorOpacity:.8,navigatorBorderColor:"#555",navigatorDisplayRegionColor:"#900",degrees:0,flipped:!1,overlayPreserveContentDirection:!0,opacity:1,compositeOperation:null,drawer:["webgl","canvas","html"],drawerOptions:{webgl:{},canvas:{},html:{},custom:{}},preload:!1,imageSmoothingEnabled:!0,placeholderFillStyle:null,subPixelRoundingForTransparency:null,showReferenceStrip:!1,referenceStripScroll:"horizontal",referenceStripElement:null,referenceStripHeight:null,referenceStripWidth:null,referenceStripPosition:"BOTTOM_LEFT",referenceStripSizeRatio:.2,collectionRows:3,collectionColumns:0,collectionLayout:"horizontal",collectionMode:!1,collectionTileSize:800,collectionTileMargin:80,imageLoaderLimit:0,maxImageCacheCount:200,timeout:3e4,tileRetryMax:0,tileRetryDelay:2500,prefixUrl:"/images/",navImages:{zoomIn:{REST:"zoomin_rest.png",GROUP:"zoomin_grouphover.png",HOVER:"zoomin_hover.png",DOWN:"zoomin_pressed.png"},zoomOut:{REST:"zoomout_rest.png",GROUP:"zoomout_grouphover.png",HOVER:"zoomout_hover.png",DOWN:"zoomout_pressed.png"},home:{REST:"home_rest.png",GROUP:"home_grouphover.png",HOVER:"home_hover.png",DOWN:"home_pressed.png"},fullpage:{REST:"fullpage_rest.png",GROUP:"fullpage_grouphover.png",HOVER:"fullpage_hover.png",DOWN:"fullpage_pressed.png"},rotateleft:{REST:"rotateleft_rest.png",GROUP:"rotateleft_grouphover.png",HOVER:"rotateleft_hover.png",DOWN:"rotateleft_pressed.png"},rotateright:{REST:"rotateright_rest.png",GROUP:"rotateright_grouphover.png",HOVER:"rotateright_hover.png",DOWN:"rotateright_pressed.png"},flip:{REST:"flip_rest.png",GROUP:"flip_grouphover.png",HOVER:"flip_hover.png",DOWN:"flip_pressed.png"},previous:{REST:"previous_rest.png",GROUP:"previous_grouphover.png",HOVER:"previous_hover.png",DOWN:"previous_pressed.png"},next:{REST:"next_rest.png",GROUP:"next_grouphover.png",HOVER:"next_hover.png",DOWN:"next_pressed.png"}},debugMode:!1,debugGridColor:["#437AB2","#1B9E77","#D95F02","#7570B3","#E7298A","#66A61E","#E6AB02","#A6761D","#666666"],silenceMultiImageWarnings:!1},delegate:function(l,u){return function(){var c=arguments;return c===void 0&&(c=[]),u.apply(l,c)}},BROWSERS:{UNKNOWN:0,IE:1,FIREFOX:2,SAFARI:3,CHROME:4,OPERA:5,EDGE:6,CHROMEEDGE:7},SUBPIXEL_ROUNDING_OCCURRENCES:{NEVER:0,ONLY_AT_REST:1,ALWAYS:2},_viewers:new Map,getViewer:function(l){return n._viewers.get(this.getElement(l))},getElement:function(l){return typeof l=="string"&&(l=document.getElementById(l)),l},getElementPosition:function(l){var u=new n.Point,c,d;for(l=n.getElement(l),c=n.getElementStyle(l).position==="fixed",d=s(l,c);d;)u.x+=l.offsetLeft,u.y+=l.offsetTop,c&&(u=u.plus(n.getPageScroll())),l=d,c=n.getElementStyle(l).position==="fixed",d=s(l,c);return u},getElementOffset:function(l){l=n.getElement(l);var u=l&&l.ownerDocument,c,d,f={top:0,left:0};return u?(c=u.documentElement,typeof l.getBoundingClientRect<"u"&&(f=l.getBoundingClientRect()),d=u===u.window?u:u.nodeType===9?u.defaultView||u.parentWindow:!1,new n.Point(f.left+(d.pageXOffset||c.scrollLeft)-(c.clientLeft||0),f.top+(d.pageYOffset||c.scrollTop)-(c.clientTop||0))):new n.Point},getElementSize:function(l){return l=n.getElement(l),new n.Point(l.clientWidth,l.clientHeight)},getElementStyle:document.documentElement.currentStyle?function(l){return l=n.getElement(l),l.currentStyle}:function(l){return l=n.getElement(l),window.getComputedStyle(l,"")},getCssPropertyWithVendorPrefix:function(l){var u={};return n.getCssPropertyWithVendorPrefix=function(c){if(u[c]!==void 0)return u[c];var d=document.createElement("div").style,f=null;if(d[c]!==void 0)f=c;else for(var h=["Webkit","Moz","MS","O","webkit","moz","ms","o"],g=n.capitalizeFirstLetter(c),p=0;p<h.length;p++){var v=h[p]+g;if(d[v]!==void 0){f=v;break}}return u[c]=f,f},n.getCssPropertyWithVendorPrefix(l)},capitalizeFirstLetter:function(l){return l.charAt(0).toUpperCase()+l.slice(1)},positiveModulo:function(l,u){var c=l%u;return c<0&&(c+=u),c},pointInElement:function(l,u){l=n.getElement(l);var c=n.getElementOffset(l),d=n.getElementSize(l);return u.x>=c.x&&u.x<c.x+d.x&&u.y<c.y+d.y&&u.y>=c.y},getMousePosition:function(l){if(typeof l.pageX=="number")n.getMousePosition=function(u){var c=new n.Point;return c.x=u.pageX,c.y=u.pageY,c};else if(typeof l.clientX=="number")n.getMousePosition=function(u){var c=new n.Point;return c.x=u.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c.y=u.clientY+document.body.scrollTop+document.documentElement.scrollTop,c};else throw new Error("Unknown event mouse position, no known technique.");return n.getMousePosition(l)},getPageScroll:function(){var l=document.documentElement||{},u=document.body||{};if(typeof window.pageXOffset=="number")n.getPageScroll=function(){return new n.Point(window.pageXOffset,window.pageYOffset)};else if(u.scrollLeft||u.scrollTop)n.getPageScroll=function(){return new n.Point(document.body.scrollLeft,document.body.scrollTop)};else if(l.scrollLeft||l.scrollTop)n.getPageScroll=function(){return new n.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new n.Point(0,0);return n.getPageScroll()},setPageScroll:function(l){if(typeof window.scrollTo<"u")n.setPageScroll=function(d){window.scrollTo(d.x,d.y)};else{var u=n.getPageScroll();if(u.x===l.x&&u.y===l.y)return;document.body.scrollLeft=l.x,document.body.scrollTop=l.y;var c=n.getPageScroll();if(c.x!==u.x&&c.y!==u.y){n.setPageScroll=function(d){document.body.scrollLeft=d.x,document.body.scrollTop=d.y};return}if(document.documentElement.scrollLeft=l.x,document.documentElement.scrollTop=l.y,c=n.getPageScroll(),c.x!==u.x&&c.y!==u.y){n.setPageScroll=function(d){document.documentElement.scrollLeft=d.x,document.documentElement.scrollTop=d.y};return}n.setPageScroll=function(d){}}n.setPageScroll(l)},getWindowSize:function(){var l=document.documentElement||{},u=document.body||{};if(typeof window.innerWidth=="number")n.getWindowSize=function(){return new n.Point(window.innerWidth,window.innerHeight)};else if(l.clientWidth||l.clientHeight)n.getWindowSize=function(){return new n.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(u.clientWidth||u.clientHeight)n.getWindowSize=function(){return new n.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return n.getWindowSize()},makeCenteredNode:function(l){l=n.getElement(l);var u=[n.makeNeutralElement("div"),n.makeNeutralElement("div"),n.makeNeutralElement("div")];return n.extend(u[0].style,{display:"table",height:"100%",width:"100%"}),n.extend(u[1].style,{display:"table-row"}),n.extend(u[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),u[0].appendChild(u[1]),u[1].appendChild(u[2]),u[2].appendChild(l),u[0]},makeNeutralElement:function(l){var u=document.createElement(l),c=u.style;return c.background="transparent none",c.border="none",c.margin="0px",c.padding="0px",c.position="static",u},now:function(){return Date.now?n.now=Date.now:n.now=function(){return new Date().getTime()},n.now()},makeTransparentImage:function(l){var u=n.makeNeutralElement("img");return u.src=l,u},setElementOpacity:function(l,u,c){var d,f;l=n.getElement(l),c&&!n.Browser.alpha&&(u=Math.round(u)),n.Browser.opacity?l.style.opacity=u<1?u:"":u<1?(d=Math.round(100*u),f="alpha(opacity="+d+")",l.style.filter=f):l.style.filter=""},setElementTouchActionNone:function(l){l=n.getElement(l),typeof l.style.touchAction<"u"?l.style.touchAction="none":typeof l.style.msTouchAction<"u"&&(l.style.msTouchAction="none")},setElementPointerEvents:function(l,u){l=n.getElement(l),typeof l.style<"u"&&typeof l.style.pointerEvents<"u"&&(l.style.pointerEvents=u)},setElementPointerEventsNone:function(l){n.setElementPointerEvents(l,"none")},addClass:function(l,u){l=n.getElement(l),l.className?(" "+l.className+" ").indexOf(" "+u+" ")===-1&&(l.className+=" "+u):l.className=u},indexOf:function(l,u,c){return Array.prototype.indexOf?this.indexOf=function(d,f,h){return d.indexOf(f,h)}:this.indexOf=function(d,f,h){var g,p=h||0,v;if(!d)throw new TypeError;if(v=d.length,v===0||p>=v)return-1;for(p<0&&(p=v-Math.abs(p)),g=p;g<v;g++)if(d[g]===f)return g;return-1},this.indexOf(l,u,c)},removeClass:function(l,u){var c,d=[],f;for(l=n.getElement(l),c=l.className.split(/\s+/),f=0;f<c.length;f++)c[f]&&c[f]!==u&&d.push(c[f]);l.className=d.join(" ")},normalizeEventListenerOptions:function(l){var u;return typeof l<"u"?typeof l=="boolean"?u=n.supportsEventListenerOptions?{capture:l}:l:u=n.supportsEventListenerOptions?l:typeof l.capture<"u"?l.capture:!1:u=n.supportsEventListenerOptions?{capture:!1}:!1,u},addEvent:function(){if(n.supportsAddEventListener)return function(l,u,c,d){d=n.normalizeEventListenerOptions(d),l=n.getElement(l),l.addEventListener(u,c,d)};if(document.documentElement.attachEvent&&document.attachEvent)return function(l,u,c){l=n.getElement(l),l.attachEvent("on"+u,c)};throw new Error("No known event model.")}(),removeEvent:function(){if(n.supportsRemoveEventListener)return function(l,u,c,d){d=n.normalizeEventListenerOptions(d),l=n.getElement(l),l.removeEventListener(u,c,d)};if(document.documentElement.detachEvent&&document.detachEvent)return function(l,u,c){l=n.getElement(l),l.detachEvent("on"+u,c)};throw new Error("No known event model.")}(),cancelEvent:function(l){l.preventDefault()},eventIsCanceled:function(l){return l.defaultPrevented},stopEvent:function(l){l.stopPropagation()},createCallback:function(l,u){console.error("The createCallback function is deprecated and will be removed in future versions. Please use alternativeFunction instead.");var c=[],d;for(d=2;d<arguments.length;d++)c.push(arguments[d]);return function(){var f=c.concat([]),h;for(h=0;h<arguments.length;h++)f.push(arguments[h]);return u.apply(l,f)}},getUrlParameter:function(l){var u=a[l];return u||null},getUrlProtocol:function(l){var u=l.match(/^([a-z]+:)\/\//i);return u===null?window.location.protocol:u[1].toLowerCase()},createAjaxRequest:function(){if(window.XMLHttpRequest)return n.createAjaxRequest=function(){return new XMLHttpRequest},new XMLHttpRequest;throw new Error("Browser doesn't support XMLHttpRequest.")},makeAjaxRequest:function(l,u,c){var d,f,h,g;n.isPlainObject(l)&&(u=l.success,c=l.error,d=l.withCredentials,f=l.headers,h=l.responseType||null,g=l.postData||null,l=l.url);var p=n.getUrlProtocol(l),v=n.createAjaxRequest();if(!n.isFunction(u))throw new Error("makeAjaxRequest requires a success callback");v.onreadystatechange=function(){v.readyState===4&&(v.onreadystatechange=function(){},v.status>=200&&v.status<300||v.status===0&&p!=="http:"&&p!=="https:"?u(v):n.isFunction(c)?c(v):n.console.error("AJAX request returned %d: %s",v.status,l))};var m=g?"POST":"GET";try{if(v.open(m,l,!0),h&&(v.responseType=h),f)for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&f[y]&&v.setRequestHeader(y,f[y]);d&&(v.withCredentials=!0),v.send(g)}catch(E){n.console.error("%s while making AJAX request: %s",E.name,E.message),v.onreadystatechange=function(){},n.isFunction(c)&&c(v,E)}return v},jsonp:function(l){var u,c=l.url,d=document.head||document.getElementsByTagName("head")[0]||document.documentElement,f=l.callbackName||"openseadragon"+n.now(),h=window[f],g="$1"+f+"$2",p=l.param||"callback",v=l.callback;c=c.replace(/(=)\?(&|$)|\?\?/i,g),c+=(/\?/.test(c)?"&":"?")+p+"="+f,window[f]=function(m){if(h)window[f]=h;else try{delete window[f]}catch{}v&&n.isFunction(v)&&v(m)},u=document.createElement("script"),(l.async!==void 0||l.async!==!1)&&(u.async="async"),l.scriptCharset&&(u.charset=l.scriptCharset),u.src=c,u.onload=u.onreadystatechange=function(m,y){(y||!u.readyState||/loaded|complete/.test(u.readyState))&&(u.onload=u.onreadystatechange=null,d&&u.parentNode&&d.removeChild(u),u=void 0)},d.insertBefore(u,d.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(l){if(window.DOMParser)n.parseXml=function(u){var c=null,d;return d=new DOMParser,c=d.parseFromString(u,"text/xml"),c};else throw new Error("Browser doesn't support XML DOM.");return n.parseXml(l)},parseJSON:function(l){return n.parseJSON=window.JSON.parse,n.parseJSON(l)},imageFormatSupported:function(l){return l=l||"",!!o[l.toLowerCase()]},setImageFormatsSupported:function(l){n.extend(o,l)}});var i=function(l){};n.console=window.console||{log:i,debug:i,info:i,warn:i,error:i,assert:i},n.Browser={vendor:n.BROWSERS.UNKNOWN,version:0,alpha:!0};var o={avif:!0,bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1,webp:!0},a={};(function(){var l=navigator.appVersion,u=navigator.userAgent,c;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(n.Browser.vendor=n.BROWSERS.IE,n.Browser.version=parseFloat(u.substring(u.indexOf("MSIE")+5,u.indexOf(";",u.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(u.indexOf("Edge")>=0?(n.Browser.vendor=n.BROWSERS.EDGE,n.Browser.version=parseFloat(u.substring(u.indexOf("Edge")+5))):u.indexOf("Edg")>=0?(n.Browser.vendor=n.BROWSERS.CHROMEEDGE,n.Browser.version=parseFloat(u.substring(u.indexOf("Edg")+4))):u.indexOf("Firefox")>=0?(n.Browser.vendor=n.BROWSERS.FIREFOX,n.Browser.version=parseFloat(u.substring(u.indexOf("Firefox")+8))):u.indexOf("Safari")>=0?(n.Browser.vendor=u.indexOf("Chrome")>=0?n.BROWSERS.CHROME:n.BROWSERS.SAFARI,n.Browser.version=parseFloat(u.substring(u.substring(0,u.indexOf("Safari")).lastIndexOf("/")+1,u.indexOf("Safari")))):(c=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),c.exec(u)!==null&&(n.Browser.vendor=n.BROWSERS.IE,n.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":n.Browser.vendor=n.BROWSERS.OPERA,n.Browser.version=parseFloat(l);break}var d=window.location.search.substring(1),f=d.split("&"),h,g,p;for(p=0;p<f.length;p++)if(h=f[p],g=h.indexOf("="),g>0){var v=h.substring(0,g),m=h.substring(g+1);try{a[v]=decodeURIComponent(m)}catch{n.console.error("Ignoring malformed URL parameter: %s=%s",v,m)}}n.Browser.alpha=!(n.Browser.vendor===n.BROWSERS.CHROME&&n.Browser.version<2),n.Browser.opacity=!0,n.Browser.vendor===n.BROWSERS.IE&&n.console.error("Internet Explorer is not supported by OpenSeadragon")})(),function(l){var u=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame,c=l.cancelAnimationFrame||l.mozCancelAnimationFrame||l.webkitCancelAnimationFrame||l.msCancelAnimationFrame;if(u&&c)n.requestAnimationFrame=function(){return u.apply(l,arguments)},n.cancelAnimationFrame=function(){return c.apply(l,arguments)};else{var d=[],f=[],h=0,g;n.requestAnimationFrame=function(p){return d.push([++h,p]),g||(g=setInterval(function(){if(d.length){var v=n.now(),m=f;for(f=d,d=m;f.length;)f.shift()[1](v)}else clearInterval(g),g=void 0},1e3/50)),h},n.cancelAnimationFrame=function(p){var v,m;for(v=0,m=d.length;v<m;v+=1)if(d[v][0]===p){d.splice(v,1);return}for(v=0,m=f.length;v<m;v+=1)if(f[v][0]===p){f.splice(v,1);return}}}}(window);function s(l,u){return u&&l!==document.body?document.body:l.offsetParent}}(t),function(n,r){e.exports?e.exports=r():n.OpenSeadragon=r()}(J,function(){return t}),function(n){class r{constructor(o){o||(o=[0,0,0,0,0,0,0,0,0]),this.values=o}static makeIdentity(){return new r([1,0,0,0,1,0,0,0,1])}static makeTranslation(o,a){return new r([1,0,0,0,1,0,o,a,1])}static makeRotation(o){var a=Math.cos(o),s=Math.sin(o);return new r([a,-s,0,s,a,0,0,0,1])}static makeScaling(o,a){return new r([o,0,0,0,a,0,0,0,1])}multiply(o){let a=this.values,s=o.values;var l=a[0*3+0],u=a[0*3+1],c=a[0*3+2],d=a[1*3+0],f=a[1*3+1],h=a[1*3+2],g=a[2*3+0],p=a[2*3+1],v=a[2*3+2],m=s[0*3+0],y=s[0*3+1],E=s[0*3+2],b=s[1*3+0],R=s[1*3+1],M=s[1*3+2],C=s[2*3+0],D=s[2*3+1],F=s[2*3+2];return new r([m*l+y*d+E*g,m*u+y*f+E*p,m*c+y*h+E*v,b*l+R*d+M*g,b*u+R*f+M*p,b*c+R*h+M*v,C*l+D*d+F*g,C*u+D*f+F*p,C*c+D*h+F*v])}}n.Mat3=r}(t),function(n){var r={supportsFullScreen:!1,isFullScreen:function(){return!1},getFullScreenElement:function(){return null},requestFullScreen:function(){},exitFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",fullScreenErrorEventName:""};document.exitFullscreen?(r.supportsFullScreen=!0,r.getFullScreenElement=function(){return document.fullscreenElement},r.requestFullScreen=function(i){return i.requestFullscreen().catch(function(o){n.console.error("Fullscreen request failed: ",o)})},r.exitFullScreen=function(){document.exitFullscreen().catch(function(i){n.console.error("Error while exiting fullscreen: ",i)})},r.fullScreenEventName="fullscreenchange",r.fullScreenErrorEventName="fullscreenerror"):document.msExitFullscreen?(r.supportsFullScreen=!0,r.getFullScreenElement=function(){return document.msFullscreenElement},r.requestFullScreen=function(i){return i.msRequestFullscreen()},r.exitFullScreen=function(){document.msExitFullscreen()},r.fullScreenEventName="MSFullscreenChange",r.fullScreenErrorEventName="MSFullscreenError"):document.webkitExitFullscreen?(r.supportsFullScreen=!0,r.getFullScreenElement=function(){return document.webkitFullscreenElement},r.requestFullScreen=function(i){return i.webkitRequestFullscreen()},r.exitFullScreen=function(){document.webkitExitFullscreen()},r.fullScreenEventName="webkitfullscreenchange",r.fullScreenErrorEventName="webkitfullscreenerror"):document.webkitCancelFullScreen?(r.supportsFullScreen=!0,r.getFullScreenElement=function(){return document.webkitCurrentFullScreenElement},r.requestFullScreen=function(i){return i.webkitRequestFullScreen()},r.exitFullScreen=function(){document.webkitCancelFullScreen()},r.fullScreenEventName="webkitfullscreenchange",r.fullScreenErrorEventName="webkitfullscreenerror"):document.mozCancelFullScreen&&(r.supportsFullScreen=!0,r.getFullScreenElement=function(){return document.mozFullScreenElement},r.requestFullScreen=function(i){return i.mozRequestFullScreen()},r.exitFullScreen=function(){document.mozCancelFullScreen()},r.fullScreenEventName="mozfullscreenchange",r.fullScreenErrorEventName="mozfullscreenerror"),r.isFullScreen=function(){return r.getFullScreenElement()!==null},r.cancelFullScreen=function(){n.console.error("cancelFullScreen is deprecated. Use exitFullScreen instead."),r.exitFullScreen()},n.extend(n,r)}(t),function(n){n.EventSource=function(){this.events={},this._rejectedEventList={}},n.EventSource.prototype={addOnceHandler:function(r,i,o,a,s){var l=this;a=a||1;var u=0,c=function(d){return u++,u===a&&l.removeHandler(r,c),i(d)};return this.addHandler(r,c,o,s)},addHandler:function(r,i,o,a){if(Object.prototype.hasOwnProperty.call(this._rejectedEventList,r))return n.console.error(`Error adding handler for ${r}. ${this._rejectedEventList[r]}`),!1;var s=this.events[r];if(s||(this.events[r]=s=[]),i&&n.isFunction(i)){var l=s.length,u={handler:i,userData:o||null,priority:a||0};for(s[l]=u;l>0&&s[l-1].priority<s[l].priority;)s[l]=s[l-1],s[l-1]=u,l--}return!0},removeHandler:function(r,i){var o=this.events[r],a=[],s;if(o&&n.isArray(o)){for(s=0;s<o.length;s++)o[s].handler!==i&&a.push(o[s]);this.events[r]=a}},numberOfHandlers:function(r){var i=this.events[r];return i?i.length:0},removeAllHandlers:function(r){if(r)this.events[r]=[];else for(var i in this.events)this.events[i]=[]},getHandler:function(r){var i=this.events[r];return!i||!i.length?null:(i=i.length===1?[i[0]]:Array.apply(null,i),function(o,a){var s,l=i.length;for(s=0;s<l;s++)i[s]&&(a.eventSource=o,a.userData=i[s].userData,i[s].handler(a))})},raiseEvent:function(r,i){if(Object.prototype.hasOwnProperty.call(this._rejectedEventList,r))return n.console.error(`Error adding handler for ${r}. ${this._rejectedEventList[r]}`),!1;var o=this.getHandler(r);return o&&o(this,i||{}),!0},rejectEventHandler(r,i=""){this._rejectedEventList[r]=i},allowEventHandler(r){delete this._rejectedEventList[r]}}}(t),function(n){var r={};n.MouseTracker=function(_){var T=arguments;n.isPlainObject(_)||(_={element:T[0],clickTimeThreshold:T[1],clickDistThreshold:T[2]}),this.hash=Math.random(),this.element=n.getElement(_.element),this.clickTimeThreshold=_.clickTimeThreshold||n.DEFAULT_SETTINGS.clickTimeThreshold,this.clickDistThreshold=_.clickDistThreshold||n.DEFAULT_SETTINGS.clickDistThreshold,this.dblClickTimeThreshold=_.dblClickTimeThreshold||n.DEFAULT_SETTINGS.dblClickTimeThreshold,this.dblClickDistThreshold=_.dblClickDistThreshold||n.DEFAULT_SETTINGS.dblClickDistThreshold,this.userData=_.userData||null,this.stopDelay=_.stopDelay||50,this.preProcessEventHandler=_.preProcessEventHandler||null,this.contextMenuHandler=_.contextMenuHandler||null,this.enterHandler=_.enterHandler||null,this.leaveHandler=_.leaveHandler||null,this.exitHandler=_.exitHandler||null,this.overHandler=_.overHandler||null,this.outHandler=_.outHandler||null,this.pressHandler=_.pressHandler||null,this.nonPrimaryPressHandler=_.nonPrimaryPressHandler||null,this.releaseHandler=_.releaseHandler||null,this.nonPrimaryReleaseHandler=_.nonPrimaryReleaseHandler||null,this.moveHandler=_.moveHandler||null,this.scrollHandler=_.scrollHandler||null,this.clickHandler=_.clickHandler||null,this.dblClickHandler=_.dblClickHandler||null,this.dragHandler=_.dragHandler||null,this.dragEndHandler=_.dragEndHandler||null,this.pinchHandler=_.pinchHandler||null,this.stopHandler=_.stopHandler||null,this.keyDownHandler=_.keyDownHandler||null,this.keyUpHandler=_.keyUpHandler||null,this.keyHandler=_.keyHandler||null,this.focusHandler=_.focusHandler||null,this.blurHandler=_.blurHandler||null;var P=this;r[this.hash]={click:function(I){E(P,I)},dblclick:function(I){b(P,I)},keydown:function(I){R(P,I)},keyup:function(I){M(P,I)},keypress:function(I){C(P,I)},focus:function(I){D(P,I)},blur:function(I){F(P,I)},contextmenu:function(I){L(P,I)},wheel:function(I){B(P,I)},mousewheel:function(I){z(P,I)},DOMMouseScroll:function(I){z(P,I)},MozMousePixelScroll:function(I){z(P,I)},losecapture:function(I){de(P,I)},mouseenter:function(I){oe(P,I)},mouseleave:function(I){be(P,I)},mouseover:function(I){te(P,I)},mouseout:function(I){q(P,I)},mousedown:function(I){ee(P,I)},mouseup:function(I){se(P,I)},mousemove:function(I){qe(P,I)},touchstart:function(I){X(P,I)},touchend:function(I){re(P,I)},touchmove:function(I){fe(P,I)},touchcancel:function(I){H(P,I)},gesturestart:function(I){Y(P,I)},gesturechange:function(I){ae(P,I)},gotpointercapture:function(I){Te(P,I)},lostpointercapture:function(I){Se(P,I)},pointerenter:function(I){oe(P,I)},pointerleave:function(I){be(P,I)},pointerover:function(I){te(P,I)},pointerout:function(I){q(P,I)},pointerdown:function(I){ee(P,I)},pointerup:function(I){se(P,I)},pointermove:function(I){qe(P,I)},pointercancel:function(I){Vn(P,I)},pointerupcaptured:function(I){ce(P,I)},pointermovecaptured:function(I){Ae(P,I)},tracking:!1,activePointersLists:[],lastClickPos:null,dblClickTimeOut:null,pinchGPoints:[],lastPinchDist:0,currentPinchDist:0,lastPinchCenter:null,currentPinchCenter:null,sentDragEvent:!1},this.hasGestureHandlers=!!(this.pressHandler||this.nonPrimaryPressHandler||this.releaseHandler||this.nonPrimaryReleaseHandler||this.clickHandler||this.dblClickHandler||this.dragHandler||this.dragEndHandler||this.pinchHandler),this.hasScrollHandler=!!this.scrollHandler,n.MouseTracker.havePointerEvents&&n.setElementPointerEvents(this.element,"auto"),this.exitHandler&&n.console.error("MouseTracker.exitHandler is deprecated. Use MouseTracker.leaveHandler instead."),_.startDisabled||this.setTracking(!0)},n.MouseTracker.prototype={destroy:function(){l(this),this.element=null,r[this.hash]=null,delete r[this.hash]},isTracking:function(){return r[this.hash].tracking},setTracking:function(_){return _?s(this):l(this),this},getActivePointersListByType:function(_){var T=r[this.hash],P,I=T?T.activePointersLists.length:0,W;for(P=0;P<I;P++)if(T.activePointersLists[P].type===_)return T.activePointersLists[P];return W=new n.MouseTracker.GesturePointList(_),T&&T.activePointersLists.push(W),W},getActivePointerCount:function(){var _=r[this.hash],T,P=_.activePointersLists.length,I=0;for(T=0;T<P;T++)I+=_.activePointersLists[T].getLength();return I},preProcessEventHandler:function(){},contextMenuHandler:function(){},enterHandler:function(){},leaveHandler:function(){},exitHandler:function(){},overHandler:function(){},outHandler:function(){},pressHandler:function(){},nonPrimaryPressHandler:function(){},releaseHandler:function(){},nonPrimaryReleaseHandler:function(){},moveHandler:function(){},scrollHandler:function(){},clickHandler:function(){},dblClickHandler:function(){},dragHandler:function(){},dragEndHandler:function(){},pinchHandler:function(){},stopHandler:function(){},keyDownHandler:function(){},keyUpHandler:function(){},keyHandler:function(){},focusHandler:function(){},blurHandler:function(){}};var i=function(){try{return window.self!==window.top}catch{return!0}}();function o(_){try{return _.addEventListener&&_.removeEventListener}catch{return!1}}n.MouseTracker.gesturePointVelocityTracker=function(){var _=[],T=0,P=0,I=function(Le,ye){return Le.hash.toString()+ye.type+ye.id.toString()},W=function(){var Le,ye=_.length,tn,St,Zi=n.now(),ep,_u,Tu;for(ep=Zi-P,P=Zi,Le=0;Le<ye;Le++)tn=_[Le],St=tn.gPoint,St.direction=Math.atan2(St.currentPos.y-tn.lastPos.y,St.currentPos.x-tn.lastPos.x),_u=tn.lastPos.distanceTo(St.currentPos),tn.lastPos=St.currentPos,Tu=1e3*_u/(ep+1),St.speed=.75*Tu+.25*St.speed},Z=function(Le,ye){var tn=I(Le,ye);_.push({guid:tn,gPoint:ye,lastPos:ye.currentPos}),_.length===1&&(P=n.now(),T=window.setInterval(W,50))},ge=function(Le,ye){var tn=I(Le,ye),St,Zi=_.length;for(St=0;St<Zi;St++)if(_[St].guid===tn){_.splice(St,1),Zi--,Zi===0&&window.clearInterval(T);break}};return{addPoint:Z,removePoint:ge}}(),n.MouseTracker.captureElement=document,n.MouseTracker.wheelEventName="onwheel" in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",n.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",n.MouseTracker.wheelEventName],n.MouseTracker.wheelEventName==="DOMMouseScroll"&&n.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(n.MouseTracker.havePointerEvents=!0,n.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),n.MouseTracker.havePointerCapture=function(){var _=document.createElement("div");return n.isFunction(_.setPointerCapture)&&n.isFunction(_.releasePointerCapture)}(),n.MouseTracker.havePointerCapture&&n.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(n.MouseTracker.havePointerEvents=!1,n.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),n.MouseTracker.mousePointerId="legacy-mouse",n.MouseTracker.havePointerCapture=function(){var _=document.createElement("div");return n.isFunction(_.setCapture)&&n.isFunction(_.releaseCapture)}(),n.MouseTracker.havePointerCapture&&n.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart" in window&&n.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart" in window&&n.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),n.MouseTracker.GesturePointList=function(_){this._gPoints=[],this.type=_,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},n.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(_){return this._gPoints.push(_)},removeById:function(_){var T,P=this._gPoints.length;for(T=0;T<P;T++)if(this._gPoints[T].id===_){this._gPoints.splice(T,1);break}return this._gPoints.length},getByIndex:function(_){return _<this._gPoints.length?this._gPoints[_]:null},getById:function(_){var T,P=this._gPoints.length;for(T=0;T<P;T++)if(this._gPoints[T].id===_)return this._gPoints[T];return null},getPrimary:function(_){var T,P=this._gPoints.length;for(T=0;T<P;T++)if(this._gPoints[T].isPrimary)return this._gPoints[T];return null},addContact:function(){++this.contacts,this.contacts>1&&(this.type==="mouse"||this.type==="pen")&&(n.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(this.contacts=0)}};function a(_){var T=r[_.hash],P,I,W,Z,ge,Le=T.activePointersLists.length;for(P=0;P<Le;P++)if(W=T.activePointersLists[P],W.getLength()>0){for(ge=[],Z=W.asArray(),I=0;I<Z.length;I++)ge.push(Z[I]);for(I=0;I<ge.length;I++)Sn(_,W,ge[I])}for(P=0;P<Le;P++)T.activePointersLists.pop();T.sentDragEvent=!1}function s(_){var T=r[_.hash],P,I;if(!T.tracking){for(I=0;I<n.MouseTracker.subscribeEvents.length;I++)P=n.MouseTracker.subscribeEvents[I],n.addEvent(_.element,P,T[P],P===n.MouseTracker.wheelEventName?{passive:!1,capture:!1}:!1);a(_),T.tracking=!0}}function l(_){var T=r[_.hash],P,I;if(T.tracking){for(I=0;I<n.MouseTracker.subscribeEvents.length;I++)P=n.MouseTracker.subscribeEvents[I],n.removeEvent(_.element,P,T[P],!1);a(_),T.tracking=!1}}function u(_,T){var P=r[_.hash];if(T==="pointerevent")return{upName:"pointerup",upHandler:P.pointerupcaptured,moveName:"pointermove",moveHandler:P.pointermovecaptured};if(T==="mouse")return{upName:"pointerup",upHandler:P.pointerupcaptured,moveName:"pointermove",moveHandler:P.pointermovecaptured};if(T==="touch")return{upName:"touchend",upHandler:P.touchendcaptured,moveName:"touchmove",moveHandler:P.touchmovecaptured};throw new Error("MouseTracker.getCaptureEventParams: Unknown pointer type.")}function c(_,T){var P;if(n.MouseTracker.havePointerCapture)if(n.MouseTracker.havePointerEvents)try{_.element.setPointerCapture(T.id)}catch{n.console.warn("setPointerCapture() called on invalid pointer ID");return}else _.element.setCapture(!0);else P=u(_,n.MouseTracker.havePointerEvents?"pointerevent":T.type),i&&o(window.top)&&n.addEvent(window.top,P.upName,P.upHandler,!0),n.addEvent(n.MouseTracker.captureElement,P.upName,P.upHandler,!0),n.addEvent(n.MouseTracker.captureElement,P.moveName,P.moveHandler,!0);k(_,T,!0)}function d(_,T){var P,I,W;if(n.MouseTracker.havePointerCapture)if(n.MouseTracker.havePointerEvents){if(I=_.getActivePointersListByType(T.type),W=I.getById(T.id),!W||!W.captured)return;try{_.element.releasePointerCapture(T.id)}catch{}}else _.element.releaseCapture();else P=u(_,n.MouseTracker.havePointerEvents?"pointerevent":T.type),i&&o(window.top)&&n.removeEvent(window.top,P.upName,P.upHandler,!0),n.removeEvent(n.MouseTracker.captureElement,P.moveName,P.moveHandler,!0),n.removeEvent(n.MouseTracker.captureElement,P.upName,P.upHandler,!0);k(_,T,!1)}function f(_){return n.MouseTracker.havePointerEvents?_.pointerId:n.MouseTracker.mousePointerId}function h(_){return n.MouseTracker.havePointerEvents&&_.pointerType?_.pointerType:"mouse"}function g(_){return n.MouseTracker.havePointerEvents?_.isPrimary:!0}function p(_){return n.getMousePosition(_)}function v(_,T){return m(p(_),T)}function m(_,T){var P=n.getElementOffset(T);return _.minus(P)}function y(_,T){return new n.Point((_.x+T.x)/2,(_.y+T.y)/2)}function E(_,T){var P={originalEvent:T,eventType:"click",pointerType:"mouse",isEmulated:!1};O(_,P),P.preventDefault&&!P.defaultPrevented&&n.cancelEvent(T),P.stopPropagation&&n.stopEvent(T)}function b(_,T){var P={originalEvent:T,eventType:"dblclick",pointerType:"mouse",isEmulated:!1};O(_,P),P.preventDefault&&!P.defaultPrevented&&n.cancelEvent(T),P.stopPropagation&&n.stopEvent(T)}function R(_,T){var P=null,I={originalEvent:T,eventType:"keydown",pointerType:"",isEmulated:!1};O(_,I),_.keyDownHandler&&!I.preventGesture&&!I.defaultPrevented&&(P={eventSource:_,keyCode:T.keyCode?T.keyCode:T.charCode,ctrl:T.ctrlKey,shift:T.shiftKey,alt:T.altKey,meta:T.metaKey,originalEvent:T,preventDefault:I.preventDefault||I.defaultPrevented,userData:_.userData},_.keyDownHandler(P)),(P&&P.preventDefault||I.preventDefault&&!I.defaultPrevented)&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T)}function M(_,T){var P=null,I={originalEvent:T,eventType:"keyup",pointerType:"",isEmulated:!1};O(_,I),_.keyUpHandler&&!I.preventGesture&&!I.defaultPrevented&&(P={eventSource:_,keyCode:T.keyCode?T.keyCode:T.charCode,ctrl:T.ctrlKey,shift:T.shiftKey,alt:T.altKey,meta:T.metaKey,originalEvent:T,preventDefault:I.preventDefault||I.defaultPrevented,userData:_.userData},_.keyUpHandler(P)),(P&&P.preventDefault||I.preventDefault&&!I.defaultPrevented)&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T)}function C(_,T){var P=null,I={originalEvent:T,eventType:"keypress",pointerType:"",isEmulated:!1};O(_,I),_.keyHandler&&!I.preventGesture&&!I.defaultPrevented&&(P={eventSource:_,keyCode:T.keyCode?T.keyCode:T.charCode,ctrl:T.ctrlKey,shift:T.shiftKey,alt:T.altKey,meta:T.metaKey,originalEvent:T,preventDefault:I.preventDefault||I.defaultPrevented,userData:_.userData},_.keyHandler(P)),(P&&P.preventDefault||I.preventDefault&&!I.defaultPrevented)&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T)}function D(_,T){var P={originalEvent:T,eventType:"focus",pointerType:"",isEmulated:!1};O(_,P),_.focusHandler&&!P.preventGesture&&_.focusHandler({eventSource:_,originalEvent:T,userData:_.userData})}function F(_,T){var P={originalEvent:T,eventType:"blur",pointerType:"",isEmulated:!1};O(_,P),_.blurHandler&&!P.preventGesture&&_.blurHandler({eventSource:_,originalEvent:T,userData:_.userData})}function L(_,T){var P=null,I={originalEvent:T,eventType:"contextmenu",pointerType:"mouse",isEmulated:!1};O(_,I),_.contextMenuHandler&&!I.preventGesture&&!I.defaultPrevented&&(P={eventSource:_,position:m(p(T),_.element),originalEvent:I.originalEvent,preventDefault:I.preventDefault||I.defaultPrevented,userData:_.userData},_.contextMenuHandler(P)),(P&&P.preventDefault||I.preventDefault&&!I.defaultPrevented)&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T)}function B(_,T){$(_,T,T)}function z(_,T){var P={target:T.target||T.srcElement,type:"wheel",shiftKey:T.shiftKey||!1,clientX:T.clientX,clientY:T.clientY,pageX:T.pageX?T.pageX:T.clientX,pageY:T.pageY?T.pageY:T.clientY,deltaMode:T.type==="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0};n.MouseTracker.wheelEventName==="mousewheel"?P.deltaY=-T.wheelDelta/n.DEFAULT_SETTINGS.pixelsPerWheelLine:P.deltaY=T.detail,$(_,P,T)}function $(_,T,P){var I=0,W,Z=null;I=T.deltaY?T.deltaY<0?1:-1:0,W={originalEvent:T,eventType:"wheel",pointerType:"mouse",isEmulated:T!==P},O(_,W),_.scrollHandler&&!W.preventGesture&&!W.defaultPrevented&&(Z={eventSource:_,pointerType:"mouse",position:v(T,_.element),scroll:I,shift:T.shiftKey,isTouchEvent:!1,originalEvent:P,preventDefault:W.preventDefault||W.defaultPrevented,userData:_.userData},_.scrollHandler(Z)),W.stopPropagation&&n.stopEvent(P),(Z&&Z.preventDefault||W.preventDefault&&!W.defaultPrevented)&&n.cancelEvent(P)}function de(_,T){var P={id:n.MouseTracker.mousePointerId,type:"mouse"},I={originalEvent:T,eventType:"lostpointercapture",pointerType:"mouse",isEmulated:!1};O(_,I),T.target===_.element&&k(_,P,!1),I.stopPropagation&&n.stopEvent(T)}function X(_,T){var P,I,W=T.changedTouches.length,Z,ge=_.getActivePointersListByType("touch");P=n.now(),ge.getLength()>T.touches.length-W&&n.console.warn("Tracked touch contact count doesn't match event.touches.length");var Le={originalEvent:T,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(O(_,Le),I=0;I<W;I++)Z={id:T.changedTouches[I].identifier,type:"touch",isPrimary:ge.getLength()===0,currentPos:p(T.changedTouches[I]),currentTime:P},V(_,Le,Z),me(_,Le,Z,0),k(_,Z,!0);Le.preventDefault&&!Le.defaultPrevented&&n.cancelEvent(T),Le.stopPropagation&&n.stopEvent(T)}function re(_,T){var P,I,W=T.changedTouches.length,Z;P=n.now();var ge={originalEvent:T,eventType:"pointerup",pointerType:"touch",isEmulated:!1};for(O(_,ge),I=0;I<W;I++)Z={id:T.changedTouches[I].identifier,type:"touch",currentPos:p(T.changedTouches[I]),currentTime:P},xe(_,ge,Z,0),k(_,Z,!1),Q(_,ge,Z);ge.preventDefault&&!ge.defaultPrevented&&n.cancelEvent(T),ge.stopPropagation&&n.stopEvent(T)}function fe(_,T){var P,I,W=T.changedTouches.length,Z;P=n.now();var ge={originalEvent:T,eventType:"pointermove",pointerType:"touch",isEmulated:!1};for(O(_,ge),I=0;I<W;I++)Z={id:T.changedTouches[I].identifier,type:"touch",currentPos:p(T.changedTouches[I]),currentTime:P},De(_,ge,Z);ge.preventDefault&&!ge.defaultPrevented&&n.cancelEvent(T),ge.stopPropagation&&n.stopEvent(T)}function H(_,T){var P=T.changedTouches.length,I,W,Z={originalEvent:T,eventType:"pointercancel",pointerType:"touch",isEmulated:!1};for(O(_,Z),I=0;I<P;I++)W={id:T.changedTouches[I].identifier,type:"touch"},we(_,Z,W);Z.stopPropagation&&n.stopEvent(T)}function Y(_,T){return n.eventIsCanceled(T)||T.preventDefault(),!1}function ae(_,T){return n.eventIsCanceled(T)||T.preventDefault(),!1}function Te(_,T){var P={originalEvent:T,eventType:"gotpointercapture",pointerType:h(T),isEmulated:!1};O(_,P),T.target===_.element&&k(_,{id:T.pointerId,type:h(T)},!0),P.stopPropagation&&n.stopEvent(T)}function Se(_,T){var P={originalEvent:T,eventType:"lostpointercapture",pointerType:h(T),isEmulated:!1};O(_,P),T.target===_.element&&k(_,{id:T.pointerId,type:h(T)},!1),P.stopPropagation&&n.stopEvent(T)}function oe(_,T){var P={id:f(T),type:h(T),isPrimary:g(T),currentPos:p(T),currentTime:n.now()},I={originalEvent:T,eventType:"pointerenter",pointerType:P.type,isEmulated:!1};O(_,I),V(_,I,P)}function be(_,T){var P={id:f(T),type:h(T),isPrimary:g(T),currentPos:p(T),currentTime:n.now()},I={originalEvent:T,eventType:"pointerleave",pointerType:P.type,isEmulated:!1};O(_,I),Q(_,I,P)}function te(_,T){var P={id:f(T),type:h(T),isPrimary:g(T),currentPos:p(T),currentTime:n.now()},I={originalEvent:T,eventType:"pointerover",pointerType:P.type,isEmulated:!1};O(_,I),le(_,I,P),I.preventDefault&&!I.defaultPrevented&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T)}function q(_,T){var P={id:f(T),type:h(T),isPrimary:g(T),currentPos:p(T),currentTime:n.now()},I={originalEvent:T,eventType:"pointerout",pointerType:P.type,isEmulated:!1};O(_,I),G(_,I,P),I.preventDefault&&!I.defaultPrevented&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T)}function ee(_,T){var P={id:f(T),type:h(T),isPrimary:g(T),currentPos:p(T),currentTime:n.now()},I=n.MouseTracker.havePointerEvents&&P.type==="touch",W={originalEvent:T,eventType:"pointerdown",pointerType:P.type,isEmulated:!1};O(_,W),me(_,W,P,T.button),W.preventDefault&&!W.defaultPrevented&&n.cancelEvent(T),W.stopPropagation&&n.stopEvent(T),W.shouldCapture&&(I?k(_,P,!0):c(_,P))}function se(_,T){Be(_,T)}function ce(_,T){var P=_.getActivePointersListByType(h(T));P.getById(T.pointerId)&&Be(_,T),n.stopEvent(T)}function Be(_,T){var P;P={id:f(T),type:h(T),isPrimary:g(T),currentPos:p(T),currentTime:n.now()};var I={originalEvent:T,eventType:"pointerup",pointerType:P.type,isEmulated:!1};O(_,I),xe(_,I,P,T.button),I.preventDefault&&!I.defaultPrevented&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T),I.shouldReleaseCapture&&(T.target===_.element?d(_,P):k(_,P,!1))}function qe(_,T){Ze(_,T)}function Ae(_,T){var P=_.getActivePointersListByType(h(T));P.getById(T.pointerId)&&Ze(_,T),n.stopEvent(T)}function Ze(_,T){var P={id:f(T),type:h(T),isPrimary:g(T),currentPos:p(T),currentTime:n.now()},I={originalEvent:T,eventType:"pointermove",pointerType:P.type,isEmulated:!1};O(_,I),De(_,I,P),I.preventDefault&&!I.defaultPrevented&&n.cancelEvent(T),I.stopPropagation&&n.stopEvent(T)}function Vn(_,T){var P={id:T.pointerId,type:h(T)},I={originalEvent:T,eventType:"pointercancel",pointerType:P.type,isEmulated:!1};O(_,I),we(_,I,P),I.stopPropagation&&n.stopEvent(T)}function xt(_,T){return T.speed=0,T.direction=0,T.contactPos=T.currentPos,T.contactTime=T.currentTime,T.lastPos=T.currentPos,T.lastTime=T.currentTime,_.add(T)}function Sn(_,T,P){var I,W=T.getById(P.id);return W?(W.captured&&(n.console.warn("stopTrackingPointer() called on captured pointer"),d(_,W)),T.removeContact(),I=T.removeById(P.id)):I=T.getLength(),I}function w(_,T){switch(T.eventType){case"pointermove":T.isStoppable=!0,T.isCancelable=!0,T.preventDefault=!1,T.preventGesture=!_.hasGestureHandlers,T.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":T.isStoppable=!0,T.isCancelable=!0,T.preventDefault=!1,T.preventGesture=!1,T.stopPropagation=!1;break;case"pointerdown":T.isStoppable=!0,T.isCancelable=!0,T.preventDefault=!1,T.preventGesture=!_.hasGestureHandlers,T.stopPropagation=!1;break;case"pointerup":T.isStoppable=!0,T.isCancelable=!0,T.preventDefault=!1,T.preventGesture=!_.hasGestureHandlers,T.stopPropagation=!1;break;case"wheel":T.isStoppable=!0,T.isCancelable=!0,T.preventDefault=!1,T.preventGesture=!_.hasScrollHandler,T.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":T.isStoppable=!0,T.isCancelable=!1,T.preventDefault=!1,T.preventGesture=!1,T.stopPropagation=!1;break;case"click":T.isStoppable=!0,T.isCancelable=!0,T.preventDefault=!!_.clickHandler,T.preventGesture=!1,T.stopPropagation=!1;break;case"dblclick":T.isStoppable=!0,T.isCancelable=!0,T.preventDefault=!!_.dblClickHandler,T.preventGesture=!1,T.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:T.isStoppable=!1,T.isCancelable=!1,T.preventDefault=!1,T.preventGesture=!1,T.stopPropagation=!1;break}}function O(_,T){T.eventSource=_,T.eventPhase=T.originalEvent&&typeof T.originalEvent.eventPhase<"u"?T.originalEvent.eventPhase:0,T.defaultPrevented=n.eventIsCanceled(T.originalEvent),T.shouldCapture=!1,T.shouldReleaseCapture=!1,T.userData=_.userData,w(_,T),_.preProcessEventHandler&&_.preProcessEventHandler(T)}function k(_,T,P){var I=_.getActivePointersListByType(T.type),W=I.getById(T.id);W?P&&!W.captured?(W.captured=!0,I.captureCount++):!P&&W.captured&&(W.captured=!1,I.captureCount--,I.captureCount<0&&(I.captureCount=0,n.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):n.console.warn("updatePointerCaptured() called on untracked pointer")}function V(_,T,P){var I=_.getActivePointersListByType(P.type),W;W=I.getById(P.id),W?(W.insideElement=!0,W.lastPos=W.currentPos,W.lastTime=W.currentTime,W.currentPos=P.currentPos,W.currentTime=P.currentTime,P=W):(P.captured=!1,P.insideElementPressed=!1,P.insideElement=!0,xt(I,P)),_.enterHandler&&_.enterHandler({eventSource:_,pointerType:P.type,position:m(P.currentPos,_.element),buttons:I.buttons,pointers:_.getActivePointerCount(),insideElementPressed:P.insideElementPressed,buttonDownAny:I.buttons!==0,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData})}function Q(_,T,P){var I=_.getActivePointersListByType(P.type),W,Z;W=I.getById(P.id),W?(W.captured?(W.insideElement=!1,W.lastPos=W.currentPos,W.lastTime=W.currentTime,W.currentPos=P.currentPos,W.currentTime=P.currentTime):Sn(_,I,W),P=W):(P.captured=!1,P.insideElementPressed=!1),(_.leaveHandler||_.exitHandler)&&(Z={eventSource:_,pointerType:P.type,position:P.currentPos&&m(P.currentPos,_.element),buttons:I.buttons,pointers:_.getActivePointerCount(),insideElementPressed:P.insideElementPressed,buttonDownAny:I.buttons!==0,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData},_.leaveHandler&&_.leaveHandler(Z),_.exitHandler&&_.exitHandler(Z))}function le(_,T,P){var I,W;I=_.getActivePointersListByType(P.type),W=I.getById(P.id),W?P=W:(P.captured=!1,P.insideElementPressed=!1),_.overHandler&&_.overHandler({eventSource:_,pointerType:P.type,position:m(P.currentPos,_.element),buttons:I.buttons,pointers:_.getActivePointerCount(),insideElementPressed:P.insideElementPressed,buttonDownAny:I.buttons!==0,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData})}function G(_,T,P){var I,W;I=_.getActivePointersListByType(P.type),W=I.getById(P.id),W?P=W:(P.captured=!1,P.insideElementPressed=!1),_.outHandler&&_.outHandler({eventSource:_,pointerType:P.type,position:P.currentPos&&m(P.currentPos,_.element),buttons:I.buttons,pointers:_.getActivePointerCount(),insideElementPressed:P.insideElementPressed,buttonDownAny:I.buttons!==0,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData})}function me(_,T,P,I){var W=r[_.hash],Z=_.getActivePointersListByType(P.type),ge;if(typeof T.originalEvent.buttons<"u"?Z.buttons=T.originalEvent.buttons:I===0?Z.buttons|=1:I===1?Z.buttons|=4:I===2?Z.buttons|=2:I===3?Z.buttons|=8:I===4?Z.buttons|=16:I===5&&(Z.buttons|=32),I!==0){T.shouldCapture=!1,T.shouldReleaseCapture=!1,_.nonPrimaryPressHandler&&!T.preventGesture&&!T.defaultPrevented&&(T.preventDefault=!0,_.nonPrimaryPressHandler({eventSource:_,pointerType:P.type,position:m(P.currentPos,_.element),button:I,buttons:Z.buttons,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData}));return}ge=Z.getById(P.id),ge?(ge.insideElementPressed=!0,ge.insideElement=!0,ge.originalTarget=T.originalEvent.target,ge.contactPos=P.currentPos,ge.contactTime=P.currentTime,ge.lastPos=ge.currentPos,ge.lastTime=ge.currentTime,ge.currentPos=P.currentPos,ge.currentTime=P.currentTime,P=ge):(P.captured=!1,P.insideElementPressed=!0,P.insideElement=!0,P.originalTarget=T.originalEvent.target,xt(Z,P)),Z.addContact(),!T.preventGesture&&!T.defaultPrevented?(T.shouldCapture=!0,T.shouldReleaseCapture=!1,T.preventDefault=!0,(_.dragHandler||_.dragEndHandler||_.pinchHandler)&&n.MouseTracker.gesturePointVelocityTracker.addPoint(_,P),Z.contacts===1?_.pressHandler&&!T.preventGesture&&_.pressHandler({eventSource:_,pointerType:P.type,position:m(P.contactPos,_.element),buttons:Z.buttons,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData}):Z.contacts===2&&_.pinchHandler&&P.type==="touch"&&(W.pinchGPoints=Z.asArray(),W.lastPinchDist=W.currentPinchDist=W.pinchGPoints[0].currentPos.distanceTo(W.pinchGPoints[1].currentPos),W.lastPinchCenter=W.currentPinchCenter=y(W.pinchGPoints[0].currentPos,W.pinchGPoints[1].currentPos))):(T.shouldCapture=!1,T.shouldReleaseCapture=!1)}function xe(_,T,P,I){var W=r[_.hash],Z=_.getActivePointersListByType(P.type),ge,Le,ye,tn=!1,St;if(typeof T.originalEvent.buttons<"u"?Z.buttons=T.originalEvent.buttons:I===0?Z.buttons^=-2:I===1?Z.buttons^=-5:I===2?Z.buttons^=-3:I===3?Z.buttons^=-9:I===4?Z.buttons^=-17:I===5&&(Z.buttons^=-33),T.shouldCapture=!1,I!==0){T.shouldReleaseCapture=!1,_.nonPrimaryReleaseHandler&&!T.preventGesture&&!T.defaultPrevented&&(T.preventDefault=!0,_.nonPrimaryReleaseHandler({eventSource:_,pointerType:P.type,position:m(P.currentPos,_.element),button:I,buttons:Z.buttons,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData}));return}ye=Z.getById(P.id),ye?(Z.removeContact(),ye.captured&&(tn=!0),ye.lastPos=ye.currentPos,ye.lastTime=ye.currentTime,ye.currentPos=P.currentPos,ye.currentTime=P.currentTime,ye.insideElement||Sn(_,Z,ye),ge=ye.currentPos,Le=ye.currentTime):(P.captured=!1,P.insideElementPressed=!1,P.insideElement=!0,xt(Z,P),ye=P),!T.preventGesture&&!T.defaultPrevented&&(tn?(T.shouldReleaseCapture=!0,T.preventDefault=!0,(_.dragHandler||_.dragEndHandler||_.pinchHandler)&&n.MouseTracker.gesturePointVelocityTracker.removePoint(_,ye),Z.contacts===0?(_.releaseHandler&&ge&&_.releaseHandler({eventSource:_,pointerType:ye.type,position:m(ge,_.element),buttons:Z.buttons,insideElementPressed:ye.insideElementPressed,insideElementReleased:ye.insideElement,isTouchEvent:ye.type==="touch",originalEvent:T.originalEvent,userData:_.userData}),_.dragEndHandler&&W.sentDragEvent&&_.dragEndHandler({eventSource:_,pointerType:ye.type,position:m(ye.currentPos,_.element),speed:ye.speed,direction:ye.direction,shift:T.originalEvent.shiftKey,isTouchEvent:ye.type==="touch",originalEvent:T.originalEvent,userData:_.userData}),W.sentDragEvent=!1,(_.clickHandler||_.dblClickHandler)&&ye.insideElement&&(St=Le-ye.contactTime<=_.clickTimeThreshold&&ye.contactPos.distanceTo(ge)<=_.clickDistThreshold,_.clickHandler&&_.clickHandler({eventSource:_,pointerType:ye.type,position:m(ye.currentPos,_.element),quick:St,shift:T.originalEvent.shiftKey,isTouchEvent:ye.type==="touch",originalEvent:T.originalEvent,originalTarget:ye.originalTarget,userData:_.userData}),_.dblClickHandler&&St&&(Z.clicks++,Z.clicks===1?(W.lastClickPos=ge,W.dblClickTimeOut=setTimeout(function(){Z.clicks=0},_.dblClickTimeThreshold)):Z.clicks===2&&(clearTimeout(W.dblClickTimeOut),Z.clicks=0,W.lastClickPos.distanceTo(ge)<=_.dblClickDistThreshold&&_.dblClickHandler({eventSource:_,pointerType:ye.type,position:m(ye.currentPos,_.element),shift:T.originalEvent.shiftKey,isTouchEvent:ye.type==="touch",originalEvent:T.originalEvent,userData:_.userData}),W.lastClickPos=null)))):Z.contacts===2&&_.pinchHandler&&ye.type==="touch"&&(W.pinchGPoints=Z.asArray(),W.lastPinchDist=W.currentPinchDist=W.pinchGPoints[0].currentPos.distanceTo(W.pinchGPoints[1].currentPos),W.lastPinchCenter=W.currentPinchCenter=y(W.pinchGPoints[0].currentPos,W.pinchGPoints[1].currentPos))):(T.shouldReleaseCapture=!1,_.releaseHandler&&ge&&(_.releaseHandler({eventSource:_,pointerType:ye.type,position:m(ge,_.element),buttons:Z.buttons,insideElementPressed:ye.insideElementPressed,insideElementReleased:ye.insideElement,isTouchEvent:ye.type==="touch",originalEvent:T.originalEvent,userData:_.userData}),T.preventDefault=!0)))}function De(_,T,P){var I=r[_.hash],W=_.getActivePointersListByType(P.type),Z,ge,Le;if(typeof T.originalEvent.buttons<"u"&&(W.buttons=T.originalEvent.buttons),Z=W.getById(P.id),Z)Z.lastPos=Z.currentPos,Z.lastTime=Z.currentTime,Z.currentPos=P.currentPos,Z.currentTime=P.currentTime;else return;T.shouldCapture=!1,T.shouldReleaseCapture=!1,_.stopHandler&&P.type==="mouse"&&(clearTimeout(_.stopTimeOut),_.stopTimeOut=setTimeout(function(){Ke(_,T.originalEvent,P.type)},_.stopDelay)),W.contacts===0?_.moveHandler&&_.moveHandler({eventSource:_,pointerType:P.type,position:m(P.currentPos,_.element),buttons:W.buttons,isTouchEvent:P.type==="touch",originalEvent:T.originalEvent,userData:_.userData}):W.contacts===1?(_.moveHandler&&(Z=W.asArray()[0],_.moveHandler({eventSource:_,pointerType:Z.type,position:m(Z.currentPos,_.element),buttons:W.buttons,isTouchEvent:Z.type==="touch",originalEvent:T.originalEvent,userData:_.userData})),_.dragHandler&&!T.preventGesture&&!T.defaultPrevented&&(Z=W.asArray()[0],Le=Z.currentPos.minus(Z.lastPos),_.dragHandler({eventSource:_,pointerType:Z.type,position:m(Z.currentPos,_.element),buttons:W.buttons,delta:Le,speed:Z.speed,direction:Z.direction,shift:T.originalEvent.shiftKey,isTouchEvent:Z.type==="touch",originalEvent:T.originalEvent,userData:_.userData}),T.preventDefault=!0,I.sentDragEvent=!0)):W.contacts===2&&(_.moveHandler&&(ge=W.asArray(),_.moveHandler({eventSource:_,pointerType:ge[0].type,position:m(y(ge[0].currentPos,ge[1].currentPos),_.element),buttons:W.buttons,isTouchEvent:ge[0].type==="touch",originalEvent:T.originalEvent,userData:_.userData})),_.pinchHandler&&P.type==="touch"&&!T.preventGesture&&!T.defaultPrevented&&(Le=I.pinchGPoints[0].currentPos.distanceTo(I.pinchGPoints[1].currentPos),Le!==I.currentPinchDist&&(I.lastPinchDist=I.currentPinchDist,I.currentPinchDist=Le,I.lastPinchCenter=I.currentPinchCenter,I.currentPinchCenter=y(I.pinchGPoints[0].currentPos,I.pinchGPoints[1].currentPos),_.pinchHandler({eventSource:_,pointerType:"touch",gesturePoints:I.pinchGPoints,lastCenter:m(I.lastPinchCenter,_.element),center:m(I.currentPinchCenter,_.element),lastDistance:I.lastPinchDist,distance:I.currentPinchDist,shift:T.originalEvent.shiftKey,originalEvent:T.originalEvent,userData:_.userData}),T.preventDefault=!0)))}function we(_,T,P){var I=_.getActivePointersListByType(P.type),W;W=I.getById(P.id),W&&Sn(_,I,W)}function Ke(_,T,P){_.stopHandler&&_.stopHandler({eventSource:_,pointerType:P,position:v(T,_.element),buttons:_.getActivePointersListByType(P).buttons,isTouchEvent:P==="touch",originalEvent:T,userData:_.userData})}}(t),function(n){n.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},n.Control=function(r,i,o){var a=r.parentNode;typeof i=="number"&&(n.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"),i={anchor:i}),i.attachToViewer=typeof i.attachToViewer>"u"?!0:i.attachToViewer,this.autoFade=typeof i.autoFade>"u"?!0:i.autoFade,this.element=r,this.anchor=i.anchor,this.container=o,this.anchor===n.ControlAnchor.ABSOLUTE?(this.wrapper=n.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof i.top=="number"?i.top+"px":i.top,this.wrapper.style.left=typeof i.left=="number"?i.left+"px":i.left,this.wrapper.style.height=typeof i.height=="number"?i.height+"px":i.height,this.wrapper.style.width=typeof i.width=="number"?i.width+"px":i.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=n.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===n.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),i.attachToViewer?this.anchor===n.ControlAnchor.TOP_RIGHT||this.anchor===n.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):a.appendChild(this.wrapper)},n.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==n.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(r){this.wrapper.style.display=r?this.anchor===n.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(r){n.setElementOpacity(this.wrapper,r,!0)}}}(t),function(n){n.ControlDock=function(i){var o=["topleft","topright","bottomright","bottomleft"],a,s;for(n.extend(!0,this,{id:"controldock-"+n.now()+"-"+Math.floor(Math.random()*1e6),container:n.makeNeutralElement("div"),controls:[]},i),this.container.onsubmit=function(){return!1},this.element&&(this.element=n.getElement(this.element),this.element.appendChild(this.container),n.getElementStyle(this.element).position==="static"&&(this.element.style.position="relative"),this.container.style.width="100%",this.container.style.height="100%"),s=0;s<o.length;s++)a=o[s],this.controls[a]=n.makeNeutralElement("div"),this.controls[a].style.position="absolute",a.match("left")&&(this.controls[a].style.left="0px"),a.match("right")&&(this.controls[a].style.right="0px"),a.match("top")&&(this.controls[a].style.top="0px"),a.match("bottom")&&(this.controls[a].style.bottom="0px");this.container.appendChild(this.controls.topleft),this.container.appendChild(this.controls.topright),this.container.appendChild(this.controls.bottomright),this.container.appendChild(this.controls.bottomleft)},n.ControlDock.prototype={addControl:function(i,o){i=n.getElement(i);var a=null;if(!(r(this,i)>=0)){switch(o.anchor){case n.ControlAnchor.TOP_RIGHT:a=this.controls.topright,i.style.position="relative",i.style.paddingRight="0px",i.style.paddingTop="0px";break;case n.ControlAnchor.BOTTOM_RIGHT:a=this.controls.bottomright,i.style.position="relative",i.style.paddingRight="0px",i.style.paddingBottom="0px";break;case n.ControlAnchor.BOTTOM_LEFT:a=this.controls.bottomleft,i.style.position="relative",i.style.paddingLeft="0px",i.style.paddingBottom="0px";break;case n.ControlAnchor.TOP_LEFT:a=this.controls.topleft,i.style.position="relative",i.style.paddingLeft="0px",i.style.paddingTop="0px";break;case n.ControlAnchor.ABSOLUTE:a=this.container,i.style.margin="0px",i.style.padding="0px";break;default:case n.ControlAnchor.NONE:a=this.container,i.style.margin="0px",i.style.padding="0px";break}this.controls.push(new n.Control(i,o,a)),i.style.display="inline-block"}},removeControl:function(i){i=n.getElement(i);var o=r(this,i);return o>=0&&(this.controls[o].destroy(),this.controls.splice(o,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var i;for(i=this.controls.length-1;i>=0;i--)if(this.controls[i].isVisible())return!0;return!1},setControlsEnabled:function(i){var o;for(o=this.controls.length-1;o>=0;o--)this.controls[o].setVisible(i);return this}};function r(i,o){var a=i.controls,s;for(s=a.length-1;s>=0;s--)if(a[s].element===o)return s;return-1}}(t),function(n){n.Placement=n.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}}})}(t),function(n){var r={},i=1;n.Viewer=function(w){var O=arguments,k=this,V;n.isPlainObject(w)||(w={id:O[0],xmlPath:O.length>1?O[1]:void 0,prefixUrl:O.length>2?O[2]:void 0,controls:O.length>3?O[3]:void 0,overlays:O.length>4?O[4]:void 0}),w.config&&(n.extend(!0,w,w.config),delete w.config);let Q=["useCanvas"];if(w.drawerOptions=Object.assign({},Q.reduce((G,me)=>(G[me]=w[me],delete w[me],G),{}),w.drawerOptions),n.extend(!0,this,{id:w.id,hash:w.hash||i++,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,buttonGroup:null,profiler:null},n.DEFAULT_SETTINGS,w),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");typeof r[this.hash]<"u"&&n.console.warn("Hash "+this.hash+" has already been used."),r[this.hash]={fsBoundsDelta:new n.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,needsResize:!1,forceResize:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null,lastClickTime:null,draggingToZoom:!1},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=n.now(),n.EventSource.call(this),this.addHandler("open-failed",function(G){var me=n.getString("Errors.OpenFailed",G.eventSource,G.message);k._showMessage(me)}),n.ControlDock.call(this,w),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=n.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(G){G.width="100%",G.height="100%",G.overflow="hidden",G.position="absolute",G.top="0px",G.left="0px"}(this.canvas.style),n.setElementTouchActionNone(this.canvas),w.tabIndex!==""&&(this.canvas.tabIndex=w.tabIndex===void 0?0:w.tabIndex),this.container.className="openseadragon-container",function(G){G.width="100%",G.height="100%",G.position="relative",G.overflow="hidden",G.left="0px",G.top="0px",G.textAlign="left"}(this.container.style),n.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 n.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:n.delegate(this,v),keyDownHandler:n.delegate(this,m),keyHandler:n.delegate(this,y),clickHandler:n.delegate(this,E),dblClickHandler:n.delegate(this,b),dragHandler:n.delegate(this,R),dragEndHandler:n.delegate(this,M),enterHandler:n.delegate(this,C),leaveHandler:n.delegate(this,D),pressHandler:n.delegate(this,F),releaseHandler:n.delegate(this,L),nonPrimaryPressHandler:n.delegate(this,B),nonPrimaryReleaseHandler:n.delegate(this,z),scrollHandler:n.delegate(this,re),pinchHandler:n.delegate(this,$),focusHandler:n.delegate(this,de),blurHandler:n.delegate(this,X)}),this.outerTracker=new n.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:n.delegate(this,fe),leaveHandler:n.delegate(this,H)}),this.toolbar&&(this.toolbar=new n.ControlDock({element:this.toolbar})),this.bindStandardControls(),r[this.hash].prevContainerSize=o(this.container),window.ResizeObserver?(this._autoResizePolling=!1,this._resizeObserver=new ResizeObserver(function(){r[k.hash].needsResize=!0}),this._resizeObserver.observe(this.container,{})):this._autoResizePolling=!0,this.world=new n.World({viewer:this}),this.world.addHandler("add-item",function(G){k.source=k.world.getItemAt(0).source,r[k.hash].forceRedraw=!0,k._updateRequestId||(k._updateRequestId=u(k,Y))}),this.world.addHandler("remove-item",function(G){k.world.getItemCount()?k.source=k.world.getItemAt(0).source:k.source=null,r[k.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(G){k.viewport&&k.viewport._setContentBounds(k.world.getHomeBounds(),k.world.getContentFactor())}),this.world.addHandler("item-index-change",function(G){k.source=k.world.getItemAt(0).source}),this.viewport=new n.Viewport({containerSize:r[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,overlayPreserveContentDirection:this.overlayPreserveContentDirection,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins,silenceMultiImageWarnings:this.silenceMultiImageWarnings}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new n.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:w.timeout,tileRetryMax:this.tileRetryMax,tileRetryDelay:this.tileRetryDelay}),this.tileCache=new n.TileCache({maxImageCacheCount:this.maxImageCacheCount}),Object.prototype.hasOwnProperty.call(this.drawerOptions,"useCanvas")&&(n.console.error('useCanvas is deprecated, use the "drawer" option to indicate preferred drawer(s)'),this.drawerOptions.useCanvas||(this.drawer=n.HTMLDrawer),delete this.drawerOptions.useCanvas);let le=Array.isArray(this.drawer)?this.drawer:[this.drawer];le.length===0&&(le=[n.DEFAULT_SETTINGS.drawer].flat(),n.console.warn("No valid drawers were selected. Using the default value.")),this.drawer=null;for(const G of le)if(this.requestDrawer(G,{mainDrawer:!0,redrawImmediately:!1}))break;if(!this.drawer)throw n.console.error("No drawer could be created!"),"Error with creating the selected drawer(s)";for(this.drawer.setImageSmoothingEnabled(this.imageSmoothingEnabled),this.overlaysContainer=n.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(V=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(V,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(V=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(V,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new n.Navigator({element:this.navigatorElement,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,animationTime:this.animationTime,drawer:this.drawer.getType(),loadTilesWithAjax:this.loadTilesWithAjax,ajaxHeaders:this.ajaxHeaders,ajaxWithCredentials:this.ajaxWithCredentials})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),V=0;V<this.customControls.length;V++)this.addControl(this.customControls[V].id,{anchor:this.customControls[V].anchor});n.requestAnimationFrame(function(){d(k)}),n._viewers.set(this.element,this)},n.extend(n.Viewer.prototype,n.EventSource.prototype,n.ControlDock.prototype,{isOpen:function(){return!!this.world.getItemCount()},openDzi:function(w){return n.console.error("[Viewer.openDzi] this function is deprecated; use Viewer.open() instead."),this.open(w)},openTileSource:function(w){return n.console.error("[Viewer.openTileSource] this function is deprecated; use Viewer.open() instead."),this.open(w)},get buttons(){return n.console.warn("Viewer.buttons is deprecated; Please use Viewer.buttonGroup"),this.buttonGroup},open:function(w,O){var k=this;if(this.close(),!w)return this;if(this.sequenceMode&&n.isArray(w))return this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),typeof O<"u"&&!isNaN(O)&&(this.initialPage=O),this.tileSources=w,this._sequenceIndex=Math.max(0,Math.min(this.tileSources.length-1,this.initialPage)),this.tileSources.length&&(this.open(this.tileSources[this._sequenceIndex]),this.showReferenceStrip&&this.addReferenceStrip()),this._updateSequenceButtons(this._sequenceIndex),this;if(n.isArray(w)||(w=[w]),!w.length)return this;this._opening=!0;for(var V=w.length,Q=0,le=0,G,me=function(){if(Q+le===V)if(Q){(k._firstOpen||!k.preserveViewport)&&(k.viewport.goHome(!0),k.viewport.update()),k._firstOpen=!1;var we=w[0];if(we.tileSource&&(we=we.tileSource),k.overlays&&!k.preserveOverlays)for(var Ke=0;Ke<k.overlays.length;Ke++)k.currentOverlays[Ke]=s(k,k.overlays[Ke]);k._drawOverlays(),k._opening=!1,k.raiseEvent("open",{source:we})}else k._opening=!1,k.raiseEvent("open-failed",G)},xe=function(we){(!n.isPlainObject(we)||!we.tileSource)&&(we={tileSource:we}),we.index!==void 0&&(n.console.error("[Viewer.open] setting indexes here is not supported; use addTiledImage instead"),delete we.index),we.collectionImmediately===void 0&&(we.collectionImmediately=!0);var Ke=we.success;we.success=function(T){if(Q++,we.tileSource.overlays)for(var P=0;P<we.tileSource.overlays.length;P++)k.addOverlay(we.tileSource.overlays[P]);Ke&&Ke(T),me()};var _=we.error;we.error=function(T){le++,G||(G=T),_&&_(T),me()},k.addTiledImage(we)},De=0;De<w.length;De++)xe(w[De]);return this},close:function(){return r[this.hash]?(this._opening=!1,this.navigator&&this.navigator.close(),this.preserveOverlays||(this.clearOverlays(),this.overlaysContainer.innerHTML=""),r[this.hash].animating=!1,this.world.removeAll(),this.imageLoader.clear(),this.raiseEvent("close"),this):this},destroy:function(){if(r[this.hash]){if(this.raiseEvent("before-destroy"),this._removeUpdatePixelDensityRatioEvent(),this.close(),this.clearOverlays(),this.overlaysContainer.innerHTML="",this._resizeObserver&&this._resizeObserver.disconnect(),this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null),this._updateRequestId!==null&&(n.cancelAnimationFrame(this._updateRequestId),this._updateRequestId=null),this.drawer&&this.drawer.destroy(),this.navigator&&(this.navigator.destroy(),r[this.navigator.hash]=null,delete r[this.navigator.hash],this.navigator=null),this.buttonGroup)this.buttonGroup.destroy();else if(this.customButtons)for(;this.customButtons.length;)this.customButtons.pop().destroy();if(this.paging&&this.paging.destroy(),this.element)for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.container.onsubmit=null,this.clearControls(),this.innerTracker&&this.innerTracker.destroy(),this.outerTracker&&this.outerTracker.destroy(),r[this.hash]=null,delete r[this.hash],this.canvas=null,this.container=null,n._viewers.delete(this.element),this.element=null,this.raiseEvent("destroy"),this.removeAllHandlers()}},requestDrawer(w,O){const k={mainDrawer:!0,redrawImmediately:!0,drawerOptions:null};O=n.extend(!0,k,O);const V=O.mainDrawer,Q=O.redrawImmediately,le=O.drawerOptions,G=this.drawer;let me=null;if(w&&w.prototype instanceof n.DrawerBase?(me=w,w="custom"):typeof w=="string"&&(me=n.determineDrawer(w)),me||n.console.warn("Unsupported drawer! Drawer must be an existing string type, or a class that extends OpenSeadragon.DrawerBase."),me&&me.isSupported()){G&&V&&G.destroy();const xe=new me({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor,options:le||this.drawerOptions[w]});return V&&(this.drawer=xe,Q&&this.forceRedraw()),xe}return!1},isMouseNavEnabled:function(){return this.innerTracker.isTracking()},setMouseNavEnabled:function(w){return this.innerTracker.setTracking(w),this.outerTracker.setTracking(w),this.raiseEvent("mouse-enabled",{enabled:w}),this},areControlsEnabled:function(){var w=this.controls.length,O;for(O=0;O<this.controls.length;O++)w=w&&this.controls[O].isVisible();return w},setControlsEnabled:function(w){return w?h(this):d(this),this.raiseEvent("controls-enabled",{enabled:w}),this},setDebugMode:function(w){for(var O=0;O<this.world.getItemCount();O++)this.world.getItemAt(O).debugMode=w;this.debugMode=w,this.forceRedraw()},setAjaxHeaders:function(w,O){if(w===null&&(w={}),!n.isPlainObject(w)){console.error("[Viewer.setAjaxHeaders] Ignoring invalid headers, must be a plain object");return}if(O===void 0&&(O=!0),this.ajaxHeaders=w,O){for(var k=0;k<this.world.getItemCount();k++)this.world.getItemAt(k)._updateAjaxHeaders(!0);if(this.navigator&&this.navigator.setAjaxHeaders(this.ajaxHeaders,!0),this.referenceStrip&&this.referenceStrip.miniViewers)for(var V in this.referenceStrip.miniViewers)this.referenceStrip.miniViewers[V].setAjaxHeaders(this.ajaxHeaders,!0)}},addButton:function(w){this.buttonGroup.addButton(w)},isFullPage:function(){return r[this.hash]&&r[this.hash].fullPage},setFullPage:function(w){var O=document.body,k=O.style,V=document.documentElement.style,Q=this,le,G;if(w===this.isFullPage())return this;var me={fullPage:w,preventDefaultAction:!1};if(this.raiseEvent("pre-full-page",me),me.preventDefaultAction)return this;if(w&&this.element){for(this.elementSize=n.getElementSize(this.element),this.pageScroll=n.getPageScroll(),this.elementMargin=this.element.style.margin,this.element.style.margin="0",this.elementPadding=this.element.style.padding,this.element.style.padding="0",this.bodyMargin=k.margin,this.docMargin=V.margin,k.margin="0",V.margin="0",this.bodyPadding=k.padding,this.docPadding=V.padding,k.padding="0",V.padding="0",this.bodyWidth=k.width,this.docWidth=V.width,k.width="100%",V.width="100%",this.bodyHeight=k.height,this.docHeight=V.height,k.height="100%",V.height="100%",this.bodyDisplay=k.display,k.display="block",this.previousBody=[],r[this.hash].prevElementParent=this.element.parentNode,r[this.hash].prevNextSibling=this.element.nextSibling,r[this.hash].prevElementWidth=this.element.style.width,r[this.hash].prevElementHeight=this.element.style.height,le=O.childNodes.length,G=0;G<le;G++)this.previousBody.push(O.childNodes[0]),O.removeChild(O.childNodes[0]);this.toolbar&&this.toolbar.element&&(this.toolbar.parentNode=this.toolbar.element.parentNode,this.toolbar.nextSibling=this.toolbar.element.nextSibling,O.appendChild(this.toolbar.element),n.addClass(this.toolbar.element,"fullpage")),n.addClass(this.element,"fullpage"),O.appendChild(this.element),this.element.style.height="100vh",this.element.style.width="100vw",this.toolbar&&this.toolbar.element&&(this.element.style.height=n.getElementSize(this.element).y-n.getElementSize(this.toolbar.element).y+"px"),r[this.hash].fullPage=!0,n.delegate(this,fe)({})}else{for(this.element.style.margin=this.elementMargin,this.element.style.padding=this.elementPadding,k.margin=this.bodyMargin,V.margin=this.docMargin,k.padding=this.bodyPadding,V.padding=this.docPadding,k.width=this.bodyWidth,V.width=this.docWidth,k.height=this.bodyHeight,V.height=this.docHeight,k.display=this.bodyDisplay,O.removeChild(this.element),le=this.previousBody.length,G=0;G<le;G++)O.appendChild(this.previousBody.shift());n.removeClass(this.element,"fullpage"),r[this.hash].prevElementParent.insertBefore(this.element,r[this.hash].prevNextSibling),this.toolbar&&this.toolbar.element&&(O.removeChild(this.toolbar.element),n.removeClass(this.toolbar.element,"fullpage"),this.toolbar.parentNode.insertBefore(this.toolbar.element,this.toolbar.nextSibling),delete this.toolbar.parentNode,delete this.toolbar.nextSibling),this.element.style.width=r[this.hash].prevElementWidth,this.element.style.height=r[this.hash].prevElementHeight;var xe=0,De=function(){n.setPageScroll(Q.pageScroll);var we=n.getPageScroll();xe++,xe<10&&(we.x!==Q.pageScroll.x||we.y!==Q.pageScroll.y)&&n.requestAnimationFrame(De)};n.requestAnimationFrame(De),r[this.hash].fullPage=!1,n.delegate(this,H)({})}return this.navigator&&this.viewport&&this.navigator.update(this.viewport),this.raiseEvent("full-page",{fullPage:w}),this},setFullScreen:function(w){var O=this;if(!n.supportsFullScreen)return this.setFullPage(w);if(n.isFullScreen()===w)return this;var k={fullScreen:w,preventDefaultAction:!1};if(this.raiseEvent("pre-full-screen",k),k.preventDefaultAction)return this;if(w){if(this.setFullPage(!0),!this.isFullPage())return this;this.fullPageStyleWidth=this.element.style.width,this.fullPageStyleHeight=this.element.style.height,this.element.style.width="100%",this.element.style.height="100%";var V=function(){var Q=n.isFullScreen();Q||(n.removeEvent(document,n.fullScreenEventName,V),n.removeEvent(document,n.fullScreenErrorEventName,V),O.setFullPage(!1),O.isFullPage()&&(O.element.style.width=O.fullPageStyleWidth,O.element.style.height=O.fullPageStyleHeight)),O.navigator&&O.viewport&&setTimeout(function(){O.navigator.update(O.viewport)}),O.raiseEvent("full-screen",{fullScreen:Q})};n.addEvent(document,n.fullScreenEventName,V),n.addEvent(document,n.fullScreenErrorEventName,V),n.requestFullScreen(document.body)}else n.exitFullScreen();return this},isVisible:function(){return this.container.style.visibility!=="hidden"},isFullScreen:function(){return n.isFullScreen()&&this.isFullPage()},setVisible:function(w){return this.container.style.visibility=w?"":"hidden",this.raiseEvent("visible",{visible:w}),this},addTiledImage:function(w){n.console.assert(w,"[Viewer.addTiledImage] options is required"),n.console.assert(w.tileSource,"[Viewer.addTiledImage] options.tileSource is required"),n.console.assert(!w.replace||w.index>-1&&w.index<this.world.getItemCount(),"[Viewer.addTiledImage] if options.replace is used, options.index must be a valid index in Viewer.world");var O=this;w.replace&&(w.replaceItem=O.world.getItemAt(w.index)),this._hideMessage(),w.placeholderFillStyle===void 0&&(w.placeholderFillStyle=this.placeholderFillStyle),w.opacity===void 0&&(w.opacity=this.opacity),w.preload===void 0&&(w.preload=this.preload),w.compositeOperation===void 0&&(w.compositeOperation=this.compositeOperation),w.crossOriginPolicy===void 0&&(w.crossOriginPolicy=w.tileSource.crossOriginPolicy!==void 0?w.tileSource.crossOriginPolicy:this.crossOriginPolicy),w.ajaxWithCredentials===void 0&&(w.ajaxWithCredentials=this.ajaxWithCredentials),w.loadTilesWithAjax===void 0&&(w.loadTilesWithAjax=this.loadTilesWithAjax),n.isPlainObject(w.ajaxHeaders)||(w.ajaxHeaders={});var k={options:w};function V(G){for(var me=0;me<O._loadQueue.length;me++)if(O._loadQueue[me]===k){O._loadQueue.splice(me,1);break}O._loadQueue.length===0&&Q(k),O.raiseEvent("add-item-failed",G),w.error&&w.error(G)}function Q(G){O.collectionMode&&(O.world.arrange({immediately:G.options.collectionImmediately,rows:O.collectionRows,columns:O.collectionColumns,layout:O.collectionLayout,tileSize:O.collectionTileSize,tileMargin:O.collectionTileMargin}),O.world.setAutoRefigureSizes(!0))}if(n.isArray(w.tileSource)){setTimeout(function(){V({message:"[Viewer.addTiledImage] Sequences can not be added; add them one at a time instead.",source:w.tileSource,options:w})});return}this._loadQueue.push(k);function le(){for(var G,me,xe;O._loadQueue.length&&(G=O._loadQueue[0],!!G.tileSource);){if(O._loadQueue.splice(0,1),G.options.replace){var De=O.world.getIndexOfItem(G.options.replaceItem);De!==-1&&(G.options.index=De),O.world.removeItem(G.options.replaceItem)}me=new n.TiledImage({viewer:O,source:G.tileSource,viewport:O.viewport,drawer:O.drawer,tileCache:O.tileCache,imageLoader:O.imageLoader,x:G.options.x,y:G.options.y,width:G.options.width,height:G.options.height,fitBounds:G.options.fitBounds,fitBoundsPlacement:G.options.fitBoundsPlacement,clip:G.options.clip,placeholderFillStyle:G.options.placeholderFillStyle,opacity:G.options.opacity,preload:G.options.preload,degrees:G.options.degrees,flipped:G.options.flipped,compositeOperation:G.options.compositeOperation,springStiffness:O.springStiffness,animationTime:O.animationTime,minZoomImageRatio:O.minZoomImageRatio,wrapHorizontal:O.wrapHorizontal,wrapVertical:O.wrapVertical,maxTilesPerFrame:O.maxTilesPerFrame,immediateRender:O.immediateRender,blendTime:O.blendTime,alwaysBlend:O.alwaysBlend,minPixelRatio:O.minPixelRatio,smoothTileEdgesMinZoom:O.smoothTileEdgesMinZoom,iOSDevice:O.iOSDevice,crossOriginPolicy:G.options.crossOriginPolicy,ajaxWithCredentials:G.options.ajaxWithCredentials,loadTilesWithAjax:G.options.loadTilesWithAjax,ajaxHeaders:G.options.ajaxHeaders,debugMode:O.debugMode,subPixelRoundingForTransparency:O.subPixelRoundingForTransparency}),O.collectionMode&&O.world.setAutoRefigureSizes(!1),O.navigator&&(xe=n.extend({},G.options,{replace:!1,originalTiledImage:me,tileSource:G.tileSource}),O.navigator.addTiledImage(xe)),O.world.addItem(me,{index:G.options.index}),O._loadQueue.length===0&&Q(G),O.world.getItemCount()===1&&!O.preserveViewport&&O.viewport.goHome(!0),G.options.success&&G.options.success({item:me})}}a(this,w.tileSource,w,function(G){k.tileSource=G,le()},function(G){G.options=w,V(G),le()})},addSimpleImage:function(w){n.console.assert(w,"[Viewer.addSimpleImage] options is required"),n.console.assert(w.url,"[Viewer.addSimpleImage] options.url is required");var O=n.extend({},w,{tileSource:{type:"image",url:w.url}});delete O.url,this.addTiledImage(O)},addLayer:function(w){var O=this;n.console.error("[Viewer.addLayer] this function is deprecated; use Viewer.addTiledImage() instead.");var k=n.extend({},w,{success:function(V){O.raiseEvent("add-layer",{options:w,drawer:V.item})},error:function(V){O.raiseEvent("add-layer-failed",V)}});return this.addTiledImage(k),this},getLayerAtLevel:function(w){return n.console.error("[Viewer.getLayerAtLevel] this function is deprecated; use World.getItemAt() instead."),this.world.getItemAt(w)},getLevelOfLayer:function(w){return n.console.error("[Viewer.getLevelOfLayer] this function is deprecated; use World.getIndexOfItem() instead."),this.world.getIndexOfItem(w)},getLayersCount:function(){return n.console.error("[Viewer.getLayersCount] this function is deprecated; use World.getItemCount() instead."),this.world.getItemCount()},setLayerLevel:function(w,O){return n.console.error("[Viewer.setLayerLevel] this function is deprecated; use World.setItemIndex() instead."),this.world.setItemIndex(w,O)},removeLayer:function(w){return n.console.error("[Viewer.removeLayer] this function is deprecated; use World.removeItem() instead."),this.world.removeItem(w)},forceRedraw:function(){return r[this.hash].forceRedraw=!0,this},forceResize:function(){r[this.hash].needsResize=!0,r[this.hash].forceResize=!0},bindSequenceControls:function(){var w=n.delegate(this,g),O=n.delegate(this,p),k=n.delegate(this,this.goToNextPage),V=n.delegate(this,this.goToPreviousPage),Q=this.navImages,le=!0;return this.showSequenceControl&&((this.previousButton||this.nextButton)&&(le=!1),this.previousButton=new n.Button({element:this.previousButton?n.getElement(this.previousButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.PreviousPage"),srcRest:oe(this.prefixUrl,Q.previous.REST),srcGroup:oe(this.prefixUrl,Q.previous.GROUP),srcHover:oe(this.prefixUrl,Q.previous.HOVER),srcDown:oe(this.prefixUrl,Q.previous.DOWN),onRelease:V,onFocus:w,onBlur:O}),this.nextButton=new n.Button({element:this.nextButton?n.getElement(this.nextButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.NextPage"),srcRest:oe(this.prefixUrl,Q.next.REST),srcGroup:oe(this.prefixUrl,Q.next.GROUP),srcHover:oe(this.prefixUrl,Q.next.HOVER),srcDown:oe(this.prefixUrl,Q.next.DOWN),onRelease:k,onFocus:w,onBlur:O}),this.navPrevNextWrap||this.previousButton.disable(),(!this.tileSources||!this.tileSources.length)&&this.nextButton.disable(),le&&(this.paging=new n.ButtonGroup({buttons:[this.previousButton,this.nextButton],clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.pagingControl=this.paging.element,this.toolbar?this.toolbar.addControl(this.pagingControl,{anchor:n.ControlAnchor.BOTTOM_RIGHT}):this.addControl(this.pagingControl,{anchor:this.sequenceControlAnchor||n.ControlAnchor.TOP_LEFT}))),this},bindStandardControls:function(){var w=n.delegate(this,be),O=n.delegate(this,q),k=n.delegate(this,ce),V=n.delegate(this,te),Q=n.delegate(this,Be),le=n.delegate(this,Ae),G=n.delegate(this,Ze),me=n.delegate(this,Vn),xe=n.delegate(this,xt),De=n.delegate(this,Sn),we=n.delegate(this,g),Ke=n.delegate(this,p),_=this.navImages,T=[],P=!0;return this.showNavigationControl&&((this.zoomInButton||this.zoomOutButton||this.homeButton||this.fullPageButton||this.rotateLeftButton||this.rotateRightButton||this.flipButton)&&(P=!1),this.showZoomControl&&(T.push(this.zoomInButton=new n.Button({element:this.zoomInButton?n.getElement(this.zoomInButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.ZoomIn"),srcRest:oe(this.prefixUrl,_.zoomIn.REST),srcGroup:oe(this.prefixUrl,_.zoomIn.GROUP),srcHover:oe(this.prefixUrl,_.zoomIn.HOVER),srcDown:oe(this.prefixUrl,_.zoomIn.DOWN),onPress:w,onRelease:O,onClick:k,onEnter:w,onExit:O,onFocus:we,onBlur:Ke})),T.push(this.zoomOutButton=new n.Button({element:this.zoomOutButton?n.getElement(this.zoomOutButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.ZoomOut"),srcRest:oe(this.prefixUrl,_.zoomOut.REST),srcGroup:oe(this.prefixUrl,_.zoomOut.GROUP),srcHover:oe(this.prefixUrl,_.zoomOut.HOVER),srcDown:oe(this.prefixUrl,_.zoomOut.DOWN),onPress:V,onRelease:O,onClick:Q,onEnter:V,onExit:O,onFocus:we,onBlur:Ke}))),this.showHomeControl&&T.push(this.homeButton=new n.Button({element:this.homeButton?n.getElement(this.homeButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.Home"),srcRest:oe(this.prefixUrl,_.home.REST),srcGroup:oe(this.prefixUrl,_.home.GROUP),srcHover:oe(this.prefixUrl,_.home.HOVER),srcDown:oe(this.prefixUrl,_.home.DOWN),onRelease:le,onFocus:we,onBlur:Ke})),this.showFullPageControl&&T.push(this.fullPageButton=new n.Button({element:this.fullPageButton?n.getElement(this.fullPageButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.FullPage"),srcRest:oe(this.prefixUrl,_.fullpage.REST),srcGroup:oe(this.prefixUrl,_.fullpage.GROUP),srcHover:oe(this.prefixUrl,_.fullpage.HOVER),srcDown:oe(this.prefixUrl,_.fullpage.DOWN),onRelease:G,onFocus:we,onBlur:Ke})),this.showRotationControl&&(T.push(this.rotateLeftButton=new n.Button({element:this.rotateLeftButton?n.getElement(this.rotateLeftButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.RotateLeft"),srcRest:oe(this.prefixUrl,_.rotateleft.REST),srcGroup:oe(this.prefixUrl,_.rotateleft.GROUP),srcHover:oe(this.prefixUrl,_.rotateleft.HOVER),srcDown:oe(this.prefixUrl,_.rotateleft.DOWN),onRelease:me,onFocus:we,onBlur:Ke})),T.push(this.rotateRightButton=new n.Button({element:this.rotateRightButton?n.getElement(this.rotateRightButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.RotateRight"),srcRest:oe(this.prefixUrl,_.rotateright.REST),srcGroup:oe(this.prefixUrl,_.rotateright.GROUP),srcHover:oe(this.prefixUrl,_.rotateright.HOVER),srcDown:oe(this.prefixUrl,_.rotateright.DOWN),onRelease:xe,onFocus:we,onBlur:Ke}))),this.showFlipControl&&T.push(this.flipButton=new n.Button({element:this.flipButton?n.getElement(this.flipButton):null,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,tooltip:n.getString("Tooltips.Flip"),srcRest:oe(this.prefixUrl,_.flip.REST),srcGroup:oe(this.prefixUrl,_.flip.GROUP),srcHover:oe(this.prefixUrl,_.flip.HOVER),srcDown:oe(this.prefixUrl,_.flip.DOWN),onRelease:De,onFocus:we,onBlur:Ke})),P?(this.buttonGroup=new n.ButtonGroup({buttons:T,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold}),this.navControl=this.buttonGroup.element,this.addHandler("open",n.delegate(this,qe)),this.toolbar?this.toolbar.addControl(this.navControl,{anchor:this.navigationControlAnchor||n.ControlAnchor.TOP_LEFT}):this.addControl(this.navControl,{anchor:this.navigationControlAnchor||n.ControlAnchor.TOP_LEFT})):this.customButtons=T),this},currentPage:function(){return this._sequenceIndex},goToPage:function(w){return this.tileSources&&w>=0&&w<this.tileSources.length&&(this._sequenceIndex=w,this._updateSequenceButtons(w),this.open(this.tileSources[w]),this.referenceStrip&&this.referenceStrip.setFocus(w),this.raiseEvent("page",{page:w})),this},addOverlay:function(w,O,k,V){var Q;if(n.isPlainObject(w)?Q=w:Q={element:w,location:O,placement:k,onDraw:V},w=n.getElement(Q.element),l(this.currentOverlays,w)>=0)return this;var le=s(this,Q);return this.currentOverlays.push(le),le.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:w,location:Q.location,placement:Q.placement}),this},updateOverlay:function(w,O,k){var V;return w=n.getElement(w),V=l(this.currentOverlays,w),V>=0&&(this.currentOverlays[V].update(O,k),r[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:w,location:O,placement:k})),this},removeOverlay:function(w){var O;return w=n.getElement(w),O=l(this.currentOverlays,w),O>=0&&(this.currentOverlays[O].destroy(),this.currentOverlays.splice(O,1),r[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:w})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return r[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(w){var O;return w=n.getElement(w),O=l(this.currentOverlays,w),O>=0?this.currentOverlays[O]:null},_updateSequenceButtons:function(w){this.nextButton&&(!this.tileSources||this.tileSources.length-1===w?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(w>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(w){this._hideMessage();var O=n.makeNeutralElement("div");O.appendChild(document.createTextNode(w)),this.messageDiv=n.makeCenteredNode(O),n.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var w=this.messageDiv;w&&(w.parentNode.removeChild(w),delete this.messageDiv)},gestureSettingsByDeviceType:function(w){switch(w){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var w,O=this.currentOverlays.length;for(w=0;w<O;w++)this.currentOverlays[w].drawHTML(this.overlaysContainer,this.viewport)},_cancelPendingImages:function(){this._loadQueue=[]},removeReferenceStrip:function(){this.showReferenceStrip=!1,this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null)},addReferenceStrip:function(){if(this.showReferenceStrip=!0,this.sequenceMode){if(this.referenceStrip)return;this.tileSources.length&&this.tileSources.length>1&&(this.referenceStrip=new n.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,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else n.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),n.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){n.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var w=n.pixelDensityRatio,O=n.getCurrentPixelDensityRatio();w!==O&&(n.pixelDensityRatio=O,this.forceResize())},goToPreviousPage:function(){var w=this._sequenceIndex-1;this.navPrevNextWrap&&w<0&&(w+=this.tileSources.length),this.goToPage(w)},goToNextPage:function(){var w=this._sequenceIndex+1;this.navPrevNextWrap&&w>=this.tileSources.length&&(w=0),this.goToPage(w)},isAnimating:function(){return r[this.hash].animating}});function o(w){return w=n.getElement(w),new n.Point(w.clientWidth===0?1:w.clientWidth,w.clientHeight===0?1:w.clientHeight)}function a(w,O,k,V,Q){var le=w;if(n.type(O)==="string"){if(O.match(/^\s*<.*>\s*$/))O=n.parseXml(O);else if(O.match(/^\s*[{[].*[}\]]\s*$/))try{var G=n.parseJSON(O);O=G}catch{}}function me(xe,De){xe.ready?V(xe):(xe.addHandler("ready",function(){V(xe)}),xe.addHandler("open-failed",function(we){Q({message:we.message,source:De})}))}setTimeout(function(){if(n.type(O)==="string")O=new n.TileSource({url:O,crossOriginPolicy:k.crossOriginPolicy!==void 0?k.crossOriginPolicy:w.crossOriginPolicy,ajaxWithCredentials:w.ajaxWithCredentials,ajaxHeaders:k.ajaxHeaders?k.ajaxHeaders:w.ajaxHeaders,splitHashDataForPost:w.splitHashDataForPost,success:function(Ke){V(Ke.tileSource)}}),O.addHandler("open-failed",function(Ke){Q(Ke)});else if(n.isPlainObject(O)||O.nodeType)if(O.crossOriginPolicy===void 0&&(k.crossOriginPolicy!==void 0||w.crossOriginPolicy!==void 0)&&(O.crossOriginPolicy=k.crossOriginPolicy!==void 0?k.crossOriginPolicy:w.crossOriginPolicy),O.ajaxWithCredentials===void 0&&(O.ajaxWithCredentials=w.ajaxWithCredentials),n.isFunction(O.getTileUrl)){var xe=new n.TileSource(O);xe.getTileUrl=O.getTileUrl,V(xe)}else{var De=n.TileSource.determineType(le,O);if(!De){Q({message:"Unable to load TileSource",source:O});return}var we=De.prototype.configure.apply(le,[O]);me(new De(we),O)}else me(O,O)})}function s(w,O){if(O instanceof n.Overlay)return O;var k=null;if(O.element)k=n.getElement(O.element);else{var V=O.id?O.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);k=n.getElement(O.id),k||(k=document.createElement("a"),k.href="#/overlay/"+V),k.id=V,n.addClass(k,O.className?O.className:"openseadragon-overlay")}var Q=O.location,le=O.width,G=O.height;if(!Q){var me=O.x,xe=O.y;if(O.px!==void 0){var De=w.viewport.imageToViewportRectangle(new n.Rect(O.px,O.py,le||0,G||0));me=De.x,xe=De.y,le=le!==void 0?De.width:void 0,G=G!==void 0?De.height:void 0}Q=new n.Point(me,xe)}var we=O.placement;return we&&n.type(we)==="string"&&(we=n.Placement[O.placement.toUpperCase()]),new n.Overlay({element:k,location:Q,placement:we,onDraw:O.onDraw,checkResize:O.checkResize,width:le,height:G,rotationMode:O.rotationMode})}function l(w,O){var k;for(k=w.length-1;k>=0;k--)if(w[k].element===O)return k;return-1}function u(w,O){return n.requestAnimationFrame(function(){O(w)})}function c(w){n.requestAnimationFrame(function(){f(w)})}function d(w){w.autoHideControls&&(w.controlsShouldFade=!0,w.controlsFadeBeginTime=n.now()+w.controlsFadeDelay,window.setTimeout(function(){c(w)},w.controlsFadeDelay))}function f(w){var O,k,V,Q;if(w.controlsShouldFade){for(O=n.now(),k=O-w.controlsFadeBeginTime,V=1-k/w.controlsFadeLength,V=Math.min(1,V),V=Math.max(0,V),Q=w.controls.length-1;Q>=0;Q--)w.controls[Q].autoFade&&w.controls[Q].setOpacity(V);V>0&&c(w)}}function h(w){var O;for(w.controlsShouldFade=!1,O=w.controls.length-1;O>=0;O--)w.controls[O].setOpacity(1)}function g(){h(this)}function p(){d(this)}function v(w){var O={tracker:w.eventSource,position:w.position,originalEvent:w.originalEvent,preventDefault:w.preventDefault};this.raiseEvent("canvas-contextmenu",O),w.preventDefault=O.preventDefault}function m(w){var O={originalEvent:w.originalEvent,preventDefaultAction:!1,preventVerticalPan:w.preventVerticalPan||!this.panVertical,preventHorizontalPan:w.preventHorizontalPan||!this.panHorizontal};if(this.raiseEvent("canvas-key",O),!O.preventDefaultAction&&!w.ctrl&&!w.alt&&!w.meta)switch(w.keyCode){case 38:O.preventVerticalPan||(w.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 40:O.preventVerticalPan||(w.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 37:O.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 39:O.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 187:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 189:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 87:O.preventVerticalPan||(w.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,-40))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 83:O.preventVerticalPan||(w.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(0,40))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 65:O.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(-40,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 68:O.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new n.Point(40,0))),this.viewport.applyConstraints()),w.preventDefault=!0;break;case 82:w.shift?this.viewport.flipped?this.viewport.setRotation(this.viewport.getRotation()+this.rotationIncrement):this.viewport.setRotation(this.viewport.getRotation()-this.rotationIncrement):this.viewport.flipped?this.viewport.setRotation(this.viewport.getRotation()-this.rotationIncrement):this.viewport.setRotation(this.viewport.getRotation()+this.rotationIncrement),this.viewport.applyConstraints(),w.preventDefault=!0;break;case 70:this.viewport.toggleFlip(),w.preventDefault=!0;break;case 74:this.goToPreviousPage();break;case 75:this.goToNextPage();break;default:w.preventDefault=!1;break}else w.preventDefault=!1}function y(w){var O={originalEvent:w.originalEvent};this.raiseEvent("canvas-key-press",O)}function E(w){var O,k=document.activeElement===this.canvas;k||this.canvas.focus(),this.viewport.flipped&&(w.position.x=this.viewport.getContainerSize().x-w.position.x);var V={tracker:w.eventSource,position:w.position,quick:w.quick,shift:w.shift,originalEvent:w.originalEvent,originalTarget:w.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",V),!V.preventDefaultAction&&this.viewport&&w.quick&&(O=this.gestureSettingsByDeviceType(w.pointerType),O.clickToZoom===!0&&(this.viewport.zoomBy(w.shift?1/this.zoomPerClick:this.zoomPerClick,O.zoomToRefPoint?this.viewport.pointFromPixel(w.position,!0):null),this.viewport.applyConstraints()),O.dblClickDragToZoom&&(r[this.hash].draggingToZoom===!0?(r[this.hash].lastClickTime=null,r[this.hash].draggingToZoom=!1):r[this.hash].lastClickTime=n.now()))}function b(w){var O,k={tracker:w.eventSource,position:w.position,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",k),!k.preventDefaultAction&&this.viewport&&(O=this.gestureSettingsByDeviceType(w.pointerType),O.dblClickToZoom&&(this.viewport.zoomBy(w.shift?1/this.zoomPerClick:this.zoomPerClick,O.zoomToRefPoint?this.viewport.pointFromPixel(w.position,!0):null),this.viewport.applyConstraints()))}function R(w){var O,k={tracker:w.eventSource,pointerType:w.pointerType,position:w.position,delta:w.delta,speed:w.speed,direction:w.direction,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",k),O=this.gestureSettingsByDeviceType(w.pointerType),!k.preventDefaultAction&&this.viewport){if(O.dblClickDragToZoom&&r[this.hash].draggingToZoom){var V=Math.pow(this.zoomPerDblClickDrag,w.delta.y/50);this.viewport.zoomBy(V)}else if(O.dragToPan&&!r[this.hash].draggingToZoom){if(this.panHorizontal||(w.delta.x=0),this.panVertical||(w.delta.y=0),this.viewport.flipped&&(w.delta.x=-w.delta.x),this.constrainDuringPan){var Q=this.viewport.deltaPointsFromPixels(w.delta.negate());this.viewport.centerSpringX.target.value+=Q.x,this.viewport.centerSpringY.target.value+=Q.y;var le=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=Q.x,this.viewport.centerSpringY.target.value-=Q.y,le.xConstrained&&(w.delta.x=0),le.yConstrained&&(w.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(w.delta.negate()),O.flickEnabled&&!this.constrainDuringPan)}}}function M(w){var O,k={tracker:w.eventSource,pointerType:w.pointerType,position:w.position,speed:w.speed,direction:w.direction,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",k),O=this.gestureSettingsByDeviceType(w.pointerType),!k.preventDefaultAction&&this.viewport){if(!r[this.hash].draggingToZoom&&O.dragToPan&&O.flickEnabled&&w.speed>=O.flickMinSpeed){var V=0;this.panHorizontal&&(V=O.flickMomentum*w.speed*Math.cos(w.direction));var Q=0;this.panVertical&&(Q=O.flickMomentum*w.speed*Math.sin(w.direction));var le=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),G=this.viewport.pointFromPixel(new n.Point(le.x-V,le.y-Q));this.viewport.panTo(G,!1)}this.viewport.applyConstraints()}O.dblClickDragToZoom&&r[this.hash].draggingToZoom===!0&&(r[this.hash].draggingToZoom=!1)}function C(w){this.raiseEvent("canvas-enter",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function D(w){this.raiseEvent("canvas-exit",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function F(w){var O;if(this.raiseEvent("canvas-press",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,insideElementPressed:w.insideElementPressed,insideElementReleased:w.insideElementReleased,originalEvent:w.originalEvent}),O=this.gestureSettingsByDeviceType(w.pointerType),O.dblClickDragToZoom){var k=r[this.hash].lastClickTime,V=n.now();if(k===null)return;V-k<this.dblClickTimeThreshold&&(r[this.hash].draggingToZoom=!0),r[this.hash].lastClickTime=null}}function L(w){this.raiseEvent("canvas-release",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,insideElementPressed:w.insideElementPressed,insideElementReleased:w.insideElementReleased,originalEvent:w.originalEvent})}function B(w){this.raiseEvent("canvas-nonprimary-press",{tracker:w.eventSource,position:w.position,pointerType:w.pointerType,button:w.button,buttons:w.buttons,originalEvent:w.originalEvent})}function z(w){this.raiseEvent("canvas-nonprimary-release",{tracker:w.eventSource,position:w.position,pointerType:w.pointerType,button:w.button,buttons:w.buttons,originalEvent:w.originalEvent})}function $(w){var O,k,V,Q,le={tracker:w.eventSource,pointerType:w.pointerType,gesturePoints:w.gesturePoints,lastCenter:w.lastCenter,center:w.center,lastDistance:w.lastDistance,distance:w.distance,shift:w.shift,originalEvent:w.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",le),this.viewport&&(O=this.gestureSettingsByDeviceType(w.pointerType),O.pinchToZoom&&(!le.preventDefaultPanAction||!le.preventDefaultZoomAction)&&(k=this.viewport.pointFromPixel(w.center,!0),O.zoomToRefPoint&&!le.preventDefaultPanAction&&(V=this.viewport.pointFromPixel(w.lastCenter,!0),Q=V.minus(k),this.panHorizontal||(Q.x=0),this.panVertical||(Q.y=0),this.viewport.panBy(Q,!0)),le.preventDefaultZoomAction||this.viewport.zoomBy(w.distance/w.lastDistance,k,!0),this.viewport.applyConstraints()),O.pinchRotate&&!le.preventDefaultRotateAction)){var G=Math.atan2(w.gesturePoints[0].currentPos.y-w.gesturePoints[1].currentPos.y,w.gesturePoints[0].currentPos.x-w.gesturePoints[1].currentPos.x),me=Math.atan2(w.gesturePoints[0].lastPos.y-w.gesturePoints[1].lastPos.y,w.gesturePoints[0].lastPos.x-w.gesturePoints[1].lastPos.x);k=this.viewport.pointFromPixel(w.center,!0),this.viewport.rotateTo(this.viewport.getRotation(!0)+(G-me)*(180/Math.PI),k,!0)}}function de(w){this.raiseEvent("canvas-focus",{tracker:w.eventSource,originalEvent:w.originalEvent})}function X(w){this.raiseEvent("canvas-blur",{tracker:w.eventSource,originalEvent:w.originalEvent})}function re(w){var O,k,V,Q,le;Q=n.now(),le=Q-this._lastScrollTime,le>this.minScrollDeltaTime?(this._lastScrollTime=Q,O={tracker:w.eventSource,position:w.position,scroll:w.scroll,shift:w.shift,originalEvent:w.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",O),!O.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(w.position.x=this.viewport.getContainerSize().x-w.position.x),k=this.gestureSettingsByDeviceType(w.pointerType),k.scrollToZoom&&(V=Math.pow(this.zoomPerScroll,w.scroll),this.viewport.zoomBy(V,k.zoomToRefPoint?this.viewport.pointFromPixel(w.position,!0):null),this.viewport.applyConstraints())),w.preventDefault=O.preventDefault):w.preventDefault=!0}function fe(w){r[this.hash].mouseInside=!0,h(this),this.raiseEvent("container-enter",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function H(w){w.pointers<1&&(r[this.hash].mouseInside=!1,r[this.hash].animating||d(this)),this.raiseEvent("container-exit",{tracker:w.eventSource,pointerType:w.pointerType,position:w.position,buttons:w.buttons,pointers:w.pointers,insideElementPressed:w.insideElementPressed,buttonDownAny:w.buttonDownAny,originalEvent:w.originalEvent})}function Y(w){Te(w),w.isOpen()?w._updateRequestId=u(w,Y):w._updateRequestId=!1}function ae(w,O){var k=w.viewport,V=k.getZoom(),Q=k.getCenter();k.resize(O,w.preserveImageSizeOnResize),k.panTo(Q,!0);var le;if(w.preserveImageSizeOnResize)le=r[w.hash].prevContainerSize.x/O.x;else{var G=new n.Point(0,0),me=new n.Point(r[w.hash].prevContainerSize.x,r[w.hash].prevContainerSize.y).distanceTo(G),xe=new n.Point(O.x,O.y).distanceTo(G);le=xe/me*r[w.hash].prevContainerSize.x/O.x}k.zoomTo(V*le,null,!0),r[w.hash].prevContainerSize=O,r[w.hash].forceRedraw=!0,r[w.hash].needsResize=!1,r[w.hash].forceResize=!1}function Te(w){if(!(w._opening||!r[w.hash])){if(w.autoResize||r[w.hash].forceResize){var O;if(w._autoResizePolling){O=o(w.container);var k=r[w.hash].prevContainerSize;O.equals(k)||(r[w.hash].needsResize=!0)}r[w.hash].needsResize&&ae(w,O||o(w.container))}var V=w.viewport.update(),Q=w.world.update(V)||V;V&&w.raiseEvent("viewport-change"),w.referenceStrip&&(Q=w.referenceStrip.update(w.viewport)||Q);var le=r[w.hash].animating;!le&&Q&&(w.raiseEvent("animation-start"),h(w));var G=le&&!Q;G&&(r[w.hash].animating=!1),(Q||G||r[w.hash].forceRedraw||w.world.needsDraw())&&(Se(w),w._drawOverlays(),w.navigator&&w.navigator.update(w.viewport),r[w.hash].forceRedraw=!1,Q&&w.raiseEvent("animation")),G&&(w.raiseEvent("animation-finish"),r[w.hash].mouseInside||d(w)),r[w.hash].animating=Q}}function Se(w){w.imageLoader.clear(),w.world.draw(),w.raiseEvent("update-viewport",{})}function oe(w,O){return w?w+O:O}function be(){r[this.hash].lastZoomTime=n.now(),r[this.hash].zoomFactor=this.zoomPerSecond,r[this.hash].zooming=!0,ee(this)}function te(){r[this.hash].lastZoomTime=n.now(),r[this.hash].zoomFactor=1/this.zoomPerSecond,r[this.hash].zooming=!0,ee(this)}function q(){r[this.hash].zooming=!1}function ee(w){n.requestAnimationFrame(n.delegate(w,se))}function se(){var w,O,k;r[this.hash].zooming&&this.viewport&&(w=n.now(),O=w-r[this.hash].lastZoomTime,k=Math.pow(r[this.hash].zoomFactor,O/1e3),this.viewport.zoomBy(k),this.viewport.applyConstraints(),r[this.hash].lastZoomTime=w,ee(this))}function ce(){this.viewport&&(r[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function Be(){this.viewport&&(r[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function qe(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function Ae(){this.viewport&&this.viewport.goHome()}function Ze(){this.isFullPage()&&!n.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function Vn(){if(this.viewport){var w=this.viewport.getRotation();this.viewport.flipped?w+=this.rotationIncrement:w-=this.rotationIncrement,this.viewport.setRotation(w)}}function xt(){if(this.viewport){var w=this.viewport.getRotation();this.viewport.flipped?w-=this.rotationIncrement:w+=this.rotationIncrement,this.viewport.setRotation(w)}}function Sn(){this.viewport.toggleFlip()}n.determineDrawer=function(w){for(let O in t){const k=t[O],V=k.prototype;if(V&&V instanceof t.DrawerBase&&n.isFunction(V.getType)&&V.getType.call(k)===w)return k}return null}}(t),function(n){n.Navigator=function(u){var c=u.viewer,d=this,f,h;u.element||u.id?(u.element?(u.id&&n.console.warn("Given option.id for Navigator was ignored since option.element was provided and is being used instead."),u.element.id?u.id=u.element.id:u.id="navigator-"+n.now(),this.element=u.element):this.element=document.getElementById(u.id),u.controlOptions={anchor:n.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(u.id="navigator-"+n.now(),this.element=n.makeNeutralElement("div"),u.controlOptions={anchor:n.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:u.autoFade},u.position&&(u.position==="BOTTOM_RIGHT"?u.controlOptions.anchor=n.ControlAnchor.BOTTOM_RIGHT:u.position==="BOTTOM_LEFT"?u.controlOptions.anchor=n.ControlAnchor.BOTTOM_LEFT:u.position==="TOP_RIGHT"?u.controlOptions.anchor=n.ControlAnchor.TOP_RIGHT:u.position==="TOP_LEFT"?u.controlOptions.anchor=n.ControlAnchor.TOP_LEFT:u.position==="ABSOLUTE"&&(u.controlOptions.anchor=n.ControlAnchor.ABSOLUTE,u.controlOptions.top=u.top,u.controlOptions.left=u.left,u.controlOptions.height=u.height,u.controlOptions.width=u.width))),this.element.id=u.id,this.element.className+=" navigator",u=n.extend(!0,{sizeRatio:n.DEFAULT_SETTINGS.navigatorSizeRatio},u,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:u.animationTime,autoResize:!1,minZoomImageRatio:1,background:u.background,opacity:u.opacity,borderColor:u.borderColor,displayRegionColor:u.displayRegionColor}),u.minPixelRatio=this.minPixelRatio=c.minPixelRatio,n.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new n.Point(1,1),this.totalBorderWidths=new n.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),u.controlOptions.anchor!==n.ControlAnchor.NONE&&function(v,m){v.margin="0px",v.border=m+"px solid "+u.borderColor,v.padding="0px",v.background=u.background,v.opacity=u.opacity,v.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=n.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(v,m){v.position="relative",v.top="0px",v.left="0px",v.fontSize="0px",v.overflow="hidden",v.border=m+"px solid "+u.displayRegionColor,v.margin="0px",v.padding="0px",v.background="transparent",v.float="left",v.cssFloat="left",v.zIndex=999999999,v.cursor="default",v.boxSizing="content-box"}(this.displayRegion.style,this.borderWidth),n.setElementPointerEventsNone(this.displayRegion),n.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=n.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",n.setElementPointerEventsNone(this.displayRegionContainer),n.setElementTouchActionNone(this.displayRegionContainer),c.addControl(this.element,u.controlOptions),this._resizeWithViewer=u.controlOptions.anchor!==n.ControlAnchor.ABSOLUTE&&u.controlOptions.anchor!==n.ControlAnchor.NONE,u.width&&u.height?(this.setWidth(u.width),this.setHeight(u.height)):this._resizeWithViewer&&(f=n.getElementSize(c.element),this.element.style.height=Math.round(f.y*u.sizeRatio)+"px",this.element.style.width=Math.round(f.x*u.sizeRatio)+"px",this.oldViewerSize=f,h=n.getElementSize(this.element),this.elementArea=h.x*h.y),this.oldContainerSize=new n.Point(0,0),n.Viewer.apply(this,[u]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function g(v,m){s(d.displayRegionContainer,v),s(d.displayRegion,-v),d.viewport.setRotation(v,m)}if(u.navigatorRotate){var p=u.viewer.viewport?u.viewer.viewport.getRotation():u.viewer.degrees||0;g(p,!0),u.viewer.addHandler("rotate",function(v){g(v.degrees,v.immediately)})}this.innerTracker.destroy(),this.innerTracker=new n.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:n.delegate(this,i),clickHandler:n.delegate(this,r),releaseHandler:n.delegate(this,o),scrollHandler:n.delegate(this,a),preProcessEventHandler:function(v){v.eventType==="wheel"&&(v.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",n.setElementPointerEventsNone(this.canvas),n.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){d.viewport&&d.viewport.goHome(!0)}),c.world.addHandler("item-index-change",function(v){window.setTimeout(function(){var m=d.world.getItemAt(v.previousIndex);d.world.setItemIndex(m,v.newIndex)},1)}),c.world.addHandler("remove-item",function(v){var m=v.item,y=d._getMatchingItem(m);y&&d.world.removeItem(y)}),this.update(c.viewport)},n.extend(n.Navigator.prototype,n.EventSource.prototype,n.Viewer.prototype,{updateSize:function(){if(this.viewport){var u=new n.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);u.equals(this.oldContainerSize)||(this.viewport.resize(u,!0),this.viewport.goHome(!0),this.oldContainerSize=u,this.world.update(),this.world.draw(),this.update(this.viewer.viewport))}},setWidth:function(u){this.width=u,this.element.style.width=typeof u=="number"?u+"px":u,this._resizeWithViewer=!1,this.updateSize()},setHeight:function(u){this.height=u,this.element.style.height=typeof u=="number"?u+"px":u,this._resizeWithViewer=!1,this.updateSize()},setFlip:function(u){return this.viewport.setFlip(u),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(u){l(this.canvas,u),l(this.element,u)},update:function(u){var c,d,f,h,g,p;if(u||(u=this.viewer.viewport),c=n.getElementSize(this.viewer.element),this._resizeWithViewer&&c.x&&c.y&&!c.equals(this.oldViewerSize)&&(this.oldViewerSize=c,this.maintainSizeRatio||!this.elementArea?(d=c.x*this.sizeRatio,f=c.y*this.sizeRatio):(d=Math.sqrt(this.elementArea*(c.x/c.y)),f=this.elementArea/d),this.element.style.width=Math.round(d)+"px",this.element.style.height=Math.round(f)+"px",this.elementArea||(this.elementArea=d*f),this.updateSize()),u&&this.viewport){if(h=u.getBoundsNoRotate(!0),g=this.viewport.pixelFromPointNoRotate(h.getTopLeft(),!1),p=this.viewport.pixelFromPointNoRotate(h.getBottomRight(),!1).minus(this.totalBorderWidths),!this.navigatorRotate){var v=u.getRotation(!0);s(this.displayRegion,-v)}var m=this.displayRegion.style;m.display=this.world.getItemCount()?"block":"none",m.top=g.y.toFixed(2)+"px",m.left=g.x.toFixed(2)+"px";var y=p.x-g.x,E=p.y-g.y;m.width=Math.round(Math.max(y,0))+"px",m.height=Math.round(Math.max(E,0))+"px"}},addTiledImage:function(u){var c=this,d=u.originalTiledImage;delete u.original;var f=n.extend({},u,{success:function(h){var g=h.item;g._originalForNavigator=d,c._matchBounds(g,d,!0),c._matchOpacity(g,d),c._matchCompositeOperation(g,d);function p(){c._matchBounds(g,d)}function v(){c._matchOpacity(g,d)}function m(){c._matchCompositeOperation(g,d)}d.addHandler("bounds-change",p),d.addHandler("clip-change",p),d.addHandler("opacity-change",v),d.addHandler("composite-operation-change",m)}});return n.Viewer.prototype.addTiledImage.apply(this,[f])},destroy:function(){return n.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(u){for(var c=this.world.getItemCount(),d,f=0;f<c;f++)if(d=this.world.getItemAt(f),d._originalForNavigator===u)return d;return null},_matchBounds:function(u,c,d){var f=c.getBoundsNoRotate();u.setPosition(f.getTopLeft(),d),u.setWidth(f.width,d),u.setRotation(c.getRotation(),d),u.setClip(c.getClip()),u.setFlip(c.getFlip())},_matchOpacity:function(u,c){u.setOpacity(c.opacity)},_matchCompositeOperation:function(u,c){u.setCompositeOperation(c.compositeOperation)}});function r(u){var c={tracker:u.eventSource,position:u.position,quick:u.quick,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};if(this.viewer.raiseEvent("navigator-click",c),!c.preventDefaultAction&&u.quick&&this.viewer.viewport&&(this.panVertical||this.panHorizontal)){this.viewer.viewport.flipped&&(u.position.x=this.viewport.getContainerSize().x-u.position.x);var d=this.viewport.pointFromPixel(u.position);this.panVertical?this.panHorizontal||(d.x=this.viewer.viewport.getCenter(!0).x):d.y=this.viewer.viewport.getCenter(!0).y,this.viewer.viewport.panTo(d),this.viewer.viewport.applyConstraints()}}function i(u){var c={tracker:u.eventSource,position:u.position,delta:u.delta,speed:u.speed,direction:u.direction,shift:u.shift,originalEvent:u.originalEvent,preventDefaultAction:!1};this.viewer.raiseEvent("navigator-drag",c),!c.preventDefaultAction&&this.viewer.viewport&&(this.panHorizontal||(u.delta.x=0),this.panVertical||(u.delta.y=0),this.viewer.viewport.flipped&&(u.delta.x=-u.delta.x),this.viewer.viewport.panBy(this.viewport.deltaPointsFromPixels(u.delta)),this.viewer.constrainDuringPan&&this.viewer.viewport.applyConstraints())}function o(u){u.insideElementPressed&&this.viewer.viewport&&this.viewer.viewport.applyConstraints()}function a(u){var c={tracker:u.eventSource,position:u.position,scroll:u.scroll,shift:u.shift,originalEvent:u.originalEvent,preventDefault:u.preventDefault};this.viewer.raiseEvent("navigator-scroll",c),u.preventDefault=c.preventDefault}function s(u,c){l(u,"rotate("+c+"deg)")}function l(u,c){u.style.webkitTransform=c,u.style.mozTransform=c,u.style.msTransform=c,u.style.oTransform=c,u.style.transform=c}}(t),function(n){var r={Errors:{Dzc:"Sorry, we don't support Deep Zoom Collections!",Dzi:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",Xml:"Hmm, this doesn't appear to be a valid Deep Zoom Image.",ImageFormat:"Sorry, we don't support {0}-based Deep Zoom Images.",Security:"It looks like a security restriction stopped us from loading this Deep Zoom Image.",Status:"This space unintentionally left blank ({0} {1}).",OpenFailed:"Unable to open {0}: {1}"},Tooltips:{FullPage:"Toggle full page",Home:"Go home",ZoomIn:"Zoom in",ZoomOut:"Zoom out",NextPage:"Next page",PreviousPage:"Previous page",RotateLeft:"Rotate left",RotateRight:"Rotate right",Flip:"Flip Horizontally"}};n.extend(n,{getString:function(i){var o=i.split("."),a=null,s=arguments,l=r,u;for(u=0;u<o.length-1;u++)l=l[o[u]]||{};return a=l[o[u]],typeof a!="string"&&(n.console.error("Untranslated source string:",i),a=""),a.replace(/\{\d+\}/g,function(c){var d=parseInt(c.match(/\d+/),10)+1;return d<s.length?s[d]:""})},setString:function(i,o){var a=i.split("."),s=r,l;for(l=0;l<a.length-1;l++)s[a[l]]||(s[a[l]]={}),s=s[a[l]];s[a[l]]=o}})}(t),function(n){n.Point=function(r,i){this.x=typeof r=="number"?r:0,this.y=typeof i=="number"?i:0},n.Point.prototype={clone:function(){return new n.Point(this.x,this.y)},plus:function(r){return new n.Point(this.x+r.x,this.y+r.y)},minus:function(r){return new n.Point(this.x-r.x,this.y-r.y)},times:function(r){return new n.Point(this.x*r,this.y*r)},divide:function(r){return new n.Point(this.x/r,this.y/r)},negate:function(){return new n.Point(-this.x,-this.y)},distanceTo:function(r){return Math.sqrt(Math.pow(this.x-r.x,2)+Math.pow(this.y-r.y,2))},squaredDistanceTo:function(r){return Math.pow(this.x-r.x,2)+Math.pow(this.y-r.y,2)},apply:function(r){return new n.Point(r(this.x),r(this.y))},equals:function(r){return r instanceof n.Point&&this.x===r.x&&this.y===r.y},rotate:function(r,i){i=i||new n.Point(0,0);var o,a;if(r%90===0){var s=n.positiveModulo(r,360);switch(s){case 0:o=1,a=0;break;case 90:o=0,a=1;break;case 180:o=-1,a=0;break;case 270:o=0,a=-1;break}}else{var l=r*Math.PI/180;o=Math.cos(l),a=Math.sin(l)}var u=o*(this.x-i.x)-a*(this.y-i.y)+i.x,c=a*(this.x-i.x)+o*(this.y-i.y)+i.y;return new n.Point(u,c)},toString:function(){return"("+Math.round(this.x*100)/100+","+Math.round(this.y*100)/100+")"}}}(t),function(n){n.TileSource=function(i,o,a,s,l,u){var c=this,d=arguments,f,h;if(n.isPlainObject(i)?f=i:f={width:d[0],height:d[1],tileSize:d[2],tileOverlap:d[3],minLevel:d[4],maxLevel:d[5]},n.EventSource.call(this),n.extend(!0,this,f),!this.success){for(h=0;h<arguments.length;h++)if(n.isFunction(arguments[h])){this.success=arguments[h];break}}this.success&&this.addHandler("ready",function(g){c.success(g)}),n.type(arguments[0])==="string"&&(this.url=arguments[0]),this.url?(this.aspectRatio=1,this.dimensions=new n.Point(10,10),this._tileWidth=0,this._tileHeight=0,this.tileOverlap=0,this.minLevel=0,this.maxLevel=0,this.ready=!1,this.getImageInfo(this.url)):(this.ready=!0,this.aspectRatio=f.width&&f.height?f.width/f.height:1,this.dimensions=new n.Point(f.width,f.height),this.tileSize?(this._tileWidth=this._tileHeight=this.tileSize,delete this.tileSize):(this.tileWidth?(this._tileWidth=this.tileWidth,delete this.tileWidth):this._tileWidth=0,this.tileHeight?(this._tileHeight=this.tileHeight,delete this.tileHeight):this._tileHeight=0),this.tileOverlap=f.tileOverlap?f.tileOverlap:0,this.minLevel=f.minLevel?f.minLevel:0,this.maxLevel=f.maxLevel!==void 0&&f.maxLevel!==null?f.maxLevel:f.width&&f.height?Math.ceil(Math.log(Math.max(f.width,f.height))/Math.log(2)):0,this.success&&n.isFunction(this.success)&&this.success(this))},n.TileSource.prototype={getTileSize:function(i){return n.console.error("[TileSource.getTileSize] is deprecated. Use TileSource.getTileWidth() and TileSource.getTileHeight() instead"),this._tileWidth},getTileWidth:function(i){return this._tileWidth?this._tileWidth:this.getTileSize(i)},getTileHeight:function(i){return this._tileHeight?this._tileHeight:this.getTileSize(i)},setMaxLevel:function(i){this.maxLevel=i,this._memoizeLevelScale()},getLevelScale:function(i){return this._memoizeLevelScale(),this.getLevelScale(i)},_memoizeLevelScale:function(){var i={},o;for(o=0;o<=this.maxLevel;o++)i[o]=1/Math.pow(2,this.maxLevel-o);this.getLevelScale=function(a){return i[a]}},getNumTiles:function(i){var o=this.getLevelScale(i),a=Math.ceil(o*this.dimensions.x/this.getTileWidth(i)),s=Math.ceil(o*this.dimensions.y/this.getTileHeight(i));return new n.Point(a,s)},getPixelRatio:function(i){var o=this.dimensions.times(this.getLevelScale(i)),a=1/o.x*n.pixelDensityRatio,s=1/o.y*n.pixelDensityRatio;return new n.Point(a,s)},getClosestLevel:function(){var i,o;for(i=this.minLevel+1;i<=this.maxLevel&&(o=this.getNumTiles(i),!(o.x>1||o.y>1));i++);return i-1},getTileAtPoint:function(i,o){var a=o.x>=0&&o.x<=1&&o.y>=0&&o.y<=1/this.aspectRatio;n.console.assert(a,"[TileSource.getTileAtPoint] must be called with a valid point.");var s=this.dimensions.x*this.getLevelScale(i),l=o.x*s,u=o.y*s,c=Math.floor(l/this.getTileWidth(i)),d=Math.floor(u/this.getTileHeight(i));o.x>=1&&(c=this.getNumTiles(i).x-1);var f=1e-15;return o.y>=1/this.aspectRatio-f&&(d=this.getNumTiles(i).y-1),new n.Point(c,d)},getTileBounds:function(i,o,a,s){var l=this.dimensions.times(this.getLevelScale(i)),u=this.getTileWidth(i),c=this.getTileHeight(i),d=o===0?0:u*o-this.tileOverlap,f=a===0?0:c*a-this.tileOverlap,h=u+(o===0?1:2)*this.tileOverlap,g=c+(a===0?1:2)*this.tileOverlap,p=1/l.x;return h=Math.min(h,l.x-d),g=Math.min(g,l.y-f),s?new n.Rect(0,0,h,g):new n.Rect(d*p,f*p,h*p,g*p)},getImageInfo:function(i){var o=this,a,s,l,u,c,d,f;i&&(c=i.split("/"),d=c[c.length-1],f=d.lastIndexOf("."),f>-1&&(c[c.length-1]=d.slice(0,f)));var h=null;if(this.splitHashDataForPost){var g=i.indexOf("#");g!==-1&&(h=i.substring(g+1),i=i.substr(0,g))}s=function(p){typeof p=="string"&&(p=n.parseXml(p));var v=n.TileSource.determineType(o,p,i);if(!v){o.raiseEvent("open-failed",{message:"Unable to load TileSource",source:i});return}u=v.prototype.configure.apply(o,[p,i,h]),u.ajaxWithCredentials===void 0&&(u.ajaxWithCredentials=o.ajaxWithCredentials),l=new v(u),o.ready=!0,o.raiseEvent("ready",{tileSource:l})},i.match(/\.js$/)?(a=i.split("/").pop().replace(".js",""),n.jsonp({url:i,async:!1,callbackName:a,callback:s})):n.makeAjaxRequest({url:i,postData:h,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(p){var v=r(p);s(v)},error:function(p,v){var m;try{m="HTTP "+p.status+" attempting to load TileSource: "+i}catch{var y;typeof v>"u"||!v.toString?y="Unknown error":y=v.toString(),m=y+" attempting to load TileSource: "+i}n.console.error(m),o.raiseEvent("open-failed",{message:m,source:i,postData:h})}})},supports:function(i,o){return!1},configure:function(i,o,a){throw new Error("Method not implemented.")},getTileUrl:function(i,o,a){throw new Error("Method not implemented.")},getTilePostData:function(i,o,a){return null},getTileAjaxHeaders:function(i,o,a){return{}},getTileHashKey:function(i,o,a,s,l,u){function c(d){return l?d+"+"+JSON.stringify(l):d}return c(typeof s!="string"?i+"/"+o+"_"+a:s)},tileExists:function(i,o,a){var s=this.getNumTiles(i);return i>=this.minLevel&&i<=this.maxLevel&&o>=0&&a>=0&&o<s.x&&a<s.y},hasTransparency:function(i,o,a,s){return!!i||o.match(".png")},downloadTileStart:function(i){var o=i.userData,a=new Image;o.image=a,o.request=null;var s=function(l){if(!a){i.finish(null,o.request,"Image load failed: undefined Image instance.");return}a.onload=a.onerror=a.onabort=null,i.finish(l?null:a,o.request,l)};a.onload=function(){s()},a.onabort=a.onerror=function(){s("Image load aborted.")},i.loadWithAjax?o.request=n.makeAjaxRequest({url:i.src,withCredentials:i.ajaxWithCredentials,headers:i.ajaxHeaders,responseType:"arraybuffer",postData:i.postData,success:function(l){var u;try{u=new window.Blob([l.response])}catch(f){var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(f.name==="TypeError"&&c){var d=new c;d.append(l.response),u=d.getBlob()}}u.size===0?s("Empty image response."):a.src=(window.URL||window.webkitURL).createObjectURL(u)},error:function(l){s("Image load aborted - XHR error")}}):(i.crossOriginPolicy!==!1&&(a.crossOrigin=i.crossOriginPolicy),a.src=i.src)},downloadTileAbort:function(i){i.userData.request&&i.userData.request.abort();var o=i.userData.image;i.userData.image&&(o.onload=o.onerror=o.onabort=null)},createTileCache:function(i,o,a){i._data=o},destroyTileCache:function(i){i._data=null,i._renderedContext=null},getTileCacheData:function(i){return i._data},getTileCacheDataAsImage:function(i){return i._data},getTileCacheDataAsContext2D:function(i){if(!i._renderedContext){var o=document.createElement("canvas");o.width=i._data.width,o.height=i._data.height,i._renderedContext=o.getContext("2d"),i._renderedContext.drawImage(i._data,0,0),i._data=null}return i._renderedContext}},n.extend(!0,n.TileSource.prototype,n.EventSource.prototype);function r(i){var o=i.responseText,a=i.status,s,l;if(i){if(i.status!==200&&i.status!==0)throw a=i.status,s=a===404?"Not Found":i.statusText,new Error(n.getString("Errors.Status",a,s))}else throw new Error(n.getString("Errors.Security"));if(o.match(/^\s*<.*/))try{l=i.responseXML&&i.responseXML.documentElement?i.responseXML:n.parseXml(o)}catch{l=i.responseText}else if(o.match(/\s*[{[].*/))try{l=n.parseJSON(o)}catch{l=o}else l=o;return l}n.TileSource.determineType=function(i,o,a){var s;for(s in t)if(s.match(/.+TileSource$/)&&n.isFunction(t[s])&&n.isFunction(t[s].prototype.supports)&&t[s].prototype.supports.call(i,o,a))return t[s];return n.console.error("No TileSource was able to open %s %s",a,o),null}}(t),function(n){n.DziTileSource=function(o,a,s,l,u,c,d,f,h){var g,p,v,m;if(n.isPlainObject(o)?m=o:m={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4],fileFormat:arguments[5],displayRects:arguments[6],minLevel:arguments[7],maxLevel:arguments[8]},this._levelRects={},this.tilesUrl=m.tilesUrl,this.fileFormat=m.fileFormat,this.displayRects=m.displayRects,this.displayRects)for(g=this.displayRects.length-1;g>=0;g--)for(p=this.displayRects[g],v=p.minLevel;v<=p.maxLevel;v++)this._levelRects[v]||(this._levelRects[v]=[]),this._levelRects[v].push(p);n.TileSource.apply(this,[m])},n.extend(n.DziTileSource.prototype,n.TileSource.prototype,{supports:function(o,a){var s;return o.Image?s=o.Image.xmlns:o.documentElement&&(o.documentElement.localName==="Image"||o.documentElement.tagName==="Image")&&(s=o.documentElement.namespaceURI),s=(s||"").toLowerCase(),s.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||s.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(o,a,s){var l;return n.isPlainObject(o)?l=i(this,o):l=r(this,o),a&&!l.tilesUrl&&(l.tilesUrl=a.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),a.search(/\.(dzi|xml|js)\?/)!==-1?l.queryParams=a.match(/\?.*/):l.queryParams=""),l},getTileUrl:function(o,a,s){return[this.tilesUrl,o,"/",a,"_",s,".",this.fileFormat,this.queryParams].join("")},tileExists:function(o,a,s){var l=this._levelRects[o],u,c,d,f,h,g,p;if(this.minLevel&&o<this.minLevel||this.maxLevel&&o>this.maxLevel)return!1;if(!l||!l.length)return!0;for(p=l.length-1;p>=0;p--)if(u=l[p],!(o<u.minLevel||o>u.maxLevel)&&(c=this.getLevelScale(o),d=u.x*c,f=u.y*c,h=d+u.width*c,g=f+u.height*c,d=Math.floor(d/this._tileWidth),f=Math.floor(f/this._tileWidth),h=Math.ceil(h/this._tileWidth),g=Math.ceil(g/this._tileWidth),d<=a&&a<h&&f<=s&&s<g))return!0;return!1}});function r(o,a){if(!a||!a.documentElement)throw new Error(n.getString("Errors.Xml"));var s=a.documentElement,l=s.localName||s.tagName,u=a.documentElement.namespaceURI,c=null,d=[],f,h,g,p,v;if(l==="Image")try{if(p=s.getElementsByTagName("Size")[0],p===void 0&&(p=s.getElementsByTagNameNS(u,"Size")[0]),c={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:s.getAttribute("Url"),Format:s.getAttribute("Format"),DisplayRect:null,Overlap:parseInt(s.getAttribute("Overlap"),10),TileSize:parseInt(s.getAttribute("TileSize"),10),Size:{Height:parseInt(p.getAttribute("Height"),10),Width:parseInt(p.getAttribute("Width"),10)}}},!n.imageFormatSupported(c.Image.Format))throw new Error(n.getString("Errors.ImageFormat",c.Image.Format.toUpperCase()));for(f=s.getElementsByTagName("DisplayRect"),f===void 0&&(f=s.getElementsByTagNameNS(u,"DisplayRect")[0]),v=0;v<f.length;v++)h=f[v],g=h.getElementsByTagName("Rect")[0],g===void 0&&(g=h.getElementsByTagNameNS(u,"Rect")[0]),d.push({Rect:{X:parseInt(g.getAttribute("X"),10),Y:parseInt(g.getAttribute("Y"),10),Width:parseInt(g.getAttribute("Width"),10),Height:parseInt(g.getAttribute("Height"),10),MinLevel:parseInt(h.getAttribute("MinLevel"),10),MaxLevel:parseInt(h.getAttribute("MaxLevel"),10)}});return d.length&&(c.Image.DisplayRect=d),i(o,c)}catch(E){throw E instanceof Error?E:new Error(n.getString("Errors.Dzi"))}else{if(l==="Collection")throw new Error(n.getString("Errors.Dzc"));if(l==="Error"){var m=s.getElementsByTagName("Message")[0],y=m.firstChild.nodeValue;throw new Error(y)}}throw new Error(n.getString("Errors.Dzi"))}function i(o,a){var s=a.Image,l=s.Url,u=s.Format,c=s.Size,d=s.DisplayRect||[],f=parseInt(c.Width,10),h=parseInt(c.Height,10),g=parseInt(s.TileSize,10),p=parseInt(s.Overlap,10),v=[],m,y;for(y=0;y<d.length;y++)m=d[y].Rect,v.push(new n.DisplayRect(parseInt(m.X,10),parseInt(m.Y,10),parseInt(m.Width,10),parseInt(m.Height,10),parseInt(m.MinLevel,10),parseInt(m.MaxLevel,10)));return n.extend(!0,{width:f,height:h,tileSize:g,tileOverlap:p,minLevel:null,maxLevel:null,tilesUrl:l,fileFormat:u,displayRects:v},a)}}(t),function(n){n.IIIFTileSource=function(s){if(n.extend(!0,this,s),this._id=this["@id"]||this.id||this.identifier||null,!(this.height&&this.width&&this._id))throw new Error("IIIF required parameters (width, height, or id) not provided.");if(s.tileSizePerScaleFactor={},this.tileFormat=this.tileFormat||"jpg",this.version=s.version,this.tile_width&&this.tile_height)s.tileWidth=this.tile_width,s.tileHeight=this.tile_height;else if(this.tile_width)s.tileSize=this.tile_width;else if(this.tile_height)s.tileSize=this.tile_height;else if(this.tiles)if(this.tiles.length===1)s.tileWidth=this.tiles[0].width,s.tileHeight=this.tiles[0].height||this.tiles[0].width,this.scale_factors=this.tiles[0].scaleFactors;else{this.scale_factors=[];for(var l=0;l<this.tiles.length;l++)for(var u=0;u<this.tiles[l].scaleFactors.length;u++){var c=this.tiles[l].scaleFactors[u];this.scale_factors.push(c),s.tileSizePerScaleFactor[c]={width:this.tiles[l].width,height:this.tiles[l].height||this.tiles[l].width}}}else if(r(s)){for(var d=Math.min(this.height,this.width),f=[256,512,1024],h=[],g=0;g<f.length;g++)f[g]<=d&&h.push(f[g]);h.length>0?s.tileSize=Math.max.apply(null,h):s.tileSize=d}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,s.levels=i(this),n.extend(!0,s,{width:s.levels[s.levels.length-1].width,height:s.levels[s.levels.length-1].height,tileSize:Math.max(s.height,s.width),tileOverlap:0,minLevel:0,maxLevel:s.levels.length-1}),this.levels=s.levels):n.console.error("Nothing in the info.json to construct image pyramids from");if(!s.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)s.maxLevel=Number(Math.round(Math.log(Math.max(this.width,this.height),2)));else{var p=Math.max.apply(null,this.scale_factors);s.maxLevel=Math.round(Math.log(p)*Math.LOG2E)}if(this.sizes){var v=this.sizes.length;(v===s.maxLevel||v===s.maxLevel+1)&&(this.levelSizes=this.sizes.slice().sort((m,y)=>m.width-y.width),v===s.maxLevel&&this.levelSizes.push({width:this.width,height:this.height}))}n.TileSource.apply(this,[s])},n.extend(n.IIIFTileSource.prototype,n.TileSource.prototype,{supports:function(s,l){return s.protocol&&s.protocol==="http://iiif.io/api/image"||s["@context"]&&(s["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||s["@context"]==="http://iiif.io/api/image/1/context.json")||s.profile&&s.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||s.identifier&&s.width&&s.height?!0:!!(s.documentElement&&s.documentElement.tagName==="info"&&s.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(s,l,u){if(n.isPlainObject(s)){if(!s["@context"])s["@context"]="http://iiif.io/api/image/1.0/context.json",s["@id"]=l.replace("/info.json",""),s.version=1;else{var d=s["@context"];if(Array.isArray(d)){for(var f=0;f<d.length;f++)if(typeof d[f]=="string"&&(/^http:\/\/iiif\.io\/api\/image\/[1-3]\/context\.json$/.test(d[f])||d[f]==="http://library.stanford.edu/iiif/image-api/1.1/context.json")){d=d[f];break}}switch(d){case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":s.version=1;break;case"http://iiif.io/api/image/2/context.json":s.version=2;break;case"http://iiif.io/api/image/3/context.json":s.version=3;break;default:n.console.error("Data has a @context property which contains no known IIIF context URI.")}}if(s.preferredFormats){for(var h=0;h<s.preferredFormats.length;h++)if(t.imageFormatSupported(s.preferredFormats[h])){s.tileFormat=s.preferredFormats[h];break}}return s}else{var c=o(s);return c["@context"]="http://iiif.io/api/image/1.0/context.json",c["@id"]=l.replace("/info.xml",""),c.version=1,c}},getTileWidth:function(s){if(this.emulateLegacyImagePyramid)return n.TileSource.prototype.getTileWidth.call(this,s);var l=Math.pow(2,this.maxLevel-s);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[l]?this.tileSizePerScaleFactor[l].width:this._tileWidth},getTileHeight:function(s){if(this.emulateLegacyImagePyramid)return n.TileSource.prototype.getTileHeight.call(this,s);var l=Math.pow(2,this.maxLevel-s);return this.tileSizePerScaleFactor&&this.tileSizePerScaleFactor[l]?this.tileSizePerScaleFactor[l].height:this._tileHeight},getLevelScale:function(s){if(this.emulateLegacyImagePyramid){var l=NaN;return this.levels.length>0&&s>=this.minLevel&&s<=this.maxLevel&&(l=this.levels[s].width/this.levels[this.maxLevel].width),l}return n.TileSource.prototype.getLevelScale.call(this,s)},getNumTiles:function(s){if(this.emulateLegacyImagePyramid){var l=this.getLevelScale(s);return l?new n.Point(1,1):new n.Point(0,0)}if(this.levelSizes){var u=this.levelSizes[s],c=Math.ceil(u.width/this.getTileWidth(s)),d=Math.ceil(u.height/this.getTileHeight(s));return new n.Point(c,d)}else return n.TileSource.prototype.getNumTiles.call(this,s)},getTileAtPoint:function(s,l){if(this.emulateLegacyImagePyramid)return new n.Point(0,0);if(this.levelSizes){var u=l.x>=0&&l.x<=1&&l.y>=0&&l.y<=1/this.aspectRatio;n.console.assert(u,"[TileSource.getTileAtPoint] must be called with a valid point.");var c=this.levelSizes[s].width,d=l.x*c,f=l.y*c,h=Math.floor(d/this.getTileWidth(s)),g=Math.floor(f/this.getTileHeight(s));l.x>=1&&(h=this.getNumTiles(s).x-1);var p=1e-15;return l.y>=1/this.aspectRatio-p&&(g=this.getNumTiles(s).y-1),new n.Point(h,g)}return n.TileSource.prototype.getTileAtPoint.call(this,s,l)},getTileUrl:function(s,l,u){if(this.emulateLegacyImagePyramid){var c=null;return this.levels.length>0&&s>=this.minLevel&&s<=this.maxLevel&&(c=this.levels[s].url),c}var d="0",f=Math.pow(.5,this.maxLevel-s),h,g,p,v,m,y,E,b,R,M,C,D,F,L,B,z;return this.levelSizes?(h=this.levelSizes[s].width,g=this.levelSizes[s].height):(h=Math.ceil(this.width*f),g=Math.ceil(this.height*f)),p=this.getTileWidth(s),v=this.getTileHeight(s),m=Math.round(p/f),y=Math.round(v/f),this.version===1?B="native."+this.tileFormat:B="default."+this.tileFormat,h<p&&g<v?(this.version===2&&h===this.width?D="full":this.version===3&&h===this.width&&g===this.height?D="max":this.version===3?D=h+","+g:D=h+",",E="full"):(b=l*m,R=u*y,M=Math.min(m,this.width-b),C=Math.min(y,this.height-R),l===0&&u===0&&M===this.width&&C===this.height?E="full":E=[b,R,M,C].join(","),F=Math.min(p,h-l*p),L=Math.min(v,g-u*v),this.version===2&&F===this.width?D="full":this.version===3&&F===this.width&&L===this.height?D="max":this.version===3?D=F+","+L:D=F+","),z=[this._id,E,D,d,B].join("/"),z},__testonly__:{canBeTiled:r,constructLevels:i}});function r(s){var l=["http://library.stanford.edu/iiif/image-api/compliance.html#level0","http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0","http://iiif.io/api/image/2/level0.json","level0","https://iiif.io/api/image/3/level0.json"],u=Array.isArray(s.profile)?s.profile[0]:s.profile,c=l.indexOf(u)!==-1,d=!1;return s.version===2&&s.profile.length>1&&s.profile[1].supports&&(d=s.profile[1].supports.indexOf("sizeByW")!==-1),s.version===3&&s.extraFeatures&&(d=s.extraFeatures.indexOf("sizeByWh")!==-1),!c||d}function i(s){for(var l=[],u=0;u<s.sizes.length;u++)l.push({url:s._id+"/full/"+s.sizes[u].width+","+(s.version===3?s.sizes[u].height:"")+"/0/default."+s.tileFormat,width:s.sizes[u].width,height:s.sizes[u].height});return l.sort(function(c,d){return c.width-d.width})}function o(s){if(!s||!s.documentElement)throw new Error(n.getString("Errors.Xml"));var l=s.documentElement,u=l.tagName,c=null;if(u==="info")try{return c={},a(l,c),c}catch(d){throw d instanceof Error?d:new Error(n.getString("Errors.IIIF"))}throw new Error(n.getString("Errors.IIIF"))}function a(s,l,u){var c,d;if(s.nodeType===3&&u)d=s.nodeValue.trim(),d.match(/^\d*$/)&&(d=Number(d)),l[u]?(n.isArray(l[u])||(l[u]=[l[u]]),l[u].push(d)):l[u]=d;else if(s.nodeType===1)for(c=0;c<s.childNodes.length;c++)a(s.childNodes[c],l,s.nodeName)}}(t),function(n){n.OsmTileSource=function(r,i,o,a,s){var l;n.isPlainObject(r)?l=r:l={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]},(!l.width||!l.height)&&(l.width=65572864,l.height=65572864),l.tileSize||(l.tileSize=256,l.tileOverlap=0),l.tilesUrl||(l.tilesUrl="http://tile.openstreetmap.org/"),l.minLevel=8,n.TileSource.apply(this,[l])},n.extend(n.OsmTileSource.prototype,n.TileSource.prototype,{supports:function(r,i){return r.type&&r.type==="openstreetmaps"},configure:function(r,i,o){return r},getTileUrl:function(r,i,o){return this.tilesUrl+(r-8)+"/"+i+"/"+o+".png"}})}(t),function(n){n.TmsTileSource=function(r,i,o,a,s){var l;n.isPlainObject(r)?l=r:l={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]};var u=Math.ceil(l.width/256)*256,c=Math.ceil(l.height/256)*256,d;u>c?d=u/256:d=c/256,l.maxLevel=Math.ceil(Math.log(d)/Math.log(2))-1,l.tileSize=256,l.width=u,l.height=c,n.TileSource.apply(this,[l])},n.extend(n.TmsTileSource.prototype,n.TileSource.prototype,{supports:function(r,i){return r.type&&r.type==="tiledmapservice"},configure:function(r,i,o){return r},getTileUrl:function(r,i,o){var a=this.getNumTiles(r).y-1;return this.tilesUrl+r+"/"+i+"/"+(a-o)+".png"}})}(t),function(n){n.ZoomifyTileSource=function(r){typeof r.tileSize>"u"&&(r.tileSize=256),typeof r.fileFormat>"u"&&(r.fileFormat="jpg",this.fileFormat=r.fileFormat);var i={x:r.width,y:r.height};for(r.imageSizes=[{x:r.width,y:r.height}],r.gridSize=[this._getGridSize(r.width,r.height,r.tileSize)];parseInt(i.x,10)>r.tileSize||parseInt(i.y,10)>r.tileSize;)i.x=Math.floor(i.x/2),i.y=Math.floor(i.y/2),r.imageSizes.push({x:i.x,y:i.y}),r.gridSize.push(this._getGridSize(i.x,i.y,r.tileSize));r.imageSizes.reverse(),r.gridSize.reverse(),r.minLevel=0,r.maxLevel=r.gridSize.length-1,t.TileSource.apply(this,[r])},n.extend(n.ZoomifyTileSource.prototype,n.TileSource.prototype,{_getGridSize:function(r,i,o){return{x:Math.ceil(r/o),y:Math.ceil(i/o)}},_calculateAbsoluteTileNumber:function(r,i,o){for(var a=0,s={},l=0;l<r;l++)s=this.gridSize[l],a+=s.x*s.y;return s=this.gridSize[r],a+=s.x*o+i,a},supports:function(r,i){return r.type&&r.type==="zoomifytileservice"},configure:function(r,i,o){return r},getTileUrl:function(r,i,o){var a=0,s=this._calculateAbsoluteTileNumber(r,i,o);return a=Math.floor(s/256),this.tilesUrl+"TileGroup"+a+"/"+r+"-"+i+"-"+o+"."+this.fileFormat}})}(t),function(n){n.LegacyTileSource=function(a){var s,l,u;n.isArray(a)&&(s={type:"legacy-image-pyramid",levels:a}),s.levels=r(s.levels),s.levels.length>0?(l=s.levels[s.levels.length-1].width,u=s.levels[s.levels.length-1].height):(l=0,u=0,n.console.error("No supported image formats found")),n.extend(!0,s,{width:l,height:u,tileSize:Math.max(u,l),tileOverlap:0,minLevel:0,maxLevel:s.levels.length>0?s.levels.length-1:0}),n.TileSource.apply(this,[s]),this.levels=s.levels},n.extend(n.LegacyTileSource.prototype,n.TileSource.prototype,{supports:function(a,s){return a.type&&a.type==="legacy-image-pyramid"||a.documentElement&&a.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(a,s,l){var u;return n.isPlainObject(a)?u=o(this,a):u=i(this,a),u},getLevelScale:function(a){var s=NaN;return this.levels.length>0&&a>=this.minLevel&&a<=this.maxLevel&&(s=this.levels[a].width/this.levels[this.maxLevel].width),s},getNumTiles:function(a){var s=this.getLevelScale(a);return s?new n.Point(1,1):new n.Point(0,0)},getTileUrl:function(a,s,l){var u=null;return this.levels.length>0&&a>=this.minLevel&&a<=this.maxLevel&&(u=this.levels[a].url),u}});function r(a){var s=[],l,u;for(u=0;u<a.length;u++)l=a[u],l.height&&l.width&&l.url?s.push({url:l.url,width:Number(l.width),height:Number(l.height)}):n.console.error("Unsupported image format: %s",l.url?l.url:"<no URL>");return s.sort(function(c,d){return c.height-d.height})}function i(a,s){if(!s||!s.documentElement)throw new Error(n.getString("Errors.Xml"));var l=s.documentElement,u=l.tagName,c=null,d=[],f,h;if(u==="image")try{for(c={type:l.getAttribute("type"),levels:[]},d=l.getElementsByTagName("level"),h=0;h<d.length;h++)f=d[h],c.levels.push({url:f.getAttribute("url"),width:parseInt(f.getAttribute("width"),10),height:parseInt(f.getAttribute("height"),10)});return o(a,c)}catch(g){throw g instanceof Error?g:new Error("Unknown error parsing Legacy Image Pyramid XML.")}else{if(u==="collection")throw new Error("Legacy Image Pyramid Collections not yet supported.");if(u==="error")throw new Error("Error: "+s)}throw new Error("Unknown element "+u)}function o(a,s){return s.levels}}(t),function(n){n.ImageTileSource=function(r){r=n.extend({buildPyramid:!0,crossOriginPolicy:!1,ajaxWithCredentials:!1},r),n.TileSource.apply(this,[r])},n.extend(n.ImageTileSource.prototype,n.TileSource.prototype,{supports:function(r,i){return r.type&&r.type==="image"},configure:function(r,i,o){return r},getImageInfo:function(r){var i=this._image=new Image,o=this;this.crossOriginPolicy&&(i.crossOrigin=this.crossOriginPolicy),this.ajaxWithCredentials&&(i.useCredentials=this.ajaxWithCredentials),n.addEvent(i,"load",function(){o.width=i.naturalWidth,o.height=i.naturalHeight,o.aspectRatio=o.width/o.height,o.dimensions=new n.Point(o.width,o.height),o._tileWidth=o.width,o._tileHeight=o.height,o.tileOverlap=0,o.minLevel=0,o.levels=o._buildLevels(),o.maxLevel=o.levels.length-1,o.ready=!0,o.raiseEvent("ready",{tileSource:o})}),n.addEvent(i,"error",function(){o.raiseEvent("open-failed",{message:"Error loading image at "+r,source:r})}),i.src=r},getLevelScale:function(r){var i=NaN;return r>=this.minLevel&&r<=this.maxLevel&&(i=this.levels[r].width/this.levels[this.maxLevel].width),i},getNumTiles:function(r){var i=this.getLevelScale(r);return i?new n.Point(1,1):new n.Point(0,0)},getTileUrl:function(r,i,o){var a=null;return r>=this.minLevel&&r<=this.maxLevel&&(a=this.levels[r].url),a},getContext2D:function(r,i,o){var a=null;return r>=this.minLevel&&r<=this.maxLevel&&(a=this.levels[r].context2D),a},destroy:function(r){this._freeupCanvasMemory(r)},_buildLevels:function(){var r=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!n.supportsCanvas)return delete this._image,r;var i=this._image.naturalWidth,o=this._image.naturalHeight,a=document.createElement("canvas"),s=a.getContext("2d");if(a.width=i,a.height=o,s.drawImage(this._image,0,0,i,o),r[0].context2D=s,delete this._image,n.isCanvasTainted(a))return r;for(;i>=2&&o>=2;){i=Math.floor(i/2),o=Math.floor(o/2);var l=document.createElement("canvas"),u=l.getContext("2d");l.width=i,l.height=o,u.drawImage(a,0,0,i,o),r.splice(0,0,{context2D:u,width:i,height:o}),a=l,s=u}return r},_freeupCanvasMemory:function(r){for(var i=0;i<this.levels.length;i++)this.levels[i].context2D&&(this.levels[i].context2D.canvas.height=0,this.levels[i].context2D.canvas.width=0,r&&r.raiseEvent("image-unloaded",{context2D:this.levels[i].context2D}))}})}(t),function(n){n.TileSourceCollection=function(r,i,o,a){n.console.error("TileSourceCollection is deprecated; use World instead")}}(t),function(n){n.ButtonState={REST:0,GROUP:1,HOVER:2,DOWN:3},n.Button=function(u){var c=this;n.EventSource.call(this),n.extend(!0,this,{tooltip:null,srcRest:null,srcGroup:null,srcHover:null,srcDown:null,clickTimeThreshold:n.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:n.DEFAULT_SETTINGS.clickDistThreshold,fadeDelay:0,fadeLength:2e3,onPress:null,onRelease:null,onClick:null,onEnter:null,onExit:null,onFocus:null,onBlur:null,userData:null},u),this.element=u.element||n.makeNeutralElement("div"),u.element||(this.imgRest=n.makeTransparentImage(this.srcRest),this.imgGroup=n.makeTransparentImage(this.srcGroup),this.imgHover=n.makeTransparentImage(this.srcHover),this.imgDown=n.makeTransparentImage(this.srcDown),this.imgRest.alt=this.imgGroup.alt=this.imgHover.alt=this.imgDown.alt=this.tooltip,n.setElementPointerEventsNone(this.imgRest),n.setElementPointerEventsNone(this.imgGroup),n.setElementPointerEventsNone(this.imgHover),n.setElementPointerEventsNone(this.imgDown),this.element.style.position="relative",n.setElementTouchActionNone(this.element),this.imgGroup.style.position=this.imgHover.style.position=this.imgDown.style.position="absolute",this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top="0px",this.imgGroup.style.left=this.imgHover.style.left=this.imgDown.style.left="0px",this.imgHover.style.visibility=this.imgDown.style.visibility="hidden",this.element.appendChild(this.imgRest),this.element.appendChild(this.imgGroup),this.element.appendChild(this.imgHover),this.element.appendChild(this.imgDown)),this.addHandler("press",this.onPress),this.addHandler("release",this.onRelease),this.addHandler("click",this.onClick),this.addHandler("enter",this.onEnter),this.addHandler("exit",this.onExit),this.addHandler("focus",this.onFocus),this.addHandler("blur",this.onBlur),this.currentState=n.ButtonState.GROUP,this.fadeBeginTime=null,this.shouldFade=!1,this.element.style.display="inline-block",this.element.style.position="relative",this.element.title=this.tooltip,this.tracker=new n.MouseTracker({userData:"Button.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(d){d.insideElementPressed?(s(c,n.ButtonState.DOWN),c.raiseEvent("enter",{originalEvent:d.originalEvent})):d.buttonDownAny||s(c,n.ButtonState.HOVER)},focusHandler:function(d){c.tracker.enterHandler(d),c.raiseEvent("focus",{originalEvent:d.originalEvent})},leaveHandler:function(d){l(c,n.ButtonState.GROUP),d.insideElementPressed&&c.raiseEvent("exit",{originalEvent:d.originalEvent})},blurHandler:function(d){c.tracker.leaveHandler(d),c.raiseEvent("blur",{originalEvent:d.originalEvent})},pressHandler:function(d){s(c,n.ButtonState.DOWN),c.raiseEvent("press",{originalEvent:d.originalEvent})},releaseHandler:function(d){d.insideElementPressed&&d.insideElementReleased?(l(c,n.ButtonState.HOVER),c.raiseEvent("release",{originalEvent:d.originalEvent})):d.insideElementPressed?l(c,n.ButtonState.GROUP):s(c,n.ButtonState.HOVER)},clickHandler:function(d){d.quick&&c.raiseEvent("click",{originalEvent:d.originalEvent})},keyHandler:function(d){d.keyCode===13?(c.raiseEvent("click",{originalEvent:d.originalEvent}),c.raiseEvent("release",{originalEvent:d.originalEvent}),d.preventDefault=!0):d.preventDefault=!1}}),l(this,n.ButtonState.REST)},n.extend(n.Button.prototype,n.EventSource.prototype,{notifyGroupEnter:function(){s(this,n.ButtonState.GROUP)},notifyGroupExit:function(){l(this,n.ButtonState.REST)},disable:function(){this.notifyGroupExit(),this.element.disabled=!0,this.tracker.setTracking(!1),n.setElementOpacity(this.element,.2,!0)},enable:function(){this.element.disabled=!1,this.tracker.setTracking(!0),n.setElementOpacity(this.element,1,!0),this.notifyGroupEnter()},destroy:function(){this.imgRest&&(this.element.removeChild(this.imgRest),this.imgRest=null),this.imgGroup&&(this.element.removeChild(this.imgGroup),this.imgGroup=null),this.imgHover&&(this.element.removeChild(this.imgHover),this.imgHover=null),this.imgDown&&(this.element.removeChild(this.imgDown),this.imgDown=null),this.removeAllHandlers(),this.tracker.destroy(),this.element=null}});function r(u){n.requestAnimationFrame(function(){i(u)})}function i(u){var c,d,f;u.shouldFade&&(c=n.now(),d=c-u.fadeBeginTime,f=1-d/u.fadeLength,f=Math.min(1,f),f=Math.max(0,f),u.imgGroup&&n.setElementOpacity(u.imgGroup,f,!0),f>0&&r(u))}function o(u){u.shouldFade=!0,u.fadeBeginTime=n.now()+u.fadeDelay,window.setTimeout(function(){r(u)},u.fadeDelay)}function a(u){u.shouldFade=!1,u.imgGroup&&n.setElementOpacity(u.imgGroup,1,!0)}function s(u,c){u.element.disabled||(c>=n.ButtonState.GROUP&&u.currentState===n.ButtonState.REST&&(a(u),u.currentState=n.ButtonState.GROUP),c>=n.ButtonState.HOVER&&u.currentState===n.ButtonState.GROUP&&(u.imgHover&&(u.imgHover.style.visibility=""),u.currentState=n.ButtonState.HOVER),c>=n.ButtonState.DOWN&&u.currentState===n.ButtonState.HOVER&&(u.imgDown&&(u.imgDown.style.visibility=""),u.currentState=n.ButtonState.DOWN))}function l(u,c){u.element.disabled||(c<=n.ButtonState.HOVER&&u.currentState===n.ButtonState.DOWN&&(u.imgDown&&(u.imgDown.style.visibility="hidden"),u.currentState=n.ButtonState.HOVER),c<=n.ButtonState.GROUP&&u.currentState===n.ButtonState.HOVER&&(u.imgHover&&(u.imgHover.style.visibility="hidden"),u.currentState=n.ButtonState.GROUP),c<=n.ButtonState.REST&&u.currentState===n.ButtonState.GROUP&&(o(u),u.currentState=n.ButtonState.REST))}}(t),function(n){n.ButtonGroup=function(r){n.extend(!0,this,{buttons:[],clickTimeThreshold:n.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:n.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},r);var i=this.buttons.concat([]),o=this,a;if(this.element=r.element||n.makeNeutralElement("div"),!r.group)for(this.element.style.display="inline-block",a=0;a<i.length;a++)this.element.appendChild(i[a].element);n.setElementTouchActionNone(this.element),this.tracker=new n.MouseTracker({userData:"ButtonGroup.tracker",element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(s){var l;for(l=0;l<o.buttons.length;l++)o.buttons[l].notifyGroupEnter()},leaveHandler:function(s){var l;if(!s.insideElementPressed)for(l=0;l<o.buttons.length;l++)o.buttons[l].notifyGroupExit()}})},n.ButtonGroup.prototype={addButton:function(r){this.buttons.push(r),this.element.appendChild(r.element)},emulateEnter:function(){this.tracker.enterHandler({eventSource:this.tracker})},emulateLeave:function(){this.tracker.leaveHandler({eventSource:this.tracker})},destroy:function(){for(;this.buttons.length;){var r=this.buttons.pop();this.element.removeChild(r.element),r.destroy()}this.tracker.destroy(),this.element=null}}}(t),function(n){n.Rect=function(r,i,o,a,s){this.x=typeof r=="number"?r:0,this.y=typeof i=="number"?i:0,this.width=typeof o=="number"?o:0,this.height=typeof a=="number"?a:0,this.degrees=typeof s=="number"?s:0,this.degrees=n.positiveModulo(this.degrees,360);var l,u;this.degrees>=270?(l=this.getTopRight(),this.x=l.x,this.y=l.y,u=this.height,this.height=this.width,this.width=u,this.degrees-=270):this.degrees>=180?(l=this.getBottomRight(),this.x=l.x,this.y=l.y,this.degrees-=180):this.degrees>=90&&(l=this.getBottomLeft(),this.x=l.x,this.y=l.y,u=this.height,this.height=this.width,this.width=u,this.degrees-=90)},n.Rect.fromSummits=function(r,i,o){var a=r.distanceTo(i),s=r.distanceTo(o),l=i.minus(r),u=Math.atan(l.y/l.x);return l.x<0?u+=Math.PI:l.y<0&&(u+=2*Math.PI),new n.Rect(r.x,r.y,a,s,u/Math.PI*180)},n.Rect.prototype={clone:function(){return new n.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new n.Point(this.x,this.y)},getBottomRight:function(){return new n.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new n.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new n.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new n.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new n.Point(this.width,this.height)},equals:function(r){return r instanceof n.Rect&&this.x===r.x&&this.y===r.y&&this.width===r.width&&this.height===r.height&&this.degrees===r.degrees},times:function(r){return new n.Rect(this.x*r,this.y*r,this.width*r,this.height*r,this.degrees)},translate:function(r){return new n.Rect(this.x+r.x,this.y+r.y,this.width,this.height,this.degrees)},union:function(r){var i=this.getBoundingBox(),o=r.getBoundingBox(),a=Math.min(i.x,o.x),s=Math.min(i.y,o.y),l=Math.max(i.x+i.width,o.x+o.width),u=Math.max(i.y+i.height,o.y+o.height);return new n.Rect(a,s,l-a,u-s)},intersection:function(r){var i=1e-10,o=[],a=this.getTopLeft();r.containsPoint(a,i)&&o.push(a);var s=this.getTopRight();r.containsPoint(s,i)&&o.push(s);var l=this.getBottomLeft();r.containsPoint(l,i)&&o.push(l);var u=this.getBottomRight();r.containsPoint(u,i)&&o.push(u);var c=r.getTopLeft();this.containsPoint(c,i)&&o.push(c);var d=r.getTopRight();this.containsPoint(d,i)&&o.push(d);var f=r.getBottomLeft();this.containsPoint(f,i)&&o.push(f);var h=r.getBottomRight();this.containsPoint(h,i)&&o.push(h);for(var g=this._getSegments(),p=r._getSegments(),v=0;v<g.length;v++)for(var m=g[v],y=0;y<p.length;y++){var E=p[y],b=R(m[0],m[1],E[0],E[1]);b&&o.push(b)}function R(z,$,de,X){var re=$.minus(z),fe=X.minus(de),H=-fe.x*re.y+re.x*fe.y;if(H===0)return null;var Y=(re.x*(z.y-de.y)-re.y*(z.x-de.x))/H,ae=(fe.x*(z.y-de.y)-fe.y*(z.x-de.x))/H;return-i<=Y&&Y<=1-i&&-i<=ae&&ae<=1-i?new n.Point(z.x+ae*re.x,z.y+ae*re.y):null}if(o.length===0)return null;for(var M=o[0].x,C=o[0].x,D=o[0].y,F=o[0].y,L=1;L<o.length;L++){var B=o[L];B.x<M&&(M=B.x),B.x>C&&(C=B.x),B.y<D&&(D=B.y),B.y>F&&(F=B.y)}return new n.Rect(M,D,C-M,F-D)},_getSegments:function(){var r=this.getTopLeft(),i=this.getTopRight(),o=this.getBottomLeft(),a=this.getBottomRight();return[[r,i],[i,a],[a,o],[o,r]]},rotate:function(r,i){if(r=n.positiveModulo(r,360),r===0)return this.clone();i=i||this.getCenter();var o=this.getTopLeft().rotate(r,i),a=this.getTopRight().rotate(r,i),s=a.minus(o);s=s.apply(function(u){var c=1e-15;return Math.abs(u)<c?0:u});var l=Math.atan(s.y/s.x);return s.x<0?l+=Math.PI:s.y<0&&(l+=2*Math.PI),new n.Rect(o.x,o.y,this.width,this.height,l/Math.PI*180)},getBoundingBox:function(){if(this.degrees===0)return this.clone();var r=this.getTopLeft(),i=this.getTopRight(),o=this.getBottomLeft(),a=this.getBottomRight(),s=Math.min(r.x,i.x,o.x,a.x),l=Math.max(r.x,i.x,o.x,a.x),u=Math.min(r.y,i.y,o.y,a.y),c=Math.max(r.y,i.y,o.y,a.y);return new n.Rect(s,u,l-s,c-u)},getIntegerBoundingBox:function(){var r=this.getBoundingBox(),i=Math.floor(r.x),o=Math.floor(r.y),a=Math.ceil(r.width+r.x-i),s=Math.ceil(r.height+r.y-o);return new n.Rect(i,o,a,s)},containsPoint:function(r,i){i=i||0;var o=this.getTopLeft(),a=this.getTopRight(),s=this.getBottomLeft(),l=a.minus(o),u=s.minus(o);return(r.x-o.x)*l.x+(r.y-o.y)*l.y>=-i&&(r.x-a.x)*l.x+(r.y-a.y)*l.y<=i&&(r.x-o.x)*u.x+(r.y-o.y)*u.y>=-i&&(r.x-s.x)*u.x+(r.y-s.y)*u.y<=i},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]"}}}(t),function(n){var r={};n.ReferenceStrip=function(f){var h=this,g=f.viewer,p=n.getElementSize(g.element),v,m,y;for(f.id||(f.id="referencestrip-"+n.now(),this.element=n.makeNeutralElement("div"),this.element.id=f.id,this.element.className="referencestrip"),f=n.extend(!0,{sizeRatio:n.DEFAULT_SETTINGS.referenceStripSizeRatio,position:n.DEFAULT_SETTINGS.referenceStripPosition,scroll:n.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:n.DEFAULT_SETTINGS.clickTimeThreshold},f,{element:this.element}),n.extend(this,f),r[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",n.setElementTouchActionNone(this.element),n.setElementOpacity(this.element,.8),this.viewer=g,this.tracker=new n.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:n.delegate(this,i),dragHandler:n.delegate(this,o),scrollHandler:n.delegate(this,a),enterHandler:n.delegate(this,l),leaveHandler:n.delegate(this,u),keyDownHandler:n.delegate(this,c),keyHandler:n.delegate(this,d),preProcessEventHandler:function(E){E.eventType==="wheel"&&(E.preventDefault=!0)}}),f.width&&f.height?(this.element.style.width=f.width+"px",this.element.style.height=f.height+"px",g.addControl(this.element,{anchor:n.ControlAnchor.BOTTOM_LEFT})):f.scroll==="horizontal"?(this.element.style.width=p.x*f.sizeRatio*g.tileSources.length+12*g.tileSources.length+"px",this.element.style.height=p.y*f.sizeRatio+"px",g.addControl(this.element,{anchor:n.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=p.y*f.sizeRatio*g.tileSources.length+12*g.tileSources.length+"px",this.element.style.width=p.x*f.sizeRatio+"px",g.addControl(this.element,{anchor:n.ControlAnchor.TOP_LEFT})),this.panelWidth=p.x*this.sizeRatio+8,this.panelHeight=p.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},y=0;y<g.tileSources.length;y++)v=n.makeNeutralElement("div"),v.id=this.element.id+"-"+y,v.style.width=h.panelWidth+"px",v.style.height=h.panelHeight+"px",v.style.display="inline",v.style.float="left",v.style.cssFloat="left",v.style.padding="2px",n.setElementTouchActionNone(v),n.setElementPointerEventsNone(v),this.element.appendChild(v),v.activePanel=!1,this.panels.push(v);s(this,this.scroll==="vertical"?p.y:p.x,0),this.setFocus(0)},n.ReferenceStrip.prototype={setFocus:function(f){var h=this.element.querySelector("#"+this.element.id+"-"+f),g=n.getElementSize(this.viewer.canvas),p=Number(this.element.style.width.replace("px","")),v=Number(this.element.style.height.replace("px","")),m=-Number(this.element.style.marginLeft.replace("px","")),y=-Number(this.element.style.marginTop.replace("px","")),E;this.currentSelected!==h&&(this.currentSelected&&(this.currentSelected.style.background="#000"),this.currentSelected=h,this.currentSelected.style.background="#999",this.scroll==="horizontal"?(E=Number(f)*(this.panelWidth+3),E>m+g.x-this.panelWidth?(E=Math.min(E,p-g.x),this.element.style.marginLeft=-E+"px",s(this,g.x,-E)):E<m&&(E=Math.max(0,E-g.x/2),this.element.style.marginLeft=-E+"px",s(this,g.x,-E))):(E=Number(f)*(this.panelHeight+3),E>y+g.y-this.panelHeight?(E=Math.min(E,v-g.y),this.element.style.marginTop=-E+"px",s(this,g.y,-E)):E<y&&(E=Math.max(0,E-g.y/2),this.element.style.marginTop=-E+"px",s(this,g.y,-E))),this.currentPage=f,l.call(this,{eventSource:this.tracker}))},update:function(){return!!r[this.id].animating},destroy:function(){if(this.miniViewers)for(var f in this.miniViewers)this.miniViewers[f].destroy();this.tracker.destroy(),this.element&&this.viewer.removeControl(this.element)}};function i(f){if(f.quick){var h;this.scroll==="horizontal"?h=Math.floor(f.position.x/(this.panelWidth+4)):h=Math.floor(f.position.y/this.panelHeight),this.viewer.goToPage(h)}this.element.focus()}function o(f){if(this.dragging=!0,this.element){var h=Number(this.element.style.marginLeft.replace("px","")),g=Number(this.element.style.marginTop.replace("px","")),p=Number(this.element.style.width.replace("px","")),v=Number(this.element.style.height.replace("px","")),m=n.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?-f.delta.x>0?h>-(p-m.x)&&(this.element.style.marginLeft=h+f.delta.x*2+"px",s(this,m.x,h+f.delta.x*2)):-f.delta.x<0&&h<0&&(this.element.style.marginLeft=h+f.delta.x*2+"px",s(this,m.x,h+f.delta.x*2)):-f.delta.y>0?g>-(v-m.y)&&(this.element.style.marginTop=g+f.delta.y*2+"px",s(this,m.y,g+f.delta.y*2)):-f.delta.y<0&&g<0&&(this.element.style.marginTop=g+f.delta.y*2+"px",s(this,m.y,g+f.delta.y*2))}}function a(f){if(this.element){var h=Number(this.element.style.marginLeft.replace("px","")),g=Number(this.element.style.marginTop.replace("px","")),p=Number(this.element.style.width.replace("px","")),v=Number(this.element.style.height.replace("px","")),m=n.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?f.scroll>0?h>-(p-m.x)&&(this.element.style.marginLeft=h-f.scroll*60+"px",s(this,m.x,h-f.scroll*60)):f.scroll<0&&h<0&&(this.element.style.marginLeft=h-f.scroll*60+"px",s(this,m.x,h-f.scroll*60)):f.scroll<0?g>m.y-v&&(this.element.style.marginTop=g+f.scroll*60+"px",s(this,m.y,g+f.scroll*60)):f.scroll>0&&g<0&&(this.element.style.marginTop=g+f.scroll*60+"px",s(this,m.y,g+f.scroll*60)),f.preventDefault=!0}}function s(f,h,g){var p,v,m,y,E,b;for(f.scroll==="horizontal"?p=f.panelWidth:p=f.panelHeight,v=Math.ceil(h/p)+5,m=Math.ceil((Math.abs(g)+h)/p)+1,v=m-v,v=v<0?0:v,E=v;E<m&&E<f.panels.length;E++)if(b=f.panels[E],!b.activePanel){var R,M=f.viewer.tileSources[E];M.referenceStripThumbnailUrl?R={type:"image",url:M.referenceStripThumbnailUrl}:R=M,y=new n.Viewer({id:b.id,tileSources:[R],element:b,navigatorSizeRatio:f.sizeRatio,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,loadTilesWithAjax:f.viewer.loadTilesWithAjax,ajaxHeaders:f.viewer.ajaxHeaders,drawer:"canvas"}),n.setElementPointerEventsNone(y.canvas),n.setElementPointerEventsNone(y.container),y.innerTracker.setTracking(!1),y.outerTracker.setTracking(!1),f.miniViewers[b.id]=y,b.activePanel=!0}}function l(f){var h=f.eventSource.element;this.scroll==="horizontal"?h.style.marginBottom="0px":h.style.marginLeft="0px"}function u(f){var h=f.eventSource.element;this.scroll==="horizontal"?h.style.marginBottom="-"+n.getElementSize(h).y/2+"px":h.style.marginLeft="-"+n.getElementSize(h).x/2+"px"}function c(f){if(!f.ctrl&&!f.alt&&!f.meta)switch(f.keyCode){case 38:a.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;case 40:a.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 37:a.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 39:a.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;default:f.preventDefault=!1;break}else f.preventDefault=!1}function d(f){if(!f.ctrl&&!f.alt&&!f.meta)switch(f.keyCode){case 61:a.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;case 45:a.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 48:case 119:case 87:a.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;case 115:case 83:a.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 97:a.call(this,{eventSource:this.tracker,position:null,scroll:-1,shift:null}),f.preventDefault=!0;break;case 100:a.call(this,{eventSource:this.tracker,position:null,scroll:1,shift:null}),f.preventDefault=!0;break;default:f.preventDefault=!1;break}else f.preventDefault=!1}}(t),function(n){n.DisplayRect=function(r,i,o,a,s,l){n.Rect.apply(this,[r,i,o,a]),this.minLevel=s,this.maxLevel=l},n.extend(n.DisplayRect.prototype,n.Rect.prototype)}(t),function(n){n.Spring=function(i){var o=arguments;typeof i!="object"&&(i={initial:o.length&&typeof o[0]=="number"?o[0]:void 0,springStiffness:o.length>1?o[1].springStiffness:5,animationTime:o.length>1?o[1].animationTime:1.5}),n.console.assert(typeof i.springStiffness=="number"&&i.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),n.console.assert(typeof i.animationTime=="number"&&i.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),i.exponential&&(this._exponential=!0,delete i.exponential),n.extend(!0,this,i),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:n.now()},n.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))},n.Spring.prototype={resetTo:function(i){n.console.assert(!this._exponential||i!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=i,this.start.time=this.target.time=this.current.time=n.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(i){n.console.assert(!this._exponential||i!==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=i,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(i){this.start.value+=i,this.target.value+=i,this._exponential&&(n.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(i){this._exponential=i,this._exponential&&(n.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=n.now();let i,o;if(this._exponential?(i=this.start._logValue,o=this.target._logValue):(i=this.start.value,o=this.target.value),this.current.time>=this.target.time)this.current.value=this.target.value;else{let a=i+(o-i)*r(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time));this._exponential?this.current.value=Math.exp(a):this.current.value=a}return this.current.value!==this.target.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function r(i,o){return(1-Math.exp(i*-o))/(1-Math.exp(-i))}}(t),function(n){n.ImageJob=function(i){n.extend(!0,this,{timeout:n.DEFAULT_SETTINGS.timeout,jobId:null,tries:0},i),this.data=null,this.userData={},this.errorMsg=null},n.ImageJob.prototype={start:function(){this.tries++;var i=this,o=this.abort;this.jobId=window.setTimeout(function(){i.finish(null,null,"Image load exceeded timeout ("+i.timeout+" ms)")},this.timeout),this.abort=function(){i.source.downloadTileAbort(i),typeof o=="function"&&o()},this.source.downloadTileStart(this)},finish:function(i,o,a){this.data=i,this.request=o,this.errorMsg=a,this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},n.ImageLoader=function(i){n.extend(!0,this,{jobLimit:n.DEFAULT_SETTINGS.imageLoaderLimit,timeout:n.DEFAULT_SETTINGS.timeout,jobQueue:[],failedTiles:[],jobsInProgress:0},i)},n.ImageLoader.prototype={addJob:function(i){if(!i.source){n.console.error("ImageLoader.prototype.addJob() requires [options.source]. TileSource since new API defines how images are fetched. Creating a dummy TileSource.");var o=n.TileSource.prototype;i.source={downloadTileStart:o.downloadTileStart,downloadTileAbort:o.downloadTileAbort}}var a=this,s=function(c){r(a,c,i.callback)},l={src:i.src,tile:i.tile||{},source:i.source,loadWithAjax:i.loadWithAjax,ajaxHeaders:i.loadWithAjax?i.ajaxHeaders:null,crossOriginPolicy:i.crossOriginPolicy,ajaxWithCredentials:i.ajaxWithCredentials,postData:i.postData,callback:s,abort:i.abort,timeout:this.timeout},u=new n.ImageJob(l);!this.jobLimit||this.jobsInProgress<this.jobLimit?(u.start(),this.jobsInProgress++):this.jobQueue.push(u)},clear:function(){for(var i=0;i<this.jobQueue.length;i++){var o=this.jobQueue[i];typeof o.abort=="function"&&o.abort()}this.jobQueue=[]}};function r(i,o,a){o.errorMsg!==""&&(o.data===null||o.data===void 0)&&o.tries<1+i.tileRetryMax&&i.failedTiles.push(o);var s;i.jobsInProgress--,(!i.jobLimit||i.jobsInProgress<i.jobLimit)&&i.jobQueue.length>0&&(s=i.jobQueue.shift(),s.start(),i.jobsInProgress++),i.tileRetryMax>0&&i.jobQueue.length===0&&(!i.jobLimit||i.jobsInProgress<i.jobLimit)&&i.failedTiles.length>0&&(s=i.failedTiles.shift(),setTimeout(function(){s.start()},i.tileRetryDelay),i.jobsInProgress++),a(o.data,o.errorMsg,o.request)}}(t),function(n){n.Tile=function(r,i,o,a,s,l,u,c,d,f,h,g){this.level=r,this.x=i,this.y=o,this.bounds=a,this.positionedBounds=new t.Rect(a.x,a.y,a.width,a.height),this.sourceBounds=f,this.exists=s,this._url=l,this.postData=h,this.context2D=u,this.loadWithAjax=c,this.ajaxHeaders=d,g===void 0&&(n.console.warn("Tile constructor needs 'cacheKey' variable: creation tile cache in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used."),g=n.TileSource.prototype.getTileHashKey(r,i,o,l,d,h)),this.cacheKey=g,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=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.hasTransparency=!1,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},n.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return console.warn("Tile.prototype._hasTransparencyChannel() has been deprecated and will be removed in the future. Use TileSource.prototype.hasTransparency() instead."),!!this.context2D||this.getUrl().match(".png")},get image(){return n.console.error("[Tile.image] property has been deprecated. Use [Tile.prototype.getImage] instead."),this.getImage()},get url(){return n.console.error("[Tile.url] property has been deprecated. Use [Tile.prototype.getUrl] instead."),this.getUrl()},getImage:function(){return this.cacheImageRecord.getImage()},getUrl:function(){return typeof this._url=="function"?this._url():this._url},getCanvasContext:function(){return this.context2D||this.cacheImageRecord&&this.cacheImageRecord.getRenderedContext()},getScaleForEdgeSmoothing:function(){var r;if(this.cacheImageRecord)r=this.cacheImageRecord.getRenderedContext();else if(this.context2D)r=this.context2D;else return n.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return r.canvas.width/(this.size.x*n.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(r,i,o){var a=Math.max(1,Math.ceil((o.x-i.x)/2)),s=Math.max(1,Math.ceil((o.y-i.y)/2));return new n.Point(a,s).minus(this.position.times(n.pixelDensityRatio).times(r||1).apply(function(l){return l%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}}}(t),function(n){n.OverlayPlacement=n.Placement,n.OverlayRotationMode=n.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),n.Overlay=function(r,i,o){var a;n.isPlainObject(r)?a=r:a={element:r,location:i,placement:o},this.elementWrapper=document.createElement("div"),this.element=a.element,this.elementWrapper.appendChild(this.element),this.element.id?this.elementWrapper.id="overlay-wrapper-"+this.element.id:this.elementWrapper.id="overlay-wrapper",this.style=this.elementWrapper.style,this._init(a)},n.Overlay.prototype={_init:function(r){this.location=r.location,this.placement=r.placement===void 0?n.Placement.TOP_LEFT:r.placement,this.onDraw=r.onDraw,this.checkResize=r.checkResize===void 0?!0:r.checkResize,this.width=r.width===void 0?null:r.width,this.height=r.height===void 0?null:r.height,this.rotationMode=r.rotationMode||n.OverlayRotationMode.EXACT,this.location instanceof n.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=n.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new n.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(r,i){var o=n.Placement.properties[this.placement];o&&(o.isHorizontallyCentered?r.x-=i.x/2:o.isRight&&(r.x-=i.x),o.isVerticallyCentered?r.y-=i.y/2:o.isBottom&&(r.y-=i.y))},destroy:function(){var r=this.elementWrapper,i=this.style;r.parentNode&&(r.parentNode.removeChild(r),r.prevElementParent&&(i.display="none",document.body.appendChild(r))),this.onDraw=null,i.top="",i.left="",i.position="",this.width!==null&&(i.width=""),this.height!==null&&(i.height="");var o=n.getCssPropertyWithVendorPrefix("transformOrigin"),a=n.getCssPropertyWithVendorPrefix("transform");o&&a&&(i[o]="",i[a]="")},drawHTML:function(r,i){var o=this.elementWrapper;o.parentNode!==r&&(o.prevElementParent=o.parentNode,o.prevNextSibling=o.nextSibling,r.appendChild(o),this.style.position="absolute",this.size=n.getElementSize(this.elementWrapper));var a=this._getOverlayPositionAndSize(i),s=a.position,l=this.size=a.size,u="";i.overlayPreserveContentDirection&&(u=i.flipped?" scaleX(-1)":" scaleX(1)");var c=i.flipped?-a.rotate:a.rotate,d=i.flipped?" scaleX(-1)":"";if(this.onDraw)this.onDraw(s,l,this.element);else{var f=this.style,h=this.element.style;h.display="block",f.left=s.x+"px",f.top=s.y+"px",this.width!==null&&(h.width=l.x+"px"),this.height!==null&&(h.height=l.y+"px");var g=n.getCssPropertyWithVendorPrefix("transformOrigin"),p=n.getCssPropertyWithVendorPrefix("transform");g&&p&&(c&&!i.flipped?(h[p]="",f[g]=this._getTransformOrigin(),f[p]="rotate("+c+"deg)"):!c&&i.flipped?(h[p]=u,f[g]=this._getTransformOrigin(),f[p]=d):c&&i.flipped?(h[p]=u,f[g]=this._getTransformOrigin(),f[p]="rotate("+c+"deg)"+d):(h[p]="",f[g]="",f[p]="")),f.display="flex"}},_getOverlayPositionAndSize:function(r){var i=r.pixelFromPoint(this.location,!0),o=this._getSizeInPixels(r);this.adjust(i,o);var a=0;if(r.getRotation(!0)&&this.rotationMode!==n.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===n.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var s=new n.Rect(i.x,i.y,o.x,o.y),l=this._getBoundingBox(s,r.getRotation(!0));i=l.getTopLeft(),o=l.getSize()}else a=r.getRotation(!0);return r.flipped&&(i.x=r.getContainerSize().x-i.x),{position:i,size:o,rotate:a}},_getSizeInPixels:function(r){var i=this.size.x,o=this.size.y;if(this.width!==null||this.height!==null){var a=r.deltaPixelsFromPointsNoRotate(new n.Point(this.width||0,this.height||0),!0);this.width!==null&&(i=a.x),this.height!==null&&(o=a.y)}if(this.checkResize&&(this.width===null||this.height===null)){var s=this.size=n.getElementSize(this.elementWrapper);this.width===null&&(i=s.x),this.height===null&&(o=s.y)}return new n.Point(i,o)},_getBoundingBox:function(r,i){var o=this._getPlacementPoint(r);return r.rotate(i,o).getBoundingBox()},_getPlacementPoint:function(r){var i=new n.Point(r.x,r.y),o=n.Placement.properties[this.placement];return o&&(o.isHorizontallyCentered?i.x+=r.width/2:o.isRight&&(i.x+=r.width),o.isVerticallyCentered?i.y+=r.height/2:o.isBottom&&(i.y+=r.height)),i},_getTransformOrigin:function(){var r="",i=n.Placement.properties[this.placement];return i&&(i.isLeft?r="left":i.isRight&&(r="right"),i.isTop?r+=" top":i.isBottom&&(r+=" bottom")),r},update:function(r,i){var o=n.isPlainObject(r)?r:{location:r,placement:i};this._init({location:o.location||this.location,placement:o.placement!==void 0?o.placement:this.placement,onDraw:o.onDraw||this.onDraw,checkResize:o.checkResize||this.checkResize,width:o.width!==void 0?o.width:this.width,height:o.height!==void 0?o.height:this.height,rotationMode:o.rotationMode||this.rotationMode})},getBounds:function(r){n.console.assert(r,"A viewport must now be passed to Overlay.getBounds.");var i=this.width,o=this.height;if(i===null||o===null){var a=r.deltaPointsFromPixelsNoRotate(this.size,!0);i===null&&(i=a.x),o===null&&(o=a.y)}var s=this.location.clone();return this.adjust(s,new n.Point(i,o)),this._adjustBoundsForRotation(r,new n.Rect(s.x,s.y,i,o))},_adjustBoundsForRotation:function(r,i){if(!r||r.getRotation(!0)===0||this.rotationMode===n.OverlayRotationMode.EXACT)return i;if(this.rotationMode===n.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return i;var o=this._getOverlayPositionAndSize(r);return r.viewerElementToViewportRectangle(new n.Rect(o.position.x,o.position.y,o.size.x,o.size.y))}return i.rotate(-r.getRotation(!0),this._getPlacementPoint(i))}}}(t),function(n){const r=n;r.DrawerBase=class{constructor(o){n.console.assert(o.viewer,"[Drawer] options.viewer is required"),n.console.assert(o.viewport,"[Drawer] options.viewport is required"),n.console.assert(o.element,"[Drawer] options.element is required"),this.viewer=o.viewer,this.viewport=o.viewport,this.debugGridColor=typeof o.debugGridColor=="string"?[o.debugGridColor]:o.debugGridColor||n.DEFAULT_SETTINGS.debugGridColor,this.options=o.options||{},this.container=n.getElement(o.element),this._renderingTarget=this._createDrawingElement(),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",this.canvas.style.left="0",n.setElementOpacity(this.canvas,this.viewer.opacity,!0),n.setElementPointerEventsNone(this.canvas),n.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._checkForAPIOverrides()}get canvas(){return this._renderingTarget}get element(){return n.console.error("Drawer.element is deprecated. Use Drawer.container instead."),this.container}getType(){n.console.error("Drawer.getType must be implemented by child class")}static isSupported(){n.console.error("Drawer.isSupported must be implemented by child class")}_createDrawingElement(){return n.console.error("Drawer._createDrawingElement must be implemented by child class"),null}draw(o){n.console.error("Drawer.draw must be implemented by child class")}canRotate(){n.console.error("Drawer.canRotate must be implemented by child class")}destroy(){n.console.error("Drawer.destroy must be implemented by child class")}minimumOverlapRequired(o){return!1}setImageSmoothingEnabled(o){n.console.error("Drawer.setImageSmoothingEnabled must be implemented by child class")}drawDebuggingRect(o){n.console.warn("[drawer].drawDebuggingRect is not implemented by this drawer")}clear(){n.console.warn("[drawer].clear() is deprecated. The drawer is responsible for clearing itself as needed before drawing tiles.")}_checkForAPIOverrides(){if(this._createDrawingElement===n.DrawerBase.prototype._createDrawingElement)throw new Error("[drawer]._createDrawingElement must be implemented by child class");if(this.draw===n.DrawerBase.prototype.draw)throw new Error("[drawer].draw must be implemented by child class");if(this.canRotate===n.DrawerBase.prototype.canRotate)throw new Error("[drawer].canRotate must be implemented by child class");if(this.destroy===n.DrawerBase.prototype.destroy)throw new Error("[drawer].destroy must be implemented by child class");if(this.setImageSmoothingEnabled===n.DrawerBase.prototype.setImageSmoothingEnabled)throw new Error("[drawer].setImageSmoothingEnabled must be implemented by child class")}viewportToDrawerRectangle(o){var a=this.viewport.pixelFromPointNoRotate(o.getTopLeft(),!0),s=this.viewport.deltaPixelsFromPointsNoRotate(o.getSize(),!0);return new n.Rect(a.x*n.pixelDensityRatio,a.y*n.pixelDensityRatio,s.x*n.pixelDensityRatio,s.y*n.pixelDensityRatio)}viewportCoordToDrawerCoord(o){var a=this.viewport.pixelFromPointNoRotate(o,!0);return new n.Point(a.x*n.pixelDensityRatio,a.y*n.pixelDensityRatio)}_calculateCanvasSize(){var o=n.pixelDensityRatio,a=this.viewport.getContainerSize();return new r.Point(Math.round(a.x*o),Math.round(a.y*o))}_raiseTiledImageDrawnEvent(o,a){this.viewer&&this.viewer.raiseEvent("tiled-image-drawn",{tiledImage:o,tiles:a})}_raiseDrawerErrorEvent(o,a){this.viewer&&this.viewer.raiseEvent("drawer-error",{tiledImage:o,drawer:this,error:a})}}}(t),function(n){const r=n;class i extends r.DrawerBase{constructor(a){super(a),this.viewer.rejectEventHandler("tile-drawing","The HTMLDrawer does not raise the tile-drawing event"),this.viewer.allowEventHandler("tile-drawn")}static isSupported(){return!0}getType(){return"html"}minimumOverlapRequired(a){return!0}_createDrawingElement(){return n.makeNeutralElement("div")}draw(a){var s=this;this._prepareNewFrame(),a.forEach(function(l){l.opacity!==0&&s._drawTiles(l)})}canRotate(){return!1}destroy(){this.container.removeChild(this.canvas)}setImageSmoothingEnabled(){}_prepareNewFrame(){this.canvas.innerHTML=""}_drawTiles(a){var s=a.getTilesToDraw().map(c=>c.tile);if(!(a.opacity===0||s.length===0&&!a.placeholderFillStyle))for(var l=s.length-1;l>=0;l--){var u=s[l];this._drawTile(u),this.viewer&&this.viewer.raiseEvent("tile-drawn",{tiledImage:a,tile:u})}}_drawTile(a){n.console.assert(a,"[Drawer._drawTile] tile is required");let s=this.canvas;if(!a.cacheImageRecord){n.console.warn("[Drawer._drawTileToHTML] attempting to draw tile %s when it's not cached",a.toString());return}if(!a.loaded){n.console.warn("Attempting to draw tile %s when it's not yet loaded.",a.toString());return}if(!a.element){var l=a.getImage();if(!l)return;a.element=n.makeNeutralElement("div"),a.imgElement=l.cloneNode(),a.imgElement.style.msInterpolationMode="nearest-neighbor",a.imgElement.style.width="100%",a.imgElement.style.height="100%",a.style=a.element.style,a.style.position="absolute"}a.element.parentNode!==s&&s.appendChild(a.element),a.imgElement.parentNode!==a.element&&a.element.appendChild(a.imgElement),a.style.top=a.position.y+"px",a.style.left=a.position.x+"px",a.style.height=a.size.y+"px",a.style.width=a.size.x+"px",a.flipped&&(a.style.transform="scaleX(-1)"),n.setElementOpacity(a.element,a.opacity)}}n.HTMLDrawer=i}(t),function(n){const r=n;class i extends r.DrawerBase{constructor(c){super(c),this.context=this.canvas.getContext("2d"),this.sketchCanvas=null,this.sketchContext=null,this._imageSmoothingEnabled=!0,this.viewer.allowEventHandler("tile-drawn"),this.viewer.allowEventHandler("tile-drawing")}static isSupported(){return n.supportsCanvas}getType(){return"canvas"}_createDrawingElement(){let c=n.makeNeutralElement("canvas"),d=this._calculateCanvasSize();return c.width=d.x,c.height=d.y,c}draw(c){this._prepareNewFrame(),this.viewer.viewport.getFlip()!==this._viewportFlipped&&this._flip();for(const d of c)d.opacity!==0&&this._drawTiles(d)}canRotate(){return!0}destroy(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null,this.container.removeChild(this.canvas)}minimumOverlapRequired(c){return!0}setImageSmoothingEnabled(c){this._imageSmoothingEnabled=!!c,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw()}drawDebuggingRect(c){var d=this.context;d.save(),d.lineWidth=2*n.pixelDensityRatio,d.strokeStyle=this.debugGridColor[0],d.fillStyle=this.debugGridColor[0],d.strokeRect(c.x*n.pixelDensityRatio,c.y*n.pixelDensityRatio,c.width*n.pixelDensityRatio,c.height*n.pixelDensityRatio),d.restore()}get _viewportFlipped(){return this.context.getTransform().a<0}_raiseTileDrawingEvent(c,d,f,h){this.viewer.raiseEvent("tile-drawing",{tiledImage:c,context:d,tile:f,rendered:h})}_prepareNewFrame(){var c=this._calculateCanvasSize();if((this.canvas.width!==c.x||this.canvas.height!==c.y)&&(this.canvas.width=c.x,this.canvas.height=c.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var d=this._calculateSketchCanvasSize();this.sketchCanvas.width=d.x,this.sketchCanvas.height=d.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}_clear(c,d){var f=this._getContext(c);if(d)f.clearRect(d.x,d.y,d.width,d.height);else{var h=f.canvas;f.clearRect(0,0,h.width,h.height)}}_drawTiles(c){var d=c.getTilesToDraw().map(z=>z.tile);if(!(c.opacity===0||d.length===0&&!c.placeholderFillStyle)){var f=d[0],h;f&&(h=c.opacity<1||c.compositeOperation&&c.compositeOperation!=="source-over"||!c._isBottomItem()&&c.source.hasTransparency(f.context2D,f.getUrl(),f.ajaxHeaders,f.postData));var g,p,v=this.viewport.getZoom(!0),m=c.viewportToImageZoom(v);d.length>1&&m>c.smoothTileEdgesMinZoom&&!c.iOSDevice&&c.getRotation(!0)%360===0&&(h=!0,g=f.getScaleForEdgeSmoothing(),p=f.getTranslationForEdgeSmoothing(g,this._getCanvasSize(!1),this._getCanvasSize(!0)));var y;h&&(g||(y=this.viewport.viewportToViewerElementRectangle(c.getClippedBounds(!0)).getIntegerBoundingBox(),y=y.times(n.pixelDensityRatio)),this._clear(!0,y)),g||this._setRotations(c,h);var E=!1;if(c._clip){this._saveContext(h);var b=c.imageToViewportRectangle(c._clip,!0);b=b.rotate(-c.getRotation(!0),c._getRotationPoint(!0));var R=this.viewportToDrawerRectangle(b);g&&(R=R.times(g)),p&&(R=R.translate(p)),this._setClip(R,h),E=!0}if(c._croppingPolygons){var M=this;E||this._saveContext(h);try{var C=c._croppingPolygons.map(function(z){return z.map(function($){var de=c.imageToViewportCoordinates($.x,$.y,!0).rotate(-c.getRotation(!0),c._getRotationPoint(!0)),X=M.viewportCoordToDrawerCoord(de);return g&&(X=X.times(g)),p&&(X=X.plus(p)),X})});this._clipWithPolygons(C,h)}catch(z){n.console.error(z)}E=!0}if(c._hasOpaqueTile=!1,c.placeholderFillStyle&&c._hasOpaqueTile===!1){let z=this.viewportToDrawerRectangle(c.getBoundsNoRotate(!0));g&&(z=z.times(g)),p&&(z=z.translate(p));let $=null;typeof c.placeholderFillStyle=="function"?$=c.placeholderFillStyle(c,this.context):$=c.placeholderFillStyle,this._drawRectangle(z,$,h)}var D=l(c.subPixelRoundingForTransparency),F=!1;if(D===n.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS)F=!0;else if(D===n.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST){var L=this.viewer&&this.viewer.isAnimating();F=!L}for(var B=0;B<d.length;B++)f=d[B],this._drawTile(f,c,h,g,p,F,c.source),this.viewer&&this.viewer.raiseEvent("tile-drawn",{tiledImage:c,tile:f});E&&this._restoreContext(h),g||(c.getRotation(!0)%360!==0&&this._restoreRotationChanges(h),this.viewport.getRotation(!0)%360!==0&&this._restoreRotationChanges(h)),h&&(g&&this._setRotations(c),this.blendSketch({opacity:c.opacity,scale:g,translate:p,compositeOperation:c.compositeOperation,bounds:y}),g&&(c.getRotation(!0)%360!==0&&this._restoreRotationChanges(!1),this.viewport.getRotation(!0)%360!==0&&this._restoreRotationChanges(!1))),this._drawDebugInfo(c,d),this._raiseTiledImageDrawnEvent(c,d)}}_drawDebugInfo(c,d){if(c.debugMode)for(var f=d.length-1;f>=0;f--){var h=d[f];try{this._drawDebugInfoOnTile(h,d.length,f,c)}catch(g){n.console.error(g)}}}_clipWithPolygons(c,d){var f=this._getContext(d);f.beginPath();for(const h of c)for(const[g,p]of h.entries())f[g===0?"moveTo":"lineTo"](p.x,p.y);f.clip()}_drawTile(c,d,f,h,g,p,v){n.console.assert(c,"[Drawer._drawTile] tile is required"),n.console.assert(d,"[Drawer._drawTile] drawingHandler is required");var m=this._getContext(f);h=h||1,this._drawTileToCanvas(c,m,d,h,g,p,v)}_drawTileToCanvas(c,d,f,h,g,p,v){var m=c.position.times(n.pixelDensityRatio),y=c.size.times(n.pixelDensityRatio),E;if(!c.context2D&&!c.cacheImageRecord){n.console.warn("[Drawer._drawTileToCanvas] attempting to draw tile %s when it's not cached",c.toString());return}if(E=c.getCanvasContext(),!c.loaded||!E){n.console.warn("Attempting to draw tile %s when it's not yet loaded.",c.toString());return}d.save(),typeof h=="number"&&h!==1&&(m=m.times(h),y=y.times(h)),g instanceof n.Point&&(m=m.plus(g)),d.globalAlpha===1&&c.hasTransparency&&(p&&(m.x=Math.round(m.x),m.y=Math.round(m.y),y.x=Math.round(y.x),y.y=Math.round(y.y)),d.clearRect(m.x,m.y,y.x,y.y)),this._raiseTileDrawingEvent(f,d,c,E);var b,R;c.sourceBounds?(b=Math.min(c.sourceBounds.width,E.canvas.width),R=Math.min(c.sourceBounds.height,E.canvas.height)):(b=E.canvas.width,R=E.canvas.height),d.translate(m.x+y.x/2,0),c.flipped&&d.scale(-1,1),d.drawImage(E.canvas,0,0,b,R,-y.x/2,m.y,y.x,y.y),d.restore()}_getContext(c){var d=this.context;if(c){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var f=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=f.x,this.sketchCanvas.height=f.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var h=this;this.viewer.addHandler("rotate",function g(){if(h.viewport.getRotation()!==0){h.viewer.removeHandler("rotate",g);var p=h._calculateSketchCanvasSize();h.sketchCanvas.width=p.x,h.sketchCanvas.height=p.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}d=this.sketchContext}return d}_saveContext(c){this._getContext(c).save()}_restoreContext(c){this._getContext(c).restore()}_setClip(c,d){var f=this._getContext(d);f.beginPath(),f.rect(c.x,c.y,c.width,c.height),f.clip()}_drawRectangle(c,d,f){var h=this._getContext(f);h.save(),h.fillStyle=d,h.fillRect(c.x,c.y,c.width,c.height),h.restore()}blendSketch(c,d,f,h){var g=c;n.isPlainObject(g)||(g={opacity:c,scale:d,translate:f,compositeOperation:h}),c=g.opacity,h=g.compositeOperation;var p=g.bounds;if(this.context.save(),this.context.globalAlpha=c,h&&(this.context.globalCompositeOperation=h),p)p.x<0&&(p.width+=p.x,p.x=0),p.x+p.width>this.canvas.width&&(p.width=this.canvas.width-p.x),p.y<0&&(p.height+=p.y,p.y=0),p.y+p.height>this.canvas.height&&(p.height=this.canvas.height-p.y),this.context.drawImage(this.sketchCanvas,p.x,p.y,p.width,p.height,p.x,p.y,p.width,p.height);else{d=g.scale||1,f=g.translate;var v=f instanceof n.Point?f:new n.Point(0,0),m=0,y=0;if(f){var E=this.sketchCanvas.width-this.canvas.width,b=this.sketchCanvas.height-this.canvas.height;m=Math.round(E/2),y=Math.round(b/2)}this.context.drawImage(this.sketchCanvas,v.x-m*d,v.y-y*d,(this.canvas.width+2*m)*d,(this.canvas.height+2*y)*d,-m,-y,this.canvas.width+2*m,this.canvas.height+2*y)}this.context.restore()}_drawDebugInfoOnTile(c,d,f,h){var g=this.viewer.world.getIndexOfItem(h)%this.debugGridColor.length,p=this.context;p.save(),p.lineWidth=2*n.pixelDensityRatio,p.font="small-caps bold "+13*n.pixelDensityRatio+"px arial",p.strokeStyle=this.debugGridColor[g],p.fillStyle=this.debugGridColor[g],this._setRotations(h),this._viewportFlipped&&this._flip({point:c.position.plus(c.size.divide(2))}),p.strokeRect(c.position.x*n.pixelDensityRatio,c.position.y*n.pixelDensityRatio,c.size.x*n.pixelDensityRatio,c.size.y*n.pixelDensityRatio);var v=(c.position.x+c.size.x/2)*n.pixelDensityRatio,m=(c.position.y+c.size.y/2)*n.pixelDensityRatio;p.translate(v,m);const y=this.viewport.getRotation(!0);p.rotate(Math.PI/180*-y),p.translate(-v,-m),c.x===0&&c.y===0&&(p.fillText("Zoom: "+this.viewport.getZoom(),c.position.x*n.pixelDensityRatio,(c.position.y-30)*n.pixelDensityRatio),p.fillText("Pan: "+this.viewport.getBounds().toString(),c.position.x*n.pixelDensityRatio,(c.position.y-20)*n.pixelDensityRatio)),p.fillText("Level: "+c.level,(c.position.x+10)*n.pixelDensityRatio,(c.position.y+20)*n.pixelDensityRatio),p.fillText("Column: "+c.x,(c.position.x+10)*n.pixelDensityRatio,(c.position.y+30)*n.pixelDensityRatio),p.fillText("Row: "+c.y,(c.position.x+10)*n.pixelDensityRatio,(c.position.y+40)*n.pixelDensityRatio),p.fillText("Order: "+f+" of "+d,(c.position.x+10)*n.pixelDensityRatio,(c.position.y+50)*n.pixelDensityRatio),p.fillText("Size: "+c.size.toString(),(c.position.x+10)*n.pixelDensityRatio,(c.position.y+60)*n.pixelDensityRatio),p.fillText("Position: "+c.position.toString(),(c.position.x+10)*n.pixelDensityRatio,(c.position.y+70)*n.pixelDensityRatio),this.viewport.getRotation(!0)%360!==0&&this._restoreRotationChanges(),h.getRotation(!0)%360!==0&&this._restoreRotationChanges(),p.restore()}_updateImageSmoothingEnabled(c){c.msImageSmoothingEnabled=this._imageSmoothingEnabled,c.imageSmoothingEnabled=this._imageSmoothingEnabled}_getCanvasSize(c){var d=this._getContext(c).canvas;return new n.Point(d.width,d.height)}_getCanvasCenter(){return new n.Point(this.canvas.width/2,this.canvas.height/2)}_setRotations(c,d=!1){var f=!1;this.viewport.getRotation(!0)%360!==0&&(this._offsetForRotation({degrees:this.viewport.getRotation(!0),useSketch:d,saveContext:f}),f=!1),c.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:c.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(c._getRotationPoint(!0),!0),useSketch:d,saveContext:f})}_offsetForRotation(c){var d=c.point?c.point.times(n.pixelDensityRatio):this._getCanvasCenter(),f=this._getContext(c.useSketch);f.save(),f.translate(d.x,d.y),f.rotate(Math.PI/180*c.degrees),f.translate(-d.x,-d.y)}_flip(c){c=c||{};var d=c.point?c.point.times(n.pixelDensityRatio):this._getCanvasCenter(),f=this._getContext(c.useSketch);f.translate(d.x,0),f.scale(-1,1),f.translate(-d.x,0)}_restoreRotationChanges(c){var d=this._getContext(c);d.restore()}_calculateCanvasSize(){var c=n.pixelDensityRatio,d=this.viewport.getContainerSize();return{x:Math.round(d.x*c),y:Math.round(d.y*c)}}_calculateSketchCanvasSize(){var c=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return c;var d=Math.ceil(Math.sqrt(c.x*c.x+c.y*c.y));return{x:d,y:d}}}n.CanvasDrawer=i;var o=n.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER;function a(u){return u!==n.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS&&u!==n.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST&&u!==n.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER}function s(u){return a(u)?o:u}function l(u){if(typeof u=="number")return s(u);if(!u||!n.Browser)return o;var c=u[n.Browser.vendor];return a(c)&&(c=u["*"]),s(c)}}(t),function(n){const r=n;r.WebGLDrawer=class extends r.DrawerBase{constructor(o){super(o),this._destroyed=!1,this._TextureMap=new Map,this._TileMap=new Map,this._gl=null,this._firstPass=null,this._secondPass=null,this._glFrameBuffer=null,this._renderToTexture=null,this._glFramebufferToCanvasTransform=null,this._outputCanvas=null,this._outputContext=null,this._clippingCanvas=null,this._clippingContext=null,this._renderingCanvas=null,this._backupCanvasDrawer=null,this._imageSmoothingEnabled=!0,this._boundToTileReady=a=>this._tileReadyHandler(a),this._boundToImageUnloaded=a=>this._imageUnloadedHandler(a),this.viewer.addHandler("tile-ready",this._boundToTileReady),this.viewer.addHandler("image-unloaded",this._boundToImageUnloaded),this.viewer.rejectEventHandler("tile-drawn","The WebGLDrawer does not raise the tile-drawn event"),this.viewer.rejectEventHandler("tile-drawing","The WebGLDrawer does not raise the tile-drawing event"),this._setupCanvases(),this._setupRenderer(),this.context=this._outputContext}destroy(){if(this._destroyed)return;let o=this._gl;var a=o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS);for(let l=0;l<a;++l)o.activeTexture(o.TEXTURE0+l),o.bindTexture(o.TEXTURE_2D,null),o.bindTexture(o.TEXTURE_CUBE_MAP,null);o.bindBuffer(o.ARRAY_BUFFER,null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,null),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindFramebuffer(o.FRAMEBUFFER,null),this._unloadTextures(),o.deleteBuffer(this._secondPass.bufferOutputPosition),o.deleteFramebuffer(this._glFrameBuffer),this._renderingCanvas.width=this._renderingCanvas.height=1,this._clippingCanvas.width=this._clippingCanvas.height=1,this._outputCanvas.width=this._outputCanvas.height=1,this._renderingCanvas=null,this._clippingCanvas=this._clippingContext=null,this._outputCanvas=this._outputContext=null;let s=o.getExtension("WEBGL_lose_context");s&&s.loseContext(),this.viewer.removeHandler("tile-ready",this._boundToTileReady),this.viewer.removeHandler("image-unloaded",this._boundToImageUnloaded),this.viewer.removeHandler("resize",this._resizeHandler),this._gl=null,this._backupCanvasDrawer&&(this._backupCanvasDrawer.destroy(),this._backupCanvasDrawer=null),this.container.removeChild(this.canvas),this.viewer.drawer===this&&(this.viewer.drawer=null),this._destroyed=!0}canRotate(){return!0}static isSupported(){let o=document.createElement("canvas"),a=n.isFunction(o.getContext)&&o.getContext("webgl"),s=a&&a.getExtension("WEBGL_lose_context");return s&&s.loseContext(),!!a}getType(){return"webgl"}minimumOverlapRequired(o){return o.isTainted()}_createDrawingElement(){let o=n.makeNeutralElement("canvas"),a=this._calculateCanvasSize();return o.width=a.x,o.height=a.y,o}_getBackupCanvasDrawer(){return this._backupCanvasDrawer||(this._backupCanvasDrawer=this.viewer.requestDrawer("canvas",{mainDrawer:!1}),this._backupCanvasDrawer.canvas.style.setProperty("visibility","hidden")),this._backupCanvasDrawer}draw(o){let a=this._gl;const s=this.viewport.getBoundsNoRotateWithMargins(!0);let l={bounds:s,center:new r.Point(s.x+s.width/2,s.y+s.height/2),rotation:this.viewport.getRotation(!0)*Math.PI/180},u=this.viewport.flipped?-1:1,c=n.Mat3.makeTranslation(-l.center.x,-l.center.y),d=n.Mat3.makeScaling(2/l.bounds.width*u,-2/l.bounds.height),f=n.Mat3.makeRotation(-l.rotation),h=d.multiply(f).multiply(c);a.bindFramebuffer(a.FRAMEBUFFER,null),a.clear(a.COLOR_BUFFER_BIT),this._outputContext.clearRect(0,0,this._outputCanvas.width,this._outputCanvas.height);let g=!1;o.forEach((p,v)=>{if(p.isTainted()){g&&(this._outputContext.drawImage(this._renderingCanvas,0,0),a.bindFramebuffer(a.FRAMEBUFFER,null),a.clear(a.COLOR_BUFFER_BIT),g=!1);const m=this._getBackupCanvasDrawer();m.draw([p]),this._outputContext.drawImage(m.canvas,0,0)}else{let m=p.getTilesToDraw();if(p.placeholderFillStyle&&p._hasOpaqueTile===!1&&this._drawPlaceholder(p),m.length===0||p.getOpacity()===0)return;let y=m[0],E=p.compositeOperation||this.viewer.compositeOperation||p._clip||p._croppingPolygons||p.debugMode,b=E||p.opacity<1||y.hasTransparency;E&&(g&&this._outputContext.drawImage(this._renderingCanvas,0,0),a.bindFramebuffer(a.FRAMEBUFFER,null),a.clear(a.COLOR_BUFFER_BIT)),a.useProgram(this._firstPass.shaderProgram),b?(a.bindFramebuffer(a.FRAMEBUFFER,this._glFrameBuffer),a.clear(a.COLOR_BUFFER_BIT)):a.bindFramebuffer(a.FRAMEBUFFER,null);let R=h,M=p.getRotation(!0);if(M%360!==0){let z=n.Mat3.makeRotation(-M*Math.PI/180),$=p.getBoundsNoRotate(!0).getCenter(),de=n.Mat3.makeTranslation($.x,$.y),X=n.Mat3.makeTranslation(-$.x,-$.y),re=de.multiply(z).multiply(X);R=h.multiply(re)}let C=this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS);if(C<=0)throw new Error(`WegGL error: bad value for gl parameter MAX_TEXTURE_IMAGE_UNITS (${C}). This could happen
                        if too many contexts have been created and not released, or there is another problem with the graphics card.`);let D=new Float32Array(C*12),F=new Array(C),L=new Array(C),B=new Array(C);for(let z=0;z<m.length;z++){let $=m[z].tile,de=z%C,X=de+1,re=$.getCanvasContext(),fe=re?this._TextureMap.get(re.canvas):null;if(fe||(this._tileReadyHandler({tile:$,tiledImage:p}),fe=re?this._TextureMap.get(re.canvas):null),fe&&this._getTileData($,p,fe,R,de,D,F,L,B),X===C||z===m.length-1){for(let H=0;H<=X;H++)a.activeTexture(a.TEXTURE0+H),a.bindTexture(a.TEXTURE_2D,F[H]);a.bindBuffer(a.ARRAY_BUFFER,this._firstPass.bufferTexturePosition),a.bufferData(a.ARRAY_BUFFER,D,a.DYNAMIC_DRAW),L.forEach((H,Y)=>{a.uniformMatrix3fv(this._firstPass.uTransformMatrices[Y],!1,H)}),a.uniform1fv(this._firstPass.uOpacities,new Float32Array(B)),a.bindBuffer(a.ARRAY_BUFFER,this._firstPass.bufferOutputPosition),a.vertexAttribPointer(this._firstPass.aOutputPosition,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,this._firstPass.bufferTexturePosition),a.vertexAttribPointer(this._firstPass.aTexturePosition,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,this._firstPass.bufferIndex),a.vertexAttribPointer(this._firstPass.aIndex,1,a.FLOAT,!1,0,0),a.drawArrays(a.TRIANGLES,0,6*X)}}b&&(a.useProgram(this._secondPass.shaderProgram),a.bindFramebuffer(a.FRAMEBUFFER,null),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,this._renderToTexture),this._gl.uniform1f(this._secondPass.uOpacityMultiplier,p.opacity),a.bindBuffer(a.ARRAY_BUFFER,this._secondPass.bufferTexturePosition),a.vertexAttribPointer(this._secondPass.aTexturePosition,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,this._secondPass.bufferOutputPosition),a.vertexAttribPointer(this._secondPass.aOutputPosition,2,a.FLOAT,!1,0,0),a.drawArrays(a.TRIANGLES,0,6)),g=!0,E&&(this._applyContext2dPipeline(p,m,v),g=!1,a.bindFramebuffer(a.FRAMEBUFFER,null),a.clear(a.COLOR_BUFFER_BIT)),v===0&&this._raiseTiledImageDrawnEvent(p,m.map(z=>z.tile))}}),g&&this._outputContext.drawImage(this._renderingCanvas,0,0)}setImageSmoothingEnabled(o){this._imageSmoothingEnabled!==o&&(this._imageSmoothingEnabled=o,this._unloadTextures(),this.viewer.world.draw())}drawDebuggingRect(o){let a=this._outputContext;a.save(),a.lineWidth=2*n.pixelDensityRatio,a.strokeStyle=this.debugGridColor[0],a.fillStyle=this.debugGridColor[0],a.strokeRect(o.x*n.pixelDensityRatio,o.y*n.pixelDensityRatio,o.width*n.pixelDensityRatio,o.height*n.pixelDensityRatio),a.restore()}_getTextureDataFromTile(o){return o.getCanvasContext().canvas}_applyContext2dPipeline(o,a,s){if(this._outputContext.save(),this._outputContext.globalCompositeOperation=s===0?null:o.compositeOperation||this.viewer.compositeOperation,o._croppingPolygons||o._clip?(this._renderToClippingCanvas(o),this._outputContext.drawImage(this._clippingCanvas,0,0)):this._outputContext.drawImage(this._renderingCanvas,0,0),this._outputContext.restore(),o.debugMode){const l=this.viewer.viewport.getFlip();l&&this._flip(),this._drawDebugInfo(a,o,l),l&&this._flip()}}_getTileData(o,a,s,l,u,c,d,f,h){let g=s.texture,p=s.position;c.set(p,u*12);let v=this._calculateOverlapFraction(o,a),m=o.positionedBounds.width*v.x,y=o.positionedBounds.height*v.y,E=o.positionedBounds.x+(o.x===0?0:m),b=o.positionedBounds.y+(o.y===0?0:y),R=o.positionedBounds.x+o.positionedBounds.width-(o.isRightMost?0:m),M=o.positionedBounds.y+o.positionedBounds.height-(o.isBottomMost?0:y),C=R-E,D=M-b,F=new n.Mat3([C,0,0,0,D,0,E,b,1]);if(o.flipped){let B=n.Mat3.makeTranslation(.5,0),z=n.Mat3.makeTranslation(-.5,0),$=B.multiply(n.Mat3.makeScaling(-1,1)).multiply(z);F=F.multiply($)}let L=l.multiply(F);h[u]=o.opacity,d[u]=g,f[u]=L.values}_textureFilter(){return this._imageSmoothingEnabled?this._gl.LINEAR:this._gl.NEAREST}_setupRenderer(){let o=this._gl;o||n.console.error("_setupCanvases must be called before _setupRenderer"),this._unitQuad=this._makeQuadVertexBuffer(0,1,0,1),this._makeFirstPassShaderProgram(),this._makeSecondPassShaderProgram(),this._renderToTexture=o.createTexture(),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this._renderToTexture),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this._renderingCanvas.width,this._renderingCanvas.height,0,o.RGBA,o.UNSIGNED_BYTE,null),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this._textureFilter()),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),this._glFrameBuffer=o.createFramebuffer(),o.bindFramebuffer(o.FRAMEBUFFER,this._glFrameBuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,this._renderToTexture,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)}_makeFirstPassShaderProgram(){let o=this._glNumTextures=this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),a=()=>[...Array(o).keys()].map(g=>`uniform mat3 u_matrix_${g};`).join(`
`),s=()=>[...Array(o).keys()].map(g=>`${g>0?"else ":""}if(int(a_index) == ${g}) { transform_matrix = u_matrix_${g}; }`).join(`
`);const l=`
            attribute vec2 a_output_position;
            attribute vec2 a_texture_position;
            attribute float a_index;
            ${a()} // create a uniform mat3 for each potential tile to draw
            varying vec2 v_texture_position;
            varying float v_image_index;
            void main() {
                mat3 transform_matrix; // value will be set by the if/elses in makeConditional()
                ${s()}
                gl_Position = vec4(transform_matrix * vec3(a_output_position, 1), 1);
                v_texture_position = a_texture_position;
                v_image_index = a_index;
            }
            `,u=`
            precision mediump float;
            // our textures
            uniform sampler2D u_images[${o}];
            // our opacities
            uniform float u_opacities[${o}];
            // the varyings passed in from the vertex shader.
            varying vec2 v_texture_position;
            varying float v_image_index;
            void main() {
                // can't index directly with a variable, need to use a loop iterator hack
                for(int i = 0; i < ${o}; ++i){
                    if(i == int(v_image_index)){
                        gl_FragColor = texture2D(u_images[i], v_texture_position) * u_opacities[i];
                    }
                }
            }
            `;let c=this._gl,d=this.constructor.initShaderProgram(c,l,u);c.useProgram(d),this._firstPass={shaderProgram:d,aOutputPosition:c.getAttribLocation(d,"a_output_position"),aTexturePosition:c.getAttribLocation(d,"a_texture_position"),aIndex:c.getAttribLocation(d,"a_index"),uTransformMatrices:[...Array(this._glNumTextures).keys()].map(g=>c.getUniformLocation(d,`u_matrix_${g}`)),uImages:c.getUniformLocation(d,"u_images"),uOpacities:c.getUniformLocation(d,"u_opacities"),bufferOutputPosition:c.createBuffer(),bufferTexturePosition:c.createBuffer(),bufferIndex:c.createBuffer()},c.uniform1iv(this._firstPass.uImages,[...Array(o).keys()]);let f=new Float32Array(o*12);for(let g=0;g<o;++g)f.set(Float32Array.from(this._unitQuad),g*12);c.bindBuffer(c.ARRAY_BUFFER,this._firstPass.bufferOutputPosition),c.bufferData(c.ARRAY_BUFFER,f,c.STATIC_DRAW),c.enableVertexAttribArray(this._firstPass.aOutputPosition),c.bindBuffer(c.ARRAY_BUFFER,this._firstPass.bufferTexturePosition),c.enableVertexAttribArray(this._firstPass.aTexturePosition),c.bindBuffer(c.ARRAY_BUFFER,this._firstPass.bufferIndex);let h=[...Array(this._glNumTextures).keys()].map(g=>Array(6).fill(g)).flat();c.bufferData(c.ARRAY_BUFFER,new Float32Array(h),c.STATIC_DRAW),c.enableVertexAttribArray(this._firstPass.aIndex)}_makeSecondPassShaderProgram(){const o=`
            attribute vec2 a_output_position;
            attribute vec2 a_texture_position;
            uniform mat3 u_matrix;
            varying vec2 v_texture_position;
            void main() {
                gl_Position = vec4(u_matrix * vec3(a_output_position, 1), 1);
                v_texture_position = a_texture_position;
            }
            `,a=`
            precision mediump float;
            // our texture
            uniform sampler2D u_image;
            // the texCoords passed in from the vertex shader.
            varying vec2 v_texture_position;
            // the opacity multiplier for the image
            uniform float u_opacity_multiplier;
            void main() {
                gl_FragColor = texture2D(u_image, v_texture_position);
                gl_FragColor *= u_opacity_multiplier;
            }
            `;let s=this._gl,l=this.constructor.initShaderProgram(s,o,a);s.useProgram(l),this._secondPass={shaderProgram:l,aOutputPosition:s.getAttribLocation(l,"a_output_position"),aTexturePosition:s.getAttribLocation(l,"a_texture_position"),uMatrix:s.getUniformLocation(l,"u_matrix"),uImage:s.getUniformLocation(l,"u_image"),uOpacityMultiplier:s.getUniformLocation(l,"u_opacity_multiplier"),bufferOutputPosition:s.createBuffer(),bufferTexturePosition:s.createBuffer()},s.bindBuffer(s.ARRAY_BUFFER,this._secondPass.bufferOutputPosition),s.bufferData(s.ARRAY_BUFFER,this._unitQuad,s.STATIC_DRAW),s.enableVertexAttribArray(this._secondPass.aOutputPosition),s.bindBuffer(s.ARRAY_BUFFER,this._secondPass.bufferTexturePosition),s.bufferData(s.ARRAY_BUFFER,this._unitQuad,s.DYNAMIC_DRAW),s.enableVertexAttribArray(this._secondPass.aTexturePosition);let u=n.Mat3.makeScaling(2,2).multiply(n.Mat3.makeTranslation(-.5,-.5));s.uniformMatrix3fv(this._secondPass.uMatrix,!1,u.values)}_resizeRenderer(){let o=this._gl,a=this._renderingCanvas.width,s=this._renderingCanvas.height;o.viewport(0,0,a,s),o.deleteTexture(this._renderToTexture),this._renderToTexture=o.createTexture(),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this._renderToTexture),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,a,s,0,o.RGBA,o.UNSIGNED_BYTE,null),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this._textureFilter()),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.bindFramebuffer(o.FRAMEBUFFER,this._glFrameBuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,this._renderToTexture,0)}_setupCanvases(){let o=this;this._outputCanvas=this.canvas,this._outputContext=this._outputCanvas.getContext("2d"),this._renderingCanvas=document.createElement("canvas"),this._clippingCanvas=document.createElement("canvas"),this._clippingContext=this._clippingCanvas.getContext("2d"),this._renderingCanvas.width=this._clippingCanvas.width=this._outputCanvas.width,this._renderingCanvas.height=this._clippingCanvas.height=this._outputCanvas.height,this._gl=this._renderingCanvas.getContext("webgl"),this._resizeHandler=function(){o._outputCanvas!==o.viewer.drawer.canvas&&(o._outputCanvas.style.width=o.viewer.drawer.canvas.clientWidth+"px",o._outputCanvas.style.height=o.viewer.drawer.canvas.clientHeight+"px");let a=o._calculateCanvasSize();(o._outputCanvas.width!==a.x||o._outputCanvas.height!==a.y)&&(o._outputCanvas.width=a.x,o._outputCanvas.height=a.y),o._renderingCanvas.style.width=o._outputCanvas.clientWidth+"px",o._renderingCanvas.style.height=o._outputCanvas.clientHeight+"px",o._renderingCanvas.width=o._clippingCanvas.width=o._outputCanvas.width,o._renderingCanvas.height=o._clippingCanvas.height=o._outputCanvas.height,o._resizeRenderer()},this.viewer.addHandler("resize",this._resizeHandler)}_makeQuadVertexBuffer(o,a,s,l){return new Float32Array([o,l,a,l,o,s,o,s,a,l,a,s])}_tileReadyHandler(o){let a=o.tile,s=o.tiledImage;if(s.isTainted())return;let l=a.getCanvasContext(),u=l&&l.canvas;if(!u||n.isCanvasTainted(u)){s.isTainted()||(s.setTainted(!0),n.console.warn("WebGL cannot be used to draw this TiledImage because it has tainted data. Does crossOriginPolicy need to be set?"),this._raiseDrawerErrorEvent(s,"Tainted data cannot be used by the WebGLDrawer. Falling back to CanvasDrawer for this TiledImage."));return}if(!this._TextureMap.get(u)){let d=this._gl,f=d.createTexture(),h,g=s.source.tileOverlap,p,v;if(a.sourceBounds?(p=Math.min(a.sourceBounds.width,u.width)/u.width,v=Math.min(a.sourceBounds.height,u.height)/u.height):(p=1,v=1),g>0){let y=this._calculateOverlapFraction(a,s),E=(a.x===0?0:y.x)*p,b=(a.y===0?0:y.y)*v,R=(a.isRightMost?1:1-y.x)*p,M=(a.isBottomMost?1:1-y.y)*v;h=this._makeQuadVertexBuffer(E,R,b,M)}else p===1&&v===1?h=this._unitQuad:h=this._makeQuadVertexBuffer(0,p,0,v);let m={texture:f,position:h};this._TextureMap.set(u,m),d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,f),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,this._textureFilter()),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,this._textureFilter()),this._uploadImageData(l)}}_calculateOverlapFraction(o,a){let s=a.source.tileOverlap,l=o.sourceBounds.width,u=o.sourceBounds.height,c=(o.x===0?0:s)+(o.isRightMost?0:s),d=(o.y===0?0:s)+(o.isBottomMost?0:s),f=s/(l+c),h=s/(u+d);return{x:f,y:h}}_unloadTextures(){Array.from(this._TextureMap.keys()).forEach(a=>{this._cleanupImageData(a)})}_uploadImageData(o){let a=this._gl,s=o.canvas;try{if(!s)throw o;a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,s)}catch(l){n.console.error("Error uploading image data to WebGL",l)}}_imageUnloadedHandler(o){let a=o.context2D.canvas;this._cleanupImageData(a)}_cleanupImageData(o){let a=this._TextureMap.get(o);this._TextureMap.delete(o),a&&this._gl.deleteTexture(a.texture)}_setClip(){}_renderToClippingCanvas(o){if(this._clippingContext.clearRect(0,0,this._clippingCanvas.width,this._clippingCanvas.height),this._clippingContext.save(),this.viewer.viewport.getFlip()){const a=new n.Point(this.canvas.width/2,this.canvas.height/2);this._clippingContext.translate(a.x,0),this._clippingContext.scale(-1,1),this._clippingContext.translate(-a.x,0)}if(o._clip){let s=[{x:o._clip.x,y:o._clip.y},{x:o._clip.x+o._clip.width,y:o._clip.y},{x:o._clip.x+o._clip.width,y:o._clip.y+o._clip.height},{x:o._clip.x,y:o._clip.y+o._clip.height}].map(l=>{let u=o.imageToViewportCoordinates(l.x,l.y,!0).rotate(this.viewer.viewport.getRotation(!0),this.viewer.viewport.getCenter(!0));return this.viewportCoordToDrawerCoord(u)});this._clippingContext.beginPath(),s.forEach((l,u)=>{this._clippingContext[u===0?"moveTo":"lineTo"](l.x,l.y)}),this._clippingContext.clip(),this._setClip()}if(o._croppingPolygons){let a=o._croppingPolygons.map(s=>s.map(l=>{let u=o.imageToViewportCoordinates(l.x,l.y,!0).rotate(this.viewer.viewport.getRotation(!0),this.viewer.viewport.getCenter(!0));return this.viewportCoordToDrawerCoord(u)}));this._clippingContext.beginPath(),a.forEach(s=>{s.forEach((l,u)=>{this._clippingContext[u===0?"moveTo":"lineTo"](l.x,l.y)})}),this._clippingContext.clip()}if(this.viewer.viewport.getFlip()){const a=new n.Point(this.canvas.width/2,this.canvas.height/2);this._clippingContext.translate(a.x,0),this._clippingContext.scale(-1,1),this._clippingContext.translate(-a.x,0)}this._clippingContext.drawImage(this._renderingCanvas,0,0),this._clippingContext.restore()}_setRotations(o){var a=!1;this.viewport.getRotation(!0)%360!==0&&(this._offsetForRotation({degrees:this.viewport.getRotation(!0),saveContext:a}),a=!1),o.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:o.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(o._getRotationPoint(!0),!0),saveContext:a})}_offsetForRotation(o){var a=o.point?o.point.times(n.pixelDensityRatio):this._getCanvasCenter(),s=this._outputContext;s.save(),s.translate(a.x,a.y),s.rotate(Math.PI/180*o.degrees),s.translate(-a.x,-a.y)}_flip(o){o=o||{};var a=o.point?o.point.times(n.pixelDensityRatio):this._getCanvasCenter(),s=this._outputContext;s.translate(a.x,0),s.scale(-1,1),s.translate(-a.x,0)}_drawDebugInfo(o,a,s){for(var l=o.length-1;l>=0;l--){var u=o[l].tile;try{this._drawDebugInfoOnTile(u,o.length,l,a,s)}catch(c){n.console.error(c)}}}_drawDebugInfoOnTile(o,a,s,l,u){var c=this.viewer.world.getIndexOfItem(l)%this.debugGridColor.length,d=this.context;d.save(),d.lineWidth=2*n.pixelDensityRatio,d.font="small-caps bold "+13*n.pixelDensityRatio+"px arial",d.strokeStyle=this.debugGridColor[c],d.fillStyle=this.debugGridColor[c],this._setRotations(l),u&&this._flip({point:o.position.plus(o.size.divide(2))}),d.strokeRect(o.position.x*n.pixelDensityRatio,o.position.y*n.pixelDensityRatio,o.size.x*n.pixelDensityRatio,o.size.y*n.pixelDensityRatio);var f=(o.position.x+o.size.x/2)*n.pixelDensityRatio,h=(o.position.y+o.size.y/2)*n.pixelDensityRatio;d.translate(f,h);const g=this.viewport.getRotation(!0);d.rotate(Math.PI/180*-g),d.translate(-f,-h),o.x===0&&o.y===0&&(d.fillText("Zoom: "+this.viewport.getZoom(),o.position.x*n.pixelDensityRatio,(o.position.y-30)*n.pixelDensityRatio),d.fillText("Pan: "+this.viewport.getBounds().toString(),o.position.x*n.pixelDensityRatio,(o.position.y-20)*n.pixelDensityRatio)),d.fillText("Level: "+o.level,(o.position.x+10)*n.pixelDensityRatio,(o.position.y+20)*n.pixelDensityRatio),d.fillText("Column: "+o.x,(o.position.x+10)*n.pixelDensityRatio,(o.position.y+30)*n.pixelDensityRatio),d.fillText("Row: "+o.y,(o.position.x+10)*n.pixelDensityRatio,(o.position.y+40)*n.pixelDensityRatio),d.fillText("Order: "+s+" of "+a,(o.position.x+10)*n.pixelDensityRatio,(o.position.y+50)*n.pixelDensityRatio),d.fillText("Size: "+o.size.toString(),(o.position.x+10)*n.pixelDensityRatio,(o.position.y+60)*n.pixelDensityRatio),d.fillText("Position: "+o.position.toString(),(o.position.x+10)*n.pixelDensityRatio,(o.position.y+70)*n.pixelDensityRatio),this.viewport.getRotation(!0)%360!==0&&this._restoreRotationChanges(),l.getRotation(!0)%360!==0&&this._restoreRotationChanges(),d.restore()}_drawPlaceholder(o){const a=o.getBounds(!0),s=this.viewportToDrawerRectangle(o.getBounds(!0)),l=this._outputContext;let u;typeof o.placeholderFillStyle=="function"?u=o.placeholderFillStyle(o,l):u=o.placeholderFillStyle,this._offsetForRotation({degrees:this.viewer.viewport.getRotation(!0)}),l.fillStyle=u,l.translate(s.x,s.y),l.rotate(Math.PI/180*a.degrees),l.translate(-s.x,-s.y),l.fillRect(s.x,s.y,s.width,s.height),this._restoreRotationChanges()}_getCanvasCenter(){return new n.Point(this.canvas.width/2,this.canvas.height/2)}_restoreRotationChanges(){var o=this._outputContext;o.restore()}static initShaderProgram(o,a,s){function l(f,h,g){const p=f.createShader(h);return f.shaderSource(p,g),f.compileShader(p),f.getShaderParameter(p,f.COMPILE_STATUS)?p:(n.console.error(`An error occurred compiling the shaders: ${f.getShaderInfoLog(p)}`),f.deleteShader(p),null)}const u=l(o,o.VERTEX_SHADER,a),c=l(o,o.FRAGMENT_SHADER,s),d=o.createProgram();return o.attachShader(d,u),o.attachShader(d,c),o.linkProgram(d),o.getProgramParameter(d,o.LINK_STATUS)?d:(n.console.error(`Unable to initialize the shader program: ${o.getProgramInfoLog(d)}`),null)}}}(t),function(n){n.Viewport=function(r){var i=arguments;i.length&&i[0]instanceof n.Point&&(r={containerSize:i[0],contentSize:i[1],config:i[2]}),r.config&&(n.extend(!0,r,r.config),delete r.config),this._margins=n.extend({left:0,top:0,right:0,bottom:0},r.margins||{}),delete r.margins,r.initialDegrees=r.degrees,delete r.degrees,n.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,rotationPivot:null,viewer:null,springStiffness:n.DEFAULT_SETTINGS.springStiffness,animationTime:n.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:n.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:n.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:n.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:n.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:n.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:n.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:n.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:n.DEFAULT_SETTINGS.maxZoomLevel,initialDegrees:n.DEFAULT_SETTINGS.degrees,flipped:n.DEFAULT_SETTINGS.flipped,homeFillsViewer:n.DEFAULT_SETTINGS.homeFillsViewer,silenceMultiImageWarnings:n.DEFAULT_SETTINGS.silenceMultiImageWarnings},r),this._updateContainerInnerSize(),this.centerSpringX=new n.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new n.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new n.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.degreesSpring=new n.Spring({initial:r.initialDegrees,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._oldDegrees=this.degreesSpring.current.value,this._setContentBounds(new n.Rect(0,0,1,1),1),this.goHome(!0),this.update()},n.Viewport.prototype={get degrees(){return n.console.warn("Accessing [Viewport.degrees] is deprecated. Use viewport.getRotation instead."),this.getRotation()},set degrees(r){n.console.warn("Setting [Viewport.degrees] is deprecated. Use viewport.rotateTo, viewport.rotateBy, or viewport.setRotation instead."),this.rotateTo(r)},resetContentSize:function(r){return n.console.assert(r,"[Viewport.resetContentSize] contentSize is required"),n.console.assert(r instanceof n.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),n.console.assert(r.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),n.console.assert(r.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new n.Rect(0,0,1,r.y/r.x),r.x),this},setHomeBounds:function(r,i){n.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(r,i)},_setContentBounds:function(r,i){n.console.assert(r,"[Viewport._setContentBounds] bounds is required"),n.console.assert(r instanceof n.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),n.console.assert(r.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),n.console.assert(r.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=r.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(i),this._contentBounds=r.rotate(this.getRotation()).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(i),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:i,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var r=this._contentAspectRatio/this.getAspectRatio(),i;return this.homeFillsViewer?i=r>=1?r:1:i=r>=1?1:r,i/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var r=this._contentBounds.getCenter(),i=1/this.getHomeZoom(),o=i/this.getAspectRatio();return new n.Rect(r.x-i/2,r.y-o/2,i,o)},goHome:function(r){return this.viewer&&this.viewer.raiseEvent("home",{immediately:r}),this.fitBounds(this.getHomeBounds(),r)},getMinZoom:function(){var r=this.getHomeZoom(),i=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*r;return i},getMaxZoom:function(){var r=this.maxZoomLevel;return r||(r=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,r/=this._contentBounds.width),Math.max(r,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new n.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return n.extend({},this._margins)},setMargins:function(r){n.console.assert(n.type(r)==="object","[Viewport.setMargins] margins must be an object"),this._margins=n.extend({left:0,top:0,right:0,bottom:0},r),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(r){return this.getBoundsNoRotate(r).rotate(-this.getRotation(r))},getBoundsNoRotate:function(r){var i=this.getCenter(r),o=1/this.getZoom(r),a=o/this.getAspectRatio();return new n.Rect(i.x-o/2,i.y-a/2,o,a)},getBoundsWithMargins:function(r){return this.getBoundsNoRotateWithMargins(r).rotate(-this.getRotation(r),this.getCenter(r))},getBoundsNoRotateWithMargins:function(r){var i=this.getBoundsNoRotate(r),o=this._containerInnerSize.x*this.getZoom(r);return i.x-=this._margins.left/o,i.y-=this._margins.top/o,i.width+=(this._margins.left+this._margins.right)/o,i.height+=(this._margins.top+this._margins.bottom)/o,i},getCenter:function(r){var i=new n.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),o=new n.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),a,s,l,u,c,d,f,h;return r?i:this.zoomPoint?(a=this.pixelFromPoint(this.zoomPoint,!0),s=this.getZoom(),l=1/s,u=l/this.getAspectRatio(),c=new n.Rect(i.x-l/2,i.y-u/2,l,u),d=this._pixelFromPoint(this.zoomPoint,c),f=d.minus(a).rotate(-this.getRotation(!0)),h=f.divide(this._containerInnerSize.x*s),o.plus(h)):o},getZoom:function(r){return r?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(r){return Math.max(Math.min(r,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(r){var i=this.viewportToViewerElementRectangle(r).getBoundingBox(),o=this.viewportToViewerElementRectangle(this._contentBoundsNoRotate).getBoundingBox(),a=!1,s=!1;if(!this.wrapHorizontal){var l=i.x+i.width,u=o.x+o.width,c,d,f;i.width>o.width?c=this.visibilityRatio*o.width:c=this.visibilityRatio*i.width,d=o.x-l+c,f=u-i.x-c,c>o.width?(i.x+=(d+f)/2,a=!0):f<0?(i.x+=f,a=!0):d>0&&(i.x+=d,a=!0)}if(!this.wrapVertical){var h=i.y+i.height,g=o.y+o.height,p,v,m;i.height>o.height?p=this.visibilityRatio*o.height:p=this.visibilityRatio*i.height,v=o.y-h+p,m=g-i.y-p,p>o.height?(i.y+=(v+m)/2,s=!0):m<0?(i.y+=m,s=!0):v>0&&(i.y+=v,s=!0)}var y=a||s,E=y?this.viewerElementToViewportRectangle(i):r.clone();return E.xConstrained=a,E.yConstrained=s,E.constraintApplied=y,E},_raiseConstraintsEvent:function(r){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:r})},applyConstraints:function(r){var i=this.getZoom(),o=this._applyZoomConstraints(i);i!==o&&this.zoomTo(o,this.zoomPoint,r);var a=this.getConstrainedBounds(!1);return a.constraintApplied&&(this.fitBounds(a,r),this._raiseConstraintsEvent(r)),this},ensureVisible:function(r){return this.applyConstraints(r)},_fitBounds:function(r,i){i=i||{};var o=i.immediately||!1,a=i.constraints||!1,s=this.getAspectRatio(),l=r.getCenter(),u=new n.Rect(r.x,r.y,r.width,r.height,r.degrees+this.getRotation()).getBoundingBox();u.getAspectRatio()>=s?u.height=u.width/s:u.width=u.height*s,u.x=l.x-u.width/2,u.y=l.y-u.height/2;var c=1/u.width;if(o)return this.panTo(l,!0),this.zoomTo(c,null,!0),a&&this.applyConstraints(!0),this;var d=this.getCenter(!0),f=this.getZoom(!0);this.panTo(d,!0),this.zoomTo(f,null,!0);var h=this.getBounds(),g=this.getZoom();if(g===0||Math.abs(c/g-1)<1e-8)return this.zoomTo(c,null,!0),this.panTo(l,o),a&&this.applyConstraints(!1),this;if(a){this.panTo(l,!1),c=this._applyZoomConstraints(c),this.zoomTo(c,null,!1);var p=this.getConstrainedBounds();this.panTo(d,!0),this.zoomTo(f,null,!0),this.fitBounds(p)}else{var v=u.rotate(-this.getRotation()),m=v.getTopLeft().times(c).minus(h.getTopLeft().times(g)).divide(c-g);this.zoomTo(c,m,o)}return this},fitBounds:function(r,i){return this._fitBounds(r,{immediately:i,constraints:!1})},fitBoundsWithConstraints:function(r,i){return this._fitBounds(r,{immediately:i,constraints:!0})},fitVertically:function(r){var i=new n.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(i,r)},fitHorizontally:function(r){var i=new n.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(i,r)},getConstrainedBounds:function(r){var i,o;return i=this.getBounds(r),o=this._applyBoundaryConstraints(i),o},panBy:function(r,i){var o=new n.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(o.plus(r),i)},panTo:function(r,i){return i?(this.centerSpringX.resetTo(r.x),this.centerSpringY.resetTo(r.y)):(this.centerSpringX.springTo(r.x),this.centerSpringY.springTo(r.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:r,immediately:i}),this},zoomBy:function(r,i,o){return this.zoomTo(this.zoomSpring.target.value*r,i,o)},zoomTo:function(r,i,o){var a=this;return this.zoomPoint=i instanceof n.Point&&!isNaN(i.x)&&!isNaN(i.y)?i:null,o?this._adjustCenterSpringsForZoomPoint(function(){a.zoomSpring.resetTo(r)}):this.zoomSpring.springTo(r),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:r,refPoint:i,immediately:o}),this},setRotation:function(r,i){return this.rotateTo(r,null,i)},getRotation:function(r){return r?this.degreesSpring.current.value:this.degreesSpring.target.value},setRotationWithPivot:function(r,i,o){return this.rotateTo(r,i,o)},rotateTo:function(r,i,o){if(!this.viewer||!this.viewer.drawer.canRotate())return this;if(this.degreesSpring.target.value===r&&this.degreesSpring.isAtTargetValue())return this;if(this.rotationPivot=i instanceof n.Point&&!isNaN(i.x)&&!isNaN(i.y)?i:null,o)if(this.rotationPivot){var a=r-this._oldDegrees;if(!a)return this.rotationPivot=null,this;this._rotateAboutPivot(r)}else this.degreesSpring.resetTo(r);else{var s=n.positiveModulo(this.degreesSpring.current.value,360),l=n.positiveModulo(r,360),u=l-s;u>180?l-=360:u<-180&&(l+=360);var c=s-l;this.degreesSpring.resetTo(r+c),this.degreesSpring.springTo(r)}return this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:r,immediately:!!o,pivot:this.rotationPivot||this.getCenter()}),this},rotateBy:function(r,i,o){return this.rotateTo(this.degreesSpring.target.value+r,i,o)},resize:function(r,i){var o=this.getBoundsNoRotate(),a=o,s;this.containerSize.x=r.x,this.containerSize.y=r.y,this._updateContainerInnerSize(),i&&(s=r.x/this.containerSize.x,a.width=o.width*s,a.height=a.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:r,maintain:i});var l=this.fitBounds(a,!0);return this.viewer&&this.viewer.raiseEvent("after-resize",{newContainerSize:r,maintain:i}),l},_updateContainerInnerSize:function(){this._containerInnerSize=new n.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 r=this;this._adjustCenterSpringsForZoomPoint(function(){r.zoomSpring.update()}),this.degreesSpring.isAtTargetValue()&&(this.rotationPivot=null),this.centerSpringX.update(),this.centerSpringY.update(),this.rotationPivot?this._rotateAboutPivot(!0):this.degreesSpring.update();var i=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom||this.degreesSpring.current.value!==this._oldDegrees;this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._oldDegrees=this.degreesSpring.current.value;var o=i||!this.zoomSpring.isAtTargetValue()||!this.centerSpringX.isAtTargetValue()||!this.centerSpringY.isAtTargetValue()||!this.degreesSpring.isAtTargetValue();return o},_rotateAboutPivot:function(r){var i=r===!0,o=this.rotationPivot.minus(this.getCenter());this.centerSpringX.shiftBy(o.x),this.centerSpringY.shiftBy(o.y),i?this.degreesSpring.update():this.degreesSpring.resetTo(r);var a=this.degreesSpring.current.value-this._oldDegrees,s=o.rotate(a*-1).times(-1);this.centerSpringX.shiftBy(s.x),this.centerSpringY.shiftBy(s.y)},_adjustCenterSpringsForZoomPoint:function(r){if(this.zoomPoint){var i=this.pixelFromPoint(this.zoomPoint,!0);r();var o=this.pixelFromPoint(this.zoomPoint,!0),a=o.minus(i),s=this.deltaPointsFromPixels(a,!0);this.centerSpringX.shiftBy(s.x),this.centerSpringY.shiftBy(s.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else r()},deltaPixelsFromPointsNoRotate:function(r,i){return r.times(this._containerInnerSize.x*this.getZoom(i))},deltaPixelsFromPoints:function(r,i){return this.deltaPixelsFromPointsNoRotate(r.rotate(this.getRotation(i)),i)},deltaPointsFromPixelsNoRotate:function(r,i){return r.divide(this._containerInnerSize.x*this.getZoom(i))},deltaPointsFromPixels:function(r,i){return this.deltaPointsFromPixelsNoRotate(r,i).rotate(-this.getRotation(i))},pixelFromPointNoRotate:function(r,i){return this._pixelFromPointNoRotate(r,this.getBoundsNoRotate(i))},pixelFromPoint:function(r,i){return this._pixelFromPoint(r,this.getBoundsNoRotate(i))},_pixelFromPointNoRotate:function(r,i){return r.minus(i.getTopLeft()).times(this._containerInnerSize.x/i.width).plus(new n.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(r,i){return this._pixelFromPointNoRotate(r.rotate(this.getRotation(!0),this.getCenter(!0)),i)},pointFromPixelNoRotate:function(r,i){var o=this.getBoundsNoRotate(i);return r.minus(new n.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/o.width).plus(o.getTopLeft())},pointFromPixel:function(r,i){return this.pointFromPixelNoRotate(r,i).rotate(-this.getRotation(i),this.getCenter(i))},_viewportToImageDelta:function(r,i){var o=this._contentBoundsNoRotate.width;return new n.Point(r*this._contentSizeNoRotate.x/o,i*this._contentSizeNoRotate.x/o)},viewportToImageCoordinates:function(r,i){if(r instanceof n.Point)return this.viewportToImageCoordinates(r.x,r.y);if(this.viewer){var o=this.viewer.world.getItemCount();if(o>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(o===1){var a=this.viewer.world.getItemAt(0);return a.viewportToImageCoordinates(r,i,!0)}}return this._viewportToImageDelta(r-this._contentBoundsNoRotate.x,i-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(r,i){var o=this._contentBoundsNoRotate.width;return new n.Point(r/this._contentSizeNoRotate.x*o,i/this._contentSizeNoRotate.x*o)},imageToViewportCoordinates:function(r,i){if(r instanceof n.Point)return this.imageToViewportCoordinates(r.x,r.y);if(this.viewer){var o=this.viewer.world.getItemCount();if(o>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(o===1){var a=this.viewer.world.getItemAt(0);return a.imageToViewportCoordinates(r,i,!0)}}var s=this._imageToViewportDelta(r,i);return s.x+=this._contentBoundsNoRotate.x,s.y+=this._contentBoundsNoRotate.y,s},imageToViewportRectangle:function(r,i,o,a){var s=r;if(s instanceof n.Rect||(s=new n.Rect(r,i,o,a)),this.viewer){var l=this.viewer.world.getItemCount();if(l>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(l===1){var u=this.viewer.world.getItemAt(0);return u.imageToViewportRectangle(r,i,o,a,!0)}}var c=this.imageToViewportCoordinates(s.x,s.y),d=this._imageToViewportDelta(s.width,s.height);return new n.Rect(c.x,c.y,d.x,d.y,s.degrees)},viewportToImageRectangle:function(r,i,o,a){var s=r;if(s instanceof n.Rect||(s=new n.Rect(r,i,o,a)),this.viewer){var l=this.viewer.world.getItemCount();if(l>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(l===1){var u=this.viewer.world.getItemAt(0);return u.viewportToImageRectangle(r,i,o,a,!0)}}var c=this.viewportToImageCoordinates(s.x,s.y),d=this._viewportToImageDelta(s.width,s.height);return new n.Rect(c.x,c.y,d.x,d.y,s.degrees)},viewerElementToImageCoordinates:function(r){var i=this.pointFromPixel(r,!0);return this.viewportToImageCoordinates(i)},imageToViewerElementCoordinates:function(r){var i=this.imageToViewportCoordinates(r);return this.pixelFromPoint(i,!0)},windowToImageCoordinates:function(r){n.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var i=r.minus(n.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(i)},imageToWindowCoordinates:function(r){n.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var i=this.imageToViewerElementCoordinates(r);return i.plus(n.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(r){return this.pointFromPixel(r,!0)},viewportToViewerElementCoordinates:function(r){return this.pixelFromPoint(r,!0)},viewerElementToViewportRectangle:function(r){return n.Rect.fromSummits(this.pointFromPixel(r.getTopLeft(),!0),this.pointFromPixel(r.getTopRight(),!0),this.pointFromPixel(r.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(r){return n.Rect.fromSummits(this.pixelFromPoint(r.getTopLeft(),!0),this.pixelFromPoint(r.getTopRight(),!0),this.pixelFromPoint(r.getBottomLeft(),!0))},windowToViewportCoordinates:function(r){n.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var i=r.minus(n.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(i)},viewportToWindowCoordinates:function(r){n.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var i=this.viewportToViewerElementCoordinates(r);return i.plus(n.getElementPosition(this.viewer.element))},viewportToImageZoom:function(r){if(this.viewer){var i=this.viewer.world.getItemCount();if(i>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(i===1){var o=this.viewer.world.getItemAt(0);return o.viewportToImageZoom(r)}}var a=this._contentSizeNoRotate.x,s=this._containerInnerSize.x,l=this._contentBoundsNoRotate.width,u=s/a*l;return r*u},imageToViewportZoom:function(r){if(this.viewer){var i=this.viewer.world.getItemCount();if(i>1)this.silenceMultiImageWarnings||n.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image. Instead, use [TiledImage.imageToViewportZoom] for the specific image of interest");else if(i===1){var o=this.viewer.world.getItemAt(0);return o.imageToViewportZoom(r)}}var a=this._contentSizeNoRotate.x,s=this._containerInnerSize.x,l=this._contentBoundsNoRotate.width,u=a/s/l;return r*u},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(r){return this.flipped===r?this:(this.flipped=r,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:r}),this)},getMaxZoomPixelRatio:function(){return this.maxZoomPixelRatio},setMaxZoomPixelRatio:function(r,i=!0,o=!1){n.console.assert(!isNaN(r),"[Viewport.setMaxZoomPixelRatio] ratio must be a number"),!isNaN(r)&&(this.maxZoomPixelRatio=r,i&&this.getZoom()>this.getMaxZoom()&&this.applyConstraints(o))}}}(t),function(n){n.TiledImage=function(r){this._initialized=!1,n.console.assert(r.tileCache,"[TiledImage] options.tileCache is required"),n.console.assert(r.drawer,"[TiledImage] options.drawer is required"),n.console.assert(r.viewer,"[TiledImage] options.viewer is required"),n.console.assert(r.imageLoader,"[TiledImage] options.imageLoader is required"),n.console.assert(r.source,"[TiledImage] options.source is required"),n.console.assert(!r.clip||r.clip instanceof n.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),n.EventSource.call(this),this._tileCache=r.tileCache,delete r.tileCache,this._drawer=r.drawer,delete r.drawer,this._imageLoader=r.imageLoader,delete r.imageLoader,r.clip instanceof n.Rect&&(this._clip=r.clip.clone()),delete r.clip;var i=r.x||0;delete r.x;var o=r.y||0;delete r.y,this.normHeight=r.source.dimensions.y/r.source.dimensions.x,this.contentAspectX=r.source.dimensions.x/r.source.dimensions.y;var a=1;r.width?(a=r.width,delete r.width,r.height&&(n.console.error("specifying both width and height to a tiledImage is not supported"),delete r.height)):r.height&&(a=r.height/this.normHeight,delete r.height);var s=r.fitBounds;delete r.fitBounds;var l=r.fitBoundsPlacement||t.Placement.CENTER;delete r.fitBoundsPlacement;var u=r.degrees||0;delete r.degrees;var c=r.ajaxHeaders;delete r.ajaxHeaders,n.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_needsDraw:!0,_needsUpdate:!0,_hasOpaqueTile:!1,_tilesLoading:0,_tilesToDraw:[],_lastDrawn:[],_isBlending:!1,_wasBlending:!1,_isTainted:!1,springStiffness:n.DEFAULT_SETTINGS.springStiffness,animationTime:n.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:n.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:n.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:n.DEFAULT_SETTINGS.wrapVertical,immediateRender:n.DEFAULT_SETTINGS.immediateRender,blendTime:n.DEFAULT_SETTINGS.blendTime,alwaysBlend:n.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:n.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:n.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:n.DEFAULT_SETTINGS.iOSDevice,debugMode:n.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:n.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:n.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:n.DEFAULT_SETTINGS.placeholderFillStyle,opacity:n.DEFAULT_SETTINGS.opacity,preload:n.DEFAULT_SETTINGS.preload,compositeOperation:n.DEFAULT_SETTINGS.compositeOperation,subPixelRoundingForTransparency:n.DEFAULT_SETTINGS.subPixelRoundingForTransparency,maxTilesPerFrame:n.DEFAULT_SETTINGS.maxTilesPerFrame},r),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new n.Spring({initial:i,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new n.Spring({initial:o,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new n.Spring({initial:a,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new n.Spring({initial:u,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),s&&this.fitBounds(s,l,!0),this._ownAjaxHeaders={},this.setAjaxHeaders(c,!1),this._initialized=!0},n.extend(n.TiledImage.prototype,n.EventSource.prototype,{needsDraw:function(){return this._needsDraw},redraw:function(){this._needsDraw=!0},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(r){r!==this._fullyLoaded&&(this._fullyLoaded=r,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=n.now(),this._needsDraw=!0},update:function(r){let i=this._xSpring.update(),o=this._ySpring.update(),a=this._scaleSpring.update(),s=this._degreesSpring.update(),l=i||o||a||s||this._needsUpdate;if(l||r||!this._fullyLoaded){let u=this._updateLevelsForViewport();this._setFullyLoaded(u)}return this._needsUpdate=!1,l?(this._updateForScale(),this._raiseBoundsChange(),this._needsDraw=!0,!0):!1},setDrawn:function(){return this._needsDraw=this._isBlending||this._wasBlending,this._needsDraw},setTainted(r){this._isTainted=r},isTainted(){return this._isTainted},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy(this.viewer)},getBounds:function(r){return this.getBoundsNoRotate(r).rotate(this.getRotation(r),this._getRotationPoint(r))},getBoundsNoRotate:function(r){return r?new n.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new n.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return n.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(r){var i=this.getBoundsNoRotate(r);if(this._clip){var o=r?this._worldWidthCurrent:this._worldWidthTarget,a=o/this.source.dimensions.x,s=this._clip.times(a);i=new n.Rect(i.x+s.x,i.y+s.y,s.width,s.height)}return i.rotate(this.getRotation(r),this._getRotationPoint(r))},getTileBounds:function(r,i,o){var a=this.source.getNumTiles(r),s=(a.x+i%a.x)%a.x,l=(a.y+o%a.y)%a.y,u=this.source.getTileBounds(r,s,l);return this.getFlip()&&(u.x=Math.max(0,1-u.x-u.width)),u.x+=(i-s)/a.x,u.y+=this._worldHeightCurrent/this._worldWidthCurrent*((o-l)/a.y),u},getContentSize:function(){return new n.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var r=this.imageToWindowCoordinates(new n.Point(0,0)),i=this.imageToWindowCoordinates(this.getContentSize());return new n.Point(i.x-r.x,i.y-r.y)},_viewportToImageDelta:function(r,i,o){var a=o?this._scaleSpring.current.value:this._scaleSpring.target.value;return new n.Point(r*(this.source.dimensions.x/a),i*(this.source.dimensions.y*this.contentAspectX/a))},viewportToImageCoordinates:function(r,i,o){var a;return r instanceof n.Point?(o=i,a=r):a=new n.Point(r,i),a=a.rotate(-this.getRotation(o),this._getRotationPoint(o)),o?this._viewportToImageDelta(a.x-this._xSpring.current.value,a.y-this._ySpring.current.value):this._viewportToImageDelta(a.x-this._xSpring.target.value,a.y-this._ySpring.target.value)},_imageToViewportDelta:function(r,i,o){var a=o?this._scaleSpring.current.value:this._scaleSpring.target.value;return new n.Point(r/this.source.dimensions.x*a,i/this.source.dimensions.y/this.contentAspectX*a)},imageToViewportCoordinates:function(r,i,o){r instanceof n.Point&&(o=i,i=r.y,r=r.x);var a=this._imageToViewportDelta(r,i,o);return o?(a.x+=this._xSpring.current.value,a.y+=this._ySpring.current.value):(a.x+=this._xSpring.target.value,a.y+=this._ySpring.target.value),a.rotate(this.getRotation(o),this._getRotationPoint(o))},imageToViewportRectangle:function(r,i,o,a,s){var l=r;l instanceof n.Rect?s=i:l=new n.Rect(r,i,o,a);var u=this.imageToViewportCoordinates(l.getTopLeft(),s),c=this._imageToViewportDelta(l.width,l.height,s);return new n.Rect(u.x,u.y,c.x,c.y,l.degrees+this.getRotation(s))},viewportToImageRectangle:function(r,i,o,a,s){var l=r;r instanceof n.Rect?s=i:l=new n.Rect(r,i,o,a);var u=this.viewportToImageCoordinates(l.getTopLeft(),s),c=this._viewportToImageDelta(l.width,l.height,s);return new n.Rect(u.x,u.y,c.x,c.y,l.degrees-this.getRotation(s))},viewerElementToImageCoordinates:function(r){var i=this.viewport.pointFromPixel(r,!0);return this.viewportToImageCoordinates(i)},imageToViewerElementCoordinates:function(r){var i=this.imageToViewportCoordinates(r);return this.viewport.pixelFromPoint(i,!0)},windowToImageCoordinates:function(r){var i=r.minus(t.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(i)},imageToWindowCoordinates:function(r){var i=this.imageToViewerElementCoordinates(r);return i.plus(t.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(r){var i=this._scaleSpring.current.value;return r=r.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new n.Rect((r.x-this._xSpring.current.value)/i,(r.y-this._ySpring.current.value)/i,r.width/i,r.height/i,r.degrees)},viewportToImageZoom:function(r){var i=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return i*r},imageToViewportZoom:function(r){var i=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return r/i},setPosition:function(r,i){var o=this._xSpring.target.value===r.x&&this._ySpring.target.value===r.y;if(i){if(o&&this._xSpring.current.value===r.x&&this._ySpring.current.value===r.y)return;this._xSpring.resetTo(r.x),this._ySpring.resetTo(r.y),this._needsDraw=!0,this._needsUpdate=!0}else{if(o)return;this._xSpring.springTo(r.x),this._ySpring.springTo(r.y),this._needsDraw=!0,this._needsUpdate=!0}o||this._raiseBoundsChange()},setWidth:function(r,i){this._setScale(r,i)},setHeight:function(r,i){this._setScale(r/this.normHeight,i)},setCroppingPolygons:function(r){var i=function(a){return a instanceof n.Point||typeof a.x=="number"&&typeof a.y=="number"},o=function(a){return a.map(function(s){try{if(i(s))return{x:s.x,y:s.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!n.isArray(r))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=r.map(function(a){return o(a)}),this._needsDraw=!0}catch(a){n.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),n.console.error(a),this.resetCroppingPolygons()}},resetCroppingPolygons:function(){this._croppingPolygons=null,this._needsDraw=!0},fitBounds:function(r,i,o){i=i||n.Placement.CENTER;var a=n.Placement.properties[i],s=this.contentAspectX,l=0,u=0,c=1,d=1;if(this._clip&&(s=this._clip.getAspectRatio(),c=this._clip.width/this.source.dimensions.x,d=this._clip.height/this.source.dimensions.y,r.getAspectRatio()>s?(l=this._clip.x/this._clip.height*r.height,u=this._clip.y/this._clip.height*r.height):(l=this._clip.x/this._clip.width*r.width,u=this._clip.y/this._clip.width*r.width)),r.getAspectRatio()>s){var f=r.height/d,h=0;a.isHorizontallyCentered?h=(r.width-r.height*s)/2:a.isRight&&(h=r.width-r.height*s),this.setPosition(new n.Point(r.x-l+h,r.y-u),o),this.setHeight(f,o)}else{var g=r.width/c,p=0;a.isVerticallyCentered?p=(r.height-r.width/s)/2:a.isBottom&&(p=r.height-r.width/s),this.setPosition(new n.Point(r.x-l,r.y-u+p),o),this.setWidth(g,o)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(r){n.console.assert(!r||r instanceof n.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),r instanceof n.Rect?this._clip=r.clone():this._clip=null,this._needsUpdate=!0,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return this.flipped},setFlip:function(r){this.flipped=r},get flipped(){return this._flipped},set flipped(r){let i=this._flipped!==!!r;this._flipped=!!r,i&&(this.update(!0),this._needsDraw=!0,this._raiseBoundsChange())},get wrapHorizontal(){return this._wrapHorizontal},set wrapHorizontal(r){let i=this._wrapHorizontal!==!!r;this._wrapHorizontal=!!r,this._initialized&&i&&(this.update(!0),this._needsDraw=!0)},get wrapVertical(){return this._wrapVertical},set wrapVertical(r){let i=this._wrapVertical!==!!r;this._wrapVertical=!!r,this._initialized&&i&&(this.update(!0),this._needsDraw=!0)},get debugMode(){return this._debugMode},set debugMode(r){this._debugMode=!!r,this._needsDraw=!0},getOpacity:function(){return this.opacity},setOpacity:function(r){this.opacity=r},get opacity(){return this._opacity},set opacity(r){r!==this.opacity&&(this._opacity=r,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(r){this._preload=!!r,this._needsDraw=!0},getRotation:function(r){return r?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(r,i){this._degreesSpring.target.value===r&&this._degreesSpring.isAtTargetValue()||(i?this._degreesSpring.resetTo(r):this._degreesSpring.springTo(r),this._needsDraw=!0,this._needsUpdate=!0,this._raiseBoundsChange())},getDrawArea:function(){if(this._opacity===0&&!this._preload)return!1;var r=this._viewportToTiledImageRectangle(this.viewport.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var i=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));r=r.intersection(i)}return r},getTilesToDraw:function(){let r=this._tilesToDraw.flat();return this._updateTilesInViewport(r),r=this._tilesToDraw.flat(),r.forEach(i=>{i.tile.beingDrawn=!0}),this._lastDrawn=r,r},_getRotationPoint:function(r){return this.getBoundsNoRotate(r).getCenter()},get compositeOperation(){return this._compositeOperation},set compositeOperation(r){r!==this._compositeOperation&&(this._compositeOperation=r,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this._compositeOperation}))},getCompositeOperation:function(){return this._compositeOperation},setCompositeOperation:function(r){this.compositeOperation=r},setAjaxHeaders:function(r,i){if(r===null&&(r={}),!n.isPlainObject(r)){console.error("[TiledImage.setAjaxHeaders] Ignoring invalid headers, must be a plain object");return}this._ownAjaxHeaders=r,this._updateAjaxHeaders(i)},_updateAjaxHeaders:function(r){if(r===void 0&&(r=!0),n.isPlainObject(this.viewer.ajaxHeaders)?this.ajaxHeaders=n.extend({},this.viewer.ajaxHeaders,this._ownAjaxHeaders):this.ajaxHeaders=this._ownAjaxHeaders,r){var i,o,a,s;for(var l in this.tilesMatrix){i=this.source.getNumTiles(l);for(var u in this.tilesMatrix[l]){o=(i.x+u%i.x)%i.x;for(var c in this.tilesMatrix[l][u])if(a=(i.y+c%i.y)%i.y,s=this.tilesMatrix[l][u][c],s.loadWithAjax=this.loadTilesWithAjax,s.loadWithAjax){var d=this.source.getTileAjaxHeaders(l,o,a);s.ajaxHeaders=n.extend({},this.ajaxHeaders,d)}else s.ajaxHeaders=null}}for(var f=0;f<this._imageLoader.jobQueue.length;f++){var h=this._imageLoader.jobQueue[f];h.loadWithAjax=h.tile.loadWithAjax,h.ajaxHeaders=h.tile.loadWithAjax?h.tile.ajaxHeaders:null}}},_setScale:function(r,i){var o=this._scaleSpring.target.value===r;if(i){if(o&&this._scaleSpring.current.value===r)return;this._scaleSpring.resetTo(r),this._updateForScale(),this._needsDraw=!0,this._needsUpdate=!0}else{if(o)return;this._scaleSpring.springTo(r),this._updateForScale(),this._needsDraw=!0,this._needsUpdate=!0}o||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 r=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),i=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,o=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(i/this.minPixelRatio)/Math.log(2))));return o=Math.max(o,this.source.minLevel||0),r=Math.min(r,o),{lowestLevel:r,highestLevel:o}},_updateLevelsForViewport:function(){var r=this._getLevelsInterval(),i=r.lowestLevel,o=r.highestLevel,a=[],s=this.getDrawArea(),l=n.now();if(this._lastDrawn.forEach(R=>{R.tile.beingDrawn=!1}),this._tilesToDraw=[],this._tilesLoading=0,this.loadingCoverage={},!s)return this._needsDraw=!1,this._fullyLoaded;var u=new Array(o-i+1);for(let R=0,M=o;M>=i;M--,R++)u[R]=M;for(let R=o+1;R<=this.source.maxLevel;R++){var c=this.tilesMatrix[R]&&this.tilesMatrix[R][0]&&this.tilesMatrix[R][0][0];if(c&&c.isBottomMost&&c.isRightMost&&c.loaded){u.push(R);break}}let d=!1;for(let R=0;R<u.length;R++){let M=u[R];var f=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(M),!0).x*this._scaleSpring.current.value;if(R===u.length-1||f>=this.minPixelRatio)d=!0;else if(!d)continue;var h=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(M),!1).x*this._scaleSpring.current.value,g=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,p=this.immediateRender?1:g,v=Math.min(1,(f-.5)/.5),m=p/Math.abs(p-h),y=this._updateLevel(M,v,m,s,l,a);a=y.bestTiles;var E=y.updatedTiles.filter(C=>C.loaded),b=function(C,D,F){return function(L){return{tile:L,level:C,levelOpacity:D,currentTime:F}}}(M,v,l);if(this._tilesToDraw[M]=E.map(b),this._providesCoverage(this.coverage,M))break}return a&&a.length>0?(a.forEach(function(R){R&&!R.context2D&&this._loadTile(R,l)},this),this._needsDraw=!0,!1):this._tilesLoading===0},_updateTilesInViewport:function(r){let i=n.now(),o=this;this._tilesLoading=0,this._wasBlending=this._isBlending,this._isBlending=!1,this.loadingCoverage={};let a=r.length?r[0].level:0;if(!this.getDrawArea())return;function l(c){let d=c.tile;if(d&&d.loaded){let f=o._blendTile(d,d.x,d.y,c.level,c.levelOpacity,i,a);o._isBlending=o._isBlending||f,o._needsDraw=o._needsDraw||f||o._wasBlending}}let u=0;for(let c=0;c<r.length;c++){let d=r[c];l(d),this._providesCoverage(this.coverage,d.level)&&(u=Math.max(u,d.level))}if(u>0)for(let c in this._tilesToDraw)c<u&&delete this._tilesToDraw[c]},_blendTile:function(r,i,o,a,s,l,u){let c=1e3*this.blendTime,d,f;return r.blendStart||(r.blendStart=l),d=l-r.blendStart,f=c?Math.min(1,d/c):1,a===u&&(f=1,d=c),this.alwaysBlend&&(f*=s),r.opacity=f,f===1&&(this._setCoverage(this.coverage,a,i,o,!0),this._hasOpaqueTile=!0),d<c},_updateLevel:function(r,i,o,a,s,l){var u=a.getBoundingBox().getTopLeft(),c=a.getBoundingBox().getBottomRight();this.viewer&&this.viewer.raiseEvent("update-level",{tiledImage:this,havedrawn:!0,level:r,opacity:i,visibility:o,drawArea:a,topleft:u,bottomright:c,currenttime:s,best:l}),this._resetCoverage(this.coverage,r),this._resetCoverage(this.loadingCoverage,r);var d=this._getCornerTiles(r,u,c),f=d.topLeft,h=d.bottomRight,g=this.source.getNumTiles(r),p=this.viewport.pixelFromPoint(this.viewport.getCenter());this.getFlip()&&(h.x+=1,this.wrapHorizontal||(h.x=Math.min(h.x,g.x-1)));for(var v=Math.max(0,(h.x-f.x)*(h.y-f.y)),m=new Array(v),y=0,E=f.x;E<=h.x;E++)for(var b=f.y;b<=h.y;b++){var R;if(this.getFlip()){var M=(g.x+E%g.x)%g.x;R=E+g.x-M-M-1}else R=E;if(a.intersection(this.getTileBounds(r,R,b))!==null){var C=this._updateTile(R,b,r,o,p,g,s,l);l=C.bestTiles,m[y]=C.tile,y+=1}}return{bestTiles:l,updatedTiles:m}},_positionTile:function(r,i,o,a,s){var l=r.bounds.getTopLeft();l.x*=this._scaleSpring.current.value,l.y*=this._scaleSpring.current.value,l.x+=this._xSpring.current.value,l.y+=this._ySpring.current.value;var u=r.bounds.getSize();u.x*=this._scaleSpring.current.value,u.y*=this._scaleSpring.current.value,r.positionedBounds.x=l.x,r.positionedBounds.y=l.y,r.positionedBounds.width=u.x,r.positionedBounds.height=u.y;var c=o.pixelFromPointNoRotate(l,!0),d=o.pixelFromPointNoRotate(l,!1),f=o.deltaPixelsFromPointsNoRotate(u,!0),h=o.deltaPixelsFromPointsNoRotate(u,!1),g=d.plus(h.divide(2)),p=a.squaredDistanceTo(g);this.viewer.drawer.minimumOverlapRequired(this)&&(i||(f=f.plus(new n.Point(1,1))),r.isRightMost&&this.wrapHorizontal&&(f.x+=.75),r.isBottomMost&&this.wrapVertical&&(f.y+=.75)),r.position=c,r.size=f,r.squaredDistance=p,r.visibility=s},_updateTile:function(r,i,o,a,s,l,u,c){var d=this._getTile(r,i,o,u,l);this.viewer&&this.viewer.raiseEvent("update-tile",{tiledImage:this,tile:d}),this._setCoverage(this.coverage,o,r,i,!1);var f=d.loaded||d.loading||this._isCovered(this.loadingCoverage,o,r,i);if(this._setCoverage(this.loadingCoverage,o,r,i,f),!d.exists)return{bestTiles:c,tile:d};if(d.loaded&&d.opacity===1&&this._setCoverage(this.coverage,o,r,i,!0),this._positionTile(d,this.source.tileOverlap,this.viewport,s,a),!d.loaded)if(d.context2D)this._setTileLoaded(d);else{var h=this._tileCache.getImageRecord(d.cacheKey);h&&this._setTileLoaded(d,h.getData())}return d.loading?this._tilesLoading++:f||(c=this._compareTiles(c,d,this.maxTilesPerFrame)),{bestTiles:c,tile:d}},_getCornerTiles:function(r,i,o){var a,s;this.wrapHorizontal?(a=n.positiveModulo(i.x,1),s=n.positiveModulo(o.x,1)):(a=Math.max(0,i.x),s=Math.min(1,o.x));var l,u,c=1/this.source.aspectRatio;this.wrapVertical?(l=n.positiveModulo(i.y,c),u=n.positiveModulo(o.y,c)):(l=Math.max(0,i.y),u=Math.min(c,o.y));var d=this.source.getTileAtPoint(r,new n.Point(a,l)),f=this.source.getTileAtPoint(r,new n.Point(s,u)),h=this.source.getNumTiles(r);return this.wrapHorizontal&&(d.x+=h.x*Math.floor(i.x),f.x+=h.x*Math.floor(o.x)),this.wrapVertical&&(d.y+=h.y*Math.floor(i.y/c),f.y+=h.y*Math.floor(o.y/c)),{topLeft:d,bottomRight:f}},_getTile:function(r,i,o,a,s){var l,u,c,d,f,h,g,p,v,m,y=this.tilesMatrix,E=this.source;return y[o]||(y[o]={}),y[o][r]||(y[o][r]={}),(!y[o][r][i]||!y[o][r][i].flipped!=!this.flipped)&&(l=(s.x+r%s.x)%s.x,u=(s.y+i%s.y)%s.y,c=this.getTileBounds(o,r,i),d=E.getTileBounds(o,l,u,!0),f=E.tileExists(o,l,u),h=E.getTileUrl(o,l,u),g=E.getTilePostData(o,l,u),this.loadTilesWithAjax?(p=E.getTileAjaxHeaders(o,l,u),n.isPlainObject(this.ajaxHeaders)&&(p=n.extend({},this.ajaxHeaders,p))):p=null,v=E.getContext2D?E.getContext2D(o,l,u):void 0,m=new n.Tile(o,r,i,c,f,h,v,this.loadTilesWithAjax,p,d,g,E.getTileHashKey(o,l,u,h,p,g)),this.getFlip()?l===0&&(m.isRightMost=!0):l===s.x-1&&(m.isRightMost=!0),u===s.y-1&&(m.isBottomMost=!0),m.flipped=this.flipped,y[o][r][i]=m),m=y[o][r][i],m.lastTouchTime=a,m},_loadTile:function(r,i){var o=this;r.loading=!0,this._imageLoader.addJob({src:r.getUrl(),tile:r,source:this.source,postData:r.postData,loadWithAjax:r.loadWithAjax,ajaxHeaders:r.ajaxHeaders,crossOriginPolicy:this.crossOriginPolicy,ajaxWithCredentials:this.ajaxWithCredentials,callback:function(a,s,l){o._onTileLoad(r,i,a,s,l)},abort:function(){r.loading=!1}})},_onTileLoad:function(r,i,o,a,s){if(o)r.exists=!0;else{n.console.error("Tile %s failed to load: %s - error: %s",r,r.getUrl(),a),this.viewer.raiseEvent("tile-load-failed",{tile:r,tiledImage:this,time:i,message:a,tileRequest:s}),r.loading=!1,r.exists=!1;return}if(i<this.lastResetTime){n.console.warn("Ignoring tile %s loaded before reset: %s",r,r.getUrl()),r.loading=!1;return}var l=this,u=function(){var c=l.source,d=c.getClosestLevel();l._setTileLoaded(r,o,d,s)};u()},_setTileLoaded:function(r,i,o,a){var s=0,l=!1,u=this;function c(){return l&&n.console.error("Event 'tile-loaded' argument getCompletionCallback must be called synchronously. Its return value should be called asynchronously."),s++,d}function d(){s--,s===0&&(r.loading=!1,r.loaded=!0,r.hasTransparency=u.source.hasTransparency(r.context2D,r.getUrl(),r.ajaxHeaders,r.postData),r.context2D||u._tileCache.cacheTile({data:i,tile:r,cutoff:o,tiledImage:u}),u.viewer.raiseEvent("tile-ready",{tile:r,tiledImage:u,tileRequest:a}),u._needsDraw=!0)}var f=c();this.viewer.raiseEvent("tile-loaded",{tile:r,tiledImage:this,tileRequest:a,get image(){return n.console.error("[tile-loaded] event 'image' has been deprecated. Use 'data' property instead."),i},data:i,getCompletionCallback:c}),l=!0,f()},_compareTiles:function(r,i,o){return r?(r.push(i),this._sortTiles(r),r.length>o&&r.pop(),r):[i]},_sortTiles:function(r){r.sort(function(i,o){return i===null?1:o===null?-1:i.visibility===o.visibility?i.squaredDistance-o.squaredDistance:o.visibility-i.visibility})},_providesCoverage:function(r,i,o,a){var s,l,u,c;if(!r[i])return!1;if(o===void 0||a===void 0){s=r[i];for(u in s)if(Object.prototype.hasOwnProperty.call(s,u)){l=s[u];for(c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&!l[c])return!1}return!0}return r[i][o]===void 0||r[i][o][a]===void 0||r[i][o][a]===!0},_isCovered:function(r,i,o,a){return o===void 0||a===void 0?this._providesCoverage(r,i+1):this._providesCoverage(r,i+1,2*o,2*a)&&this._providesCoverage(r,i+1,2*o,2*a+1)&&this._providesCoverage(r,i+1,2*o+1,2*a)&&this._providesCoverage(r,i+1,2*o+1,2*a+1)},_setCoverage:function(r,i,o,a,s){if(!r[i]){n.console.warn("Setting coverage for a tile before its level's coverage has been reset: %s",i);return}r[i][o]||(r[i][o]={}),r[i][o][a]=s},_resetCoverage:function(r,i){r[i]={}}})}(t),function(n){var r=function(o){n.console.assert(o,"[TileCache.cacheTile] options is required"),n.console.assert(o.tile,"[TileCache.cacheTile] options.tile is required"),n.console.assert(o.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=o.tile,this.tiledImage=o.tiledImage},i=function(o){n.console.assert(o,"[ImageRecord] options is required"),n.console.assert(o.data,"[ImageRecord] options.data is required"),this._tiles=[],o.create.apply(null,[this,o.data,o.ownerTile]),this._destroyImplementation=o.destroy.bind(null,this),this.getImage=o.getImage.bind(null,this),this.getData=o.getData.bind(null,this),this.getRenderedContext=o.getRenderedContext.bind(null,this)};i.prototype={destroy:function(){this._destroyImplementation(),this._tiles=null},addTile:function(o){n.console.assert(o,"[ImageRecord.addTile] tile is required"),this._tiles.push(o)},removeTile:function(o){for(var a=0;a<this._tiles.length;a++)if(this._tiles[a]===o){this._tiles.splice(a,1);return}n.console.warn("[ImageRecord.removeTile] trying to remove unknown tile",o)},getTileCount:function(){return this._tiles.length}},n.TileCache=function(o){o=o||{},this._maxImageCacheCount=o.maxImageCacheCount||n.DEFAULT_SETTINGS.maxImageCacheCount,this._tilesLoaded=[],this._imagesLoaded=[],this._imagesLoadedCount=0},n.TileCache.prototype={numTilesLoaded:function(){return this._tilesLoaded.length},cacheTile:function(o){n.console.assert(o,"[TileCache.cacheTile] options is required"),n.console.assert(o.tile,"[TileCache.cacheTile] options.tile is required"),n.console.assert(o.tile.cacheKey,"[TileCache.cacheTile] options.tile.cacheKey is required"),n.console.assert(o.tiledImage,"[TileCache.cacheTile] options.tiledImage is required");var a=o.cutoff||0,s=this._tilesLoaded.length,l=this._imagesLoaded[o.tile.cacheKey];if(l||(o.data||(n.console.error("[TileCache.cacheTile] options.image was renamed to options.data. '.image' attribute has been deprecated and will be removed in the future."),o.data=o.image),n.console.assert(o.data,"[TileCache.cacheTile] options.data is required to create an ImageRecord"),l=this._imagesLoaded[o.tile.cacheKey]=new i({data:o.data,ownerTile:o.tile,create:o.tiledImage.source.createTileCache,destroy:o.tiledImage.source.destroyTileCache,getImage:o.tiledImage.source.getTileCacheDataAsImage,getData:o.tiledImage.source.getTileCacheData,getRenderedContext:o.tiledImage.source.getTileCacheDataAsContext2D}),this._imagesLoadedCount++),l.addTile(o.tile),o.tile.cacheImageRecord=l,this._imagesLoadedCount>this._maxImageCacheCount){for(var u=null,c=-1,d=null,f,h,g,p,v,m,y=this._tilesLoaded.length-1;y>=0;y--)if(m=this._tilesLoaded[y],f=m.tile,!(f.level<=a||f.beingDrawn)){if(!u){u=f,c=y,d=m;continue}p=f.lastTouchTime,h=u.lastTouchTime,v=f.level,g=u.level,(p<h||p===h&&v>g)&&(u=f,c=y,d=m)}u&&c>=0&&(this._unloadTile(d),s=c)}this._tilesLoaded[s]=new r({tile:o.tile,tiledImage:o.tiledImage})},clearTilesFor:function(o){n.console.assert(o,"[TileCache.clearTilesFor] tiledImage is required");for(var a,s=0;s<this._tilesLoaded.length;++s)a=this._tilesLoaded[s],a.tiledImage===o&&(this._unloadTile(a),this._tilesLoaded.splice(s,1),s--)},getImageRecord:function(o){return n.console.assert(o,"[TileCache.getImageRecord] cacheKey is required"),this._imagesLoaded[o]},_unloadTile:function(o){n.console.assert(o,"[TileCache._unloadTile] tileRecord is required");var a=o.tile,s=o.tiledImage;let l=a.getCanvasContext&&a.getCanvasContext();a.unload(),a.cacheImageRecord=null;var u=this._imagesLoaded[a.cacheKey];u&&(u.removeTile(a),u.getTileCount()||(u.destroy(),delete this._imagesLoaded[a.cacheKey],this._imagesLoadedCount--,l&&(l.canvas.width=0,l.canvas.height=0,s.viewer.raiseEvent("image-unloaded",{context2D:l,tile:a}))),s.viewer.raiseEvent("tile-unloaded",{tile:a,tiledImage:s}))}}}(t),function(n){n.World=function(r){var i=this;n.console.assert(r.viewer,"[World] options.viewer is required"),n.EventSource.call(this),this.viewer=r.viewer,this._items=[],this._needsDraw=!1,this._autoRefigureSizes=!0,this._needsSizesFigured=!1,this._delegatedFigureSizes=function(o){i._autoRefigureSizes?i._figureSizes():i._needsSizesFigured=!0},this._figureSizes()},n.extend(n.World.prototype,n.EventSource.prototype,{addItem:function(r,i){if(n.console.assert(r,"[World.addItem] item is required"),n.console.assert(r instanceof n.TiledImage,"[World.addItem] only TiledImages supported at this time"),i=i||{},i.index!==void 0){var o=Math.max(0,Math.min(this._items.length,i.index));this._items.splice(o,0,r)}else this._items.push(r);this._autoRefigureSizes?this._figureSizes():this._needsSizesFigured=!0,this._needsDraw=!0,r.addHandler("bounds-change",this._delegatedFigureSizes),r.addHandler("clip-change",this._delegatedFigureSizes),this.raiseEvent("add-item",{item:r})},getItemAt:function(r){return n.console.assert(r!==void 0,"[World.getItemAt] index is required"),this._items[r]},getIndexOfItem:function(r){return n.console.assert(r,"[World.getIndexOfItem] item is required"),n.indexOf(this._items,r)},getItemCount:function(){return this._items.length},setItemIndex:function(r,i){n.console.assert(r,"[World.setItemIndex] item is required"),n.console.assert(i!==void 0,"[World.setItemIndex] index is required");var o=this.getIndexOfItem(r);if(i>=this._items.length)throw new Error("Index bigger than number of layers.");i===o||o===-1||(this._items.splice(o,1),this._items.splice(i,0,r),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:r,previousIndex:o,newIndex:i}))},removeItem:function(r){n.console.assert(r,"[World.removeItem] item is required");var i=n.indexOf(this._items,r);i!==-1&&(r.removeHandler("bounds-change",this._delegatedFigureSizes),r.removeHandler("clip-change",this._delegatedFigureSizes),r.destroy(),this._items.splice(i,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(r))},removeAll:function(){this.viewer._cancelPendingImages();var r,i;for(i=0;i<this._items.length;i++)r=this._items[i],r.removeHandler("bounds-change",this._delegatedFigureSizes),r.removeHandler("clip-change",this._delegatedFigureSizes),r.destroy();var o=this._items;for(this._items=[],this._figureSizes(),this._needsDraw=!0,i=0;i<o.length;i++)r=o[i],this._raiseRemoveItem(r)},resetItems:function(){for(var r=0;r<this._items.length;r++)this._items[r].reset()},update:function(r){for(var i=!1,o=0;o<this._items.length;o++)i=this._items[o].update(r)||i;return i},draw:function(){this.viewer.drawer.draw(this._items),this._needsDraw=!1,this._items.forEach(r=>{this._needsDraw=r.setDrawn()||this._needsDraw})},needsDraw:function(){for(var r=0;r<this._items.length;r++)if(this._items[r].needsDraw())return!0;return this._needsDraw},getHomeBounds:function(){return this._homeBounds.clone()},getContentFactor:function(){return this._contentFactor},setAutoRefigureSizes:function(r){this._autoRefigureSizes=r,r&this._needsSizesFigured&&(this._figureSizes(),this._needsSizesFigured=!1)},arrange:function(r){r=r||{};var i=r.immediately||!1,o=r.layout||n.DEFAULT_SETTINGS.collectionLayout,a=r.rows||n.DEFAULT_SETTINGS.collectionRows,s=r.columns||n.DEFAULT_SETTINGS.collectionColumns,l=r.tileSize||n.DEFAULT_SETTINGS.collectionTileSize,u=r.tileMargin||n.DEFAULT_SETTINGS.collectionTileMargin,c=l+u,d;!r.rows&&s?d=s:d=Math.ceil(this._items.length/a);var f=0,h=0,g,p,v,m,y;this.setAutoRefigureSizes(!1);for(var E=0;E<this._items.length;E++)E&&E%d===0&&(o==="horizontal"?(h+=c,f=0):(f+=c,h=0)),g=this._items[E],p=g.getBounds(),p.width>p.height?v=l:v=l*(p.width/p.height),m=v*(p.height/p.width),y=new n.Point(f+(l-v)/2,h+(l-m)/2),g.setPosition(y,i),g.setWidth(v,i),o==="horizontal"?f+=c:h+=c;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var r=this._homeBounds?this._homeBounds.clone():null,i=this._contentSize?this._contentSize.clone():null,o=this._contentFactor||0;if(!this._items.length)this._homeBounds=new n.Rect(0,0,1,1),this._contentSize=new n.Point(1,1),this._contentFactor=1;else{var a=this._items[0],s=a.getBounds();this._contentFactor=a.getContentSize().x/s.width;for(var l=a.getClippedBounds().getBoundingBox(),u=l.x,c=l.y,d=l.x+l.width,f=l.y+l.height,h=1;h<this._items.length;h++)a=this._items[h],s=a.getBounds(),this._contentFactor=Math.max(this._contentFactor,a.getContentSize().x/s.width),l=a.getClippedBounds().getBoundingBox(),u=Math.min(u,l.x),c=Math.min(c,l.y),d=Math.max(d,l.x+l.width),f=Math.max(f,l.y+l.height);this._homeBounds=new n.Rect(u,c,d-u,f-c),this._contentSize=new n.Point(this._homeBounds.width*this._contentFactor,this._homeBounds.height*this._contentFactor)}(this._contentFactor!==o||!this._homeBounds.equals(r)||!this._contentSize.equals(i))&&this.raiseEvent("metrics-change",{})},_raiseRemoveItem:function(r){this.raiseEvent("remove-item",{item:r})}})}(t)})(_D);var vve=_D.exports;const Jh=He(vve),yve={get(e){return this.refs[e]},refs:{},set(e,t){this.refs[e]=t}},TD=ie("section")({cursor:"grab",flex:1,position:"relative","& .openseadragon-canvas:focus, & .openseadragon-canvas:focus-visible, & .openseadragon-canvas:focus:focus-visible":{outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"-1px",outlineColor:"#101010",WebkitOutlineColor:"-webkit-focus-ring-color"}});let nw=class extends x.Component{constructor(t){super(t),this.state={viewer:void 0},this.ref=x.createRef(),this.apiRef=x.createRef(),yve.set(t.windowId,this.apiRef),this.onCanvasMouseMove=Ul(this.onCanvasMouseMove.bind(this),10),this.onViewportChange=this.onViewportChange.bind(this),this.zoomToWorld=this.zoomToWorld.bind(this),this.osdUpdating=!1,this.onZoom=this.onZoom.bind(this),this.onZoom=Ul(this.onZoom,67)}componentDidMount(){const{osdConfig:t,windowId:n,ngtvLayout:r}=this.props;if(!this.ref.current)return;const i=new Jh({id:this.ref.current.id,...t,...r==="banner"?{zoomInButton:`${n}-zoom-in`,zoomOutButton:`${n}-zoom-out`}:{}});!i.gestureSettingsMouse.scrollToZoom&&!i.gestureSettingsPen.scrollToZoom&&!i.gestureSettingsTouch.scrollToZoom&&!i.gestureSettingsUnknown.scrollToZoom&&(i.innerTracker.scrollHandler=null);const o=i.canvas;o&&(o.setAttribute("role","img"),o.setAttribute("aria-label","Zoomable image"),o.setAttribute("aria-describedby",`${n}-osd`)),this.apiRef.current=i,this.setState({viewer:i}),i.addHandler("animation-start",()=>{this.osdUpdating=!0}),i.addHandler("animation-finish",this.onViewportChange),i.addHandler("animation-finish",()=>{this.osdUpdating=!1}),i.addHandler("zoom",this.onZoom),i.innerTracker&&(i.innerTracker.moveHandler=this.onCanvasMouseMove)}componentWillUnmount(){const{viewer:t}=this.state;t.innerTracker&&t.innerTracker.moveHandler===this.onCanvasMouseMove&&(t.innerTracker.moveHandler=null),t.removeAllHandlers(),this.onCanvasMouseMove.cancel(),this.apiRef.current=void 0}onCanvasMouseMove(t){const{viewer:n}=this.state;n.raiseEvent("mouse-move",t)}canvasImageSmallerThanViewport(){const{canvasWorld:t,windowWidth:n,windowHeight:r}=this.props;return t.worldBounds()[2]!==0&&t.worldBounds()[3]!==0&&t.worldBounds()[2]<n&&t.worldBounds()[3]<r}getMaxZoomNoStretch(){const{viewer:t}=this.state;return t.viewport.imageToViewportZoom(1)}addNonTiledImage(t){const{canvasWorld:n}=this.props,{viewer:r}=this.state,i=t.getProperty("type"),o=t.getProperty("format")||"";return i==="Image"||i==="dctypes:Image"||o.startsWith("image/")?new Promise((a,s)=>{a(r.addSimpleImage({error:l=>s(l),fitBounds:new Jh.Rect(...n.contentResourceToWorldCoordinates(t)),index:n.layerIndexOfImageResource(t),opacity:n.layerOpacityOfImageResource(t),success:l=>a(l),url:t.id}))}):Promise.resolve()}addTileSource(t){const{canvasWorld:n}=this.props,{viewer:r}=this.state;return new Promise((i,o)=>{const a={...t.json},s=n.contentResource(t.id);s&&r.addTiledImage({error:l=>{console.log({error:l}),o(l)},fitBounds:new Jh.Rect(...n.contentResourceToWorldCoordinates(s)),index:n.layerIndexOfImageResource(s),opacity:n.layerOpacityOfImageResource(s),success:l=>i(l),tileSource:a})})}addAllImageSources(t=!0){const{nonTiledImages:n,infoResponses:r,handleZoomBtnVisibility:i}=this.props;return Promise.allSettled([...r.map(o=>this.addTileSource(o)),...n.map(o=>this.addNonTiledImage(o))]).then(()=>{r[0]||n[0]?(t&&this.zoomToWorld(),this.refreshTileProperties()):i!==void 0&&i(!1)})}refreshTileProperties(){const{canvasWorld:t}=this.props,{viewer:n}=this.state,{world:r}=n,i=[];for(let o=0;o<r.getItemCount();o+=1)i.push(r.getItemAt(o));i.forEach((o,a)=>{const s=t.contentResource(o.source["@id"]||o.source.id);if(!s)return;const l=t.layerIndexOfImageResource(s);a!==l&&r.setItemIndex(o,l),o.setOpacity(t.layerOpacityOfImageResource(s))})}infoResponsesMatch(t){const{infoResponses:n}=this.props;return n.length===0&&t.length===0?!0:n.length!==t.length?!1:n.every((r,i)=>!t[i]||!r.json||!t[i].json||r.tokenServiceId!==t[i].tokenServiceId?!1:!!(r.json["@id"]&&r.json["@id"]===t[i].json["@id"]||r.json.id&&r.json.id===t[i].json.id))}nonTiledImagedMatch(t){const{nonTiledImages:n}=this.props;return n.length===0&&t.length===0?!0:n.some((r,i)=>t[i]?r.id===t[i].id:!1)}adjustZoomButtons(t){const{handleZoomBtnVisibility:n}=this.props;n!==void 0&&n(!t)}handleImageFit(t){if(t){const{viewer:n}=this.state;n.viewport.zoomTo(this.getMaxZoomNoStretch())}}fitBounds(t,n,r,i,o=!0){const{viewer:a}=this.state;a&&a.viewport&&a.viewport.fitBounds(new Jh.Rect(t,n,r,i),o)}componentDidUpdate(t,n){const{viewerConfig:r,canvasWorld:i}=this.props,{viewer:o}=this.state;if(this.apiRef.current=o,n.viewer===void 0){r&&(o.viewport.panTo(r,!0),o.viewport.zoomTo(r.zoom,r,!0),r.degrees!==void 0&&o.viewport.setRotation(r.degrees),r.flip!==void 0&&o.viewport.setFlip(r.flip)),this.addAllImageSources(!r);return}if(!this.infoResponsesMatch(t.infoResponses)||!this.nonTiledImagedMatch(t.nonTiledImages)){o.close();const a=!G1(i.canvasIds,t.canvasWorld.canvasIds);this.addAllImageSources(a||!r)}else if(!G1(i.layers,t.canvasWorld.layers))this.refreshTileProperties();else if(r&&!this.osdUpdating){const{viewport:a}=o;(r.x!==a.centerSpringX.target.value||r.y!==a.centerSpringY.target.value)&&a.panTo(r,!1),r.zoom!==a.zoomSpring.target.value&&a.zoomTo(r.zoom,r,!1)}if(t.windowWidth!==this.props.windowWidth||t.windowHeight!==this.props.windowHeight){const a=this.canvasImageSmallerThanViewport();this.adjustZoomButtons(a),this.handleImageFit(a)}}onViewportChange(t){const{viewport:n}=t.eventSource,{updateViewport:r,windowId:i}=this.props,{viewer:o}=this.state,a=this.canvasImageSmallerThanViewport(),s=this.getMaxZoomNoStretch(),l=a?Math.min(n.getMinZoom(),s):n.getMinZoom(),u=a?s:n.getMaxZoom(),c=o.viewport.getBounds(),d=o.world.getItemAt(0).getBounds();c.x<d.x+d.width&&c.x+c.width>d.x&&c.y<d.y+d.height&&c.y+c.height>d.y||n.applyConstraints(),r(i,{flip:n.getFlip(),rotation:n.getRotation(),x:Math.round(n.centerSpringX.target.value),y:Math.round(n.centerSpringY.target.value),zoom:n.zoomSpring.target.value,minZoom:l,maxZoom:u})}onZoom(t){const{zoomPercentageChange:n}=this.props,{viewport:r}=t.eventSource;let i=0;const o=r.getZoom(),a=this.canvasImageSmallerThanViewport(),s=this.getMaxZoomNoStretch(),l=a?Math.min(r.getMinZoom(),s):r.getMinZoom(),u=a?s:r.getMaxZoom();o>u?(r.zoomTo(u),i=100):o<l?(r.zoomTo(l),i=0):i=(o-l)/(u-l)*100,i=Math.max(0,Math.min(100,i)),n!==void 0&&n(i)}zoomToWorld(t=!0){const{canvasWorld:n,loadSize:r="full",handleZoomBtnVisibility:i}=this.props;if(r==="cover"){const{viewer:o}=this.state,{focalPoint:a}=this.props,s={w:n.worldBounds()[2],h:n.worldBounds()[3]},l=o.viewport.getContainerSize(),u={x:s.w/l.x,y:s.h/l.y},c={l:a.left*s.w,t:a.top*s.h};let d,f,h,g;if(u.x<u.y?(h=s.w,g=s.w*l.y/l.x,d=0,f=c.t-g/2,f<0?f=0:f+g>s.h&&(f=s.h-g)):(g=s.h,h=s.h*l.x/l.y,f=0,d=c.l-h/2,d<0?d=0:d+h>s.w&&(d=s.w-h)),i!==void 0){let v=s.w<l.x&&s.h<l.y;i(!v)}let p=o.viewport.imageToViewportRectangle(d,f,h,g);this.fitBounds(p.x,p.y,p.width,p.height,t)}else{const o=this.canvasImageSmallerThanViewport();if(this.adjustZoomButtons(o),this.handleImageFit(o),!o){let a=n.worldBounds(),s=Math.max(a[2],a[3])*.06,l=s/2;this.fitBounds(-1*l,-1*l,a[2]+s,a[3]+s,t)}}}render(){const{children:t=null,label:n="",windowId:r,canTabIn:i=!0,ngtvLayout:o}=this.props;if(o==="banner")return S.jsx(TD,{className:je(ve("osd-container")),style:{cursor:"default"},id:`${r}-osd`,ref:this.ref,"aria-label":`Item: ${n}`,"aria-live":"polite"});{const{viewer:a}=this.state,s=x.Children.map(t,l=>x.cloneElement(l,{zoomToWorld:this.zoomToWorld}));return a&&a.canvas&&(i?a.canvas.setAttribute("tabIndex","0"):a.canvas.setAttribute("tabIndex","-1")),S.jsxs(TD,{className:je(ve("osd-container")),style:{cursor:"default"},id:`${r}-osd`,ref:this.ref,"aria-label":`Item: ${n}`,"aria-live":"polite",children:[s,S.jsx(r1,{viewer:a,...this.props,children:null})]})}}};nw.propTypes={label:A.string,windowId:A.string.isRequired,canvasWorld:A.instanceOf(XS).isRequired,updateViewport:A.func.isRequired,osdConfig:A.object,viewerConfig:A.object,ngtvLayout:A.string,focalPoint:A.shape({left:A.number,top:A.number}),infoResponses:A.arrayOf(A.object),nonTiledImages:A.array,loadSize:A.string,zoomPercentageChange:A.func,canTabIn:A.bool,children:A.node,windowWidth:A.number,windowHeight:A.number,handleZoomBtnVisibility:A.func},nw.defaultProps={children:null,infoResponses:[],label:null,nonTiledImages:[],osdConfig:{},viewerConfig:null};const wve=Me(Qe((e,{windowId:t})=>{const n=QS(e,{windowId:t}),r=Ia(e),i=Pe(n.canvases.map(s=>s.imageServiceIds)),o=yt(e,{windowId:t}),a=Ie(e).window;return{canvasWorld:n,infoResponses:i.map(s=>r[s]).filter(s=>s!==void 0&&s.isFetching===!1&&s.error===void 0),label:CS(e,{canvasId:(Ed(e,{windowId:t})||{}).id,windowId:t}),drawAnnotations:Ie(e).window.forceDrawAnnotations||dS(e,{content:"annotations",windowId:t}).length>0,nonTiledImages:Sd(e,{windowId:t}),osdConfig:Ie(e).osdConfig,viewerConfig:md(e,{windowId:t}),focalPoint:o.focalPt===void 0?a.focalPt:o.focalPt,loadSize:o.size===void 0?a.size:o.size,ngtvLayout:Ie(e).ngtvLayout}},{updateViewport:P0}),gt("OpenSeadragonViewer"))(nw),ED=Object.freeze(Object.defineProperty({__proto__:null,default:wve},Symbol.toStringTag,{value:"Module"}));mt.TheViewer=yie,Object.defineProperty(mt,Symbol.toStringTag,{value:"Module"})});;;
'use strict';class TabsAutomatic{static get INDEX_KEY(){return"tabIndex"};static get SELECTOR(){return"[data-ng-tablist='auto']"};constructor(groupNode){this.tablistNode=groupNode;this.tabs=[];this.firstTab=null;this.lastTab=null;this.tabs=Array.from(this.tablistNode.querySelectorAll('[role=tab]'));this.tabpanels=[];for(var i=0;i<this.tabs.length;i+=1){var tab=this.tabs[i];var tabpanel=document.getElementById(tab.getAttribute('aria-controls'));tab.tabIndex=-1;tab.setAttribute('aria-selected','false');this.tabpanels.push(tabpanel);tab.addEventListener('keydown',this.onKeydown.bind(this));tab.addEventListener('click',this.onClick.bind(this));if(!this.firstTab){this.firstTab=tab;}
this.lastTab=tab;}
this.setSelectedTab(this.firstTab,false);}
setSelectedTab(currentTab,setFocus){if(typeof setFocus!=='boolean'){setFocus=true;}
for(var i=0;i<this.tabs.length;i+=1){var tab=this.tabs[i];if(currentTab===tab){tab.setAttribute('aria-selected','true');tab.removeAttribute('tabindex');this.tabpanels[i].classList.remove('hidden');if(setFocus){tab.focus();}}else{tab.setAttribute('aria-selected','false');tab.tabIndex=-1;this.tabpanels[i].classList.add('hidden');}}}
setSelectedToPreviousTab(currentTab){var index;if(currentTab===this.firstTab){this.setSelectedTab(this.lastTab);}else{index=this.tabs.indexOf(currentTab);this.setSelectedTab(this.tabs[index-1]);}}
setSelectedToNextTab(currentTab){var index;if(currentTab===this.lastTab){this.setSelectedTab(this.firstTab);}else{index=this.tabs.indexOf(currentTab);this.setSelectedTab(this.tabs[index+1]);}}
onKeydown(event){var tgt=event.currentTarget,flag=false;switch(event.key){case'ArrowLeft':this.setSelectedToPreviousTab(tgt);flag=true;break;case'ArrowRight':this.setSelectedToNextTab(tgt);flag=true;break;case'Home':this.setSelectedTab(this.firstTab);flag=true;break;case'End':this.setSelectedTab(this.lastTab);flag=true;break;default:break;}
if(flag){event.stopPropagation();event.preventDefault();}}
onClick(event){this.setSelectedTab(event.currentTarget);}}
window.addEventListener('load',function(){var tablists=document.querySelectorAll(TabsAutomatic.SELECTOR);for(var i=0;i<tablists.length;i++){new TabsAutomatic(tablists[i]);}
adjustTablists();});function adjustTablists(){let tablists=$(TabsAutomatic.SELECTOR);tablists.each(function(){let tablist=$(this);tablist.find("[role=tab]").each(function(index){let tab=$(this);tab.data(TabsAutomatic.INDEX_KEY,index);});adjustTablist($(this));});function adjustTablist(tablist){const IncludeMargin=true;let more=tablist.find(".more");if(more.length===0){tablist.append(`
                    <div class="more dropdown">
                        <button type="button" class="button" data-bs-toggle="dropdown" aria-expanded="false">More</button>
                        <div class="overflow-container dropdown-menu dropdown-menu-end"></div>
                    </div>`);more=tablist.find(".more")}
let moreWidth=more.outerWidth(IncludeMargin);let overflowContainer=more.find(".overflow-container");overflowContainer.find("[role=tab]").each(function(){let tab=$(this);addToTablist(tab,tablist);});let availableSpace=tablist.innerWidth();let tabsAccumulativeWidth=13;let inTablist=[];let inOverflow=[];let addedMore=false;tablist.find("[role=tab]").each(function(){let tab=$(this);tabsAccumulativeWidth+=tab.outerWidth(IncludeMargin);if(tabsAccumulativeWidth<=availableSpace){inTablist.push(tab);}else{inOverflow.push(tab);if(!addedMore){tabsAccumulativeWidth-=tab.outerWidth(IncludeMargin);tabsAccumulativeWidth+=moreWidth;if(tabsAccumulativeWidth>availableSpace){let last=inTablist.pop();inOverflow.push(last);}
addedMore=true;}}});inOverflow.sort((a,b)=>{let indexA=Number(a.data(TabsAutomatic.INDEX_KEY));let indexB=Number(b.data(TabsAutomatic.INDEX_KEY));return indexA-indexB;});inOverflow.forEach(function(tab){addToOverflowContainer(tab,overflowContainer);});inOverflow.length===0?more.hide():more.show();}
function addToTablist(tab,tablist,prepend=false){prepend?tab.removeClass("dropdown-item").prependTo(tablist):tab.removeClass("dropdown-item").appendTo(tablist);}
function addToOverflowContainer(tab,overflowContainer){if(tab&&overflowContainer){tab.addClass("dropdown-item").appendTo(overflowContainer);}}
function moveIntoTablist(){let tabToMove=$(this);let tablist=tabToMove.closest("[role=tablist]");let overflowContainer=tablist.find(".overflow-container");let currentLastTab=tablist.children("[role=tab]").last();addToOverflowContainer(currentLastTab,overflowContainer);addToTablist(tabToMove,tablist,true);adjustTablist(tablist);}
$(TabsAutomatic.SELECTOR).on("click",".overflow-container [role=tab]",moveIntoTablist);};;
"use strict";$(function(){if(typeof bannerConfig==="object"){const{TheViewer}=TheViewerLib;TheViewer.TheViewer(bannerConfig);}
$("[role=tabpanel]:not(.hidden)").readMore("add",true);$("[role=tabpanel].hidden").removeClass("hidden").readMore("add",true).addClass("hidden");$(".in-depth-text, .provenance-text, .bibliography-list, .frame-description").find("a").contents().unwrap();if(window.matchMedia("(max-width: 767.98px)").matches){const initialListLength=6;let list=$(".paintings-in-group .paintings-list, .about-the-group .group-items");let items=list.find(".painting, .image-item");if(items.length>initialListLength){hideExtraItems(items,initialListLength);list.append("<div class='load'><button type='button' id='btnGroupLoad'>Load more</button></div>");$("#btnGroupLoad").on("click",function(){if(items.hasClass("hidden")){items.removeClass("hidden");$(this).text("Load less").addClass("less");}else{hideExtraItems(items,initialListLength);$(this).text("Load more").removeClass("less");}});function hideExtraItems(items,initialListLength){items.each(function(idx){if(idx>initialListLength-1){$(this).addClass("hidden");}});}}}
$("#viewBackButton").on("click",function(){let bannerImage=$(this).closest("#banner").find("#bannerImage");let manifestUrl=null;if($(this).attr("aria-checked")==="false"){$(this).attr("aria-checked","true");manifestUrl=bannerImage.data("backManifest");}else{$(this).attr("aria-checked","false");manifestUrl=bannerImage.data("frontManifest");}
bannerImage.data("manifest",manifestUrl);bannerImage.children().first().remove();if(typeof bannerConfig==="object"){bannerConfig.windows[0].manifestId=manifestUrl;const{TheViewer}=TheViewerLib;TheViewer.TheViewer(bannerConfig);}});$("#mobileThumbnails").slick({infinite:false,slidesToShow:2,slidesToScroll:2,prevArrow:$("#prev_mobileThumbnails"),nextArrow:$("#next_mobileThumbnails"),responsive:[{breakpoint:1024,settings:{slidesToShow:2,slidesToScroll:2,}},{breakpoint:768,settings:{slidesToShow:5,slidesToScroll:5,}},{breakpoint:600,settings:{slidesToShow:4,slidesToScroll:4,}},{breakpoint:500,settings:{slidesToShow:3,slidesToScroll:3,}},{breakpoint:400,settings:{slidesToShow:2,slidesToScroll:2,}}],});$("#desktopThumbnails").slick({infinite:false,slidesToShow:2,slidesToScroll:2,prevArrow:$("#prev_desktopThumbnails"),nextArrow:$("#next_desktopThumbnails"),responsive:[{breakpoint:1024,settings:{slidesToShow:2,slidesToScroll:2,}},{breakpoint:768,settings:{slidesToShow:5,slidesToScroll:5,}},{breakpoint:600,settings:{slidesToShow:4,slidesToScroll:4,}},{breakpoint:500,settings:{slidesToShow:3,slidesToScroll:3,}},{breakpoint:400,settings:{slidesToShow:2,slidesToScroll:2,}}],});$("#imageSection").on("click",".thumbnail",function(){let caption=$(this).find(".caption").text();let midImage=$(this).find("img").data("mdFullUrl");let manifest=$(this).find("img").data("manifest");let index=$(this).closest(".slick-slide").index();$("#imageSection .figure .image").css("background-image","url('"+midImage+"')").data({"manifest":manifest,"index":index});$("#imageSection .figure .caption-text").text(caption);if(!caption){$("#imageSection .figure").addClass("without-caption");}else{$("#imageSection .figure").removeClass("without-caption");}
$("#imageSection .thumbnail").attr("aria-pressed","false");$(this).attr("aria-pressed","true");});$("#desktopThumbnails .thumbnail").first().trigger("click");$(".mobile-thumbnails").on("click",".thumbnail",function(){const config={opener:this,container:$(".painting-page")[0],manifest:$(this).find("img").data("manifest"),index:$(this).closest(".slick-slide").index(),compareModeAvailable:true,};ng.ui.openImageViewer(config);});$("#banner .open-viewer-button, #imageSection .image, #imageSection .open-viewer-button").on("click",function(){const image=$(this).closest("#banner, #imageSection").find(".image");const config={opener:this,container:$(".painting-page")[0],manifest:image.data("manifest"),index:image.data("index"),compareModeAvailable:$(this).closest("#banner").length===0,};ng.ui.openImageViewer(config);});});;;
(function(){window.ng=window.ng||{};window.ng.element=window.ng.element||{};window.ng.element.cardSlider=window.ng.element.cardSlider||{};ng.element.cardSlider.Init=function(component,callback){if(typeof callback==="function"){$(component).data("selectCardCallback",callback);}
$(component).find('[data-card-slider-el="controls"] button').on("click",function(){let direction=parseInt($(this).attr('data-direction'));shiftSlider(component,direction);return false;});$(component).find('[data-card-slider-el="card"] button').on("click",function(){let o=getSizing(component);let visibleStartIdx=$(component).data("visibleStartIdx")||0;let visibleEndIdx=$(component).data("visibleEndIdx")||(o.visibleCardCount-1);let currentCard=$(this).closest('[data-card-slider-el="card"]')
let currentCardIdx=$(component).find('[data-card-slider-el="card"]').index(currentCard);selectCard(component,currentCardIdx+1,visibleStartIdx,visibleEndIdx,o.cardCount,true);return false;});};ng.element.cardSlider.SetStartState=function(){$('[data-elemental="card-slider"]').each(function(){let component=this;let o=getSizing(component);$(component).data("currentCard",1);$(component).data("visibleStartIdx",0);$(component).data("visibleEndIdx",(o.visibleCardCount-1));$(component).find('[data-card-slider-el="card"]').show();$(component).find('[data-card-slider-el="card"]').removeClass('selected');$(component).find('[data-card-slider-el="card"]').eq(0).addClass('selected');$(component).find('[data-card-slider-el="controls"] button[data-direction="-1"]').first().prop('disabled',true);$(component).find('[data-card-slider-el="controls"] button[data-direction="+1"]').first().prop('disabled',false);if($(component).find('[data-card-slider-el="indicator"]').length>0){$(component).find('[data-card-slider-val="current"]').html(1);let total=$(component).find('[data-card-slider-val="total"]').text();$(component).find(".live-region").text("Item 1 of "+total);}
if(o.cardCount<=o.visibleCardCount){$(component).addClass("single-page");$(component).find('[data-card-slider-el="controls"] button').hide();if($(component).find('[data-card-slider-el="indicator"]:not([data-visibility="always-on"])').length>0){$(component).find('[data-card-slider-el="indicator"]:not([data-visibility="always-on"])').hide();$(component).find('[data-card-slider-el="controls"]').hide();}
$(component).find('[data-card-slider-el="card"] button').removeAttr('tabindex');}
else{$(component).removeClass("single-page");$(component).find('[data-card-slider-el="controls"] button').show();$(component).find('[data-card-slider-el="controls"]').show();$(component).find('[data-card-slider-el="controls"] button[data-direction="-1"]').first().prop('disabled',true);$(component).find('[data-card-slider-el="controls"] button[data-direction="+1"]').first().prop('disabled',false);if($(component).find('[data-card-slider-el="indicator"]').length>0){$(component).find('[data-card-slider-el="indicator"]').show();}
$(component).find('[data-card-slider-el="card"] button').attr('tabindex','-1');}});};function selectCard(component,currentCard,visStartIdx,visEndIdx,cardCount,callCallback){let currCardIdx=currentCard-1;$(component).data("currentCard",currentCard);$(component).find('[data-card-slider-el="card"]').removeClass('selected');$(component).find('[data-card-slider-el="card"]').eq(currCardIdx).addClass('selected');;if(currCardIdx>visEndIdx){$(component).find('[data-card-slider-el="card"]').eq(visStartIdx).hide();$(component).find('[data-card-slider-el="card"]').eq(currCardIdx).show();$(component).data("visibleStartIdx",visStartIdx+1);$(component).data("visibleEndIdx",visEndIdx+1);}
else if(currCardIdx<visStartIdx){$(component).find('[data-card-slider-el="card"]').eq(visEndIdx).hide();$(component).find('[data-card-slider-el="card"]').eq(currCardIdx).show();$(component).data("visibleStartIdx",visStartIdx-1);$(component).data("visibleEndIdx",visEndIdx-1);}
$(component).find('[data-card-slider-el="controls"] button[data-direction="-1"]').first().prop('disabled',currentCard<=1);$(component).find('[data-card-slider-el="controls"] button[data-direction="+1"]').first().prop('disabled',currentCard>=cardCount);if($(component).find('[data-card-slider-el="indicator"]').length>0){$(component).find('[data-card-slider-val="current"]').html(currentCard);let idx=$(component).find('[data-card-slider-val="current"]').text();let total=$(component).find('[data-card-slider-val="total"]').text();$(component).find(".live-region").text("Item "+idx+" of "+total);}
let callback=$(component).data("selectCardCallback");if(typeof callback==="function"&&callCallback){callback();}}
function getSizing(component){let windowWidth=$(component).find('[data-card-slider-el="window"]').first().width();let cardWidth=$(component).find('[data-card-slider-el="card"]').first().outerWidth(true);let o={cardCount:$(component).find('[data-card-slider-el="card"]').length,visibleCardCount:(windowWidth/cardWidth),id:component.id};return o;};function shiftSlider(component,direction){let o=getSizing(component);let currentCard=$(component).data("currentCard")||1;if(direction===1&&currentCard<o.cardCount){currentCard++;}
else if(direction===-1&&currentCard>1){currentCard--;}
let visibleStartIdx=$(component).data("visibleStartIdx")||0;let visibleEndIdx=$(component).data("visibleEndIdx")||(o.visibleCardCount-1);selectCard(component,currentCard,visibleStartIdx,visibleEndIdx,o.cardCount,true);};})();function resetCardSliderElementals(){ng.element.cardSlider.SetStartState();}
$(function(){setTimeout(function(){ng.element.cardSlider.SetStartState();},100);});;;
$(function(){"use strict";$(".c-video-player .adjust-cookie-preferences").on("click",function(){if(Cookiebot){Cookiebot.renew();window.addEventListener('CookiebotOnAccept',function(e){location.reload();},false);}});renderPlayers();function renderPlayers(){$(".c-video-player").each(function(){renderPlayer($(this));});}
function renderPlayer($vpComponent){if(!Cookiebot||!Cookiebot.consent.marketing)
{$vpComponent.find(".message-container .loading-message").hide();$vpComponent.find(".message-container .cookie-message").show();}
else
{$vpComponent.find(".message-container").hide();$vpComponent.find(".video-component-ui").show();var $playlist=$(".playlist-controls-area",$vpComponent);if($playlist.length>0){ng.element.cardSlider.Init($(".ng-carousel",$playlist),function(){var $card=$(".ng-card-wrap.selected .ng-card",$playlist);updateVideo($vpComponent,$card,false);});}}}
function updateVideo($vpComponent,$card,autoplay){var videoId=$card.attr("data-video-id");var $player=$(".player .frame",$vpComponent);loadVideoPlayer($player,videoId,autoplay);updateVideoInfo($vpComponent,$card);}
function loadVideoPlayer($player,videoId,autoplay){var playerSrc=$player.attr("src");playerSrc=playerSrc.replace(/embed\/.*\?/,"embed/"+videoId+"?");if(playerSrc.indexOf("autoplay=")===-1){playerSrc+="&autoplay="+(autoplay?"1":"0");}else{playerSrc=playerSrc.replace(/autoplay=./,"autoplay="+(autoplay?"1":"0"));}
$player.attr("src",playerSrc);}
function updateVideoInfo($vpComponent,$card){var duration=$card.attr("data-video-duration");var title=$card.attr("data-video-title");$(".video-info .duration",$vpComponent).text(duration);$(".video-info .title",$vpComponent).text(title);}
function adjustVideoPlayer(){$(".c-video-player").each(function(){var $vpComponent=$(this);var $playlist=$(".playlist-controls-area",$vpComponent);if($playlist.length>0){updateVideo($vpComponent,$(".ng-card-wrap .ng-card",$playlist).first(),false);}});}
window.adjustVideoPlayer=adjustVideoPlayer;});;;
$(function(){"use strict;"
const sessionKey="RelatedPaintings";$(".m-related-paintings.with-see-more-loader-form").each(function(idx){var component=$(this);var pageSize=component.data("pageSize");var componentKey=component.data("componentKey");componentKey="c_"+componentKey+"_"+idx;component.data("componentKey",componentKey);var sessionObj=ng.util.sessionGet(sessionKey)||{};var visibleItems=sessionObj[componentKey]||pageSize;component.find('.image-item').each(function(idx){if(idx>=visibleItems){$(this).hide();}});UpdateIndicators(component);component.find('.see-more-loader-form button').on("click",function(){SeeMoreRelatedPaintings(component,pageSize);});component.find('.view-all-link').on("click",function(){if(!($(this).hasClass("disabled"))){SeeAllRelatedPaintings(component);}});});function SeeMoreRelatedPaintings(component,pageSize){component.find('.image-item:not(:visible)').each(function(idx){if(idx<pageSize){$(this).show();if(idx===0){$(this).find("a:focusable").first().trigger("focus");}}});UpdateIndicators(component);}
function SeeAllRelatedPaintings(component){component.find('.image-item').each(function(){$(this).show();});UpdateIndicators(component);}
function UpdateIndicators(component){var visibleItems=component.find('.image-item:visible').length;var totalCount=component.find('.image-item').length;var visiblePercent=(visibleItems/totalCount)*100;visiblePercent=Math.round(visiblePercent);if(visiblePercent>100){visiblePercent=100;}
component.find('.x-count').html(visibleItems);component.find('.showing-x-of-y-indicator .x-count-line').css("width",visiblePercent+"%");if(visibleItems===totalCount){component.find(".see-more-loader-form button").prop("disabled",true);component.find(".view-all-link").addClass("disabled");}
else{component.find(".see-more-loader-form button").prop("disabled",false);}
if(Cookiebot.consent.preferences){var sessionObj=ng.util.sessionGet(sessionKey)||{};var componentKey=component.data("componentKey");sessionObj[componentKey]=visibleItems;ng.util.sessionSet(sessionKey,sessionObj);}}});;;
(function(){"use strict";var DEBUG=false;var infoParameterName="ngInfo";var infoCookieName="ngInfo";const defaultCurrency="GBP";$(function(){var $products=$(".dl-product").not(".dl-duplicate");if($products.length>0){var products=[];$products.each(function(){var $product=$(this);var product={name:$product.data("dlName"),id:$product.data("dlName"),category:$product.data("dlCategory"),variant:$product.data("dlVariant"),list:getListName($product)};products.push(product);});var dataLayerItem={event:"productImpression",ecommerce:{impressions:products}};pushToDataLayer(dataLayerItem);}
var $product=$(".dl-product-detail").first();if($product.length===1){var product={name:$product.data("dlName"),id:$product.data("dlName"),category:$product.data("dlCategory"),variant:$product.data("dlVariant"),price:parseFloat($product.data("dlPrice"))};var dataLayerItem={event:"productDetail",ecommerce:{detail:{products:[product]}}};pushToDataLayer(dataLayerItem);}
if(ng.util.urlContains("/visiting/plan-your-visit/general-admission")){var dataLayerItem={event:"productDetail",ecommerce:{detail:{products:[{name:"Gallery entry",id:"Gallery entry",category:"Gallery entry",variant:"Gallery entry",price:"0"}]}}};pushToDataLayer(dataLayerItem);}
var $promotions=$(".c-angle-cut, .c-browse-events-panel");if($promotions.length>0){var promotions=[];$promotions.each(function(idx){var $promotion=$(this);var name=$promotion.hasClass("c-angle-cut")?$promotion.find(".title").text():"Browse all events";var promotion={name:name,id:name,creative:$promotion.hasClass("c-angle-cut")?"Angle cut":"Browse all events",position:(idx+1).toString()};promotions.push(promotion);});var dataLayerItem={event:"promotionView",ecommerce:{promoView:{promotions:promotions}}};pushToDataLayer(dataLayerItem);}
$(document).on("click",".dl-purchase-link, .btp-membership-button, .btp-tickets-button, .c-banner-body-side-panel .btn-next",function(){var url=$(this).attr("href");var id=$(this).attr("id");var funnel=$(this).hasClass("btp-membership-button")?"member":$(this).hasClass("btp-tickets-button")?"guest":undefined;var $product=$(this).closest(".dl-product, .dl-product-detail");if($product.length===0){$product=$(document).find(".dl-product-detail").first();}
if(url&&$product.length){url=addDataLayerInfoToUrl(url,$product.data("dlName"),$product.data("dlName"),$product.data("dlCategory"),$product.data("dlVariant"),$product.data("dlPrice"),funnel);}else if(url&&url.match(/galleryentry/i)){url=addDataLayerInfoToUrl(url,"General admission","General admission","Admissions","General admission","0.00",funnel);}
$(this).attr("href",url);});$(".event-listing .label").has("label[for='IncludePaid_main']").on("click",function(){var dataLayerItem={"event":"trackEvent","eventDetails.category":"Event Filter","eventDetails.action":"Price","eventDetails.label":"Paid"};pushToDataLayer(dataLayerItem);});$(".event-listing .label").has("label[for='IncludeFree_main']").on("click",function(){var dataLayerItem={"event":"trackEvent","eventDetails.category":"Event Filter","eventDetails.action":"Price","eventDetails.label":"Free"};pushToDataLayer(dataLayerItem);});$(".event-listing .category-picker .label").on("click",function(){var category=$(this).closest(".category-picker").find("input").val();var dataLayerItem={"event":"trackEvent","eventDetails.category":"Event Filter","eventDetails.action":"Type","eventDetails.label":category};pushToDataLayer(dataLayerItem);});$(".event-listing .audience-filter .label").on("click",function(){var $input=$(this).closest(".audience-filter").find("input");var audience=$input.attr("id")==="IsAccessible_main"?"Access":$input.val();var dataLayerItem={"event":"trackEvent","eventDetails.category":"Event Filter","eventDetails.action":"Audience","eventDetails.label":audience};pushToDataLayer(dataLayerItem);});$(".dl-product-link").on("click",function(){var $product=$(this).closest(".dl-product");var product={name:$product.data("dlName"),id:$product.data("dlName"),category:$product.data("dlCategory"),variant:$product.data("dlVariant")};var dataLayerItem={event:"productClick",ecommerce:{click:{actionField:{list:getListName($product)},products:[product]}}};pushToDataLayer(dataLayerItem);});$(".exhibition-listing .label").has("label[for='showPaid']").on("click",function(){var dataLayerItem={"event":"trackEvent","eventDetails.category":"Exhibition Filter","eventDetails.action":"Price","eventDetails.label":"Paid"};pushToDataLayer(dataLayerItem);});$(".exhibition-listing .label").has("label[for='showFree']").on("click",function(){var dataLayerItem={"event":"trackEvent","eventDetails.category":"Exhibition Filter","eventDetails.action":"Price","eventDetails.label":"Free"};pushToDataLayer(dataLayerItem);});$("#subscribe-form .btn").on("click",function(){var userID=ng.util.getCookie("ngSessUid");var dataLayerItem={"event":"trackEvent","eventDetails.category":"Form","eventDetails.action":"Newsletter Sign-up","eventDetails.label":userID};pushToDataLayer(dataLayerItem);});$(".dc-image-carousel-with-expand .shift-right").on("click",function(){var slideNumber=$(this).closest("div").find(".displayed-object-idx").text();var dataLayerItem={"event":"trackEvent","eventDetails.category":"Image Carousel","eventDetails.label":slideNumber};pushToDataLayer(dataLayerItem);});$(".c-angle-cut a, .c-browse-events-panel a").on("click",function(){var $promotion=$(this).closest(".c-angle-cut, .c-browse-events-panel");var $promotions=$(".c-angle-cut, .c-browse-events-panel");var idx=0;$promotions.each(function(i){if($(this)[0]===$promotion[0]){idx=i;}})
var promotion={};promotion.name=promotion.id=$promotion.hasClass("c-angle-cut")?$promotion.find(".title").text():"Browse all events";promotion.creative=$promotion.hasClass("c-angle-cut")?"Angle cut":"Browse all events";promotion.position=(idx+1).toString();var dataLayerItem={event:"promotionClick",ecommerce:{promoClick:{promotions:[promotion]}}};pushToDataLayer(dataLayerItem);});$("#contact-preferences-form .btn-primary").on("click",function(){var userID=ng.util.getCookie("ngSessUid");var dataLayerItem={"event":"trackEvent","eventDetails.category":"Account","eventDetails.action":"Update Account","eventDetails.label":userID};pushToDataLayer(dataLayerItem);});});function getListName($obj){var listName;if($(".home-page .c-events-carousel").find($obj).length>0){listName="Home carousel";}else if($(".exhibition-page .c-events-carousel").find($obj).length>0){listName="Related events";}else if($(".c-events-carousel").find($obj).length>0){listName="Events carousel";}else if($(".exhibition-listing").find($obj).length>0){listName="Exhibitions";}else if($(".event-listing").find($obj).length>0){listName="Events";}else if($(".event-page.festival-variant").find($obj).length>0){listName="Festival events";}else if($(".m-membership-promo-block").find($obj).length>0){listName="Membership";}else if($(".c-whats-on-panel").find($obj).length>0){listName="What's on panel";}else if($(".c-exhibition-listing").find($obj).length>0){listName="Exhibition listing component";}else if($(".c-promoted-event").find($obj).length>0){listName="Promoted event";}else if(ng.util.urlContains("/membership/on-demand")){listName="On-demand films";}else if($obj.closest(".dl-list").length>0){listName=$obj.closest(".dl-list").data("dlListName");}
return listName;}
function addDataLayerInfoToUrl(url,name,id,category,variant,price,funnel){var info={product:{name:name,id:id,category:category,variant:variant,price:price},funnel:funnel};var jsonInfo=JSON.stringify(info);url=ng.util.setUrlParam(url,infoParameterName,jsonInfo);saveDataLayerInfoToCookie(jsonInfo);return url;}
function saveDataLayerInfoToCookie(jsonInfo){var domain=window.location.host;if(domain.match("/nationalgallery\.org\.uk/")){domain=".nationalgallery.org.uk";}else{domain=null;}
ng.util.setCookie(infoCookieName,encodeURIComponent(jsonInfo),0,"/",domain);}
function pushToDataLayer(item){var dataLayer=window.dataLayer=window.dataLayer||[];dataLayer.push(item);consoleLog(item);}
function consoleLog(item){if(DEBUG)
console.log(JSON.stringify(item,null,2));}
function getItemsFromEvent($elem){let items=[];let $itemElems=$elem.find("[data-dl-item-name], [data-dl-item-id]")
$itemElems.each(function(){let $itemElem=$(this);let item={item_id:$itemElem.data("dlItemId"),item_name:$itemElem.data("dlItemName"),index:Number($itemElem.data("dlIndex")),item_category:$itemElem.data("dlItemCategory"),item_category2:$itemElem.data("dlItemCategory2"),item_category3:$itemElem.data("dlItemCategory3"),price:Number($itemElem.data("dlPrice")),quantity:Number($itemElem.data("dlQuantity")),};items.push(item);});return items;}
function pushEcommerceEventToDataLayer(event){pushToDataLayer({ecommerce:null});pushToDataLayer(event);}})();;;
