UNPKG

@vivliostyle/viewer

Version:

Vivliostyle Viewer - HTML+CSS typesetting and rich paged viewing with EPUB/Web publications support

14 lines 825 kB
/** * @vivliostyle/viewer v2.34.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.1 * (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 x)&&e===t}function h(t,i){var n;return function(){n||(n=y.a.setTimeout((function(){n=e,t()}),i))}}function u(e,t){var i;return function(){clearTimeout(i),i=y.a.setTimeout(e,t)}}function c(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.gb(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[P];n.ra||(this.Qb&&this.mb[t]?(i.uc(t,e,this.mb[t]),this.mb[t]=null,--this.Qb):n.I[t]||i.uc(t,e,n.J?{da:e}:i.$c(e)),e.Ja&&e.gd())}var f,g,m,b,v,w,y=void 0!==r?r:{};y.b=function(e,t){for(var i=e.split("."),n=y,r=0;r<i.length-1;r++)n=n[i[r]];n[i[i.length-1]]=t},y.L=function(e,t,i){e[t]=i},y.version="3.5.1",y.b("version",y.version),y.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},y.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(v)||[];y.a.D(i.match(v),(function(e){y.a.Na(r,e,n)})),e[t]=r.join(" ")}var u=Object.prototype.hasOwnProperty,c={__proto__:[]}instanceof Array,d="function"==typeof Symbol,p={},f={};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++)f[t[i]]=e}));var g,m={propertychange:!0},b=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}(),v=/\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},Lb: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},Pa:function(e,t){var i=y.a.A(e,t);0<i?e.splice(i,1):0===i&&e.shift()},wc:function(e){var t=[];return e&&y.a.D(e,(function(e){0>y.a.A(t,e)&&t.push(e)})),t},Mb: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},jb: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},Nb: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},Na:function(e,t,i){var n=y.a.A(y.a.bc(e),t);0>n?i&&e.push(t):i||e.splice(n,1)},Ba:c,extend:o,setPrototypeOf:l,Ab:c?l:o,P:r,Ga: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},Tb:function(e){for(;e.firstChild;)y.removeNode(e.firstChild)},Yb:function(e){for(var t=((e=y.a.la(e))[0]&&e[0].ownerDocument||i).createElement("div"),n=0,r=e.length;n<r;n++)t.appendChild(y.oa(e[n]));return t},Ca:function(e,t){for(var i=0,n=e.length,r=[];i<n;i++){var o=e[i].cloneNode(!0);r.push(t?y.oa(o):o)}return r},va:function(e,t){if(y.a.Tb(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++)y.removeNode(i[o])}},Ua: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>b?e.setAttribute("selected",t):e.selected=t},Db: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},Sb:function(e){return y.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!y.a.Lb(e,y.a.Sb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return y.onError?function(){try{return e.apply(this,arguments)}catch(e){throw y.onError&&y.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(y.a.Ac(e),t)},Gc:function(e){setTimeout((function(){throw y.onError&&y.onError(e),e}),0)},B:function(e,t,i){var n=y.a.Ac(i);if(i=m[t],y.options.useOnlyNativeEvents||i||!s)if(i||"function"!=typeof e.addEventListener){if(void 0===e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var r=function(t){n.call(e,t)},o="on"+t;e.attachEvent(o,r),y.a.K.za(e,(function(){e.detachEvent(o,r)}))}else e.addEventListener(t,n,!1);else g||(g="function"==typeof s(e).on?"on":"bind"),s(e)[g](t,n)},Fb:function(e,n){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var r;if(r=!("input"!==y.a.R(e)||!e.type||"click"!=n.toLowerCase()||"checkbox"!=(r=e.type)&&"radio"!=r),y.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(f[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 y.O(e)?e():e},bc:function(e){return y.O(e)?e.v():e},Eb:function(e,t,i){var n;t&&("object"==typeof e.classList?(n=e.classList[i?"add":"remove"],y.a.D(t.match(v),(function(t){n.call(e.classList,t)}))):"string"==typeof e.className.baseVal?h(e.className,"baseVal",t,i):h(e,"className",t,i))},Bb:function(t,i){var n=y.a.f(i);null!==n&&n!==e||(n="");var r=y.h.firstChild(t);!r||3!=r.nodeType||y.h.nextSibling(r)?y.h.va(t,[t.ownerDocument.createTextNode(n)]):r.data=n,y.a.Ad(t)},Yc:function(e,t){if(e.name=t,7>=b)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<=b&&(e=1==e.nodeType?e:e.parentNode).style&&(e.style.zoom=e.style.zoom)},wd:function(e){if(b){var t=e.style.width;e.style.width=0,e.style.width=t}},Pd:function(e,t){e=y.a.f(e),t=y.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},Da:function(e){return d?Symbol(e):e},Zd:6===b,$d:7===b,W:b,Lc:function(e,t){for(var i=y.a.la(e.getElementsByTagName("input")).concat(y.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=y.a.Db(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(y.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"===y.a.R(e)){a=e.action;for(var l=s.length-1;0<=l;l--)for(var h=y.a.Lc(e,s[l]),u=h.length-1;0<=u;u--)o[h[u].name]=h[u].value}t=y.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=y.a.hc(y.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)}}}(),y.b("utils",y.a),y.b("utils.arrayForEach",y.a.D),y.b("utils.arrayFirst",y.a.Lb),y.b("utils.arrayFilter",y.a.jb),y.b("utils.arrayGetDistinctValues",y.a.wc),y.b("utils.arrayIndexOf",y.a.A),y.b("utils.arrayMap",y.a.Mb),y.b("utils.arrayPushAll",y.a.Nb),y.b("utils.arrayRemoveItem",y.a.Pa),y.b("utils.cloneNodes",y.a.Ca),y.b("utils.createSymbolOrString",y.a.Da),y.b("utils.extend",y.a.extend),y.b("utils.fieldsIncludedWithJsonPost",y.a.Jc),y.b("utils.getFormFields",y.a.Lc),y.b("utils.objectMap",y.a.Ga),y.b("utils.peekObservable",y.a.bc),y.b("utils.postJson",y.a.Od),y.b("utils.parseJson",y.a.Nd),y.b("utils.registerEventHandler",y.a.B),y.b("utils.stringifyJson",y.a.hc),y.b("utils.range",y.a.Pd),y.b("utils.toggleDomNodeCssClass",y.a.Eb),y.b("utils.triggerEvent",y.a.Fb),y.b("utils.unwrapObservable",y.a.f),y.b("utils.objectForEach",y.a.P),y.b("utils.addOrRemoveItem",y.a.Na),y.b("utils.setTextContent",y.a.Bb),y.b("unwrap",y.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)}}),y.a.g=new function(){var t,i,n=0,r="__ko__"+(new Date).getTime(),o={};return y.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)},Ub:function(e,i,n){return(e=t(e,!0))[i]||(e[i]=n)},clear:i,Z:function(){return n+++r}}},y.b("utils.domData",y.a.g),y.b("utils.domData.clear",y.a.g.clear),y.a.K=new function(){function t(t,i){var n=y.a.g.get(t,r);return n===e&&i&&(n=[],y.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);y.a.g.clear(e),y.a.K.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==y.a.A(r,e[o]););}var r=y.a.g.Z(),o={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{za:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},yb:function(i,n){var o=t(i,!1);o&&(y.a.Pa(o,n),0==o.length&&y.a.g.set(i,r,e))},oa:function(e){return y.u.G((function(){o[e.nodeType]&&(i(e),a[e.nodeType]&&n(e.getElementsByTagName("*")))})),e},removeNode:function(e){y.oa(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){s&&"function"==typeof s.cleanData&&s.cleanData([e])}}},y.oa=y.a.K.oa,y.removeNode=y.a.K.removeNode,y.b("cleanNode",y.oa),y.b("removeNode",y.removeNode),y.b("utils.domNodeDisposal",y.a.K),y.b("utils.domNodeDisposal.addDisposeCallback",y.a.K.za),y.b("utils.domNodeDisposal.removeDisposeCallback",y.a.K.yb),f=[0,"",""],v={thead:g=[1,"<table>","</table>"],tbody:g,tfoot:g,tr:[2,"<table><tbody>","</tbody></table>"],td:m=[3,"<table><tbody><tr>","</tr></tbody></table>"],th:m,option:b=[1,"<select multiple='multiple'>","</select>"],optgroup:b},w=8>=y.a.W,y.a.ua=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=y.a.Db(e).toLowerCase(),h=r.createElement("div");for(a=(l=l.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&v[l[1]]||f,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=a,w&&h.parentNode.removeChild(h));l--;)h=h.lastChild;r=y.a.la(h.lastChild.childNodes)}return r},y.a.Md=function(e,t){var i=y.a.ua(e,t);return i.length&&i[0].parentElement||y.a.Yb(i)},y.a.fc=function(t,i){if(y.a.Tb(t),null!==(i=y.a.f(i))&&i!==e)if("string"!=typeof i&&(i=i.toString()),s)s(t).html(i);else for(var n=y.a.ua(i,t.ownerDocument),r=0;r<n.length;r++)t.appendChild(n[r])},y.b("utils.parseHtmlFragment",y.a.ua),y.b("utils.setHtml",y.a.fc),y.aa=function(){function t(e,i){if(e)if(8==e.nodeType)null!=(n=y.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{Xb: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&&y.a.Nb(a,i),y.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}}}(),y.b("memoization",y.aa),y.b("memoization.memoize",y.aa.Xb),y.b("memoization.unmemoize",y.aa.bd),y.b("memoization.parseMemoText",y.aa.Uc),y.b("memoization.unmemoizeDomNodeAndDescendants",y.aa.cd),y.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,y.a.Gc(Error("'Too much recursion' after processing "+i+" task groups."));break}t=s}try{e()}catch(e){y.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,zb:function(e){return s||y.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}}(),y.b("tasks",y.na),y.b("tasks.schedule",y.na.zb),y.b("tasks.runEarly",y.na.Sd),y.Ta={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return y.$({read:e,write:function(n){clearTimeout(i),i=y.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.Hb=!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.Hb||(t.Hb=!0,t.ub((function(i){var n,r=!1;return function(){if(!r){y.na.cancel(n),n=y.na.zb(i);try{r=!0,t.notifySubscribers(e,"dirty")}finally{r=!1}}}})))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var x={undefined:1,boolean:1,number:1,string:1};y.b("extenders",y.Ta),y.ic=function(e,t,i){this.da=e,this.lc=t,this.mc=i,this.Ib=!1,this.fb=this.Jb=null,y.L(this,"dispose",this.s),y.L(this,"disposeWhenNodeIsRemoved",this.l)},y.ic.prototype.s=function(){this.Ib||(this.fb&&y.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},y.ic.prototype.l=function(e){this.Jb=e,y.a.K.za(e,this.fb=this.s.bind(this))},y.T=function(){y.a.Ab(this,S),S.qb(this)};var S={qb:function(e){e.U={change:[]},e.sc=1},subscribe:function(e,t,i){var n=this;i=i||"change";var r=new y.ic(n,t?e.bind(t):e,(function(){y.a.Pa(n.U[i],r),n.hb&&n.hb(i)}));return n.Qa&&n.Qa(i),n.U[i]||(n.U[i]=[]),n.U[i].push(r),r},notifySubscribers:function(e,t){if("change"===(t=t||"change")&&this.Gb(),this.Wa(t)){var i="change"===t&&this.ed||this.U[t].slice(0);try{y.u.xc();for(var n,r=0;n=i[r];++r)n.Ib||n.lc(e)}finally{y.u.end()}}},ob:function(){return this.sc},Dd:function(e){return this.ob()!==e},Gb:function(){++this.sc},ub:function(e){var t,i,n,r,o,s=this,a=y.O(s);s.gb||(s.gb=s.notifySubscribers,s.notifySubscribers=c);var l=e((function(){s.Ja=!1,a&&r===s&&(r=s.nc?s.nc():s());var e=i||o&&s.sb(n,r);o=i=t=!1,e&&s.gb(n=r)}));s.qc=function(e,i){i&&s.Ja||(o=!i),s.ed=s.U.change.slice(0),s.Ja=t=!0,r=e,l()},s.pc=function(e){t||(n=e,s.gb(e,"beforeChange"))},s.rc=function(){o=!0},s.gd=function(){s.sb(n,s.v(!0))&&(i=!0)}},Wa: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 y.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&&y.a.P(e,(function(e,i){var n=y.Ta[e];"function"==typeof n&&(t=n(t,i)||t)})),t}};y.L(S,"init",S.qb),y.L(S,"subscribe",S.subscribe),y.L(S,"extend",S.extend),y.L(S,"getSubscriptionsCount",S.Bd),y.a.Ba&&y.a.setPrototypeOf(S,Function.prototype),y.T.fn=S,y.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},y.b("subscribable",y.T),y.b("isSubscribable",y.Qc),y.S=y.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(!y.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()}},qa:function(){if(i)return i.o.qa()},Va:function(){if(i)return i.o.Va()},Ya:function(){if(i)return i.Ya},o:function(){if(i)return i.o}}}(),y.b("computedContext",y.S),y.b("computedContext.getDependenciesCount",y.S.qa),y.b("computedContext.getDependencies",y.S.Va),y.b("computedContext.isInitial",y.S.Ya),y.b("computedContext.registerDependency",y.S.cc),y.b("ignoreDependencies",y.Yd=y.u.G);var C=y.a.Da("_latestValue");y.ta=function(e){function t(){return 0<arguments.length?(t.sb(t[C],arguments[0])&&(t.ya(),t[C]=arguments[0],t.xa()),this):(y.u.cc(t),t[C])}return t[C]=e,y.a.Ba||y.a.extend(t,y.T.fn),y.T.fn.qb(t),y.a.Ab(t,E),y.options.deferUpdates&&y.Ta.deferred(t,!0),t};var E={equalityComparer:l,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};y.a.Ba&&y.a.setPrototypeOf(E,y.T.fn);var k=y.ta.Ma="__ko_proto__";E[k]=y.ta,y.O=function(e){if((e="function"==typeof e&&e[k])&&e!==E[k]&&e!==y.o.fn[k])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},y.Za=function(e){return"function"==typeof e&&(e[k]===E[k]||e[k]===y.o.fn[k]&&e.Nc)},y.b("observable",y.ta),y.b("isObservable",y.O),y.b("isWriteableObservable",y.Za),y.b("isWritableObservable",y.Za),y.b("observable.fn",E),y.L(E,"peek",E.v),y.L(E,"valueHasMutated",E.xa),y.L(E,"valueWillMutate",E.ya),y.Ha=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=y.ta(e),y.a.Ab(e,y.Ha.fn),e.extend({trackArrayChanges:!0})},y.Ha.fn={remove:function(e){for(var t=this.v(),i=[],n="function"!=typeof e||y.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.ya(),t[r]!==o)throw Error("Array modified during remove; cannot remove item");i.push(o),t.splice(r,1),r--}}return i.length&&this.xa(),i},removeAll:function(t){if(t===e){var i=this.v(),n=i.slice(0);return this.ya(),i.splice(0,i.length),this.xa(),n}return t?this.remove((function(e){return 0<=y.a.A(t,e)})):[]},destroy:function(e){var t=this.v(),i="function"!=typeof e||y.O(e)?function(t){return t===e}:e;this.ya();for(var n=t.length-1;0<=n;n--){var r=t[n];i(r)&&(r._destroy=!0)}this.xa()},destroyAll:function(t){return t===e?this.destroy((function(){return!0})):t?this.destroy((function(e){return 0<=y.a.A(t,e)})):[]},indexOf:function(e){var t=this();return y.a.A(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ya(),this.v()[i]=t,this.xa())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},y.a.Ba&&y.a.setPrototypeOf(y.Ha.fn,y.ta.fn),y.a.D("pop push reverse shift sort splice unshift".split(" "),(function(e){y.Ha.fn[e]=function(){var t=this.v();this.ya(),this.zc(t,e,arguments);var i=t[e].apply(t,arguments);return this.xa(),i===t?this:i}})),y.a.D(["slice"],(function(e){y.Ha.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}})),y.Pc=function(e){return y.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},y.b("observableArray",y.Ha),y.b("isObservableArray",y.Pc),y.Ta.trackArrayChanges=function(t,i){function n(){function e(){if(h){var e,i=[].concat(t.v()||[]);t.Wa("arrayChange")&&((!l||1<h)&&(l=y.a.Pb(s,i,t.Ob)),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.Ob={},i&&"object"==typeof i&&y.a.extend(t.Ob,i),t.Ob.sparse=!0,!t.zc){var r,o,s,a=!1,l=null,h=0,u=t.Qa,c=t.hb;t.Qa=function(e){u&&u.call(t,e),"arrayChange"===e&&n()},t.hb=function(i){c&&c.call(t,i),"arrayChange"!==i||t.Wa("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));y.a.Kc(d,c);break;default:return}l=r}}}};var P=y.a.Da("_state");y.o=y.$=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.nb,arguments),this}return s.ra||y.u.cc(r),(s.ka||s.J&&r.Xa())&&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,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:n.read,nb:i||n.owner,l:n.disposeWhenNodeIsRemoved||n.l||null,Sa:n.disposeWhen||n.Sa,Rb:null,I:{},V:0,Ic:null};return r[P]=s,r.Nc="function"==typeof o,y.a.Ba||y.a.extend(r,y.T.fn),y.T.fn.qb(r),y.a.Ab(r,N),n.pure?(s.wb=!0,s.J=!0,y.a.extend(r,T)):n.deferEvaluation&&y.a.extend(r,I),y.options.deferUpdates&&y.Ta.deferred(r,!0),s.l&&(s.jc=!0,s.l.nodeType||(s.l=null)),s.J||n.deferEvaluation||r.ha(),s.l&&r.ja()&&y.a.K.za(s.l,s.Rb=function(){r.s()}),r};var N={equalityComparer:l,qa:function(){return this[P].V},Va:function(){var e=[];return y.a.P(this[P].I,(function(t,i){e[i.Ka]=i.da})),e},Vb:function(e){if(!this[P].V)return!1;var t=this.Va();return-1!==y.a.A(t,e)||!!y.a.Lb(t,(function(t){return t.Vb&&t.Vb(e)}))},uc:function(e,t,i){if(this[P].wb&&t===this)throw Error("A 'pure' computed must not be called recursively");this[P].I[e]=i,i.Ka=this[P].V++,i.La=t.ob()},Xa:function(){var e,t,i=this[P].I;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&(t=i[e],this.Ia&&t.da.Ja||t.da.Dd(t.La)))return!0},Jd:function(){this.Ia&&!this[P].rb&&this.Ia(!1)},ja:function(){var e=this[P];return e.ka||0<e.V},Rd:function(){this.Ja?this[P].ka&&(this[P].sa=!0):this.Hc()},$c:function(e){if(e.Hb){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[P].Ic),this[P].Ic=y.a.setTimeout((function(){e.ha(!0)}),t)):e.Ia?e.Ia(!0):e.ha(!0)},ha:function(e){var t=this[P],i=t.Sa,n=!1;if(!t.rb&&!t.ra){if(t.l&&!y.a.Sb(t.l)||i&&i()){if(!t.jc)return void this.s()}else t.jc=!1;t.rb=!0;try{n=this.zd(e)}finally{t.rb=!1}return n}},zd:function(t){var i=this[P],n=!1,r=i.wb?e:!i.V;n={qd:this,mb:i.I,Qb:i.V},y.u.xc({pd:n,od:p,o:this,Ya: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.J?this.Gb():this.notifySubscribers(i.X,"beforeChange"),i.X=o,this.notifySubscribers(i.X,"spectate"),!i.J&&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.nb?i.call(e.nb):i()}finally{y.u.end(),t.Qb&&!e.J&&y.a.P(t.mb,d),e.sa=e.ka=!1}},v:function(e){var t=this[P];return(t.ka&&(e||!t.V)||t.J&&this.Xa())&&this.ha(),t.X},ub:function(e){y.T.fn.ub.call(this,e),this.nc=function(){return this[P].J||(this[P].sa?this.ha():this[P].ka=!1),this[P].X},this.Ia=function(e){this.pc(this[P].X),this[P].ka=!0,e&&(this[P].sa=!0),this.qc(this,!e)}},s:function(){var t=this[P];!t.J&&t.I&&y.a.P(t.I,(function(e,t){t.s&&t.s()})),t.l&&t.Rb&&y.a.K.yb(t.l,t.Rb),t.I=e,t.V=0,t.ra=!0,t.sa=!1,t.ka=!1,t.J=!1,t.l=e,t.Sa=e,t.Wc=e,this.Nc||(t.nb=e)}},T={Qa:function(e){var t=this,i=t[P];if(!i.ra&&i.J&&"change"==e){if(i.J=!1,i.sa||t.Xa())i.I=null,i.V=0,t.ha()&&t.Gb();else{var n=[];y.a.P(i.I,(function(e,t){n[t.Ka]=e})),y.a.D(n,(function(e,n){var r=i.I[e],o=t.$c(r.da);o.Ka=n,o.La=r.La,i.I[e]=o})),t.Xa()&&t.ha()&&t.Gb()}i.ra||t.notifySubscribers(i.X,"awake")}},hb:function(t){var i=this[P];i.ra||"change"!=t||this.Wa("change")||(y.a.P(i.I,(function(e,t){t.s&&(i.I[e]={da:t.da,Ka:t.Ka,La:t.La},t.s())})),i.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var e=this[P];return e.J&&(e.sa||this.Xa())&&this.ha(),y.T.fn.ob.call(this)}},I={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};y.a.Ba&&y.a.setPrototypeOf(N,y.T.fn);var R=y.ta.Ma;N[R]=y.o,y.Oc=function(e){return"function"==typeof e&&e[R]===N[R]},y.Fd=function(e){return y.Oc(e)&&e[P]&&e[P].wb},y.b("computed",y.o),y.b("dependentObservable",y.o),y.b("isComputed",y.Oc),y.b("isPureComputed",y.Fd),y.b("computed.fn",N),y.L(N,"peek",N.v),y.L(N,"dispose",N.s),y.L(N,"isActive",N.ja),y.L(N,"getDependenciesCount",N.qa),y.L(N,"getDependencies",N.Va),y.xb=function(e,t){return"function"==typeof e?y.o(e,t,{pure:!0}):((e=y.a.extend({},e)).pure=!0,y.o(e,t))},y.b("pureComputed",y.xb),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"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=[]}y.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;y.O(e)&&10>t;t++)e=e();return e}))},y.toJSON=function(e,t,i){return e=y.ad(e),y.a.hc(e,t,i)},i.prototype={constructor:i,save:function(e,t){var i=y.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=y.a.A(this.keys,t))?this.values[t]:e}}}(),y.b("toJS",y.ad),y.b("toJSON",y.toJSON),y.Wd=function(e,t,i){function n(t){var n=y.xb(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)},y.b("when",y.Wd),y.w={M:function(t){switch(y.a.R(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?y.a.g.get(t,y.c.options.$b):7>=y.a.W?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?y.w.M(t.options[t.selectedIndex]):e;default:return t.value}},cb:function(t,i,n){switch(y.a.R(t)){case"option":"string"==typeof i?(y.a.g.set(t,y.c.options.$b,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i):(y.a.g.set(t,y.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=y.w.M(t.options[s]))==i||""===r&&i===e){o=s;break}(n||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o,6===y.a.W&&y.a.setTimeout((function(){t.selectedIndex=o}),0));break;default:null!==i&&i!==e||(i=""),t.value=i}}},y.b("selectExtensions",y.w),y.b("selectExtensions.readValue",y.w.M),y.b("selectExtensions.writeValue",y.w.cb),y.m=function(){function e(e){123===(e=y.a.Db(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{Ra:[],wa:s,ac:e,vb:function(n,r){function o(e,n){var r;if(!u){var c=y.getBindingHandler(e);if(c&&c.preprocess&&!(n=c.preprocess(n,e,o)))return;(c=s[e])&&(r=n,0<=y.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 y.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},eb:function(e,t,i,n,r){e&&y.O(e)?!y.Za(e)||r&&e.v()===n||e(n):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](n)}}}(),y.b("expressionRewriting",y.m),y.b("expressionRewriting.bindingRewriteValidators",y.m.Ra),y.b("expressionRewriting.parseObjectLiteral",y.m.ac),y.b("expressionRewriting.preProcessBindings",y.m.vb),y.b("expressionRewriting._twoWayBindings",y.m.wa),y.b("jsonExpressionRewriting",y.m),y.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",y.m.vb),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)&&(y.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__";y.h={ea:{},childNodes:function(t){return e(t)?n(t):t.childNodes},Ea:function(t){if(e(t))for(var i=0,n=(t=y.h.childNodes(t)).length;i<n;i++)y.removeNode(t[i]);else y.a.Tb(t)},va:function(t,i){if(e(t)){y.h.Ea(t);for(var n=t.nextSibling,r=0,o=i.length;r<o;r++)n.parentNode.insertBefore(i[r],n)}else y.a.va(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)},Wb:function(t,i,n){n?(n=n.nextSibling,e(t)&&(t=t.parentNode),n?i!==n&&t.insertBefore(i,n):t.appendChild(i)):y.h.Vc(t,i)},firstChild:function(i){if(e(i))return!i.nextSibling||t(i.nextSibling)?null:i.nextSibling;if(i.firstChild&&t(i.firstChild))throw Error("Found invalid end comment, as the first child of "+i);return i.firstChild},nextSibling:function(i){if(e(i)&&(i=r(i)),i.nextSibling&&t(i.nextSibling)){var n=i.nextSibling;if(t(n)&&!y.a.g.get(n,h))throw Error("Found end comment without a matching opening comment, as child of "+i);return null}return i.nextSibling},Cd:e,Vd:function(e){return(e=(o?e.text:e.nodeValue).match(s))?e[1]:null},Sc:function(i){if(l[y.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)}}}}(),y.b("virtualElements",y.h),y.b("virtualElements.allowedBindings",y.h.ea),y.b("virtualElements.emptyNode",y.h.Ea),y.b("virtualElements.insertAfter",y.h.Wb),y.b("virtualElements.prepend",y.h.Vc),y.b("virtualElements.setDomNodeChildren",y.h.va),y.ga=function(){this.nd={}},y.a.extend(y.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||y.j.getComponentNameForNode(e);case 8:return y.h.Cd(e);default:return!1}},getBindings:function(e,t){var i=(i=this.getBindingsString(e,t))?this.parseBindingsString(i,t,e):null;return y.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 y.j.tc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return y.h.Vd(e);default:return null}},parseBindingsString:function(e,t,i,n){try{var r,o=this.nd,s=e+(n&&n.valueAccessors||"");if(!(r=o[s])){var a,l="with($context){with($data||{}){return{"+y.m.vb(e,n)+"}}}";a=new Function("$context","$element",l),r=o[s]=a}return r(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),y.ga.instance=new y.ga,y.b("bindingProvider",y.ga),function(){function n(e){var t=(e=y.a.g.get(e,x))&&e.N;t&&(e.N=null,t.Tc())}function r(e,t,i){this.node=e,this.yc=t,this.kb=[],this.H=!1,t.N||y.a.K.za(e,n),i&&i.N&&(i.N.kb.push(e),this.Kb=i)}function o(e){return function(){return e}}function a(e){return e()}function l(e){return y.a.Ga(y.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)):y.a.Ga(e,o)}function u(e,t){return l(this.getBindings.bind(this,e,t))}function c(e,t){var i=y.h.firstChild(t);if(i){var n,r=y.ga.instance,o=r.preprocessNode;if(o){for(;n=i;)i=y.h.nextSibling(n),o.call(r,n);i=y.h.firstChild(t)}for(;n=i;)i=y.h.nextSibling(n),d(e,n)}y.i.ma(t,y.i.H)}function d(e,t){var i=e,n=1===t.nodeType;n&&y.h.Sc(t),(n||y.ga.instance.nodeHasBindings(t))&&(i=p(t,null,e).bindingContextForDescendants),i&&!v[y.a.R(t)]&&c(i,t)}function p(t,i,n){var r,o=y.a.g.Ub(t,x,{}),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.Zb||(o.Zb={}),i&&"function"!=typeof i)r=i;else{var l=y.ga.instance,h=l.getBindingAccessors||u,c=y.$((function(){return(r=i?i(n,t):h.call(l,t,n))&&(n[g]&&n[g](),n[b]&&n[b]()),r}),null,{l:t});r&&c.ja()||(c=null)}var d,p=n;if(r){var f=function(){return y.a.Ga(c?c():r,a)},m=c?function(e){return function(){return a(c()[e])}}:function(e){return r[e]};f.get=function(e){return r[e]&&a(m(e))},f.has=function(e){return e in r},y.i.H in r&&y.i.subscribe(t,y.i.H,(function(){var e=(0,r[y.i.H])();if(e){var i=y.h.childNodes(t);i.length&&e(i,y.Ec(i[0]))}})),y.i.pa in r&&(p=y.i.Cb(t,n),y.i.subscribe(t,y.i.pa,(function(){var e=(0,r[y.i.pa])();e&&y.h.firstChild(t)&&e(t)}))),o=function(e){var t=[],i={},n=[];return y.a.P(e,(function r(o){if(!i[o]){var s=y.getBindingHandler(o);s&&(s.after&&(n.push(o),y.a.D(s.after,(function(t){if(e[t]){if(-1!==y.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),y.a.D(o,(function(i){var n=i.Mc.init,o=i.Mc.update,s=i.key;if(8===t.nodeType&&!y.h.ea[s])throw Error("The binding '"+s+"' cannot be used with virtual elements");try{"function"==typeof n&&y.u.G((function(){var i=n(t,m(s),f,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&&y.$((function(){o(t,m(s),f,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 y.fa?t:new y.fa(t,e,e,i)}var g=y.a.Da("_subscribable"),m=y.a.Da("_ancestorBindingInfo"),b=y.a.Da("_dataDependency");y.c={};var v={script:!0,textarea:!0,template:!0};y.getBindingHandler=function(e){return y.c[e]};var w={};y.fa=function(t,i,n,r,o){function s(){var e=c?u():u,t=y.a.f(e);return i?(y.a.extend(l,i),m in i&&(l[m]=i[m])):(l.$parents=[],l.$root=t,l.ko=y),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]&&!y.S.o().Vb(i[g])&&i[g](),d&&(l[b]=d),l.$data}var a,l=this,h=t===w,u=h?e:t,c="function"==typeof u&&!y.O(u),d=o&&o.dataDependency;o&&o.exportDependencies?s():((a=y.xb(s)).v(),a.ja()?a.equalityComparer=null:l[g]=e)},y.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&&!y.O(e);return new y.fa(w,this,null,(function(n){i&&i(n),n[t]=r?e():e}),n)}return new y.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)},y.fa.prototype.extend=function(e,t){return new y.fa(w,this,null,(function(t){y.a.extend(t,"function"==typeof e?e(t):e)}),t)};var x=y.a.g.Z();r.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},r.prototype.sd=function(e){y.a.Pa(this.kb,e),!this.kb.length&&this.H&&this.Cc()},r.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,y.a.K.yb(this.node,n),y.i.ma(this.node,y.i.pa),this.Tc())},y.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(e,t,i,n,r){var o=y.a.g.Ub(e,x,{});return o.Fa||(o.Fa=new y.T),r&&r.notifyImmediately&&o.Zb[t]&&y.u.G(i,n,[e]),o.Fa.subscribe(i,n,t)},ma:function(t,i){var n=y.a.g.get(t,x);if(n&&(n.Zb[i]=!0,n.Fa&&n.Fa.notifySubscribers(t,i),i==y.i.H))if(n.N)n.N.Cc();else if(n.N===e&&n.Fa&&n.Fa.Wa(y.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")},Cb:function(e,t){var i=y.a.g.Ub(e,x,{});return i.N||(i.N=new r(e,i,t[m])),t[m]==i?t:t.extend((function(e){e[m]=i}))}},y.Td=function(e){return(e=y.a.g.get(e,x))&&e.context},y.ib=function(e,t,i){return 1===e.nodeType&&y.h.Sc(e),p(e,t,f(i))},y.ld=function(e,t,i){return i=f(i),y.ib(e,h(t,i,e),i)},y.Oa=function(e,t){1!==t.nodeType&&8!==t.nodeType||c(f(e),t)},y.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)},y.Dc=function(t){return!t||1!==t.nodeType&&8!==t.nodeType?e:y.Td(t)},y.Ec=function(t){return(t=y.Dc(t))?t.$data:e},y.b("bindingHandlers",y.c),y.b("bindingEvent",y.i),y.b("bindingEvent.subscribe",y.i.subscribe),y.b("bindingEvent.startPossiblyAsyncContentBinding",y.i.Cb),y.b("applyBindings",y.vc),y.b("applyBindingsToDescendants",y.Oa),y.b("applyBindingAccessorsToNode",y.ib),y.b("applyBindingsToNode",y.ld),y.b("contextFor",y.Dc),y.b("dataFor",y.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 y.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):y.na.zb((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=y.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={};y.j={get:function(i,n){var r=Object.prototype.hasOwnProperty.call(o,i)?o[i]:e;r?r.Gd?y.u.G((function(){n(r.definition)})):y.na.zb((function(){n(r.definition)})):t(i,n)},Bc:function(e){delete o[e]},oc:n},y.j.loaders=[],y.b("components",y.j),y.b("components.get",y.j.get),y.b("components.clearCachedDefinition",y.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){y.j.oc("loadTemplate",[e,t],(function(e){o.template=e,r()}))})):r(),i?a(t,i,(function(t){y.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(y.a.R(e)){case"script":return y.a.ua(e.text);case"textarea":return y.a.ua(e.value);case"template":if(s(e.content))return y.a.Ca(e.content.childNodes)}return y.a.Ca(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={};y.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(y.j.tb(e))throw Error("Component "+e+" is already registered");h[e]=t},y.j.tb=function(e){return Object.prototype.hasOwnProperty.call(h,e)},y.j.unregister=function(e){delete h[e],y.j.Bc(e)},y.j.Fc={getConfig:function(e,t){t(y.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(y.a.ua(n));else if(n instanceof Array)o(n);else if(s(n))o(y.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";y.b("components.register",y.j.register),y.b("components.isRegistered",y.j.tb),y.b("components.unregister",y.j.unregister),y.b("components.defaultLoader",y.j.Fc),y.j.loaders.push(y.j.Fc),y.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=y.a.Ga(n,(function(t){return y.o(t,null,{l:e})})),y.a.Ga(n,(function(t){var i=t.v();return t.ja()?y.o({read:function(){return y.a.f(t())},write:y.Za(i)&&function(e){t()(e)},l:e}):i})));return Object.prototype.hasOwnProperty.call(r,"$raw")||(r.$raw=n),r}return{$raw:{}}}y.j.getComponentNameForNode=function(e){var t=y.a.R(e);if(y.j.tb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=y.a.W&&e.tagName===t))return t},y.j.tc=function(t,i,n,r){if(1===i.nodeType){var o=y.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 y.ga;9>y.a.W&&(y.j.register=function(e){return function(t){return e.apply(this,arguments)}}(y.j.register),i.createDocumentFragment=function(e){return function(){var t=e();return y.j.dd,t}}(i.createDocumentFragment))}(),function(){var e=0;y.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=y.a.la(y.h.childNodes(t));return y.h.Ea(t),y.a.K.za(t,s),y.o((function(){var n,r,c=y.a.f(i());if("string"==typeof c?n=c:(n=y.a.f(c.name),r=y.a.f(c.params)),!n)throw Error("No component name specified");var d=y.i.Cb(t,o),p=l=++e;y.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=y.a.Ca(t),y.h.va(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=y.i.subscribe(t,y.i.pa,i.koDescendantsComplete,i)),a=i,y.Oa(e,t)}}))}),null,{l:t}),{controlsDescendantBindings:!0}}},y.h.ea.component=!0}();var _={class:"className",for:"htmlFor"};y.c.attr={update:function(t,i){var n=y.a.f(i())||{};y.a.P(n,(function(i,n){n=y.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>=y.a.W&&i in _?(i=_[i],o?t.removeAttribute(i):t[i]=n):o||(r?t.setAttributeNS(r,i,n):t.setAttribute(i,n)),"name"===i&&y.a.Yc(t,o?"":n)}))}},y.c.checked={after:["value","attr"],init:function(t,i,n){function r(){var r=t.checked,l=o();if(!y.S.Ya()&&(r||!a&&!y.S.qa())){var c=y.u.G(i);if(h){var p=u?c.v():c,f=d;d=l,f!==l?r&&(y.a.Na(p,l,!0),y.a.Na(p,f,!1)):y.a.Na(p,l,r),u&&y.Za(c)&&c(p)}else s&&(l===e?l=r:r||(l=e)),y.m.eb(c,n,"checked",l,!0)}}var o=y.xb((function(){return n.has("checkedValue")?y.a.f(n.get("checkedValue")):c?n.has("value")?y.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&&y.a.f(l)instanceof Array,u=!(h&&l.push&&l.splice),c=a||h,d=h?o():e;a&&!t.name&&y.c.uniqueName.init(t,(function(){return!0})),y.o(r,null,{l:t}),y.a.B(t,"click",r),y.o((function(){var n=y.a.f(i()),r=o();h?(t.checked=0<=y.a.A(n,r),d=r):t.checked=s&&r===e?!!n:o()===n}),null,{l:t}),l=e}}},y.m.wa.checked=!0,y.c.checkedValue={update:function(e,t){e.value=y.a.f(t())}},y.c.class={update:function(e,t){var i=y.a.Db(y.a.f(t()));y.a.Eb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,y.a.Eb(e,i,!0)}},y.c.css={update:function(e,t){var i=y.a.f(t());null!==i&&"object"==typeof i?y.a.P(i,(function(t,i){i=y.a.f(i),y.a.Eb(e,t,i)})):y.c.class.update(e,t)}},y.c.enable={update:function(e,t){var i=y.a.f(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},y.c.disable={update:function(e,t){y.c.enable.update(e,(function(){return!y.a.f(t())}))}},y.c.event={init:function(e,t,i,n,r){var o=t()||{};y.a.P(o,(function(o){"string"==typeof o&&y.a.B(e,o,(function(e){var s,a=t()[o];if(a){try{var l=y.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())}}))}))}},y.c.foreach={Rc:function(e){return function(){var t=e(),i=y.a.bc(t);return i&&"number"!=typeof i.length?(y.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:y.ba.Ma}):{foreach:t,templateEngine:y.ba.Ma}}},init:function(e,t){return y.c.template.init(e,y.c.foreach.Rc(t))},update:function(e,t,i,n,r){return y.c.template.update(e,y.c.foreach.Rc(t),i,n,r)}},y.m.Ra.foreach=!1,y.h.ea.foreach=!0,y.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(),y.m.eb(r,i,"hasfocus",n,!0),e.__ko_hasfocusLastValue=n,e.__ko_hasfocusUpdating=!1}var r=n.bind(null,!0),o=n.bind(null,!1);y.a.B(e,"focus",r),y.a.B(e,"focusin",r),y.a.B(e,"blur",o),y.a.B(e,"focusout",o),e.__ko_hasfocusLastValue=!1},update:function(e,t){var i=!!y.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),y.u.G(y.a.Fb,null,[e,i?"focusin":"focusout"]))}},y.m.wa.hasfocus=!0,y.c.hasFocus=y.c.hasfocus,y.m.wa.hasFocus="hasfocus",y.c.html={init:function(){return{controlsDescendantBindings: