Tiny knockoutjs speedup

This commit is contained in:
djmaze 2021-04-23 18:16:36 +02:00
parent 8aa9b0b33f
commit c3c1fc2c0e
5 changed files with 165 additions and 208 deletions

View file

@ -215,24 +215,25 @@ ko.utils.domData = new (function () {
};
})();
ko.utils.domNodeDisposal = new (function () {
ko.utils.domNodeDisposal = (() => {
var domDataKey = ko.utils.domData.nextKey();
var cleanableNodeTypes = { 1: true, 8: true, 9: true }; // Element, Comment, Document
var cleanableNodeTypesWithDescendants = { 1: true, 9: true }; // Element, Document
function getDisposeCallbacksCollection(node, createIfNotFound) {
const getDisposeCallbacksCollection = (node, createIfNotFound) => {
var allDisposeCallbacks = ko.utils.domData.get(node, domDataKey);
if ((allDisposeCallbacks === undefined) && createIfNotFound) {
allDisposeCallbacks = [];
ko.utils.domData.set(node, domDataKey, allDisposeCallbacks);
}
return allDisposeCallbacks;
}
function destroyCallbacksCollection(node) {
ko.utils.domData.set(node, domDataKey, undefined);
}
},
function cleanSingleNode(node) {
destroyCallbacksCollection = node => {
ko.utils.domData.set(node, domDataKey, undefined);
},
cleanSingleNode = node => {
// Run all the dispose callbacks
var callbacks = getDisposeCallbacksCollection(node, false);
if (callbacks) {
@ -246,12 +247,11 @@ ko.utils.domNodeDisposal = new (function () {
// Clear any immediate-child comment nodes, as these wouldn't have been found by
// node.getElementsByTagName("*") in cleanNode() (comment nodes aren't elements)
if (cleanableNodeTypesWithDescendants[node.nodeType]) {
cleanNodesInList(node.childNodes, true/*onlyComments*/);
}
}
cleanableNodeTypesWithDescendants[node.nodeType]
&& cleanNodesInList(node.childNodes, true/*onlyComments*/);
},
function cleanNodesInList(nodeList, onlyComments) {
cleanNodesInList = (nodeList, onlyComments) => {
var cleanedNodes = [], lastCleanedNode;
for (var i = 0; i < nodeList.length; i++) {
if (!onlyComments || nodeList[i].nodeType === 8) {
@ -261,7 +261,7 @@ ko.utils.domNodeDisposal = new (function () {
}
}
}
}
};
return {
addDisposeCallback : (node, callback) => {
@ -274,8 +274,7 @@ ko.utils.domNodeDisposal = new (function () {
var callbacksCollection = getDisposeCallbacksCollection(node, false);
if (callbacksCollection) {
ko.utils.arrayRemoveItem(callbacksCollection, callback);
if (callbacksCollection.length == 0)
destroyCallbacksCollection(node);
callbacksCollection.length || destroyCallbacksCollection(node);
}
},
@ -286,9 +285,8 @@ ko.utils.domNodeDisposal = new (function () {
cleanSingleNode(node);
// ... then its descendants, where applicable
if (cleanableNodeTypesWithDescendants[node.nodeType]) {
cleanNodesInList(node.getElementsByTagName("*"));
}
cleanableNodeTypesWithDescendants[node.nodeType]
&& cleanNodesInList(node.getElementsByTagName("*"));
}
});
@ -297,8 +295,7 @@ ko.utils.domNodeDisposal = new (function () {
removeNode : node => {
ko.cleanNode(node);
if (node.parentNode)
node.parentNode.removeChild(node);
node.parentNode && node.parentNode.removeChild(node);
}
};
})();
@ -454,6 +451,7 @@ class koSubscription
}
disposeWhenNodeIsRemoved(node) {
// MutationObserver ?
this._node = node;
ko.utils.domNodeDisposal.addDisposeCallback(node, this._domNodeDisposalCallback = this.dispose.bind(this));
}
@ -990,7 +988,7 @@ ko.extenders['trackArrayChanges'] = (target, options) => {
};
var computedState = Symbol('_state');
ko.computed = function (evaluatorFunctionOrOptions, options) {
ko.computed = (evaluatorFunctionOrOptions, options) => {
if (typeof evaluatorFunctionOrOptions === "object") {
// Single-parameter syntax - everything is on this "options" param
options = evaluatorFunctionOrOptions;
@ -1061,11 +1059,6 @@ ko.computed = function (evaluatorFunctionOrOptions, options) {
ko.utils.extend(computedObservable, deferEvaluationOverrides);
}
if (DEBUG) {
// #1731 - Aid debugging by exposing the computed's options
computedObservable["_options"] = options;
}
if (state.disposeWhenNodeIsRemoved) {
// Since this computed is associated with a DOM node, and we don't want to dispose the computed
// until the DOM node is *removed* from the document (as opposed to never having been in the document),
@ -1089,7 +1082,7 @@ ko.computed = function (evaluatorFunctionOrOptions, options) {
// Attach a DOM node disposal callback so that the computed will be proactively disposed as soon as the node is
// removed using ko.removeNode. But skip if isActive is false (there will never be any dependencies to dispose).
if (state.disposeWhenNodeIsRemoved && computedObservable.isActive()) {
ko.utils.domNodeDisposal.addDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback = function () {
ko.utils.domNodeDisposal.addDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback = () => {
computedObservable.dispose();
});
}
@ -1126,6 +1119,26 @@ function computedBeginDependencyDetectionCallback(subscribable, id) {
}
}
function evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext) {
// This function is really part of the evaluateImmediate_CallReadWithDependencyDetection logic.
// You'd never call it from anywhere else. Factoring it out means that evaluateImmediate_CallReadWithDependencyDetection
// can be independent of try/finally blocks, which contributes to saving about 40% off the CPU
// overhead of computed evaluation (on V8 at least).
try {
return state.readFunction();
} finally {
ko.dependencyDetection.end();
// For each subscription no longer being used, remove it from the active subscriptions list and dispose it
if (dependencyDetectionContext.disposalCount && !state.isSleeping) {
ko.utils.objectForEach(dependencyDetectionContext.disposalCandidates, computedDisposeDependencyCallback);
}
state.isStale = state.isDirty = false;
}
}
var computedFn = {
"equalityComparer": valuesArePrimitiveAndEqual,
getDependenciesCount: function () {
@ -1274,7 +1287,7 @@ var computedFn = {
state.dependencyTracking = {};
state.dependenciesCount = 0;
var newValue = this.evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext);
var newValue = evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext);
if (!state.dependenciesCount) {
computedObservable.dispose();
@ -1291,7 +1304,6 @@ var computedFn = {
}
state.latestValue = newValue;
if (DEBUG) computedObservable._latestValue = newValue;
computedObservable["notifySubscribers"](state.latestValue, "spectate");
@ -1309,25 +1321,6 @@ var computedFn = {
return changed;
},
evaluateImmediate_CallReadThenEndDependencyDetection: (state, dependencyDetectionContext) => {
// This function is really part of the evaluateImmediate_CallReadWithDependencyDetection logic.
// You'd never call it from anywhere else. Factoring it out means that evaluateImmediate_CallReadWithDependencyDetection
// can be independent of try/finally blocks, which contributes to saving about 40% off the CPU
// overhead of computed evaluation (on V8 at least).
try {
return state.readFunction();
} finally {
ko.dependencyDetection.end();
// For each subscription no longer being used, remove it from the active subscriptions list and dispose it
if (dependencyDetectionContext.disposalCount && !state.isSleeping) {
ko.utils.objectForEach(dependencyDetectionContext.disposalCandidates, computedDisposeDependencyCallback);
}
state.isStale = state.isDirty = false;
}
},
peek: function (evaluate) {
// By default, peek won't re-evaluate, except while the computed is sleeping or to get the initial value when "deferEvaluation" is set.
// Pass in true to evaluate if needed.
@ -3386,7 +3379,6 @@ ko.bindingHandlers['textInput'] = {
var elementValue = element.value;
if (previousElementValue !== elementValue) {
// Provide a way for tests to know exactly which event was processed
if (DEBUG && event) element['_ko_textInputProcessedEvent'] = event.type;
previousElementValue = elementValue;
ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'textInput', elementValue);
}
@ -3399,8 +3391,7 @@ ko.bindingHandlers['textInput'] = {
// updates that are from the previous state of the element, usually due to techniques
// such as rateLimit. Such updates, if not ignored, can cause keystrokes to be lost.
elementValueBeforeEvent = element.value;
var handler = DEBUG ? updateModel.bind(element, {type: event.type}) : updateModel;
timeoutHandle = ko.utils.setTimeout(handler, 4);
timeoutHandle = ko.utils.setTimeout(updateModel, 4);
}
};
@ -3427,18 +3418,7 @@ ko.bindingHandlers['textInput'] = {
var onEvent = (event, handler) =>
ko.utils.registerEventHandler(element, event, handler);
if (DEBUG && ko.bindingHandlers['textInput']['_forceUpdateOn']) {
// Provide a way for tests to specify exactly which events are bound
ko.bindingHandlers['textInput']['_forceUpdateOn'].forEach(eventName => {
if (eventName.slice(0,5) == 'after') {
onEvent(eventName.slice(5), deferUpdateModel);
} else {
onEvent(eventName, updateModel);
}
});
} else {
onEvent('input', updateModel);
}
onEvent('input', updateModel);
// Bind to the change event so that we can catch programmatic updates of the value that fire this event.
onEvent('change', updateModel);

View file

@ -4,80 +4,80 @@
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/
(C=>{function F(a,c){return null===a||da[typeof a]?a===c:!1}function E(a,c){var e;return()=>{e||(e=b.a.setTimeout(()=>{e=0;a()},c))}}function J(a,c){var e;return()=>{clearTimeout(e);e=b.a.setTimeout(a,c)}}function S(a,c){null!==c&&c.o&&c.o()}function V(a,c){var e=this.hc,h=e[D];h.$||(this.Ua&&this.ya[c]?(e.wb(c,a,this.ya[c]),this.ya[c]=null,--this.Ua):h.u[c]||e.wb(c,a,h.v?{V:a}:e.Yb(a)),a.ja&&a.bc())}var T=C.document,W={},b="undefined"!==typeof W?W:{};b.m=(a,c)=>{a=a.split(".");for(var e=b,h=0;h<
a.length-1;h++)e=e[a[h]];e[a[a.length-1]]=c};b.Z=(a,c,e)=>{a[c]=e};b.version="3.5.1-sm";b.m("version",b.version);b.a={va:(a,c)=>{c=a.indexOf(c);0<c?a.splice(c,1):0===c&&a.shift()},extend:(a,c)=>{c&&Object.entries(c).forEach(e=>a[e[0]]=e[1]);return a},N:(a,c)=>a&&Object.entries(a).forEach(e=>c(e[0],e[1])),eb:(a,c,e)=>{if(!a)return a;var h={};Object.entries(a).forEach(k=>h[k[0]]=c.call(e,k[1],k[0],a));return h},Ya:a=>{for(;a.firstChild;)b.removeNode(a.firstChild)},Rb:a=>{var c=[...a],e=(c[0]&&c[0].ownerDocument||
T).createElement("div");a.forEach(h=>e.append(b.ea(h)));return e},xa:(a,c)=>Array.prototype.map.call(a,c?e=>b.ea(e.cloneNode(!0)):e=>e.cloneNode(!0)),sa:(a,c)=>{b.a.Ya(a);c&&a.append(...c)},za:(a,c)=>{if(a.length){for(c=8===c.nodeType&&c.parentNode||c;a.length&&a[0].parentNode!==c;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==c;)a.length--;if(1<a.length){c=a[0];var e=a[a.length-1];for(a.length=0;c!==e;)a.push(c),c=c.nextSibling;a.push(e)}}return a},Xb:a=>null==a?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,
""),Ec:(a,c)=>{a=a||"";return c.length>a.length?!1:a.substring(0,c.length)===c},kc:(a,c)=>c.contains(1!==a.nodeType?a.parentNode:a),Xa:a=>b.a.kc(a,a.ownerDocument.documentElement),Eb:a=>b.onError?function(){try{return a.apply(this,arguments)}catch(c){throw b.onError&&b.onError(c),c;}}:a,setTimeout:(a,c)=>setTimeout(b.a.Eb(a),c),Ib:a=>setTimeout(()=>{b.onError&&b.onError(a);throw a;},0),H:(a,c,e)=>{a.addEventListener(c,b.a.Eb(e),!1)},Zb:(a,c)=>{if(!a||!a.nodeType)throw Error("element must be a DOM node when calling triggerEvent");
a.dispatchEvent(new Event(c))},g:a=>b.K(a)?a():a,ib:(a,c)=>a.textContent=b.a.g(c)||""};b.m("utils",b.a);b.m("unwrap",b.a.g);b.a.f=new function(){let a=0,c="__ko__"+Date.now(),e=new WeakMap;return{get:(h,k)=>(e.get(h)||{})[k],set:(h,k,t)=>{if(e.has(h))e.get(h)[k]=t;else{let d={};d[k]=t;e.set(h,d)}return t},$a:function(h,k,t){return this.get(h,k)||this.set(h,k,t)},clear:h=>e.delete(h),X:()=>a++ +c}};b.a.J=new function(){function a(d,f){var g=b.a.f.get(d,h);void 0===g&&f&&(g=[],b.a.f.set(d,h,g));return g}
function c(d){var f=a(d,!1);if(f){f=f.slice(0);for(var g=0;g<f.length;g++)f[g](d)}b.a.f.clear(d);t[d.nodeType]&&e(d.childNodes,!0)}function e(d,f){for(var g=[],n,p=0;p<d.length;p++)if(!f||8===d[p].nodeType)if(c(g[g.length]=n=d[p]),d[p]!==n)for(;p--&&!g.includes(d[p]););}var h=b.a.f.X(),k={1:!0,8:!0,9:!0},t={1:!0,9:!0};return{ma:(d,f)=>{if("function"!=typeof f)throw Error("Callback must be a function");a(d,!0).push(f)},hb:(d,f)=>{var g=a(d,!1);g&&(b.a.va(g,f),0==g.length&&b.a.f.set(d,h,void 0))},ea:d=>
{b.i.D(()=>{k[d.nodeType]&&(c(d),t[d.nodeType]&&e(d.getElementsByTagName("*")))});return d},removeNode:d=>{b.ea(d);d.parentNode&&d.parentNode.removeChild(d)}}};b.ea=b.a.J.ea;b.removeNode=b.a.J.removeNode;b.m("utils.domNodeDisposal",b.a.J);b.m("utils.domNodeDisposal.addDisposeCallback",b.a.J.ma);b.lb=(()=>{function a(){if(e)for(var d=e,f=0,g;k<e;)if(g=c[k++]){if(k>d){if(5E3<=++f){k=e;b.a.Ib(Error("'Too much recursion' after processing "+f+" task groups."));break}d=e}try{g()}catch(n){b.a.Ib(n)}}k=e=
c.length=0}var c=[],e=0,h=1,k=0,t=(d=>{var f=T.createElement("div");(new MutationObserver(d)).observe(f,{attributes:!0});return()=>f.classList.toggle("foo")})(a);return{Vb:d=>{e||t(a);c[e++]=d;return h++},cancel:d=>{d-=h-e;d>=k&&d<e&&(c[d]=null)}}})();b.m("tasks",b.lb);b.Za={debounce:(a,c)=>a.Ga(e=>J(e,c)),rateLimit:(a,c)=>{if("number"==typeof c)var e=c;else{e=c.timeout;var h=c.method}var k="function"==typeof h?h:E;a.Ga(t=>k(t,e,c))},notify:(a,c)=>{a.equalityComparer="always"==c?null:F}};var da={undefined:1,
"boolean":1,number:1,string:1};b.m("extenders",b.Za);class ea{constructor(a,c,e){this.V=a;this.pb=c;this.Cb=e;this.Ma=!1;this.P=this.Qa=null;b.Z(this,"dispose",this.o);b.Z(this,"disposeWhenNodeIsRemoved",this.j)}o(){this.Ma||(this.P&&b.a.J.hb(this.Qa,this.P),this.Ma=!0,this.Cb(),this.V=this.pb=this.Cb=this.Qa=this.P=null)}j(a){this.Qa=a;b.a.J.ma(a,this.P=this.o.bind(this))}}b.T=function(){Object.setPrototypeOf(this,P);P.Da(this)};var P={Da:a=>{a.U={change:[]};a.vb=1},subscribe:function(a,c,e){var h=
this;e=e||"change";var k=new ea(h,c?a.bind(c):a,()=>{b.a.va(h.U[e],k);h.ua&&h.ua(e)});h.na&&h.na(e);h.U[e]||(h.U[e]=[]);h.U[e].push(k);return k},notifySubscribers:function(a,c){c=c||"change";"change"===c&&this.Ja();if(this.qa(c)){c="change"===c&&this.$b||this.U[c].slice(0);try{b.i.zb();for(var e=0,h;h=c[e++];)h.Ma||h.pb(a)}finally{b.i.end()}}},Ba:function(){return this.vb},qc:function(a){return this.Ba()!==a},Ja:function(){++this.vb},Ga:function(a){var c=this,e=b.K(c),h,k,t,d,f;c.ta||(c.ta=c.notifySubscribers,
c.notifySubscribers=function(n,p){p&&"change"!==p?"beforeChange"===p?this.sb(n):this.ta(n,p):this.tb(n)});var g=a(()=>{c.ja=!1;e&&d===c&&(d=c.qb?c.qb():c());var n=k||f&&c.Fa(t,d);f=k=h=!1;n&&c.ta(t=d)});c.tb=(n,p)=>{p&&c.ja||(f=!p);c.$b=c.U.change.slice(0);c.ja=h=!0;d=n;g()};c.sb=n=>{h||(t=n,c.ta(n,"beforeChange"))};c.ub=()=>{f=!0};c.bc=()=>{c.Fa(t,c.G(!0))&&(k=!0)}},qa:function(a){return this.U[a]&&this.U[a].length},Fa:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:()=>
"[object Object]",extend:function(a){var c=this;a&&b.a.N(a,(e,h)=>{e=b.Za[e];"function"==typeof e&&(c=e(c,h)||c)});return c}};b.Z(P,"init",P.Da);b.Z(P,"subscribe",P.subscribe);b.Z(P,"extend",P.extend);Object.setPrototypeOf(P,Function.prototype);b.T.fn=P;b.tc=a=>null!=a&&"function"==typeof a.subscribe&&"function"==typeof a.notifySubscribers;b.i=(()=>{var a=[],c,e=0;return{zb:h=>{a.push(c);c=h},end:()=>c=a.pop(),Ub:h=>{if(c){if(!b.tc(h))throw Error("Only subscribable things can act as dependencies");
c.dc.call(c.ec,h,h.ac||(h.ac=++e))}},D:(h,k,t)=>{try{return a.push(c),c=void 0,h.apply(k,t||[])}finally{c=a.pop()}},Aa:()=>c&&c.l.Aa(),bb:()=>c&&c.bb,l:()=>c&&c.l}})();const O=Symbol("_latestValue");b.ba=a=>{function c(){if(0<arguments.length)return c.Fa(c[O],arguments[0])&&(c.nb(),c[O]=arguments[0],c.Ka()),this;b.i.Ub(c);return c[O]}c[O]=a;Object.defineProperty(c,"length",{get:()=>null==c[O]?void 0:c[O].length});b.T.fn.Da(c);Object.setPrototypeOf(c,Q);return c};var Q={toJSON:function(){let a=this[O];
return a&&a.toJSON?a.toJSON():a},equalityComparer:F,G:function(){return this[O]},Ka:function(){this.notifySubscribers(this[O],"spectate");this.notifySubscribers(this[O])},nb:function(){this.notifySubscribers(this[O],"beforeChange")}};Object.setPrototypeOf(Q,b.T.fn);var R=b.ba.P="__ko_proto__";Q[R]=b.ba;b.K=a=>{if((a="function"==typeof a&&a[R])&&a!==Q[R]&&a!==b.l.fn[R])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!a};b.vc=a=>"function"==
typeof a&&(a[R]===Q[R]||a[R]===b.l.fn[R]&&a.rc);b.m("observable",b.ba);b.m("isObservable",b.K);b.m("observable.fn",Q);b.Z(Q,"valueHasMutated",Q.Ka);b.ha=a=>{a=a||[];if("object"!=typeof a||!("length"in a))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");a=b.ba(a);Object.setPrototypeOf(a,b.ha.fn);return a.extend({trackArrayChanges:!0})};b.ha.fn={remove:function(a){for(var c=this.G(),e=[],h="function"!=typeof a||b.K(a)?function(d){return d===
a}:a,k=c.length;k--;){var t=c[k];if(h(t)){0===e.length&&this.nb();if(c[k]!==t)throw Error("Array modified during remove; cannot remove item");e.push(t);c.splice(k,1)}}e.length&&this.Ka();return e}};Object.setPrototypeOf(b.ha.fn,b.ba.fn);Object.getOwnPropertyNames(Array.prototype).forEach(a=>{"function"===typeof Array.prototype[a]&&"constructor"!=a&&("copyWithin fill pop push reverse shift sort splice unshift".split(" ").includes(a)?b.ha.fn[a]=function(...c){var e=this.G();this.nb();this.Db(e,a,c);
c=e[a](...c);this.Ka();return c===e?this:c}:b.ha.fn[a]=function(...c){return this()[a](...c)})});b.Ob=a=>b.K(a)&&"function"==typeof a.remove&&"function"==typeof a.push;b.m("observableArray",b.ha);b.m("isObservableArray",b.Ob);b.Za.trackArrayChanges=(a,c)=>{function e(){function q(){if(f){var u=[].concat(a.G()||[]);if(a.qa("arrayChange")){if(!k||1<f)k=b.a.Fb(g,u,a.Sa);var x=k}g=u;k=null;f=0;x&&x.length&&a.notifySubscribers(x,"arrayChange")}}h?q():(h=!0,d=a.subscribe(()=>++f,null,"spectate"),g=[].concat(a.G()||
[]),k=null,t=a.subscribe(q))}a.Sa={};c&&"object"==typeof c&&b.a.extend(a.Sa,c);a.Sa.sparse=!0;if(!a.Db){var h=!1,k=null,t,d,f=0,g,n=a.na,p=a.ua;a.na=q=>{n&&n.call(a,q);"arrayChange"===q&&e()};a.ua=q=>{p&&p.call(a,q);"arrayChange"!==q||a.qa("arrayChange")||(t&&t.o(),d&&d.o(),d=t=null,h=!1,g=void 0)};a.Db=(q,u,x)=>{function l(G,z,M){return m[m.length]={status:G,value:z,index:M}}if(h&&!f){var m=[],r=q.length,v=x.length,y=0;switch(u){case "push":y=r;case "unshift":for(u=0;u<v;u++)l("added",x[u],y+u);
break;case "pop":y=r-1;case "shift":r&&l("deleted",q[y],y);break;case "splice":u=Math.min(Math.max(0,0>x[0]?r+x[0]:x[0]),r);r=1===v?r:Math.min(u+(x[1]||0),r);v=u+v-2;y=Math.max(r,v);for(var w=[],A=[],I=2;u<y;++u,++I)u<r&&A.push(l("deleted",q[u],u)),u<v&&w.push(l("added",x[I],u));b.a.Lb(A,w);break;default:return}k=m}}}};var D=Symbol("_state");b.l=function(a,c){function e(){if(0<arguments.length){if("function"===typeof h)h(...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}k.$||b.i.Ub(e);(k.W||k.v&&e.ra())&&e.S();return k.L}"object"===typeof a?c=a:(c=c||{},a&&(c.read=a));if("function"!=typeof c.read)throw Error("Pass a function that returns the value of the ko.computed");var h=c.write,k={L:void 0,aa:!0,W:!0,Ea:!1,kb:!1,$:!1,gb:!1,v:!1,Tb:c.read,j:c.disposeWhenNodeIsRemoved||c.j||null,oa:c.disposeWhen||c.oa,Wa:null,u:{},I:0,Kb:null};e[D]=k;e.rc="function"===typeof h;b.T.fn.Da(e);Object.setPrototypeOf(e,U);c.pure?(k.gb=!0,k.v=!0,b.a.extend(e,fa)):c.deferEvaluation&&
b.a.extend(e,ha);k.j&&(k.kb=!0,k.j.nodeType||(k.j=null));k.v||c.deferEvaluation||e.S();k.j&&e.ga()&&b.a.J.ma(k.j,k.Wa=function(){e.o()});return e};var U={equalityComparer:F,Aa:function(){return this[D].I},oc:function(){var a=[];b.a.N(this[D].u,(c,e)=>a[e.ka]=e.V);return a},ab:function(a){if(!this[D].I)return!1;var c=this.oc();return c.includes(a)?!0:!!c.find(e=>e.ab&&e.ab(a))},wb:function(a,c,e){if(this[D].gb&&c===this)throw Error("A 'pure' computed must not be called recursively");this[D].u[a]=e;
e.ka=this[D].I++;e.la=c.Ba()},ra:function(){var a,c=this[D].u;for(a in c)if(Object.prototype.hasOwnProperty.call(c,a)){var e=c[a];if(this.ia&&e.V.ja||e.V.qc(e.la))return!0}},Hc:function(){this.ia&&!this[D].Ea&&this.ia(!1)},ga:function(){var a=this[D];return a.W||0<a.I},Ic:function(){this.ja?this[D].W&&(this[D].aa=!0):this.Jb()},Yb:function(a){return a.subscribe(this.Jb,this)},Jb:function(){var a=this,c=a.throttleEvaluation;c&&0<=c?(clearTimeout(this[D].Kb),this[D].Kb=b.a.setTimeout(()=>a.S(!0),c)):
a.ia?a.ia(!0):a.S(!0)},S:function(a){var c=this[D],e=c.oa,h=!1;if(!c.Ea&&!c.$){if(c.j&&!b.a.Xa(c.j)||e&&e()){if(!c.kb){this.o();return}}else c.kb=!1;c.Ea=!0;try{h=this.mc(a)}finally{c.Ea=!1}return h}},mc:function(a){var c=this[D],e=c.gb?void 0:!c.I;var h={hc:this,ya:c.u,Ua:c.I};b.i.zb({ec:h,dc:V,l:this,bb:e});c.u={};c.I=0;var k=this.lc(c,h);c.I?h=this.Fa(c.L,k):(this.o(),h=!0);h&&(c.v?this.Ja():this.notifySubscribers(c.L,"beforeChange"),c.L=k,this.notifySubscribers(c.L,"spectate"),!c.v&&a&&this.notifySubscribers(c.L),
this.ub&&this.ub());e&&this.notifySubscribers(c.L,"awake");return h},lc:(a,c)=>{try{return a.Tb()}finally{b.i.end(),c.Ua&&!a.v&&b.a.N(c.ya,S),a.aa=a.W=!1}},G:function(a){var c=this[D];(c.W&&(a||!c.I)||c.v&&this.ra())&&this.S();return c.L},Ga:function(a){b.T.fn.Ga.call(this,a);this.qb=function(){this[D].v||(this[D].aa?this.S():this[D].W=!1);return this[D].L};this.ia=function(c){this.sb(this[D].L);this[D].W=!0;c&&(this[D].aa=!0);this.tb(this,!c)}},o:function(){var a=this[D];!a.v&&a.u&&b.a.N(a.u,(c,
e)=>e.o&&e.o());a.j&&a.Wa&&b.a.J.hb(a.j,a.Wa);a.u=void 0;a.I=0;a.$=!0;a.aa=!1;a.W=!1;a.v=!1;a.j=void 0;a.oa=void 0;a.Tb=void 0}},fa={na:function(a){var c=this,e=c[D];if(!e.$&&e.v&&"change"==a){e.v=!1;if(e.aa||c.ra())e.u=null,e.I=0,c.S()&&c.Ja();else{var h=[];b.a.N(e.u,(k,t)=>h[t.ka]=k);h.forEach((k,t)=>{var d=e.u[k],f=c.Yb(d.V);f.ka=t;f.la=d.la;e.u[k]=f});c.ra()&&c.S()&&c.Ja()}e.$||c.notifySubscribers(e.L,"awake")}},ua:function(a){var c=this[D];c.$||"change"!=a||this.qa("change")||(b.a.N(c.u,(e,h)=>
{h.o&&(c.u[e]={V:h.V,ka:h.ka,la:h.la},h.o())}),c.v=!0,this.notifySubscribers(void 0,"asleep"))},Ba:function(){var a=this[D];a.v&&(a.aa||this.ra())&&this.S();return b.T.fn.Ba.call(this)}},ha={na:function(a){"change"!=a&&"beforeChange"!=a||this.G()}};Object.setPrototypeOf(U,b.T.fn);U[b.ba.P]=b.l;b.m("computed",b.l);b.m("computed.fn",U);b.Z(U,"dispose",U.o);b.Ac=a=>{if("function"===typeof a)return b.l(a,{pure:!0});a=b.a.extend({},a);a.pure=!0;return b.l(a)};(()=>{b.A={O:a=>{switch(a.nodeName){case "OPTION":return!0===
a.__ko__hasDomDataOptionValue__?b.a.f.get(a,b.b.options.fb):a.value;case "SELECT":return 0<=a.selectedIndex?b.A.O(a.options[a.selectedIndex]):void 0;default:return a.value}},La:(a,c,e)=>{switch(a.nodeName){case "OPTION":"string"===typeof c?(b.a.f.set(a,b.b.options.fb,void 0),delete a.__ko__hasDomDataOptionValue__,a.value=c):(b.a.f.set(a,b.b.options.fb,c),a.__ko__hasDomDataOptionValue__=!0,a.value="number"===typeof c?c:"");break;case "SELECT":for(var h=-1,k=""===c||null==c,t=0,d=a.options.length,f;t<
d;++t)if(f=b.A.O(a.options[t]),f==c||""===f&&k){h=t;break}if(e||0<=h||k&&1<a.size)a.selectedIndex=h;break;default:a.value=null==c?"":c}}}})();b.F=(()=>{function a(f){f=b.a.Xb(f);123===f.charCodeAt(0)&&(f=f.slice(1,-1));f+="\n,";var g=[],n=f.match(h),p=[],q=0;if(1<n.length){for(var u=0,x;x=n[u];++u){var l=x.charCodeAt(0);if(44===l){if(0>=q){g.push(m&&p.length?{key:m,value:p.join("")}:{unknown:m||p.join("")});var m=q=0;p=[];continue}}else if(58===l){if(!q&&!m&&1===p.length){m=p.pop();continue}}else if(47===
l&&1<x.length&&(47===x.charCodeAt(1)||42===x.charCodeAt(1)))continue;else 47===l&&u&&1<x.length?(l=n[u-1].match(k))&&!t[l[0]]&&(f=f.substr(f.indexOf(x)+1),n=f.match(h),u=-1,x="/"):40===l||123===l||91===l?++q:41===l||125===l||93===l?--q:m||p.length||34!==l&&39!==l||(x=x.slice(1,-1));p.push(x)}if(0<q)throw Error("Unbalanced parentheses, braces, or brackets");}return g}var c=["true","false","null","undefined"],e=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,h=/"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|`(?:\\.|[^`])*`|\/\*(?:[^*]|\*+[^*/])*\*+\/|\/\/.*\n|\/(?:\\.|[^/])+\/w*|[^\s:,/][^,"'`{}()/:[\]]*[^\s,"'`{}()/:[\]]|[^\s]/g,
k=/[\])"'A-Za-z0-9_$]+$/,t={"in":1,"return":1,"typeof":1},d={};return{Ra:[],mb:d,yc:a,zc:function(f,g){function n(l,m){if(!x){var r=b.getBindingHandler(l);if(r&&r.preprocess&&!(m=r.preprocess(m,l,n)))return;if(r=d[l]){var v=m;c.includes(v)?v=!1:(r=v.match(e),v=null===r?!1:r[1]?"Object("+r[1]+")"+r[2]:v);r=v}r&&q.push("'"+("string"==typeof d[l]?d[l]:l)+"':function(_z){"+v+"=_z}")}u&&(m="function(){return "+m+" }");p.push("'"+l+"':"+m)}g=g||{};var p=[],q=[],u=g.valueAccessors,x=g.bindingParams;("string"===
typeof f?a(f):f).forEach(l=>n(l.key||l.unknown,l.value));q.length&&n("_ko_property_writers","{"+q.join(",")+" }");return p.join(",")},wc:(f,g)=>-1<f.findIndex(n=>n.key==g),ob:(f,g,n,p,q)=>{if(f&&b.K(f))!b.vc(f)||q&&f.G()===p||f(p);else if((f=g.get("_ko_property_writers"))&&f[n])f[n](p)}}})();(()=>{function a(d){return 8==d.nodeType&&h.test(d.nodeValue)}function c(d){return 8==d.nodeType&&k.test(d.nodeValue)}function e(d,f){for(var g=d,n=1,p=[];g=g.nextSibling;){if(c(g)&&(b.a.f.set(g,t,!0),n--,0===
n))return p;p.push(g);a(g)&&n++}if(!f)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}var h=/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=/^\s*\/ko\s*$/,t="__ko_matchedEndComment__";b.h={ca:{},childNodes:d=>a(d)?e(d):d.childNodes,pa:d=>{if(a(d)){d=e(d);for(var f=0,g=d.length;f<g;f++)b.removeNode(d[f])}else b.a.Ya(d)},sa:(d,f)=>{if(a(d)){b.h.pa(d);d=d.nextSibling;for(var g=0,n=f.length;g<n;g++)d.parentNode.insertBefore(f[g],d)}else b.a.sa(d,f)},prepend:(d,f)=>{if(a(d)){var g=d.nextSibling;
d=d.parentNode}else g=d.firstChild;d.insertBefore(f,g)},Nb:(d,f,g)=>{g?(g=g.nextSibling,a(d)&&(d=d.parentNode),d.insertBefore(f,g)):b.h.prepend(d,f)},firstChild:d=>{if(a(d))return!d.nextSibling||c(d.nextSibling)?null:d.nextSibling;if(d.firstChild&&c(d.firstChild))throw Error("Found invalid end comment, as the first child of "+d);return d.firstChild},nextSibling:d=>{if(a(d)){var f=e(d,void 0);d=f?0<f.length?f[f.length-1].nextSibling:d.nextSibling:null}if(d.nextSibling&&c(d.nextSibling)){f=d.nextSibling;
if(c(f)&&!b.a.f.get(f,t))throw Error("Found end comment without a matching opening comment, as child of "+d);return null}return d.nextSibling},pc:a,Fc:d=>(d=d.nodeValue.match(h))?d[1]:null}})();(()=>{const a={};b.Bb=new class{xc(c){switch(c.nodeType){case 1:return null!=c.getAttribute("data-bind");case 8:return b.h.pc(c);default:return!1}}nc(c,e){a:{switch(c.nodeType){case 1:var h=c.getAttribute("data-bind");break a;case 8:h=b.h.Fc(c);break a}h=null}if(h){var k={valueAccessors:!0};try{var t=h+(k&&
k.valueAccessors||""),d;if(!(d=a[t])){var f="with($context){with($data||{}){return{"+b.F.zc(h,k)+"}}}";var g=new Function("$context","$element",f);d=a[t]=g}var n=d(e,c)}catch(p){throw p.message="Unable to parse bindings.\nBindings value: "+h+"\nMessage: "+p.message,p;}}else n=null;return n}}})();(()=>{function a(l){var m=(l=b.a.f.get(l,x))&&l.C;m&&(l.C=null,m.Sb())}function c(l,m,r){this.node=l;this.Ab=m;this.wa=[];this.B=!1;m.C||b.a.J.ma(l,a);r&&r.C&&(r.C.wa.push(l),this.Na=r)}function e(l){return b.a.eb(b.i.D(l),
(m,r)=>()=>l()[r])}function h(l,m,r){return"function"===typeof l?e(l.bind(null,m,r)):b.a.eb(l,v=>()=>v)}function k(l,m){var r=b.h.firstChild(m);if(r)for(var v;v=r;)r=b.h.nextSibling(v),t(l,v);b.c.notify(m,b.c.B)}function t(l,m){var r=l;if(1===m.nodeType||b.Bb.xc(m))r=f(m,null,l).bindingContextForDescendants;r&&m.matches&&!m.matches("SCRIPT,TEXTAREA,TEMPLATE")&&k(r,m)}function d(l){var m=[],r={},v=[];b.a.N(l,function A(w){if(!r[w]){var I=b.getBindingHandler(w);I&&(I.after&&(v.push(w),I.after.forEach(G=>
{if(l[G]){if(v.includes(G))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+v.join(", "));A(G)}}),v.length--),m.push({key:w,Mb:I}));r[w]=!0}});return m}function f(l,m,r){var v=b.a.f.$a(l,x,{}),y=v.cc;if(!m){if(y)throw Error("You cannot apply bindings multiple times to the same element.");v.cc=!0}y||(v.context=r);v.cb||(v.cb={});if(m&&"function"!==typeof m)var w=m;else{var A=b.l(()=>{if(w=m?m(r,l):b.Bb.nc(l,r)){if(r[n])r[n]();if(r[q])r[q]()}return w},{j:l});
w&&A.ga()||(A=null)}var I=r,G;if(w){var z=A?B=>()=>A()[B]():B=>w[B];function M(){return b.a.eb(A?A():w,B=>B())}M.get=B=>w[B]&&z(B)();M.has=B=>B in w;b.c.B in w&&b.c.subscribe(l,b.c.B,()=>{var B=w[b.c.B]();if(B){var H=b.h.childNodes(l);H.length&&B(H,b.Hb(H[0]))}});b.c.Y in w&&(I=b.c.jb(l,r),b.c.subscribe(l,b.c.Y,()=>{var B=w[b.c.Y]();B&&b.h.firstChild(l)&&B(l)}));d(w).forEach(B=>{var H=B.Mb.init,L=B.Mb.update,K=B.key;if(8===l.nodeType&&!b.h.ca[K])throw Error("The binding '"+K+"' cannot be used with virtual elements");
try{"function"==typeof H&&b.i.D(()=>{var N=H(l,z(K),M,I.$data,I);if(N&&N.controlsDescendantBindings){if(void 0!==G)throw Error("Multiple bindings ("+G+" and "+K+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");G=K}}),"function"==typeof L&&b.l(()=>L(l,z(K),M,I.$data,I),{j:l})}catch(N){throw N.message='Unable to process binding "'+K+": "+w[K]+'"\nMessage: '+N.message,N;}})}v=void 0===G;return{shouldBindDescendants:v,bindingContextForDescendants:v&&
I}}function g(l,m){return l&&l instanceof b.R?l:new b.R(l,void 0,void 0,m)}var n=Symbol("_subscribable"),p=Symbol("_ancestorBindingInfo"),q=Symbol("_dataDependency");b.b={};b.getBindingHandler=l=>b.b[l];var u={};b.R=function(l,m,r,v,y){function w(){var H=z?G():G,L=b.a.g(H);m?(b.a.extend(A,m),p in m&&(A[p]=m[p])):(A.$parents=[],A.$root=L,A.ko=b);A[n]=B;I?L=A.$data:(A.$rawData=H,A.$data=L);r&&(A[r]=L);v&&v(A,m,L);if(m&&m[n]&&!b.i.l().ab(m[n]))m[n]();M&&(A[q]=M);return A.$data}var A=this,I=l===u,G=I?
void 0:l,z="function"==typeof G&&!b.K(G),M=y&&y.dataDependency;if(y&&y.exportDependencies)w();else{var B=b.Ac(w);B.G();B.ga()?B.equalityComparer=null:A[n]=void 0}};b.R.prototype.createChildContext=function(l,m,r,v){!v&&m&&"object"==typeof m&&(v=m,m=v.as,r=v.extend);if(m&&v&&v.noChildContext){var y="function"==typeof l&&!b.K(l);return new b.R(u,this,null,w=>{r&&r(w);w[m]=y?l():l},v)}return new b.R(l,this,m,(w,A)=>{w.$parentContext=A;w.$parent=A.$data;w.$parents=(A.$parents||[]).slice(0);w.$parents.unshift(w.$parent);
r&&r(w)},v)};b.R.prototype.extend=function(l,m){return new b.R(u,this,null,r=>b.a.extend(r,"function"==typeof l?l(r):l),m)};var x=b.a.f.X();c.prototype.Sb=function(){this.Na&&this.Na.C&&this.Na.C.jc(this.node)};c.prototype.jc=function(l){b.a.va(this.wa,l);!this.wa.length&&this.B&&this.Gb()};c.prototype.Gb=function(){this.B=!0;this.Ab.C&&!this.wa.length&&(this.Ab.C=null,b.a.J.hb(this.node,a),b.c.notify(this.node,b.c.Y),this.Sb())};b.c={B:"childrenComplete",Y:"descendantsComplete",subscribe:(l,m,r,
v,y)=>{var w=b.a.f.$a(l,x,{});w.fa||(w.fa=new b.T);y&&y.notifyImmediately&&w.cb[m]&&b.i.D(r,v,[l]);return w.fa.subscribe(r,v,m)},notify:(l,m)=>{var r=b.a.f.get(l,x);if(r&&(r.cb[m]=!0,r.fa&&r.fa.notifySubscribers(l,m),m==b.c.B))if(r.C)r.C.Gb();else if(void 0===r.C&&r.fa&&r.fa.qa(b.c.Y))throw Error("descendantsComplete event not supported for bindings on this node");},jb:(l,m)=>{var r=b.a.f.$a(l,x,{});r.C||(r.C=new c(l,r,m[p]));return m[p]==r?m:m.extend(v=>{v[p]=r})}};b.Dc=l=>(l=b.a.f.get(l,x))&&l.context;
b.Pa=(l,m,r)=>f(l,m,g(r));b.Gc=(l,m,r)=>{r=g(r);return b.Pa(l,h(m,r,l),r)};b.yb=(l,m)=>{1!==m.nodeType&&8!==m.nodeType||k(g(l),m)};b.xb=function(l,m,r){if(2>arguments.length){if(m=T.body,!m)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");}else if(!m||1!==m.nodeType&&8!==m.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");t(g(l,r),m)};b.Hb=l=>(l=l&&[1,8].includes(l.nodeType)&&b.Dc(l))?
l.$data:void 0;b.m("bindingHandlers",b.b);b.m("applyBindings",b.xb);b.m("applyBindingAccessorsToNode",b.Pa);b.m("dataFor",b.Hb)})();(()=>{function a(d,f){return Object.prototype.hasOwnProperty.call(d,f)?d[f]:void 0}function c(d,f){var g=a(k,d);if(g)g.subscribe(f);else{g=k[d]=new b.T;g.subscribe(f);e(d,(p,q)=>{q=!(!q||!q.synchronous);t[d]={definition:p,uc:q};delete k[d];n||q?g.notifySubscribers(p):b.lb.Vb(()=>g.notifySubscribers(p))});var n=!0}}function e(d,f){h("getConfig",[d],g=>{g?h("loadComponent",
[d,g],n=>f(n,g)):f(null,null)})}function h(d,f,g,n){n||(n=b.s.loaders.slice(0));var p=n.shift();if(p){var q=p[d];if(q){var u=!1;if(void 0!==q.apply(p,f.concat(function(x){u?g(null):null!==x?g(x):h(d,f,g,n)}))&&(u=!0,!p.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else h(d,f,g,n)}else g(null)}var k={},t={};b.s={get:(d,f)=>{var g=a(t,d);g?g.uc?b.i.D(()=>f(g.definition)):b.lb.Vb(()=>f(g.definition)):c(d,
f)},fc:d=>delete t[d],rb:h};b.s.loaders=[];b.m("components",b.s)})();(()=>{function a(d,f,g,n){var p={},q=2;f=g.template;g=g.viewModel;f?b.s.rb("loadTemplate",[d,f],u=>{p.template=u;0===--q&&n(p)}):0===--q&&n(p);g?b.s.rb("loadViewModel",[d,g],u=>{p[t]=u;0===--q&&n(p)}):0===--q&&n(p)}function c(d,f,g){if("function"===typeof f)g(p=>new f(p));else if("function"===typeof f[t])g(f[t]);else if("instance"in f){var n=f.instance;g(()=>n)}else"viewModel"in f?c(d,f.viewModel,g):d("Unknown viewModel value: "+
f)}function e(d){if(d.matches("TEMPLATE")&&d.content instanceof DocumentFragment)return b.a.xa(d.content.childNodes);throw"Template Source Element not a <template>";}function h(d){return f=>{throw Error("Component '"+d+"': "+f);}}var k={};b.s.register=(d,f)=>{if(!f)throw Error("Invalid configuration for "+d);if(b.s.Pb(d))throw Error("Component "+d+" is already registered");k[d]=f};b.s.Pb=d=>Object.prototype.hasOwnProperty.call(k,d);b.s.unregister=d=>{delete k[d];b.s.fc(d)};b.s.ic={getConfig:(d,f)=>
{d=b.s.Pb(d)?k[d]:null;f(d)},loadComponent:(d,f,g)=>{var n=h(d);a(d,n,f,g)},loadTemplate:(d,f,g)=>{d=h(d);if(f instanceof Array)g(f);else if(f instanceof DocumentFragment)g([...f.childNodes]);else if(f.element)if(f=f.element,f instanceof HTMLElement)g(e(f));else if("string"===typeof f){var n=T.getElementById(f);n?g(e(n)):d("Cannot find element with ID "+f)}else d("Unknown element type: "+f);else d("Unknown template value: "+f)},loadViewModel:(d,f,g)=>c(h(d),f,g)};var t="createViewModel";b.m("components.register",
b.s.register);b.s.loaders.push(b.s.ic)})();(()=>{function a(h,k,t){k=k.template;if(!k)throw Error("Component '"+h+"' has no template");h=b.a.xa(k);b.h.sa(t,h)}function c(h,k,t){var d=h.createViewModel;return d?d.call(h,k,t):k}var e=0;b.b.component={init:(h,k,t,d,f)=>{var g,n,p,q=()=>{var x=g&&g.dispose;"function"===typeof x&&x.call(g);p&&p.o();n=g=p=null},u=[...b.h.childNodes(h)];b.h.pa(h);b.a.J.ma(h,q);b.l(()=>{var x=b.a.g(k());if("string"===typeof x)var l=x;else{l=b.a.g(x.name);var m=b.a.g(x.params)}if(!l)throw Error("No component name specified");
var r=b.c.jb(h,f),v=n=++e;b.s.get(l,y=>{if(n===v){q();if(!y)throw Error("Unknown component '"+l+"'");a(l,y,h);var w=c(y,m,{element:h,templateNodes:u});y=r.createChildContext(w,{extend:A=>{A.$component=w;A.$componentTemplateNodes=u}});w&&w.koDescendantsComplete&&(p=b.c.subscribe(h,b.c.Y,w.koDescendantsComplete,w));g=w;b.yb(y,h)}})},{j:h});return{controlsDescendantBindings:!0}}};b.h.ca.component=!0})();b.b.attr={update:(a,c)=>{c=b.a.g(c())||{};b.a.N(c,function(e,h){h=b.a.g(h);var k=e.indexOf(":");k=
"lookupNamespaceURI"in a&&0<k&&a.lookupNamespaceURI(e.substr(0,k));var t=!1===h||null===h||void 0===h;t?k?a.removeAttributeNS(k,e):a.removeAttribute(e):h=h.toString();t||(k?a.setAttributeNS(k,e,h):a.setAttribute(e,h));"name"===e&&(a.name=t?"":h)})}};var X=(a,c,e)=>{c&&c.split(/\s+/).forEach(h=>a.classList.toggle(h,e))};b.b.css={update:(a,c)=>{c=b.a.g(c());null!==c&&"object"==typeof c?b.a.N(c,(e,h)=>{h=b.a.g(h);X(a,e,!!h)}):(c=b.a.Xb(c),X(a,a.__ko__cssValue,!1),a.__ko__cssValue=c,X(a,c,!0))}};b.b.enable=
{update:(a,c)=>{(c=b.a.g(c()))&&a.disabled?a.removeAttribute("disabled"):c||a.disabled||(a.disabled=!0)}};b.b.disable={update:(a,c)=>b.b.enable.update(a,()=>!b.a.g(c()))};b.b.event={init:(a,c,e,h,k)=>{var t=c()||{};b.a.N(t,d=>{"string"==typeof d&&b.a.H(a,d,function(f){var g=c()[d];if(g){try{h=k.$data;var n=g.apply(h,[h,...arguments])}finally{!0!==n&&f.preventDefault()}!1===e.get(d+"Bubble")&&(f.cancelBubble=!0,f.stopPropagation())}})})}};b.b.foreach={Qb:a=>()=>{var c=a(),e=b.K(c)?c.G():c;if(!e||"number"==
typeof e.length)return{foreach:c};b.a.g(c);return{foreach:e.data,as:e.as,noChildContext:e.noChildContext,includeDestroyed:e.includeDestroyed,afterAdd:e.afterAdd,beforeRemove:e.beforeRemove,afterRender:e.afterRender,beforeMove:e.beforeMove,afterMove:e.afterMove}},init:(a,c)=>b.b.template.init(a,b.b.foreach.Qb(c)),update:(a,c,e,h,k)=>b.b.template.update(a,b.b.foreach.Qb(c),e,h,k)};b.F.Ra.foreach=!1;b.h.ca.foreach=!0;b.b.hasfocus={init:(a,c,e)=>{var h=t=>{a.__ko_hasfocusUpdating=!0;t=a.ownerDocument.activeElement===
a;var d=c();b.F.ob(d,e,"hasfocus",t,!0);a.__ko_hasfocusLastValue=t;a.__ko_hasfocusUpdating=!1},k=h.bind(null,!0);h=h.bind(null,!1);b.a.H(a,"focus",k);b.a.H(a,"focusin",k);b.a.H(a,"blur",h);b.a.H(a,"focusout",h);a.__ko_hasfocusLastValue=!1},update:(a,c)=>{c=!!b.a.g(c());a.__ko_hasfocusUpdating||a.__ko_hasfocusLastValue===c||(c?a.focus():a.blur())}};b.F.mb.hasfocus=!0;b.b.html={init:()=>({controlsDescendantBindings:!0}),update:(a,c)=>{b.a.Ya(a);c=b.a.g(c());if(null!=c){const e=T.createElement("template");
e.innerHTML="string"!=typeof c?c.toString():c;a.appendChild(e.content)}}};(function(){function a(c,e,h){b.b[c]={init:(k,t,d,f,g)=>{var n,p,q={},u;if(e){f=d.get("as");var x=d.get("noChildContext");var l=!(f&&x);q={as:f,noChildContext:x,exportDependencies:l}}var m=(u="render"==d.get("completeOn"))||d.has(b.c.Y);b.l(()=>{var r=b.a.g(t()),v=!h!==!r,y=!p;if(l||v!==n){m&&(g=b.c.jb(k,g));if(v){if(!e||l)q.dataDependency=b.i.l();var w=e?g.createChildContext("function"==typeof r?r:t,q):b.i.Aa()?g.extend(null,
q):g}y&&b.i.Aa()&&(p=b.a.xa(b.h.childNodes(k),!0));v?(y||b.h.sa(k,b.a.xa(p)),b.yb(w,k)):(b.h.pa(k),u||b.c.notify(k,b.c.B));n=v}},{j:k});return{controlsDescendantBindings:!0}}};b.F.Ra[c]=!1;b.h.ca[c]=!0}a("if");a("ifnot",!1,!0);a("with",!0)})();var Y={};b.b.options={init:a=>{if(!a.matches("SELECT"))throw Error("options binding applies only to SELECT elements");for(;0<a.length;)a.remove(0);return{controlsDescendantBindings:!0}},update:(a,c,e)=>{function h(){return Array.from(a.options).filter(l=>l.selected)}
function k(l,m,r){var v=typeof m;return"function"==v?m(l):"string"==v?l[m]:r}function t(l,m){u&&n?b.c.notify(a,b.c.B):p.length&&(l=p.includes(b.A.O(m[0])),m[0].selected=l,u&&!l&&b.i.D(b.a.Zb,null,[a,"change"]))}var d=a.multiple,f=0!=a.length&&d?a.scrollTop:null,g=b.a.g(c()),n=e.get("valueAllowUnset")&&e.has("value");c={};var p=[];n||(d?p=h().map(b.A.O):0<=a.selectedIndex&&p.push(b.A.O(a.options[a.selectedIndex])));if(g){"undefined"==typeof g.length&&(g=[g]);var q=g.filter(l=>l||null==l);e.has("optionsCaption")&&
(g=b.a.g(e.get("optionsCaption")),null!==g&&void 0!==g&&q.unshift(Y))}var u=!1;c.beforeRemove=l=>a.removeChild(l);g=t;e.has("optionsAfterRender")&&"function"==typeof e.get("optionsAfterRender")&&(g=(l,m)=>{t(l,m);b.i.D(e.get("optionsAfterRender"),null,[m[0],l!==Y?l:void 0])});b.a.Wb(a,q,function(l,m,r){r.length&&(p=!n&&r[0].selected?[b.A.O(r[0])]:[],u=!0);m=a.ownerDocument.createElement("option");l===Y?(b.a.ib(m,e.get("optionsCaption")),b.A.La(m,void 0)):(r=k(l,e.get("optionsValue"),l),b.A.La(m,b.a.g(r)),
l=k(l,e.get("optionsText"),r),b.a.ib(m,l));return[m]},c,g);if(!n){var x;d?x=p.length&&h().length<p.length:x=p.length&&0<=a.selectedIndex?b.A.O(a.options[a.selectedIndex])!==p[0]:p.length||0<=a.selectedIndex;x&&b.i.D(b.a.Zb,null,[a,"change"])}(n||b.i.bb())&&b.c.notify(a,b.c.B);f&&20<Math.abs(f-a.scrollTop)&&(a.scrollTop=f)}};b.b.options.fb=b.a.f.X();b.b.style={update:(a,c)=>{c=b.a.g(c()||{});b.a.N(c,(e,h)=>{h=b.a.g(h);if(null===h||void 0===h||!1===h)h="";if(/^--/.test(e))a.style.setProperty(e,h);else{e=
e.replace(/-(\w)/g,(t,d)=>d.toUpperCase());var k=a.style[e];a.style[e]=h;h===k||a.style[e]!=k||isNaN(h)||(a.style[e]=h+"px")}})}};b.b.submit={init:(a,c,e,h,k)=>{if("function"!=typeof c())throw Error("The value for a submit binding must be a function");b.a.H(a,"submit",t=>{var d=c();try{var f=d.call(k.$data,a)}finally{!0!==f&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}})}};b.b.text={init:()=>({controlsDescendantBindings:!0}),update:(a,c)=>b.a.ib(a,c())};b.h.ca.text=!0;b.b.textInput={init:(a,
c,e)=>{var h=a.value,k,t,d=()=>{clearTimeout(k);t=k=void 0;var g=a.value;h!==g&&(h=g,b.F.ob(c(),e,"textInput",g))},f=()=>{var g=b.a.g(c());if(null===g||void 0===g)g="";void 0!==t&&g===t?b.a.setTimeout(f,4):a.value!==g&&(a.value=g,h=a.value)};b.a.H(a,"input",d);b.a.H(a,"change",d);b.a.H(a,"blur",d);b.l(f,{j:a})}};b.F.mb.textInput=!0;b.b.textinput={preprocess:(a,c,e)=>e("textInput",a)};b.b.value={init:(a,c,e)=>{var h=a.matches("SELECT"),k=a.matches("INPUT");if(!k||"checkbox"!=a.type&&"radio"!=a.type){var t=
[],d=e.get("valueUpdate"),f=null;d&&("string"==typeof d?t=[d]:t=d?d.filter((q,u)=>d.indexOf(q)===u):[],b.a.va(t,"change"));var g=()=>{f=null;var q=c(),u=b.A.O(a);b.F.ob(q,e,"value",u)};t.forEach(q=>{var u=g;b.a.Ec(q,"after")&&(u=()=>{f=b.A.O(a);b.a.setTimeout(g,0)},q=q.substring(5));b.a.H(a,q,u)});var n=k&&"file"==a.type?()=>{var q=b.a.g(c());null===q||void 0===q||""===q?a.value="":b.i.D(g)}:()=>{var q=b.a.g(c()),u=b.A.O(a);if(null!==f&&q===f)b.a.setTimeout(n,0);else if(q!==u||void 0===u)h?(u=e.get("valueAllowUnset"),
b.A.La(a,q,u),u||q===b.A.O(a)||b.i.D(g)):b.A.La(a,q)};if(h){var p;b.c.subscribe(a,b.c.B,()=>{p?e.get("valueAllowUnset")?n():g():(b.a.H(a,"change",g),p=b.l(n,{j:a}))},null,{notifyImmediately:!0})}else b.a.H(a,"change",g),b.l(n,{j:a})}else b.Pa(a,{checkedValue:c})},update:()=>{}};b.F.mb.value=!0;b.b.visible={update:(a,c)=>{c=b.a.g(c());var e="none"!=a.style.display;c&&!e?a.style.display="":e&&!c&&(a.style.display="none")}};b.b.hidden={update:(a,c)=>a.hidden=!!b.a.g(c())};(function(a){b.b[a]={init:function(c,
e,h,k,t){return b.b.event.init.call(this,c,()=>({[a]:e()}),h,k,t)}}})("click");(()=>{let a=b.a.f.X();class c{constructor(h){this.Va=h}Ha(...h){let k=this.Va;if(!h.length)return b.a.f.get(k,a)||(11===this.P?k.content:1===this.P?k:void 0);b.a.f.set(k,a,h[0])}}class e extends c{constructor(h){super(h);h&&(this.P=h.matches("TEMPLATE")&&h.content?h.content.nodeType:1)}}b.Ia={Va:e,Oa:c}})();(()=>{function a(d,f){if(d.length){var g=d[0],n=g.parentNode;h(g,d[d.length-1],p=>{1!==p.nodeType&&8!==p.nodeType||
b.xb(f,p)});b.a.za(d,n)}}function c(d,f,g,n,p){p=p||{};var q=(d&&(d.nodeType?d:0<d.length?d[0]:null)||g||{}).ownerDocument;if("string"==typeof g){q=q||T;q=q.getElementById(g);if(!q)throw Error("Cannot find template with ID "+g);g=new b.Ia.Va(q)}else if([1,8].includes(g.nodeType))g=new b.Ia.Oa(g);else throw Error("Unknown template type: "+g);g=(g=g.Ha?g.Ha():null)?[...g.cloneNode(!0).childNodes]:null;if("number"!=typeof g.length||0<g.length&&"number"!=typeof g[0].nodeType)throw Error("Template engine must return an array of DOM nodes");
q=!1;switch(f){case "replaceChildren":b.h.sa(d,g);q=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+f);}q&&(a(g,n),p.afterRender&&b.i.D(p.afterRender,null,[g,n[p.as||"$data"]]),"replaceChildren"==f&&b.c.notify(d,b.c.B));return g}function e(d,f,g){return b.K(d)?d():"function"===typeof d?d(f,g):d}var h=(d,f,g)=>{var n;for(f=b.h.nextSibling(f);d&&(n=d)!==f;)d=b.h.nextSibling(n),g(n,d)};b.Bc=function(d,f,g,n){g=g||{};var p=p||"replaceChildren";if(n){var q=n.nodeType?
n:0<n.length?n[0]:null;return b.l(()=>{var u=f&&f instanceof b.R?f:new b.R(f,null,null,null,{exportDependencies:!0}),x=e(d,u.$data,u);c(n,p,x,u,g)},{oa:()=>!q||!b.a.Xa(q),j:q})}console.log("no targetNodeOrNodeArray")};b.Cc=(d,f,g,n,p)=>{function q(y,w){b.i.D(b.a.Wb,null,[n,y,l,g,m,w]);b.c.notify(n,b.c.B)}var u,x=g.as,l=(y,w)=>{u=p.createChildContext(y,{as:x,noChildContext:g.noChildContext,extend:A=>{A.$index=w;x&&(A[x+"Index"]=w)}});y=e(d,y,u);return c(n,"ignoreTargetNode",y,u,g)},m=(y,w)=>{a(w,u);
g.afterRender&&g.afterRender(w,y);u=null},r=!1===g.includeDestroyed;if(r||g.beforeRemove||!b.Ob(f))return b.l(()=>{var y=b.a.g(f)||[];"undefined"==typeof y.length&&(y=[y]);r&&(y=y.filter(w=>w||null==w));q(y)},{j:n});q(f.G());var v=f.subscribe(y=>{q(f(),y)},null,"arrayChange");v.j(n);return v};var k=b.a.f.X(),t=b.a.f.X();b.b.template={init:(d,f)=>{f=b.a.g(f());if("string"==typeof f||"name"in f)b.h.pa(d);else if("nodes"in f){f=f.nodes||[];if(b.K(f))throw Error('The "nodes" option must be a plain, non-observable array.');
let g=f[0]&&f[0].parentNode;g&&b.a.f.get(g,t)||(g=b.a.Rb(f),b.a.f.set(g,t,!0));(new b.Ia.Oa(d)).Ha(g)}else if(f=b.h.childNodes(d),0<f.length)f=b.a.Rb(f),(new b.Ia.Oa(d)).Ha(f);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:(d,f,g,n,p)=>{var q=f();f=b.a.g(q);g=!0;n=null;"string"==typeof f?f={}:(q="name"in f?f.name:d,"if"in f&&(g=b.a.g(f["if"])),g&&"ifnot"in f&&(g=!b.a.g(f.ifnot)),g&&!q&&(g=!1));"foreach"in f?n=b.Cc(q,
g&&f.foreach||[],f,d,p):g?(g=p,"data"in f&&(g=p.createChildContext(f.data,{as:f.as,noChildContext:f.noChildContext,exportDependencies:!0})),n=b.Bc(q,g,f,d)):b.h.pa(d);p=n;(f=b.a.f.get(d,k))&&"function"==typeof f.o&&f.o();b.a.f.set(d,k,!p||p.ga&&!p.ga()?void 0:p)}};b.F.Ra.template=d=>{d=b.F.yc(d);return 1==d.length&&d[0].unknown||b.F.wc(d,"name")?null:"This template engine does not support anonymous templates nested within its templates"};b.h.ca.template=!0})();b.a.Lb=(a,c,e)=>{if(a.length&&c.length){var h,
k,t,d,f;for(h=k=0;(!e||h<e)&&(d=a[k]);++k){for(t=0;f=c[t];++t)if(d.value===f.value){d.moved=f.index;f.moved=d.index;c.splice(t,1);h=t=0;break}h+=t}}};b.a.Fb=(()=>{function a(c,e,h,k,t){var d=Math.min,f=Math.max,g=[],n,p=c.length,q,u=e.length,x=u-p||1,l=p+u+1,m;for(n=0;n<=p;n++){var r=m;g.push(m=[]);var v=d(u,n+x);for(q=f(0,n-1);q<=v;q++)m[q]=q?n?c[n-1]===e[q-1]?r[q-1]:d(r[q]||l,m[q-1]||l)+1:q+1:n+1}d=[];f=[];x=[];n=p;for(q=u;n||q;)u=g[n][q]-1,q&&u===g[n][q-1]?f.push(d[d.length]={status:h,value:e[--q],
index:q}):n&&u===g[n-1][q]?x.push(d[d.length]={status:k,value:c[--n],index:n}):(--q,--n,t.sparse||d.push({status:"retained",value:e[q]}));b.a.Lb(x,f,!t.dontLimitMoves&&10*p);return d.reverse()}return function(c,e,h){h="boolean"===typeof h?{dontLimitMoves:h}:h||{};c=c||[];e=e||[];return c.length<e.length?a(c,e,"added","deleted",h):a(e,c,"deleted","added",h)}})();(()=>{function a(h,k,t,d,f){var g=[],n=b.l(()=>{var p=k(t,f,b.a.za(g,h))||[];if(0<g.length){var q=g.nodeType?[g]:g;if(0<q.length){var u=q[0],
x=u.parentNode,l;var m=0;for(l=p.length;m<l;m++)x.insertBefore(p[m],u);m=0;for(l=q.length;m<l;m++)b.removeNode(q[m])}d&&b.i.D(d,null,[t,p,f])}g.length=0;g.push(...p)},{j:h,oa:()=>!!g.find(b.a.Xa)});return{M:g,Ta:n.ga()?n:void 0}}var c=b.a.f.X(),e=b.a.f.X();b.a.Wb=(h,k,t,d,f,g)=>{function n(H){z={da:H,Ca:b.ba(r++)};l.push(z);x||I.push(z)}function p(H){z=u[H];r!==z.Ca.G()&&A.push(z);z.Ca(r++);b.a.za(z.M,h);l.push(z)}function q(H,L){if(H)for(var K=0,N=L.length;K<N;K++)L[K].M.forEach(ia=>H(ia,K,L[K].da))}
k=k||[];"undefined"==typeof k.length&&(k=[k]);d=d||{};var u=b.a.f.get(h,c),x=!u,l=[],m=0,r=0,v=[],y=[],w=[],A=[],I=[],G=0;if(x)k.forEach(n);else{if(!g||u&&u._countWaitingForRemove)g=Array.prototype.map.call(u,H=>H.da),g=b.a.Fb(g,k,{dontLimitMoves:d.dontLimitMoves,sparse:!0});for(let H=0,L,K,N;L=g[H];H++)switch(K=L.moved,N=L.index,L.status){case "deleted":for(;m<N;)p(m++);if(void 0===K){var z=u[m];z.Ta&&(z.Ta.o(),z.Ta=void 0);b.a.za(z.M,h).length&&(d.beforeRemove&&(l.push(z),G++,z.da===e?z=null:w.push(z)),
z&&v.push.apply(v,z.M))}m++;break;case "added":for(;r<N;)p(m++);void 0!==K?(y.push(l.length),p(K)):n(L.value)}for(;r<k.length;)p(m++);l._countWaitingForRemove=G}b.a.f.set(h,c,l);q(d.beforeMove,A);v.forEach(d.beforeRemove?b.ea:b.removeNode);var M,B;G=h.ownerDocument.activeElement;if(y.length)for(;void 0!=(k=y.shift());){z=l[k];for(M=void 0;k;)if((B=l[--k].M)&&B.length){M=B[B.length-1];break}for(m=0;v=z.M[m];M=v,m++)b.h.Nb(h,v,M)}for(k=0;z=l[k];k++){z.M||b.a.extend(z,a(h,t,z.da,f,z.Ca));for(m=0;v=z.M[m];M=
v,m++)b.h.Nb(h,v,M);!z.sc&&f&&(f(z.da,z.M,z.Ca),z.sc=!0,M=z.M[z.M.length-1])}G&&h.ownerDocument.activeElement!=G&&G.focus();q(d.beforeRemove,w);for(k=0;k<w.length;++k)w[k].da=e;q(d.afterMove,A);q(d.afterAdd,I)}})();C.ko=W})(this);
(C=>{function F(b,c){return null===b||da[typeof b]?b===c:!1}function E(b,c){var e;return()=>{e||(e=a.a.setTimeout(()=>{e=0;b()},c))}}function J(b,c){var e;return()=>{clearTimeout(e);e=a.a.setTimeout(b,c)}}function S(b,c){null!==c&&c.o&&c.o()}function V(b,c){var e=this.hc,g=e[D];g.$||(this.Ua&&this.ya[c]?(e.wb(c,b,this.ya[c]),this.ya[c]=null,--this.Ua):g.u[c]||e.wb(c,b,g.v?{V:b}:e.Yb(b)),b.ja&&b.bc())}var T=C.document,W={},a="undefined"!==typeof W?W:{};a.m=(b,c)=>{b=b.split(".");for(var e=a,g=0;g<
b.length-1;g++)e=e[b[g]];e[b[b.length-1]]=c};a.Z=(b,c,e)=>{b[c]=e};a.version="3.5.1-sm";a.m("version",a.version);a.a={va:(b,c)=>{c=b.indexOf(c);0<c?b.splice(c,1):0===c&&b.shift()},extend:(b,c)=>{c&&Object.entries(c).forEach(e=>b[e[0]]=e[1]);return b},N:(b,c)=>b&&Object.entries(b).forEach(e=>c(e[0],e[1])),eb:(b,c,e)=>{if(!b)return b;var g={};Object.entries(b).forEach(k=>g[k[0]]=c.call(e,k[1],k[0],b));return g},Ya:b=>{for(;b.firstChild;)a.removeNode(b.firstChild)},Rb:b=>{var c=[...b],e=(c[0]&&c[0].ownerDocument||
T).createElement("div");b.forEach(g=>e.append(a.ea(g)));return e},xa:(b,c)=>Array.prototype.map.call(b,c?e=>a.ea(e.cloneNode(!0)):e=>e.cloneNode(!0)),sa:(b,c)=>{a.a.Ya(b);c&&b.append(...c)},za:(b,c)=>{if(b.length){for(c=8===c.nodeType&&c.parentNode||c;b.length&&b[0].parentNode!==c;)b.splice(0,1);for(;1<b.length&&b[b.length-1].parentNode!==c;)b.length--;if(1<b.length){c=b[0];var e=b[b.length-1];for(b.length=0;c!==e;)b.push(c),c=c.nextSibling;b.push(e)}}return b},Xb:b=>null==b?"":b.trim?b.trim():b.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,
""),Dc:(b,c)=>{b=b||"";return c.length>b.length?!1:b.substring(0,c.length)===c},kc:(b,c)=>c.contains(1!==b.nodeType?b.parentNode:b),Xa:b=>a.a.kc(b,b.ownerDocument.documentElement),Eb:b=>a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b,setTimeout:(b,c)=>setTimeout(a.a.Eb(b),c),Ib:b=>setTimeout(()=>{a.onError&&a.onError(b);throw b;},0),H:(b,c,e)=>{b.addEventListener(c,a.a.Eb(e),!1)},Zb:(b,c)=>{if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");
b.dispatchEvent(new Event(c))},g:b=>a.K(b)?b():b,ib:(b,c)=>b.textContent=a.a.g(c)||""};a.m("utils",a.a);a.m("unwrap",a.a.g);a.a.f=new function(){let b=0,c="__ko__"+Date.now(),e=new WeakMap;return{get:(g,k)=>(e.get(g)||{})[k],set:(g,k,t)=>{if(e.has(g))e.get(g)[k]=t;else{let d={};d[k]=t;e.set(g,d)}return t},$a:function(g,k,t){return this.get(g,k)||this.set(g,k,t)},clear:g=>e.delete(g),X:()=>b++ +c}};a.a.J=(()=>{var b=a.a.f.X(),c={1:!0,8:!0,9:!0},e={1:!0,9:!0};const g=(d,f)=>{var h=a.a.f.get(d,b);void 0===
h&&f&&(h=[],a.a.f.set(d,b,h));return h},k=d=>{var f=g(d,!1);if(f){f=f.slice(0);for(var h=0;h<f.length;h++)f[h](d)}a.a.f.clear(d);e[d.nodeType]&&t(d.childNodes,!0)},t=(d,f)=>{for(var h=[],n,p=0;p<d.length;p++)if(!f||8===d[p].nodeType)if(k(h[h.length]=n=d[p]),d[p]!==n)for(;p--&&!h.includes(d[p]););};return{ma:(d,f)=>{if("function"!=typeof f)throw Error("Callback must be a function");g(d,!0).push(f)},hb:(d,f)=>{var h=g(d,!1);h&&(a.a.va(h,f),h.length||a.a.f.set(d,b,void 0))},ea:d=>{a.i.D(()=>{c[d.nodeType]&&
(k(d),e[d.nodeType]&&t(d.getElementsByTagName("*")))});return d},removeNode:d=>{a.ea(d);d.parentNode&&d.parentNode.removeChild(d)}}})();a.ea=a.a.J.ea;a.removeNode=a.a.J.removeNode;a.m("utils.domNodeDisposal",a.a.J);a.m("utils.domNodeDisposal.addDisposeCallback",a.a.J.ma);a.lb=(()=>{function b(){if(e)for(var d=e,f=0,h;k<e;)if(h=c[k++]){if(k>d){if(5E3<=++f){k=e;a.a.Ib(Error("'Too much recursion' after processing "+f+" task groups."));break}d=e}try{h()}catch(n){a.a.Ib(n)}}k=e=c.length=0}var c=[],e=0,
g=1,k=0,t=(d=>{var f=T.createElement("div");(new MutationObserver(d)).observe(f,{attributes:!0});return()=>f.classList.toggle("foo")})(b);return{Vb:d=>{e||t(b);c[e++]=d;return g++},cancel:d=>{d-=g-e;d>=k&&d<e&&(c[d]=null)}}})();a.m("tasks",a.lb);a.Za={debounce:(b,c)=>b.Ga(e=>J(e,c)),rateLimit:(b,c)=>{if("number"==typeof c)var e=c;else{e=c.timeout;var g=c.method}var k="function"==typeof g?g:E;b.Ga(t=>k(t,e,c))},notify:(b,c)=>{b.equalityComparer="always"==c?null:F}};var da={undefined:1,"boolean":1,
number:1,string:1};a.m("extenders",a.Za);class ea{constructor(b,c,e){this.V=b;this.pb=c;this.Cb=e;this.Ma=!1;this.P=this.Qa=null;a.Z(this,"dispose",this.o);a.Z(this,"disposeWhenNodeIsRemoved",this.j)}o(){this.Ma||(this.P&&a.a.J.hb(this.Qa,this.P),this.Ma=!0,this.Cb(),this.V=this.pb=this.Cb=this.Qa=this.P=null)}j(b){this.Qa=b;a.a.J.ma(b,this.P=this.o.bind(this))}}a.T=function(){Object.setPrototypeOf(this,P);P.Da(this)};var P={Da:b=>{b.U={change:[]};b.vb=1},subscribe:function(b,c,e){var g=this;e=e||
"change";var k=new ea(g,c?b.bind(c):b,()=>{a.a.va(g.U[e],k);g.ua&&g.ua(e)});g.na&&g.na(e);g.U[e]||(g.U[e]=[]);g.U[e].push(k);return k},notifySubscribers:function(b,c){c=c||"change";"change"===c&&this.Ja();if(this.qa(c)){c="change"===c&&this.$b||this.U[c].slice(0);try{a.i.zb();for(var e=0,g;g=c[e++];)g.Ma||g.pb(b)}finally{a.i.end()}}},Ba:function(){return this.vb},pc:function(b){return this.Ba()!==b},Ja:function(){++this.vb},Ga:function(b){var c=this,e=a.K(c),g,k,t,d,f;c.ta||(c.ta=c.notifySubscribers,
c.notifySubscribers=function(n,p){p&&"change"!==p?"beforeChange"===p?this.sb(n):this.ta(n,p):this.tb(n)});var h=b(()=>{c.ja=!1;e&&d===c&&(d=c.qb?c.qb():c());var n=k||f&&c.Fa(t,d);f=k=g=!1;n&&c.ta(t=d)});c.tb=(n,p)=>{p&&c.ja||(f=!p);c.$b=c.U.change.slice(0);c.ja=g=!0;d=n;h()};c.sb=n=>{g||(t=n,c.ta(n,"beforeChange"))};c.ub=()=>{f=!0};c.bc=()=>{c.Fa(t,c.G(!0))&&(k=!0)}},qa:function(b){return this.U[b]&&this.U[b].length},Fa:function(b,c){return!this.equalityComparer||!this.equalityComparer(b,c)},toString:()=>
"[object Object]",extend:function(b){var c=this;b&&a.a.N(b,(e,g)=>{e=a.Za[e];"function"==typeof e&&(c=e(c,g)||c)});return c}};a.Z(P,"init",P.Da);a.Z(P,"subscribe",P.subscribe);a.Z(P,"extend",P.extend);Object.setPrototypeOf(P,Function.prototype);a.T.fn=P;a.sc=b=>null!=b&&"function"==typeof b.subscribe&&"function"==typeof b.notifySubscribers;a.i=(()=>{var b=[],c,e=0;return{zb:g=>{b.push(c);c=g},end:()=>c=b.pop(),Ub:g=>{if(c){if(!a.sc(g))throw Error("Only subscribable things can act as dependencies");
c.dc.call(c.ec,g,g.ac||(g.ac=++e))}},D:(g,k,t)=>{try{return b.push(c),c=void 0,g.apply(k,t||[])}finally{c=b.pop()}},Aa:()=>c&&c.l.Aa(),bb:()=>c&&c.bb,l:()=>c&&c.l}})();const O=Symbol("_latestValue");a.ba=b=>{function c(){if(0<arguments.length)return c.Fa(c[O],arguments[0])&&(c.nb(),c[O]=arguments[0],c.Ka()),this;a.i.Ub(c);return c[O]}c[O]=b;Object.defineProperty(c,"length",{get:()=>null==c[O]?void 0:c[O].length});a.T.fn.Da(c);Object.setPrototypeOf(c,Q);return c};var Q={toJSON:function(){let b=this[O];
return b&&b.toJSON?b.toJSON():b},equalityComparer:F,G:function(){return this[O]},Ka:function(){this.notifySubscribers(this[O],"spectate");this.notifySubscribers(this[O])},nb:function(){this.notifySubscribers(this[O],"beforeChange")}};Object.setPrototypeOf(Q,a.T.fn);var R=a.ba.P="__ko_proto__";Q[R]=a.ba;a.K=b=>{if((b="function"==typeof b&&b[R])&&b!==Q[R]&&b!==a.l.fn[R])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b};a.uc=b=>"function"==
typeof b&&(b[R]===Q[R]||b[R]===a.l.fn[R]&&b.qc);a.m("observable",a.ba);a.m("isObservable",a.K);a.m("observable.fn",Q);a.Z(Q,"valueHasMutated",Q.Ka);a.ha=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.ba(b);Object.setPrototypeOf(b,a.ha.fn);return b.extend({trackArrayChanges:!0})};a.ha.fn={remove:function(b){for(var c=this.G(),e=[],g="function"!=typeof b||a.K(b)?function(d){return d===
b}:b,k=c.length;k--;){var t=c[k];if(g(t)){0===e.length&&this.nb();if(c[k]!==t)throw Error("Array modified during remove; cannot remove item");e.push(t);c.splice(k,1)}}e.length&&this.Ka();return e}};Object.setPrototypeOf(a.ha.fn,a.ba.fn);Object.getOwnPropertyNames(Array.prototype).forEach(b=>{"function"===typeof Array.prototype[b]&&"constructor"!=b&&("copyWithin fill pop push reverse shift sort splice unshift".split(" ").includes(b)?a.ha.fn[b]=function(...c){var e=this.G();this.nb();this.Db(e,b,c);
c=e[b](...c);this.Ka();return c===e?this:c}:a.ha.fn[b]=function(...c){return this()[b](...c)})});a.Ob=b=>a.K(b)&&"function"==typeof b.remove&&"function"==typeof b.push;a.m("observableArray",a.ha);a.m("isObservableArray",a.Ob);a.Za.trackArrayChanges=(b,c)=>{function e(){function q(){if(f){var u=[].concat(b.G()||[]);if(b.qa("arrayChange")){if(!k||1<f)k=a.a.Fb(h,u,b.Sa);var x=k}h=u;k=null;f=0;x&&x.length&&b.notifySubscribers(x,"arrayChange")}}g?q():(g=!0,d=b.subscribe(()=>++f,null,"spectate"),h=[].concat(b.G()||
[]),k=null,t=b.subscribe(q))}b.Sa={};c&&"object"==typeof c&&a.a.extend(b.Sa,c);b.Sa.sparse=!0;if(!b.Db){var g=!1,k=null,t,d,f=0,h,n=b.na,p=b.ua;b.na=q=>{n&&n.call(b,q);"arrayChange"===q&&e()};b.ua=q=>{p&&p.call(b,q);"arrayChange"!==q||b.qa("arrayChange")||(t&&t.o(),d&&d.o(),d=t=null,g=!1,h=void 0)};b.Db=(q,u,x)=>{function l(G,z,M){return m[m.length]={status:G,value:z,index:M}}if(g&&!f){var m=[],r=q.length,v=x.length,y=0;switch(u){case "push":y=r;case "unshift":for(u=0;u<v;u++)l("added",x[u],y+u);
break;case "pop":y=r-1;case "shift":r&&l("deleted",q[y],y);break;case "splice":u=Math.min(Math.max(0,0>x[0]?r+x[0]:x[0]),r);r=1===v?r:Math.min(u+(x[1]||0),r);v=u+v-2;y=Math.max(r,v);for(var w=[],A=[],I=2;u<y;++u,++I)u<r&&A.push(l("deleted",q[u],u)),u<v&&w.push(l("added",x[I],u));a.a.Lb(A,w);break;default:return}k=m}}}};var D=Symbol("_state");a.l=(b,c)=>{function e(){if(0<arguments.length){if("function"===typeof g)g(...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}k.$||a.i.Ub(e);(k.W||k.v&&e.ra())&&e.S();return k.L}"object"===typeof b?c=b:(c=c||{},b&&(c.read=b));if("function"!=typeof c.read)throw Error("Pass a function that returns the value of the ko.computed");var g=c.write,k={L:void 0,aa:!0,W:!0,Ea:!1,kb:!1,$:!1,gb:!1,v:!1,Tb:c.read,j:c.disposeWhenNodeIsRemoved||c.j||null,oa:c.disposeWhen||c.oa,Wa:null,u:{},I:0,Kb:null};e[D]=k;e.qc="function"===typeof g;a.T.fn.Da(e);Object.setPrototypeOf(e,U);c.pure?(k.gb=!0,k.v=!0,a.a.extend(e,fa)):c.deferEvaluation&&
a.a.extend(e,ha);k.j&&(k.kb=!0,k.j.nodeType||(k.j=null));k.v||c.deferEvaluation||e.S();k.j&&e.ga()&&a.a.J.ma(k.j,k.Wa=()=>{e.o()});return e};var U={equalityComparer:F,Aa:function(){return this[D].I},nc:function(){var b=[];a.a.N(this[D].u,(c,e)=>b[e.ka]=e.V);return b},ab:function(b){if(!this[D].I)return!1;var c=this.nc();return c.includes(b)?!0:!!c.find(e=>e.ab&&e.ab(b))},wb:function(b,c,e){if(this[D].gb&&c===this)throw Error("A 'pure' computed must not be called recursively");this[D].u[b]=e;e.ka=
this[D].I++;e.la=c.Ba()},ra:function(){var b,c=this[D].u;for(b in c)if(Object.prototype.hasOwnProperty.call(c,b)){var e=c[b];if(this.ia&&e.V.ja||e.V.pc(e.la))return!0}},Gc:function(){this.ia&&!this[D].Ea&&this.ia(!1)},ga:function(){var b=this[D];return b.W||0<b.I},Hc:function(){this.ja?this[D].W&&(this[D].aa=!0):this.Jb()},Yb:function(b){return b.subscribe(this.Jb,this)},Jb:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[D].Kb),this[D].Kb=a.a.setTimeout(()=>b.S(!0),c)):b.ia?
b.ia(!0):b.S(!0)},S:function(b){var c=this[D],e=c.oa,g=!1;if(!c.Ea&&!c.$){if(c.j&&!a.a.Xa(c.j)||e&&e()){if(!c.kb){this.o();return}}else c.kb=!1;c.Ea=!0;try{g=this.lc(b)}finally{c.Ea=!1}return g}},lc:function(b){var c=this[D],e=c.gb?void 0:!c.I;var g={hc:this,ya:c.u,Ua:c.I};a.i.zb({ec:g,dc:V,l:this,bb:e});c.u={};c.I=0;a:{try{var k=c.Tb();break a}finally{a.i.end(),g.Ua&&!c.v&&a.a.N(g.ya,S),c.aa=c.W=!1}k=void 0}c.I?g=this.Fa(c.L,k):(this.o(),g=!0);g&&(c.v?this.Ja():this.notifySubscribers(c.L,"beforeChange"),
c.L=k,this.notifySubscribers(c.L,"spectate"),!c.v&&b&&this.notifySubscribers(c.L),this.ub&&this.ub());e&&this.notifySubscribers(c.L,"awake");return g},G:function(b){var c=this[D];(c.W&&(b||!c.I)||c.v&&this.ra())&&this.S();return c.L},Ga:function(b){a.T.fn.Ga.call(this,b);this.qb=function(){this[D].v||(this[D].aa?this.S():this[D].W=!1);return this[D].L};this.ia=function(c){this.sb(this[D].L);this[D].W=!0;c&&(this[D].aa=!0);this.tb(this,!c)}},o:function(){var b=this[D];!b.v&&b.u&&a.a.N(b.u,(c,e)=>e.o&&
e.o());b.j&&b.Wa&&a.a.J.hb(b.j,b.Wa);b.u=void 0;b.I=0;b.$=!0;b.aa=!1;b.W=!1;b.v=!1;b.j=void 0;b.oa=void 0;b.Tb=void 0}},fa={na:function(b){var c=this,e=c[D];if(!e.$&&e.v&&"change"==b){e.v=!1;if(e.aa||c.ra())e.u=null,e.I=0,c.S()&&c.Ja();else{var g=[];a.a.N(e.u,(k,t)=>g[t.ka]=k);g.forEach((k,t)=>{var d=e.u[k],f=c.Yb(d.V);f.ka=t;f.la=d.la;e.u[k]=f});c.ra()&&c.S()&&c.Ja()}e.$||c.notifySubscribers(e.L,"awake")}},ua:function(b){var c=this[D];c.$||"change"!=b||this.qa("change")||(a.a.N(c.u,(e,g)=>{g.o&&
(c.u[e]={V:g.V,ka:g.ka,la:g.la},g.o())}),c.v=!0,this.notifySubscribers(void 0,"asleep"))},Ba:function(){var b=this[D];b.v&&(b.aa||this.ra())&&this.S();return a.T.fn.Ba.call(this)}},ha={na:function(b){"change"!=b&&"beforeChange"!=b||this.G()}};Object.setPrototypeOf(U,a.T.fn);U[a.ba.P]=a.l;a.m("computed",a.l);a.m("computed.fn",U);a.Z(U,"dispose",U.o);a.zc=b=>{if("function"===typeof b)return a.l(b,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.l(b)};(()=>{a.A={O:b=>{switch(b.nodeName){case "OPTION":return!0===
b.__ko__hasDomDataOptionValue__?a.a.f.get(b,a.b.options.fb):b.value;case "SELECT":return 0<=b.selectedIndex?a.A.O(b.options[b.selectedIndex]):void 0;default:return b.value}},La:(b,c,e)=>{switch(b.nodeName){case "OPTION":"string"===typeof c?(a.a.f.set(b,a.b.options.fb,void 0),delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.f.set(b,a.b.options.fb,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===typeof c?c:"");break;case "SELECT":for(var g=-1,k=""===c||null==c,t=0,d=b.options.length,f;t<
d;++t)if(f=a.A.O(b.options[t]),f==c||""===f&&k){g=t;break}if(e||0<=g||k&&1<b.size)b.selectedIndex=g;break;default:b.value=null==c?"":c}}}})();a.F=(()=>{function b(f){f=a.a.Xb(f);123===f.charCodeAt(0)&&(f=f.slice(1,-1));f+="\n,";var h=[],n=f.match(g),p=[],q=0;if(1<n.length){for(var u=0,x;x=n[u];++u){var l=x.charCodeAt(0);if(44===l){if(0>=q){h.push(m&&p.length?{key:m,value:p.join("")}:{unknown:m||p.join("")});var m=q=0;p=[];continue}}else if(58===l){if(!q&&!m&&1===p.length){m=p.pop();continue}}else if(47===
l&&1<x.length&&(47===x.charCodeAt(1)||42===x.charCodeAt(1)))continue;else 47===l&&u&&1<x.length?(l=n[u-1].match(k))&&!t[l[0]]&&(f=f.substr(f.indexOf(x)+1),n=f.match(g),u=-1,x="/"):40===l||123===l||91===l?++q:41===l||125===l||93===l?--q:m||p.length||34!==l&&39!==l||(x=x.slice(1,-1));p.push(x)}if(0<q)throw Error("Unbalanced parentheses, braces, or brackets");}return h}var c=["true","false","null","undefined"],e=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,g=/"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|`(?:\\.|[^`])*`|\/\*(?:[^*]|\*+[^*/])*\*+\/|\/\/.*\n|\/(?:\\.|[^/])+\/w*|[^\s:,/][^,"'`{}()/:[\]]*[^\s,"'`{}()/:[\]]|[^\s]/g,
k=/[\])"'A-Za-z0-9_$]+$/,t={"in":1,"return":1,"typeof":1},d={};return{Ra:[],mb:d,xc:b,yc:function(f,h){function n(l,m){if(!x){var r=a.getBindingHandler(l);if(r&&r.preprocess&&!(m=r.preprocess(m,l,n)))return;if(r=d[l]){var v=m;c.includes(v)?v=!1:(r=v.match(e),v=null===r?!1:r[1]?"Object("+r[1]+")"+r[2]:v);r=v}r&&q.push("'"+("string"==typeof d[l]?d[l]:l)+"':function(_z){"+v+"=_z}")}u&&(m="function(){return "+m+" }");p.push("'"+l+"':"+m)}h=h||{};var p=[],q=[],u=h.valueAccessors,x=h.bindingParams;("string"===
typeof f?b(f):f).forEach(l=>n(l.key||l.unknown,l.value));q.length&&n("_ko_property_writers","{"+q.join(",")+" }");return p.join(",")},vc:(f,h)=>-1<f.findIndex(n=>n.key==h),ob:(f,h,n,p,q)=>{if(f&&a.K(f))!a.uc(f)||q&&f.G()===p||f(p);else if((f=h.get("_ko_property_writers"))&&f[n])f[n](p)}}})();(()=>{function b(d){return 8==d.nodeType&&g.test(d.nodeValue)}function c(d){return 8==d.nodeType&&k.test(d.nodeValue)}function e(d,f){for(var h=d,n=1,p=[];h=h.nextSibling;){if(c(h)&&(a.a.f.set(h,t,!0),n--,0===
n))return p;p.push(h);b(h)&&n++}if(!f)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}var g=/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=/^\s*\/ko\s*$/,t="__ko_matchedEndComment__";a.h={ca:{},childNodes:d=>b(d)?e(d):d.childNodes,pa:d=>{if(b(d)){d=e(d);for(var f=0,h=d.length;f<h;f++)a.removeNode(d[f])}else a.a.Ya(d)},sa:(d,f)=>{if(b(d)){a.h.pa(d);d=d.nextSibling;for(var h=0,n=f.length;h<n;h++)d.parentNode.insertBefore(f[h],d)}else a.a.sa(d,f)},prepend:(d,f)=>{if(b(d)){var h=d.nextSibling;
d=d.parentNode}else h=d.firstChild;d.insertBefore(f,h)},Nb:(d,f,h)=>{h?(h=h.nextSibling,b(d)&&(d=d.parentNode),d.insertBefore(f,h)):a.h.prepend(d,f)},firstChild:d=>{if(b(d))return!d.nextSibling||c(d.nextSibling)?null:d.nextSibling;if(d.firstChild&&c(d.firstChild))throw Error("Found invalid end comment, as the first child of "+d);return d.firstChild},nextSibling:d=>{if(b(d)){var f=e(d,void 0);d=f?0<f.length?f[f.length-1].nextSibling:d.nextSibling:null}if(d.nextSibling&&c(d.nextSibling)){f=d.nextSibling;
if(c(f)&&!a.a.f.get(f,t))throw Error("Found end comment without a matching opening comment, as child of "+d);return null}return d.nextSibling},oc:b,Ec:d=>(d=d.nodeValue.match(g))?d[1]:null}})();(()=>{const b={};a.Bb=new class{wc(c){switch(c.nodeType){case 1:return null!=c.getAttribute("data-bind");case 8:return a.h.oc(c);default:return!1}}mc(c,e){a:{switch(c.nodeType){case 1:var g=c.getAttribute("data-bind");break a;case 8:g=a.h.Ec(c);break a}g=null}if(g){var k={valueAccessors:!0};try{var t=g+(k&&
k.valueAccessors||""),d;if(!(d=b[t])){var f="with($context){with($data||{}){return{"+a.F.yc(g,k)+"}}}";var h=new Function("$context","$element",f);d=b[t]=h}var n=d(e,c)}catch(p){throw p.message="Unable to parse bindings.\nBindings value: "+g+"\nMessage: "+p.message,p;}}else n=null;return n}}})();(()=>{function b(l){var m=(l=a.a.f.get(l,x))&&l.C;m&&(l.C=null,m.Sb())}function c(l,m,r){this.node=l;this.Ab=m;this.wa=[];this.B=!1;m.C||a.a.J.ma(l,b);r&&r.C&&(r.C.wa.push(l),this.Na=r)}function e(l){return a.a.eb(a.i.D(l),
(m,r)=>()=>l()[r])}function g(l,m,r){return"function"===typeof l?e(l.bind(null,m,r)):a.a.eb(l,v=>()=>v)}function k(l,m){var r=a.h.firstChild(m);if(r)for(var v;v=r;)r=a.h.nextSibling(v),t(l,v);a.c.notify(m,a.c.B)}function t(l,m){var r=l;if(1===m.nodeType||a.Bb.wc(m))r=f(m,null,l).bindingContextForDescendants;r&&m.matches&&!m.matches("SCRIPT,TEXTAREA,TEMPLATE")&&k(r,m)}function d(l){var m=[],r={},v=[];a.a.N(l,function A(w){if(!r[w]){var I=a.getBindingHandler(w);I&&(I.after&&(v.push(w),I.after.forEach(G=>
{if(l[G]){if(v.includes(G))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+v.join(", "));A(G)}}),v.length--),m.push({key:w,Mb:I}));r[w]=!0}});return m}function f(l,m,r){var v=a.a.f.$a(l,x,{}),y=v.cc;if(!m){if(y)throw Error("You cannot apply bindings multiple times to the same element.");v.cc=!0}y||(v.context=r);v.cb||(v.cb={});if(m&&"function"!==typeof m)var w=m;else{var A=a.l(()=>{if(w=m?m(r,l):a.Bb.mc(l,r)){if(r[n])r[n]();if(r[q])r[q]()}return w},{j:l});
w&&A.ga()||(A=null)}var I=r,G;if(w){var z=A?B=>()=>A()[B]():B=>w[B];function M(){return a.a.eb(A?A():w,B=>B())}M.get=B=>w[B]&&z(B)();M.has=B=>B in w;a.c.B in w&&a.c.subscribe(l,a.c.B,()=>{var B=w[a.c.B]();if(B){var H=a.h.childNodes(l);H.length&&B(H,a.Hb(H[0]))}});a.c.Y in w&&(I=a.c.jb(l,r),a.c.subscribe(l,a.c.Y,()=>{var B=w[a.c.Y]();B&&a.h.firstChild(l)&&B(l)}));d(w).forEach(B=>{var H=B.Mb.init,L=B.Mb.update,K=B.key;if(8===l.nodeType&&!a.h.ca[K])throw Error("The binding '"+K+"' cannot be used with virtual elements");
try{"function"==typeof H&&a.i.D(()=>{var N=H(l,z(K),M,I.$data,I);if(N&&N.controlsDescendantBindings){if(void 0!==G)throw Error("Multiple bindings ("+G+" and "+K+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");G=K}}),"function"==typeof L&&a.l(()=>L(l,z(K),M,I.$data,I),{j:l})}catch(N){throw N.message='Unable to process binding "'+K+": "+w[K]+'"\nMessage: '+N.message,N;}})}v=void 0===G;return{shouldBindDescendants:v,bindingContextForDescendants:v&&
I}}function h(l,m){return l&&l instanceof a.R?l:new a.R(l,void 0,void 0,m)}var n=Symbol("_subscribable"),p=Symbol("_ancestorBindingInfo"),q=Symbol("_dataDependency");a.b={};a.getBindingHandler=l=>a.b[l];var u={};a.R=function(l,m,r,v,y){function w(){var H=z?G():G,L=a.a.g(H);m?(a.a.extend(A,m),p in m&&(A[p]=m[p])):(A.$parents=[],A.$root=L,A.ko=a);A[n]=B;I?L=A.$data:(A.$rawData=H,A.$data=L);r&&(A[r]=L);v&&v(A,m,L);if(m&&m[n]&&!a.i.l().ab(m[n]))m[n]();M&&(A[q]=M);return A.$data}var A=this,I=l===u,G=I?
void 0:l,z="function"==typeof G&&!a.K(G),M=y&&y.dataDependency;if(y&&y.exportDependencies)w();else{var B=a.zc(w);B.G();B.ga()?B.equalityComparer=null:A[n]=void 0}};a.R.prototype.createChildContext=function(l,m,r,v){!v&&m&&"object"==typeof m&&(v=m,m=v.as,r=v.extend);if(m&&v&&v.noChildContext){var y="function"==typeof l&&!a.K(l);return new a.R(u,this,null,w=>{r&&r(w);w[m]=y?l():l},v)}return new a.R(l,this,m,(w,A)=>{w.$parentContext=A;w.$parent=A.$data;w.$parents=(A.$parents||[]).slice(0);w.$parents.unshift(w.$parent);
r&&r(w)},v)};a.R.prototype.extend=function(l,m){return new a.R(u,this,null,r=>a.a.extend(r,"function"==typeof l?l(r):l),m)};var x=a.a.f.X();c.prototype.Sb=function(){this.Na&&this.Na.C&&this.Na.C.jc(this.node)};c.prototype.jc=function(l){a.a.va(this.wa,l);!this.wa.length&&this.B&&this.Gb()};c.prototype.Gb=function(){this.B=!0;this.Ab.C&&!this.wa.length&&(this.Ab.C=null,a.a.J.hb(this.node,b),a.c.notify(this.node,a.c.Y),this.Sb())};a.c={B:"childrenComplete",Y:"descendantsComplete",subscribe:(l,m,r,
v,y)=>{var w=a.a.f.$a(l,x,{});w.fa||(w.fa=new a.T);y&&y.notifyImmediately&&w.cb[m]&&a.i.D(r,v,[l]);return w.fa.subscribe(r,v,m)},notify:(l,m)=>{var r=a.a.f.get(l,x);if(r&&(r.cb[m]=!0,r.fa&&r.fa.notifySubscribers(l,m),m==a.c.B))if(r.C)r.C.Gb();else if(void 0===r.C&&r.fa&&r.fa.qa(a.c.Y))throw Error("descendantsComplete event not supported for bindings on this node");},jb:(l,m)=>{var r=a.a.f.$a(l,x,{});r.C||(r.C=new c(l,r,m[p]));return m[p]==r?m:m.extend(v=>{v[p]=r})}};a.Cc=l=>(l=a.a.f.get(l,x))&&l.context;
a.Pa=(l,m,r)=>f(l,m,h(r));a.Fc=(l,m,r)=>{r=h(r);return a.Pa(l,g(m,r,l),r)};a.yb=(l,m)=>{1!==m.nodeType&&8!==m.nodeType||k(h(l),m)};a.xb=function(l,m,r){if(2>arguments.length){if(m=T.body,!m)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");}else if(!m||1!==m.nodeType&&8!==m.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");t(h(l,r),m)};a.Hb=l=>(l=l&&[1,8].includes(l.nodeType)&&a.Cc(l))?
l.$data:void 0;a.m("bindingHandlers",a.b);a.m("applyBindings",a.xb);a.m("applyBindingAccessorsToNode",a.Pa);a.m("dataFor",a.Hb)})();(()=>{function b(d,f){return Object.prototype.hasOwnProperty.call(d,f)?d[f]:void 0}function c(d,f){var h=b(k,d);if(h)h.subscribe(f);else{h=k[d]=new a.T;h.subscribe(f);e(d,(p,q)=>{q=!(!q||!q.synchronous);t[d]={definition:p,tc:q};delete k[d];n||q?h.notifySubscribers(p):a.lb.Vb(()=>h.notifySubscribers(p))});var n=!0}}function e(d,f){g("getConfig",[d],h=>{h?g("loadComponent",
[d,h],n=>f(n,h)):f(null,null)})}function g(d,f,h,n){n||(n=a.s.loaders.slice(0));var p=n.shift();if(p){var q=p[d];if(q){var u=!1;if(void 0!==q.apply(p,f.concat(function(x){u?h(null):null!==x?h(x):g(d,f,h,n)}))&&(u=!0,!p.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else g(d,f,h,n)}else h(null)}var k={},t={};a.s={get:(d,f)=>{var h=b(t,d);h?h.tc?a.i.D(()=>f(h.definition)):a.lb.Vb(()=>f(h.definition)):c(d,
f)},fc:d=>delete t[d],rb:g};a.s.loaders=[];a.m("components",a.s)})();(()=>{function b(d,f,h,n){var p={},q=2;f=h.template;h=h.viewModel;f?a.s.rb("loadTemplate",[d,f],u=>{p.template=u;0===--q&&n(p)}):0===--q&&n(p);h?a.s.rb("loadViewModel",[d,h],u=>{p[t]=u;0===--q&&n(p)}):0===--q&&n(p)}function c(d,f,h){if("function"===typeof f)h(p=>new f(p));else if("function"===typeof f[t])h(f[t]);else if("instance"in f){var n=f.instance;h(()=>n)}else"viewModel"in f?c(d,f.viewModel,h):d("Unknown viewModel value: "+
f)}function e(d){if(d.matches("TEMPLATE")&&d.content instanceof DocumentFragment)return a.a.xa(d.content.childNodes);throw"Template Source Element not a <template>";}function g(d){return f=>{throw Error("Component '"+d+"': "+f);}}var k={};a.s.register=(d,f)=>{if(!f)throw Error("Invalid configuration for "+d);if(a.s.Pb(d))throw Error("Component "+d+" is already registered");k[d]=f};a.s.Pb=d=>Object.prototype.hasOwnProperty.call(k,d);a.s.unregister=d=>{delete k[d];a.s.fc(d)};a.s.ic={getConfig:(d,f)=>
{d=a.s.Pb(d)?k[d]:null;f(d)},loadComponent:(d,f,h)=>{var n=g(d);b(d,n,f,h)},loadTemplate:(d,f,h)=>{d=g(d);if(f instanceof Array)h(f);else if(f instanceof DocumentFragment)h([...f.childNodes]);else if(f.element)if(f=f.element,f instanceof HTMLElement)h(e(f));else if("string"===typeof f){var n=T.getElementById(f);n?h(e(n)):d("Cannot find element with ID "+f)}else d("Unknown element type: "+f);else d("Unknown template value: "+f)},loadViewModel:(d,f,h)=>c(g(d),f,h)};var t="createViewModel";a.m("components.register",
a.s.register);a.s.loaders.push(a.s.ic)})();(()=>{function b(g,k,t){k=k.template;if(!k)throw Error("Component '"+g+"' has no template");g=a.a.xa(k);a.h.sa(t,g)}function c(g,k,t){var d=g.createViewModel;return d?d.call(g,k,t):k}var e=0;a.b.component={init:(g,k,t,d,f)=>{var h,n,p,q=()=>{var x=h&&h.dispose;"function"===typeof x&&x.call(h);p&&p.o();n=h=p=null},u=[...a.h.childNodes(g)];a.h.pa(g);a.a.J.ma(g,q);a.l(()=>{var x=a.a.g(k());if("string"===typeof x)var l=x;else{l=a.a.g(x.name);var m=a.a.g(x.params)}if(!l)throw Error("No component name specified");
var r=a.c.jb(g,f),v=n=++e;a.s.get(l,y=>{if(n===v){q();if(!y)throw Error("Unknown component '"+l+"'");b(l,y,g);var w=c(y,m,{element:g,templateNodes:u});y=r.createChildContext(w,{extend:A=>{A.$component=w;A.$componentTemplateNodes=u}});w&&w.koDescendantsComplete&&(p=a.c.subscribe(g,a.c.Y,w.koDescendantsComplete,w));h=w;a.yb(y,g)}})},{j:g});return{controlsDescendantBindings:!0}}};a.h.ca.component=!0})();a.b.attr={update:(b,c)=>{c=a.a.g(c())||{};a.a.N(c,function(e,g){g=a.a.g(g);var k=e.indexOf(":");k=
"lookupNamespaceURI"in b&&0<k&&b.lookupNamespaceURI(e.substr(0,k));var t=!1===g||null===g||void 0===g;t?k?b.removeAttributeNS(k,e):b.removeAttribute(e):g=g.toString();t||(k?b.setAttributeNS(k,e,g):b.setAttribute(e,g));"name"===e&&(b.name=t?"":g)})}};var X=(b,c,e)=>{c&&c.split(/\s+/).forEach(g=>b.classList.toggle(g,e))};a.b.css={update:(b,c)=>{c=a.a.g(c());null!==c&&"object"==typeof c?a.a.N(c,(e,g)=>{g=a.a.g(g);X(b,e,!!g)}):(c=a.a.Xb(c),X(b,b.__ko__cssValue,!1),b.__ko__cssValue=c,X(b,c,!0))}};a.b.enable=
{update:(b,c)=>{(c=a.a.g(c()))&&b.disabled?b.removeAttribute("disabled"):c||b.disabled||(b.disabled=!0)}};a.b.disable={update:(b,c)=>a.b.enable.update(b,()=>!a.a.g(c()))};a.b.event={init:(b,c,e,g,k)=>{var t=c()||{};a.a.N(t,d=>{"string"==typeof d&&a.a.H(b,d,function(f){var h=c()[d];if(h){try{g=k.$data;var n=h.apply(g,[g,...arguments])}finally{!0!==n&&f.preventDefault()}!1===e.get(d+"Bubble")&&(f.cancelBubble=!0,f.stopPropagation())}})})}};a.b.foreach={Qb:b=>()=>{var c=b(),e=a.K(c)?c.G():c;if(!e||"number"==
typeof e.length)return{foreach:c};a.a.g(c);return{foreach:e.data,as:e.as,noChildContext:e.noChildContext,includeDestroyed:e.includeDestroyed,afterAdd:e.afterAdd,beforeRemove:e.beforeRemove,afterRender:e.afterRender,beforeMove:e.beforeMove,afterMove:e.afterMove}},init:(b,c)=>a.b.template.init(b,a.b.foreach.Qb(c)),update:(b,c,e,g,k)=>a.b.template.update(b,a.b.foreach.Qb(c),e,g,k)};a.F.Ra.foreach=!1;a.h.ca.foreach=!0;a.b.hasfocus={init:(b,c,e)=>{var g=t=>{b.__ko_hasfocusUpdating=!0;t=b.ownerDocument.activeElement===
b;var d=c();a.F.ob(d,e,"hasfocus",t,!0);b.__ko_hasfocusLastValue=t;b.__ko_hasfocusUpdating=!1},k=g.bind(null,!0);g=g.bind(null,!1);a.a.H(b,"focus",k);a.a.H(b,"focusin",k);a.a.H(b,"blur",g);a.a.H(b,"focusout",g);b.__ko_hasfocusLastValue=!1},update:(b,c)=>{c=!!a.a.g(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===c||(c?b.focus():b.blur())}};a.F.mb.hasfocus=!0;a.b.html={init:()=>({controlsDescendantBindings:!0}),update:(b,c)=>{a.a.Ya(b);c=a.a.g(c());if(null!=c){const e=T.createElement("template");
e.innerHTML="string"!=typeof c?c.toString():c;b.appendChild(e.content)}}};(function(){function b(c,e,g){a.b[c]={init:(k,t,d,f,h)=>{var n,p,q={},u;if(e){f=d.get("as");var x=d.get("noChildContext");var l=!(f&&x);q={as:f,noChildContext:x,exportDependencies:l}}var m=(u="render"==d.get("completeOn"))||d.has(a.c.Y);a.l(()=>{var r=a.a.g(t()),v=!g!==!r,y=!p;if(l||v!==n){m&&(h=a.c.jb(k,h));if(v){if(!e||l)q.dataDependency=a.i.l();var w=e?h.createChildContext("function"==typeof r?r:t,q):a.i.Aa()?h.extend(null,
q):h}y&&a.i.Aa()&&(p=a.a.xa(a.h.childNodes(k),!0));v?(y||a.h.sa(k,a.a.xa(p)),a.yb(w,k)):(a.h.pa(k),u||a.c.notify(k,a.c.B));n=v}},{j:k});return{controlsDescendantBindings:!0}}};a.F.Ra[c]=!1;a.h.ca[c]=!0}b("if");b("ifnot",!1,!0);b("with",!0)})();var Y={};a.b.options={init:b=>{if(!b.matches("SELECT"))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:(b,c,e)=>{function g(){return Array.from(b.options).filter(l=>l.selected)}
function k(l,m,r){var v=typeof m;return"function"==v?m(l):"string"==v?l[m]:r}function t(l,m){u&&n?a.c.notify(b,a.c.B):p.length&&(l=p.includes(a.A.O(m[0])),m[0].selected=l,u&&!l&&a.i.D(a.a.Zb,null,[b,"change"]))}var d=b.multiple,f=0!=b.length&&d?b.scrollTop:null,h=a.a.g(c()),n=e.get("valueAllowUnset")&&e.has("value");c={};var p=[];n||(d?p=g().map(a.A.O):0<=b.selectedIndex&&p.push(a.A.O(b.options[b.selectedIndex])));if(h){"undefined"==typeof h.length&&(h=[h]);var q=h.filter(l=>l||null==l);e.has("optionsCaption")&&
(h=a.a.g(e.get("optionsCaption")),null!==h&&void 0!==h&&q.unshift(Y))}var u=!1;c.beforeRemove=l=>b.removeChild(l);h=t;e.has("optionsAfterRender")&&"function"==typeof e.get("optionsAfterRender")&&(h=(l,m)=>{t(l,m);a.i.D(e.get("optionsAfterRender"),null,[m[0],l!==Y?l:void 0])});a.a.Wb(b,q,function(l,m,r){r.length&&(p=!n&&r[0].selected?[a.A.O(r[0])]:[],u=!0);m=b.ownerDocument.createElement("option");l===Y?(a.a.ib(m,e.get("optionsCaption")),a.A.La(m,void 0)):(r=k(l,e.get("optionsValue"),l),a.A.La(m,a.a.g(r)),
l=k(l,e.get("optionsText"),r),a.a.ib(m,l));return[m]},c,h);if(!n){var x;d?x=p.length&&g().length<p.length:x=p.length&&0<=b.selectedIndex?a.A.O(b.options[b.selectedIndex])!==p[0]:p.length||0<=b.selectedIndex;x&&a.i.D(a.a.Zb,null,[b,"change"])}(n||a.i.bb())&&a.c.notify(b,a.c.B);f&&20<Math.abs(f-b.scrollTop)&&(b.scrollTop=f)}};a.b.options.fb=a.a.f.X();a.b.style={update:(b,c)=>{c=a.a.g(c()||{});a.a.N(c,(e,g)=>{g=a.a.g(g);if(null===g||void 0===g||!1===g)g="";if(/^--/.test(e))b.style.setProperty(e,g);else{e=
e.replace(/-(\w)/g,(t,d)=>d.toUpperCase());var k=b.style[e];b.style[e]=g;g===k||b.style[e]!=k||isNaN(g)||(b.style[e]=g+"px")}})}};a.b.submit={init:(b,c,e,g,k)=>{if("function"!=typeof c())throw Error("The value for a submit binding must be a function");a.a.H(b,"submit",t=>{var d=c();try{var f=d.call(k.$data,b)}finally{!0!==f&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}})}};a.b.text={init:()=>({controlsDescendantBindings:!0}),update:(b,c)=>a.a.ib(b,c())};a.h.ca.text=!0;a.b.textInput={init:(b,
c,e)=>{var g=b.value,k,t,d=()=>{clearTimeout(k);t=k=void 0;var h=b.value;g!==h&&(g=h,a.F.ob(c(),e,"textInput",h))},f=()=>{var h=a.a.g(c());if(null===h||void 0===h)h="";void 0!==t&&h===t?a.a.setTimeout(f,4):b.value!==h&&(b.value=h,g=b.value)};a.a.H(b,"input",d);a.a.H(b,"change",d);a.a.H(b,"blur",d);a.l(f,{j:b})}};a.F.mb.textInput=!0;a.b.textinput={preprocess:(b,c,e)=>e("textInput",b)};a.b.value={init:(b,c,e)=>{var g=b.matches("SELECT"),k=b.matches("INPUT");if(!k||"checkbox"!=b.type&&"radio"!=b.type){var t=
[],d=e.get("valueUpdate"),f=null;d&&("string"==typeof d?t=[d]:t=d?d.filter((q,u)=>d.indexOf(q)===u):[],a.a.va(t,"change"));var h=()=>{f=null;var q=c(),u=a.A.O(b);a.F.ob(q,e,"value",u)};t.forEach(q=>{var u=h;a.a.Dc(q,"after")&&(u=()=>{f=a.A.O(b);a.a.setTimeout(h,0)},q=q.substring(5));a.a.H(b,q,u)});var n=k&&"file"==b.type?()=>{var q=a.a.g(c());null===q||void 0===q||""===q?b.value="":a.i.D(h)}:()=>{var q=a.a.g(c()),u=a.A.O(b);if(null!==f&&q===f)a.a.setTimeout(n,0);else if(q!==u||void 0===u)g?(u=e.get("valueAllowUnset"),
a.A.La(b,q,u),u||q===a.A.O(b)||a.i.D(h)):a.A.La(b,q)};if(g){var p;a.c.subscribe(b,a.c.B,()=>{p?e.get("valueAllowUnset")?n():h():(a.a.H(b,"change",h),p=a.l(n,{j:b}))},null,{notifyImmediately:!0})}else a.a.H(b,"change",h),a.l(n,{j:b})}else a.Pa(b,{checkedValue:c})},update:()=>{}};a.F.mb.value=!0;a.b.visible={update:(b,c)=>{c=a.a.g(c());var e="none"!=b.style.display;c&&!e?b.style.display="":e&&!c&&(b.style.display="none")}};a.b.hidden={update:(b,c)=>b.hidden=!!a.a.g(c())};(function(b){a.b[b]={init:function(c,
e,g,k,t){return a.b.event.init.call(this,c,()=>({[b]:e()}),g,k,t)}}})("click");(()=>{let b=a.a.f.X();class c{constructor(g){this.Va=g}Ha(...g){let k=this.Va;if(!g.length)return a.a.f.get(k,b)||(11===this.P?k.content:1===this.P?k:void 0);a.a.f.set(k,b,g[0])}}class e extends c{constructor(g){super(g);g&&(this.P=g.matches("TEMPLATE")&&g.content?g.content.nodeType:1)}}a.Ia={Va:e,Oa:c}})();(()=>{function b(d,f){if(d.length){var h=d[0],n=h.parentNode;g(h,d[d.length-1],p=>{1!==p.nodeType&&8!==p.nodeType||
a.xb(f,p)});a.a.za(d,n)}}function c(d,f,h,n,p){p=p||{};var q=(d&&(d.nodeType?d:0<d.length?d[0]:null)||h||{}).ownerDocument;if("string"==typeof h){q=q||T;q=q.getElementById(h);if(!q)throw Error("Cannot find template with ID "+h);h=new a.Ia.Va(q)}else if([1,8].includes(h.nodeType))h=new a.Ia.Oa(h);else throw Error("Unknown template type: "+h);h=(h=h.Ha?h.Ha():null)?[...h.cloneNode(!0).childNodes]:null;if("number"!=typeof h.length||0<h.length&&"number"!=typeof h[0].nodeType)throw Error("Template engine must return an array of DOM nodes");
q=!1;switch(f){case "replaceChildren":a.h.sa(d,h);q=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+f);}q&&(b(h,n),p.afterRender&&a.i.D(p.afterRender,null,[h,n[p.as||"$data"]]),"replaceChildren"==f&&a.c.notify(d,a.c.B));return h}function e(d,f,h){return a.K(d)?d():"function"===typeof d?d(f,h):d}var g=(d,f,h)=>{var n;for(f=a.h.nextSibling(f);d&&(n=d)!==f;)d=a.h.nextSibling(n),h(n,d)};a.Ac=function(d,f,h,n){h=h||{};var p=p||"replaceChildren";if(n){var q=n.nodeType?
n:0<n.length?n[0]:null;return a.l(()=>{var u=f&&f instanceof a.R?f:new a.R(f,null,null,null,{exportDependencies:!0}),x=e(d,u.$data,u);c(n,p,x,u,h)},{oa:()=>!q||!a.a.Xa(q),j:q})}console.log("no targetNodeOrNodeArray")};a.Bc=(d,f,h,n,p)=>{function q(y,w){a.i.D(a.a.Wb,null,[n,y,l,h,m,w]);a.c.notify(n,a.c.B)}var u,x=h.as,l=(y,w)=>{u=p.createChildContext(y,{as:x,noChildContext:h.noChildContext,extend:A=>{A.$index=w;x&&(A[x+"Index"]=w)}});y=e(d,y,u);return c(n,"ignoreTargetNode",y,u,h)},m=(y,w)=>{b(w,u);
h.afterRender&&h.afterRender(w,y);u=null},r=!1===h.includeDestroyed;if(r||h.beforeRemove||!a.Ob(f))return a.l(()=>{var y=a.a.g(f)||[];"undefined"==typeof y.length&&(y=[y]);r&&(y=y.filter(w=>w||null==w));q(y)},{j:n});q(f.G());var v=f.subscribe(y=>{q(f(),y)},null,"arrayChange");v.j(n);return v};var k=a.a.f.X(),t=a.a.f.X();a.b.template={init:(d,f)=>{f=a.a.g(f());if("string"==typeof f||"name"in f)a.h.pa(d);else if("nodes"in f){f=f.nodes||[];if(a.K(f))throw Error('The "nodes" option must be a plain, non-observable array.');
let h=f[0]&&f[0].parentNode;h&&a.a.f.get(h,t)||(h=a.a.Rb(f),a.a.f.set(h,t,!0));(new a.Ia.Oa(d)).Ha(h)}else if(f=a.h.childNodes(d),0<f.length)f=a.a.Rb(f),(new a.Ia.Oa(d)).Ha(f);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:(d,f,h,n,p)=>{var q=f();f=a.a.g(q);h=!0;n=null;"string"==typeof f?f={}:(q="name"in f?f.name:d,"if"in f&&(h=a.a.g(f["if"])),h&&"ifnot"in f&&(h=!a.a.g(f.ifnot)),h&&!q&&(h=!1));"foreach"in f?n=a.Bc(q,
h&&f.foreach||[],f,d,p):h?(h=p,"data"in f&&(h=p.createChildContext(f.data,{as:f.as,noChildContext:f.noChildContext,exportDependencies:!0})),n=a.Ac(q,h,f,d)):a.h.pa(d);p=n;(f=a.a.f.get(d,k))&&"function"==typeof f.o&&f.o();a.a.f.set(d,k,!p||p.ga&&!p.ga()?void 0:p)}};a.F.Ra.template=d=>{d=a.F.xc(d);return 1==d.length&&d[0].unknown||a.F.vc(d,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.h.ca.template=!0})();a.a.Lb=(b,c,e)=>{if(b.length&&c.length){var g,
k,t,d,f;for(g=k=0;(!e||g<e)&&(d=b[k]);++k){for(t=0;f=c[t];++t)if(d.value===f.value){d.moved=f.index;f.moved=d.index;c.splice(t,1);g=t=0;break}g+=t}}};a.a.Fb=(()=>{function b(c,e,g,k,t){var d=Math.min,f=Math.max,h=[],n,p=c.length,q,u=e.length,x=u-p||1,l=p+u+1,m;for(n=0;n<=p;n++){var r=m;h.push(m=[]);var v=d(u,n+x);for(q=f(0,n-1);q<=v;q++)m[q]=q?n?c[n-1]===e[q-1]?r[q-1]:d(r[q]||l,m[q-1]||l)+1:q+1:n+1}d=[];f=[];x=[];n=p;for(q=u;n||q;)u=h[n][q]-1,q&&u===h[n][q-1]?f.push(d[d.length]={status:g,value:e[--q],
index:q}):n&&u===h[n-1][q]?x.push(d[d.length]={status:k,value:c[--n],index:n}):(--q,--n,t.sparse||d.push({status:"retained",value:e[q]}));a.a.Lb(x,f,!t.dontLimitMoves&&10*p);return d.reverse()}return function(c,e,g){g="boolean"===typeof g?{dontLimitMoves:g}:g||{};c=c||[];e=e||[];return c.length<e.length?b(c,e,"added","deleted",g):b(e,c,"deleted","added",g)}})();(()=>{function b(g,k,t,d,f){var h=[],n=a.l(()=>{var p=k(t,f,a.a.za(h,g))||[];if(0<h.length){var q=h.nodeType?[h]:h;if(0<q.length){var u=q[0],
x=u.parentNode,l;var m=0;for(l=p.length;m<l;m++)x.insertBefore(p[m],u);m=0;for(l=q.length;m<l;m++)a.removeNode(q[m])}d&&a.i.D(d,null,[t,p,f])}h.length=0;h.push(...p)},{j:g,oa:()=>!!h.find(a.a.Xa)});return{M:h,Ta:n.ga()?n:void 0}}var c=a.a.f.X(),e=a.a.f.X();a.a.Wb=(g,k,t,d,f,h)=>{function n(H){z={da:H,Ca:a.ba(r++)};l.push(z);x||I.push(z)}function p(H){z=u[H];r!==z.Ca.G()&&A.push(z);z.Ca(r++);a.a.za(z.M,g);l.push(z)}function q(H,L){if(H)for(var K=0,N=L.length;K<N;K++)L[K].M.forEach(ia=>H(ia,K,L[K].da))}
k=k||[];"undefined"==typeof k.length&&(k=[k]);d=d||{};var u=a.a.f.get(g,c),x=!u,l=[],m=0,r=0,v=[],y=[],w=[],A=[],I=[],G=0;if(x)k.forEach(n);else{if(!h||u&&u._countWaitingForRemove)h=Array.prototype.map.call(u,H=>H.da),h=a.a.Fb(h,k,{dontLimitMoves:d.dontLimitMoves,sparse:!0});for(let H=0,L,K,N;L=h[H];H++)switch(K=L.moved,N=L.index,L.status){case "deleted":for(;m<N;)p(m++);if(void 0===K){var z=u[m];z.Ta&&(z.Ta.o(),z.Ta=void 0);a.a.za(z.M,g).length&&(d.beforeRemove&&(l.push(z),G++,z.da===e?z=null:w.push(z)),
z&&v.push.apply(v,z.M))}m++;break;case "added":for(;r<N;)p(m++);void 0!==K?(y.push(l.length),p(K)):n(L.value)}for(;r<k.length;)p(m++);l._countWaitingForRemove=G}a.a.f.set(g,c,l);q(d.beforeMove,A);v.forEach(d.beforeRemove?a.ea:a.removeNode);var M,B;G=g.ownerDocument.activeElement;if(y.length)for(;void 0!=(k=y.shift());){z=l[k];for(M=void 0;k;)if((B=l[--k].M)&&B.length){M=B[B.length-1];break}for(m=0;v=z.M[m];M=v,m++)a.h.Nb(g,v,M)}for(k=0;z=l[k];k++){z.M||a.a.extend(z,b(g,t,z.da,f,z.Ca));for(m=0;v=z.M[m];M=
v,m++)a.h.Nb(g,v,M);!z.rc&&f&&(f(z.da,z.M,z.Ca),z.rc=!0,M=z.M[z.M.length-1])}G&&g.ownerDocument.activeElement!=G&&G.focus();q(d.beforeRemove,w);for(k=0;k<w.length;++k)w[k].da=e;q(d.afterMove,A);q(d.afterAdd,I)}})();C.ko=W})(this);

View file

@ -12,7 +12,6 @@ ko.bindingHandlers['textInput'] = {
var elementValue = element.value;
if (previousElementValue !== elementValue) {
// Provide a way for tests to know exactly which event was processed
if (DEBUG && event) element['_ko_textInputProcessedEvent'] = event.type;
previousElementValue = elementValue;
ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'textInput', elementValue);
}
@ -25,8 +24,7 @@ ko.bindingHandlers['textInput'] = {
// updates that are from the previous state of the element, usually due to techniques
// such as rateLimit. Such updates, if not ignored, can cause keystrokes to be lost.
elementValueBeforeEvent = element.value;
var handler = DEBUG ? updateModel.bind(element, {type: event.type}) : updateModel;
timeoutHandle = ko.utils.setTimeout(handler, 4);
timeoutHandle = ko.utils.setTimeout(updateModel, 4);
}
};
@ -53,18 +51,7 @@ ko.bindingHandlers['textInput'] = {
var onEvent = (event, handler) =>
ko.utils.registerEventHandler(element, event, handler);
if (DEBUG && ko.bindingHandlers['textInput']['_forceUpdateOn']) {
// Provide a way for tests to specify exactly which events are bound
ko.bindingHandlers['textInput']['_forceUpdateOn'].forEach(eventName => {
if (eventName.slice(0,5) == 'after') {
onEvent(eventName.slice(5), deferUpdateModel);
} else {
onEvent(eventName, updateModel);
}
});
} else {
onEvent('input', updateModel);
}
onEvent('input', updateModel);
// Bind to the change event so that we can catch programmatic updates of the value that fire this event.
onEvent('change', updateModel);

View file

@ -1,6 +1,6 @@
var computedState = Symbol('_state');
ko.computed = function (evaluatorFunctionOrOptions, options) {
ko.computed = (evaluatorFunctionOrOptions, options) => {
if (typeof evaluatorFunctionOrOptions === "object") {
// Single-parameter syntax - everything is on this "options" param
options = evaluatorFunctionOrOptions;
@ -71,11 +71,6 @@ ko.computed = function (evaluatorFunctionOrOptions, options) {
ko.utils.extend(computedObservable, deferEvaluationOverrides);
}
if (DEBUG) {
// #1731 - Aid debugging by exposing the computed's options
computedObservable["_options"] = options;
}
if (state.disposeWhenNodeIsRemoved) {
// Since this computed is associated with a DOM node, and we don't want to dispose the computed
// until the DOM node is *removed* from the document (as opposed to never having been in the document),
@ -99,7 +94,7 @@ ko.computed = function (evaluatorFunctionOrOptions, options) {
// Attach a DOM node disposal callback so that the computed will be proactively disposed as soon as the node is
// removed using ko.removeNode. But skip if isActive is false (there will never be any dependencies to dispose).
if (state.disposeWhenNodeIsRemoved && computedObservable.isActive()) {
ko.utils.domNodeDisposal.addDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback = function () {
ko.utils.domNodeDisposal.addDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback = () => {
computedObservable.dispose();
});
}
@ -136,6 +131,26 @@ function computedBeginDependencyDetectionCallback(subscribable, id) {
}
}
function evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext) {
// This function is really part of the evaluateImmediate_CallReadWithDependencyDetection logic.
// You'd never call it from anywhere else. Factoring it out means that evaluateImmediate_CallReadWithDependencyDetection
// can be independent of try/finally blocks, which contributes to saving about 40% off the CPU
// overhead of computed evaluation (on V8 at least).
try {
return state.readFunction();
} finally {
ko.dependencyDetection.end();
// For each subscription no longer being used, remove it from the active subscriptions list and dispose it
if (dependencyDetectionContext.disposalCount && !state.isSleeping) {
ko.utils.objectForEach(dependencyDetectionContext.disposalCandidates, computedDisposeDependencyCallback);
}
state.isStale = state.isDirty = false;
}
}
var computedFn = {
"equalityComparer": valuesArePrimitiveAndEqual,
getDependenciesCount: function () {
@ -284,7 +299,7 @@ var computedFn = {
state.dependencyTracking = {};
state.dependenciesCount = 0;
var newValue = this.evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext);
var newValue = evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext);
if (!state.dependenciesCount) {
computedObservable.dispose();
@ -301,7 +316,6 @@ var computedFn = {
}
state.latestValue = newValue;
if (DEBUG) computedObservable._latestValue = newValue;
computedObservable["notifySubscribers"](state.latestValue, "spectate");
@ -319,25 +333,6 @@ var computedFn = {
return changed;
},
evaluateImmediate_CallReadThenEndDependencyDetection: (state, dependencyDetectionContext) => {
// This function is really part of the evaluateImmediate_CallReadWithDependencyDetection logic.
// You'd never call it from anywhere else. Factoring it out means that evaluateImmediate_CallReadWithDependencyDetection
// can be independent of try/finally blocks, which contributes to saving about 40% off the CPU
// overhead of computed evaluation (on V8 at least).
try {
return state.readFunction();
} finally {
ko.dependencyDetection.end();
// For each subscription no longer being used, remove it from the active subscriptions list and dispose it
if (dependencyDetectionContext.disposalCount && !state.isSleeping) {
ko.utils.objectForEach(dependencyDetectionContext.disposalCandidates, computedDisposeDependencyCallback);
}
state.isStale = state.isDirty = false;
}
},
peek: function (evaluate) {
// By default, peek won't re-evaluate, except while the computed is sleeping or to get the initial value when "deferEvaluation" is set.
// Pass in true to evaluate if needed.

View file

@ -1,24 +1,23 @@
ko.utils.domNodeDisposal = new (function () {
ko.utils.domNodeDisposal = (() => {
var domDataKey = ko.utils.domData.nextKey();
var cleanableNodeTypes = { 1: true, 8: true, 9: true }; // Element, Comment, Document
var cleanableNodeTypesWithDescendants = { 1: true, 9: true }; // Element, Document
var cleanableNodeTypes = { 1: 1, 8: 1, 9: 1 }; // Element, Comment, Document
var cleanableNodeTypesWithDescendants = { 1: 1, 9: 1 }; // Element, Document
function getDisposeCallbacksCollection(node, createIfNotFound) {
const getDisposeCallbacksCollection = (node, createIfNotFound) => {
var allDisposeCallbacks = ko.utils.domData.get(node, domDataKey);
if ((allDisposeCallbacks === undefined) && createIfNotFound) {
allDisposeCallbacks = [];
ko.utils.domData.set(node, domDataKey, allDisposeCallbacks);
}
return allDisposeCallbacks;
}
function destroyCallbacksCollection(node) {
ko.utils.domData.set(node, domDataKey, undefined);
}
},
function cleanSingleNode(node) {
destroyCallbacksCollection = node => ko.utils.domData.set(node, domDataKey, undefined),
cleanSingleNode = node => {
// Run all the dispose callbacks
var callbacks = getDisposeCallbacksCollection(node, false);
var callbacks = getDisposeCallbacksCollection(node);
if (callbacks) {
callbacks = callbacks.slice(0); // Clone, as the array may be modified during iteration (typically, callbacks will remove themselves)
for (var i = 0; i < callbacks.length; i++)
@ -30,12 +29,11 @@ ko.utils.domNodeDisposal = new (function () {
// Clear any immediate-child comment nodes, as these wouldn't have been found by
// node.getElementsByTagName("*") in cleanNode() (comment nodes aren't elements)
if (cleanableNodeTypesWithDescendants[node.nodeType]) {
cleanNodesInList(node.childNodes, true/*onlyComments*/);
}
}
cleanableNodeTypesWithDescendants[node.nodeType]
&& cleanNodesInList(node.childNodes, true/*onlyComments*/);
},
function cleanNodesInList(nodeList, onlyComments) {
cleanNodesInList = (nodeList, onlyComments) => {
var cleanedNodes = [], lastCleanedNode;
for (var i = 0; i < nodeList.length; i++) {
if (!onlyComments || nodeList[i].nodeType === 8) {
@ -45,21 +43,20 @@ ko.utils.domNodeDisposal = new (function () {
}
}
}
}
};
return {
addDisposeCallback : (node, callback) => {
if (typeof callback != "function")
throw new Error("Callback must be a function");
getDisposeCallbacksCollection(node, true).push(callback);
getDisposeCallbacksCollection(node, 1).push(callback);
},
removeDisposeCallback : (node, callback) => {
var callbacksCollection = getDisposeCallbacksCollection(node, false);
var callbacksCollection = getDisposeCallbacksCollection(node);
if (callbacksCollection) {
ko.utils.arrayRemoveItem(callbacksCollection, callback);
if (callbacksCollection.length == 0)
destroyCallbacksCollection(node);
callbacksCollection.length || destroyCallbacksCollection(node);
}
},
@ -70,9 +67,8 @@ ko.utils.domNodeDisposal = new (function () {
cleanSingleNode(node);
// ... then its descendants, where applicable
if (cleanableNodeTypesWithDescendants[node.nodeType]) {
cleanNodesInList(node.getElementsByTagName("*"));
}
cleanableNodeTypesWithDescendants[node.nodeType]
&& cleanNodesInList(node.getElementsByTagName("*"));
}
});
@ -81,8 +77,7 @@ ko.utils.domNodeDisposal = new (function () {
removeNode : node => {
ko.cleanNode(node);
if (node.parentNode)
node.parentNode.removeChild(node);
node.parentNode && node.parentNode.removeChild(node);
}
};
})();