mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
Update Fork (#2)
* Cleanup OpenPgpImportPopupView code * update polish translation * small fix * Added Import S/MIME certificate popup And much better handling of the sign and encrypt options * bugfix: store in Passphrases * Resolve #1448 * pre-verify S/MIME opaque signed messages so we have a body to view * Fix timestampToString() for future dates * Move php8.php to /app/libraries/polyfill/ * Improved Settings handling to prevent bugs in outer code * Changed AbstractProvider::IsActive() to be abstract * Example for #1449 * bugfix: previous IsActive() commit * OpenSSL required due to S/MIME * Use get_debug_type() instead of gettype() * update polish translation * Make all Enumerations classes abstract * Added search functionality in Admin -> Config And removed the unused ['capa']['quota'] * Cleanup Quota handling * OPEN_PGP should be OPENPGP as it is one word * Improve Capa handling * Resolve #1451 * Bugfix TypeError: b64Encode(...).match(...) is null * Small StorageType change * Bugfix: mailvelope editor failed * Bugfix: undefined getMailvelopePrivateKeyFor() * Bugfix: MIME parser RegExp didn't escape `boundary` which caused issues * Return detailed info on PgpImportKey * Show GnuPG verify error * Sort PGP keys by email and id * Sort S/MIME certificates on emailAddress else validTo * S/MIME import from signature use `BEGIN PKCS7` * Optionally use existing private key to generate S/MIME certificate * Chaned some error_log() to MailSo Logger() * Force reload of S/MIME certificates list on import * Make better use of SnappyMail\SensitiveString * Fix view PGP key button * Mask all POST data that has a key which contains `pass` * v2.35.1 * Resolve #1455 * Improved GnuPG error handling * Update pt/pt-PT translation * update Polish translation * Drop support for gnupg pecl extension as it fails with "no passphrase" issues * Resolve #1456 * Resolve #1458 * v2.35.2 * fix changelog * Resolve #1461 * Update pt/pt-PT translation * compact-composer plugin v1.0.0 * Resolve #1462 * Fix decrypt error message * `new Error()` to `Error()` * Resolve #1463 * Show url for #1466 * Simplify SignMe/Remember me code * Simplify language Notifications * Bugfix: SetPassword expects \SnappyMail\SensitiveString * https://github.com/the-djmaze/snappymail/issues/1450#issuecomment-1972147950 * improve: fire the 'squire2-toolbar' event after more props are added * improve: add dark theme support and use 'button' element as menu trigger for consistent styling * fix: use compact template in non-destructive way (do not replace the PopupsCompose template if a different wysiwyg is used) * Update admin.json * Update user.json * CSS rainloopErrorTip location * Improved error handling on PGP and S/MIME decrypt * KnockoutJS remove unused `beforeRemove` * KnockoutJS drop unused `as` * KnockoutJS simplify renderMode because only 1 option is used * KnoutJS cleanup templating.js a bit * KnockoutJS drop unused `bindingRewriteValidators` * KnockoutJS drop the twoWayBindings code * KnockoutJS simplify virtualElements binding check * KnockoutJS simplify applyBindingsToNodeInternal * KnockoutJS use Array.isArray * KnockoutJS drop alias `textinput` for `textInput` * KnockoutJS scramble `createChildContext` * KnockoutJS scramble `controlsDescendantBindings` * KnockoutJS scramble `exportDependencies` * KnockoutJS drop unused `throttleEvaluation` * KnockoutJS drop unused `valueAllowUnset` * KnockoutJS drop unused `templateNodes` * KnockoutJS drop unused `optionsCaption` * KnockoutJS drop unused `dontLimitMoves` * KnockoutJS drop unused `uniqueName` * KnockoutJS drop IE leftovers * KnockoutJS drop unused `preprocess` * KnockoutJS drop unused "disposeWhenNodeIsRemoved" and "disposeWhen" * KnockoutJS don't scramble exportDependencies. controlsDescendantBindings, createChildContext * KnockoutJS drop unused `$parentContext` and `$parents` * KnockoutJS drop unused `$rawData` * Knockoutjs built latest * KnockoutJS drop unused template options `nodes`, `if`, `ifnot` * KnockoutJS use more Array.isArray * KnockoutJS cleanup code a bit * KnockoutJS primitiveTypes can just be checked with Object() * KnockoutJS rebuilt * Verify S/MIME signed automatically and log Exception * Automatically verify PGP and S/MIME signed messages * `new Error` to `Error` * By default throw AccountNotAllowed as confused in #1478 * GPG use pinentries for decrypt, sign and export * Better GPG error handling * GPG show error on view/export * OpenPGP fix handling of importing keys * Make "verify signatures automatically" optional, as it requires more IMAP fetching * S/MIME don't post identity key and certificate, just fetch from server * Show error to old browsers, instead of crashing * Automatically verify S/MIME decrypted signed message --------- Co-authored-by: the-djmaze <> Co-authored-by: tinola <tinola@poczta.onet.pl> Co-authored-by: Maarten <3752035+the-djmaze@users.noreply.github.com> Co-authored-by: lmperfis <joint.striker@gmail.com> Co-authored-by: Sergey Mosin <sergey@srgdev.com> Co-authored-by: hguilbert <51283484+hguilbert@users.noreply.github.com>
This commit is contained in:
parent
3bd073a38b
commit
876ed221c3
218 changed files with 10266 additions and 4267 deletions
|
|
@ -1,7 +1,7 @@
|
|||
knockoutDebugCallback([
|
||||
'src/namespace.js',
|
||||
'src/google-closure-compiler-utils.js',
|
||||
'src/version.js',
|
||||
// 'src/version.js',
|
||||
// 'src/options.js',
|
||||
'src/utils.js',
|
||||
'src/utils.domData.js',
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
129
vendors/knockout/build/output/knockout-latest.js
vendored
129
vendors/knockout/build/output/knockout-latest.js
vendored
|
|
@ -4,70 +4,65 @@
|
|||
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
(V=>{function O(a,b){return null===a||ea[typeof a]?a===b:!1}function fa(a,b){var d;return()=>{d||(d=setTimeout(()=>{d=0;a()},b))}}function ha(a,b){var d;return()=>{clearTimeout(d);d=setTimeout(a,b)}}function ia(a,b){b?.dispose?.()}function ja(a,b){var d=this.Pb,f=d[x];f.Z||(this.Ra&&this.va[b]?(d.mb(b,a,this.va[b]),this.va[b]=null,--this.Ra):f.v[b]||d.mb(b,a,f.A?{W:a}:d.Hb(a)),a.ha&&a.Lb())}function W(a){a=c.g.j.get(a,H);var b=a?.F;b&&(a.F=null,b.Bb())}function X(a,b){for(var d,f=c.m.firstChild(b);d=
|
||||
f;)f=c.m.nextSibling(d),Y(a,d);c.l.notify(b,c.l.D)}function Y(a,b){var d=a;if(1===b.nodeType||c.qb.ac(b))d=Z(b,null,a).bindingContextForDescendants;d&&!b.matches?.("SCRIPT,TEXTAREA,TEMPLATE")&&X(d,b)}function ka(a){var b=[],d={},f=[];c.g.M(a,function e(l){if(!d[l]){var g=c.h[l];g&&(g.after&&(f.push(l),g.after.forEach(k=>{if(a[k]){if(f.includes(k))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+f.join(", "));e(k)}}),f.length--),b.push({key:l,xb:g}));d[l]=
|
||||
!0}});return b}function Z(a,b,d){var f=c.g.j.Wa(a,H,{}),h=f.Mb;if(!b){if(h)throw Error("You cannot apply bindings multiple times to the same element.");f.Mb=!0}h||(f.context=d);f.Ya||(f.Ya={});if(b&&"function"!==typeof b)var l=b;else{var e=c.o(()=>{if(l=b?b(d,a):c.qb.Sb(a,d))d[I]?.(),d[aa]?.();return l},{s:a});l&&e.isActive()||(e=null)}var g=d,k;if(l){var n=e?m=>()=>e()[m]():m=>l[m],p={get:m=>l[m]&&n(m)(),has:m=>m in l};c.l.D in l&&c.l.subscribe(a,c.l.D,()=>{var m=l[c.l.D]();if(m){var q=c.m.childNodes(a);
|
||||
q.length&&m(q,c.dataFor(q[0]))}});c.l.fa in l&&(g=c.l.cb(a,d),c.l.subscribe(a,c.l.fa,()=>{var m=l[c.l.fa]();m&&c.m.firstChild(a)&&m(a)}));ka(l).forEach(m=>{var q=m.xb.init,r=m.xb.update,t=m.key;if(8===a.nodeType&&!c.m.ba[t])throw Error("The binding '"+t+"' cannot be used with virtual elements");try{"function"==typeof q&&c.u.J(()=>{var u=q(a,n(t),p,g.$data,g);if(u&&u.controlsDescendantBindings){if(void 0!==k)throw Error("Multiple bindings ("+k+" and "+t+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
|
||||
k=t}}),"function"==typeof r&&c.o(()=>r(a,n(t),p,g.$data,g),{s:a})}catch(u){throw u.message='Unable to process binding "'+t+": "+l[t]+'"\nMessage: '+u.message,u;}})}f=void 0===k;return{shouldBindDescendants:f,bindingContextForDescendants:f&&g}}function P(a,b){return a&&a instanceof c.da?a:new c.da(a,void 0,void 0,b)}var J=V.document,Q={},c="undefined"!==typeof Q?Q:{};c.S=(a,b)=>{a=a.split(".");for(var d=c,f=0,h=a.length-1;f<h;f++)d=d[a[f]];d[a[h]]=b};c.version="3.5.1-sm";c.g={extend:(a,b)=>b?Object.assign(a,
|
||||
b):a,M:(a,b)=>a&&Object.entries(a).forEach(d=>b(d[0],d[1])),Va:a=>[...a.childNodes].forEach(b=>c.removeNode(b)),Ab:a=>{a=[...a];var b=(a[0]?.ownerDocument||J).createElement("div");a.forEach(d=>b.append(c.ea(d)));return b},ua:(a,b)=>Array.prototype.map.call(a,b?d=>c.ea(d.cloneNode(!0)):d=>d.cloneNode(!0)),qa:(a,b)=>{c.g.Va(a);b&&a.append(...b)},xa:(a,b)=>{if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)--a.length;
|
||||
if(1<a.length){b=a[0];var d=a[a.length-1];for(a.length=0;b!==d;)a.push(b),b=b.nextSibling;a.push(d)}}return a},Gb:a=>null==a?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,""),Ua:a=>a.ownerDocument.documentElement.contains(1!==a.nodeType?a.parentNode:a),Ib:(a,b)=>{if(!a?.nodeType)throw Error("element must be a DOM node when calling triggerEvent");a.dispatchEvent(new Event(b))},i:a=>c.T(a)?a():a,bb:(a,b)=>a.textContent=c.g.i(b)};c.S("utils",c.g);c.S("unwrap",c.g.i);(()=>{let a=0,
|
||||
b="__ko__"+Date.now(),d=new WeakMap;c.g.j={get:(f,h)=>(d.get(f)||{})[h],set:(f,h,l)=>{d.has(f)?d.get(f)[h]=l:d.set(f,{[h]:l});return l},Wa(f,h,l){return this.get(f,h)||this.set(f,h,l)},clear:f=>d.delete(f),Y:()=>a++ +b}})();c.g.O=(()=>{var a=c.g.j.Y(),b={1:1,8:1,9:1},d={1:1,9:1};const f=(e,g)=>{var k=c.g.j.get(e,a);g&&!k&&(k=new Set,c.g.j.set(e,a,k));return k},h=e=>{var g=f(e);g&&(new Set(g)).forEach(k=>k(e));c.g.j.clear(e);d[e.nodeType]&&l(e.childNodes,!0)},l=(e,g)=>{for(var k=[],n,p=0;p<e.length;p++)if(!g||
|
||||
8===e[p].nodeType)if(h(k[k.length]=n=e[p]),e[p]!==n)for(;p--&&!k.includes(e[p]););};return{addDisposeCallback:(e,g)=>{if("function"!=typeof g)throw Error("Callback must be a function");f(e,1).add(g)},ab:(e,g)=>{var k=f(e);k&&(k.delete(g),k.size||c.g.j.set(e,a,null))},ea:e=>{c.u.J(()=>{b[e.nodeType]&&(h(e),d[e.nodeType]&&l(e.getElementsByTagName("*")))});return e},removeNode:e=>{c.ea(e);e.parentNode&&e.parentNode.removeChild(e)}}})();c.ea=c.g.O.ea;c.removeNode=c.g.O.removeNode;c.S("utils.domNodeDisposal",
|
||||
c.g.O);c.extenders={debounce:(a,b)=>a.Ea(d=>ha(d,b)),rateLimit:(a,b)=>a.Ea(d=>fa(d,b)),notify:(a,b)=>{a.ma="always"==b?null:O}};var ea={undefined:1,"boolean":1,number:1,string:1};class la{constructor(a,b,d){this.W=a;this.gb=b;this.za=d;this.Ka=!1;this.I=this.ga=null}dispose(){this.Ka||(this.I&&c.g.O.ab(this.ga,this.I),this.Ka=!0,this.za(),this.W=this.gb=this.za=this.ga=this.I=null)}s(a){this.ga=a;c.g.O.addDisposeCallback(a,this.I=this.dispose.bind(this))}}c.U=function(){Object.setPrototypeOf(this,
|
||||
R);R.init(this)};var R={init:a=>{a.V=new Map;a.V.set("change",new Set);a.lb=1},subscribe:function(a,b,d){var f=this;d=d||"change";var h=new la(f,b?a.bind(b):a,()=>{f.V.get(d).delete(h);f.La?.(d)});f.Na?.(d);f.V.has(d)||f.V.set(d,new Set);f.V.get(d).add(h);return h},B(a,b){b=b||"change";"change"===b&&this.Ha();if(this.oa(b)){b="change"===b&&this.Jb||new Set(this.V.get(b));try{c.u.pb(),b.forEach(d=>{d.Ka||d.gb(a)})}finally{c.u.end()}}},ya(){return this.lb},Vb(a){return this.ya()!==a},Ha(){++this.lb},
|
||||
Ea(a){var b=this,d=c.T(b),f,h,l,e,g;b.sa||(b.sa=b.B,b.B=(n,p)=>{p&&"change"!==p?"beforeChange"===p?b.ib(n):b.sa(n,p):b.jb(n)});var k=a(()=>{b.ha=!1;d&&e===b&&(e=b.hb?b.hb():b());var n=h||g&&b.Ca(l,e);g=h=f=!1;n&&b.sa(l=e)});b.jb=(n,p)=>{p&&b.ha||(g=!p);b.Jb=new Set(b.V.get("change"));b.ha=f=!0;e=n;k()};b.ib=n=>{f||(l=n,b.sa(n,"beforeChange"))};b.kb=()=>{g=!0};b.Lb=()=>{b.Ca(l,b.G(!0))&&(h=!0)}},oa(a){return(this.V.get(a)||[]).size},Ca(a,b){return!this.ma||!this.ma(a,b)},toString:()=>"[object Object]",
|
||||
extend:function(a){var b=this;a&&c.g.M(a,(d,f)=>{d=c.extenders[d];"function"==typeof d&&(b=d(b,f)||b)});return b}};c.U.fn=Object.setPrototypeOf(R,Function.prototype);c.Zb=a=>"function"==typeof a?.subscribe&&"function"==typeof a.B;(()=>{let a=[],b,d=0;c.u={pb:f=>{a.push(b);b=f},end:()=>b=a.pop(),Eb:f=>{if(b){if(!c.Zb(f))throw Error("Only subscribable things can act as dependencies");b.Nb.call(b.Ob,f,f.Kb||(f.Kb=++d))}},J(f,h,l){try{return a.push(b),b=void 0,f.apply(h,l||[])}finally{b=a.pop()}},na:()=>
|
||||
b?.o.na(),Da:()=>b?.Da,o:()=>b?.o}})();const B=Symbol("_latestValue");c.aa=a=>{function b(){if(0<arguments.length)return b.Ca(b[B],arguments[0])&&(b.fb(),b[B]=arguments[0],b.valueHasMutated()),this;c.u.Eb(b);return b[B]}b[B]=a;Object.defineProperty(b,"length",{get:()=>null==b[B]?void 0:b[B].length});c.U.fn.init(b);return Object.setPrototypeOf(b,K)};var K={toJSON:function(){let a=this[B];return a?.toJSON?.()||a},ma:O,G(){return this[B]},valueHasMutated:function(){this.B(this[B],"spectate");this.B(this[B])},
|
||||
fb(){this.B(this[B],"beforeChange")}};Object.setPrototypeOf(K,c.U.fn);var E=c.aa.dc="__ko_proto__";K[E]=c.aa;c.T=a=>{if((a="function"==typeof a&&a[E])&&a!==K[E]&&a!==c.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!a};c.yb=a=>"function"==typeof a&&(a[E]===K[E]||a[E]===c.o.fn[E]&&a.Wb);c.S("observable",c.aa);c.S("isObservable",c.T);c.S("observable.fn",K);c.observableArray=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.");
|
||||
return Object.setPrototypeOf(c.aa(a),c.observableArray.fn).extend({trackArrayChanges:!0})};const ba=Symbol("IS_OBSERVABLE_ARRAY");c.observableArray.fn=Object.setPrototypeOf({[ba]:1,remove:function(a){for(var b=this.G(),d=!1,f="function"!=typeof a||c.T(a)?e=>e===a:a,h=b.length;h--;){var l=b[h];if(f(l)){if(b[h]!==l)throw Error("Array modified during remove; cannot remove item");d||this.fb();d=!0;b.splice(h,1)}}d&&this.valueHasMutated()}},c.aa.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)?c.observableArray.fn[a]=function(...b){var d=this.G();this.fb();this.rb(d,a,b);b=d[a](...b);this.valueHasMutated();return b===d?this:b}:c.observableArray.fn[a]=function(...b){return this()[a](...b)})});c.isObservableArray=a=>!(!a||!a[ba]);c.extenders.trackArrayChanges=(a,b)=>{function d(){function m(){if(g){var q=[].concat(a.G()||[]);if(a.oa("arrayChange")){if(!h||
|
||||
1<g)h=c.g.sb(k,q,a.Pa);var r=h}k=q;h=null;g=0;r?.length&&a.B(r,"arrayChange")}}f?m():(f=!0,e=a.subscribe(()=>++g,null,"spectate"),k=[].concat(a.G()||[]),h=null,l=a.subscribe(m))}a.Pa={};"object"==typeof b&&c.g.extend(a.Pa,b);a.Pa.sparse=!0;if(!a.rb){var f=!1,h=null,l,e,g=0,k,n=a.Na,p=a.La;a.Na=m=>{n?.call(a,m);"arrayChange"===m&&d()};a.La=m=>{p?.call(a,m);"arrayChange"!==m||a.oa("arrayChange")||(l?.dispose(),e?.dispose(),e=l=null,f=!1,k=void 0)};a.rb=(m,q,r)=>{function t(A,v,G){return u[u.length]=
|
||||
{status:A,value:v,index:G}}if(f&&!g){var u=[],y=m.length,w=r.length,z=0;switch(q){case "push":z=y;case "unshift":for(m=0;m<w;m++)t("added",r[m],z+m);break;case "pop":z=y-1;case "shift":y&&t("deleted",m[z],z);break;case "splice":z=Math.min(Math.max(0,0>r[0]?y+r[0]:r[0]),y);y=1===w?y:Math.min(z+(r[1]||0),y);w=z+w-2;q=Math.max(y,w);for(var C=[],F=[],M=2;z<q;++z,++M)z<y&&F.push(t("deleted",m[z],z)),z<w&&C.push(t("added",r[M],z));c.g.wb(F,C);break;default:return}h=u}}}};var x=Symbol("_state");c.o=(a,b)=>
|
||||
{function d(){if(0<arguments.length){if("function"!==typeof f)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.");f(...arguments);return this}h.Z||c.u.Eb(d);(h.X||h.A&&d.pa())&&d.R();return h.K}"object"===typeof a?b=a:(b=b||{},a&&(b.read=a));if("function"!=typeof b.read)throw Error("Pass a function that returns the value of the ko.computed");var f=b.write,h={K:void 0,$:!0,X:!0,Ba:!1,eb:!1,Z:!1,
|
||||
$a:!1,A:!1,Db:b.read,s:b.disposeWhenNodeIsRemoved||b.s||null,ka:b.disposeWhen||b.ka,Ta:null,v:{},H:0,vb:null};d[x]=h;d.Wb="function"===typeof f;c.U.fn.init(d);Object.setPrototypeOf(d,N);b.pure&&(h.$a=!0,h.A=!0,c.g.extend(d,ma));h.s&&(h.eb=!0,h.s.nodeType||(h.s=null));h.A||d.R();h.s&&d.isActive()&&c.g.O.addDisposeCallback(h.s,h.Ta=()=>{d.dispose()});return d};var N={ma:O,na(){return this[x].H},Tb(){var a=[];c.g.M(this[x].v,(b,d)=>a[d.ia]=d.W);return a},Xa(a){if(!this[x].H)return!1;var b=this.Tb();
|
||||
return b.includes(a)||!!b.find(d=>d.Xa&&d.Xa(a))},mb(a,b,d){if(this[x].$a&&b===this)throw Error("A 'pure' computed must not be called recursively");this[x].v[a]=d;d.ia=this[x].H++;d.ja=b.ya()},pa(){var a,b=this[x].v;for(a in b)if(Object.prototype.hasOwnProperty.call(b,a)){var d=b[a];if(this.ra&&d.W.ha||d.W.Vb(d.ja))return!0}},jc(){this[x].Ba||this.ra?.(!1)},isActive(){var a=this[x];return a.X||0<a.H},kc(){this.ha?this[x].X&&(this[x].$=!0):this.ub()},Hb(a){return a.subscribe(this.ub,this)},ub(){var a=
|
||||
this,b=a.throttleEvaluation;0<=b?(clearTimeout(this[x].vb),this[x].vb=setTimeout(()=>a.R(!0),b)):a.ra?a.ra(!0):a.R(!0)},R(a){var b=this[x],d=b.ka,f=!1;if(!b.Ba&&!b.Z){if(b.s&&!c.g.Ua(b.s)||d?.()){if(!b.eb){this.dispose();return}}else b.eb=!1;try{b.Ba=!0,f=this.Rb(a)}finally{b.Ba=!1}return f}},Rb(a){var b=this[x],d=b.$a?void 0:!b.H;var f={Pb:this,va:b.v,Ra:b.H};c.u.pb({Ob:f,Nb:ja,o:this,Da:d});b.v={};b.H=0;a:{try{var h=b.Db();break a}finally{c.u.end(),f.Ra&&!b.A&&c.g.M(f.va,ia),b.$=b.X=!1}h=void 0}b.H?
|
||||
f=this.Ca(b.K,h):(this.dispose(),f=!0);f&&(b.A?this.Ha():this.B(b.K,"beforeChange"),b.K=h,this.B(b.K,"spectate"),!b.A&&a&&this.B(b.K),this.kb&&this.kb());d&&this.B(b.K,"awake");return f},G(a){var b=this[x];(b.X&&(a||!b.H)||b.A&&this.pa())&&this.R();return b.K},Ea(a){var b=this;c.U.fn.Ea.call(b,a);b.hb=()=>{b[x].A||(b[x].$?b.R():b[x].X=!1);return b[x].K};b.ra=d=>{b.ib(b[x].K);b[x].X=!0;d&&(b[x].$=!0);b.jb(b,!d)}},dispose:function(){var a=this[x];!a.A&&a.v&&c.g.M(a.v,(b,d)=>d.dispose?.());a.s&&a.Ta&&
|
||||
c.g.O.ab(a.s,a.Ta);a.v=void 0;a.H=0;a.Z=!0;a.$=!1;a.X=!1;a.A=!1;a.s=void 0;a.ka=void 0;a.Db=void 0}},ma={Na(a){var b=this,d=b[x];if(!d.Z&&d.A&&"change"==a){d.A=!1;if(d.$||b.pa())d.v=null,d.H=0,b.R()&&b.Ha();else{var f=[];c.g.M(d.v,(h,l)=>f[l.ia]=h);f.forEach((h,l)=>{var e=d.v[h],g=b.Hb(e.W);g.ia=l;g.ja=e.ja;d.v[h]=g});b.pa()&&b.R()&&b.Ha()}d.Z||b.B(d.K,"awake")}},La(a){var b=this[x];b.Z||"change"!=a||this.oa("change")||(c.g.M(b.v,(d,f)=>{f.dispose&&(b.v[d]={W:f.W,ia:f.ia,ja:f.ja},f.dispose())}),b.A=
|
||||
!0,this.B(void 0,"asleep"))},ya(){var a=this[x];a.A&&(a.$||this.pa())&&this.R();return c.U.fn.ya.call(this)}};Object.setPrototypeOf(N,c.U.fn);var S=c.aa.dc;N[S]=c.o;c.o.fn=N;c.S("computed",c.o);c.isComputed=a=>"function"==typeof a&&a[S]===N[S];c.Cb=a=>{if("function"===typeof a)return c.o(a,{pure:!0});a={...a,pure:!0};return c.o(a)};c.C={N:a=>{switch(a.nodeName){case "OPTION":return!0===a.__ko__hasDomDataOptionValue__?c.g.j.get(a,c.h.options.Za):a.value;case "SELECT":return 0<=a.selectedIndex?c.C.N(a.options[a.selectedIndex]):
|
||||
void 0;default:return a.value}},Ia:(a,b,d)=>{switch(a.nodeName){case "OPTION":"string"===typeof b?(c.g.j.set(a,c.h.options.Za,void 0),delete a.__ko__hasDomDataOptionValue__,a.value=b):(c.g.j.set(a,c.h.options.Za,b),a.__ko__hasDomDataOptionValue__=!0,a.value="number"===typeof b?b:"");break;case "SELECT":for(var f=-1,h=""===b||null==b,l=a.options.length,e;l--;)if(e=c.C.N(a.options[l]),e==b||""===e&&h){f=l;break}if(d||0<=f||h&&1<a.size)a.selectedIndex=f;break;default:a.value=null==b?"":b}}};c.P=(()=>
|
||||
{var a=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),b=/[\])"'A-Za-z0-9_$]+$/,d={"in":1,"return":1,"typeof":1},f=h=>{h=c.g.Gb(h);123===h.charCodeAt(0)&&(h=h.slice(1,-1));h+="\n,";var l=[],e=h.match(a),g=[],k=0;if(1<e.length){for(var n=0,p;p=e[n++];){var m=p.charCodeAt(0);if(44===m){if(0>=k){l.push(q&&g.length?{key:q,value:g.join("")}:{unknown:q||g.join("")});var q=
|
||||
k=0;g=[];continue}}else if(58===m){if(!k&&!q&&1===g.length){q=g.pop();continue}}else if(47===m&&1<p.length&&(47===p.charCodeAt(1)||42===p.charCodeAt(1)))continue;else 47===m&&n&&1<p.length?(m=e[n-1].match(b))&&!d[m[0]]&&(h=h.slice(h.indexOf(p)+1),e=h.match(a),n=-1,p="/"):40===m||123===m||91===m?++k:41===m||125===m||93===m?--k:q||g.length||34!==m&&39!==m||(p=p.slice(1,-1));g.push(p)}if(0<k)throw Error("Unbalanced parentheses, braces, or brackets");}return l};return{Oa:[],bc:f,cc:h=>{var l=[],e=(g,
|
||||
k)=>{var n=c.h[g];n?.preprocess&&!n.preprocess(k,g,e)||l.push("'"+g+"':function(){return "+(k+" }"))};f(h).forEach(g=>e(g.key||g.unknown,g.value));return l.join(",")},$b:(h,l)=>-1<h.findIndex(e=>e.key==l),Ja:(h,l,e,g,k)=>{if(h&&c.T(h))!c.yb(h)||k&&h.G()===g||h(g);else throw Error(`${e} , must be observable`);}}})();(()=>{function a(e){return 8==e.nodeType&&f.test(e.nodeValue)}function b(e){return 8==e.nodeType&&h.test(e.nodeValue)}function d(e,g){for(var k=e,n=1,p=[];k=k.nextSibling;){if(b(k)&&(c.g.j.set(k,
|
||||
l,!0),!--n))return p;p.push(k);a(k)&&++n}if(!g)throw Error("Cannot find closing comment tag to match: "+e.nodeValue);return null}var f=/^\s*ko(?:\s+([\s\S]+))?\s*$/,h=/^\s*\/ko\s*$/,l="__ko_matchedEndComment__";c.m={ba:{},childNodes:e=>a(e)?d(e):e.childNodes,la:e=>{a(e)?(e=d(e))&&[...e].forEach(g=>c.removeNode(g)):c.g.Va(e)},qa:(e,g)=>{a(e)?(c.m.la(e),e.after(...g)):c.g.qa(e,g)},prepend:(e,g)=>{a(e)?e.nextSibling.before(g):e.prepend(g)},Yb:(e,g,k)=>{k?k.after(g):c.m.prepend(e,g)},firstChild:e=>{if(a(e))return e=
|
||||
e.nextSibling,!e||b(e)?null:e;let g=e.firstChild;if(g&&b(g))throw Error("Found invalid end comment, as the first child of "+e);return g},nextSibling:e=>{if(a(e)){var g=d(e,void 0);e=g?(g.length?g[g.length-1]:e).nextSibling:null}if((g=e.nextSibling)&&b(g)){if(b(g)&&!c.g.j.get(g,l))throw Error("Found end comment without a matching opening comment, as child of "+e);return null}return g},Ub:a,ic:e=>(e=e.nodeValue.match(f))?e[1]:null}})();const ca=new Map;c.qb=new class{ac(a){switch(a.nodeType){case 1:return null!=
|
||||
a.getAttribute("data-bind");case 8:return c.m.Ub(a)}return!1}Sb(a,b){a:{switch(a.nodeType){case 1:var d=a.getAttribute("data-bind");break a;case 8:d=c.m.ic(a);break a}d=null}if(d)try{let h=ca.get(d);if(!h){var f="with($context){with($data||{}){return{"+c.P.cc(d)+"}}}";h=new Function("$context","$element",f);ca.set(d,h)}return h(b,a)}catch(h){throw h.message="Unable to parse bindings.\nBindings value: "+d+"\nMessage: "+h.message,h;}return null}};const I=Symbol("_subscribable"),L=Symbol("_ancestorBindingInfo"),
|
||||
aa=Symbol("_dataDependency"),da={},H=c.g.j.Y();c.h={};c.da=class{constructor(a,b,d,f,h){var l=this,e=a===da,g=e?void 0:a,k="function"==typeof g&&!c.T(g),n=h?.dataDependency;a=()=>{var m=k?g():g,q=c.g.i(m);b?(c.g.extend(l,b),L in b&&(l[L]=b[L])):(l.$parents=[],l.$root=q,l.ko=c);l[I]=p;e?q=l.$data:(l.$rawData=m,l.$data=q);d&&(l[d]=q);f?.(l,b,q);if(b?.[I]&&!c.u.o().Xa(b[I]))b[I]();n&&(l[aa]=n);return l.$data};if(h?.exportDependencies)a();else{var p=c.Cb(a);p.G();p.isActive()?p.ma=null:l[I]=void 0}}createChildContext(a,
|
||||
b,d,f){!f&&b&&"object"==typeof b&&(f=b,b=f.as,d=f.extend);return new c.da(a,this,b,(h,l)=>{h.$parentContext=l;h.$parent=l.$data;h.$parents=(l.$parents||[]).slice(0);h.$parents.unshift(h.$parent);d&&d(h)},f)}extend(a,b){return new c.da(da,this,null,d=>c.g.extend(d,"function"==typeof a?a(d):a),b)}};class na{constructor(a,b,d){this.I=a;this.ga=b;this.ta=new Set;this.D=!1;b.F||c.g.O.addDisposeCallback(a,W);d?.F&&(d.F.ta.add(a),this.za=d)}Bb(){this.za?.F?.Qb(this.I)}Qb(a){this.ta.delete(a);this.ta.size||
|
||||
this.tb?.()}tb(){this.D=!0;this.ga.F&&!this.ta.size&&(this.ga.F=null,c.g.O.ab(this.I,W),c.l.notify(this.I,c.l.fa),this.Bb())}}c.l={D:"childrenComplete",fa:"descendantsComplete",subscribe:(a,b,d,f,h)=>{var l=c.g.j.Wa(a,H,{});l.wa||(l.wa=new c.U);h?.notifyImmediately&&l.Ya[b]&&c.u.J(d,f,[a]);return l.wa.subscribe(d,f,b)},notify:(a,b)=>{var d=c.g.j.get(a,H);if(d&&(d.Ya[b]=!0,d.wa?.B(a,b),b==c.l.D))if(d.F)d.F.tb();else if(void 0===d.F&&d.wa?.oa(c.l.fa))throw Error("descendantsComplete event not supported for bindings on this node");
|
||||
},cb:(a,b)=>{var d=c.g.j.Wa(a,H,{});d.F||(d.F=new na(a,d,b[L]));return b[L]==d?b:b.extend(f=>{f[L]=d})}};c.hc=a=>(a=c.g.j.get(a,H))&&a.context;c.applyBindingAccessorsToNode=(a,b,d)=>Z(a,b,P(d));c.ob=(a,b)=>{1!==b.nodeType&&8!==b.nodeType||X(P(a),b)};c.nb=function(a,b,d){if(2>arguments.length){if(b=J.body,!b)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
|
||||
Y(P(a,d),b)};c.dataFor=a=>(a=a&&[1,8].includes(a.nodeType)&&c.hc(a))?a.$data:void 0;c.S("bindingHandlers",c.h);c.S("applyBindings",c.nb);(()=>{var a=Object.create(null),b=new Map;c.components={get:(l,e)=>{if(b.has(l))e(b.get(l));else{var g=a[l];g?g.subscribe(e):(g=a[l]=new c.U,g.subscribe(e),h(l,k=>{b.set(l,k);delete a[l];g.B(k)}))}},register:(l,e)=>{if(!e)throw Error("Invalid configuration for "+l);if(d[l])throw Error("Component "+l+" is already registered");d[l]=e}};var d=Object.create(null),f=
|
||||
(l,e)=>{throw Error(`Component '${l}': ${e}`);},h=(l,e)=>{var g={},k=d[l]||{},n=k.template;k=k.viewModel;if(n){n.element||f(l,"Unknown template value: "+n);n=n.element;var p=J.getElementById(n);p||f(l,"Cannot find element with ID "+n);p.matches("TEMPLATE")||f(l,"Template Source Element not a <template>");g.template=c.g.ua(p.content.childNodes)}k&&("function"!==typeof k.createViewModel&&f(l,"Unknown viewModel value: "+k),g.createViewModel=k.createViewModel);e(g.template&&g.createViewModel?g:null)}})();
|
||||
(()=>{var a=0;c.h.component={init:(b,d,f,h,l)=>{var e,g,k,n=()=>{var m=e&&e.dispose;"function"===typeof m&&m.call(e);k&&k.dispose();g=e=k=null},p=[...c.m.childNodes(b)];c.m.la(b);c.g.O.addDisposeCallback(b,n);c.o(()=>{var m=c.g.i(d());if("string"!==typeof m){var q=c.g.i(m.params);m=c.g.i(m.name)}if(!m)throw Error("No component name specified");var r=c.l.cb(b,l),t=g=++a;c.components.get(m,u=>{if(g===t){n();if(!u)throw Error("Unknown component '"+m+"'");var y=u.template;if(!y)throw Error("Component '"+
|
||||
m+"' has no template");c.m.qa(b,c.g.ua(y));e=u.createViewModel(q,{element:b,templateNodes:p});c.ob(r.createChildContext(e,{extend:w=>{w.$component=e;w.$componentTemplateNodes=p}}),b)}})},{s:b});return{controlsDescendantBindings:!0}}};c.m.ba.component=!0})();c.h.attr={update:(a,b)=>{b=c.g.i(b())||{};c.g.M(b,function(d,f){f=c.g.i(f);var h=d.indexOf(":");h="lookupNamespaceURI"in a&&0<h&&a.lookupNamespaceURI(d.slice(0,h));var l=!1===f||null==f;l?h?a.removeAttributeNS(h,d):a.removeAttribute(d):(f=f.toString(),
|
||||
h?a.setAttributeNS(h,d,f):a.setAttribute(d,f));"name"===d&&(a.name=l?"":f)})}};(()=>{c.h.checked={after:["value","attr"],init:function(a,b,d){var f="checkbox"==a.type,h="radio"==a.type;if(f||h){const m=c.Cb(()=>{if(d.has("checkedValue"))return c.g.i(d.get("checkedValue"));if(n)return d.has("value")?c.g.i(d.get("value")):a.value});var l=()=>{if(!c.u.Da()){var q=a.checked,r=m();if(q||!h&&!c.u.na()){var t=c.u.J(b);if(g){var u=k?t.G():t,y=p;p=r;y!==r?q&&(u.push(r),u.remove(y)):q?u.push(r):u.remove(r);
|
||||
k&&c.yb(t)&&t(u)}else f&&(void 0===r?r=q:q||(r=void 0)),c.P.Ja(t,d,"checked",r,!0)}}},e=b(),g=f&&c.g.i(e)instanceof Array,k=!(g&&e.push&&e.splice),n=h||g,p=g?m():void 0;h&&!a.name&&c.h.uniqueName.init(a,function(){return!0});c.o(l,null,{s:a});a.addEventListener("click",l);c.o(()=>{var q=c.g.i(b()),r=m();g?(a.checked=q.includes(r),p=r):a.checked=f&&void 0===r?!!q:m()===q},null,{s:a});e=void 0}}};c.h.checkedValue={update:function(a,b){a.value=c.g.i(b())}}})();var T=(a,b,d)=>b&&b.split(/\s+/).forEach(f=>
|
||||
a.classList.toggle(f,d));c.h.css={update:(a,b)=>{b=c.g.i(b());"object"==typeof b?c.g.M(b,(d,f)=>{f=c.g.i(f);T(a,d,!!f)}):(b=c.g.Gb(b),T(a,a.__ko__cssValue,!1),a.__ko__cssValue=b,T(a,b,!0))}};c.h.enable={update:(a,b)=>{(b=c.g.i(b()))&&a.disabled?a.removeAttribute("disabled"):b||a.disabled||(a.disabled=!0)}};c.h.disable={update:(a,b)=>c.h.enable.update(a,()=>!c.g.i(b()))};c.h.event={init:function(a,b,d,f,h){c.g.M(b()||{},l=>{"string"==typeof l&&a.addEventListener(l,(...e)=>{var g=b()[l];if(g)try{f=
|
||||
h.$data;var k=g.apply(f,[f,...e])}finally{!0!==k&&e[0].preventDefault()}})})}};c.h.foreach={zb:a=>()=>{var b=a(),d=c.T(b)?b.G():b;if(!d||"number"==typeof d.length)return{foreach:b};c.g.i(b);return{foreach:d.data,as:d.as,beforeRemove:d.beforeRemove}},init:(a,b)=>c.h.template.init(a,c.h.foreach.zb(b)),update:(a,b,d,f,h)=>c.h.template.update(a,c.h.foreach.zb(b),d,f,h)};c.P.Oa.foreach=!1;c.m.ba.foreach=!0;c.h.hasfocus={init:(a,b,d)=>{var f=l=>{a.__ko_hasfocusUpdating=!0;l=a.ownerDocument.activeElement===
|
||||
a;c.P.Ja(b(),d,"hasfocus",l,!0);a.__ko_hasfocusLastValue=l;a.__ko_hasfocusUpdating=!1},h=f.bind(null,!0);f=f.bind(null,!1);a.addEventListener("focus",h);a.addEventListener("focusin",h);a.addEventListener("blur",f);a.addEventListener("focusout",f);a.__ko_hasfocusLastValue=!1},update:(a,b)=>{b=!!c.g.i(b());a.__ko_hasfocusUpdating||a.__ko_hasfocusLastValue===b||(b?a.focus():a.blur())}};c.h.html={init:()=>({controlsDescendantBindings:!0}),update:(a,b)=>{c.g.Va(a);b=c.g.i(b());if(null!=b){const d=J.createElement("template");
|
||||
d.innerHTML="string"!=typeof b?b.toString():b;a.appendChild(d.content)}}};(()=>{function a(b,d,f){c.h[b]={init:(h,l,e,g,k)=>{var n,p={};d&&(p={as:e.get("as"),exportDependencies:!0});var m=e.has(c.l.fa);c.o(()=>{var q=c.g.i(l()),r=!f!==!q,t=!n;m&&(k=c.l.cb(h,k));if(r){p.dataDependency=c.u.o();var u=d?k.createChildContext("function"==typeof q?q:l,p):c.u.na()?k.extend(null,p):k}t&&c.u.na()&&(n=c.g.ua(c.m.childNodes(h),!0));r?(t||c.m.qa(h,c.g.ua(n)),c.ob(u,h)):(c.m.la(h),c.l.notify(h,c.l.D))},{s:h});
|
||||
return{controlsDescendantBindings:!0}}};c.P.Oa[b]=!1;c.m.ba[b]=!0}a("if");a("ifnot",!1,!0);a("with",!0)})();var U={};c.h.options={init:a=>{if(!a.matches("SELECT"))throw Error("options binding applies only to SELECT elements");let b=a.length;for(;b--;)a.remove(b);return{controlsDescendantBindings:!0}},update:(a,b,d)=>{var f=a.multiple,h=0!=a.length&&f?a.scrollTop:null,l=c.g.i(b()),e=d.get("valueAllowUnset")&&d.has("value"),g={},k=[];b=()=>Array.from(a.options).filter(r=>r.selected);var n=(r,t,u)=>
|
||||
{var y=typeof t;return"function"==y?t(r):"string"==y?r[t]:u},p=(r,t)=>{q&&e?c.l.notify(a,c.l.D):k.length&&(r=k.includes(c.C.N(t[0])),t[0].selected=r,q&&!r&&c.u.J(c.g.Ib,null,[a,"change"]))};e||(f?k=b().map(c.C.N):0<=a.selectedIndex&&k.push(c.C.N(a.options[a.selectedIndex])));if(l){"undefined"==typeof l.length&&(l=[l]);var m=l.filter(r=>r||null==r);d.has("optionsCaption")&&(l=c.g.i(d.get("optionsCaption")),null!=l&&m.unshift(U))}var q=!1;g.beforeRemove=r=>a.removeChild(r);l=p;d.has("optionsAfterRender")&&
|
||||
"function"==typeof d.get("optionsAfterRender")&&(l=(r,t)=>{p(r,t);c.u.J(d.get("optionsAfterRender"),null,[t[0],r!==U?r:void 0])});c.g.Fb(a,m,(r,t,u)=>{u.length&&(k=!e&&u[0].selected?[c.C.N(u[0])]:[],q=!0);t=a.ownerDocument.createElement("option");r===U?(c.g.bb(t,d.get("optionsCaption")),c.C.Ia(t,void 0)):(u=n(r,d.get("optionsValue"),r),c.C.Ia(t,c.g.i(u)),r=n(r,d.get("optionsText"),u),c.g.bb(t,r));return[t]},g,l);e||(m=k.length,(f?m&&b().length<m:m&&0<=a.selectedIndex?c.C.N(a.options[a.selectedIndex])!==
|
||||
k[0]:m||0<=a.selectedIndex)&&c.u.J(c.g.Ib,null,[a,"change"]));(e||c.u.Da())&&c.l.notify(a,c.l.D);h&&20<Math.abs(h-a.scrollTop)&&(a.scrollTop=h)}};c.h.options.Za=c.g.j.Y();c.h.style={update:(a,b)=>{c.g.M(c.g.i(b()||{}),(d,f)=>{f=c.g.i(f);if(null==f||!1===f)f="";if(/^--/.test(d))a.style.setProperty(d,f);else{d=d.replace(/-(\w)/g,(l,e)=>e.toUpperCase());var h=a.style[d];a.style[d]=f;f===h||a.style[d]!=h||isNaN(f)||(a.style[d]=f+"px")}})}};c.h.submit={init:(a,b,d,f,h)=>{if("function"!=typeof b())throw Error("The value for a submit binding must be a function");
|
||||
a.addEventListener("submit",l=>{var e=b();try{var g=e.call(h.$data,a)}finally{!0!==g&&l.preventDefault()}})}};c.h.text={init:()=>({controlsDescendantBindings:!0}),update:(a,b)=>{8===a.nodeType&&(a.text||a.after(a.text=J.createTextNode("")),a=a.text);c.g.bb(a,b())}};c.m.ba.text=!0;c.h.textInput={init:(a,b,d)=>{var f=a.value,h,l,e=()=>{clearTimeout(h);l=h=void 0;var k=a.value;f!==k&&(f=k,c.P.Ja(b(),d,"textInput",k))},g=()=>{var k=c.g.i(b());null==k&&(k="");void 0!==l&&k===l?setTimeout(g,4):a.value!==
|
||||
k&&(a.value=k,f=a.value)};a.addEventListener("input",e);a.addEventListener("change",e);a.addEventListener("blur",e);c.o(g,{s:a})}};c.h.textinput={preprocess:(a,b,d)=>d("textInput",a)};c.h.value={init:(a,b,d)=>{var f=a.matches("SELECT"),h=a.matches("INPUT");if(!h||"checkbox"!=a.type&&"radio"!=a.type){var l=new Set,e=d.get("valueUpdate"),g=null,k=()=>{g=null;var m=b(),q=c.C.N(a);c.P.Ja(m,d,"value",q)};e&&("string"==typeof e?l.add(e):e.forEach(m=>l.add(m)),l.delete("change"));l.forEach(m=>{var q=k;(m||
|
||||
"").startsWith("after")&&(q=()=>{g=c.C.N(a);setTimeout(k,0)},m=m.slice(5));a.addEventListener(m,q)});var n=h&&"file"==a.type?()=>{var m=c.g.i(b());null==m||""===m?a.value="":c.u.J(k)}:()=>{var m=c.g.i(b()),q=c.C.N(a);if(null!==g&&m===g)setTimeout(n,0);else if(m!==q||void 0===q)f?(q=d.get("valueAllowUnset"),c.C.Ia(a,m,q),q||m===c.C.N(a)||c.u.J(k)):c.C.Ia(a,m)};if(f){var p;c.l.subscribe(a,c.l.D,()=>{p?d.get("valueAllowUnset")?n():k():(a.addEventListener("change",k),p=c.o(n,{s:a}))},null,{notifyImmediately:!0})}else a.addEventListener("change",
|
||||
k),c.o(n,{s:a})}else c.applyBindingAccessorsToNode(a,{checkedValue:b})},update:()=>{}};c.h.visible={update:(a,b)=>{b=c.g.i(b());var d="none"!=a.style.display;b&&!d?a.style.display="":d&&!b&&(a.style.display="none")}};c.h.hidden={update:(a,b)=>a.hidden=!!c.g.i(b())};(function(a){c.h[a]={init:function(b,d,f,h,l){return c.h.event.init.call(this,b,()=>({[a]:d()}),f,h,l)}}})("click");(()=>{let a=c.g.j.Y();class b{constructor(f){this.Sa=f}Fa(...f){let h=this.Sa;if(!f.length)return c.g.j.get(h,a)||(11===
|
||||
this.I?h.content:1===this.I?h:void 0);c.g.j.set(h,a,f[0])}}class d extends b{constructor(f){super(f);f&&(this.I=f.matches("TEMPLATE")&&f.content?f.content.nodeType:1)}}c.Ga={Sa:d,Ma:b}})();(()=>{var a=(e,g,k)=>{var n;for(g=c.m.nextSibling(g);e&&(n=e)!==g;)e=c.m.nextSibling(n),k(n,e)},b=(e,g)=>{if(e.length){var k=e[0],n=k.parentNode;a(k,e[e.length-1],p=>{1!==p.nodeType&&8!==p.nodeType||c.nb(g,p)});c.g.xa(e,n)}},d=(e,g,k,n)=>{var p=(e&&(e.nodeType?e:0<e.length?e[0]:null)||k||{}).ownerDocument;if("string"==
|
||||
typeof k){p=p||J;p=p.getElementById(k);if(!p)throw Error("Cannot find template with ID "+k);k=new c.Ga.Sa(p)}else if([1,8].includes(k.nodeType))k=new c.Ga.Ma(k);else throw Error("Unknown template type: "+k);k=(k=k.Fa?k.Fa():null)?[...k.cloneNode(!0).childNodes]:null;if("number"!=typeof k.length||0<k.length&&"number"!=typeof k[0].nodeType)throw Error("Template engine must return an array of DOM nodes");p=!1;switch(g){case "replaceChildren":c.m.qa(e,k);p=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+
|
||||
g);}p&&(b(k,n),"replaceChildren"==g&&c.l.notify(e,c.l.D));return k},f=(e,g,k)=>c.T(e)?e():"function"===typeof e?e(g,k):e;c.ec=function(e,g,k,n){k=k||{};var p=p||"replaceChildren";if(n){var m=n.nodeType?n:0<n.length?n[0]:null;return c.o(()=>{var q=g instanceof c.da?g:new c.da(g,null,null,null,{exportDependencies:!0}),r=f(e,q.$data,q);d(n,p,r,q,k)},{ka:()=>!m||!c.g.Ua(m),s:m})}console.log("no targetNodeOrNodeArray")};c.fc=(e,g,k,n,p)=>{function m(w,z){c.u.J(c.g.Fb,null,[n,w,t,k,u,z]);c.l.notify(n,c.l.D)}
|
||||
var q,r=k.as,t=(w,z)=>{q=p.createChildContext(w,{as:r,extend:C=>{C.$index=z;r&&(C[r+"Index"]=z)}});w=f(e,w,q);return d(n,"ignoreTargetNode",w,q,k)},u=(w,z)=>{b(z,q);q=null};if(!k.beforeRemove&&c.isObservableArray(g)){m(g.G());var y=g.subscribe(w=>{m(g(),w)},null,"arrayChange");y.s(n);return y}return c.o(()=>{var w=c.g.i(g)||[];"undefined"==typeof w.length&&(w=[w]);m(w)},{s:n})};var h=c.g.j.Y(),l=c.g.j.Y();c.h.template={init:(e,g)=>{g=c.g.i(g());if("string"==typeof g||"name"in g)c.m.la(e);else if("nodes"in
|
||||
g){g=g.nodes||[];if(c.T(g))throw Error('The "nodes" option must be a plain, non-observable array.');let k=g[0]?.parentNode;k&&c.g.j.get(k,l)||(k=c.g.Ab(g),c.g.j.set(k,l,!0));(new c.Ga.Ma(e)).Fa(k)}else if(g=c.m.childNodes(e),g.length)g=c.g.Ab(g),(new c.Ga.Ma(e)).Fa(g);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:(e,g,k,n,p)=>{var m=g();g=c.g.i(m);k=!0;n=null;"string"==typeof g?g={}:(m="name"in g?g.name:e,"if"in g&&
|
||||
(k=c.g.i(g["if"])),k&&"ifnot"in g&&(k=!c.g.i(g.ifnot)),k&&!m&&(k=!1));"foreach"in g?n=c.fc(m,k&&g.foreach||[],g,e,p):k?(k=p,"data"in g&&(k=p.createChildContext(g.data,{as:g.as,exportDependencies:!0})),n=c.ec(m,k,g,e)):c.m.la(e);p=n;c.g.j.get(e,h)?.dispose?.();c.g.j.set(e,h,!p||p.isActive&&!p.isActive()?void 0:p)}};c.P.Oa.template=e=>{e=c.P.bc(e);return 1==e.length&&e[0].unknown||c.P.$b(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"};c.m.ba.template=
|
||||
!0})();c.g.wb=(a,b,d)=>{var f=0,h,l=b.length;l&&a.every(e=>{h=b.findIndex(g=>e.value===g.value);0<=h&&(e.moved=b[h].index,b[h].moved=e.index,b.splice(h,1),f=h=0,--l);f+=l;return l&&(!d||f<d)})};c.g.sb=(()=>{var a=(b,d,f,h,l)=>{for(var e=Math.min,g=Math.max,k=[],n=-1,p=b.length,m,q=d.length,r=q-p||1,t=p+q+1,u,y,w;++n<=p;)for(y=u,k.push(u=[]),w=e(q,n+r),m=g(0,n-1);m<=w;m++)u[m]=m?n?b[n-1]===d[m-1]?y[m-1]:e(y[m]||t,u[m-1]||t)+1:m+1:n+1;e=[];g=[];r=[];n=p;for(m=q;n||m;)q=k[n][m]-1,m&&q===k[n][m-1]?g.push(e[e.length]=
|
||||
{status:f,value:d[--m],index:m}):n&&q===k[n-1][m]?r.push(e[e.length]={status:h,value:b[--n],index:n}):(--m,--n,l.sparse||e.push({status:"retained",value:d[m]}));c.g.wb(r,g,!l.dontLimitMoves&&10*p);return e.reverse()};return(b,d,f)=>{f="boolean"===typeof f?{dontLimitMoves:f}:f||{};b=b||[];d=d||[];return b.length<d.length?a(b,d,"added","deleted",f):a(d,b,"deleted","added",f)}})();(()=>{function a(f,h,l,e,g){var k=[],n=c.o(()=>{var p=h(l,g,c.g.xa(k,f))||[];if(0<k.length){var m=k.nodeType?[k]:k;if(0<
|
||||
m.length){var q=m[0],r=q.parentNode;p.forEach(t=>r.insertBefore(t,q));m.forEach(t=>c.removeNode(t))}e&&c.u.J(e,null,[l,p,g])}k.length=0;k.push(...p)},{s:f,ka:()=>!!k.find(c.g.Ua)});return{L:k,Qa:n.isActive()?n:void 0}}var b=c.g.j.Y(),d=c.g.j.Y();c.g.Fb=(f,h,l,e,g,k)=>{h=h||[];"undefined"==typeof h.length&&(h=[h]);e=e||{};var n=c.g.j.get(f,b),p=[],m=0,q=0,r=[],t=[],u=[],y=0,w=v=>{A={ca:v,Aa:c.aa(q++)};p.push(A)},z=v=>{A=n[v];A.Aa(q++);c.g.xa(A.L,f);p.push(A)};if(n){if(!k||n&&n._countWaitingForRemove)k=
|
||||
c.g.sb(Array.prototype.map.call(n,D=>D.ca),h,{dontLimitMoves:e.dontLimitMoves,sparse:!0});let v,G;for(k.forEach(D=>{v=D.moved;G=D.index;switch(D.status){case "deleted":for(;m<G;)z(m++);void 0===v&&(A=n[m],A.Qa&&(A.Qa.dispose(),A.Qa=void 0),c.g.xa(A.L,f).length&&(e.beforeRemove&&(p.push(A),y++,A.ca===d?A=null:u[A.Aa.G()]=A),A&&r.push.apply(r,A.L)));m++;break;case "added":for(;q<G;)z(m++);void 0!==v?(t.push(p.length),z(v)):w(D.value)}});q<h.length;)z(m++);p._countWaitingForRemove=y}else h.forEach(w);
|
||||
c.g.j.set(f,b,p);r.forEach(e.beforeRemove?c.ea:c.removeNode);var C,F,M=v=>{c.m.Yb(f,v,F);F=v};k=f.ownerDocument.activeElement;if(t.length)for(;void 0!=(C=t.shift());){var A=p[C];for(F=void 0;C;)if(h=p[--C].L,h?.length){F=h[h.length-1];break}A.L.forEach(M)}p.forEach(v=>{v.L||c.g.extend(v,a(f,l,v.ca,g,v.Aa));v.L.forEach(M);!v.Xb&&g&&(g(v.ca,v.L,v.Aa),v.Xb=!0,F=v.L[v.L.length-1])});f.ownerDocument.activeElement!=k&&k?.focus();((v,G)=>{v&&G.forEach(D=>D?.L.forEach(oa=>v(oa,C,D.ca)))})(e.beforeRemove,
|
||||
u);u.forEach(v=>v&&(v.ca=d))}})();V.ko=Q})(this);
|
||||
(R=>{function L(a,b){return a===b&&a!==Object(a)}function ca(a,b){var d;return()=>{d||(d=setTimeout(()=>{d=0;a()},b))}}function da(a,b){var d;return()=>{clearTimeout(d);d=setTimeout(a,b)}}function ea(a,b){b?.dispose?.()}function fa(a,b){var d=this.Lb,e=d[x];e.X||(this.Ma&&this.va[b]?(d.kb(b,a,this.va[b]),this.va[b]=null,--this.Ma):e.v[b]||d.kb(b,a,e.A?{T:a}:d.Db(a)),a.ea&&a.Hb())}function S(a){a=c.g.l.get(a,E);var b=a?.D;b&&(a.D=null,b.xb())}function T(a,b){for(var d,e=c.m.firstChild(b);d=e;)e=c.m.nextSibling(d),
|
||||
U(a,d);c.j.notify(b,c.j.F)}function U(a,b){var d=a;if(1===b.nodeType||c.pb.Xb(b))d=V(b,null,a);d&&!b.matches?.("SCRIPT,TEXTAREA,TEMPLATE")&&T(d,b)}function ha(a){var b=[],d={},e=[];c.g.K(a,function f(l){if(!d[l]){var h=c.i[l];h&&(h.after&&(e.push(l),h.after.forEach(k=>{if(a[k]){if(e.includes(k))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", "));f(k)}}),e.length--),b.push({key:l,vb:h}));d[l]=!0}});return b}function V(a,b,d){var e=c.g.l.Ra(a,E,
|
||||
{}),g=e.Ib;if(!b){if(g)throw Error("You cannot apply bindings multiple times to the same element.");e.Ib=!0}g||(e.context=d);e.Va||(e.Va={});if(b&&"function"!==typeof b)var l=b;else{var f=c.o(()=>{if(l=b?b(d,a):c.pb.Ob(a,d))d[F]?.(),d[W]?.();return l},{s:a});l&&f.isActive()||(f=null)}var h=d,k;if(l){var n=f?m=>()=>f()[m]():m=>l[m],p={get:m=>l[m]&&n(m)(),has:m=>m in l};c.j.F in l&&c.j.subscribe(a,c.j.F,()=>{var m=l[c.j.F]();if(m){var q=c.m.childNodes(a);q.length&&m(q,c.dataFor(q[0]))}});c.j.ca in l&&
|
||||
(h=c.j.$a(a,d),c.j.subscribe(a,c.j.ca,()=>{var m=l[c.j.ca]();m&&c.m.firstChild(a)&&m(a)}));ha(l).forEach(m=>{var q=m.vb.init,r=m.vb.update,t=m.key;if(8===a.nodeType&&!c.m.aa[t])throw Error("The binding '"+t+"' cannot be used with comment nodes");try{"function"==typeof q&&c.u.I(()=>{var u=q(a,n(t),p,h.$data,h);if(u&&u.controlsDescendantBindings){if(void 0!==k)throw Error("Multiple bindings ("+k+" and "+t+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
|
||||
k=t}}),"function"==typeof r&&c.o(()=>r(a,n(t),p,h.$data,h),{s:a})}catch(u){throw u.message='Unable to process binding "'+t+": "+l[t]+'"\nMessage: '+u.message,u;}})}return void 0===k&&h}function M(a,b){return a&&a instanceof c.ba?a:new c.ba(a,null,b)}var G=R.document,N={},c="undefined"!==typeof N?N:{};c.P=(a,b)=>{a=a.split(".");for(var d=c,e=0,g=a.length-1;e<g;e++)d=d[a[e]];d[a[g]]=b};c.g={extend:(a,b)=>b?Object.assign(a,b):a,K:(a,b)=>a&&Object.entries(a).forEach(d=>b(d[0],d[1])),Qa:a=>[...a.childNodes].forEach(b=>
|
||||
c.removeNode(b)),Wb:a=>{a=[...a];var b=(a[0]?.ownerDocument||G).createElement("div");a.forEach(d=>b.append(c.ha(d)));return b},ua:(a,b)=>Array.prototype.map.call(a,b?d=>c.ha(d.cloneNode(!0)):d=>d.cloneNode(!0)),pa:(a,b)=>{c.g.Qa(a);b&&a.append(...b)},xa:(a,b)=>{if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)--a.length;if(1<a.length){b=a[0];var d=a[a.length-1];for(a.length=0;b!==d;)a.push(b),b=b.nextSibling;
|
||||
a.push(d)}}return a},Cb:a=>null==a?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,""),Pa:a=>a.ownerDocument.documentElement.contains(1!==a.nodeType?a.parentNode:a),Eb:(a,b)=>{if(!a?.nodeType)throw Error("element must be a DOM node when calling triggerEvent");a.dispatchEvent(new Event(b))},h:a=>c.W(a)?a():a,Za:(a,b)=>a.textContent=c.g.h(b)};c.P("utils",c.g);c.P("unwrap",c.g.h);(()=>{let a=0,b="__ko__"+Date.now(),d=new WeakMap;c.g.l={get:(e,g)=>(d.get(e)||{})[g],set:(e,g,l)=>{d.has(e)?
|
||||
d.get(e)[g]=l:d.set(e,{[g]:l});return l},Ra(e,g,l){return this.get(e,g)||this.set(e,g,l)},clear:e=>d.delete(e),Z:()=>a++ +b}})();c.g.N=(()=>{var a=c.g.l.Z(),b={1:1,8:1,9:1},d={1:1,9:1};const e=(f,h)=>{var k=c.g.l.get(f,a);h&&!k&&(k=new Set,c.g.l.set(f,a,k));return k},g=f=>{var h=e(f);h&&(new Set(h)).forEach(k=>k(f));c.g.l.clear(f);d[f.nodeType]&&l(f.childNodes,!0)},l=(f,h)=>{for(var k=[],n,p=0;p<f.length;p++)if(!h||8===f[p].nodeType)if(g(k[k.length]=n=f[p]),f[p]!==n)for(;p--&&!k.includes(f[p]););
|
||||
};return{addDisposeCallback:(f,h)=>{if("function"!=typeof h)throw Error("Callback must be a function");e(f,1).add(h)},Ya:(f,h)=>{var k=e(f);k&&(k.delete(h),k.size||c.g.l.set(f,a,null))},ha:f=>{c.u.I(()=>{b[f.nodeType]&&(g(f),d[f.nodeType]&&l(f.getElementsByTagName("*")))});return f},removeNode:f=>{c.ha(f);f.parentNode&&f.parentNode.removeChild(f)}}})();c.ha=c.g.N.ha;c.removeNode=c.g.N.removeNode;c.P("utils.domNodeDisposal",c.g.N);c.extenders={debounce:(a,b)=>a.Da(d=>da(d,b)),rateLimit:(a,b)=>a.Da(d=>
|
||||
ca(d,b)),notify:(a,b)=>{a.ka="always"==b?null:L}};class ia{constructor(a,b,d){this.T=a;this.eb=b;this.za=d;this.Ha=!1;this.H=this.da=null}dispose(){this.Ha||(this.H&&c.g.N.Ya(this.da,this.H),this.Ha=!0,this.za(),this.T=this.eb=this.za=this.da=this.H=null)}s(a){this.da=a;c.g.N.addDisposeCallback(a,this.H=this.dispose.bind(this))}}c.R=function(){Object.setPrototypeOf(this,O);O.init(this)};var O={init:a=>{a.S=new Map;a.S.set("change",new Set);a.jb=1},subscribe:function(a,b,d){var e=this;d=d||"change";
|
||||
var g=new ia(e,b?a.bind(b):a,()=>{e.S.get(d).delete(g);e.Ia?.(d)});e.Ja?.(d);e.S.has(d)||e.S.set(d,new Set);e.S.get(d).add(g);return g},B(a,b){b=b||"change";"change"===b&&this.Ea();if(this.na(b)){b="change"===b&&this.Fb||new Set(this.S.get(b));try{c.u.ob(),b.forEach(d=>{d.Ha||d.eb(a)})}finally{c.u.end()}}},ya(){return this.jb},Rb(a){return this.ya()!==a},Ea(){++this.jb},Da(a){var b=this,d=c.W(b),e,g,l,f,h;b.ra||(b.ra=b.B,b.B=(n,p)=>{p&&"change"!==p?"beforeChange"===p?b.gb(n):b.ra(n,p):b.hb(n)});var k=
|
||||
a(()=>{b.ea=!1;d&&f===b&&(f=b.fb?b.fb():b());var n=g||h&&b.Ba(l,f);h=g=e=!1;n&&b.ra(l=f)});b.hb=(n,p)=>{p&&b.ea||(h=!p);b.Fb=new Set(b.S.get("change"));b.ea=e=!0;f=n;k()};b.gb=n=>{e||(l=n,b.ra(n,"beforeChange"))};b.ib=()=>{h=!0};b.Hb=()=>{b.Ba(l,b.L(!0))&&(g=!0)}},na(a){return(this.S.get(a)||[]).size},Ba(a,b){return!this.ka||!this.ka(a,b)},toString:()=>"[object Object]",extend:function(a){var b=this;a&&c.g.K(a,(d,e)=>{d=c.extenders[d];"function"==typeof d&&(b=d(b,e)||b)});return b}};c.R.fn=Object.setPrototypeOf(O,
|
||||
Function.prototype);c.Vb=a=>"function"==typeof a?.subscribe&&"function"==typeof a.B;(()=>{let a=[],b,d=0;c.u={ob:e=>{a.push(b);b=e},end:()=>b=a.pop(),Ab:e=>{if(b){if(!c.Vb(e))throw Error("Only subscribable things can act as dependencies");b.Jb.call(b.Kb,e,e.Gb||(e.Gb=++d))}},I(e,g,l){try{return a.push(b),b=void 0,e.apply(g,l||[])}finally{b=a.pop()}},ma:()=>b?.o.ma(),Ca:()=>b?.Ca,o:()=>b?.o}})();const B=Symbol("_latestValue");c.$=a=>{function b(){if(0<arguments.length)return b.Ba(b[B],arguments[0])&&
|
||||
(b.cb(),b[B]=arguments[0],b.valueHasMutated()),this;c.u.Ab(b);return b[B]}b[B]=a;Object.defineProperty(b,"length",{get:()=>null==b[B]?void 0:b[B].length});c.R.fn.init(b);return Object.setPrototypeOf(b,H)};var H={toJSON:function(){let a=this[B];return a?.toJSON?.()||a},ka:L,L(){return this[B]},valueHasMutated:function(){this.B(this[B],"spectate");this.B(this[B])},cb(){this.B(this[B],"beforeChange")}};Object.setPrototypeOf(H,c.R.fn);var D=c.$.Zb="__ko_proto__";H[D]=c.$;c.W=a=>{if((a="function"==typeof a&&
|
||||
a[D])&&a!==H[D]&&a!==c.o.fn[D])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!a};c.wb=a=>"function"==typeof a&&(a[D]===H[D]||a[D]===c.o.fn[D]&&a.Sb);c.P("observable",c.$);c.P("isObservable",c.W);c.P("observable.fn",H);c.observableArray=a=>{a=a||[];if(!Array.isArray(a))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return Object.setPrototypeOf(c.$(a),c.observableArray.fn).extend({trackArrayChanges:!0})};
|
||||
const X=Symbol("IS_OBSERVABLE_ARRAY");c.observableArray.fn=Object.setPrototypeOf({[X]:1,remove:function(a){for(var b=this.L(),d=!1,e="function"!=typeof a||c.W(a)?f=>f===a:a,g=b.length;g--;){var l=b[g];if(e(l)){if(b[g]!==l)throw Error("Array modified during remove; cannot remove item");d||this.cb();d=!0;b.splice(g,1)}}d&&this.valueHasMutated()}},c.$.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)?
|
||||
c.observableArray.fn[a]=function(...b){var d=this.L();this.cb();this.qb(d,a,b);b=d[a](...b);this.valueHasMutated();return b===d?this:b}:c.observableArray.fn[a]=function(...b){return this()[a](...b)})});c.isObservableArray=a=>!(!a||!a[X]);c.extenders.trackArrayChanges=(a,b)=>{function d(){if(k){var q=[].concat(a.L()||[]);if(a.na("arrayChange")){if(!l||1<k)l=c.g.rb(n,q,a.Ka);var r=l}n=q;l=null;k=0;r?.length&&a.B(r,"arrayChange")}}function e(){g?d():(g=!0,h=a.subscribe(()=>++k,null,"spectate"),n=[].concat(a.L()||
|
||||
[]),l=null,f=a.subscribe(d))}a.Ka={};"object"==typeof b&&c.g.extend(a.Ka,b);a.Ka.sparse=!0;if(!a.qb){var g=!1,l=null,f,h,k=0,n,p=a.Ja,m=a.Ia;a.Ja=q=>{p?.call(a,q);"arrayChange"===q&&e()};a.Ia=q=>{m?.call(a,q);"arrayChange"!==q||a.na("arrayChange")||(f?.dispose(),h?.dispose(),h=f=null,g=!1,n=void 0)};a.qb=(q,r,t)=>{if(g&&!k){var u=[],y=q.length,v=t.length,z=0,A=(ja,ka,la)=>u[u.length]={status:ja,value:ka,index:la};switch(r){case "push":z=y;case "unshift":for(q=0;q<v;++q)A("added",t[q],z+q);break;case "pop":z=
|
||||
y-1;case "shift":y&&A("deleted",q[z],z);break;case "splice":z=Math.min(Math.max(0,0>t[0]?y+t[0]:t[0]),y);y=1===v?y:Math.min(z+(t[1]||0),y);v=z+v-2;r=Math.max(y,v);for(var w=[],I=[],C=2;z<r;++z,++C)z<y&&I.push(A("deleted",q[z],z)),z<v&&w.push(A("added",t[C],z));c.g.ub(I,w);break;default:return}l=u}}}};var x=Symbol("_state");c.o=(a,b)=>{function d(){if(0<arguments.length){if("function"!==typeof e)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.");
|
||||
e(...arguments);return this}g.X||c.u.Ab(d);(g.V||g.A&&d.oa())&&d.U();return g.J}"object"===typeof a?b=a:(b=b||{},a&&(b.read=a));if("function"!=typeof b.read)throw Error("Pass a function that returns the value of the ko.computed");var e=b.write,g={J:void 0,Y:!0,V:!0,Aa:!1,ab:!1,X:!1,Xa:!1,A:!1,zb:b.read,s:b.s||null,ia:b.ia,Oa:null,v:{},G:0,bc:null};d[x]=g;d.Sb="function"===typeof e;c.R.fn.init(d);Object.setPrototypeOf(d,K);b.pure&&(g.Xa=!0,g.A=!0,c.g.extend(d,ma));g.s&&(g.ab=!0,g.s.nodeType||(g.s=
|
||||
null));g.A||d.U();g.s&&d.isActive()&&c.g.N.addDisposeCallback(g.s,g.Oa=()=>{d.dispose()});return d};var K={ka:L,ma(){return this[x].G},Pb(){var a=[];c.g.K(this[x].v,(b,d)=>a[d.fa]=d.T);return a},Sa(a){if(!this[x].G)return!1;var b=this.Pb();return b.includes(a)||!!b.find(d=>d.Sa&&d.Sa(a))},kb(a,b,d){if(this[x].Xa&&b===this)throw Error("A 'pure' computed must not be called recursively");this[x].v[a]=d;d.fa=this[x].G++;d.ga=b.ya()},oa(){var a,b=this[x].v;for(a in b)if(Object.prototype.hasOwnProperty.call(b,
|
||||
a)){var d=b[a];if(this.qa&&d.T.ea||d.T.Rb(d.ga))return!0}},dc(){this[x].Aa||this.qa?.(!1)},isActive(){var a=this[x];return a.V||0<a.G},fc(){this.ea?this[x].V&&(this[x].Y=!0):this.tb()},Db(a){return a.subscribe(this.tb,this)},tb(){this.qa?this.qa(!0):this.U(!0)},U(a){var b=this[x],d=b.ia,e=!1;if(!b.Aa&&!b.X){if(b.s&&!c.g.Pa(b.s)||d?.()){if(!b.ab){this.dispose();return}}else b.ab=!1;try{b.Aa=!0,e=this.Nb(a)}finally{b.Aa=!1}return e}},Nb(a){var b=this[x],d=b.Xa?void 0:!b.G;var e={Lb:this,va:b.v,Ma:b.G};
|
||||
c.u.ob({Kb:e,Jb:fa,o:this,Ca:d});b.v={};b.G=0;a:{try{var g=b.zb();break a}finally{c.u.end(),e.Ma&&!b.A&&c.g.K(e.va,ea),b.Y=b.V=!1}g=void 0}b.G?e=this.Ba(b.J,g):(this.dispose(),e=!0);e&&(b.A?this.Ea():this.B(b.J,"beforeChange"),b.J=g,this.B(b.J,"spectate"),!b.A&&a&&this.B(b.J),this.ib&&this.ib());d&&this.B(b.J,"awake");return e},L(a){var b=this[x];(b.V&&(a||!b.G)||b.A&&this.oa())&&this.U();return b.J},Da(a){var b=this;c.R.fn.Da.call(b,a);b.fb=()=>{b[x].A||(b[x].Y?b.U():b[x].V=!1);return b[x].J};b.qa=
|
||||
d=>{b.gb(b[x].J);b[x].V=!0;d&&(b[x].Y=!0);b.hb(b,!d)}},dispose:function(){var a=this[x];!a.A&&a.v&&c.g.K(a.v,(b,d)=>d.dispose?.());a.s&&a.Oa&&c.g.N.Ya(a.s,a.Oa);a.v=void 0;a.G=0;a.X=!0;a.Y=!1;a.V=!1;a.A=!1;a.s=void 0;a.ia=void 0;a.zb=void 0}},ma={Ja(a){var b=this,d=b[x];if(!d.X&&d.A&&"change"==a){d.A=!1;if(d.Y||b.oa())d.v=null,d.G=0,b.U()&&b.Ea();else{var e=[];c.g.K(d.v,(g,l)=>e[l.fa]=g);e.forEach((g,l)=>{var f=d.v[g],h=b.Db(f.T);h.fa=l;h.ga=f.ga;d.v[g]=h});b.oa()&&b.U()&&b.Ea()}d.X||b.B(d.J,"awake")}},
|
||||
Ia(a){var b=this[x];b.X||"change"!=a||this.na("change")||(c.g.K(b.v,(d,e)=>{e.dispose&&(b.v[d]={T:e.T,fa:e.fa,ga:e.ga},e.dispose())}),b.A=!0,this.B(void 0,"asleep"))},ya(){var a=this[x];a.A&&(a.Y||this.oa())&&this.U();return c.R.fn.ya.call(this)}};Object.setPrototypeOf(K,c.R.fn);var P=c.$.Zb;K[P]=c.o;c.o.fn=K;c.P("computed",c.o);c.isComputed=a=>"function"==typeof a&&a[P]===K[P];c.yb=a=>{if("function"===typeof a)return c.o(a,{pure:!0});a={...a,pure:!0};return c.o(a)};c.C={M:a=>{switch(a.nodeName){case "OPTION":return!0===
|
||||
a.__ko__hasDomDataOptionValue__?c.g.l.get(a,c.i.options.Wa):a.value;case "SELECT":return 0<=a.selectedIndex?c.C.M(a.options[a.selectedIndex]):void 0;default:return a.value}},Fa:(a,b)=>{switch(a.nodeName){case "OPTION":"string"===typeof b?(c.g.l.set(a,c.i.options.Wa,void 0),delete a.__ko__hasDomDataOptionValue__,a.value=b):(c.g.l.set(a,c.i.options.Wa,b),a.__ko__hasDomDataOptionValue__=!0,a.value="number"===typeof b?b:"");break;case "SELECT":for(var d=-1,e=""===b||null==b,g=a.options.length,l;g--;)if(l=
|
||||
c.C.M(a.options[g]),l==b||""===l&&e){d=g;break}if(0<=d||e&&1<a.size)a.selectedIndex=d;break;default:a.value=null==b?"":b}}};c.la=(()=>{var a=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),b=/[\])"'A-Za-z0-9_$]+$/,d={"in":1,"return":1,"typeof":1},e=g=>{g=c.g.Cb(g);123===g.charCodeAt(0)&&(g=g.slice(1,-1));g+="\n,";var l=[],f=g.match(a),h=[],k=0;if(1<f.length){for(var n=
|
||||
0,p;p=f[n++];){var m=p.charCodeAt(0);if(44===m){if(0>=k){l.push(q&&h.length?{key:q,value:h.join("")}:{unknown:q||h.join("")});var q=k=0;h=[];continue}}else if(58===m){if(!k&&!q&&1===h.length){q=h.pop();continue}}else if(47===m&&1<p.length&&(47===p.charCodeAt(1)||42===p.charCodeAt(1)))continue;else 47===m&&n&&1<p.length?(m=f[n-1].match(b))&&!d[m[0]]&&(g=g.slice(g.indexOf(p)+1),f=g.match(a),n=-1,p="/"):40===m||123===m||91===m?++k:41===m||125===m||93===m?--k:q||h.length||34!==m&&39!==m||(p=p.slice(1,
|
||||
-1));h.push(p)}if(0<k)throw Error("Unbalanced parentheses, braces, or brackets");}return l};return{ec:e,Yb:g=>{var l=[];e(g).forEach(f=>{l.push("'"+(f.key||f.unknown)+"':function(){return "+(f.value+" }"))});return l.join(",")},cc:(g,l)=>-1<g.findIndex(f=>f.key==l),Ga:(g,l,f,h,k)=>{if(g&&c.W(g))!c.wb(g)||k&&g.L()===h||g(h);else throw Error(`${f} , must be observable`);}}})();(()=>{function a(f){return 8==f.nodeType&&e.test(f.nodeValue)}function b(f){return 8==f.nodeType&&g.test(f.nodeValue)}function d(f,
|
||||
h){for(var k=f,n=1,p=[];k=k.nextSibling;){if(b(k)&&(c.g.l.set(k,l,!0),!--n))return p;p.push(k);a(k)&&++n}if(!h)throw Error("Cannot find closing comment tag to match: "+f.nodeValue);return null}var e=/^\s*ko(?:\s+([\s\S]+))?\s*$/,g=/^\s*\/ko\s*$/,l="__ko_matchedEndComment__";c.m={aa:{},childNodes:f=>a(f)?d(f):f.childNodes,ja:f=>{a(f)?(f=d(f))&&[...f].forEach(h=>c.removeNode(h)):c.g.Qa(f)},pa:(f,h)=>{a(f)?(c.m.ja(f),f.after(...h)):c.g.pa(f,h)},prepend:(f,h)=>{a(f)?f.nextSibling.before(h):f.prepend(h)},
|
||||
Ub:(f,h,k)=>{k?k.after(h):c.m.prepend(f,h)},firstChild:f=>{if(a(f))return f=f.nextSibling,!f||b(f)?null:f;let h=f.firstChild;if(h&&b(h))throw Error("Found invalid end comment, as the first child of "+f);return h},nextSibling:f=>{if(a(f)){var h=d(f,void 0);f=h?(h.length?h[h.length-1]:f).nextSibling:null}if((h=f.nextSibling)&&b(h)){if(b(h)&&!c.g.l.get(h,l))throw Error("Found end comment without a matching opening comment, as child of "+f);return null}return h},Qb:a,ac:f=>(f=f.nodeValue.match(e))?f[1]:
|
||||
null}})();const Y=new Map;c.pb=new class{Xb(a){switch(a.nodeType){case 1:return null!=a.getAttribute("data-bind");case 8:return c.m.Qb(a)}return!1}Ob(a,b){a:{switch(a.nodeType){case 1:var d=a.getAttribute("data-bind");break a;case 8:d=c.m.ac(a);break a}d=null}if(d)try{let g=Y.get(d);if(!g){var e="with($context){with($data||{}){return{"+c.la.Yb(d)+"}}}";g=new Function("$context","$element",e);Y.set(d,g)}return g(b,a)}catch(g){throw g.message="Unable to parse bindings.\nBindings value: "+d+"\nMessage: "+
|
||||
g.message,g;}return null}};const F=Symbol("_subscribable"),J=Symbol("_ancestorBindingInfo"),W=Symbol("_dataDependency"),Z={},E=c.g.l.Z();c.i={};c.ba=class{constructor(a,b,d,e){var g=this,l=a===Z,f=l?void 0:a,h="function"==typeof f&&!c.W(f),k=e?.dataDependency;a=()=>{var p=h?f():f;p=c.g.h(p);b?(c.g.extend(g,b),J in b&&(g[J]=b[J])):(g.$root=p,g.ko=c);g[F]=n;l?p=g.$data:g.$data=p;d?.(g,b,p);if(b?.[F]&&!c.u.o().Sa(b[F]))b[F]();k&&(g[W]=k);return g.$data};if(e?.exportDependencies)a();else{var n=c.yb(a);
|
||||
n.L();n.isActive()?n.ka=null:g[F]=void 0}}createChildContext(a,b){return new c.ba(a,this,(d,e)=>{d.$parent=e.$data;b.extend?.(d)},b)}extend(a,b){return new c.ba(Z,this,d=>c.g.extend(d,"function"==typeof a?a(d):a),b)}};class na{constructor(a,b,d){this.H=a;this.da=b;this.ta=new Set;this.F=!1;b.D||c.g.N.addDisposeCallback(a,S);d?.D&&(d.D.ta.add(a),this.za=d)}xb(){this.za?.D?.Mb(this.H)}Mb(a){this.ta.delete(a);this.ta.size||this.sb?.()}sb(){this.F=!0;this.da.D&&!this.ta.size&&(this.da.D=null,c.g.N.Ya(this.H,
|
||||
S),c.j.notify(this.H,c.j.ca),this.xb())}}c.j={F:"childrenComplete",ca:"descendantsComplete",subscribe:(a,b,d,e,g)=>{var l=c.g.l.Ra(a,E,{});l.wa||(l.wa=new c.R);g?.notifyImmediately&&l.Va[b]&&c.u.I(d,e,[a]);return l.wa.subscribe(d,e,b)},notify:(a,b)=>{var d=c.g.l.get(a,E);if(d&&(d.Va[b]=!0,d.wa?.B(a,b),b==c.j.F))if(d.D)d.D.sb();else if(void 0===d.D&&d.wa?.na(c.j.ca))throw Error("descendantsComplete event not supported for bindings on this node");},$a:(a,b)=>{var d=c.g.l.Ra(a,E,{});d.D||(d.D=new na(a,
|
||||
d,b[J]));return b[J]==d?b:b.extend(e=>{e[J]=d})}};c.$b=a=>(a=c.g.l.get(a,E))&&a.context;c.applyBindingAccessorsToNode=(a,b,d)=>V(a,b,M(d));c.nb=(a,b)=>{1!==b.nodeType&&8!==b.nodeType||T(M(a),b)};c.mb=function(a,b,d){if(2>arguments.length){if(b=G.body,!b)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
|
||||
U(M(a,d),b)};c.dataFor=a=>(a=a&&[1,8].includes(a.nodeType)&&c.$b(a))?a.$data:void 0;c.P("bindingHandlers",c.i);c.P("applyBindings",c.mb);(()=>{var a=Object.create(null),b=new Map;c.components={get:(l,f)=>{if(b.has(l))f(b.get(l));else{var h=a[l];h?h.subscribe(f):(h=a[l]=new c.R,h.subscribe(f),g(l,k=>{b.set(l,k);delete a[l];h.B(k)}))}},register:(l,f)=>{if(!f)throw Error("Invalid configuration for "+l);if(d[l])throw Error("Component "+l+" is already registered");d[l]=f}};var d=Object.create(null),e=
|
||||
(l,f)=>{throw Error(`Component '${l}': ${f}`);},g=(l,f)=>{var h={},k=d[l]||{},n=k.template;k=k.viewModel;if(n){n.element||e(l,"Unknown template value: "+n);n=n.element;var p=G.getElementById(n);p||e(l,"Cannot find element with ID "+n);p.matches("TEMPLATE")||e(l,"Template Source Element not a <template>");h.template=c.g.ua(p.content.childNodes)}k&&("function"!==typeof k.createViewModel&&e(l,"Unknown viewModel value: "+k),h.createViewModel=k.createViewModel);f(h.template&&h.createViewModel?h:null)}})();
|
||||
(()=>{var a=0;c.i.component={init:(b,d,e,g,l)=>{var f,h,k,n=()=>{var p=f&&f.dispose;"function"===typeof p&&p.call(f);k&&k.dispose();h=f=k=null};c.m.ja(b);c.g.N.addDisposeCallback(b,n);c.o(()=>{var p=c.g.h(d());if("string"!==typeof p){var m=c.g.h(p.params);p=c.g.h(p.name)}if(!p)throw Error("No component name specified");var q=c.j.$a(b,l),r=h=++a;c.components.get(p,t=>{if(h===r){n();if(!t)throw Error("Unknown component '"+p+"'");var u=t.template;if(!u)throw Error("Component '"+p+"' has no template");
|
||||
c.m.pa(b,c.g.ua(u));f=t.createViewModel(m,{element:b});c.nb(q.createChildContext(f,{}),b)}})},{s:b});return{controlsDescendantBindings:!0}}};c.m.aa.component=!0})();c.i.attr={update:(a,b)=>{b=c.g.h(b())||{};c.g.K(b,function(d,e){e=c.g.h(e);var g=d.indexOf(":");g="lookupNamespaceURI"in a&&0<g&&a.lookupNamespaceURI(d.slice(0,g));!1===e||null==e?g?a.removeAttributeNS(g,d):a.removeAttribute(d):(e=e.toString(),g?a.setAttributeNS(g,d,e):a.setAttribute(d,e))})}};(()=>{c.i.checked={after:["value","attr"],
|
||||
init:function(a,b,d){var e="checkbox"==a.type,g="radio"==a.type;if(e||g){const m=c.yb(()=>{if(d.has("checkedValue"))return c.g.h(d.get("checkedValue"));if(n)return d.has("value")?c.g.h(d.get("value")):a.value});var l=()=>{if(!c.u.Ca()){var q=a.checked,r=m();if(q||!g&&!c.u.ma()){var t=c.u.I(b);if(h){var u=k?t.L():t,y=p;p=r;y!==r?q&&(u.push(r),u.remove(y)):q?u.push(r):u.remove(r);k&&c.wb(t)&&t(u)}else e&&(void 0===r?r=q:q||(r=void 0)),c.la.Ga(t,d,"checked",r,!0)}}},f=b(),h=e&&c.g.h(f)instanceof Array,
|
||||
k=!(h&&f.push&&f.splice),n=g||h,p=h?m():void 0;c.o(l,null,{s:a});a.addEventListener("click",l);c.o(()=>{var q=c.g.h(b()),r=m();h?(a.checked=q.includes(r),p=r):a.checked=e&&void 0===r?!!q:m()===q},null,{s:a});f=void 0}}};c.i.checkedValue={update:function(a,b){a.value=c.g.h(b())}}})();var Q=(a,b,d)=>b&&b.split(/\s+/).forEach(e=>a.classList.toggle(e,d));c.i.css={update:(a,b)=>{b=c.g.h(b());"object"==typeof b?c.g.K(b,(d,e)=>{e=c.g.h(e);Q(a,d,!!e)}):(b=c.g.Cb(b),Q(a,a.__ko__cssValue,!1),a.__ko__cssValue=
|
||||
b,Q(a,b,!0))}};c.i.enable={update:(a,b)=>{(b=c.g.h(b()))&&a.disabled?a.removeAttribute("disabled"):b||a.disabled||(a.disabled=!0)}};c.i.disable={update:(a,b)=>c.i.enable.update(a,()=>!c.g.h(b()))};c.i.event={init:function(a,b,d,e,g){c.g.K(b()||{},l=>{"string"==typeof l&&a.addEventListener(l,(...f)=>{var h=b()[l];if(h)try{e=g.$data;var k=h.apply(e,[e,...f])}finally{!0!==k&&f[0].preventDefault()}})})}};const aa=a=>()=>{var b=a(),d=c.W(b)?b.L():b;if(!d||Array.isArray(d))return{foreach:b};c.g.h(b);return{foreach:d.data}};
|
||||
c.i.foreach={init:(a,b)=>c.i.template.init(a,aa(b)),update:(a,b,d,e,g)=>c.i.template.update(a,aa(b),d,e,g)};c.m.aa.foreach=!0;c.i.hasfocus={init:(a,b,d)=>{var e=l=>{a.__ko_hasfocusUpdating=!0;l=a.ownerDocument.activeElement===a;c.la.Ga(b(),d,"hasfocus",l,!0);a.__ko_hasfocusLastValue=l;a.__ko_hasfocusUpdating=!1},g=e.bind(null,!0);e=e.bind(null,!1);a.addEventListener("focus",g);a.addEventListener("focusin",g);a.addEventListener("blur",e);a.addEventListener("focusout",e);a.__ko_hasfocusLastValue=!1},
|
||||
update:(a,b)=>{b=!!c.g.h(b());a.__ko_hasfocusUpdating||a.__ko_hasfocusLastValue===b||(b?a.focus():a.blur())}};c.i.html={init:()=>({controlsDescendantBindings:!0}),update:(a,b)=>{c.g.Qa(a);b=c.g.h(b());if(null!=b){const d=G.createElement("template");d.innerHTML="string"!=typeof b?b.toString():b;a.appendChild(d.content)}}};(()=>{function a(b,d,e){c.i[b]={init:(g,l,f,h,k)=>{var n,p={};d&&(p={exportDependencies:!0});var m=f.has(c.j.ca);c.o(()=>{var q=c.g.h(l()),r=!e!==!q,t=!n;m&&(k=c.j.$a(g,k));if(r){p.dataDependency=
|
||||
c.u.o();var u=d?k.createChildContext("function"==typeof q?q:l,p):c.u.ma()?k.extend(null,p):k}t&&c.u.ma()&&(n=c.g.ua(c.m.childNodes(g),!0));r?(t||c.m.pa(g,c.g.ua(n)),c.nb(u,g)):(c.m.ja(g),c.j.notify(g,c.j.F))},{s:g});return{controlsDescendantBindings:!0}}};c.m.aa[b]=!0}a("if");a("ifnot",!1,!0);a("with",!0)})();var ba={};c.i.options={init:a=>{if(!a.matches("SELECT"))throw Error("options binding applies only to SELECT elements");let b=a.length;for(;b--;)a.remove(b);return{controlsDescendantBindings:!0}},
|
||||
update:(a,b,d)=>{var e=a.multiple,g=0!=a.length&&e?a.scrollTop:null,l=c.g.h(b()),f=[];b=()=>Array.from(a.options).filter(m=>m.selected);var h=(m,q,r)=>{var t=typeof q;return"function"==t?q(m):"string"==t?m[q]:r},k=(m,q)=>{f.length&&(m=f.includes(c.C.M(q[0])),q[0].selected=m,p&&!m&&c.u.I(c.g.Eb,null,[a,"change"]))};e?f=b().map(c.C.M):0<=a.selectedIndex&&f.push(c.C.M(a.options[a.selectedIndex]));if(l){Array.isArray(l)||(l=[l]);var n=l.filter(m=>m||null==m)}var p=!1;l=k;d.has("optionsAfterRender")&&
|
||||
"function"==typeof d.get("optionsAfterRender")&&(l=(m,q)=>{k(m,q);c.u.I(d.get("optionsAfterRender"),null,[q[0],m!==ba?m:void 0])});c.g.Bb(a,n,(m,q,r)=>{r.length&&(f=r[0].selected?[c.C.M(r[0])]:[],p=!0);q=a.ownerDocument.createElement("option");m===ba?(c.g.Za(q),c.C.Fa(q,void 0)):(r=h(m,d.get("optionsValue"),m),c.C.Fa(q,c.g.h(r)),m=h(m,d.get("optionsText"),r),c.g.Za(q,m));return[q]},{},l);n=f.length;(e?n&&b().length<n:n&&0<=a.selectedIndex?c.C.M(a.options[a.selectedIndex])!==f[0]:n||0<=a.selectedIndex)&&
|
||||
c.u.I(c.g.Eb,null,[a,"change"]);c.u.Ca()&&c.j.notify(a,c.j.F);g&&20<Math.abs(g-a.scrollTop)&&(a.scrollTop=g)}};c.i.options.Wa=c.g.l.Z();c.i.style={update:(a,b)=>{c.g.K(c.g.h(b()||{}),(d,e)=>{e=c.g.h(e);if(null==e||!1===e)e="";if(/^--/.test(d))a.style.setProperty(d,e);else{d=d.replace(/-(\w)/g,(l,f)=>f.toUpperCase());var g=a.style[d];a.style[d]=e;e===g||a.style[d]!=g||isNaN(e)||(a.style[d]=e+"px")}})}};c.i.submit={init:(a,b,d,e,g)=>{if("function"!=typeof b())throw Error("The value for a submit binding must be a function");
|
||||
a.addEventListener("submit",l=>{var f=b();try{var h=f.call(g.$data,a)}finally{!0!==h&&l.preventDefault()}})}};c.i.text={init:()=>({controlsDescendantBindings:!0}),update:(a,b)=>{8===a.nodeType&&(a.text||a.after(a.text=G.createTextNode("")),a=a.text);c.g.Za(a,b())}};c.m.aa.text=!0;c.i.textInput={init:(a,b,d)=>{var e=a.value,g,l,f=()=>{clearTimeout(g);l=g=void 0;var k=a.value;e!==k&&(e=k,c.la.Ga(b(),d,"textInput",k))},h=()=>{var k=c.g.h(b());null==k&&(k="");void 0!==l&&k===l?setTimeout(h,4):a.value!==
|
||||
k&&(a.value=k,e=a.value)};a.addEventListener("input",f);a.addEventListener("change",f);c.o(h,{s:a})}};c.i.value={init:(a,b,d)=>{var e=a.matches("SELECT"),g=a.matches("INPUT");if(!g||"checkbox"!=a.type&&"radio"!=a.type){var l=new Set,f=d.get("valueUpdate"),h=null,k=()=>{h=null;var m=b(),q=c.C.M(a);c.la.Ga(m,d,"value",q)};f&&("string"==typeof f?l.add(f):f.forEach(m=>l.add(m)),l.delete("change"));l.forEach(m=>{var q=k;(m||"").startsWith("after")&&(q=()=>{h=c.C.M(a);setTimeout(k,0)},m=m.slice(5));a.addEventListener(m,
|
||||
q)});var n=g&&"file"==a.type?()=>{var m=c.g.h(b());null==m||""===m?a.value="":c.u.I(k)}:()=>{var m=c.g.h(b()),q=c.C.M(a);if(null!==h&&m===h)setTimeout(n,0);else if(m!==q||void 0===q)e?(c.C.Fa(a,m),m!==c.C.M(a)&&c.u.I(k)):c.C.Fa(a,m)};if(e){var p;c.j.subscribe(a,c.j.F,()=>{p?d.get("valueAllowUnset")?n():k():(a.addEventListener("change",k),p=c.o(n,{s:a}))},null,{notifyImmediately:!0})}else a.addEventListener("change",k),c.o(n,{s:a})}else c.applyBindingAccessorsToNode(a,{checkedValue:b})},update:()=>
|
||||
{}};c.i.visible={update:(a,b)=>{b=c.g.h(b());var d="none"!=a.style.display;b&&!d?a.style.display="":d&&!b&&(a.style.display="none")}};c.i.hidden={update:(a,b)=>a.hidden=!!c.g.h(b())};(function(a){c.i[a]={init:function(b,d,e,g,l){return c.i.event.init.call(this,b,()=>({[a]:d()}),e,g,l)}}})("click");(()=>{let a=c.g.l.Z();class b{constructor(e){this.Na=e}Ua(...e){let g=this.Na;if(!e.length)return c.g.l.get(g,a)||(11===this.H?g.content:1===this.H?g:void 0);c.g.l.set(g,a,e[0])}}class d extends b{constructor(e){super(e);
|
||||
e&&(this.H=e.matches("TEMPLATE")&&e.content?e.content.nodeType:1)}}c.bb={Na:d,lb:b}})();(()=>{const a=(h,k,n)=>{var p;for(k=c.m.nextSibling(k);h&&(p=h)!==k;)h=c.m.nextSibling(p),n(p,h)},b=(h,k)=>{if(h.length){var n=h[0],p=n.parentNode;a(n,h[h.length-1],m=>{1!==m.nodeType&&8!==m.nodeType||c.mb(k,m)});c.g.xa(h,p)}},d=(h,k,n,p)=>{var m=(h&&(h.nodeType?h:0<h.length?h[0]:null)||n||{}).ownerDocument;if("string"==typeof n){m=m||G;m=m.getElementById(n);if(!m)throw Error("Cannot find template with ID "+n);
|
||||
n=new c.bb.Na(m)}else if([1,8].includes(n.nodeType))n=new c.bb.lb(n);else throw Error("Unknown template type: "+n);n=(n=n.Ua?n.Ua():null)?[...n.cloneNode(!0).childNodes]:null;if(!Array.isArray(n)||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");k&&(c.m.pa(h,n),b(n,p),c.j.notify(h,c.j.F));return n},e=(h,k,n)=>c.W(h)?h():"function"===typeof h?h(k,n):h,g=(h,k,n,p)=>{n=n||{};if(p){var m=p.nodeType?p:0<p.length?p[0]:null;return c.o(()=>{var q=
|
||||
k instanceof c.ba?k:new c.ba(k,null,null,{exportDependencies:!0}),r=e(h,q.$data,q);d(p,!0,r,q,n)},{ia:()=>!m||!c.g.Pa(m),s:m})}console.log("no targetNodeOrNodeArray")},l=(h,k,n,p,m)=>{var q,r=(v,z)=>{q=m.createChildContext(v,{extend:A=>A.$index=z});v=e(h,v,q);return d(p,!1,v,q,n)},t=(v,z)=>{b(z,q);q=null},u=(v,z)=>{c.u.I(c.g.Bb,null,[p,v,r,n,t,z]);c.j.notify(p,c.j.F)};if(c.isObservableArray(k)){u(k.L());var y=k.subscribe(v=>{u(k(),v)},null,"arrayChange");y.s(p);return y}return c.o(()=>{var v=c.g.h(k)||
|
||||
[];Array.isArray(v)||(v=[v]);u(v)},{s:p})},f=c.g.l.Z();c.i.template={init:(h,k)=>{k=c.g.h(k());if("string"==typeof k||"name"in k)c.m.ja(h);else if(k=c.m.childNodes(h),k.length)k=c.g.Wb(k),(new c.bb.lb(h)).Ua(k);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:(h,k,n,p,m)=>{p=k();k=c.g.h(p);n=null;"string"==typeof k?k={}:p="name"in k?k.name:h;var q=!!p;"foreach"in k?n=l(p,q&&k.foreach||[],k,h,m):q?(n=m,"data"in k&&(n=
|
||||
m.createChildContext(k.data,{exportDependencies:!0})),n=g(p,n,k,h)):c.m.ja(h);m=n;c.g.l.get(h,f)?.dispose?.();c.g.l.set(h,f,!m||m.isActive&&!m.isActive()?void 0:m)}};c.m.aa.template=!0})();c.g.ub=(a,b,d)=>{var e=0,g,l=b.length;l&&a.every(f=>{g=b.findIndex(h=>f.value===h.value);0<=g&&(f.moved=b[g].index,b[g].moved=f.index,b.splice(g,1),e=g=0,--l);e+=l;return l&&(!d||e<d)})};c.g.rb=(()=>{var a=(b,d,e,g,l)=>{for(var f=Math.min,h=Math.max,k=[],n=-1,p=b.length,m,q=d.length,r=q-p||1,t=p+q+1,u,y,v;++n<=
|
||||
p;)for(y=u,k.push(u=[]),v=f(q,n+r),m=h(0,n-1);m<=v;m++)u[m]=m?n?b[n-1]===d[m-1]?y[m-1]:f(y[m]||t,u[m-1]||t)+1:m+1:n+1;f=[];h=[];r=[];n=p;for(m=q;n||m;)q=k[n][m]-1,m&&q===k[n][m-1]?h.push(f[f.length]={status:e,value:d[--m],index:m}):n&&q===k[n-1][m]?r.push(f[f.length]={status:g,value:b[--n],index:n}):(--m,--n,l.sparse||f.push({status:"retained",value:d[m]}));c.g.ub(r,h,10*p);return f.reverse()};return(b,d,e)=>{b=b||[];d=d||[];return b.length<d.length?a(b,d,"added","deleted",e):a(d,b,"deleted","added",
|
||||
e)}})();(()=>{function a(e,g,l,f,h){var k=[],n=c.o(()=>{var p=g(l,h,c.g.xa(k,e))||[];if(0<k.length){var m=k.nodeType?[k]:k;if(0<m.length){var q=m[0],r=q.parentNode;p.forEach(t=>r.insertBefore(t,q));m.forEach(t=>c.removeNode(t))}f&&c.u.I(f,null,[l,p,h])}k.length=0;k.push(...p)},{s:e,ia:()=>!!k.find(c.g.Pa)});return{O:k,La:n.isActive()?n:void 0}}var b=c.g.l.Z(),d=c.g.l.Z();c.g.Bb=(e,g,l,f,h,k)=>{g=g||[];Array.isArray(g)||(g=[g]);var n=c.g.l.get(e,b),p=[],m=0,q=0,r=[],t=[],u=w=>{A={sa:w,Ta:c.$(q++)};
|
||||
p.push(A)},y=w=>{A=n[w];A.Ta(q++);c.g.xa(A.O,e);p.push(A)};if(n){if(!k||n&&n._countWaitingForRemove)k=c.g.rb(Array.prototype.map.call(n,C=>C.sa),g,{sparse:!0});let w,I;for(k.forEach(C=>{w=C.moved;I=C.index;switch(C.status){case "deleted":for(;m<I;)y(m++);void 0===w&&(A=n[m],A.La&&(A.La.dispose(),A.La=void 0),c.g.xa(A.O,e).length&&A&&r.push.apply(r,A.O));m++;break;case "added":for(;q<I;)y(m++);void 0!==w?(t.push(p.length),y(w)):u(C.value)}});q<g.length;)y(m++);p._countWaitingForRemove=0}else g.forEach(u);
|
||||
c.g.l.set(e,b,p);r.forEach(c.removeNode);var v,z=w=>{c.m.Ub(e,w,v);v=w};k=e.ownerDocument.activeElement;if(t.length)for(;void 0!=(g=t.shift());){var A=p[g];for(v=void 0;g;)if(f=p[--g].O,f?.length){v=f[f.length-1];break}A.O.forEach(z)}p.forEach(w=>{w.O||c.g.extend(w,a(e,l,w.sa,h,w.Ta));w.O.forEach(z);!w.Tb&&h&&(h(w.sa,w.O,w.Ta),w.Tb=!0,v=w.O[w.O.length-1])});e.ownerDocument.activeElement!=k&&k?.focus();[].forEach(w=>w&&(w.sa=d))}})();R.ko=N})(this);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ ko.bindingHandlers = {};
|
|||
// The ko.bindingContext constructor is only called directly to create the root context. For child
|
||||
// contexts, use bindingContext.createChildContext or bindingContext.extend.
|
||||
ko.bindingContext = class {
|
||||
constructor(dataItemOrAccessor, parentContext, dataItemAlias, extendCallback, options)
|
||||
constructor(dataItemOrAccessor, parentContext, extendCallback, options)
|
||||
{
|
||||
var self = this,
|
||||
shouldInheritData = dataItemOrAccessor === inheritParentVm,
|
||||
|
|
@ -42,7 +42,6 @@ ko.bindingContext = class {
|
|||
self[contextAncestorBindingInfo] = parentContext[contextAncestorBindingInfo];
|
||||
}
|
||||
} else {
|
||||
self['$parents'] = [];
|
||||
self['$root'] = dataItem;
|
||||
|
||||
// Export 'ko' in the binding context so it will be available in bindings and templates
|
||||
|
|
@ -56,13 +55,9 @@ ko.bindingContext = class {
|
|||
if (shouldInheritData) {
|
||||
dataItem = self['$data'];
|
||||
} else {
|
||||
self['$rawData'] = dataItemOrObservable;
|
||||
self['$data'] = dataItem;
|
||||
}
|
||||
|
||||
if (dataItemAlias)
|
||||
self[dataItemAlias] = dataItem;
|
||||
|
||||
// The extendCallback function is provided when creating a child context or extending a context.
|
||||
// It handles the specific actions needed to finish setting up the binding context. Actions in this
|
||||
// function could also add dependencies to this binding context.
|
||||
|
|
@ -107,21 +102,11 @@ ko.bindingContext = class {
|
|||
// But this does not mean that the $data value of the child context will also get updated. If the child
|
||||
// view model also depends on the parent view model, you must provide a function that returns the correct
|
||||
// view model on each update.
|
||||
'createChildContext'(dataItemOrAccessor, dataItemAlias, extendCallback, options) {
|
||||
if (!options && dataItemAlias && typeof dataItemAlias == "object") {
|
||||
options = dataItemAlias;
|
||||
dataItemAlias = options['as'];
|
||||
extendCallback = options['extend'];
|
||||
}
|
||||
|
||||
return new ko.bindingContext(dataItemOrAccessor, this, dataItemAlias, (self, parentContext) => {
|
||||
'createChildContext'(dataItemOrAccessor, options) {
|
||||
return new ko.bindingContext(dataItemOrAccessor, this, (self, parentContext) => {
|
||||
// Extend the context hierarchy by setting the appropriate pointers
|
||||
self['$parentContext'] = parentContext;
|
||||
self['$parent'] = parentContext['$data'];
|
||||
self['$parents'] = (parentContext['$parents'] || []).slice(0);
|
||||
self['$parents'].unshift(self['$parent']);
|
||||
if (extendCallback)
|
||||
extendCallback(self);
|
||||
options['extend']?.(self);
|
||||
}, options);
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +114,7 @@ ko.bindingContext = class {
|
|||
// Similarly to "child" contexts, provide a function here to make sure that the correct values are set
|
||||
// when an observable view model is updated.
|
||||
'extend'(properties, options) {
|
||||
return new ko.bindingContext(inheritParentVm, this, null, self =>
|
||||
return new ko.bindingContext(inheritParentVm, this, self =>
|
||||
ko.utils.extend(self, typeof(properties) == "function" ? properties(self) : properties)
|
||||
, options);
|
||||
}
|
||||
|
|
@ -202,7 +187,7 @@ ko.bindingEvent = {
|
|||
} else if (bindingInfo.asyncContext === undefined && bindingInfo.eventSubscribable?.hasSubscriptionsForEvent(ko.bindingEvent.descendantsComplete)) {
|
||||
// It's currently an error to register a descendantsComplete handler for a node that was never registered as completing asynchronously.
|
||||
// That's because without the asyncContext, we don't have a way to know that all descendants have completed.
|
||||
throw new Error("descendantsComplete event not supported for bindings on this node");
|
||||
throw Error("descendantsComplete event not supported for bindings on this node");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -226,12 +211,6 @@ ko.bindingEvent = {
|
|||
}
|
||||
};
|
||||
|
||||
function validateThatBindingIsAllowedForVirtualElements(bindingName) {
|
||||
var validator = ko.virtualElements.allowedBindings[bindingName];
|
||||
if (!validator)
|
||||
throw new Error("The binding '" + bindingName + "' cannot be used with virtual elements")
|
||||
}
|
||||
|
||||
function applyBindingsToDescendantsInternal(bindingContext, elementOrVirtualElement) {
|
||||
var currentChild, nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement);
|
||||
|
||||
|
|
@ -252,7 +231,7 @@ function applyBindingsToNodeAndDescendantsInternal(bindingContext, nodeVerified)
|
|||
// (1) We need to store the binding info for the node (all element nodes)
|
||||
// (2) It might have bindings (e.g., it has a data-bind attribute, or it's a marker for a containerless template)
|
||||
if (isElement || ko.bindingProvider.nodeHasBindings(nodeVerified))
|
||||
bindingContextForDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext)['bindingContextForDescendants'];
|
||||
bindingContextForDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext);
|
||||
|
||||
// Don't want bindings that operate on text nodes to mutate <script> and <textarea> contents,
|
||||
// because it's unexpected and a potential XSS issue.
|
||||
|
|
@ -384,8 +363,9 @@ function applyBindingsToNodeInternal(node, sourceBindings, bindingContext) {
|
|||
handlerUpdateFn = bindingKeyAndHandler.handler["update"],
|
||||
bindingKey = bindingKeyAndHandler.key;
|
||||
|
||||
if (node.nodeType === 8) {
|
||||
validateThatBindingIsAllowedForVirtualElements(bindingKey);
|
||||
// COMMENT_NODE
|
||||
if (node.nodeType === 8 && !ko.virtualElements.allowedBindings[bindingKey]) {
|
||||
throw Error("The binding '" + bindingKey + "' cannot be used with comment nodes");
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -397,7 +377,7 @@ function applyBindingsToNodeInternal(node, sourceBindings, bindingContext) {
|
|||
// If this binding handler claims to control descendant bindings, make a note of this
|
||||
if (initResult && initResult['controlsDescendantBindings']) {
|
||||
if (bindingHandlerThatControlsDescendantBindings !== undefined)
|
||||
throw new Error("Multiple bindings (" + bindingHandlerThatControlsDescendantBindings + " and " + bindingKey + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
|
||||
throw Error("Multiple bindings (" + bindingHandlerThatControlsDescendantBindings + " and " + bindingKey + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
|
||||
bindingHandlerThatControlsDescendantBindings = bindingKey;
|
||||
}
|
||||
});
|
||||
|
|
@ -417,11 +397,7 @@ function applyBindingsToNodeInternal(node, sourceBindings, bindingContext) {
|
|||
});
|
||||
}
|
||||
|
||||
var shouldBindDescendants = bindingHandlerThatControlsDescendantBindings === undefined;
|
||||
return {
|
||||
'shouldBindDescendants': shouldBindDescendants,
|
||||
'bindingContextForDescendants': shouldBindDescendants && contextToExtend
|
||||
};
|
||||
return bindingHandlerThatControlsDescendantBindings === undefined && contextToExtend;
|
||||
}
|
||||
|
||||
ko.storedBindingContextForNode = node => {
|
||||
|
|
@ -432,7 +408,7 @@ ko.storedBindingContextForNode = node => {
|
|||
function getBindingContext(viewModelOrBindingContext, extendContextCallback) {
|
||||
return viewModelOrBindingContext && (viewModelOrBindingContext instanceof ko.bindingContext)
|
||||
? viewModelOrBindingContext
|
||||
: new ko.bindingContext(viewModelOrBindingContext, undefined, undefined, extendContextCallback);
|
||||
: new ko.bindingContext(viewModelOrBindingContext, null, extendContextCallback);
|
||||
}
|
||||
|
||||
ko['applyBindingAccessorsToNode'] = (node, bindings, viewModelOrBindingContext) =>
|
||||
|
|
|
|||
|
|
@ -18,14 +18,6 @@ ko.bindingHandlers['attr'] = {
|
|||
attrValue = attrValue.toString();
|
||||
namespace ? element.setAttributeNS(namespace, attrName, attrValue) : element.setAttribute(attrName, attrValue);
|
||||
}
|
||||
|
||||
// Treat "name" specially - although you can think of it as an attribute, it also needs
|
||||
// special handling on older versions of IE (https://github.com/SteveSanderson/knockout/pull/333)
|
||||
// Deliberately being case-sensitive here because XHTML would regard "Name" as a different thing
|
||||
// entirely, and there's no strong reason to allow for such casing in HTML.
|
||||
if (attrName === "name") {
|
||||
element.name = toRemove ? "" : attrValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ ko.bindingHandlers['checked'] = {
|
|||
// Treat "value" like "checkedValue" when it is included with "checked" binding
|
||||
if (allBindings['has']('checkedValue')) {
|
||||
return ko.utils.unwrapObservable(allBindings.get('checkedValue'));
|
||||
} else if (useElementValue) {
|
||||
}
|
||||
if (useElementValue) {
|
||||
return allBindings['has']('value')
|
||||
? ko.utils.unwrapObservable(allBindings.get('value'))
|
||||
: element.value;
|
||||
|
|
@ -78,10 +79,6 @@ ko.bindingHandlers['checked'] = {
|
|||
useElementValue = isRadio || valueIsArray,
|
||||
oldElemValue = valueIsArray ? checkedValue() : undefined;
|
||||
|
||||
// IE 6 won't allow radio buttons to be selected unless they have a name
|
||||
if (isRadio && !element.name)
|
||||
ko.bindingHandlers['uniqueName']['init'](element, function() { return true });
|
||||
|
||||
// Set up two computeds to update the binding:
|
||||
|
||||
// The first responds to changes in the checkedValue value and to element clicks
|
||||
|
|
@ -113,7 +110,6 @@ ko.bindingHandlers['checked'] = {
|
|||
}
|
||||
}
|
||||
};
|
||||
//ko.expressionRewriting.twoWayBindings['checked'] = true;
|
||||
|
||||
ko.bindingHandlers['checkedValue'] = {
|
||||
'update'(element, valueAccessor) {
|
||||
|
|
|
|||
|
|
@ -1,31 +1,28 @@
|
|||
// "foreach: someExpression" is equivalent to "template: { foreach: someExpression }"
|
||||
// "foreach: { data: someExpression, afterAdd: myfn }" is equivalent to "template: { foreach: someExpression, afterAdd: myfn }"
|
||||
// "foreach: { data: someExpression }" is equivalent to "template: { foreach: someExpression }"
|
||||
const makeTemplateValueAccessor = valueAccessor =>
|
||||
() => {
|
||||
var modelValue = valueAccessor(),
|
||||
// Unwrap without setting a dependency here
|
||||
unwrappedValue = ko.isObservable(modelValue) ? modelValue.peek() : modelValue;
|
||||
|
||||
// If unwrappedValue is the array, pass in the wrapped value on its own
|
||||
// The value will be unwrapped and tracked within the template binding
|
||||
// (See https://github.com/SteveSanderson/knockout/issues/523)
|
||||
if ((!unwrappedValue) || Array.isArray(unwrappedValue))
|
||||
return { 'foreach': modelValue };
|
||||
|
||||
// If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates
|
||||
ko.utils.unwrapObservable(modelValue);
|
||||
return {
|
||||
'foreach': unwrappedValue['data']
|
||||
};
|
||||
};
|
||||
ko.bindingHandlers['foreach'] = {
|
||||
makeTemplateValueAccessor: valueAccessor =>
|
||||
() => {
|
||||
var modelValue = valueAccessor(),
|
||||
// Unwrap without setting a dependency here
|
||||
unwrappedValue = ko.isObservable(modelValue) ? modelValue.peek() : modelValue;
|
||||
|
||||
// If unwrappedValue is the array, pass in the wrapped value on its own
|
||||
// The value will be unwrapped and tracked within the template binding
|
||||
// (See https://github.com/SteveSanderson/knockout/issues/523)
|
||||
if ((!unwrappedValue) || typeof unwrappedValue.length == "number")
|
||||
return { 'foreach': modelValue };
|
||||
|
||||
// If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates
|
||||
ko.utils.unwrapObservable(modelValue);
|
||||
return {
|
||||
'foreach': unwrappedValue['data'],
|
||||
'as': unwrappedValue['as'],
|
||||
'beforeRemove': unwrappedValue['beforeRemove']
|
||||
};
|
||||
},
|
||||
'init': (element, valueAccessor) =>
|
||||
ko.bindingHandlers['template']['init'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor))
|
||||
ko.bindingHandlers['template']['init'](element, makeTemplateValueAccessor(valueAccessor))
|
||||
,
|
||||
'update': (element, valueAccessor, allBindings, viewModel, bindingContext) =>
|
||||
ko.bindingHandlers['template']['update'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor), allBindings, viewModel, bindingContext)
|
||||
ko.bindingHandlers['template']['update'](element, makeTemplateValueAccessor(valueAccessor), allBindings, viewModel, bindingContext)
|
||||
};
|
||||
ko.expressionRewriting.bindingRewriteValidators['foreach'] = false; // Can't rewrite control flow bindings
|
||||
ko.virtualElements.allowedBindings['foreach'] = true;
|
||||
|
|
|
|||
|
|
@ -36,4 +36,3 @@ ko.bindingHandlers['hasfocus'] = {
|
|||
}
|
||||
}
|
||||
};
|
||||
//ko.expressionRewriting.twoWayBindings.add('hasfocus');
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ function makeWithIfBinding(bindingKey, isWith, isNot) {
|
|||
var savedNodes, contextOptions = {}, needAsyncContext;
|
||||
|
||||
if (isWith) {
|
||||
contextOptions = { 'as': allBindings.get('as'), 'exportDependencies': true };
|
||||
contextOptions = { 'exportDependencies': true };
|
||||
}
|
||||
|
||||
needAsyncContext = allBindings['has'](ko.bindingEvent.descendantsComplete);
|
||||
|
|
@ -53,7 +53,6 @@ function makeWithIfBinding(bindingKey, isWith, isNot) {
|
|||
return { 'controlsDescendantBindings': true };
|
||||
}
|
||||
};
|
||||
ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings
|
||||
ko.virtualElements.allowedBindings[bindingKey] = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ var captionPlaceholder = {};
|
|||
ko.bindingHandlers['options'] = {
|
||||
'init': element => {
|
||||
if (!element.matches("SELECT"))
|
||||
throw new Error("options binding applies only to SELECT elements");
|
||||
throw Error("options binding applies only to SELECT elements");
|
||||
|
||||
// Remove all existing <option>s.
|
||||
let l = element.length;
|
||||
|
|
@ -19,7 +19,6 @@ ko.bindingHandlers['options'] = {
|
|||
multiple = element.multiple,
|
||||
previousScrollTop = (!selectWasPreviouslyEmpty && multiple) ? element.scrollTop : null,
|
||||
unwrappedArray = ko.utils.unwrapObservable(valueAccessor()),
|
||||
valueAllowUnset = allBindings.get('valueAllowUnset') && allBindings['has']('value'),
|
||||
arrayToDomNodeChildrenOptions = {},
|
||||
captionValue,
|
||||
filteredArray,
|
||||
|
|
@ -38,10 +37,7 @@ ko.bindingHandlers['options'] = {
|
|||
},
|
||||
|
||||
setSelectionCallback = (arrayEntry, newOptions) => {
|
||||
if (itemUpdate && valueAllowUnset) {
|
||||
// The model value is authoritative, so make sure its value is the one selected
|
||||
ko.bindingEvent.notify(element, ko.bindingEvent.childrenComplete);
|
||||
} else if (previousSelectedValues.length) {
|
||||
if (previousSelectedValues.length) {
|
||||
// IE6 doesn't like us to assign selection to OPTION nodes before they're added to the document.
|
||||
// That's why we first added them without selection. Now it's time to set the selection.
|
||||
var isSelected = previousSelectedValues.includes(ko.selectExtensions.readValue(newOptions[0]));
|
||||
|
|
@ -54,29 +50,18 @@ ko.bindingHandlers['options'] = {
|
|||
}
|
||||
};
|
||||
|
||||
if (!valueAllowUnset) {
|
||||
if (multiple) {
|
||||
previousSelectedValues = selectedOptions().map(ko.selectExtensions.readValue);
|
||||
} else if (element.selectedIndex >= 0) {
|
||||
previousSelectedValues.push(ko.selectExtensions.readValue(element.options[element.selectedIndex]));
|
||||
}
|
||||
if (multiple) {
|
||||
previousSelectedValues = selectedOptions().map(ko.selectExtensions.readValue);
|
||||
} else if (element.selectedIndex >= 0) {
|
||||
previousSelectedValues.push(ko.selectExtensions.readValue(element.options[element.selectedIndex]));
|
||||
}
|
||||
|
||||
if (unwrappedArray) {
|
||||
if (typeof unwrappedArray.length == "undefined") // Coerce single value into array
|
||||
if (!Array.isArray(unwrappedArray)) // Coerce single value into array
|
||||
unwrappedArray = [unwrappedArray];
|
||||
|
||||
// Filter out any entries marked as destroyed
|
||||
filteredArray = unwrappedArray.filter(item => item || item == null);
|
||||
|
||||
// If caption is included, add it to the array
|
||||
if (allBindings['has']('optionsCaption')) {
|
||||
captionValue = ko.utils.unwrapObservable(allBindings.get('optionsCaption'));
|
||||
// If caption value is null or undefined, don't show a caption
|
||||
if (captionValue != null) {
|
||||
filteredArray.unshift(captionPlaceholder);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If a falsy value is provided (e.g. null), we'll simply empty the select element
|
||||
}
|
||||
|
|
@ -88,12 +73,12 @@ ko.bindingHandlers['options'] = {
|
|||
var itemUpdate = false,
|
||||
optionForArrayItem = (arrayEntry, index, oldOptions) => {
|
||||
if (oldOptions.length) {
|
||||
previousSelectedValues = !valueAllowUnset && oldOptions[0].selected ? [ ko.selectExtensions.readValue(oldOptions[0]) ] : [];
|
||||
previousSelectedValues = oldOptions[0].selected ? [ ko.selectExtensions.readValue(oldOptions[0]) ] : [];
|
||||
itemUpdate = true;
|
||||
}
|
||||
var option = element.ownerDocument.createElement("option");
|
||||
if (arrayEntry === captionPlaceholder) {
|
||||
ko.utils.setTextContent(option, allBindings.get('optionsCaption'));
|
||||
ko.utils.setTextContent(option);
|
||||
ko.selectExtensions.writeValue(option, undefined);
|
||||
} else {
|
||||
// Apply a value to the option element
|
||||
|
|
@ -107,10 +92,6 @@ ko.bindingHandlers['options'] = {
|
|||
return [option];
|
||||
};
|
||||
|
||||
// By using a beforeRemove callback, we delay the removal until after new items are added. This fixes a selection
|
||||
// problem in IE<=8 and Firefox. See https://github.com/knockout/knockout/issues/1208
|
||||
arrayToDomNodeChildrenOptions['beforeRemove'] = option => element.removeChild(option);
|
||||
|
||||
var callback = setSelectionCallback;
|
||||
if (allBindings['has']('optionsAfterRender') && typeof allBindings.get('optionsAfterRender') == "function") {
|
||||
callback = (arrayEntry, newOptions) => {
|
||||
|
|
@ -121,28 +102,26 @@ ko.bindingHandlers['options'] = {
|
|||
|
||||
ko.utils.setDomNodeChildrenFromArrayMapping(element, filteredArray, optionForArrayItem, arrayToDomNodeChildrenOptions, callback);
|
||||
|
||||
if (!valueAllowUnset) {
|
||||
// Determine if the selection has changed as a result of updating the options list
|
||||
var selectionChanged, prevLength = previousSelectedValues.length;
|
||||
if (multiple) {
|
||||
// For a multiple-select box, compare the new selection count to the previous one
|
||||
// But if nothing was selected before, the selection can't have changed
|
||||
selectionChanged = prevLength && selectedOptions().length < prevLength;
|
||||
} else {
|
||||
// For a single-select box, compare the current value to the previous value
|
||||
// But if nothing was selected before or nothing is selected now, just look for a change in selection
|
||||
selectionChanged = (prevLength && element.selectedIndex >= 0)
|
||||
? (ko.selectExtensions.readValue(element.options[element.selectedIndex]) !== previousSelectedValues[0])
|
||||
: (prevLength || element.selectedIndex >= 0);
|
||||
}
|
||||
|
||||
// Ensure consistency between model value and selected option.
|
||||
// If the dropdown was changed so that selection is no longer the same,
|
||||
// notify the value or selectedOptions binding.
|
||||
selectionChanged && ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]);
|
||||
// Determine if the selection has changed as a result of updating the options list
|
||||
var selectionChanged, prevLength = previousSelectedValues.length;
|
||||
if (multiple) {
|
||||
// For a multiple-select box, compare the new selection count to the previous one
|
||||
// But if nothing was selected before, the selection can't have changed
|
||||
selectionChanged = prevLength && selectedOptions().length < prevLength;
|
||||
} else {
|
||||
// For a single-select box, compare the current value to the previous value
|
||||
// But if nothing was selected before or nothing is selected now, just look for a change in selection
|
||||
selectionChanged = (prevLength && element.selectedIndex >= 0)
|
||||
? (ko.selectExtensions.readValue(element.options[element.selectedIndex]) !== previousSelectedValues[0])
|
||||
: (prevLength || element.selectedIndex >= 0);
|
||||
}
|
||||
|
||||
if (valueAllowUnset || ko.dependencyDetection.isInitial()) {
|
||||
// Ensure consistency between model value and selected option.
|
||||
// If the dropdown was changed so that selection is no longer the same,
|
||||
// notify the value or selectedOptions binding.
|
||||
selectionChanged && ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]);
|
||||
|
||||
if (ko.dependencyDetection.isInitial()) {
|
||||
ko.bindingEvent.notify(element, ko.bindingEvent.childrenComplete);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
ko.bindingHandlers['submit'] = {
|
||||
'init': (element, valueAccessor, allBindings, viewModel, bindingContext) => {
|
||||
if (typeof valueAccessor() != "function")
|
||||
throw new Error("The value for a submit binding must be a function");
|
||||
throw Error("The value for a submit binding must be a function");
|
||||
element.addEventListener("submit", event => {
|
||||
var handlerReturnValue;
|
||||
var value = valueAccessor();
|
||||
|
|
|
|||
|
|
@ -45,16 +45,6 @@ ko.bindingHandlers['textInput'] = {
|
|||
// Bind to the change event so that we can catch programmatic updates of the value that fire this event.
|
||||
onEvent('change', updateModel);
|
||||
|
||||
// To deal with browsers that don't notify any kind of event for some changes (IE, Safari, etc.)
|
||||
onEvent('blur', updateModel);
|
||||
|
||||
ko.computed(updateView, { disposeWhenNodeIsRemoved: element });
|
||||
}
|
||||
};
|
||||
//ko.expressionRewriting.twoWayBindings.add('textInput');
|
||||
|
||||
// textinput is an alias for textInput
|
||||
ko.bindingHandlers['textinput'] = {
|
||||
// preprocess is the only way to set up a full alias
|
||||
'preprocess': (value, name, addBinding) => addBinding('textInput', value)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -79,9 +79,8 @@ ko.bindingHandlers['value'] = {
|
|||
|
||||
if (valueHasChanged || elementValue === undefined) {
|
||||
if (isSelectElement) {
|
||||
var allowUnset = allBindings.get('valueAllowUnset');
|
||||
ko.selectExtensions.writeValue(element, newValue, allowUnset);
|
||||
if (!allowUnset && newValue !== ko.selectExtensions.readValue(element)) {
|
||||
ko.selectExtensions.writeValue(element, newValue);
|
||||
if (newValue !== ko.selectExtensions.readValue(element)) {
|
||||
// If you try to set a model value that can't be represented in an already-populated dropdown, reject that change,
|
||||
// because you're not allowed to have a model value that disagrees with a visible UI selection.
|
||||
ko.dependencyDetection.ignore(valueUpdateHandler);
|
||||
|
|
@ -112,4 +111,3 @@ ko.bindingHandlers['value'] = {
|
|||
},
|
||||
'update': () => {} // Keep for backwards compatibility with code that may have wrapped value binding
|
||||
};
|
||||
//ko.expressionRewriting.twoWayBindings.add('value');
|
||||
|
|
|
|||
|
|
@ -32,8 +32,14 @@
|
|||
// of which nodes would be deleted if valueToMap was itself later removed
|
||||
mappedNodes.length = 0;
|
||||
mappedNodes.push(...newMappedNodes);
|
||||
}, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: ()=>!!mappedNodes.find(ko.utils.domNodeIsAttachedToDocument) });
|
||||
return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };
|
||||
}, {
|
||||
disposeWhenNodeIsRemoved: containerNode,
|
||||
disposeWhen: ()=>!!mappedNodes.find(ko.utils.domNodeIsAttachedToDocument)
|
||||
});
|
||||
return {
|
||||
mappedNodes : mappedNodes,
|
||||
dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined)
|
||||
};
|
||||
}
|
||||
|
||||
var lastMappingResultDomDataKey = ko.utils.domData.nextKey(),
|
||||
|
|
@ -41,7 +47,7 @@
|
|||
|
||||
ko.utils.setDomNodeChildrenFromArrayMapping = (domNode, array, mapping, options, callbackAfterAddingNodes, editScript) => {
|
||||
array = array || [];
|
||||
if (typeof array.length == "undefined") // Coerce single value into array
|
||||
if (!Array.isArray(array)) // Coerce single value into array
|
||||
array = [array];
|
||||
|
||||
options = options || {};
|
||||
|
|
@ -70,12 +76,6 @@
|
|||
mapData.indexObservable(currentArrayIndex++);
|
||||
ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode);
|
||||
newMappingResult.push(mapData);
|
||||
},
|
||||
|
||||
callCallback = (callback, items) => {
|
||||
if (callback) {
|
||||
items.forEach(item => item?.mappedNodes.forEach(node => callback(node, i, item.arrayEntry)));
|
||||
}
|
||||
};
|
||||
|
||||
if (isFirstExecution) {
|
||||
|
|
@ -87,7 +87,6 @@
|
|||
Array.prototype.map.call(lastMappingResult, x => x.arrayEntry),
|
||||
array,
|
||||
{
|
||||
'dontLimitMoves': options['dontLimitMoves'],
|
||||
'sparse': true
|
||||
});
|
||||
}
|
||||
|
|
@ -112,15 +111,6 @@
|
|||
|
||||
// Queue these nodes for later removal
|
||||
if (ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode).length) {
|
||||
if (options['beforeRemove']) {
|
||||
newMappingResult.push(mapData);
|
||||
countWaitingForRemove++;
|
||||
if (mapData.arrayEntry === deletedItemDummyValue) {
|
||||
mapData = null;
|
||||
} else {
|
||||
itemsForBeforeRemoveCallbacks[mapData.indexObservable.peek()] = mapData;
|
||||
}
|
||||
}
|
||||
if (mapData) {
|
||||
nodesToDelete.push.apply(nodesToDelete, mapData.mappedNodes);
|
||||
}
|
||||
|
|
@ -155,8 +145,8 @@
|
|||
// Store a copy of the array items we just considered so we can difference it next time
|
||||
ko.utils.domData.set(domNode, lastMappingResultDomDataKey, newMappingResult);
|
||||
|
||||
// Next remove nodes for deleted items (or just clean if there's a beforeRemove callback)
|
||||
nodesToDelete.forEach(options['beforeRemove'] ? ko.cleanNode : ko.removeNode);
|
||||
// Next remove nodes for deleted items
|
||||
nodesToDelete.forEach(ko.removeNode);
|
||||
|
||||
var i, lastNode, mappedNodes, activeElement,
|
||||
insertNode = nodeToInsert => {
|
||||
|
|
@ -183,7 +173,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Next add/reorder the remaining items (will include deleted items if there's a beforeRemove callback)
|
||||
// Next add/reorder the remaining items
|
||||
newMappingResult.forEach(mapData => {
|
||||
// Get nodes for newly added items
|
||||
mapData.mappedNodes
|
||||
|
|
@ -205,15 +195,8 @@
|
|||
activeElement?.focus();
|
||||
}
|
||||
|
||||
// If there's a beforeRemove callback, call it after reordering.
|
||||
// Note that we assume that the beforeRemove callback will usually be used to remove the nodes using
|
||||
// some sort of animation, which is why we first reorder the nodes that will be removed. If the
|
||||
// callback instead removes the nodes right away, it would be more efficient to skip reordering them.
|
||||
// Perhaps we'll make that change in the future if this scenario becomes more common.
|
||||
callCallback(options['beforeRemove'], itemsForBeforeRemoveCallbacks);
|
||||
|
||||
// Replace the stored values of deleted items with a dummy value. This provides two benefits: it marks this item
|
||||
// as already "removed" so we won't call beforeRemove for it again, and it ensures that the item won't match up
|
||||
// as already "removed", and it ensures that the item won't match up
|
||||
// with an actual item in the array and appear as "retained" or "moved".
|
||||
itemsForBeforeRemoveCallbacks.forEach(callback => callback && (callback.arrayEntry = deletedItemDummyValue));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,16 +78,13 @@ ko.utils.compareArrays = (() => {
|
|||
|
||||
// Set a limit on the number of consecutive non-matching comparisons; having it a multiple of
|
||||
// smlIndexMax keeps the time complexity of this algorithm linear.
|
||||
ko.utils.findMovesInArrayComparison(notInBig, notInSml, !options['dontLimitMoves'] && smlIndexMax * 10);
|
||||
ko.utils.findMovesInArrayComparison(notInBig, notInSml, smlIndexMax * 10);
|
||||
|
||||
return editScript.reverse();
|
||||
};
|
||||
|
||||
// Simple calculation based on Levenshtein distance.
|
||||
return (oldArray, newArray, options) => {
|
||||
// For backward compatibility, if the third arg is actually a bool, interpret
|
||||
// it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.
|
||||
options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});
|
||||
oldArray = oldArray || [];
|
||||
newArray = newArray || [];
|
||||
|
||||
|
|
|
|||
|
|
@ -112,9 +112,6 @@ ko.expressionRewriting = (() => {
|
|||
return result;
|
||||
},
|
||||
|
||||
// Two-way bindings include a write function that allow the handler to update the value even if it's not an observable.
|
||||
// twoWayBindings = new Set,
|
||||
|
||||
preProcessBindings = (bindingsStringOrKeyValueArray) => {
|
||||
|
||||
var resultStrings = [],
|
||||
|
|
@ -122,16 +119,6 @@ ko.expressionRewriting = (() => {
|
|||
keyValueArray = parseObjectLiteral(bindingsStringOrKeyValueArray),
|
||||
|
||||
processKeyValue = (key, val) => {
|
||||
var /*writableVal,*/ obj = ko.bindingHandlers[key];
|
||||
if (obj?.['preprocess'] && !obj['preprocess'](val, key, processKeyValue))
|
||||
return;
|
||||
/*
|
||||
if (twoWayBindings.has(key) && (writableVal = getWriteableValue(val))) {
|
||||
// For two-way bindings, provide a write method in case the value
|
||||
// isn't a writable observable.
|
||||
propertyAccessorResultStrings.push("'" + key + "':function(_z){" + writableVal + "=_z}");
|
||||
}
|
||||
*/
|
||||
// Values are wrapped in a function so that each value can be accessed independently
|
||||
val = 'function(){return ' + val + ' }';
|
||||
resultStrings.push("'" + key + "':" + val);
|
||||
|
|
@ -148,10 +135,6 @@ ko.expressionRewriting = (() => {
|
|||
};
|
||||
|
||||
return {
|
||||
bindingRewriteValidators: [],
|
||||
|
||||
// twoWayBindings: twoWayBindings,
|
||||
|
||||
parseObjectLiteral: parseObjectLiteral,
|
||||
|
||||
preProcessBindings: preProcessBindings,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ ko.selectExtensions = {
|
|||
}
|
||||
},
|
||||
|
||||
writeValue: (element, value, allowUnset) => {
|
||||
writeValue: (element, value) => {
|
||||
switch (element.nodeName) {
|
||||
case 'OPTION':
|
||||
if (typeof value === "string") {
|
||||
|
|
@ -49,7 +49,7 @@ ko.selectExtensions = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (allowUnset || selection >= 0 || (noValue && element.size > 1)) {
|
||||
if (selection >= 0 || (noValue && element.size > 1)) {
|
||||
element.selectedIndex = selection;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@
|
|||
currentViewModel = null;
|
||||
// Any in-flight loading operation is no longer relevant, so make sure we ignore its completion
|
||||
currentLoadingOperationId = null;
|
||||
},
|
||||
originalChildNodes = [...ko.virtualElements.childNodes(element)];
|
||||
};
|
||||
|
||||
ko.virtualElements.emptyNode(element);
|
||||
ko.utils.domNodeDisposal['addDisposeCallback'](element, disposeAssociatedComponentViewModel);
|
||||
|
|
@ -34,7 +33,7 @@
|
|||
}
|
||||
|
||||
if (!componentName) {
|
||||
throw new Error('No component name specified');
|
||||
throw Error('No component name specified');
|
||||
}
|
||||
|
||||
var asyncContext = ko.bindingEvent.startPossiblyAsyncContentBinding(element, bindingContext);
|
||||
|
|
@ -48,25 +47,19 @@
|
|||
|
||||
// Instantiate and bind new component. Implicitly this cleans any old DOM nodes.
|
||||
if (!componentDefinition) {
|
||||
throw new Error('Unknown component \'' + componentName + '\'');
|
||||
throw Error('Unknown component \'' + componentName + '\'');
|
||||
}
|
||||
// cloneTemplateIntoElement
|
||||
var template = componentDefinition['template'];
|
||||
if (!template) {
|
||||
throw new Error('Component \'' + componentName + '\' has no template');
|
||||
throw Error('Component \'' + componentName + '\' has no template');
|
||||
}
|
||||
ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(template));
|
||||
|
||||
currentViewModel = componentDefinition['createViewModel'](componentParams, {
|
||||
'element': element,
|
||||
'templateNodes': originalChildNodes
|
||||
'element': element
|
||||
});
|
||||
ko.applyBindingsToDescendants(asyncContext['createChildContext'](currentViewModel, {
|
||||
'extend': ctx => {
|
||||
ctx['$component'] = currentViewModel;
|
||||
ctx['$componentTemplateNodes'] = originalChildNodes;
|
||||
}
|
||||
}), element);
|
||||
ko.applyBindingsToDescendants(asyncContext['createChildContext'](currentViewModel, {}), element);
|
||||
}
|
||||
});
|
||||
}, { disposeWhenNodeIsRemoved: element });
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
'register': (componentName, config) => {
|
||||
if (!config) {
|
||||
throw new Error('Invalid configuration for ' + componentName);
|
||||
throw Error('Invalid configuration for ' + componentName);
|
||||
}
|
||||
|
||||
if (defaultConfigRegistry[componentName]) {
|
||||
throw new Error('Component ' + componentName + ' is already registered');
|
||||
throw Error('Component ' + componentName + ' is already registered');
|
||||
}
|
||||
|
||||
defaultConfigRegistry[componentName] = config;
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
var defaultConfigRegistry = Object.create(null),
|
||||
createViewModelKey = 'createViewModel',
|
||||
throwError = (componentName, message) => { throw new Error(`Component '${componentName}': ${message}`) },
|
||||
throwError = (componentName, message) => { throw Error(`Component '${componentName}': ${message}`) },
|
||||
|
||||
// Takes a config object of the form { template: ..., viewModel: ... }, and asynchronously convert it
|
||||
// into the standard component definition format:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ ko.dependencyDetection = {
|
|||
registerDependency: subscribable => {
|
||||
if (currentFrame) {
|
||||
if (!ko.isSubscribable(subscribable))
|
||||
throw new Error("Only subscribable things can act as dependencies");
|
||||
throw Error("Only subscribable things can act as dependencies");
|
||||
currentFrame.callback.call(currentFrame.callbackTarget, subscribable,
|
||||
subscribable._id || (subscribable._id = ++lastId));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ ko.computed = (evaluatorFunctionOrOptions, options) => {
|
|||
pure: false,
|
||||
isSleeping: false,
|
||||
readFunction: options["read"],
|
||||
disposeWhenNodeIsRemoved: options["disposeWhenNodeIsRemoved"] || options.disposeWhenNodeIsRemoved || null,
|
||||
disposeWhen: options["disposeWhen"] || options.disposeWhen,
|
||||
disposeWhenNodeIsRemoved: options.disposeWhenNodeIsRemoved || null,
|
||||
disposeWhen: options.disposeWhen,
|
||||
domNodeDisposalCallback: null,
|
||||
dependencyTracking: {},
|
||||
dependenciesCount: 0,
|
||||
|
|
@ -36,7 +36,7 @@ ko.computed = (evaluatorFunctionOrOptions, options) => {
|
|||
function computedObservable() {
|
||||
if (arguments.length > 0) {
|
||||
if (typeof writeFunction !== "function") {
|
||||
throw new 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.");
|
||||
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.");
|
||||
}
|
||||
// Writing a value
|
||||
writeFunction(...arguments);
|
||||
|
|
@ -205,14 +205,8 @@ var computedFn = {
|
|||
return target['subscribe'](this.evaluatePossiblyAsync, this);
|
||||
},
|
||||
evaluatePossiblyAsync() {
|
||||
var computedObservable = this,
|
||||
throttleEvaluationTimeout = computedObservable['throttleEvaluation'];
|
||||
if (throttleEvaluationTimeout >= 0) {
|
||||
clearTimeout(this[computedState].evaluationTimeoutInstance);
|
||||
this[computedState].evaluationTimeoutInstance = setTimeout(() =>
|
||||
computedObservable.evaluateImmediate(true /*notifyChange*/)
|
||||
, throttleEvaluationTimeout);
|
||||
} else if (computedObservable._evalDelayed) {
|
||||
var computedObservable = this;
|
||||
if (computedObservable._evalDelayed) {
|
||||
computedObservable._evalDelayed(true /*isChange*/);
|
||||
} else {
|
||||
computedObservable.evaluateImmediate(true /*notifyChange*/);
|
||||
|
|
|
|||
|
|
@ -10,9 +10,8 @@ ko['extenders'] = {
|
|||
}
|
||||
};
|
||||
|
||||
var primitiveTypes = { 'undefined':1, 'boolean':1, 'number':1, 'string':1 };
|
||||
function valuesArePrimitiveAndEqual(a, b) {
|
||||
return (a === null || primitiveTypes[typeof(a)]) ? (a === b) : false;
|
||||
return a === b && a !== Object(a);
|
||||
}
|
||||
|
||||
function throttle(callback, timeout) {
|
||||
|
|
|
|||
|
|
@ -39,29 +39,28 @@ ko['extenders']['trackArrayChanges'] = (target, options) => {
|
|||
}
|
||||
};
|
||||
|
||||
function trackChanges() {
|
||||
function notifyChanges() {
|
||||
if (pendingChanges) {
|
||||
// Make a copy of the current contents and ensure it's an array
|
||||
var currentContents = [].concat(target.peek() || []), changes;
|
||||
|
||||
function notifyChanges() {
|
||||
if (pendingChanges) {
|
||||
// Make a copy of the current contents and ensure it's an array
|
||||
var currentContents = [].concat(target.peek() || []), changes;
|
||||
// Compute the diff and issue notifications, but only if someone is listening
|
||||
if (target.hasSubscriptionsForEvent(arrayChangeEventName)) {
|
||||
changes = getChanges(previousContents, currentContents);
|
||||
}
|
||||
|
||||
// Compute the diff and issue notifications, but only if someone is listening
|
||||
if (target.hasSubscriptionsForEvent(arrayChangeEventName)) {
|
||||
changes = getChanges(previousContents, currentContents);
|
||||
}
|
||||
// Eliminate references to the old, removed items, so they can be GCed
|
||||
previousContents = currentContents;
|
||||
cachedDiff = null;
|
||||
pendingChanges = 0;
|
||||
|
||||
// Eliminate references to the old, removed items, so they can be GCed
|
||||
previousContents = currentContents;
|
||||
cachedDiff = null;
|
||||
pendingChanges = 0;
|
||||
|
||||
if (changes?.length) {
|
||||
target.notifySubscribers(changes, arrayChangeEventName);
|
||||
}
|
||||
if (changes?.length) {
|
||||
target.notifySubscribers(changes, arrayChangeEventName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function trackChanges() {
|
||||
if (trackingChanges) {
|
||||
// Whenever there's a new subscription and there are pending notifications, make sure all previous
|
||||
// subscriptions are notified of the change so that all subscriptions are in sync.
|
||||
|
|
@ -102,16 +101,15 @@ ko['extenders']['trackArrayChanges'] = (target, options) => {
|
|||
var diff = [],
|
||||
arrayLength = rawArray.length,
|
||||
argsLength = args.length,
|
||||
offset = 0;
|
||||
offset = 0,
|
||||
pushDiff = (status, value, index) =>
|
||||
diff[diff.length] = { 'status': status, 'value': value, 'index': index };
|
||||
|
||||
function pushDiff(status, value, index) {
|
||||
return diff[diff.length] = { 'status': status, 'value': value, 'index': index };
|
||||
}
|
||||
switch (operationName) {
|
||||
case 'push':
|
||||
offset = arrayLength;
|
||||
case 'unshift':
|
||||
for (let index = 0; index < argsLength; index++) {
|
||||
for (let index = 0; index < argsLength; ++index) {
|
||||
pushDiff('added', args[index], offset + index);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
ko['observableArray'] = initialValues => {
|
||||
initialValues = initialValues || [];
|
||||
|
||||
if (typeof initialValues != 'object' || !('length' in initialValues))
|
||||
throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
|
||||
if (!Array.isArray(initialValues))
|
||||
throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
|
||||
|
||||
return Object.setPrototypeOf(ko.observable(initialValues), ko['observableArray']['fn']).extend({'trackArrayChanges':true});
|
||||
};
|
||||
|
|
|
|||
259
vendors/knockout/src/templating/templating.js
vendored
259
vendors/knockout/src/templating/templating.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
(() => {
|
||||
var renderTemplateSource = templateSource => {
|
||||
const renderTemplateSource = templateSource => {
|
||||
var templateNodes = templateSource.nodes ? templateSource.nodes() : null;
|
||||
return templateNodes
|
||||
? [...templateNodes.cloneNode(true).childNodes]
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
templateDocument = templateDocument || document;
|
||||
var elem = templateDocument.getElementById(template);
|
||||
if (!elem)
|
||||
throw new Error("Cannot find template with ID " + template);
|
||||
throw Error("Cannot find template with ID " + template);
|
||||
return new ko.templateSources.domElement(elem);
|
||||
}
|
||||
if ([1,8].includes(template.nodeType)) {
|
||||
// Anonymous template
|
||||
return new ko.templateSources.anonymousTemplate(template);
|
||||
}
|
||||
throw new Error("Unknown template type: " + template);
|
||||
throw Error("Unknown template type: " + template);
|
||||
},
|
||||
|
||||
invokeForEachNodeInContinuousRange = (firstNode, lastNode, action) => {
|
||||
|
|
@ -60,32 +60,20 @@
|
|||
: null;
|
||||
},
|
||||
|
||||
executeTemplate = (targetNodeOrNodeArray, renderMode, template, bindingContext) => {
|
||||
executeTemplate = (targetNodeOrNodeArray, replaceChildren, template, bindingContext) => {
|
||||
var firstTargetNode = targetNodeOrNodeArray && getFirstNodeFromPossibleArray(targetNodeOrNodeArray);
|
||||
var templateDocument = (firstTargetNode || template || {}).ownerDocument;
|
||||
|
||||
var renderedNodesArray = renderTemplateSource(makeTemplateSource(template, templateDocument));
|
||||
|
||||
// Loosely check result is an array of DOM nodes
|
||||
if ((typeof renderedNodesArray.length != "number") || (renderedNodesArray.length > 0 && typeof renderedNodesArray[0].nodeType != "number"))
|
||||
throw new Error("Template engine must return an array of DOM nodes");
|
||||
if (!Array.isArray(renderedNodesArray) || (renderedNodesArray.length > 0 && typeof renderedNodesArray[0].nodeType != "number"))
|
||||
throw Error("Template engine must return an array of DOM nodes");
|
||||
|
||||
var haveAddedNodesToParent = false;
|
||||
switch (renderMode) {
|
||||
case "replaceChildren":
|
||||
ko.virtualElements.setDomNodeChildren(targetNodeOrNodeArray, renderedNodesArray);
|
||||
haveAddedNodesToParent = true;
|
||||
break;
|
||||
case "ignoreTargetNode": break;
|
||||
default:
|
||||
throw new Error("Unknown renderMode: " + renderMode);
|
||||
}
|
||||
|
||||
if (haveAddedNodesToParent) {
|
||||
if (replaceChildren) {
|
||||
ko.virtualElements.setDomNodeChildren(targetNodeOrNodeArray, renderedNodesArray);
|
||||
activateBindingsOnContinuousNodeArray(renderedNodesArray, bindingContext);
|
||||
if (renderMode == "replaceChildren") {
|
||||
ko.bindingEvent.notify(targetNodeOrNodeArray, ko.bindingEvent.childrenComplete);
|
||||
}
|
||||
ko.bindingEvent.notify(targetNodeOrNodeArray, ko.bindingEvent.childrenComplete);
|
||||
}
|
||||
|
||||
return renderedNodesArray;
|
||||
|
|
@ -99,100 +87,92 @@
|
|||
}
|
||||
// 2. A function of (data, context) returning a string ELSE 3. A string
|
||||
return (typeof template === 'function') ? template(data, context) : template;
|
||||
},
|
||||
|
||||
renderTemplate = (template, dataOrBindingContext, options, targetNodeOrNodeArray) => {
|
||||
options = options || {};
|
||||
|
||||
if (targetNodeOrNodeArray) {
|
||||
var firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray);
|
||||
|
||||
var whenToDispose = () => (!firstTargetNode) || !ko.utils.domNodeIsAttachedToDocument(firstTargetNode); // Passive disposal (on next evaluation)
|
||||
|
||||
return ko.computed( // So the DOM is automatically updated when any dependency changes
|
||||
() => {
|
||||
// Ensure we've got a proper binding context to work with
|
||||
var bindingContext = (dataOrBindingContext instanceof ko.bindingContext)
|
||||
? dataOrBindingContext
|
||||
: new ko.bindingContext(dataOrBindingContext, null, null, { "exportDependencies": true });
|
||||
|
||||
var templateName = resolveTemplateName(template, bindingContext['$data'], bindingContext);
|
||||
executeTemplate(targetNodeOrNodeArray, true, templateName, bindingContext, options);
|
||||
},
|
||||
{ disposeWhen: whenToDispose, disposeWhenNodeIsRemoved: firstTargetNode }
|
||||
);
|
||||
} else {
|
||||
console.log('no targetNodeOrNodeArray');
|
||||
}
|
||||
},
|
||||
|
||||
renderTemplateForEach = (template, arrayOrObservableArray, options, targetNode, parentBindingContext) => {
|
||||
// Since setDomNodeChildrenFromArrayMapping always calls executeTemplateForArrayItem and then
|
||||
// activateBindingsCallback for added items, we can store the binding context in the former to use in the latter.
|
||||
var arrayItemContext;
|
||||
|
||||
// This will be called by setDomNodeChildrenFromArrayMapping to get the nodes to add to targetNode
|
||||
var executeTemplateForArrayItem = (arrayValue, index) => {
|
||||
// Support selecting template as a function of the data being rendered
|
||||
arrayItemContext = parentBindingContext['createChildContext'](arrayValue, {
|
||||
'extend': context => context['$index'] = index
|
||||
});
|
||||
|
||||
var templateName = resolveTemplateName(template, arrayValue, arrayItemContext);
|
||||
return executeTemplate(targetNode, false, templateName, arrayItemContext, options);
|
||||
};
|
||||
|
||||
// This will be called whenever setDomNodeChildrenFromArrayMapping has added nodes to targetNode
|
||||
var activateBindingsCallback = (arrayValue, addedNodesArray) => {
|
||||
activateBindingsOnContinuousNodeArray(addedNodesArray, arrayItemContext);
|
||||
|
||||
// release the "cache" variable, so that it can be collected by
|
||||
// the GC when its value isn't used from within the bindings anymore.
|
||||
arrayItemContext = null;
|
||||
};
|
||||
|
||||
var setDomNodeChildrenFromArrayMapping = (newArray, changeList) => {
|
||||
// Call setDomNodeChildrenFromArrayMapping, ignoring any observables unwrapped within (most likely from a callback function).
|
||||
// If the array items are observables, though, they will be unwrapped in executeTemplateForArrayItem and managed within setDomNodeChildrenFromArrayMapping.
|
||||
ko.dependencyDetection.ignore(ko.utils.setDomNodeChildrenFromArrayMapping, null, [targetNode, newArray, executeTemplateForArrayItem, options, activateBindingsCallback, changeList]);
|
||||
ko.bindingEvent.notify(targetNode, ko.bindingEvent.childrenComplete);
|
||||
};
|
||||
|
||||
if (ko['isObservableArray'](arrayOrObservableArray)) {
|
||||
setDomNodeChildrenFromArrayMapping(arrayOrObservableArray.peek());
|
||||
|
||||
var subscription = arrayOrObservableArray['subscribe'](changeList => {
|
||||
setDomNodeChildrenFromArrayMapping(arrayOrObservableArray(), changeList);
|
||||
}, null, "arrayChange");
|
||||
subscription.disposeWhenNodeIsRemoved(targetNode);
|
||||
|
||||
return subscription;
|
||||
}
|
||||
return ko.computed(() => {
|
||||
var unwrappedArray = ko.utils.unwrapObservable(arrayOrObservableArray) || [];
|
||||
if (!Array.isArray(unwrappedArray)) // Coerce single value into array
|
||||
unwrappedArray = [unwrappedArray];
|
||||
|
||||
setDomNodeChildrenFromArrayMapping(unwrappedArray);
|
||||
|
||||
}, { disposeWhenNodeIsRemoved: targetNode });
|
||||
},
|
||||
|
||||
templateComputedDomDataKey = ko.utils.domData.nextKey(),
|
||||
disposeOldComputedAndStoreNewOne = (element, newComputed) => {
|
||||
var oldComputed = ko.utils.domData.get(element, templateComputedDomDataKey);
|
||||
oldComputed?.['dispose']?.();
|
||||
ko.utils.domData.set(element, templateComputedDomDataKey, (newComputed && (!newComputed.isActive || newComputed.isActive())) ? newComputed : undefined);
|
||||
};
|
||||
|
||||
ko.renderTemplate = function (template, dataOrBindingContext, options, targetNodeOrNodeArray, renderMode) {
|
||||
options = options || {};
|
||||
renderMode = renderMode || "replaceChildren";
|
||||
|
||||
if (targetNodeOrNodeArray) {
|
||||
var firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray);
|
||||
|
||||
var whenToDispose = () => (!firstTargetNode) || !ko.utils.domNodeIsAttachedToDocument(firstTargetNode); // Passive disposal (on next evaluation)
|
||||
|
||||
return ko.computed( // So the DOM is automatically updated when any dependency changes
|
||||
() => {
|
||||
// Ensure we've got a proper binding context to work with
|
||||
var bindingContext = (dataOrBindingContext instanceof ko.bindingContext)
|
||||
? dataOrBindingContext
|
||||
: new ko.bindingContext(dataOrBindingContext, null, null, null, { "exportDependencies": true });
|
||||
|
||||
var templateName = resolveTemplateName(template, bindingContext['$data'], bindingContext);
|
||||
executeTemplate(targetNodeOrNodeArray, renderMode, templateName, bindingContext, options);
|
||||
},
|
||||
{ disposeWhen: whenToDispose, disposeWhenNodeIsRemoved: firstTargetNode }
|
||||
);
|
||||
} else {
|
||||
console.log('no targetNodeOrNodeArray');
|
||||
}
|
||||
};
|
||||
|
||||
ko.renderTemplateForEach = (template, arrayOrObservableArray, options, targetNode, parentBindingContext) => {
|
||||
// Since setDomNodeChildrenFromArrayMapping always calls executeTemplateForArrayItem and then
|
||||
// activateBindingsCallback for added items, we can store the binding context in the former to use in the latter.
|
||||
var arrayItemContext, asName = options['as'];
|
||||
|
||||
// This will be called by setDomNodeChildrenFromArrayMapping to get the nodes to add to targetNode
|
||||
var executeTemplateForArrayItem = (arrayValue, index) => {
|
||||
// Support selecting template as a function of the data being rendered
|
||||
arrayItemContext = parentBindingContext['createChildContext'](arrayValue, {
|
||||
'as': asName,
|
||||
'extend': context => {
|
||||
context['$index'] = index;
|
||||
if (asName) {
|
||||
context[asName + "Index"] = index;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var templateName = resolveTemplateName(template, arrayValue, arrayItemContext);
|
||||
return executeTemplate(targetNode, "ignoreTargetNode", templateName, arrayItemContext, options);
|
||||
};
|
||||
|
||||
// This will be called whenever setDomNodeChildrenFromArrayMapping has added nodes to targetNode
|
||||
var activateBindingsCallback = (arrayValue, addedNodesArray) => {
|
||||
activateBindingsOnContinuousNodeArray(addedNodesArray, arrayItemContext);
|
||||
|
||||
// release the "cache" variable, so that it can be collected by
|
||||
// the GC when its value isn't used from within the bindings anymore.
|
||||
arrayItemContext = null;
|
||||
};
|
||||
|
||||
var setDomNodeChildrenFromArrayMapping = function (newArray, changeList) {
|
||||
// Call setDomNodeChildrenFromArrayMapping, ignoring any observables unwrapped within (most likely from a callback function).
|
||||
// If the array items are observables, though, they will be unwrapped in executeTemplateForArrayItem and managed within setDomNodeChildrenFromArrayMapping.
|
||||
ko.dependencyDetection.ignore(ko.utils.setDomNodeChildrenFromArrayMapping, null, [targetNode, newArray, executeTemplateForArrayItem, options, activateBindingsCallback, changeList]);
|
||||
ko.bindingEvent.notify(targetNode, ko.bindingEvent.childrenComplete);
|
||||
};
|
||||
|
||||
if (!options['beforeRemove'] && ko['isObservableArray'](arrayOrObservableArray)) {
|
||||
setDomNodeChildrenFromArrayMapping(arrayOrObservableArray.peek());
|
||||
|
||||
var subscription = arrayOrObservableArray['subscribe'](changeList => {
|
||||
setDomNodeChildrenFromArrayMapping(arrayOrObservableArray(), changeList);
|
||||
}, null, "arrayChange");
|
||||
subscription.disposeWhenNodeIsRemoved(targetNode);
|
||||
|
||||
return subscription;
|
||||
}
|
||||
return ko.computed(() => {
|
||||
var unwrappedArray = ko.utils.unwrapObservable(arrayOrObservableArray) || [];
|
||||
if (typeof unwrappedArray.length == "undefined") // Coerce single value into array
|
||||
unwrappedArray = [unwrappedArray];
|
||||
|
||||
setDomNodeChildrenFromArrayMapping(unwrappedArray);
|
||||
|
||||
}, { disposeWhenNodeIsRemoved: targetNode });
|
||||
};
|
||||
|
||||
var templateComputedDomDataKey = ko.utils.domData.nextKey();
|
||||
function disposeOldComputedAndStoreNewOne(element, newComputed) {
|
||||
var oldComputed = ko.utils.domData.get(element, templateComputedDomDataKey);
|
||||
oldComputed?.['dispose']?.();
|
||||
ko.utils.domData.set(element, templateComputedDomDataKey, (newComputed && (!newComputed.isActive || newComputed.isActive())) ? newComputed : undefined);
|
||||
}
|
||||
|
||||
var cleanContainerDomDataKey = ko.utils.domData.nextKey();
|
||||
ko.bindingHandlers['template'] = {
|
||||
'init': (element, valueAccessor) => {
|
||||
// Support anonymous templates
|
||||
|
|
@ -200,25 +180,6 @@
|
|||
if (typeof bindingValue == "string" || 'name' in bindingValue) {
|
||||
// It's a named template - clear the element
|
||||
ko.virtualElements.emptyNode(element);
|
||||
} else if ('nodes' in bindingValue) {
|
||||
// We've been given an array of DOM nodes. Save them as the template source.
|
||||
// There is no known use case for the node array being an observable array (if the output
|
||||
// varies, put that behavior *into* your template - that's what templates are for), and
|
||||
// the implementation would be a mess, so assert that it's not observable.
|
||||
var nodes = bindingValue['nodes'] || [];
|
||||
if (ko.isObservable(nodes)) {
|
||||
throw new Error('The "nodes" option must be a plain, non-observable array.');
|
||||
}
|
||||
|
||||
// If the nodes are already attached to a KO-generated container, we reuse that container without moving the
|
||||
// elements to a new one (we check only the first node, as the nodes are always moved together)
|
||||
let container = nodes[0]?.parentNode;
|
||||
if (!container || !ko.utils.domData.get(container, cleanContainerDomDataKey)) {
|
||||
container = ko.utils.moveCleanedNodesToContainerElement(nodes);
|
||||
ko.utils.domData.set(container, cleanContainerDomDataKey, true);
|
||||
}
|
||||
|
||||
new ko.templateSources.anonymousTemplate(element).nodes(container);
|
||||
} else {
|
||||
// It's an anonymous template - store the element contents, then clear the element
|
||||
var templateNodes = ko.virtualElements.childNodes(element);
|
||||
|
|
@ -226,7 +187,7 @@
|
|||
let container = ko.utils.moveCleanedNodesToContainerElement(templateNodes); // This also removes the nodes from their current parent
|
||||
new ko.templateSources.anonymousTemplate(element).nodes(container);
|
||||
} else {
|
||||
throw new Error("Anonymous template defined, but no template content was provided");
|
||||
throw Error("Anonymous template defined, but no template content was provided");
|
||||
}
|
||||
}
|
||||
return { 'controlsDescendantBindings': true };
|
||||
|
|
@ -243,23 +204,14 @@
|
|||
options = {};
|
||||
} else {
|
||||
template = 'name' in options ? options['name'] : element;
|
||||
|
||||
// Support "if"/"ifnot" conditions
|
||||
if ('if' in options)
|
||||
shouldDisplay = ko.utils.unwrapObservable(options['if']);
|
||||
if (shouldDisplay && 'ifnot' in options)
|
||||
shouldDisplay = !ko.utils.unwrapObservable(options['ifnot']);
|
||||
|
||||
// Don't show anything if an empty name is given (see #2446)
|
||||
if (shouldDisplay && !template) {
|
||||
shouldDisplay = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't show anything if an empty name is given (see #2446)
|
||||
shouldDisplay = !!template;
|
||||
|
||||
if ('foreach' in options) {
|
||||
// Render once for each data point (treating data set as empty if shouldDisplay==false)
|
||||
var dataArray = (shouldDisplay && options['foreach']) || [];
|
||||
templateComputed = ko.renderTemplateForEach(template, dataArray, options, element, bindingContext);
|
||||
templateComputed = renderTemplateForEach(template, (shouldDisplay && options['foreach']) || [], options, element, bindingContext);
|
||||
} else if (!shouldDisplay) {
|
||||
ko.virtualElements.emptyNode(element);
|
||||
} else {
|
||||
|
|
@ -267,11 +219,10 @@
|
|||
var innerBindingContext = bindingContext;
|
||||
if ('data' in options) {
|
||||
innerBindingContext = bindingContext['createChildContext'](options['data'], {
|
||||
'as': options['as'],
|
||||
'exportDependencies': true
|
||||
});
|
||||
}
|
||||
templateComputed = ko.renderTemplate(template, innerBindingContext, options, element);
|
||||
templateComputed = renderTemplate(template, innerBindingContext, options, element);
|
||||
}
|
||||
|
||||
// It only makes sense to have a single template computed per element (otherwise which one should have its output displayed?)
|
||||
|
|
@ -279,17 +230,5 @@
|
|||
}
|
||||
};
|
||||
|
||||
// Anonymous templates can't be rewritten. Give a nice error message if you try to do it.
|
||||
ko.expressionRewriting.bindingRewriteValidators['template'] = bindingValue => {
|
||||
var parsedBindingValue = ko.expressionRewriting.parseObjectLiteral(bindingValue);
|
||||
|
||||
if ((parsedBindingValue.length == 1) && parsedBindingValue[0]['unknown'])
|
||||
return null; // It looks like a string literal, not an object literal, so treat it as a named template (which is allowed for rewriting)
|
||||
|
||||
if (ko.expressionRewriting.keyValueArrayContainsKey(parsedBindingValue, "name"))
|
||||
return null; // Named templates can be rewritten, so return "no error"
|
||||
return "This template engine does not support anonymous templates nested within its templates";
|
||||
};
|
||||
|
||||
ko.virtualElements.allowedBindings['template'] = true;
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ ko.utils.domNodeDisposal = (() => {
|
|||
return {
|
||||
'addDisposeCallback' : (node, callback) => {
|
||||
if (typeof callback != "function")
|
||||
throw new Error("Callback must be a function");
|
||||
throw Error("Callback must be a function");
|
||||
getDisposeCallbacksCollection(node, 1).add(callback);
|
||||
},
|
||||
|
||||
|
|
|
|||
2
vendors/knockout/src/utils.js
vendored
2
vendors/knockout/src/utils.js
vendored
|
|
@ -84,7 +84,7 @@ ko.utils = {
|
|||
|
||||
triggerEvent: (element, eventType) => {
|
||||
if (!element?.nodeType)
|
||||
throw new Error("element must be a DOM node when calling triggerEvent");
|
||||
throw Error("element must be a DOM node when calling triggerEvent");
|
||||
|
||||
element.dispatchEvent(new Event(eventType));
|
||||
},
|
||||
|
|
|
|||
4
vendors/knockout/src/virtualElements.js
vendored
4
vendors/knockout/src/virtualElements.js
vendored
|
|
@ -41,7 +41,7 @@
|
|||
++depth;
|
||||
}
|
||||
if (!allowUnbalanced)
|
||||
throw new Error("Cannot find closing comment tag to match: " + startComment.nodeValue);
|
||||
throw Error("Cannot find closing comment tag to match: " + startComment.nodeValue);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
}
|
||||
let first = node.firstChild;
|
||||
if (first && isEndComment(first)) {
|
||||
throw new Error("Found invalid end comment, as the first child of " + node);
|
||||
throw Error("Found invalid end comment, as the first child of " + node);
|
||||
}
|
||||
return first;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue