http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/58047a3d/node_modules/winjs/js/ui.min.js
----------------------------------------------------------------------
diff --git a/node_modules/winjs/js/ui.min.js b/node_modules/winjs/js/ui.min.js
index 20e2af5..d59dfe5 100644
--- a/node_modules/winjs/js/ui.min.js
+++ b/node_modules/winjs/js/ui.min.js
@@ -1,29 +1,30 @@
 /*! Copyright (c) Microsoft Corporation.  All Rights Reserved. Licensed 
under the MIT License. See License.txt in the project root for license 
information. */
-!function(){var a="undefined"!=typeof window?window:"undefined"!=typeof 
self?self:"undefined"!=typeof global?global:{};!function(b){"function"==typeof 
define&&define.amd?define(["./base"],b):(a.msWriteProfilerMark&&msWriteProfilerMark("WinJS.4.0
 4.0.1.winjs.2015.6.10 ui.js,StartTM"),b("undefined"!=typeof 
module?require("./base"):a.WinJS),a.msWriteProfilerMark&&msWriteProfilerMark("WinJS.4.0
 4.0.1.winjs.2015.6.10 ui.js,StopTM"))}(function(b){var 
c=b.Utilities._require,d=b.Utilities._define;d("WinJS/VirtualizedDataSource/_VirtualizedDataSourceImpl",["exports","../Core/_Global","../Core/_Base","../Core/_BaseUtils","../Core/_ErrorFromName","../Core/_Events","../Core/_Log","../Core/_Resources","../Core/_WriteProfilerMark","../Promise","../Scheduler","../_Signal","../Utilities/_UI"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){"use
 
strict";c.Namespace._moduleDefine(a,"WinJS.UI",{VirtualizedDataSource:c.Namespace._lazy(function(){function
 a(a,c){function f(a){var b="WinJS.UI.VirtualizedDataSource:"
 +pe+":"+a+",StartTM";i(b),g.log&&g.log(b,"winjs vds","perf")}function u(a){var 
b="WinJS.UI.VirtualizedDataSource:"+pe+":"+a+",StopTM";i(b),g.log&&g.log(b,"winjs
 vds","perf")}function v(a){return"number"==typeof a&&a>=0}function w(a){return 
v(a)&&a===Math.floor(a)}function x(a){if(null===a)a=void 0;else if(void 
0!==a&&!w(a))throw new 
e("WinJS.UI.ListDataSource.InvalidIndexReturned",s.invalidIndexReturned);return 
a}function y(a){if(null===a)a=void 0;else if(void 
0!==a&&!w(a)&&a!==p.unknown)throw new 
e("WinJS.UI.ListDataSource.InvalidCountReturned",s.invalidCountReturned);return 
a}function z(){var 
a=(nd++).toString(),b={handle:a,item:null,itemNew:null,fetchListeners:null,cursorCount:0,bindingMap:null};return
 Nd[a]=b,b}function A(){return z()}function 
B(a,b){a.prev=b.prev,a.next=b,a.prev.next=a,b.prev=a}function 
C(a){a.lastInSequence&&(delete 
a.lastInSequence,a.prev.lastInSequence=!0),a.firstInSequence&&(delete 
a.firstInSequence,a.next.firstInSequence=!0),a.prev.next=a.next,a.next.prev=
 a.prev}function D(a){for(;!a.firstInSequence;)a=a.prev;return a}function 
E(a){for(;!a.lastInSequence;)a=a.next;return a}function F(a,b,c){return 
b.prev.next=c.next,c.next.prev=b.prev,b.prev=a.prev,c.next=a,b.prev.next=b,a.prev=c,!0}function
 G(a,b,c){return 
b.prev.next=c.next,c.next.prev=b.prev,b.prev=a,c.next=a.next,a.next=b,c.next.prev=c,!0}function
 H(a){delete a.lastInSequence,delete a.next.firstInSequence}function I(a){var 
b=a.next;a.lastInSequence=!0,b.firstInSequence=!0,b===Ld&&nb(Ld,void 
0)}function J(a,b,c,d){B(a,b);var e=a.prev;e.lastInSequence&&(c?delete 
e.lastInSequence:a.firstInSequence=!0,d?delete 
b.firstInSequence:a.lastInSequence=!0)}function 
K(a,b){a.key=b,Od[a.key]=a}function 
L(a,b,c){+b===b&&(a.index=b,c[b]=a,Ad||(a.firstInSequence&&a.prev&&a.prev.index===b-1&&H(a.prev),a.lastInSequence&&a.next&&a.next.index===b+1&&H(a)))}function
 M(a,b){var c=b===Pd?A():z();return B(c,a),c}function N(a,b,c){var 
d=M(a,c);return d.firstInSequence=!0,d.lastInSequence=!0,L(d,b,c),d}fun
 ction O(a,b){return N(a,b,Pd)}function P(a,b){var c=M(a,b);return delete 
a.firstInSequence,c.prev.index===c.index-1?delete 
c.prev.lastInSequence:c.firstInSequence=!0,L(c,a.index-1,b),c}function 
Q(a,b){var c=M(a.next,b);return delete 
a.lastInSequence,c.next.index===c.index+1?delete 
c.next.firstInSequence:c.lastInSequence=!0,L(c,a.index+1,b),c}function 
R(a,b,c,d){J(a,b,c,d),Od[a.key]=a,void 0!==a.index&&(Pd[a.index]=a)}function 
S(a){C(a),a.key&&delete Od[a.key],void 0!==a.index&&Pd[a.index]===a&&delete 
Pd[a.index];var b=a.bindingMap;for(var c in b){var 
d=b[c].handle;d&&Nd[d]===a&&delete Nd[d]}Nd[a.handle]===a&&delete 
Nd[a.handle]}function T(a){return!Nd[a.handle]}function U(a,b,c,d,e){var 
f=e?null:b[a-1];if(f&&(f.next!==d||d.firstInSequence))f=f.next;else 
if(f=b[a+1],!f){f=c.next;for(var 
g;;){if(f.firstInSequence&&(g=f),!(a>=f.index)||f===d)break;f=f.next}f!==d||d.firstInSequence||(f=g&&void
 0===g.index?g:void 0)}return f}function 
V(a){return!a.item&&!a.itemNew&&a!==Ld}function W(a,b)
 
{Object.defineProperty(a,"handle",{value:b,writable:!1,enumerable:!1,configurable:!0})}function
 
X(a,b,c){W(a,c),Object.defineProperty(a,"index",{get:function(){for(;b.slotMergedWith;)b=b.slotMergedWith;return
 b.index},enumerable:!1,configurable:!0})}function Y(a){if(void 0===a)return 
a;var b=JSON.stringify(a);if(void 0===b)throw new 
e("WinJS.UI.ListDataSource.ObjectIsNotValidJson",s.objectIsNotValidJson);return 
b}function Z(b){return 
a.itemSignature?a.itemSignature(b.data):Y(b.data)}function $(b){var 
c=b.itemNew;b.itemNew=null,c&&(c=Object.create(c),X(c,b,b.handle),a.compareByIdentity||(b.signature=Z(c))),b.item=c,delete
 b.indexRequested,delete b.keyRequested}function _(a){return 
a.bindingMap||a.cursorCount>0}function ab(a){return 
_(a)||a.fetchListeners||a.directFetchListeners}function bb(a){return 
ab(a)||!a.firstInSequence&&_(a.prev)||!a.lastInSequence&&_(a.next)||!ie&&(!a.firstInSequence&&a.prev!==Kd&&!(a.prev.item||a.prev.itemNew))|(!a.lastInSequence&&a.next!==Ld&&!(a.next.item||
 a.next.itemNew))}function cb(a){I(a),S(a)}function 
db(){if(!vd){(!Rd||T(Rd))&&(Rd=Ld.prev);for(var 
a=Rd.prev,b=Rd.next,c=0,d=function(a){a===Ld||bb(a)||(hd>=c?c++:cb(a))};a||b;){if(a){var
 e=a;a=e.prev,e!==Kd&&d(e)}if(b){var f=b;b=f.next,f!==Md&&d(f)}}Qd=0}}function 
eb(a){ab(a)||(Qd++,vd||Ud||(Rd=a,Qd>hd&&!Sd&&(Sd=!0,k.schedule(function(){Sd=!1,db()},k.Priority.idle,null,"WinJS.UI.VirtualizedDataSource.releaseSlotIfUnrequested"))))}function
 fb(a){for(var b in ld)a(ld[b])}function gb(a,b){for(var c in 
a.bindingMap)b(a.bindingMap[c].bindingRecord,c)}function hb(a){return 
a.notificationsSent||(a.notificationsSent=!0,a.notificationHandler.beginNotifications&&a.notificationHandler.beginNotifications()),a.notificationHandler}function
 
ib(){sd||yd||fb(function(a){a.notificationsSent&&(a.notificationsSent=!1,a.notificationHandler.endNotifications&&a.notificationHandler.endNotifications())})}function
 jb(a,b){var c=a.bindingMap;if(c){var d=c[b];if(d){var e=d.handle;if(e)return 
e}}return a.handl
 e}function kb(a,b){return 
a&&a.handle!==b&&(a=Object.create(a),W(a,b)),a}function lb(a){var 
b=Jd;Jd=a,fb(function(a){a.notificationHandler&&a.notificationHandler.countChanged&&hb(a).countChanged(Jd,b)})}function
 
mb(a,b){gb(a,function(c,d){c.notificationHandler.indexChanged&&hb(c).indexChanged(jb(a,d),a.index,b)})}function
 nb(a,b){var c=a.index;if(void 0!==c&&Pd[c]===a&&delete 
Pd[c],+b===b)L(a,b,Pd);else{if(+c!==c)return;delete a.index}mb(a,c)}function 
ob(a,b,c,d,e){var 
f={};if(!(!d&&b.lastInSequence||!e&&c.firstInSequence))if(b===Kd)if(c===Ld)for(var
 g in ld)f[g]=ld[g];else for(var g in c.bindingMap)f[g]=ld[g];else 
if(c===Ld||c.bindingMap)for(var g in 
b.bindingMap)(c===Ld||c.bindingMap[g])&&(f[g]=ld[g]);for(var g in 
a.bindingMap)f[g]=ld[g];return f}function pb(a){var 
b,c=a.prev,d=a.next,e=ob(a,c,d);for(b in e){var 
f=e[b];f.notificationHandler&&hb(f).inserted(f.itemPromiseFromKnownSlot(a),c.lastInSequence||c===Kd?null:jb(c,b),d.firstInSequence||d===Ld?null:jb(d,b))}}function
 qb(a){va
 r b=a.item;$(a),gb(a,function(c,d){var 
e=jb(a,d);hb(c).changed(kb(a.item,e),kb(b,e))})}function rb(a,b,c,d,e){var 
f,g=b.prev;if(b===a){if(!a.firstInSequence||!c)return;b=a.next}else 
if(g===a){if(!a.lastInSequence||!d)return;g=a.prev}if(!e){var 
h=ob(a,g,b,c,d);for(f in h){var 
i=h[f];hb(i).moved(i.itemPromiseFromKnownSlot(a),(g.lastInSequence||g===a.prev)&&!c||g===Kd?null:jb(g,f),(b.firstInSequence||b===a.next)&&!d||b===Ld?null:jb(b,f))}fb(function(b){b.adjustCurrentSlot(a)})}C(a),J(a,b,c,d)}function
 
sb(a,b){Bb(a,!0),gb(a,function(c,d){hb(c).removed(jb(a,d),b)}),fb(function(b){b.adjustCurrentSlot(a)}),S(a)}function
 tb(a){for(;!a.firstInSequence;)a=a.prev;var b;do{b=a.lastInSequence;var 
c=a.next;sb(a,!0),a=c}while(!b)}function ub(a){var b;if(!a)return b;for(var 
c=0;!a.firstInSequence;)c++,a=a.prev;return"number"==typeof 
a.indexNew?a.indexNew+c:"number"==typeof a.index?a.index+c:b}function 
vb(a,b){for(a=a.next;a;a=a.next)if(a.firstInSequence){var c=void 
0!==a.indexNew?a.indexNew:a.index
 ;void 0!==c&&(a.indexNew=c+b)}zd+=b,Ad=!0,Ud?wc():Cd++}function 
wb(a,b){if(a.firstInSequence){var c;if(0>b)c=a.indexNew,void 0!==c?delete 
a.indexNew:c=a.index,a.lastInSequence||(a=a.next,void 
0!==c&&(a.indexNew=c));else if(!a.lastInSequence){var 
d=a.next;c=d.indexNew,void 0!==c?delete d.indexNew:c=d.index,void 
0!==c&&(a.indexNew=c)}}vb(a,b)}function xb(a,b){for(var 
c=Kd;c!==Ld;c=c.next){var d=c.indexNew;if(void 
0!==d&&d>=a){vb(c,b);break}}}function yb(){var 
a,b,c;for(a=Kd;;a=a.next){if(a.firstInSequence){if(b=a,void 
0!==a.indexNew){if(c=a.indexNew,delete a.indexNew,isNaN(c))break}else 
c=a.index;a!==Kd&&a.prev.index===c-1&&H(a.prev)}if(a.lastInSequence)for(var 
d=c,e=b;e!==a.next;e=e.next)d!==e.index&&nb(e,d),+d===d&&d++;if(a===Ld)break}for(;a!==Md;a=a.next)void
 0!==a.index&&a!==Ld&&nb(a,void 
0);Ad=!1,zd&&+Jd===Jd&&(pd?pd.reset():lb(Jd+zd),zd=0)}function 
zb(a,b,c,d,e){if(a.item)return new j(function(b){e?e(b,a.item):b(a.item)});var 
f={listBindingID:d,retained:!1};return a[b]||(a[b]={}
 ),a[b][c]=f,f.promise=new 
j(function(a,b){f.complete=e?function(b){e(a,b)}:a,f.error=b},function(){for(;a.slotMergedWith;)a=a.slotMergedWith;var
 d=a[b];if(d){if(delete d[c],Object.keys(d).length>0)return;delete 
a[b]}eb(a)}),f.promise}function Ab(a,b){for(var c in 
b)b[c].complete(a)}function Bb(a,b){var 
c=a.fetchListeners,d=a.directFetchListeners;if(c||d){$(a);var 
e=a.item,f=function(a){b?Ab(e,a):Gd.push(function(){Ab(e,a)})};d&&(a.directFetchListeners=null,f(d)),c&&(a.fetchListeners=null,f(c)),eb(a)}}function
 Cb(){var a=Gd;Gd=[];for(var b=0,c=a.length;c>b;b++)a[b]()}function Db(a,b){var 
c=a.directFetchListeners;if(c){a.directFetchListeners=null;for(var d in 
c)c[d].error(b);eb(a)}}function Eb(a){return 
a.firstInSequence&&P(a,Pd),a.lastInSequence&&Q(a,Pd),a.itemNew&&$(a),ac(),a}function
 Fb(a){if(!a.firstInSequence){var b=a.prev;return b===Kd?null:Eb(b)}return 
Eb(P(a,Pd))}function Gb(a){if(!a.lastInSequence){var b=a.next;return 
b===Ld?null:Eb(b)}return Eb(Q(a,Pd))}function Hb(a){return
  a?zb(a,"directFetchListeners",(od++).toString()):j.wrap(null)}function 
Ib(a){if("string"!=typeof a||!a)throw new 
e("WinJS.UI.ListDataSource.KeyIsInvalid",s.keyIsInvalid)}function Jb(a){var 
b=O(Md);return K(b,a),b.keyRequested=!0,b}function Kb(a,b){Ib(a);var 
c=Od[a];return c||(c=Jb(a),c.hints=b),Eb(c)}function Lb(a){if("number"!=typeof 
a||0>a)throw new 
e("WinJS.UI.ListDataSource.IndexIsInvalid",s.indexIsInvalid);if(Ld.index<=a)return
 null;var b=Pd[a];if(!b){var c=U(a,Pd,Kd,Ld);if(!c)return 
null;c===Ld&&a>=Ld&&nb(Ld,void 
0),b=c.prev.index===a-1?Q(c.prev,Pd):c.index===a+1?P(c,Pd):O(c,a)}return 
b.item||(b.indexRequested=!0),Eb(b)}function Mb(a){var b=O(Md);return 
b.description=a,Eb(b)}function Nb(a){if(jd=a,id!==jd){var 
c=function(){kd=!1,id!==jd&&(id=jd,qe.dispatchEvent(t,id))};jd===o.failure?c():kd||(kd=!0,b.setTimeout(c,40))}}function
 Ob(a){var b=a.fetchID;return b&&Fd[b]}function Pb(a,b){a.fetchID=b}function 
Qb(){var a=Ed;return Ed++,Fd[a]=!0,a}function Rb(a,b,c){var d=Qb();Pb(a,d)
 ;for(var e=a;!e.firstInSequence&&b>0;)e=e.prev,b--,Pb(e,d);for(var 
f=a;!f.lastInSequence&&c>0;)f=f.next,c--,Pb(f,d);return d}function Sb(a){var 
b=a.items,c=a.offset,d=a.totalCount,e=a.absoluteIndex,f=a.atStart,g=a.atEnd;if(v(e)){if(v(d)){var
 
h=b.length;e-c+h===d&&(g=!0)}c===e&&(f=!0)}f&&(b.unshift(Hd),a.offset++),g&&b.push(Id)}function
 Tb(a,b,c){return delete Fd[c],b!==Cd||T(a)?(ac(),!1):!0}function 
Ub(a,b,c,d){var g=Cd;c.then(function(c){if(!c.items||!c.items.length)return 
j.wrapError(new e(q.doesNotExist));var h="itemsFetched id="+b+" 
count="+c.items.length;f(h),Tb(a,g,b)&&(+d===d&&(c.absoluteIndex=d),Sb(c),qc(a,c.items,c.offset,c.totalCount,c.absoluteIndex)),u(h)}).then(null,function(c){Tb(a,g,b)&&rc(a,c)})}function
 Vb(a,b,c,d){var g=Cd;d.then(function(d){if(!d.items||!d.items.length)return 
j.wrapError(new e(q.doesNotExist));var h="itemsFetched id="+c+" 
count="+d.items.length;f(h),Tb(b,g,c)&&(d.absoluteIndex=a,Sb(d),sc(a,b,d.items,d.offset,d.totalCount,d.absoluteIndex)),u(h)}).th
 en(null,function(){Tb(b,g,c)&&tc(a,b,g)})}function Wb(a,b){var 
c=Rb(a,0,b-1);je?Ub(a,c,je(c,b),0):Ub(a,c,ie(c,0,0,b-1),0)}function Xb(a,b){var 
c=Rb(a,b-1,0);Ub(a,c,ke(c,b))}function Yb(a,b,c){var 
d=Rb(a,b,c);Ub(a,d,he(d,a.key,b,c,a.hints))}function Zb(a,b,c){var 
d=a.index;if(b>d&&(b=d),ie){var e=Rb(a,b,c);Ub(a,e,ie(e,d,b,c),d)}else 
if(a.key)Yb(a,b,c);else{var f,g,h=Kd,i=d+1;for(f=a.prev;f!==Kd;f=f.prev)if(void 
0!==f.index&&f.key){g=d-f.index,i>g&&(i=g,h=f);break}for(f=a.next;f!==Ld;f=f.next)if(void
 0!==f.index&&f.key){g=f.index-d,i>g&&(i=g,h=f);break}if(h===Kd){var 
e=Rb(a,0,d+1);Vb(0,a,e,je(e,d+1))}else{var 
j=Math.max(h.index-d,0),k=Math.max(d-h.index,0),e=Rb(h,j,k);Vb(h.index,a,e,he(e,h.key,j,k,a.hints))}}}function
 $b(a,b,c){var d=Rb(a,b,c);Ub(a,d,le(d,a.description,b,c))}function 
_b(){if(!Ud){for(var a,b,c,d,e,f,g,h,i=!1,j=!1,k=Kd.next;k!==Md;){var 
l=k.next;if(k!==Ld&&V(k)&&(j=!0,a?b++:(a=k,b=1),Ob(k)&&(i=!0),k.keyRequested&&!c&&(c=k,d=b-1),void
 0===k.description||e||(e=k,f=b-1),k
 
.indexRequested&&!g&&(g=k,h=b-1),k.lastInSequence||l===Md||!V(l))){if(i)i=!1;else{if(qd=!1,!a.firstInSequence&&a.prev.key&&he?Yb(a.prev,0,b):!k.lastInSequence&&l.key&&he?Yb(l,b,0):a.prev!==Kd||a.firstInSequence||!je&&!ie?l===Ld&&!k.lastInSequence&&ke?Xb(k,b):c?Yb(c,d,b-1-d):e?$b(e,f,b-1-f):g?Zb(g,h,b-1-h):"number"==typeof
 a.index?Zb(a,b-1,0):tb(a):Wb(a,b),qd)return void 
ac();if(Ud)return}a=g=c=null}k=l}Nb(j?o.waiting:o.ready)}}function 
ac(){Dd||(Dd=!0,k.schedule(function(){Dd=!1,_b(),ib()},k.Priority.max,null,"WinJS.UI.ListDataSource._fetch"))}function
 bc(b){var c=b.itemNew;if(!c)return!1;var d=b.item;for(var e in 
d)switch(e){case"data":break;default:if(d[e]!==c[e])return!0}return 
a.compareByIdentity?d.data!==c.data:b.signature!==Z(c)}function 
cc(a){ab(a)?bc(a)?qb(a):a.itemNew=null:a.item=null}function 
dc(a){a.item?cc(a):Bb(a)}function 
ec(a,b){a.key||K(a,b.key),a.itemNew=b,dc(a)}function fc(a,b,c){var 
d=b.bindingMap;if(d)for(var e in c)if(d[e]){var f=b.fetchListeners;for(var g in 
f)
 {var h=f[g];h.listBindingID===e&&h.retained&&(delete 
f[g],h.complete(null))}var 
i=d[e].bindingRecord;hb(i).removed(jb(b,e),!0,jb(a,e)),b.bindingMap&&delete 
b.bindingMap[e]}}function gc(a,b){if(a.index!==b.index){var 
c=b.index;b.index=a.index,mb(b,c)}b.slotMergedWith=a;var d=b.bindingMap;for(var 
e in d){a.bindingMap||(a.bindingMap={});var 
f=d[e];f.handle||(f.handle=b.handle),Nd[f.handle]=a,a.bindingMap[e]=f}fb(function(c){c.adjustCurrentSlot(b,a)});var
 
g=b.itemNew||b.item;if(g&&(g=Object.create(g),X(g,a,a.handle),ec(a,g)),a.item)b.directFetchListeners&&Gd.push(function(){Ab(a.item,b.directFetchListeners)}),b.fetchListeners&&Gd.push(function(){Ab(a.item,b.fetchListeners)});else{var
 h;for(h in 
b.directFetchListeners)a.directFetchListeners||(a.directFetchListeners={}),a.directFetchListeners[h]=b.directFetchListeners[h];for(h
 in 
b.fetchListeners)a.fetchListeners||(a.fetchListeners={}),a.fetchListeners[h]=b.fetchListeners[h]}a.itemNew&&Bb(a),b.handle=(nd++).toString(),I(b),S(b)}function
 h
 c(a,b,c){b&&b.key&&(c||(c=b.itemNew||b.item),delete b.key,delete 
Od[c.key],b.itemNew=null,b.item=null),c&&ec(a,c),b&&gc(a,b)}function 
ic(a){if("object"!=typeof a)throw new 
e("WinJS.UI.ListDataSource.InvalidItemReturned",s.invalidItemReturned);if(a===Hd)return
 Kd;if(a===Id)return Ld;if(a.key)return d.validation&&Ib(a.key),Od[a.key];throw 
new 
e("WinJS.UI.ListDataSource.InvalidKeyReturned",s.invalidKeyReturned)}function 
jc(a,b){var c=ic(b);c===a&&(c=null),c&&fc(a,c,a.bindingMap),hc(a,c,b)}function 
kc(a,b,c,d){if(b&&a.key&&a.key!==b.key)return wc(),!1;var 
e=Pd[c];if(e)if(e===a)e=null;else{if(e.key&&(a.key||b&&e.key!==b.key))return 
wc(),!1;if(!a.key&&e.bindingMap)return!1}var 
f;if(b)if(f=Od[b.key],f===a)f=null;else if(f&&f.bindingMap)return!1;return 
e?(fc(a,e,a.bindingMap),delete 
Pd[c],nb(a,c),a.prev.index===c-1&&H(a.prev),a.next.index===c+1&&H(a),d.slotNext=e.slotNext,b||(b=e.itemNew||e.item,b&&(f=Od[b.key]))):nb(a,c),f&&e!==f&&fc(a,f,a.bindingMap),hc(a,f,b),e&&e!==f&&gc(a,e),!0}functio
 n lc(a,b,c){if(b.key&&a.key&&b.key!==a.key)return wc(),!1;for(var d in 
a.bindingMap)c[d]=!0;return fc(a,b,c),hc(a,b),!0}function mc(a,b){for(var 
c={};a;){var 
d=a.firstInSequence?null:a.prev;if(b.firstInSequence||b.prev!==Kd){if(b=b.firstInSequence?P(b,Pd):b.prev,!lc(b,a,c))return}else
 sb(a,!0);a=d}}function nc(a,b){for(var c={};a;){var 
d=a.lastInSequence?null:a.next;if(b.lastInSequence||b.next!==Ld){if(b=b.lastInSequence?Q(b,Pd):b.next,!lc(b,a,c))return}else
 sb(a,!0);a=d}}function oc(a){for(var b=0;b<a.length;b++){var 
c=a[b];mc(c.slotBeforeSequence,c.slotFirstInSequence),nc(c.slotAfterSequence,c.slotLastInSequence)}}function
 pc(a,b){function c(b){for(var c=Ld.prev;!(c.index<a)&&c!==b;){var 
e=c.prev;void 0!==c.index&&sb(c,!0),c=e}d=0}for(var 
d=0,e=Ld.prev;!(e.index<a)||d>0;){var 
f=e.prev;if(e===Kd){c(Kd);break}if(e.key){if(e.index>=a)return 
wc(),!1;if(!(e.index>=b))return he?Yb(e,0,d):Zb(e,0,d),!1;c(e)}else 
e.indexRequested||e.firstInSequence?c(f):d++;e=f}return!0}function qc(a,b,c,d
 ,e){var g="WinJS.UI.ListDataSource.processResults";return 
f(g),e=x(e),d=y(d),vd?void 
u(g):(Ad&&yb(),!v(d)&&d!==p.unknown||d===Jd||Ld.firstInSequence?(qd=!0,function(){var
 f,g,h,i,j=b.length;if("number"!=typeof e)for(f=0;j>f;f++)if(h=ic(b[f]),h&&void 
0!==h.index){e=h.index+c-f;break}"number"==typeof 
e&&b[j-1]===Id?d=e-c+j-1:!v(d)||void 
0!==e&&null!==e||(e=d-(j-1)+c),v(d)&&!pc(d,e-c)&&(d=void 0);var k=new 
Array(j);for(f=0;j>f;f++){var 
l=null;if(h=ic(b[f])){if(f>0&&!h.firstInSequence&&h.prev.key&&h.prev.key!==b[f-1].key||"number"==typeof
 e&&void 0!==h.index&&h.index!==e-c+f)return void 
wc();(h===Kd||h===Ld||h.bindingMap)&&(l=h)}if("number"==typeof 
e&&(h=Pd[e-c+f])){if(h.key&&h.key!==b[f].key)return void 
wc();!l&&h.bindingMap&&(l=h)}if(f===c){if(a.key&&a.key!==b[f].key||"number"==typeof
 a.index&&"number"==typeof e&&a.index!==e)return void 
wc();l||(l=a)}k[f]=l}for(f=0;j>f;f++)h=k[f],h&&void 
0!==h.index&&h!==Kd&&h!==Ld&&jc(h,b[f]);var 
m,n,o=[],p=!0;for(f=0;j>f;f++)if(h=k[f],h&&h!==Ld){var
  q=f;if(void 0===h.index){var r={};kc(h,b[f],e-c+f,r);var 
s,t=h,u=h;for(g=f-1;!t.firstInSequence&&(s=b[g],s!==Hd);g--){var 
w=e-c+g;if(0>w)break;if(!kc(t.prev,s,w,r))break;t=t.prev,g>=0&&(k[g]=t)}for(g=f+1;!u.lastInSequence&&(s=b[g],s!==Id&&g!==d||u.next===Ld)&&(u.next===Ld||kc(u.next,s,e-c+g,r))&&(u=u.next,j>g&&(k[g]=u),q=g,u!==Ld);g++);if(m=t.firstInSequence?null:t.prev,n=u.lastInSequence?null:u.next,m&&I(m),n&&I(u),"number"==typeof
 e){if(u===Ld)m&&G(Ld,D(m),m);else{var 
x=r.slotNext;x||(x=U(u.index,Pd,Kd,Ld,!0)),F(x,t,u)}t.prev.index===t.index-1&&H(t.prev),u.next.index===u.index+1&&H(u)}else
 
p||(i=k[f-1],i&&(t.prev!==i&&(u===Ld?(m&&G(Ld,D(m),m),F(t,D(i),i)):G(i,t,u)),H(i)));if(p=!1,Td)return;o.push({slotBeforeSequence:m,slotFirstInSequence:t,slotLastInSequence:u,slotAfterSequence:n})}f!==c||h===a||T(a)||(m=a.firstInSequence?null:a.prev,n=a.lastInSequence?null:a.next,fc(h,a,h.bindingMap),gc(h,a),o.push({slotBeforeSequence:m,slotFirstInSequence:h,slotLastInSequence:h,slotAfterSequenc
 
e:n})),f=q}for(v(d)&&Ld.index!==d&&nb(Ld,d),oc(o),f=0;j>f;f++)if(h=k[f]){for(g=f-1;g>=0;g--){var
 
y=k[g+1];jc(k[g]=y.firstInSequence?P(k[g+1],Pd):y.prev,b[g])}for(g=f+1;j>g;g++)i=k[g-1],h=k[g],h?h.firstInSequence&&(h.prev!==i&&G(i,h,E(h)),H(i)):jc(k[g]=i.lastInSequence?Q(i,Pd):i.next,b[g]);break}delete
 a.description}(),Td||(void 0!==d&&d!==Jd&&lb(d),ac()),ib(),Cb(),void 
u(g)):(wc(),void u(g)))}function rc(a,b){switch(b.name){case 
q.noResponse:Nb(o.failure),Db(a,b);break;case 
q.doesNotExist:a.indexRequested?pc(a.index):(a.keyRequested||a.description)&&tb(a),ib(),wc()}}function
 sc(a,b,c,d,f,g){g=x(g),f=y(f);var 
h=a-d,i=c.length;if(b.index>=h&&b.index<h+i)qc(b,c,b.index-h,f,b.index);else 
if(d===i-1&&a<b.index||v(f)&&f<=b.index)rc(b,new e(q.doesNotExist));else 
if(b.index<h){var 
j=Rb(b,0,h-b.index);Vb(h,b,j,he(j,c[0].key,h-b.index,0))}else{var 
k=h+i-1,j=Rb(b,b.index-k,0);Vb(k,b,j,he(j,c[i-1].key,0,b.index-k))}}function 
tc(a,b,c){switch(c.name){case q.doesNotExist:a===Kd.index?(pc(0),rc(b,
 c)):wc();break;default:rc(b,c)}}function uc(){for(var 
a=0;a<ne.length&&"beginRefresh"!==ne[a].kind;a++);for(var 
b=a;b<ne.length&&"beginRefresh"!==ne[b].kind;b++);if(b>a&&b+(b-a)<ne.length){for(var
 
c=!0,d=b-a,e=0;d>e;e++)if(ne[a+e].kind!==ne[b+e].kind){c=!1;break}if(c&&g.log){g.log(s.refreshCycleIdentified,"winjs
 vds","error");for(var e=a;b>e;e++)g.log(""+(e-a)+": 
"+JSON.stringify(ne[e]),"winjs vds","error")}return c}}function 
vc(){return++me>h&&uc()?void 
Nb(o.failure):(ne[++oe%ne.length]={kind:"beginRefresh"},Zd={firstInSequence:!0,lastInSequence:!0,index:-1},$d={firstInSequence:!0,lastInSequence:!0},Zd.next=$d,$d.prev=Zd,Xd=!1,Yd=void
 0,_d={},ae={},be={},be[-1]=Zd,void(ce={}))}function 
wc(){if(!Td){if(Td=!0,Nb(o.waiting),xd)return xd=!1,void Zc();if(!vd){var 
a=++Cd;Ud=!0,Wd=0,k.schedule(function(){if(Cd===a){Td=!1,vc();for(var 
b=Kd.next;b!==Md;){var 
c=b.next;bb(b)||b===Ld||cb(b),b=c}Ec()}},k.Priority.high,null,"WinJS.VirtualizedDataSource.beginRefresh")}}}function
 xc(){return Vd=Vd
 ||new l,wc(),Vd.promise}function yc(a,b){return delete 
Fd[b],a!==Cd?!1:(Wd--,!0)}function zc(a,b,c,d,g){var 
h=Cd;Wd++,d.then(function(b){if(!b.items||!b.items.length)return 
j.wrapError(new e(q.doesNotExist));var d="itemsFetched id="+c+" 
count="+b.items.length;f(d),yc(h,c)&&(Sb(b),Kc(a,b.items,b.offset,b.totalCount,"number"==typeof
 
g?g:b.absoluteIndex)),u(d)}).then(null,function(d){yc(h,c)&&Lc(a,b,d)})}function
 Ac(a,b,c,d){if(he)zc(a.key,!1,b,he(b,a.key,c,d,a.hints));else{var 
e=10,f=a.index;be[f]&&be[f].firstInSequence?zc(a.key,!1,b,ie(b,f-1,Math.min(c+e,f)-1,d+1+e),f-1):be[f]&&be[f].lastInSequence?zc(a.key,!1,b,ie(b,f+1,Math.min(c+e,f)+1,d-1+e),f+1):zc(a.key,!1,b,ie(b,f,Math.min(c+e,f),d+e),f)}}function
 Bc(a){je?zc(null,!0,a,je(a,1),0):ie&&zc(null,!0,a,ie(a,0,0,0),0)}function 
Cc(a){return Fd[_d[a]]}function Dc(a,b){for(var 
c,d,e,f=3,g=Cd,h=0,i=a;i!==Md;i=i.next){if(!c&&i.key&&!ce[i.key]&&!Cc(i.key)){var
 
j=ae[i.key];(!j||j.firstInSequence||j.lastInSequence)&&(c=i,d=j,e=Qb())}if(c){va
 r 
k=Cc(i.key);if(ce[i.key]||ae[i.key]||k||(i.key&&(_d[i.key]=e),h++),i.lastInSequence||i.next===Ld||k){if(Ac(c,e,!d||d.firstInSequence?f:0,h-1+f),!b)break;c=null,h=0}}else
 
i.key&&V(i)&&!ce[i.key]&&(ae[i.key]||(e=Qb(),zc(i.key,!1,e,he(e,i.key,1,1,i.hints))))}0!==Wd||Xd||Cd!==g||Bc(Qb())}function
 Ec(){var a=Cd;do 
de=!1,ee=!0,Dc(Kd.next,!0),ee=!1;while(0===Wd&&de&&Cd===a&&Ud);0===Wd&&Cd===a&&Uc()}function
 Fc(a){var b=Cd;if(a){var c=Od[a];c||(c=Kd.next);do 
fe=!1,ge=!0,Dc(c,!1),ge=!1;while(fe&&Cd===b&&Ud)}ee?de=!0:0===Wd&&Cd===b&&Ec()}function
 Gc(a){if("object"==typeof a&&a){if(a===Hd)return Zd;if(a===Id)return 
$d;if(a.key)return ae[a.key];throw new 
e("WinJS.UI.ListDataSource.InvalidKeyReturned",s.invalidKeyReturned)}throw new 
e("WinJS.UI.ListDataSource.InvalidItemReturned",s.invalidItemReturned)}function 
Hc(a,b){for(;void 
0===a.index;){if(L(a,b,be),a.firstInSequence)return!0;a=a.prev,b--}return 
a.index!==b?(wc(),!1):!0}function 
Ic(a,b){a.key=b.key,ae[a.key]=a,a.item=b}function Jc(){for(
 var a=$d;!a.firstInSequence;)if(a=a.prev,a===Zd)return null;return a}function 
Kc(a,b,c,d,e){e=x(e),d=y(d);var f=!1;Xd=!0;var 
g=e-c,h=b[0];h.key===a&&(f=!0);var 
i=Gc(h);if(i){if(+g===g&&!Hc(i,g))return}else{if(be[g])return void wc();var 
j;if(void 0!==e&&(j=be[g-1])){if(!j.lastInSequence)return void 
wc();i=Q(j,be)}else{var k=+g===g?U(g,be,Zd,$d):Jc(Zd,$d);if(!k)return void 
wc();i=N(k,g,be)}Ic(i,b[0])}for(var 
l=b.length,m=1;l>m;m++){h=b[m],h.key===a&&(f=!0);var n=Gc(h);if(n){if(void 
0!==i.index&&!Hc(n,i.index+1))return;if(n!==i.next){if(!i.lastInSequence||!n.firstInSequence)return
 void wc();var o=E(n);if(o!==$d)G(i,n,o);else{var q=D(i);if(q===Zd)return void 
wc();F(n,q,i)}H(i)}else i.lastInSequence&&H(i)}else{if(!i.lastInSequence)return 
void 
wc();n=Q(i,be),Ic(n,h)}i=n}if(f||(ce[a]=!0),!v(d)&&!$d.firstInSequence){var 
r=$d.prev.index;void 
0!==r&&(d=r+1)}if(v(d)||d===p.unknown){if(v(Yd)){if(d!==Yd)return void 
wc()}else Yd=d;v(Yd)&&!be[Yd]&&L($d,Yd,be)}ge?fe=!0:Fc(a)}function 
Lc(a,b,c){swit
 ch(c.name){case q.noResponse:Nb(o.failure);break;case 
q.doesNotExist:b?(L($d,0,be),Yd=0,Uc()):(ce[a]=!0,ge?fe=!0:Fc(a))}}function 
Mc(a){return a===Zd?Kd:a===$d?Ld:Od[a.key]}function Nc(a){return 
a===Kd?Zd:a===Ld?$d:ae[a.key]}function 
Oc(a){H(a),a.next.mergedForRefresh=!0}function 
Pc(a,b){K(b,a.key),b.itemNew=a.item}function Qc(a,b,c){var 
d=A();Pc(a,d),J(d,b,c,!c);var 
e=a.index;return+e!==e&&(e=c?d.prev.index+1:b.next.index-1),L(d,e,Pd),d}function
 
Rc(a,b,c){a?(fc(a,b,a.bindingMap),hc(a,b,c.item)):(Pc(c,b),b.indexRequested&&dc(b))}function
 Sc(a,b,c){return 
b.key?!1:(a?(c.mergeWithPrev=!b.firstInSequence,c.mergeWithNext=!b.lastInSequence):c.stationary=!0,Rc(a,b,c),!0)}function
 Tc(a){var b;if(a.indexRequested)b=a.index;else{var 
c=Nc(a);c&&(b=c.index)}return b}function Uc(){me=0,ne=new 
Array(100),oe=-1,Ad=!0,_d={};var 
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s=[],t=[];for(o=0,h=Zd;h;h=h.next)h.sequenceNumber=o,h.firstInSequence&&(j=h),h.lastInSequence&&(t[o]={first:j,last:h,matchingItems:0},o
 
++);for(Rd=null,Qd=0,c=Kd.next;c!==Md;)h=ae[c.key],e=c.next,c!==Ld&&(bb(c)?c.key&&!h?sb(c,!1):0===Yd||c.indexRequested&&c.index>=Yd?sb(c,!0):c.item||c.keyRequested?c.itemNew=h.item:c.key&&(c.keyRequested||(delete
 Od[c.key],delete 
c.key),c.itemNew=null):cb(c)),c=e;for(c=Kd.next;c!==Ld;)e=c.next,c.indexRequested&&(h=be[c.index],h&&Rc(Mc(h),c,h)),c=e;var
 
u,v,w,x,y,z=0,A=[];for(k=0,c=Kd;c!==Md;c=c.next){if(c.firstInSequence)for(j=c,w=null,a=0;o>a;a++)A[a]=0;if(c.indexRequested&&(w=c),h=Nc(c),h&&A[h.sequenceNumber]++,c.lastInSequence){for(v=0,a=z;o>a;a++)v<A[a]&&(v=A[a],u=a);l={first:j,last:c,sequenceNew:v>0?t[u]:void
 
0,matchingItems:v},w&&(l.indexRequested=!0,l.stationarySlot=w),s[k]=l,c===Ld&&(x=k,y=l),k++,void
 
0!==t[u].first.index&&(z=u)}}s[0].sequenceNew!==t[0]&&(I(Kd),s[0].first=Kd.next,s.unshift({first:Kd,last:Kd,sequenceNew:t[0],matchingItems:1}),x++,k++);var
 
B=!Ld.firstInSequence;for(y.sequenceNew!==t[o-1]&&(I(Ld.prev),y.last=Ld.prev,x++,s.splice(x,0,{first:Ld,last:Ld,sequenceNew
 
:t[o-1],matchingItems:1}),k++,y=s[x]),a=0;k>a;a++)p=s[a].sequenceNew,p&&p.matchingItems<s[a].matchingItems&&(p.matchingItems=s[a].matchingItems,p.sequenceOld=s[a]);for(t[o-1].sequenceOld=y,y.stationarySlot=Ld,t[0].sequenceOld=s[0],s[0].stationarySlot=Kd,a=0;x>=a;a++)l=s[a],l.sequenceNew&&(n=l.sequenceNew.sequenceOld)===m&&m.last!==Ld?(Oc(n.last),n.last=l.last,delete
 
s[a]):m=l;for(m=null,a=x;a>=0;a--)l=s[a],l&&(l.sequenceNew&&(n=l.sequenceNew.sequenceOld)===m&&l.last!==Ld?(Oc(l.last),n.first=l.first,delete
 s[a]):m=l);B&&delete Ld.mergedForRefresh;var 
C=[];for(a=x+1;k>a;a++)if(l=s[a],l&&(!l.sequenceNew||l.sequenceNew.sequenceOld!==l)){var
 
D=!0,E=null,J=null,K=0;for(h=Nc(l.first),h&&(E=J=h,K=1),c=l.first;c!==l.last;c=c.next){var
 
L=Nc(c.next);if(h&&L&&(h.lastInSequence||h.next!==L)){D=!1;break}h&&!E&&(E=J=h),L&&E&&(J=L,K++),h=L}if(D&&E&&void
 0!==E.index){var M;E.firstInSequence||(f=Mc(E.prev),f&&(M=f.index));var 
N;if(J.lastInSequence||(g=Mc(J.next),g&&(N=g.index)),(!g||g.lastInSequence|
 |g.mergedForRefresh)&&(void 0===M||void 
0===N||N-M-1>=K)){for(l.locationJustDetermined=!0,h=E;h.locationJustDetermined=!0,h!==J;h=h.next);var
 
j=Mc(E),O=Mc(J);C.push({slotBeforeSequence:j.firstInSequence?null:j.prev,slotFirstInSequence:j,slotLastInSequence:O,slotAfterSequence:O.lastInSequence?null:O.next})}}}for(a=0;k>a;a++)if(l=s[a],!(!l||l.indexRequested||l.locationJustDetermined||l.sequenceNew&&l.sequenceNew.sequenceOld===l)){l.sequenceNew=null,c=l.first;var
 
P;do{if(P=c===l.last,e=c.next,c!==Kd&&c!==Ld&&c!==Md&&!c.item&&!c.keyRequested)if(sb(c,!0),l.first===c){if(l.last===c){delete
 s[a];break}l.first=c.next}else 
l.last===c&&(l.last=c.prev);c=e}while(!P)}for(a=0;o>a;a++){for(p=t[a],h=p.first;!Mc(h)&&!h.lastInSequence;h=h.next);if(h.lastInSequence&&!Mc(h))p.firstInner=p.lastInner=null;else{for(p.firstInner=h,h=p.last;!Mc(h);h=h.prev);p.lastInner=h}}for(a=0;o>a;a++)if(p=t[a],p&&p.firstInner&&(l=p.sequenceOld)){var
 Q=0;for(c=l.first;!0&&(h=Nc(c),h&&h.sequenceNumber===p.firstInner.sequ
 enceNumber&&(h.ordinal=Q),!c.lastInSequence);c=c.next,Q++);var 
R=[];for(h=p.firstInner;!0;h=h.next){if(Q=h.ordinal,void 0!==Q){for(var 
S=0,T=R.length-1;T>=S;){var 
U=Math.floor(.5*(S+T));R[U].ordinal<Q?S=U+1:T=U-1}R[S]=h,S>0&&(h.predecessor=R[S-1])}if(h===p.lastInner)break}var
 
W=[],X=R.length;for(h=R[X-1],b=X;b--;)h.stationary=!0,W[b]=h,h=h.predecessor;l.stationarySlot=Mc(W[0]),h=W[0],c=Mc(h),d=c.prev;for(var
 
Y=c.firstInSequence;!h.firstInSequence;)if(h=h.prev,i=Mc(h),!i||h.locationJustDetermined)for(;!Y&&d!==Kd&&(c=d,d=c.prev,Y=c.firstInSequence,!Sc(i,c,h)););for(b=0;X-1>b;b++){h=W[b],c=Mc(h);var
 
i,Z=W[b+1],_=null,ab=Mc(Z);for(e=c.next,h=h.next;h!==Z&&!_&&c!==ab;h=h.next)if(i=Mc(h),!i||h.locationJustDetermined)for(;e!==ab;){if(e.mergedForRefresh){_=h.prev;break}if(c=e,e=c.next,Sc(i,c,h))break}if(_)for(d=ab.prev,h=Z.prev;h!==_&&ab!==c;h=h.prev)if(i=Mc(h),!i||h.locationJustDetermined)for(;d!==c&&(ab=d,d=ab.prev,!Sc(i,ab,h)););for(;e!==ab;)c=e,e=c.next,c!==Kd&&V(c)&&!c.keyRequested&&sb
 
(c)}for(h=W[X-1],c=Mc(h),e=c.next,Y=c.lastInSequence;!h.lastInSequence;)if(h=h.next,i=Mc(h),!i||h.locationJustDetermined)for(;!Y&&e!==Ld&&(c=e,e=c.next,Y=c.lastInSequence,!Sc(i,c,h)););}for(a=0;o>a;a++)if(p=t[a],p.firstInner)for(d=null,h=p.firstInner;!0;h=h.next){if(c=Mc(h)){if(!h.stationary){var
 db,eb=!1,fb=!1;if(d)db=d.next,eb=!0;else{var 
gb;for(gb=p.firstInner;!gb.stationary&&gb!==p.lastInner;gb=gb.next);if(gb.stationary)db=Mc(gb),fb=!0;else
 if(q=h.index,0===q)db=Kd.next,eb=!0;else if(void 
0===q)db=Md;else{db=Kd.next;for(var 
hb=null;;){if(db.firstInSequence&&(hb=db),q<db.index&&hb||db===Ld)break;db=db.next}!db.firstInSequence&&hb&&(db=hb)}}c.mergedForRefresh&&(delete
 
c.mergedForRefresh,c.lastInSequence||(c.next.mergedForRefresh=!0)),eb=eb||h.mergeWithPrev,fb=fb||h.mergeWithNext;var
 
jb=h.locationJustDetermined;rb(c,db,eb,fb,jb),jb&&fb&&(db.mergedForRefresh=!0)}d=c}if(h===p.lastInner)break}for(a=0;o>a;a++)if(p=t[a],p.firstInner)for(d=null,h=p.firstInner;!0;h=h.next){if(c=Mc(h),!c){
 var kb;if(d)kb=d.next;else{var 
mb;for(mb=p.firstInner;!Mc(mb);mb=mb.next);kb=Mc(mb)}c=Qc(h,kb,!!d);var 
L=Nc(kb);kb.mergedForRefresh||L&&L.locationJustDetermined||($(c),pb(c))}if(d=c,h===p.lastInner)break}Pd=[];var
 ob=-1;for(c=Kd,r=0;c!==Md;r++){var 
e=c.next;if(c.firstInSequence&&(j=c,r=0),void 0===ob){var qb=Tc(c);void 
0!==qb&&(ob=qb-r)}if(void 0!==ob&&!c.lastInSequence){var tb=Tc(c.next);if(void 
0!==tb&&tb!==ob+r+1){I(c);for(var ub=!0,vb=c.next,wb=!1;!wb&&vb!==Ld;){var 
xb=vb.next;wb=vb.lastInSequence,rb(vb,xb,!ub,!1),ub=!1,vb=xb}}}if(c.lastInSequence){q=ob;for(var
 yb=j;yb!==e;){var zb=yb.next;if(q>=Yd&&yb!==Ld)sb(yb,!0);else{var 
Ab=Pd[q];q!==yb.index?(delete 
Pd[q],nb(yb,q)):+q===q&&Pd[q]!==yb&&(Pd[q]=yb),yb.itemNew&&dc(yb),Ab&&(yb.key?(fc(yb,Ab,yb.bindingMap),gc(yb,Ab),+q===q&&(Pd[q]=yb)):(fc(Ab,yb,Ab.bindingMap),gc(Ab,yb),+q===q&&(Pd[q]=Ab))),+q===q&&q++}yb=zb}ob=void
 0}c=e}var Bb,Db=-2;for(c=Kd,r=0;c!==Md;r++){var 
e=c.next;if(c.firstInSequence&&(j=c,r=0),delete c.mergedForRefresh
 ,c.lastInSequence)if(void 0===j.index){f=j.prev;var 
Eb;f&&(Eb=Nc(f))&&!Eb.lastInSequence&&(h=Nc(c))&&h.prev===Eb?(G(f,j,c),H(f)):c===Ld||Bb||F(Md,j,c)}else{if(Db<c.index&&!Bb)Db=c.index;else{for(g=Kd.next;g.index<c.index;g=g.next);for(var
 vb=j;vb!==e;){var 
xb=vb.next;h=Nc(vb),rb(vb,g,g.prev.index===vb.index-1,g.index===vb.index+1,h&&h.locationJustDetermined),vb=xb}}f=j.prev,f&&f.index===j.index-1&&H(f)}c===Ld&&(Bb=!0),c=e}Ad=!1,oc(C),void
 0!==Yd&&Yd!==Jd&&lb(Yd),ib();var Fb=[];for(a=0;o>a;a++){p=t[a];var 
Gb=[];c=null,r=0;var 
Hb;for(h=p.first;!0&&(h===Zd?Gb.push(Hd):h===$d?Gb.push(Id):(Gb.push(h.item),c||(c=Mc(h),Hb=r)),!h.lastInSequence);h=h.next,r++);c&&Fb.push({slot:c,results:Gb,offset:Hb})}for(vc(),Ud=!1,Cb(),a=0;a<Fb.length;a++){var
 Ib=Fb[a];qc(Ib.slot,Ib.results,Ib.offset,Jd,Ib.slot.index)}if(Vd){var 
Jb=Vd;Vd=null,Jb.complete()}ac()}function Vc(a,b,c,d,e,f,g){var 
h=ud.prev,i={prev:h,next:ud,applyEdit:a,editType:b,complete:c,error:d,keyUpdate:e};h.next=i,ud.prev=i,vd=!0,(Td||Ud)
 
&&(Cd++,Ud=!1,Td=!0),ud.next===i&&Zc(),i.failed||(f(),i.undo=g),sd||$c()}function
 Wc(){td=!1;var a=ud.next.next;
-ud.next=a,a.prev=ud}function Xc(){for(;ud.prev!==ud;){var 
a=ud.prev;a.error&&a.error(new 
e(r.canceled)),a.undo&&!Td&&a.undo(),ud.prev=a.prev}ud.next=ud,sd=!1,$c()}function
 Yc(b){function c(){xd||(f?wd=!0:Zc())}function d(a){if(a){var 
d;if(g&&g.key!==a.key){var e=a.key;if(b.undo){if(d=g.slot){var 
h=d.key;h&&delete Od[h],K(d,e),d.itemNew=a,d.item?(qb(d),ib()):Bb(d)}}else 
g.key=e}else 
b.editType===re.change&&(d.itemNew=a,f||cc(d))}Wc(),b.complete&&b.complete(a),c()}function
 e(a){switch(a.Name){case r.noResponse:return 
Nb(o.failure),xd=!0,void(td=!1);case r.notPermitted:break;case 
r.noLongerMeaningful:wc()}b.failed=!0,Wc(),Xc(),b.error&&b.error(a),c()}if(!td){var
 
f=!0,g=b.keyUpdate;a.beginEdits&&!rd&&(rd=!0,a.beginEdits()),td=!0,b.applyEdit().then(d,e),f=!1}}function
 Zc(){for(;ud.next!==ud;)if(wd=!1,Yc(ud.next),!wd)return;_c()}function 
$c(){yb(),ib(),Cb(),ud.next===ud&&_c()}function 
_c(){vd=!1,a.endEdits&&rd&&!sd&&(rd=!1,a.endEdits()),Td?(Td=!1,wc()):ac()}function
 ad(a){return Ib(a),Od[
 a]||Jb(a)}function bd(a,b,c,d,e){var f=A();return 
J(f,c,d,e),a&&K(f,a),f.itemNew=b,wb(f,1),sd||yd||(f.firstInSequence||"number"!=typeof
 f.prev.index?f.lastInSequence||"number"!=typeof 
f.next.index||L(f,f.next.index-1,Pd):L(f,f.prev.index+1,Pd)),$(f),pb(f),f}function
 cd(a,b,c,d,e){var f={key:a};return new 
j(function(a,g){Vc(e,re.insert,a,g,f,function(){if(c){var 
a={key:f.key,data:b};f.slot=bd(f.key,a,c,d,!d)}},function(){var 
a=f.slot;a&&(wb(a,-1),sb(a,!1))})})}function dd(a,b,c,d){return new 
j(function(e,f){var 
g,h,i,j;Vc(d,re.move,e,f,null,function(){h=a.next,i=a.firstInSequence,j=a.lastInSequence;var
 d=a.prev;g=!("number"==typeof 
a.index||!i&&d.item||!j&&h.item),wb(a,-1),rb(a,b,c,!c),wb(a,1),g&&(I(d),i||mc(d,a),j||nc(h,a))},function(){g?wc():(wb(a,-1),rb(a,h,!i,!j),wb(a,1))})})}function
 ed(){function a(){yd||(yb(),ib(),Cb())}this.invalidateAll=function(){return 
0===Jd?(this.reload(),j.wrap()):xc()},this.reload=function(){pd&&pd.cancel(),Vd&&Vd.cancel();for(var
 a=Kd.next;a!==Md;a=a.
 next){var b=a.fetchListeners;for(var c in b)b[c].promise.cancel();var 
d=a.directFetchListeners;for(var c in 
d)d[c].promise.cancel()}fd(),fb(function(a){a.notificationHandler&&a.notificationHandler.reload()})},this.beginNotifications=function(){yd=!0},this.inserted=function(b,c,d,e){if(vd)wc();else{var
 f=b.key,g=Od[c],h=Od[d],i="string"==typeof c,j="string"==typeof 
d;if(i?h&&!h.firstInSequence&&(g=h.prev):j&&g&&!g.lastInSequence&&(h=g.next),(i||j)&&!g&&!h&&Kd.next===Ld)return
 void wc();if(Od[f])return void 
wc();if(g&&h&&(g.next!==h||g.lastInSequence||h.firstInSequence))return void 
wc();if(g&&(g.keyRequested||g.indexRequested)||h&&(h.keyRequested||h.indexRequested))return
 void wc();if(g||h)bd(f,b,h?h:g.next,!!g,!!h);else 
if(Kd.next===Ld)bd(f,b,Kd.next,!0,!0);else{if(void 0===e)return void 
wc();xb(e,1)}a()}},this.changed=function(b){if(vd)wc();else{var 
c=b.key,d=Od[c];d&&(d.keyRequested?wc():(d.itemNew=b,d.item&&(qb(d),a())))}},this.moved=function(b,c,d,e,f){if(vd)wc();else{var
 g=b.key
 
,h=Od[g],i=Od[c],j=Od[d];h&&h.keyRequested||i&&i.keyRequested||j&&j.keyRequested?wc():h?i&&j&&(i.next!==j||i.lastInSequence||j.firstInSequence)?wc():i||j?(wb(h,-1),rb(h,j?j:i.next,!!i,!!j),wb(h,1),a()):(wb(h,-1),sb(h,!1),void
 0!==e&&(f>e&&f--,xb(f,1)),a()):i||j?(void 
0!==e&&(xb(e,-1),f>e&&f--),this.inserted(b,c,d,f)):void 
0!==e&&(xb(e,-1),f>e&&f--,xb(f,1),a())}},this.removed=function(b,c){if(vd)wc();else{var
 d;d="string"==typeof 
b?Od[b]:Pd[c],d?d.keyRequested?wc():(wb(d,-1),sb(d,!1),a()):void 
0!==c&&(xb(c,-1),a())}},this.endNotifications=function(){yd=!1,a()}}function 
fd(){Nb(o.ready),pd=null,rd=!1,sd=!1,td=!1,ud={},ud.next=ud,ud.prev=ud,vd=!1,xd=!1,zd=0,Ad=!1,Bd=0,Fd={},Gd=[],Jd=p.unknown,Kd={firstInSequence:!0,lastInSequence:!0,index:-1},Ld={firstInSequence:!0,lastInSequence:!0},Md={firstInSequence:!0,lastInSequence:!0},Kd.next=Ld,Ld.prev=Kd,Ld.next=Md,Md.prev=Ld,Nd={},Od={},Pd={},Pd[-1]=Kd,Qd=0,Rd=null,Sd=!1,Td=!1,Ud=!1,Vd=null}var
 gd,hd,id,jd,kd,ld,md,nd,od,pd,qd,rd,sd,td,ud,vd,
 
wd,xd,yd,zd,Ad,Bd,Cd,Dd,Ed,Fd,Gd,Hd,Id,Jd,Kd,Ld,Md,Nd,Od,Pd,Qd,Rd,Sd,Td,Ud,Vd,Wd,Xd,Yd,Zd,$d,_d,ae,be,ce,de,ee,fe,ge,he,ie,je,ke,le,me=0,ne=new
 Array(100),oe=-1;a.itemsFromKey&&(he=function(b,c,d,e,g){var 
h="fetchItemsFromKey id="+b+" key="+c+" countBefore="+d+" 
countAfter="+e;f(h),ne[++oe%ne.length]={kind:"itemsFromKey",key:c,countBefore:d,countAfter:e};var
 i=a.itemsFromKey(c,d,e,g);return 
u(h),i}),a.itemsFromIndex&&(ie=function(b,c,d,e){var g="fetchItemsFromIndex 
id="+b+" index="+c+" countBefore="+d+" 
countAfter="+e;f(g),ne[++oe%ne.length]={kind:"itemsFromIndex",index:c,countBefore:d,countAfter:e};var
 h=a.itemsFromIndex(c,d,e);return 
u(g),h}),a.itemsFromStart&&(je=function(b,c){var d="fetchItemsFromStart 
id="+b+" count="+c;f(d),ne[++oe%ne.length]={kind:"itemsFromStart",count:c};var 
e=a.itemsFromStart(c);return u(d),e}),a.itemsFromEnd&&(ke=function(b,c){var 
d="fetchItemsFromEnd id="+b+" 
count="+c;f(d),ne[++oe%ne.length]={kind:"itemsFromEnd",count:c};var 
e=a.itemsFromEnd(c);return u
 (d),e}),a.itemsFromDescription&&(le=function(b,c,d,e){var 
g="fetchItemsFromDescription id="+b+" desc="+c+" countBefore="+d+" 
countAfter="+e;f(g),ne[++oe%ne.length]={kind:"itemsFromDescription",description:c,countBefore:d,countAfter:e};var
 h=a.itemsFromDescription(c,d,e);return u(g),h});var 
pe=++n,qe=this,re={insert:"insert",change:"change",move:"move",remove:"remove"};if(!a)throw
 new 
e("WinJS.UI.ListDataSource.ListDataAdapterIsInvalid",s.listDataAdapterIsInvalid);hd=a.compareByIdentity?0:200,c&&"number"==typeof
 c.cacheSize&&(hd=c.cacheSize),a.setNotificationHandler&&(gd=new 
ed,a.setNotificationHandler(gd)),id=o.ready,kd=!1,ld={},md=0,nd=1,od=0,Cd=0,Dd=!1,Ed=1,Hd={},Id={},fd(),this.createListBinding=function(a){function
 b(a){a&&a.cursorCount++}function c(a){a&&0===--a.cursorCount&&eb(a)}function 
d(a){b(a),c(m),m=a}function 
e(a,b){a===m&&(b||(b=!m||m.lastInSequence||m.next===Ld?null:m.next),d(b))}function
 f(a){var b=a.bindingMap,c=b[l].handle;delete a.bindingMap[l];var 
d=!0,e=!0;for(v
 ar f in b)if(d=!1,c&&b[f].handle===c){e=!1;break}c&&e&&delete 
Nd[c],d&&(a.bindingMap=null,eb(a))}function 
g(a,b){a.bindingMap||(a.bindingMap={});var 
c=a.bindingMap[l];if(c?c.count++:a.bindingMap[l]={bindingRecord:ld[l],count:1},a.fetchListeners){var
 d=a.fetchListeners[b];d&&(d.retained=!0)}}function h(a){var b=Nd[a];if(b){var 
c=b.bindingMap[l];if(0===--c.count){var d=b.fetchListeners;for(var e in d){var 
g=d[e];g.listBindingID===l&&(g.retained=!1)}f(b)}}}function i(b){var 
c=jb(b,l),d=(od++).toString(),e=zb(b,"fetchListeners",d,l,function(a,b){a(kb(b,c))});return
 X(e,b,c),a&&(e.retain=function(){return 
o._retainItem(b,d),e},e.release=function(){o._releaseItem(c)}),e}function 
k(b){var c;return!n&&b?c=i(b):(n?(c=new 
j(function(){}),c.cancel()):c=j.wrap(null),W(c,null),a&&(c.retain=function(){return
 c},c.release=function(){})),d(b),c}var 
l=(md++).toString(),m=null,n=!1;ld[l]={notificationHandler:a,notificationsSent:!1,adjustCurrentSlot:e,itemPromiseFromKnownSlot:i};var
 o={_retainItem:fun
 
ction(a,b){g(a,b)},_releaseItem:function(a){h(a)},jumpToItem:function(a){return 
k(a?Nd[a.handle]:null)},current:function(){return 
k(m)},previous:function(){return k(m?Fb(m):null)},next:function(){return 
k(m?Gb(m):null)},releaseItem:function(a){this._releaseItem(a.handle)},release:function(){n=!0,c(m),m=null;for(var
 a=Kd.next;a!==Md;){var b=a.next,d=a.fetchListeners;for(var e in d){var 
g=d[e];g.listBindingID===l&&(g.promise.cancel(),delete 
d[e])}a.bindingMap&&a.bindingMap[l]&&f(a),a=b}delete 
ld[l]}};return(je||ie)&&(o.first=function(){return 
k(Gb(Kd))}),ke&&(o.last=function(){return 
k(Fb(Ld))}),he&&(o.fromKey=function(a,b){return 
k(Kb(a,b))}),(ie||je&&he)&&(o.fromIndex=function(a){return 
k(Lb(a))}),le&&(o.fromDescription=function(a){return 
k(Mb(a))}),o},this.invalidateAll=function(){return xc()};var 
se=function(a,b){var c=new 
l;a.then(function(a){c.complete(a)},function(a){c.error(a)});var 
d=c.promise.then(null,function(c){return"WinJS.UI.VirtualizedDataSource.resetCount"===c.name?(p
 d=null,a=b.getCount()):j.wrapError(c)}),f=0,g={get:function(){return f++,new 
j(function(a,b){d.then(a,b)},function(){0===--f&&(c.promise.cancel(),a.cancel(),g===pd&&(pd=null))})},reset:function(){c.error(new
 
e("WinJS.UI.VirtualizedDataSource.resetCount"))},cancel:function(){c.promise.cancel(),a.cancel(),g===pd&&(pd=null)}};return
 g};this.getCount=function(){if(a.getCount){var b=this;return 
j.wrap().then(function(){if(sd||vd)return Jd;var c;if(!pd){var 
d;c=a.getCount();var 
e;c.then(function(){pd===d&&(pd=null),e=!0},function(){pd===d&&(pd=null),e=!0}),zd=0,e||(d=pd=se(c,b))}return
 pd?pd.get():c}).then(function(a){if(!w(a)&&void 0!==a)throw new 
e("WinJS.UI.ListDataSource.InvalidRequestedCountReturned",s.invalidRequestedCountReturned);return
 
a!==Jd&&(Jd===p.unknown?Jd=a:(lb(a),ib())),0===a&&(Kd.next!==Ld||Ld.next!==Md?wc():Kd.lastInSequence&&(H(Kd),Ld.index=0)),a}).then(null,function(a){return
 a.name===m.CountError.noResponse?(Nb(o.failure),Jd):j.wrapError(a)})}return 
j.wrap(Jd)},he&&(
 this.itemFromKey=function(a,b){return 
Hb(Kb(a,b))}),(ie||je&&he)&&(this.itemFromIndex=function(a){return 
Hb(Lb(a))}),le&&(this.itemFromDescription=function(a){return 
Hb(Mb(a))}),this.beginEdits=function(){sd=!0},a.insertAtStart&&(this.insertAtStart=function(b,c){return
 cd(b,c,Kd.lastInSequence?null:Kd.next,!0,function(){return 
a.insertAtStart(b,c)})}),a.insertBefore&&(this.insertBefore=function(b,c,d){var 
e=ad(d);return cd(b,c,e,!1,function(){return 
a.insertBefore(b,c,d,ub(e))})}),a.insertAfter&&(this.insertAfter=function(b,c,d){var
 e=ad(d);return cd(b,c,e?e.next:null,!0,function(){return 
a.insertAfter(b,c,d,ub(e))})}),a.insertAtEnd&&(this.insertAtEnd=function(b,c){return
 cd(b,c,Ld.firstInSequence?null:Ld,!1,function(){return 
a.insertAtEnd(b,c)})}),a.change&&(this.change=function(b,c){var d=ad(b);return 
new j(function(e,f){var g;Vc(function(){return 
a.change(b,c,ub(d))},re.change,e,f,null,function(){g=d.item,d.itemNew={key:b,data:c},g?qb(d):Bb(d)},function(){g?(d.itemNew=g,qb(d)):wc
 ()})})}),a.moveToStart&&(this.moveToStart=function(b){var c=ad(b);return 
dd(c,Kd.next,!0,function(){return 
a.moveToStart(b,ub(c))})}),a.moveBefore&&(this.moveBefore=function(b,c){var 
d=ad(b),e=ad(c);return dd(d,e,!1,function(){return 
a.moveBefore(b,c,ub(d),ub(e))})}),a.moveAfter&&(this.moveAfter=function(b,c){var
 d=ad(b),e=ad(c);return dd(d,e.next,!0,function(){return 
a.moveAfter(b,c,ub(d),ub(e))})}),a.moveToEnd&&(this.moveToEnd=function(b){var 
c=ad(b);return dd(c,Ld,!1,function(){return 
a.moveToEnd(b,ub(c))})}),a.remove&&(this.remove=function(b){Ib(b);var 
c=Od[b];return new j(function(d,e){var f,g,h;Vc(function(){return 
a.remove(b,ub(c))},re.remove,d,e,null,function(){c&&(f=c.next,g=c.firstInSequence,h=c.lastInSequence,wb(c,-1),sb(c,!1))},function(){c&&(R(c,f,!g,!h),wb(c,1),pb(c))})})}),this.endEdits=function(){sd=!1,$c()}}var
 
h=100,n=1,o=m.DataSourceStatus,p=m.CountResult,q=m.FetchError,r=m.EditError,s={get
 listDataAdapterIsInvalid(){return"Invalid argument: listDataAdapter must b
 e an object or an array."},get indexIsInvalid(){return"Invalid argument: index 
must be a non-negative integer."},get keyIsInvalid(){return"Invalid argument: 
key must be a string."},get invalidItemReturned(){return"Error: data adapter 
returned item that is not an object."},get invalidKeyReturned(){return"Error: 
data adapter returned item with undefined or null key."},get 
invalidIndexReturned(){return"Error: data adapter should return undefined, null 
or a non-negative integer for the index."},get 
invalidCountReturned(){return"Error: data adapter should return undefined, 
null, CountResult.unknown, or a non-negative integer for the count."},get 
invalidRequestedCountReturned(){return"Error: data adapter should return 
CountResult.unknown, CountResult.failure, or a non-negative integer for the 
count."},get refreshCycleIdentified(){return"refresh cycle found, likely data 
inconsistency"}},t="statuschanged",u=c.Class.define(function(){},{_baseDataSourceConstructor:a,_isVirtualizedDataSource:!
 0},{supportedForProcessing:!1});return 
c.Class.mix(u,f.eventMixin),u})})}),d("WinJS/VirtualizedDataSource/_GroupDataSource",["exports","../Core/_Base","../Core/_ErrorFromName","../Promise","../Scheduler","../Utilities/_UI","./_VirtualizedDataSourceImpl"],function(a,b,c,d,e,f,g){"use
 
strict";b.Namespace._moduleDefine(a,"WinJS.UI",{_GroupDataSource:b.Namespace._lazy(function(){function
 a(){return new c(f.FetchError.doesNotExist)}function h(a){return 
a&&a.firstReached&&a.lastReached}var 
i=101,j=b.Class.define(function(a){this._groupDataAdapter=a},{beginNotifications:function(){},inserted:function(a,b,c){this._groupDataAdapter._inserted(a,b,c)},changed:function(a,b){this._groupDataAdapter._changed(a,b)},moved:function(a,b,c){this._groupDataAdapter._moved(a,b,c)},removed:function(a,b){this._groupDataAdapter._removed(a,b)},countChanged:function(a,b){0===a&&0!==b&&this._groupDataAdapter.invalidateGroups()},indexChanged:function(a,b,c){this._groupDataAdapter._indexChanged(a,b,c)},endNotific
 
ations:function(){this._groupDataAdapter._endNotifications()},reload:function(){this._groupDataAdapter._reload()}},{supportedForProcessing:!1}),k=b.Class.define(function(a,b,c,d){this._listBinding=a.createListBinding(new
 
j(this)),this._groupKey=b,this._groupData=c,this._initializeState(),this._batchSize=i,this._count=null,d&&("number"==typeof
 
d.groupCountEstimate&&(this._count=d.groupCountEstimate<0?null:Math.max(d.groupCountEstimate,1)),"number"==typeof
 
d.batchSize&&(this._batchSize=d.batchSize+1)),this._listBinding.last&&(this.itemsFromEnd=function(a){var
 b=this;return this._fetchItems(function(){return 
b._lastGroup},function(a){if(a)return!1;var 
c=b._count;return+c!==c?!0:c>0?!0:void 
0},function(){b._fetchBatch(b._listBinding.last(),b._batchSize-1,0)},a-1,0)})},{setNotificationHandler:function(a){this._listDataNotificationHandler=a},compareByIdentity:!0,itemsFromKey:function(a,b,c,d){var
 e=this;return this._fetchItems(function(){return e._keyMap[a]},function(){var 
a=e._lastGroup;
 return a?+a.index!==a.index?!0:void 0:!0},function(){d=d||{};var 
a="string"==typeof 
d.groupMemberKey&&e._listBinding.fromKey?e._listBinding.fromKey(d.groupMemberKey):"number"==typeof
 
d.groupMemberIndex&&e._listBinding.fromIndex?e._listBinding.fromIndex(d.groupMemberIndex):void
 
0!==d.groupMemberDescription&&e._listBinding.fromDescription?e._listBinding.fromDescription(d.groupMemberDescription):e._listBinding.first(),b=Math.floor(.5*(e._batchSize-1));e._fetchBatch(a,b,e._batchSize-1-b)},b,c)},itemsFromIndex:function(a,b,c){var
 d=this;return this._fetchItems(function(){return 
d._indexMap[a]},function(){var b=d._lastGroup;return 
b?+b.index!==b.index?!0:a<=b.index?!0:void 
0:!0},function(){d._fetchNextIndex()},b,c)},getCount:function(){if(this._lastGroup&&"number"==typeof
 this._lastGroup.index)return d.wrap(this._count);var a=this,b=new 
d(function(b){var 
c={initialBatch:function(){a._fetchNextIndex()},getGroup:function(){return 
null},countBefore:0,countAfter:0,complete:function(c){c&&(a._
 count=0);var d=a._count;return"number"==typeof 
d?(b(d),!0):!1}};a._fetchQueue.push(c),a._itemBatch||a._continueFetch(c)});return"number"==typeof
 
this._count?d.wrap(this._count):b},invalidateGroups:function(){this._beginRefresh(),this._initializeState()},_initializeState:function(){this._count=null,this._indexMax=null,this._keyMap={},this._indexMap={},this._lastGroup=null,this._handleMap={},this._fetchQueue=[],this._itemBatch=null,this._itemsToFetch=0,this._indicesChanged=!1},_releaseItem:function(a){delete
 
this._handleMap[a.handle],this._listBinding.releaseItem(a)},_processBatch:function(){for(var
 a=null,b=null,c=null,d=0,f=!0,g=0;g<this._batchSize;g++){var 
h=this._itemBatch[g],i=h?this._groupKey(h):null;if(h&&(f=!1),b&&null!==i&&i===b.key)d++,b.lastItem===a?(b.lastItem.handle!==b.firstItem.handle&&this._releaseItem(b.lastItem),b.lastItem=h,this._handleMap[h.handle]=b,b.size++):b.firstItem===h&&(b.firstItem.handle!==b.lastItem.handle&&this._releaseItem(b.firstItem),b.firstItem=c,thi
 s._handleMap[c.handle]=b,b.size+=d);else{var 
j=null;if(b&&(b.lastReached=!0,"number"==typeof b.index&&(j=b.index+1)),h){var 
k=this._keyMap[i];if(k||(k={key:i,data:this._groupData(h),firstItem:h,lastItem:h,size:1},this._keyMap[k.key]=k,this._handleMap[h.handle]=k),g>0&&(k.firstReached=!0,b||(j=0)),"number"!=typeof
 k.index&&"number"==typeof j){for(var 
l=k;l;l=this._nextGroup(l))l.index=j,this._indexMap[j]=l,j++;this._indexMax=j,"number"==typeof
 
this._count&&!this._lastGroup&&this._count<=this._indexMax&&(this._count=this._indexMax+1)}c=h,d=0,b=k}else
 b&&(this._lastGroup=b,"number"==typeof 
b.index&&(this._count=b.index+1),this._listDataNotificationHandler.invalidateAll(),b=null)}a=h}var
 
m;for(m=this._fetchQueue[0];m&&m.complete(f);m=this._fetchQueue[0])this._fetchQueue.splice(0,1);if(m){var
 
n=this;e.schedule(function(){n._continueFetch(m)},e.Priority.normal,null,"WinJS.UI._GroupDataSource._continueFetch")}else
 this._itemBatch=null},_processPromise:function(a,b){a.retain(),this._itemBat
 ch[b]=a;var 
c=this;a.then(function(a){c._itemBatch[b]=a,0===--c._itemsToFetch&&c._processBatch()})},_fetchBatch:function(a,b){this._itemBatch=new
 
Array(this._batchSize),this._itemsToFetch=this._batchSize,this._processPromise(a,b);var
 
c;for(this._listBinding.jumpToItem(a),c=b-1;c>=0;c--)this._processPromise(this._listBinding.previous(),c);for(this._listBinding.jumpToItem(a),c=b+1;c<this._batchSize;c++)this._processPromise(this._listBinding.next(),c)},_fetchAdjacent:function(a,b){this._fetchBatch(this._listBinding.fromKey?this._listBinding.fromKey(a.key):this._listBinding.fromIndex(a.index),b?0:this._batchSize-1,b?this._batchSize-1:0)},_fetchNextIndex:function(){var
 
a=this._indexMap[this._indexMax-1];a?this._fetchAdjacent(a.lastItem,!0):this._fetchBatch(this._listBinding.first(),1,this._batchSize-2)},_continueFetch:function(a){if(a.initialBatch)a.initialBatch(),a.initialBatch=null;else{var
 b=a.getGroup();if(b){var 
c,d;b.firstReached?b.lastReached?a.countBefore>0&&0!==b.index&&!h(c=thi
 
s._previousGroup(b))?this._fetchAdjacent(c&&c.lastReached?c.firstItem:b.firstItem,!1):(d=this._nextGroup(b),this._fetchAdjacent(d&&d.firstReached?d.lastItem:b.lastItem,!0)):this._fetchAdjacent(b.lastItem,!0):this._fetchAdjacent(b.firstItem,!1)}else
 this._fetchNextIndex()}},_fetchComplete:function(a,b,c,d,e){if(h(a)){var 
g=this._previousGroup(a);if(d||h(g)||0===a.index||0===b){var 
i=this._nextGroup(a);if(d||h(i)||this._lastGroup===a||0===c){for(var 
j=0,k=a;b>j&&(g=this._previousGroup(k),h(g));)k=g,j++;for(var 
l=0,m=a;c>l&&(i=this._nextGroup(m),h(i));)m=i,l++;for(var n=j+1+l,o=new 
Array(n),p=0;n>p;p++){var 
q={key:k.key,data:k.data,firstItemKey:k.firstItem.key,groupSize:k.size},r=k.firstItem.index;"number"==typeof
 r&&(q.firstItemIndexHint=r),o[p]=q,k=this._nextGroup(k)}var 
s={items:o,offset:j};return s.totalCount="number"==typeof 
this._count?this._count:f.CountResult.unknown,"number"==typeof 
a.index&&(s.absoluteIndex=a.index),m===this._lastGroup&&(s.atEnd=!0),e(s),!0}}}return!1},_fetch
 Items:function(b,c,e,f,g){var h=this;return new d(function(d,i){function 
j(e){var j=b();return 
j?h._fetchComplete(j,f,g,l,d,i):l&&!c(e)?(i(a()),!0):m>2?(i(a()),!0):(e?m++:m=0,!1)}var
 k=b(),l=!k,m=0;if(!j()){var 
n={initialBatch:l?e:null,getGroup:b,countBefore:f,countAfter:g,complete:j};h._fetchQueue.push(n),h._itemBatch||h._continueFetch(n)}})},_previousGroup:function(a){return
 
a&&a.firstReached?(this._listBinding.jumpToItem(a.firstItem),this._handleMap[this._listBinding.previous().handle]):null},_nextGroup:function(a){return
 
a&&a.lastReached?(this._listBinding.jumpToItem(a.lastItem),this._handleMap[this._listBinding.next().handle]):null},_invalidateIndices:function(a){this._count=null,this._lastGroup=null,"number"==typeof
 a.index&&(this._indexMax=a.index>0?a.index:null);for(var 
b=a;b&&"number"==typeof b.index;b=this._nextGroup(b))delete 
this._indexMap[b.index],b.index=null},_releaseGroup:function(a){this._invalidateIndices(a),delete
 this._keyMap[a.key],this._lastGroup===a&&(this._la
 
stGroup=null),a.firstItem!==a.lastItem&&this._releaseItem(a.firstItem),this._releaseItem(a.lastItem)},_beginRefresh:function(){if(this._fetchQueue=[],this._itemBatch){for(var
 a=0;a<this._batchSize;a++){var 
b=this._itemBatch[a];b&&(b.cancel&&b.cancel(),this._listBinding.releaseItem(b))}this._itemBatch=null}this._itemsToFetch=0,this._listDataNotificationHandler.invalidateAll()},_processInsertion:function(a,b,c){var
 
d=this._handleMap[b],e=this._handleMap[c],f=null;d&&(d.lastReached&&b===d.lastItem.handle&&(f=this._groupKey(a))!==d.key?this._lastGroup===d&&(this._lastGroup=null,this._count=null):this._releaseGroup(d),this._beginRefresh()),e&&e!==d&&(this._invalidateIndices(e),e.firstReached&&c===e.firstItem.handle&&(null!==f?f:this._groupKey(a))!==e.key||this._releaseGroup(e),this._beginRefresh())},_processRemoval:function(a){var
 
b=this._handleMap[a];if(!b||a!==b.firstItem.handle&&a!==b.lastItem.handle){if(this._itemBatch)for(var
 c=0;c<this._batchSize;c++){var d=this._itemBatch[c];if(d&
 &d.handle===a){this._beginRefresh();break}}}else 
this._releaseGroup(b),this._beginRefresh()},_inserted:function(a,b,c){var 
d=this;a.then(function(a){d._processInsertion(a,b,c)})},_changed:function(a,b){var
 
c=this._handleMap[a.handle];if(c&&a.handle===c.firstItem.handle&&(this._releaseGroup(c),this._beginRefresh()),this._groupKey(a)!==this._groupKey(b)){this._listBinding.jumpToItem(a);var
 d=this._listBinding.previous().handle;this._listBinding.jumpToItem(a);var 
e=this._listBinding.next().handle;this._processRemoval(a.handle),this._processInsertion(a,d,e)}},_moved:function(a,b,c){this._processRemoval(a.handle);var
 
d=this;a.then(function(a){d._processInsertion(a,b,c)})},_removed:function(a,b){b||this._processRemoval(a)},_indexChanged:function(a,b,c){"number"==typeof
 
c&&(this._indicesChanged=!0)},_endNotifications:function(){if(this._indicesChanged){this._indicesChanged=!1;for(var
 a in this._keyMap){var b=this._keyMap[a];if(b.firstReached&&b.lastReached){var 
c=b.lastItem.index+1-b.first
 
Item.index;isNaN(c)||(b.size=c)}}this._beginRefresh()}},_reload:function(){this._initializeState(),this._listDataNotificationHandler.reload()}},{supportedForProcessing:!1});return
 b.Class.derive(g.VirtualizedDataSource,function(a,b,c,d){var e=new 
k(a,b,c,d);this._baseDataSourceConstructor(e),this.extensions={invalidateGroups:function(){e.invalidateGroups()}}},{},{supportedForProcessing:!1})})})}),d("WinJS/VirtualizedDataSource/_GroupedItemDataSource",["../Core/_Base","./_GroupDataSource"],function(a,b){"use
 
strict";a.Namespace.define("WinJS.UI",{computeDataSourceGroups:function(a,c,d,e){function
 f(a){if(a){var b=Object.create(a);return 
b.groupKey=c(a),d&&(b.groupData=d(a)),b}return null}function g(a){var 
b=Object.create(a);return b.then=function(b,c,d){return 
a.then(function(a){return b(f(a))},c,d)},b}var 
h=Object.create(a);h.createListBinding=function(b){var 
c;b?(c=Object.create(b),c.inserted=function(a,c,d){return 
b.inserted(g(a),c,d)},c.changed=function(a,c){return b.changed(f(a)
 ,f(c))},c.moved=function(a,c,d){return b.moved(g(a),c,d)}):c=null;for(var 
d=a.createListBinding(c),e=Object.create(d),h=["first","last","fromDescription","jumpToItem","current"],i=0,j=h.length;j>i;i++)!function(a){d[a]&&(e[a]=function(){return
 g(d[a].apply(d,arguments))})}(h[i]);return 
d.fromKey&&(e.fromKey=function(a){return 
g(d.fromKey(a))}),d.fromIndex&&(e.fromIndex=function(a){return 
g(d.fromIndex(a))}),e.prev=function(){return 
g(d.prev())},e.next=function(){return g(d.next())},e};for(var 
i=["itemFromKey","itemFromIndex","itemFromDescription","insertAtStart","insertBefore","insertAfter","insertAtEnd","change","moveToStart","moveBefore","moveAfter","moveToEnd"],j=0,k=i.length;k>j;j++)!function(b){a[b]&&(h[b]=function(){return
 
g(a[b].apply(a,arguments))})}(i[j]);["addEventListener","removeEventListener","dispatchEvent"].forEach(function(b){a[b]&&(h[b]=function(){return
 a[b].apply(a,arguments)})});var l=null;return 
Object.defineProperty(h,"groups",{get:function(){return l||(l=new b
 
._GroupDataSource(a,c,d,e)),l},enumerable:!0,configurable:!0}),h}})}),d("WinJS/VirtualizedDataSource/_StorageDataSource",["exports","../Core/_WinRT","../Core/_Global","../Core/_Base","../Core/_ErrorFromName","../Core/_WriteProfilerMark","../Animations","../Promise","../Utilities/_UI","./_VirtualizedDataSourceImpl"],function(a,b,c,d,e,f,g,h,i,j){"use
 
strict";d.Namespace._moduleDefine(a,"WinJS.UI",{StorageDataSource:d.Namespace._lazy(function(){var
 
a=d.Class.define(function(a,c){f("WinJS.UI.StorageDataSource:constructor,StartTM");var
 
d,e=b.Windows.Storage.FileProperties.ThumbnailMode.singleItem,g=256,h=b.Windows.Storage.FileProperties.ThumbnailOptions.useCurrentScale,i=!0;if("Pictures"===a?(e=b.Windows.Storage.FileProperties.ThumbnailMode.picturesView,d=b.Windows.Storage.KnownFolders.picturesLibrary,g=190):"Music"===a?(e=b.Windows.Storage.FileProperties.ThumbnailMode.musicView,d=b.Windows.Storage.KnownFolders.musicLibrary,g=256):"Documents"===a?(e=b.Windows.Storage.FileProperties.Thum
 
bnailMode.documentsView,d=b.Windows.Storage.KnownFolders.documentsLibrary,g=40):"Videos"===a&&(e=b.Windows.Storage.FileProperties.ThumbnailMode.videosView,d=b.Windows.Storage.KnownFolders.videosLibrary,g=190),d){var
 j=new 
b.Windows.Storage.Search.QueryOptions;j.folderDepth=b.Windows.Storage.Search.FolderDepth.deep,j.indexerOption=b.Windows.Storage.Search.IndexerOption.useIndexerWhenAvailable,this._query=d.createFileQueryWithOptions(j)}else
 this._query=a;if(c){if("number"==typeof c.mode&&(e=c.mode),"number"==typeof 
c.requestedThumbnailSize)g=Math.max(1,Math.min(c.requestedThumbnailSize,1024));else
 switch(e){case 
b.Windows.Storage.FileProperties.ThumbnailMode.picturesView:case 
b.Windows.Storage.FileProperties.ThumbnailMode.videosView:g=190;break;case 
b.Windows.Storage.FileProperties.ThumbnailMode.documentsView:case 
b.Windows.Storage.FileProperties.ThumbnailMode.listView:g=40;break;case 
b.Windows.Storage.FileProperties.ThumbnailMode.musicView:case 
b.Windows.Storage.FileProperties.Thumb
 nailMode.singleItem:g=256}"number"==typeof 
c.thumbnailOptions&&(h=c.thumbnailOptions),"boolean"==typeof 
c.waitForFileLoad&&(i=!c.waitForFileLoad)}this._loader=new 
b.Windows.Storage.BulkAccess.FileInformationFactory(this._query,e,g,h,i),this.compareByIdentity=!1,this.firstDataRequest=!0,f("WinJS.UI.StorageDataSource:constructor,StopTM")},{setNotificationHandler:function(a){this._notificationHandler=a,this._query.addEventListener("contentschanged",function(){a.invalidateAll()}),this._query.addEventListener("optionschanged",function(){a.invalidateAll()})},itemsFromEnd:function(a){var
 b=this;return 
f("WinJS.UI.StorageDataSource:itemsFromEnd,info"),this.getCount().then(function(c){return
 0===c?h.wrapError(new 
e(i.FetchError.doesNotExist)):b.itemsFromIndex(c-1,Math.min(c-1,a-1),1)})},itemsFromIndex:function(a,b,c){function
 
d(a){k._notificationHandler.changed(k._item(a.target))}b+c>64&&(b=Math.min(b,32),c=64-(b+1));var
 g=a-b,j=b+1+c,k=this;k.firstDataRequest&&(k.firstDataRequest=!1,j=Math.
 max(j,32));var 
l="WinJS.UI.StorageDataSource:itemsFromIndex("+g+"-"+(g+j-1)+")";return 
f(l+",StartTM"),this._loader.getItemsAsync(g,j).then(function(c){var 
m=c.size;if(b>=m)return h.wrapError(new e(i.FetchError.doesNotExist));var n=new 
Array(m),o=new Array(m);c.getMany(0,o);for(var 
p=0;m>p;p++)n[p]=k._item(o[p]),o[p].addEventListener("propertiesupdated",d);var 
q={items:n,offset:b,absoluteIndex:a};return 
j>m&&(q.totalCount=g+m),f(l+",StopTM"),q})},itemsFromDescription:function(a,b,c){var
 d=this;return 
f("WinJS.UI.StorageDataSource:itemsFromDescription,info"),this._query.findStartIndexAsync(a).then(function(a){return
 d.itemsFromIndex(a,b,c)})},getCount:function(){return 
f("WinJS.UI.StorageDataSource:getCount,info"),this._query.getItemCountAsync()},itemSignature:function(a){return
 
a.folderRelativeId},_item:function(a){return{key:a.path||a.folderRelativeId,data:a}}},{supportedForProcessing:!1});return
 
d.Class.derive(j.VirtualizedDataSource,function(b,c){this._baseDataSourceConstructor(n
 ew a(b,c))},{},{loadThumbnail:function(a,d){var e,i,j=!1;return new 
h(function(k){var l=d?!0:!1,m=function(m){if(m){var 
n=c.URL.createObjectURL(m,{oneTimeOnly:!0});i=i?i.then(function(b){return 
a.loadImage(n,b)}):a.loadImage(n,d).then(function(b){return 
a.isOnScreen().then(function(a){var c;return 
a&&l?c=g.fadeIn(b).then(function(){return 
b}):(b.style.opacity=1,c=h.wrap(b)),c})}),m.type===b.Windows.Storage.FileProperties.ThumbnailType.icon||m.returnedSmallerCachedSize||(f("WinJS.UI.StorageDataSource:loadThumbnail
 
complete,info"),a.data.removeEventListener("thumbnailupdated",e),j=!1,i=i.then(function(a){e=null,i=null,k(a)}))}};e=function(a){j&&m(a.target.thumbnail)},a.data.addEventListener("thumbnailupdated",e),j=!0,m(a.data.thumbnail)},function(){a.data.removeEventListener("thumbnailupdated",e),j=!1,e=null,i&&(i.cancel(),i=null)})},supportedForProcessing:!1})})})}),d("WinJS/VirtualizedDataSource",["./VirtualizedDataSource/_VirtualizedDataSourceImpl","./VirtualizedDataSource/_GroupDa
 
taSource","./VirtualizedDataSource/_GroupedItemDataSource","./VirtualizedDataSource/_StorageDataSource"],function(){}),d("WinJS/_Accents",["require","exports","./Core/_Global","./Core/_WinRT","./Core/_Base","./Core/_BaseUtils"],function(a,b,c,d,e,f){function
 g(a,b){s.push({selector:a,props:b}),h()}function 
h(){0!==s.length&&-1===t&&(t=f._setImmediate(function(){t=-1,l();var 
a=r?n.lightThemeSelector:n.darkThemeSelector,b=n.hoverSelector+" 
"+a,d=c.document.createElement("style");d.id=n.accentStyleId,d.textContent=s.map(function(c){var
 d="  "+c.props.map(function(a){return a.name+": "+q[a.value]+";"}).join("\n  
"),e=c.selector.split(",").map(function(a){return k(a)}),f=e.join(",\n"),g=f+" 
{\n"+d+"\n}",h=c.props.some(function(a){return 0!==a.value});if(h){var i="  
"+c.props.map(function(a){return a.name+": 
"+q[a.value?a.value+3:a.value]+";"}).join("\n  
"),j=[];e.forEach(function(c){if(-1!==c.indexOf(n.hoverSelector)&&-1===c.indexOf(b)){j.push(c.replace(n.hoverSelector,b));var
 d=c.replac
 
e(n.hoverSelector,"").trim();-1!==o.indexOf(d[0])&&j.push(c.replace(n.hoverSelector+"
 ",b))}else j.push(a+" 
"+c),-1!==o.indexOf(c[0])&&j.push(a+c);g+="\n"+j.join(",\n")+" 
{\n"+i+"\n}"})}return g}).join("\n"),c.document.head.appendChild(d)}))}function 
i(){var 
a=(d.Windows.UI.ViewManagement.UIColorType,p.getColorValue(d.Windows.UI.ViewManagement.UIColorType.accent)),b=j(a,1);q[0]!==b&&(q.length=0,q.push(b,j(a,r?.6:.4),j(a,r?.8:.6),j(a,r?.9:.7),j(a,r?.4:.6),j(a,r?.6:.8),j(a,r?.7:.9)),h())}function
 j(a,b){return"rgba("+a.r+","+a.g+","+a.b+","+b+")"}function k(a){return 
a.replace(/  /g," ").replace(/  /g," ").trim()}function l(){var 
a=c.document.head.querySelector("#"+n.accentStyleId);a&&a.parentNode.removeChild(a)}function
 m(){s.length=0,l()}var 
n={accentStyleId:"WinJSAccentsStyle",themeDetectionTag:"winjs-themedetection-tag",hoverSelector:"html.win-hoverable",lightThemeSelector:".win-ui-light",darkThemeSelector:".win-ui-dark"},o=[".","#",":"],p=null,q=[],r=!1,s=[],t=-1;!function(a){a[a
 
.accent=0]="accent",a[a.listSelectRest=1]="listSelectRest",a[a.listSelectHover=2]="listSelectHover",a[a.listSelectPress=3]="listSelectPress",a[a._listSelectRestInverse=4]="_listSelectRestInverse",a[a._listSelectHoverInverse=5]="_listSelectHoverInverse",a[a._listSelectPressInverse=6]="_listSelectPressInverse"}(b.ColorTypes||(b.ColorTypes={}));var
 u=b.ColorTypes;b.createAccentRule=g;var 
v=c.document.createElement(n.themeDetectionTag);c.document.head.appendChild(v);var
 
w=c.getComputedStyle(v).opacity;r="0"===w,v.parentElement.removeChild(v);try{p=new
 
d.Windows.UI.ViewManagement.UISettings,p.addEventListener("colorvalueschanged",i),i()}catch(x){q.push("rgb(0,
 120, 215)","rgba(0, 120, 215, "+(r?"0.6":"0.4")+")","rgba(0, 120, 215, 
"+(r?"0.8":"0.6")+")","rgba(0, 120, 215, "+(r?"0.9":"0.7")+")","rgba(0, 120, 
215, "+(r?"0.4":"0.6")+")","rgba(0, 120, 215, "+(r?"0.6":"0.8")+")","rgba(0, 
120, 215, "+(r?"0.7":"0.9")+")")}var 
y={ColorTypes:u,createAccentRule:g,_colors:q,_reset:m,_isDarkTheme:r};e
 
.Namespace.define("WinJS.UI._Accents",y)}),d("require-style",{load:function(a){throw
 new Error("Dynamic load not allowed: "+a)
-}}),d("require-style!less/styles-intrinsic",[],function(){}),d("require-style!less/colors-intrinsic",[],function(){}),d("WinJS/Controls/IntrinsicControls",["../Utilities/_Hoverable","../_Accents","require-style!less/styles-intrinsic","require-style!less/colors-intrinsic"],function(a,b){"use
 strict";b.createAccentRule(".win-link,         .win-progress-bar,         
.win-progress-ring,         
.win-ring",[{name:"color",value:b.ColorTypes.accent}]),b.createAccentRule("::selection,
         .win-button.win-button-primary,         .win-dropdown option:checked,  
       select[multiple].win-dropdown 
option:checked",[{name:"background-color",value:b.ColorTypes.accent}]),b.createAccentRule(".win-textbox:focus,
         .win-textarea:focus,         .win-textbox:focus:hover,         
.win-textarea:focus:hover",[{name:"border-color",value:b.ColorTypes.accent}]),b.createAccentRule(".win-textbox::-ms-clear:hover:not(:active),
         .win-textbox::-ms-reveal:hover:not(:active)",[{name:"color",value:b
 .ColorTypes.accent}]),b.createAccentRule(".win-checkbox:checked::-ms-check,    
     .win-textbox::-ms-clear:active,         
.win-textbox::-ms-reveal:active",[{name:"background-color",value:b.ColorTypes.accent}]),b.createAccentRule(".win-progress-bar::-webkit-progress-value,
         .win-progress-ring::-webkit-progress-value,         
.win-ring::-webkit-progress-value",[{name:"background-color",value:b.ColorTypes.accent}]),b.createAccentRule(".win-progress-bar:not(:indeterminate)::-moz-progress-bar,
         .win-progress-ring:not(:indeterminate)::-moz-progress-bar,         
.win-ring:not(:indeterminate)::-moz-progress-bar",[{name:"background-color",value:b.ColorTypes.accent}]),b.createAccentRule(".win-checkbox:indeterminate::-ms-check,
         .win-checkbox:hover:indeterminate::-ms-check,         
.win-radio:checked::-ms-check",[{name:"border-color",value:b.ColorTypes.accent}]),b.createAccentRule(".win-slider::-ms-thumb,
         .win-slider::-ms-fill-lower",[{name:"background",value:b.C
 
olorTypes.accent}]),b.createAccentRule(".win-slider::-webkit-slider-thumb",[{name:"background",value:b.ColorTypes.accent}]),b.createAccentRule(".win-slider::-moz-range-thumb",[{name:"background",value:b.ColorTypes.accent}])}),d("WinJS/Controls/ItemContainer/_Constants",["exports","../../Core/_Base"],function(a,b){"use
 strict";var 
c={};c._listViewClass="win-listview",c._viewportClass="win-viewport",c._rtlListViewClass="win-rtl",c._horizontalClass="win-horizontal",c._verticalClass="win-vertical",c._scrollableClass="win-surface",c._itemsContainerClass="win-itemscontainer",c._listHeaderContainerClass="win-headercontainer",c._listFooterContainerClass="win-footercontainer",c._padderClass="win-itemscontainer-padder",c._proxyClass="_win-proxy",c._itemClass="win-item",c._itemBoxClass="win-itembox",c._itemsBlockClass="win-itemsblock",c._containerClass="win-container",c._containerEvenClass="win-container-even",c._containerOddClass="win-container-odd",c._backdropClass="win-backdrop",c._footprin
 
tClass="win-footprint",c._groupsClass="win-groups",c._selectedClass="win-selected",c._selectionBorderClass="win-selectionborder",c._selectionBackgroundClass="win-selectionbackground",c._selectionCheckmarkClass="win-selectioncheckmark",c._selectionCheckmarkBackgroundClass="win-selectioncheckmarkbackground",c._pressedClass="win-pressed",c._headerClass="win-groupheader",c._headerContainerClass="win-groupheadercontainer",c._groupLeaderClass="win-groupleader",c._progressClass="win-progress",c._revealedClass="win-revealed",c._itemFocusClass="win-focused",c._itemFocusOutlineClass="win-focusedoutline",c._zoomingXClass="win-zooming-x",c._zoomingYClass="win-zooming-y",c._listLayoutClass="win-listlayout",c._gridLayoutClass="win-gridlayout",c._headerPositionTopClass="win-headerpositiontop",c._headerPositionLeftClass="win-headerpositionleft",c._structuralNodesClass="win-structuralnodes",c._singleItemsBlockClass="win-single-itemsblock",c._uniformGridLayoutClass="win-uniformgridlayout",c._uniformL
 
istLayoutClass="win-uniformlistlayout",c._cellSpanningGridLayoutClass="win-cellspanninggridlayout",c._laidOutClass="win-laidout",c._nonDraggableClass="win-nondraggable",c._nonSelectableClass="win-nonselectable",c._dragOverClass="win-dragover",c._dragSourceClass="win-dragsource",c._clipClass="win-clip",c._selectionModeClass="win-selectionmode",c._noCSSGrid="win-nocssgrid",c._hidingSelectionMode="win-hidingselectionmode",c._hidingSelectionModeAnimationTimeout=250,c._INVALID_INDEX=-1,c._UNINITIALIZED=-1,c._LEFT_MSPOINTER_BUTTON=0,c._RIGHT_MSPOINTER_BUTTON=2,c._TAP_END_THRESHOLD=10,c._DEFAULT_PAGES_TO_LOAD=5,c._DEFAULT_PAGE_LOAD_THRESHOLD=2,c._MIN_AUTOSCROLL_RATE=150,c._MAX_AUTOSCROLL_RATE=1500,c._AUTOSCROLL_THRESHOLD=100,c._AUTOSCROLL_DELAY=50,c._DEFERRED_ACTION=250,c._DEFERRED_SCROLL_END=250,c._SELECTION_CHECKMARK="",c._LISTVIEW_PROGRESS_DELAY=2e3;var
 
d={uninitialized:0,low:1,medium:2,high:3},e={rebuild:0,remeasure:1,relayout:2,realize:3};c._ScrollToPriority=d,c._ViewChange=e,b.Nam
 
espace._moduleDefine(a,"WinJS.UI",c)}),d("WinJS/Controls/ItemContainer/_ItemEventsHandler",["exports","../../Core/_Global","../../Core/_WinRT","../../Core/_Base","../../Core/_BaseUtils","../../Core/_WriteProfilerMark","../../Animations","../../Animations/_TransitionAnimation","../../Promise","../../Utilities/_ElementUtilities","../../Utilities/_UI","./_Constants"],function(a,b,c,d,e,f,g,h,i,j,k,l){"use
 strict";function m(a,b,c){var 
d=44,e=750,f=2,g=9,h=2.11,i=13,k=e-d,l=c.width/2,m=c.height/2,n=j._clamp(c.width,d,e),o=j._clamp(c.height,d,e),p=g-(o-d)/k*(g-f),q=i-(n-d)/k*(i-h),r=(a-c.left-l)/l,s=(b-c.top-m)/m,t=p*s,u=q*r,v=.97+.03*(Math.abs(r)+Math.abs(s))/2,w="perspective(800px)
 scale("+v+") rotateX("+-t+"deg) rotateY("+u+"deg)";return w}var 
n=e._browserStyleEquivalents.transform;d.Namespace._moduleDefine(a,"WinJS.UI",{_tiltTransform:m,_ItemEventsHandler:d.Namespace._lazy(function(){function
 a(a,c){var d=b.document.createElement("div");return 
d.className=a,c||d.setAttribute("aria-hi
 dden",!0),d}var 
g=j._MSPointerEvent.MSPOINTER_TYPE_TOUCH||"touch",o=d.Class.define(function(a){this._site=a,this._work=[],this._animations={}},{dispose:function(){this._disposed||(this._disposed=!0,j._removeEventListener(b,"pointerup",this._resetPointerDownStateBound),j._removeEventListener(b,"pointercancel",this._resetPointerDownStateBound))},onPointerDown:function(a){f("WinJS.UI._ItemEventsHandler:MSPointerDown,StartTM");var
 
d,h,i=this._site,m=a.pointerType===g;if(i.pressedElement=a.target,c.Windows.UI.Input.PointerPoint){var
 
n=this._getCurrentPoint(a),o=n.properties;m||o.isInverted||o.isEraser||o.isMiddleButtonPressed?d=h=!1:(h=o.isRightButtonPressed,d=!h&&o.isLeftButtonPressed)}else
 
d=a.button===l._LEFT_MSPOINTER_BUTTON,h=a.button===l._RIGHT_MSPOINTER_BUTTON;this._DragStartBound=this._DragStartBound||this.onDragStart.bind(this),this._PointerEnterBound=this._PointerEnterBound||this.onPointerEnter.bind(this),this._PointerLeaveBound=this._PointerLeaveBound||this.onPointerLeave.bind
 (this);var 
p=this._isInteractive(a.target),q=i.indexForItemElement(a.target),r=i.indexForHeaderElement(a.target),s=!p&&q!==l._INVALID_INDEX;if((m||d)&&this._site.pressedEntity.index===l._INVALID_INDEX&&!p&&(this._site.pressedEntity=r===l._INVALID_INDEX?{type:k.ObjectType.item,index:q}:{type:k.ObjectType.groupHeader,index:r},this._site.pressedEntity.index!==l._INVALID_INDEX)){this._site.pressedPosition=j._getCursorPos(a);var
 
t=i.verifySelectionAllowed(this._site.pressedEntity);this._canSelect=t.canSelect,this._canTapSelect=t.canTapSelect,this._site.pressedEntity.type===k.ObjectType.item?(this._site.pressedItemBox=i.itemBoxAtIndex(this._site.pressedEntity.index),this._site.pressedContainer=i.containerAtIndex(this._site.pressedEntity.index),this._site.animatedElement=this._site.pressedContainer,this._site.pressedHeader=null,this._togglePressed(!0,!1,a),this._site.pressedContainer.addEventListener("dragstart",this._DragStartBound),m||(j._addEventListener(this._site.pressedContainer,"poi
 
nterenter",this._PointerEnterBound,!1),j._addEventListener(this._site.pressedContainer,"pointerleave",this._PointerLeaveBound,!1))):(this._site.pressedHeader=this._site.headerFromElement(a.target),e.isPhone?(this._site.animatedElement=this._site.pressedHeader,this._togglePressed(!0,!1,a)):(this._site.pressedItemBox=null,this._site.pressedContainer=null,this._site.animatedElement=null)),this._resetPointerDownStateBound||(this._resetPointerDownStateBound=this._resetPointerDownStateForPointerId.bind(this)),m||(j._addEventListener(b,"pointerup",this._resetPointerDownStateBound,!1),j._addEventListener(b,"pointercancel",this._resetPointerDownStateBound,!1)),this._pointerId=a.pointerId,this._pointerRightButton=h}if(s&&m)try{j._setPointerCapture(i.canvasProxy,a.pointerId)}catch(u){return
 void 
f("WinJS.UI._ItemEventsHandler:MSPointerDown,StopTM")}this._site.pressedEntity.type===k.ObjectType.item&&this._selectionAllowed()&&this._multiSelection()&&this._site.pressedEntity.index!==l._INVALID_IN
 
DEX&&i.selection._getFocused().index!==l._INVALID_INDEX&&i.selection._pivot===l._INVALID_INDEX&&(i.selection._pivot=i.selection._getFocused().index),f("WinJS.UI._ItemEventsHandler:MSPointerDown,StopTM")},onPointerEnter:function(a){this._site.pressedContainer&&this._pointerId===a.pointerId&&this._togglePressed(!0,!1,a)},onPointerLeave:function(a){this._site.pressedContainer&&this._pointerId===a.pointerId&&this._togglePressed(!1,!0,a)},onDragStart:function(){this._resetPressedContainer()},_resetPressedContainer:function(){(this._site.pressedContainer||this._site.pressedHeader)&&this._site.animatedElement&&(this._togglePressed(!1),this._site.pressedContainer&&(this._site.pressedContainer.style[n.scriptName]="",this._site.pressedContainer.removeEventListener("dragstart",this._DragStartBound),j._removeEventListener(this._site.pressedContainer,"pointerenter",this._PointerEnterBound,!1),j._removeEventListener(this._site.pressedContainer,"pointerleave",this._PointerLeaveBound,!1)))},onClick
 :function(a){if(!this._skipClick){var 
b={type:k.ObjectType.item,index:this._site.indexForItemElement(a.target)};if(b.index===l._INVALID_INDEX&&(b.index=this._site.indexForHeaderElement(a.target),b.index!==l._INVALID_INDEX&&(b.type=k.ObjectType.groupHeader)),b.index!==l._INVALID_INDEX&&(j.hasClass(a.target,this._site.accessibleItemClass)||j.hasClass(a.target,l._headerClass))){var
 
c=this._site.verifySelectionAllowed(b);c.canTapSelect&&this.handleTap(b),this._site.fireInvokeEvent(b,a.target)}}},onPointerUp:function(a){f("WinJS.UI._ItemEventsHandler:MSPointerUp,StartTM");var
 b=this._site;this._skipClick=!0;var 
c=this;e._yieldForEvents(function(){c._skipClick=!1});try{j._releasePointerCapture(b.canvasProxy,a.pointerId)}catch(d){}var
 
h=a.pointerType===g,i=this._releasedElement(a),m=b.indexForItemElement(i),n=b.indexForHeaderElement(i&&j.hasClass(i,l._headerContainerClass)?b.pressedHeader:i);if(this._pointerId===a.pointerId){var
 o;if(o=n===l._INVALID_INDEX?{type:k.ObjectType.item,index:m}:
 
{type:k.ObjectType.groupHeader,index:n},this._resetPressedContainer(),this._site.pressedEntity.type===k.ObjectType.item&&o.type===k.ObjectType.item&&this._site.pressedContainer&&this._site.pressedEntity.index===o.index)if(a.shiftKey||(b.selection._pivot=l._INVALID_INDEX),a.shiftKey){if(this._selectionAllowed()&&this._multiSelection()&&b.selection._pivot!==l._INVALID_INDEX){var
 
p=Math.min(this._site.pressedEntity.index,b.selection._pivot),q=Math.max(this._site.pressedEntity.index,b.selection._pivot),r=this._pointerRightButton||a.ctrlKey||b.tapBehavior===k.TapBehavior.toggleSelect;b.selectRange(p,q,r)}}else
 
a.ctrlKey&&this.toggleSelectionIfAllowed(this._site.pressedEntity.index);if(this._site.pressedHeader||this._site.pressedContainer){var
 
s=j._getCursorPos(a),t=Math.abs(s.left-this._site.pressedPosition.left)<=l._TAP_END_THRESHOLD&&Math.abs(s.top-this._site.pressedPosition.top)<=l._TAP_END_THRESHOLD;this._pointerRightButton||a.ctrlKey||a.shiftKey||!(h&&t||!h&&this._site.pressedEntity
 
.index===o.index&&this._site.pressedEntity.type===o.type)||(o.type===k.ObjectType.groupHeader?(this._site.pressedHeader=b.headerAtIndex(o.index),this._site.pressedItemBox=null,this._site.pressedContainer=null):(this._site.pressedItemBox=b.itemBoxAtIndex(o.index),this._site.pressedContainer=b.containerAtIndex(o.index),this._site.pressedHeader=null),this._canTapSelect&&this.handleTap(this._site.pressedEntity),this._site.fireInvokeEvent(this._site.pressedEntity,this._site.pressedItemBox||this._site.pressedHeader))}this._site.pressedEntity.index!==l._INVALID_INDEX&&b.changeFocus(this._site.pressedEntity,!0,!1,!0),this.resetPointerDownState()}f("WinJS.UI._ItemEventsHandler:MSPointerUp,StopTM")},onPointerCancel:function(a){this._pointerId===a.pointerId&&(f("WinJS.UI._ItemEventsHandler:MSPointerCancel,info"),this.resetPointerDownState())},onLostPointerCapture:function(a){this._pointerId===a.pointerId&&(f("WinJS.UI._ItemEventsHandler:MSLostPointerCapture,info"),this.resetPointerDownState())
 
},onContextMenu:function(a){this._shouldSuppressContextMenu(a.target)&&a.preventDefault()},onMSHoldVisual:function(a){this._shouldSuppressContextMenu(a.target)&&a.preventDefault()},onDataChanged:function(){this.resetPointerDownState()},toggleSelectionIfAllowed:function(a){this._selectionAllowed(a)&&this._toggleItemSelection(a)},handleTap:function(a){if(a.type!==k.ObjectType.groupHeader){var
 
b=this._site,c=b.selection;this._selectionAllowed(a.index)&&this._selectOnTap()&&(b.tapBehavior===k.TapBehavior.toggleSelect?this._toggleItemSelection(a.index):b.selectionMode!==k.SelectionMode.multi&&c._isIncluded(a.index)||c.set(a.index))}},_toggleItemSelection:function(a){var
 
b=this._site,c=b.selection,d=c._isIncluded(a);b.selectionMode===k.SelectionMode.single?d?c.clear():c.set(a):d?c.remove(a):c.add(a)},_getCurrentPoint:function(a){return
 
c.Windows.UI.Input.PointerPoint.getCurrentPoint(a.pointerId)},_containedInElementWithClass:function(a,b){if(a.parentNode)for(var
 c=a.parentNode.querySelect
 orAll("."+b+", ."+b+" 
*"),d=0,e=c.length;e>d;d++)if(c[d]===a)return!0;return!1},_isSelected:function(a){return
 this._site.selection._isIncluded(a)},_isInteractive:function(a){return 
this._containedInElementWithClass(a,"win-interactive")},_shouldSuppressContextMenu:function(a){var
 b=this._site.containerFromElement(a);return 
this._selectionAllowed()&&b&&!this._isInteractive(a)},_togglePressed:function(a,b,c){function
 
d(a){o._site.isInSelectionMode()||(""===o._site.animatedElement.style[n.scriptName]?(o._site.animatedElement.style[n.scriptName]=a,o._site.animatedElementScaleTransform=o._site.animatedElement.style[n.scriptName]):o._site.animatedElementScaleTransform="")}function
 
g(a,b){f("WinJS.UI._ItemEventsHandler:removePressedUI,info"),j.removeClass(a,l._pressedClass),o._containsTransform(a,b)&&h.executeTransition(a,{property:n.cssName,delay:150,duration:350,timing:"cubic-bezier(0.17,0.17,0.2,1)",to:a.style[n.scriptName].replace(b,"")})}var
 o=this,p=this._site.pressedEntity.type===k.
 
ObjectType.groupHeader;if(this._site.animatedDownPromise&&this._site.animatedDownPromise.cancel(),(p||!j.hasClass(this._site.pressedItemBox,l._nonSelectableClass))&&!this._staticMode(p))if(a){if(!j.hasClass(this._site.animatedElement,l._pressedClass)){f("WinJS.UI._ItemEventsHandler:applyPressedUI,info"),j.addClass(this._site.animatedElement,l._pressedClass);var
 
q=p?o._site.pressedHeader:o._site.pressedContainer,r=m(c.clientX,c.clientY,q.getBoundingClientRect());this._site.animatedDownPromise=i.timeout(50).then(function(){d(r)})}}else
 if(j.hasClass(this._site.animatedElement,l._pressedClass)){var 
s=this._site.animatedElement,t=this._site.animatedElementScaleTransform;b?g(s,t):e._setImmediate(function(){j.hasClass(s,l._pressedClass)&&g(s,t)})}},_containsTransform:function(a,b){return
 
b&&-1!==a.style[n.scriptName].indexOf(b)},_resetPointerDownStateForPointerId:function(a){this._pointerId===a.pointerId&&this.resetPointerDownState()},resetPointerDownState:function(){this._site.pressedEle
 
ment=null,j._removeEventListener(b,"pointerup",this._resetPointerDownStateBound),j._removeEventListener(b,"pointercancel",this._resetPointerDownStateBound),this._resetPressedContainer(),this._site.pressedContainer=null,this._site.animatedElement=null,this._site.pressedHeader=null,this._site.pressedItemBox=null,this._site.pressedEntity={type:k.ObjectType.item,index:l._INVALID_INDEX},this._pointerId=null},_releasedElement:function(a){return
 
b.document.elementFromPoint(a.clientX,a.clientY)},_applyUIInBatches:function(a){function
 
b(){c._work.length>0?(c._flushUIBatches(),c._paintedThisFrame=e._requestAnimationFrame(b.bind(c))):c._paintedThisFrame=null}var
 
c=this;this._work.push(a),this._paintedThisFrame||b()},_flushUIBatches:function(){if(this._work.length>0){var
 a=this._work;this._work=[];for(var 
b=0;b<a.length;b++)a[b]()}},_selectionAllowed:function(a){var b=void 
0!==a?this._site.itemAtIndex(a):null,c=!(b&&j.hasClass(b,l._nonSelectableClass));return
 c&&this._site.selectionMode!==k.Sel
 ectionMode.none},_multiSelection:function(){return 
this._site.selectionMode===k.SelectionMode.multi},_selectOnTap:function(){return
 
this._site.tapBehavior===k.TapBehavior.toggleSelect||this._site.tapBehavior===k.TapBehavior.directSelect},_staticMode:function(a){return
 
a?this._site.headerTapBehavior===k.GroupHeaderTapBehavior.none:this._site.tapBehavior===k.TapBehavior.none&&this._site.selectionMode===k.SelectionMode.none}},{setAriaSelected:function(a,b){var
 
c="true"===a.getAttribute("aria-selected");b!==c&&a.setAttribute("aria-selected",b)},renderSelection:function(b,c,d,e,f){if(!o._selectionTemplate){o._selectionTemplate=[],o._selectionTemplate.push(a(l._selectionBackgroundClass)),o._selectionTemplate.push(a(l._selectionBorderClass)),o._selectionTemplate.push(a(l._selectionCheckmarkBackgroundClass));var
 
g=a(l._selectionCheckmarkClass);g.textContent=l._SELECTION_CHECKMARK,o._selectionTemplate.push(g)}if(d!==j._isSelectionRendered(b)){if(d){b.insertBefore(o._selectionTemplate[0].clon
 eNode(!0),b.firstElementChild);for(var 
h=1,i=o._selectionTemplate.length;i>h;h++)b.appendChild(o._selectionTemplate[h].cloneNode(!0))}else
 for(var 
k=b.querySelectorAll(j._selectionPartsSelector),h=0,i=k.length;i>h;h++)b.removeChild(k[h]);j[d?"addClass":"removeClass"](b,l._selectedClass),f&&j[d?"addClass":"removeClass"](f,l._selectedClass)}e&&o.setAriaSelected(c,d)}});return
 
o})})}),d("WinJS/Controls/ListView/_SelectionManager",["exports","../../Core/_Global","../../Core/_Base","../../Promise","../../_Signal","../../Utilities/_UI","../ItemContainer/_Constants"],function(a,b,c,d,e,f,g){"use
 
strict";c.Namespace._moduleDefine(a,"WinJS.UI",{_ItemSet:c.Namespace._lazy(function(){var
 
b=c.Class.define(function(a,b,c){this._listView=a,this._ranges=b,this._itemsCount=c});return
 b.prototype={getRanges:function(){for(var 
a=[],b=0,c=this._ranges.length;c>b;b++){var 
d=this._ranges[b];a.push({firstIndex:d.firstIndex,lastIndex:d.lastIndex,firstKey:d.firstKey,lastKey:d.lastKey})}return
 a},getItems:f
 unction(){return 
a.getItemsFromRanges(this._listView._itemsManager.dataSource,this._ranges)},isEverything:function(){return
 this.count()===this._itemsCount},count:function(){for(var 
a=0,b=0,c=this._ranges.length;c>b;b++){var 
d=this._ranges[b];a+=d.lastIndex-d.firstIndex+1}return 
a},getIndices:function(){for(var a=[],b=0,c=this._ranges.length;c>b;b++)for(var 
d=this._ranges[b],e=d.firstIndex;e<=d.lastIndex;e++)a.push(e);return 
a}},b}),getItemsFromRanges:function(a,b){function c(){for(var 
a=[],c=0,e=b.length;e>c;c++)for(var 
f=b[c],g=f.firstIndex;g<=f.lastIndex;g++)a.push(g);return d.wrap(a)}var 
e=a.createListBinding(),f=[];return c().then(function(a){for(var 
b=0;b<a.length;b++)f.push(e.fromIndex(a[b]));return 
d.join(f).then(function(a){return 
e.release(),a})})},_Selection:c.Namespace._lazy(function(){function b(a){return 
a&&0===a.firstIndex&&a.lastIndex===Number.MAX_VALUE}return 
c.Class.derive(a._ItemSet,function(a,b){this._listView=a,this._itemsCount=-1,this._ranges=[],b&&this.set(b)}
 ,{clear:function(){return 
this._releaseRanges(this._ranges),this._ranges=[],d.wrap()},set:function(a){if(b(a))return
 this.selectAll();this._releaseRanges(this._ranges),this._ranges=[];var 
c=this;return this._execute("_set",a).then(function(){return 
c._ranges.sort(function(a,b){return 
a.firstIndex-b.firstIndex}),c._ensureKeys()}).then(function(){return 
c._ensureCount()})},add:function(a){if(b(a))return this.selectAll();var 
c=this;return this._execute("_add",a).then(function(){return 
c._ensureKeys()}).then(function(){return 
c._ensureCount()})},remove:function(a){var b=this;return 
this._execute("_remove",a).then(function(){return 
b._ensureKeys()})},selectAll:function(){var a=this;return 
a._ensureCount().then(function(){if(a._itemsCount){var 
b={firstIndex:0,lastIndex:a._itemsCount-1};return 
a._retainRange(b),a._releaseRanges(a._ranges),a._ranges=[b],a._ensureKeys()}})},_execute:function(a,b){function
 c(a,b,c){var d={};return d["first"+a]=b,d["last"+a]=c,d}function e(b){var 
c=f._getListB
 
inding(),e=d.join([c.fromKey(b.firstKey),c.fromKey(b.lastKey)]).then(function(c){return
 
c[0]&&c[1]&&(b.firstIndex=c[0].index,b.lastIndex=c[1].index,f[a](b)),b});i.push(e)}for(var
 
f=this,g=!!f._getListBinding().fromKey,h=Array.isArray(b)?b:[b],i=[d.wrap()],j=0,k=h.length;k>j;j++){var
 l=h[j];"number"==typeof l?this[a](c("Index",l,l)):l&&(g&&void 
0!==l.key?e(c("Key",l.key,l.key)):g&&void 0!==l.firstKey&&void 
0!==l.lastKey?e(c("Key",l.firstKey,l.lastKey)):void 
0!==l.index&&"number"==typeof l.index?this[a](c("Index",l.index,l.index)):void 
0!==l.firstIndex&&void 0!==l.lastIndex&&"number"==typeof 
l.firstIndex&&"number"==typeof 
l.lastIndex&&this[a](c("Index",l.firstIndex,l.lastIndex)))}return 
d.join(i)},_set:function(a){this._retainRange(a),this._ranges.push(a)},_add:function(a){for(var
 
b,c,d,e=this,f=null,g=function(a,b){b.lastIndex>a.lastIndex&&(a.lastIndex=b.lastIndex,a.lastKey=b.lastKey,a.lastPromise&&a.lastPromise.release(),a.lastPromise=e._getListBinding().fromIndex(a.lastIndex).retai
 
n())},h=0,i=this._ranges.length;i>h;h++){if(b=this._ranges[h],a.firstIndex<b.firstIndex){d=f&&a.firstIndex<f.lastIndex+1,d?(c=h-1,g(f,a)):(this._insertRange(h,a),c=h);break}if(a.firstIndex===b.firstIndex){g(b,a),c=h;break}f=b}if(void
 0===c){var 
j=this._ranges.length?this._ranges[this._ranges.length-1]:null,k=j&&a.firstIndex<j.lastIndex+1;k?g(j,a):(this._retainRange(a),this._ranges.push(a))}else{for(f=null,h=c+1,i=this._ranges.length;i>h;h++){if(b=this._ranges[h],a.lastIndex<b.firstIndex){d=f&&f.lastIndex>a.lastIndex,d&&g(this._ranges[c],f),this._removeRanges(c+1,h-c-1);break}if(a.lastIndex===b.firstIndex){g(this._ranges[c],b),this._removeRanges(c+1,h-c);break}f=b}h>=i&&(g(this._ranges[c],this._ranges[i-1]),this._removeRanges(c+1,i-c-1))}},_remove:function(a){function
 b(a){return c._getListBinding().fromIndex(a).retain()}for(var 
c=this,d=[],e=0,f=this._ranges.length;f>e;e++){var 
g=this._ranges[e];g.lastIndex<a.firstIndex||g.firstIndex>a.lastIndex?d.push(g):g.firstIndex<a.firstIndex&&
 
g.lastIndex>=a.firstIndex&&g.lastIndex<=a.lastIndex?(d.push({firstIndex:g.firstIndex,firstKey:g.firstKey,firstPromise:g.firstPromise,lastIndex:a.firstIndex-1,lastPromise:b(a.firstIndex-1)}),g.lastPromise.release()):g.lastIndex>a.lastIndex&&g.firstIndex>=a.firstIndex&&g.firstIndex<=a.lastIndex?(d.push({firstIndex:a.lastIndex+1,firstPromise:b(a.lastIndex+1),lastIndex:g.lastIndex,lastKey:g.lastKey,lastPromise:g.lastPromise}),g.firstPromise.release()):g.firstIndex<a.firstIndex&&g.lastIndex>a.lastIndex?(d.push({firstIndex:g.firstIndex,firstKey:g.firstKey,firstPromise:g.firstPromise,lastIndex:a.firstIndex-1,lastPromise:b(a.firstIndex-1)}),d.push({firstIndex:a.lastIndex+1,firstPromise:b(a.lastIndex+1),lastIndex:g.lastIndex,lastKey:g.lastKey,lastPromise:g.lastPromise})):(g.firstPromise.release(),g.lastPromise.release())}this._ranges=d},_ensureKeys:function(){for(var
 a=[d.wrap()],b=this,c=function(a,b){var c=a+"Key";if(b[c])return d.wrap();var 
e=b[a+"Promise"];return e.then(function(a){a&&(b
 [c]=a.key)}),e},e=0,f=this._ranges.length;f>e;e++){var 
g=this._ranges[e];a.push(c("first",g)),a.push(c("last",g))}return 
d.join(a).then(function(){b._ranges=b._ranges.filter(function(a){return 
a.firstKey&&a.lastKey})}),d.join(a)},_mergeRanges:function(a,b){a.lastIndex=b.lastIndex,a.lastKey=b.lastKey},_isIncluded:function(a){if(this.isEverything())return!0;for(var
 b=0,c=this._ranges.length;c>b;b++){var 
d=this._ranges[b];if(d.firstIndex<=a&&a<=d.lastIndex)return!0}return!1},_ensureCount:function(){var
 a=this;return 
this._listView._itemsCount().then(function(b){a._itemsCount=b})},_insertRange:function(a,b){this._retainRange(b),this._ranges.splice(a,0,b)},_removeRanges:function(a,b){for(var
 
c=0;b>c;c++)this._releaseRange(this._ranges[a+c]);this._ranges.splice(a,b)},_retainRange:function(a){a.firstPromise||(a.firstPromise=this._getListBinding().fromIndex(a.firstIndex).retain()),a.lastPromise||(a.lastPromise=this._getListBinding().fromIndex(a.lastIndex).retain())},_r

<TRUNCATED>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to