1/* 2 * AllForJoomla.com AMD 1.0.0 Copyright Oleg Micriucov 3 */ 4 5(function(global){ 6 "use strict"; 7 8 if(global.a4jDefine && typeof global.a4jDefine=='function'){ 9 return; 10 } 11 12 var definedRegistry = {}, 13 queue = [], 14 checkTimeout = 0; 15 16 var check = function(){ 17 if(checkTimeout>0){ 18 window.clearTimeout(checkTimeout); 19 } 20 checkTimeout = window.setTimeout(function(){ 21 checkTimeout = 0; 22 checkQueue(); 23 }, 50); 24 } 25 26 var checkQueue = function(){ 27 var newQueue = []; 28 for(var i=0;i<queue.length;i++){ 29 if(queue[i][0]!='' && definedRegistry[queue[i][0]]){ 30 console.log('a4jAMD: Instance "'+queue[i][0]+'" already defined.'); 31 continue; 32 } 33 var deps = []; 34 for(var j=0;j<queue[i][1].length;j++){ 35 if(definedRegistry[queue[i][1][j]]){ 36 deps.push(definedRegistry[queue[i][1][j]]); 37 } 38 } 39 if(deps.length==queue[i][1].length){ 40 if(queue[i][0]!=''){ 41 definedRegistry[queue[i][0]] = queue[i][2].apply(queue[i][2], deps); 42 } 43 else{ 44 queue[i][2].apply(queue[i][2], deps); 45 } 46 } 47 else{ 48 newQueue.push(queue[i]); 49 } 50 } 51 queue = newQueue; 52 if(queue.length>0){ 53 check(); 54 } 55 } 56 57 global.a4jDefine = function(_name, _deps, _callback){ 58 if(definedRegistry[_name]){ 59 console.log('a4jAMD: Instance "'+_name+'" already defined.'); 60 return; 61 } 62 queue.push([_name, _deps, _callback]); 63 check(); 64 } 65 66 global.a4jRequire = function(_deps, _callback){ 67 global.a4jDefine('', _deps, _callback); 68 } 69 70})(typeof window !== "undefined" ? window : this); 71a4jDefine("jquery", [], function(){return jQuery;}); 72/*! 73 * Knockout JavaScript library v3.5.0 74 * (c) The Knockout.js team - http://knockoutjs.com/ 75 * License: MIT (http://www.opensource.org/licenses/mit-license.php) 76 */ 77 78(function() {(function(p){var z=this||(0,eval)("this"),w=z.document,R=z.navigator,v=z.jQuery,H=z.JSON;v||"undefined"===typeof jQuery||(v=jQuery);(function(p){var xko={};p(xko);a4jDefine('ko',[],function(){return xko;})})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=p;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d); 79d=a.a.setTimeout(b,c)}}function Z(a,c){c&&"change"!==c?"beforeChange"===c?this.oc(a):this.bb(a,c):this.pc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.pd,e=d[t];e.qa||(this.Pb&&this.kb[c]?(d.tc(c,a,this.kb[c]),this.kb[c]=null,--this.Pb):e.F[c]||d.tc(c,a,e.G?{da:a}:d.Zc(a)),a.Ka&&a.fd())}var a="undefined"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.J=function(a,c,d){a[c]=d};a.version="3.5.0";a.b("version", 80a.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var k=b[c].match(n)||[];a.a.C(d.match(n),function(b){a.a.Oa(k,b,e)});b[c]=k.join(" ")}var f=Object.prototype.hasOwnProperty,g={__proto__:[]}instanceof Array,h="function"===typeof Symbol,m={},l={};m[R&&/Firefox\/2/i.test(R.userAgent)? 81"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];m.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(m,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)l[b[c]]=a});var k={propertychange:!0},q=w&&function(){for(var a=3,b=w.createElement("div"),c=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+ ++a+"]><i></i><![endif]--\x3e",c[0];);return 4<a?a:p}(),n=/\S+/g,r;return{Ic:["authenticity_token",/^__RequestVerificationToken(_.*)?$/], 82C:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},A:"function"==typeof Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Lb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return p},hb:function(b,c){var d=a.a.A(b,c);0<d?b.splice(d,1):0===d&&b.shift()},vc:function(b){var c=[];b&&a.a.C(b,function(b){0>a.a.A(c,b)&&c.push(b)});return c},Mb:function(a, 83b,c){var d=[];if(a)for(var e=0,k=a.length;e<k;e++)d.push(b.call(c,a[e],e));return d},fb:function(a,b,c){var d=[];if(a)for(var e=0,k=a.length;e<k;e++)b.call(c,a[e],e)&&d.push(a[e]);return d},gb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Oa:function(b,c,d){var e=a.a.A(a.a.$b(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,zb:g?d:c,O:b,Ha:function(a,b,c){if(!a)return a;var d={},e;
vendor: 62,666 bytes, lines 83-205
83for(e in a)f.call(a,e)&&(d[e]= 84b.call(c,a[e],e,a));return d},Sb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Xb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement("div"),d=0,e=b.length;d<e;d++)c.appendChild(a.na(b[d]));return c},Ca:function(b,c){for(var d=0,e=b.length,k=[];d<e;d++){var f=b[d].cloneNode(!0);k.push(c?a.na(f):f)}return k},ua:function(b,c){a.a.Sb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Wc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0], 85k=e.parentNode,f=0,l=c.length;f<l;f++)k.insertBefore(c[f],e);f=0;for(l=d.length;f<l;f++)a.removeNode(d[f])}},Ua:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},Yc:function(a,b){7>q?a.setAttribute("selected",b):a.selected=b},Cb:function(a){return null===a||a===p?"":a.trim? 86a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Td:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},ud:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Rb:function(b){return a.a.ud(b,b.ownerDocument.documentElement)},jd:function(b){return!!a.a.Lb(b,a.a.Rb)},P:function(a){return a&& 87a.tagName&&a.tagName.toLowerCase()},zc:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.zc(b),c)},Fc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},H:function(b,c,d){var e=a.a.zc(d);d=k[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var f=function(a){e.call(b,a)},l="on"+c;b.attachEvent(l, 88f);a.a.I.za(b,function(){b.detachEvent(l,f)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(c,e,!1);else r||(r="function"==typeof v(b).on?"on":"bind"),v(b)[r](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"input"===a.a.P(b)&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if("function"==typeof w.createEvent)if("function"== 89typeof b.dispatchEvent)d=w.createEvent(l[c]||"HTMLEvents"),d.initEvent(c,!0,!0,z,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error("The supplied element doesn't support dispatchEvent");else if(d&&b.click)b.click();else if("undefined"!=typeof b.fireEvent)b.fireEvent("on"+c);else throw Error("Browser doesn't support triggering events");else v(b).trigger(c)},c:function(b){return a.N(b)?b():b},$b:function(b){return a.N(b)?b.w():b},Eb:function(b,c,d){var k;c&&("object"===typeof b.classList? 90(k=b.classList[d?"add":"remove"],a.a.C(c.match(n),function(a){k.call(b.classList,a)})):"string"===typeof b.className.baseVal?e(b.className,"baseVal",c,d):e(b,"className",c,d))},Ab:function(b,c){var d=a.a.c(c);if(null===d||d===p)d="";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.ua(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.zd(b)},Xc:function(a,b){a.name=b;if(7>=q)try{var c=a.name.replace(/[&<>'"]/g,function(a){return"&#"+a.charCodeAt(0)+";"});a.mergeAttributes(w.createElement("<input name='"+ 91c+"'/>"),!1)}catch(d){}},zd:function(a){9<=q&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},vd:function(a){if(q){var b=a.style.width;a.style.width=0;a.style.width=b}},Od:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Da:function(a){return h?Symbol(a):a},Xd:6===q,Yd:7===q,W:q,Kc:function(b,c){for(var d=a.a.la(b.getElementsByTagName("input")).concat(a.a.la(b.getElementsByTagName("textarea"))), 92e="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},k=[],f=d.length-1;0<=f;f--)e(d[f])&&k.push(d[f]);return k},Md:function(b){return"string"==typeof b&&(b=a.a.Cb(b))?H&&H.parse?H.parse(b):(new Function("return "+b))():null},fc:function(b,c,d){if(!H||!H.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"); 93return H.stringify(a.a.c(b),c,d)},Nd:function(c,d,e){e=e||{};var k=e.params||{},f=e.includeFields||this.Ic,l=c;if("object"==typeof c&&"form"===a.a.P(c))for(var l=c.action,h=f.length-1;0<=h;h--)for(var g=a.a.Kc(c,f[h]),m=g.length-1;0<=m;m--)k[g[m].name]=g[m].value;d=a.a.c(d);var n=w.createElement("form");n.style.display="none";n.action=l;n.method="post";for(var q in d)c=w.createElement("input"),c.type="hidden",c.name=q,c.value=a.a.fc(a.a.c(d[q])),n.appendChild(c);b(k,function(a,b){var c=w.createElement("input"); 94c.type="hidden";c.name=a;c.value=b;n.appendChild(c)});w.body.appendChild(n);e.submitter?e.submitter(n):n.submit();setTimeout(function(){n.parentNode.removeChild(n)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.C);a.b("utils.arrayFirst",a.a.Lb);a.b("utils.arrayFilter",a.a.fb);a.b("utils.arrayGetDistinctValues",a.a.vc);a.b("utils.arrayIndexOf",a.a.A);a.b("utils.arrayMap",a.a.Mb);a.b("utils.arrayPushAll",a.a.gb);a.b("utils.arrayRemoveItem",a.a.hb);a.b("utils.cloneNodes",a.a.Ca);a.b("utils.createSymbolOrString", 95a.a.Da);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",a.a.Ic);a.b("utils.getFormFields",a.a.Kc);a.b("utils.objectMap",a.a.Ha);a.b("utils.peekObservable",a.a.$b);a.b("utils.postJson",a.a.Nd);a.b("utils.parseJson",a.a.Md);a.b("utils.registerEventHandler",a.a.H);a.b("utils.stringifyJson",a.a.fc);a.b("utils.range",a.a.Od);a.b("utils.toggleDomNodeCssClass",a.a.Eb);a.b("utils.triggerEvent",a.a.Fb);a.b("utils.unwrapObservable",a.a.c);a.b("utils.objectForEach",a.a.O);a.b("utils.addOrRemoveItem", 96a.a.Oa);a.b("utils.setTextContent",a.a.Ab);a.b("unwrap",a.a.c);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.g=new function(){var b=0,c="__ko__"+(new Date).getTime(),d={},e,f;a.a.W?(e=function(a,e){var f=a[c];if(!f||"null"===f||!d[f]){if(!e)return p;f=a[c]="ko"+b++;d[f]= 97{}}return d[f]},f=function(a){var b=a[c];return b?(delete d[b],a[c]=null,!0):!1}):(e=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d},f=function(a){return a[c]?(delete a[c],!0):!1});return{get:function(a,b){var c=e(a,!1);return c&&c[b]},set:function(a,b,c){(a=e(a,c!==p))&&(a[b]=c)},Tb:function(a,b,c){a=e(a,!0);return a[b]||(a[b]=c)},clear:f,Z:function(){return b++ +c}}};a.b("utils.domData",a.a.g);a.b("utils.domData.clear",a.a.g.clear);a.a.I=new function(){function b(b,c){var d=a.a.g.get(b,e); 98d===p&&c&&(d=[],a.a.g.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),f=0;f<e.length;f++)e[f](c);a.a.g.clear(c);a.a.I.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],k,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=k=b[f]),b[f]!==k)for(;f--&&-1==a.a.A(e,b[f]););}var e=a.a.g.Z(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{za:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},xb:function(c, 99d){var f=b(c,!1);f&&(a.a.hb(f,d),0==f.length&&a.a.g.set(c,e,p))},na:function(a){f[a.nodeType]&&(c(a),g[a.nodeType]&&d(a.getElementsByTagName("*")));return a},removeNode:function(b){a.na(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&"function"==typeof v.cleanData&&v.cleanData([a])}}};a.na=a.a.I.na;a.removeNode=a.a.I.removeNode;a.b("cleanNode",a.na);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.I);a.b("utils.domNodeDisposal.addDisposeCallback",a.a.I.za); 100a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.I.xb);(function(){var b=[0,"",""],c=[1,"<table>","</table>"],d=[3,"<table><tbody><tr>","</tr></tbody></table>"],e=[1,"<select multiple='multiple'>","</select>"],f={thead:c,tbody:c,tfoot:c,tr:[2,"<table><tbody>","</tbody></table>"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ta=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var k=e[0];k.parentNode&&11!==k.parentNode.nodeType;)k=k.parentNode; 101k.parentNode&&k.parentNode.removeChild(k)}}else{(e=d)||(e=w);var k=e.parentWindow||e.defaultView||z,q=a.a.Cb(c).toLowerCase(),n=e.createElement("div"),r;r=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&f[q[1]]||b;q=r[0];r="ignored<div>"+r[1]+c+r[2]+"</div>";"function"==typeof k.innerShiv?n.appendChild(k.innerShiv(r)):(g&&e.body.appendChild(n),n.innerHTML=r,g&&n.parentNode.removeChild(n));for(;q--;)n=n.lastChild;e=a.a.la(n.lastChild.childNodes)}return e};a.a.Ld=function(b,c){var d=a.a.ta(b, 102c);return d.length&&d[0].parentElement||a.a.Xb(d)};a.a.dc=function(b,c){a.a.Sb(b);c=a.a.c(c);if(null!==c&&c!==p)if("string"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ta(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b("utils.parseHtmlFragment",a.a.ta);a.b("utils.setHtml",a.a.dc);a.aa=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Tc(c.nodeValue);null!=f&&e.push({sd:c,Jd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f], 103e)}var c={};return{Wb:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},ad:function(a,b){var f=c[a];if(f===p)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},bd:function(c,e){var f= 104[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].sd,l=[m];e&&a.a.gb(l,e);a.aa.ad(f[g].Jd,l);m.nodeValue="";m.parentNode&&m.parentNode.removeChild(m)}},Tc:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.aa);a.b("memoization.memoize",a.aa.Wb);a.b("memoization.unmemoize",a.aa.ad);a.b("memoization.parseMemoText",a.aa.Tc);a.b("memoization.unmemoizeDomNodeAndDescendants",a.aa.bd);a.ma=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<= 105++c){h=f;a.a.Fc(Error("'Too much recursion' after processing "+c+" task groups."));break}b=f}try{d()}catch(g){a.a.Fc(g)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;z.MutationObserver?d=function(a){var b=w.createElement("div");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle("foo")}}(c):d=w&&"onreadystatechange"in w.createElement("script")?function(a){var b=w.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b); 106b=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,yb:function(b){f||a.ma.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},Rd:b}}();a.b("tasks",a.ma);a.b("tasks.schedule",a.ma.yb);a.b("tasks.runEarly",a.ma.Rd);a.Ta={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.$({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)}, 107c)}})},rateLimit:function(a,c){var d,e,f;"number"==typeof c?d=c:(d=c.timeout,e=c.method);a.Hb=!1;f="function"==typeof e?e:"notifyWhenChangesStop"==e?Y:X;a.tb(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.tb(function(c){var e,f=!1;return function(){if(!f){a.ma.cancel(e);e=a.ma.yb(c);try{f=!0,b.notifySubscribers(p,"dirty")}finally{f= 108!1}}}}))},notify:function(a,c){a.equalityComparer="always"==c?null:K}};var W={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.Ta);a.gc=function(b,c,d){this.da=b;this.kc=c;this.lc=d;this.Ib=!1;this.ab=this.Jb=null;a.J(this,"dispose",this.s);a.J(this,"disposeWhenNodeIsRemoved",this.l)};a.gc.prototype.s=function(){this.Ib||(this.ab&&a.a.I.xb(this.Jb,this.ab),this.Ib=!0,this.lc(),this.da=this.kc=this.lc=this.Jb=this.ab=null)};a.gc.prototype.l=function(b){this.Jb=b;a.a.I.za(b,this.ab=this.s.bind(this))}; 109a.R=function(){a.a.zb(this,D);D.ob(this)};var D={ob:function(a){a.S={change:[]};a.rc=1},subscribe:function(b,c,d){var e=this;d=d||"change";var f=new a.gc(e,c?b.bind(c):b,function(){a.a.hb(e.S[d],f);e.cb&&e.cb(d)});e.Qa&&e.Qa(d);e.S[d]||(e.S[d]=[]);e.S[d].push(f);return f},notifySubscribers:function(b,c){c=c||"change";"change"===c&&this.Gb();if(this.Wa(c)){var d="change"===c&&this.dd||this.S[c].slice(0);try{a.v.wc();for(var e=0,f;f=d[e];++e)f.Ib||f.kc(b)}finally{a.v.end()}}},mb:function(){return this.rc}, 110Cd:function(a){return this.mb()!==a},Gb:function(){++this.rc},tb:function(b){var c=this,d=a.N(c),e,f,g,h,m;c.bb||(c.bb=c.notifySubscribers,c.notifySubscribers=Z);var l=b(function(){c.Ka=!1;d&&h===c&&(h=c.mc?c.mc():c());var a=f||m&&c.qb(g,h);m=f=e=!1;a&&c.bb(g=h)});c.pc=function(a,b){b&&c.Ka||(m=!b);c.dd=c.S.change.slice(0);c.Ka=e=!0;h=a;l()};c.oc=function(a){e||(g=a,c.bb(a,"beforeChange"))};c.qc=function(){m=!0};c.fd=function(){c.qb(g,c.w(!0))&&(f=!0)}},Wa:function(a){return this.S[a]&&this.S[a].length}, 111Ad:function(b){if(b)return this.S[b]&&this.S[b].length||0;var c=0;a.a.O(this.S,function(a,b){"dirty"!==a&&(c+=b.length)});return c},qb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return"[object Object]"},extend:function(b){var c=this;b&&a.a.O(b,function(b,e){var f=a.Ta[b];"function"==typeof f&&(c=f(c,e)||c)});return c}};a.J(D,"init",D.ob);a.J(D,"subscribe",D.subscribe);a.J(D,"extend",D.extend);a.J(D,"getSubscriptionsCount",D.Ad);a.a.Ba&&a.a.setPrototypeOf(D, 112Function.prototype);a.R.fn=D;a.Pc=function(a){return null!=a&&"function"==typeof a.subscribe&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.R);a.b("isSubscribable",a.Pc);a.U=a.v=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{wc:b,end:c,ac:function(b){if(e){if(!a.Pc(b))throw Error("Only subscribable things can act as dependencies");e.nd.call(e.od,b,b.ed||(b.ed=++f))}},K:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},pa:function(){if(e)return e.o.pa()}, 113Va:function(){if(e)return e.o.Va()},rb:function(){if(e)return e.rb},o:function(){if(e)return e.o}}}();a.b("computedContext",a.U);a.b("computedContext.getDependenciesCount",a.U.pa);a.b("computedContext.getDependencies",a.U.Va);a.b("computedContext.isInitial",a.U.rb);a.b("computedContext.registerDependency",a.U.ac);a.b("ignoreDependencies",a.Wd=a.v.K);var I=a.a.Da("_latestValue");a.sa=function(b){function c(){if(0<arguments.length)return c.qb(c[I],arguments[0])&&(c.xa(),c[I]=arguments[0],c.wa()),this; 114a.v.ac(c);return c[I]}c[I]=b;a.a.Ba||a.a.extend(c,a.R.fn);a.R.fn.ob(c);a.a.zb(c,F);a.options.deferUpdates&&a.Ta.deferred(c,!0);return c};var F={equalityComparer:K,w:function(){return this[I]},wa:function(){this.notifySubscribers(this[I],"spectate");this.notifySubscribers(this[I])},xa:function(){this.notifySubscribers(this[I],"beforeChange")}};a.a.Ba&&a.a.setPrototypeOf(F,a.R.fn);var G=a.sa.Na="__ko_proto__";F[G]=a.sa;a.N=function(b){if((b="function"==typeof b&&b[G])&&b!==F[G]&&b!==a.o.fn[G])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance"); 115return!!b};a.Ya=function(b){return"function"==typeof b&&(b[G]===F[G]||b[G]===a.o.fn[G]&&b.Mc)};a.b("observable",a.sa);a.b("isObservable",a.N);a.b("isWriteableObservable",a.Ya);a.b("isWritableObservable",a.Ya);a.b("observable.fn",F);a.J(F,"peek",F.w);a.J(F,"valueHasMutated",F.wa);a.J(F,"valueWillMutate",F.xa);a.Ia=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.sa(b);a.a.zb(b, 116a.Ia.fn);return b.extend({trackArrayChanges:!0})};a.Ia.fn={remove:function(b){for(var c=this.w(),d=[],e="function"!=typeof b||a.N(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.xa();if(c[f]!==g)throw Error("Array modified during remove; cannot remove item");d.push(g);c.splice(f,1);f--}}d.length&&this.wa();return d},removeAll:function(b){if(b===p){var c=this.w(),d=c.slice(0);this.xa();c.splice(0,c.length);this.wa();return d}return b?this.remove(function(c){return 0<= 117a.a.A(b,c)}):[]},destroy:function(b){var c=this.w(),d="function"!=typeof b||a.N(b)?function(a){return a===b}:b;this.xa();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.wa()},destroyAll:function(b){return b===p?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.A(b,c)}):[]},indexOf:function(b){var c=this();return a.a.A(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.xa(),this.w()[d]=c,this.wa())},sorted:function(a){var c=this().slice(0); 118return a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.Ba&&a.a.setPrototypeOf(a.Ia.fn,a.sa.fn);a.a.C("pop push reverse shift sort splice unshift".split(" "),function(b){a.Ia.fn[b]=function(){var a=this.w();this.xa();this.yc(a,b,arguments);var d=a[b].apply(a,arguments);this.wa();return d===a?this:d}});a.a.C(["slice"],function(b){a.Ia.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Oc=function(b){return a.N(b)&&"function"==typeof b.remove&&"function"== 119typeof b.push};a.b("observableArray",a.Ia);a.b("isObservableArray",a.Oc);a.Ta.trackArrayChanges=function(b,c){function d(){function c(){if(h){var d=[].concat(b.w()||[]);if(b.Wa("arrayChange")){var e;if(!f||1<h)f=a.a.Ob(m,d,b.Nb);e=f}m=d;f=null;h=0;e&&e.length&&b.notifySubscribers(e,"arrayChange")}}e?c():(e=!0,l=b.notifySubscribers,b.notifySubscribers=function(a,b){b&&"change"!==b||++h;return l.apply(this,arguments)},m=[].concat(b.w()||[]),f=null,g=b.subscribe(c))}b.Nb={};c&&"object"==typeof c&&a.a.extend(b.Nb, 120c);b.Nb.sparse=!0;if(!b.yc){var e=!1,f=null,g,h=0,m,l,k=b.Qa,q=b.cb;b.Qa=function(a){k&&k.call(b,a);"arrayChange"===a&&d()};b.cb=function(a){q&&q.call(b,a);"arrayChange"!==a||b.Wa("arrayChange")||(l&&(b.notifySubscribers=l,l=p),g&&g.s(),g=null,e=!1,m=p)};b.yc=function(b,c,d){function k(a,b,c){return l[l.length]={status:a,value:b,index:c}}if(e&&!h){var l=[],g=b.length,q=d.length,m=0;switch(c){case "push":m=g;case "unshift":for(c=0;c<q;c++)k("added",d[c],m+c);break;case "pop":m=g-1;case "shift":g&& 121k("deleted",b[m],m);break;case "splice":c=Math.min(Math.max(0,0>d[0]?g+d[0]:d[0]),g);for(var g=1===q?g:Math.min(c+(d[1]||0),g),q=c+q-2,m=Math.max(g,q),U=[],L=[],p=2;c<m;++c,++p)c<g&&L.push(k("deleted",b[c],c)),c<q&&U.push(k("added",d[p],c));a.a.Jc(L,U);break;default:return}f=l}}}};var t=a.a.Da("_state");a.o=a.$=function(b,c,d){function e(){if(0<arguments.length){if("function"===typeof f)f.apply(g.lb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."); 122return this}g.qa||a.v.ac(e);(g.ka||g.G&&e.Xa())&&e.ha();return g.X}"object"===typeof b?d=b:(d=d||{},b&&(d.read=b));if("function"!=typeof d.read)throw Error("Pass a function that returns the value of the ko.computed");var f=d.write,g={X:p,ra:!0,ka:!0,pb:!1,hc:!1,qa:!1,vb:!1,G:!1,Vc:d.read,lb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Sa:d.disposeWhen||d.Sa,Qb:null,F:{},V:0,Hc:null};e[t]=g;e.Mc="function"===typeof f;a.a.Ba||a.a.extend(e,a.R.fn);a.R.fn.ob(e);a.a.zb(e,C);d.pure?(g.vb=!0,g.G=!0, 123a.a.extend(e,da)):d.deferEvaluation&&a.a.extend(e,ea);a.options.deferUpdates&&a.Ta.deferred(e,!0);g.l&&(g.hc=!0,g.l.nodeType||(g.l=null));g.G||d.deferEvaluation||e.ha();g.l&&e.ja()&&a.a.I.za(g.l,g.Qb=function(){e.s()});return e};var C={equalityComparer:K,pa:function(){return this[t].V},Va:function(){var b=[];a.a.O(this[t].F,function(a,d){b[d.La]=d.da});return b},Ub:function(b){if(!this[t].V)return!1;var c=this.Va();return-1!==a.a.A(c,b)?!0:!!a.a.Lb(c,function(a){return a.Ub&&a.Ub(b)})},tc:function(a, 124c,d){if(this[t].vb&&c===this)throw Error("A 'pure' computed must not be called recursively");this[t].F[a]=d;d.La=this[t].V++;d.Ma=c.mb()},Xa:function(){var a,c,d=this[t].F;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Ja&&c.da.Ka||c.da.Cd(c.Ma)))return!0},Id:function(){this.Ja&&!this[t].pb&&this.Ja(!1)},ja:function(){var a=this[t];return a.ka||0<a.V},Qd:function(){this.Ka?this[t].ka&&(this[t].ra=!0):this.Gc()},Zc:function(a){if(a.Hb){var c=a.subscribe(this.Id,this,"dirty"), 125d=a.subscribe(this.Qd,this);return{da:a,s:function(){c.s();d.s()}}}return a.subscribe(this.Gc,this)},Gc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[t].Hc),this[t].Hc=a.a.setTimeout(function(){b.ha(!0)},c)):b.Ja?b.Ja(!0):b.ha(!0)},ha:function(b){var c=this[t],d=c.Sa,e=!1;if(!c.pb&&!c.qa){if(c.l&&!a.a.Rb(c.l)||d&&d()){if(!c.hc){this.s();return}}else c.hc=!1;c.pb=!0;try{e=this.yd(b)}finally{c.pb=!1}return e}},yd:function(b){var c=this[t],d=!1,e=c.vb?p:!c.V,d={pd:this,kb:c.F, 126Pb:c.V};a.v.wc({od:d,nd:ba,o:this,rb:e});c.F={};c.V=0;var f=this.xd(c,d);c.V?d=this.qb(c.X,f):(this.s(),d=!0);d&&(c.G?this.Gb():this.notifySubscribers(c.X,"beforeChange"),c.X=f,this.notifySubscribers(c.X,"spectate"),!c.G&&b&&this.notifySubscribers(c.X),this.qc&&this.qc());e&&this.notifySubscribers(c.X,"awake");return d},xd:function(b,c){try{var d=b.Vc;return b.lb?d.call(b.lb):d()}finally{a.v.end(),c.Pb&&!b.G&&a.a.O(c.kb,aa),b.ra=b.ka=!1}},w:function(a){var c=this[t];(c.ka&&(a||!c.V)||c.G&&this.Xa())&& 127this.ha();return c.X},tb:function(b){a.R.fn.tb.call(this,b);this.mc=function(){this[t].G||(this[t].ra?this.ha():this[t].ka=!1);return this[t].X};this.Ja=function(a){this.oc(this[t].X);this[t].ka=!0;a&&(this[t].ra=!0);this.pc(this,!a)}},s:function(){var b=this[t];!b.G&&b.F&&a.a.O(b.F,function(a,b){b.s&&b.s()});b.l&&b.Qb&&a.a.I.xb(b.l,b.Qb);b.F=p;b.V=0;b.qa=!0;b.ra=!1;b.ka=!1;b.G=!1;b.l=p;b.Sa=p;b.Vc=p;this.Mc||(b.lb=p)}},da={Qa:function(b){var c=this,d=c[t];if(!d.qa&&d.G&&"change"==b){d.G=!1;if(d.ra|| 128c.Xa())d.F=null,d.V=0,c.ha()&&c.Gb();else{var e=[];a.a.O(d.F,function(a,b){e[b.La]=a});a.a.C(e,function(a,b){var e=d.F[a],m=c.Zc(e.da);m.La=b;m.Ma=e.Ma;d.F[a]=m});c.Xa()&&c.ha()&&c.Gb()}d.qa||c.notifySubscribers(d.X,"awake")}},cb:function(b){var c=this[t];c.qa||"change"!=b||this.Wa("change")||(a.a.O(c.F,function(a,b){b.s&&(c.F[a]={da:b.da,La:b.La,Ma:b.Ma},b.s())}),c.G=!0,this.notifySubscribers(p,"asleep"))},mb:function(){var b=this[t];b.G&&(b.ra||this.Xa())&&this.ha();return a.R.fn.mb.call(this)}}, 129ea={Qa:function(a){"change"!=a&&"beforeChange"!=a||this.w()}};a.a.Ba&&a.a.setPrototypeOf(C,a.R.fn);var N=a.sa.Na;C[N]=a.o;a.Nc=function(a){return"function"==typeof a&&a[N]===C[N]};a.Ed=function(b){return a.Nc(b)&&b[t]&&b[t].vb};a.b("computed",a.o);a.b("dependentObservable",a.o);a.b("isComputed",a.Nc);a.b("isPureComputed",a.Ed);a.b("computed.fn",C);a.J(C,"peek",C.w);a.J(C,"dispose",C.s);a.J(C,"isActive",C.ja);a.J(C,"getDependenciesCount",C.pa);a.J(C,"getDependencies",C.Va);a.wb=function(b,c){if("function"=== 130typeof b)return a.o(b,c,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b("pureComputed",a.wb);(function(){function b(a,f,g){g=g||new d;a=f(a);if("object"!=typeof a||null===a||a===p||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var h=a instanceof Array?[]:{};g.save(a,h);c(a,function(c){var d=f(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":h[c]=d;break;case "object":case "undefined":var k= 131g.get(d);h[c]=k!==p?k:b(d,f,g)}});return h}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=[];this.values=[]}a.$c=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.N(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.$c(b);return a.a.fc(b,c,d)};d.prototype={constructor:d,save:function(b, 132c){var d=a.a.A(this.keys,b);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:p}}})();a.b("toJS",a.$c);a.b("toJSON",a.toJSON);a.Vd=function(b,c,d){function e(c){var e=a.wb(b,d).extend({Ga:"always"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.w());return h}return"function"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b("when",a.Vd);(function(){a.u={L:function(b){switch(a.a.P(b)){case "option":return!0=== 133b.__ko__hasDomDataOptionValue__?a.a.g.get(b,a.f.options.Yb):7>=a.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.u.L(b.options[b.selectedIndex]):p;default:return b.value}},ya:function(b,c,d){switch(a.a.P(b)){case "option":"string"===typeof c?(a.a.g.set(b,a.f.options.Yb,p),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.f.options.Yb,c),b.__ko__hasDomDataOptionValue__= 134!0,b.value="number"===typeof c?c:"");break;case "select":if(""===c||null===c)c=p;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.u.L(b.options[f]),h==c||""===h&&c===p){e=f;break}if(d||0<=e||c===p&&1<b.size)b.selectedIndex=e,6===a.a.W&&a.a.setTimeout(function(){b.selectedIndex=e},0);break;default:if(null===c||c===p)c="";b.value=c}}}})();a.b("selectExtensions",a.u);a.b("selectExtensions.readValue",a.u.L);a.b("selectExtensions.writeValue",a.u.ya);a.m=function(){function b(b){b=a.a.Cb(b);123===b.charCodeAt(0)&& 135(b=b.slice(1,-1));b+="\n,";var c=[],d=b.match(e),q,n=[],h=0;if(1<d.length){for(var y=0,A;A=d[y];++y){var u=A.charCodeAt(0);if(44===u){if(0>=h){c.push(q&&n.length?{key:q,value:n.join("")}:{unknown:q||n.join("")});q=h=0;n=[];continue}}else if(58===u){if(!h&&!q&&1===n.length){q=n.pop();continue}}else if(47===u&&1<A.length&&(47===A.charCodeAt(1)||42===A.charCodeAt(1)))continue;else 47===u&&y&&1<A.length?(u=d[y-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(A)+1),d=b.match(e),y=-1,A="/"):40===u||123=== 136u||91===u?++h:41===u||125===u||93===u?--h:q||n.length||34!==u&&39!==u||(A=A.slice(1,-1));n.push(A)}if(0<h)throw Error("Unbalanced parentheses, braces, or brackets");}return c}var c=["true","false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,g={"in":1,"return":1, 137"typeof":1},h={};return{Ra:[],va:h,Zb:b,ub:function(e,f){function k(b,e){var f;if(!y){var l=a.getBindingHandler(b);if(l&&l.preprocess&&!(e=l.preprocess(e,b,k)))return;if(l=h[b])f=e,0<=a.a.A(c,f)?f=!1:(l=f.match(d),f=null===l?!1:l[1]?"Object("+l[1]+")"+l[2]:f),l=f;l&&n.push("'"+("string"==typeof h[b]?h[b]:b)+"':function(_z){"+f+"=_z}")}g&&(e="function(){return "+e+" }");q.push("'"+b+"':"+e)}f=f||{};var q=[],n=[],g=f.valueAccessors,y=f.bindingParams,A="string"===typeof e?b(e):e;a.a.C(A,function(a){k(a.key|| 138a.unknown,a.value)});n.length&&k("_ko_property_writers","{"+n.join(",")+" }");return q.join(",")},Hd:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},$a:function(b,c,d,e,f){if(b&&a.N(b))!a.Ya(b)||f&&b.w()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();a.b("expressionRewriting",a.m);a.b("expressionRewriting.bindingRewriteValidators",a.m.Ra);a.b("expressionRewriting.parseObjectLiteral",a.m.Zb);a.b("expressionRewriting.preProcessBindings",a.m.ub);a.b("expressionRewriting._twoWayBindings", 139a.m.va);a.b("jsonExpressionRewriting",a.m);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.m.ub);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,g=1,h=[];f=f.nextSibling;){if(c(f)&&(a.a.g.set(f,l,!0),g--,0===g))return h;h.push(f);b(f)&&g++}if(!e)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c? 1400<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&"\x3c!--test--\x3e"===w.createComment("test").text,g=f?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,h=f?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,m={ul:!0,ol:!0},l="__ko_matchedEndComment__";a.h={ea:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ea:function(c){if(b(c)){c=a.h.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Sb(c)},ua:function(c,d){if(b(c)){a.h.Ea(c);for(var e= 141c.nextSibling,f=0,l=d.length;f<l;f++)e.parentNode.insertBefore(d[f],e)}else a.a.ua(c,d)},Uc:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},Vb:function(c,d,e){e?b(c)?c.parentNode.insertBefore(d,e.nextSibling):e.nextSibling?c.insertBefore(d,e.nextSibling):c.appendChild(d):a.h.Uc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error("Found invalid end comment, as the first child of "+ 142a);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.g.get(f,l))throw Error("Found end comment without a matching opening comment, as child of "+d);return null}return d.nextSibling},Bd:b,Ud:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Rc:function(d){if(m[a.a.P(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var l;l=f.firstChild;var g=null;if(l){do if(g)g.push(l);else if(b(l)){var h=e(l,!0);h?l= 143h:g=[l]}else c(l)&&(g=[l]);while(l=l.nextSibling)}if(l=g)for(g=f.nextSibling,h=0;h<l.length;h++)g?d.insertBefore(l[h],g):d.appendChild(l[h])}while(f=f.nextSibling)}}}}})();a.b("virtualElements",a.h);a.b("virtualElements.allowedBindings",a.h.ea);a.b("virtualElements.emptyNode",a.h.Ea);a.b("virtualElements.insertAfter",a.h.Vb);a.b("virtualElements.prepend",a.h.Uc);a.b("virtualElements.setDomNodeChildren",a.h.ua);(function(){a.ga=function(){this.md={}};a.a.extend(a.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!= 144b.getAttribute("data-bind")||a.i.getComponentNameForNode(b);case 8:return a.h.Bd(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.i.sc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.i.sc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.h.Ud(b);default:return null}}, 145parseBindingsString:function(b,c,d,e){try{var f=this.md,g=b+(e&&e.valueAccessors||""),h;if(!(h=f[g])){var m,l="with($context){with($data||{}){return{"+a.m.ub(b,e)+"}}}";m=new Function("$context","$element",l);h=f[g]=m}return h(c,d)}catch(k){throw k.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+k.message,k;}}});a.ga.instance=new a.ga})();a.b("bindingProvider",a.ga);(function(){function b(b){var c=(b=a.a.g.get(b,B))&&b.M;c&&(b.M=null,c.Sc())}function c(c,d,e){this.node=c;this.xc= 146d;this.ib=[];this.T=!1;d.M||a.a.I.za(c,b);e&&e.M&&(e.M.ib.push(c),this.Kb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Ha(a.v.K(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return"function"===typeof b?f(b.bind(null,c,e)):a.a.Ha(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,k=f.preprocessNode;if(k){for(;e=d;)d=a.h.nextSibling(e),k.call(f,e); 147d=a.h.firstChild(c)}for(;e=d;)d=a.h.nextSibling(e),l(b,e)}a.j.Ga(c,a.j.T)}function l(b,c){var d=b,e=1===c.nodeType;e&&a.h.Rc(c);if(e||a.ga.instance.nodeHasBindings(c))d=q(c,null,b).bindingContextForDescendants;d&&!u[a.a.P(c)]&&m(d,c)}function k(b){var c=[],d={},e=[];a.a.O(b,function ca(f){if(!d[f]){var l=a.getBindingHandler(f);l&&(l.after&&(e.push(f),a.a.C(l.after,function(c){if(b[c]){if(-1!==a.a.A(e,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", ")); 148ca(c)}}),e.length--),c.push({key:f,Lc:l}));d[f]=!0}});return c}function q(b,c,d){var f=a.a.g.Tb(b,B,{}),l=f.gd;if(!c){if(l)throw Error("You cannot apply bindings multiple times to the same element.");f.gd=!0}l||(f.context=d);var g;if(c&&"function"!==typeof c)g=c;else{var q=a.ga.instance,n=q.getBindingAccessors||h,m=a.$(function(){if(g=c?c(d,b):n.call(q,b,d)){if(d[r])d[r]();if(d[A])d[A]()}return g},null,{l:b});g&&m.ja()||(m=null)}var y=d,u;if(g){var J=function(){return a.a.Ha(m?m():g,e)},t=m?function(a){return function(){return e(m()[a])}}: 149function(a){return g[a]};J.get=function(a){return g[a]&&e(t(a))};J.has=function(a){return a in g};a.j.T in g&&a.j.subscribe(b,a.j.T,function(){var c=(0,g[a.j.T])();if(c){var d=a.h.childNodes(b);d.length&&c(d,a.Dc(d[0]))}});a.j.oa in g&&(y=a.j.Bb(b,d),a.j.subscribe(b,a.j.oa,function(){var c=(0,g[a.j.oa])();c&&a.h.firstChild(b)&&c(b)}));f=k(g);a.a.C(f,function(c){var d=c.Lc.init,e=c.Lc.update,f=c.key;if(8===b.nodeType&&!a.h.ea[f])throw Error("The binding '"+f+"' cannot be used with virtual elements"); 150try{"function"==typeof d&&a.v.K(function(){var a=d(b,t(f),J,y.$data,y);if(a&&a.controlsDescendantBindings){if(u!==p)throw Error("Multiple bindings ("+u+" and "+f+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=f}}),"function"==typeof e&&a.$(function(){e(b,t(f),J,y.$data,y)},null,{l:b})}catch(l){throw l.message='Unable to process binding "'+f+": "+g[f]+'"\nMessage: '+l.message,l;}})}f=u===p;return{shouldBindDescendants:f, 151bindingContextForDescendants:f&&y}}function n(b,c){return b&&b instanceof a.fa?b:new a.fa(b,p,p,c)}var r=a.a.Da("_subscribable"),y=a.a.Da("_ancestorBindingInfo"),A=a.a.Da("_dataDependency");a.f={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.f[b]};var J={};a.fa=function(b,c,d,e,f){function l(){var b=q?h():h,f=a.a.c(b);c?(a.a.extend(k,c),y in c&&(k[y]=c[y])):(k.$parents=[],k.$root=f,k.ko=a);k[r]=n;g?f=k.$data:(k.$rawData=b,k.$data=f);d&&(k[d]=f);e&&e(k,c,f);if(c&& 152c[r]&&!a.U.o().Ub(c[r]))c[r]();m&&(k[A]=m);return k.$data}var k=this,g=b===J,h=g?p:b,q="function"==typeof h&&!a.N(h),n,m=f&&f.dataDependency;f&&f.exportDependencies?l():(n=a.wb(l),n.w(),n.ja()?n.equalityComparer=null:k[r]=p)};a.fa.prototype.createChildContext=function(b,c,d,e){!e&&c&&"object"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f="function"==typeof b&&!a.N(b);return new a.fa(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.fa(b,this,c,function(a,b){a.$parentContext= 153b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.fa.prototype.extend=function(b,c){return new a.fa(J,this,null,function(c){a.a.extend(c,"function"==typeof b?b(c):b)},c)};var B=a.a.g.Z();c.prototype.Sc=function(){this.Kb&&this.Kb.M&&this.Kb.M.rd(this.node)};c.prototype.rd=function(b){a.a.hb(this.ib,b);!this.ib.length&&this.T&&this.Bc()};c.prototype.Bc=function(){this.T=!0;this.xc.M&&!this.ib.length&&(this.xc.M=null,a.a.I.xb(this.node,b),a.j.Ga(this.node, 154a.j.oa),this.Sc())};a.j={T:"childrenComplete",oa:"descendantsComplete",subscribe:function(b,c,d,e){b=a.a.g.Tb(b,B,{});b.Fa||(b.Fa=new a.R);return b.Fa.subscribe(d,e,c)},Ga:function(b,c){var d=a.a.g.get(b,B);if(d&&(d.Fa&&d.Fa.notifySubscribers(b,c),c==a.j.T))if(d.M)d.M.Bc();else if(d.M===p&&d.Fa&&d.Fa.Wa(a.j.oa))throw Error("descendantsComplete event not supported for bindings on this node");},Bb:function(b,d){var e=a.a.g.Tb(b,B,{});e.M||(e.M=new c(b,e,d[y]));return d[y]==e?d:d.extend(function(a){a[y]= 155e})}};a.Sd=function(b){return(b=a.a.g.get(b,B))&&b.context};a.eb=function(b,c,d){1===b.nodeType&&a.h.Rc(b);return q(b,c,n(d))};a.kd=function(b,c,d){d=n(d);return a.eb(b,g(c,d,b),d)};a.Pa=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(n(a),b)};a.uc=function(a,b,c){!v&&z.jQuery&&(v=z.jQuery);if(2>arguments.length){if(b=w.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"); 156l(n(a,c),b)};a.Cc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?p:a.Sd(b)};a.Dc=function(b){return(b=a.Cc(b))?b.$data:p};a.b("bindingHandlers",a.f);a.b("bindingEvent",a.j);a.b("bindingEvent.subscribe",a.j.subscribe);a.b("bindingEvent.startPossiblyAsyncContentBinding",a.j.Bb);a.b("applyBindings",a.uc);a.b("applyBindingsToDescendants",a.Pa);a.b("applyBindingAccessorsToNode",a.eb);a.b("applyBindingsToNode",a.kd);a.b("contextFor",a.Cc);a.b("dataFor",a.Dc)})();(function(b){function c(c,e){var l= 157Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,k;l?l.subscribe(e):(l=f[c]=new a.R,l.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Fd:e};delete f[c];k||e?l.notifySubscribers(b):a.ma.yb(function(){l.notifySubscribers(b)})}),k=!0)}function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a,c)}):b(null,null)})}function e(c,d,f,k){k||(k=a.i.loaders.slice(0));var g=k.shift();if(g){var n=g[c];if(n){var r=!1;if(n.apply(g,d.concat(function(a){r? 158f(null):null!==a?f(a):e(c,d,f,k)}))!==b&&(r=!0,!g.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else e(c,d,f,k)}else f(null)}var f={},g={};a.i={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Fd?a.v.K(function(){e(f.definition)}):a.ma.yb(function(){e(f.definition)}):c(d,e)},Ac:function(a){delete g[a]},nc:e};a.i.loaders=[];a.b("components",a.i);a.b("components.get",a.i.get); 159a.b("components.clearCachedDefinition",a.i.Ac)})();(function(){function b(b,c,d,e){function g(){0===--A&&e(h)}var h={},A=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.i.nc("loadTemplate",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.i.nc("loadViewModel",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)});else if("function"===typeof b[m])d(b[m]);else if("instance"in b){var e=b.instance;d(function(){return e})}else"viewModel"in 160b?c(a,b.viewModel,d):a("Unknown viewModel value: "+b)}function d(b){switch(a.a.P(b)){case "script":return a.a.ta(b.text);case "textarea":return a.a.ta(b.value);case "template":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return z.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){"string"===typeof b.require?T||z.require?(T||z.require)([b.require],c):a("Uses require, but no AMD loader is present"):c(b)}function g(a){return function(b){throw Error("Component '"+ 161a+"': "+b);}}var h={};a.i.register=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.i.sb(b))throw Error("Component "+b+" is already registered");h[b]=c};a.i.sb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.i.unregister=function(b){delete h[b];a.i.Ac(b)};a.i.Ec={getConfig:function(b,c){c(a.i.sb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if("string"===typeof c)f(a.a.ta(c));else if(c instanceof 162Array)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,z.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if("string"===typeof c){var h=w.getElementById(c);h?f(d(h)):b("Cannot find element with ID "+c)}else b("Unknown element type: "+c);else b("Unknown template value: "+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m="createViewModel";a.b("components.register",a.i.register);a.b("components.isRegistered",a.i.sb);a.b("components.unregister", 163a.i.unregister);a.b("components.defaultLoader",a.i.Ec);a.i.loaders.push(a.i.Ec);a.i.cd=h})();(function(){function b(b,e){var f=b.getAttribute("params");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ha(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ha(f,function(c){var e=c.w();return c.ja()?a.o({read:function(){return a.a.c(c())},write:a.Ya(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,"$raw")||(g.$raw=f);return g}return{$raw:{}}}a.i.getComponentNameForNode= 164function(b){var c=a.a.P(b);if(a.i.sb(c)&&(-1!=c.indexOf("-")||"[object HTMLUnknownElement]"==""+b||8>=a.a.W&&b.tagName===c))return c};a.i.sc=function(c,e,f,g){if(1===e.nodeType){var h=a.i.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.i.register=function(a){return function(b){return a.apply(this, 165arguments)}}(a.i.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.i.cd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has no template");b=a.a.Ca(c);a.h.ua(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,b,c):b}var d=0;a.f.component={init:function(e,f,g,h,m){function l(){var a=k&&k.dispose;"function"===typeof a&&a.call(k);n&&n.s();q=k=n=null}var k,q,n,r=a.a.la(a.h.childNodes(e)); 166a.h.Ea(e);a.a.I.za(e,l);a.o(function(){var g=a.a.c(f()),h,u;"string"===typeof g?h=g:(h=a.a.c(g.name),u=a.a.c(g.params));if(!h)throw Error("No component name specified");var p=a.j.Bb(e,m),B=q=++d;a.i.get(h,function(d){if(q===B){l();if(!d)throw Error("Unknown component '"+h+"'");b(h,d,e);var f=c(d,u,{element:e,templateNodes:r});d=p.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=r}});f&&f.koDescendantsComplete&&(n=a.j.subscribe(e,a.j.oa,f.koDescendantsComplete,f)); 167k=f;a.Pa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={"class":"className","for":"htmlFor"};a.f.attr={update:function(b,c){var d=a.a.c(c())||{};a.a.O(d,function(c,d){d=a.a.c(d);var g=c.indexOf(":"),g="lookupNamespaceURI"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===d||d===p;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();8>=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c, 168d));"name"===c&&a.a.Xc(b,h?"":d)})}};(function(){a.f.checked={after:["value","attr"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.U.rb()&&(e||!m&&!a.U.pa())){var l=a.v.K(c);if(k){var n=q?l.w():l,B=r;r=f;B!==f?e&&(a.a.Oa(n,f,!0),a.a.Oa(n,B,!1)):a.a.Oa(n,f,e);q&&a.Ya(l)&&l(n)}else h&&(f===p?f=e:e||(f=p)),a.m.$a(l,d,"checked",f,!0)}}function f(){var d=a.a.c(c()),e=g();k?(b.checked=0<=a.a.A(d,e),r=e):b.checked=h&&e===p?!!d:g()===d}var g=a.wb(function(){if(d.has("checkedValue"))return a.a.c(d.get("checkedValue")); 169if(n)return d.has("value")?a.a.c(d.get("value")):b.value}),h="checkbox"==b.type,m="radio"==b.type;if(h||m){var l=c(),k=h&&a.a.c(l)instanceof Array,q=!(k&&l.push&&l.splice),n=m||k,r=k?g():p;m&&!b.name&&a.f.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.H(b,"click",e);a.o(f,null,{l:b});l=p}}};a.m.va.checked=!0;a.f.checkedValue={update:function(b,c){b.value=a.a.c(c())}}})();a.f["class"]={update:function(b,c){var d=a.a.Cb(a.a.c(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b, 170d,!0)}};a.f.css={update:function(b,c){var d=a.a.c(c());null!==d&&"object"==typeof d?a.a.O(d,function(c,d){d=a.a.c(d);a.a.Eb(b,c,d)}):a.f["class"].update(b,c)}};a.f.enable={update:function(b,c){var d=a.a.c(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.f.disable={update:function(b,c){a.f.enable.update(b,function(){return!a.a.c(c())})}};a.f.event={init:function(b,c,d,e,f){var g=c()||{};a.a.O(g,function(g){"string"==typeof g&&a.a.H(b,g,function(b){var l,k=c()[g]; 171if(k){try{var q=a.a.la(arguments);e=f.$data;q.unshift(e);l=k.apply(e,q)}finally{!0!==l&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.f.foreach={Qc:function(b){return function(){var c=b(),d=a.a.$b(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.ba.Na};a.a.c(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd, 172beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Na}}},init:function(b,c){return a.f.template.init(b,a.f.foreach.Qc(c))},update:function(b,c,d,e,f){return a.f.template.update(b,a.f.foreach.Qc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach=!0;a.f.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if("activeElement"in f){var g;try{g=f.activeElement}catch(k){g=f.body}e=g===b}f=c();a.m.$a(f, 173d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.H(b,"focus",f);a.a.H(b,"focusin",f);a.a.H(b,"blur",g);a.a.H(b,"focusout",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.c(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.v.K(a.a.Fb,null,[b,d?"focusin":"focusout"]))}};a.m.va.hasfocus=!0;a.f.hasFocus=a.f.hasfocus;a.m.va.hasFocus= 174"hasfocus";a.f.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.dc(b,c())}};(function(){function b(b,d,e){a.f[b]={init:function(b,c,h,m,l){var k,q,n={},r,p,A;if(d){m=h.get("as");var u=h.get("noChildContext");A=!(m&&u);n={as:m,noChildContext:u,exportDependencies:A}}p=(r="render"==h.get("completeOn"))||h.has(a.j.oa);a.o(function(){var h=a.a.c(c()),m=!e!==!h,u=!q,t;if(A||m!==k){p&&(l=a.j.Bb(b,l));if(m){if(!d||A)n.dataDependency=a.U.o();t=d?l.createChildContext("function"== 175typeof h?h:c,n):a.U.pa()?l.extend(null,n):l}u&&a.U.pa()&&(q=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.ua(b,a.a.Ca(q)),a.Pa(t,b)):(a.h.Ea(b),r||a.j.Ga(b,a.j.T));k=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b("if");b("ifnot",!1,!0);b("with",!0)})();a.f.let={init:function(b,c,d,e,f){c=f.extend(c);a.Pa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.f.options={init:function(b){if("select"!==a.a.P(b))throw Error("options binding applies only to SELECT elements"); 176for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.fb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function g(c,e){if(y&&k)a.u.ya(b,a.a.c(d.get("value")),!0);else if(r.length){var f=0<=a.a.A(r,a.u.L(e[0]));a.a.Yc(e[0],f);y&&!f&&a.v.K(a.a.Fb,null,[b,"change"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,l=a.a.c(c()),k=d.get("valueAllowUnset")&&d.has("value"), 177q=d.get("optionsIncludeDestroyed");c={};var n,r=[];k||(h?r=a.a.Mb(e(),a.u.L):0<=b.selectedIndex&&r.push(a.u.L(b.options[b.selectedIndex])));l&&("undefined"==typeof l.length&&(l=[l]),n=a.a.fb(l,function(b){return q||b===p||null===b||!a.a.c(b._destroy)}),d.has("optionsCaption")&&(l=a.a.c(d.get("optionsCaption")),null!==l&&l!==p&&n.unshift(Q)));var y=!1;c.beforeRemove=function(a){b.removeChild(a)};l=g;d.has("optionsAfterRender")&&"function"==typeof d.get("optionsAfterRender")&&(l=function(b,c){g(0,c); 178a.v.K(d.get("optionsAfterRender"),null,[c[0],b!==Q?b:p])});a.a.cc(b,n,function(c,e,g){g.length&&(r=!k&&g[0].selected?[a.u.L(g[0])]:[],y=!0);e=b.ownerDocument.createElement("option");c===Q?(a.a.Ab(e,d.get("optionsCaption")),a.u.ya(e,p)):(g=f(c,d.get("optionsValue"),c),a.u.ya(e,a.a.c(g)),c=f(c,d.get("optionsText"),g),a.a.Ab(e,c));return[e]},c,l);a.v.K(function(){if(k)a.u.ya(b,a.a.c(d.get("value")),!0);else{var c;h?c=r.length&&e().length<r.length:c=r.length&&0<=b.selectedIndex?a.u.L(b.options[b.selectedIndex])!== 179r[0]:r.length||0<=b.selectedIndex;c&&a.a.Fb(b,"change")}});a.a.vd(b);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.f.options.Yb=a.a.g.Z();a.f.selectedOptions={after:["options","foreach"],init:function(b,c,d){a.a.H(b,"change",function(){var e=c(),f=[];a.a.C(b.getElementsByTagName("option"),function(b){b.selected&&f.push(a.u.L(b))});a.m.$a(e,d,"selectedOptions",f)})},update:function(b,c){if("select"!=a.a.P(b))throw Error("values binding applies only to SELECT elements");var d=a.a.c(c()),e=b.scrollTop; 180d&&"number"==typeof d.length&&a.a.C(b.getElementsByTagName("option"),function(b){var c=0<=a.a.A(d,a.u.L(b));b.selected!=c&&a.a.Yc(b,c)});b.scrollTop=e}};a.m.va.selectedOptions=!0;a.f.style={update:function(b,c){var d=a.a.c(c()||{});a.a.O(d,function(c,d){d=a.a.c(d);if(null===d||d===p||!1===d)d="";if(v)v(b).css(c,d);else if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]= 181d+"px")}})}};a.f.submit={init:function(b,c,d,e,f){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");a.a.H(b,"submit",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.f.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ab(b,c())}};a.h.ea.text=!0;(function(){if(z&&z.navigator){var b=function(a){if(a)return parseFloat(a[1])},c=z.navigator.userAgent, 182d,e,f,g,h;(d=z.opera&&z.opera.version&&parseInt(z.opera.version()))||(h=b(c.match(/Edge\/([^ ]+)$/)))||b(c.match(/Chrome\/([^ ]+)/))||(e=b(c.match(/Version\/([^ ]+) Safari/)))||(f=b(c.match(/Firefox\/([^ ]+)/)))||(g=a.a.W||b(c.match(/MSIE ([^ ]+)/)))||(g=b(c.match(/rv:([^ )]+)/)))}if(8<=g&&10>g)var m=a.a.g.Z(),l=a.a.g.Z(),k=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,l))&&c(b)},q=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.H(d,"selectionchange",k));a.a.g.set(b, 183l,c)};a.f.textInput={init:function(b,c,l){function k(c,d){a.a.H(b,c,d)}function m(){var d=a.a.c(c());if(null===d||d===p)d="";L!==p&&d===L?a.a.setTimeout(m,4):b.value!==d&&(x=!0,b.value=d,x=!1,v=b.value)}function t(){w||(L=b.value,w=a.a.setTimeout(B,4))}function B(){clearTimeout(w);L=w=p;var d=b.value;v!==d&&(v=d,a.m.$a(c(),l,"textInput",d))}var v=b.value,w,L,z=9==a.a.W?t:B,x=!1;g&&k("keypress",B);11>g&&k("propertychange",function(a){x||"value"!==a.propertyName||z(a)});8==g&&(k("keyup",B),k("keydown", 184B));q&&(q(b,z),k("dragend",t));(!g||9<=g)&&k("input",z);5>e&&"textarea"===a.a.P(b)?(k("keydown",t),k("paste",t),k("cut",t)):11>d?k("keydown",t):4>f?(k("DOMAutoComplete",B),k("dragdrop",B),k("drop",B)):h&&"number"===b.type&&k("keydown",t);k("change",B);k("blur",B);a.o(m,null,{l:b})}};a.m.va.textInput=!0;a.f.textinput={preprocess:function(a,b,c){c("textInput",a)}}})();a.f.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.f.uniqueName.qd;a.a.Xc(b,d)}}};a.f.uniqueName.qd=0;a.f.using={init:function(b, 185c,d,e,f){var g;d.has("as")&&(g={as:d.get("as"),noChildContext:d.get("noChildContext")});c=f.createChildContext(c,g);a.Pa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.f.value={after:["options","foreach"],init:function(b,c,d){var e=a.a.P(b),f="input"==e;if(!f||"checkbox"!=b.type&&"radio"!=b.type){var g=["change"],h=d.get("valueUpdate"),m=!1,l=null;h&&("string"==typeof h&&(h=[h]),a.a.gb(g,h),g=a.a.vc(g));var k=function(){l=null;m=!1;var e=c(),f=a.u.L(b);a.m.$a(e,d,"value",f)};!a.a.W|| 186!f||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.A(g,"propertychange")||(a.a.H(b,"propertychange",function(){m=!0}),a.a.H(b,"focus",function(){m=!1}),a.a.H(b,"blur",function(){m&&k()}));a.a.C(g,function(c){var d=k;a.a.Td(c,"after")&&(d=function(){l=a.u.L(b);a.a.setTimeout(k,0)},c=c.substring(5));a.a.H(b,c,d)});var q;q=f&&"file"==b.type?function(){var d=a.a.c(c());null===d||d===p||""===d?b.value="":a.v.K(k)}:function(){var f=a.a.c(c()),g=a.u.L(b);if(null!==l&& 187f===l)a.a.setTimeout(q,0);else if(f!==g||g===p)"select"===e?(g=d.get("valueAllowUnset"),a.u.ya(b,f,g),g||f===a.u.L(b)||a.v.K(k)):a.u.ya(b,f)};a.o(q,null,{l:b})}else a.eb(b,{checkedValue:c})},update:function(){}};a.m.va.value=!0;a.f.visible={update:function(b,c){var d=a.a.c(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};a.f.hidden={update:function(b,c){a.f.visible.update(b,function(){return!a.a.c(c())})}};(function(b){a.f[b]={init:function(c,d,e,f,g){return a.f.event.init.call(this, 188c,function(){var a={};a[b]=d();return a},e,f,g)}}})("click");a.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.ca.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.B.D(d)}if(1==b.nodeType||8==b.nodeType)return new a.B.ia(b); 189throw Error("Unknown template type: "+b);};a.ca.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.ca);a.ic=function(){function b(b,c,d,h){b=a.m.Zb(b); 190for(var m=a.m.Ra,l=0;l<b.length;l++){var k=b[l].key;if(Object.prototype.hasOwnProperty.call(m,k)){var q=m[k];if("function"===typeof q){if(k=q(b[l].value))throw Error(k);}else if(!q)throw Error("This template engine does not support the '"+k+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.m.ub(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi, 191d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{wd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.ic.Kd(b,c)},d)},Kd:function(a,f){return a.replace(c,function(a,c,d,e,k){return b(k,c,d,f)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",f)})},ld:function(b,c){return a.aa.Wb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.eb(m,b,h)})}}}();a.b("__tr_ambtns",a.ic.ld);(function(){a.B={};a.B.D=function(b){if(this.D=b){var c= 192a.a.P(b);this.Db="script"===c?1:"textarea"===c?2:"template"==c&&b.content&&11===b.content.nodeType?3:4}};a.B.D.prototype.text=function(){var b=1===this.Db?"text":2===this.Db?"value":"innerHTML";if(0==arguments.length)return this.D[b];var c=arguments[0];"innerHTML"===b?a.a.dc(this.D,c):this.D[b]=c};var b=a.a.g.Z()+"_";a.B.D.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.D,b+c);a.a.g.set(this.D,b+c,arguments[1])};var c=a.a.g.Z();a.B.D.prototype.nodes=function(){var b=this.D; 193if(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.jb||(3===this.Db?b.content:4===this.Db?b:p);if(!f||e.hd)if(e=this.text())f=a.a.Ld(e,b.ownerDocument),this.text(""),a.a.g.set(b,c,{jb:f,hd:!0});return f}a.a.g.set(b,c,{jb:arguments[0]})};a.B.ia=function(a){this.D=a};a.B.ia.prototype=new a.B.D;a.B.ia.prototype.constructor=a.B.ia;a.B.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.D,c)||{};b.jc===p&&b.jb&&(b.jc=b.jb.innerHTML);return b.jc}a.a.g.set(this.D,c,{jc:arguments[0]})}; 194a.b("templateSources",a.B);a.b("templateSources.domElement",a.B.D);a.b("templateSources.anonymousTemplate",a.B.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):(c.push(e,f),a.a.Ua(c, 195g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.uc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.bd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,m){m=m||{};var p=(b&&d(b)||f||{}).ownerDocument,A=m.templateEngine||g;a.ic.wd(f,A,p);f=A.renderTemplate(f,h,m,p);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");p=!1;switch(e){case "replaceChildren":a.h.ua(b, 196f);p=!0;break;case "replaceNode":a.a.Wc(b,f);p=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}p&&(c(f,h),m.afterRender&&a.v.K(m.afterRender,null,[f,h[m.as||"$data"]]),"replaceChildren"==e&&a.j.Ga(b,a.j.T));return f}function f(b,c,d){return a.N(b)?b():"function"===typeof b?b(c,d):b}var g;a.ec=function(b){if(b!=p&&!(b instanceof a.ca))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.bc=function(b,c,h,m,r){h=h||{};if((h.templateEngine||g)== 197p)throw Error("Set a template engine before calling renderTemplate");r=r||"replaceChildren";if(m){var y=d(m);return a.$(function(){var g=c&&c instanceof a.fa?c:new a.fa(c,null,null,null,{exportDependencies:!0}),p=f(b,g.$data,g),g=e(m,r,p,g,h);"replaceNode"==r&&(m=g,y=d(m))},null,{Sa:function(){return!y||!a.a.Rb(y)},l:y&&"replaceNode"==r?y.parentNode:y})}return a.aa.Wb(function(d){a.bc(b,c,h,d,"replaceNode")})};a.Pd=function(b,d,g,h,m){function y(b,c){a.v.K(a.a.cc,null,[h,b,u,g,t,c]);a.j.Ga(h,a.j.T)} 198function t(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}function u(a,c){v=m.createChildContext(a,{as:B,noChildContext:g.noChildContext,extend:function(a){a.$index=c;B&&(a[B+"Index"]=c)}});var d=f(b,a,v);return e(h,"ignoreTargetNode",d,v,g)}var v,B=g.as,w=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(w||g.beforeRemove||!a.Oc(d))return a.$(function(){var b=a.a.c(d)||[];"undefined"==typeof b.length&&(b=[b]);w&&(b=a.a.fb(b,function(b){return b===p||null===b|| 199!a.a.c(b._destroy)}));y(b)},null,{l:h});y(d.w());var z=d.subscribe(function(a){y(d(),a)},null,"arrayChange");z.l(h);return z};var h=a.a.g.Z(),m=a.a.g.Z();a.f.template={init:function(b,c){var d=a.a.c(c());if("string"==typeof d||d.name)a.h.Ea(b);else if("nodes"in d){d=d.nodes||[];if(a.N(d))throw Error('The "nodes" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.g.get(e,m)||(e=a.a.Xb(d),a.a.g.set(e,m,!0));(new a.B.ia(b)).nodes(e)}else if(d=a.h.childNodes(b),0<d.length)e= 200a.a.Xb(d),(new a.B.ia(b)).nodes(e);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.c(g);d=!0;e=null;"string"==typeof c?c={}:(g=c.name,"if"in c&&(d=a.a.c(c["if"])),d&&"ifnot"in c&&(d=!a.a.c(c.ifnot)));"foreach"in c?e=a.Pd(g||b,d&&c.foreach||[],c,b,f):d?(d=f,"data"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),e=a.bc(g||b,d,c, 201b)):a.h.Ea(b);f=e;(c=a.a.g.get(b,h))&&"function"==typeof c.s&&c.s();a.a.g.set(b,h,!f||f.ja&&!f.ja()?p:f)}};a.m.Ra.template=function(b){b=a.m.Zb(b);return 1==b.length&&b[0].unknown||a.m.Hd(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.h.ea.template=!0})();a.b("setTemplateEngine",a.ec);a.b("renderTemplate",a.bc);a.a.Jc=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===m.value){h.moved= 202m.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Ob=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,l=[],k,p=b.length,n,r=d.length,t=r-p||1,A=p+r+1,u,v,w;for(k=0;k<=p;k++)for(v=u,l.push(u=[]),w=h(r,k+t),n=m(0,k-1);n<=w;n++)u[n]=n?k?b[k-1]===d[n-1]?v[n-1]:h(v[n]||A,u[n-1]||A)+1:n+1:k+1;h=[];m=[];t=[];k=p;for(n=r;k||n;)r=l[k][n]-1,n&&r===l[k][n-1]?m.push(h[h.length]={status:e,value:d[--n],index:n}):k&&r===l[k-1][n]?t.push(h[h.length]={status:f,value:b[--k],index:k}):(--n,--k, 203g.sparse||h.push({status:"retained",value:d[n]}));a.a.Jc(t,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,"added","deleted",e):b(d,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.Ob);(function(){function b(b,c,d,h,m){var l=[],k=a.$(function(){var k=c(d,m,a.a.Ua(l,b))||[];0<l.length&&(a.a.Wc(l,k),h&&a.v.K(h,null,[d,k,m]));l.length=0;a.a.gb(l,k)},null,{l:b,Sa:function(){return!a.a.jd(l)}}); 204return{Y:l,$:k.ja()?k:p}}var c=a.a.g.Z(),d=a.a.g.Z();a.a.cc=function(e,f,g,h,m,l){function k(b){x={Aa:b,nb:a.sa(w++)};v.push(x);t||F.push(x)}function q(b){x=r[b];w!==x.nb.w()&&D.push(x);x.nb(w++);a.a.Ua(x.Y,e);v.push(x)}function n(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.C(c[d].Y,function(a){b(a,d,c[d].Aa)})}f=f||[];"undefined"==typeof f.length&&(f=[f]);h=h||{};var r=a.a.g.get(e,c),t=!r,v=[],u=0,w=0,B=[],z=[],C=[],D=[],F=[],x,I=0;if(t)a.a.C(f,k);else{if(!l||r&&r._countWaitingForRemove){var E= 205a.a.Mb(r,function(a){return a.Aa});l=a.a.Ob(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,G,H,K;G=l[E];E++)switch(H=G.moved,K=G.index,G.status){case "deleted":for(;u<K;)q(u++);H===p&&(x=r[u],x.$&&(x.$.s(),x.$=p),a.a.Ua(x.Y,e).length&&(h.beforeRemove&&(v.push(x),I++,x.Aa===d?x=null:C.push(x)),x&&B.push.apply(B,x.Y)));u++;break;case "added":for(;w<K;)q(u++);H!==p?(z.push(v.length),q(H)):k(G.value)}for(;w<f.length;)q(u++);v._countWaitingForRemove=I}a.a.g.set(e,c,v);
205n(h.beforeMove,D);a.a.C(B, 206h.beforeRemove?a.na:a.removeNode);var M,O,P;try{P=e.ownerDocument.activeElement}catch(N){}if(z.length)for(;(E=z.shift())!=p;){x=v[E];for(M=p;E;)if((O=v[--E].Y)&&O.length){M=O[O.length-1];break}for(f=0;u=x.Y[f];M=u,f++)a.h.Vb(e,u,M)}E=0;for(z=a.h.firstChild(e);x=v[E];E++){x.Y||a.a.extend(x,b(e,g,x.Aa,m,x.nb));for(f=0;u=x.Y[f];z=u.nextSibling,M=u,f++)u!==z&&a.h.Vb(e,u,M);!x.Dd&&m&&(m(x.Aa,x.Y,x.nb),x.Dd=!0,M=x.Y[x.Y.length-1])}P&&e.ownerDocument.activeElement!=P&&P.focus();n(h.beforeRemove,C);for(E= 2070;E<C.length;++E)C[E].Aa=d;n(h.afterMove,D);n(h.afterAdd,F)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.cc);a.ba=function(){this.allowTemplateRewriting=!1};a.ba.prototype=new a.ca;a.ba.prototype.constructor=a.ba;a.ba.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ta(b,e)};a.ba.Na=new a.ba;a.ec(a.ba.Na);a.b("nativeTemplateEngine",a.ba);(function(){a.Za=function(){var a=this.Gd=function(){if(!v|| 208!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=v.template(null,"{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement("div")); 209v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){w.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(v.tmpl.tag.ko_code={open:"__.push($1 || '');"},v.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.Za.prototype=new a.ca;a.Za.prototype.constructor=a.Za;var b=new a.Za;0<b.Gd&&a.ec(b);a.b("jqueryTmplTemplateEngine",a.Za)})()})})();})(); 210/*! 211 * Masonry PACKAGED v4.2.2 [modified] 212 * Cascading grid layout library 213 * https://masonry.desandro.com 214 * MIT License 215 * by David DeSandro 216 */ 217if (typeof jQuery.fn.masonry == 'undefined'){ 218!function(t, e){"function" == typeof define && define.amd?define("jquery-bridget/jquery-bridget", ["jquery"], function(i){return e(t, i)}):"object" == typeof module && module.exports?module.exports = e(t, require("jquery")):t.jQueryBridget = e(t, t.jQuery)}(window, function(t, e){"use strict"; function i(i, r, a){function h(t, e, n){var o, r = "$()." + i + '("' + e + '")'; return t.each(function(t, h){var u = a.data(h, i); if (!u)return void s(i + " not initialized. Cannot call methods, i.e. " + r); var d = u[e]; if (!d || "_" == e.charAt(0))return void s(r + " is not a valid method"); var l = d.apply(u, n); o = void 0 === o?l:o}), void 0 !== o?o:t}function u(t, e){t.each(function(t, n){var o = a.data(n, i); o?(o.option(e), o._init()):(o = new r(n, e), a.data(n, i, o))})}a = a || e || t.jQuery, a && (r.prototype.option || (r.prototype.option = function(t){a.isPlainObject(t) && (this.options = a.extend(!0, this.options, t))}), a.fn[i] = function(t){if ("string" == typeof t){var e = o.call(arguments, 1); return h(this, t, e)}return u(this, t), this}, n(a))}function n(t){!t || t && t.bridget || (t.bridget = i)}var o = Array.prototype.slice, r = t.console, s = "undefined" == typeof r?function(){}:function(t){r.error(t)}; return n(e || t.jQuery), i}), function(t, e){"function" == typeof define && define.amd?define("ev-emitter/ev-emitter", e):"object" == typeof module && module.exports?module.exports = e():t.EvEmitter = e()}("undefined" != typeof window?window:this, function(){function t(){}var e = t.prototype; return e.on = function(t, e){if (t && e){var i = this._events = this._events || {}, n = i[t] = i[t] || []; return - 1 == n.indexOf(e) && n.push(e), this}}, e.once = function(t, e){if (t && e){this.on(t, e); var i = this._onceEvents = this._onceEvents || {}, n = i[t] = i[t] || {}; return n[e] = !0, this}}, e.off = function(t, e){var i = this._events && this._events[t]; if (i && i.length){var n = i.indexOf(e); return - 1 != n && i.splice(n, 1), this}}, e.emitEvent = function(t, e){var i = this._events && this._events[t]; if (i && i.length){i = i.slice(0), e = e || []; for (var n = this._onceEvents && this._onceEvents[t], o = 0; o < i.length; o++){var r = i[o], s = n && n[r]; s && (this.off(t, r), delete n[r]), r.apply(this, e)}return this}}, e.allOff = function(){delete this._events, delete this._onceEvents}, t}), function(t, e){"function" == typeof define && define.amd?define("get-size/get-size", e):"object" == typeof module && module.exports?module.exports = e():t.msnGetSize = e()}(window, function(){"use strict"; function t(t){var e = parseFloat(t), i = - 1 == t.indexOf("%") && !isNaN(e); return i && e}function e(){}function i(){for (var t = {width:0, height:0, innerWidth:0, innerHeight:0, outerWidth:0, outerHeight:0}, e = 0; u > e;
vendor: 23,183 bytes, line 218
218 e++){var i = h[e]; t[i] = 0}return t}function n(t){var e = getComputedStyle(t); return e || a("Style returned " + e + ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"), e}function o(){if (!d){d = !0; var e = document.createElement("div"); e.style.width = "200px", e.style.padding = "1px 2px 3px 4px", e.style.borderStyle = "solid", e.style.borderWidth = "1px 2px 3px 4px", e.style.boxSizing = "border-box"; var i = document.body || document.documentElement; i.appendChild(e); var o = n(e); s = 200 == Math.round(t(o.width)), r.isBoxSizeOuter = s, i.removeChild(e)}}function r(e){if (o(), "string" == typeof e && (e = document.querySelector(e)), e && "object" == typeof e && e.nodeType){var r = n(e); if ("none" == r.display)return i(); var a = {}; a.width = e.offsetWidth, a.height = e.offsetHeight; for (var d = a.isBorderBox = "border-box" == r.boxSizing, l = 0; u > l; l++){var c = h[l], f = r[c], m = parseFloat(f); a[c] = isNaN(m)?0:m}var p = a.paddingLeft + a.paddingRight, g = a.paddingTop + a.paddingBottom, y = a.marginLeft + a.marginRight, v = a.marginTop + a.marginBottom, _ = a.borderLeftWidth + a.borderRightWidth, z = a.borderTopWidth + a.borderBottomWidth, E = d && s, b = t(r.width); b !== !1 && (a.width = b + (E?0:p + _)); var x = t(r.height); return x !== !1 && (a.height = x + (E?0:g + z)), a.innerWidth = a.width - (p + _), a.innerHeight = a.height - (g + z), a.outerWidth = a.width + y, a.outerHeight = a.height + v, a}}var s, a = "undefined" == typeof console?e:function(t){console.error(t)}, h = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"], u = h.length, d = !1; return r}), function(t, e){"use strict"; "function" == typeof define && define.amd?define("desandro-matches-selector/matches-selector", e):"object" == typeof module && module.exports?module.exports = e():t.matchesSelector = e()}(window, function(){"use strict"; var t = function(){var t = window.Element.prototype; if (t.matches)return"matches"; if (t.matchesSelector)return"matchesSelector"; for (var e = ["webkit", "moz", "ms", "o"], i = 0; i < e.length; i++){var n = e[i], o = n + "MatchesSelector"; if (t[o])return o}}(); return function(e, i){return e[t](i)}}), function(t, e){"function" == typeof define && define.amd?define("fizzy-ui-utils/utils", ["desandro-matches-selector/matches-selector"], function(i){return e(t, i)}):"object" == typeof module && module.exports?module.exports = e(t, require("desandro-matches-selector")):t.fizzyUIUtils = e(t, t.matchesSelector)}(window, function(t, e){var i = {}; i.extend = function(t, e){for (var i in e)t[i] = e[i]; return t}, i.modulo = function(t, e){return(t % e + e) % e}; var n = Array.prototype.slice; i.makeArray = function(t){if (Array.isArray(t))return t; if (null === t || void 0 === t)return[]; var e = "object" == typeof t && "number" == typeof t.length; return e?n.call(t):[t]}, i.removeFrom = function(t, e){var i = t.indexOf(e); - 1 != i && t.splice(i, 1)}, i.getParent = function(t, i){for (; t.parentNode && t != document.body; )if (t = t.parentNode, e(t, i))return t}, i.getQueryElement = function(t){return"string" == typeof t?document.querySelector(t):t}, i.handleEvent = function(t){var e = "on" + t.type; this[e] && this[e](t)}, i.filterFindElements = function(t, n){t = i.makeArray(t); var o = []; return t.forEach(function(t){if (t instanceof HTMLElement){if (!n)return void o.push(t); e(t, n) && o.push(t); for (var i = t.querySelectorAll(n), r = 0; r < i.length; r++)o.push(i[r])}}), o}, i.debounceMethod = function(t, e, i){i = i || 100; var n = t.prototype[e], o = e + "Timeout"; t.prototype[e] = function(){var t = this[o]; clearTimeout(t); var e = arguments, r = this; this[o] = setTimeout(function(){n.apply(r, e), delete r[o]}, i)}}, i.docReady = function(t){var e = document.readyState; "complete" == e || "interactive" == e?setTimeout(t):document.addEventListener("DOMContentLoaded", t)}, i.toDashed = function(t){return t.replace(/(.)([A-Z])/g, function(t, e, i){return e + "-" + i}).toLowerCase()}; var o = t.console; return i.htmlInit = function(e, n){i.docReady(function(){var r = i.toDashed(n), s = "data-" + r, a = document.querySelectorAll("[" + s + "]"), h = document.querySelectorAll(".js-" + r), u = i.makeArray(a).concat(i.makeArray(h)), d = s + "-options", l = t.jQuery; u.forEach(function(t){var i, r = t.getAttribute(s) || t.getAttribute(d); try{i = r && JSON.parse(r)} catch (a){return void(o && o.error("Error parsing " + s + " on " + t.className + ": " + a))}var h = new e(t, i); l && l.data(t, n, h)})})}, i}), function(t, e){"function" == typeof define && define.amd?define("outlayer/item", ["ev-emitter/ev-emitter", "get-size/get-size"], e):"object" == typeof module && module.exports?module.exports = e(require("ev-emitter"), require("get-size")):(t.Outlayer = {}, t.Outlayer.Item = e(t.EvEmitter, t.msnGetSize))}(window, function(t, e){"use strict"; function i(t){for (var e in t)return!1; return e = null, !0}function n(t, e){t && (this.element = t, this.layout = e, this.position = {x:0, y:0}, this._create())}function o(t){return t.replace(/([A-Z])/g, function(t){return"-" + t.toLowerCase()})}var r = document.documentElement.style, s = "string" == typeof r.transition?"transition":"WebkitTransition", a = "string" == typeof r.transform?"transform":"WebkitTransform", h = {WebkitTransition:"webkitTransitionEnd", transition:"transitionend"}[s], u = {transform:a, transition:s, transitionDuration:s + "Duration", transitionProperty:s + "Property", transitionDelay:s + "Delay"}, d = n.prototype = Object.create(t.prototype); d.constructor = n, d._create = function(){this._transn = {ingProperties:{}, clean:{}, onEnd:{}}, this.css({position:"absolute"})}, d.handleEvent = function(t){var e = "on" + t.type; this[e] && this[e](t)}, d.msnGetSize = function(){this.size = e(this.element)}, d.css = function(t){var e = this.element.style; for (var i in t){var n = u[i] || i; e[n] = t[i]}}, d.getPosition = function(){var t = getComputedStyle(this.element), e = this.layout._getOption("originLeft"), i = this.layout._getOption("originTop"), n = t[e?"left":"right"], o = t[i?"top":"bottom"], r = parseFloat(n), s = parseFloat(o), a = this.layout.size; - 1 != n.indexOf("%") && (r = r / 100 * a.width), - 1 != o.indexOf("%") && (s = s / 100 * a.height), r = isNaN(r)?0:r, s = isNaN(s)?0:s, r -= e?a.paddingLeft:a.paddingRight, s -= i?a.paddingTop:a.paddingBottom, this.position.x = r, this.position.y = s}, d.layoutPosition = function(){var t = this.layout.size, e = {}, i = this.layout._getOption("originLeft"), n = this.layout._getOption("originTop"), o = i?"paddingLeft":"paddingRight", r = i?"left":"right", s = i?"right":"left", a = this.position.x + t[o]; e[r] = this.getXValue(a), e[s] = ""; var h = n?"paddingTop":"paddingBottom", u = n?"top":"bottom", d = n?"bottom":"top", l = this.position.y + t[h]; e[u] = this.getYValue(l), e[d] = "", this.css(e), this.emitEvent("layout", [this])}, d.getXValue = function(t){var e = this.layout._getOption("horizontal"); return this.layout.options.percentPosition && !e?t / this.layout.size.width * 100 + "%":t + "px"}, d.getYValue = function(t){var e = this.layout._getOption("horizontal"); return this.layout.options.percentPosition && e?t / this.layout.size.height * 100 + "%":t + "px"}, d._transitionTo = function(t, e){this.getPosition(); var i = this.position.x, n = this.position.y, o = t == this.position.x && e == this.position.y; if (this.setPosition(t, e), o && !this.isTransitioning)return void this.layoutPosition(); var r = t - i, s = e - n, a = {}; a.transform = this.getTranslate(r, s), this.transition({to:a, onTransitionEnd:{transform:this.layoutPosition}, isCleaning:!0})}, d.getTranslate = function(t, e){var i = this.layout._getOption("originLeft"), n = this.layout._getOption("originTop"); return t = i?t: - t, e = n?e: - e, "translate3d(" + t + "px, " + e + "px, 0)"}, d.goTo = function(t, e){this.setPosition(t, e), this.layoutPosition()}, d.moveTo = d._transitionTo, d.setPosition = function(t, e){this.position.x = parseFloat(t), this.position.y = parseFloat(e)}, d._nonTransition = function(t){this.css(t.to), t.isCleaning && this._removeStyles(t.to); for (var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)}, d.transition = function(t){if (!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t); var e = this._transn; for (var i in t.onTransitionEnd)e.onEnd[i] = t.onTransitionEnd[i]; for (i in t.to)e.ingProperties[i] = !0, t.isCleaning && (e.clean[i] = !0); if (t.from){this.css(t.from); var n = this.element.offsetHeight; n = null}this.enableTransition(t.to), this.css(t.to), this.isTransitioning = !0}; var l = "opacity," + o(a); d.enableTransition = function(){if (!this.isTransitioning){var t = this.layout.options.transitionDuration; t = "number" == typeof t?t + "ms":t, this.css({transitionProperty:l, transitionDuration:t, transitionDelay:this.staggerDelay || 0}), this.element.addEventListener(h, this, !1)}}, d.onwebkitTransitionEnd = function(t){this.ontransitionend(t)}, d.onotransitionend = function(t){this.ontransitionend(t)}; var c = {"-webkit-transform":"transform"}; d.ontransitionend = function(t){if (t.target === this.element){var e = this._transn, n = c[t.propertyName] || t.propertyName; if (delete e.ingProperties[n], i(e.ingProperties) && this.disableTransition(), n in e.clean && (this.element.style[t.propertyName] = "", delete e.clean[n]), n in e.onEnd){var o = e.onEnd[n]; o.call(this), delete e.onEnd[n]}this.emitEvent("transitionEnd", [this])}}, d.disableTransition = function(){this.removeTransitionStyles(), this.element.removeEventListener(h, this, !1), this.isTransitioning = !1}, d._removeStyles = function(t){var e = {}; for (var i in t)e[i] = ""; this.css(e)}; var f = {transitionProperty:"", transitionDuration:"", transitionDelay:""}; return d.removeTransitionStyles = function(){this.css(f)}, d.stagger = function(t){t = isNaN(t)?0:t, this.staggerDelay = t + "ms"}, d.removeElem = function(){this.element.parentNode.removeChild(this.element), this.css({display:""}), this.emitEvent("remove", [this])}, d.remove = function(){return s && parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd", function(){this.removeElem()}), void this.hide()):void this.removeElem()}, d.reveal = function(){delete this.isHidden, this.css({display:""}); var t = this.layout.options, e = {}, i = this.getHideRevealTransitionEndProperty("visibleStyle"); e[i] = this.onRevealTransitionEnd, this.transition({from:t.hiddenStyle, to:t.visibleStyle, isCleaning:!0, onTransitionEnd:e})}, d.onRevealTransitionEnd = function(){this.isHidden || this.emitEvent("reveal")}, d.getHideRevealTransitionEndProperty = function(t){var e = this.layout.options[t]; if (e.opacity)return"opacity"; for (var i in e)return i}, d.hide = function(){this.isHidden = !0, this.css({display:""}); var t = this.layout.options, e = {}, i = this.getHideRevealTransitionEndProperty("hiddenStyle"); e[i] = this.onHideTransitionEnd, this.transition({from:t.visibleStyle, to:t.hiddenStyle, isCleaning:!0, onTransitionEnd:e})}, d.onHideTransitionEnd = function(){this.isHidden && (this.css({display:"none"}), this.emitEvent("hide"))}, d.destroy = function(){this.css({position:"", left:"", right:"", top:"", bottom:"", transition:"", transform:""})}, n}), function(t, e){"use strict"; "function" == typeof define && define.amd?define("outlayer/outlayer", ["ev-emitter/ev-emitter", "get-size/get-size", "fizzy-ui-utils/utils", "./item"], function(i, n, o, r){return e(t, i, n, o, r)}):"object" == typeof module && module.exports?module.exports = e(t, require("ev-emitter"), require("get-size"), require("fizzy-ui-utils"), require("./item")):t.Outlayer = e(t, t.EvEmitter, t.msnGetSize, t.fizzyUIUtils, t.Outlayer.Item)}(window, function(t, e, i, n, o){"use strict"; function r(t, e){var i = n.getQueryElement(t); if (!i)return void(h && h.error("Bad element for " + this.constructor.namespace + ": " + (i || t))); this.element = i, u && (this.$element = u(this.element)), this.options = n.extend({}, this.constructor.defaults), this.option(e); var o = ++l; this.element.outlayerGUID = o, c[o] = this, this._create(); var r = this._getOption("initLayout"); r && this.layout()}function s(t){function e(){t.apply(this, arguments)}return e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e}function a(t){if ("number" == typeof t)return t; var e = t.match(/(^\d*\.?\d*)(\w*)/), i = e && e[1], n = e && e[2]; if (!i.length)return 0; i = parseFloat(i); var o = m[n] || 1; return i * o}var h = t.console, u = t.jQuery, d = function(){}, l = 0, c = {}; r.namespace = "outlayer", r.Item = o, r.defaults = {containerStyle:{position:"relative"}, initLayout:!0, originLeft:!0, originTop:!0, resize:!0, resizeContainer:!0, transitionDuration:"0.4s", hiddenStyle:{opacity:0, transform:"scale(0.001)"}, visibleStyle:{opacity:1, transform:"scale(1)"}}; var f = r.prototype; n.extend(f, e.prototype), f.option = function(t){n.extend(this.options, t)}, f._getOption = function(t){var e = this.constructor.compatOptions[t]; return e && void 0 !== this.options[e]?this.options[e]:this.options[t]}, r.compatOptions = {initLayout:"isInitLayout", horizontal:"isHorizontal", layoutInstant:"isLayoutInstant", originLeft:"isOriginLeft", originTop:"isOriginTop", resize:"isResizeBound", resizeContainer:"isResizingContainer"}, f._create = function(){this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), n.extend(this.element.style, this.options.containerStyle); var t = this._getOption("resize"); t && this.bindResize()}, f.reloadItems = function(){this.items = this._itemize(this.element.children)}, f._itemize = function(t){for (var e = this._filterFindItemElements(t), i = this.constructor.Item, n = [], o = 0; o < e.length; o++){var r = e[o], s = new i(r, this); n.push(s)}return n}, f._filterFindItemElements = function(t){return n.filterFindElements(t, this.options.itemSelector)}, f.getItemElements = function(){return this.items.map(function(t){return t.element})}, f.layout = function(){this._resetLayout(), this._manageStamps(); var t = this._getOption("layoutInstant"), e = void 0 !== t?t:!this._isLayoutInited; this.layoutItems(this.items, e), this._isLayoutInited = !0}, f._init = f.layout, f._resetLayout = function(){this.msnGetSize()}, f.msnGetSize = function(){this.size = i(this.element)}, f._getMeasurement = function(t, e){var n, o = this.options[t]; o?("string" == typeof o?n = this.element.querySelector(o):o instanceof HTMLElement && (n = o), this[t] = n?i(n)[e]:o):this[t] = 0}, f.layoutItems = function(t, e){t = this._getItemsForLayout(t), this._layoutItems(t, e), this._postLayout()}, f._getItemsForLayout = function(t){return t.filter(function(t){return!t.isIgnored})}, f._layoutItems = function(t, e){if (this._emitCompleteOnItems("layout", t), t && t.length){var i = []; t.forEach(function(t){var n = this._getItemLayoutPosition(t); n.item = t, n.isInstant = e || t.isLayoutInstant, i.push(n)}, this), this._processLayoutQueue(i)}}, f._getItemLayoutPosition = function(){return{x:0, y:0}}, f._processLayoutQueue = function(t){this.updateStagger(), t.forEach(function(t, e){this._positionItem(t.item, t.x, t.y, t.isInstant, e)}, this)}, f.updateStagger = function(){var t = this.options.stagger; return null === t || void 0 === t?void(this.stagger = 0):(this.stagger = a(t), this.stagger)}, f._positionItem = function(t, e, i, n, o){n?t.goTo(e, i):(t.stagger(o * this.stagger), t.moveTo(e, i))}, f._postLayout = function(){this.resizeContainer()}, f.resizeContainer = function(){var t = this._getOption("resizeContainer"); if (t){var e = this._getContainerSize(); e && (this._setContainerMeasure(e.width, !0), this._setContainerMeasure(e.height, !1))}}, f._getContainerSize = d, f._setContainerMeasure = function(t, e){if (void 0 !== t){var i = this.size; i.isBorderBox && (t += e?i.paddingLeft + i.paddingRight + i.borderLeftWidth + i.borderRightWidth:i.paddingBottom + i.paddingTop + i.borderTopWidth + i.borderBottomWidth), t = Math.max(t, 0), this.element.style[e?"width":"height"] = t + "px"}}, f._emitCompleteOnItems = function(t, e){function i(){o.dispatchEvent(t + "Complete", null, [e])}function n(){s++, s == r && i()}var o = this, r = e.length; if (!e || !r)return void i(); var s = 0; e.forEach(function(e){e.once(t, n)})}, f.dispatchEvent = function(t, e, i){var n = e?[e].concat(i):i; if (this.emitEvent(t, n), u)if (this.$element = this.$element || u(this.element), e){var o = u.Event(e); o.type = t, this.$element.trigger(o, i)} else this.$element.trigger(t, i)}, f.ignore = function(t){var e = this.getItem(t); e && (e.isIgnored = !0)}, f.unignore = function(t){var e = this.getItem(t); e && delete e.isIgnored}, f.stamp = function(t){t = this._find(t), t && (this.stamps = this.stamps.concat(t), t.forEach(this.ignore, this))}, f.unstamp = function(t){t = this._find(t), t && t.forEach(function(t){n.removeFrom(this.stamps, t), this.unignore(t)}, this)}, f._find = function(t){return t?("string" == typeof t && (t = this.element.querySelectorAll(t)), t = n.makeArray(t)):void 0}, f._manageStamps = function(){this.stamps && this.stamps.length && (this._getBoundingRect(), this.stamps.forEach(this._manageStamp, this))}, f._getBoundingRect = function(){var t = this.element.getBoundingClientRect(), e = this.size; this._boundingRect = {left:t.left + e.paddingLeft + e.borderLeftWidth, top:t.top + e.paddingTop + e.borderTopWidth, right:t.right - (e.paddingRight + e.borderRightWidth), bottom:t.bottom - (e.paddingBottom + e.borderBottomWidth)}}, f._manageStamp = d, f._getElementOffset = function(t){var e = t.getBoundingClientRect(), n = this._boundingRect, o = i(t), r = {left:e.left - n.left - o.marginLeft, top:e.top - n.top - o.marginTop, right:n.right - e.right - o.marginRight, bottom:n.bottom - e.bottom - o.marginBottom}; return r}, f.handleEvent = n.handleEvent, f.bindResize = function(){t.addEventListener("resize", this), this.isResizeBound = !0}, f.unbindResize = function(){t.removeEventListener("resize", this), this.isResizeBound = !1}, f.onresize = function(){this.resize()}, n.debounceMethod(r, "onresize", 100), f.resize = function(){this.isResizeBound && this.needsResizeLayout() && this.layout()}, f.needsResizeLayout = function(){var t = i(this.element), e = this.size && t; return e && t.innerWidth !== this.size.innerWidth}, f.addItems = function(t){var e = this._itemize(t); return e.length && (this.items = this.items.concat(e)), e}, f.appended = function(t){var e = this.addItems(t); e.length && (this.layoutItems(e, !0), this.reveal(e))}, f.prepended = function(t){var e = this._itemize(t); if (e.length){var i = this.items.slice(0); this.items = e.concat(i), this._resetLayout(), this._manageStamps(), this.layoutItems(e, !0), this.reveal(e), this.layoutItems(i)}}, f.reveal = function(t){if (this._emitCompleteOnItems("reveal", t), t && t.length){var e = this.updateStagger(); t.forEach(function(t, i){t.stagger(i * e), t.reveal()})}}, f.hide = function(t){if (this._emitCompleteOnItems("hide", t), t && t.length){var e = this.updateStagger(); t.forEach(function(t, i){t.stagger(i * e), t.hide()})}}, f.revealItemElements = function(t){var e = this.getItems(t); this.reveal(e)}, f.hideItemElements = function(t){var e = this.getItems(t); this.hide(e)}, f.getItem = function(t){for (var e = 0; e < this.items.length; e++){var i = this.items[e]; if (i.element == t)return i}}, f.getItems = function(t){t = n.makeArray(t); var e = []; return t.forEach(function(t){var i = this.getItem(t); i && e.push(i)}, this), e}, f.remove = function(t){var e = this.getItems(t); this._emitCompleteOnItems("remove", e), e && e.length && e.forEach(function(t){t.remove(), n.removeFrom(this.items, t)}, this)}, f.destroy = function(){var t = this.element.style; t.height = "", t.position = "", t.width = "", this.items.forEach(function(t){t.destroy()}), this.unbindResize(); var e = this.element.outlayerGUID; delete c[e], delete this.element.outlayerGUID, u && u.removeData(this.element, this.constructor.namespace)}, r.data = function(t){t = n.getQueryElement(t); var e = t && t.outlayerGUID; return e && c[e]}, r.create = function(t, e){var i = s(r); return i.defaults = n.extend({}, r.defaults), n.extend(i.defaults, e), i.compatOptions = n.extend({}, r.compatOptions), i.namespace = t, i.data = r.data, i.Item = s(o), n.htmlInit(i, t), u && u.bridget && u.bridget(t, i), i}; var m = {ms:1, s:1e3}; return r.Item = o, r}), function(t, e){"function" == typeof define && define.amd?define(["outlayer/outlayer", "get-size/get-size"], e):"object" == typeof module && module.exports?module.exports = e(require("outlayer"), require("get-size")):t.Masonry = e(t.Outlayer, t.msnGetSize)}(window, function(t, e){var i = t.create("masonry"); i.compatOptions.fitWidth = "isFitWidth"; var n = i.prototype; return n._resetLayout = function(){this.msnGetSize(), this._getMeasurement("columnWidth", "outerWidth"), this._getMeasurement("gutter", "outerWidth"), this.measureColumns(), this.colYs = []; for (var t = 0; t < this.cols; t++)this.colYs.push(0); this.maxY = 0, this.horizontalColIndex = 0}, n.measureColumns = function(){if (this.getContainerWidth(), !this.columnWidth){var t = this.items[0], i = t && t.element; this.columnWidth = i && e(i).outerWidth || this.containerWidth}var n = this.columnWidth += this.gutter, o = this.containerWidth + this.gutter, r = o / n, s = n - o % n, a = s && 1 > s?"round":"floor"; r = Math[a](r), this.cols = Math.max(r, 1)}, n.getContainerWidth = function(){var t = this._getOption("fitWidth"), i = t?this.element.parentNode:this.element, n = e(i); this.containerWidth = n && n.innerWidth}, n._getItemLayoutPosition = function(t){t.msnGetSize(); var e = t.size.outerWidth % this.columnWidth, i = e && 1 > e?"round":"ceil", n = Math[i](t.size.outerWidth / this.columnWidth); n = Math.min(n, this.cols); for (var o = this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition", r = this[o](n, t), s = {x:this.columnWidth * r.col, y:r.y}, a = r.y + t.size.outerHeight, h = n + r.col, u = r.col; h > u; u++)this.colYs[u] = a; return s}, n._getTopColPosition = function(t){var e = this._getTopColGroup(t), i = Math.min.apply(Math, e); return{col:e.indexOf(i), y:i}}, n._getTopColGroup = function(t){if (2 > t)return this.colYs; for (var e = [], i = this.cols + 1 - t, n = 0; i > n; n++)e[n] = this._getColGroupY(n, t); return e}, n._getColGroupY = function(t, e){if (2 > e)return this.colYs[t]; var i = this.colYs.slice(t, t + e); return Math.max.apply(Math, i)}, n._getHorizontalColPosition = function(t, e){var i = this.horizontalColIndex % this.cols, n = t > 1 && i + t > this.cols; i = n?0:i; var o = e.size.outerWidth && e.size.outerHeight; return this.horizontalColIndex = o?i + t:this.horizontalColIndex, {col:i, y:this._getColGroupY(i, t)}}, n._manageStamp = function(t){var i = e(t), n = this._getElementOffset(t), o = this._getOption("originLeft"), r = o?n.left:n.right, s = r + i.outerWidth, a = Math.floor(r / this.columnWidth); a = Math.max(0, a);
218 var h = Math.floor(s / this.columnWidth); h -= s % this.columnWidth?0:1, h = Math.min(this.cols - 1, h); for (var u = this._getOption("originTop"), d = (u?n.top:n.bottom) + i.outerHeight, l = a; h >= l; l++)this.colYs[l] = Math.max(d, this.colYs[l])}, n._getContainerSize = function(){this.maxY = Math.max.apply(Math, this.colYs); var t = {height:this.maxY}; return this._getOption("fitWidth") && (t.width = this._getContainerFitWidth()), t}, n._getContainerFitWidth = function(){for (var t = 0, e = this.cols; --e && 0 === this.colYs[e]; )t++; return(this.cols - t) * this.columnWidth - this.gutter}, n.needsResizeLayout = function(){var t = this.containerWidth; return this.getContainerWidth(), t != this.containerWidth}, i}); 219 } 220a4jDefine('ffp_app', ['jquery', 'ko'], function($, ko_lib){ 221 'use strict'; 222 223 var app = { 224 config: {}, 225 params: {}, // ko_lib.observableArray 226 view: {}, // ko_lib.observable 227 templateHTML: "", 228 jqDomNode: null, 229 active: false, 230 translations: {}, 231 232 extend: function(extender){ 233 var instance = $.extend(true, {}, this, extender); 234 instance.init(); 235 return instance; 236 }, 237 238 init: function(){ 239 this.params = ko_lib.observableArray(); 240 this.view = ko_lib.observable(''); 241 var self = this; 242 243 ko_lib.computed(function(){ 244 return ko_lib.toJSON(self.params); 245 }).subscribe(this.onParamsChanged.bind(this)); 246 247 this.view.subscribe(this.onViewChanged.bind(this)); 248 249 this.onInit(); 250 }, 251 252 setConfig: function(cfg){ 253 this.config = cfg; 254 }, 255 256 getConfig: function(){ 257 return this.config; 258 }, 259 260 getConfigValue: function(cfgName, defaultValue=null){ 261 if(this.config[cfgName]!==undefined){ 262 return this.config[cfgName]; 263 } 264 return defaultValue; 265 }, 266 267 setParams: function(_params){ 268 this.params.removeAll(); 269 for(var k in _params){ 270 this.params.push({'name':k,'value':ko_lib.observable(_params[k])}); 271 } 272 }, 273 274 addParams: function(_params){ 275 for(var k in _params){ 276 if(this.getParameter(k)!==null){ 277 this.setParamValue(k,_params[k]); 278 } 279 else{ 280 this.params.push({'name':k,'value':ko_lib.observable(_params[k])}); 281 } 282 } 283 }, 284 285 getParams: function(){ 286 var result = {}; 287 for(var i=0;i<this.params().length;i++){ 288 result[this.params()[i]['name']] = this.params()[i]['value'](); 289 } 290 return result; 291 }, 292 293 getParameter: function(paramName){ 294 for(var i=0;i<this.params().length;i++){ 295 if(this.params()[i]['name']==paramName){ 296 return this.params()[i]['value']; 297 } 298 } 299 return null; 300 }, 301 302 getParamValue: function(paramName, defaultValue=null){ 303 var value = this.getParameter(paramName); 304 if(value!==null){ 305 var v = value(); 306 if(v==undefined){ 307 return defaultValue; 308 } 309 return v; 310 } 311 return defaultValue; 312 }, 313 314 getTimePassed: function(_timestamp){ 315 if(_timestamp == undefined){ 316 return ''; 317 } 318 var wasDate = new Date(parseInt(_timestamp)*1000); 319 var nowDate = new Date(); 320 var $time = Math.max(Math.round((nowDate - wasDate)/1000),1); 321 322 var $tokens = [ 323 {'31536000': this.__('COM_FACEBOOKFEEDPRO_YEAR')}, 324 {'2592000': this.__('COM_FACEBOOKFEEDPRO_MONTH')}, 325 {'604800': this.__('COM_FACEBOOKFEEDPRO_WEEK')}, 326 {'86400': this.__('COM_FACEBOOKFEEDPRO_DAY')}, 327 {'3600': this.__('COM_FACEBOOKFEEDPRO_HOUR')}, 328 {'60': this.__('COM_FACEBOOKFEEDPRO_MINUTE')}, 329 {'1': this.__('COM_FACEBOOKFEEDPRO_SECOND')}
329 330 ]; 331 var $tokensPL = [ 332 {'31536000': this.__('COM_FACEBOOKFEEDPRO_YEARS')}, 333 {'2592000': this.__('COM_FACEBOOKFEEDPRO_MONTHS')}, 334 {'604800': this.__('COM_FACEBOOKFEEDPRO_WEEKS')}, 335 {'86400': this.__('COM_FACEBOOKFEEDPRO_DAYS')}, 336 {'3600': this.__('COM_FACEBOOKFEEDPRO_HOURS')}, 337 {'60': this.__('COM_FACEBOOKFEEDPRO_MINUTES')}, 338 {'1': this.__('COM_FACEBOOKFEEDPRO_SECONDS')} 339 ]; 340 var $tokensPL2 = [ 341 {'31536000': this.__('COM_FACEBOOKFEEDPRO_YEARS2')}, 342 {'2592000': this.__('COM_FACEBOOKFEEDPRO_MONTHS2')}, 343 {'604800': this.__('COM_FACEBOOKFEEDPRO_WEEKS2')}, 344 {'86400': this.__('COM_FACEBOOKFEEDPRO_DAYS2')}, 345 {'3600': this.__('COM_FACEBOOKFEEDPRO_HOURS2')}, 346 {'60': this.__('COM_FACEBOOKFEEDPRO_MINUTES2')}, 347 {'1': this.__('COM_FACEBOOKFEEDPRO_SECONDS2')} 348 ]; 349 var $str = ''; 350 for(var $i=0;$i<$tokens.length;$i++){ 351 var k = Object.keys($tokens[$i])[0]; 352 var $unit = parseInt(k); 353 if ($time < $unit){ 354 continue; 355 } 356 var $numberOfUnits = String(Math.floor($time / $unit)); 357 var $pl_sg = parseInt($numberOfUnits.substr($numberOfUnits.length-1)); 358 if($numberOfUnits>10 && $numberOfUnits<15){ 359 $str = $tokensPL2[$i][k]; 360 } 361 else if($pl_sg==1){ 362 $str = $tokens[$i][k]; 363 } 364 else if($pl_sg>1&&$pl_sg<5){ 365 $str = $tokensPL[$i][k]; 366 } 367 else{ 368 $str = $tokensPL2[$i][k]; 369 } 370 371 return $numberOfUnits+' '+$str+' '+this.__('COM_FACEBOOKFEEDPRO_AGO'); 372 } 373 return ''; 374 }, 375 376 setParamValue: function(paramName, paramValue){ 377 var value = this.getParameter(paramName); 378 if(value!==null){ 379 value(paramValue); 380 } 381 else{ 382 this.params.push({'name':paramName,'value':ko_lib.observable(paramValue)}); 383 } 384 }, 385 386 loadTemplate: function(){ 387 var self = this; 388 var fdf = $.Deferred(); 389 390 $.ajax({ 391 url: this.getConfigValue('templates_url')+this.getConfigValue('template')+'.html?v='+this.getConfigValue('version', '1.0'), 392 }) 393 .done(function(html){ 394 self.templateHTML = html; 395 fdf.resolve(); 396 }) 397 .fail(function(e){ 398 fdf.reject(e); 399 }); 400 return fdf.promise(); 401 }, 402 403 getTemplate: function(_html="", _bindObj=null){ 404 if(_html=="" && this.templateHTML==''){ 405 return $('<b>Template "'+this.getConfigValue('template')+'" is not loaded.</b>'); 406 } 407 var result; 408 if(_html!=''){ 409 result = $(_html); 410 } 411 else{ 412 result = $(this.templateHTML); 413 } 414 if(_bindObj!==null){ 415 ko_lib.applyBindings(_bindObj, result[0]); 416 } 417 else{ 418 ko_lib.applyBindings(this, result[0]); 419 } 420 return result; 421 }, 422 423 /* 424 * type = info | error | success 425 */ 426 427 showMessage: function(msg, type='info'){ 428 msg = '<p>'+msg+'</p>'; 429 $(':focus').blur(); 430 var existing = $('.ffp-message-win'); 431 if(existing.length){ 432 msg = existing.find('.ffp-win-body').html()+msg; 433 existing.remove(); 434 } 435 var html = '<div class="ffp-shade ffp-message-win"><div class="ffp-win ffp-type-'+type+'">'; 436 html+= '<div class="ffp-win-body">'+msg+'</div>'; 437 html+= '<div class="ffp-win-close">+</div>'; 438 html+= '</div></div>'; 439 var win = $(html).appendTo('body'); 440 var modal = win.find('.ffp-win'); 441 win.on('close',function(){ 442 win.animate({ 443 opacity: 0 444 },200,'swing',function(){ 445 win.remove(); 446 }); 447 modal.animate({ 448 'margin-top': -50 449 },200,'swing'); 450 }); 451 win.on('click',function(e){ 452 var target = $(e.target); 453 if(target.is('.ffp-shade, .ffp-win-close') || target.parent().is('.ffp-win-close')){ 454 win.trigger('close'); 455 } 456 }); 457 win.css({ 458 opacity: 0 459 }); 460 modal.css({ 461 'margin-top': -50 462 }); 463 win.animate({ 464 opacity: 1 465 },200,'swing'); 466 modal.animate({ 467 'margin-top': 0 468 },200,'swing'); 469 }, 470 471 /* 472 * type = info | error | success 473 */ 474 475 getMessageHTML: function(msg, type='info'){ 476 return '<div class="ffp-message ffp-type-'+type+'">'+msg+'</div>'; 477 }, 478 479 renderTo: function(selector){ 480 var node = selector; 481 if(!(node instanceof $)){ 482 node = $(selector); 483 } 484 this.beforeRender(); 485 var self = this; 486 var templateLoaded = function(){ 487 self.jqDomNode = self.getTemplate(); 488 node.empty().append(self.jqDomNode); 489 self.active = true;
490 self.afterRender(); 491 }; 492 if(this.templateHTML==''){ 493 this.loadTemplate().done(function(){ 494 templateLoaded(); 495 }); 496 } 497 else{ 498 templateLoaded(); 499 } 500 }, 501 502 setTranslation: function(trans){ 503 $.extend(this.translations, trans); 504 }, 505 506 __: function(string){ 507 if(this.translations[string]){ 508 return this.translations[string]; 509 } 510 else{ 511 return string; 512 } 513 }, 514 515 precisionRound: function(number, precision) { 516 var factor = Math.pow(10, precision); 517 return Math.round(number * factor) / factor; 518 }, 519 520 detach: function(){ 521 this.beforeDetach(); 522 this.jqDomNode.remove(); 523 this.active = false; 524 this.afterDetach(); 525 }, 526 527 // for child use 528 529 onInit: function(){}, 530 beforeRender: function(){}, 531 afterRender: function(){}, 532 beforeDetach: function(){}, 533 afterDetach: function(){}, 534 onParamsChanged: function(){}, 535 onViewChanged: function(){} 536 }; 537 538 return app; 539}); 540a4jDefine('ffp_popup', ['ffp_app', 'ko', 'jquery'], function(App, ko_lib, $){ 541 'use strict'; 542 543 var popup = App.extend({ 544 545 item: ko_lib.observable({}), 546 items: ko_lib.observableArray(), 547 commentsCache: {}, 548 comments: ko_lib.observable({}), 549 started: false, 550 wrapper: null, 551 displayed: false, 552 commentsLoading: ko_lib.observable(false), 553 feed: null, 554 videoContainer: null, 555 videoPlayer: null, 556 commentsIDs: [], 557 fbAPIloaded: false, 558 559 prepare: function(){ 560 if(this.started){ 561 return; 562 } 563 this.started = true; 564 565 this.hasPrevItem = ko_lib.computed(function(){ 566 return (this.getPrevItem()!==false); 567 },this); 568 569 this.hasNextItem = ko_lib.computed(function(){ 570 return (this.getNextItem()!==false); 571 },this); 572 573 574 this.wrapper = $('<div class="ffp-shade" id="ffp-shade"></div>'); 575 $('body').append(this.wrapper); 576 this.wrapper.hide(); 577 this.renderTo('#ffp-shade'); 578 }, 579 580 getPrevItem: function(){ 581 if(!this.items().length){ 582 return false; 583 } 584 var totalItems = this.items().length; 585 var currentItemIndex = this.getCurrentItemIndex(); 586 if(currentItemIndex>0){ 587 return this.items()[currentItemIndex-1]; 588 } 589 return false; 590 }, 591 592 getNextItem: function(){ 593 if(!this.items().length){ 594 return false; 595 } 596 var totalItems = this.items().length; 597 var currentItemIndex = this.getCurrentItemIndex(); 598 if(currentItemIndex+1<totalItems){ 599 return this.items()[currentItemIndex+1]; 600 } 601 return false; 602 }, 603 604 getCurrentItemIndex: function(){ 605 if(!this.items().length){ 606 return -1; 607 } 608 for(var i=0;i<this.items().length;i++){ 609 if(this.items()[i]===this.item()){ 610 return i; 611 } 612 } 613 return -1; 614 }, 615 616 loadCommentsFor: function(_id, _page){ 617 if(this.commentsCache[_id]){ 618 this.comments(this.commentsCache[_id]); 619 return; 620 } 621 else{ 622 this.comments({'items':[],'total':0,'page':0}); 623 } 624 return; 625 }, 626 627 show: function(_item, _items=null){ 628 this.item(_item); 629 if(_items){ 630 this.items(_items()); 631 } 632 this.loadCommentsFor(_item.id, 1); 633 634 if(!this.displayed){ 635 this.display(); 636 } 637 else{ 638 this.jqDomNode.find('.ffp-animate').hide().fadeIn(200,'swing'); 639 } 640 this.fitWindow(); 641 if(_item.type=='video'){ 642 this.videoPlayer.attr('poster', _item.picture); 643 this.videoPlayer.empty().append('<source src="'+_item.link+'" type="video/mp4">'); 644 this.videoPlayer.get(0).load(); 645 } 646 else if(_item.type=='video_live'){ 647 this.commentsStart(); 648 } 649 else if(_item.type=='video_inline'){ 650 this.loadFB_API(); 651 } 652 }, 653 654 loadFB_API: function(){ 655 if(this.fbAPIloaded){ 656 window.FB.init({xfbml:true,version:"v3.2"}); 657 } 658 else{ 659 this.fbAPIloaded = true; 660 var s = document.createElement("script"); 661 s.type = "text/javascript"; 662 s.onload = function(){ 663 window.FB.init({xfbml:true,version:"v3.2"}); 664 }; 665 s.src = "https://connect.facebook.net/en-GB/all.js"; 666 document.head.appendChild(s); 667 } 668 }, 669 670 hide: function(){ 671 var self = this; 672 if(!popup.displayed){ 673 return; 674 } 675 popup.displayed = false; 676 if(this.item()['type']=='video'){ 677 this.videoPlayer.attr('poster', ''); 678 this.videoPlayer.get(0).pause(); 679 } 680 else if(this.item()['type']=='video_live'){ 681 this.commentsStop(); 682 } 683 this.wrapper.fadeOut(200,'swing', function(){ 684 self.item({}); 685 }); 686 this.jqDomNode.find('.ffp-media iframe').attr('src', ''); 687 this.jqDomNode.removeClass('ffp-visible'); 688 }, 689 690 commentsLoad: function(){ 691 if(!this.displayed){ 692 return false; 693 } 694 var commentsWrap = this.jqDomNode.find('.ffp-popup-live-comments'); 695 var self = this; 696 $.ajax({
697 url: self.getConfigValue('ajax_url')+'&id='+self.getConfigValue('id')+'&scope=live_comments&liveID='+self.item()['id'], 698 method: "GET", 699 dataType: 'json', 700 success: function(_data){ 701 if(_data && _data.status && _data.status=='success'){ 702 for(var i=0;i<_data.comments.length;i++){ 703 self.commentAdd(_data.comments[i]); 704 } 705 window.setTimeout(function(){self.commentsLoad();}, 10000); 706 } 707 else if(_data && _data.status && _data.status=='error'){ 708 commentsWrap.prepend(self.getMessageHTML(_data.message,'error')); 709 } 710 else{ 711 commentsWrap.prepend(self.getMessageHTML(self.feed.__('ajax_error'),'error')); 712 } 713 }, 714 error: function(xhr, type, message){ 715 commentsWrap.prepend(self.getMessageHTML('<b>'+self.feed.__('ajax_error')+'</b><br><i>'+message+'</i>','error')); 716 } 717 }); 718 }, 719 720 commentAdd: function(comment){ 721 if(this.commentsIDs.indexOf(comment.id)>=0){ 722 return; 723 } 724 var commentsWrap = this.jqDomNode.find('.ffp-popup-live-comments'); 725 this.commentsIDs.push(comment.id); 726 var commentHTML = '<div class="ffp-popup-live-comment">' 727 +'<div class="ffp-popup-live-comment-author-pic"><img src="'+comment.from_picture+'"/></div>' 728 +'<div class="ffp-popup-live-comment-block">' 729 +'<div class="ffp-popup-live-comment-block-author-name">'+comment.from_name+'</div>' 730 +'<div class="ffp-popup-live-comment-block-text">'+comment.text+'</div>' 731 +'</div>' 732 +'<div class="ffp-popup-live-comment-time">'+comment.created+'</div>' 733 +'</div>'; 734 var comment = $(commentHTML); 735 commentsWrap.prepend(comment); 736 comment.hide().fadeIn(200,'swing'); 737 }, 738 739 commentsStart: function(){ 740 this.commentsIDs = []; 741 this.commentsLoad(); 742 }, 743 744 commentsStop: function(){ 745 this.commentsIDs = []; 746 }, 747 748 display: function(){ 749 if(popup.displayed){ 750 return; 751 } 752 popup.displayed = true; 753 this.wrapper.fadeIn(200,'swing'); 754 this.jqDomNode.addClass('ffp-visible'); 755 }, 756 757 showPrevItem: function(){ 758 if(!this.hasPrevItem()){ 759 return false; 760 } 761 this.show(this.getPrevItem()); 762 }, 763 764 showNextItem: function(){ 765 if(!this.hasNextItem()){ 766 return false; 767 } 768 this.show(this.getNextItem()); 769 }, 770 771 shareLink: function(_link){ 772 window.open("https://www.facebook.com/sharer/sharer.php?u="+_link, "facebook", "width=600px,height=600px,menubar=no,toolbar=no,resizable=yes,scrollbars=yes") 773 }, 774 775 fitWindow: function(){ 776 var winWidth = $(window).width(); 777 var winHeight = $(window).height(); 778 var maxWidth = winWidth-140-340; 779 var maxHeight = winHeight-70; 780 var winRatio = winWidth/winHeight; 781 var _w = Math.min(720,Math.floor(winWidth*0.4)); 782 if(winWidth<600){ 783 this.jqDomNode.removeClass('ffp-desktop'); 784 this.jqDomNode.addClass('ffp-mobile'); 785 this.jqDomNode.find('.ffp-popup-content-main .ffp-media').css({'max-width':'none','width':'100%','height':'auto'}); 786 this.jqDomNode.find('.ffp-popup-content-main').css({'width':'100%','height':'auto'}); 787 788 if(this.item() && this.item()['media_width']){ 789 var itemWidth = this.item()['media_width']; 790 var itemHeight = this.item()['media_height']; 791 var itemRatio = itemWidth/itemHeight; 792 var finalWidth = Math.min(itemWidth, winWidth)-20;
793 var finalHeight = finalWidth/itemRatio; 794 finalWidth = Math.round(finalWidth); 795 finalHeight = Math.round(finalHeight); 796 this.jqDomNode.find('.ffp-popup-content-main .ffp-media').css({'width':finalWidth+'px','height':finalHeight+'px'}); 797 } 798 } 799 else{ 800 this.jqDomNode.removeClass('ffp-mobile'); 801 this.jqDomNode.addClass('ffp-desktop'); 802 this.jqDomNode.find('.ffp-popup-content-main .ffp-media').css({'max-width':_w+'px','width':'auto','height':'auto'}); 803 this.jqDomNode.find('.ffp-popup-content-main').css({'width':'auto','height':'auto'}); 804 if(this.item() && this.item()['media_width']){ 805 var itemWidth = this.item()['media_width']; 806 var itemHeight = this.item()['media_height']; 807 var itemRatio = itemWidth/itemHeight; 808 var finalWidth = Math.min(itemWidth, maxWidth); 809 var finalHeight = finalWidth/itemRatio; 810 finalWidth = Math.round(finalWidth); 811 finalHeight = Math.round(finalHeight); 812 this.jqDomNode.find('.ffp-popup-content-main .ffp-media').css({'max-width':'none','width':'100%','height':'100%'}); 813 this.jqDomNode.find('.ffp-popup-content-main').css({'width':finalWidth+'px','height':finalHeight+'px'}); 814 } 815 } 816 }, 817 818 afterRender: function(){ 819 this.wrapper.on('click',function(e){ 820 var _target = $(e.target); 821 var _close = _target.closest('.ffp-popup-close'); 822 if(_target.is(popup.wrapper) || _close.length){ 823 popup.hide(); 824 } 825 }); 826 this.fitWindow(); 827 828 var ttlInt = 0; 829 $(window).on('resize', function(){ 830 window.clearTimeout(ttlInt); 831 ttlInt = window.setTimeout(function(){ 832 popup.fitWindow(); 833 },100); 834 }); 835 836 if('ontouchstart' in document.documentElement){ 837 this.jqDomNode.get(0).addEventListener('touchstart', onTouchStart, false); 838 } 839 840 var videoContainer = this.videoContainer = this.jqDomNode.find('.ffp-popup-video'); 841 var videoPlayer = this.videoPlayer = this.jqDomNode.find('.ffp-popup-video-player'); 842 videoContainer.on('click', function(){ 843 var player = videoPlayer.get(0); 844 if (player.paused){ 845 videoContainer.addClass('ffp-playing'); 846 player.play(); 847 } else { 848 videoContainer.removeClass('ffp-playing'); 849 player.pause(); 850 } 851 }); 852 } 853 854 }); 855 856 var startX; 857 var startY; 858 var isMoving = false; 859 var config = { 860 min_move_x: 20, 861 min_move_y: 20, 862 preventDefaultEvents: true 863 }; 864 865 function onTouchStart(e){ 866 var $domElem = popup.jqDomNode.get(0); 867 if (e.touches.length == 1) { 868 startX = e.touches[0].pageX; 869 startY = e.touches[0].pageY; 870 isMoving = true; 871 $domElem.addEventListener('touchmove', onTouchMove, false); 872 } 873 }; 874 875 function cancelTouch(){ 876 var $domElem = popup.jqDomNode.get(0); 877 $domElem.removeEventListener('touchmove', onTouchMove); 878 startX = null; 879 isMoving = false; 880 } 881 882 function onTouchMove(e) { 883 /*if(config.preventDefaultEvents) { 884 e.preventDefault(); 885 } 886 if(isMoving){ 887 var x = e.touches[0].pageX; 888 var y = e.touches[0].pageY; 889 var dx = startX - x; 890 var dy = startY - y; 891 if(Math.abs(dx) >= config.min_move_x) { 892 cancelTouch(); 893 if(dx > 0) { 894 popup.showNextItem(); 895 } 896 else { 897 popup.showPrevItem(); 898 } 899 } 900 }*/ 901 } 902 903 return popup; 904 905}); 906a4jDefine('ffp_feed', ['ffp_app', 'ffp_popup', 'ko', 'jquery'], function(App, Popup, ko_lib, $){ 907 'use strict'; 908 909 var feed = App.extend({ 910 911 create: function(cfg){ 912 var feed = this.extend({}); 913 feed.setConfig(cfg); 914 Popup.setTranslation(this.translations); 915 feed.popup = Popup; 916 feed.popup.setConfig($.extend({},cfg,{'template':'popup'})); 917 feed.popup.feed = feed; 918 return feed; 919 }, 920 921 onInit: function(){ 922 var feed = this; 923 924 this.haveMore = { 925 'data': ko_lib.observable(false), 926 'posts': ko_lib.observable(false), 927 'photos': ko_lib.observable(false), 928 'albums': ko_lib.observable(false), 929 'videos': ko_lib.observable(false) 930 }; 931 932 this.grid = { 933 'posts': null, 934 'photos': null, 935 'albums': null, 936 'videos': null 937 }; 938 939 this.currentPage = { 940 'posts': 1, 941 'photos': 1, 942 'albums': 1, 943 'videos': 1 944 }; 945 946 this.error = ko_lib.observable(''); 947 948 this.dataLoaded = ko_lib.observable(false); 949 this.postsLoaded = ko_lib.observable(false); 950 this.photosLoaded = ko_lib.observable(false); 951 this.albumsLoaded = ko_lib.observable(false); 952 this.videosLoaded = ko_lib.observable(false); 953 954 this.data = ko_lib.observable({}); 955 this.posts = ko_lib.observableArray(); 956 this.photos = ko_lib.observableArray(); 957 this.videos = ko_lib.observableArray(); 958 this.albums = ko_lib.observableArray(); 959 960 this.allDataLoading = ko_lib.observable(false); 961 962 this.albumsShown = ko_lib.observable(!this.getParamValue('photos_albums_limit',false)); 963 this.showAlbumsText = ko_lib.observable(this.__('show_more')); 964 965 this.rebuildStyles = ko_lib.observable(0); 966 this.visible = ko_lib.observable(false); 967 968 this.isSingleAlbum = ko_lib.observable(false); 969 970 this.cssStyles = ko_lib.computed(function(){ 971 var cssID = this.getCSSFeedID(); 972 var postsGutter = parseInt(this.getParamValue('posts_layout_gutter',0)); 973 var postsGutterHalf = (postsGutter>0?Math.floor(postsGutter/2):0); 974 var photosGutter = parseInt(this.getParamValue('photos_layout_gutter',0)); 975 var photosGutterHalf = (photosGutter>0?Math.floor(photosGutter/2):0); 976 var videosGutter = parseInt(this.getParamValue('videos_layout_gutter',0)); 977 var videosGutterHalf = (videosGutter>0?Math.floor(videosGutter/2):0); 978 var headerVisible = this.getParamValue('main_header_show',false); 979 var menuVisible = this.getParamValue('main_menu_show',false); 980 var picType = this.getParamValue('main_header_logo_type',1); 981 var albumsShown = this.albumsShown(); 982 var cssHeight = this.getCSSHeight(); 983 var rand = this.rebuildStyles(); 984 985 var styles = '' 986 +'#'+cssID+'{max-width:'+this.getCSSWidth()+';}' 987 +'#'+cssID+' .ffp-feed-header-cover{background-image:url('+this.data()['cover']+');}' 988 +'#'+cssID+' .ffp-feed-header-picture{background-image:url('+(picType==1?this.data()['picture']:this.data()['picture2'])+');}' 989 +'#'+cssID+' .ffp-feed-container{'+(cssHeight=='none'?'overflow:hidden':'max-height:'+cssHeight)+';}' 990 /* 991 * GRID posts 992 */ 993 +'#'+cssID+' .ffp-feed-posts-items .ffp-feed-grid{margin-left:-'+postsGutterHalf+'px;margin-right:-'+postsGutterHalf+'px;}' 994 +'#'+cssID+' .ffp-feed-posts-items .ffp-feed-grid-item-content{padding-left:'+postsGutterHalf+'px;padding-right:'+postsGutterHalf+'px;padding-bottom:'+postsGutter+'px;}' 995 /* 996 * ----- 997 */ 998 /* 999 * GRID photos 1000 */ 1001 +'#'+cssID+' .ffp-feed-photos-items .ffp-feed-grid, ' 1002 +'#'+cssID+' .ffp-feed-albumphotos-items .ffp-feed-grid{margin-left:-'+photosGutterHalf+'px;margin-right:-'+photosGutterHalf+'px;}' 1003 +'#'+cssID+' .ffp-feed-photos-items .ffp-feed-grid-item-content, ' 1004 +'#'+cssID+' .ffp-feed-albumphotos-items .ffp-feed-grid-item-content{padding-left:'+photosGutterHalf+'px;padding-right:'+photosGutterHalf+'px;padding-bottom:'+photosGutter+'px;}' 1005 /* 1006 * ----- 1007 */ 1008 /* 1009 * GRID videos 1010 */ 1011 +'#'+cssID+' .ffp-feed-videos-items .ffp-feed-grid{margin-left:-'+videosGutterHalf+'px;margin-right:-'+videosGutterHalf+'px;}' 1012 +'#'+cssID+' .ffp-feed-videos-items .ffp-feed-grid-item-content{padding-left:'+videosGutterHalf+'px;padding-right:'+videosGutterHalf+'px;padding-bottom:'+videosGutter+'px;}' 1013 /* 1014 * ----- 1015 */ 1016 +'#'+cssID+' .ffp-feed-albums-wrap .ffp-feed-albums-items{height:'+(albumsShown?'auto':'205px')+';}' 1017 1018 +'#'+cssID+' .ffp-feed-posts-item{'+(postsGutter>3?'box-shadow: 0 1px 3px rgba(0,0,0,0.12);':'border-radius:0;')+'}' 1019 ; 1020 1021 if(photosGutter<=3){ 1022 styles+= '#'+cssID+' .ffp-feed-photos-item .ffp-feed-item-picture{border-radius:0;}'; 1023 } 1024 if(videosGutter<=3){ 1025 styles+= '#'+cssID+' .ffp-feed-videos-item{border-radius:0;}'; 1026 } 1027 if(this.getParamValue('main_display_widget_bg','')!=''){ 1028 styles+= '#'+cssID+'.ffp-feed-wrap{background-color: '+this.getParamValue('main_display_widget_bg','')+';}'; 1029 } 1030 if(this.getParamValue('main_display_widget_border_color','')!=''){ 1031 styles+= '#'+cssID+'.ffp-feed-wrap{border-color: '+this.getParamValue('main_display_widget_border_color','')+';}'; 1032 } 1033 if(this.getParamValue('main_header_bg_color','')!=''){ 1034 styles+= '#'+cssID+' .ffp-feed-header{background-color: '+this.getParamValue('main_header_bg_color','')+';}'; 1035 } 1036 if(this.getParamValue('main_menu_bg_color','')!=''){ 1037 styles+= '#'+cssID+' .ffp-feed-menu{background-color: '+this.getParamValue('main_menu_bg_color','')+';}'; 1038 } 1039 if(this.getParamValue('main_menu_text_color','')!=''){ 1040 styles+= '#'+cssID+' .ffp-feed-menu-item{color: '+this.getParamValue('main_menu_text_color','')+';}'; 1041 styles+= '#'+cssID+' .ffp-feed-menu-item:after{background-color: '+this.getParamValue('main_menu_text_color','')+';}'; 1042 } 1043 if(this.getParamValue('main_menu_text_hover_color','')!=''){ 1044 styles+= '#'+cssID+' .ffp-feed-menu-item:hover, #'+cssID+' .ffp-feed-menu-item.active{color: '+this.getParamValue('main_menu_text_hover_color','')+';}'; 1045 styles+= '#'+cssID+' .ffp-feed-menu-item.active:after{background-color: '+this.getParamValue('main_menu_text_hover_color','')+';}'; 1046 } 1047 if(this.getParamValue('main_display_feed_bg','')!=''){ 1048 styles+= '#'+cssID+' .ffp-feed-container{background-color: '+this.getParamValue('main_display_feed_bg','')+';}'; 1049 } 1050 if(this.getParamValue('main_display_feed_border_color','')!=''){ 1051 styles+= '#'+cssID+' .ffp-feed-container{border-color: '+this.getParamValue('main_display_feed_border_color','')+';}'; 1052 } 1053 if(this.getParamValue('photos_albums_bg','')!=''){ 1054 styles+= '#'+cssID+' .ffp-feed-albums-wrap{background-color: '+this.getParamValue('photos_albums_bg','')+';}'; 1055 } 1056 return styles; 1057 },this); 1058 1059 1060 this.posts.subscribe(function(){ 1061 feed.checkGrid(); 1062 }); 1063 this.photos.subscribe(function(){ 1064 feed.checkGrid(); 1065 }); 1066 this.albums.subscribe(function(){ 1067 feed.checkGrid(); 1068 }); 1069 this.videos.subscribe(function(){ 1070 feed.checkGrid(); 1071 }); 1072 1073 this.visible.subscribe(function(){ 1074 feed.checkGrid(); 1075 }); 1076 1077 }, 1078 1079 getFeedCSSClass: function(){ 1080 var css = 'ffp-feed-wrap'; 1081 css+= ' ffp-style-'+this.getParamValue('main_display_style','light'); 1082 return css; 1083 }, 1084 1085 onParamsChanged: function(){ 1086 this.toggleAlbums(!this.getParamValue('photos_albums_limit',false)); 1087 this.popup.addParams(this.getParams()); 1088 this.checkGrid(); 1089 }, 1090 1091 currentAlbum: { 1092 'album': ko_lib.observable({}), 1093 'photos': ko_lib.observableArray([]), 1094 'page': ko_lib.observable(1), 1095 'haveMore': ko_lib.observable(false), 1096 'isLoading': ko_lib.observable(false), 1097 }, 1098 1099 checkDisplayAlbum: function(){ 1100 if(this.isSingleAlbum() && this.view()=='photos' && !this.getParamValue('posts_show_all_photos',true)){ 1101 this.view('albumphotos'); 1102 } 1103 }, 1104 1105 preloadAlbum: function(album){ 1106 this.currentAlbum.album(album); 1107 this.currentAlbum.page(1); 1108 this.currentAlbum.photos.removeAll(); 1109 this.currentAlbum.haveMore(false); 1110 this.loadAlbumPhotos(album['id']); 1111 }, 1112 1113 showAlbum: function(album){ 1114 this.currentAlbum.album(album); 1115 this.currentAlbum.page(1); 1116 this.currentAlbum.photos.removeAll(); 1117 this.currentAlbum.haveMore(false); 1118 this.loadAlbumPhotos(album['id']); 1119 this.view('albumphotos'); 1120 }, 1121 1122 albumsPhotosCache: {}, 1123 loadAlbumPhotos: function(_albumID){ 1124 if(!this.albumsPhotosCache[_albumID]){ 1125 this.albumsPhotosCache[_albumID] = { 1126 'id': 0, 1127 'page': 0, 1128 'photos': [], 1129 'haveMore': false 1130 }; 1131 } 1132 var cache = this.albumsPhotosCache[_albumID]; 1133 if(cache.id!==0 && cache.page>=this.currentAlbum.page()){ 1134 this.currentAlbum.photos(cache.photos.slice()); 1135 this.currentAlbum.page(cache.page); 1136 this.currentAlbum.haveMore(cache.haveMore); 1137 this.checkDisplayAlbum(); 1138 this.checkGrid(); 1139 return; 1140 } 1141 1142 this.currentAlbum.isLoading(true); 1143 1144 var _page = this.currentAlbum.page(); 1145 var feed = this; 1146 this.loadData('albumphotos', this.currentAlbum.page(), { 1147 request_add_str: 'albumID='+_albumID, 1148 success: function(_data){ 1149 if(_data && _data.status && _data.status=='success'){ 1150 if(_page==1){ 1151 feed.currentAlbum.photos(_data.p
1151hotos); 1152 } 1153 else{ 1154 for(var i=0;i<_data.photos.length;i++){ 1155 feed.currentAlbum.photos.push(_data.photos[i]); 1156 } 1157 } 1158 feed.currentAlbum.isLoading(false); 1159 feed.currentAlbum.haveMore(_data.have_more); 1160 cache.id = feed.currentAlbum.album()['id']; 1161 cache.page = _page; 1162 cache.photos = feed.currentAlbum.photos().slice(); 1163 cache.haveMore = _data.have_more; 1164 feed.checkDisplayAlbum(); 1165 feed.checkGrid(); 1166 } 1167 else if(_data && _data.status && _data.status=='error'){ 1168 feed.showMessage(_data.message,'error'); 1169 } 1170 else{ 1171 feed.showMessage(feed.__('ajax_error'),'error'); 1172 } 1173 } 1174 }); 1175 }, 1176 1177 loadMoreAlbumPhotos: function(){ 1178 this.currentAlbum.page(this.currentAlbum.page()+1); 1179 this.loadAlbumPhotos(this.currentAlbum.album()['id']); 1180 }, 1181 1182 getDateDisplay: function(_item){ 1183 if(this.getParamValue('main_display_date','time_passed')=='date'){ 1184 return _item.date; 1185 } 1186 else{ 1187 return this.getTimePassed(_item.created); 1188 } 1189 }, 1190 1191 getLinkDomain: function(_url){ 1192 var a = document.createElement('a'); 1193 a.href = _url; 1194 return a.hostname; 1195 }, 1196 1197 getPictureAlt: function(post){ 1198 var text = ''; 1199 if(post.title){
1200 text = post.title; 1201 } 1202 else if(post.description){ 1203 text = post.description; 1204 } 1205 else if(post.text){ 1206 text = post.text; 1207 } 1208 if(text.length>50){ 1209 text = text.substring(0,50)+'...'; 1210 } 1211 return text; 1212 }, 1213 1214 onViewChanged: function(){ 1215 if(!this.active){ 1216 return; 1217 } 1218 this.checkDisplayAlbum(); 1219 this.checkGrid(); 1220 }, 1221 1222 toggleAlbums: function(val=null){ 1223 if(val!==true && val!==false){ 1224 val = !this.albumsShown(); 1225 } 1226 this.albumsShown(val); 1227 if(this.albumsShown()){ 1228 this.showAlbumsText(this.__('show_less')); 1229 } 1230 else{ 1231 this.showAlbumsText(this.__('show_more')); 1232 } 1233 }, 1234 1235 checkGridThrottleInt: 0, 1236 1237 checkGrid: function(){ 1238 if(!this.active){ 1239 return; 1240 } 1241 var feed = this; 1242 1243 if(this.checkGridThrottleInt){ 1244 window.clearTimeout(this.checkGridThrottleInt); 1245 } 1246 this.checkGridThrottleInt = window.setTimeout(function(){ 1247 feed._checkGrid(); 1248 },100); 1249 }, 1250 1251 _checkGrid: function(){ 1252 if(!this.active){ 1253 return; 1254 } 1255 var feedWidth = this.jqDomNode.width(); 1256 this.jqDomNode.toggleClass('ffp-layout-mobile',feedWidth<400); 1257 1258 this._checkGridFor(this.view()); 1259 1260 this.rebuildStyles(Math.random()); 1261 }, 1262 1263 _checkGridFor: function(_scope){ 1264 if(!this.getParamValue(_scope+'_show') && _scope!='albumphotos'){ 1265 return; 1266 } 1267 var feed = this; 1268 var feedWidth = this.jqDomNode.width(); 1269 var cols = this.getColsForWidth(feedWidth,_scope); 1270 var widthPercent = this.precisionRound(100/cols,3); 1271 1272 if(_scope=='photos'){ 1273 if(this.getParamValue('photos_albums_show')){ 1274 var albumsWrap = this.jqDomNode.find('.ffp-feed-albums-items'); 1275 var albumsCols = Math.round(albumsWrap.width()/200); 1276 if(this.albums().length>0){ 1277 albumsCols = Math.min(albumsCols, this.albums().length); 1278 } 1279 var albumsWidthPercent = this.precisionRound(100/albumsCols,3); 1280 albumsWrap.find('.ffp-feed-albums-item').css('width',albumsWidthPercent+'%').css('flex-basis',albumsWidthPercent+'%'); 1281 } 1282 } 1283 1284 this.jqDomNode.find('.ffp-feed-'+_scope+'-items .ffp-feed-grid-item').css('width',widthPercent+'%'); 1285 1286 this.jqDomNode.find('.ffp-feed-'+_scope+'-items .ffp-text-expand').each(function(){ 1287 var $elem = $(this); 1288 if(!$elem.is('.ffp-expanded') && !$elem.next().hasClass('ffp-text-expand-btn')){ 1289 var subElem = $elem.children().first(); 1290 if($elem.height()+18<subElem.height()){ 1291 var moreBtn = $('<div class="ffp-text-expand-btn">'+feed.__('show_more')+'</div>'); 1292 $elem.addClass('ffp-has-more'); 1293 moreBtn.insertAfter($elem); 1294 moreBtn.off('click'); 1295 moreBtn.on('click',function(){ 1296 $elem.removeClass('ffp-has-more'); 1297 $elem.addClass('ffp-expanded'); 1298 moreBtn.remove(); 1299 feed.checkGrid(); 1300 }); 1301 } 1302 else{ 1303 $elem.removeClass('ffp-has-more'); 1304 $elem.addClass('ffp-expanded'); 1305 } 1306 } 1307 }); 1308 1309 this.jqDomNode.find('.ffp-feed-'+_scope+'-items .ffp-text-wrap').not('.ffp-text-expand').removeClass('ffp-expanded').next('.ffp-text-expand-btn').remove(); 1310 1311 if(!this.grid[_scope]){ 1312 this.jqDomNode.find('.ffp-feed-'+_scope+'-items .ffp-feed-grid .ffp-feed-grid-item.ffp-
1312hidden').removeClass('ffp-hidden'); 1313 this.grid[_scope] = this.jqDomNode.find('.ffp-feed-'+_scope+'-items .ffp-feed-grid'); 1314 this.grid[_scope].masonry({ 1315 'itemSelector': '.ffp-feed-grid-item', 1316 'percentPosition': true, 1317 'columnWidth': '.ffp-feed-grid-item', 1318 'masonry':{ 1319 'columnWidth': '.ffp-feed-grid-item' 1320 }, 1321 'originLeft': $('body').css('direction')!=='rtl' 1322 }); 1323 this.grid[_scope].masonry('reloadItems'); 1324 } 1325 else{ 1326 var newItems = this.jqDomNode.find('.ffp-feed-'+_scope+'-items .ffp-feed-grid .ffp-feed-grid-item.ffp-hidden'); 1327 if(newItems.length){ 1328 this.grid[_scope].masonry('appended', newItems.removeClass('ffp-hidden')); 1329 } 1330 this.grid[_scope].masonry('reloadItems'); 1331 } 1332 var images = this.grid[_scope].find('img'); 1333 1334 var imagesLoaded = 0; 1335 var imagesTotal = images.length; 1336 var imgLoaded = function(img){ 1337 imagesLoaded++; 1338 feed.grid[_scope].masonry('layout'); 1339 if(imagesLoaded>=imagesTotal){ 1340 window.setTimeout(function(){ 1341 feed.grid[_scope].masonry('layout'); 1342 }, 100); 1343 } 1344 }; 1345 images.each(function(){ 1346 if(this.complete && this.naturalWidth){ 1347 imgLoaded(this); 1348 } 1349 }); 1350 if(imagesLoaded<imagesTotal){ 1351 images.on('load',function(){ 1352 if(this.complete && this.naturalWidth){ 1353 imgLoaded(this); 1354 } 1355 }); 1356 } 1357 this.jqDomNode.trigger('FFPLayout'); 1358 }, 1359 1360 showInPopup: function(_item, _scope){ 1361 var skipTypes = ["video", "video_embeded", "video_live", "video_youtube", "video_inline"]; 1362 if(this.getParamValue('cfg_display_mode')=='download' && skipTypes.indexOf(_item.type)>=0){ 1363 console.info(_item); 1364 return true; 1365 } 1366 var items = (_scope=='albumphotos'?this.currentAlbum.photos:this[_scope]); 1367 var _items = ko_lib.observableArray(); 1368 if(this.getParamValue('cfg_display_mode')=='download'){ 1369 for(var i=0;i<items().length;i++){ 1370 if(skipTypes.indexOf(items()[i]['type'])<0){ 1371 _items.push(items()[i]); 1372 } 1373 } 1374 } 1375 else{ 1376 _items = items; 1377 } 1378 this.popup.show(_item, _items); 1379 return false; 1380 }, 1381 1382 shareLink: function(_link){ 1383 window.open("https://www.facebook.com/sharer/sharer.php?u="+_link, "facebook", "width=600px,height=600px,menubar=no,toolbar=no,resizable=yes,scrollbars=yes"); 1384 return false; 1385 }, 1386 1387 getColsForWidth: function(_width, _scope){ 1388 if(_scope=='albumphotos'){ 1389 _scope = 'photos'; 1390 } 1391 _width = parseInt(_width); 1392 var cols = this.getParamValue(_scope+'_layout_cols',3); 1393 var respBreakpoints = this.getRespBreakpoints(_scope); 1394 var setCols = 9; 1395 for(var _w in respBreakpoints){ 1396 setCols = respBreakpoints[_w]; 1397 if(_width<=parseInt(_w) && setCols<=cols){ 1398 cols = setCols; 1399 } 1400 } 1401 return cols; 1402 }, 1403 1404 getRespBreakpoints: function(_scope){ 1405 var result = {}; 1406 var cfgStr = this.getParamValue(_scope+'_layout_responsive_cfg',''); 1407 var cfgItems = cfgStr.split('|'); 1408 for(var i=0;i<cfgItems.length;i++){ 1409 var rItem = cfgItems[i]; 1410 if(!/^\d+\:\d+$/.test(rItem)){ 1411 continue; 1412 } 1413 rItem = rItem.split(':'); 1414 result[rItem[0]] = rItem[1]; 1415 } 1416 return result; 1417 }, 1418 1419 getLikesCount: function(){ 1420 var likes = parseInt(this.data()['likes']);
1421 return likes.toLocaleString('en', {minimumFractionDigits: 0, maximumFractionDigits:0}); 1422 }, 1423 1424 getCSSFeedID: function(){ 1425 return 'ffp-feed-'+this.getConfigValue('id'); 1426 }, 1427 1428 getCSSWidth: function(){ 1429 var width = this.getParamValue('main_display_width',null); 1430 if(width===null){ 1431 return 'none'; 1432 } 1433 if(/^\d+$/.test(width)){ 1434 width+= 'px'; 1435 } 1436 else if(width=='' || width=='auto'){ 1437 width = 'none'; 1438 } 1439 return width; 1440 }, 1441 1442 getCSSHeight: function(){ 1443 var height = this.getParamValue('main_display_height',null); 1444 if(height===null){ 1445 return 'none'; 1446 } 1447 if(/^\d+$/.test(height)){ 1448 height+= 'px'; 1449 } 1450 else if(height=='' || height=='auto'){ 1451 height = 'none'; 1452 } 1453 if(height.substr(-2)=='px'){ 1454 var headerHeight = 0; 1455 var menuHeight = 0; 1456 if(this.getParamValue('main_header_show')){ 1457 headerHeight = $('#'+this.getCSSFeedID()+' .ffp-feed-header').height(); 1458 } 1459 if(this.getParamValue('main_menu_show')){ 1460 menuHeight = $('#'+this.getCSSFeedID()+' .ffp-feed-menu').height(); 1461 } 1462 var contentHeight = parseInt(height.slice(0,-2))-headerHeight-menuHe
1462ight; 1463 if(contentHeight>0){ 1464 height = contentHeight+'px'; 1465 } 1466 } 1467 return height; 1468 }, 1469 1470 beforeRender: function(){ 1471 this.switchDefaultView(); 1472 }, 1473 1474 switchDefaultView: function(){ 1475 if(this.getParamValue('posts_show')){ 1476 this.view('posts'); 1477 } 1478 else if(this.getParamValue('photos_show')){ 1479 this.view('photos'); 1480 } 1481 else if(this.getParamValue('videos_show')){ 1482 this.view('videos'); 1483 } 1484 else{ 1485 this.view(''); 1486 } 1487 }, 1488 1489 afterRender: function(){ 1490 var feed = this; 1491 this.popup.prepare(); 1492 1493 if(this.getConfigValue('alldata_uri')){ 1494 this.allDataLoading(true); 1495 $.ajax({ 1496 url: this.getConfigValue('alldata_uri')+'&id='+this.getConfigValue('id'), 1497 method: "GET", 1498 dataType: 'json', 1499 success: function(_data){ 1500 if(_data && _data.status && _data.status=='success'){ 1501 for(var _scope in _data.scopes){ 1502 feed.allDataLoading(false); 1503 feed.addParams(_data.params); 1504 feed.switchDefaultView(); 1505 feed.currentPage[_scope] = 1; 1506 feed[_scope](_data.scopes[_scope]['items']); 1507 feed[_scope+'Loaded'](true); 1508 feed.haveMore[_scope](_data.scopes[_scope]['have_more']); 1509 } 1510 if(feed.getParamValue('photos_albums_show') && feed.albums().length==1){ 1511 feed.isSingleAlbum(true); 1512 feed.preloadAlbum(feed.albums()[0]); 1513 } 1514 else{ 1515 feed.isSingleAlbum(false); 1516 } 1517 } 1518 else if(_data && _data.status && _data.status=='error'){ 1519 feed.error(_data.message); 1520 } 1521 else{ 1522 feed.error(feed.__('ajax_error')); 1523 } 1524 }, 1525 error: function(xhr, type, message){ 1526 feed.error('<b>'+feed.__('ajax_error')+'</b><br><i>'+message+'</i>'); 1527 } 1528 }); 1529 } 1530 else{ 1531 this.clearAndLoad(); 1532 } 1533 1534 $(window).on('resize',function(){ 1535 feed.checkGrid(); 1536 }); 1537 1538 this.jqDomNode.on('relayout',function(){ 1539 feed.checkGrid(); 1540 }); 1541 1542 window.setInterval(function(){ 1543 feed.visible(feed.jqDomNode.is(':visible')); 1544 },100); 1545 1546 this.jqDomNode.trigger('FFPRender'); 1547 }, 1548 1549 clearAndLoad: function(_scope=''){ 1550 if(_scope=='') this.clearAndLoadData(); 1551 if(_scope=='' || _scope=='posts') this.clearAndLoadPosts(); 1552 if(_scope=='' || _scope=='photos') this.clearAndLoadPhotos(); 1553 if(_scope=='' || _scope=='albums') this.clearAndLoadAlbums(); 1554 if(_scope=='' || _scope=='videos') this.clearAndLoadVideos(); 1555 }, 1556 1557 clearAndLoadData: function(){ 1558 this.dataLoaded(false); 1559 if(this.getParamValue('main_source_id','')!=''){ 1560 this.loadData('data'); 1561 } 1562 }, 1563 1564 clearAndLoadPosts: function(){ 1565 this.postsLoaded(false); 1566 if(this.grid.posts){ 1567 this.grid.posts.masonry('destroy'); 1568 this.grid.posts = null; 1569 } 1570 this.posts([]); 1571 if(this.getParamValue('main_source_id','')==''){ 1572 return; 1573 } 1574 if(this.getParamValue('posts_show',false)){ 1575 this.loadData('posts'); 1576 } 1577 }, 1578 clearAndLoadPhotos: function(){ 1579 this.photosLoaded(false); 1580 if(this.grid.photos){ 1581 this.grid.photos.masonry('destroy'); 1582 this.grid.photos = null; 1583 } 1584 this.photos([]); 1585 if(this.getParamValue('main_source_id','')==''){ 1586 return; 1587 } 1588 if(this.getParamValue('photos_show',false)){ 1589 this.loadData('photos'); 1590 } 1591 }, 1592 clearAndLoadAlbums: function(){ 1593 this.albumsLoaded(false); 1594 if(this.grid.albumphotos){ 1595 this.grid.albumphotos.masonry('destroy'); 1596 this.grid.albumphotos = null; 1597 } 1598 this.albums([]); 1599 if(this.getParamValue('main_source_id','')==''){ 1600 return; 1601 } 1602 if(this.getParamValue('photos_albums_show',false)){ 1603 this.loadData('albums'); 1604 } 1605 }, 1606 clearAndLoadVideos: function(){ 1607 this.videosLoaded(false); 1608 if(this.grid.videos){ 1609 this.grid.videos.masonry('destroy'); 1610 this.grid.videos = null; 1611 } 1612 this.videos([]); 1613 if(this.getParamValue('main_source_id','')==''){ 1614 return; 1615 } 1616 if(this.getParamValue('videos_show',false)){ 1617 this.loadData('videos'); 1618 } 1619 }, 1620
1621 loadMorePosts: function(){ 1622 if(!this.getParamValue('posts_show',false) || !this.postsLoaded()){ 1623 return; 1624 } 1625 this.postsLoaded(false); 1626 this.loadData('posts',this.currentPage.posts+1); 1627 }, 1628 1629 loadMorePhotos: function(){ 1630 if(!this.getParamValue('photos_show',false) || !this.photosLoaded()){ 1631 return; 1632 } 1633 this.photosLoaded(false); 1634 this.loadData('photos',this.currentPage.photos+1); 1635 }, 1636 1637 loadMoreVideos: function(){ 1638 if(!this.getParamValue('videos_show',false) || !this.videosLoaded()){ 1639 return; 1640 } 1641 this.videosLoaded(false); 1642 this.loadData('videos',this.currentPage.videos+1); 1643 }, 1644 1645 loadData: function(_scope='', _page=1, _ajax_config={}){ 1646 return this._loadData(_scope, _page, _ajax_config); 1647 }, 1648 1649 _loadData: function(_scope='',_page=1, _ajax_config){ 1650 var feed = this; 1651 var requestAddStr = ''; 1652 if(_ajax_config.request_add_str){ 1653 requestAddStr = '&'+_ajax_config.request_add_str; 1654 } 1655 var ajaxConfig = { 1656 url: this.getConfigValue('ajax_url')+'&id='+this.getConfigValue('id')+'&scope='+_scope+'&page='+_page+requestAddStr, 1657 method: "GET", 1658 dataType: 'json', 1659 success: function(_data){ 1660 if(_data && _data.status && _data.status=='success'){ 1661 if(_page==1){ 1662 feed.currentPage[_scope] = 1; 1663 feed[_scope](_data[_scope]); 1664 } 1665 else{ 1666 feed.currentPage[_scope]++; 1667 for(var i=0;i<_data[_scope].length;i++){ 1668 feed[_scope].push(_data[_scope][i]); 1669 } 1670 } 1671 feed[_scope+'Loaded'](true); 1672 feed.haveMore[_scope](_data.have_more); 1673 if(_scope=='albums'){ 1674 if(feed.albums().length==1){ 1675 feed.isSingleAlbum(true); 1676 feed.preloadAlbum(feed.albums()[0]); 1677 } 1678 else{ 1679 feed.isSingleAlbum(false); 1680 } 1681 } 1682 1683 } 1684 else if(_data && _data.status && _data.status=='error'){ 1685 feed.showMessage(_data.message,'error'); 1686 } 1687 else{ 1688 feed.showMessage(feed.__('ajax_error'),'error'); 1689 } 1690 }, 1691 error: function(xhr, type, message){ 1692 feed.showMessage('<b>'+feed.__('ajax_error')+'</b><br><i>'+message+'</i>','error'); 1693 } 1694 }; 1695 $.extend(ajaxConfig,_ajax_config); 1696 $.ajax(ajaxConfig); 1697 }, 1698 1699 }); 1700 1701 return feed; 1702 1703}); 1704 1705 1706a4jRequire(["ffp_app", "ffp_feed", "jquery"], function(App, Feed, $){ 1707 $(document).ready(function(){ 1708 var configNode = $('#ffp-frontend-cfg'); 1709 if(configNode.length==0){ 1710 App.showMessage('No FFP config', 'error'); 1711 } 1712 var config = JSON.parse(configNode.html()); 1713 if(!config || typeof config.feedConfig=='undefined'){ 1714 App.showMessage('Wrong FFP config', 'error'); 1715 } 1716 1717 Feed.setTranslation(config.i18n); 1718 1719 $(".facebookfeedpro-feed").each(function(){ 1720 var node = $(this); 1721 var _feed = Feed.create($.extend({},config.feedConfig,{"id":node.attr("data-id")})); 1722 _feed.renderTo(node); 1723 }); 1724 }); 1725});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.