Replace $().trigger() and document.createEvent() with element.dispatchEvent(new Event())

This commit is contained in:
djmaze 2020-09-17 21:18:39 +02:00
parent 7ac8143f34
commit 7713f459ac
5 changed files with 134 additions and 164 deletions

View file

@ -203,16 +203,14 @@ ko.bindingHandlers.initDom = {
ko.bindingHandlers.onEsc = {
init: (element, fValueAccessor, fAllBindingsAccessor, viewModel) => {
$(element).on('keyup.koOnEsc', event => {
if (event && 'Escape' === event.key) {
$(element).trigger('change');
let fn = event => {
if ('Escape' == event.key) {
element.dispatchEvent(new Event('change'));
fValueAccessor().call(viewModel);
}
});
ko.utils.domNodeDisposal.addDisposeCallback(element, () =>
$(element).off('keyup.koOnEsc')
);
};
element.addEventListener('keyup', fn);
ko.utils.domNodeDisposal.addDisposeCallback(element, () => element.removeEventListener('keyup', fn));
}
};

27
dev/External/ko.js vendored
View file

@ -1,5 +1,4 @@
const
$ = jQuery,
doc = document,
ko = window.ko,
Translator = () => require('Common/Translator'),
@ -93,30 +92,26 @@ ko.bindingHandlers.popover = {
ko.bindingHandlers.onEnter = {
init: (element, fValueAccessor, fAllBindingsAccessor, viewModel) => {
$(element).on('keypress.koOnEnter', event => {
if (event && 'Enter' === event.key) {
$(element).trigger('change');
let fn = event => {
if ('Enter' == event.key) {
element.dispatchEvent(new Event('change'));
fValueAccessor().call(viewModel);
}
});
ko.utils.domNodeDisposal.addDisposeCallback(element, () => {
$(element).off('keypress.koOnEnter');
});
};
element.addEventListener('keydown', fn);
ko.utils.domNodeDisposal.addDisposeCallback(element, () => element.removeEventListener('keydown', fn));
}
};
ko.bindingHandlers.onSpace = {
init: (element, fValueAccessor, fAllBindingsAccessor, viewModel) => {
$(element).on('keyup.koOnSpace', event => {
if (event && ' ' === event.key) {
let fn = event => {
if (' ' == event.key) {
fValueAccessor().call(viewModel, event);
}
});
ko.utils.domNodeDisposal.addDisposeCallback(element, () => {
$(element).off('keyup.koOnSpace');
});
};
element.addEventListener('keyup', fn);
ko.utils.domNodeDisposal.addDisposeCallback(element, () => element.removeEventListener('keyup', fn));
}
};

View file

@ -83,14 +83,6 @@ ko.utils = (function () {
var canSetPrototype = ({ __proto__: [] } instanceof Array);
// Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup)
var ke = 'KeyboardEvent', me = 'MouseEvent',
knownEventTypesByEventName = {
keyup: ke, keydown: ke, keypress: ke,
click: me, dblclick: me, mousedown: me, mouseup: me, mousemove: me,
mouseover: me, mouseout: me, mouseenter: me, mouseleave: me
};
function isClickOnCheckableElement(element, eventType) {
if ((element.nodeName !== "INPUT") || !element.type) return false;
if (eventType.toLowerCase() != "click") return false;
@ -332,10 +324,7 @@ ko.utils = (function () {
if (!ko.options['useOnlyNativeEvents'] && jQuery && !useClickWorkaround) {
jQuery(element)['trigger'](eventType);
} else {
var eventCategory = knownEventTypesByEventName[eventType] || "HTMLEvents";
var event = document.createEvent(eventCategory);
event.initEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element);
element.dispatchEvent(event);
element.dispatchEvent(new Event(eventType));
}
},

View file

@ -4,119 +4,118 @@
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/
(function() {(function(n){var G=this||(0,eval)("this"),z=G.document,I=G.jQuery;I||"undefined"===typeof jQuery||(I=jQuery);(function(n){"function"===typeof define&&define.amd?define(["exports","require"],n):"object"===typeof exports&&"object"===typeof module?n(module.exports||exports):n(G.ko={})})(function(I,R){function L(a,c){return null===a||typeof a in U?a===c:!1}function V(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function W(b,c){var d;return function(){clearTimeout(d);d=a.a.setTimeout(b,
c)}}function X(a,c){c&&"change"!==c?"beforeChange"===c?this.hc(a):this.bb(a,c):this.ic(a)}function Y(a,c){null!==c&&c.s&&c.s()}function Z(a,c){var d=this.bd,e=d[q];e.pa||(this.Jb&&this.ib[c]?(d.mc(c,a,this.ib[c]),this.ib[c]=null,--this.Jb):e.F[c]||d.mc(c,a,e.G?{aa:a}:d.Oc(a)),a.Ga&&a.Tc())}function O(a,c,d){if(c){var e=d?"add":"remove";c.split(/\s+/).forEach(function(c){a.classList[e](c)})}}var a="undefined"!==typeof I?I:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f<d.length-1;f++)e=e[d[f]];
e[d[d.length-1]]=c};a.I=function(a,c,d){a[c]=d};a.version="3.5.1-pre";a.b("version",a.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){b&&Object.entries(b).forEach(function(b){a[b[0]]=b[1]});return a}function c(a,b){a.__proto__=b;return a}var d={__proto__:[]}instanceof Array,e={Kd:"KeyboardEvent",Id:"KeyboardEvent",Jd:"KeyboardEvent",click:"MouseEvent",Gd:"MouseEvent",Ld:"MouseEvent",Rd:"MouseEvent",Od:"MouseEvent",Qd:"MouseEvent",
Pd:"MouseEvent",Md:"MouseEvent",Nd:"MouseEvent"};return{K:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},L:function(a,b){return Array.prototype.indexOf.call(a,b)},Fb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return n},Ma:function(b,c){var d=a.a.L(b,c);0<d?b.splice(d,1):0===d&&b.shift()},fb:function(a,b,c){return a?Array.prototype.filter.call(a,b,c):[]},Gb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<
d;c++)a.push(b[c]);return a},ya:d,extend:b,setPrototypeOf:c,wb:d?c:b,O:function(a,b){a&&Object.entries(a).forEach(function(a){b(a[0],a[1])})},Da:function(a,b,c){if(!a)return a;var d={};Object.entries(a).forEach(function(e){d[e[0]]=b.call(c,e[1],e[0],a)});return d},Mb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Rb:function(b){b=a.a.Ca(b);for(var c=(b[0]&&b[0].ownerDocument||z).createElement("div"),d=0,e=b.length;d<e;d++)c.appendChild(a.ma(b[d]));return c},za:function(b,c){for(var d=
0,e=b.length,k=[];d<e;d++){var l=b[d].cloneNode(!0);k.push(c?a.ma(l):l)}return k},ta:function(b,c){a.a.Mb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Mc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){var e=d[0],k=e.parentNode,l,p;l=0;for(p=c.length;l<p;l++)k.insertBefore(c[l],e);l=0;for(p=d.length;l<p;l++)a.removeNode(d[l])}},Ra:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==
b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},$b:function(a){return null===a||a===n?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Bd:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},fd:function(a,b){return b.contains(1!==a.nodeType?a.parentNode:a)},Lb:function(b){return a.a.fd(b,b.ownerDocument.documentElement)},Wc:function(b){return!!a.a.Fb(b,a.a.Lb)},$:function(a){return a&&
a.tagName&&a.tagName.toLowerCase()},rc:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.rc(b),c)},xc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},H:function(b,c,d){d=a.a.rc(d);if(!a.options.useOnlyNativeEvents&&jQuery)jQuery(b).on(c,d);else b.addEventListener(c,d,!1)},zb:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");
var d;"INPUT"===b.nodeName&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;a.options.useOnlyNativeEvents||!jQuery||d?(d=z.createEvent(e[c]||"HTMLEvents"),d.initEvent(c,!0,!0,G,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d)):jQuery(b).trigger(c)},g:function(b){return a.R(b)?b():b},Vb:function(b){return a.R(b)?b.v():b},xb:function(b,c){var d=a.a.g(c);if(null===d||d===n)d="";var e=a.f.firstChild(b);!e||3!=e.nodeType||a.f.nextSibling(e)?a.f.ta(b,[b.ownerDocument.createTextNode(d)]):
e.data=d},Ca:function(a){return Array.from(a)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.K);a.b("utils.arrayFirst",a.a.Fb);a.b("utils.arrayFilter",a.a.fb);a.b("utils.arrayIndexOf",a.a.L);a.b("utils.arrayPushAll",a.a.Gb);a.b("utils.arrayRemoveItem",a.a.Ma);a.b("utils.cloneNodes",a.a.za);a.b("utils.extend",a.a.extend);a.b("utils.objectMap",a.a.Da);a.b("utils.peekObservable",a.a.Vb);a.b("utils.registerEventHandler",a.a.H);a.b("utils.stringifyJson",a.a.Sd);a.b("utils.triggerEvent",a.a.zb);a.b("utils.unwrapObservable",
a.a.g);a.b("utils.objectForEach",a.a.O);a.b("utils.setTextContent",a.a.xb);a.b("unwrap",a.a.g);a.a.h=new function(){var a=0,c="__ko__"+Date.now(),d;d=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d};return{get:function(a,b){var c=d(a,!1);return c&&c[b]},set:function(a,b,c){(a=d(a,c!==n))&&(a[b]=c)},Nb:function(a,b,c){a=d(a,!0);return a[b]||(a[b]=c)},clear:function(a){return a[c]?(delete a[c],!0):!1},fa:function(){return a++ +c}}};a.b("utils.domData",a.a.h);a.b("utils.domData.clear",a.a.h.clear);
a.a.N=new function(){function b(b,c){var d=a.a.h.get(b,e);d===n&&c&&(d=[],a.a.h.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);a.a.h.clear(c);a.a.N.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],l,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=l=b[f]),b[f]!==l)for(;f--&&-1==a.a.L(e,b[f]););}var e=a.a.h.fa(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{Ka:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");
b(a,!0).push(c)},ub:function(c,d){var k=b(c,!1);k&&(a.a.Ma(k,d),0==k.length&&a.a.h.set(c,e,n))},ma:function(b){a.u.C(function(){f[b.nodeType]&&(c(b),g[b.nodeType]&&d(b.getElementsByTagName("*")))});return b},removeNode:function(b){a.ma(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){jQuery&&jQuery.cleanData&&jQuery.cleanData([a])}}};a.ma=a.a.N.ma;a.removeNode=a.a.N.removeNode;a.b("cleanNode",a.ma);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.N);a.b("utils.domNodeDisposal.addDisposeCallback",
a.a.N.Ka);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.N.ub);(function(){var b=[0,"",""],c=[1,"<table>","</table>"],d=[3,"<table><tbody><tr>","</tr></tbody></table>"],e=[1,"<select multiple='multiple'>","</select>"],f={thead:c,tbody:c,tfoot:c,tr:[2,"<table><tbody>","</tbody></table>"],td:d,th:d,option:e,optgroup:e};a.a.sa=function(c,d){var e=d;e||(e=z);var k=e.parentWindow||e.defaultView||G,l=a.a.$b(c).toLowerCase(),e=e.createElement("div"),p;p=(l=l.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&
f[l[1]]||b;l=p[0];p="ignored<div>"+p[1]+c+p[2]+"</div>";for("function"==typeof k.innerShiv?e.appendChild(k.innerShiv(p)):e.innerHTML=p;l--;)e=e.lastChild;return a.a.Ca(e.lastChild.childNodes)};a.a.wd=function(b,c){var d=a.a.sa(b,c);return d.length&&d[0].parentElement||a.a.Rb(d)};a.a.Zb=function(b,c){a.a.Mb(b);c=a.a.g(c);if(null!==c&&c!==n){"string"!=typeof c&&(c=c.toString());for(var d=a.a.sa(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}}})();a.b("utils.parseHtmlFragment",a.a.sa);a.b("utils.setHtml",
a.a.Zb);a.Y=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.Y.Jc(c.nodeValue);null!=f&&e.push({ed:c,sd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f],e)}var c={};return{Qb:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},Pc:function(a,
b){var f=c[a];if(f===n)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},Qc:function(c,e){var f=[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].ed,k=[m];e&&a.a.Gb(k,e);a.Y.Pc(f[g].sd,k);m.nodeValue="";m.parentNode&&m.parentNode.removeChild(m)}},Jc:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.Y);a.b("memoization.memoize",a.Y.Qb);a.b("memoization.unmemoize",
a.Y.Pc);a.b("memoization.parseMemoText",a.Y.Jc);a.b("memoization.unmemoizeDomNodeAndDescendants",a.Y.Qc);a.la=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=++c){h=f;a.a.xc(Error("'Too much recursion' after processing "+c+" task groups."));break}b=f}try{d()}catch(p){a.a.xc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;G.MutationObserver?d=function(a){var b=z.createElement("div");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle("foo")}}(c):
d=z&&"onreadystatechange"in z.createElement("script")?function(a){var b=z.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;z.documentElement.removeChild(b);b=null;a()};z.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,vb:function(b){f||a.la.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},zd:b}}();a.b("tasks",a.la);a.b("tasks.schedule",
a.la.vb);a.b("tasks.runEarly",a.la.zd);a.Qa={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.X({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},c)}})},rateLimit:function(a,c){var d,e,f;"number"==typeof c?d=c:(d=c.timeout,e=c.method);a.Bb=!1;f="function"==typeof e?e:"notifyWhenChangesStop"==e?W:V;a.qb(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");
b.Bb||(b.Bb=!0,b.qb(function(c){var e,f=!1;return function(){if(!f){a.la.cancel(e);e=a.la.vb(c);try{f=!0,b.notifySubscribers(n,"dirty")}finally{f=!1}}}}))},notify:function(a,c){a.equalityComparer="always"==c?null:L}};var U={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.Qa);a.ac=function(b,c,d){this.aa=b;this.dc=c;this.ec=d;this.Cb=!1;this.ab=this.Db=null;a.I(this,"dispose",this.s);a.I(this,"disposeWhenNodeIsRemoved",this.l)};a.ac.prototype.s=function(){this.Cb||(this.ab&&a.a.N.ub(this.Db,
this.ab),this.Cb=!0,this.ec(),this.aa=this.dc=this.ec=this.Db=this.ab=null)};a.ac.prototype.l=function(b){this.Db=b;a.a.N.Ka(b,this.ab=this.s.bind(this))};a.S=function(){a.a.wb(this,C);C.mb(this)};var C={mb:function(a){a.T={change:[]};a.kc=1},subscribe:function(b,c,d){var e=this;d=d||"change";var f=new a.ac(e,c?b.bind(c):b,function(){a.a.Ma(e.T[d],f);e.cb&&e.cb(d)});e.Na&&e.Na(d);e.T[d]||(e.T[d]=[]);e.T[d].push(f);return f},notifySubscribers:function(b,c){c=c||"change";"change"===c&&this.Ab();if(this.Ta(c)){var d=
"change"===c&&this.Rc||this.T[c].slice(0);try{a.u.oc();for(var e=0,f;f=d[e];++e)f.Cb||f.dc(b)}finally{a.u.end()}}},kb:function(){return this.kc},md:function(a){return this.kb()!==a},Ab:function(){++this.kc},qb:function(b){var c=this,d=a.R(c),e,f,g,h,m;c.bb||(c.bb=c.notifySubscribers,c.notifySubscribers=X);var k=b(function(){c.Ga=!1;d&&h===c&&(h=c.fc?c.fc():c());var a=f||m&&c.ob(g,h);m=f=e=!1;a&&c.bb(g=h)});c.ic=function(a,b){b&&c.Ga||(m=!b);c.Rc=c.T.change.slice(0);c.Ga=e=!0;h=a;k()};c.hc=function(a){e||
(g=a,c.bb(a,"beforeChange"))};c.jc=function(){m=!0};c.Tc=function(){c.ob(g,c.v(!0))&&(f=!0)}},Ta:function(a){return this.T[a]&&this.T[a].length},kd:function(b){if(b)return this.T[b]&&this.T[b].length||0;var c=0;a.a.O(this.T,function(a,b){"dirty"!==a&&(c+=b.length)});return c},ob:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return"[object Object]"},extend:function(b){var c=this;b&&a.a.O(b,function(b,e){var f=a.Qa[b];"function"==typeof f&&(c=f(c,e)||c)});
return c}};a.I(C,"init",C.mb);a.I(C,"subscribe",C.subscribe);a.I(C,"extend",C.extend);a.I(C,"getSubscriptionsCount",C.kd);a.a.ya&&a.a.setPrototypeOf(C,Function.prototype);a.S.fn=C;a.Fc=function(a){return null!=a&&"function"==typeof a.subscribe&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.S);a.b("isSubscribable",a.Fc);a.P=a.u=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{oc:b,end:c,Wb:function(b){if(e){if(!a.Fc(b))throw Error("Only subscribable things can act as dependencies");
e.$c.call(e.ad,b,b.Sc||(b.Sc=++f))}},C:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},oa:function(){if(e)return e.o.oa()},Sa:function(){if(e)return e.o.Sa()},Va:function(){if(e)return e.Va},o:function(){if(e)return e.o}}}();a.b("computedContext",a.P);a.b("computedContext.getDependenciesCount",a.P.oa);a.b("computedContext.getDependencies",a.P.Sa);a.b("computedContext.isInitial",a.P.Va);a.b("computedContext.registerDependency",a.P.Wb);a.b("ignoreDependencies",a.Hd=a.u.C);var F=Symbol("_latestValue");
a.ra=function(b){function c(){if(0<arguments.length)return c.ob(c[F],arguments[0])&&(c.wa(),c[F]=arguments[0],c.va()),this;a.u.Wb(c);return c[F]}c[F]=b;a.a.ya||a.a.extend(c,a.S.fn);a.S.fn.mb(c);a.a.wb(c,D);a.options.deferUpdates&&a.Qa.deferred(c,!0);return c};var D={equalityComparer:L,v:function(){return this[F]},va:function(){this.notifySubscribers(this[F],"spectate");this.notifySubscribers(this[F])},wa:function(){this.notifySubscribers(this[F],"beforeChange")}};a.a.ya&&a.a.setPrototypeOf(D,a.S.fn);
var H=a.ra.Ja="__ko_proto__";D[H]=a.ra;a.R=function(b){if((b="function"==typeof b&&b[H])&&b!==D[H]&&b!==a.o.fn[H])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b};a.Wa=function(b){return"function"==typeof b&&(b[H]===D[H]||b[H]===a.o.fn[H]&&b.Cc)};a.b("observable",a.ra);a.b("isObservable",a.R);a.b("isWriteableObservable",a.Wa);a.b("isWritableObservable",a.Wa);a.b("observable.fn",D);a.I(D,"peek",D.v);a.I(D,"valueHasMutated",D.va);a.I(D,
"valueWillMutate",D.wa);a.Ea=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.ra(b);a.a.wb(b,a.Ea.fn);return b.extend({trackArrayChanges:!0})};a.Ea.fn={remove:function(b){for(var c=this.v(),d=[],e="function"!=typeof b||a.R(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.wa();if(c[f]!==g)throw Error("Array modified during remove; cannot remove item");
d.push(g);c.splice(f,1);f--}}d.length&&this.va();return d},removeAll:function(b){if(b===n){var c=this.v(),d=c.slice(0);this.wa();c.splice(0,c.length);this.va();return d}return b?this.remove(function(c){return 0<=a.a.L(b,c)}):[]},destroy:function(b){var c=this.v(),d="function"!=typeof b||a.R(b)?function(a){return a===b}:b;this.wa();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.va()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=
a.a.L(b,c)}):[]},indexOf:function(b){var c=this();return a.a.L(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.wa(),this.v()[d]=c,this.va())},sorted:function(a){var c=this().slice(0);return a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.ya&&a.a.setPrototypeOf(a.Ea.fn,a.ra.fn);a.a.K("pop push reverse shift sort splice unshift".split(" "),function(b){a.Ea.fn[b]=function(){var a=this.v();this.wa();this.qc(a,b,arguments);var d=a[b].apply(a,arguments);this.va();
return d===a?this:d}});a.a.K(["slice"],function(b){a.Ea.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Ec=function(b){return a.R(b)&&"function"==typeof b.remove&&"function"==typeof b.push};a.b("observableArray",a.Ea);a.b("isObservableArray",a.Ec);a.Qa.trackArrayChanges=function(b,c){function d(){function c(){if(m){var d=[].concat(b.v()||[]),e;if(b.Ta("arrayChange")){if(!f||1<m)f=a.a.Ib(k,d,b.Hb);e=f}k=d;f=null;m=0;e&&e.length&&b.notifySubscribers(e,"arrayChange")}}e?c():(e=!0,h=
b.subscribe(function(){++m},null,"spectate"),k=[].concat(b.v()||[]),f=null,g=b.subscribe(c))}b.Hb={};c&&"object"==typeof c&&a.a.extend(b.Hb,c);b.Hb.sparse=!0;if(!b.qc){var e=!1,f=null,g,h,m=0,k,l=b.Na,p=b.cb;b.Na=function(a){l&&l.call(b,a);"arrayChange"===a&&d()};b.cb=function(a){p&&p.call(b,a);"arrayChange"!==a||b.Ta("arrayChange")||(g&&g.s(),h&&h.s(),h=g=null,e=!1,k=n)};b.qc=function(b,c,d){function l(a,b,c){return k[k.length]={status:a,value:b,index:c}}if(e&&!m){var k=[],p=b.length,h=d.length,
g=0;switch(c){case "push":g=p;case "unshift":for(c=0;c<h;c++)l("added",d[c],g+c);break;case "pop":g=p-1;case "shift":p&&l("deleted",b[g],g);break;case "splice":c=Math.min(Math.max(0,0>d[0]?p+d[0]:d[0]),p);for(var p=1===h?p:Math.min(c+(d[1]||0),p),h=c+h-2,g=Math.max(p,h),S=[],T=[],n=2;c<g;++c,++n)c<p&&T.push(l("deleted",b[c],c)),c<h&&S.push(l("added",d[n],c));a.a.Ac(T,S);break;default:return}f=k}}}};var q=Symbol("_state");a.o=a.X=function(b,c,d){function e(){if(0<arguments.length){if("function"===
typeof f)f.apply(g.jb,arguments);else 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 this}g.pa||a.u.Wb(e);(g.ja||g.G&&e.Ua())&&e.ea();return g.V}"object"===typeof b?d=b:(d=d||{},b&&(d.read=b));if("function"!=typeof d.read)throw Error("Pass a function that returns the value of the ko.computed");var f=d.write,g={V:n,qa:!0,ja:!0,nb:!1,bc:!1,pa:!1,sb:!1,G:!1,Lc:d.read,jb:c||d.owner,l:d.disposeWhenNodeIsRemoved||
d.l||null,Pa:d.disposeWhen||d.Pa,Kb:null,F:{},U:0,zc:null};e[q]=g;e.Cc="function"===typeof f;a.a.ya||a.a.extend(e,a.S.fn);a.S.fn.mb(e);a.a.wb(e,y);d.pure?(g.sb=!0,g.G=!0,a.a.extend(e,ba)):d.deferEvaluation&&a.a.extend(e,ca);a.options.deferUpdates&&a.Qa.deferred(e,!0);g.l&&(g.bc=!0,g.l.nodeType||(g.l=null));g.G||d.deferEvaluation||e.ea();g.l&&e.ia()&&a.a.N.Ka(g.l,g.Kb=function(){e.s()});return e};var y={equalityComparer:L,oa:function(){return this[q].U},Sa:function(){var b=[];a.a.O(this[q].F,function(a,
d){b[d.Ha]=d.aa});return b},Ob:function(b){if(!this[q].U)return!1;var c=this.Sa();return-1!==a.a.L(c,b)?!0:!!a.a.Fb(c,function(a){return a.Ob&&a.Ob(b)})},mc:function(a,c,d){if(this[q].sb&&c===this)throw Error("A 'pure' computed must not be called recursively");this[q].F[a]=d;d.Ha=this[q].U++;d.Ia=c.kb()},Ua:function(){var a,c,d=this[q].F;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Fa&&c.aa.Ga||c.aa.md(c.Ia)))return!0},rd:function(){this.Fa&&!this[q].nb&&this.Fa(!1)},ia:function(){var a=
this[q];return a.ja||0<a.U},yd:function(){this.Ga?this[q].ja&&(this[q].qa=!0):this.yc()},Oc:function(a){if(a.Bb){var c=a.subscribe(this.rd,this,"dirty"),d=a.subscribe(this.yd,this);return{aa:a,s:function(){c.s();d.s()}}}return a.subscribe(this.yc,this)},yc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[q].zc),this[q].zc=a.a.setTimeout(function(){b.ea(!0)},c)):b.Fa?b.Fa(!0):b.ea(!0)},ea:function(b){var c=this[q],d=c.Pa,e=!1;if(!c.nb&&!c.pa){if(c.l&&!a.a.Lb(c.l)||d&&d()){if(!c.bc){this.s();
return}}else c.bc=!1;c.nb=!0;try{e=this.jd(b)}finally{c.nb=!1}return e}},jd:function(b){var c=this[q],d=!1,e=c.sb?n:!c.U,d={bd:this,ib:c.F,Jb:c.U};a.u.oc({ad:d,$c:Z,o:this,Va:e});c.F={};c.U=0;var f=this.hd(c,d);c.U?d=this.ob(c.V,f):(this.s(),d=!0);d&&(c.G?this.Ab():this.notifySubscribers(c.V,"beforeChange"),c.V=f,this.notifySubscribers(c.V,"spectate"),!c.G&&b&&this.notifySubscribers(c.V),this.jc&&this.jc());e&&this.notifySubscribers(c.V,"awake");return d},hd:function(b,c){try{var d=b.Lc;return b.jb?
d.call(b.jb):d()}finally{a.u.end(),c.Jb&&!b.G&&a.a.O(c.ib,Y),b.qa=b.ja=!1}},v:function(a){var c=this[q];(c.ja&&(a||!c.U)||c.G&&this.Ua())&&this.ea();return c.V},qb:function(b){a.S.fn.qb.call(this,b);this.fc=function(){this[q].G||(this[q].qa?this.ea():this[q].ja=!1);return this[q].V};this.Fa=function(a){this.hc(this[q].V);this[q].ja=!0;a&&(this[q].qa=!0);this.ic(this,!a)}},s:function(){var b=this[q];!b.G&&b.F&&a.a.O(b.F,function(a,b){b.s&&b.s()});b.l&&b.Kb&&a.a.N.ub(b.l,b.Kb);b.F=n;b.U=0;b.pa=!0;b.qa=
!1;b.ja=!1;b.G=!1;b.l=n;b.Pa=n;b.Lc=n;this.Cc||(b.jb=n)}},ba={Na:function(b){var c=this,d=c[q];if(!d.pa&&d.G&&"change"==b){d.G=!1;if(d.qa||c.Ua())d.F=null,d.U=0,c.ea()&&c.Ab();else{var e=[];a.a.O(d.F,function(a,b){e[b.Ha]=a});a.a.K(e,function(a,b){var e=d.F[a],m=c.Oc(e.aa);m.Ha=b;m.Ia=e.Ia;d.F[a]=m});c.Ua()&&c.ea()&&c.Ab()}d.pa||c.notifySubscribers(d.V,"awake")}},cb:function(b){var c=this[q];c.pa||"change"!=b||this.Ta("change")||(a.a.O(c.F,function(a,b){b.s&&(c.F[a]={aa:b.aa,Ha:b.Ha,Ia:b.Ia},b.s())}),
c.G=!0,this.notifySubscribers(n,"asleep"))},kb:function(){var b=this[q];b.G&&(b.qa||this.Ua())&&this.ea();return a.S.fn.kb.call(this)}},ca={Na:function(a){"change"!=a&&"beforeChange"!=a||this.v()}};a.a.ya&&a.a.setPrototypeOf(y,a.S.fn);var P=a.ra.Ja;y[P]=a.o;a.Dc=function(a){return"function"==typeof a&&a[P]===y[P]};a.od=function(b){return a.Dc(b)&&b[q]&&b[q].sb};a.b("computed",a.o);a.b("dependentObservable",a.o);a.b("isComputed",a.Dc);a.b("isPureComputed",a.od);a.b("computed.fn",y);a.I(y,"peek",y.v);
a.I(y,"dispose",y.s);a.I(y,"isActive",y.ia);a.I(y,"getDependenciesCount",y.oa);a.I(y,"getDependencies",y.Sa);a.tb=function(b,c){if("function"===typeof b)return a.o(b,c,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b("pureComputed",a.tb);a.Dd=function(b,c,d){function e(c){var e=a.tb(b,d).extend({ka:"always"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return c?e(c.bind(d)):new Promise(e)};a.b("when",a.Dd);(function(){a.w={J:function(b){switch(a.a.$(b)){case "option":return!0===
b.__ko__hasDomDataOptionValue__?a.a.h.get(b,a.c.options.Tb):b.value;case "select":return 0<=b.selectedIndex?a.w.J(b.options[b.selectedIndex]):n;default:return b.value}},Za:function(b,c,d){switch(a.a.$(b)){case "option":"string"===typeof c?(a.a.h.set(b,a.c.options.Tb,n),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.h.set(b,a.c.options.Tb,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===typeof c?c:"");break;case "select":if(""===c||null===c)c=n;
for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.w.J(b.options[f]),h==c||""===h&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=e;break;default:if(null===c||c===n)c="";b.value=c}}}})();a.b("selectExtensions",a.w);a.b("selectExtensions.readValue",a.w.J);a.b("selectExtensions.writeValue",a.w.Za);a.m=function(){function b(b){b=a.a.$b(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));b+="\n,";var c=[],d=b.match(e),p,v=[],h=0;if(1<d.length){for(var w=0,u;u=d[w];++w){var t=u.charCodeAt(0);if(44===
t){if(0>=h){c.push(p&&v.length?{key:p,value:v.join("")}:{unknown:p||v.join("")});p=h=0;v=[];continue}}else if(58===t){if(!h&&!p&&1===v.length){p=v.pop();continue}}else if(47===t&&1<u.length&&(47===u.charCodeAt(1)||42===u.charCodeAt(1)))continue;else 47===t&&w&&1<u.length?(t=d[w-1].match(f))&&!g[t[0]]&&(b=b.substr(b.indexOf(u)+1),d=b.match(e),w=-1,u="/"):40===t||123===t||91===t?++h:41===t||125===t||93===t?--h:p||v.length||34!==t&&39!==t||(u=u.slice(1,-1));v.push(u)}if(0<h)throw Error("Unbalanced parentheses, braces, or brackets");
}return c}var c=["true","false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,g={"in":1,"return":1,"typeof":1},h={};return{Oa:[],ua:h,Ub:b,rb:function(e,k){function l(b,e){var k;if(!w){var B=a.getBindingHandler(b);if(B&&B.preprocess&&!(e=B.preprocess(e,b,l)))return;
if(B=h[b])k=e,0<=a.a.L(c,k)?k=!1:(B=k.match(d),k=null===B?!1:B[1]?"Object("+B[1]+")"+B[2]:k),B=k;B&&v.push("'"+("string"==typeof h[b]?h[b]:b)+"':function(_z){"+k+"=_z}")}g&&(e="function(){return "+e+" }");f.push("'"+b+"':"+e)}k=k||{};var f=[],v=[],g=k.valueAccessors,w=k.bindingParams,u="string"===typeof e?b(e):e;a.a.K(u,function(a){l(a.key||a.unknown,a.value)});v.length&&l("_ko_property_writers","{"+v.join(",")+" }");return f.join(",")},qd:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;
return!1},$a:function(b,c,d,e,f){if(b&&a.R(b))!a.Wa(b)||f&&b.v()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();a.b("expressionRewriting",a.m);a.b("expressionRewriting.bindingRewriteValidators",a.m.Oa);a.b("expressionRewriting.parseObjectLiteral",a.m.Ub);a.b("expressionRewriting.preProcessBindings",a.m.rb);a.b("expressionRewriting._twoWayBindings",a.m.ua);a.b("jsonExpressionRewriting",a.m);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.m.rb);(function(){function b(a){return 8==
a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.h.set(f,k,!0),h--,0===h))return g;g.push(f);b(f)&&h++}if(!e)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=z&&"\x3c!--test--\x3e"===z.createComment("test").text,g=f?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:
/^\s*ko(?:\s+([\s\S]+))?\s*$/,h=f?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,m={ul:!0,ol:!0},k="__ko_matchedEndComment__";a.f={ba:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Aa:function(c){if(b(c)){c=a.f.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Mb(c)},ta:function(c,d){if(b(c)){a.f.Aa(c);for(var e=c.nextSibling,f=0,k=d.length;f<k;f++)e.parentNode.insertBefore(d[f],e)}else a.a.ta(c,d)},Kc:function(a,c){var d;b(a)?(d=a.nextSibling,a=a.parentNode):d=a.firstChild;
d?c!==d&&a.insertBefore(c,d):a.appendChild(c)},Pb:function(c,d,e){e?(e=e.nextSibling,b(c)&&(c=c.parentNode),e?d!==e&&c.insertBefore(d,e):c.appendChild(d)):a.f.Kc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error("Found invalid end comment, as the first child of "+a);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.h.get(f,k))throw Error("Found end comment without a matching opening comment, as child of "+
d);return null}return d.nextSibling},ld:b,Cd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Hc:function(d){if(m[a.a.$(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var k;k=f.firstChild;var h=null;if(k){do if(h)h.push(k);else if(b(k)){var g=e(k,!0);g?k=g:h=[k]}else c(k)&&(h=[k]);while(k=k.nextSibling)}if(k=h)for(h=f.nextSibling,g=0;g<k.length;g++)h?d.insertBefore(k[g],h):d.appendChild(k[g])}while(f=f.nextSibling)}}}}})();a.b("virtualElements",a.f);a.b("virtualElements.allowedBindings",
a.f.ba);a.b("virtualElements.emptyNode",a.f.Aa);a.b("virtualElements.insertAfter",a.f.Pb);a.b("virtualElements.prepend",a.f.Kc);a.b("virtualElements.setDomNodeChildren",a.f.ta);(function(){a.da=function(){this.Zc={}};a.a.extend(a.da.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=b.getAttribute("data-bind")||a.j.getComponentNameForNode(b);case 8:return a.f.ld(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,
c,b):null;return a.j.lc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.j.lc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.f.Cd(b);default:return null}},parseBindingsString:function(b,c,d,e){try{var f=this.Zc,g=b+(e&&e.valueAccessors||""),h;if(!(h=f[g])){var m,k="with($context){with($data||{}){return{"+a.m.rb(b,e)+"}}}";m=new Function("$context",
"$element",k);h=f[g]=m}return h(c,d)}catch(l){throw l.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+l.message,l;}}});a.da.instance=new a.da})();a.b("bindingProvider",a.da);(function(){function b(b){var c=(b=a.a.h.get(b,A))&&b.M;c&&(b.M=null,c.Ic())}function c(c,d,e){this.node=c;this.pc=d;this.gb=[];this.D=!1;d.M||a.a.N.Ka(c,b);e&&e.M&&(e.M.gb.push(c),this.Eb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Da(a.u.C(b),function(a,
c){return function(){return b()[c]}})}function g(b,c,e){return"function"===typeof b?f(b.bind(null,c,e)):a.a.Da(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.f.firstChild(c);if(d){var e,f=a.da.instance,l=f.preprocessNode;if(l){for(;e=d;)d=a.f.nextSibling(e),l.call(f,e);d=a.f.firstChild(c)}for(;e=d;)d=a.f.nextSibling(e),k(b,e)}a.i.ka(c,a.i.D)}function k(b,c){var d=b,e=1===c.nodeType;e&&a.f.Hc(c);if(e||a.da.instance.nodeHasBindings(c))d=p(c,null,b).bindingContextForDescendants;
d&&!t[a.a.$(c)]&&m(d,c)}function l(b){var c=[],d={},e=[];a.a.O(b,function aa(f){if(!d[f]){var k=a.getBindingHandler(f);k&&(k.after&&(e.push(f),a.a.K(k.after,function(c){if(b[c]){if(-1!==a.a.L(e,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", "));aa(c)}}),e.length--),c.push({key:f,Bc:k}));d[f]=!0}});return c}function p(b,c,d){var f=a.a.h.Nb(b,A,{}),k=f.Uc;if(!c){if(k)throw Error("You cannot apply bindings multiple times to the same element.");
f.Uc=!0}k||(f.context=d);f.Sb||(f.Sb={});var p;if(c&&"function"!==typeof c)p=c;else{var g=a.da.instance,v=g.getBindingAccessors||h,m=a.X(function(){if(p=c?c(d,b):v.call(g,b,d)){if(d[r])d[r]();if(d[u])d[u]()}return p},null,{l:b});p&&m.ia()||(m=null)}var t=d,w;if(p){var J=function(){return a.a.Da(m?m():p,e)},q=m?function(a){return function(){return e(m()[a])}}:function(a){return p[a]};J.get=function(a){return p[a]&&e(q(a))};J.has=function(a){return a in p};a.i.D in p&&a.i.subscribe(b,a.i.D,function(){var c=
(0,p[a.i.D])();if(c){var d=a.f.childNodes(b);d.length&&c(d,a.vc(d[0]))}});a.i.na in p&&(t=a.i.yb(b,d),a.i.subscribe(b,a.i.na,function(){var c=(0,p[a.i.na])();c&&a.f.firstChild(b)&&c(b)}));f=l(p);a.a.K(f,function(c){var d=c.Bc.init,e=c.Bc.update,f=c.key;if(8===b.nodeType&&!a.f.ba[f])throw Error("The binding '"+f+"' cannot be used with virtual elements");try{"function"==typeof d&&a.u.C(function(){var a=d(b,q(f),J,t.$data,t);if(a&&a.controlsDescendantBindings){if(w!==n)throw Error("Multiple bindings ("+
w+" and "+f+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");w=f}}),"function"==typeof e&&a.X(function(){e(b,q(f),J,t.$data,t)},null,{l:b})}catch(k){throw k.message='Unable to process binding "'+f+": "+p[f]+'"\nMessage: '+k.message,k;}})}f=w===n;return{shouldBindDescendants:f,bindingContextForDescendants:f&&t}}function v(b,c){return b&&b instanceof a.ca?b:new a.ca(b,n,n,c)}var r=Symbol("_subscribable"),w=Symbol("_ancestorBindingInfo"),
u=Symbol("_dataDependency");a.c={};var t={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.c[b]};var J={};a.ca=function(b,c,d,e,f){function k(){var b=g?p():p,f=a.a.g(b);c?(a.a.extend(l,c),w in c&&(l[w]=c[w])):(l.$parents=[],l.$root=f,l.ko=a);l[r]=v;h?f=l.$data:(l.$rawData=b,l.$data=f);d&&(l[d]=f);e&&e(l,c,f);if(c&&c[r]&&!a.P.o().Ob(c[r]))c[r]();m&&(l[u]=m);return l.$data}var l=this,h=b===J,p=h?n:b,g="function"==typeof p&&!a.R(p),v,m=f&&f.dataDependency;f&&f.exportDependencies?
k():(v=a.tb(k),v.v(),v.ia()?v.equalityComparer=null:l[r]=n)};a.ca.prototype.createChildContext=function(b,c,d,e){!e&&c&&"object"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f="function"==typeof b&&!a.R(b);return new a.ca(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.ca(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.ca.prototype.extend=function(b,c){return new a.ca(J,
this,null,function(c){a.a.extend(c,"function"==typeof b?b(c):b)},c)};var A=a.a.h.fa();c.prototype.Ic=function(){this.Eb&&this.Eb.M&&this.Eb.M.dd(this.node)};c.prototype.dd=function(b){a.a.Ma(this.gb,b);!this.gb.length&&this.D&&this.tc()};c.prototype.tc=function(){this.D=!0;this.pc.M&&!this.gb.length&&(this.pc.M=null,a.a.N.ub(this.node,b),a.i.ka(this.node,a.i.na),this.Ic())};a.i={D:"childrenComplete",na:"descendantsComplete",subscribe:function(b,c,d,e,f){var k=a.a.h.Nb(b,A,{});k.Ba||(k.Ba=new a.S);
f&&f.notifyImmediately&&k.Sb[c]&&a.u.C(d,e,[b]);return k.Ba.subscribe(d,e,c)},ka:function(b,c){var d=a.a.h.get(b,A);if(d&&(d.Sb[c]=!0,d.Ba&&d.Ba.notifySubscribers(b,c),c==a.i.D))if(d.M)d.M.tc();else if(d.M===n&&d.Ba&&d.Ba.Ta(a.i.na))throw Error("descendantsComplete event not supported for bindings on this node");},yb:function(b,d){var e=a.a.h.Nb(b,A,{});e.M||(e.M=new c(b,e,d[w]));return d[w]==e?d:d.extend(function(a){a[w]=e})}};a.Ad=function(b){return(b=a.a.h.get(b,A))&&b.context};a.eb=function(b,
c,d){1===b.nodeType&&a.f.Hc(b);return p(b,c,v(d))};a.Xc=function(b,c,d){d=v(d);return a.eb(b,g(c,d,b),d)};a.La=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(v(a),b)};a.nc=function(a,b,c){if(2>arguments.length){if(b=z.body,!b)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");k(v(a,c),b)};a.uc=function(b){return!b||
1!==b.nodeType&&8!==b.nodeType?n:a.Ad(b)};a.vc=function(b){return(b=a.uc(b))?b.$data:n};a.b("bindingHandlers",a.c);a.b("bindingEvent",a.i);a.b("bindingEvent.subscribe",a.i.subscribe);a.b("bindingEvent.startPossiblyAsyncContentBinding",a.i.yb);a.b("applyBindings",a.nc);a.b("applyBindingsToDescendants",a.La);a.b("applyBindingAccessorsToNode",a.eb);a.b("applyBindingsToNode",a.Xc);a.b("contextFor",a.uc);a.b("dataFor",a.vc)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,
c)?f[c]:b,l;k?k.subscribe(e):(k=f[c]=new a.S,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,pd:e};delete f[c];l||e?k.notifySubscribers(b):a.la.vb(function(){k.notifySubscribers(b)})}),l=!0)}function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a,c)}):b(null,null)})}function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var p=l.shift();if(p){var g=p[c];if(g){var r=!1;if(g.apply(p,d.concat(function(a){r?f(null):null!==a?f(a):e(c,d,f,l)}))!==
b&&(r=!0,!p.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else e(c,d,f,l)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.pd?a.u.C(function(){e(f.definition)}):a.la.vb(function(){e(f.definition)}):c(d,e)},sc:function(a){delete g[a]},gc:e};a.j.loaders=[];a.b("components",a.j);a.b("components.get",a.j.get);a.b("components.clearCachedDefinition",
a.j.sc)})();(function(){function b(b,c,d,e){function g(){0===--u&&e(h)}var h={},u=2,t=d.template;d=d.viewModel;t?f(c,t,function(c){a.j.gc("loadTemplate",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.j.gc("loadViewModel",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)});else if("function"===typeof b[m])d(b[m]);else if("instance"in b){var e=b.instance;d(function(){return e})}else"viewModel"in b?c(a,b.viewModel,d):a("Unknown viewModel value: "+
b)}function d(b){switch(a.a.$(b)){case "script":return a.a.sa(b.text);case "textarea":return a.a.sa(b.value);case "template":if(e(b.content))return a.a.za(b.content.childNodes)}return a.a.za(b.childNodes)}function e(a){return G.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){"string"===typeof b.require?R||G.require?(R||G.require)([b.require],function(a){a&&"object"===typeof a&&a.Ed&&a["default"]&&(a=a["default"]);c(a)}):a("Uses require, but no AMD loader is present"):
c(b)}function g(a){return function(b){throw Error("Component '"+a+"': "+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.j.pb(b))throw Error("Component "+b+" is already registered");h[b]=c};a.j.pb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b];a.j.sc(b)};a.j.wc={getConfig:function(b,c){c(a.j.pb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,
c,f){b=g(b);if("string"===typeof c)f(a.a.sa(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.Ca(c.childNodes));else if(c.element)if(c=c.element,G.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if("string"===typeof c){var h=z.getElementById(c);h?f(d(h)):b("Cannot find element with ID "+c)}else b("Unknown element type: "+c);else b("Unknown template value: "+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m="createViewModel";a.b("components.register",a.j.register);
a.b("components.isRegistered",a.j.pb);a.b("components.unregister",a.j.unregister);a.b("components.defaultLoader",a.j.wc);a.j.loaders.push(a.j.wc);a.j.Fd=h})();(function(){function b(b,e){var f=b.getAttribute("params");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Da(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Da(f,function(c){var e=c.v();return c.ia()?a.o({read:function(){return a.a.g(c())},write:a.Wa(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,
"$raw")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.$(b);if(a.j.pb(c)&&(-1!=c.indexOf("-")||"[object HTMLUnknownElement]"==""+b))return c};a.j.lc=function(c,e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.da})();(function(){function b(b,
c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has no template");b=a.a.za(c);a.f.ta(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,b,c):b}var d=0;a.c.component={init:function(e,f,g,h,m){function k(){var a=l&&l.dispose;"function"===typeof a&&a.call(l);v&&v.s();p=l=v=null}var l,p,v,r=a.a.Ca(a.f.childNodes(e));a.f.Aa(e);a.a.N.Ka(e,k);a.o(function(){var g=a.a.g(f()),h,t;"string"===typeof g?h=g:(h=a.a.g(g.name),t=a.a.g(g.params));if(!h)throw Error("No component name specified");
var n=a.i.yb(e,m),A=p=++d;a.j.get(h,function(d){if(p===A){k();if(!d)throw Error("Unknown component '"+h+"'");b(h,d,e);var f=c(d,t,{element:e,templateNodes:r});d=n.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=r}});f&&f.koDescendantsComplete&&(v=a.i.subscribe(e,a.i.na,f.koDescendantsComplete,f));l=f;a.La(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.f.ba.component=!0})();a.c.attr={update:function(b,c){var d=a.a.g(c())||{};a.a.O(d,function(c,d){d=
a.a.g(d);var g=c.indexOf(":"),g="lookupNamespaceURI"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===d||d===n;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,d));"name"===c&&(b.name=h?"":d)})}};(function(){function b(b,d,e){var f=a.a.L(a.a.Vb(b),d);0>f?e&&b.push(d):e||b.splice(f,1)}a.c.checked={after:["value","attr"],init:function(c,d,e){function f(){var f=c.checked,g=h();if(!a.P.Va()&&(f||!k&&!a.P.oa())){var l=a.u.C(d);
if(p){var r=v?l.v():l,q=w;w=g;q!==g?f&&(b(r,g,!0),b(r,q,!1)):b(r,g,f);v&&a.Wa(l)&&l(r)}else m&&(g===n?g=f:f||(g=n)),a.m.$a(l,e,"checked",g,!0)}}function g(){var b=a.a.g(d()),e=h();p?(c.checked=0<=a.a.L(b,e),w=e):c.checked=m&&e===n?!!b:h()===b}var h=a.tb(function(){if(e.has("checkedValue"))return a.a.g(e.get("checkedValue"));if(r)return e.has("value")?a.a.g(e.get("value")):c.value}),m="checkbox"==c.type,k="radio"==c.type;if(m||k){var l=d(),p=m&&a.a.g(l)instanceof Array,v=!(p&&l.push&&l.splice),r=k||
p,w=p?h():n;k&&!c.name&&a.c.uniqueName.init(c,function(){return!0});a.o(f,null,{l:c});a.a.H(c,"click",f);a.o(g,null,{l:c});l=n}}};a.m.ua.checked=!0;a.c.checkedValue={update:function(b,d){b.value=a.a.g(d())}}})();a.c["class"]={update:function(b,c){var d=a.a.$b(a.a.g(c()));O(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;O(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.g(c());null!==d&&"object"==typeof d?a.a.O(d,function(c,d){d=a.a.g(d);O(b,c,d)}):a.c["class"].update(b,c)}};a.c.enable={update:function(b,
c){var d=a.a.g(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.c.disable={update:function(b,c){a.c.enable.update(b,function(){return!a.a.g(c())})}};a.c.event={init:function(b,c,d,e,f){var g=c()||{};a.a.O(g,function(g){"string"==typeof g&&a.a.H(b,g,function(b){var k,l=c()[g];if(l){try{var p=a.a.Ca(arguments);e=f.$data;p.unshift(e);k=l.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&
b.stopPropagation())}})})}};a.c.foreach={Gc:function(b){return function(){var c=b(),d=a.a.Vb(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.Z.Ja};a.a.g(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.Z.Ja}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Gc(c))},update:function(b,
c,d,e,f){return a.c.template.update(b,a.c.foreach.Gc(c),d,e,f)}};a.m.Oa.foreach=!1;a.f.ba.foreach=!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;e=b.ownerDocument.activeElement===b;var f=c();a.m.$a(f,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.H(b,"focus",f);a.a.H(b,"focusin",f);a.a.H(b,"blur",g);a.a.H(b,"focusout",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.g(c());b.__ko_hasfocusUpdating||
b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.C(a.a.zb,null,[b,d?"focusin":"focusout"]))}};a.m.ua.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.ua.hasFocus="hasfocus";a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Zb(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,v={},r,n,u;if(d){m=h.get("as");var t=h.get("noChildContext");u=!(m&&t);v={as:m,noChildContext:t,
exportDependencies:u}}n=(r="render"==h.get("completeOn"))||h.has(a.i.na);a.o(function(){var h=a.a.g(c()),m=!e!==!h,t=!p,q;if(u||m!==l){n&&(k=a.i.yb(b,k));if(m){if(!d||u)v.dataDependency=a.P.o();q=d?k.createChildContext("function"==typeof h?h:c,v):a.P.oa()?k.extend(null,v):k}t&&a.P.oa()&&(p=a.a.za(a.f.childNodes(b),!0));m?(t||a.f.ta(b,a.a.za(p)),a.La(q,b)):(a.f.Aa(b),r||a.i.ka(b,a.i.D));l=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Oa[b]=!1;a.f.ba[b]=!0}b("if");b("ifnot",!1,!0);b("with",
!0)})();a.c.let={init:function(b,c,d,e,f){c=f.extend(c);a.La(c,b);return{controlsDescendantBindings:!0}}};a.f.ba.let=!0;var Q={};a.c.options={init:function(b){if("select"!==a.a.$(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.fb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function g(c,d){if(w&&
l)a.i.ka(b,a.i.D);else if(r.length){var e=0<=a.a.L(r,a.w.J(d[0]));d[0].selected=e;w&&!e&&a.u.C(a.a.zb,null,[b,"change"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,k=a.a.g(c()),l=d.get("valueAllowUnset")&&d.has("value"),p=d.get("optionsIncludeDestroyed");c={};var v,r=[];l||(h?r=e().map(a.w.J):0<=b.selectedIndex&&r.push(a.w.J(b.options[b.selectedIndex])));k&&("undefined"==typeof k.length&&(k=[k]),v=a.a.fb(k,function(b){return p||b===n||null===b||!a.a.g(b._destroy)}),d.has("optionsCaption")&&
(k=a.a.g(d.get("optionsCaption")),null!==k&&k!==n&&v.unshift(Q)));var w=!1;c.beforeRemove=function(a){b.removeChild(a)};k=g;d.has("optionsAfterRender")&&"function"==typeof d.get("optionsAfterRender")&&(k=function(b,c){g(0,c);a.u.C(d.get("optionsAfterRender"),null,[c[0],b!==Q?b:n])});a.a.Yb(b,v,function(c,e,k){k.length&&(r=!l&&k[0].selected?[a.w.J(k[0])]:[],w=!0);e=b.ownerDocument.createElement("option");c===Q?(a.a.xb(e,d.get("optionsCaption")),a.w.Za(e,n)):(k=f(c,d.get("optionsValue"),c),a.w.Za(e,
a.a.g(k)),c=f(c,d.get("optionsText"),k),a.a.xb(e,c));return[e]},c,k);if(!l){var u;h?u=r.length&&e().length<r.length:u=r.length&&0<=b.selectedIndex?a.w.J(b.options[b.selectedIndex])!==r[0]:r.length||0<=b.selectedIndex;u&&a.u.C(a.a.zb,null,[b,"change"])}(l||a.P.Va())&&a.i.ka(b,a.i.D);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.c.options.Tb=a.a.h.fa();a.c.selectedOptions={init:function(b,c,d){function e(){var e=c(),f=[];a.a.K(b.getElementsByTagName("option"),function(b){b.selected&&f.push(a.w.J(b))});
a.m.$a(e,d,"selectedOptions",f)}function f(){var d=a.a.g(c()),e=b.scrollTop;d&&"number"==typeof d.length&&a.a.K(b.getElementsByTagName("option"),function(b){var c=0<=a.a.L(d,a.w.J(b));b.selected!=c&&(b.selected=c)});b.scrollTop=e}if("select"!=a.a.$(b))throw Error("selectedOptions binding applies only to SELECT elements");var g;a.i.subscribe(b,a.i.D,function(){g?e():(a.a.H(b,"change",e),g=a.o(f,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}};a.m.ua.selectedOptions=!0;a.c.style={update:function(b,
c){var d=a.a.g(c()||{});a.a.O(d,function(c,d){d=a.a.g(d);if(null===d||d===n||!1===d)d="";if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=d+"px")}})}};a.c.submit={init:function(b,c,d,e,f){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");a.a.H(b,"submit",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?
a.preventDefault():a.returnValue=!1)}})}};a.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.xb(b,c())}};a.f.ba.text=!0;(function(){a.c.textInput={init:function(b,c,d){function e(){var d=a.a.g(c());if(null===d||d===n)d="";m!==n&&d===m?a.a.setTimeout(e,4):b.value!==d&&(b.value=d,g=b.value)}function f(){clearTimeout(h);m=h=n;var e=b.value;g!==e&&(g=e,a.m.$a(c(),d,"textInput",e))}var g=b.value,h,m;a.a.H(b,"input",f);a.a.H(b,"change",f);a.a.H(b,"blur",f);a.o(e,null,
{l:b})}};a.m.ua.textInput=!0;a.c.textinput={preprocess:function(a,c,d){d("textInput",a)}}})();a.c.uniqueName={init:function(b,c){c()&&(b.name="ko_unique_"+ ++a.c.uniqueName.cd)}};a.c.uniqueName.cd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has("as")&&(g={as:d.get("as"),noChildContext:d.get("noChildContext")});c=f.createChildContext(c,g);a.La(c,b);return{controlsDescendantBindings:!0}}};a.f.ba.using=!0;a.c.value={init:function(b,c,d){var e=a.a.$(b),f="input"==e;if(!f||"checkbox"!=b.type&&"radio"!=
b.type){var g=[],h=d.get("valueUpdate"),m=null;h&&("string"==typeof h?g=[h]:g=h?h.filter(function(a,b){return h.indexOf(a)===b}):[],a.a.Ma(g,"change"));var k=function(){m=null;var e=c(),f=a.w.J(b);a.m.$a(e,d,"value",f)};a.a.K(g,function(c){var d=k;a.a.Bd(c,"after")&&(d=function(){m=a.w.J(b);a.a.setTimeout(k,0)},c=c.substring(5));a.a.H(b,c,d)});var l;l=f&&"file"==b.type?function(){var d=a.a.g(c());null===d||d===n||""===d?b.value="":a.u.C(k)}:function(){var f=a.a.g(c()),g=a.w.J(b);if(null!==m&&f===
m)a.a.setTimeout(l,0);else if(f!==g||g===n)"select"===e?(g=d.get("valueAllowUnset"),a.w.Za(b,f,g),g||f===a.w.J(b)||a.u.C(k)):a.w.Za(b,f)};if("select"===e){var p;a.i.subscribe(b,a.i.D,function(){p?d.get("valueAllowUnset")?l():k():(a.a.H(b,"change",k),p=a.o(l,null,{l:b}))},null,{notifyImmediately:!0})}else a.a.H(b,"change",k),a.o(l,null,{l:b})}else a.eb(b,{checkedValue:c})},update:function(){}};a.m.ua.value=!0;a.c.visible={update:function(b,c){var d=a.a.g(c()),e="none"!=b.style.display;d&&!e?b.style.display=
"":!d&&e&&(b.style.display="none")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.g(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})("click");a.ga=function(){};a.ga.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};a.ga.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.ga.prototype.makeTemplateSource=
function(b,c){if("string"==typeof b){c=c||z;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.A.B(d)}if(1==b.nodeType||8==b.nodeType)return new a.A.ha(b);throw Error("Unknown template type: "+b);};a.ga.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ga.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};
a.ga.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.ga);a.cc=function(){function b(b,c,d,h){b=a.m.Ub(b);for(var m=a.m.Oa,k=0;k<b.length;k++){var l=b[k].key;if(Object.prototype.hasOwnProperty.call(m,l)){var p=m[l];if("function"===typeof p){if(l=p(b[k].value))throw Error(l);}else if(!p)throw Error("This template engine does not support the '"+l+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+
a.m.rb(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{gd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.cc.ud(b,c)},d)},ud:function(a,f){return a.replace(c,function(a,c,d,e,l){return b(l,c,d,f)}).replace(d,function(a,c){return b(c,
"\x3c!-- ko --\x3e","#comment",f)})},Yc:function(b,c){return a.Y.Qb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.eb(m,b,h)})}}}();a.b("__tr_ambtns",a.cc.Yc);(function(){a.A={};a.A.B=function(b){if(this.B=b){var c=a.a.$(b);this.Xa="script"===c?1:"textarea"===c?2:"template"==c&&b.content&&11===b.content.nodeType?3:4}};a.A.B.prototype.text=function(){var b=1===this.Xa?"text":2===this.Xa?"value":"innerHTML";if(0==arguments.length)return this.B[b];var c=arguments[0];"innerHTML"===
b?a.a.Zb(this.B,c):this.B[b]=c};var b=a.a.h.fa()+"_";a.A.B.prototype.data=function(c){if(1===arguments.length)return a.a.h.get(this.B,b+c);a.a.h.set(this.B,b+c,arguments[1])};var c=a.a.h.fa();a.A.B.prototype.nodes=function(){var b=this.B;if(0==arguments.length){var e=a.a.h.get(b,c)||{},f=e.hb||(3===this.Xa?b.content:4===this.Xa?b:n);if(!f||e.Vc){var g=this.text();g&&g!==e.Ya&&(f=a.a.wd(g,b.ownerDocument),a.a.h.set(b,c,{hb:f,Ya:g,Vc:!0}))}return f}e=arguments[0];this.Xa!==n&&this.text("");a.a.h.set(b,
c,{hb:e})};a.A.ha=function(a){this.B=a};a.A.ha.prototype=new a.A.B;a.A.ha.prototype.constructor=a.A.ha;a.A.ha.prototype.text=function(){if(0==arguments.length){var b=a.a.h.get(this.B,c)||{};b.Ya===n&&b.hb&&(b.Ya=b.hb.innerHTML);return b.Ya}a.a.h.set(this.B,c,{Ya:arguments[0]})};a.b("templateSources",a.A);a.b("templateSources.domElement",a.A.B);a.b("templateSources.anonymousTemplate",a.A.ha)})();(function(){function b(b,c,d){var e;for(c=a.f.nextSibling(c);b&&(e=b)!==c;)b=a.f.nextSibling(e),d(e,b)}
function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.da.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):(c.push(e,f),a.a.Ra(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.nc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.Y.Qc(b,[d])});a.a.Ra(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,
f,h,m){m=m||{};var n=(b&&d(b)||f||{}).ownerDocument,u=m.templateEngine||g;a.cc.gd(f,u,n);f=u.renderTemplate(f,h,m,n);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");n=!1;switch(e){case "replaceChildren":a.f.ta(b,f);n=!0;break;case "replaceNode":a.a.Mc(b,f);n=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}n&&(c(f,h),m.afterRender&&a.u.C(m.afterRender,null,[f,h[m.as||"$data"]]),
"replaceChildren"==e&&a.i.ka(b,a.i.D));return f}function f(b,c,d){return a.R(b)?b():"function"===typeof b?b(c,d):b}var g;a.Nc=function(b){if(b!=n&&!(b instanceof a.ga))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.Xb=function(b,c,h,m,r){h=h||{};if((h.templateEngine||g)==n)throw Error("Set a template engine before calling renderTemplate");r=r||"replaceChildren";if(m){var w=d(m);return a.X(function(){var g=c&&c instanceof a.ca?c:new a.ca(c,null,null,null,{exportDependencies:!0}),
n=f(b,g.$data,g),g=e(m,r,n,g,h);"replaceNode"==r&&(m=g,w=d(m))},null,{Pa:function(){return!w||!a.a.Lb(w)},l:w&&"replaceNode"==r?w.parentNode:w})}return a.Y.Qb(function(d){a.Xb(b,c,h,d,"replaceNode")})};a.xd=function(b,d,g,h,m){function w(b,c){a.u.C(a.a.Yb,null,[h,b,t,g,u,c]);a.i.ka(h,a.i.D)}function u(a,b){c(b,q);g.afterRender&&g.afterRender(b,a);q=null}function t(a,c){q=m.createChildContext(a,{as:A,noChildContext:g.noChildContext,extend:function(a){a.$index=c;A&&(a[A+"Index"]=c)}});var d=f(b,a,q);
return e(h,"ignoreTargetNode",d,q,g)}var q,A=g.as,B=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(B||g.beforeRemove||!a.Ec(d))return a.X(function(){var b=a.a.g(d)||[];"undefined"==typeof b.length&&(b=[b]);B&&(b=a.a.fb(b,function(b){return b===n||null===b||!a.a.g(b._destroy)}));w(b)},null,{l:h});w(d.v());var y=d.subscribe(function(a){w(d(),a)},null,"arrayChange");y.l(h);return y};var h=a.a.h.fa(),m=a.a.h.fa();a.c.template={init:function(b,c){var d=a.a.g(c());if("string"==
typeof d||"name"in d)a.f.Aa(b);else if("nodes"in d){d=d.nodes||[];if(a.R(d))throw Error('The "nodes" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.h.get(e,m)||(e=a.a.Rb(d),a.a.h.set(e,m,!0));(new a.A.ha(b)).nodes(e)}else if(d=a.f.childNodes(b),0<d.length)e=a.a.Rb(d),(new a.A.ha(b)).nodes(e);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.g(g);
d=!0;e=null;"string"==typeof c?c={}:(g="name"in c?c.name:b,"if"in c&&(d=a.a.g(c["if"])),d&&"ifnot"in c&&(d=!a.a.g(c.ifnot)),d&&!g&&(d=!1));"foreach"in c?e=a.xd(g,d&&c.foreach||[],c,b,f):d?(d=f,"data"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),e=a.Xb(g,d,c,b)):a.f.Aa(b);f=e;(c=a.a.h.get(b,h))&&"function"==typeof c.s&&c.s();a.a.h.set(b,h,!f||f.ia&&!f.ia()?n:f)}};a.m.Oa.template=function(b){b=a.m.Ub(b);return 1==b.length&&b[0].unknown||a.m.qd(b,
"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.f.ba.template=!0})();a.b("setTemplateEngine",a.Nc);a.b("renderTemplate",a.Xb);a.a.Ac=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===m.value){h.moved=m.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Ib=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,k=[],l,p=b.length,n,r=d.length,q=r-p||1,u=p+r+1,t,y,
A;for(l=0;l<=p;l++)for(y=t,k.push(t=[]),A=h(r,l+q),n=m(0,l-1);n<=A;n++)t[n]=n?l?b[l-1]===d[n-1]?y[n-1]:h(y[n]||u,t[n-1]||u)+1:n+1:l+1;h=[];m=[];q=[];l=p;for(n=r;l||n;)r=k[l][n]-1,n&&r===k[l][n-1]?m.push(h[h.length]={status:e,value:d[--n],index:n}):l&&r===k[l-1][n]?q.push(h[h.length]={status:f,value:b[--l],index:l}):(--n,--l,g.sparse||h.push({status:"retained",value:d[n]}));a.a.Ac(q,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};
a=a||[];d=d||[];return a.length<d.length?b(a,d,"added","deleted",e):b(d,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.Ib);(function(){function b(b,c,d,h,m){var k=[],l=a.X(function(){var l=c(d,m,a.a.Ra(k,b))||[];0<k.length&&(a.a.Mc(k,l),h&&a.u.C(h,null,[d,l,m]));k.length=0;a.a.Gb(k,l)},null,{l:b,Pa:function(){return!a.a.Wc(k)}});return{W:k,X:l.ia()?l:n}}var c=a.a.h.fa(),d=a.a.h.fa();a.a.Yb=function(e,f,g,h,m,k){function l(b){x={xa:b,lb:a.ra(y++)};u.push(x);w||D.push(x)}function p(b){x=r[b];
y!==x.lb.v()&&C.push(x);x.lb(y++);a.a.Ra(x.W,e);u.push(x)}function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.K(c[d].W,function(a){b(a,d,c[d].xa)})}f=f||[];"undefined"==typeof f.length&&(f=[f]);h=h||{};var r=a.a.h.get(e,c),w=!r,u=[],t=0,y=0,A=[],B=[],z=[],C=[],D=[],x,G=0;if(w)a.a.K(f,l);else{if(!k||r&&r._countWaitingForRemove){var E=Array.prototype.map.call(r,function(a){return a.xa});k=a.a.Ib(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,F,H,I;F=k[E];E++)switch(H=F.moved,I=F.index,
F.status){case "deleted":for(;t<I;)p(t++);H===n&&(x=r[t],x.X&&(x.X.s(),x.X=n),a.a.Ra(x.W,e).length&&(h.beforeRemove&&(u.push(x),G++,x.xa===d?x=null:z.push(x)),x&&A.push.apply(A,x.W)));t++;break;case "added":for(;y<I;)p(t++);H!==n?(B.push(u.length),p(H)):l(F.value)}for(;y<f.length;)p(t++);u._countWaitingForRemove=G}a.a.h.set(e,c,u);q(h.beforeMove,C);a.a.K(A,h.beforeRemove?a.ma:a.removeNode);var K,M,N;try{N=e.ownerDocument.activeElement}catch(L){}if(B.length)for(;(E=B.shift())!=n;){x=u[E];for(K=n;E;)if((M=
u[--E].W)&&M.length){K=M[M.length-1];break}for(f=0;t=x.W[f];K=t,f++)a.f.Pb(e,t,K)}for(E=0;x=u[E];E++){x.W||a.a.extend(x,b(e,g,x.xa,m,x.lb));for(f=0;t=x.W[f];K=t,f++)a.f.Pb(e,t,K);!x.nd&&m&&(m(x.xa,x.W,x.lb),x.nd=!0,K=x.W[x.W.length-1])}N&&e.ownerDocument.activeElement!=N&&N.focus();q(h.beforeRemove,z);for(E=0;E<z.length;++E)z[E].xa=d;q(h.afterMove,C);q(h.afterAdd,D)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Yb);a.Z=function(){this.allowTemplateRewriting=!1};a.Z.prototype=new a.ga;a.Z.prototype.constructor=
a.Z;a.Z.prototype.renderTemplateSource=function(b,c,d,e){if(c=b.vd?b.vd():null)return a.a.Ca(c.cloneNode(!0).childNodes);b=b.text();return a.a.sa(b,e)};a.Z.Ja=new a.Z;a.Nc(a.Z.Ja);a.b("nativeTemplateEngine",a.Z)})})();})();
(function() {(function(n){var F=this||(0,eval)("this"),z=F.document,H=F.jQuery;H||"undefined"===typeof jQuery||(H=jQuery);(function(n){"function"===typeof define&&define.amd?define(["exports","require"],n):"object"===typeof exports&&"object"===typeof module?n(module.exports||exports):n(F.ko={})})(function(H,Q){function J(a,c){return null===a||typeof a in T?a===c:!1}function U(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function V(b,c){var d;return function(){clearTimeout(d);d=a.a.setTimeout(b,
c)}}function W(a,c){c&&"change"!==c?"beforeChange"===c?this.hc(a):this.bb(a,c):this.ic(a)}function X(a,c){null!==c&&c.s&&c.s()}function Y(a,c){var d=this.bd,e=d[t];e.pa||(this.Jb&&this.ib[c]?(d.mc(c,a,this.ib[c]),this.ib[c]=null,--this.Jb):e.F[c]||d.mc(c,a,e.G?{aa:a}:d.Oc(a)),a.Ga&&a.Tc())}function L(a,c,d){if(c){var e=d?"add":"remove";c.split(/\s+/).forEach(function(c){a.classList[e](c)})}}var a="undefined"!==typeof H?H:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f<d.length-1;f++)e=e[d[f]];
e[d[d.length-1]]=c};a.I=function(a,c,d){a[c]=d};a.version="3.5.1-pre";a.b("version",a.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){b&&Object.entries(b).forEach(function(b){a[b[0]]=b[1]});return a}function c(a,b){a.__proto__=b;return a}var d={__proto__:[]}instanceof Array;return{K:function(a,b,c){for(var d=0,l=a.length;d<l;d++)b.call(c,a[d],d,a)},L:function(a,b){return Array.prototype.indexOf.call(a,b)},Fb:function(a,b,c){for(var d=
0,l=a.length;d<l;d++)if(b.call(c,a[d],d,a))return a[d];return n},Ma:function(b,c){var d=a.a.L(b,c);0<d?b.splice(d,1):0===d&&b.shift()},fb:function(a,b,c){return a?Array.prototype.filter.call(a,b,c):[]},Gb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},ya:d,extend:b,setPrototypeOf:c,wb:d?c:b,O:function(a,b){a&&Object.entries(a).forEach(function(a){b(a[0],a[1])})},Da:function(a,b,c){if(!a)return a;var d={};Object.entries(a).forEach(function(l){d[l[0]]=
b.call(c,l[1],l[0],a)});return d},Mb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Rb:function(b){b=a.a.Ca(b);for(var c=(b[0]&&b[0].ownerDocument||z).createElement("div"),d=0,h=b.length;d<h;d++)c.appendChild(a.ma(b[d]));return c},za:function(b,c){for(var d=0,h=b.length,l=[];d<h;d++){var k=b[d].cloneNode(!0);l.push(c?a.ma(k):k)}return l},ta:function(b,c){a.a.Mb(b);if(c)for(var d=0,h=c.length;d<h;d++)b.appendChild(c[d])},Mc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){var h=d[0],
l=h.parentNode,k,m;k=0;for(m=c.length;k<m;k++)l.insertBefore(c[k],h);k=0;for(m=d.length;k<m;k++)a.removeNode(d[k])}},Ra:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},$b:function(a){return null===a||a===n?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,
"")},Bd:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},fd:function(a,b){return b.contains(1!==a.nodeType?a.parentNode:a)},Lb:function(b){return a.a.fd(b,b.ownerDocument.documentElement)},Wc:function(b){return!!a.a.Fb(b,a.a.Lb)},$:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},rc:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.rc(b),c)},
xc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},H:function(b,c,d){d=a.a.rc(d);if(!a.options.useOnlyNativeEvents&&jQuery)jQuery(b).on(c,d);else b.addEventListener(c,d,!1)},zb:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"INPUT"===b.nodeName&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;a.options.useOnlyNativeEvents||!jQuery||d?b.dispatchEvent(new Event(c)):jQuery(b).trigger(c)},
g:function(b){return a.R(b)?b():b},Vb:function(b){return a.R(b)?b.v():b},xb:function(b,c){var d=a.a.g(c);if(null===d||d===n)d="";var h=a.f.firstChild(b);!h||3!=h.nodeType||a.f.nextSibling(h)?a.f.ta(b,[b.ownerDocument.createTextNode(d)]):h.data=d},Ca:function(a){return Array.from(a)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.K);a.b("utils.arrayFirst",a.a.Fb);a.b("utils.arrayFilter",a.a.fb);a.b("utils.arrayIndexOf",a.a.L);a.b("utils.arrayPushAll",a.a.Gb);a.b("utils.arrayRemoveItem",a.a.Ma);
a.b("utils.cloneNodes",a.a.za);a.b("utils.extend",a.a.extend);a.b("utils.objectMap",a.a.Da);a.b("utils.peekObservable",a.a.Vb);a.b("utils.registerEventHandler",a.a.H);a.b("utils.stringifyJson",a.a.Hd);a.b("utils.triggerEvent",a.a.zb);a.b("utils.unwrapObservable",a.a.g);a.b("utils.objectForEach",a.a.O);a.b("utils.setTextContent",a.a.xb);a.b("unwrap",a.a.g);a.a.h=new function(){var a=0,c="__ko__"+Date.now(),d;d=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d};return{get:function(a,b){var c=d(a,
!1);return c&&c[b]},set:function(a,b,c){(a=d(a,c!==n))&&(a[b]=c)},Nb:function(a,b,c){a=d(a,!0);return a[b]||(a[b]=c)},clear:function(a){return a[c]?(delete a[c],!0):!1},fa:function(){return a++ +c}}};a.b("utils.domData",a.a.h);a.b("utils.domData.clear",a.a.h.clear);a.a.N=new function(){function b(b,c){var d=a.a.h.get(b,e);d===n&&c&&(d=[],a.a.h.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);a.a.h.clear(c);a.a.N.cleanExternalData(c);g[c.nodeType]&&
d(c.childNodes,!0)}function d(b,d){for(var e=[],m,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=m=b[f]),b[f]!==m)for(;f--&&-1==a.a.L(e,b[f]););}var e=a.a.h.fa(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{Ka:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},ub:function(c,d){var k=b(c,!1);k&&(a.a.Ma(k,d),0==k.length&&a.a.h.set(c,e,n))},ma:function(b){a.u.C(function(){f[b.nodeType]&&(c(b),g[b.nodeType]&&d(b.getElementsByTagName("*")))});return b},
removeNode:function(b){a.ma(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){jQuery&&jQuery.cleanData&&jQuery.cleanData([a])}}};a.ma=a.a.N.ma;a.removeNode=a.a.N.removeNode;a.b("cleanNode",a.ma);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.N);a.b("utils.domNodeDisposal.addDisposeCallback",a.a.N.Ka);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.N.ub);(function(){var b=[0,"",""],c=[1,"<table>","</table>"],d=[3,"<table><tbody><tr>","</tr></tbody></table>"],
e=[1,"<select multiple='multiple'>","</select>"],f={thead:c,tbody:c,tfoot:c,tr:[2,"<table><tbody>","</tbody></table>"],td:d,th:d,option:e,optgroup:e};a.a.sa=function(c,d){var e=d;e||(e=z);var k=e.parentWindow||e.defaultView||F,m=a.a.$b(c).toLowerCase(),e=e.createElement("div"),p;p=(m=m.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&f[m[1]]||b;m=p[0];p="ignored<div>"+p[1]+c+p[2]+"</div>";for("function"==typeof k.innerShiv?e.appendChild(k.innerShiv(p)):e.innerHTML=p;m--;)e=e.lastChild;return a.a.Ca(e.lastChild.childNodes)};
a.a.wd=function(b,c){var d=a.a.sa(b,c);return d.length&&d[0].parentElement||a.a.Rb(d)};a.a.Zb=function(b,c){a.a.Mb(b);c=a.a.g(c);if(null!==c&&c!==n){"string"!=typeof c&&(c=c.toString());for(var d=a.a.sa(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}}})();a.b("utils.parseHtmlFragment",a.a.sa);a.b("utils.setHtml",a.a.Zb);a.Y=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.Y.Jc(c.nodeValue);null!=f&&e.push({ed:c,sd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<
h;f++)b(g[f],e)}var c={};return{Qb:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},Pc:function(a,b){var f=c[a];if(f===n)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},Qc:function(c,
e){var f=[];b(c,f);for(var g=0,h=f.length;g<h;g++){var l=f[g].ed,k=[l];e&&a.a.Gb(k,e);a.Y.Pc(f[g].sd,k);l.nodeValue="";l.parentNode&&l.parentNode.removeChild(l)}},Jc:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.Y);a.b("memoization.memoize",a.Y.Qb);a.b("memoization.unmemoize",a.Y.Pc);a.b("memoization.parseMemoText",a.Y.Jc);a.b("memoization.unmemoizeDomNodeAndDescendants",a.Y.Qc);a.la=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=
++c){h=f;a.a.xc(Error("'Too much recursion' after processing "+c+" task groups."));break}b=f}try{d()}catch(p){a.a.xc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;F.MutationObserver?d=function(a){var b=z.createElement("div");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle("foo")}}(c):d=z&&"onreadystatechange"in z.createElement("script")?function(a){var b=z.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;z.documentElement.removeChild(b);
b=null;a()};z.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,vb:function(b){f||a.la.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},zd:b}}();a.b("tasks",a.la);a.b("tasks.schedule",a.la.vb);a.b("tasks.runEarly",a.la.zd);a.Qa={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.X({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},
c)}})},rateLimit:function(a,c){var d,e,f;"number"==typeof c?d=c:(d=c.timeout,e=c.method);a.Bb=!1;f="function"==typeof e?e:"notifyWhenChangesStop"==e?V:U;a.qb(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Bb||(b.Bb=!0,b.qb(function(c){var e,f=!1;return function(){if(!f){a.la.cancel(e);e=a.la.vb(c);try{f=!0,b.notifySubscribers(n,"dirty")}finally{f=
!1}}}}))},notify:function(a,c){a.equalityComparer="always"==c?null:J}};var T={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.Qa);a.ac=function(b,c,d){this.aa=b;this.dc=c;this.ec=d;this.Cb=!1;this.ab=this.Db=null;a.I(this,"dispose",this.s);a.I(this,"disposeWhenNodeIsRemoved",this.l)};a.ac.prototype.s=function(){this.Cb||(this.ab&&a.a.N.ub(this.Db,this.ab),this.Cb=!0,this.ec(),this.aa=this.dc=this.ec=this.Db=this.ab=null)};a.ac.prototype.l=function(b){this.Db=b;a.a.N.Ka(b,this.ab=this.s.bind(this))};
a.S=function(){a.a.wb(this,B);B.mb(this)};var B={mb:function(a){a.T={change:[]};a.kc=1},subscribe:function(b,c,d){var e=this;d=d||"change";var f=new a.ac(e,c?b.bind(c):b,function(){a.a.Ma(e.T[d],f);e.cb&&e.cb(d)});e.Na&&e.Na(d);e.T[d]||(e.T[d]=[]);e.T[d].push(f);return f},notifySubscribers:function(b,c){c=c||"change";"change"===c&&this.Ab();if(this.Ta(c)){var d="change"===c&&this.Rc||this.T[c].slice(0);try{a.u.oc();for(var e=0,f;f=d[e];++e)f.Cb||f.dc(b)}finally{a.u.end()}}},kb:function(){return this.kc},
md:function(a){return this.kb()!==a},Ab:function(){++this.kc},qb:function(b){var c=this,d=a.R(c),e,f,g,h,l;c.bb||(c.bb=c.notifySubscribers,c.notifySubscribers=W);var k=b(function(){c.Ga=!1;d&&h===c&&(h=c.fc?c.fc():c());var a=f||l&&c.ob(g,h);l=f=e=!1;a&&c.bb(g=h)});c.ic=function(a,b){b&&c.Ga||(l=!b);c.Rc=c.T.change.slice(0);c.Ga=e=!0;h=a;k()};c.hc=function(a){e||(g=a,c.bb(a,"beforeChange"))};c.jc=function(){l=!0};c.Tc=function(){c.ob(g,c.v(!0))&&(f=!0)}},Ta:function(a){return this.T[a]&&this.T[a].length},
kd:function(b){if(b)return this.T[b]&&this.T[b].length||0;var c=0;a.a.O(this.T,function(a,b){"dirty"!==a&&(c+=b.length)});return c},ob:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return"[object Object]"},extend:function(b){var c=this;b&&a.a.O(b,function(b,e){var f=a.Qa[b];"function"==typeof f&&(c=f(c,e)||c)});return c}};a.I(B,"init",B.mb);a.I(B,"subscribe",B.subscribe);a.I(B,"extend",B.extend);a.I(B,"getSubscriptionsCount",B.kd);a.a.ya&&a.a.setPrototypeOf(B,
Function.prototype);a.S.fn=B;a.Fc=function(a){return null!=a&&"function"==typeof a.subscribe&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.S);a.b("isSubscribable",a.Fc);a.P=a.u=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{oc:b,end:c,Wb:function(b){if(e){if(!a.Fc(b))throw Error("Only subscribable things can act as dependencies");e.$c.call(e.ad,b,b.Sc||(b.Sc=++f))}},C:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},oa:function(){if(e)return e.o.oa()},
Sa:function(){if(e)return e.o.Sa()},Va:function(){if(e)return e.Va},o:function(){if(e)return e.o}}}();a.b("computedContext",a.P);a.b("computedContext.getDependenciesCount",a.P.oa);a.b("computedContext.getDependencies",a.P.Sa);a.b("computedContext.isInitial",a.P.Va);a.b("computedContext.registerDependency",a.P.Wb);a.b("ignoreDependencies",a.Gd=a.u.C);var G=Symbol("_latestValue");a.ra=function(b){function c(){if(0<arguments.length)return c.ob(c[G],arguments[0])&&(c.wa(),c[G]=arguments[0],c.va()),this;
a.u.Wb(c);return c[G]}c[G]=b;a.a.ya||a.a.extend(c,a.S.fn);a.S.fn.mb(c);a.a.wb(c,C);a.options.deferUpdates&&a.Qa.deferred(c,!0);return c};var C={equalityComparer:J,v:function(){return this[G]},va:function(){this.notifySubscribers(this[G],"spectate");this.notifySubscribers(this[G])},wa:function(){this.notifySubscribers(this[G],"beforeChange")}};a.a.ya&&a.a.setPrototypeOf(C,a.S.fn);var E=a.ra.Ja="__ko_proto__";C[E]=a.ra;a.R=function(b){if((b="function"==typeof b&&b[E])&&b!==C[E]&&b!==a.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");
return!!b};a.Wa=function(b){return"function"==typeof b&&(b[E]===C[E]||b[E]===a.o.fn[E]&&b.Cc)};a.b("observable",a.ra);a.b("isObservable",a.R);a.b("isWriteableObservable",a.Wa);a.b("isWritableObservable",a.Wa);a.b("observable.fn",C);a.I(C,"peek",C.v);a.I(C,"valueHasMutated",C.va);a.I(C,"valueWillMutate",C.wa);a.Ea=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.ra(b);a.a.wb(b,
a.Ea.fn);return b.extend({trackArrayChanges:!0})};a.Ea.fn={remove:function(b){for(var c=this.v(),d=[],e="function"!=typeof b||a.R(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.wa();if(c[f]!==g)throw Error("Array modified during remove; cannot remove item");d.push(g);c.splice(f,1);f--}}d.length&&this.va();return d},removeAll:function(b){if(b===n){var c=this.v(),d=c.slice(0);this.wa();c.splice(0,c.length);this.va();return d}return b?this.remove(function(c){return 0<=
a.a.L(b,c)}):[]},destroy:function(b){var c=this.v(),d="function"!=typeof b||a.R(b)?function(a){return a===b}:b;this.wa();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.va()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.L(b,c)}):[]},indexOf:function(b){var c=this();return a.a.L(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.wa(),this.v()[d]=c,this.va())},sorted:function(a){var c=this().slice(0);
return a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.ya&&a.a.setPrototypeOf(a.Ea.fn,a.ra.fn);a.a.K("pop push reverse shift sort splice unshift".split(" "),function(b){a.Ea.fn[b]=function(){var a=this.v();this.wa();this.qc(a,b,arguments);var d=a[b].apply(a,arguments);this.va();return d===a?this:d}});a.a.K(["slice"],function(b){a.Ea.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Ec=function(b){return a.R(b)&&"function"==typeof b.remove&&"function"==
typeof b.push};a.b("observableArray",a.Ea);a.b("isObservableArray",a.Ec);a.Qa.trackArrayChanges=function(b,c){function d(){function c(){if(l){var d=[].concat(b.v()||[]),e;if(b.Ta("arrayChange")){if(!f||1<l)f=a.a.Ib(k,d,b.Hb);e=f}k=d;f=null;l=0;e&&e.length&&b.notifySubscribers(e,"arrayChange")}}e?c():(e=!0,h=b.subscribe(function(){++l},null,"spectate"),k=[].concat(b.v()||[]),f=null,g=b.subscribe(c))}b.Hb={};c&&"object"==typeof c&&a.a.extend(b.Hb,c);b.Hb.sparse=!0;if(!b.qc){var e=!1,f=null,g,h,l=0,
k,m=b.Na,p=b.cb;b.Na=function(a){m&&m.call(b,a);"arrayChange"===a&&d()};b.cb=function(a){p&&p.call(b,a);"arrayChange"!==a||b.Ta("arrayChange")||(g&&g.s(),h&&h.s(),h=g=null,e=!1,k=n)};b.qc=function(b,c,d){function m(a,b,c){return k[k.length]={status:a,value:b,index:c}}if(e&&!l){var k=[],p=b.length,h=d.length,g=0;switch(c){case "push":g=p;case "unshift":for(c=0;c<h;c++)m("added",d[c],g+c);break;case "pop":g=p-1;case "shift":p&&m("deleted",b[g],g);break;case "splice":c=Math.min(Math.max(0,0>d[0]?p+d[0]:
d[0]),p);for(var p=1===h?p:Math.min(c+(d[1]||0),p),h=c+h-2,g=Math.max(p,h),R=[],S=[],n=2;c<g;++c,++n)c<p&&S.push(m("deleted",b[c],c)),c<h&&R.push(m("added",d[n],c));a.a.Ac(S,R);break;default:return}f=k}}}};var t=Symbol("_state");a.o=a.X=function(b,c,d){function e(){if(0<arguments.length){if("function"===typeof f)f.apply(g.jb,arguments);else 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 this}g.pa||
a.u.Wb(e);(g.ja||g.G&&e.Ua())&&e.ea();return g.V}"object"===typeof b?d=b:(d=d||{},b&&(d.read=b));if("function"!=typeof d.read)throw Error("Pass a function that returns the value of the ko.computed");var f=d.write,g={V:n,qa:!0,ja:!0,nb:!1,bc:!1,pa:!1,sb:!1,G:!1,Lc:d.read,jb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Pa:d.disposeWhen||d.Pa,Kb:null,F:{},U:0,zc:null};e[t]=g;e.Cc="function"===typeof f;a.a.ya||a.a.extend(e,a.S.fn);a.S.fn.mb(e);a.a.wb(e,y);d.pure?(g.sb=!0,g.G=!0,a.a.extend(e,aa)):
d.deferEvaluation&&a.a.extend(e,ba);a.options.deferUpdates&&a.Qa.deferred(e,!0);g.l&&(g.bc=!0,g.l.nodeType||(g.l=null));g.G||d.deferEvaluation||e.ea();g.l&&e.ia()&&a.a.N.Ka(g.l,g.Kb=function(){e.s()});return e};var y={equalityComparer:J,oa:function(){return this[t].U},Sa:function(){var b=[];a.a.O(this[t].F,function(a,d){b[d.Ha]=d.aa});return b},Ob:function(b){if(!this[t].U)return!1;var c=this.Sa();return-1!==a.a.L(c,b)?!0:!!a.a.Fb(c,function(a){return a.Ob&&a.Ob(b)})},mc:function(a,c,d){if(this[t].sb&&
c===this)throw Error("A 'pure' computed must not be called recursively");this[t].F[a]=d;d.Ha=this[t].U++;d.Ia=c.kb()},Ua:function(){var a,c,d=this[t].F;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Fa&&c.aa.Ga||c.aa.md(c.Ia)))return!0},rd:function(){this.Fa&&!this[t].nb&&this.Fa(!1)},ia:function(){var a=this[t];return a.ja||0<a.U},yd:function(){this.Ga?this[t].ja&&(this[t].qa=!0):this.yc()},Oc:function(a){if(a.Bb){var c=a.subscribe(this.rd,this,"dirty"),d=a.subscribe(this.yd,
this);return{aa:a,s:function(){c.s();d.s()}}}return a.subscribe(this.yc,this)},yc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[t].zc),this[t].zc=a.a.setTimeout(function(){b.ea(!0)},c)):b.Fa?b.Fa(!0):b.ea(!0)},ea:function(b){var c=this[t],d=c.Pa,e=!1;if(!c.nb&&!c.pa){if(c.l&&!a.a.Lb(c.l)||d&&d()){if(!c.bc){this.s();return}}else c.bc=!1;c.nb=!0;try{e=this.jd(b)}finally{c.nb=!1}return e}},jd:function(b){var c=this[t],d=!1,e=c.sb?n:!c.U,d={bd:this,ib:c.F,Jb:c.U};a.u.oc({ad:d,
$c:Y,o:this,Va:e});c.F={};c.U=0;var f=this.hd(c,d);c.U?d=this.ob(c.V,f):(this.s(),d=!0);d&&(c.G?this.Ab():this.notifySubscribers(c.V,"beforeChange"),c.V=f,this.notifySubscribers(c.V,"spectate"),!c.G&&b&&this.notifySubscribers(c.V),this.jc&&this.jc());e&&this.notifySubscribers(c.V,"awake");return d},hd:function(b,c){try{var d=b.Lc;return b.jb?d.call(b.jb):d()}finally{a.u.end(),c.Jb&&!b.G&&a.a.O(c.ib,X),b.qa=b.ja=!1}},v:function(a){var c=this[t];(c.ja&&(a||!c.U)||c.G&&this.Ua())&&this.ea();return c.V},
qb:function(b){a.S.fn.qb.call(this,b);this.fc=function(){this[t].G||(this[t].qa?this.ea():this[t].ja=!1);return this[t].V};this.Fa=function(a){this.hc(this[t].V);this[t].ja=!0;a&&(this[t].qa=!0);this.ic(this,!a)}},s:function(){var b=this[t];!b.G&&b.F&&a.a.O(b.F,function(a,b){b.s&&b.s()});b.l&&b.Kb&&a.a.N.ub(b.l,b.Kb);b.F=n;b.U=0;b.pa=!0;b.qa=!1;b.ja=!1;b.G=!1;b.l=n;b.Pa=n;b.Lc=n;this.Cc||(b.jb=n)}},aa={Na:function(b){var c=this,d=c[t];if(!d.pa&&d.G&&"change"==b){d.G=!1;if(d.qa||c.Ua())d.F=null,d.U=
0,c.ea()&&c.Ab();else{var e=[];a.a.O(d.F,function(a,b){e[b.Ha]=a});a.a.K(e,function(a,b){var e=d.F[a],l=c.Oc(e.aa);l.Ha=b;l.Ia=e.Ia;d.F[a]=l});c.Ua()&&c.ea()&&c.Ab()}d.pa||c.notifySubscribers(d.V,"awake")}},cb:function(b){var c=this[t];c.pa||"change"!=b||this.Ta("change")||(a.a.O(c.F,function(a,b){b.s&&(c.F[a]={aa:b.aa,Ha:b.Ha,Ia:b.Ia},b.s())}),c.G=!0,this.notifySubscribers(n,"asleep"))},kb:function(){var b=this[t];b.G&&(b.qa||this.Ua())&&this.ea();return a.S.fn.kb.call(this)}},ba={Na:function(a){"change"!=
a&&"beforeChange"!=a||this.v()}};a.a.ya&&a.a.setPrototypeOf(y,a.S.fn);var O=a.ra.Ja;y[O]=a.o;a.Dc=function(a){return"function"==typeof a&&a[O]===y[O]};a.od=function(b){return a.Dc(b)&&b[t]&&b[t].sb};a.b("computed",a.o);a.b("dependentObservable",a.o);a.b("isComputed",a.Dc);a.b("isPureComputed",a.od);a.b("computed.fn",y);a.I(y,"peek",y.v);a.I(y,"dispose",y.s);a.I(y,"isActive",y.ia);a.I(y,"getDependenciesCount",y.oa);a.I(y,"getDependencies",y.Sa);a.tb=function(b,c){if("function"===typeof b)return a.o(b,
c,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b("pureComputed",a.tb);a.Dd=function(b,c,d){function e(c){var e=a.tb(b,d).extend({ka:"always"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return c?e(c.bind(d)):new Promise(e)};a.b("when",a.Dd);(function(){a.w={J:function(b){switch(a.a.$(b)){case "option":return!0===b.__ko__hasDomDataOptionValue__?a.a.h.get(b,a.c.options.Tb):b.value;case "select":return 0<=b.selectedIndex?a.w.J(b.options[b.selectedIndex]):
n;default:return b.value}},Za:function(b,c,d){switch(a.a.$(b)){case "option":"string"===typeof c?(a.a.h.set(b,a.c.options.Tb,n),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.h.set(b,a.c.options.Tb,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===typeof c?c:"");break;case "select":if(""===c||null===c)c=n;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.w.J(b.options[f]),h==c||""===h&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=
e;break;default:if(null===c||c===n)c="";b.value=c}}}})();a.b("selectExtensions",a.w);a.b("selectExtensions.readValue",a.w.J);a.b("selectExtensions.writeValue",a.w.Za);a.m=function(){function b(b){b=a.a.$b(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));b+="\n,";var c=[],d=b.match(e),p,h=[],r=0;if(1<d.length){for(var w=0,v;v=d[w];++w){var u=v.charCodeAt(0);if(44===u){if(0>=r){c.push(p&&h.length?{key:p,value:h.join("")}:{unknown:p||h.join("")});p=r=0;h=[];continue}}else if(58===u){if(!r&&!p&&1===h.length){p=
h.pop();continue}}else if(47===u&&1<v.length&&(47===v.charCodeAt(1)||42===v.charCodeAt(1)))continue;else 47===u&&w&&1<v.length?(u=d[w-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(v)+1),d=b.match(e),w=-1,v="/"):40===u||123===u||91===u?++r:41===u||125===u||93===u?--r:p||h.length||34!==u&&39!==u||(v=v.slice(1,-1));h.push(v)}if(0<r)throw Error("Unbalanced parentheses, braces, or brackets");}return c}var c=["true","false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=
RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,g={"in":1,"return":1,"typeof":1},h={};return{Oa:[],ua:h,Ub:b,rb:function(e,k){function m(b,e){var k;if(!w){var l=a.getBindingHandler(b);if(l&&l.preprocess&&!(e=l.preprocess(e,b,m)))return;if(l=h[b])k=e,0<=a.a.L(c,k)?k=!1:(l=k.match(d),k=null===l?!1:l[1]?"Object("+l[1]+")"+l[2]:k),l=k;l&&q.push("'"+
("string"==typeof h[b]?h[b]:b)+"':function(_z){"+k+"=_z}")}g&&(e="function(){return "+e+" }");f.push("'"+b+"':"+e)}k=k||{};var f=[],q=[],g=k.valueAccessors,w=k.bindingParams,v="string"===typeof e?b(e):e;a.a.K(v,function(a){m(a.key||a.unknown,a.value)});q.length&&m("_ko_property_writers","{"+q.join(",")+" }");return f.join(",")},qd:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},$a:function(b,c,d,e,f){if(b&&a.R(b))!a.Wa(b)||f&&b.v()===e||b(e);else if((b=c.get("_ko_property_writers"))&&
b[d])b[d](e)}}}();a.b("expressionRewriting",a.m);a.b("expressionRewriting.bindingRewriteValidators",a.m.Oa);a.b("expressionRewriting.parseObjectLiteral",a.m.Ub);a.b("expressionRewriting.preProcessBindings",a.m.rb);a.b("expressionRewriting._twoWayBindings",a.m.ua);a.b("jsonExpressionRewriting",a.m);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.m.rb);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}
function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.h.set(f,k,!0),h--,0===h))return g;g.push(f);b(f)&&h++}if(!e)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=z&&"\x3c!--test--\x3e"===z.createComment("test").text,g=f?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,h=f?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},
k="__ko_matchedEndComment__";a.f={ba:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Aa:function(c){if(b(c)){c=a.f.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Mb(c)},ta:function(c,d){if(b(c)){a.f.Aa(c);for(var e=c.nextSibling,k=0,f=d.length;k<f;k++)e.parentNode.insertBefore(d[k],e)}else a.a.ta(c,d)},Kc:function(a,c){var d;b(a)?(d=a.nextSibling,a=a.parentNode):d=a.firstChild;d?c!==d&&a.insertBefore(c,d):a.appendChild(c)},Pb:function(c,d,e){e?(e=e.nextSibling,b(c)&&
(c=c.parentNode),e?d!==e&&c.insertBefore(d,e):c.appendChild(d)):a.f.Kc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error("Found invalid end comment, as the first child of "+a);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.h.get(f,k))throw Error("Found end comment without a matching opening comment, as child of "+d);return null}return d.nextSibling},
ld:b,Cd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Hc:function(d){if(l[a.a.$(d)]){var k=d.firstChild;if(k){do if(1===k.nodeType){var f;f=k.firstChild;var h=null;if(f){do if(h)h.push(f);else if(b(f)){var g=e(f,!0);g?f=g:h=[f]}else c(f)&&(h=[f]);while(f=f.nextSibling)}if(f=h)for(h=k.nextSibling,g=0;g<f.length;g++)h?d.insertBefore(f[g],h):d.appendChild(f[g])}while(k=k.nextSibling)}}}}})();a.b("virtualElements",a.f);a.b("virtualElements.allowedBindings",a.f.ba);a.b("virtualElements.emptyNode",
a.f.Aa);a.b("virtualElements.insertAfter",a.f.Pb);a.b("virtualElements.prepend",a.f.Kc);a.b("virtualElements.setDomNodeChildren",a.f.ta);(function(){a.da=function(){this.Zc={}};a.a.extend(a.da.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=b.getAttribute("data-bind")||a.j.getComponentNameForNode(b);case 8:return a.f.ld(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.j.lc(d,b,c,!1)},getBindingAccessors:function(b,
c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.j.lc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.f.Cd(b);default:return null}},parseBindingsString:function(b,c,d,e){try{var f=this.Zc,g=b+(e&&e.valueAccessors||""),h;if(!(h=f[g])){var l,k="with($context){with($data||{}){return{"+a.m.rb(b,e)+"}}}";l=new Function("$context","$element",k);h=f[g]=l}return h(c,d)}catch(m){throw m.message=
"Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+m.message,m;}}});a.da.instance=new a.da})();a.b("bindingProvider",a.da);(function(){function b(b){var c=(b=a.a.h.get(b,A))&&b.M;c&&(b.M=null,c.Ic())}function c(c,d,e){this.node=c;this.pc=d;this.gb=[];this.D=!1;d.M||a.a.N.Ka(c,b);e&&e.M&&(e.M.gb.push(c),this.Eb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Da(a.u.C(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return"function"===
typeof b?f(b.bind(null,c,e)):a.a.Da(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function l(b,c){var d=a.f.firstChild(c);if(d){var e,f=a.da.instance,h=f.preprocessNode;if(h){for(;e=d;)d=a.f.nextSibling(e),h.call(f,e);d=a.f.firstChild(c)}for(;e=d;)d=a.f.nextSibling(e),k(b,e)}a.i.ka(c,a.i.D)}function k(b,c){var d=b,e=1===c.nodeType;e&&a.f.Hc(c);if(e||a.da.instance.nodeHasBindings(c))d=p(c,null,b).bindingContextForDescendants;d&&!u[a.a.$(c)]&&l(d,c)}function m(b){var c=[],d={},e=[];
a.a.O(b,function Z(f){if(!d[f]){var k=a.getBindingHandler(f);k&&(k.after&&(e.push(f),a.a.K(k.after,function(c){if(b[c]){if(-1!==a.a.L(e,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", "));Z(c)}}),e.length--),c.push({key:f,Bc:k}));d[f]=!0}});return c}function p(b,c,d){var f=a.a.h.Nb(b,A,{}),k=f.Uc;if(!c){if(k)throw Error("You cannot apply bindings multiple times to the same element.");f.Uc=!0}k||(f.context=d);f.Sb||(f.Sb={});var g;if(c&&"function"!==
typeof c)g=c;else{var p=a.da.instance,l=p.getBindingAccessors||h,q=a.X(function(){if(g=c?c(d,b):l.call(p,b,d)){if(d[r])d[r]();if(d[v])d[v]()}return g},null,{l:b});g&&q.ia()||(q=null)}var u=d,w;if(g){var I=function(){return a.a.Da(q?q():g,e)},t=q?function(a){return function(){return e(q()[a])}}:function(a){return g[a]};I.get=function(a){return g[a]&&e(t(a))};I.has=function(a){return a in g};a.i.D in g&&a.i.subscribe(b,a.i.D,function(){var c=(0,g[a.i.D])();if(c){var d=a.f.childNodes(b);d.length&&c(d,
a.vc(d[0]))}});a.i.na in g&&(u=a.i.yb(b,d),a.i.subscribe(b,a.i.na,function(){var c=(0,g[a.i.na])();c&&a.f.firstChild(b)&&c(b)}));f=m(g);a.a.K(f,function(c){var d=c.Bc.init,e=c.Bc.update,f=c.key;if(8===b.nodeType&&!a.f.ba[f])throw Error("The binding '"+f+"' cannot be used with virtual elements");try{"function"==typeof d&&a.u.C(function(){var a=d(b,t(f),I,u.$data,u);if(a&&a.controlsDescendantBindings){if(w!==n)throw Error("Multiple bindings ("+w+" and "+f+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
w=f}}),"function"==typeof e&&a.X(function(){e(b,t(f),I,u.$data,u)},null,{l:b})}catch(k){throw k.message='Unable to process binding "'+f+": "+g[f]+'"\nMessage: '+k.message,k;}})}f=w===n;return{shouldBindDescendants:f,bindingContextForDescendants:f&&u}}function q(b,c){return b&&b instanceof a.ca?b:new a.ca(b,n,n,c)}var r=Symbol("_subscribable"),w=Symbol("_ancestorBindingInfo"),v=Symbol("_dataDependency");a.c={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.c[b]};
var I={};a.ca=function(b,c,d,e,f){function k(){var b=p?g():g,f=a.a.g(b);c?(a.a.extend(h,c),w in c&&(h[w]=c[w])):(h.$parents=[],h.$root=f,h.ko=a);h[r]=l;m?f=h.$data:(h.$rawData=b,h.$data=f);d&&(h[d]=f);e&&e(h,c,f);if(c&&c[r]&&!a.P.o().Ob(c[r]))c[r]();q&&(h[v]=q);return h.$data}var h=this,m=b===I,g=m?n:b,p="function"==typeof g&&!a.R(g),l,q=f&&f.dataDependency;f&&f.exportDependencies?k():(l=a.tb(k),l.v(),l.ia()?l.equalityComparer=null:h[r]=n)};a.ca.prototype.createChildContext=function(b,c,d,e){!e&&
c&&"object"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f="function"==typeof b&&!a.R(b);return new a.ca(I,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.ca(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.ca.prototype.extend=function(b,c){return new a.ca(I,this,null,function(c){a.a.extend(c,"function"==typeof b?b(c):b)},c)};var A=a.a.h.fa();c.prototype.Ic=function(){this.Eb&&
this.Eb.M&&this.Eb.M.dd(this.node)};c.prototype.dd=function(b){a.a.Ma(this.gb,b);!this.gb.length&&this.D&&this.tc()};c.prototype.tc=function(){this.D=!0;this.pc.M&&!this.gb.length&&(this.pc.M=null,a.a.N.ub(this.node,b),a.i.ka(this.node,a.i.na),this.Ic())};a.i={D:"childrenComplete",na:"descendantsComplete",subscribe:function(b,c,d,e,f){var k=a.a.h.Nb(b,A,{});k.Ba||(k.Ba=new a.S);f&&f.notifyImmediately&&k.Sb[c]&&a.u.C(d,e,[b]);return k.Ba.subscribe(d,e,c)},ka:function(b,c){var d=a.a.h.get(b,A);if(d&&
(d.Sb[c]=!0,d.Ba&&d.Ba.notifySubscribers(b,c),c==a.i.D))if(d.M)d.M.tc();else if(d.M===n&&d.Ba&&d.Ba.Ta(a.i.na))throw Error("descendantsComplete event not supported for bindings on this node");},yb:function(b,d){var e=a.a.h.Nb(b,A,{});e.M||(e.M=new c(b,e,d[w]));return d[w]==e?d:d.extend(function(a){a[w]=e})}};a.Ad=function(b){return(b=a.a.h.get(b,A))&&b.context};a.eb=function(b,c,d){1===b.nodeType&&a.f.Hc(b);return p(b,c,q(d))};a.Xc=function(b,c,d){d=q(d);return a.eb(b,g(c,d,b),d)};a.La=function(a,
b){1!==b.nodeType&&8!==b.nodeType||l(q(a),b)};a.nc=function(a,b,c){if(2>arguments.length){if(b=z.body,!b)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");k(q(a,c),b)};a.uc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?n:a.Ad(b)};a.vc=function(b){return(b=a.uc(b))?b.$data:n};a.b("bindingHandlers",
a.c);a.b("bindingEvent",a.i);a.b("bindingEvent.subscribe",a.i.subscribe);a.b("bindingEvent.startPossiblyAsyncContentBinding",a.i.yb);a.b("applyBindings",a.nc);a.b("applyBindingsToDescendants",a.La);a.b("applyBindingAccessorsToNode",a.eb);a.b("applyBindingsToNode",a.Xc);a.b("contextFor",a.uc);a.b("dataFor",a.vc)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,m;k?k.subscribe(e):(k=f[c]=new a.S,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]=
{definition:b,pd:e};delete f[c];m||e?k.notifySubscribers(b):a.la.vb(function(){k.notifySubscribers(b)})}),m=!0)}function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a,c)}):b(null,null)})}function e(c,d,f,m){m||(m=a.j.loaders.slice(0));var g=m.shift();if(g){var q=g[c];if(q){var r=!1;if(q.apply(g,d.concat(function(a){r?f(null):null!==a?f(a):e(c,d,f,m)}))!==b&&(r=!0,!g.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");
}else e(c,d,f,m)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.pd?a.u.C(function(){e(f.definition)}):a.la.vb(function(){e(f.definition)}):c(d,e)},sc:function(a){delete g[a]},gc:e};a.j.loaders=[];a.b("components",a.j);a.b("components.get",a.j.get);a.b("components.clearCachedDefinition",a.j.sc)})();(function(){function b(b,c,d,e){function h(){0===--v&&e(g)}var g={},v=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.j.gc("loadTemplate",
[b,c],function(a){g.template=a;h()})}):h();d?f(c,d,function(c){a.j.gc("loadViewModel",[b,c],function(a){g[l]=a;h()})}):h()}function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)});else if("function"===typeof b[l])d(b[l]);else if("instance"in b){var e=b.instance;d(function(){return e})}else"viewModel"in b?c(a,b.viewModel,d):a("Unknown viewModel value: "+b)}function d(b){switch(a.a.$(b)){case "script":return a.a.sa(b.text);case "textarea":return a.a.sa(b.value);case "template":if(e(b.content))return a.a.za(b.content.childNodes)}return a.a.za(b.childNodes)}
function e(a){return F.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){"string"===typeof b.require?Q||F.require?(Q||F.require)([b.require],function(a){a&&"object"===typeof a&&a.Ed&&a["default"]&&(a=a["default"]);c(a)}):a("Uses require, but no AMD loader is present"):c(b)}function g(a){return function(b){throw Error("Component '"+a+"': "+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.j.pb(b))throw Error("Component "+
b+" is already registered");h[b]=c};a.j.pb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b];a.j.sc(b)};a.j.wc={getConfig:function(b,c){c(a.j.pb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if("string"===typeof c)f(a.a.sa(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.Ca(c.childNodes));else if(c.element)if(c=c.element,F.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&
1===c.nodeType)f(d(c));else if("string"===typeof c){var h=z.getElementById(c);h?f(d(h)):b("Cannot find element with ID "+c)}else b("Unknown element type: "+c);else b("Unknown template value: "+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var l="createViewModel";a.b("components.register",a.j.register);a.b("components.isRegistered",a.j.pb);a.b("components.unregister",a.j.unregister);a.b("components.defaultLoader",a.j.wc);a.j.loaders.push(a.j.wc);a.j.Fd=h})();(function(){function b(b,e){var f=b.getAttribute("params");
if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Da(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Da(f,function(c){var e=c.v();return c.ia()?a.o({read:function(){return a.a.g(c())},write:a.Wa(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,"$raw")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.$(b);if(a.j.pb(c)&&(-1!=c.indexOf("-")||"[object HTMLUnknownElement]"==""+b))return c};a.j.lc=function(c,
e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var l={name:h,params:b(e,f)};c.component=g?function(){return l}:l}}return c};var c=new a.da})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has no template");b=a.a.za(c);a.f.ta(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,b,c):b}var d=0;a.c.component={init:function(e,
f,g,h,l){function k(){var a=m&&m.dispose;"function"===typeof a&&a.call(m);q&&q.s();p=m=q=null}var m,p,q,r=a.a.Ca(a.f.childNodes(e));a.f.Aa(e);a.a.N.Ka(e,k);a.o(function(){var h=a.a.g(f()),g,u;"string"===typeof h?g=h:(g=a.a.g(h.name),u=a.a.g(h.params));if(!g)throw Error("No component name specified");var n=a.i.yb(e,l),A=p=++d;a.j.get(g,function(d){if(p===A){k();if(!d)throw Error("Unknown component '"+g+"'");b(g,d,e);var f=c(d,u,{element:e,templateNodes:r});d=n.createChildContext(f,{extend:function(a){a.$component=
f;a.$componentTemplateNodes=r}});f&&f.koDescendantsComplete&&(q=a.i.subscribe(e,a.i.na,f.koDescendantsComplete,f));m=f;a.La(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.f.ba.component=!0})();a.c.attr={update:function(b,c){var d=a.a.g(c())||{};a.a.O(d,function(c,d){d=a.a.g(d);var g=c.indexOf(":"),g="lookupNamespaceURI"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===d||d===n;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();h||(g?b.setAttributeNS(g,c,
d):b.setAttribute(c,d));"name"===c&&(b.name=h?"":d)})}};(function(){function b(b,d,e){var f=a.a.L(a.a.Vb(b),d);0>f?e&&b.push(d):e||b.splice(f,1)}a.c.checked={after:["value","attr"],init:function(c,d,e){function f(){var f=c.checked,g=h();if(!a.P.Va()&&(f||!k&&!a.P.oa())){var m=a.u.C(d);if(p){var r=q?m.v():m,t=w;w=g;t!==g?f&&(b(r,g,!0),b(r,t,!1)):b(r,g,f);q&&a.Wa(m)&&m(r)}else l&&(g===n?g=f:f||(g=n)),a.m.$a(m,e,"checked",g,!0)}}function g(){var b=a.a.g(d()),e=h();p?(c.checked=0<=a.a.L(b,e),w=e):c.checked=
l&&e===n?!!b:h()===b}var h=a.tb(function(){if(e.has("checkedValue"))return a.a.g(e.get("checkedValue"));if(r)return e.has("value")?a.a.g(e.get("value")):c.value}),l="checkbox"==c.type,k="radio"==c.type;if(l||k){var m=d(),p=l&&a.a.g(m)instanceof Array,q=!(p&&m.push&&m.splice),r=k||p,w=p?h():n;k&&!c.name&&a.c.uniqueName.init(c,function(){return!0});a.o(f,null,{l:c});a.a.H(c,"click",f);a.o(g,null,{l:c});m=n}}};a.m.ua.checked=!0;a.c.checkedValue={update:function(b,d){b.value=a.a.g(d())}}})();a.c["class"]=
{update:function(b,c){var d=a.a.$b(a.a.g(c()));L(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;L(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.g(c());null!==d&&"object"==typeof d?a.a.O(d,function(c,d){d=a.a.g(d);L(b,c,d)}):a.c["class"].update(b,c)}};a.c.enable={update:function(b,c){var d=a.a.g(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.c.disable={update:function(b,c){a.c.enable.update(b,function(){return!a.a.g(c())})}};a.c.event={init:function(b,c,d,e,f){var g=
c()||{};a.a.O(g,function(g){"string"==typeof g&&a.a.H(b,g,function(b){var k,m=c()[g];if(m){try{var p=a.a.Ca(arguments);e=f.$data;p.unshift(e);k=m.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.c.foreach={Gc:function(b){return function(){var c=b(),d=a.a.Vb(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.Z.Ja};a.a.g(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,
includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.Z.Ja}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Gc(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.Gc(c),d,e,f)}};a.m.Oa.foreach=!1;a.f.ba.foreach=!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;e=b.ownerDocument.activeElement===b;var f=c();a.m.$a(f,d,"hasfocus",
e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.H(b,"focus",f);a.a.H(b,"focusin",f);a.a.H(b,"blur",g);a.a.H(b,"focusout",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.g(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.C(a.a.zb,null,[b,d?"focusin":"focusout"]))}};a.m.ua.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.ua.hasFocus="hasfocus";
a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Zb(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,l,k){var m,p,q={},r,n,v;if(d){l=h.get("as");var u=h.get("noChildContext");v=!(l&&u);q={as:l,noChildContext:u,exportDependencies:v}}n=(r="render"==h.get("completeOn"))||h.has(a.i.na);a.o(function(){var h=a.a.g(c()),l=!e!==!h,u=!p,t;if(v||l!==m){n&&(k=a.i.yb(b,k));if(l){if(!d||v)q.dataDependency=a.P.o();t=d?k.createChildContext("function"==typeof h?
h:c,q):a.P.oa()?k.extend(null,q):k}u&&a.P.oa()&&(p=a.a.za(a.f.childNodes(b),!0));l?(u||a.f.ta(b,a.a.za(p)),a.La(t,b)):(a.f.Aa(b),r||a.i.ka(b,a.i.D));m=l}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Oa[b]=!1;a.f.ba[b]=!0}b("if");b("ifnot",!1,!0);b("with",!0)})();a.c.let={init:function(b,c,d,e,f){c=f.extend(c);a.La(c,b);return{controlsDescendantBindings:!0}}};a.f.ba.let=!0;var P={};a.c.options={init:function(b){if("select"!==a.a.$(b))throw Error("options binding applies only to SELECT elements");
for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.fb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function g(c,d){if(w&&m)a.i.ka(b,a.i.D);else if(r.length){var e=0<=a.a.L(r,a.w.J(d[0]));d[0].selected=e;w&&!e&&a.u.C(a.a.zb,null,[b,"change"])}}var h=b.multiple,l=0!=b.length&&h?b.scrollTop:null,k=a.a.g(c()),m=d.get("valueAllowUnset")&&d.has("value"),p=d.get("optionsIncludeDestroyed");
c={};var q,r=[];m||(h?r=e().map(a.w.J):0<=b.selectedIndex&&r.push(a.w.J(b.options[b.selectedIndex])));k&&("undefined"==typeof k.length&&(k=[k]),q=a.a.fb(k,function(b){return p||b===n||null===b||!a.a.g(b._destroy)}),d.has("optionsCaption")&&(k=a.a.g(d.get("optionsCaption")),null!==k&&k!==n&&q.unshift(P)));var w=!1;c.beforeRemove=function(a){b.removeChild(a)};k=g;d.has("optionsAfterRender")&&"function"==typeof d.get("optionsAfterRender")&&(k=function(b,c){g(0,c);a.u.C(d.get("optionsAfterRender"),null,
[c[0],b!==P?b:n])});a.a.Yb(b,q,function(c,e,k){k.length&&(r=!m&&k[0].selected?[a.w.J(k[0])]:[],w=!0);e=b.ownerDocument.createElement("option");c===P?(a.a.xb(e,d.get("optionsCaption")),a.w.Za(e,n)):(k=f(c,d.get("optionsValue"),c),a.w.Za(e,a.a.g(k)),c=f(c,d.get("optionsText"),k),a.a.xb(e,c));return[e]},c,k);if(!m){var v;h?v=r.length&&e().length<r.length:v=r.length&&0<=b.selectedIndex?a.w.J(b.options[b.selectedIndex])!==r[0]:r.length||0<=b.selectedIndex;v&&a.u.C(a.a.zb,null,[b,"change"])}(m||a.P.Va())&&
a.i.ka(b,a.i.D);l&&20<Math.abs(l-b.scrollTop)&&(b.scrollTop=l)}};a.c.options.Tb=a.a.h.fa();a.c.selectedOptions={init:function(b,c,d){function e(){var e=c(),f=[];a.a.K(b.getElementsByTagName("option"),function(b){b.selected&&f.push(a.w.J(b))});a.m.$a(e,d,"selectedOptions",f)}function f(){var d=a.a.g(c()),e=b.scrollTop;d&&"number"==typeof d.length&&a.a.K(b.getElementsByTagName("option"),function(b){var c=0<=a.a.L(d,a.w.J(b));b.selected!=c&&(b.selected=c)});b.scrollTop=e}if("select"!=a.a.$(b))throw Error("selectedOptions binding applies only to SELECT elements");
var g;a.i.subscribe(b,a.i.D,function(){g?e():(a.a.H(b,"change",e),g=a.o(f,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}};a.m.ua.selectedOptions=!0;a.c.style={update:function(b,c){var d=a.a.g(c()||{});a.a.O(d,function(c,d){d=a.a.g(d);if(null===d||d===n||!1===d)d="";if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=d+"px")}})}};a.c.submit={init:function(b,
c,d,e,f){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");a.a.H(b,"submit",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.xb(b,c())}};a.f.ba.text=!0;(function(){a.c.textInput={init:function(b,c,d){function e(){var d=a.a.g(c());if(null===d||d===n)d="";l!==n&&d===l?a.a.setTimeout(e,4):b.value!==
d&&(b.value=d,g=b.value)}function f(){clearTimeout(h);l=h=n;var e=b.value;g!==e&&(g=e,a.m.$a(c(),d,"textInput",e))}var g=b.value,h,l;a.a.H(b,"input",f);a.a.H(b,"change",f);a.a.H(b,"blur",f);a.o(e,null,{l:b})}};a.m.ua.textInput=!0;a.c.textinput={preprocess:function(a,c,d){d("textInput",a)}}})();a.c.uniqueName={init:function(b,c){c()&&(b.name="ko_unique_"+ ++a.c.uniqueName.cd)}};a.c.uniqueName.cd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has("as")&&(g={as:d.get("as"),noChildContext:d.get("noChildContext")});
c=f.createChildContext(c,g);a.La(c,b);return{controlsDescendantBindings:!0}}};a.f.ba.using=!0;a.c.value={init:function(b,c,d){var e=a.a.$(b),f="input"==e;if(!f||"checkbox"!=b.type&&"radio"!=b.type){var g=[],h=d.get("valueUpdate"),l=null;h&&("string"==typeof h?g=[h]:g=h?h.filter(function(a,b){return h.indexOf(a)===b}):[],a.a.Ma(g,"change"));var k=function(){l=null;var e=c(),f=a.w.J(b);a.m.$a(e,d,"value",f)};a.a.K(g,function(c){var d=k;a.a.Bd(c,"after")&&(d=function(){l=a.w.J(b);a.a.setTimeout(k,0)},
c=c.substring(5));a.a.H(b,c,d)});var m;m=f&&"file"==b.type?function(){var d=a.a.g(c());null===d||d===n||""===d?b.value="":a.u.C(k)}:function(){var f=a.a.g(c()),g=a.w.J(b);if(null!==l&&f===l)a.a.setTimeout(m,0);else if(f!==g||g===n)"select"===e?(g=d.get("valueAllowUnset"),a.w.Za(b,f,g),g||f===a.w.J(b)||a.u.C(k)):a.w.Za(b,f)};if("select"===e){var p;a.i.subscribe(b,a.i.D,function(){p?d.get("valueAllowUnset")?m():k():(a.a.H(b,"change",k),p=a.o(m,null,{l:b}))},null,{notifyImmediately:!0})}else a.a.H(b,
"change",k),a.o(m,null,{l:b})}else a.eb(b,{checkedValue:c})},update:function(){}};a.m.ua.value=!0;a.c.visible={update:function(b,c){var d=a.a.g(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.g(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})("click");a.ga=function(){};a.ga.prototype.renderTemplateSource=
function(){throw Error("Override renderTemplateSource");};a.ga.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.ga.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||z;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.A.B(d)}if(1==b.nodeType||8==b.nodeType)return new a.A.ha(b);throw Error("Unknown template type: "+b);};a.ga.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,
e);return this.renderTemplateSource(a,c,d,e)};a.ga.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.ga.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.ga);a.cc=function(){function b(b,c,d,h){b=a.m.Ub(b);for(var l=a.m.Oa,k=0;k<b.length;k++){var m=b[k].key;if(Object.prototype.hasOwnProperty.call(l,m)){var p=l[m];if("function"===
typeof p){if(m=p(b[k].value))throw Error(m);}else if(!p)throw Error("This template engine does not support the '"+m+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.m.rb(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;
return{gd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.cc.ud(b,c)},d)},ud:function(a,f){return a.replace(c,function(a,c,d,e,m){return b(m,c,d,f)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",f)})},Yc:function(b,c){return a.Y.Qb(function(d,h){var l=d.nextSibling;l&&l.nodeName.toLowerCase()===c&&a.eb(l,b,h)})}}}();a.b("__tr_ambtns",a.cc.Yc);(function(){a.A={};a.A.B=function(b){if(this.B=b){var c=a.a.$(b);this.Xa="script"===c?1:"textarea"===
c?2:"template"==c&&b.content&&11===b.content.nodeType?3:4}};a.A.B.prototype.text=function(){var b=1===this.Xa?"text":2===this.Xa?"value":"innerHTML";if(0==arguments.length)return this.B[b];var c=arguments[0];"innerHTML"===b?a.a.Zb(this.B,c):this.B[b]=c};var b=a.a.h.fa()+"_";a.A.B.prototype.data=function(c){if(1===arguments.length)return a.a.h.get(this.B,b+c);a.a.h.set(this.B,b+c,arguments[1])};var c=a.a.h.fa();a.A.B.prototype.nodes=function(){var b=this.B;if(0==arguments.length){var e=a.a.h.get(b,
c)||{},f=e.hb||(3===this.Xa?b.content:4===this.Xa?b:n);if(!f||e.Vc){var g=this.text();g&&g!==e.Ya&&(f=a.a.wd(g,b.ownerDocument),a.a.h.set(b,c,{hb:f,Ya:g,Vc:!0}))}return f}e=arguments[0];this.Xa!==n&&this.text("");a.a.h.set(b,c,{hb:e})};a.A.ha=function(a){this.B=a};a.A.ha.prototype=new a.A.B;a.A.ha.prototype.constructor=a.A.ha;a.A.ha.prototype.text=function(){if(0==arguments.length){var b=a.a.h.get(this.B,c)||{};b.Ya===n&&b.hb&&(b.Ya=b.hb.innerHTML);return b.Ya}a.a.h.set(this.B,c,{Ya:arguments[0]})};
a.b("templateSources",a.A);a.b("templateSources.domElement",a.A.B);a.b("templateSources.anonymousTemplate",a.A.ha)})();(function(){function b(b,c,d){var e;for(c=a.f.nextSibling(c);b&&(e=b)!==c;)b=a.f.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.da.instance,l=h.preprocessNode;if(l){b(e,f,function(a,b){var c=a.previousSibling,d=l.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):(c.push(e,f),a.a.Ra(c,
g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.nc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.Y.Qc(b,[d])});a.a.Ra(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,l){l=l||{};var n=(b&&d(b)||f||{}).ownerDocument,v=l.templateEngine||g;a.cc.gd(f,v,n);f=v.renderTemplate(f,h,l,n);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");n=!1;switch(e){case "replaceChildren":a.f.ta(b,
f);n=!0;break;case "replaceNode":a.a.Mc(b,f);n=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}n&&(c(f,h),l.afterRender&&a.u.C(l.afterRender,null,[f,h[l.as||"$data"]]),"replaceChildren"==e&&a.i.ka(b,a.i.D));return f}function f(b,c,d){return a.R(b)?b():"function"===typeof b?b(c,d):b}var g;a.Nc=function(b){if(b!=n&&!(b instanceof a.ga))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.Xb=function(b,c,h,l,r){h=h||{};if((h.templateEngine||g)==
n)throw Error("Set a template engine before calling renderTemplate");r=r||"replaceChildren";if(l){var w=d(l);return a.X(function(){var g=c&&c instanceof a.ca?c:new a.ca(c,null,null,null,{exportDependencies:!0}),n=f(b,g.$data,g),g=e(l,r,n,g,h);"replaceNode"==r&&(l=g,w=d(l))},null,{Pa:function(){return!w||!a.a.Lb(w)},l:w&&"replaceNode"==r?w.parentNode:w})}return a.Y.Qb(function(d){a.Xb(b,c,h,d,"replaceNode")})};a.xd=function(b,d,g,h,l){function w(b,c){a.u.C(a.a.Yb,null,[h,b,u,g,v,c]);a.i.ka(h,a.i.D)}
function v(a,b){c(b,t);g.afterRender&&g.afterRender(b,a);t=null}function u(a,c){t=l.createChildContext(a,{as:A,noChildContext:g.noChildContext,extend:function(a){a.$index=c;A&&(a[A+"Index"]=c)}});var d=f(b,a,t);return e(h,"ignoreTargetNode",d,t,g)}var t,A=g.as,y=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(y||g.beforeRemove||!a.Ec(d))return a.X(function(){var b=a.a.g(d)||[];"undefined"==typeof b.length&&(b=[b]);y&&(b=a.a.fb(b,function(b){return b===n||null===b||
!a.a.g(b._destroy)}));w(b)},null,{l:h});w(d.v());var z=d.subscribe(function(a){w(d(),a)},null,"arrayChange");z.l(h);return z};var h=a.a.h.fa(),l=a.a.h.fa();a.c.template={init:function(b,c){var d=a.a.g(c());if("string"==typeof d||"name"in d)a.f.Aa(b);else if("nodes"in d){d=d.nodes||[];if(a.R(d))throw Error('The "nodes" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.h.get(e,l)||(e=a.a.Rb(d),a.a.h.set(e,l,!0));(new a.A.ha(b)).nodes(e)}else if(d=a.f.childNodes(b),0<
d.length)e=a.a.Rb(d),(new a.A.ha(b)).nodes(e);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.g(g);d=!0;e=null;"string"==typeof c?c={}:(g="name"in c?c.name:b,"if"in c&&(d=a.a.g(c["if"])),d&&"ifnot"in c&&(d=!a.a.g(c.ifnot)),d&&!g&&(d=!1));"foreach"in c?e=a.xd(g,d&&c.foreach||[],c,b,f):d?(d=f,"data"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),
e=a.Xb(g,d,c,b)):a.f.Aa(b);f=e;(c=a.a.h.get(b,h))&&"function"==typeof c.s&&c.s();a.a.h.set(b,h,!f||f.ia&&!f.ia()?n:f)}};a.m.Oa.template=function(b){b=a.m.Ub(b);return 1==b.length&&b[0].unknown||a.m.qd(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.f.ba.template=!0})();a.b("setTemplateEngine",a.Nc);a.b("renderTemplate",a.Xb);a.a.Ac=function(a,c,d){if(a.length&&c.length){var e,f,g,h,l;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;l=c[g];++g)if(h.value===
l.value){h.moved=l.index;l.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Ib=function(){function b(b,d,e,f,g){var h=Math.min,l=Math.max,k=[],m,n=b.length,q,r=d.length,t=r-n||1,v=n+r+1,u,y,A;for(m=0;m<=n;m++)for(y=u,k.push(u=[]),A=h(r,m+t),q=l(0,m-1);q<=A;q++)u[q]=q?m?b[m-1]===d[q-1]?y[q-1]:h(y[q]||v,u[q-1]||v)+1:q+1:m+1;h=[];l=[];t=[];m=n;for(q=r;m||q;)r=k[m][q]-1,q&&r===k[m][q-1]?l.push(h[h.length]={status:e,value:d[--q],index:q}):m&&r===k[m-1][q]?t.push(h[h.length]={status:f,value:b[--m],index:m}):
(--q,--m,g.sparse||h.push({status:"retained",value:d[q]}));a.a.Ac(t,l,!g.dontLimitMoves&&10*n);return h.reverse()}return function(a,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,"added","deleted",e):b(d,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.Ib);(function(){function b(b,c,d,h,l){var k=[],m=a.X(function(){var m=c(d,l,a.a.Ra(k,b))||[];0<k.length&&(a.a.Mc(k,m),h&&a.u.C(h,null,[d,m,l]));k.length=0;a.a.Gb(k,m)},null,{l:b,Pa:function(){return!a.a.Wc(k)}});
return{W:k,X:m.ia()?m:n}}var c=a.a.h.fa(),d=a.a.h.fa();a.a.Yb=function(e,f,g,h,l,k){function m(b){x={xa:b,lb:a.ra(y++)};v.push(x);t||F.push(x)}function p(b){x=r[b];y!==x.lb.v()&&C.push(x);x.lb(y++);a.a.Ra(x.W,e);v.push(x)}function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.K(c[d].W,function(a){b(a,d,c[d].xa)})}f=f||[];"undefined"==typeof f.length&&(f=[f]);h=h||{};var r=a.a.h.get(e,c),t=!r,v=[],u=0,y=0,A=[],z=[],B=[],C=[],F=[],x,G=0;if(t)a.a.K(f,m);else{if(!k||r&&r._countWaitingForRemove){var D=
Array.prototype.map.call(r,function(a){return a.xa});k=a.a.Ib(D,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var D=0,E,H,J;E=k[D];D++)switch(H=E.moved,J=E.index,E.status){case "deleted":for(;u<J;)p(u++);H===n&&(x=r[u],x.X&&(x.X.s(),x.X=n),a.a.Ra(x.W,e).length&&(h.beforeRemove&&(v.push(x),G++,x.xa===d?x=null:B.push(x)),x&&A.push.apply(A,x.W)));u++;break;case "added":for(;y<J;)p(u++);H!==n?(z.push(v.length),p(H)):m(E.value)}for(;y<f.length;)p(u++);v._countWaitingForRemove=G}a.a.h.set(e,c,v);q(h.beforeMove,
C);a.a.K(A,h.beforeRemove?a.ma:a.removeNode);var K,M,N;try{N=e.ownerDocument.activeElement}catch(L){}if(z.length)for(;(D=z.shift())!=n;){x=v[D];for(K=n;D;)if((M=v[--D].W)&&M.length){K=M[M.length-1];break}for(f=0;u=x.W[f];K=u,f++)a.f.Pb(e,u,K)}for(D=0;x=v[D];D++){x.W||a.a.extend(x,b(e,g,x.xa,l,x.lb));for(f=0;u=x.W[f];K=u,f++)a.f.Pb(e,u,K);!x.nd&&l&&(l(x.xa,x.W,x.lb),x.nd=!0,K=x.W[x.W.length-1])}N&&e.ownerDocument.activeElement!=N&&N.focus();q(h.beforeRemove,B);for(D=0;D<B.length;++D)B[D].xa=d;q(h.afterMove,
C);q(h.afterAdd,F)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Yb);a.Z=function(){this.allowTemplateRewriting=!1};a.Z.prototype=new a.ga;a.Z.prototype.constructor=a.Z;a.Z.prototype.renderTemplateSource=function(b,c,d,e){if(c=b.vd?b.vd():null)return a.a.Ca(c.cloneNode(!0).childNodes);b=b.text();return a.a.sa(b,e)};a.Z.Ja=new a.Z;a.Nc(a.Z.Ja);a.b("nativeTemplateEngine",a.Z)})})();})();

View file

@ -21,14 +21,6 @@ ko.utils = (function () {
var canSetPrototype = ({ __proto__: [] } instanceof Array);
// Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup)
var ke = 'KeyboardEvent', me = 'MouseEvent',
knownEventTypesByEventName = {
keyup: ke, keydown: ke, keypress: ke,
click: me, dblclick: me, mousedown: me, mouseup: me, mousemove: me,
mouseover: me, mouseout: me, mouseenter: me, mouseleave: me
};
function isClickOnCheckableElement(element, eventType) {
if ((element.nodeName !== "INPUT") || !element.type) return false;
if (eventType.toLowerCase() != "click") return false;
@ -270,10 +262,7 @@ ko.utils = (function () {
if (!ko.options['useOnlyNativeEvents'] && jQuery && !useClickWorkaround) {
jQuery(element)['trigger'](eventType);
} else {
var eventCategory = knownEventTypesByEventName[eventType] || "HTMLEvents";
var event = document.createEvent(eventCategory);
event.initEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element);
element.dispatchEvent(event);
element.dispatchEvent(new Event(eventType));
}
},