@vivliostyle/viewer
Version:
Vivliostyle Viewer - HTML+CSS typesetting and rich paged viewing with EPUB/Web publications support
14 lines • 955 kB
JavaScript
/**
* @vivliostyle/viewer v2.42.1
* Vivliostyle Viewer - HTML+CSS typesetting and rich paged viewing with EPUB/Web publications support
*
* @author Vivliostyle Foundation
* @license AGPL-3.0
* @preserve
*/
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(i){if("default"!==i&&!(i in e)){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})}),Object.freeze(e)}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,n={exports:{}};
/*!
* Knockout JavaScript library v3.5.3
* (c) The Knockout.js team - http://knockoutjs.com/
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/var r,o,s=(i||(i=1,r=n,o=n.exports,function(e){var t=this||(0,eval)("this"),i=t.document,n=t.navigator,s=t.jQuery,a=t.JSON;s||"undefined"==typeof jQuery||(s=jQuery),function(e){e(r.exports||o)}(function(r,o){function l(e,t){return(null===e||typeof e in S)&&e===t}function h(t,i){var n;return function(){n||(n=x.a.setTimeout(function(){n=e,t()},i))}}function u(e,t){var i;return function(){clearTimeout(i),i=x.a.setTimeout(e,t)}}function c(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.ib(e,t):this.qc(e)}function d(e,t){null!==t&&t.s&&t.s()}function p(e,t){var i=this.qd,n=i[N];n.ta||(this.Rb&&this.ob[t]?(i.uc(t,e,this.ob[t]),this.ob[t]=null,--this.Rb):n.I[t]||i.uc(t,e,n.K?{da:e}:i.$c(e)),e.La&&e.gd())}var f,g,m,v,b,y,w,x=void 0!==r?r:{};if(x.b=function(e,t){for(var i=e.split("."),n=x,r=0;r<i.length-1;r++)n=n[i[r]];n[i[i.length-1]]=t},x.L=function(e,t,i){e[t]=i},x.version="3.5.3",x.b("version",x.version),x.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},"undefined"!=typeof trustedTypes)try{f=trustedTypes.createPolicy("knockout",{createHTML:function(e){return e},createScript:function(e){return e}})}catch(e){}x.a=function(){function r(e,t){for(var i in e)u.call(e,i)&&t(i,e[i])}function o(e,t){if(t)for(var i in t)u.call(t,i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function h(e,t,i,n){var r=e[t].match(y)||[];x.a.D(i.match(y),function(e){x.a.Pa(r,e,n)}),e[t]=r.join(" ")}var u=Object.prototype.hasOwnProperty,c={__proto__:[]}instanceof Array,d="function"==typeof Symbol,p={},g={};p[n&&/Firefox\/2/i.test(n.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],p.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),r(p,function(e,t){if(t.length)for(var i=0,n=t.length;i<n;i++)g[t[i]]=e});var m,v={propertychange:!0};f||(m=i&&function(){for(var t=3,n=i.createElement("div"),r=n.getElementsByTagName("i");n.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",r[0];);return 4<t?t:e}());var b,y=/\S+/g;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(e,t,i){for(var n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e)},A:"function"==typeof Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t)}:function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},Mb:function(t,i,n){for(var r=0,o=t.length;r<o;r++)if(i.call(n,t[r],r,t))return t[r];return e},Ra:function(e,t){var i=x.a.A(e,t);0<i?e.splice(i,1):0===i&&e.shift()},wc:function(e){var t=[];return e&&x.a.D(e,function(e){0>x.a.A(t,e)&&t.push(e)}),t},Nb:function(e,t,i){var n=[];if(e)for(var r=0,o=e.length;r<o;r++)n.push(t.call(i,e[r],r));return n},lb:function(e,t,i){var n=[];if(e)for(var r=0,o=e.length;r<o;r++)t.call(i,e[r],r)&&n.push(e[r]);return n},Ob:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,n=t.length;i<n;i++)e.push(t[i]);return e},Pa:function(e,t,i){var n=x.a.A(x.a.bc(e),t);0>n?i&&e.push(t):i||e.splice(n,1)},Ca:c,extend:o,setPrototypeOf:l,Bb:c?l:o,P:r,Ia:function(e,t,i){if(!e)return e;var n,r={};for(n in e)u.call(e,n)&&(r[n]=t.call(i,e[n],n,e));return r},Ub:function(e){for(;e.firstChild;)x.removeNode(e.firstChild)},Zb:function(e){for(var t=((e=x.a.la(e))[0]&&e[0].ownerDocument||i).createElement("div"),n=0,r=e.length;n<r;n++)t.appendChild(x.pa(e[n]));return t},Da:function(e,t){for(var i=0,n=e.length,r=[];i<n;i++){var o=e[i].cloneNode(!0);r.push(t?x.pa(o):o)}return r},xa:function(e,t){if(x.a.Ub(e),t)for(var i=0,n=t.length;i<n;i++)e.appendChild(t[i])},Xc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var n=i[0],r=n.parentNode,o=0,s=t.length;o<s;o++)r.insertBefore(t[o],n);for(o=0,s=i.length;o<s;o++)x.removeNode(i[o])}},Wa:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],n=e[e.length-1];for(e.length=0;i!==n;)e.push(i),i=i.nextSibling;e.push(n)}}return e},Zc:function(e,t){7>m?e.setAttribute("selected",t):e.selected=t},Eb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},vd:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(1!==e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return!(16&~t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},Tb:function(e){return x.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!x.a.Mb(e,x.a.Tb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return x.onError?function(){try{return e.apply(this,arguments)}catch(e){throw x.onError&&x.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(x.a.Ac(e),t)},Gc:function(e){setTimeout(function(){throw x.onError&&x.onError(e),e},0)},B:function(e,t,i){var n=x.a.Ac(i);if(i=v[t],x.options.useOnlyNativeEvents||i||!s)if(i||"function"!=typeof e.addEventListener){if(void 0!==e.attachEvent){var r=function(t){n.call(e,t)},o="on"+t;e.attachEvent(o,r),x.a.J.oa(e,function(){e.detachEvent(o,r)})}}else e.addEventListener(t,n,!1),x.a.J.oa(e,function(){e.removeEventListener(t,n)});else b||(b="function"==typeof s(e).on?"on":"bind"),s(e)[b](t,n)},Gb:function(e,n){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var r;if(r=!("input"!==x.a.R(e)||!e.type||"click"!=n.toLowerCase()||"checkbox"!=(r=e.type)&&"radio"!=r),x.options.useOnlyNativeEvents||!s||r)if("function"==typeof i.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");(r=i.createEvent(g[n]||"HTMLEvents")).initEvent(n,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(r)}else if(r&&e.click)e.click();else{if(void 0===e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+n)}else s(e).trigger(n)},f:function(e){return x.O(e)?e():e},bc:function(e){return x.O(e)?e.v():e},Fb:function(e,t,i){var n;t&&("object"==typeof e.classList?(n=e.classList[i?"add":"remove"],x.a.D(t.match(y),function(t){n.call(e.classList,t)})):"string"==typeof e.className.baseVal?h(e.className,"baseVal",t,i):h(e,"className",t,i))},Cb:function(t,i){var n=x.a.f(i);null!==n&&n!==e||(n="");var r=x.h.firstChild(t);!r||3!=r.nodeType||x.h.nextSibling(r)?x.h.xa(t,[t.ownerDocument.createTextNode(n)]):r.data=n,x.a.Ad(t)},Yc:function(e,t){if(e.name=t,7>=m)try{var n=e.name.replace(/[&<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"});e.mergeAttributes(i.createElement("<input name='"+n+"'/>"),!1)}catch(e){}},Ad:function(e){9<=m&&(e=1==e.nodeType?e:e.parentNode).style&&(e.style.zoom=e.style.zoom)},wd:function(e){if(m){var t=e.style.width;e.style.width=0,e.style.width=t}},Pd:function(e,t){e=x.a.f(e),t=x.a.f(t);for(var i=[],n=e;n<=t;n++)i.push(n);return i},la:function(e){for(var t=[],i=0,n=e.length;i<n;i++)t.push(e[i]);return t},Ea:function(e){return d?Symbol(e):e},Zd:6===m,$d:7===m,W:m,Lc:function(e,t){for(var i=x.a.la(e.getElementsByTagName("input")).concat(x.a.la(e.getElementsByTagName("textarea"))),n="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},r=[],o=i.length-1;0<=o;o--)n(i[o])&&r.push(i[o]);return r},Nd:function(e){return"string"==typeof e&&(e=x.a.Eb(e))?a&&a.parse?a.parse(e):new Function("return "+e)():null},hc:function(e,t,i){if(!a||!a.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return a.stringify(x.a.f(e),t,i)},Od:function(e,t,n){var o=(n=n||{}).params||{},s=n.includeFields||this.Jc,a=e;if("object"==typeof e&&"form"===x.a.R(e)){a=e.action;for(var l=s.length-1;0<=l;l--)for(var h=x.a.Lc(e,s[l]),u=h.length-1;0<=u;u--)o[h[u].name]=h[u].value}t=x.a.f(t);var c=i.createElement("form");for(var d in c.style.display="none",c.action=a,c.method="post",t)(e=i.createElement("input")).type="hidden",e.name=d,e.value=x.a.hc(x.a.f(t[d])),c.appendChild(e);r(o,function(e,t){var n=i.createElement("input");n.type="hidden",n.name=e,n.value=t,c.appendChild(n)}),i.body.appendChild(c),n.submitter?n.submitter(c):c.submit(),setTimeout(function(){c.parentNode.removeChild(c)},0)}}}(),x.b("utils",x.a),x.b("utils.arrayForEach",x.a.D),x.b("utils.arrayFirst",x.a.Mb),x.b("utils.arrayFilter",x.a.lb),x.b("utils.arrayGetDistinctValues",x.a.wc),x.b("utils.arrayIndexOf",x.a.A),x.b("utils.arrayMap",x.a.Nb),x.b("utils.arrayPushAll",x.a.Ob),x.b("utils.arrayRemoveItem",x.a.Ra),x.b("utils.cloneNodes",x.a.Da),x.b("utils.createSymbolOrString",x.a.Ea),x.b("utils.extend",x.a.extend),x.b("utils.fieldsIncludedWithJsonPost",x.a.Jc),x.b("utils.getFormFields",x.a.Lc),x.b("utils.objectMap",x.a.Ia),x.b("utils.peekObservable",x.a.bc),x.b("utils.postJson",x.a.Od),x.b("utils.parseJson",x.a.Nd),x.b("utils.registerEventHandler",x.a.B),x.b("utils.stringifyJson",x.a.hc),x.b("utils.range",x.a.Pd),x.b("utils.toggleDomNodeCssClass",x.a.Fb),x.b("utils.triggerEvent",x.a.Gb),x.b("utils.unwrapObservable",x.a.f),x.b("utils.objectForEach",x.a.P),x.b("utils.addOrRemoveItem",x.a.Pa),x.b("utils.setTextContent",x.a.Cb),x.b("unwrap",x.a.f),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var n=i.slice(0);return n.push.apply(n,arguments),t.apply(e,n)}}),x.a.g=new function(){var t,i,n=0,r="__ko__"+(new Date).getTime(),o={};return x.a.W?(t=function(t,i){var s=t[r];if(!s||"null"===s||!o[s]){if(!i)return e;s=t[r]="ko"+n++,o[s]={}}return o[s]},i=function(e){var t=e[r];return!!t&&(delete o[t],e[r]=null,!0)}):(t=function(e,t){var i=e[r];return!i&&t&&(i=e[r]={}),i},i=function(e){return!!e[r]&&(delete e[r],!0)}),{get:function(e,i){var n=t(e,!1);return n&&n[i]},set:function(i,n,r){(i=t(i,r!==e))&&(i[n]=r)},Vb:function(e,i,n){return(e=t(e,!0))[i]||(e[i]=n)},clear:i,Z:function(){return n+++r}}},x.b("utils.domData",x.a.g),x.b("utils.domData.clear",x.a.g.clear),x.a.J=new function(){function t(t,i){var n=x.a.g.get(t,r);return n===e&&i&&(n=[],x.a.g.set(t,r,n)),n}function i(e){if(i=t(e,!1))for(var i=i.slice(0),r=0;r<i.length;r++)i[r](e);x.a.g.clear(e),x.a.J.cleanExternalData(e),a[e.nodeType]&&n(e.childNodes,!0)}function n(e,t){for(var n,r=[],o=0;o<e.length;o++)if((!t||8===e[o].nodeType)&&(i(r[r.length]=n=e[o]),e[o]!==n))for(;o--&&-1==x.a.A(r,e[o]););}var r=x.a.g.Z(),o={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},zb:function(i,n){var o=t(i,!1);o&&(x.a.Ra(o,n),0==o.length&&x.a.g.set(i,r,e))},pa:function(e){return x.u.G(function(){o[e.nodeType]&&(i(e),a[e.nodeType]&&n(e.getElementsByTagName("*")))}),e},removeNode:function(e){x.pa(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){s&&"function"==typeof s.cleanData&&s.cleanData([e])}}},x.pa=x.a.J.pa,x.removeNode=x.a.J.removeNode,x.b("cleanNode",x.pa),x.b("removeNode",x.removeNode),x.b("utils.domNodeDisposal",x.a.J),x.b("utils.domNodeDisposal.addDisposeCallback",x.a.J.oa),x.b("utils.domNodeDisposal.removeDisposeCallback",x.a.J.zb),g=[0,"",""],y={thead:m=[1,"<table>","</table>"],tbody:m,tfoot:m,tr:[2,"<table><tbody>","</tbody></table>"],td:v=[3,"<table><tbody><tr>","</tr></tbody></table>"],th:v,option:b=[1,"<select multiple='multiple'>","</select>"],optgroup:b},w=8>=x.a.W,x.a.wa=function(e,n){var r;if(s){if(s.parseHTML)r=s.parseHTML(e,n)||[];else if((r=s.clean([e],n))&&r[0]){for(var o=r[0];o.parentNode&&11!==o.parentNode.nodeType;)o=o.parentNode;o.parentNode&&o.parentNode.removeChild(o)}}else{(r=n)||(r=i),o=r.parentWindow||r.defaultView||t;var a,l=x.a.Eb(e).toLowerCase(),h=r.createElement("div");for(a=(l=l.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&y[l[1]]||g,l=a[0],a="ignored<div>"+a[1]+e+a[2]+"</div>","function"==typeof o.innerShiv?h.appendChild(o.innerShiv(a)):(w&&r.body.appendChild(h),h.innerHTML=f?f.createHTML(a):a,w&&h.parentNode.removeChild(h));l--;)h=h.lastChild;r=x.a.la(h.lastChild.childNodes)}return r},x.a.Md=function(e,t){var i=x.a.wa(e,t);return i.length&&i[0].parentElement||x.a.Zb(i)},x.a.fc=function(t,i){if(x.a.Ub(t),null!==(i=x.a.f(i))&&i!==e){if("string"!=typeof i){if("undefined"!=typeof trustedTypes&&trustedTypes.isHTML(i))return void(t.innerHTML=i);i=i.toString()}if(s)s(t).html(i);else for(var n=x.a.wa(i,t.ownerDocument),r=0;r<n.length;r++)t.appendChild(n[r])}},x.b("utils.parseHtmlFragment",x.a.wa),x.b("utils.setHtml",x.a.fc),x.aa=function(){function t(e,i){if(e)if(8==e.nodeType)null!=(n=x.aa.Uc(e.nodeValue))&&i.push({ud:e,Kd:n});else if(1==e.nodeType)for(var n=0,r=e.childNodes,o=r.length;n<o;n++)t(r[n],i)}var i={};return{Yb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"\x3c!--[ko_memo:"+t+"]--\x3e"},bd:function(t,n){var r=i[t];if(r===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return r.apply(null,n||[]),!0}finally{delete i[t]}},cd:function(e,i){var n=[];t(e,n);for(var r=0,o=n.length;r<o;r++){var s=n[r].ud,a=[s];i&&x.a.Ob(a,i),x.aa.bd(n[r].Kd,a),s.nodeValue="",s.parentNode&&s.parentNode.removeChild(s)}},Uc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),x.b("memoization",x.aa),x.b("memoization.memoize",x.aa.Yb),x.b("memoization.unmemoize",x.aa.bd),x.b("memoization.parseMemoText",x.aa.Uc),x.b("memoization.unmemoizeDomNodeAndDescendants",x.aa.cd),x.na=function(){function e(){if(s)for(var e,t=s,i=0;l<s;)if(e=o[l++]){if(l>t){if(5e3<=++i){l=s,x.a.Gc(Error("'Too much recursion' after processing "+i+" task groups."));break}t=s}try{e()}catch(e){x.a.Gc(e)}}}function n(){e(),l=s=o.length=0}var r,o=[],s=0,a=1,l=0;return r=t.MutationObserver?function(e){var t=i.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(n):i&&"onreadystatechange"in i.createElement("script")?function(e){var t=i.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,i.documentElement.removeChild(t),t=null,e()},i.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},{scheduler:r,Ab:function(e){return s||x.na.scheduler(n),o[s++]=e,a++},cancel:function(e){(e-=a-s)>=l&&e<s&&(o[e]=null)},resetForTesting:function(){var e=s-l;return l=s=o.length=0,e},Sd:e}}(),x.b("tasks",x.na),x.b("tasks.schedule",x.na.Ab),x.b("tasks.runEarly",x.na.Sd),x.Va={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return x.$({read:e,write:function(n){clearTimeout(i),i=x.a.setTimeout(function(){e(n)},t)}})},rateLimit:function(e,t){var i,n,r;"number"==typeof t?i=t:(i=t.timeout,n=t.method),e.Ib=!1,r="function"==typeof n?n:"notifyWhenChangesStop"==n?u:h,e.ub(function(e){return r(e,i,t)})},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.Ib||(t.Ib=!0,t.ub(function(i){var n,r=!1;return function(){if(!r){x.na.cancel(n),n=x.na.Ab(i);try{r=!0,t.notifySubscribers(e,"dirty")}finally{r=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var S={undefined:1,boolean:1,number:1,string:1};x.b("extenders",x.Va),x.ic=function(e,t,i){this.da=e,this.lc=t,this.mc=i,this.Jb=!1,this.hb=this.Kb=null,x.L(this,"dispose",this.s),x.L(this,"disposeWhenNodeIsRemoved",this.l)},x.ic.prototype.s=function(){this.Jb||(this.hb&&x.a.J.zb(this.Kb,this.hb),this.Jb=!0,this.mc(),this.da=this.lc=this.mc=this.Kb=this.hb=null)},x.ic.prototype.l=function(e){this.Kb=e,x.a.J.oa(e,this.hb=this.s.bind(this))},x.T=function(){x.a.Bb(this,C),C.rb(this)};var C={rb:function(e){e.U={change:[]},e.sc=1},subscribe:function(e,t,i){var n=this;i=i||"change";var r=new x.ic(n,t?e.bind(t):e,function(){x.a.Ra(n.U[i],r),n.jb&&n.jb(i)});return n.Sa&&n.Sa(i),n.U[i]||(n.U[i]=[]),n.U[i].push(r),r},notifySubscribers:function(e,t){if("change"===(t=t||"change")&&this.Hb(),this.Ya(t)){var i="change"===t&&this.ed||this.U[t].slice(0);try{x.u.xc();for(var n,r=0;n=i[r];++r)n.Jb||n.lc(e)}finally{x.u.end()}}},qb:function(){return this.sc},Dd:function(e){return this.qb()!==e},Hb:function(){++this.sc},ub:function(e){var t,i,n,r,o,s=this,a=x.O(s);s.ib||(s.ib=s.notifySubscribers,s.notifySubscribers=c);var l=e(function(){s.La=!1,a&&r===s&&(r=s.nc?s.nc():s());var e=i||o&&s.sb(n,r);o=i=t=!1,e&&s.ib(n=r)});s.qc=function(e,i){i&&s.La||(o=!i),s.ed=s.U.change.slice(0),s.La=t=!0,r=e,l()},s.pc=function(e){t||(n=e,s.ib(e,"beforeChange"))},s.rc=function(){o=!0},s.gd=function(){s.sb(n,s.v(!0))&&(i=!0)}},Ya:function(e){return this.U[e]&&this.U[e].length},Bd:function(e){if(e)return this.U[e]&&this.U[e].length||0;var t=0;return x.a.P(this.U,function(e,i){"dirty"!==e&&(t+=i.length)}),t},sb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var t=this;return e&&x.a.P(e,function(e,i){var n=x.Va[e];"function"==typeof n&&(t=n(t,i)||t)}),t}};x.L(C,"init",C.rb),x.L(C,"subscribe",C.subscribe),x.L(C,"extend",C.extend),x.L(C,"getSubscriptionsCount",C.Bd),x.a.Ca&&x.a.setPrototypeOf(C,Function.prototype),x.T.fn=C,x.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},x.b("subscribable",x.T),x.b("isSubscribable",x.Qc),x.S=x.u=function(){function e(e){n.push(i),i=e}function t(){i=n.pop()}var i,n=[],r=0;return{xc:e,end:t,cc:function(e){if(i){if(!x.Qc(e))throw Error("Only subscribable things can act as dependencies");i.od.call(i.pd,e,e.fd||(e.fd=++r))}},G:function(i,n,r){try{return e(),i.apply(n,r||[])}finally{t()}},ra:function(){if(i)return i.o.ra()},Xa:function(){if(i)return i.o.Xa()},$a:function(){if(i)return i.$a},o:function(){if(i)return i.o}}}(),x.b("computedContext",x.S),x.b("computedContext.getDependenciesCount",x.S.ra),x.b("computedContext.getDependencies",x.S.Xa),x.b("computedContext.isInitial",x.S.$a),x.b("computedContext.registerDependency",x.S.cc),x.b("ignoreDependencies",x.Yd=x.u.G);var k=x.a.Ea("_latestValue");x.va=function(e){function t(){return 0<arguments.length?(t.sb(t[k],arguments[0])&&(t.Aa(),t[k]=arguments[0],t.za()),this):(x.u.cc(t),t[k])}return t[k]=e,x.a.Ca||x.a.extend(t,x.T.fn),x.T.fn.rb(t),x.a.Bb(t,P),x.options.deferUpdates&&x.Va.deferred(t,!0),t};var P={equalityComparer:l,v:function(){return this[k]},za:function(){this.notifySubscribers(this[k],"spectate"),this.notifySubscribers(this[k])},Aa:function(){this.notifySubscribers(this[k],"beforeChange")}};x.a.Ca&&x.a.setPrototypeOf(P,x.T.fn);var E=x.va.Oa="__ko_proto__";P[E]=x.va,x.O=function(e){if((e="function"==typeof e&&e[E])&&e!==P[E]&&e!==x.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},x.ab=function(e){return"function"==typeof e&&(e[E]===P[E]||e[E]===x.o.fn[E]&&e.Nc)},x.b("observable",x.va),x.b("isObservable",x.O),x.b("isWriteableObservable",x.ab),x.b("isWritableObservable",x.ab),x.b("observable.fn",P),x.L(P,"peek",P.v),x.L(P,"valueHasMutated",P.za),x.L(P,"valueWillMutate",P.Aa),x.Ja=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=x.va(e),x.a.Bb(e,x.Ja.fn),e.extend({trackArrayChanges:!0})},x.Ja.fn={remove:function(e){for(var t=this.v(),i=[],n="function"!=typeof e||x.O(e)?function(t){return t===e}:e,r=0;r<t.length;r++){var o=t[r];if(n(o)){if(0===i.length&&this.Aa(),t[r]!==o)throw Error("Array modified during remove; cannot remove item");i.push(o),t.splice(r,1),r--}}return i.length&&this.za(),i},removeAll:function(t){if(t===e){var i=this.v(),n=i.slice(0);return this.Aa(),i.splice(0,i.length),this.za(),n}return t?this.remove(function(e){return 0<=x.a.A(t,e)}):[]},destroy:function(e){var t=this.v(),i="function"!=typeof e||x.O(e)?function(t){return t===e}:e;this.Aa();for(var n=t.length-1;0<=n;n--){var r=t[n];i(r)&&(r._destroy=!0)}this.za()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=x.a.A(t,e)}):[]},indexOf:function(e){var t=this();return x.a.A(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.Aa(),this.v()[i]=t,this.za())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},x.a.Ca&&x.a.setPrototypeOf(x.Ja.fn,x.va.fn),x.a.D("pop push reverse shift sort splice unshift".split(" "),function(e){x.Ja.fn[e]=function(){var t=this.v();this.Aa(),this.zc(t,e,arguments);var i=t[e].apply(t,arguments);return this.za(),i===t?this:i}}),x.a.D(["slice"],function(e){x.Ja.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),x.Pc=function(e){return x.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},x.b("observableArray",x.Ja),x.b("isObservableArray",x.Pc),x.Va.trackArrayChanges=function(t,i){function n(){function e(){if(h){var e,i=[].concat(t.v()||[]);t.Ya("arrayChange")&&((!l||1<h)&&(l=x.a.Qb(s,i,t.Pb)),e=l),s=i,l=null,h=0,e&&e.length&&t.notifySubscribers(e,"arrayChange")}}a?e():(a=!0,o=t.subscribe(function(){++h},null,"spectate"),s=[].concat(t.v()||[]),l=null,r=t.subscribe(e))}if(t.Pb={},i&&"object"==typeof i&&x.a.extend(t.Pb,i),t.Pb.sparse=!0,!t.zc){var r,o,s,a=!1,l=null,h=0,u=t.Sa,c=t.jb;t.Sa=function(e){u&&u.call(t,e),"arrayChange"===e&&n()},t.jb=function(i){c&&c.call(t,i),"arrayChange"!==i||t.Ya("arrayChange")||(r&&r.s(),o&&o.s(),o=r=null,a=!1,s=e)},t.zc=function(e,t,i){function n(e,t,i){return r[r.length]={status:e,value:t,index:i}}if(a&&!h){var r=[],o=e.length,s=i.length,u=0;switch(t){case"push":u=o;case"unshift":for(t=0;t<s;t++)n("added",i[t],u+t);break;case"pop":u=o-1;case"shift":o&&n("deleted",e[u],u);break;case"splice":t=Math.min(Math.max(0,0>i[0]?o+i[0]:i[0]),o),o=1===s?o:Math.min(t+(i[1]||0),o),s=t+s-2,u=Math.max(o,s);for(var c=[],d=[],p=2;t<u;++t,++p)t<o&&d.push(n("deleted",e[t],t)),t<s&&c.push(n("added",i[p],t));x.a.Kc(d,c);break;default:return}l=r}}}};var N=x.a.Ea("_state");x.o=x.$=function(t,i,n){function r(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(s.pb,arguments),this}return s.ta||x.u.cc(r),(s.ka||s.K&&r.Za())&&r.ha(),s.X}if("object"==typeof t?n=t:(n=n||{},t&&(n.read=t)),"function"!=typeof n.read)throw Error("Pass a function that returns the value of the ko.computed");var o=n.write,s={X:e,ua:!0,ka:!0,sa:!1,jc:!1,ta:!1,xb:!1,K:!1,Wc:n.read,pb:i||n.owner,l:n.disposeWhenNodeIsRemoved||n.l||null,Ua:n.disposeWhen||n.Ua,Sb:null,I:{},V:0,Ic:null};return r[N]=s,r.Nc="function"==typeof o,x.a.Ca||x.a.extend(r,x.T.fn),x.T.fn.rb(r),x.a.Bb(r,T),n.pure?(s.xb=!0,s.K=!0,x.a.extend(r,I)):n.deferEvaluation&&x.a.extend(r,A),x.options.deferUpdates&&x.Va.deferred(r,!0),s.l&&(s.jc=!0,s.l.nodeType||(s.l=null)),s.K||n.deferEvaluation||r.ha(),s.l&&r.ja()&&x.a.J.oa(s.l,s.Sb=function(){r.s()}),r};var T={equalityComparer:l,ra:function(){return this[N].V},Xa:function(){var e=[];return x.a.P(this[N].I,function(t,i){e[i.Ma]=i.da}),e},Wb:function(e){if(!this[N].V)return!1;var t=this.Xa();return-1!==x.a.A(t,e)||!!x.a.Mb(t,function(t){return t.Wb&&t.Wb(e)})},uc:function(e,t,i){if(this[N].xb&&t===this)throw Error("A 'pure' computed must not be called recursively");this[N].I[e]=i,i.Ma=this[N].V++,i.Na=t.qb()},Za:function(){var e=this[N];if(e.sa)return!1;e.sa=!0;try{var t,i,n=e.I;for(t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&(i=n[t],this.Ka&&i.da.La||i.da.Dd(i.Na)))return!0}finally{e.sa=!1}},Jd:function(){this.Ka&&!this[N].sa&&this.Ka(!1)},ja:function(){var e=this[N];return e.ka||0<e.V},Rd:function(){this.La?this[N].ka&&(this[N].ua=!0):this.Hc()},$c:function(e){if(e.Ib){var t=e.subscribe(this.Jd,this,"dirty"),i=e.subscribe(this.Rd,this);return{da:e,s:function(){t.s(),i.s()}}}return e.subscribe(this.Hc,this)},Hc:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[N].Ic),this[N].Ic=x.a.setTimeout(function(){e.ha(!0)},t)):e.Ka?e.Ka(!0):e.ha(!0)},ha:function(e){var t=this[N],i=t.Ua,n=!1;if(!t.sa&&!t.ta){if(t.l&&!x.a.Tb(t.l)||i&&i()){if(!t.jc)return void this.s()}else t.jc=!1;t.sa=!0;try{n=this.zd(e)}finally{t.sa=!1}return n}},zd:function(t){var i=this[N],n=!1,r=i.xb?e:!i.V;n={qd:this,ob:i.I,Rb:i.V},x.u.xc({pd:n,od:p,o:this,$a:r}),i.I={},i.V=0;var o=this.yd(i,n);return i.V?n=this.sb(i.X,o):(this.s(),n=!0),n&&(i.K?this.Hb():this.notifySubscribers(i.X,"beforeChange"),i.X=o,this.notifySubscribers(i.X,"spectate"),!i.K&&t&&this.notifySubscribers(i.X),this.rc&&this.rc()),r&&this.notifySubscribers(i.X,"awake"),n},yd:function(e,t){try{var i=e.Wc;return e.pb?i.call(e.pb):i()}finally{x.u.end(),t.Rb&&!e.K&&x.a.P(t.ob,d),e.ua=e.ka=!1}},v:function(e){var t=this[N];return(t.ka&&(e||!t.V)||t.K&&this.Za())&&this.ha(),t.X},ub:function(e){x.T.fn.ub.call(this,e),this.nc=function(){return this[N].K||(this[N].ua?this.ha():this[N].ka=!1),this[N].X},this.Ka=function(e){this.pc(this[N].X),this[N].ka=!0,e&&(this[N].ua=!0),this.qc(this,!e)}},s:function(){var t=this[N];!t.K&&t.I&&x.a.P(t.I,function(e,t){t.s&&t.s()}),t.l&&t.Sb&&x.a.J.zb(t.l,t.Sb),t.I=e,t.V=0,t.ta=!0,t.ua=!1,t.ka=!1,t.K=!1,t.l=e,t.Ua=e,t.Wc=e,this.Nc||(t.pb=e)}},I={Sa:function(e){var t=this,i=t[N];if(!i.ta&&i.K&&"change"==e){if(i.K=!1,i.ua||t.Za())i.I=null,i.V=0,t.ha()&&t.Hb();else{var n=[];x.a.P(i.I,function(e,t){n[t.Ma]=e}),x.a.D(n,function(e,n){var r=i.I[e],o=t.$c(r.da);o.Ma=n,o.Na=r.Na,i.I[e]=o}),t.Za()&&t.ha()&&t.Hb()}i.ta||t.notifySubscribers(i.X,"awake")}},jb:function(t){var i=this[N];i.ta||"change"!=t||this.Ya("change")||(x.a.P(i.I,function(e,t){t.s&&(i.I[e]={da:t.da,Ma:t.Ma,Na:t.Na},t.s())}),i.K=!0,this.notifySubscribers(e,"asleep"))},qb:function(){var e=this[N];return e.K&&(e.ua||this.Za())&&this.ha(),x.T.fn.qb.call(this)}},A={Sa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};x.a.Ca&&x.a.setPrototypeOf(T,x.T.fn);var F=x.va.Oa;T[F]=x.o,x.Oc=function(e){return"function"==typeof e&&e[F]===T[F]},x.Fd=function(e){return x.Oc(e)&&e[N]&&e[N].xb},x.b("computed",x.o),x.b("dependentObservable",x.o),x.b("isComputed",x.Oc),x.b("isPureComputed",x.Fd),x.b("computed.fn",T),x.L(T,"peek",T.v),x.L(T,"dispose",T.s),x.L(T,"isActive",T.ja),x.L(T,"getDependenciesCount",T.ra),x.L(T,"getDependencies",T.Xa),x.yb=function(e,t){return"function"==typeof e?x.o(e,t,{pure:!0}):((e=x.a.extend({},e)).pure=!0,x.o(e,t))},x.b("pureComputed",x.yb),function(){function t(n,r,o){if(o=o||new i,"object"!=typeof(n=r(n))||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return o.save(n,s),function(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}(n,function(i){var a=r(n[i]);switch(typeof a){case"boolean":case"number":case"string":case"bigint":case"symbol":case"function":s[i]=a;break;case"object":case"undefined":var l=o.get(a);s[i]=l!==e?l:t(a,r,o)}}),s}function i(){this.keys=[],this.values=[]}x.ad=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;x.O(e)&&10>t;t++)e=e();return e})},x.toJSON=function(e,t,i){return e=x.ad(e),x.a.hc(e,t,i)},i.prototype={constructor:i,save:function(e,t){var i=x.a.A(this.keys,e);0<=i?this.values[i]=t:(this.keys.push(e),this.values.push(t))},get:function(t){return 0<=(t=x.a.A(this.keys,t))?this.values[t]:e}}}(),x.b("toJS",x.ad),x.b("toJSON",x.toJSON),x.Wd=function(e,t,i){function n(t){var n=x.yb(e,i).extend({ma:"always"}),r=n.subscribe(function(e){e&&(r.s(),t(e))});return n.notifySubscribers(n.v()),r}return"function"!=typeof Promise||t?n(t.bind(i)):new Promise(n)},x.b("when",x.Wd),x.w={M:function(t){switch(x.a.R(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?x.a.g.get(t,x.c.options.$b):7>=x.a.W?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?x.w.M(t.options[t.selectedIndex]):e;default:return t.value}},fb:function(t,i,n){switch(x.a.R(t)){case"option":"string"==typeof i?(x.a.g.set(t,x.c.options.$b,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i):(x.a.g.set(t,x.c.options.$b,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:"");break;case"select":""!==i&&null!==i||(i=e);for(var r,o=-1,s=0,a=t.options.length;s<a;++s)if((r=x.w.M(t.options[s]))==i||""===r&&i===e){o=s;break}(n||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o,6===x.a.W&&x.a.setTimeout(function(){t.selectedIndex=o},0));break;default:null!==i&&i!==e||(i=""),t.value=i}}},x.b("selectExtensions",x.w),x.b("selectExtensions.readValue",x.w.M),x.b("selectExtensions.writeValue",x.w.fb),x.m=function(){function e(e){123===(e=x.a.Eb(e)).charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],s=(e+="\n,").match(n),a=[],l=0;if(1<s.length){for(var h,u=0;h=s[u];++u){var c=h.charCodeAt(0);if(44===c){if(0>=l){i.push(t&&a.length?{key:t,value:a.join("")}:{unknown:t||a.join("")}),t=l=0,a=[];continue}}else if(58===c){if(!l&&!t&&1===a.length){t=a.pop();continue}}else{if(47===c&&1<h.length&&(47===h.charCodeAt(1)||42===h.charCodeAt(1)))continue;47===c&&u&&1<h.length?(c=s[u-1].match(r))&&!o[c[0]]&&(s=(e=e.substr(e.indexOf(h)+1)).match(n),u=-1,h="/"):40===c||123===c||91===c?++l:41===c||125===c||93===c?--l:t||a.length||34!==c&&39!==c||(h=h.slice(1,-1))}a.push(h)}if(0<l)throw Error("Unbalanced parentheses, braces, or brackets")}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,n=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),r=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},s={};return{Ta:[],ya:s,ac:e,wb:function(n,r){function o(e,n){var r;if(!u){var c=x.getBindingHandler(e);if(c&&c.preprocess&&!(n=c.preprocess(n,e,o)))return;(c=s[e])&&(r=n,0<=x.a.A(t,r)?r=!1:(c=r.match(i),r=null!==c&&(c[1]?"Object("+c[1]+")"+c[2]:r)),c=r),c&&l.push("'"+("string"==typeof s[e]?s[e]:e)+"':function(_z){"+r+"=_z}")}h&&(n="function(){return "+n+" }"),a.push("'"+e+"':"+n)}var a=[],l=[],h=(r=r||{}).valueAccessors,u=r.bindingParams,c="string"==typeof n?e(n):n;return x.a.D(c,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),a.join(",")},Id:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},gb:function(e,t,i,n,r){e&&x.O(e)?!x.ab(e)||r&&e.v()===n||e(n):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](n)}}}(),x.b("expressionRewriting",x.m),x.b("expressionRewriting.bindingRewriteValidators",x.m.Ta),x.b("expressionRewriting.parseObjectLiteral",x.m.ac),x.b("expressionRewriting.preProcessBindings",x.m.wb),x.b("expressionRewriting._twoWayBindings",x.m.ya),x.b("jsonExpressionRewriting",x.m),x.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",x.m.wb),function(){function e(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function n(i,n){for(var r=i,o=1,s=[];r=r.nextSibling;){if(t(r)&&(x.a.g.set(r,h,!0),0===--o))return s;s.push(r),e(r)&&o++}if(!n)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function r(e,t){var i=n(e,t);return i?0<i.length?i[i.length-1].nextSibling:e.nextSibling:null}var o=i&&"\x3c!--test--\x3e"===i.createComment("test").text,s=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,a=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},h="__ko_matchedEndComment__";x.h={ea:{},childNodes:function(t){return e(t)?n(t):t.childNodes},Fa:function(t){if(e(t))for(var i=0,n=(t=x.h.childNodes(t)).length;i<n;i++)x.removeNode(t[i]);else x.a.Ub(t)},xa:function(t,i){if(e(t)){x.h.Fa(t);for(var n=t.nextSibling,r=0,o=i.length;r<o;r++)n.parentNode.insertBefore(i[r],n)}else x.a.xa(t,i)},Vc:function(t,i){var n;e(t)?(n=t.nextSibling,t=t.parentNode):n=t.firstChild,n?i!==n&&t.insertBefore(i,n):t.appendChild(i)},Xb:function(t,i,n){n?(n=n.nextSibling,e(t)&&(t=t.parentNode),n?i!==n&&t.insertBefore(i,n):t.appendChild(i)):x.h.Vc(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild&&t(i.firstChild)?i.firstChild.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=r(i)),i.nextSibling&&t(i.nextSibling)?(t(i=i.nextSibling)&&x.a.g.get(i,h),null):i.nextSibling},Cd:e,Vd:function(e){return(e=(o?e.text:e.nodeValue).match(s))?e[1]:null},Sc:function(i){if(l[x.a.R(i)]){var n=i.firstChild;if(n)do{if(1===n.nodeType){var o,s=null;if(o=n.firstChild)do{if(s)s.push(o);else if(e(o)){var a=r(o,!0);a?o=a:s=[o]}else t(o)&&(s=[o])}while(o=o.nextSibling);if(o=s)for(s=n.nextSibling,a=0;a<o.length;a++)s?i.insertBefore(o[a],s):i.appendChild(o[a])}}while(n=n.nextSibling)}}}}(),x.b("virtualElements",x.h),x.b("virtualElements.allowedBindings",x.h.ea),x.b("virtualElements.emptyNode",x.h.Fa),x.b("virtualElements.insertAfter",x.h.Xb),x.b("virtualElements.prepend",x.h.Vc),x.b("virtualElements.setDomNodeChildren",x.h.xa),function(){function e(e,t){var i="with($context){with($data||{}){return{"+x.m.wb(e,t)+"}}}";return f?(0,eval)(f.createScript("(function($context,$element){"+i+"})")):new Function("$context","$element",i)}x.ga=function(){this.nd={}},x.a.extend(x.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||x.j.getComponentNameForNode(e);case 8:return x.h.Cd(e);default:return!1}},getBindings:function(e,t){var i=(i=this.getBindingsString(e,t))?this.parseBindingsString(i,t,e):null;return x.j.tc(i,e,t,!1)},getBindingAccessors:function(e,t){var i=(i=this.getBindingsString(e,t))?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return x.j.tc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return x.h.Vd(e);default:return null}},parseBindingsString:function(t,i,n,r){try{var o=this.nd,s=t+(r&&r.valueAccessors||"");return(o[s]||(o[s]=e(t,r)))(i,n)}catch(e){throw e.message="Unable to parse bindings.\nBindings value: "+t+"\nMessage: "+e.message,e}}}),x.ga.instance=new x.ga}(),x.b("bindingProvider",x.ga),function(){function n(e){var t=(e=x.a.g.get(e,w))&&e.N;t&&(e.N=null,t.Tc())}function r(e,t,i){this.node=e,this.yc=t,this.mb=[],this.H=!1,t.N||x.a.J.oa(e,n),i&&i.N&&(i.N.mb.push(e),this.Lb=i)}function o(e){return function(){return e}}function a(e){return e()}function l(e){return x.a.Ia(x.u.G(e),function(t,i){return function(){return e()[i]}})}function h(e,t,i){return"function"==typeof e?l(e.bind(null,t,i)):x.a.Ia(e,o)}function u(e,t){return l(this.getBindings.bind(this,e,t))}function c(e,t){var i=x.h.firstChild(t);if(i){var n,r=x.ga.instance,o=r.preprocessNode;if(o){for(;n=i;)i=x.h.nextSibling(n),o.call(r,n);i=x.h.firstChild(t)}for(;n=i;)i=x.h.nextSibling(n),d(e,n)}x.i.ma(t,x.i.H)}function d(e,t){var i=e,n=1===t.nodeType;n&&x.h.Sc(t),(n||x.ga.instance.nodeHasBindings(t))&&(i=p(t,null,e).bindingContextForDescendants),i&&!b[x.a.R(t)]&&c(i,t)}function p(t,i,n){var r,o=x.a.g.Vb(t,w,{}),s=o.hd;if(!i){if(s)throw Error("You cannot apply bindings multiple times to the same element.");o.hd=!0}if(s||(o.context=n),o.vb||(o.vb={}),i&&"function"!=typeof i)r=i;else{var l=x.ga.instance,h=l.getBindingAccessors||u,c=x.$(function(){return(r=i?i(n,t):h.call(l,t,n))&&(n[g]&&n[g](),n[v]&&n[v]()),r},null,{l:t});r&&c.ja()||(c=null)}var d,p=n;if(r){var f=c?function(e){return function(){return a(c()[e])}}:function(e){return r[e]},m=function(){return x.a.Ia(c?c():r,a)};m.get=function(e){return r[e]&&a(f(e))},m.has=function(e){return e in r},x.i.H in r&&x.i.subscribe(t,x.i.H,function(){var e=(0,r[x.i.H])();if(e){var i=x.h.childNodes(t);i.length&&e(i,x.Ec(i[0]))}}),x.i.qa in r&&(p=x.i.Db(t,n),x.i.subscribe(t,x.i.qa,function(){var e=(0,r[x.i.qa])();e&&x.h.firstChild(t)&&e(t)})),o=function(e){var t=[],i={},n=[];return x.a.P(e,function r(o){if(!i[o]){var s=x.getBindingHandler(o);s&&(s.after&&(n.push(o),x.a.D(s.after,function(t){if(e[t]){if(-1!==x.a.A(n,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+n.join(", "));r(t)}}),n.length--),t.push({key:o,Mc:s})),i[o]=!0}}),t}(r),x.a.D(o,function(i){var n=i.Mc.init,o=i.Mc.update,s=i.key;if(8===t.nodeType&&!x.h.ea[s])throw Error("The binding '"+s+"' cannot be used with virtual elements");try{"function"==typeof n&&x.u.G(function(){var i=n(t,f(s),m,p.$data,p);if(i&&i.controlsDescendantBindings){if(d!==e)throw Error("Multiple bindings ("+d+" and "+s+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");d=s}}),"function"==typeof o&&x.$(function(){o(t,f(s),m,p.$data,p)},null,{l:t})}catch(e){throw e.message='Unable to process binding "'+s+": "+r[s]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:o=d===e,bindingContextForDescendants:o&&p}}function f(t,i){return t&&t instanceof x.fa?t:new x.fa(t,e,e,i)}var g=x.a.Ea("_subscribable"),m=x.a.Ea("_ancestorBindingInfo"),v=x.a.Ea("_dataDependency");x.c={};var b={script:!0,textarea:!0,template:!0};x.getBindingHandler=function(e){return x.c[e]};var y={};x.fa=function(t,i,n,r,o){function s(){var e=c?u():u,t=x.a.f(e);return i?(x.a.extend(l,i),m in i&&(l[m]=i[m])):(l.$parents=[],l.$root=t,l.ko=x),l[g]=a,h?t=l.$data:(l.$rawData=e,l.$data=t),n&&(l[n]=t),r&&r(l,i,t),i&&i[g]&&!x.S.o().Wb(i[g])&&i[g](),d&&(l[v]=d),l.$data}var a,l=this,h=t===y,u=h?e:t,c="function"==typeof u&&!x.O(u),d=o&&o.dataDependency;o&&o.exportDependencies?s():((a=x.yb(s)).v(),a.ja()?a.equalityComparer=null:l[g]=e)},x.fa.prototype.createChildContext=function(e,t,i,n){if(!n&&t&&"object"==typeof t&&(t=(n=t).as,i=n.extend),t&&n&&n.noChildContext){var r="function"==typeof e&&!x.O(e);return new x.fa(y,this,null,function(n){i&&i(n),n[t]=r?e():e},n)}return new x.fa(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)},n)},x.fa.prototype.extend=function(e,t){return new x.fa(y,this,null,function(t){x.a.extend(t,"function"==typeof e?e(t):e)},t)};var w=x.a.g.Z();r.prototype.Tc=function(){this.Lb&&this.Lb.N&&this.Lb.N.sd(this.node)},r.prototype.sd=function(e){x.a.Ra(this.mb,e),!this.mb.length&&this.H&&this.Cc()},r.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.mb.length&&(this.yc.N=null,x.a.J.zb(this.node,n),x.i.ma(this.node,x.i.qa),this.Tc())},x.i={H:"childrenComplete",qa:"descendantsComplete",subscribe:function(e,t,i,n,r){var o=x.a.g.Vb(e,w,{});return o.Ga||(o.Ga=new x.T),r&&r.notifyImmediately&&o.vb&&o.vb[t]&&x.u.G(i,n,[e]),o.Ga.subscribe(i,n,t)},ma:function(t,i){var n=x.a.g.get(t,w);if(n&&(n.vb[i]=!0,n.Ga&&n.Ga.notifySubscribers(t,i),i==x.i.H))if(n.N)n.N.Cc();else if(n.N===e&&n.Ga&&n.Ga.Ya(x.i.qa))throw Error("descendantsComplete event not supported for bindings on this node")},Db:function(e,t){var i=x.a.g.Vb(e,w,{});return i.N||(i.N=new r(e,i,t[m])),t[m]==i?t:t.extend(function(e){e[m]=i})}},x.Td=function(e){return(e=x.a.g.get(e,w))&&e.context},x.kb=function(e,t,i){return 1===e.nodeType&&x.h.Sc(e),p(e,t,f(i))},x.ld=function(e,t,i){return i=f(i),x.kb(e,h(t,i,e),i)},x.Qa=function(e,t){1!==t.nodeType&&8!==t.nodeType||c(f(e),t)},x.vc=function(e,n,r){if(!s&&t.jQuery&&(s=t.jQuery),2>arguments.length){if(!(n=i.body))throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!n||1!==n.nodeType&&8!==n.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");d(f(e,r),n)},x.Dc=function(t){return!t||1!==t.nodeType&&8!==t.nodeType?e:x.Td(t)},x.Ec=function(t){return(t=x.Dc(t))?t.$data:e},x.b("bindingHandlers",x.c),x.b("bindingEvent",x.i),x.b("bindingEvent.subscribe",x.i.subscribe),x.b("bindingEvent.startPossiblyAsyncContentBinding",x.i.Db),x.b("applyBindings",x.vc),x.b("applyBindingsToDescendants",x.Qa),x.b("applyBindingAccessorsToNode",x.kb),x.b("applyBindingsToNode",x.ld),x.b("contextFor",x.Dc),x.b("dataFor",x.Ec)}(),function(e){function t(t,n){var s,a=Object.prototype.hasOwnProperty.call(r,t)?r[t]:e;a?a.subscribe(n):((a=r[t]=new x.T).subscribe(n),i(t,function(e,i){var n=!(!i||!i.synchronous);o[t]={definition:e,Gd:n},delete r[t],s||n?a.notifySubscribers(e):x.na.Ab(function(){a.notifySubscribers(e)})}),s=!0)}function i(e,t){n("getConfig",[e],function(i){i?n("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function n(t,i,r,o){o||(o=x.j.loaders.slice(0));var s=o.shift();if(s){var a=s[t];if(a){var l=!1;if(a.apply(s,i.concat(function(e){l?r(null):null!==e?r(e):n(t,i,r,o)}))!==e&&(l=!0,!s.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else n(t,i,r,o)}else r(null)}var r={},o={};x.j={get:function(i,n){var r=Object.prototype.hasOwnProperty.call(o,i)?o[i]:e;r?r.Gd?x.u.G(function(){n(r.definition)}):x.na.Ab(function(){n(r.definition)}):t(i,n)},Bc:function(e){delete o[e]},oc:n},x.j.loaders=[],x.b("components",x.j),x.b("components.get",x.j.get),x.b("components.clearCachedDefinition",x.j.Bc)}(),function(){function e(e,t,i,n){function r(){0===--s&&n(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){x.j.oc("loadTemplate",[e,t],function(e){o.template=e,r()})}):r(),i?a(t,i,function(t){x.j.oc("loadViewModel",[e,t],function(e){o[u]=e,r()})}):r()}function n(e,t,i){if("function"==typeof t)i(function(e){return new t(e)});else if("function"==typeof t[u])i(t[u]);else if("instance"in t){var r=t.instance;i(function(){return r})}else"viewModel"in t?n(e,t.viewModel,i):e("Unknown viewModel value: "+t)}function r(e){switch(x.a.R(e)){case"script":return x.a.wa(e.text);case"textarea":return x.a.wa(e.value);case"template":if(s(e.content))return x.a.Da(e.content.childNodes)}return x.a.Da(e.childNodes)}function s(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,n){"string"==typeof i.require?o||t.require?(o||t.require)([i.require],function(e){e&&"object"==typeof e&&e.Xd&&e.default&&(e=e.default),n(e)}):e("Uses require, but no AMD loader is present"):n(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var h={};x.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(x.j.tb(e))throw Error("Component "+e+" is already registered");h[e]=t},x.j.tb=function(e){return Object.prototype.hasOwnProperty.call(h,e)},x.j.unregister=function(e){delete h[e],x.j.Bc(e)},x.j.Fc={getConfig:function(e,t){t(x.j.tb(e)?h[e]:null)},loadComponent:function(t,i,n){var r=l(t);a(r,i,function(i){e(t,r,i,n)})},loadTemplate:function(e,n,o){if(e=l(e),"string"==typeof n)o(x.a.wa(n));else if(n instanceof Array)o(n);else if(s(n))o(x.a.la(n.childNodes));else if(n.element)if(n=n.element,t.HTMLElement?n instanceof HTMLElement:n&&n.tagName&&1===n.nodeType)o(r(n));else if("string"==typeof n){var a=i.getElementById(n);a?o(r(a)):e("Cannot find element with ID "+n)}else e("Unknown element type: "+n);else e("Unknown template value: "+n)},loadViewModel:function(e,t,i){n(l(e),t,i)}};var u="createViewModel";x.b("components.register",x.j.register),x.b("components.isRegistered",x.j.tb),x.b("components.unregister",x.j.unregister),x.b("components.defaultLoader",x.j.Fc),x.j.loaders.push(x.j.Fc),x.j.dd=h}(),function(){function e(e,i){if(n=e.getAttribute("params")){var n=t.parseBindingsString(n,i,e,{valueAccessors:!0,bindingParams:!0}),r=(n=x.a.Ia(n,function(t){return x.o(t,null,{l:e})}),x.a.Ia(n,function(t){var i=t.v();return t.ja()?x.o({read:function(){return x.a.f(t())},write:x.ab(i)&&function(e){t()(e)},l:e}):i}));return Object.prototype.hasOwnProperty.call(r,"$raw")||(r.$raw=n),r}return{$raw:{}}}x.j.getComponentNameForNode=function(e){var t=x.a.R(e);if(x.j.tb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=x.a.W&&e.tagName===t))return t},x.j.tc=function(t,i,n,r){if(1===i.nodeType){var o=x.j.getComponentNameForNode(i);if(o){if((t=t||{}).component)throw Error('Cannot use the "component" binding on a custom element matching a component');var s={name:o,params:e(i,n)};t.component=r?function(){return s}:s}}return t};var t=new x.ga;9>x.a.W&&(x.j.register=function(e){return function(t){return e.apply(this,arguments)}}(x.j.register),i.createDocumentFragment=function(e){return function(){var t=e();return x.j.dd,t}}(i.createDocumentFragment))}(),function(){var e=0;x.c.component={init:function(t,i,n,r,o){function s(){var e=a&&a.dispose;"function"==typeof e&&e.call(a),h&&h.s(),l=a=h=null}var a,l,h,u=x.a.la(x.h.childNodes(t));return x.h.Fa(t),x.a.J.oa(t,s),x.o(function(){var n,r,c=x.a.f(i());if("string"==typeof c?n=c:(n=x.a.f(c.name),r=x.a.f(c.params)),!n)throw Error("No component name specified");var d=x.i.Db(t,o),p=l=++e;x.j.get(n,function(e){if(l===p){if(s(),!e)throw Error("Unknown component '"+n+"'");!function(e,t,i){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=x.a.Da(t),x.h.xa(i,e)}(n,e,t);var i=function(e,t,i){var n=e.createViewModel;return n?n.call(e,t,i):t}(e,r,{element:t,templateNodes:u});e=d.createChildContext(i,{extend:function(e){e.$component=i,e.$componentTemplateNodes=u}}),i&&i.koDescendantsComplete&&(h=x.i.subscribe(t,x.i.qa,i.koDescendantsComplete,i)),a=i,x.Qa(e,t)}})},null,{l:t}),{controlsDescendantBindings:!0}}},x.h.ea.component=!0}();var R={class:"className",for:"htmlFor"};x.c.attr={update:function(t,i){var n=x.a.f(i())||{};x.a.P(n,function(i,n){n=x.a.f(n);var r=i.indexOf(":"),o=(r="lookupNamespaceURI"in t&&0<r&&t.lookupNamespaceURI(i.substr(0,r)),!1===n||null===n||n===e);o?r?t.removeAttributeNS(r,i):t.removeAttribute(i):n=n.toString(),8>=x.a.W&&i in R?(i=R[i],o?t.removeAttribute(i):t[i]=n):o||(r?t.setAttributeNS(r,i,n):t.setAttribute(i,n)),"name"===i&&x.a.Yc(t,o?"":n)})}},x.c.checked={after:["value","attr"],init:function(t,i,n){function r(){var r=t.checked,l=o();if(!x.S.$a()&&(r||!a&&!x.S.ra())){var c=x.u.G(i);if(h){var p=u?c.v():c,f=d;d=l,f!==l?r&&(x.a.Pa(p,l,!0),x.a.Pa(p,f,!1)):x.a.Pa(p,l,r),u&&x.ab(c)&&c(p)}else s&&(l===e?l=r:r||(l=e)),x.m.gb(c,n,"checked",l,!0)}}var o=x.yb(function(){return n.has("checkedValue")?x.a.f(n.get("checkedValue")):c?n.has("value")?x.a.f(n.get("value")):t.value:void 0}),s="checkbox"==t.type,a="radio"==t.type;if(s||a){var l=i(),h=s&&x.a.f(l)instanceof Array,u=!(h&&l.push&&l.splice),c=a||h,d=h?o():e;a&&!t.name&&x.c.uniqueName.init(t,function(){return!0}),x.o(r,null,{l:t}),x.a.B(t,"click",r),x.o(function(){var n=x.a.f(i()),r=o();h?(t.checked=null!=n&&0<=x.a.A(n,r),d=r):t.checked=s&&r===e?!!n:o()===n},null,{l:t}),l=e}}},x.m.ya.checked=!0,x.c.checkedValue={update:function(e,t){e.value=x.a.f(t())}},x.c.class={update:function(e,t){var i=x.a.Eb(x.a.f(t()));x.a.Fb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,x.a.Fb(e,i,!0)}},x.c.css={update:function(e,t){var i=x.a.f(t());null!==i&&"object"==typeof i?x.a.P(i,function(t,i){i=x.a.f(i),x.a.Fb(e,t,i)}):x.c.class.update(e,t)}},x.c.enable={update:function(e,t){var i=x.a.f(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},x.c.disable={update:function(e,t){x.c.enable.update(e,function(){return!x.a.f(t())})}},x.c.event={init:function(e,t,i,n,r){var o=t()||{};x.a.P(o,function(o){"string"==typeof o&&x.a.B(e,o,function(e){var s,a=t()[o];if(a){try{var l=x.a.la(arguments);n=r.$data,l.unshift(n),s=a.apply(n,l)}finally{!0!==s&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},x.c.foreach={Rc:function(e){return function(){var t=e(),i=x.a.bc(t);return i&&"number"!=typeof i.length?(x.a.f(t),{foreach:i.data,as:i.as,noChildContext:i.noChildContext,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:x.ba.Oa}):{foreach:t,templateEngine:x.ba.Oa}}},init:function(e,t){return x.c.template.init(e,x.c.foreach.Rc(t))},update:function(e,t,i,n,r){return x.c.template.update(e,x.c.foreach.Rc(t),i,n,r)}},x.m.Ta.foreach=!1,x.h.ea.foreach=!0,x.c.hasfocus={init:function(e,t,i){function n(n){e.__ko_hasfocusUpdating=!0;var r=e.ownerDocument;if("activeElement"in r){var o;try{o=r.activeElement}catch(e){o=r.body}n=o===e}r=t(),x.m.gb(r,i,"hasfocus",n,!0),e.__ko_hasfocusLastValue=n,e.__ko_hasfocusUpdating=!1}var r=n.bind(null,!0),o=n.bind(null,!1);x.a.B(e,"focus",r),x.a.B(e,"focusin",r),x.a.B(e,"blur",o),x.a.B(e,"focusout",o),e.__ko_hasfocusLastValue=!1},update:function(e,t){var i=!!x.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),x.u.G(x.a.Gb,null,[e,i?"focusin":"focusout