@acdh-oeaw/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
2 lines • 191 kB
JavaScript
/*! For license information please see 561.9c9010d28f0e85a93735.js.LICENSE.txt */
(self.webpackChunkUV=self.webpackChunkUV||[]).push([[561],{2325:e=>{window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511}])},1539:(e,t,n)=>{"use strict";n.d(t,{JT:()=>a,Yw:()=>v,BG:()=>r,k9:()=>_,eY:()=>y});var r,i=function(e){this.isVisible=!0;var t=e.target.match(/.*[^n]xyz=(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/),n=e.target.match(/.*nxyz=(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/);this.bodyValue=e.bodyValue,this.x=Number(t[1]),this.y=Number(t[2]),this.z=Number(t[3]),this.nx=Number(n[1]),this.ny=Number(n[2]),this.nz=Number(n[3])},o=function(e){var t;this.isVisible=!0,e.on?(t=e.on.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/),this.chars=e.resource.chars):(t=e.target.match(/.*xywh=(\d*),(\d*),(\d*),(\d*)/),this.chars=e.bodyValue),this.x=Number(t[1]),this.y=Number(t[2]),this.width=Number(t[3]),this.height=Number(t[4])},a=function(){function e(e){this.rects=[],this.points3D=[],this.canvasId=e}return e.prototype.addRect=function(e){var t=new o(e);t.canvasId=this.canvasId,t.canvasIndex=this.canvasIndex,t.index=this.rects.length,this.rects.push(t),this.rects.sort((function(e,t){return e.index-t.index}))},e.prototype.addPoint3D=function(e){var t=new i(e);t.canvasId=this.canvasId,t.canvasIndex=this.canvasIndex,t.index=this.points3D.length,this.points3D.push(t),this.points3D.sort((function(e,t){return e.index-t.index}))},e}(),s=n(6346),l=function(){function e(){this.isEnabled=!1,this.ranges=[],this.canvases=[]}return e.prototype.allCanvasesSelected=function(){return this.canvases.length>0&&this.getAllSelectedCanvases().length===this.canvases.length},e.prototype.allRangesSelected=function(){return this.ranges.length>0&&this.getAllSelectedRanges().length===this.ranges.length},e.prototype.allSelected=function(){return this.allRangesSelected()&&this.allCanvasesSelected()},e.prototype.getAll=function(){return this.canvases.concat(this.ranges)},e.prototype.getAllSelectedCanvases=function(){return this.canvases.filter((function(e){return e.multiSelected}))},e.prototype.getAllSelectedRanges=function(){return this.ranges.filter((function(e){return e.multiSelected}))},e.prototype.getCanvasById=function(e){return this.canvases.filter((function(t){return s.Utils.normaliseUrl(t.id)===s.Utils.normaliseUrl(e)}))[0]},e.prototype.getCanvasesByIds=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(this.getCanvasById(r))}return t},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesByIds(t)},e.prototype.selectAll=function(e){this.selectRanges(this.ranges,e),this.selectCanvases(this.canvases,e)},e.prototype.selectCanvas=function(e,t){this.canvases.filter((function(t){return t.id===e.id}))[0].multiSelected=t},e.prototype.selectAllCanvases=function(e){this.selectCanvases(this.canvases,e)},e.prototype.selectCanvases=function(e,t){for(var n=0;n<e.length;n++)e[n].multiSelected=t},e.prototype.selectRange=function(e,t){var n=this.ranges.filter((function(t){return t.id===e.id}))[0];n.multiSelected=t;var r=this.getRangeCanvases(n);this.selectCanvases(r,t)},e.prototype.selectAllRanges=function(e){this.selectRanges(this.ranges,e)},e.prototype.selectRanges=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];r.multiSelected=t;var i=this.getCanvasesByIds(r.getCanvasIds());this.selectCanvases(i,t)}},e.prototype.setEnabled=function(e){this.isEnabled=e;for(var t=this.getAll(),n=0;n<t.length;n++){var r=t[n];r.multiSelectEnabled=this.isEnabled,e||(r.multiSelected=!1)}},e}(),c=function(){function e(e,t){this.items=[],this.resource=e,this.label=t}return e.prototype.addItem=function(e){this.items.push(e)},e.prototype.addMetadata=function(e,t){void 0===t&&(t=!1);for(var n=0;n<e.length;n++){var r=e[n];r.isRootLevel=t,this.addItem(r)}},e}();!function(e){e.DATE="date",e.NONE="none"}(r||(r={}));var u=n(3957),p=function(){function e(){}return e.manifestNotLoaded="Manifest has not loaded yet",e}(),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},f.apply(this,arguments)},d=function(){function e(e){if(this.options=e,this.iiifResource=this.options.iiifResource,this.manifestUri=this.options.manifestUri,this.manifest=this.options.manifest,this.collectionIndex=this.options.collectionIndex||0,this.manifestIndex=this.options.manifestIndex||0,this.sequenceIndex=this.options.sequenceIndex||0,this.canvasIndex=this.options.canvasIndex||0,this.options.canvasId){var t=this.getCanvasIndexById(this.options.canvasId);null!==t&&(this.canvasIndex=t)}}return e.prototype.getAutoCompleteService=function(){var e=this.getSearchService(),t=null;return e&&((t=e.getService(u.bB.SEARCH_0_AUTO_COMPLETE))||(t=e.getService(u.bB.SEARCH_1_AUTO_COMPLETE))),t},e.prototype.getAttribution=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getAttribution();return e?e.getValue(this.options.locale):null},e.prototype.getCanvases=function(){return this.getCurrentSequence().getCanvases()},e.prototype.getCanvasById=function(e){return this.getCurrentSequence().getCanvasById(e)},e.prototype.getCanvasesById=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=this.getCanvasById(r);i&&t.push(i)}return t},e.prototype.getCanvasByIndex=function(e){return this.getCurrentSequence().getCanvasByIndex(e)},e.prototype.getCanvasIndexById=function(e){return this.getCurrentSequence().getCanvasIndexById(e)},e.prototype.getCanvasIndexByLabel=function(e){var t=this.getManifestType()===s.ManifestType.MANUSCRIPT;return this.getCurrentSequence().getCanvasIndexByLabel(e,t)},e.prototype.getCanvasRange=function(e,t){var n=this.getCanvasRanges(e);if(t){for(var r=0;r<n.length;r++){var i=n[r];if(i.path===t)return i}return null}return n[0]},e.prototype.getCanvasRanges=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return e.ranges||(e.ranges=this.manifest.getAllRanges().filter((function(t){return t.getCanvasIds().some((function(t){return s.Utils.normaliseUrl(t)===s.Utils.normaliseUrl(e.id)}))}))),e.ranges},e.prototype.getCollectionIndex=function(e){if(!e.parentCollection||e.parentCollection.parentCollection)return e.parentCollection?e.parentCollection.index:void 0},e.prototype.getCurrentCanvas=function(){return this.getCurrentSequence().getCanvasByIndex(this.canvasIndex)},e.prototype.getCurrentSequence=function(){return this.getSequenceByIndex(this.sequenceIndex)},e.prototype.getDescription=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getDescription();return e?e.getValue(this.options.locale):null},e.prototype.getLabel=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getLabel();return e?e.getValue(this.options.locale):null},e.prototype.getLastCanvasLabel=function(e){return this.getCurrentSequence().getLastCanvasLabel(e)},e.prototype.getFirstPageIndex=function(){return 0},e.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},e.prototype.getLicense=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getLicense()},e.prototype.getRights=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getRights()},e.prototype.getLogo=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getLogo()},e.prototype.getManifestType=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getManifestType();return e===s.ManifestType.EMPTY&&(e=s.ManifestType.MONOGRAPH),e},e.prototype.getMetadata=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);var t=[],n=this.manifest.getMetadata(),r=new c(this.manifest),i=this.options.locale;n&&n.length&&r.addMetadata(n,!0),this.manifest.getDescription().length&&((u=new s.LabelValuePair(i)).label=new s.PropertyValue([new s.LocalizedValue("description",i)]),u.value=this.manifest.getDescription(),u.isRootLevel=!0,r.addItem(u)),this.manifest.getAttribution().length&&((u=new s.LabelValuePair(i)).label=new s.PropertyValue([new s.LocalizedValue("attribution",i)]),u.value=this.manifest.getAttribution(),u.isRootLevel=!0,r.addItem(u));var o=this.manifest.getRequiredStatement();if(o){var a=this.parseStatement(o);(u=new s.LabelValuePair(i)).parse(a),u.isRootLevel=!0,r.addItem(u)}var l=this.manifest.getLicense();l&&(a={label:"license",value:e&&e.licenseFormatter?e.licenseFormatter.format(l):l},(u=new s.LabelValuePair(i)).parse(a),u.isRootLevel=!0,r.addItem(u));var u,f=this.manifest.getRights();(f&&(a={label:"rights",value:e&&e.licenseFormatter?e.licenseFormatter.format(f):f},(u=new s.LabelValuePair(i)).parse(a),u.isRootLevel=!0,r.addItem(u)),this.manifest.getLogo())&&(a={label:"logo",value:'<img alt="logo" src="'+this.manifest.getLogo()+'"/>'},(u=new s.LabelValuePair(i)).parse(a),u.isRootLevel=!0,r.addItem(u));return t.push(r),e?this._parseMetadataOptions(e,t):t},e.prototype.getAllRequiredStatements=function(){var e=[],t=this.getCurrentRange();if(t){var n=t.getRequiredStatement?t.getRequiredStatement():null;n&&e.push(f(f({},this.parseStatement(n)),{source:"Range"}))}var r=this.getCurrentCanvas();if(r){var i=r.getRequiredStatement?r.getRequiredStatement():null;i&&e.push(f(f({},this.parseStatement(i)),{source:"Canvas"}))}if(this.manifest){var o=this.manifest.getRequiredStatement();o&&o&&e.push(f(f({},this.parseStatement(o)),{source:"Manifest"}))}return e},e.prototype.getMostSpecificRequiredStatement=function(){var e=this.getAllRequiredStatements(),t=e.find((function(e){return"Range"===e.source}));if(t)return t;var n=e.find((function(e){return"Canvas"===e.source}));return n||(e.find((function(e){return"Manifest"===e.source}))||null)},e.prototype.getRequiredStatement=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getRequiredStatement();return e?this.parseStatement(e):null},e.prototype.parseStatement=function(e){return{label:e.label?e.getLabel():"",value:e.value&&e.value.length?e.getValue():""}},e.prototype._parseMetadataOptions=function(e,t){var n=this.getCurrentSequence(),r=n.getMetadata();if(r&&r.length){var i=new c(n);i.addMetadata(r),t.push(i)}if(e.range){var o=this._getRangeMetadata([],e.range);o=o.reverse(),t=t.concat(o)}if(e.canvases&&e.canvases.length)for(var a=0;a<e.canvases.length;a++){var s=e.canvases[a],l=s.getMetadata();if(l&&l.length){var u=new c(s);u.addMetadata(s.getMetadata()),t.push(u)}for(var p=s.getImages(),f=0;f<p.length;f++){var d=p[f],h=d.getMetadata();if(h&&h.length){var g=new c(d);g.addMetadata(h),t.push(g)}}}return t},e.prototype._getRangeMetadata=function(e,t){var n=t.getMetadata();if(n&&n.length){var r=new c(t);r.addMetadata(n),e.push(r)}else if(t.parentRange)return this._getRangeMetadata(e,t.parentRange);return e},e.prototype.getMultiSelectState=function(){return this._multiSelectState||(this._multiSelectState=new l,this._multiSelectState.ranges=this.getRanges().slice(0),this._multiSelectState.canvases=this.getCurrentSequence().getCanvases().slice(0)),this._multiSelectState},e.prototype.getCurrentRange=function(){return this.rangeId?this.getRangeById(this.rangeId):null},e.prototype.getPosterCanvas=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getPosterCanvas()},e.prototype.getAccompanyingCanvas=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getAccompanyingCanvas()},e.prototype.getPosterImage=function(){var e=this.getPosterCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getAccompanyingCanvasImage=function(){var e=this.getAccompanyingCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getPreviousRange=function(e){var t;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var r=0;r<n.length;r++){var i=n[r];if(i&&i.data.id===t.id){for(;r>0;)return n[--r].data;break}}}return null},e.prototype.getNextRange=function(e){var t;if(t=e||this.getCurrentRange()){var n=this.getFlattenedTree();if(n)for(var r=0;r<n.length;r++){var i=n[r];if(i&&i.data.id===t.id){for(;r<n.length-1;){var o=n[++r];if(o.data.canvases&&o.data.canvases.length)return o.data}break}}}return null},e.prototype.getFlattenedTree=function(e){var t;return(t=e||this.getTree())?this._flattenTree(t,"nodes"):null},e.prototype._flattenTree=function(e,t){var n=this,r=[e];return e[t]&&e[t].length>0?r.concat(e[t].map((function(e){return n._flattenTree(e,t)})).reduce((function(e,t){return e.concat(t)}),[])):r},e.prototype.getRanges=function(){return this.manifest.getAllRanges()},e.prototype.getRangeByPath=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getRangeByPath(e)},e.prototype.getRangeById=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getRangeById(e)},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesById(t)},e.prototype.getRelated=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getRelated()},e.prototype.getSearchService=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.manifest.getService(u.bB.SEARCH_0);return e||(e=this.manifest.getService(u.bB.SEARCH_1)),e},e.prototype.getSeeAlso=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getSeeAlso()},e.prototype.getSequenceByIndex=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getSequenceByIndex(e)},e.prototype.getShareServiceUrl=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=null,t=this.manifest.getService(u.bB.SHARE_EXTENSIONS);return t&&(t.length&&(t=t[0]),e=t.__jsonld.shareUrl),e},e.prototype._getSortedTreeNodesByDate=function(e,t){var n=this.getFlattenedTree(t);if(n){var r=n.filter((function(e){return e.data.type===s.TreeNodeType.MANIFEST}));this.createDecadeNodes(e,n),this.sortDecadeNodes(e),this.createYearNodes(e,n),this.sortYearNodes(e),this.createMonthNodes(e,r),this.sortMonthNodes(e),this.createDateNodes(e,r),this.pruneDecadeNodes(e)}},e.prototype.getStartCanvasIndex=function(){return this.getCurrentSequence().getStartCanvasIndex()},e.prototype.getThumbs=function(e,t){return this.getCurrentSequence().getThumbs(e,t)},e.prototype.getTopRanges=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getTopRanges()},e.prototype.getTotalCanvases=function(){return this.getCurrentSequence().getTotalCanvases()},e.prototype.getTrackingLabel=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.getTrackingLabel()},e.prototype._getTopRanges=function(){return this.iiifResource.getTopRanges()},e.prototype.getTree=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=r.NONE),!this.iiifResource)return null;var n;if(this.iiifResource.isCollection())n=this.iiifResource.getDefaultTree();else{var i=this._getTopRanges(),o=new s.TreeNode;if(o.label="root",o.data=this.iiifResource,!i.length)return o;n=i[e].getTree(o)}var a=new s.TreeNode;return t.toString()===r.DATE.toString()&&this.treeHasNavDates(n)?(this._getSortedTreeNodesByDate(a,n),a):n},e.prototype.treeHasNavDates=function(e){var t=this.getFlattenedTree(e);return!!t&&t.some((function(e){return!isNaN(e.navDate)}))},e.prototype.getViewingDirection=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.getCurrentSequence().getViewingDirection();return e||(e=this.manifest.getViewingDirection()),e},e.prototype.getViewingHint=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.getCurrentSequence().getViewingHint();return e||(e=this.manifest.getViewingHint()),e},e.prototype.hasParentCollection=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return!!this.manifest.parentCollection},e.prototype.hasRelatedPage=function(){var e=this.getRelated();return!!e&&(e.length&&(e=e[0]),"text/html"===e.format)},e.prototype.hasResources=function(){return this.getCurrentCanvas().getResources().length>0},e.prototype.isBottomToTop=function(){var e=this.getViewingDirection();return!!e&&e===u.T5.BOTTOM_TO_TOP},e.prototype.isCanvasIndexOutOfRange=function(e){return this.getCurrentSequence().isCanvasIndexOutOfRange(e)},e.prototype.isContinuous=function(){var e=this.getViewingHint();return!!e&&e===u.LX.CONTINUOUS},e.prototype.isFirstCanvas=function(e){return void 0!==e?this.getCurrentSequence().isFirstCanvas(e):this.getCurrentSequence().isFirstCanvas(this.canvasIndex)},e.prototype.isHorizontallyAligned=function(){return this.isLeftToRight()||this.isRightToLeft()},e.prototype.isLastCanvas=function(e){return void 0!==e?this.getCurrentSequence().isLastCanvas(e):this.getCurrentSequence().isLastCanvas(this.canvasIndex)},e.prototype.isLeftToRight=function(){var e=this.getViewingDirection();return!!e&&e===u.T5.LEFT_TO_RIGHT},e.prototype.isMultiCanvas=function(){return this.getCurrentSequence().isMultiCanvas()},e.prototype.isMultiSequence=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.isMultiSequence()},e.prototype.isPaged=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);var e=this.getViewingHint();return e?e===u.LX.PAGED:this.manifest.isPagingEnabled()},e.prototype.isPagingAvailable=function(){return this.isPagingEnabled()&&this.getTotalCanvases()>2},e.prototype.isPagingEnabled=function(){if(!this.manifest)throw new Error(p.manifestNotLoaded);return this.manifest.isPagingEnabled()||this.getCurrentSequence().isPagingEnabled()},e.prototype.isRightToLeft=function(){var e=this.getViewingDirection();return!!e&&e===u.T5.RIGHT_TO_LEFT},e.prototype.isTopToBottom=function(){var e=this.getViewingDirection();return!!e&&e===u.T5.TOP_TO_BOTTOM},e.prototype.isTotalCanvasesEven=function(){return this.getCurrentSequence().isTotalCanvasesEven()},e.prototype.isUIEnabled=function(e){if(!this.manifest)throw new Error(p.manifestNotLoaded);var t=this.manifest.getService(u.bB.UI_EXTENSIONS);if(t){var n=t.getProperty("disableUI");if(n&&(-1!==n.indexOf(e)||-1!==n.indexOf(e.toLowerCase())))return!1}return!0},e.prototype.isVerticallyAligned=function(){return this.isTopToBottom()||this.isBottomToTop()},e.prototype.createDateNodes=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=this.getNodeYear(r),o=this.getNodeMonth(r),a=new s.TreeNode;a.id=r.id,a.label=this.getNodeDisplayDate(r),a.data=r.data,a.data.type=s.TreeNodeType.MANIFEST,a.data.year=i,a.data.month=o;var l=this.getDecadeNode(e,i);if(l){var c=this.getYearNode(l,i);if(c){var u=this.getMonthNode(c,o);u&&u.addNode(a)}}}},e.prototype.createDecadeNodes=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(r.navDate){var i=this.getNodeYear(r),o=Number(i.toString().substr(0,3)+"9");if(!this.getDecadeNode(e,i)){var a=new s.TreeNode;a.label=i+" - "+o,a.navDate=r.navDate,a.data.startYear=i,a.data.endYear=o,e.addNode(a)}}}},e.prototype.createMonthNodes=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(r.navDate){var i=this.getNodeYear(r),o=this.getNodeMonth(r),a=this.getDecadeNode(e,i),l=null;if(a&&(l=this.getYearNode(a,i)),a&&l&&!this.getMonthNode(l,o)){var c=new s.TreeNode;c.label=this.getNodeDisplayMonth(r),c.navDate=r.navDate,c.data.year=i,c.data.month=o,l.addNode(c)}}}},e.prototype.createYearNodes=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(r.navDate){var i=this.getNodeYear(r),o=this.getDecadeNode(e,i);if(o&&!this.getYearNode(o,i)){var a=new s.TreeNode;a.label=i.toString(),a.navDate=r.navDate,a.data.year=i,o.addNode(a)}}}},e.prototype.getDecadeNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(t>=r.data.startYear&&t<=r.data.endYear)return r}return null},e.prototype.getMonthNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(t===this.getNodeMonth(r))return r}return null},e.prototype.getNodeDisplayDate=function(e){return e.navDate.toDateString()},e.prototype.getNodeDisplayMonth=function(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e.navDate.getMonth()]},e.prototype.getNodeMonth=function(e){return e.navDate.getMonth()},e.prototype.getNodeYear=function(e){return e.navDate.getFullYear()},e.prototype.getYearNode=function(e,t){for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(t===this.getNodeYear(r))return r}return null},e.prototype.pruneDecadeNodes=function(e){for(var t=[],n=0;n<e.nodes.length;n++){var r=e.nodes[n];r.nodes.length||t.push(r)}for(var i=0;i<t.length;i++){var o=t[i],a=e.nodes.indexOf(o);a>-1&&e.nodes.splice(a,1)}},e.prototype.sortDecadeNodes=function(e){e.nodes=e.nodes.sort((function(e,t){return e.data.startYear-t.data.startYear}))},e.prototype.sortMonthNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++)for(var r=e.nodes[n],i=0;i<r.nodes.length;i++){var o=r.nodes[i];o.nodes=o.nodes.sort((function(e,n){return t.getNodeMonth(e)-t.getNodeMonth(n)}))}},e.prototype.sortYearNodes=function(e){for(var t=this,n=0;n<e.nodes.length;n++){var r=e.nodes[n];r.nodes=r.nodes.sort((function(e,n){return t.getNodeYear(e)-t.getNodeYear(n)}))}},e}(),h=function(){function e(e){this._options=e,this._options.locale=this._options.locale||"en-GB"}return e.prototype.bootstrap=function(e,t){var n=this;return new Promise((function(r,i){e&&t&&(r=e,i=t),s.Utils.loadManifest(n._options.manifestUri).then((function(e){n._loaded(n,e,r,i)})).catch((function(e){i(e)}))}))},e.prototype.bootstrapJson=function(e,t,n){var r=this;return new Promise((function(i,o){t&&n&&(i=t,o=n),r._loaded(r,e,i,o)}))},e.prototype._loaded=function(e,t,n,r){var i=s.Utils.parseManifest(t,{locale:e._options.locale});if(i){e._options.iiifResource||(e._options.iiifResource=i);var o=e._options.collectionIndex,a=e._options.manifestIndex;if(i.getIIIFResourceType()===u.es.COLLECTION){var l=i.getManifests(),c=i.getCollections();l.length||void 0!==o||(o=0),void 0!==o&&c&&c.length?i.getCollectionByIndex(o).then((function(t){t||r("Collection index not found"),0===t.getTotalManifests()&&0===a&&t.getTotalCollections()>0?(e._options.collectionIndex=0,e._options.manifestUri=t.id,e.bootstrap(n,r)):void 0!==a&&t.getManifestByIndex(a).then((function(t){e._options.manifest=t;var r=new d(e._options);n(r)}))})):i.getManifestByIndex(e._options.manifestIndex).then((function(t){e._options.manifest=t;var r=new d(e._options);n(r)}))}else{e._options.manifest=i;var p=new d(e._options);n(p)}}else console.error("Unable to load IIIF resource")},e}(),g=n(2325),v=function(){function e(e,t){this.authHoldingPage=null,this.clickThroughService=null,this.externalService=null,this.isProbed=!1,this.isResponseHandled=!1,this.kioskService=null,this.loginService=null,this.logoutService=null,this.probeService=null,this.restrictedService=null,this.tokenService=null,e.externalResource=this,this.dataUri=this._getDataUri(e),this.index=e.index,this.authAPIVersion=t.authApiVersion,this._parseAuthServices(e),this._parseCanvasDimensions(e)}return e.prototype._getImageServiceDescriptor=function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n],i=r.id;i.endsWith("/")||(i+="/"),r.getProfile()&&(s.Utils.isImageProfile(r.getProfile())||s.Utils.isImageServiceType(r.getIIIFResourceType()))&&(t=i+"info.json")}return t},e.prototype._getDataUri=function(e){var t=e.getContent(),n=e.getImages(),r=null;if(t&&t.length){var i=t[0].getBody();return i.length?(o=i[0].getServices()).length&&(r=this._getImageServiceDescriptor(o))?r:i[0].id:null}if(n&&n.length){var o,a=n[0].getResource();return(o=a.getServices()).length&&(r=this._getImageServiceDescriptor(o))?r:a.id}var s=e.getService(u.bB.IXIF);return s?s.getInfoUri():e.id},e.prototype._parseAuthServices=function(e){if(.9===this.authAPIVersion)this.clickThroughService=s.Utils.getService(e,u.bB.AUTH_0_CLICK_THROUGH),this.loginService=s.Utils.getService(e,u.bB.AUTH_0_LOGIN),this.restrictedService=s.Utils.getService(e,u.bB.AUTH_0_RESTRICTED),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(u.bB.AUTH_0_LOGOUT),this.tokenService=this.clickThroughService.getService(u.bB.AUTH_0_TOKEN)):this.loginService?(this.logoutService=this.loginService.getService(u.bB.AUTH_0_LOGOUT),this.tokenService=this.loginService.getService(u.bB.AUTH_0_TOKEN)):this.restrictedService&&(this.logoutService=this.restrictedService.getService(u.bB.AUTH_0_LOGOUT),this.tokenService=this.restrictedService.getService(u.bB.AUTH_0_TOKEN));else{if(void 0!==e.isCanvas&&e.isCanvas()){var t=e.getContent();if(t&&t.length){var n=t[0].getBody();n&&n.length&&(e=n[0])}}this.clickThroughService=s.Utils.getService(e,u.bB.AUTH_1_CLICK_THROUGH),this.loginService=s.Utils.getService(e,u.bB.AUTH_1_LOGIN),this.externalService=s.Utils.getService(e,u.bB.AUTH_1_EXTERNAL),this.kioskService=s.Utils.getService(e,u.bB.AUTH_1_KIOSK),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(u.bB.AUTH_1_LOGOUT),this.tokenService=this.clickThroughService.getService(u.bB.AUTH_1_TOKEN),this.probeService=this.clickThroughService.getService(u.bB.AUTH_1_PROBE)):this.loginService?(this.logoutService=this.loginService.getService(u.bB.AUTH_1_LOGOUT),this.tokenService=this.loginService.getService(u.bB.AUTH_1_TOKEN),this.probeService=s.Utils.getService(e,u.bB.AUTH_1_PROBE),this.probeService||(this.probeService=this.loginService.getService(u.bB.AUTH_1_PROBE))):this.externalService?(this.logoutService=this.externalService.getService(u.bB.AUTH_1_LOGOUT),this.tokenService=this.externalService.getService(u.bB.AUTH_1_TOKEN),this.probeService=s.Utils.getService(e,u.bB.AUTH_1_PROBE),this.probeService||(this.probeService=this.externalService.getService(u.bB.AUTH_1_PROBE))):this.kioskService&&(this.logoutService=this.kioskService.getService(u.bB.AUTH_1_LOGOUT),this.tokenService=this.kioskService.getService(u.bB.AUTH_1_TOKEN),this.probeService=s.Utils.getService(e,u.bB.AUTH_1_PROBE),this.probeService||(this.probeService=this.kioskService.getService(u.bB.AUTH_1_PROBE)))}},e.prototype._parseCanvasDimensions=function(e){var t=e.getImages();if(t&&t.length){var n=t[0].getResource();this.width=n.getWidth(),this.height=n.getHeight()}else if((t=e.getContent()).length){var r=t[0].getBody();r.length&&(this.width=r[0].getWidth(),this.height=r[0].getHeight())}},e.prototype._parseDescriptorDimensions=function(e){void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)},e.prototype.isAccessControlled=function(){return!!(this.clickThroughService||this.loginService||this.externalService||this.kioskService||this.probeService)},e.prototype.hasServiceDescriptor=function(){return!!this.dataUri&&this.dataUri.endsWith("info.json")},e.prototype.getData=function(e){var t=this;return t.data={},new Promise((function(n,r){if(t.dataUri)if(t.probeService){t.isProbed=!0;var i=new XMLHttpRequest;i.open("GET",t.probeService.id,!0),i.withCredentials=!1,e&&i.setRequestHeader("Authorization","Bearer "+e.accessToken),i.onload=function(){var e=JSON.parse(i.responseText),r=unescape(e.contentLocation);t.status=i.status,r!==t.dataUri&&(t.status=g.MOVED_TEMPORARILY),t.data=e,n(t)},i.onerror=function(){t.status=i.status,n(t)},i.send()}else{var o="GET";if(!t.hasServiceDescriptor()){if(!t.isAccessControlled())return t.status=g.OK,void n(t);o="HEAD"}var a=new XMLHttpRequest;a.open(o,t.dataUri,!0),a.withCredentials=!1,e&&a.setRequestHeader("Authorization","Bearer "+e.accessToken),a.onload=function(){if(a.responseText){var e=JSON.parse(a.responseText),r=a.status,i=unescape(e["@id"]||e.id);t.data=e,t._parseAuthServices(t.data),t._parseDescriptorDimensions(t.data),i.endsWith("/info.json")&&(i=i.substr(0,i.lastIndexOf("/")));var o=t.dataUri;o&&o.endsWith("/info.json")&&(o=o.substr(0,o.lastIndexOf("/"))),r===g.OK&&i!==o&&(t.loginService||t.kioskService)?t.status=g.MOVED_TEMPORARILY:t.status=r,n(t)}else t.status=a.status||g.OK,n(t)},a.onerror=function(){t.status=a.status,a.responseText&&t._parseAuthServices(JSON.parse(a.responseText)),n(t)},a.send()}else r("There is no dataUri to fetch")}))},e}(),_=function(){function e(e){this.labels=e}return e.prototype.format=function(e){return-1!=e.indexOf("<a")?e:'<a href="'+e+'">'+(this.labels[e]?this.labels[e]:e)+"</a>"},e}(),y=function(e){return new h(e).bootstrap()}},3957:(e,t)=>{"use strict";var n,r,i,o,a,s,l,c,u,p;(p=t.uk||(t.uk={})).BOOKMARKING="oa:bookmarking",p.CLASSIFYING="oa:classifying",p.COMMENTING="oa:commenting",p.DESCRIBING="oa:describing",p.EDITING="oa:editing",p.HIGHLIGHTING="oa:highlighting",p.IDENTIFYING="oa:identifying",p.LINKING="oa:linking",p.MODERATING="oa:moderating",p.PAINTING="sc:painting",p.QUESTIONING="oa:questioning",p.REPLYING="oa:replying",p.TAGGING="oa:tagging",p.TRANSCRIBING="oad:transcribing",(u=t.nS||(t.nS={})).AUTO_ADVANCE="auto-advance",u.CONTINUOUS="continuous",u.FACING_PAGES="facing-pages",u.HIDDEN="hidden",u.INDIVIDUALS="individuals",u.MULTI_PART="multi-part",u.NO_NAV="no-nav",u.NON_PAGED="non-paged",u.PAGED="paged",u.REPEAT="repeat",u.SEQUENCE="sequence",u.THUMBNAIL_NAV="thumbnail-nav",u.TOGETHER="together",u.UNORDERED="unordered",(c=t.S3||(t.S3={})).CANVAS="canvas",c.CHOICE="choice",c.OA_CHOICE="oa:choice",c.CONTENT_AS_TEXT="contentastext",c.DATASET="dataset",c.DOCUMENT="document",c.IMAGE="image",c.MODEL="model",c.MOVING_IMAGE="movingimage",c.PDF="pdf",c.PHYSICAL_OBJECT="physicalobject",c.SOUND="sound",c.TEXT="text",c.TEXTUALBODY="textualbody",c.VIDEO="video",(l=t.es||(t.es={})).ANNOTATION="annotation",l.CANVAS="canvas",l.COLLECTION="collection",l.MANIFEST="manifest",l.RANGE="range",l.SEQUENCE="sequence",(s=t.zu||(t.zu={})).AUDIO_MP4="audio/mp4",s.CORTO="application/corto",s.DICOM="application/dicom",s.DRACO="application/draco",s.EPUB="application/epub+zip",s.GIRDER="image/vnd.kitware.girder",s.GLB="model/gltf-binary",s.GLTF="model/gltf+json",s.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',s.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',s.JPG="image/jpeg",s.M3U8="application/vnd.apple.mpegurl",s.MP3="audio/mp3",s.MPEG_DASH="application/dash+xml",s.OBJ="text/plain",s.OPF="application/oebps-package+xml",s.PDF="application/pdf",s.PLY="application/ply",s.THREEJS="application/vnd.threejs+json",s.USDZ="model/vnd.usd+zip",s.VIDEO_MP4="video/mp4",s.WAV="audio/wav",s.WEBM="video/webm",(a=t.O6||(t.O6={})).DOC="application/msword",a.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",a.PDF="application/pdf",(o=t.bB||(t.bB={})).IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",o.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",o.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",o.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",o.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",o.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",o.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",o.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",o.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",o.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",o.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",o.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",o.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",o.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",o.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",o.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",o.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",o.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",o.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",o.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",o.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",o.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",o.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",o.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",o.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",o.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",o.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",o.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",o.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",o.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",o.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",o.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",o.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",o.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",o.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",o.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",o.SEARCH_0="http://iiif.io/api/search/0/search",o.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",o.SEARCH_1="http://iiif.io/api/search/1/search",o.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",o.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",o.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",o.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",o.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",o.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",o.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",o.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json",(i=t.C0||(t.C0={})).IMAGE_SERVICE_2="ImageService2",i.IMAGE_SERVICE_3="ImageService3",(r=t.T5||(t.T5={})).BOTTOM_TO_TOP="bottom-to-top",r.LEFT_TO_RIGHT="left-to-right",r.RIGHT_TO_LEFT="right-to-left",r.TOP_TO_BOTTOM="top-to-bottom",(n=t.LX||(t.LX={})).CONTINUOUS="continuous",n.INDIVIDUALS="individuals",n.NON_PAGED="non-paged",n.PAGED="paged",n.TOP="top"},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},4991:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var n,r,i=(r=4,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(n,r)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[1],a=i[3];if(!a)return o;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),c="/*# ".concat(l," */"),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([c]).join("\n")}return[o].join("\n")}},2127:(e,t,n)=>{var r,i,o,a=n(4692);r=function(e,t){"use strict";var n=!1===t;if(!(t=t||e.jQuery)||!t.fn)throw"JsViews requires jQuery";var r,i,o,a,s,l,c,u,p,f,d,h,g,v,_,y,m,E,b,I,T,C,A,O,S="v1.0.15",w="_ocp",x=/[ \t]*(\r\n|\n|\r)/g,L=/\\(['"\\])/g,N=/['"\\]/g,R=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,P=/^if\s/,M=/<(\w+)[>\s]/,j=/[\x00`><\"'&=]/,U=/^on[A-Z]|^convert(Back)?$/,D=/^\#\d+_`[\s\S]*\/\d+_`$/,V=/[\x00`><"'&=]/g,k=/[&<>]/g,G=/&(amp|gt|lt);/g,F=/\[['"]?|['"]?\]/g,B=0,H={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`","=":"="},q={amp:"&",gt:">",lt:"<"},Y="html",K="string",W="object",X="data-jsv-tmpl",$="jsvTmpl",Q="For #index in nested block use #getIndex().",z={},J={},Z=e.jsrender,ee=Z&&t&&!t.render,te={template:{compile:function e(n,r,i,o){function s(r){var a,s;if(typeof r===K||r.nodeType>0&&(l=r)){if(!l&&(/^\.?\/[^\\:*?"<>]*$/.test(r)?(s=f[n=n||r])?r=s:l=document.getElementById(r):"#"===r.charAt(0)&&(l=document.getElementById(r.slice(1))),!l&&t.fn&&!v.rTmpl.test(r)))try{l=t(r,document)[0]}catch(e){}l&&("SCRIPT"!==l.tagName&&Se(r+": Use script block, not "+l.tagName),o?r=l.innerHTML:((a=l.getAttribute(X))&&(a!==$?(r=f[a],delete f[a]):t.fn&&(r=t.data(l)[$])),a&&r||(n=n||(t.fn?$:r),r=e(n,l.innerHTML,i,o)),r.tmplName=n=n||a,n!==$&&(f[n]=r),l.setAttribute(X,n),t.fn&&t.data(l,$,r))),l=void 0}else r.fn||(r=void 0);return r}var l,c,u=r=r||"";if(v._html=d.html,0===o&&(o=void 0,u=s(u)),(o=o||(r.markup?r.bnds?le({},r):r:{})).tmplName=o.tmplName||n||"unnamed",i&&(o._parentTmpl=i),!u&&r.markup&&(u=s(r.markup))&&u.fn&&(u=u.markup),void 0!==u)return u.render||r.render?u.tmpls&&(c=u):(r=Ee(u,o),xe(u.replace(N,"\\$&"),r)),c||(c=le((function(){return c.render.apply(c,arguments)}),r),function(e){var t,n,r;for(t in te)e[n=t+"s"]&&(r=e[n],e[n]={},a[n](r,e))}(c)),c}},tag:{compile:function(e,t,n){var r,i,o,a=new v._tg;function s(){var t=this;t._={unlinked:!0},t.inline=!0,t.tagName=e}if(u(t)?t={depends:t.depends,render:t}:typeof t===K&&(t={template:t}),i=t.baseTag)for(o in t.flow=!!t.flow,(i=typeof i===K?n&&n.tags[i]||g[i]:i)||Se('baseTag: "'+t.baseTag+'" not found'),a=le(a,i),t)a[o]=re(i[o],t[o]);else a=le(a,t);return void 0!==(r=a.template)&&(a.template=typeof r===K?f[r]||f(r):r),(s.prototype=a).constructor=a._ctr=s,n&&(a._parentTmpl=n),a}},viewModel:{compile:function(e,n){var r,i,o,a=this,s=n.getters,l=n.extend,f=n.id,d=t.extend({_is:e||"unnamed",unmap:T,merge:I},l),h="",g="",v=s?s.length:0,_=t.observable,y={};function m(e){i.apply(this,e)}function E(){return new m(arguments)}function b(e,t){for(var n,r,i,o,l,c=0;c<v;c++)n=void 0,typeof(i=s[c])!==K&&(i=(n=i).getter,l=n.parentRef),void 0===(o=e[i])&&n&&void 0!==(r=n.defaultVal)&&(o=ye(r,e)),t(o,n&&a[n.type],i,l)}function I(e,t,n){e=typeof e===K?JSON.parse(e):e;var r,i,o,a,s,l,u,d,h,g,v=0,m=this;if(p(m)){for(u={},h=[],i=e.length,o=m.length;v<i;v++){for(d=e[v],l=!1,r=0;r<o&&!l;r++)u[r]||(s=m[r],f&&(u[r]=l=typeof f===K?d[f]&&(y[f]?s[f]():s[f])===d[f]:f(s,d)));l?(s.merge(d),h.push(s)):(h.push(g=E.map(d)),n&&me(g,n,t))}_?_(m).refresh(h,!0):m.splice.apply(m,[0,m.length].concat(h))}else for(a in b(e,(function(e,t,n,r){t?m[n]().merge(e,m,r):m[n]()!==e&&m[n](e)})),e)a===c||y[a]||(m[a]=e[a])}function T(){var e,t,n,r,i=0,o=this;function l(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push(e[n].unmap());return t}if(p(o))return l(o);for(e={};i<v;i++)n=void 0,typeof(t=s[i])!==K&&(t=(n=t).getter),r=o[t](),e[t]=n&&r&&a[n.type]?p(r)?l(r):r.unmap():r;for(t in o)!o.hasOwnProperty(t)||"_"===t.charAt(0)&&y[t.slice(1)]||t===c||u(o[t])||(e[t]=o[t]);return e}for(m.prototype=d,r=0;r<v;r++)!function(e){e=e.getter||e,y[e]=r+1;var t="_"+e;h+=(h?",":"")+e,g+="this."+t+" = "+e+";\n",d[e]=d[e]||function(n){if(!arguments.length)return this[t];_?_(this).setProperty(e,n):this[t]=n},_&&(d[e].set=d[e].set||function(e){this[t]=e})}(s[r]);return g=new Function(h,g),i=function(){g.apply(this,arguments),(o=arguments[v+1])&&me(this,arguments[v],o)},i.prototype=d,d.constructor=i,E.map=function(t){var n,r,i,o,a=0,l=t=typeof t===K?JSON.parse(t):t,u=[];if(p(t)){for(n=(t=t||[]).length;a<n;a++)u.push(this.map(t[a]));return u._is=e,u.unmap=T,u.merge=I,u}if(t){for(b(t,(function(e,t){t&&(e=t.map(e)),u.push(e)})),l=this.apply(this,u),a=v;a--;)if(i=u[a],(o=s[a].parentRef)&&i&&i.unmap)if(p(i))for(n=i.length;n--;)me(i[n],o,l);else me(i,o,l);for(r in t)r===c||y[r]||(l[r]=t[r])}return l},E.getters=s,E.extend=l,E.id=f,E}},helper:{},converter:{}};function ne(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function re(e,t){return u(t)&&((t=ne(e?e._d?e:ne(ae,e):ae,t))._d=(e&&e._d||0)+1),t}function ie(e,t){var n,r=t.props;for(n in r)!U.test(n)||e[n]&&e[n].fix||(e[n]="convert"!==n?re(e.constructor.prototype[n],r[n]):r[n])}function oe(e){return e}function ae(){return""}function se(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function le(e,t){if(e){for(var n in t)e[n]=t[n];return e}}function ce(e,t,n){return e?p(e)?ce.apply(a,e):(C=n?n[0]:C,/^(\W|_){5}$/.test(e+t+C)||Se("Invalid delimiters"),E=e[0],b=e[1],I=t[0],T=t[1],_.delimiters=[E+b,I+T,C],e="\\"+E+"(\\"+C+")?\\"+b,t="\\"+I+"\\"+T,i="(?:(\\w+(?=[\\/\\s\\"+I+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+I+"]|\\"+I+"(?!\\"+T+"))*?)",v.rTag="(?:"+i+")",i=new RegExp("(?:"+e+i+"(\\/)?|\\"+E+"(\\"+C+")?\\"+b+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),v.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),m):_.delimiters}function ue(){var e=this.get("item");return e?e.index:void 0}function pe(){return this.index}function fe(e,t,n,r){var i,o,a,s=0;if(1===n&&(r=1,n=void 0),t)for(a=(o=t.split(".")).length;e&&s<a;s++)i=e,e=o[s]?e[o[s]]:e;return n&&(n.lt=n.lt||s<a),void 0===e?r?ae:"":r?function(){return e.apply(i,arguments)}:e}function de(n,r,i){var o,a,s,l,c,p,f,d=this,g=!O&&arguments.length>1,_=d.ctx;if(n){if(d._||(c=d.index,d=d.tag),p=d,_&&_.hasOwnProperty(n)||(_=h).hasOwnProperty(n)){if(s=_[n],"tag"===n||"tagCtx"===n||"root"===n||"parentTags"===n)return s}else _=void 0;if((!O&&d.tagCtx||d.linked)&&(s&&s._cxp||(d=d.tagCtx||u(s)?d:!(d=d.scope||d).isTop&&d.ctx.tag||d,void 0!==s&&d.tagCtx&&(d=d.tagCtx.view.scope),_=d._ocps,(s=_&&_.hasOwnProperty(n)&&_[n]||s)&&s._cxp||!i&&!g||((_||(d._ocps=d._ocps||{}))[n]=s=[{_ocp:s,_vw:p,_key:n}],s._cxp={path:w,ind:0,updateValue:function(e,n){return t.observable(s[0]).setProperty(w,e),this}})),l=s&&s._cxp)){if(arguments.length>2)return(a=s[1]?v._ceo(s[1].deps):[w]).unshift(s[0]),a._cxp=l,a;if(c=l.tagElse,f=s[1]?l.tag&&l.tag.cvtArgs?l.tag.cvtArgs(c,1)[l.ind]:s[1](s[0].data,s[0],v):s[0]._ocp,g)return v._ucp(n,r,d,l),d;s=f}return s&&u(s)&&(o=function(){return s.apply(this&&this!==e?this:p,arguments)},le(o,s)),o||s}}function he(e,t){var n,r,i,o,a,s,l,c=this;if(c.tagName){if(!(c=((s=c).tagCtxs||[c])[e||0]))return}else s=c.tag;if(a=s.bindFrom,o=c.args,(l=s.convert)&&typeof l===K&&(l="true"===l?void 0:c.view.getRsc("converters",l)||Se("Unknown converter: '"+l+"'")),l&&!t&&(o=o.slice()),a){for(i=[],n=a.length;n--;)r=a[n],i.unshift(ge(c,r));t&&(o=i)}if(l){if(void 0===(l=l.apply(s,i||o)))return o;if(n=(a=a||[0]).length,p(l)&&(!1===l.arg0||1!==n&&l.length===n&&!l.arg0)||(l=[l],a=[0],n=1),t)o=l;else for(;n--;)+(r=a[n])===r&&(o[r]=l[n])}return o}function ge(e,t){return(e=e[+t===t?"args":"props"])&&e[t]}function ve(e){return this.cvtArgs(e,1)}function _e(e,t,n,r,i,o,a,s){var l,c,u,p=this,f="array"===t;p.content=s,p.views=f?[]:{},p.data=r,p.tmpl=i,u=p._={key:0,useKey:f?0:1,id:""+B++,onRender:a,bnds:{}},p.linked=!!a,p.type=t||"top",t&&(p.cache={_ct:_._cchCt}),n&&"top"!==n.type||((p.ctx=e||{}).root=p.data),(p.parent=n)?(p.root=n.root||p,l=n.views,c=n._,p.isTop=c.scp,p.scope=(!e.tag||e.tag===n.ctx.tag)&&!p.isTop&&n.scope||p,c.useKey?(l[u.key="_"+c.useKey++]=p,p.index=Q,p.getIndex=ue):l.length===(u.key=p.index=o)?l.push(p):l.splice(o,0,p),p.ctx=e||n.ctx):t&&(p.root=p)}function ye(e,t){return u(e)?e.call(t):e}function me(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0})}function Ee(e,n){var r,i=y._wm||{},o={tmpls:[],links:{},bnds:[],_is:"template",render:Ce};return n&&(o=le(o,n)),o.markup=e,o.htmlTag||(r=M.exec(e),o.htmlTag=r?r[1].toLowerCase():""),(r=i[o.htmlTag])&&r!==i.div&&(o.markup=t.trim(o.markup)),o}function be(e,t){var n=e+"s";a[n]=function r(i,o,s){var l,c,u,p=v.onStore[e];if(i&&typeof i===W&&!i.nodeType&&!i.markup&&!i.getTgt&&!("viewModel"===e&&i.getters||i.extend)){for(c in i)r(c,i[c],o);return o||a}return i&&typeof i!==K&&(s=o,o=i,i=void 0),u=s?"viewModel"===e?s:s[n]=s[n]||{}:r,l=t.compile,void 0===o&&(o=l?i:u[i],i=void 0),null===o?i&&delete u[i]:(l&&((o=l.call(u,i,o,s,0)||{})._is=e),i&&(u[i]=o)),p&&p(i,o,s,l),o}}function Ie(e){m[e]=m[e]||function(t){return arguments.length?(_[e]=t,m):_[e]}}function Te(e){function t(t,n){this.tgt=e.getTgt(t,n),n.map=this}return u(e)&&(e={getTgt:e}),e.baseMap&&(e=le(le({},e.baseMap),e)),e.map=function(e,n){return new t(e,n)},e}function Ce(e,t,n,r,i,a){var s,l,c,f,d,h,g,_=r,m="";if(!0===t?(n=t,t=void 0):typeof t!==W&&(t=void 0),(c=this.tag)?(f=(_=_||this.view)._getTmpl(c.template||this.tmpl),arguments.length||(e=c.contentCtx&&u(c.contentCtx)?e=c.contentCtx(e):_)):f=this,f){if(!r&&e&&"view"===e._is&&(_=e),_&&e===_&&(e=_.data),d=!_,O=O||d,d&&((t=t||{}).root=e),!O||y.useViews||f.useViews||_&&_!==o)m=Ae(f,e,t,n,_,i,a,c);else{if(_?(h=_.data,g=_.index,_.index=Q):(h=(_=o).data,_.data=e,_.ctx=t),p(e)&&!n)for(s=0,l=e.length;s<l;s++)_.index=s,_.data=e[s],m+=f.fn(e[s],_,v);else _.data=e,m+=f.fn(e,_,v);_.data=h,_.index=g}d&&(O=void 0)}return m}function Ae(e,t,n,r,i,o,a,s){var l,c,u,f,d,h,g,_,y,m,E,b,I,T="";if(s&&(y=s.tagName,b=s.tagCtx,n=n?Me(n,s.ctx):s.ctx,e===i.content?g=e!==i.ctx._wrp?i.ctx._wrp:void 0:e!==b.content?e===s.template?(g=b.tmpl,n._wrp=b.content):g=b.content||i.content:g=i.content,!1===b.props.link&&((n=n||{}).link=!1)),i&&(a=a||i._.onRender,(I=n&&!1===n.link)&&i._.nl&&(a=void 0),n=Me(n,i.ctx),b=!s&&i.tag?i.tag.tagCtxs[i.tagElse]:b),(m=b&&b.props.itemVar)&&("~"!==m[0]&&we("Use itemVar='~myItem'"),m=m.slice(1)),!0===o&&(h=!0,o=0),a&&s&&s._.noVws&&(a=void 0),_=a,!0===a&&(_=void 0,a=i._.onRender),E=n=e.helpers?Me(e.helpers,n):n,p(t)&&!r)for((u=h?i:void 0!==o&&i||new _e(n,"array",i,t,e,o,a,g))._.nl=I,i&&i._.useKey&&(u._.bnd=!s||s._.bnd&&s,u.tag=s),l=0,c=t.length;l<c;l++)f=new _e(E,"item",u,t[l],e,(o||0)+l,a,u.content),m&&((f.ctx=le({},E))[m]=v._cp(t[l],"#data",f)),d=e.fn(t[l],f,v),T+=u._.onRender?u._.onRender(d,f):d;else u=h?i:new _e(E,y||"data",i,t,e,o,a,g),m&&((u.ctx=le({},E))[m]=v._cp(t,"#data",u)),u.tag=s,u._.nl=I,T+=e.fn(t,u,v);return s&&(u.tagElse=b.index,b.contentView=u),_?_(T,u):T}function Oe(e,t,n){var r=void 0!==n?u(n)?n.call(t.data,e,t):n||"":"{Error: "+(e.message||e)+"}";return _.onError&&void 0!==(n=_.onError.call(t.data,e,n&&r,t))&&(r=n),t&&!t._lc?d.html(r):r}function Se(e){throw new v.Err(e)}function we(e){Se("Syntax error\n"+e)}function xe(e,t,n,r,o){function a(t){(t-=g)&&y.push(e.substr(g,t).replace(x,"\\n"))}function s(t,n){t&&(t+="}}",we((n?"{{"+n+"}} block has {{/"+t+" without {{"+t:"Unmatched or missing {{/"+t)+", in template:\n"+e))}var l,c,u,p,f,d=_.allowCode||t&&t.allowCode||!0===m.allowCode,h=[],g=0,v=[],y=h,b=[,,h];if(d&&t._is&&(t.allowCode=d),n&&(void 0!==r&&(e=e.slice(0,-r.length-2)+I),e=E+e+T),s(v[0]&&v[0][2].pop()[0]),e.replace(i,(function(i,l,c,f,h,_,m,E,I,T,C,A){(m&&l||I&&!c||E&&":"===E.slice(-1)||T)&&we(i),_&&(h=":",f=Y);var O,S,w,N=(l||n)&&[[]],M="",j="",D="",V="",k="",G="",F="",B="",H=!(I=I||n&&!o)&&!h;c=c||(E=E||"#data",h),a(A),g=A+i.length,m?d&&y.push(["*","\n"+E.replace(/^:/,"ret+= ").replace(L,"$1")+";\n"]):c?("else"===c&&(P.test(E)&&we('For "{{else if expr}}" use "{{else expr}}"'),N=b[9]&&[[]],b[10]=e.substring(b[10],A),S=b[11]||b[0]||we("Mismatched: "+i),b=v.pop(),y=b[2],H=!0),E&&Re(E.replace(x," "),N,t,n).replace(R,(function(e,t,n,r,i,o,a,s){return"this:"===r&&(o="undefined"),s&&(w=w||"@"===s[0]),r="'"+i+"':",a?(j+=n+o+",",V+="'"+s+"',"):n?(D+=r+"j._cp("+o+',"'+s+'",view),',G+=r+"'"+s+"',"):t?F+=o:("trigger"===i&&(B+=o),"lateRender"===i&&(O="false"!==s),M+=r+o+",",k+=r+"'"+s+"',",p=p||U.test(i)),""})).slice(0,-1),N&&N[0]&&N.pop(),u=[c,f||!!r||p||"",H&&[],Ne(V||(":"===c?"'#data',":""),k,G),Ne(j||(":"===c?"data,":""),M,D),F,B,O,w,N||0],y.push(u),H&&(v.push(b),(b=u)[10]=g,b[11]=S)):C&&(s(C!==b[0]&&C!==b[11]&&C,b[0]),b[10]=e.substring(b[10],A),b=v.pop()),s(!b&&C),y=b[2]})),a(e.length),(g=h[h.length-1])&&s(typeof g!==K&&+g[10]===g[10]&&g[0]),n){for(c=Pe(h,e,n),f=[],l=h.length;l--;)f.unshift(h[l][9]);Le(c,f)}else c=Pe(h,t);return c}function Le(e,t){var n,r,i=0,o=t.length;for(e.deps=[],e.paths=[];i<o;i++)for(n in e.paths.push(r=t[i]),r)"_jsvto"!==n&&r.hasOwnProperty(n)&&r[n].length&&!r[n].skp&&(e.deps=e.deps.concat(r[n]))}function Ne(e,t,n){return[e.slice(0,-1),t.slice(0,-1),n.slice(0,-1)]}function Re(e,n,r,i){var o,a,s,l,c,u=n&&n[0],p={bd:u},f={0:p},d=0,h=0,g=0,_={},m=0,E={},b={},I={},T={0:0},C={0:""},A=0;return"@"===e[0]&&(e=e.replace(F,".")),s=(e+(r?" ":"")).replace(v.rPrm,(function(r,s,O,S,w,x,L,R,P,M,j,U,D,V,k,G,F,B,H,q,Y){S&&!R&&(w=S+w),x=x||"",D=D||"",O=O||s||D,w=w||P,M&&(M=!/\)|]/.test(Y[q-1]))&&(w=w.slice(1).split(".").join("^")),j=j||B||"";var K,W,X,$,Q,J,Z,ee=q;if(!c&&!l){if(L&&we(e),F&&u){if(K=I[g-1],Y.length-1>ee-(K||0)){if(K=t.trim(Y.slice(K,ee+r.length)),W=a||f[g-1].bd,(X=W[W.length-1])&&X.prm){for(;X.sb&&X.sb.prm;)X=X.sb;$=X.sb={path:X.sb,bnd:X.bnd}}else W.push($={path:W.pop()});X&&X.sb===$&&(C[g]=C[g-1].slice(X._cpPthSt)+C[g],C[g-1]=C[g-1].slice(0,X._cpPthSt)),$._cpPthSt=T[g-1],$._cpKey=K,C[g]+=Y.slice(A,q),A=q,$._cpfn=z[K]=z[K]||new Function("data,view,j","//"+K+"\nvar v;\nreturn ((v="+C[g]+("]"===G?")]":G)+")!=null?v:null);"),C[g-1]+=b[h]&&y.cache?'view.getCache("'+K.replace(N,"\\$&")+'"':C[g],$.prm=p.bd,$.bnd=$.bnd||$.path&&$.path.indexOf("^")>=0}C[g]=""}"["===j&&(j="[j._sq("),"["===O&&(O="[j._sq(")}return Z=c?(c=!V)?r:D+'"':l?(l=!k)?r:D+'"':(O?(E[++h]=!0,_[h]=0,u&&(I[g++]=ee++,p=f[g]={bd:[]},C[g]="",T[g]=1),O):"")+(H?h?"":(d=Y.slice(d,ee),(o?(o=a=!1,"\b"):"\b,")+d+(d=ee+r.length,u&&n.push(p.bd=[]),"\b")):R?(g&&we(e),u&&n.pop(),o="_"+w,d=ee+r.length,u&&((u=p.bd=n[o]=[]).skp=!S),w+":"):w?w.split("^").join(".").replace(v.rPath,(function(e,t,r,s,l,c,f,d){if(Q="."===r,r&&(w=w.slice(t.length),/^\.?constructor$/.test(d||w)&&we(e),Q||(e=(M?(i?"":"(ltOb.lt=ltOb.lt||")+"(ob=":"")+(s?'view.ctxPrm("'+s+'")':l?"view":"data")+(M?")===undefined"+(i?"":")")+'?"":view._getOb(ob,"':"")+(d?(c?"."+c:s||l?"":"."+r)+(f||""):(d=s?"":l?c||"":r,"")),e=t+("view.data"===(e+=d?"."+d:"").slice(0,9)?e.slice(5):e)+(M?(i?'"':'",ltOb')+(j?",1)":")"):"")),u)){if(W="_linkTo"===o?a=n._jsvto=n._jsvto||[]:p.bd,X=Q&&W[W.length-1]){if(X._cpfn){for(;X.sb;)X=X.sb;X.prm&&(X.bnd&&(w="^"+w.slice(1)),X.sb=w,X.bnd=X.bnd||"^"===w[0])}}else W.push(w);j&&!Q&&(I[g]=ee,T[g]=C[g].length)}return e}))+(j||x):x||(G?"]"===G?")]":")":U?(b[h]||we(e),","):s?"":(c=V,l=k,'"'))),c||l||G&&(b[h]=!1,h--),u&&(c||l||(G&&(E[h+1]&&(p=f[--g],E[h+1]=!1),m=_[h+1]),j&&(_[h+1]=C[g].length+(O?1:0),(w||G)&&(p=f[++g]={bd:[]},E[h+1]=!0))),C[g]=(C[g]||"")+Y.slice(A,q),A=q+r.length,c||l||((J=O&&E[h+1])&&(C[g-1]+=O,T[g-1]++),"("===j&&Q&&!$&&(C[g]=C[g-1].slice(m)+C[g],C[g-1]=C[g-1].slice(0,m))),C[g]+=J?Z.slice(1):Z),c||l||!j||(h++,w&&"("===j&&(b[h]=!0)),c||l||!B||(u&&(C[g]+=j),Z+=j),Z})),u&&(s=C[0]),!h&&s||we(e)}function Pe(e,t,n){var r,i,o,a,s,l,c,u,p,f,d,h,v,m,E,b,I,T,C,A,O,S,w,N,R,P,M,j,U,D,V,k,G,F,B=0,H=y.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,q="",W={},X=e.length;for(typeof t===K?(I=n?'data-link="'+t.replace(x," ").slice(1,-1)+'"':t,t=0):(I=t.tmplName||"unnamed",t.allowCode&&(W.allowCode=!0),t.debug&&(W.debug=!0),f=t.bnds,b=t.tmpls),r=0;r<X;r++)if(typeof(i=e[r])===K)q+='+"'+i+'"';else if("*"===(o=i[0]))q+=";\n"+i[1]+"\nret=ret";else{if(a=i[1],A=!n&&i[2],G=i[3],F=h=i[4],s="\n\tparams:{args:["+G[0]+"],\n\tprops:{"+G[1]+"}"+(G[2]?",\n\tctx:{"+G[2]+"}":"")+"},\n\targs:["+F[0]+"],\n\tprops:{"+F[1]+"}"+(F[2]?",\n\tctx:{"+F[2]+"}":""),U=i[6],D=i[7],i[8]?(V="\nvar ob,ltOb={},ctxs=",k=";\nctxs.lt=ltOb.lt;\nreturn ctxs;"):(V="\nreturn ",k=""),O=i[10]&&i[10].replace(L,"$1"),(N="else"===o)?d&&d.push(i[9]):(M=i[5]||!1!==_.debugMode&&"undefined",f&&(d=i[9])&&(d=[d],B=f.push(1))),H=H||h[1]||h[2]||d||/view.(?!index)/.test(h[0]),(R=":"===o)?a&&(o=a===Y?">":a+o):(A&&((T=Ee(O,W)).tmplName=I+"/"+o,T.useViews=T.useViews||H,Pe(A,T),H=T.useViews,b.push(T)),N||(C=o,H=H||o&&(!g[o]||!g[o].flow),w=q,q=""),S=(S=e[r+1])&&"else"===S[0]),j=M?";\ntry{\nret+=":"\n+",v="",m="",R&&(d||U||a&&a!==Y||D)){if((P=new Function("data,view,j","// "+I+" "+ ++B+" "+o+V+"{"+s+"};"+k))._er=M,P._tag=o,P._bd=!!d,P._lr=D,n)return P;Le(P,d),p=!0,v=(E='c("'+a+'",view,')+B+",",m=")"}if(q+=R?(n?(M?"try{\n":"")+"return ":j)+(p?(p=void 0,H=u=!0,E+(P?(f[B-1]=P,B):"{"+s+"}")+")"):">"===o?(c=!0,"h("+h[0]+")"):"((v="+h[0]+")!=null?v:"+(n?"null)":'"")')):(l=!0,"\n{view:view,content:false,tmpl:"+(A?b.length:"false")+","+s+"},"),C&&!S){if(q="["+q.slice(0,-1)+"]",E='t("'+C+'",view,this,',n||d){if((q=new Function("data,view,j"," // "+I+" "+B+" "+C+V+q+k))._er=M,q._tag=C,d&&Le(f[B-1]=q,d),q._lr=D,n)return q;v=E+B+",undefined,",m=")"}q=w+j+E+(d&&B||q)+")",d=0,C=0}M&&!S&&(H=!0,q+=";\n}catch(e){ret"+(n?"urn ":"+=")+v+"j._err(e,view,"+M+")"+m+";}"+(n?"":"\nret=ret"))}q="// "+I+(W.debug?"\ndebugger;":"")+"\nvar v"+(l?",t=j._tag":"")+(u?",c=j._cnvt":"")+(c?",h=j._html":"")+(n?(i[8]?", ob":"")+";\n":',ret=""')+q+(n?"\n":";\nreturn ret;");try{q=new Function("data,view,j",q)}catch(e){we("Compiled template code:\n\n"+q+'\n: "'+(e.message||e)+'"')}return t&&(t.fn=q,t.useViews=!!H),q}function Me(e,t){return e&&e!==t?t?le(le({},t),e):e:t&&le({},t)}function je(e,n){var r,i,o,a=n.tag,s=n.props,c=n.params.props,f=s.filter,d=s.sort,h=!0===d,g=parseInt(s.step),v=s.reverse?-1:1;if(!p(e))return e;if(h||d&&typeof d===K?((r=e.map((function(e,t){return{i:t,v:typeof(e=h?e:fe(e,d))===K?e.toLowerCase():e}}))).sort((function(e,t){return e.v>t.v?v:e.v<t.v?-v:0})),e=r.map((function(t){return e[t.i]}))):(d||v<0)&&!a.dataMap&&(e=e.slice()),u(d)&&(e=e.sort((function(){return d.apply(n,arguments)}))),v<0&&(!d||u(d))&&(e=e.reverse()),e.filter&&f&&(e=e.filter(f,n),n.tag.onFilter&&n.tag.onFilter(n)),c.sorted&&(r=d||v<0?e:e.slice(),a.sorted?t.observable(a.sorted).refresh(r):n.map.sorted=r),i=s.start,o=s.end,(c.start&&void 0===i||c.end&&void 0===o)&&(i=o=0),isNaN(i)&&isNaN(o)||(i=+i||0,o=void 0===o||o>e.length?e.length:+o,e=e.slice(i,o)),g>1){for(i=0,o=e.length,r=[];i<o;i+=g)r.push(e[i]);e=r}return c.paged&&a.paged&&l(a.paged).refresh(e),e}function Ue(e,n,r){var i=this.jquery&&(this[0]||Se("Unknown template")),o=i.getAttribute(X);return Ce.call(o&&t.data(i)[$]||f(i),e,n,r)}function De(e){return H[e]||(H[e]="&#"+e.charCodeAt(0)+";")}function Ve(e,t){return q[t]||""}function ke(e){return null!=e?j.test(e)&&(""+e).replace(V,De)||e:""}if(a={jsviews:S,sub:{rPath:/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,rPrm:/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(?:(\()\s*)?\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,View:_e,Err:se,tmplFn:xe,parse:Re,extend:le,extendCtx:Me,syntaxErr:we,onStore:{template:function(e,t){null===t?delete J[e]:e&&(J[e]=t)}},addSetting:Ie,settings:{allowCode:!1},advSet:ae,_thp:ie,_gm:re,_tg:function(){},_cnvt:function(e,t,n,r){var i,o,a,s,l,c="number"==typeof n&&t.tmpl.bnds[n-1];if(void 0===r&&c&&c._lr&&(r=""),void 0!==r?n=r={props:{},args:[r]}:c&&(n=c(t.data,t,v)),c=c._bd&&c,e||c){if(i=(o=t._lc)&&o.tag,n.view=t,!i){if(i=le(new v._tg,{_:{bnd:c,unlinked:!0,lt:n.lt},inline:!o,tagName:":",convert:e,onArrayChange:!0,flow:!0,tagCtx:n,tagCtxs:[n],_is:"tag"}),(s=n.args.length)>1)for(l=i.bindTo=[];s--;)l.unshift(s);o&&(o.tag=i,i.linkCtx=o),n.ctx=Me(n.ctx,(o?o.view:t).ctx),ie(i,n)}i._er=r&&a,i.ctx=n.ctx||i.ctx||{},n.ctx=void 0,a=i.cvtArgs()[0],i._er=r&&a}else a=n.args[0];return null!=(a=c&&t._.onRender?t._.onRender(a,t,i):a)?a:""},_tag:function(e,t,n,r,i,a){function s(e){var t=l[e];if(void 0!==t)for(t=p(t)?t:[t],_=t.length;_--;)j=t[_],isNaN(parseInt(j))||(t[_]=parseInt(j));return t||[0]}var l,c,u,f,h,g,_,y,m,E,b,I,T,C,A,O,S,w,x,L,N,R,P,M,j,U,V,k,G,F=0,B="",H=(t=t||o)._lc||!1,q=t.ctx,K=n||t.tmpl,W="number"==typeof r&&t.tmpl.bnds[r-1];for("tag"===e._is?(e=(l=e).tagName,r=l.tagCtxs,l.template):(c=t.getRsc("tags",e)||Se("Unknown tag: {{"+e+"}} ")).template,void 0===a&&W&&(W._lr=c.lateRender&&!1!==W._lr||W._lr)&&(a=""),void 0!==a?(B+=a,r=a=[{props:{},args:[],params:{props:{}}}]):W&&(r=W(t.data,t,v)),g=r.length;F<g;F++)O=(E=r[F]).tmpl,(!H||!H.tag||F&&!H.tag.inline||l._er||O&&+O===O)&&(O&&K.tmpls&&(E.tmpl=E.content=K.tmpls[O-1]),E.index=F,E.ctxPrm=de,E.render=Ce,E.cvtArgs=he,E.bndArgs=ve,E.view=t,E.ctx=Me(Me(E.ctx,c&&c.ctx),q)),(n=E.props.tmpl)&&(E.tmpl=t._getTmpl(n),E.content=E.content||E.tmpl),l?H&&H.fn._lr&&(S=!!l.init):(S=!!(l=new c._ctr).init,l.parent=h=q&&q.tag,l.tagCtxs=r,H&&(l.inline=!1,H.tag=l),l.linkCtx=H,(l._.bnd=W||H.fn)?(l._.ths=E.params.props.this,l._.lt=r.lt,l._.arrVws={}):l.dataBoundOnly&&Se(e+" must be data-bound:\n{^{"+e+"}}")),P=l.dataMap,E.tag=l,P&&r&&(E.map=r[F].map),l.flow||(b=E.ctx=E.ctx||{},u=l.parents=b.parentTags=q&&Me(b.parentTags,q.parentTags)||{},h&&(u[h.tagName]=h),u[l.tagName]=b.tag=l,b.tagCtx=E);if(!(l._er=a)){for(ie(l,r[0]),l.rendering={rndr:l.rendering},F=0;F<g;F++){if(R=(E=l.tagCtx=r[F]).props,l.ctx=E.ctx,!F){if(S&&(l.init(E,H,l.ctx),S=void 0),E.args.length||!1===E.argDefault||!1===l.argDefault||(E.args=L=[E.view.data],E.params.args=["#data"]),T=s("bindTo"),void 0!==l.bindTo&&(l.bindTo=T),void 0!==l.bindFrom?l.bindFrom=s("bindFrom"):l.bindTo&&(l.bindFrom=l.bindTo=T),C=l.bindFrom||T,V=T.length,U=C.length,l._.bnd&&(k=l.linkedElement)&&(l.linkedElement=k=p(k)?k:[k],V!==k.length&&Se("linkedElement not same length as bindTo")),(k=l.linkedCtxParam)&&(l.linkedCtxParam=k=p(k)?k:[k],U!==k.length&&Se("linkedCtxParam not same length as bindFrom/bindTo")),C)for(l._.fromIndex={},l._.toIndex={},y=U;y--;)for(j=C[y],_=V;_--;)j===T[_]&&(l._.fromIndex[_]=y,l._.toIndex[y]=_);H&&(H.attr=l.attr=H.attr||l.attr||H._dfAt),f=l.attr,l._.noVws=f&&f!==Y}if(L=l.cvtArgs(F),l.linkedCtxParam)for(N=l.cvtArgs(F,1),_=U,G=l.constructor.prototype.ctx;_--;)(I=l.linkedCtxParam[_])&&(j=C[_],A=N[_],E.ctx[I]=v._cp(G&&void 0===A?G[I]:A,void 0!==A&&ge(E.params,j),E.view,l._.bnd&&{tag:l,cvt:l.convert,ind:_,tagElse:F}));(w=R.dataMap||P)&&(L.length||R.dataMap)&&((x=E.map)&&x.src===L[0]&&!i||(x&&x.src&&x.unmap(),w.map(L[0],E,x,!l._.bnd),x=E.map),L=[x.tgt]),m=void 0,l.render&&(m=l.render.apply(l,L),t.linked&&m&&!D.test(m)&&((n={links:[]}).render=n.fn=function(){return m},m=Ae(n,t.data,void 0,!0,t,void 0,void 0,l))),L.length||(L=[t]),void 0===m&&(M=L[0],l.contentCtx&&(M=!0===l.contentCtx?t:l.contentCtx(M)),m=E.render(M,!0)||(i?void 0:"")),B=B?B+(m||""):void 0!==m?""+m:void 0}l.rendering=l.rendering.rndr}return l.tagCtx=r[0],l.ctx=l.tagCtx.ctx,l._.noVws&&l.inline&&(B="text"===f?d.html(B):""),W&&t._.onRender?t._.onRender(B,t,l):B},_er:Se,_err:Oe,_cp:oe,_sq:function(e){return"constructor"===e&&we(""),e}},settings:{delimiters:ce,advanced:function(e){return e?(le(y,e),v.advSet(),m):y}},map:Te},(se.prototype=new Error).constructor=se,ue.depends=function(){return[this.get("item"),"index"]},pe.depends="index",_e.prototype={get:function(e,t){t||!0===e||(t=e,e=void 0);var n,r,i,o,a=this,s="root"===t;if(e){if(!(o=t&&a.type===t&&a))if(n=a.views,a._.useKey){for(r in n)if(o=t?n[r].get(e,t):n[r])break}else for(r=0,i=n.length;!o&&r<i;r++)o=t?n[r].get(e,t):n[r]}else if(s)o=a.root;else if(t)for(;a&&!o;)o=a.type===t?a:void 0,a=a.parent;else o=a.parent;return o||void 0},getIndex:pe,ctxPrm:de,getRsc:function(e,t){var n,r,i=this;if(typeof t===K){for(;void 0===n&&i;)n=(r=i.tmpl&&i.tmpl[e])&&r[t],i=i.parent;return n||a[e][t]}},_getTmpl:function(e){return e&&(e.fn?e:this.getRsc("templates",e)||f(e))},_getOb:fe,getCache:function(e){return _._cchCt>this.cache._ct&&(this.cache={_ct:_._cchCt}),void 0!==this.cache[e]?this.cache[e]:this.cache[e]=z[e](this.data,this,v)},_is:"view"},v=a.sub,m=a.settings,!t.link){for(r in te)be(r,te[r]);if(d=a.converters,h=a.helpers,g=a.tags,v._tg.prototype={baseApply:function(e){return this.base.apply(this,e)},cvtArgs:he,bndArgs:ve,ctxPrm:de},o=v.topView=new _e,t){if(t.fn.render=Ue,c=t.expando,t.observable){if(S!==(S=t.views.jsviews))throw"jquery.observable.js requires jsrender.js "+S;le(v,t.views.sub),a.map=t.views.map}}else t={},n&&(e.jsrender=t),t.renderFile=t.__express=t.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},t.isFunction=function(e){return"function"==typeof e},t.isArray=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},v._jq=function(e){e!==t&&(le(e,t),(t=e).fn.render=Ue,delete t.jsrender,c=t.expando)},t.jsrender=S;for(A in(_=v.settings).allowCode=!1,u=t.isFunction,t.render=J,t.views=a,t.templates=f=a.templates,_)Ie(A);(m.debugMode=function(e){return void 0===e?_.debugMode:(_._clFns&&_._clFns(),_.debugMode=e,_.onError=typeof e===K?function(){return e}:u(e)?e:void 0,m)})(!1),y=_.advanced={cache:!0,useViews:!1,_jsv:!1},g({if:{render:function(e){var t=this,n=t.tagCtx;return t.rendering.done||!e&&(n.args.length||!n.index)?"":(t.rendering.done=!0,void(t.selected=n.index))},contentCtx:!0,flow:!0},for:{sortDataMap:Te(je),init:function(e,t){this.setDataMap(this.tagCtxs)},render:function(e){var t,n,r,i,o,a=this,s=a.tagCtx,l=!1===s.argDefault,c=s.props,u=l||s.args.length,f="",d=0;if(!a.rendering.done){if(t=u?e:s.view.data,l)for(l=c.reverse?"unshift":"push",i=+c.end,o=+c.step||1,t=[],r=+c.start||0;(i-r)*o>0;r+=o)t[l](r);void 0!==t&&(n=p(t),f+=s.render(t,!u||c.noIteration),d+=n?t.length:1),(a.rendering.done=d)&&(a.selected=s.index)}return f},setDataMap:function(e){for(var t,n,r,i=e.length;i--;)n=(t=e[i]).props,r=t.params.props,t.argDefault=void 0===n.end||t.args.length>0,n.dataMap=!1!==t.argDefault&&p(t.args[0])&&(r.sort||r.start||r.end||r.step||r.filter||r.reverse||n.sort||n.start||n.end||n.step||n.filter||n.reverse)&&this.sortDataMap},flow:!0},props:{baseTag:"for",dataMap:Te((function(e,n){var r,i,o=n.map,a=o&&o.propsArr;if(!a){if(a=[],typeof e===W||u(e))for(r in e)i=e[r],r===c||!e.hasOwnProperty(r)||n.props.noFunctions&&t.isFunction(i)||a.push({key:r,prop:i});o&&(o.propsArr=o.options&&a)}return je(a,n)})),init:ae,flow:!0},include:{flow:!0},"*":{render:oe,flow:!0},":*":{render:oe,flow:!0},dbg:h.dbg=d.dbg=function(e){try{throw console.log("JsRender dbg breakpoint: "+e),"dbg breakpoint"}catch(e){}return this.base?this.baseApply(arguments):e}}),d({html:ke,attr:ke,encode:function(e){return typeof e===K?e.replace(k,De):e},unencode:function(e){return typeof e===K?e.replace(G,Ve):e},url:function(e){return null!=e?encodeURI(""+e):null===e?e:""}})}if(_=v.settings,p=(t||Z).isArray,m.delimiters("{{","}}","^"),ee&&Z.views.sub._jq(t),a=t.views,v=a.sub,u=t.isFunction,p=t.isArray,c=t.expando,!t.observe){var Ge=t.event.special,Fe=[].slice,Be=[].splice,He=[].concat,qe=parseInt,Ye=/\S+/g,Ke=/^[^.[]*$/,We=v.propChng=v.propChng||"propertyChange",Xe=v.arrChng=v.arrChng||"arrayChange",$e={},Qe=We+".observe",ze=1,Je=1,Ze=1,et=t.data,tt={},nt=[],rt=function(e){return e?e._cId=e._cId||".obs"+Je++:""},it=function(e,t){return this._data=t,this._ns=e,this},ot=function(e,t){return this._data=t,this._ns=e,this},at=function(e,t,n){var r,i,o,a,s=o=t,l=(e=e?p(e)?e:[e]:[])&&e.length,c=[];for(r=0;r<l;r++)i=e[r],u(i)?(a=t.tagName?t.linkCtx.data:t,c=c.concat(at(i.call(t,a,n),a,n))):typeof i===K?(s!==o&&c.push(o=s),c.push(i)):(t=s=i=void 0===i?null:i,s!==o&&c.push(o=s));return c.length&&(c.unshift({_ar:1}),c.push({_ar:-1})),c},st=function(e,t){function n(e){return typeof e===W&&(d[0]||!f&&p(e))}if(!e.data||!e.data.off){var r,i,o,a=t.oldValue,s=t.value,l=e.data,c=l.observeAll,u=l.cb,f=l._arOk?0:1,d=l.paths,h=l.ns;e.type===Xe?(u.array||u).call(l,e,t):l.prop!==t.path&&"*"!==l.prop||(c?(r=c._path+"."+t.path,i=c.filter,o=[e.target].concat(c.parents()),n(a)&<(void 0,h,[a],d,u,!0,i,[o],r),n(s)&<(void 0,h,[s],d,u,void 0,i,[o],r)):(n(a)&<(f,h,[a],d,u,!0),n(s)&<(f,h,[s],d,u)),l.cb(e,t))}},lt=function(){var e=He.apply([],arguments);return s.apply(e.shift(),e)},ct=function(e,t,n){pt(this._ns,this._data,e,t,[],"root",n)},ut=function(e,t){ct.call(this,e,t,!0)},pt=function(e,n,r,i,o,a,u,f){function d(e,t){for(v=e.length,y=a+"[]";v--;)h(e,v,t,1)}function h(t,n,o,a){var s,u;+n!==n&&n===c||!(s=l._fltr(y,t[n],m,i))||(u=m.slice(),a&&E&&u[0]!==E&&u.unshift(E),pt(e,s,r,i||(a?void 0:0),u,y,o,f))}function g(e,t){switch(a=e.data.observeAll._path,E=e.target,t.change){case"insert":d(t.items);break;case"remove":d(t.items,!0);break;case"set":y=a+"."+t.path,h(t,"oldValue",!0),h(t,"value")}E=void 0,r.apply(this,arguments)}g._wrp=1;var v,_,y,m,E,b,I=!f||f.un||!u;if(n&&typeof n===W){if(m=[n].concat(o),_=p(n)?"":"*",f&&I&&t.hasData(n)&&f[b=et(n).obId])return void f[b]++;if(f||(f={un:u}),r){if(_||0!==i)if(g._cId=rt(r),I)s(e,n,_,g,u,i,m,a),b=et(n).obId,f[b]=(f[b]||0)+1;else{if(--f[et(n).obId])return;s(e,n,_,g,u,i,m,a)}}else f&&(f[et(n).obId]=1),s(e,n,_,void 0,u,i,m,a);if(_)for(v in n)y=a+"."+v,h(n,v,u);else d(n,u)}},ft=function(e){return Ke.test(e)},dt=function(){return[].push.call(arguments,!0),s.apply(void 0,arguments)},ht=function(e){var t,n=this.slice();for(this.length=0,this._go=0;t=n.shift();)t.skip||t[0]._trigger(t[1],t[2],!0);this.paths={}};s=function(){var e,n=1==this?0:1,r=Fe.call(arguments),i=r[0];return typeof i===K&&(e=i,r.shift()),function r(){var i,o,a,f,d,h,g,_,y,m,E,b,I,T,C,A,O,S,w,x;function L(e,t){var n;for(g in t)n=t[g],p(n)?R(e,n,a,a):N(e,n,void 0,M,"")}function N(r,i,o,s,l,c,u){var f,d,h,v=function(e){return p(e)?[e]:e}(i),_=b,y=I;if(s=e?s+"."+e:s,!a&&(u||c))for(w=(w=t._data(i).events)&&w[c?Xe:We],x=w&&w.length;x--;)if((g=w[x]&&w[x].data)&&(u&&g.ns!==e||!u&&g.ns===e&&g.cb&&g.cb._cId===r._cId&&g.cb._inId===r._inId&&(!r._wrp||g.cb._wrp)))return;a||u?t(v).off(s,st):((d=c?{}:{fullPath:o,paths:l?[l]:[],prop:S,_arOk:n}).ns=e,d.cb=r,I&&(d.observeAll={_path:y,path:function(){return f=_.length,y.replace(/[[.]/g,(function(e){return f--,"["===e?"["+t.inArray(_[f-1],_[f]):"."}))},parents:function(){return _},filter:T}),t(v).on(s,null,d,st),m&&(h=(h=et(i)).obId||(h.obId=ze++),m[h]=m[h]||(m.len++,i)))}function R(e,t,r,i,o){if(n){var a,s=I;a=t,o&&(a=t[o],I=I?I+"."+o:I),T&&a&&(a=l._fltr(I,a,o?[t].concat(b):b,T)),a&&(i||p(a))&&N(e,a,void 0,Xe+".observe"+rt(e),void 0,!0,r),I=s}}function P(i){function l(i,f,d,h){function _(e){return e.ob=h(e),e.cb=function(t,i){var o=e.ob,a=e.sb,s=h(e);s!==o&&(typeof o===W&&(R(d,o,!0),(a||n&&p(o))&&r([o],a,d,h,!0)),e.ob=s,typeof s===W&&(R(d,s),(a||n&&p(s))&&r([s],a,d,h))),d(t,i)}}function m(r,i){function o(e,t){var n;if("insert"===t.change||(a="remove"===t.change)){for(n=t.items.length;n--;)m(t.items[n],i.slice());a=!1}}d&&(o._cId=rt(d),o._inId=".arIn"+Ze++);var f,v,_,y,E,b,A,O=r;if(r&&r._cxp)return l(r[0],[r[1]],d,h);for(;void 0!==(S=i.shift());){if(O&&typeof O===W&&typeof S===K){if(""===S)continue;if("()"===S.slice(-2)&&(S=S.slice(0,-2),A=!0),i.length<C+1&&!O.nodeType){if(!a&&(w=t._data(O).events)){for(w=w&&w[We],x=w&&w.length,v=0;x--;)!(g=w[x].data)||g.ns!==e||g.cb._cId!==d._cId||g.cb._inId!==d._inId||!g._arOk!=!n||g.prop!==S&&"*"!==g.prop&&"**"!==g.prop||((E=i.join("."))&&g.paths.push(E),v++);if(v){b=O[S],O=u(b)?b.call(O):O[S];continue}}if("*"===S||"**"===S){if(!a&&w&&w.length&&N(d,O,T,M,"",!1,!0),"*"===S)for(E in N(d,O,T,M,""),O)E!==c&&R(d,O,a,void 0,E);else t.observable(e,O)[(a?"un":"")+"observeAll"](d);break}"[]"==S?p(O)&&(a?N(d,O,T,Xe+rt(d),void 0,a,a):s(e,O,o,a)):S&&N(d,O,T,M+".p_"+S,i.join("^"))}if(I&&(I+="."+S),"[]"===S){for(p(O)&&(y=O,f=O.length);f--;)m(O=y[f],i.slice());return}S=O[S],i[0]||R(d,S,a)}if(u(S)&&((_=(b=S).depends)&&(O._vw&&O._ocp&&((O=O._vw)._tgId&&(O=O.tagCtx.view),O=O.data),P(He.apply([],[[O],at(_,O,d)]))),A)){if(!i[0]){R(d,b.call(O),a);break}if(!(S=b.call(O)))break}O=S}}var b,T,C=0,A=f.length;for(!i||h||!(O="view"===i._is)&&"tag"!==i._is||(h=v._gccb(O?i:i.tagCtx.contentView),d&&!a&&function(){var e=i,t=d;(d=function(n,r){t.call(e,n,r)})._cId=t._cId,d._inId=t._inId}(),i=O?i.data:i),f[0]||(p(i)?R(d,i,a,!0):a&&N(d,i,void 0,M,"")),b=0;b<A;b++)if(""!==(T=f[b]))if(T&&T._ar)n+=T._ar;else if(typeof T===K)if((o=T.split("^"))[1]&&(C=o[0].split(".").length,T=o.join("."),C=T.split(".").length-C),h&&(y=h(T,C))){if(y.length){var L=y[0],j=y[1];if(L&&L._cxp&&(j=L[1],"view"===(L=L[0])._is)){l(L,[j],d);continue}typeof j===K?m(L,j.split(".")):l(y.shift(),y,d,h)}}else m(i,T.split("."));else!u(T)&&T&&T._cpfn&&((E=a?T.cb:_(T))._cId=d._cId,E._inId=E._inId||".obIn"+Ze++,(T.bnd||T.prm&&T.prm.length||!T.sb)&&r([i],T.path,T.prm.length?[T.root||i]:[],T.prm,E,h,a),T.sb&&(T.sb.prm&&(T.sb.root=i),l(T.ob,[T.sb],d,h)))}for(var d,h=[],m=i.length;m--;)typeof(d=i[m])===K||d&&(d._ar||d._cpfn)?h.unshift(d):(l(d,h,f,_),h=[])}var M=Qe,j=1!=this?He.apply([],arguments):Fe.call(arguments),U=j.pop()||!1,D=j.length;if(typeof U===K&&(I=U,b=j.pop(),T=j.pop(),U=!!j.pop(),D-=3),U===!!U&&(a=U,U=j[D-1],U=!D||typeof U===K||U&&!u(U)?void 0:(D--,j.pop()),a&&!D&&u(j[0])&&(U=j.shift())),f=U,D&&u(j[D-1])&&(_=f,U=f=j.pop(),D--),!a||!f||f._cId){for(M+=f?(h=f._inId||"",a?f._cId+h:(d=rt(f))+h):"",d&&!a&&(m=$e[d]=$e[d]||{len:0}),A=(C=e&&e.match(Ye)||[""]).length;A--;){if(e=C[A],a&&arguments.length<3)if(f)L(f,$e[f._cId]);else if(!j[0])for(i in $e)L(f,$e[i]);P(j)}return d&&!m.len&&delete $e[d],{cbId:d,bnd:m}}}.apply(1,r)},nt.wait=function(){var e=this;e._go=1,setTimeout((function(){e.trigger(!0),e._go=0,e.paths={}}))},l=function(e,t,n){typeof e!==K&&(n=t,t=e,e=""),n=void 0===n?y.asyncObserve:n;var r=p(t)?new ot(e,t):new it(e,t);return n&&(!0===n&&(r.async=!0,n=nt),n.trigger||(p(n)?(n.trigger=ht,n.paths={}):n=void 0),r._batch=n),r},t.observable=l,l._fltr=function(e,t,n,r){if(!r||!u(r)||r(e,t,n))return typeof(t=u(t)?t.set&&t.call(n[0]):t)===W&&t},l.Object=it,l.Array=ot,t.observe=l.observe=s,t.unobserve=l.unobserve=dt,l._apply=lt,it.prototype={_data:null,observeAll:ct,unobserveAll:ut,data:function(){return this._data},setProperty:function(e,t,n,r){var i,o,a,s,l=typeof(e=e||"")!==K,u=this,f=u._data,d=u._batch;if(f)if(l)if(n=t,p(e))for(i=e.length;i--;)o=e[i],u.setProperty(o.name,o.value,void 0===n||n);else{for(i in d||(u._batch=s=[],s.trigger=ht,s.paths={}),e)u.setProperty(i,e[i],n);s&&(u._batch.trigger(),u._batch=void 0)}else if(e!==c){for(a=e.split(/[.^]/);f&&a.length>1;)f=f[a.shift()];f&&u._setProperty(f,a[0],t,n,r)}return u},removeProperty:function(e){return this.setProperty(e,tt),this},_setProperty:function(e,t,n,r,i){var o,a,s,l,c,p=t?e[t]:e;if(u(p)&&!u(n)){if(i&&!p.set)return;p.set&&(c=e._vw||e,o=!0===(a=p).set?a:a.set,p=a.call(c))}(p!==n||r&&p!=n)&&(!(p instanceof Date&&n instanceof Date)||p>n||p<n)&&(o?(o.call(c,n),n=a.call(c)):(s=n===tt)?void 0!==p?(delete e[t],n=void 0):t=void 0:t&&(e[t]=n),t&&(l={change:"set",path:t,value:n,oldValue:p,remove:s},e._ocp&&(l.ctxPrm=e._key),this._trigger(e,l)))},_trigger:function(e,n,r){_._cchCt++;var i,o,a,s=this;t.hasData(e)&&(!r&&(o=s._batch)?(s.async&&!o._go&&o.wait(),o.push([s,e,n]),i=et(e).obId+n.path,(a=o.paths[i])&&(o[a-1].skip=1),o.paths[i]=o.length):(t(e).triggerHandler(We+(this._ns?"."+/^\S+/.exec(this._ns)[0]:""),n),n.oldValue=null))}},ot.prototype={_data:null,observeAll:ct,unobserveAll:ut,data:function(){return this._data},insert:function(e,t){var n=this._data;return 1===arguments.length&&(t=e,e=n.length),(e=qe(e))>-1&&(t=p(t)?t:[t]).length&&this._insert(e,t),this},_insert:function(e,t){var n=this._data,r=n.length;e>r&&(e=r),Be.apply(n,[e,0].concat(t)),this._trigger({change:"insert",index:e,items:t},r)},remove:function(e,t){var n,r=this._data;return void 0===e&&(e=r.length-1),e=qe(e),(t=t?qe(t):0===t?0:1)>0&&e>-1&&(t=(n=r.slice(e,e+t)).length)&&this._remove(e,t,n),this},_remove:function(e,t,n){var r=this._data,i=r.length;r.splice(e,t),this._trigger({change:"remove",index:e,items:n},i)},move:function(e,t,n){return n=n?qe(n):0===n?0:1,e=qe(e),t=qe(t),n>0&&e>-1&&t>-1&&e!==t&&this._move(e,t,n),this},_move:function(e,t,n){var r,i=this._data,o=i.length,a=e+n-o;a>0&&(n-=a),n&&(r=i.splice(e,n),t>i.length&&(t=i.length),Be.apply(i,[t,0].concat(r)),t!==e&&this._trigger({change:"move",oldIndex:e,index:t,items:r},o))},refresh:function(e){function t(){i&&(s.insert(r-i,l),f+=i,n+=i,i=0,l=[])}var n,r,i,o,a,s=this,l=[],c=s._data,u=c.slice(),p=c.length,f=p,d=e.length;for(s._srt=!0,r=i=0;r<d;r++)if((o=e[r])===c[r-i])t();else{for(n=r-i;n<f&&o!==c[n];n++);if(n<f){for(t(),a=0;a++<d-n&&e[r+a]===c[n+a];);s.move(n,r,a),r+=a-1}else i++,l.push(o)}return t(),f>r&&s.remove(r,f-r),s._srt=void 0,(p||d)&&s._trigger({change:"refresh",oldItems:u},p),s},_trigger:function(e,n,r){_._cchCt++;var i,o,a,s=this;t.hasData(o=s._data)&&(!r&&(a=s._batch)?(e._dly=!0,a.push([s,e,n]),s.async&&!a._go&&a.wait()):(i=o.length,o=t([o]),s._srt?e.refresh=!0:i!==n&&o.triggerHandler(We,{change:"set",path:"length",value:i,oldValue:n}),o.triggerHandler(Xe+(s._ns?"."+/^\S+/.exec(s._ns)[0]:""),e)))}},Ge[We]=Ge[Xe]={remove:function(e){var n,r,i,o,a,s=e.data;if(s&&(s.off=!0,s=s.cb)&&(n=$e[s._cId])){for(o=(i=t._data(this).events[e.type]).length;o--&&!r;)r=(a=i[o].data)&&a.cb&&a.cb._cId===s._cId;r||(--n.len?delete n[et(this).obId]:delete $e[s._cId])}}},a.map=function(e){function n(t,n,r,i){var o,a,s=this;s.src&&s.unmap(),n&&(n.map=s),(typeof t===W||u(t))&&(s.src=t,i?s.tgt=e.getTgt(t,n):(r&&(s.tgt=r.tgt||p(r)&&r),s.tgt=s.tgt||[],s.options=n||s.options,(a=s.update())?s=a:(e.obsSrc&&l(s.src).observeAll(s.obs=function(t,n){o||n.refresh||(o=!0,e.obsSrc(s,t,n),o=void 0)},s.srcFlt),e.obsTgt&&l(s.tgt).observeAll(s.obt=function(t,n){o||s.tgt._updt||(o=!0,e.obsTgt(s,t,n),o=void 0)},s.tgtFlt))))}return u(e)&&(e={getTgt:e}),e.baseMap&&(e=t.extend({},e.baseMap,e)),e.map=function(e,t,r,i){return new n(e,t,r,i)},(n.prototype={srcFlt:e.srcFlt||ft,tgtFlt:e.tgtFlt||ft,update:function(t){var n,r,i=this,o=i.tgt;if(!o._updt&&(o._updt=!0,n=i.options&&i.options.map,l(o).refresh(e.getTgt(i.src,i.options=t||i.options)),o._updt=!1,(r=i.options&&i.options.map)&&n!==r))return r},observe:function(e,n){var r=this,i=r.options;r.obmp&&dt(r.obmp),r.obmp=function(){var e=n.fn(n.data,n.view,v)[i.index];t.extend(i.props,e.props),i.args=e.args,r.update()},l._apply(1,n.data,at(e,n.tag,r.obmp),r.obmp,n._ctxCb)},unmap:function(){var e=this;e.src&&e.obs&&l(e.src).unobserveAll(e.obs,e.srcFlt),e.tgt&&e.obt&&l(e.tgt).unobserveAll(e.obt,e.tgtFlt),e.obmp&&dt(e.obmp),e.src=void 0},map:n,_def:e}).constructor=n,e},v.advSet=function(){v=this,y=_.advanced,e._jsv=y._jsv?{cbBindings:$e}:void 0},v._dp=at,v._gck=rt,v._obs=s,_._cchCt=0,y=_.advanced=y||{useViews:!1,_jsv:!1}}if(m=a.settings,_=v.settings,y=_.advanced,d=a.converters,t.templates=f=a.templates,g=a.tags,M=/<(?!script)(\w+)[>\s]/,K="string",t.link)return t;_.trigger=!0;var gt,vt,_t,yt,mt,Et,bt,It,Tt,Ct=window.navigator.userAgent,At=void 0!==document.textContent?"textContent":"innerText",Ot="data-jsv",St="change.jsv",wt="onBeforeChange",xt="onAfterChange",Lt="onAfterCreate",Nt="checked",Rt="checkbox",Pt="radio",Mt="input[type=",jt=Mt+Rt+"]",Ut="none",Dt="value",Vt="SCRIPT",kt="true",Gt='"><\/script>',Ft='<script type="jsv',Bt=Ot+"-df",Ht="script,["+Ot+"]",qt={value:"val",input:"val",html:Y,text:"text"},Yt={from:Dt,to:Dt},Kt=0,Wt=t.cleanData,Xt=m.delimiters,$t={},Qt=document.createDocumentFragment(),zt=document.querySelector,Jt={ol:1,ul:1,table:1,tbody:1,thead:1,tfoot:1,tr:1,colgroup:1,dl:1,select:1,optgroup:1,svg:1,svg_ns:1},Zt={tr:"table"},en={br:1,img:1,input:1,hr:1,area:1,base:1,col:1,link:1,meta:1,command:1,embed:1,keygen:1,param:1,source:1,track:1,wbr:1},tn={},nn={},rn=1,on=/^#(view\.?)?/,an=/((\/>)|<\/(\w+)>|)(\s*)([#/]\d+(?:_|(\^)))`(\s*)(<\w+(?=[\s\/>]))?|\s*(?:(<\w+(?=[\s\/>]))|<\/(\w+)>(\s*)|(\/>)\s*|(>)|$)/g,sn=/(#)()(\d+)(_)/g,ln=/(#)()(\d+)([_^])/g,cn=/(?:(#)|(\/))(\d+)(_)/g,un=/(?:(#)|(\/))(\d+)(\^)/g,pn=/(#)()(\d+)(\^)/g,fn=/(?:(#)|(\/))(\d+)([_^])([-+@\d]+)?/g,dn=/^[^.]*$/,hn=e.getComputedStyle,gn=t.inArray;if(Mt+=Pt+"]",Ct=Ct.indexOf("MSIE ")>0||Ct.indexOf("Trident/")>0,!(l=t.observable))throw requiresStr+"jquery.observable.js";function vn(e,t,n,r,i){var o,a,s,c,f,d,h,g,v,_,y,m,E,b,I,T,C,A,O,S;if(r&&r._tgId&&(r=(A=r)._tgId,A.bindTo||(Bn(nn[r],A),A.bindTo=[0])),(d=nn[r])&&(y=d.to))for(y=y[t||0],v=(o=d.linkCtx).elem,f=o.view,!(A=o.tag)&&y._cxp&&(A=y._cxp.path!==w&&y._cxp.tag,h=e[0],(e=[])[y._cxp.ind]=h),A&&(A._.chg=1,(s=A.convertBack)&&(a=u(s)?s:f.getRsc("converters",s))),"SELECT"===v.nodeName?(v.multiple&&null===e[0]&&(e=[[]]),v._jsvSel=e):v._jsvSel&&(O=v._jsvSel.slice(),(S=gn(v.value,O))>-1&&!v.checked?O.splice(S,1):S<0&&v.checked&&O.push(v.value),e=[O]),g=e,T=y.length,a&&(void 0===(e=a.apply(A,e))&&(y=[]),p(e)&&(!1===e.arg0||1!==T&&e.length===T&&!e.arg0)||(e=[e]));T--;)if((m=y[T])&&(c=(m=typeof m===K?[o.data,m]:m)[0],E=m.tag,!(void 0===(h=(c&&c._ocp&&!c._vw?g:e)[T])||A&&A.onBeforeUpdateVal&&!1===A.onBeforeUpdateVal(i,{change:"change",data:c,path:m[1],index:T,tagElse:t,value:h}))))if(E)void 0!==(C=E._.toIndex[m.ind])&&E.updateValue(h,C,m.tagElse,void 0,void 0,i),E.setValue(h,m.ind,m.tagElse);else if(void 0!==h&&c){if((E=i&&(_=i.target)._jsvInd===T&&_._jsvLkEl)&&void 0!==(C=E._.fromIndex[T])&&E.setValue(g[T],C,_._jsvElse),c._cpfn)for(I=o._ctxCb,b=c,c=o.data,b._cpCtx&&(c=b.data,I=b._cpCtx);b&&b.sb;)c=I(b),b=b.sb;l(c,n).setProperty(m[1],h,void 0,m.isCpfn)}if(A)return A._.chg=void 0,A}function _n(e){var n,r,i=e.target,o=Tn(i),a=qt[o],s=/&(\d+)\+?/g;if(!i._jsvTr||e.delegateTarget!==gt&&"number"!==i.type||"input"===e.type){for(r=u(o)?o(i):a?t(i)[a]():t(i).attr(o),i._jsvChg=1;n=s.exec(i._jsvBnd);)zn(r,i._jsvInd,i._jsvElse,void 0,n[1],e);i._jsvChg=void 0}}function yn(e,t){var n,r,i,o,a,s,l,c,p,f=this,d=f.fn,h=f.tag,g=f.data,_=f.elem,y=f.convert,m=_.parentNode,E=f.view,b=E._lc,I=t&&Xn(E,wt,h);if(m&&(!I||!1!==I.call(h||f,e,t))&&(!t||"*"===e.data.prop||e.data.prop===t.path)){if(E._lc=f,t||f._toLk){if(f._toLk=0,d._er)try{r=d(g,E,v)}catch(e){a=d._er,r=[{props:{},args:[s=Oe(e,E,new Function("data,view","return "+a+";")(g,E))],tag:h}]}else r=d(g,E,v);if(n=h&&h.attr||f.attr||(f._dfAt=Tn(_,!0,void 0!==y)),f._dfAt===Dt&&(h&&h.parentElem||f.elem).type===Rt&&(n=Nt),h){if(o=a||h._er,r=r[0]?r:[r],i=!o&&(!1===h.onUpdate||t&&u(h.onUpdate)&&!1===h.onUpdate(e,t,r)),qn(h,r,o),h._.chg&&(n===Y||n===Dt)||i||n===Ut)return Vn(h,e,t),h._.chg||On(f,g,_),E._lc=b,t&&(I=Xn(E,xt,h))&&I.call(h||f,e,t),void(h.tagCtx.props.dataMap&&h.tagCtx.props.dataMap.map(h.tagCtx.args[0],h.tagCtx,h.tagCtx.map,O||!h._.bnd));for(h.onUnbind&&h.onUnbind(h.tagCtx,f,h.ctx,e,t),h.linkedElems=h.linkedElem=h.mainElem=h.displayElem=void 0,p=h.tagCtxs.length;p--;)(c=h.tagCtxs[p]).linkedElems=c.mainElem=c.displayElem=void 0;r=":"===h.tagName?v._cnvt(h.convert,E,r[0]):v._tag(h,E,E.tmpl,r,!0,s)}else d._tag&&(r=(y=""===y?kt:y)?v._cnvt(y,E,r[0]||r):v._tag(d._tag,E,E.tmpl,r,!0,s),Zn(h=f.tag),n=f.attr||n);(l=h&&(!h.inline||f.fn._lr)&&h.template)&&On(f,g,_),En(r,f,n,h),f._noUpd=0,h&&(h._er=a,Vn(h,e,t))}l||On(f,g,_),h&&h._.ths&&h.updateValue(h,h.bindTo?h.bindTo.length:1),t&&(I=Xn(E,xt,h))&&I.call(h||f,e,t),E._lc=b}}function mn(e,t){e._df=t,e[(t?"set":"remove")+"Attribute"](Bt,"")}function En(n,r,i,o){var a,s,l,c,u,f,d,h,g,v,_,y,m,E,b=!(i===Ut||void 0===n||r._noUpd||(i===Dt||i===Y)&&!o&&r.elem._jsvChg),I=r.data,T=o&&o.parentElem||r.elem,C=T.parentNode,A=t(T),O=r.view,S=r._val,w=o;if(o&&(o._.unlinked=!0,o.parentElem=o.parentElem||r.expr||o._elCnt?T:C,s=o._prv,l=o._nxt),b)return"visible"===i&&(i="css-display"),/^css-/.test(i)?("visible"===r.attr&&(m=(T.currentStyle||hn.call(e,T,"")).display,n?(n=T._jsvd||m)!==Ut||(n=tn[y=T.nodeName])||(_=document.createElement(y),document.body.appendChild(_),n=tn[y]=(_.currentStyle||hn.call(e,_,"")).display,document.body.removeChild(_)):(T._jsvd=m,n=Ut)),(w=w||S!==n)&&t.style(T,i.slice(4),n)):"link"!==i&&(/^data-/.test(i)?t.data(T,i.slice(5),n):/^prop-/.test(i)?(f=!0,i=i.slice(5)):i===Nt?(f=!0,T.name&&p(n)?(T._jsvSel=n,n=gn(T.value,n)>-1):n=n&&"false"!==n):i===Pt?(f=!0,i=Nt,n=T.value===n):"selected"===i||"disabled"===i||"multiple"===i||"readonly"===i?n=n&&"false"!==n?i:null:i===Dt&&"SELECT"===T.nodeName&&(T._jsvSel=p(n)?n:""+n),(a=qt[i])?i===Y?o&&o.inline?(u=o.nodes(!0),o._elCnt&&(s&&s!==l?$n(s,l,T,o._tgId,"^",!0):(d=s?s.getAttribute(Ot):T._df,h=o._tgId+"^",g=d.indexOf("#"+h)+1,v=d.indexOf("/"+h),g&&v>0&&v>(g+=h.length)&&(Qn(d.slice(g,v)),d=d.slice(0,g)+d.slice(v),s?s.setAttribute(Ot,d):T._df&&mn(T,d))),s=s?s.previousSibling:l?l.previousSibling:T.lastChild),t(u).remove(),c=O.link(O.data,T,s,l,n,o&&{tag:o._tgId})):(b=b&&S!==n)&&(A.empty(),c=O.link(I,T,s,l,n,o&&{tag:o._tgId})):T._jsvSel?A[a](n):((w=w||S!==n)&&("text"===i&&T.children&&!T.children[0]?T[At]=null===n?"":n:A[a](n)),void 0===(E=C._jsvSel)||i!==Dt&&void 0!==A.attr(Dt)||(T.selected=gn(""+n,p(E)?E:[E])>-1)):(w=w||S!==n)&&A[f?"prop":"attr"](i,void 0!==n||f?n:null)),r._val=n,Sn(c),w;r._val=n}function bn(e,t){var n=this,r=Xn(n,wt,n.tag),i=Xn(n,xt,n.tag);if(!r||!1!==r.call(n,e,t)){if(t){var o=t.change,a=t.index,s=t.items;switch(n._.srt=t.refresh,o){case"insert":n.addViews(a,s,t._dly);break;case"remove":n.removeViews(a,s.length,void 0,t._dly);break;case"move":n.moveViews(t.oldIndex,a,s.length);break;case"refresh":n._.srt=void 0,n.fixIndex(0)}}i&&i.call(n,e,t)}}function In(e){var n,r,i=e.type,o=e.data,a=e._.bnd;!e._.useKey&&a&&((r=e._.bndArr)&&(t([r[1]]).off(Xe,r[0]),e._.bndArr=void 0),a!==!!a?i?a._.arrVws[e._.id]=e:delete a._.arrVws[e._.id]:i&&o&&(n=function(t){t.data&&t.data.off||bn.apply(e,arguments)},t([o]).on(Xe,n),e._.bndArr=[n,o]))}function Tn(e,t,n){var r=e.nodeName.toLowerCase(),i=y._fe[r]||e.contentEditable===kt&&{to:Y,from:Y};return i?t?"input"===r&&e.type===Pt?Pt:i.to:i.from:t?n?"text":Y:""}function Cn(e,n,r,i,o,a,s){var l,c,u,p,f,d=e.parentElem,h=e._prv,g=e._nxt,v=e._elCnt;if(h&&h.parentNode!==d&&Se("Missing parentNode"),s)for(f in p=e.nodes(),v&&h&&h!==g&&$n(h,g,d,e._.id,"_",!0),e.removeViews(void 0,void 0,!0),c=g,v&&(h=h?h.previousSibling:g?g.previousSibling:d.lastChild),t(p).remove(),e._.bnds)Kn(f);else{if(n){if(!(u=i[n-1]))return!1;h=u._nxt}v?h=(c=h)?c.previousSibling:d.lastChild:c=h.nextSibling}l=r.render(o,a,e._.useKey&&s,e,s||n,!0),Sn(e.link(o,d,h,c,l,u))}function An(e,t,n){var r,i;return n?(i="^`",Zn(n),(r=n._tgId)||(nn[r=rn++]=n,n._tgId=""+r)):(i="_`",bt[r=t._.id]=t),"#"+r+i+(null!=e?e:"")+"/"+r+i}function On(e,t,n){var r,i,o,a,s,c,u,p,f,d,h,g,_=e.tag,y=!_,m=e.convertBack,E=e._hdl;if(t="object"==typeof t&&t,_&&((f=_.convert)&&(f=f===kt?_.tagCtx.props.convert:f,f=(f=(f=e.view.getRsc("converters",f)||f)&&f.depends)&&v._dp(f,t,E)),(d=_.tagCtx.props.depends||_.depends)&&(d=v._dp(d,_,E),f=f?f.concat(d):d),g=_.linkedElems),f=f||[],!e._depends||""+e._depends!=""+f){if(s=e.fn.deps.slice(),e._depends&&(h=e._depends.bdId,l._apply(1,[t],s,e._depends,E,e._ctxCb,!0)),_){for(i=_.boundProps.length;i--;)for(u=_.boundProps[i],o=_._.bnd.paths.length;o--;)(p=_._.bnd.paths[o]["_"+u])&&p.length&&p.skp&&(s=s.concat(p));y=void 0===_.onArrayChange||!0===_.onArrayChange}for(i=s.length;i--;)(c=s[i])._cpfn&&(s[i]=le({},c));if(r=l._apply(y?0:1,[t],s,f,E,e._ctxCb),h||(h=e._bndId||""+rn++,e._bndId=void 0,n._jsvBnd=(n._jsvBnd||"")+"&"+h,e.view._.bnds[h]=h),r.elem=n,r.linkCtx=e,r._tgId=h,f.bdId=h,e._depends=f,nn[h]=r,(g||void 0!==m||_&&_.bindTo)&&Bn(r,_,m),g)for(i=g.length;i--;)for(o=(a=g[i])&&a.length;o--;)a[o]._jsvLkEl?a[o]._jsvBnd||(a[o]._jsvBnd="&"+h+"+"):(a[o]._jsvLkEl=_,Fn(_,a[o]),a[o]._jsvBnd="&"+h+"+");else void 0!==m&&Fn(_,n);_&&!_.inline&&(_.flow||n.setAttribute(Ot,(n.getAttribute(Ot)||"")+"#"+h+"^/"+h+"^"),_._tgId=""+h)}}function Sn(e){var t;if(e)for(;t=e.pop();)t._hdl()}function wn(e,t,n,r,i,o,a){return xn(this,e,t,n,r,i,o,a)}function xn(e,n,r,i,a,s,l,c){if(!0===i?(a=i,i=void 0):i="object"!=typeof i?void 0:le({},i),e&&n){n=n.jquery?n:t(n),gt||(gt=document.body,Tt="oninput"in gt,t(gt).on(St,_n).on("blur.jsv","[contenteditable]",_n));for(var u,p,f,d,h,g,v,_,y,m,E=An,b=i&&"replace"===i.target,I=n.length;I--;){if(v=n[I],m=s||_t(v),typeof e===K)Nn(y=[],e,v,m,void 0,"expr",r,i);else{if(void 0!==e.markup)b&&(g=v.parentNode),m._.scp=!0,f=e.render(r,i,a,m,void 0,E,!0),m._.scp=void 0,g?(l=v.previousSibling,c=v.nextSibling,t.cleanData([v],!0),g.removeChild(v),v=g):(l=c=void 0,t(v).empty());else{if(!0!==e||m!==o)break;_={lnk:"top"}}if(v._df&&!c){for(u=0,p=(d=jn(v._df,!0,sn)).length;u<p;u++)h=d[u],(h=bt[h.id])&&void 0!==h.data&&h.parent.removeViews(h._.key,void 0,!0);mn(v)}y=m.link(r,v,l,c,f,_,i)}Sn(y)}}return n}function Ln(e,n,r,i,o,a,s,l){function c(e,t){var r,i,o,a,s,l,c,u=[];if(e){for("@"===e._tkns.charAt(0)&&(t=E.previousSibling,E.parentNode.removeChild(E),E=void 0),_=e.length;_--;){if(o=(I=e[_]).ch,r=I.path)for(v=r.length-1;i=r.charAt(v--);)"+"===i?"-"===r.charAt(v)?(v--,t=t.previousElementSibling):t=t.parentNode:t=t.lastElementChild;"^"===o?(d=nn[s=I.id])&&(c=t&&(!E||E.parentNode!==t),E&&!c||(d.parentElem=t),I.elCnt&&c&&mn(t,(I.open?"#":"/")+s+o+(t._df||"")),u.push([c?null:E,I])):(b=bt[s=I.id])&&(b.parentElem||(b.parentElem=t||E&&E.parentNode||n,b._.onRender=An,b._.onArrayChange=bn,In(b)),a=b.parentElem,I.open?(b._elCnt=I.elCnt,t&&!E?mn(t,"#"+s+o+(t._df||"")):(b._prv||mn(a,Pn(a._df,"#"+s+o)),b._prv=E)):(!t||E&&E.parentNode===t?E&&(b._nxt||mn(a,Pn(a._df,"/"+s+o)),b._nxt=E):(mn(t,"/"+s+o+(t._df||"")),b._nxt=void 0),(l=Xn(b,Lt)||le)&&l.call(b.ctx.tag,b)))}for(_=u.length;_--;)ie.push(u[_])}return!e||e.elCnt}function u(e){var t,n,r;if(e)for(_=e.length,v=0;v<_;v++)if(I=e[v],!(d=nn[I.id])._is&&d.linkCtx&&(n=d=d.linkCtx.tag,r=d.tagName===N,!d.flow||r)){if(!L){for(t=1;n=n.parent;)t++;j=j||t}!L&&t!==j||N&&!r||x.push(d)}}var p,f,d,h,g,v,_,m,E,b,I,T,C,A,O,S,w,x,L,N,R,P,j,U,D,V,k,G,F,B,H,q,Y,W,X,$,Q,z,J,Z,ee,te=this,ne=te._.id+"_",re="",ie=[],oe=[],ae=[],se=[],le=Xn(te,Lt),ce=c;if(a&&(a.tmpl?O="/"+a._.id+"_":(Z=a.lnk,a.tag&&(ne=a.tag+"^",a=!0),(ee=a.get)&&(ce=u,x=ee.tags,L=ee.deep,N=ee.name)),a=!0===a),n=n?typeof n===K?t(n)[0]:n.jquery?n[0]:n:te.parentElem||document.body,P=!y.noValidate&&n.contentEditable!==kt,G=n.tagName.toLowerCase(),Y=!!Jt[G],r=r&&Dn(r,Y),i=i&&Dn(i,Y)||null,null!=o){if(B=H=document.createElement("div"),Q=$="",X="http://www.w3.org/2000/svg"===n.namespaceURI?"svg_ns":(k=M.exec(o))&&k[1]||"",Y){for(w=i;w&&!(S=jn(w));)w=w.nextSibling;(q=S?S._tkns:n._df)&&(A=O||"",!a&&O||(A+="#"+ne),(v=q.indexOf(A))+1&&(v+=A.length,Q=$=q.slice(0,v),q=q.slice(v),S?w.setAttribute(Ot,q):mn(n,q)))}if(F=void 0,o=(""+o).replace(an,(function(e,t,n,r,i,a,s,l,c,u,f,h,g,v){var _,y,m="";return v?(p=0,e):(d=(c||u||"").toLowerCase(),r=r||f,n=n||g,F&&!n&&(!e||r||d||a&&!p)&&(F=void 0,G=oe.shift()),(r=r||n)&&(r=r.toLowerCase(),p=0,F=void 0,P&&(n||g?en[G]||/;svg;|;math;/.test(";"+oe.join(";")+";")||(_="'<"+G+".../"):en[r]?_="'</"+r:oe.length&&r===G||(_="Mismatch: '</"+r),_&&we(_+">' in:\n"+o)),W=Y,G=oe.shift(),Y=Jt[G],f=f?"</"+f+">":"",W&&(re+=$,$="",Y?re+="-":(m=f+Ft+"@"+re+Gt+(h||""),re=ae.shift()))),Y&&!p?(a?$+=a:t=f||g||"",d&&(t+=d,$&&(t+=" "+Ot+'="'+$+'"',$=""))):t=a?t+m+i+(p?"":Ft+a+Gt)+l+d:m||e,P&&s&&(p&&we("{^{ within elem markup ("+p+' ). Use data-link="..."'),"#"===a.charAt(0)?oe.unshift(a.slice(1)):a.slice(1)!==(y=oe.shift())&&we("Closing tag for {^{...}} under different elem: <"+y+">")),d&&(p=d,oe.unshift(G),G=d.slice(1),P&&oe[0]&&oe[0]===Zt[G]&&Se("Parent of <tr> must be <tbody>"),F=en[G],(Y=Jt[G])&&!W&&(ae.unshift(re),re=""),W=Y,re&&Y&&(re+="+")),t)})),P&&oe.length&&we("Mismatched '<"+G+"...>' in:\n"+o),l)return;for(Qt.appendChild(H),U=(X=Et[X]||Et.div)[0],B.innerHTML=X[1]+o+X[2];U--;)B=B.lastChild;for(Qt.removeChild(H),D=document.createDocumentFragment();V=B.firstChild;)D.appendChild(V);n.insertBefore(D,i)}return function(){var a,l,p="",v={},_=mt+(ee?",["+Bt+"]":"");for(m=zt?n.querySelectorAll(_):t(_,n).get(),g=m.length,r&&r.innerHTML&&(C=zt?r.querySelectorAll(_):t(_,r).get(),r=C.length?C[C.length-1]:r),j=0,h=0;h<g;h++)if(E=m[h],r&&!z)z=E===r;else{if(i&&E===i){ee&&(p+=Mn(E));break}if(E.parentNode)if(ee){if(p+=Mn(E),E._df){for(a=h+1;a<g&&E.contains(m[a]);)a++;v[a-1]=E._df}v[h]&&(p+=v[h]||"")}else Z&&(I=jn(E,void 0,cn))&&(I=I[0])&&(J=J?I.id!==J&&J:I.open&&I.id),!J&&ce(jn(E))&&E.getAttribute(yt)&&ie.push([E])}if(ee&&((l=(p+=n._df||"").indexOf("#"+ee.id)+1)&&(p=p.slice(l+ee.id.length)),(l=p.indexOf("/"+ee.id))+1&&(p=p.slice(0,l)),u(jn(p,void 0,pn))),void 0===o&&n.getAttribute(yt)&&ie.push([n]),Un(r,Y),Un(i,Y),!ee)for(Y&&re+$&&(E=i,re&&(i?c(jn(re+"+",!0),i):c(jn(re,!0),n)),c(jn($,!0),n),i&&(p=i.getAttribute(Ot),(g=p.indexOf(Q)+1)&&(p=p.slice(g+Q.length-1)),i.setAttribute(Ot,$+p))),g=ie.length,h=0;h<g;h++)E=ie[h],T=E[1],E=E[0],T?(d=nn[T.id])&&((f=d.linkCtx)&&((d=f.tag).linkCtx=f),T.open?(E&&(d.parentElem=E.parentNode,d._prv=E),d._elCnt=T.elCnt,b=d.tagCtx.view,Nn(se,void 0,d._prv,b,T.id)):(d._nxt=E,d._.unlinked&&!d._toLk&&(R=d.tagCtx,b=R.view,Vn(d)))):Nn(se,E.getAttribute(yt),E,_t(E),void 0,Z,e,s)}(),se}function Nn(e,n,r,i,o,a,s,l){var c,u,p,f,d,h,g,_,y,m,C,A=[];if(o)g=(_=(_=nn[o]).linkCtx?_.linkCtx.tag:_).linkCtx||{type:"inline",data:i.data,elem:_._elCnt?_.parentElem:r,view:i,ctx:i.ctx,attr:Y,fn:_._.bnd,tag:_,_bndId:o},_.linkCtx=g,Rn(g,e),_._toLk=g._bndId;else if(n&&r){for(s=a?s:i.data,c=i.tmpl,n=function(e,n){return(e=t.trim(e)).slice(-1)!==I?e=b+":"+e+(n?":":"")+I:e}(n,Tn(r)),C=vt.lastIndex=0;u=vt.exec(n);)A.push(u),C=vt.lastIndex;for(C<n.length&&we(n);u=A.shift();){for(y=vt.lastIndex,p=u[1],d=u[3];A[0]&&"else"===A[0][4];)d+=T+E+A.shift()[3],m=!0;m&&(d+=T+E+b+"/"+u[4]+I),g={type:a||"link",data:s,elem:r,view:i,ctx:l,attr:p,_toLk:1,_noUpd:u[2]},f=void 0,u[6]&&(f=u[10]||void 0,g.convert=u[5]||"",void 0!==f&&Tn(r)&&(p&&we(d+"- Remove target: "+p),g.convertBack=f=f.slice(1))),g.expr=p+d,(h=$t[d])||($t[d]=h=v.tmplFn(d.replace(N,"\\$&"),c,!0,f,m)),g.fn=h,Rn(g,e),vt.lastIndex=y}}}function Rn(e,n){function r(t,n){n&&n.refresh||yn.call(e,t,n)}var i,o=e.type;if("top"!==o&&"expr"!==o||(e.view=new v.View(v.extendCtx(e.ctx,e.view.ctx),"link",e.view,e.data,e.expr,void 0,An)),e._ctxCb=v._gccb(i=e.view),e._hdl=r,"SELECT"===e.elem.nodeName&&(e.elem._jsvLkEl||"link"===o&&!e.attr&&void 0!==e.convert)){var a,s=e.elem,l=t(s);l.on("jsv-domchange",(function(){arguments[3].refresh||(s._jsvLkEl?l.val(s._jsvLkEl.cvtArgs(s._jsvElse,1)[s._jsvInd]):e.tag?l.val(e.tag.cvtArgs(0,1)):(a=e.fn(i.data,i,v),l.val(e.convert||e.convertBack?v._cnvt(e.convert,i,a):a)))}))}e.fn._lr?(e._toLk=1,n.push(e)):r(!0)}function Pn(e,t){var n;return e?(n=e.indexOf(t))+1?e.slice(0,n)+e.slice(n+t.length):e:""}function Mn(e){return e&&(typeof e===K?e:e.tagName===Vt?e.type.slice(3):1===e.nodeType&&e.getAttribute(Ot)||"")}function jn(e,t,n){var r,i,o=[];if(i=t?e:Mn(e))return r=o.elCnt=e.tagName!==Vt,r="@"===i.charAt(0)||r,o._tkns=i,i.replace(n||fn,(function(e,t,n,i,a,s){o.push({elCnt:r,id:i,ch:a,open:t,close:n,path:s,token:e})})),o}function Un(e,t){e&&("jsv"===e.type?e.parentNode.removeChild(e):t&&""===e.getAttribute(yt)&&e.removeAttribute(yt))}function Dn(e,t){for(var n=e;t&&n&&1!==n.nodeType;)n=n.previousSibling;return n&&(1!==n.nodeType?((n=document.createElement(Vt)).type="jsv",e.parentNode.insertBefore(n,e)):Mn(n)||n.getAttribute(yt)||n.setAttribute(yt,"")),n}function Vn(e,n,r){function i(){(o=T.linkedElems||e.linkedElems||e.linkedElem&&[e.linkedElem])&&(e.linkedElems=T.linkedElems=o,e.linkedElem=o[0]=e.linkedElem||o[0]),(s=T.mainElem||e.mainElem)&&(T.mainElem=e.mainElem=s),(s=T.displayElem||e.displayElem)&&(T.displayElem=e.displayElem=s)}var o,a,s,l,c,u,f,d,h,g,v,_,y,m,E,b,I,T=e.tagCtx,C=e.tagCtxs,A=C&&C.length,O=e.linkCtx,S=e.bindTo||{};if(e._.unlinked){if(u=t(O.elem),e.linkedElement||e.mainElement||e.displayElement){if(a=e.linkedElement)for(e.linkedElem=void 0,l=a.length;l--;)if(a[l])for(f=!e.inline&&u.filter(a[l]),c=A;c--;)g=C[c],o=g.linkedElems=g.linkedElems||new Array(l),(s=f[0]?f:g.contents(!0,a[l]))[0]&&s[0].type!==Pt&&(o[l]=s.eq(0));if(a=e.mainElement)for(f=!e.inline&&u.filter(a),c=A;c--;)g=C[c],(s=f[0]?f:g.contents(!0,a).eq(0))[0]&&(g.mainElem=s);if(a=e.displayElement)for(f=!e.inline&&u.filter(a),c=A;c--;)g=C[c],(s=f[0]?f:g.contents(!0,a).eq(0))[0]&&(g.displayElem=s);i()}e.onBind&&(e.onBind(T,O,e.ctx,n,r),i())}for(c=A;c--;){if(v=(g=C[c]).props,e._.unlinked&&g.map&&e.mapProps){for(E=e.mapProps.length,b=v.mapDepends||e.mapDepends||[],b=p(b)?b:[b];E--;){var w=e.mapProps[E];(I=e._.bnd.paths[c]["_"+w])&&I.length&&I.skp&&(b=b.concat(I))}b.length&&g.map.observe(b,O)}(s=g.mainElem||!e.mainElement&&g.linkedElems&&g.linkedElems[0])&&(s[0]&&v.id&&!s[0].id&&(s[0].id=v.id),e.setSize&&((_=!S.height&&v.height||e.height)&&s.height(_),(_=!S.width&&v.width||e.width)&&s.width(_))),(_=(s=g.displayElem||s)&&(!S.class&&v.class||e.className))&&_!==(y=s[0]._jsvCl)&&(s.hasClass(y)&&s.removeClass(y),s.addClass(_),s[0]._jsvCl=_)}if(e.onAfterLink&&(e.onAfterLink(T,O,e.ctx,n,r),i()),!e.flow&&!e._.chg)for(e._tgId&&e._.unlinked&&(e.linkedElems||e.bindTo)&&Bn(nn[e._tgId],e),c=C.length;c--;){for(l=(v=e.cvtArgs(c,1)).length;l--;)e.setValue(v[l],l,c,n,r);if(e._.unlinked)for(T=C[c],o=T.linkedElems||!c&&e.linkedElem&&[e.linkedElem],m=(e.bindTo||[0]).length;m--;)if((s=o&&o[m])&&(l=s.length))for(;l--;)(h=(d=s[l])._jsvLkEl)&&h===e||(d._jsvLkEl=e,d._jsvInd=m,d._jsvElse=c,Fn(e,d),e._tgId&&(d._jsvBnd="&"+e._tgId+"+"))}e._.unlinked=void 0,e._.lt&&e.refresh()}function kn(e){var t=e.which;t>15&&t<21||t>32&&t<41||t>111&&t<131||27===t||144===t||setTimeout((function(){_n(e)}))}function Gn(e,t,n){!0!==t||!Tt||Ct&&e[0].contentEditable===kt?(t=typeof t===K?t:"keydown.jsv",e[n](t,t.indexOf("keydown")>=0?kn:_n)):e[n]("input.jsv",_n)}function Fn(e,n){var r,i,o=n._jsvTr||!1;e&&void 0===(i=e.tagCtx.props.trigger)&&(i=e.trigger),void 0===i&&(i=_.trigger),o!==(i=i&&("INPUT"===n.tagName&&n.type!==Rt&&n.type!==Pt||"textarea"===n.type||n.contentEditable===kt)&&i||!1)&&(Gn(r=t(n),o,"off"),Gn(r,n._jsvTr=i,"on"))}function Bn(e,t,n){var r,i,o,a,s,l,c,u,p,f,d,h,g,v,_,y=1,m=[],E=e.linkCtx,b=E.data,I=E.fn.paths;if(e&&!e.to){for(t&&(t.convertBack||(t.convertBack=n),l=t.bindTo,y=t.tagCtxs?t.tagCtxs.length:1);y--;){if(g=[],h=I[y])for(l=h._jsvto?["jsvto"]:l||[0],!y&&t&&t._.ths&&(l=l.concat("this")),u=l.length;u--;){if(i="",d=E._ctxCb,r=(c=h[+(c=l[u])===c?c:"_"+c])&&c.length){if((o=c[r-1])._cpfn){for(a=o;o.sb&&o.sb._cpfn;)i=o=o.sb;i=o.sb||i&&i.path,_=o._cpfn&&!o.sb,o=i?i.slice(1):a.path}s=i?[a,o]:Hn(o,b,d)}else f=t.linkedCtxParam,s=[],(v=t._.fromIndex)&&f&&f[v[u]]&&(s=[t.tagCtxs[y].ctx[f[v[u]]][0],w]);(p=s._cxp)&&p.tag&&o.indexOf(".")<0&&(s=p),s.isCpfn=_,g.unshift(s)}m.unshift(g)}e.to=m}}function Hn(e,t,n){for(var r,i,o,a,s,l,c,u;e&&e!==w&&(o=n(r=e.split("^").join(".")))&&(a=o.length);){if(s=o[0]._cxp)if(c=c||s,l=o[0][0],w in l?(u=l,l=l._vw):u=l.data,c.path=e=o[0][1],o=[c.data=u,e],n=v._gccb(l),e._cpfn){for((i=e).data=o[0],i._cpCtx=n;e.sb&&e.sb._cpfn;)r=e=e.sb;o=[i,e=(r=e.sb||r&&r.path)?r.slice(1):i.path]}else s.tag&&s.path===w&&(o=s);else o=a>1?[o[a-2],o[a-1]]:[o[a-1]];t=o[0],e=o[1]}return(o=o||[t,r])._cxp=c,o}function qn(e,t,n){var r,i,o=e.tagCtx.view,a=e.tagCtxs||[e.tagCtx],s=a.length,c=!t;if(c){if((t=e._.bnd.call(o.tmpl,(e.linkCtx||o).data,o,v)).lt)return;e._.lt=void 0,t=p(t)?t:[t]}if(n)a=e.tagCtxs=t,e.tagCtx=a[0],Zn(e);else for(;s--;)r=a[s],i=t[s],le(r.ctx,i.ctx),r.args=i.args,c&&(r.tmpl=i.tmpl),l(r.props).setProperty(i.props);return v._thp(e,a[0]),a}function Yn(e){for(var t,n,r,i=[],o=e.length,a=o;a--;)i.push(e[a]);for(a=o;a--;)if((n=i[a]).parentNode){if(r=n._jsvBnd)for(r=r.slice(1).split("&"),n._jsvBnd="",t=r.length;t--;)Kn(r[t],n._jsvLkEl,n);Qn(Mn(n)+(n._df||""),n)}}function Kn(e,n,r){var i,o,a,s,l,c,u,f,d,h,g,v,_,y,m=nn[e];if(n)r._jsvLkEl=void 0;else if(m&&(!r||r===m.elem)){for(i in delete nn[e],m.bnd)(s=m.bnd[i])&&(l=m.cbId,p(s)?t([s]).off(Xe+l).off(We+l):t(s).off(We+l),delete m.bnd[i]);if(o=m.linkCtx){if(a=o.tag){if(c=a.tagCtxs)for(u=c.length;u--;)(f=(v=c[u]).map)&&f.unmap(),(_=v.linkedElems)&&(y=(y||[]).concat(_));a.onUnbind&&a.onUnbind(a.tagCtx,o,a.ctx),a.onDispose&&a.onDispose(),a._elCnt||(a._prv&&a._prv.parentNode.removeChild(a._prv),a._nxt&&a._nxt.parentNode.removeChild(a._nxt))}for(u=(_=y||[t(o.elem)]).length;u--;)(h=(d=_[u])&&d[0]&&d[0]._jsvTr)&&(Gn(d,h,"off"),d[0]._jsvTr=void 0);"link"===(g=o.view).type?g.parent.removeViews(g._.key,void 0,!0):delete g._.bnds[e]}delete $e[m.cbId]}}function Wn(e){e?((e=e.jquery?e:t(e)).each((function(){for(var e;(e=_t(this,!0))&&e.parent;)e.parent.removeViews(e._.key,void 0,!0);Yn(this.getElementsByTagName("*"))})),Yn(e)):(gt&&(t(gt).off(St,_n).off("blur.jsv","[contenteditable]",_n),gt=void 0),o.removeViews(),Yn(document.body.getElementsByTagName("*")))}function Xn(e,t,n){return n&&n[t]||e.ctx[t]&&e.ctxPrm(t)||a.helpers[t]}function $n(e,t,n,r,i,o){var a,s,l,c,u,p,f,d=0,h=e===t;if(e){for(a=0,s=(l=jn(e)||[]).length;a<s;a++){if((p=(c=l[a]).id)===r&&c.ch===i){if(!o)break;s=0}h||(u="_"===c.ch?bt[p]:nn[p].linkCtx.tag)&&(c.open?u._prv=t:c.close&&(u._nxt=t)),d+=p.length+2}d&&e.setAttribute(Ot,e.getAttribute(Ot).slice(d)),(s=(f=t?t.getAttribute(Ot):n._df).indexOf("/"+r+i)+1)&&(f=l._tkns.slice(0,d)+f.slice(s+(o?-1:r.length+1))),f&&(t?t.setAttribute(Ot,f):mn(n,f))}else mn(n,Pn(n._df,"#"+r+i)),o||t||mn(n,Pn(n._df,"/"+r+i))}function Qn(e,t){var n,r,i,o;if(o=jn(e,!0,ln))for(n=0,r=o.length;n<r;n++)"_"===(i=o[n]).ch?!(i=bt[i.id])||!i.type||t&&i._prv!==t&&i.parentElem!==t||i.parent.removeViews(i._.key,void 0,!0):Kn(i.id,void 0,t)}function zn(e,t,n,r,i,o){var a=this,s=[];return a&&a._tgId&&(i=a),arguments.length<4&&(+t!==t?(r=t,n=t=0):+n!==n&&(r=n,n=0)),s[t||0]=e,vn(s,n,r,i,o),a}function Jn(){for(var e=this.tag.bindTo.length,t=arguments[e],n=arguments[e+1];e--;)this.tag.setValue(arguments[e],e,this.index,t,n)}function Zn(e){var n,r,i,a,s,c,u,p;if(e.contents=function(e,n,r){e!==!!e&&(n=e,e=void 0);var i,o=t(this.nodes());return o[0]&&(i=(n=e?n||"*":n)?o.filter(n):o,o=e?i.add(o.find(n)):i),r?o.filter(r):o},e.nodes=function(e,t,n){var r,i=this.contentView||this,o=i._elCnt,a=!t&&o,s=[];if(!i.args)for(t=t||i._prv,n=n||i._nxt,r=a?t===i._nxt?i.parentElem.lastSibling:t:!1===i.inline?t||i.linkCtx.elem.firstChild:t&&t.nextSibling;r&&(!n||r!==n);)(e||o||r.tagName!==Vt)&&s.push(r),r=r.nextSibling;return s},e.childTags=function(e,t){e!==!!e&&(t=e,e=void 0);var n=this.contentView||this,r=n.link?n:n.tagCtx.view,i=n._prv,o=n._elCnt,a=[];return n.args||r.link(void 0,n.parentElem,o?i&&i.previousSibling:i,n._nxt,void 0,{get:{tags:a,deep:e,name:t,id:n.link?n._.id+"_":n._tgId+"^"}}),a},"tag"===e._is){for(r=(u=e).tagCtxs.length;r--;)(i=u.tagCtxs[r]).setValues=Jn,i.contents=e.contents,i.childTags=e.childTags,i.nodes=e.nodes;if(a=u.boundProps=u.boundProps||[],s=u.bindFrom)for(n=s.length;n--;)typeof(c=s[n])===K&&(s[c]=1,gn(c,a)<0&&a.push(c));u.setValue=v._gm(u.constructor.prototype.setValue||function(e){return e},(function(e,r,i,o,a){r=r||0,i=i||0;var s,l,c,p,f,d,h=u.tagCtxs[i];if(!h._bdArgs||!a&&void 0===e||h._bdArgs[r]!==e||a&&"set"===a.change&&(o.target===e||a.value===e)?(h._bdArgs=h._bdArgs||[],h._bdArgs[r]=e,void 0!==(d=u.base.call(u,e,r,i,o,a))&&(h._bdVals=h._bdVals||[],h._bdVals[r]=d,e=d)):h._bdVals&&(e=h._bdVals[r]),void 0!==e&&(c=u.linkedCtxParam)&&c[r]&&h.ctxPrm(c[r],e),void 0!==(p=u._.toIndex[r])&&(f=h.linkedElems||u.linkedElem&&[u.linkedElem])&&(s=f[p])&&(n=s.length))for(;n--;)l=s[n],void 0===e||l._jsvChg||u.linkCtx._val===e||(void 0!==l.value?l.type===Rt?l[Nt]=t.isArray(e)?t.inArray(l.value,e)>-1:e&&"false"!==e:l.type===Pt?l[Nt]=l.value===e:t(l).val(e):l[l.contentEditable===kt?"innerHTML":At]=e),h.props.name&&(l.name=l.name||h.props.name);return u})),u.updateValue=zn,u.updateValues=function(){var e,t,n=this.bindTo?this.bindTo.length:1,r=arguments.length-n;return r&&(e=arguments[n],r>1?t=r>1?arguments[n+1]:void 0:+e!==e&&(t=e,e=0)),vn(arguments,e,t,this)},u.setValues=function(){return Jn.apply(u.tagCtx,arguments),u},u.refresh=function(){var e,t,n=u.linkCtx,r=u.tagCtx.view;if(t=qn(u))return u.onUnbind&&(u.onUnbind(u.tagCtx,n,u.ctx),u._.unlinked=!0),e=u.inline?Y:n.attr||Tn(u.parentElem,!0),t=":"===u.tagName?v._cnvt(u.convert,r,u.tagCtx):v._tag(u,r,r.tmpl,t,!0),On(n,n.data,n.elem),En(t,n,e,u),Vn(u),u},u.domChange=function(e,n,r,a){var s,l,c,p,f=u,d="jsv-domchange",h=/&(\d+)\+?/g,g=f.parentElem,v=t._data(g).events;for(v&&v[d]&&t(g).triggerHandler(d,arguments);g!==gt;){for(;f&&(!f.parentElem||f.parentElem===g);)for(f.onDomChange&&f.onDomChange(i,n,r,a),f=(c=f.tagCtx.view||o).tag;!f&&c.parent&&!c.isTop;)f=(c=c.parent).tag;for(p=g,g=f&&f.parentElem||gt;p&&p!==g;){for(;s=h.exec(p._jsvBnd);)(l=nn[s[1]])&&(l=l.linkCtx.tag)&&l.onDomChange&&l.onDomChange(i,n,r,a);p=p.parentElement}}}}else(p=e).addViews=function(e,t,n){var r,i=this,o=t.length,a=i.views;!i._.useKey&&o&&(r=a.length+o,!n&&r!==i.data.length||!1===Cn(i,e,i.tmpl,a,t,i.ctx)||i._.srt||i.fixIndex(e+o))},p.removeViews=function(e,n,r,i){function o(e){var n,i,o,a,s,l,c=p[e];if(c&&c.link){for(i in n=c._.id,r||(l=c.nodes()),c.removeViews(void 0,void 0,!0),c.type=void 0,a=c._prv,s=c._nxt,o=c.parentElem,r||(c._elCnt&&$n(a,s,o,n,"_"),t(l).remove()),!c._elCnt&&a&&(a.parentNode.removeChild(a),s.parentNode.removeChild(s)),In(c),c._.bnds)Kn(i);delete bt[n]}}var a,s,l,c=this,u=!c._.useKey,p=c.views;if(u&&(l=p.length),void 0===e)if(u){for(a=l;a--;)o(a);c.views=[]}else{for(s in p)o(s);c.views={}}else if(void 0===n&&(u?n=1:(o(e),delete p[e])),u&&n&&(i||l-n===c.data.length)){for(a=e+n;a-- >e;)o(a);p.splice(e,n),c._.srt||c.fixIndex(e)}},p.moveViews=function(e,n,r){function i(e,t){return RegExp("^(.*)("+(t?"\\/":"#")+e._.id+"_.*)$").exec(t||e._prv.getAttribute(Ot))}function o(e,t){var n,r=e._prv;r.setAttribute(Ot,t),t.replace(un,(function(e,t,i,o){(n=nn[o].linkCtx.tag).inline&&(n[t?"_prv":"_nxt"]=r)})),t.replace(cn,(function(e,t,n,i){bt[i][t?"_prv":"_nxt"]=r}))}var a,s,l,c=this,u=c._nxt,p=c.views,f=n<e,d=f?n:e,h=f?e:n,g=n,v=[],_=p.splice(e,r);for(n>p.length&&(n=p.length),p.splice.apply(p,[n,0].concat(_)),l=n+(r=_.length),h+=r;g<l;g++)a=(s=p[g]).nodes(!0),v=c._elCnt?v.concat(a):v.concat(s._prv,a,s._nxt);if(v=t(v),l<p.length?v.insertBefore(p[l]._prv):u?v.insertBefore(u):v.appendTo(c.parentElem),c._elCnt){var y,m=f?d+r:h-r,E=(p[d-1],p[d]),b=p[m],I=p[h],T=i(E),C=i(b);o(E,C[1]+T[2]),I?(y=i(I),o(I,T[1]+y[2])):(p[h-1]._nxt=u,u?(y=i(c,u.getAttribute(Ot)),u.setAttribute(Ot,T[1]+y[2])):(y=i(c,c.parentElem._df),mn(c.parentElem,T[1]+y[2]))),o(b,y[1]+C[2])}c.fixIndex(d)},p.refresh=function(){var e=this,t=e.parent;return t&&(Cn(e,e.index,e.tmpl,t.views,e.data,void 0,!0),In(e)),e},p.fixIndex=function(e){for(var t=this.views,n=t.length;e<n--;)t[n].index!==n&&l(t[n]).setProperty("index",n)},p.link=Ln}function er(e,t,n,r){for(var i=e.length;i--&&e[i].key!==t;);-1===i?t&&!r&&e.push({key:t,prop:n}):r&&e.splice(i,1)}return s=l.observe,_._clFns=function(){$t={}},Zn(v.View.prototype),v.onStore.template=function(e,n,r){null===n?(delete t.link[e],delete t.render[e]):(n.link=wn,e&&!r&&"jsvTmpl"!==e&&(t.render[e]=n,t.link[e]=function(){return wn.apply(n,arguments)}))},v.viewInfos=jn,(m.delimiters=function(){var e=Xt.apply(0,arguments);return Xt!==ce&&(e=ce.apply(0,arguments)),vt=new RegExp("(?:^|\\s*)([\\w-]*)(\\"+C+")?(\\"+b+v.rTag+"(:\\w*)?\\"+I+")","g"),e})(),v.addSetting("trigger"),d.merge=function(e){var t,n=this.linkCtx.elem.className,r=this.tagCtx.props.toggle;return r&&(t="(\\s(?="+(t=r.replace(/[\\^$.|?*+()[{]/g,"\\$&"))+"$)|(\\s)|^)("+t+"(\\s|$))",e=(n=n.replace(new RegExp(t),"$2"))+(e?(n&&" ")+r:"")),e},g({on:{attr:Ut,bindTo:[],init:function(e){for(var n,r=this,i=0,o=e.args,a=o.length;i<a&&!u(o[i]);i++);r._hi=a>i&&i+1,r.inline&&(v.rTmpl.exec(n=t.trim(e.tmpl.markup))||(r.template="<button>"+(n||e.params.args[i]||"noop")+"</button>"),r.attr=Y)},onBind:function(){this.template&&(this.mainElem=this.contents("button"))},onAfterLink:function(e,n){var r,i,o,a=this,s=a._hi,l=e.args,c=l.length,u=e.props,p=u.data,f=e.view,d=u.context;s&&(r=l[s-1],i=l.slice(s),l=l.slice(0,s-1),a._sel=l[1],o=a.activeElem=a.activeElem||t(a.inline?(a._sel=l[1]||"*",a.parentElem):n.elem),d||(d=(d=/^(.*)[.^][\w$]+$/.exec(e.params.args.slice(-i.length-1)[0]))&&v.tmplFn(b+":"+d[1]+I,f.tmpl,!0)(n.data,f,v)),a._evs&&a.onUnbind(e,n,a.ctx),o.on(a._evs=l[0]||"click",a._sel,null==p?null:p,a._hlr=function(e){var t,o=!a.inline;if(!o)for(t=a.contents("*"),c=t.length;!o&&c--;)t[c].contains(e.target)&&(o=!0);if(o)return r.apply(d||n.data,[].concat(i,e,{change:e.type,view:f,linkCtx:n},i.slice.call(arguments,1)))}))},onUpdate:!1,onArrayChange:!1,onUnbind:function(){var e=this,t=Kt;e.activeElem&&(Kt=0,e.activeElem.off(e._evs,e._sel,e._hlr),Kt=t)},contentCtx:!0,setSize:!0,dataBoundOnly:!0},radiogroup:{boundProps:["disabled"],init:function(e){this.name=e.props.name||(Math.random()+"jsv").slice(9)},onBind:function(e,n){var r,i,o=this,a=e.args[1],s=e.params.args[0],l=e.params.props,c=l&&l.disabled;for(o.inline?r=o.contents(!0,Mt,a):(r=t(Mt,n.elem),a&&(r=r.filter(a))),i=r.length;i--;)r[i].name=r[i].name||o.name;for(i in l)s+=" "+i+"="+l[i];r.link(s,n.data,void 0,void 0,n.view),o.linkedElem=r,o.onDomChange=function(n,i,l,u){var p,f,d=o.cvtArgs()[0];for(o.linkedElem=r=o.contents(!0,Mt,a),f=r.length;f--;)(p=r[f])._jsvLkEl||(p.name=p.name||o.name,p._jsvLkEl=o,p._jsvBnd="&"+o._tgId+"+",p.checked=d===p.value,c&&(p.disabled=!!e.props.disabled),t.link(s,p,i.data))}},onAfterLink:function(e,t,n,r,i){var o=e.params.props;o&&o.disabled&&this.linkedElem.prop("disabled",!!e.props.disabled)},flow:!0,onUpdate:!1,contentCtx:!0,dataBoundOnly:!0},checkboxgroup:{boundProps:["disabled"],init:function(e){this.name=e.props.name||(Math.random()+"jsv").slice(9)},onBind:function(e,n){var r,i,o=this,a=e.args[1],s=e.params.args[0],l=e.params.props,c=l&&l.disabled;for(o.inline?r=o.contents(!0,jt,a):(o.lateRender=!0,r=t(jt,n.elem),a&&(r=r.filter(a))),i=r.length;i--;)r[i].name=r[i].name||o.name,r[i]._jsvLkEl=o;for(i in l)s+=" "+i+"="+l[i];r.link(s,n.data,void 0,void 0,n.view),o.linkedElem=r,o.onDomChange=function(n,r,i,l){for(var u,p=o.contents(!0,jt,a),f=p.length;f--;)u=p[f],c&&(u.disabled=!!e.props.disabled),u._jsvSel||(u.name=u.name||o.name,t.link(s,u,r.data))}},onAfterLink:function(e,t,n,r,i){var o=e.params.props;o&&o.disabled&&this.contents(!0,jt,e.args[1]).prop("disabled",!!e.props.disabled)},flow:!0,onUpdate:!1,contentCtx:!0,dataBoundOnly:!0}}),le(g.for,{sortDataMap:a.map({getTgt:g.for.sortDataMap.getTgt,obsSrc:function(e,t,n){e.update()},obsTgt:function(e,t,n){var r,i=n.items,o=e.src;if("remove"===n.change)for(r=i.length;r--;)l(o).remove(gn(i[r],o));else"insert"===n.change&&l(o).insert(i)}}),mapProps:["filter","sort","reverse","start","end","step"],bindTo:["paged","sorted"],bindFrom:[0],onArrayChange:function(e,t,n,r){var i,o,a=e.target.length,s=this;if(!s.rendering)if(s._.noVws||s.tagCtxs[1]&&("insert"===t.change&&a===t.items.length||"remove"===t.change&&!a))o=n.map&&n.map.propsArr,s.refresh(),o&&(n.map.propsArr=o);else for(i in s._.arrVws)(i=s._.arrVws[i]).data===e.target&&bn.apply(i,arguments);s.domChange(n,r,t,e),e.done=!0},onUpdate:function(e,t,n){this.setDataMap(n)},onBind:function(e,t,n,r,i){for(var o,a=this,l=0,c=a._ars=a._ars||{},u=a.tagCtxs,f=u.length,d=a.selected||0;l<=d;l++)e=u[l],o=e.map?e.map.tgt:e.args.length?e.args[0]:e.view.data,c[l]&&(s(c[l],!0),delete c[l]),!c[l]&&p(o)&&function(){var n=e;s(o,c[l]=function(e,r){a.onArrayChange(e,r,n,t)})}();for(l=d+1;l<f;l++)c[l]&&(s(c[l],!0),delete c[l]);i&&a.domChange(e,t,i,r)},onAfterLink:function(){for(var e,n,r,i,o=this,a=0,s=o.tagCtxs,l=(s.length,o.selected||0);a<=l;a++)n=(i=s[a]).map,e=i.map?n.tgt:i.args.length?i.args[0]:i.view.data,p(e)&&(r=i.params.props)&&(r.paged&&!o.paged&&(t.observable(o).setProperty("paged",e.slice()),o.updateValue(o.paged,0,a,!0)),r.sorted&&!o.sorted&&(t.observable(o).setProperty("sorted",n&&n.sorted||e.slice()),o.updateValue(o.sorted,1,a,!0)))},onDispose:function(){var e;for(e in this._ars)s(this._ars[e],!0)}}),le(g.if,{onUpdate:function(e,t,n){for(var r,i,o=0;r=this.tagCtxs[o];o++)if(i=r.props.tmpl!==n[o].props.tmpl||r.args.length&&!(r=r.args[0])!=!n[o].args[0],!this.convert&&r||i)return i;return!1},onAfterLink:function(e,t,n,r,i){i&&this.domChange(e,t,i,r)}}),g("props",{baseTag:"for",dataMap:a.map({getTgt:g.props.dataMap.getTgt,obsSrc:function(e,t,n){var r,i,o=e.options.props;if(er(e.propsArr,n.path,n.value,n.remove),void 0!==o.sort||void 0!==o.start||void 0!==o.end||void 0!==o.step||o.filter||o.reverse)e.update();else if("set"===n.change){for(i=(r=e.tgt).length;i--&&r[i].key!==n.path;);-1===i?n.path&&!n.remove&&l(r).insert({key:n.path,prop:n.value}):n.remove?l(r).remove(i):l(r[i]).setProperty("prop",n.value)}},obsTgt:function(e,t,n){var r,i,o,a,s=e.src,c=n.change;if("set"===c)"prop"===n.path?l(s).setProperty(t.target.key,n.value):(l(s).removeProperty(n.oldValue),l(s).setProperty(n.value,t.target.prop));else if("insert"===c||(a="remove"===c))for(i=(r=n.items).length;i--;)(o=r[i].key)&&(er(e.propsArr,o,r[i].prop,a),a?(l(s).removeProperty(o),delete s[o]):l(s).setProperty(o,r[i].prop))},tgtFlt:function(e){return dn.test(e)}}),flow:!0}),le(t,{view:_t=function(e,n,r){function i(e,t){if(e)for(s=jn(e,t,sn),c=0,u=s.length;c<u&&(!(a=bt[s[c].id])||!(a=a&&r?a.get(!0,r):a));c++);}n!==!!n&&(r=n,n=void 0);var a,s,l,c,u,p,f,d=0,h=document.body;if(e&&e!==h&&o._.useKey>1&&(e=typeof e===K?t(e)[0]:e.jquery?e[0]:e)){if(n){if(i(e._df,!0),!a&&e.tagName)for(p=(f=zt?e.querySelectorAll(Ht):t(Ht,e).get()).length,l=0;!a&&l<p;l++)i(f[l]);return a}for(;e;){if(s=jn(e,void 0,cn))for(p=s.length;p--;)if((a=s[p]).open){if(d<1)return(a=bt[a.id])&&r?a.get(r):a||o;d--}else d++;e=e.previousSibling||e.parentNode}}return o},link:xn,unlink:Wn,cleanData:function(e){e.length&&Kt&&Yn(e),Wt.apply(t,arguments)}}),le(t.fn,{link:function(e,t,n,r,i,o,a){return xn(e,this,t,n,r,i,o,a)},unlink:function(){return Wn(this)},view:function(e,t){return _t(this[0],e,t)}}),t.each([Y,"replaceWith","empty","remove"],(function(e,n){var r=t.fn[n];t.fn[n]=function(){var e;Kt++;try{e=r.apply(this,arguments)}finally{Kt--}return e}})),le(o=v.topView,{tmpl:{links:{}}}),bt={0:o},v._glt=function(e){for(var t,n=/#(\d*)\^\/\1\^/g,r=[],i=Mn(e);t=n.exec(i);)(t=nn[t[1]])&&r.push(t.linkCtx.tag);return r},v._gccb=function(e){return function(t,n){var r,i,o,a,s,l,c,p,f,d,h;if(e&&t){if(t._cpfn)try{return y.cache?e.getCache(t._cpKey):t._cpfn.call(e.tmpl,e.data,e,v)}catch(e){return}if("~"===t.charAt(0)){if("~tag"===t.slice(0,4)&&(i=e.ctx,"."===t.charAt(4)?(r=t.slice(5),i=i.tag):"~tagCtx."===t.slice(0,8)&&(r=t.slice(8),i=i.tagCtx),r))return i?[i,r]:[];if(t=t.slice(1).split("."),a=e.ctxPrm(s=t.shift(),void 0,!0))if(p=a._cxp){if(t.length&&(l="."+t.join("."),(s=a[c=a.length-1])._cpfn?(s.sb=l,s.bnd=!!n):(a[c]=(s+l).replace("#data.",""),"#view"===s.slice(0,5)&&(a[c]=a[c].slice(6),a.splice(c,0,e)))),o=[a],(i=p.tag)&&i.convert)for(c=(h=i.bindTo||[0]).length;c--;)void 0!==n&&c!==p.ind&&(d=h[c],(f=[a[0],i.tagCtx.params[+d===d?"args":"props"]])._cxp=p,o.push(f))}else(t.length||u(a))&&(o=[a,t.join(".")]);return o||[]}if("#"===t.charAt(0))return"#data"===t?[]:[e,t.replace(on,"")]}}},v._cp=function(e,n,r,i){if(r.linked){if(i&&(i.cvt||void 0===i.tag._.toIndex[i.ind]))e=[{_ocp:e}],i.updateValue=function(n){return t.observable(e._cxp.data).setProperty(w,n),this};else if(n){var o=b+":"+n+I,a=$t[o];a||($t[o]=a=v.tmplFn(o.replace(N,"\\$&"),r.tmpl,!0)),e=a.deps[0]?[r,a]:[{_ocp:i?e:a()}]}else e=[{_ocp:e}];e._cxp=i||{updateValue:function(t){return l(e._cxp.data).setProperty(e._cxp.path,t),this}}}return e},v._ucp=function(e,t,n,r){var i=r.tag,o=i?gn(e,i.linkedCtxParam):0;return r.path||Hn("~"+e,n.data,v._gccb(n)),(r.updateValue||i.updateValue)(t,o,r.tagElse,void 0,i)},v._ceo=function e(t){for(var n,r=[],i=t.length;i--;)(n=t[i])._cpfn&&((n=le({},n)).prm=e(n.prm)),r.unshift(n);return r},It=v.advSet,v.advSet=function(){It.call(v),e._jsv=y._jsv?le(e._jsv||{},{views:bt,bindings:nn}):void 0,yt=y.linkAttr,mt=Ht+",["+yt+"]",(Et=y._wm).optgroup=Et.option,Et.tbody=Et.tfoot=Et.colgroup=Et.caption=Et.thead,Et.th=Et.td},m.advanced({linkAttr:"data-link",useViews:!1,noValidate:!1,_wm:{option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],svg_ns:[1,"<svg>","</svg>"],div:t.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},_fe:{input:{from:function(e){return e.type===Rt?e[Nt]:e.value},to:Dt},textarea:Yt,select:Yt,optgroup:{to:"label"}}}),t},i=window,o=a,e.exports=o?r(i,o):function(e){return r(i,e)}},6346:function(e){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(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){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(9),t),i(n(10),t),i(n(11),t),i(n(12),t),i(n(13),t),i(n(14),t),i(n(15),t),i(n(16),t),i(n(17),t),i(n(31),t),i(n(32),t),i(n(33),t),i(n(34),t),i(n(35),t),i(n(36),t),i(n(37),t),i(n(38),t),i(n(39),t),i(n(40),t),i(n(41),t),i(n(42),t),i(n(45),t),i(n(46),t),i(n(47),t),i(n(48),t),i(n(49),t),i(n(50),t),i(n(51),t),i(n(52),t),i(n(53),t),i(n(54),t),i(n(55),t),i(n(56),t),i(n(57),t),i(n(3),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BOOKMARKING="oa:bookmarking",e.CLASSIFYING="oa:classifying",e.COMMENTING="oa:commenting",e.DESCRIBING="oa:describing",e.EDITING="oa:editing",e.HIGHLIGHTING="oa:highlighting",e.IDENTIFYING="oa:identifying",e.LINKING="oa:linking",e.MODERATING="oa:moderating",e.PAINTING="sc:painting",e.QUESTIONING="oa:questioning",e.REPLYING="oa:replying",e.TAGGING="oa:tagging",e.TRANSCRIBING="oad:transcribing"}(t.AnnotationMotivation||(t.AnnotationMotivation={})),function(e){e.AUTO_ADVANCE="auto-advance",e.CONTINUOUS="continuous",e.FACING_PAGES="facing-pages",e.HIDDEN="hidden",e.INDIVIDUALS="individuals",e.MULTI_PART="multi-part",e.NO_NAV="no-nav",e.NON_PAGED="non-paged",e.PAGED="paged",e.REPEAT="repeat",e.SEQUENCE="sequence",e.THUMBNAIL_NAV="thumbnail-nav",e.TOGETHER="together",e.UNORDERED="unordered"}(t.Behavior||(t.Behavior={})),function(e){e.CANVAS="canvas",e.CHOICE="choice",e.OA_CHOICE="oa:choice",e.CONTENT_AS_TEXT="contentastext",e.DATASET="dataset",e.DOCUMENT="document",e.IMAGE="image",e.MODEL="model",e.MOVING_IMAGE="movingimage",e.PDF="pdf",e.PHYSICAL_OBJECT="physicalobject",e.SOUND="sound",e.TEXT="text",e.TEXTUALBODY="textualbody",e.VIDEO="video"}(t.ExternalResourceType||(t.ExternalResourceType={})),function(e){e.ANNOTATION="annotation",e.CANVAS="canvas",e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range",e.SEQUENCE="sequence"}(t.IIIFResourceType||(t.IIIFResourceType={})),function(e){e.AUDIO_MP4="audio/mp4",e.CORTO="application/corto",e.DICOM="application/dicom",e.DRACO="application/draco",e.EPUB="application/epub+zip",e.GIRDER="image/vnd.kitware.girder",e.GLB="model/gltf-binary",e.GLTF="model/gltf+json",e.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',e.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',e.JPG="image/jpeg",e.M3U8="application/vnd.apple.mpegurl",e.MP3="audio/mp3",e.MPEG_DASH="application/dash+xml",e.OBJ="text/plain",e.OPF="application/oebps-package+xml",e.PDF="application/pdf",e.PLY="application/ply",e.THREEJS="application/vnd.threejs+json",e.USDZ="model/vnd.usd+zip",e.VIDEO_MP4="video/mp4",e.WAV="audio/wav",e.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(e){e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",e.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",e.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",e.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",e.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",e.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",e.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",e.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",e.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",e.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",e.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",e.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",e.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",e.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",e.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",e.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",e.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",e.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",e.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",e.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",e.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",e.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",e.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",e.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",e.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",e.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",e.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",e.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",e.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",e.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",e.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",e.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",e.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",e.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",e.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",e.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",e.SEARCH_0="http://iiif.io/api/search/0/search",e.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",e.SEARCH_1="http://iiif.io/api/search/1/search",e.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",e.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",e.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",e.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",e.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",e.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",e.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",e.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.IMAGE_SERVICE_2="ImageService2",e.IMAGE_SERVICE_3="ImageService3"}(t.ServiceType||(t.ServiceType={})),function(e){e.BOTTOM_TO_TOP="bottom-to-top",e.LEFT_TO_RIGHT="left-to-right",e.RIGHT_TO_LEFT="right-to-left",e.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS="continuous",e.INDIVIDUALS="individuals",e.NON_PAGED="non-paged",e.PAGED="paged",e.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){var r=n(21).Symbol;e.exports=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Utils=void 0;var o=n(0),a=n(1),s=n(43);n(44);var l=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},e.getInexactLocale=function(e){return-1!==e.indexOf("-")?e.substr(0,e.indexOf("-")):e},e.getLocalisedValue=function(e,t){if(!Array.isArray(e))return e;for(var n=0;n<e.length;n++){var r=e[n];if(t===r["@language"])return r["@value"]}var i=t.substr(0,t.indexOf("-"));for(n=0;n<e.length;n++){var o=e[n];if(o["@language"]===i)return o["@value"]}return null},e.generateTreeNodeIds=function(t,n){var r;void 0===n&&(n=0),r=t.parentNode?t.parentNode.id+"-"+n:"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(e){return-1!==(e=(e||"").toLowerCase()).indexOf(":")?e.split(":")[1]:e},e.normaliseUrl=function(e){return-1!==(e=e.substr(e.indexOf("://"))).indexOf("#")&&(e=e.split("#")[0]),e},e.normalisedUrlsMatch=function(t,n){return e.normaliseUrl(t)===e.normaliseUrl(n)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isImageServiceType=function(e){return null!==e&&e.toLowerCase()===a.ServiceType.IMAGE_SERVICE_2.toLowerCase()||e===a.ServiceType.IMAGE_SERVICE_3.toLowerCase()},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(e,t){return o.Deserialiser.parse(e,t)},e.checkStatus=function(e){if(e.ok)return e;var t=new Error(e.statusText);return t.response=e,Promise.reject(t)},e.loadManifest=function(t){return new Promise((function(n,r){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){n(e)})).catch((function(e){r()}))}))},e.loadExternalResourcesAuth1=function(t,n,r,i,o,a,s,l){return new Promise((function(c,u){var p=t.map((function(t){return e.loadExternalResourceAuth1(t,n,r,i,o,a,s,l)}));Promise.all(p).then((function(){c(t)})).catch((function(e){u(e)}))}))},e.loadExternalResourceAuth1=function(t,n,o,a,l,c,u,p){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,a(t)];case 1:return(r=i.sent())?[4,t.getData(r)]:[3,6];case 2:return i.sent(),t.status!==s.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,n,o,l,c,u,p)];case 4:i.sent(),i.label=5;case 5:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return i.sent(),t.status!==s.MOVED_TEMPORARILY&&t.status!==s.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,n,o,l,c,u,p)];case 8:i.sent(),i.label=9;case 9:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,n,o,a,l,c,u){return r(this,void 0,void 0,(function(){var r,p,f,d,h,g,v,_;return i(this,(function(i){switch(i.label){case 0:return t.isAccessControlled()?((r=t.externalService)&&(r.options=t.options),(p=t.kioskService)&&(p.options=t.options),(f=t.clickThroughService)&&(f.options=t.options),(d=t.loginService)&&(d.options=t.options),t.isResponseHandled||t.status!==s.MOVED_TEMPORARILY?[3,2]:[4,c(t)]):[2,t];case 1:case 3:case 6:case 10:case 14:return i.sent(),[2,t];case 2:return h=null,g=null,(h=r)?(g=h,[4,e.attemptResourceWithToken(t,o,h)]):[3,4];case 4:return(h=p)?(g=h,(v=n(h))?[4,a(v)]:[3,7]):[3,7];case 5:case 9:case 13:return i.sent(),[4,e.attemptResourceWithToken(t,o,h)];case 7:return(h=f)?(g=h,[4,l(t,h)]):[3,11];case 8:return(_=i.sent())?[4,a(_)]:[3,11];case 11:return(h=d)?(g=h,[4,l(t,h)]):[3,15];case 12:return(_=i.sent())?[4,a(_)]:[3,15];case 15:return g&&u(t,g),[2]}}))}))},e.attemptResourceWithToken=function(e,t,n){return r(this,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return(r=n.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,r)]:[3,3];case 1:return(o=i.sent())&&o.accessToken?[4,e.getData(o)]:[3,3];case 2:return i.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,n,r,i,o,a,s,l,c,u){return new Promise((function(p,f){var d=t.map((function(t){return e.loadExternalResourceAuth09(t,n,r,i,o,a,s,l,c,u)}));Promise.all(d).then((function(){p(t)})).catch((function(e){f(e)}))}))},e.loadExternalResourceAuth09=function(t,n,r,i,o,a,l,c,u,p){return new Promise((function(f,d){p&&p.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(f(r(t)),f(i(t))):o(t).then((function(){a(t,!0).then((function(n){t.getData(n).then((function(){f(u(t))})).catch((function(t){d(e.createInternalServerError(t))}))})).catch((function(t){d(e.createInternalServerError(t))}))})).catch((function(t){d(e.createInternalServerError(t))})):f(t)})).catch((function(t){d(e.createInternalServerError(t))})):c(t,n).then((function(p){p?t.getData(p).then((function(){t.status===s.OK?f(u(t)):e.authorize(t,n,r,i,o,a,l,c).then((function(){f(u(t))})).catch((function(t){d(e.createAuthorizationFailedError())}))})).catch((function(t){d(e.createAuthorizationFailedError())})):e.authorize(t,n,r,i,o,a,l,c).then((function(){f(u(t))})).catch((function(t){d(e.createAuthorizationFailedError())}))})).catch((function(t){d(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var n=new Error;return n.message=t,n.name=String(e),n},e.createAuthorizationFailedError=function(){return e.createError(o.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(o.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(o.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,n,r,i,o,a,l,c){return new Promise((function(u,p){t.getData().then((function(){t.isAccessControlled()?c(t,n).then((function(c){c?t.getData(c).then((function(){t.status===s.OK?u(t):e.showAuthInteraction(t,n,r,i,o,a,l,u,p)})).catch((function(t){p(e.createInternalServerError(t))})):a(t,!1).then((function(c){c?l(t,c,n).then((function(){t.getData(c).then((function(){t.status===s.OK?u(t):e.showAuthInteraction(t,n,r,i,o,a,l,u,p)})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):e.showAuthInteraction(t,n,r,i,o,a,l,u,p)}))})).catch((function(t){p(e.createInternalServerError(t))})):u(t)}))}))},e.showAuthInteraction=function(t,n,r,i,o,a,l,c,u){t.status!==s.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?r(t).then((function(){a(t,!0).then((function(r){l(t,r,n).then((function(){t.getData(r).then((function(){c(t)})).catch((function(t){u(e.createInternalServerError(t))}))})).catch((function(t){u(e.createInternalServerError(t))}))})).catch((function(t){u(e.createInternalServerError(t))}))})):o(t).then((function(){a(t,!0).then((function(r){l(t,r,n).then((function(){t.getData(r).then((function(){c(t)})).catch((function(t){u(e.createInternalServerError(t))}))})).catch((function(t){u(e.createInternalServerError(t))}))})).catch((function(t){u(e.createInternalServerError(t))}))})):c(t)},e.getService=function(e,t){for(var n=this.getServices(e),r=0;r<n.length;r++){var i=n[r];if(i.getProfile()===t)return i}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("object"==typeof t[Object.keys(t)[i]]){var o=e.traverseAndFind(t[Object.keys(t)[i]],n,r);if(null!=o)return o}},e.getServices=function(t,n){var r=void 0===n?{}:n,i=r.onlyService,a=void 0!==i&&i,s=r.onlyServices,l=void 0!==s&&s,c=r.skipParentResources,u=[];(void 0===c||!c)&&t&&t.options&&t.options.resource&&t.options.resource!==t&&u.push.apply(u,e.getServices(t.options.resource,{onlyServices:!0}));var p=l?[]:(t.__jsonld||t).service||[];if(Array.isArray(p)||(p=[p]),a||p.push.apply(p,(t.__jsonld||t).services||[]),0===p.length)return u;for(var f=0;f<p.length;f++){var d=p[f];if("string"==typeof d){var h=this.getResourceById(t.options.resource,d);h&&u.push(new o.Service(h.__jsonld||h,t.options))}else u.push(new o.Service(d,t.options))}return u},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),n=null;return t&&t[1]&&(n=t[1].split(",")),n},e}();t.Utils=l},function(e,t,n){var r=n(19),i=n(20);e.exports=function e(t,n,o,a,s){var l=-1,c=t.length;for(o||(o=i),s||(s=[]);++l<c;){var u=t[l];n>0&&o(u)?n>1?e(u,n-1,o,a,s):r(s,u):a||(s[s.length]=u)}return s}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)}))}},function(e,t,n){e.exports=n(8)},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(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){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.parseManifest=t.loadManifest=void 0,i(n(0),t);var o=n(3);t.loadManifest=function(e){return o.Utils.loadManifest(e)},t.parseManifest=function(e,t){return o.Utils.parseManifest(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONLDResource=void 0;var r=function(){function e(e){this.__jsonld=e,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return e.prototype.getProperty=function(e){var t=null;return this.__jsonld&&((t=this.__jsonld[e])||(t=this.__jsonld["@"+e])),t},e}();t.JSONLDResource=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestResource=void 0;var o=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.options=n,r}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){var e=this.getProperty("label");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty("metadata"),t=[];if(!e)return t;for(var n=0;n<e.length;n++){var r=e[n],i=new o.LabelValuePair(this.options.locale);i.parse(r),t.push(i)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),n=0;n<t.length;n++){var r=t[n];if(r.getFormat()===e)return r}return null},t.prototype.getRenderings=function(){var e,t=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return t;Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var r=e[n];t.push(new o.Rendering(r,this.options))}return t},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty("requiredStatement");return t&&(e=new o.LabelValuePair(this.options.locale)).parse(t),e},t.prototype.getService=function(e){return o.Utils.getService(this,e)},t.prototype.getServices=function(){return o.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty("thumbnail");return Array.isArray(e)&&(e=e[0]),e?new o.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},t}(o.JSONLDResource);t.ManifestResource=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Resource=void 0;var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?e.toLowerCase():null},t.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var n=this.__jsonld.resources[t],r=new o.Annotation(n,this.options);e.push(r)}return e},t.prototype.getType=function(){var e=this.getProperty("type");return e?o.Utils.normaliseType(e):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(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},t}(o.ManifestResource);t.Resource=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.IIIFResource=void 0;var o=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.index=-1,r.isLoaded=!1;var i={defaultLabel:"-",locale:"en-GB",resource:r,pessimisticAccessControl:!1};return r.options=Object.assign(i,n),r}return i(t,e),t.prototype.getAttribution=function(){var e=this.getProperty("attribution");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDescription=function(){var e=this.getProperty("description");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getHomepage=function(){var e=this.getProperty("homepage");return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLogo=function(){var e=this.getProperty("logo");if(!e){var t=this.getProperty("provider");if(!t)return null;var n=t.find((function(e){return void 0!==e.logo}));e=n&&void 0!==n.logo?n.logo:null}return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||(null==e?void 0:e.id)):null},t.prototype.getLicense=function(){return o.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},t.prototype.getRights=function(){var e=this.getProperty("rights");return e?"string"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.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 e=this.getService(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty("trackingLabel"):""},t.prototype.getDefaultTree=function(){return this.defaultTree=new o.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty("requiredStatement");if(t)(e=new o.LabelValuePair(this.options.locale)).parse(t);else{var n=this.getAttribution();n&&n.length&&((e=new o.LabelValuePair(this.options.locale)).value=n)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var n=e.options;n.navDate=e.getNavDate();var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),o.Utils.loadManifest(r).then((function(r){e.parentLabel=e.getLabel().getValue(n.locale);var i=o.Deserialiser.parse(r,n);(e=Object.assign(e,i)).index=n.index,t(e)}))}}))},t}(o.ManifestResource);t.IIIFResource=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Annotation=void 0;var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)if((a=t[n]).items)for(var r=0;r<a.items.length;r++){var i=a.items[r];e.push(new o.AnnotationBody(i,this.options))}else e.push(new o.AnnotationBody(a,this.options));else if(t.items)for(n=0;n<t.items.length;n++){var a=t.items[n];e.push(new o.AnnotationBody(a,this.options))}else e.push(new o.AnnotationBody(t,this.options));return e},t.prototype.getMotivation=function(){return this.getProperty("motivation")||null},t.prototype.getOn=function(){return this.getProperty("on")},t.prototype.getTarget=function(){return this.getProperty("target")},t.prototype.getResource=function(){return new o.Resource(this.getProperty("resource"),this.options)},t}(o.ManifestResource);t.Annotation=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationBody=void 0;var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty("format");return e?o.Utils.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty("type")?o.Utils.normaliseType(this.getProperty("type")):null},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t}(o.ManifestResource);t.AnnotationBody=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationList=void 0;var o=n(0),a=function(e){function t(t,n,r){var i=e.call(this,n)||this;return i.label=t,i.options=r,i}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty("type"))},t.prototype.getLabel=function(){return this.label},t.prototype.getResources=function(){var e=this;return this.getProperty("resources").map((function(t){return new o.Annotation(t,e.options)}))},t.prototype.load=function(){var e=this;return new Promise((function(t,n){if(e.isLoaded)t(e);else{var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),o.Utils.loadManifest(r).then((function(n){e.__jsonld=n,e.context=e.getProperty("context"),e.id=e.getProperty("id"),e.isLoaded=!0,t(e)})).catch(n)}}))},t}(o.JSONLDResource);t.AnnotationList=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationPage=void 0;var o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getItems=function(){return this.getProperty("items")},t}(n(0).ManifestResource);t.AnnotationPage=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Canvas=void 0;var a=n(1),s=n(0),l=o(n(18)),c=o(n(30)),u=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getCanonicalImageUri=function(e){var t,n=null,r="default",i=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])n=this.externalResource.data["@id"],i||(i=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)&&(r="native");else{var o=void 0;if((o=this.getImages())&&o.length){var a=o[0].getResource(),l=a.getServices();if(i||(i=a.getWidth()),c=l?l.find((function(e){return s.Utils.isImageProfile(e.getProfile())||s.Utils.isImageServiceType(e.getIIIFResourceType())})):null)n=c.id,r=s.Utils.getImageQuality(c.getProfile());else if(i===a.getWidth())return a.id}if((o=this.getContent())&&o.length){var c,u=o[0].getBody()[0];if(l=u.getServices(),i||(i=u.getWidth()),c=l?l.find((function(e){return s.Utils.isImageServiceType(e.getIIIFResourceType())})):null)n=c.id,r=s.Utils.getImageQuality(c.getProfile());else if(i===u.getWidth())return u.id}if(!n){var p=this.getProperty("thumbnail");if(p){if("string"==typeof p)return p;if(p["@id"])return p["@id"];if(p.length)return p[0].id}}}return t=i+",",n&&n.endsWith("/")&&(n=n.substr(0,n.length-1)),[n,"full",t,0,r+".jpg"].join("/")},t.prototype.getMaxDimensions=function(){var e,t=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(e=this.externalResource.data.profile,Array.isArray(e)&&(e=e.filter((function(e){var t;return null!==(t=e.maxWidth)&&void 0!==t?t:e.maxwidth}))[0])&&(t=new s.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var n=null;if(t.length&&(n=new s.AnnotationPage(t[0],this.options)),!n)return e;for(var r=n.getItems(),i=0;i<r.length;i++){var o=r[i],a=new s.Annotation(o,this.options);e.push(a)}return e},t.prototype.getDuration=function(){return this.getProperty("duration")},t.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var n=this.__jsonld.images[t],r=new s.Annotation(n,this.options);e.push(r)}return e},t.prototype.getIndex=function(){return this.getProperty("index")},t.prototype.getOtherContent=function(){var e=this,t=(Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")]).filter((function(e){return e&&"string"==typeof(t=e["@type"])&&t.toLowerCase()==t.toLowerCase();var t})).map((function(t,n){return new s.AnnotationList(t.label||"Annotation list ".concat(n),t,e.options)})).map((function(e){return e.load()}));return Promise.all(t)},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 e=this,n=(0,c.default)([this.getImages().map((function(e){return e.getResource()})),this.getContent().map((function(e){return e.getBody()}))]);return(0,l.default)(n.map((function(n){switch(n.getProperty("type").toLowerCase()){case a.ExternalResourceType.CHOICE:case a.ExternalResourceType.OA_CHOICE:return new t({images:(0,l.default)([n.getProperty("default"),n.getProperty("item")]).map((function(e){return{resource:e}}))},e.options).getImages().map((function(e){return e.getResource()}));default:return n}})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resourceAnnotations",{get:function(){return(0,c.default)([this.getImages(),this.getContent()])},enumerable:!1,configurable:!0}),t.prototype.resourceAnnotation=function(e){return this.resourceAnnotations.find((function(t){return t.getResource().id===e||(0,l.default)(new Array(t.getBody())).some((function(t){return t.id===e}))}))},t.prototype.onFragment=function(e){var t=this.resourceAnnotation(e);if(t){var n=t.getProperty("on"),r=t.getProperty("target");if(n&&r){var i=(n||r).match(/xywh=(.*)$/);if(i)return i[1].split(",").map((function(e){return parseInt(e,10)}))}}},Object.defineProperty(t.prototype,"iiifImageResources",{get:function(){return this.imageResources.filter((function(e){return e&&e.getServices()[0]&&e.getServices()[0].id}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageServiceIds",{get:function(){return this.iiifImageResources.map((function(e){return e.getServices()[0].id}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!1,configurable:!0}),t}(s.Resource);t.Canvas=u},function(e,t,n){var r=n(4);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t,n){var r=n(2),i=n(24),o=n(29),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(22),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(23))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(25),i=n(5),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},function(e,t,n){var r=n(26),i=n(5);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},function(e,t,n){var r=n(2),i=n(27),o=n(28),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(2),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(4);e.exports=function(e){return null!=e&&e.length?r(e,1/0):[]}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 0;var o=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.items=[],r._collections=null,r._manifests=null,t.__collection=r,r}return i(t,e),t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter((function(e){return e.isCollection()}))},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter((function(e){return e.isManifest()}))},t.prototype.getCollectionByIndex=function(e){for(var t,n=this.getCollections(),r=0;r<n.length;r++){var i=n[r];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error("Collection index not found")},t.prototype.getManifestByIndex=function(e){for(var t,n=this.getManifests(),r=0;r<n.length;r++){var i=n[r];i.index===e&&(t=i)}if(t)return t.options.index=e,t.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"):o.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getDefaultTree=function(){return e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),this._parseManifests(this),this._parseCollections(this),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._parseManifests=function(e){if(e.getManifests()&&e.getManifests().length)for(var t=0;t<e.getManifests().length;t++){var n=e.getManifests()[t],r=n.getDefaultTree();r.label=n.parentLabel||n.getLabel().getValue(this.options.locale)||"manifest "+(t+1),r.navDate=n.getNavDate(),r.data.id=n.id,r.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),e.defaultTree.addNode(r)}},t.prototype._parseCollections=function(e){if(e.getCollections()&&e.getCollections().length)for(var t=0;t<e.getCollections().length;t++){var n=e.getCollections()[t],r=n.getDefaultTree();r.label=n.parentLabel||n.getLabel().getValue(this.options.locale)||"collection "+(t+1),r.navDate=n.getNavDate(),r.data.id=n.id,r.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),e.defaultTree.addNode(r)}},t}(a.IIIFResource);t.Collection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Duration=void 0;var r=function(){function e(e,t){this.start=e,this.end=t}return e.prototype.getLength=function(){return this.end-this.start},e}();t.Duration=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LabelValuePair=void 0;var r=n(0),i=function(){function e(e){this.defaultLocale=e}return e.prototype.parse=function(e){this.resource=e,this.label=r.PropertyValue.parse(this.resource.label,this.defaultLocale),this.value=r.PropertyValue.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(e){return null===this.label?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.label.getValue(e||this.defaultLocale))},e.prototype.setLabel=function(e){null===this.label&&(this.label=new r.PropertyValue([])),this.label.setValue(e,this.defaultLocale)},e.prototype.getValue=function(e,t){return void 0===t&&(t="<br/>"),null===this.value?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValue(e||this.defaultLocale,t))},e.prototype.getValues=function(e){return null===this.value?[]:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValues(e||this.defaultLocale))},e.prototype.setValue=function(e){null===this.value&&(this.value=new r.PropertyValue([])),this.value.setValue(e,this.defaultLocale)},e}();t.LabelValuePair=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageMap=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.getValue=function(e,t){return e.getValue(t,"<br/>")},t.getValues=function(e,t){return e.getValues(t)},t}(Array);t.LanguageMap=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyValue=t.LocalizedValue=void 0;var o=n(3),a=function(){function e(e,t,n){void 0===n&&(n="none"),Array.isArray(e)&&1===e.length?this._value=e[0]:this._value=e,"none"!==t&&"@none"!==t||(t=void 0),this._locale=t,this._defaultLocale=n}return e.parseV2Value=function(t,n){return"string"==typeof t?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 void 0===this._locale?this._defaultLocale:this._locale},enumerable:!1,configurable:!0}),e.prototype.addValue=function(e){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(e)?this._value=this._value.concat(e):this._value.push(e)},e}();t.LocalizedValue=a;var s=function(e){function t(n,r){void 0===n&&(n=[]);var i=e.apply(this,n)||this;return i.__proto__=t.prototype,i._defaultLocale=r,i}return i(t,e),t.parse=function(e,n){if(!e)return new t([],n);if(Array.isArray(e)){var r=(i=e.map((function(e){return a.parseV2Value(e,n)})).filter((function(e){return null!==e}))).reduce((function(e,t){var n=t._locale;return n||(n="none"),e[n]?e[n].addValue(t._value):e[n]=t,e}),{});return new t(Object.values(r),n)}return"string"==typeof e?new t([new a(e,void 0,n)],n):e["@language"]||e["@value"]?new t(null!==(i=a.parseV2Value(e))?[i]:[],n):new t(Object.keys(e).map((function(t){var r=e[t];if(!Array.isArray(r))throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");return new a(r,t,n)})),n);var i},t.prototype.getSuitableLocale=function(e){for(var t=Array.from(this.values()).map((function(e){return e._locale})).filter((function(e){return void 0!==e})),n=function(e){var n=t.find((function(t){return t===e}));if(n)return{value:n}},r=0,i=e;r<i.length;r++){var a=n(i[r]);if("object"==typeof a)return a.value}for(var s=function(e){var n=t.find((function(t){return o.Utils.getInexactLocale(t)===o.Utils.getInexactLocale(e)}));if(n)return{value:n}},l=0,c=e;l<c.length;l++){var u=s(c[l]);if("object"==typeof u)return u.value}},t.prototype.setValue=function(e,t){var n=void 0;if(t){var r=this.getSuitableLocale([t]);r&&(n=this.find((function(e){return e._locale===r})))}else n=this.find((function(e){return void 0===e._locale}));n?n._value=e:this.push(new a(e,t,this._defaultLocale))},t.prototype.getValue=function(e,t){var n=this.getValues(e);return 0===n.length?null:t?n.join(t):n[0]},t.prototype.getValues=function(e){if(!this.length)return[];var t;if(t=e?Array.isArray(e)?e:[e]:[],1===this.length&&void 0===this[0]._locale){var n=this[0]._value;return Array.isArray(n)?n:[n]}var r=this.getSuitableLocale(t);if(r)return n=this.find((function(e){return e._locale===r}))._value,Array.isArray(n)?n:[n];if(!this.find((function(e){return void 0===e._locale})))return n=this[0]._value,Array.isArray(n)?n:[n];var i=this.find((function(e){return void 0===e._locale}));return i?Array.isArray(i._value)?i._value:[i._value]:[]},t}(Array);t.PropertyValue=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511},function(e,t,n){e.exports=window.fetch||(window.fetch=n(6).default||n(6))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Manifest=void 0;var o=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.index=0,r._allRanges=null,r.items=[],r._topRanges=[],r.__jsonld.structures&&r.__jsonld.structures.length)for(var i=r._getTopRanges(),o=0;o<i.length;o++){var a=i[o];r._parseRanges(a,String(o))}return r}return i(t,e),t.prototype.getPosterCanvas=function(){var e=this.getProperty("posterCanvas");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getAccompanyingCanvas=function(){var e=this.getProperty("accompanyingCanvas");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),!this.isLoaded)return this.defaultTree;var t=this.getTopRanges();return t.length&&t[0].getTree(this.defaultTree),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var e=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var t=0;t<this.__jsonld.structures.length;t++){var n=this.__jsonld.structures[t];n.viewingHint===o.ViewingHint.TOP&&e.push(n)}if(!e.length){var r={};r.ranges=this.__jsonld.structures,e.push(r)}}return e},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(e){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var t=0;t<this.__jsonld.structures.length;t++){var n=this.__jsonld.structures[t];if(n["@id"]===e||n.id===e)return n}return null},t.prototype._parseRanges=function(e,t,n){var r,i=null;if("string"==typeof e&&(i=e,e=this._getRangeById(i)),e){(r=new a.Range(e,this.options)).parentRange=n,r.path=t,n?n.items.push(r):this._topRanges.push(r);var o=e.items||e.members;if(o)for(var s=0;s<o.length;s++){var l=o[s];if(l["@type"]&&"sc:range"===l["@type"].toLowerCase()||l.type&&"range"===l.type.toLowerCase())this._parseRanges(l,t+"/"+s,r);else if(l["@type"]&&"sc:canvas"===l["@type"].toLowerCase()||l.type&&"canvas"===l.type.toLowerCase()){r.canvases||(r.canvases=[]);var c=l.id||l["@id"];r.canvases.push(c)}}else if(e.ranges)for(s=0;s<e.ranges.length;s++)this._parseRanges(e.ranges[s],t+"/"+s,r)}else console.warn("Range:",i,"does not exist")},t.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var e=this.getTopRanges(),t=function(t){var r=e[t];r.id&&n._allRanges.push(r);var i=function(e,t){e.add(t);var n=t.getRanges();return n.length?n.reduce(i,e):e},o=Array.from(r.getRanges().reduce(i,new Set));n._allRanges=n._allRanges.concat(o)},n=this,r=0;r<e.length;r++)t(r);return this._allRanges},t.prototype.getRangeById=function(e){for(var t=this.getAllRanges(),n=0;n<t.length;n++){var r=t[n];if(r.id===e)return r}return null},t.prototype.getRangeByPath=function(e){for(var t=this.getAllRanges(),n=0;n<t.length;n++){var r=t[n];if(r.path===e)return r}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var e=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(e)for(var t=0;t<e.length;t++){var n=e[t],r=new a.Sequence(n,this.options);this.items.push(r)}else this.__jsonld.items&&(r=new a.Sequence(this.__jsonld.items,this.options),this.items.push(r));return this.items},t.prototype.getSequenceByIndex=function(e){return this.getSequences()[e]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var e=this.getService(o.ServiceProfile.UI_EXTENSIONS);return e?e.getProperty("manifestType"):a.ManifestType.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===o.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===o.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t}(a.IIIFResource);t.Manifest=s},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestType=void 0,function(e){e.EMPTY="",e.MANUSCRIPT="manuscript",e.MONOGRAPH="monograph"}(r||(t.ManifestType=r={}))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Range=void 0;var o=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._ranges=null,r.canvases=null,r.items=[],r}return i(t,e),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 e=[],t=[],n=0,r=this.canvases;n<r.length;n++)if(h=r[n]){var i=h.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,h],a=i[1],s=i[2],l=i[3];a&&(e.push(parseFloat(s)),t.push(parseFloat(l)))}if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}else{e=[],t=[];for(var c=0,u=v=this.getRanges();c<u.length;c++)(_=u[c].getDuration())&&(e.push(_.start),t.push(_.end));if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}var p,f;if(this.canvases&&this.canvases.length)for(var d=0;d<this.canvases.length;d++){var h=this.canvases[d],g=o.Utils.getTemporalComponent(h);g&&g.length>1&&(0===d&&(p=Number(g[0])),d===this.canvases.length-1&&(f=Number(g[1])))}else{var v=this.getRanges();for(d=0;d<v.length;d++){var _;(_=v[d].getDuration())&&(0===d&&(p=_.start),d===v.length-1&&(f=_.end))}}if(void 0!==p&&void 0!==f)return new o.Duration(p,f)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(e){return e.isRange()}))},t.prototype.getBehavior=function(){var e=this.getProperty("behavior");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")},t.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var t=this.getRanges();if(t&&t.length)for(var n=0;n<t.length;n++){var r=t[n],i=new o.TreeNode;e.addNode(i),this._parseTreeNode(i,r)}return o.Utils.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var t=this.getDuration();return!!(t&&e>=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=t.getLabel().getValue(this.options.locale),e.data=t,e.data.type=o.Utils.normaliseType(o.TreeNodeType.RANGE),t.treeNode=e;var n=t.getRanges();if(n&&n.length)for(var r=0;r<n.length;r++){var i=n[r];if(i.getBehavior()!==a.Behavior.NO_NAV){var s=new o.TreeNode;e.addNode(s),this._parseTreeNode(s,i)}}},t}(o.ManifestResource);t.Range=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Rendering=void 0;var o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){return this.getProperty("format")},t}(n(0).ManifestResource);t.Rendering=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Sequence=void 0;var o=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.items=[],r._thumbnails=null,r}return i(t,e),t.prototype.getCanvases=function(){if(this.items.length)return this.items;var e=this.__jsonld.canvases||this.__jsonld.elements;if(e)for(var t=0;t<e.length;t++){var n=e[t];(r=new a.Canvas(n,this.options)).index=t,this.items.push(r)}else if(this.__jsonld)for(t=0;t<this.__jsonld.length;t++){var r;n=this.__jsonld[t],(r=new a.Canvas(n,this.options)).index=t,this.items.push(r)}return this.items},t.prototype.getCanvasById=function(e){for(var t=0;t<this.getTotalCanvases();t++){var n=this.getCanvasByIndex(t),r=a.Utils.normaliseUrl(n.id);if(a.Utils.normaliseUrl(e)===r)return n}return null},t.prototype.getCanvasByIndex=function(e){return this.getCanvases()[e]},t.prototype.getCanvasIndexById=function(e){for(var t=0;t<this.getTotalCanvases();t++)if(this.getCanvasByIndex(t).id===e)return t;return null},t.prototype.getCanvasIndexByLabel=function(e,t){e=e.trim(),isNaN(e)||(e=parseInt(e,10).toString(),t&&(e+="r"));for(var n,r,i,o=/(\d*)\D+(\d*)/,a=0;a<this.getTotalCanvases();a++){var s=this.getCanvasByIndex(a);if(s.getLabel().getValue(this.options.locale)===e)return a;if((n=o.exec(e))&&(r=n[1],(i=n[2])&&new RegExp("^"+r+"\\D+"+i+"$").test(s.getLabel().toString())))return a}return-1},t.prototype.getLastCanvasLabel=function(e){for(var t=this.getTotalCanvases()-1;t>=0;t--){var n=this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(n))return n}else if(n)return n}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),i=this.getViewingDirection();n=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?r[0]+1:r[r.length-1]+1}else n=e+1;return n>this.getLastPageIndex()?-1:n},t.prototype.getPagedIndices=function(e,t){var n=[];if(t){n=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var r=this.getViewingDirection();r&&r===o.ViewingDirection.RIGHT_TO_LEFT&&(n=n.reverse())}else n.push(e);return n},t.prototype.getPrevPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),i=this.getViewingDirection();n=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?r[r.length-1]-1:r[0]-1}else n=e-1;return n},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;t<this.getTotalCanvases();t++)if(this.getCanvasByIndex(t).id===e)return t;return 0},t.prototype.getThumbs=function(e,t){for(var n=[],r=this.getTotalCanvases(),i=0;i<r;i++){var o=this.getCanvasByIndex(i),s=new a.Thumb(e,o);n.push(s)}return n},t.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var e=this.getCanvases(),t=0;t<e.length;t++){var n=e[t].getThumbnail();n&&this._thumbnails.push(n)}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(e){return e>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===o.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(a.ManifestResource);t.Sequence=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deserialiser=void 0;var r=n(0),i=function(){function e(){}return e.parse=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var n;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e["@type"])switch(e["@type"]){case"sc:Collection":n=this.parseCollection(e,t);break;case"sc:Manifest":n=this.parseManifest(e,t);break;default:return null}else switch(e.type){case"Collection":n=this.parseCollection(e,t);break;case"Manifest":n=this.parseManifest(e,t);break;default:return null}return n.isLoaded=!0,n},e.parseCollection=function(e,t){var n=new r.Collection(e,t);return t?(n.index=t.index||0,t.resource&&(n.parentCollection=t.resource.parentCollection)):n.index=0,this.parseCollections(n,t),this.parseManifests(n,t),this.parseItems(n,t),n},e.parseCollections=function(e,t){var n;if(e.__jsonld.collections?n=e.__jsonld.collections:e.__jsonld.items&&(n=e.__jsonld.items.filter((function(e){return"collection"===e.type.toLowerCase()}))),n)for(var r=0;r<n.length;r++){t&&(t.index=r);var i=this.parseCollection(n[r],t);i.index=r,i.parentCollection=e,e.items.push(i)}},e.parseManifest=function(e,t){return new r.Manifest(e,t)},e.parseManifests=function(e,t){var n;if(e.__jsonld.manifests?n=e.__jsonld.manifests:e.__jsonld.items&&(n=e.__jsonld.items.filter((function(e){return"manifest"===e.type.toLowerCase()}))),n)for(var r=0;r<n.length;r++){var i=this.parseManifest(n[r],t);i.index=r,i.parentCollection=e,e.items.push(i)}},e.parseItem=function(e,t){if(e["@type"]){if("sc:manifest"===e["@type"].toLowerCase())return this.parseManifest(e,t);if("sc:collection"===e["@type"].toLowerCase())return this.parseCollection(e,t)}else if(e.type){if("manifest"===e.type.toLowerCase())return this.parseManifest(e,t);if("collection"===e.type.toLowerCase())return this.parseCollection(e,t)}return null},e.parseItems=function(e,t){var n=e.__jsonld.members||e.__jsonld.items;if(n)for(var r=function(r){t&&(t.index=r);var o=i.parseItem(n[r],t);return o?e.items.filter((function(e){return e.id===o.id}))[0]?"continue":(o.index=r,o.parentCollection=e,void e.items.push(o)):{value:void 0}},i=this,o=0;o<n.length;o++){var a=r(o);if("object"==typeof a)return a.value}},e}();t.Deserialiser=i},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Service=void 0;var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getProfile=function(){var e=this.getProperty("profile");return e||(e=this.getProperty("dcterms:conformsTo")),Array.isArray(e)?e[0]:e},t.prototype.getConfirmLabel=function(){return o.Utils.getLocalisedValue(this.getProperty("confirmLabel"),this.options.locale)},t.prototype.getDescription=function(){return o.Utils.getLocalisedValue(this.getProperty("description"),this.options.locale)},t.prototype.getFailureDescription=function(){return o.Utils.getLocalisedValue(this.getProperty("failureDescription"),this.options.locale)},t.prototype.getFailureHeader=function(){return o.Utils.getLocalisedValue(this.getProperty("failureHeader"),this.options.locale)},t.prototype.getHeader=function(){return o.Utils.getLocalisedValue(this.getProperty("header"),this.options.locale)},t.prototype.getServiceLabel=function(){return o.Utils.getLocalisedValue(this.getProperty("label"),this.options.locale)},t.prototype.getInfoUri=function(){var e=this.id;return e.endsWith("/")||(e+="/"),e+"info.json"},t}(o.ManifestResource);t.Service=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Size=void 0;t.Size=function(e,t){this.width=e,this.height=t}},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.StatusCode=void 0,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"}(r||(t.StatusCode=r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Thumb=void 0;t.Thumb=function(e,t){this.data=t,this.index=t.index,this.width=e;var n=t.getHeight()/t.getWidth();this.height=n?Math.floor(this.width*n):e,this.uri=t.getCanonicalImageUri(e),this.label=t.getLabel().getValue(),this.viewingHint=t.getViewingHint()}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Thumbnail=void 0;var o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t}(n(0).Resource);t.Thumbnail=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeNode=void 0;var r=n(0),i=function(){function e(e,t){this.label=e,this.data=t||{},this.nodes=[]}return e.prototype.addNode=function(e){this.nodes.push(e),e.parentNode=this},e.prototype.isCollection=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.MANIFEST)},e.prototype.isRange=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.RANGE)},e}();t.TreeNode=i},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TreeNodeType=void 0,function(e){e.COLLECTION="collection",e.MANIFEST="manifest",e.RANGE="range"}(r||(t.TreeNodeType=r={}))}])},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},a=[],s=0;s<e.length;s++){var l=e[s],c=r.base?l[0]+r.base:l[0],u=o[c]||0,p="".concat(c," ").concat(u);o[c]=u+1;var f=n(p),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==f)t[f].references++,t[f].updater(d);else{var h=i(d,r);r.byIndex=s,t.splice(s,0,{identifier:p,updater:h,references:1})}a.push(p)}return a}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var s=n(o[a]);t[s].references--}for(var l=r(e,i),c=0;c<o.length;c++){var u=n(o[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}o=l}}},7659:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}}]);