!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):function(){var n=t.Ractive,i=e();t.Ractive=i,i.noConflict=function(){return t.Ractive=n,i}}()}(this,function(){"use strict";function t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function e(e){for(var n=[],i=arguments.length-1;i-->0;)n[i]=arguments[i+1];for(var r=0;r<n.length;r++){var s=n[r];for(var a in s)a in e||!t(s,a)||(e[a]=s[a])}return e}function n(e){void 0===e&&(e={});var n=[];for(var i in e)t(e,i)&&n.push([i,e[i]]);return n}function i(t,e){return null===t&&null===e?!0:o(t)||o(e)?!1:t===e}function r(t){return!isNaN(parseFloat(t))&&isFinite(t)}function s(t){return t&&"[object Object]"===La.call(t)}function a(t){return!(!t||!o(t)&&!u(t))}function o(t){return"object"==typeof t}function u(t){return"function"==typeof t}function h(t){return"string"==typeof t}function l(t){return"number"==typeof t}function c(t){return void 0===t}function f(){}function d(t,e){return t.replace(/%s/g,function(){return e.shift()})}function p(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];throw t=d(t,e),new Error(t)}function m(){Va.DEBUG&&io.apply(null,arguments)}function v(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];t=d(t,e),ro(t,e)}function g(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];t=d(t,e),uo[t]||(uo[t]=!0,ro(t,e))}function y(){Va.DEBUG&&v.apply(null,arguments)}function b(){Va.DEBUG&&g.apply(null,arguments)}function w(t,e,n){var i=x(t,e,n);return i?i[t][n]:null}function x(t,e,n){for(;e;){if(n in e[t])return e;if(e.isolated)return null;e=e.parent}}function k(t,e,n,i){if(t===e)return null;if(i){var r=w("interpolators",n,i);if(r)return r(t,e)||null;p(po(i,"interpolator"))}return mo.number(t,e)||mo.array(t,e)||mo.object(t,e)||null}function _(t){return h(t)?t.replace(yo,"\\$&"):t}function E(t){return t?t.replace(vo,".$1"):""}function A(t){var e,n=[];for(t=E(t);e=go.exec(t);){var i=e.index+e[1].length;n.push(t.substr(0,i)),t=t.substr(i+1)}return n.push(t),n}function C(t){return h(t)?t.replace(bo,"$1$2"):t}function S(t,e){var n=t.indexOf(e);-1===n&&t.push(e)}function O(t,e){for(var n=0,i=t.length;i>n;n++)if(t[n]==e)return!0;return!1}function j(t,e){var n;if(!Da(t)||!Da(e))return!1;if(t.length!==e.length)return!1;for(n=t.length;n--;)if(t[n]!==e[n])return!1;return!0}function N(t){return h(t)?[t]:c(t)?[]:t}function T(t){return t[t.length-1]}function V(t,e){if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}}function M(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var n=t.concat.apply([],t),i=n.length;i--;){var r=n.indexOf(n[i]);~r&&i>r&&n.splice(i,1)}return n}function P(t){for(var e=[],n=t.length;n--;)e[n]=t[n];return e}function I(t,e){for(var n=t.length,i=0;n>i;i++){var r=e(t[i]);if(r)return r}}function R(t,e,n){var i=t,r=e;n&&(i=i.map(n),r=r.map(n));var s=i.length,a={},o=0,u=i.map(function(t){var e,n=o;do{if(e=r.indexOf(t,n),-1===e)return-1;n=e+1}while(a[e]===!0&&s>n);return e===o&&(o+=1),a[e]=!0,e}),h=u.oldLen=i.length;if(u.newLen=r.length,h===u.newLen){var l=0;for(l;h>l&&u[l]===l;l++);l===h&&(u.same=!0)}return u}function B(t,e){if(!/this/.test(t.toString()))return t;var n=wo.call(t,e);for(var i in t)n[i]=t[i];return n}function K(t,e,n){return n&&u(e)&&t.parent&&t.parent.isRoot?(t.boundValue||(t.boundValue=B(e._r_unbound||e,t.parent.ractive)),t.boundValue):e}function L(t){t.updateFromBindings(!0)}function D(t){for(var e=t.length;e--;)if(t[e].bound){var n=t[e].owner;if(n){var i="checked"===n.name?n.node.checked:n.node.value;return{value:i}}}}function F(t){if(t){var e=xo[t];xo[t]=[];for(var n=e.length;n--;)e[n]();var i=ko[t];for(ko[t]=[],n=i.length;n--;)i[n].model.register(i[n].item)}else F("early"),F("mark")}function z(t,e,n,i){t.shuffling=!0;for(var r=e.length;r--;){var s=e[r];r!==s&&r in t.childByKey&&t.childByKey[r].rebind(~s?t.joinKey(s):void 0,t.childByKey[r],!i)}var a=t.source().length!==t.source().value.length;for(t.links.forEach(function(t){return t.shuffle(e)}),n||F("early"),r=t.deps.length;r--;)t.deps[r].shuffle&&t.deps[r].shuffle(e);t[n?"marked":"mark"](),n||F("mark"),a&&t.notifyUpstream(),t.shuffling=!1}function U(t,e){e!==t.dataModel&&(e&&e.viewmodel&&e.viewmodel.isRoot&&t.childByKey.data?(t.childByKey.data.link(e.viewmodel,"data"),t.dataModel=e):t.dataModel&&(t.childByKey.data.unlink(),t.dataModel=!0))}function $(){So.push(Co=[])}function q(){var t=So.pop();return Co=So[So.length-1],t}function H(t){Co&&Co.push(t)}function Z(t){t.bind()}function W(t){t.cancel()}function G(t){t.destroyed()}function Q(t){t.handleChange()}function Y(t){t.mark()}function J(t){t.mark(!0)}function X(t){t.marked()}function tt(t){t.markedAll()}function et(t){t.render()}function nt(t){t.shuffled()}function it(t){t.teardown()}function rt(t){t.unbind()}function st(t){t.unrender()}function at(t){t.update()}function ot(t){return t.toString()}function ut(t){return t.toString(!0)}function ht(t,e,n,i){var r=t.r||t;if(!r||!h(r))return e;if("."===r||"@"===r[0]||(e||n).isKey||(e||n).isKeypath)return e;var s=r.split("/"),a=A(s[s.length-1]),o=a[a.length-1],u=e||n;u&&1===a.length&&o!==u.key&&i&&(a=lt(o,i)||a);for(var l=a.length,c=!0,f=!1;u&&l--;)u.shuffling&&(f=!0),a[l]!=u.key&&(c=!1),u=u.parent;return!e&&c&&f?n:e&&!c&&f?n:e}function lt(t,e){for(;e;){var n=e.aliases;if(n&&n[t]){for(var i=(e.owner.iterations?e.owner:e).owner.template.z,r=0;r<i.length;r++)if(i[r].n===t){var s=i[r].x;if(!s.r)return!1;var a=s.r.split("/");return A(a[a.length-1])}return}e=e.componentParent||e.parent}}function ct(t,e){void 0===e&&(e=0);for(var n=new Array(e);e--;)n[e]="_"+e;return new Function([],"return function ("+n.join(",")+"){return("+t+");};")()}function ft(t,e){return No[t]?No[t]:No[t]=Be(t,e)}function dt(t){if(t){var e=t.e;e&&Ka(e).forEach(function(t){No[t]||(No[t]=e[t])})}}function pt(t){if(!t.matchString("="))return null;var e=t.pos;t.sp();var n=t.matchPattern(Tu);if(!n)return t.pos=e,null;if(!t.matchPattern(Vu))return null;var i=t.matchPattern(Tu);return i?(t.sp(),t.matchString("=")?[n,i]:(t.pos=e,null)):(t.pos=e,null)}function mt(t){var e;return(e=t.matchPattern(Mu))?{t:au,v:e}:null}function vt(t){return t.replace(Pu,"\\$&")}function gt(t,e){return t.search(Iu[e.join()]||(Iu[e.join()]=new RegExp(e.map(vt).join("|"))))}function yt(t){return t.replace(Du,function(t,e){var n;return n="#"!==e[0]?Ku[e]:"x"===e[1]?parseInt(e.substring(2),16):parseInt(e.substring(1),10),n?zu(wt(n)):t})}function bt(t){return t.replace(qu,"&amp;").replace(Uu,"&lt;").replace($u,"&gt;")}function wt(t){return t?10===t?32:128>t?t:159>=t?Lu[t-128]:55296>t?t:57343>=t?Hu:65535>=t?t:Fu?t>=65536&&131071>=t?t:t>=131072&&196607>=t?t:Hu:Hu:Hu}function xt(t){var e;return(e=t.matchPattern(Gu))?{t:eu,v:e}:null}function kt(t){var e=t.remaining();return"true"===e.substr(0,4)?(t.pos+=4,{t:su,v:"true"}):"false"===e.substr(0,5)?(t.pos+=5,{t:su,v:"false"}):null}function _t(t){return function(e){for(var n,i='"',r=!1;!r;)n=e.matchPattern(Qu)||e.matchPattern(Yu)||e.matchString(t),n?i+='"'===n?'\\"':"\\'"===n?"'":n:(n=e.matchPattern(Ju),n?i+="\\u"+("000"+n.charCodeAt(1).toString(16)).slice(-4):r=!0);return i+='"',JSON.parse(i)}}function Et(t){var e=t.pos,n=t.matchString("'")||t.matchString('"');if(n){var i=("'"===n?Xu:th)(t);return t.matchString(n)?{t:nu,v:i}:(t.pos=e,null)}return null}function At(t){return JSON.parse('"'+t.replace(nh,Ct)+'"')}function Ct(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"	":return"\\t";case"\b":return"\\b";case"\f":return"\\f"}}function St(t){if(!t.matchString("`"))return null;for(var e,n="",i=!1,r=[];!i;)if(e=t.matchPattern(eh)||t.matchPattern(Yu)||t.matchString("$")||t.matchString('"'))if('"'===e)n+='\\"';else if("\\`"===e)n+="`";else if("$"===e)if(t.matchString("{")){r.push({t:nu,v:At(n)}),n="",t.sp();var s=Dt(t);s||t.error("Expected valid expression"),r.push({t:du,x:s}),t.sp(),t.matchString("}")||t.error("Expected closing '}' after interpolated expression")}else n+="$";else n+=e;else e=t.matchPattern(Ju),e?n+="\\u"+("000"+e.charCodeAt(1).toString(16)).slice(-4):i=!0;if(n.length&&r.push({t:nu,v:At(n)}),t.matchString("`")||t.error("Expected closing '`'"),1===r.length)return r[0];for(var a,o=r.pop();a=r.pop();)o={t:mu,s:"+",o:[a,o]};return{t:du,x:o}}function Ot(t){var e;return(e=Et(t))?oh.test(e.v)?e.v:'"'+e.v.replace(/"/g,'\\"')+'"':(e=xt(t))?e.v:(e=t.matchPattern(ih))?e:null}function jt(t){var e,n=t.pos;t.sp();var i="'"!==t.nextChar()&&'"'!==t.nextChar();i&&(e=t.matchPattern(rh));var r=e?Dt(t):Ot(t);if(null===r)return t.pos=n,null;if(t.sp(),i&&(","===t.nextChar()||"}"===t.nextChar())){e||ih.test(r)||t.error("Expected a valid reference, but found '"+r+"' instead.");var s={t:uu,k:r,v:{t:hu,n:r}};return e&&(s.p=!0),s}if(!t.matchString(":"))return t.pos=n,null;t.sp();var a=Dt(t);return null===a?(t.pos=n,null):{t:uu,k:r,v:a}}function Nt(t){var e=t.pos,n=jt(t);if(null===n)return null;var i=[n];if(t.matchString(",")){var r=Nt(t);return r?i.concat(r):(t.pos=e,null)}return i}function Tt(t){var e=t.pos;if(t.sp(),!t.matchString("{"))return t.pos=e,null;var n=Nt(t);return t.sp(),t.matchString("}")?{t:ru,m:n}:(t.pos=e,null)}function Vt(t){var e=t.pos;if(t.sp(),!t.matchString("["))return t.pos=e,null;var n=Ft(t,!0);return t.matchString("]")?{t:iu,m:n}:(t.pos=e,null)}function Mt(t){return xt(t)||kt(t)||Et(t)||St(t)||Tt(t)||Vt(t)||mt(t)}function Pt(t){var e,n,i,r,s,a=t.pos;e=t.matchPattern(lh)||"",n=!e&&t.relaxedNames&&t.matchPattern(ah)||t.matchPattern(sh);var o=e.length+(n&&n.length||0);if("@."===e&&(e="@",n=n?"this."+n:"this"),!n&&e&&(n=e,e=""),!n)return null;if("@"===e)if(ch.test(n))if(n.indexOf("event")&&n.indexOf("node")||t.inEvent){if(~n.indexOf("context"))return t.pos=t.pos-(n.length-7),{t:du,x:{t:hu,n:"@context"}}}else t.error("@event and @node are only valid references within an event directive");else t.error("Unrecognized special reference @"+n);if(!e&&!t.relaxedNames&&hh.test(n))return t.pos=a,null;if(!e&&uh.test(n))return i=uh.exec(n)[0],t.pos=a+i.length,{t:ou,v:i};if(r=(e||"")+E(n),t.matchString("("))if(s=r.lastIndexOf("."),-1!==s&&"]"!==n[n.length-1])if(0===s)r=".",t.pos=a;else{var u=r.length;r=r.substr(0,s),t.pos=a+(o-(u-s))}else t.pos-=1;return{t:hu,n:r.replace(/^this\./,"./").replace(/^this$/,".")}}function It(t){if(!t.matchString("("))return null;t.sp();var e=Dt(t);return e||t.error(Zu),t.sp(),t.matchString(")")||t.error(Wu),{t:du,x:e}}function Rt(t){return Mt(t)||Pt(t)||It(t)}function Bt(t){if(t.strictRefinement||t.sp(),t.matchString(".")){t.sp();var e=t.matchPattern(ih);if(e)return{t:lu,n:e};t.error("Expected a property name")}if(t.matchString("[")){t.sp();var n=Dt(t);return n||t.error(Zu),t.sp(),t.matchString("]")||t.error("Expected ']'"),{t:lu,x:n}}return null}function Kt(t){var e=Rt(t);if(!e)return null;for(;e;){var n=Bt(t);if(n)e={t:cu,x:e,r:n};else{if(!t.matchString("("))break;t.sp();var i=Ft(t,!0);t.sp(),t.matchString(")")||t.error(Wu),e={t:vu,x:e},i&&(e.o=i)}}return e}function Lt(t){var e=vh(t);if(!e)return null;var n=t.pos;if(t.sp(),!t.matchString("?"))return t.pos=n,e;t.sp();var i=Dt(t);i||t.error(Zu),t.sp(),t.matchString(":")||t.error('Expected ":"'),t.sp();var r=Dt(t);return r||t.error(Zu),{t:pu,o:[e,i,r]}}function Dt(t){if(t.allowExpressions===!1){var e=Pt(t);return t.sp(),e}return Lt(t)}function Ft(t,e){var n,i=[],r=t.pos;do{t.sp(),e&&(n=t.matchPattern(rh));var s=Dt(t);if(null===s&&i.length)t.error(Zu);else if(null===s)return t.pos=r,null;n&&(s.p=!0),i.push(s),t.sp()}while(t.matchString(","));return i}function zt(t,e){var n=t.pos,i=Dt(t);if(!i){var r=t.matchPattern(/^(\w+)/);return r?{t:hu,n:r}:null}for(var s=0;s<e.length;s+=1)if(t.remaining().substr(0,e[s].length)===e[s])return i;return t.pos=n,Pt(t)}function Ut(t){function e(t){for(var e=[],n=a-1;n>=0;n--)e.push("x$"+n);return e.length?"(function(){var "+e.join(",")+";return("+t+");})()":t}function n(t){if(h(t))return t;switch(t.t){case su:case ou:case eu:case au:return t.v;case nu:return JSON.stringify(String(t.v));case iu:return t.m&&$t(t.m)?"[].concat("+r(t.m,"[","]",n)+")":"["+(t.m?t.m.map(n).join(","):"")+"]";case ru:return t.m&&$t(t.m)?"Object.assign({},"+r(t.m,"{","}",i)+")":"{"+(t.m?t.m.map(function(t){return t.k+":"+n(t.v)}).join(","):"")+"}";case fu:return("typeof"===t.s?"typeof ":t.s)+n(t.o);case mu:return n(t.o[0])+("in"===t.s.substr(0,2)?" "+t.s+" ":t.s)+n(t.o[1]);case vu:if(t.o&&$t(t.o)){var e=a++;return"(x$"+e+"="+n(t.x)+").apply(x$"+e+","+n({t:iu,m:t.o})+")"}return n(t.x)+"("+(t.o?t.o.map(n).join(","):"")+")";case du:return"("+n(t.x)+")";case cu:return n(t.x)+n(t.r);case lu:return t.n?"."+t.n:"["+n(t.x)+"]";case pu:return n(t.o[0])+"?"+n(t.o[1])+":"+n(t.o[2]);case hu:return"_"+s.indexOf(t.n);default:throw new Error("Expected legal JavaScript")}}function i(t){return t.p?n(t.k):t.k+":"+n(t.v)}function r(t,e,n,i){var r=t.reduce(function(t,r){return r.p?t.str+=""+(t.open?n+",":t.str.length?",":"")+i(r):t.str+=""+(t.str.length?t.open?",":","+e:e)+i(r),t.open=!r.p,t},{open:!1,str:""});return r.open&&(r.str+=n),r.str}var s,a=0;qt(t,s=[]);var o=n(t);return{r:s,s:e(o)}}function $t(t){for(var e=0;e<t.length;e++)if(t[e].p)return!0;return!1}function qt(t,e){t.t===hu&&h(t.n)&&(~e.indexOf(t.n)||e.unshift(t.n));var n=t.o||t.m;if(n)if(s(n))qt(n,e);else for(var i=n.length;i--;)qt(n[i],e);t.k&&t.t===uu&&!h(t.k)&&qt(t.k,e),t.x&&qt(t.x,e),t.r&&qt(t.r,e),t.v&&qt(t.v,e)}function Ht(t,e){var n;if(t){for(;t.t===du&&t.x;)t=t.x;if(t.t===hu){var i=t.n;~i.indexOf("@context")?e.x=Ut(t):e.r=t.n}else(n=Zt(t))?e.rx=n:e.x=Ut(t);return e}}function Zt(t){for(var e,n=[];t.t===cu&&t.r.t===lu;)e=t.r,e.x?e.x.t===hu?n.unshift(e.x):n.unshift(Ut(e.x)):n.unshift(e.n),t=t.x;return t.t!==hu?null:{r:t.n,m:n}}function Wt(t){for(var e=[],n=0,i=0;i<t.length;i++)"-"===t[i]&&"\\"!==t[i-1]&&(e.push(t.substring(n,i).replace(Oh,"")),n=i+1);return e.push(t.substring(n).replace(Oh,"")),e}function Gt(t){var e,n,i,r;if(t.sp(),e=t.matchPattern(gh),!e)return null;for(i=e.length,n=0;n<t.tags.length;n++)~(r=e.indexOf(t.tags[n].open))&&i>r&&(i=r);return i<e.length&&(t.pos-=e.length-i,e=e.substr(0,i),!e)?null:{n:e}}function Qt(t){var e=t.pos;if(/[=\/>\s]/.test(t.nextChar())||t.error("Expected `=`, `/`, `>` or whitespace"),t.sp(),!t.matchString("="))return t.pos=e,null;t.sp();var n=t.pos,i=t.sectionDepth,r=Xt(t,"'")||Xt(t,'"')||Jt(t);return null===r&&t.error("Expected valid attribute value"),t.sectionDepth!==i&&(t.pos=n,t.error("An attribute value must contain as many opening section tags as closing section tags")),r.length?1===r.length&&h(r[0])?yt(r[0]):r:""}function Yt(t){var e,n,i=t.pos;if(e=t.matchPattern(Ah),!e)return null;var r=e,s=t.tags.map(function(t){return t.open});return-1!==(n=gt(r,s))&&(e=e.substr(0,n),t.pos=i+e.length),e}function Jt(t){t.inAttribute=!0;for(var e=[],n=re(t)||Yt(t);n;)e.push(n),n=re(t)||Yt(t);return e.length?(t.inAttribute=!1,e):null}function Xt(t,e){var n=t.pos;if(!t.matchString(e))return null;t.inAttribute=e;for(var i=[],r=re(t)||te(t,e);null!==r;)i.push(r),r=re(t)||te(t,e);return t.matchString(e)?(t.inAttribute=!1,i):(t.pos=n,null)}function te(t,e){var n=t.remaining(),i=t.tags.map(function(t){return t.open});i.push(e);var r=gt(n,i);return-1===r&&t.error("Quoted attribute value must have a closing quote"),r?(t.pos+=r,n.substr(0,r)):null}function ee(t){var e,n,i=Gt(t,!1);if(!i)return null;if(n=Eh[i.n])i.t=n.t,n.v&&(i.v=n.v),delete i.n,t.sp(),"="===t.nextChar()&&(i.f=Qt(t));else if(e=xh.exec(i.n))i.n=e[1],i.t=Su,ie(t,i);else if(e=kh.exec(i.n))i.n=e[1],i.t=Ou,ie(t,i),i.v="in-out"===e[2]?"t0":"in"===e[2]?"t1":"t2";else if(e=bh.exec(i.n))i.n=Wt(e[1]),i.t=Cu,t.matchString("(")&&(i.a=Ut({t:iu,m:Ft(t)}),t.matchString(")")||t.error("Expected closing ')'")),t.inEvent=!0,ne(t,i)?wh.test(i.f)&&(t.pos-=i.f.length,t.error("Cannot use reserved event names (change, reset, teardown, update, construct, config, init, render, unrender, complete, detach, insert, destruct, attachchild, detachchild)")):ie(t,i,!0),t.inEvent=!1;else if(e=_h.exec(i.n)){var r="bind"===e[2];i.n=r?e[3]:e[1],i.t=Zo,ie(t,i,!1,!0),!i.f&&r&&(i.f=[{t:Bo,r:e[3]}])}else{t.sp();var s="="===t.nextChar()?Qt(t):null;if(i.f=null!=s?s:i.f,t.sanitizeEventAttributes&&yh.test(i.n))return{exclude:!0};i.f=i.f||(""===i.f?"":0),i.t=Zo}return i}function ne(t,e){var n=t.pos;t.matchString("=")||t.error("Missing required directive arguments");var i=t.matchString("'")||t.matchString('"');t.sp();var r=t.matchPattern(Ch);if(void 0!==r)if(i){if(t.sp(),t.matchString(i))return(e.f=r)||!0;t.pos=n}else{if(t.matchPattern(Sh))return(e.f=r)||!0;t.pos=n}else t.pos=n}function ie(t,e,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=!1),t.sp(),!t.matchString("="))return void(n&&t.error("Missing required directive arguments"));t.sp();var r=t.matchString('"')||t.matchString("'"),s=t.spreadArgs;t.spreadArgs=!0,t.inUnquotedAttribute=!r;var a=i?zt(t,[r||" ","/",">"]):{m:Ft(t),t:iu};if(t.inUnquotedAttribute=!1,t.spreadArgs=s,r&&(t.sp(),t.matchString(r)!==r&&t.error("Expected matching quote '"+r+"'")),i){var o={t:Bo};Ht(a,o),e.f=[o]}else e.f=Ut(a)}function re(t){var e,n;if(t.interpolate[t.inside]===!1)return null;for(n=0;n<t.tags.length;n+=1)if(e=se(t,t.tags[n]))return e;return t.inTag&&!t.inAttribute&&(e=ee(t))?(t.sp(),e):void 0}function se(t,e){var n,i,r,s=t.pos;if(t.matchString("\\"+e.open)){if(0===s||"\\"!==t.str[s-1])return e.open}else if(!t.matchString(e.open))return null;if(n=pt(t))return t.matchString(e.close)?(e.open=n[0],e.close=n[1],t.sortMustacheTags(),jh):null;if(t.sp(),t.matchString("/")){t.pos-=1;var a=t.pos;if(mt(t))t.pos=a;else{if(t.pos=a-e.close.length,t.inAttribute)return t.pos=s,null;t.error("Attempted to close a section that wasn't open")}}for(r=0;r<e.readers.length;r+=1)if(i=e.readers[r],n=i(t,e))return e.isStatic&&(n.s=1),t.includeLinePositions&&(n.q=t.getLinePos(s)),n;return t.pos=s,null}function ae(t,e){var n=Dt(t);if(!n)return null;t.matchString(e.close)||t.error("Expected closing delimiter '"+e.close+"'");var i={t:Ko};return Ht(n,i),i}function oe(t,e){if(!t.matchString("&"))return null;t.sp();var n=Dt(t);if(!n)return null;t.matchString(e.close)||t.error("Expected closing delimiter '"+e.close+"'");var i={t:Ko};return Ht(n,i),i}function ue(t){var e,n=[],i=t.pos;if(t.sp(),e=he(t)){for(e.x=Ht(e.x,{}),n.push(e),t.sp();t.matchString(",");)e=he(t),e||t.error("Expected another alias."),e.x=Ht(e.x,{}),n.push(e),t.sp();return n}return t.pos=i,null}function he(t){var e=t.pos;t.sp();var n=Dt(t,[]);if(!n)return t.pos=e,null;t.sp(),t.matchPattern(Th),t.sp();var i=t.matchPattern(Nh);return i?{n:i,x:n}:(t.pos=e,null)}function le(t,e){var n,i=t.matchString(">")||t.matchString("yield"),r={t:">"===i?Uo:Qo};if(!i)return null;if(t.sp(),">"===i||!(n=t.matchString("with"))){t.relaxedNames=t.strictRefinement=!0;var s=Dt(t);if(t.relaxedNames=t.strictRefinement=!1,!s&&">"===i)return null;s&&(Ht(s,r),t.sp(),">"!==i&&(n=t.matchString("with")))}if(t.sp(),n||">"===i){if(n=ue(t),n&&n.length)r.z=n;else{var a=Dt(t);a&&(r.c={},Ht(a,r.c)),t.matchString(",")&&(n=ue(t),n&&n.length&&(r.z=n))}">"===i||r.c||r.z||t.error("Expected a context or one or more aliases")}return t.sp(),t.matchString(e.close)||t.error("Expected closing delimiter '"+e.close+"'"),r}function ce(t,e){if(!t.matchString("!"))return null;var n=t.remaining().indexOf(e.close);return-1!==n?(t.pos+=n+e.close.length,{t:$o}):void 0}function fe(t,e){var n,i,r=t.pos;try{n=zt(t,[e.close])}catch(s){i=s}if(!n){if("!"===t.str.charAt(r))return t.pos=r,null;if(i)throw i}if(!t.matchString(e.close)&&(t.error("Expected closing delimiter '"+e.close+"' after reference"),!n)){if("!"===t.nextChar())return null;t.error("Expected expression or legal reference")}var a={t:Bo};return Ht(n,a),a}function de(t,e){var n=t.pos;if(!t.matchString(e.open))return null;if(t.sp(),!t.matchString("/"))return t.pos=n,null;t.sp();var i=t.remaining(),r=i.indexOf(e.close);if(-1!==r){var s={t:Fo,r:i.substr(0,r).split(" ")[0]};return t.pos+=r,t.matchString(e.close)||t.error("Expected closing delimiter '"+e.close+"'"),s}return t.pos=n,null}function pe(t,e,n){var i=t.pos;if(!t.matchString(e.open))return null;if(!t.matchPattern(Vh[n]))return t.pos=i,null;var r={t:Mh[n]};if("elseif"===n)r.x=Dt(t);else if("catch"===n||"then"===n){var s=t.matchPattern(ih);s&&(r.n=s)}return t.matchString(e.close)||t.error("Expected closing delimiter '"+e.close+"'"),r}function me(t,e){var n,i,r,s,a,o,u,h,l,c,f,d,p,m=!1,v=t.pos;if(t.matchString("^")){if(t.matchString("^/"))return t.pos=v,null;i={t:Lo,f:[],n:yu}}else{if(!t.matchString("#"))return null;i={t:Lo,f:[]},t.matchString("partial")&&(t.pos=v-t.standardDelimiters[0].length,t.error("Partial definitions can only be at the top level of the template, or immediately inside components")),(o=t.matchString("await"))?(c=o,i.t=tu):(o=t.matchPattern(Bh))&&(c=o,i.n=Ph[o])}if(t.sp(),"with"===o){var g=ue(t);g&&(m=!0,i.z=g,i.t=Xo)}else if("each"===o){var y=he(t);y&&(i.z=[{n:y.n,x:{r:"."}}],n=y.x)}if(!m){if(n||(n=Dt(t)),n||t.error("Expected expression"),"each"===o&&t.matchString(",")){var b=ue(t);b&&(i.z&&b.unshift(i.z[0]),i.z=b)}if("each"!==o&&o||!(l=t.matchPattern(Ih)))"await"===o&&t.matchString("then")&&(t.sp(),f=!0,p=t.matchPattern(ih),p||(p=!0));else{var w;(w=t.matchPattern(Rh))?i.i=l+","+w:i.i=l}!o&&n.n&&(c=n.n)}t.sp(),t.matchString(e.close)||t.error("Expected closing delimiter '"+e.close+"'"),t.sectionDepth+=1,s=i.f;var x;do if(x=t.pos,r=de(t,e))c&&r.r!==c&&(o?(t.pos=x,t.error("Expected "+e.open+"/"+c+e.close)):r.r&&t.warn("Expected "+e.open+"/"+c+e.close+" but found "+e.open+"/"+r.r+e.close)),t.sectionDepth-=1,h=!0;else if(!m&&((r=pe(t,e,"elseif"))||(r=pe(t,e,"else"))||"await"===o&&((r=pe(t,e,"then"))||(r=pe(t,e,"catch"))))){if(i.n===yu&&t.error("{{else}} not allowed in {{#unless}}"),a&&(r.t===ku?t.error("there can only be one {{else}} block, at the end of a section"):r.t===_u&&t.error("illegal {{elseif...}} after {{else}}")),!u&&(p||!f)&&!d)if("await"===o){var k={f:s};i.f=[k],p?(k.t=Eu,p!==!0&&(k.n=p)):k.t=Lo}else u=[];var _={t:Lo,f:s=[]};r.t===ku?("await"===o?(i.f.push(_),_.t=ku):(_.n=yu,u.push(_)),a=!0):r.t===_u?(_.n=gu,Ht(r.x,_),u.push(_)):r.t===Eu?(a&&t.error("{{then}} block must appear before any {{else}} block"),d&&t.error("{{then}} block must appear before any {{catch}} block"),f&&t.error("there can only be one {{then}} block per {{#await}}"),_.t=Eu,f=!0,r.n&&(_.n=r.n),i.f.push(_)):r.t===Au&&(a&&t.error("{{catch}} block must appear before any {{else}} block"),d&&t.error("there can only be one {{catch}} block per {{#await}}"),_.t=Au,d=!0,_.n=r.n,i.f.push(_))}else{if(r=t.read(sl),!r)break;s.push(r)}while(!h);if(u&&(i.l=u),m||Ht(n,i),"await"===o&&(p||!f)&&!d&&!a){var E={f:i.f};i.f=[E],p?(E.t=Eu,p!==!0&&(E.n=p)):E.t=Lo}return i.f.length||delete i.f,i}function ve(t){var e=t.pos;if(t.textOnlyMode||!t.matchString(Kh))return null;var n=t.remaining(),i=n.indexOf(Lh);-1===i&&t.error("Illegal HTML - expected closing comment sequence ('-->')");var r=n.substr(0,i);t.pos+=i+3;var s={t:$o,c:r};return t.includeLinePositions&&(s.q=t.getLinePos(e)),s}function ge(t){var e,n,i,r,s;for(e=1;e<t.length;e+=1)n=t[e],i=t[e-1],r=t[e-2],h(n)&&ye(i)&&h(r)&&Fh.test(r)&&Dh.test(n)&&(t[e-2]=r.replace(Fh,"\n"),t[e]=n.replace(Dh,"")),be(n)&&h(i)&&Fh.test(i)&&h(n.f[0])&&Dh.test(n.f[0])&&(t[e-1]=i.replace(Fh,"\n"),n.f[0]=n.f[0].replace(Dh,"")),h(n)&&be(i)&&(s=T(i.f),h(s)&&Fh.test(s)&&Dh.test(n)&&(i.f[i.f.length-1]=s.replace(Fh,"\n"),t[e]=n.replace(Dh,"")));return t}function ye(t){return t.t===$o||t.t===qo}function be(t){return(t.t===Lo||t.t===Do)&&t.f}function we(t,e,n){var i;e&&(i=t[0],h(i)&&(i=i.replace(e,""),i?t[0]=i:t.shift())),n&&(i=T(t),h(i)&&(i=i.replace(n,""),i?t[t.length-1]=i:t.pop()))}function xe(t,e,n,i,r,s){if(!h(t)){var a,o,u,l,c,f,d;for(ge(t),a=t.length;a--;)o=t[a],o.exclude?t.splice(a,1):e&&o.t===$o&&t.splice(a,1);for(we(t,i?Uh:null,r?$h:null),a=t.length;a--;){if(o=t[a],f=d=!1,o.f){var p=o.t===zo&&(s[o.e.toLowerCase()]||s[o.e]);c=n||p,!n&&p&&we(o.f,qh,Hh),c||(u=t[a-1],l=t[a+1],(!u||h(u)&&$h.test(u))&&(f=!0),(!l||h(l)&&Uh.test(l))&&(d=!0)),xe(o.f,e,c,f,d,s)}o.l&&(xe(o.l,e,n,f,d,s),o.l.forEach(function(t){return t.l=1}),o.l.unshift(a+1,0),t.splice.apply(t,o.l),delete o.l),o.m&&(xe(o.m,e,n,f,d,s),o.m.length<1&&delete o.m)}for(a=t.length;a--;)h(t[a])&&(h(t[a+1])&&(t[a]=t[a]+t[a+1],t.splice(a+1,1)),n||(t[a]=t[a].replace(zh," ")),""===t[a]&&t.splice(a,1))}}function ke(t){var e,n=t.pos;return t.matchString("</")?(e=t.matchPattern(Zh))?t.inside&&e!==t.inside?(t.pos=n,null):{t:Wo,e:e}:(t.pos-=2,void t.error("Illegal closing tag")):null}function _e(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}function Ee(t){var e,n,i,r,s,a,o,u,l,c,f,d=t.pos;if(t.inside||t.inAttribute||t.textOnlyMode)return null;if(!t.matchString("<"))return null;if("/"===t.nextChar())return null;var p={};if(t.includeLinePositions&&(p.q=t.getLinePos(d)),t.matchString("!"))return p.t=Jo,t.matchPattern(/^doctype/i)||t.error("Expected DOCTYPE declaration"),p.a=t.matchPattern(/^(.+?)>/),p;if(f=t.matchString("#"))t.sp(),p.t=Ho,p.n=t.matchPattern(Gh);else if(p.t=zo,p.e=t.matchPattern(Wh),!p.e)return null;for(Qh.test(t.nextChar())||t.error("Illegal tag name"),t.sp(),t.inTag=!0;e=re(t);)e!==!1&&(p.m||(p.m=[]),p.m.push(e)),t.sp();if(t.inTag=!1,t.sp(),t.matchString("/")&&(n=!0),!t.matchString(">"))return null;var m=(p.e||p.n).toLowerCase(),v=t.preserveWhitespace;if(!n&&(f||!Bu[p.e.toLowerCase()])){f||(t.elementStack.push(m),m in t.interpolate&&(t.inside=m)),i=[],r=Ia(null);do{if(u=t.pos,l=t.remaining(),!l){if("script"===t.inside){o=!0;break}t.error("Missing end "+(t.elementStack.length>1?"tags":"tag")+" ("+t.elementStack.reverse().map(function(t){return"</"+t+">"}).join("")+")")}if(f||Ae(m,l))if(!f&&(c=ke(t))){o=!0;var g=c.e.toLowerCase();if(g!==m&&(t.pos=u,!~t.elementStack.indexOf(g))){var y="Unexpected closing tag";Bu[g.toLowerCase()]&&(y+=" (<"+g+"> is a void element - it cannot contain children)"),t.error(y)}}else if(f&&Ce(t,p.n))o=!0;else{var b={open:t.standardDelimiters[0],close:t.standardDelimiters[1]};de(t,b)||Se(t,b)?(o=!0,t.pos=u):(a=t.read(al))?(r[a.n]&&(t.pos=u,t.error("Duplicate partial definition")),xe(a.f,t.stripComments,v,!v,!v,t.whiteSpaceElements),r[a.n]=a.f,s=!0):(a=t.read(sl))?i.push(a):o=!0}else o=!0}while(!o);i.length&&(p.f=i),s&&(p.p=r),t.elementStack.pop()}if(t.inside=null,t.sanitizeElements&&-1!==t.sanitizeElements.indexOf(m))return Jh;if(p.m&&"input"!==m&&"select"!==m&&"textarea"!==m&&"option"!==m){for(var w,x,k,_,E,A=p.m,C=0;C<A.length;)E=A[C],E.t===Zo?0!==E.n.indexOf("class-")||E.f?0===E.n.indexOf("style-")&&h(E.f)?((x||(x=[])).push(_e(E.n.slice(6))+": "+E.f+";"),A.splice(C,1)):"class"===E.n&&h(E.f)?((w||(w=[])).push(E.f),A.splice(C,1)):"style"===E.n&&h(E.f)?((x||(x=[])).push(E.f+(Yh.test(E.f)?"":";")),A.splice(C,1)):"class"===E.n?(k=E,C++):"style"===E.n?(_=E,C++):!~E.n.indexOf(":")&&"value"!==E.n&&"contenteditable"!==E.n&&h(E.f)?(E.g=1,C++):C++:((w||(w=[])).push(E.n.slice(6)),A.splice(C,1)):C++;w?k&&h(k.f)?k.f+=" "+w.join(" "):A.unshift({t:Zo,n:"class",f:w.join(" "),g:1}):k&&h(k.f)&&(k.g=1),x?_&&h(_.f)?_.f+="; "+x.join(" "):A.unshift({t:Zo,n:"style",f:x.join(" "),g:1}):_&&h(_.f)&&(_.g=1)}return p}function Ae(t,e){var n=/^<([a-zA-Z][a-zA-Z0-9]*)/.exec(e),i=Xh[t];return n&&i?!~i.indexOf(n[1].toLowerCase()):!0}function Ce(t,e){var n=t.pos;return t.matchString("</")?(t.matchString("#"),t.sp(),t.matchString(e)?(t.sp(),t.matchString(">")?!0:(t.pos=n,null)):(t.pos=n,null)):null}function Se(t,e){var n=t.pos;if(t.matchString(e.open))return t.matchPattern(tl)?!0:void(t.pos=n)}function Oe(t){var e,n,i,r=t.remaining();return t.textOnlyMode?(n=t.tags.map(function(t){return t.open}),n=n.concat(t.tags.map(function(t){return"\\"+t.open})),e=gt(r,n)):(i=t.inside?"</"+t.inside:"<",t.inside&&!t.interpolate[t.inside]?e=r.indexOf(i):(n=t.tags.map(function(t){return t.open}),n=n.concat(t.tags.map(function(t){return"\\"+t.open})),t.inAttribute===!0?n.push('"',"'","=","<",">","`"):t.inAttribute?n.push(t.inAttribute):n.push(i),e=gt(r,n))),e?(-1===e&&(e=r.length),t.pos+=e,t.inside&&"textarea"!==t.inside||t.textOnlyMode?r.substr(0,e):yt(r.substr(0,e))):null}function je(t){var e,n,i=t.pos,r=t.standardDelimiters;if(!t.matchString(r[0]))return null;if(!t.matchPattern(el))return t.pos=i,null;var s=t.matchPattern(/^[a-zA-Z_$][a-zA-Z_$0-9\-\/]*/);s||t.error("expected legal partial name"),t.sp(),t.matchString(r[1])||t.error("Expected closing delimiter '"+r[1]+"'");var a=[],o=r[0],u=r[1];do(e=de(t,{open:o,close:u}))?("partial"!==e.r&&t.error("Expected "+o+"/partial"+u),n=!0):(e=t.read(sl),e||t.error("Expected "+o+"/partial"+u),a.push(e));while(!n);return{t:Yo,n:s,f:a}}function Ne(t){for(var e=[],n=Ia(null),i=!1,r=t.preserveWhitespace;t.pos<t.str.length;){var s=t.pos,a=void 0,o=void 0;(o=t.read(al))?(n[o.n]&&(t.pos=s,t.error("Duplicated partial definition")),xe(o.f,t.stripComments,r,!r,!r,t.whiteSpaceElements),n[o.n]=o.f,i=!0):(a=t.read(sl))?e.push(a):t.error("Unexpected template content")}var u={v:To,t:e};return i&&(u.p=n),u}function Te(t,e){Ka(t).forEach(function(n){if(Ve(n,t))return Me(t,e);var i=t[n];Pe(i)&&Te(i,e)})}function Ve(t,e){return"s"===t&&Da(e.r)}function Me(t,e){var n=t.s,i=t.r;e[n]||(e[n]=ct(n,i.length))}function Pe(t){return Da(t)||s(t)}function Ie(t,e){return new hl(t,e||{}).result}function Re(t,e,n){t||p("Missing Ractive.parse - cannot parse "+e+". "+n)}function Be(t,e){return Re(ct,"new expression function",cl),ct(t,e)}function Ke(t,e){Re(Ie,'compution string "${str}"',fl);var n=Ie(t,{expression:!0});return function(){return n.e.apply(e,n.r.map(function(t){return e.get(t)}))}}function Le(t,e,n){var i,r,s,a,l;return u(n)&&(i=B(n,t),s=n.toString(),a=!0),h(n)&&(i=Ke(n,t),s=n),o(n)&&(h(n.get)?(i=Ke(n.get,t),s=n.get):u(n.get)?(i=B(n.get,t),s=n.get.toString(),a=!0):p("`%s` computation must have a `get()` method",e),u(n.set)&&(r=B(n.set,t),l=n.set.toString())),{getter:i,setter:r,getterString:s,setterString:l,getterUseStack:a}}function De(t){!t.started||t.outros.length||t.outroChildren||(t.outrosComplete||(t.outrosComplete=!0,t.parent&&t.parent.decrementOutros(t),(!t.parent||t.parent.outrosComplete)&&t.detachNodes()),t.intros.length||t.totalChildren||(u(t.callback)&&t.callback(),t.parent&&!t.notifiedTotal&&(t.notifiedTotal=!0,t.parent.decrementTotal())))}function Fe(t){var e=t.detachQueue,n=ze(t);if(n.length){var i,r,s=e.length,a=0,o=t.detachQueue=[];t:for(;s--;){for(i=e[s].node,a=n.length;a--;)if(r=n[a].element.node,r===i||r.contains(i)||i.contains(r)){o.push(e[s]);continue t}e[s].detach()}}else t.detachNodes()}function ze(t,e){var n=e;if(n){for(var i=t.children.length;i--;)n=ze(t.children[i],n);return t.outros.length&&(n=n.concat(t.outros)),n}n=[];for(var r=t;r.parent;)r=r.parent;return ze(r,n)}function Ue(t){t.dispatch()}function $e(){var t=gl.immediateObservers;gl.immediateObservers=[],t.forEach(Ue);var e,n=gl.fragments.length;for(t=gl.fragments,gl.fragments=[];n--;)e=t[n],e.update();gl.transitionManager.ready(),t=gl.deferredObservers,gl.deferredObservers=[],t.forEach(Ue);var i=gl.tasks;for(gl.tasks=[],n=0;n<i.length;n+=1)i[n]();return gl.fragments.length||gl.immediateObservers.length||gl.deferredObservers.length||gl.tasks.length?$e():void 0}function qe(){yl.start();var t,e,n=performance.now();for(t=0;t<bl.length;t+=1)e=bl[t],e.tick(n)||bl.splice(t--,1);yl.end(),bl.length?requestAnimationFrame(qe):wl=!1}function He(e,n){var i={};if(!n)return e;n+=".";for(var r in e)t(e,r)&&(i[n+r]=e[r]);return i}function Ze(t){var e;return _l[t]||(e=t?t+".":"",_l[t]=function(n,i){var r;return h(n)?(r={},r[e+n]=i,r):o(n)?e?He(n,t):n:void 0}),_l[t]}function We(t){for(var e=[],n=0;n<t.length;n++)e[n]=(t.childByKey[n]||{}).value;return e}function Ge(t){for(var e=t;e&&!e.context&&!e.aliases;)e=e.parent;return e}function Qe(e,n){var i=e;if("."===n)return e.findContext();if("~"===n[0])return e.ractive.viewmodel.joinAll(A(n.slice(2)));if("."===n[0]||"^"===n[0]){for(var r=e,s=n.split("/"),a="^^"===s[0];r&&!r.context;)r=Ye(r);for(var o=r&&r.context;r&&"^^"===s[0];){for(s.shift(),r=r.isIteration?r.parent.parent:Ye(r);r&&!r.context;)r=Ye(r);o=r&&r.context}if(!o&&a)throw new Error("Invalid context parent reference ('"+n+"'). There is not context at that level.");
for(;"."===s[0]||".."===s[0];){var h=s.shift();".."===h&&(o=o.parent)}return n=s.join("/"),"."===n[0]&&(n=n.slice(1)),o.joinAll(A(n))}var l=A(n);if(l.length){var c=l.shift();if("@"===c[0]){if("@this"===c||"@"===c)return e.ractive.viewmodel.getRactiveModel().joinAll(l);if("@index"===c||"@key"===c){l.length&&tn(c);var f=Je(e);return f&&f["get"+("i"===c[1]?"Index":"Key")]()}if("@last"===c){var d=Je(e);return d&&d.parent.getLast()}if("@global"===c)return jl.joinAll(l);if("@shared"===c)return Ol.joinAll(l);if("@keypath"===c||"@rootpath"===c){for(var p="r"===n[1]?e.ractive.root:null,m=e;m&&(!m.context||m.isRoot&&m.ractive.component&&(p||!m.ractive.isolated));)m=m.isRoot?m.componentParent:m.parent;return m.getKeypath(p)}if("@context"===c)return new Sl(e.getContext(),"context").joinAll(l);if("@local"===c)return e.getContext()._data.joinAll(l);if("@style"===c)return e.ractive.constructor._cssModel.joinAll(l);if("@helpers"===c)return e.ractive.viewmodel.getHelpers().joinAll(l);if("@macro"===c){var v=Xe(e);return v?new Sl(v,"macro").joinAll(l):void 0}throw new Error("Invalid special reference '"+c+"'")}if(c&&!l.length){var g=e.ractive.viewmodel.getHelpers();if(g.has(c))return g.joinKey(c)}var b=Ge(e);b=b&&b.context?b.context:e.findContext();for(var w,x=!1,k=e.ractive.warnAboutAmbiguity,_=0;e;){if(e.isIteration&&(c===e.parent.keyRef?w=e.getKey():c===e.parent.indexRef&&(w=e.getIndex()),w&&l.length&&tn(c)),!w&&e.aliases&&t(e.aliases,c)&&(w=e.aliases[c]),!w&&e.context&&e.context.has(c)&&(w=e.context.joinKey(c),x?k&&y("'"+n+"' resolved but is ambiguous and will create a mapping to a parent component."):k&&_&&y("'"+n+"' resolved but is ambiguous.")),w)return x&&(w=i.ractive.viewmodel.createLink(c,w,c,{implicit:!0})),l.length>0&&u(w.joinAll)&&(w=w.joinAll(l)),w;e.context&&!e.aliases&&(_=1),(e.componentParent||!e.parent&&e.ractive.component)&&!e.ractive.isolated?(e=e.componentParent||e.ractive.component.up,x=!0):e=e.parent}var E=i.ractive;return E.resolveInstanceMembers&&"data"!==c&&c in E?E.viewmodel.getRactiveModel().joinKey(c).joinAll(l):(k&&y("'"+n+"' is ambiguous and did not resolve."),b.joinKey(c).joinAll(l))}}function Ye(t){return t&&(!t.ractive.isolated&&t.componentParent||t.parent)}function Je(t){for(var e,n=t;!n.isIteration&&(e=Ye(n));)n=e;return n.isIteration&&n}function Xe(t){for(var e=t;e;){if(e.owner.handle)return e.owner.handle;e=Ye(e)}}function tn(t){throw new Error("An index or key reference ("+t+") cannot have child properties")}function en(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];var i=t.fragment||t._fakeFragment||(t._fakeFragment=new Tl(t));return i.getContext.apply(i,e)}function nn(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return this.ctx||(this.ctx=new Nl.Context(this)),t.unshift(Ia(this.ctx)),Pa.apply(null,t)}function rn(t){for(var e=t;e&&!e.context;)e=e.parent;return e?e:t&&t.ractive.fragment}function sn(t,e){var n=Ml,i=e&&e.deep,r=e&&e.shuffle,s=yl.start();e&&"keep"in e&&(Ml=e.keep);for(var a=t.length;a--;){var o=t[a][0],u=t[a][1],h=t[a][2];if(!o)throw yl.end(),new Error("Failed to set invalid keypath '"+h+"'");if(i)un(o,u);else if(r){var l=u,f=o.get();if(l||(l=f),c(f))o.set(l);else{if(!Da(f)||!Da(l))throw yl.end(),new Error("You cannot merge an array with a non-array");var d=hn(r);o.merge(l,d)}}else o.set(u)}return yl.end(),Ml=n,s}function an(t,e,n,i){if(!n&&("."===e[0]||"^"===e[1]))return y("Attempted to set a relative keypath from a non-relative context. You can use a context object to set relative keypaths."),[];var r=A(e),s=n||t.viewmodel;return Pl.test(e)?s.findMatches(r):s===t.viewmodel?!t.component||t.isolated||s.has(r[0])||"@"===e[0]||!e[0]||i?[s.joinAll(r)]:[Qe(t.fragment||new Tl(t),e)]:[s.joinAll(r)]}function on(e,n,i,r){var a=[];if(s(n)){var o=function(i){t(n,i)&&a.push.apply(a,an(e,i,null,r).map(function(t){return[t,n[i],i]}))};for(var u in n)o(u)}else a.push.apply(a,an(e,n,null,r).map(function(t){return[t,i,n]}));return a}function un(e,n){var i=e.get(!1,Il);if(null==i||!o(n))return e.set(n);if(!o(i))return e.set(n);for(var r in n)t(n,r)&&un(e.joinKey(r),n[r])}function hn(t){if(t===!0)return null;if(u(t))return t;if(h(t))return Rl[t]||(Rl[t]=function(e){return e[t]});throw new Error("If supplied, options.compare must be a string, function, or true")}function ln(t,e,n,i){if(!h(e)||!r(n))throw new Error("Bad arguments");var s=on(t,e,n,i&&i.isolated);return sn(s.map(function(t){var e=t[0],n=t[1],i=e.get();if(!r(n)||!r(i))throw new Error(Bl);return[e,i+n]}))}function cn(t,e,n){var i=l(e)?e:1,r=o(e)?e:n;return ln(this,t,i,r)}function fn(t){var e=Promise.resolve(t);return Ra(e,"stop",{value:f}),e}function dn(t,e){t=t||{};var n;return t.easing&&(n=u(t.easing)?t.easing:e.easing[t.easing]),{easing:n||Kl,duration:"duration"in t?t.duration:400,complete:t.complete||f,step:t.step||f,interpolator:t.interpolator}}function pn(t,e,n,r){r=dn(r,t);var s=e.get();if(i(s,n))return r.complete(r.to),fn(n);var a=k(s,n,t,r.interpolator);return a?e.animate(s,n,r,a):(yl.start(),e.set(n),yl.end(),fn(n))}function mn(t,e,n){if(o(t)){var i=Ka(t);throw new Error("ractive.animate(...) no longer supports objects. Instead of ractive.animate({\n  "+i.map(function(e){return"'"+e+"': "+t[e]}).join("\n  ")+"\n}, {...}), do\n\n"+i.map(function(e){return"ractive.animate('"+e+"', "+t[e]+", {...});"}).join("\n")+"\n")}return pn(this,this.viewmodel.joinAll(A(t)),e,n)}function vn(t,e){t.event&&t._eventQueue.push(t.event),t.event=e}function gn(t){t._eventQueue.length?t.event=t._eventQueue.pop():t.event=null}function yn(t,e){var n=e?Ll:Dl;if(n[t])return n[t];var i=t.split("."),r=[],s=!1;e&&(i.unshift("this"),s=!0);for(var a=Math.pow(2,i.length)-(e?1:0),o=0;a>o;o++){for(var u=[],h=0;h<i.length;h++)u.push(1&o>>h?"*":i[h]);r.unshift(u.join("."))}return s&&(i.length>2?r.push.apply(r,yn(t,!1)):(r.push("*"),r.push(t))),n[t]=r,r}function bn(t,e,n,i){if(void 0===i&&(i=[]),e){n.name=e,i.unshift(n);var r=t._nsSubs?yn(e,!0):["*",e];return wn(t,r,n,i,!0)}}function wn(t,e,n,i,r){void 0===r&&(r=!1);var s=!0;if(r||t._nsSubs){vn(t,n);for(var a=e.length;a--;)e[a]in t._subs&&(s=xn(t,t._subs[e[a]],n,i)&&s);gn(t)}if(t.parent&&s){if(r&&t.component){var o=t.component.name+"."+e[e.length-1];e=yn(o,!1),n&&!n.component&&(n.component=t)}s=wn(t.parent,e,n,i)}return s}function xn(t,e,n,i){var r=null,s=!1;e=e.slice();for(var a=0,o=e.length;o>a;a+=1)e[a].off||e[a].handler.apply(t,i)!==!1||(s=!0);return n&&s&&(r=n.event)&&(r.preventDefault&&r.preventDefault(),r.stopPropagation&&r.stopPropagation()),!s}function kn(t,e){return t[e._guid]||(t[e._guid]=[])}function _n(t,e){var n=kn(t.queue,e);for(t.hook.fire(e);n.length;)_n(t,n.shift());delete t.queue[e._guid]}function En(t,e){void 0===e&&(e=null);var n=[];return An(t,e,n),n}function An(t,e,n){t.isAnchor?e&&t.name!==e||n.push(t):t.items?t.items.forEach(function(t){return An(t,e,n)}):t.iterations?t.iterations.forEach(function(t){return An(t,e,n)}):t.fragment&&!t.component&&An(t.fragment,e,n)}function Cn(t,e){void 0===e&&(e=null);var n=En(t.fragment,e),i={},r=t._children.byName;n.forEach(function(t){var e=t.name;e in i||(i[e]=0);var n=i[e],s=(r[e]||[])[n];s&&s.lastBound!==t&&(s.lastBound&&s.lastBound.removeChild(s),t.addChild(s)),i[e]++})}function Sn(t){t.instance.fragment.rendered&&(t.shouldDestroy=!0,t.instance.unrender()),t.instance.el=null}function On(t,e){void 0===e&&(e={});var n,i=this._children;if(t.parent&&t.parent!==this)throw new Error("Instance "+t._guid+" is already attached to a different instance "+t.parent._guid+". Please detach it from the other instance using detachChild first.");if(t.parent)throw new Error("Instance "+t._guid+" is already attached to this instance.");var r={instance:t,ractive:this,name:e.name||t.constructor.name||"Ractive",target:e.target||!1,bubble:jn,findNextNode:Nn};if(r.nameOption=e.name,r.target){var s;(s=i.byName[r.target])||(s=[],this.set("@this.children.byName."+r.target,s)),n=e.prepend?0:void 0!==e.insertAt?e.insertAt:s.length}else r.up=this.fragment,r.external=!0;t.parent=this,t.root=this.root,t.component=r,i.push(r);var a=yl.start(),o=t.viewmodel.getRactiveModel();return o.joinKey("parent",{lastLink:!1}).link(this.viewmodel.getRactiveModel()),o.joinKey("root",{lastLink:!1}).link(this.root.viewmodel.getRactiveModel()),$l.attachchild.fire(t),r.target?(Sn(r),this.splice("@this.children.byName."+r.target,n,0,r),Cn(this,r.target)):t.isolated||t.viewmodel.attached(this.fragment),yl.end(),a.ractive=t,a.then(function(){return t})}function jn(){yl.addFragment(this.instance.fragment)}function Nn(){return this.anchor?this.anchor.findNextNode():void 0}function Tn(t,e){this.computed[t]=e,(h(e)||u(e))&&(e=this.computed[t]={get:e});var n=A(t);if(!~t.indexOf("*")){var i=n.pop();return this.viewmodel.joinAll(n).compute(i,e)}e.pattern=new RegExp("^"+n.map(function(t){return t.replace(/\*\*/g,"(.+)").replace(/\*/g,"((?:\\\\.|[^\\.])+)")}).join("\\.")+"$")}function Vn(t,e){var n=yl.start(),i=Tn.call(this,t,e);if(i){var r=A(t);1!==r.length||i.isReadonly||i.set(this.viewmodel.value[r[0]]);var s=r.reduce(function(t,e){return t&&t.childByKey[e]},this.viewmodel);s&&(s.rebind(i,s,!1),s.parent&&delete s.parent.childByKey[s.key],F())}return yl.end(),n}function Mn(){return this.isDetached?this.el:(this.el&&V(this.el.__ractive_instances__,this),this.el=this.fragment.detach(),this.isDetached=!0,$l.detach.fire(this),this.el)}function Pn(t){for(var e,n,i=this._children,r=i.length;r--;)if(i[r].instance===t){n=r,e=i[r];break}if(!e||t.parent!==this)throw new Error("Instance "+t._guid+" is not attached to this instance.");var s=yl.start();e.anchor&&e.anchor.removeChild(e),t.isolated||t.viewmodel.detached(),i.splice(n,1),e.target&&(this.splice("@this.children.byName."+e.target,i.byName[e.target].indexOf(e),1),Cn(this,e.target));var a=t.viewmodel.getRactiveModel();return a.joinKey("parent",{lastLink:!1}).unlink(),a.joinKey("root",{lastLink:!1}).link(a),t.root=t,t.parent=null,t.component=null,$l.detachchild.fire(t),yl.end(),s.ractive=t,s.then(function(){return t})}function In(t,e){var n=this;if(void 0===e&&(e={}),!this.rendered)throw new Error("Cannot call ractive.find('"+t+"') unless instance is rendered to the DOM");var i=this.fragment.find(t,e);if(i)return i;if(e.remote)for(var r=0;r<this._children.length;r++)if(n._children[r].instance.fragment.rendered&&(i=n._children[r].instance.find(t,e)))return i}function Rn(t,e){if(void 0===e&&(e={}),!this.rendered)throw new Error("Cannot call ractive.findAll('"+t+"', ...) unless instance is rendered to the DOM");return Da(e.result)||(e.result=[]),this.fragment.findAll(t,e),e.remote&&this._children.forEach(function(n){!n.target&&n.instance.fragment&&n.instance.fragment.rendered&&n.instance.findAll(t,e)}),e.result}function Bn(t,e){return!e&&o(t)&&(e=t,t=""),e=e||{},Da(e.result)||(e.result=[]),this.fragment.findAllComponents(t,e),e.remote&&this._children.forEach(function(n){!n.target&&n.instance.fragment&&n.instance.fragment.rendered&&(t&&n.name!==t||e.result.push(n.instance),n.instance.findAllComponents(t,e))}),e.result}function Kn(t,e){var n=this;void 0===e&&(e={}),o(t)&&(e=t,t="");var i=this.fragment.findComponent(t,e);if(i)return i;if(e.remote){if(!t&&this._children.length)return this._children[0].instance;for(var r=0;r<this._children.length;r++)if(!n._children[r].target){if(n._children[r].name===t)return n._children[r].instance;if(i=n._children[r].instance.findComponent(t,e))return i}}}function Ln(t){return this.container?this.container.component&&this.container.component.name===t?this.container:this.container.findContainer(t):null}function Dn(t){return this.parent?this.parent.component&&this.parent.component.name===t?this.parent:this.parent.findParent(t):null}function Fn(t,e,n){for(void 0===e&&(e=!0);t&&(t.type!==zo||n&&t.name!==n)&&(!e||t.type!==Go&&t.type!==Ho);)t=t.owner?t.owner:t.component?t.containerFragment||t.component.up:t.parent?t.parent:t.up?t.up:void 0;return t}function zn(t,e,n){var i=[],r=Un(t,e,n);if(!r)return null;var s=r.length-2-r[1],a=Math.min(t,r[0]),o=a+r[1];i.startIndex=a;var u;for(u=0;a>u;u+=1)i.push(u);for(;o>u;u+=1)i.push(-1);for(;t>u;u+=1)i.push(u+s);return 0!==s?i.touchedFrom=r[0]:i.touchedFrom=t,i}function Un(t,e,n){switch(e){case"splice":for(void 0!==n[0]&&n[0]<0&&(n[0]=t+Math.max(n[0],-t)),c(n[0])&&(n[0]=0);n.length<2;)n.push(t-n[0]);return l(n[1])||(n[1]=t-n[0]),n[1]=Math.min(n[1],t-n[0]),n;case"sort":case"reverse":return null;case"pop":return t?[t-1,1]:[0,0];case"push":return[t,0].concat(n);case"shift":return[0,t?1:0];case"unshift":return[0,0].concat(n)}}function $n(t){function e(t){for(var e=[],i=arguments.length-1;i-->0;)e[i]=arguments[i+1];return n(this.viewmodel.joinAll(A(t)),e)}function n(e,n){var i=e.get();if(!Da(i)){if(c(i)){i=[];var r=ql[t].apply(i,n),s=yl.start().then(function(){return r});return e.set(i),yl.end(),s}throw new Error("shuffle array method "+t+" called on non-array at "+e.getKeypath())}var a=zn(i.length,t,n),o=ql[t].apply(i,n),u=yl.start().then(function(){return o});return u.result=o,a?e.shuffle?e.shuffle(a):e.mark():e.set(o),yl.end(),u}return{path:e,model:n}}function qn(t,e,n){e.parent&&e.parent.wrapper&&e.parent.adapt();var i=yl.start();return e.mark(n&&n.force),e.notifyUpstream(),yl.end(),$l.update.fire(t,e),i}function Hn(t,e){var n,i;return h(t)?(i=A(t),n=e):n=t,qn(this,i?this.viewmodel.joinAll(i):this.viewmodel,n)}function Zn(e,n,i){var r=[];if(s(n))for(var a in n)t(n,a)&&r.push([Wn(e,a).model,n[a]]);else r.push([Wn(e,n).model,i]);return r}function Wn(t,e){var n=t.fragment;return h(e)?{model:Qe(n,e),instance:n.ractive}:{model:n.findContext(),instance:e}}function Gn(t,e){return t.events&&t.events.find&&t.events.find(function(t){return~t.template.n.indexOf(e)})}function Qn(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];var i;if(e[0]instanceof tc){var r=e.shift();i=Ia(r),Pa(i,r)}else i=!o(e[0])||null!==e[0]&&e[0].constructor!==Object?tc.forRactive(this):tc.forRactive(this,e.shift());return bn(this,t,i,e)}function Yn(t,e){if(!h(t))return this.viewmodel.get(!0,t);var n,i=A(t),r=i[0];return this.viewmodel.has(r)||this.component&&!this.isolated&&(n=Qe(this.fragment||new Tl(this),r)),n=this.viewmodel.joinAll(i),n.get(!0,e)}function Jn(t){h(t)&&fc&&(t=fc.call(document,t));var e;if(t){if(t._ractive)return t._ractive.proxy.getContext();if(!(e=t.__ractive_instances__))return Jn(t.parentNode);if(1===e.length)return en(e[0])}}function Xn(t,e){return t?(h(t)&&(t=this.find(t,e)),Jn(t)):en(this)}function ti(){return Ua.createDocumentFragment()}function ei(t){var e;if(t&&"boolean"!=typeof t){if(!za||!Ua||!t)return null;if(t.nodeType)return t;if(h(t)){if(e=Ua.getElementById(t),!e&&Ua.querySelector)try{e=Ua.querySelector(t)}catch(n){}if(e&&e.nodeType)return e}return t[0]&&t[0].nodeType?t[0]:null}}function ni(t){return t&&"unknown"!=typeof t.parentNode&&t.parentNode&&t.parentNode.removeChild(t),t}function ii(t){return null==t||l(t)&&isNaN(t)||!t.toString?"":""+t}function ri(t){return ii(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function si(t,e){if(!this.fragment.rendered)throw new Error("The API has changed - you must call `ractive.render(target[, anchor])` to render your Ractive instance. Once rendered you can use `ractive.insert()`.");if(t=ei(t),e=ei(e)||null,!t)throw new Error("You must specify a valid target to insert into");t.insertBefore(this.detach(),e),this.el=t,(t.__ractive_instances__||(t.__ractive_instances__=[])).push(this),this.isDetached=!1,ai(this)}function ai(t){$l.insert.fire(t),t.findAllComponents("*").forEach(function(t){ai(t.instance)})}function oi(t,e,n){var i,r=n&&(n.ractive||n.instance)||this,s=A(t);!r.viewmodel.has(s[0])&&r.component&&(i=Qe(r.component.up,s[0]),i=i.joinAll(s.slice(1)));var a=i||r.viewmodel.joinAll(s),o=this.viewmodel.joinAll(A(e),{lastLink:!1});if(ui(a,o)||ui(o,a))throw new Error("A keypath cannot be linked to itself.");var u=yl.start();return o.link(a,n&&n.keypath||t),yl.end(),u}function ui(t,e){for(var n=e;n;){if(n===t||n.owner===t)return!0;n=n.target||n.parent}}function hi(t,e){var n=e&&t.model?t.model.get():t.newValue;t.oldValue=t.oldFn?t.oldFn.call(t.oldContext,void 0,n,t.keypath):n}function li(t,e,n){var i=t.oldValues;t.oldFn?(n||(t.oldValues={}),Ka(e).forEach(function(n){var r=[i[n],e[n],n],s=t.pattern.exec(n);s&&r.push.apply(r,s.slice(1)),t.oldValues[n]=t.oldFn.apply(t.oldContext,r)})):n?Ka(e).forEach(function(t){return i[t]=e[t]}):t.oldValues=e}function ci(){return-1}function fi(t,e,n){var i,r,a=this,o=[];s(t)?(i=t,r=e||{}):u(t)?(i={"":t},r=e||{}):(i={},i[t]=e,r=n||{});var h=!1;return Ka(i).forEach(function(t){var e=i[t],n=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return h?void 0:e.apply(this,t)},s=t.split(" ");s.length>1&&(s=s.filter(function(t){return t})),s.forEach(function(t){r.keypath=t;var e=di(a,t,n,r);e&&o.push(e)})}),this._observers.push.apply(this._observers,o),{cancel:function(){return o.forEach(function(t){return t.cancel()})},isSilenced:function(){return h},silence:function(){return h=!0},resume:function(){return h=!1}}}function di(t,e,n,i){var r=A(e),s=r.indexOf("*");~s||(s=r.indexOf("**")),i.fragment=i.fragment||t.fragment;var a;if(i.fragment?~r[0].indexOf(".*")?(a=i.fragment.findContext(),s=0,r[0]=r[0].slice(1)):a=0===s?i.fragment.findContext():Qe(i.fragment,r[0]):a=t.viewmodel.joinKey(r[0]),a||(a=t.viewmodel.joinKey(r[0])),~s){var o=r.indexOf("**");return~o&&(o+1!==r.length||~r.indexOf("*"))?void b("Recursive observers may only specify a single '**' at the end of the path."):(a=a.joinAll(r.slice(1,s)),new _c(t,a,r.slice(s),n,i))}return a=a.joinAll(r.slice(1)),i.array?new Ac(t,a,n,i):new wc(t,a,n,i)}function pi(t,e,n){return s(t)||u(t)?(n=Pa(e||{},Sc),this.observe(t,n)):(n=Pa(n||{},Sc),this.observe(t,e,n))}function mi(t,e){var n=this;if(t){var i=t.split(" ").map(Oc).filter(jc);i.forEach(function(t){var i=n._subs[t];if(i&&e){var r=i.find(function(t){return t.callback===e});r&&(V(i,r),r.off=!0,t.indexOf(".")&&n._nsSubs--)}else i&&(t.indexOf(".")&&(n._nsSubs-=i.length),i.length=0)})}else this._subs={};return this}function vi(e,n){var i=this,r=o(e)?e:{};h(e)&&(r[e]=n);var s=!1,a=[],u=function(e){var n=r[e],o=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return s?void 0:n.apply(this,t)},u={callback:n,handler:o};if(t(r,e)){var h=e.split(" ").map(Oc).filter(jc);h.forEach(function(t){(i._subs[t]||(i._subs[t]=[])).push(u),t.indexOf(".")&&i._nsSubs++,a.push([t,u])})}};for(var l in r)u(l);return{cancel:function(){return a.forEach(function(t){return i.off(t[0],t[1].callback)})},isSilenced:function(){return s},silence:function(){return s=!0},resume:function(){return s=!1}}}function gi(t,e){var n=this.on(t,function(){e.apply(this,arguments),n.cancel()});return n}function yi(t,e){void 0===e&&(e={});var n=A(t);if(this.viewmodel.has(n[0])){var i=this.viewmodel.joinAll(n);if(!i.isLink)return;for(;(i=i.target)&&e.canonical!==!1&&i.isLink;);if(i)return{ractive:i.root.ractive,keypath:i.getKeypath()}}}function bi(t){Mc.push(t),Pc=!0}function wi(t){var e=ki();e&&(t||Pc)&&(Rc?e.styleSheet.cssText=xi(null):e.innerHTML=xi(null),Pc=!1)}function xi(t){var e=t?Mc.filter(function(e){return~t.indexOf(e.id)}):Mc;return e.forEach(function(t){return t.applied=!0}),e.reduce(function(t,e){return""+(t?t+"\n\n/* {"+e.id+"} */\n"+e.styles:"")},Vc)}function ki(){return Ua&&!Ic&&(Ic=Ua.createElement("style"),Ic.type="text/css",Ic.setAttribute("data-ractive-css",""),Ua.getElementsByTagName("head")[0].appendChild(Ic),Rc=!!Ic.styleSheet),Ic}function _i(t,e,n){void 0===n&&(n=[]);var i=[],r=function(t){return t.replace(Dc,function(t,e){return i[e]})};return t=t.replace(Lc,function(t){return"\x00"+(i.push(t)-1)}).replace(Kc,""),n.forEach(function(e){t=t.replace(e,function(t){return"\x00"+(i.push(t)-1)})}),e(t,r)}function Ei(t){return t.trim()}function Ai(t){return t.str}function Ci(t,e){for(var n,i=[];n=qc.exec(t);)i.push({str:n[0],base:n[1],modifiers:n[2]});for(var r=i.map(Ai),s=[],a=i.length;a--;){var o=r.slice(),u=i[a];o[a]=u.base+e+u.modifiers||"";var h=r.slice();h[a]=e+" "+h[a],s.push(o.join(" "),h.join(" "))}return s.join(", ")}function Si(t,e){var n,i='[data-ractive-css~="{'+e+'}"]';return n=Zc.test(t)?t.replace(Zc,i):_i(t,function(t,e){return t=t.replace(zc,"$&").replace(Fc,function(t,e){if(Hc.test(e))return t;var n=e.split(",").map(Ei),r=n.map(function(t){return Ci(t,i)}).join(", ")+" ";return t.replace(e,r)}).replace(Uc,""),e(t)},[$c])}function Oi(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function ji(){return Oi()+Oi()+"-"+Oi()+"-"+Oi()+"-"+Oi()+"-"+Oi()+Oi()+Oi()}function Ni(t,e,n){var i=o(t)?e:n,r=this._cssModel;r.locked=!0;var s=sn(on({viewmodel:r},t,e,!0),i);r.locked=!1;var a=yl.start();return this.extensions.forEach(function(t){var e=t._cssModel;e.mark(),e.downstreamChanged("",1)}),yl.end(),Ti(this,!i||i.apply!==!1),s.then(function(){return a})}function Ti(t,e){var n=Vi(t),i=t.extensions.map(function(t){return Ti(t,!1)}).reduce(function(t,e){return e||t},!1);if(e&&(n||i)){var r=t._cssDef;(!r||r&&r.applied)&&wi(!0)}return n||i}function Vi(t){var e=t.css;if(u(e)){var n=t._cssDef,i=Pi(t,e),r=n.transform?Si(i,n.id):i;if(n.styles!==r)return n.styles=r,!0}}function Mi(t){for(var e=t,n=[];e;)e.prototype.cssId&&n.push(e.prototype.cssId),e=e.Parent;return n}function Pi(t,e){if(h(e))return e;var n=t.cssData,i=t._cssModel,r=function(t){return i.joinAll(A(t)).get()};r.__proto__=n;var s=e.call(t,r);return h(s)?s:""}function Ii(t,e,n){var i=t.css===!0?"":h(t.css)&&!Gc.test(t.css)?ei(t.css)||t.css:t.css,r=i,s=t.cssId||ji();o(i)?(i="textContent"in i?i.textContent:i.innerHTML,r=i):u(i)&&(r=i,i=Pi(e,i));var a={transform:"noCSSTransform"in t?!t.noCSSTransform:!t.noCssTransform};Ra(e,"_cssDef",{configurable:!0,value:a}),Ra(e,"css",{get:function(){return r},set:function(t){r=t;var n=Pi(e,r),i=a.styles;a.styles=a.transform?Si(n,s):n,a.applied&&i!==a.styles&&wi(!0)}}),a.styles=a.transform?Si(i,s):i,a.id=n.cssId=s,e._cssIds.push(s),bi(e._cssDef)}function Ri(t){t&&t.constructor!==Object&&(u(t)||(o(t)?y("If supplied, options.data should be a plain JavaScript object - using a non-POJO as the root object may work, but is discouraged"):p("data option must be an object or a function, `"+t+"` is not valid")))}function Bi(){return{}}function Ki(t,e){Ri(e);var n=u(t);e||n||(e=Bi);var i=u(e);return n||i?function(){var r=i?Li(e,this):e,s=n?Li(t,this):t;return Di(r,s)}:Di(e,t)}function Li(t,e){var n=t.call(e);if(n)return o(n)||p("Data function must return an object"),n.constructor!==Object&&b("Data function returned something other than a plain JavaScript object. This might work, but is strongly discouraged"),n}function Di(t,e){if(t&&e){for(var n in e)n in t||(t[n]=e[n]);return t}return t||e}function Fi(t){var e=t._config.template;if(e&&e.fn){var n=zi(t,e.fn);return n!==e.result?(e.result=n,n):void 0}}function zi(t,e){return e.call(t,{fromId:dl.fromId,isParsed:dl.isParsed,parse:function(e,n){return void 0===n&&(n=dl.getParseOptions(t)),dl.parse(e,n)}})}function Ui(t,e){return h(t)?t=$i(t,e):(qi(t),dt(t)),t}function $i(t,e){return"#"===t[0]&&(t=dl.fromId(t)),dl.parseFor(t,e)}function qi(t){if(void 0==t)throw new Error("The template cannot be "+t+".");if(!l(t.v))throw new Error("The template parser was passed a non-string template, but the template doesn't have a version.  Make sure you're passing in the template you think you are.");if(t.v!==To)throw new Error("Mismatched template version (expected "+To+", got "+t.v+") Please ensure you are using the latest version of Ractive.js in your build process as well as in your app")}function Hi(e,n,i){if(n)for(var r in n)(i||!t(e,r))&&(e[r]=n[r])}function Zi(t,e,n){function i(){var t=Wi(i._parent,e),r="_super"in this,s=this._super;this._super=t;var a=n.apply(this,arguments);return r?this._super=s:delete this._super,a}return/_super/.test(n)?(i._parent=t,i._method=n,i):n}function Wi(t,e){if(e in t){var n=t[e];return u(n)?n:function(){return n}}return f}function Gi(t,e,n){return"options."+t+" has been deprecated in favour of options."+e+"."+(n?" You cannot specify both options, please use options."+e+".":"")}function Qi(t,e,n){if(e in t){if(n in t)throw new Error(Gi(e,n,!0));y(Gi(e,n)),t[n]=t[e]}}function Yi(t){Qi(t,"beforeInit","onconstruct"),Qi(t,"init","onrender"),Qi(t,"complete","oncomplete"),Qi(t,"eventDefinitions","events"),Da(t.adaptors)&&Qi(t,"adaptors","adapt")}function Ji(e,n,i,r,s){Yi(r);for(var a in r)if(t(uf,a)){var o=r[a];"el"!==a&&u(o)?y(a+" is a Ractive option that does not expect a function and will be ignored","init"===e?i:null):i[a]=o}if(i.append&&i.enhance)throw new Error("Cannot use append and enhance at the same time");rf.forEach(function(t){t[e](n,i,r,s)}),Bc[e](n,i,r,s),Jc[e](n,i,r,s),Qc[e](n,i,r,s),Xi(n.prototype,i,r)}function Xi(e,n,i){for(var r in i)if(!hf[r]&&t(i,r)){var s=i[r];u(s)&&((r in Dp||"on"===r.slice(0,2)&&r.slice(2)in $l&&r in n)&&!cf.test(s.toString())&&y("Overriding Ractive prototype function '"+r+"' without calling the '"+cf+"' method can be very dangerous."),s=Zi(e,r,s)),n[r]=s}}function tr(t){var e={};return t.forEach(function(t){return e[t]=!0}),e}function er(t){return h(t)?_i(t,function(t,e){return t.split(";").filter(function(t){return!!t.trim()}).map(e).reduce(function(t,e){var n=e.indexOf(":"),i=e.substr(0,n).trim();return t[i]=e.substr(n+1).trim(),t},{})}):{}}function nr(t){for(var e=t.split(mf),n=e.length;n--;)e[n]||e.splice(n,1);return e}function ir(t){var e=t.element,n=t.name;if("value"===n){if(t.interpolator&&(t.interpolator.bound=!0),"select"===e.name&&"value"===n)return e.getAttribute("multiple")?rr:sr;if("textarea"===e.name)return hr;if(null!=e.getAttribute("contenteditable"))return ar;if("input"===e.name){var i=e.getAttribute("type");if("file"===i)return f;if("radio"===i&&e.binding&&"name"===e.binding.attribute.name)return or;if(~vf.indexOf(i))return hr}return ur}var r=e.node;if(t.isTwoway&&"name"===n){if("radio"===r.type)return lr;if("checkbox"===r.type)return cr}if("style"===n)return fr;if(0===n.indexOf("style-"))return dr;if("class"===n&&(!r.namespaceURI||r.namespaceURI===dc))return pr;if(0===n.indexOf("class-"))return mr;if(t.isBoolean){var s=e.getAttribute("type");return!t.interpolator||"checked"!==n||"checkbox"!==s&&"radio"!==s||(t.interpolator.bound=!0),vr}return t.namespace&&t.namespace!==t.node.namespaceURI?yr:gr}function rr(t){var e=this.getValue();Da(e)||(e=[e]);var n=this.node.options,i=n.length;if(t)for(;i--;)n[i].selected=!1;else for(;i--;){var r=n[i],s=r._ractive?r._ractive.value:r.value;r.selected=O(e,s)}}function sr(t){var e=this.getValue();if(!this.locked){this.node._ractive.value=e;var n=this.node.options,i=n.length,r=!1;if(t)for(;i--;)n[i].selected=!1;else for(;i--;){var s=n[i],a=s._ractive?s._ractive.value:s.value;if(s.disabled&&s.selected&&(r=!0),a==e)return void(s.selected=!0)}r||(this.node.selectedIndex=-1)}}function ar(t){var e=this.getValue();this.locked||(t?this.node.innerHTML="":this.node.innerHTML=c(e)?"":e)}function or(t){var e=this.node,n=e.checked,i=this.getValue();return t?e.checked=!1:(e.value=this.node._ractive.value=i,e.checked=this.element.compare(i,this.element.getAttribute("name")),void(n&&!e.checked&&this.element.binding&&this.element.binding.rendered&&this.element.binding.group.model.set(this.element.binding.group.getValue())))}function ur(t){if(!this.locked)if(t)this.node.removeAttribute("value"),this.node.value=this.node._ractive.value=null;else{var e=this.getValue();this.node.value=this.node._ractive.value=e,this.node.setAttribute("value",ii(e))}}function hr(t){if(!this.locked)if(t)this.node._ractive.value="",this.node.removeAttribute("value");else{var e=this.getValue();this.node._ractive.value=e;var n=ii(e);this.node.value!==n&&(this.node.value=n),this.node.setAttribute("value",n)}}function lr(t){t?this.node.checked=!1:this.node.checked=this.element.compare(this.getValue(),this.element.binding.getValue())}function cr(t){var e=this,n=e.element,i=e.node,r=n.binding,s=this.getValue(),a=n.getAttribute("value");if(Da(s)){for(var o=s.length;o--;)if(n.compare(a,s[o]))return void(r.isChecked=i.checked=!0);r.isChecked=i.checked=!1}else r.isChecked=i.checked=n.compare(s,a)}function fr(t){for(var e=t?{}:er(this.getValue()||""),n=this.node.style,i=Ka(e),r=this.previous||[],s=0;s<i.length;){if(i[s]in n){var a=e[i[s]].replace("!important","");n.setProperty(i[s],a,a.length!==e[i[s]].length?"important":"")}s++}for(s=r.length;s--;)!~i.indexOf(r[s])&&r[s]in n&&n.setProperty(r[s],"","");this.previous=i}function dr(t){if(this.style||(this.style=_e(this.name.substr(6))),!t||this.node.style.getPropertyValue(this.style)===this.last){var e=t?"":ii(this.getValue()),n=e.replace("!important","");this.node.style.setProperty(this.style,n,n.length!==e.length?"important":""),this.last=this.node.style.getPropertyValue(this.style)}}function pr(t){var e=t?[]:nr(ii(this.getValue())),n=this.node.className;n=void 0!==n.baseVal?n.baseVal:n;var i=nr(n),r=this.previous||[],s=e.concat(i.filter(function(t){return!~r.indexOf(t)})).join(" ");s!==n&&(h(this.node.className)?this.node.className=s:this.node.className.baseVal=s),this.previous=e}function mr(t){var e=this.name.substr(6),n=this.node.className;n=void 0!==n.baseVal?n.baseVal:n;var i=nr(n),r=t?!1:this.getValue();this.inlineClass||(this.inlineClass=e),r&&!~i.indexOf(e)?i.push(e):!r&&~i.indexOf(e)&&i.splice(i.indexOf(e),1),h(this.node.className)?this.node.className=i.join(" "):this.node.className.baseVal=i.join(" ")}function vr(t){if(!this.locked)if(t)this.useProperty&&(this.node[this.propertyName]=!1),this.node.removeAttribute(this.propertyName);else if(this.useProperty)this.node[this.propertyName]=this.getValue();else{var e=this.getValue();e?this.node.setAttribute(this.propertyName,h(e)?e:""):this.node.removeAttribute(this.propertyName)}}function gr(t){t?this.node.getAttribute(this.name)===this.value&&this.node.removeAttribute(this.name):(this.value=ii(this.getString()),this.node.setAttribute(this.name,this.value))}function yr(t){t?this.value===this.node.getAttributeNS(this.namespace,this.name.slice(this.name.indexOf(":")+1))&&this.node.removeAttributeNS(this.namespace,this.name.slice(this.name.indexOf(":")+1)):(this.value=ii(this.getString()),this.node.setAttributeNS(this.namespace,this.name.slice(this.name.indexOf(":")+1),this.value))}function br(){return bf}function wr(t,e){if(xf.test(t))return[];var n=e?"svg":"div";return t?(yf.innerHTML="<"+n+" "+t+"></"+n+">")&&P(yf.childNodes[0].attributes):[]}function xr(t,e){for(var n=t.length;n--;)if(t[n].name===e.name)return!1;return!0}function kr(t,e){for(var n="xmlns:"+e;t;){if(t.hasAttribute&&t.hasAttribute(n))return t.getAttribute(n);t=t.parentNode}return bc[e]}function _r(){return kf}function Er(t,e,n){0===e?t.value=!0:"true"===e?t.value=!0:"false"===e||"0"===e?t.value=!1:t.value=e;var i=t.element[t.flag];return t.element[t.flag]=t.value,n&&!t.element.attributes.binding&&i!==t.value&&t.element.recreateTwowayBinding(),t.value}function Ar(t){ff.call(this,t)}function Cr(){var t=this;return this.torndown?(y("ractive.teardown() was called on a Ractive instance that was already torn down"),Promise.resolve()):(this.shouldDestroy=!0,Sr(this,function(){return t.fragment.rendered?t.unrender():Promise.resolve()}))}function Sr(t,e){t.torndown=!0,t.fragment.unbind(),t._observers.slice().forEach(W),t.el&&t.el.__ractive_instances__&&V(t.el.__ractive_instances__,t);var n=e();return $l.teardown.fire(t),n.then(function(){$l.destruct.fire(t),t.viewmodel.teardown()}),n}function Or(t,e){if(t.applyValue=function(t){this.parent.value[e]=t,t&&t.viewmodel?(this.link(t.viewmodel.getRactiveModel(),e),this._link.markedAll()):(this.link(Ia(Oo),e),this._link.markedAll())},"root"===e){var n=t.mark;t.mark=function(t){this._marking||(this._marking=!0,n.apply(this,t),this._marking=!1)}}return t.applyValue(t.parent.ractive[e],e),t._link.set=function(e){return t.applyValue(e)},t._link.applyValue=function(e){return t.applyValue(e)},t._link}function jr(t,e){t._link&&t._link.implicit&&t._link.isDetached()&&t.attach(e);for(var n in t.childByKey)if(t.value)if(n in t.value)jr(t.childByKey[n],e);else if(!t.childByKey[n]._link||t.childByKey[n]._link.isDetached()){
var i=Qe(e,n);i&&t.childByKey[n].link(i,n,{implicit:!0})}}function Nr(t){t._link&&t._link.implicit&&t.unlink();for(var e in t.childByKey)Nr(t.childByKey[e])}function Tr(t,e,i){var r=(t.constructor["_"+i]||[]).concat(n(e[i]||[])),s="on"===i?"once":i+"Once";r.forEach(function(e){var n=e[0],r=e[1];u(r)?t[i](n,r):o(r)&&u(r.handler)&&t[r.once?s:i](n,r.handler,Ia(r))})}function Vr(e,n){Va.DEBUG&&so(),Pr(e),Ir(e),Tr(e,n,"on"),!t(n,"delegate")&&e.parent&&e.parent.delegate!==e.delegate&&(e.delegate=!1),Da(n.use)&&e.use.apply(e,n.use.filter(function(t){return t.construct})),$l.construct.fire(e,n),n.onconstruct&&n.onconstruct.call(e,en(e),n);for(var i=jf.length;i--;){var r=jf[i];e[r]=Pa(Ia(e.constructor[r]||null),n[r])}for(i=Nf.length;i--;){var s=Nf[i];e[s]=Pa(Ia(e.constructor.prototype[s]),n[s])}e._attributePartial&&(e.partials["extra-attributes"]=e._attributePartial,delete e._attributePartial);var a=new Of({adapt:Mr(e,e.adapt,n),data:Yc.init(e.constructor,e,n),ractive:e});e.adapt=a.adaptors,e.viewmodel=a;for(var o in e.computed)Tn.call(e,o,e.computed[o])}function Mr(t,e,n){function i(e){return h(e)&&(e=w("adaptors",t,e),e||p(po(e,"adaptor"))),e}e=e.map(i);var r=N(n.adapt).map(i),s=[e,r];return t.parent&&!t.isolated&&s.push(t.parent.viewmodel.adaptors),M.apply(null,s)}function Pr(t){t._guid="r-"+Tf++,t._subs=Ia(null),t._nsSubs=0,t._config={},t.event=null,t._eventQueue=[],t._observers=[],t._children=[],t._children.byName={},t.children=t._children,t.component||(t.root=t,t.parent=t.container=null)}function Ir(t){var e=t.component,n=t.constructor.attributes;if(n&&e){var i=e.template,r=i.m?i.m.slice():[],s=r.filter(function(t){return t.t===Zo}).map(function(t){return t.n});n.required.forEach(function(t){~s.indexOf(t)||y("Component '"+e.name+"' requires attribute '"+t+"' to be provided")});for(var a=n.optional.concat(n.required),o=[],u=r.length;u--;){var h=r[u];h.t!==Zo||~a.indexOf(h.n)?n.mapAll||h.t!==Su&&h.t!==Ou&&h.t!==ju||o.unshift(r.splice(u,1)[0]):n.mapAll?o.unshift({t:Zo,n:h.n,f:[{t:Bo,r:"~/"+h.n}]}):o.unshift(r.splice(u,1)[0])}o.length&&(e.template={t:i.t,e:i.e,f:i.f,m:r,p:i.p}),t._attributePartial=o}}function Rr(t){this.item&&this.removeChild(this.item);var e=t.instance;t.anchor=this,t.up=this.up,t.name=t.nameOption||this.name,this.name=t.name,e.isolated||e.viewmodel.attached(this.up),this.rendered&&Kr(this,t)}function Br(t){this.item===t&&(Lr(this,t),this.name=this.template.n)}function Kr(t,e){if(t.rendered){e.shouldDestroy=!1,e.up=t.up,t.item=e,t.instance=e.instance;var n=t.up.findNextNode(t);e.instance.fragment.rendered&&e.instance.unrender(),e.partials=e.instance.partials,e.instance.partials=Pa(Ia(e.partials),e.partials,t._partials),e.instance.fragment.unbind(!0),e.instance.fragment.componentParent=t.up,e.instance.fragment.bind(e.instance.viewmodel),t.attributes.forEach(Z),t.eventHandlers.forEach(Z),t.attributes.forEach(et),t.eventHandlers.forEach(et);var i=t.up.findParentNode();ta(e.instance,i,i.contains(n)?n:null,t.occupants),e.lastBound!==t&&(e.lastBound=t)}}function Lr(t,e){t.rendered&&(e.shouldDestroy=!0,e.instance.unrender(),t.eventHandlers.forEach(st),t.attributes.forEach(st),t.eventHandlers.forEach(rt),t.attributes.forEach(rt),e.instance.el=e.instance.anchor=null,e.instance.fragment.componentParent=null,e.up=null,e.anchor=null,t.item=null,t.instance=null)}function Dr(){var t=Mf;Mf=[],t.forEach(Cn)}function Fr(t,e,n,i){void 0===i&&(i={}),e&&e.f&&e.f.s&&(t.fn=ft(e.f.s,e.f.r.length),i.register===!0&&(t.models=zr(t,e,n,i)))}function zr(t,e,n,i){return void 0===i&&(i={}),e.f.r.map(function(e,r){var s;return i.specialRef&&(s=i.specialRef(e,r))?s:(s=Qe(n,e),i.register===!0&&s.register(t),s)})}function Ur(t,e){e&&e.f&&e.f.s&&(t.models&&t.models.forEach(function(e){e&&e.unregister&&e.unregister(t)}),t.models=null)}function $r(){this._ractive.binding.handleChange()}function qr(t,e,n){var i=t+"-bindingGroup";return e[i]||(e[i]=new zf(i,e,n))}function Hr(){var t=this,e=this.bindings.filter(function(t){return t.node&&t.node.checked}).map(function(t){return t.element.getAttribute("value")}),n=[];return e.forEach(function(e){t.bindings[0].arrayContains(n,e)||n.push(e)}),n}function Zr(){$r.call(this);var t=this._ractive.binding.model.get();this.value=void 0==t?"":t}function Wr(t){var e;return function(){var n=this;e&&clearTimeout(e),e=setTimeout(function(){var t=n._ractive.binding;t.rendered&&$r.call(n),e=null},t)}}function Gr(t){return t.selectedOptions?P(t.selectedOptions):t.options?P(t.options).filter(function(t){return t.selected}):[]}function Qr(t){return Yf[t]||(Yf[t]=[])}function Yr(){var t=this.bindings.filter(function(t){return t.node.checked});return t.length>0?t[0].element.getAttribute("value"):void 0}function Jr(t){return t&&t.template.f&&1===t.template.f.length&&!t.template.f[0].s?t.template.f[0].t===Bo?!0:(t.template.f[0].t===Ko&&y("It is not possible create a binding using a triple mustache."),!1):!1}function Xr(t){var e=t.name,n=t.attributeByName;if("input"===e||"textarea"===e||"select"===e||n.contenteditable){var i=Jr(n.value),r=Jr(n.contenteditable),s=t.getAttribute("contenteditable");if((s||r)&&i)return Hf;if("input"===e){var a=t.getAttribute("type");if("radio"===a){var o=Jr(n.name),u=Jr(n.checked);return o&&u?(y("A radio input can have two-way binding on its name attribute, or its checked attribute - not both",{ractive:t.root}),Xf):o?Xf:u?Jf:null}if("checkbox"===a){var h=Jr(n.name),l=Jr(n.checked);return h&&l?Ff:h?qf:l?Ff:null}return"file"===a&&i?Wf:"number"===a&&i?Qf:"range"===a&&i?Qf:i?Zf:null}return"select"===e&&i?t.getAttribute("multiple")?Gf:td:"textarea"===e&&i?Zf:null}}function ts(t){var e=t.attributeByName.name;return"radio"===t.getAttribute("type")&&(e||{}).interpolator&&t.getAttribute("value")===e.interpolator.model.get()}function es(t){var e=t.toString();return e?" "+e:""}function ns(t){var e=t.getAttribute("xmlns");if(e)return e;if("svg"===t.name)return mc;var n=t.parent;return n?"foreignobject"===n.name?dc:n.node.namespaceURI:t.ractive.el.namespaceURI}function is(t){for(var e,n=t.type,i=t.currentTarget,r=i._ractive&&i._ractive.proxy,s=t.target,a=!0;a&&s&&s!==i;){var o=s._ractive&&s._ractive.proxy;if(o&&o.up.delegate===r&&rs(t,s,i)&&(e=o.listeners&&o.listeners[n]))for(var u=e.length,h=0;u>h;h++)a=e[h].call(s,t)!==!1&&a;s=s.parentNode||s.correspondingUseElement}return a}function rs(t,e,n){if(id&&t instanceof id)for(var i=e;i&&i!==n;){if(i.disabled)return!1;i=i.parentNode||i.correspondingUseElement}return!0}function ss(t){var e,n=this,i=this._ractive.proxy;if(i.listeners&&(e=i.listeners[t.type]))for(var r=e.length,s=0;r>s;s++)e[s].call(n,t)}function as(){var t=this._ractive.proxy;yl.start(),t.formBindings.forEach(os),yl.end()}function os(t){t.model.set(t.resetValue)}function us(t,e,n,i){if(n){var r=n[0];if(r&&3===r.nodeType){var s=r.nodeValue.indexOf(i);n.shift(),0===s?r.nodeValue.length!==i.length&&n.unshift(r.splitText(i.length)):r.nodeValue=i}else r=t.node=Ua.createTextNode(i),n[0]?e.insertBefore(r,n[0]):e.appendChild(r);t.node=r}else t.node||(t.node=Ua.createTextNode(i)),e.appendChild(t.node)}function hs(t){t.deps.length||t.refs||t.links.length||t.teardown()}function ls(t){t.base&&t.base.unregister(t.proxy),t.models&&t.models.forEach(function(e){e.unregister&&e.unregister(t)})}function cs(t){var e,n,i=t.deps.length;for(e=0;i>e;e++)n=t.deps[e],n.pathChanged&&n.pathChanged(),n.fragment&&n.fragment.pathModel&&n.fragment.pathModel.applyValue(t.getKeypath());for(i=t.children.length,e=0;i>e;e++)cs(t.children[e])}function fs(t,e){return e.r?Qe(t,e.r):e.x?new wd(t,e.x):e.rx?new _d(t,e.rx):void 0}function ds(t){Cd.call(this,t)}function ps(t){t.sp();var e=Ot(t);if(!e)return null;var n={key:e};if(t.sp(),!t.matchString(":"))return null;t.sp();var i=t.read();return i?(n.value=i.v,n):null}function ms(t,e){var n=new Rd(t,{values:e});return n.result}function vs(t){var e=t.template.f,n=t.element.instance.viewmodel,i=n.value;if(1===e.length&&e[0].t===Bo){var r=fs(t.up,e[0]),s=r.get(!1);e[0].s?!o(s)||e[0].x?n.joinKey(A(t.name)).set(s):y("Cannot copy non-computed object value from static mapping '"+t.name+"'"):(t.model=r,t.link=n.createLink(t.name,r,e[0].r,{mapping:!0}),c(s)&&!r.isReadonly&&t.name in i&&r.set(i[t.name])),r!==t.model&&r.unregister()}else t.boundFragment=new Vp({owner:t,template:e}).bind(),t.model=n.joinKey(A(t.name)),t.model.set(t.boundFragment.valueOf()),t.boundFragment.bubble=function(){Vp.prototype.bubble.call(t.boundFragment),yl.scheduleTask(function(){t.boundFragment.update(),t.model.set(t.boundFragment.valueOf())})}}function gs(t,n,i){var r=ys(t,n,i||{});if(r)return r;if(r=dl.fromId(n,{noThrow:!0})){var s=dl.parseFor(r,t);return s.p&&e(t.partials,s.p),t.partials[n]=s.t}}function ys(e,n,i){var r=xs(n,i.owner);if(r)return r;var s=x("partials",e,n);if(s){r=s.partials[n];var a;if(u(r)){if(a=r,a.styleSet)return a;a=r.bind(s),a.isOwner=t(s.partials,n),r=a.call(e,dl)}if(!r&&""!==r)return void y(fo,n,"partial","partial",{ractive:e});if(!dl.isParsed(r)){var o=dl.parseFor(r,s);o.p&&y("Partials ({{>%s}}) cannot contain nested inline partials",n,{ractive:e});var h=a?s:bs(s,n);h.partials[n]=r=o.t}return a&&(r._fn=a),r.v?r.t:r}}function bs(e,n){return t(e.partials,n)?e:ws(e.constructor,n)}function ws(e,n){return e?t(e.partials,n)?e:ws(e.Parent,n):void 0}function xs(e,n){if(n){if(n.template&&n.template.p&&!Da(n.template.p)&&t(n.template.p,e))return n.template.p[e];if(n.up&&n.up.owner)return xs(e,n.up.owner)}}function ks(t){ds.call(this,t);var e=t.template;e.t===Qo?this.yielder=1:e.t===zo&&(this.type=Uo,this.macro=t.macro)}function _s(t,e){t.partial=t.last=e,Es(t);var n={owner:t,template:t.partial};t.yielder&&(n.ractive=t.container.parent),t.fn&&(n.cssIds=t.fn._cssIds),t.fragment=new Vp(n)}function Es(t){t.template.c&&(t.partial=[{t:Lo,n:wu,f:t.partial,z:t.template.z}],Pa(t.partial[0],t.template.c),t.yielder&&(t.partial[0].y=t))}function As(t,e,n){var i=e;return Da(i)?t.partial=i:i&&o(i)?Da(i.t)?t.partial=i.t:h(i.template)&&(t.partial=js(i.template,i.template,t.ractive).t):u(i)&&i.styleSet?(t.fn=i,t.fragment&&(t.fragment.cssIds=i._cssIds)):null!=i&&(i=gs(t.ractive,""+i,t.containerFragment||t.up),i?(t.name=e,i.styleSet?(t.fn=i,t.fragment&&(t.fragment.cssIds=i._cssIds)):t.partial=i):n?t.partial=js(""+e,""+e,t.ractive).t:t.name=e),t.partial}function Cs(t){if(As(this,t,!0),!this.initing){if(this.dirtyTemplate=!0,this.fnTemplate=this.partial,!this.updating){var e=yl.start();return this.bubble(),yl.end(),e}this.bubble(),yl.promise()}}function Ss(t,e){var n=this.fragment.aliases||(this.fragment.aliases={});e?n[e]=this._data.joinAll(A(t)):n[t]=this._data}function Os(e){var n=e.fn,i=e.fragment,r=e.template=Pa({},e.template),s=e.handle=i.getContext({proxy:e,aliasLocal:Ss,name:e.template.e||e.name,attributes:{},setTemplate:Cs.bind(e),template:r,macro:n});if(r.p||(r.p={}),r.p=s.partials=Pa({},r.p),t(r.p,"content")||(r.p.content=r.f||[]),Da(n.attributes)){e._attrs={};var a=function(){this.dirty=!0,e.dirtyAttrs=!0,e.bubble()};if(Da(r.m)){var o=r.m;r.p[Dd]=r.m=o.filter(function(t){return!~n.attributes.indexOf(t.n)}),o.filter(function(t){return~n.attributes.indexOf(t.n)}).forEach(function(t){var n=new Vp({template:t.f,owner:e});n.bubble=a,n.findFirstNode=f,e._attrs[t.n]=n})}else r.p[Dd]=[]}else r.p[Dd]=r.m;e._attrs&&(Ka(e._attrs).forEach(function(t){e._attrs[t].bind()}),e.refreshAttrs()),e.initing=1,e.proxy=n.call(e.ractive,s,s.attributes)||{},e.partial||(e.partial=[]),e.fnTemplate=e.partial,e.initing=0,Es(e),i.resetTemplate(e.partial)}function js(t,e,n){var i;try{i=dl.parse(e,dl.getParseOptions(n))}catch(r){y("Could not parse partial from expression '"+t+"'\n"+r.message)}return i||{t:[]}}function Ns(t){var e,n,i=t;t:for(;i;){for(n=0;!n&&i;){if(i.owner.type===zo&&(n=i.owner),i.owner.ractive&&i.owner.ractive.delegate===!1)break t;i=i.parent||i.componentParent}if(n.delegate===!1)break t;for(e=n.delegate||n;i&&!i.iterations;){if(i.owner.ractive&&i.owner.ractive.delegate===!1)break t;i=i.parent||i.componentParent}}return e}function Ts(t,e,n,i){var r=t.context?Ms(t,e,n):void 0;e.key=n,e.index=i,e.context=r,t.source&&(e.lastValue=r&&r.get()),e.idxModel&&e.idxModel.applyValue(i),e.keyModel&&e.keyModel.applyValue(n),e.pathModel&&(e.pathModel.context=r,e.pathModel.applyValue(r.getKeypath())),e.rootModel&&(e.rootModel.context=r,e.rootModel.applyValue(r.getKeypath(e.ractive.root)));var s=e.aliases;t.aliases&&t.aliases.forEach(function(t){"."===t.x.r?s[t.n]=r:"@index"===t.x.r?s[t.n]=e.getIndex():"@key"===t.x.r?s[t.n]=e.getKey():"@keypath"===t.x.r?s[t.n]=e.getKeypath():"@rootpath"===t.x.r&&(s[t.n]=e.getKeypath(!0))})}function Vs(t,e){var n=t.context.get()||[];return e===!0?n.slice():n.map(function(t){return e.reduce(function(t,e){return t&&t[e]},t)})}function Ms(t,e,n){if(t.source){var i,r=t.source.model.get();if(r.indexOf&&~(i=r.indexOf(t.context.joinKey(n).get())))return t.source.model.joinKey(i)}return t.context.joinKey(n)}function Ps(t){return!t||Da(t)&&0===t.length||s(t)&&0===Ka(t).length}function Is(t,e){return e||Da(t)?bu:a(t)?xu:c(t)?null:gu}function Rs(t,e){var n=(t.containerFragment||t.up).findNextNode(t);if(n){var i=ti();e.render(i),n.parentNode.insertBefore(i,n)}else e.render(t.up.findParentNode())}function Bs(){Yd=!Ua[Jd]}function Ks(){Yd=!1}function Ls(){Yd=!0}function Ds(t){return t?(op.test(t)&&(t="-"+t),t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()})):""}function Fs(e,n,i){for(var r=n;r;){if(t(r,e)&&(c(i)||i?r.rendering:r.unrendering))return r[e];r=r.component&&r.component.ractive}return n[e]}function zs(t,e){var n=[];if(null==t||""===t)return n;var i,r,s;Ap&&(r=Cp[e.tagName])?(i=Us("DIV"),i.innerHTML=r[0]+t+r[1],i=i.querySelector(".x"),"SELECT"===i.tagName&&(s=i.options[i.selectedIndex])):e.namespaceURI===mc?(i=Us("DIV"),i.innerHTML='<svg class="x">'+t+"</svg>",i=i.querySelector(".x")):"TEXTAREA"===e.tagName?(i=ic("div"),"undefined"!=typeof i.textContent?i.textContent=t:i.innerHTML=t):(i=Us(e.tagName),i.innerHTML=t,"SELECT"===i.tagName&&(s=i.options[i.selectedIndex]));for(var a;a=i.firstChild;)n.push(a),i.removeChild(a);var o;if("SELECT"===e.tagName)for(o=n.length;o--;)n[o]!==s&&(n[o].selected=!1);return n}function Us(t){return Sp[t]||(Sp[t]=ic(t))}function $s(e,n){var i,r=x("components",e,n);if(r&&(i=r.components[n],i&&!i.isInstance))if(i["default"]&&i["default"].isInstance)i=i["default"];else if(!i.then&&u(i)){var s=i.bind(r);if(s.isOwner=t(r.components,n),i=s(),!i)return void y(fo,n,"component","component",{ractive:e});h(i)&&(i=$s(e,i)),i._fn=s,r.components[n]=i}return i}function qs(t,e){var n=e.template.p||{},i=e.template.e,r=Pa({},e,{template:{t:zo,e:i},macro:function(r){r.setTemplate(n["async-loading"]||[]),t.then(function(t){e.up.ractive.components[i]=t,n["async-loaded"]?(r.partials.component=[e.template],r.setTemplate(n["async-loaded"])):r.setTemplate([e.template])},function(t){n["async-failed"]?(r.aliasLocal("error","error"),r.set("@local.error",t),r.setTemplate(n["async-failed"])):r.setTemplate([])})}});return new ks(r)}function Hs(t,e,n){var i=t.f.find(function(t){return t.t===e});return i?i.n?[{t:19,n:54,f:i.f||[],z:[{n:i.n,x:{r:"__await."+n}}]}]:i.f||[]:[]}function Zs(t){var e=t.template,n=Hs(e,Eu,"value"),i=Hs(e,Au,"error"),r=Hs(e,Lo),s=Hs(e,ku),a=Pa({},t,{template:{t:zo,m:[{t:Zo,n:"for",f:[{t:Bo,r:e.r,rx:e.rx,x:e.x}]}]},macro:function(t,e){function a(e){e["for"]&&u(e["for"].then)?(t.setTemplate(r),e["for"].then(function(e){t.set("@local.value",e),t.setTemplate(n)},function(e){t.set("@local.error",e),t.setTemplate(i)})):c(e["for"])?t.setTemplate(s):(t.set("@local.value",e["for"]),t.setTemplate(n))}return t.aliasLocal("__await"),a(e),{update:a}}});return a.macro.attributes=["for"],new ks(a)}function Ws(t){if(h(t.template))return new Gd(t);var e,n,i=t.template.t;if(i===zo){if(n=t.template.e,e=x("partials",t.up.ractive,n),e&&(e=e.partials[n],e.styleSet))return t.macro=e,new ks(t);if(e=$s(t.up.ractive,n)){if(u(e.then))return qs(e,t);if(u(e))return new Vf(t,e)}return new(e=Tp[n.toLowerCase()]||nd)(t)}var r;if(i===Zo){var s=t.owner;(!s||s.type!==Ho&&s.type!==Go&&s.type!==zo)&&(s=Fn(t.up)),t.element=s,r=s.type===Go||s.type===Ho?Bd:_f}else r=Np[i];if(!r)throw new Error("Unrecognised item type "+i);return new r(t)}function Gs(t,e,n,i){return void 0===i&&(i=0),t.map(function(t){if(t.type===Ro)return t.template;if(t.fragment)return t.fragment.iterations?t.fragment.iterations.map(function(t){return Gs(t.items,e,n,i)}).join(""):Gs(t.fragment.items,e,n,i);var r=n+"-"+i++,s=t.model||t.newModel;return e[r]=s?s.wrapper?s.wrapperValue:s.get():void 0,"${"+r+"}"}).join("")}function Qs(t,e,n){void 0===n&&(n={});for(var i=0;i<t.length;i++)if(!n[t[i].n]){var r=fs(e,t[i].x);n[t[i].n]=r,r.reference()}return n}function Ys(t){var e,n=rn(this);if(t){if(this.rootModel)return this.rootModel;this.rootModel=new Fd(this.context.getKeypath(this.ractive.root),this.context,this.ractive.root),e=this.rootModel}else{if(this.pathModel)return this.pathModel;this.pathModel=new Fd(this.context.getKeypath(),this.context),e=this.pathModel}return n&&n.context&&n.getKeypath(t).registerChild(e),e}function Js(t,e,n){var i=t.viewmodel.computed;if(i)for(var r in i)r in t.viewmodel.value&&i[r]&&!i[r].isReadonly&&i[r].set(t.viewmodel.value[r]);sf.init(t.constructor,t,e),Da(e.use)&&t.use.apply(t,e.use.filter(function(t){return!t.construct})),$l.config.fire(t),$l.init.begin(t);var s=t.fragment=Xs(t,n);if(s&&s.bind(t.viewmodel),$l.init.end(t),Tr(t,e,"observe"),s){var a=t.el=t.target=ei(t.el||t.target);if(a&&!t.component){var o=t.render(a,t.append);Va.DEBUG_PROMISES&&o["catch"](function(e){throw b("Promise debugging is enabled, to help solve errors that happen asynchronously. Some browsers will log unhandled promise rejections, in which case you can safely disable promise debugging:\n  Ractive.DEBUG_PROMISES = false;"),y("An error happened during rendering",{ractive:t}),m(e),e})}}}function Xs(t,e){if(void 0===e&&(e={}),t.template){var n=[].concat(t.constructor._cssIds||[],e.cssIds||[]);return new Vp({owner:t,template:t.template,cssIds:n})}}function ta(t,e,n,i){t.rendering=!0;var r=yl.start();if(yl.scheduleTask(function(){return $l.render.fire(t)},!0),t.fragment.rendered)throw new Error("You cannot call ractive.render() on an already rendered instance! Call ractive.unrender() first");if(t.destroyed&&(t.destroyed=!1,t.fragment=Xs(t).bind(t.viewmodel)),n=ei(n)||t.anchor,t.el=t.target=e,t.anchor=n,t.cssId&&wi(),e)if((e.__ractive_instances__||(e.__ractive_instances__=[])).push(t),n){var s=Ua.createDocumentFragment();t.fragment.render(s),e.insertBefore(s,n)}else t.fragment.render(e,i);return yl.end(),t.rendering=!1,r.then(function(){t.torndown||$l.complete.fire(t)})}function ea(t,e){if(this.torndown)return y("ractive.render() was called on a Ractive instance that was already torn down"),Promise.resolve();if(t=ei(t)||this.el,!this.append&&t){var n=t.__ractive_instances__;n&&n.forEach(it),this.enhance||(t.innerHTML="")}var i=this.enhance?P(t.childNodes):null,r=ta(this,t,e,i);if(i)for(;i.length;)t.removeChild(i.pop());return r}function na(t){if(t=t||{},!o(t))throw new Error("The reset method takes either no arguments, or an object containing new data");t=Yc.init(this.constructor,this,{data:t});var e=yl.start(),n=this.viewmodel.wrapper;n&&n.reset?n.reset(t)===!1&&this.viewmodel.set(t):this.viewmodel.set(t);for(var i,r=sf.reset(this),s=r.length;s--;)if(Pp.indexOf(r[s])>-1){i=!0;break}return i&&($l.unrender.fire(this),this.fragment.resetTemplate(this.template),$l.render.fire(this),$l.complete.fire(this)),yl.end(),$l.reset.fire(this,t),e}function ia(t,e,n,i){t.forEach(function(t){if(t.type===Uo&&(t.refName===e||t.name===e))return t.inAttribute=n,void i.push(t);if(t.fragment)ia(t.fragment.iterations||t.fragment.items,e,n,i);else if(Da(t.items))ia(t.items,e,n,i);else if(t.type===Go&&t.instance){if(t.instance.partials[e])return;ia(t.instance.fragment.items,e,n,i)}t.type===zo&&Da(t.attributes)&&ia(t.attributes,e,!0,i)})}function ra(t,e){var n=[];ia(this.fragment.items,t,!1,n);var i=yl.start();return this.partials[t]=e,n.forEach(Q),yl.end(),i}function sa(t){Jc.init(null,this,{template:t});var e=this.transitionsEnabled;this.transitionsEnabled=!1;var n=this.component;n&&(n.shouldDestroy=!0),this.unrender(),n&&(n.shouldDestroy=!1);var i=yl.start();this.fragment.unbind().unrender(!0),this.fragment=new Vp({template:this.template,root:this,owner:this});var r=ti();return this.fragment.bind(this.viewmodel).render(r),n&&!n.external?this.fragment.findParentNode().insertBefore(r,n.findNextNode()):this.el.insertBefore(r,this.anchor),yl.end(),this.transitionsEnabled=e,i}function aa(t,e,n){var i=this,r=o(t)?e:n;return sn(on(i,t,e,r&&r.isolated),r)}function oa(t,e,n){var i=l(e)?-e:-1,r=o(e)?e:n;return ln(this,t,i,r)}function ua(t,e){if(!h(t))throw new TypeError(co);return sn(an(this,t,null,e&&e.isolated).map(function(t){return[t,!t.get()]}),e)}function ha(){var t=[this.cssId].concat(this.findAllComponents().map(function(t){return t.cssId})),e=Ka(t.reduce(function(t,e){return t[e]=!0,t},{}));return xi(e)}function la(){return this.fragment.toString(!0)}function ca(){return this.fragment.toString(!1)}function fa(t,e,n){e instanceof HTMLElement||s(e)&&(n=e),e=e||this.event.node,e&&e._ractive||p("No node was supplied for transition "+t),n=n||{};var i=e._ractive.proxy,r=new kp({owner:i,up:i.up,name:t,params:n});r.bind();var a=yl.start();return yl.registerTransition(r),yl.end(),a.then(function(){return r.unbind()}),a}function da(t){var e=yl.start();return this.viewmodel.joinAll(A(t),{lastLink:!1}).unlink(),yl.end(),e}function pa(){if(!this.fragment.rendered)return y("ractive.unrender() was called on a Ractive instance that was not rendered"),Promise.resolve();this.unrendering=!0;var t=yl.start();$l.unrendering.fire(this);var e=!this.component||(this.component.anchor||{}).shouldDestroy||this.component.shouldDestroy||this.shouldDestroy;return this.fragment.unrender(e),e&&(this.destroyed=!0),V(this.el.__ractive_instances__,this),$l.unrender.fire(this),yl.end(),this.unrendering=!1,t}function ma(t,e){var n=yl.start();return t?this.viewmodel.joinAll(A(t)).updateFromBindings(e!==!1):this.viewmodel.updateFromBindings(!0),yl.end(),n}function va(){for(var t=this,e=[],n=arguments.length;n--;)e[n]=arguments[n];return e.forEach(function(e){e({proto:t,Ractive:t.constructor.Ractive,instance:t})}),this}function ga(t){return t&&t instanceof this}function ya(t,e){return this._cssModel.joinAll(A(t)).get(!0,e)}function ba(t,e){if(Fp.find(function(e){return e.id===t}))throw new Error("Extra styles with the id '"+t+"' have already been added.");Fp.push({id:t,css:e}),this.css||Object.defineProperty(this,"css",{configurable:!1,writable:!1,value:wa}),this._cssDef||(Object.defineProperty(this,"_cssDef",{configurable:!0,writable:!1,value:{transform:!1,id:"Ractive.addStyle"}}),bi(this._cssDef)),Vi(this),wi(!0)}function wa(t){return Fp.map(function(e){return"\n/* ---- extra style "+e.id+" */\n"+(u(e.css)?e.css(t):e.css)}).join("")}function xa(t){return!!Fp.find(function(e){return e.id===t})}function ka(t,e,n){var i=o(t)?e:n,r=Ol;return sn(on({viewmodel:r},t,e,!0),i)}function _a(t,e){return Ol.joinAll(A(t)).get(!0,e)}function Ea(){for(var t=this,e=[],n=arguments.length;n--;)e[n]=arguments[n];return e.forEach(function(e){u(e)&&e({proto:t.prototype,Ractive:t.Ractive,instance:t})}),this}function Aa(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.length?t.reduce(Sa,this):Sa(this)}function Ca(t,e){return void 0===e&&(e={}),Sa(this,e,t)}function Sa(t,e,i){void 0===e&&(e={});var r,s=u(i)&&i;if(e.prototype instanceof Va)throw new Error("Ractive no longer supports multiple inheritance.");if(s){if(!(s.prototype instanceof t))throw new Error("Only classes that inherit the appropriate prototype may be used with extend");if(!zp.test(s.toString()))throw new Error("Only classes that call super in their constructor may be used with extend");r=s.prototype}else s=function(t){return this instanceof s?(Vr(this,t||{}),void Js(this,t||{},{})):new s(t)},r=Ia(t.prototype),r.constructor=s,s.prototype=r;if(Ba(s,{defaults:{value:r},extend:{value:Aa,writable:!0,configurable:!0},extendWith:{value:Ca,writable:!0,configurable:!0},extensions:{value:[]},use:{value:Ea},isInstance:{value:ga},Parent:{value:t},Ractive:{value:Va},styleGet:{value:ya.bind(s),configurable:!0},styleSet:{value:Ni.bind(s),configurable:!0}}),sf.extend(t,r,e,s),s._on=(t._on||[]).concat(n(e.on)),s._observe=(t._observe||[]).concat(n(e.observe)),t.extensions.push(s),e.attributes){var a;a=Da(e.attributes)?{optional:e.attributes,required:[]}:e.attributes,Da(a.required)||(a.required=[]),Da(a.optional)||(a.optional=[]),s.attributes=a}return Yc.extend(t,r,e,s),Ra(s,"helpers",{writable:!0,value:r.helpers}),Da(e.use)&&s.use.apply(s,e.use),s}function Oa(t,e){if(!u(t))throw new Error("The macro must be a function");return Pa(t,e),Ba(t,{extensions:{value:[]},_cssIds:{value:[]},cssData:{value:Pa(Ia(this.cssData),t.cssData||{})},styleGet:{value:ya.bind(t)},styleSet:{value:Ni.bind(t)}}),Ra(t,"_cssModel",{value:new Wc(t)}),t.css&&Ii(t,t,t),this.extensions.push(t),t}function ja(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.map(_).join(".")}function Na(t){return A(t).map(C)}function Ta(t,e,n){return w(e,n,t)}function Va(t){return this instanceof Va?(Vr(this,t||{}),void Js(this,t||{},{})):new Va(t)}Object.assign||(Object.assign=function(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=e.length,s=0;r>s;s++){var a=e[s];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])}return i});var Ma=Object,Pa=Ma.assign,Ia=Ma.create,Ra=Ma.defineProperty,Ba=Ma.defineProperties,Ka=Ma.keys,La=Object.prototype.toString,Da=Array.isArray;if(Array.prototype.find||Ra(Array.prototype,"find",{value:function(e,n){if(null===this||c(this))throw new TypeError("Array.prototype.find called on null or undefined");if(!u(e))throw new TypeError(e+" is not a function");for(var i=Object(this),r=i.length>>>0,s=0;r>s;s++)if(t(i,s)&&e.call(n,i[s],s,i))return i[s];return void 0},configurable:!0,writable:!0}),"undefined"!=typeof window&&window.Node&&window.Node.prototype&&!window.Node.prototype.contains&&(Node.prototype.contains=function(t){var e=this;if(!t)throw new TypeError("node required");do if(e===t)return!0;while(t=t&&t.parentNode);return!1}),"undefined"!=typeof window&&window.performance&&!window.performance.now){window.performance=window.performance||{};var Fa=Date.now();window.performance.now=function(){return Date.now()-Fa}}var za="undefined"!=typeof window?window:null,Ua=za?document:null,$a=!!Ua,qa="undefined"!=typeof global?global:za,Ha="undefined"!=typeof console&&u(console.warn)&&u(console.warn.apply),Za=Ua?Ua.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"):!1,Wa=["o","ms","moz","webkit"];if(!qa.Promise){var Ga={},Qa={},Ya={},Ja=qa.Promise=function(t){var e,n,i=[],r=[],s=Ga,a=function(t){return function(a){s===Ga&&(e=a,s=t,n=to(s===Qa?i:r,e),Xa(n))}},o=a(Qa),h=a(Ya);try{t(o,h)}catch(l){h(l)}return{then:function(t,e){var a=new Ja(function(o,h){var l=function(t,e,n){u(t)?e.push(function(e){try{eo(a,t(e),o,h)}catch(n){h(n)}}):e.push(n)};l(t,i,o),l(e,r,h),s!==Ga&&Xa(n)});return a},"catch":function(t){return this.then(null,t)},"finally":function(t){return this.then(function(e){return t(),e},function(e){throw t(),e})}}};Ja.all=function(t){return new Ja(function(e,n){var i,r,s=[];if(!t.length)return void e(s);var a=function(t,r){t&&u(t.then)?t.then(function(t){s[r]=t,--i||e(s)},n):(s[r]=t,--i||e(s))};for(i=r=t.length;r--;)a(t[r],r)})},Ja.race=function(t){return new Ja(function(e,n){function i(t){s&&(s=!1,e(t))}function r(t){s&&(s=!1,n(t))}for(var s=!0,a=0;a<t.length;a++)t[a]&&u(t[a].then)&&t[a].then(i,r)})},Ja.resolve=function(t){return t&&u(t.then)?t:new Ja(function(e){e(t)})},Ja.reject=function(t){return t&&u(t.then)?t:new Ja(function(e,n){n(t)})};var Xa=function(t){setTimeout(t,0)},to=function(t,e){return function(){for(var n=void 0;n=t.shift();)n(e)}},eo=function(t,e,n,i){var r;if(e===t)throw new TypeError("A promise's fulfillment handler cannot return the same promise");if(e instanceof Ja)e.then(n,i);else if(e&&(o(e)||u(e))){try{r=e.then}catch(s){return void i(s)}if(u(r)){var a,h=function(e){a||(a=!0,eo(t,e,n,i))},l=function(t){a||(a=!0,i(t))};try{r.call(e,h,l)}catch(s){if(!a)return i(s),void(a=!0)}}else n(e)}else n(e)}}if(!("undefined"==typeof window||window.requestAnimationFrame&&window.cancelAnimationFrame)){var no=0;window.requestAnimationFrame=function(t){var e=Date.now(),n=Math.max(0,16-(e-no)),i=window.setTimeout(function(){t(e+n)},n);return no=e+n,i},window.cancelAnimationFrame=function(t){clearTimeout(t)}}var io,ro,so,ao={el:void 0,append:!1,delegate:!0,enhance:!1,template:null,allowExpressions:!0,delimiters:["{{","}}"],tripleDelimiters:["{{{","}}}"],staticDelimiters:["[[","]]"],staticTripleDelimiters:["[[[","]]]"],csp:!0,interpolate:!1,preserveWhitespace:!1,sanitize:!1,stripComments:!0,contextLines:0,data:Ia(null),helpers:Ia(null),computed:Ia(null),syncComputedChildren:!1,resolveInstanceMembers:!1,warnAboutAmbiguity:!1,adapt:[],isolated:!0,twoway:!0,lazy:!1,noIntro:!1,noOutro:!1,transitionsEnabled:!0,complete:void 0,nestedTransitions:!0,css:null,noCSSTransform:!1},oo={linear:function(t){return t},easeIn:function(t){return Math.pow(t,3)},easeOut:function(t){return Math.pow(t-1,3)+1},easeInOut:function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)}},uo={};if(Ha){var ho=["%cRactive.js %c1.3.2 %cin debug mode, %cmore...","color: rgb(114, 157, 52); font-weight: normal;","color: rgb(85, 85, 85); font-weight: normal;","color: rgb(85, 85, 85); font-weight: normal;","color: rgb(82, 140, 224); font-weight: normal; text-decoration: underline;"],lo="You're running Ractive 1.3.2 in debug mode - messages will be printed to the console to help you fix problems and optimise your application.\n\nTo disable debug mode, add this line at the start of your app:\n  Ractive.DEBUG = false;\n\nTo disable debug mode when your app is minified, add this snippet:\n  Ractive.DEBUG = /unminified/.test(function(){/*unminified*/});\n\nGet help and support:\n  http://ractive.js.org\n  http://stackoverflow.com/questions/tagged/ractivejs\n  http://groups.google.com/forum/#!forum/ractive-js\n  http://twitter.com/ractivejs\n\nFound a bug? Raise an issue:\n  https://github.com/ractivejs/ractive/issues\n\n";so=function(){if(Va.WELCOME_MESSAGE===!1)return void(so=f);var t="WELCOME_MESSAGE"in Va?Va.WELCOME_MESSAGE:lo,e=!!console.groupCollapsed;e&&console.groupCollapsed.apply(console,ho),console.log(t),e&&console.groupEnd(ho),so=f},ro=function(t,e){if(so(),o(e[e.length-1])){var n=e.pop(),i=n?n.ractive:null;if(i){var r;i.component&&(r=i.component.name)&&(t="<"+r+"> "+t);var s;(s=n.node||i.fragment&&i.fragment.rendered&&i.find("*"))&&e.push(s)}}console.warn.apply(console,["%cRactive.js: %c"+t,"color: rgb(114, 157, 52);","color: rgb(85, 85, 85);"].concat(e))},io=function(){console.log.apply(console,arguments)}}else ro=io=so=f;var co="Bad arguments",fo='A function was specified for "%s" %s, but no %s was returned',po=function(t,e){return'Missing "'+t+'" '+e+" plugin. You may need to download a plugin via http://ractive.js.org/integrations/#"+e+"s"},mo={number:function(t,e){if(!r(t)||!r(e))return null;t=+t,e=+e;var n=e-t;return n?function(e){return t+e*n}:function(){return t}},array:function(t,e){var n,i;if(!Da(t)||!Da(e))return null;var r=[],s=[];for(i=n=Math.min(t.length,e.length);i--;)s[i]=k(t[i],e[i]);for(i=n;i<t.length;i+=1)r[i]=t[i];for(i=n;i<e.length;i+=1)r[i]=e[i];return function(t){for(var e=n;e--;)r[e]=s[e](t);return r}},object:function(e,n){if(!s(e)||!s(n))return null;var i=[],r={},a={},o=function(s){t(e,s)&&(t(n,s)?(i.push(s),a[s]=k(e[s],n[s])||function(){return n[s]}):r[s]=e[s])};for(var u in e)o(u);for(var h in n)t(n,h)&&!t(e,h)&&(r[h]=n[h]);var l=i.length;return function(t){for(var e=l;e--;){var n=i[e];r[n]=a[n](t)}return r}}},vo=/\[\s*(\*|[0-9]|[1-9][0-9]+)\s*\]/g,go=/([^\\](?:\\\\)*)\./,yo=/\\|\./g,bo=/((?:\\)+)\1|\\(\.)/g,wo=Function.prototype.bind,xo={
early:[],mark:[]},ko={early:[],mark:[]},_o={virtual:!1},Eo=function(t){this.deps=[],this.children=[],this.childByKey={},this.links=[],this.bindings=[],t&&(this.parent=t,this.root=t.root)},Ao=Eo.prototype;Ao.addShuffleTask=function(t,e){void 0===e&&(e="early"),xo[e].push(t)},Ao.addShuffleRegister=function(t,e){void 0===e&&(e="early"),ko[e].push({model:this,item:t})},Ao.downstreamChanged=function(){},Ao.findMatches=function(t){var e,n,i=t.length,r=[this],s=function(){var i=t[n];"*"===i?(e=[],r.forEach(function(t){e.push.apply(e,t.getValueChildren(t.get()))})):e=r.map(function(t){return t.joinKey(i)}),r=e};for(n=0;i>n;n+=1)s();return e},Ao.getKeypath=function(t){if(t!==this.ractive&&this._link)return this._link.target.getKeypath(t);if(!this.keypath){var e=this.parent&&this.parent.getKeypath(t);this.keypath=e?this.parent.getKeypath(t)+"."+_(this.key):_(this.key)}return this.keypath},Ao.getValueChildren=function(t){var e,n=this;Da(t)?(e=[],"length"in this&&this.length!==t.length&&e.push(this.joinKey("length")),t.forEach(function(t,i){e.push(n.joinKey(i))})):s(t)||u(t)?e=Ka(t).map(function(t){return n.joinKey(t)}):null!=t&&(e=[]);var i=this.computed;return i&&e.push.apply(e,Ka(i).map(function(t){return n.joinKey(t)})),e},Ao.getVirtual=function(t){var e=this,n=this.get(t,{virtual:!1});if(s(n)){for(var i=Da(n)?[]:Ia(null),r=Ka(n),a=r.length;a--;){var o=e.childByKey[r[a]];o?o._link?i[r[a]]=o._link.getVirtual():i[r[a]]=o.getVirtual():i[r[a]]=n[r[a]]}for(a=this.children.length;a--;){var u=e.children[a];u.key in i||!u._link||(i[u.key]=u._link.getVirtual())}if(this.computed)for(r=Ka(this.computed),a=r.length;a--;)i[r[a]]=e.computed[r[a]].get();return i}return n},Ao.has=function(t){var e=this;if(this._link)return this._link.has(t);var n=this.get(!1,_o);if(!n)return!1;if(t=C(t),(u(n)||s(n))&&t in n)return!0;var i=this.computed;return i&&t in this.computed?!0:(i=this.root.ractive&&this.root.ractive.computed,i&&Ka(i).forEach(function(t){return i[t].pattern&&i[t].pattern.test(e.getKeypath())?!0:void 0}),!1)},Ao.joinAll=function(t,e){for(var n=this,i=0;i<t.length;i+=1){if(e&&e.lastLink===!1&&i+1===t.length&&n.childByKey[t[i]]&&n.childByKey[t[i]]._link)return n.childByKey[t[i]];n=n.joinKey(t[i],e)}return n},Ao.notifyUpstream=function(t){for(var e=this,n=this.parent,i=t||[this.key];n;)n.patterns&&n.patterns.forEach(function(t){return t.notify(i.slice())}),i.unshift(n.key),n.links.forEach(function(t){return t.notifiedUpstream(i,e.root)}),n.deps.forEach(function(t){return t.handleChange(i)}),n.downstreamChanged(t),n=n.parent},Ao.rebind=function(t,e,n){var i=this;this._link&&this._link.rebind(t,e,!1);for(var r=this.deps.length;r--;)i.deps[r].rebind&&i.deps[r].rebind(t,e,n);for(r=this.links.length;r--;){var s=i.links[r];s.owner&&s.owner._link&&s.relinking(t,n)}for(r=this.children.length;r--;){var a=i.children[r];a.rebind(t?t.joinKey(a.key):void 0,a._link||a,n),i.dataModel&&i.addShuffleTask(function(){return U(i,i.retrieve())},"early")}for(r=this.bindings.length;r--;)i.bindings[r].rebind(t,e,n)},Ao.reference=function(){"refs"in this?this.refs++:this.refs=1},Ao.register=function(t){this.deps.push(t)},Ao.registerLink=function(t){S(this.links,t)},Ao.registerPatternObserver=function(t){(this.patterns||(this.patterns=[])).push(t),this.register(t)},Ao.registerTwowayBinding=function(t){this.bindings.push(t)},Ao.unreference=function(){"refs"in this&&this.refs--},Ao.unregister=function(t){V(this.deps,t)},Ao.unregisterLink=function(t){V(this.links,t)},Ao.unregisterPatternObserver=function(t){V(this.patterns,t),this.unregister(t)},Ao.unregisterTwowayBinding=function(t){V(this.bindings,t)},Ao.updateFromBindings=function(t){for(var e=this,n=this.bindings.length;n--;){var i=e.bindings[n].getValue();i!==e.value&&e.set(i)}if(!this.bindings.length){var r=D(this.deps);r&&r.value!==this.value&&this.set(r.value)}t&&(this.children.forEach(L),this.links.forEach(L),this._link&&this._link.updateFromBindings(t))};var Co,So=[],Oo={key:"@missing",animate:f,applyValue:f,get:f,getKeypath:function(){return this.key},joinAll:function(){return this},joinKey:function(){return this},mark:f,registerLink:f,shufle:f,set:f,unregisterLink:f};Oo.parent=Oo;var jo=function(e){function n(t,n,i,r){e.call(this,t),this.owner=n,this.target=i,this.key=c(r)?n.key:r,n&&n.isLink&&(this.sourcePath=n.sourcePath+"."+this.key),i&&i.registerLink(this),t&&(this.isReadonly=t.isReadonly),this.isLink=!0}e&&(n.__proto__=e);var i=n.prototype=Object.create(e&&e.prototype);return i.constructor=n,i.animate=function(t,e,n,i){return this.target.animate(t,e,n,i)},i.applyValue=function(t){this.boundValue&&(this.boundValue=null),this.target.applyValue(t)},i.attach=function(t){var e=Qe(t,this.key);e?this.relinking(e,!1):this.owner.unlink()},i.detach=function(){this.relinking(Oo,!1)},i.get=function(t,e){void 0===e&&(e={}),t&&(H(this),e.unwrap="unwrap"in e?e.unwrap:!0);var n="shouldBind"in e?e.shouldBind:!0;return e.shouldBind=this.mapping&&this.target.parent&&this.target.parent.isRoot,K(this,this.target.get(!1,e),n)},i.getKeypath=function(t){return t&&t!==this.root.ractive?this.target.getKeypath(t):e.prototype.getKeypath.call(this,t)},i.handleChange=function(){this.deps.forEach(Q),this.links.forEach(Q),this.notifyUpstream()},i.isDetached=function(){return this.virtual&&this.target===Oo},i.joinKey=function(e){if(c(e)||""===e)return this;if(!t(this.childByKey,e)){var i=new n(this,this,this.target.joinKey(e),e);this.children.push(i),this.childByKey[e]=i}return this.childByKey[e]},i.mark=function(t){this.target.mark(t)},i.marked=function(){this.boundValue&&(this.boundValue=null),this.links.forEach(X),this.deps.forEach(Q)},i.markedAll=function(){this.children.forEach(tt),this.marked()},i.notifiedUpstream=function(t,e){var n=this;if(this.links.forEach(function(e){return e.notifiedUpstream(t,n.root)}),this.deps.forEach(Q),t&&this.rootLink&&this.root!==e){var i=t.slice(1);i.unshift(this.key),this.notifyUpstream(i)}},i.relinked=function(){this.target.registerLink(this),this.children.forEach(function(t){return t.relinked()})},i.relinking=function(t,e){var n=this;this.rootLink&&this.sourcePath&&(t=ht(this.sourcePath,t,this.target)),t&&this.target!==t&&(this.target&&this.target.unregisterLink(this),this.target=t,this.children.forEach(function(n){n.relinking(t.joinKey(n.key),e)}),this.rootLink&&this.addShuffleTask(function(){n.relinked(),e||(n.markedAll(),n.notifyUpstream())}))},i.set=function(t){this.boundValue&&(this.boundValue=null),this.target.set(t)},i.shuffle=function(t){this.shuffling||(this.target.shuffling?z(this,t,!0):this.target.shuffle?this.target.shuffle(t):this.target.mark())},i.source=function(){return this.target.source?this.target.source():this.target},i.teardown=function(){this._link&&this._link.teardown(),this.target.unregisterLink(this),this.children.forEach(it)},n}(Eo);Eo.prototype.link=function(t,e,n){var i=this._link||new jo(this.parent,this,t,this.key);return i.implicit=n&&n.implicit,i.mapping=n&&n.mapping,i.sourcePath=e,i.rootLink=!0,this._link&&this._link.relinking(t,!1),this.rebind(i,this,!1),F(),this._link=i,i.markedAll(),this.notifyUpstream(),i},Eo.prototype.unlink=function(){if(this._link){var t=this._link;this._link=void 0,t.rebind(this,t,!1),F(),t.teardown(),this.notifyUpstream()}};var No=Ia(null),To=4,Vo=/^\s+/,Mo=function(t){this.name="ParseError",this.message=t;try{throw new Error(t)}catch(e){this.stack=e.stack}};Mo.prototype=Error.prototype;var Po=function(t,e){var n,i=0;this.str=t,this.options=e||{},this.pos=0,this.lines=this.str.split("\n"),this.lineEnds=this.lines.map(function(t){var e=i+t.length+1;return i=e,e},0),this.init&&this.init(t,e);for(var r=[];this.pos<this.str.length&&(n=this.read());)r.push(n);this.leftover=this.remaining(),this.result=this.postProcess?this.postProcess(r,e):r};Po.prototype={read:function(t){var e,n,i=this;t||(t=this.converters);var r=this.pos,s=t.length;for(e=0;s>e;e+=1)if(i.pos=r,n=t[e](i))return n;return null},getContextMessage:function(t,e){var n=this.getLinePos(t),i=n[0],r=n[1];if(-1===this.options.contextLines)return[i,r,e+" at line "+i+" character "+r];var s=this.lines[i-1],a="",o="";if(this.options.contextLines){var u=i-1-this.options.contextLines<0?0:i-1-this.options.contextLines;a=this.lines.slice(u,i-1-u).join("\n").replace(/\t/g,"  "),o=this.lines.slice(i,i+this.options.contextLines).join("\n").replace(/\t/g,"  "),a&&(a+="\n"),o&&(o="\n"+o)}var h=0,l=a+s.replace(/\t/g,function(t,e){return r>e&&(h+=1),"  "})+"\n"+new Array(r+h).join(" ")+"^----"+o;return[i,r,e+" at line "+i+" character "+r+":\n"+l]},getLinePos:function(t){for(var e=this,n=0,i=0;t>=this.lineEnds[n];)i=e.lineEnds[n],n+=1;var r=t-i;return[n+1,r+1,t]},error:function qp(t){var e=this.getContextMessage(this.pos,t),n=e[0],i=e[1],r=e[2],qp=new Mo(r);throw qp.line=n,qp.character=i,qp.shortMessage=t,qp},matchString:function(t){return this.str.substr(this.pos,t.length)===t?(this.pos+=t.length,t):void 0},matchPattern:function(t){var e;return(e=t.exec(this.remaining()))?(this.pos+=e[0].length,e[1]||e[0]):void 0},sp:function(){this.matchPattern(Vo)},remaining:function(){return this.str.substring(this.pos)},nextChar:function(){return this.str.charAt(this.pos)},warn:function(t){var e=this.getContextMessage(this.pos,t)[2];y(e)}},Po.extend=function(e){var n=this,i=function(t,e){Po.call(this,t,e)};i.prototype=Ia(n.prototype);for(var r in e)t(e,r)&&(i.prototype[r]=e[r]);return i.extend=Po.extend,i};var Io,Ro=1,Bo=2,Ko=3,Lo=4,Do=5,Fo=6,zo=7,Uo=8,$o=9,qo=10,Ho=11,Zo=13,Wo=14,Go=15,Qo=16,Yo=17,Jo=18,Xo=19,tu=55,eu=20,nu=21,iu=22,ru=23,su=24,au=25,ou=26,uu=27,hu=30,lu=31,cu=32,fu=33,du=34,pu=35,mu=36,vu=40,gu=50,yu=51,bu=52,wu=53,xu=54,ku=60,_u=61,Eu=62,Au=63,Cu=70,Su=71,Ou=72,ju=73,Nu=74,Tu=/^[^\s=]+/,Vu=/^\s+/,Mu=/^(\/(?:[^\n\r\u2028\u2029\/\\[]|\\.|\[(?:[^\n\r\u2028\u2029\]\\]|\\.)*])+\/(?:([gimuy])(?![a-z]*\2))*(?![a-zA-Z_$0-9]))/,Pu=/[-\/\\^$*+?.()|[\]{}]/g,Iu={},Ru={allowfullscreen:1,async:1,autofocus:1,autoplay:1,checked:1,compact:1,controls:1,declare:1,"default":1,defaultchecked:1,defaultmuted:1,defaultselected:1,defer:1,disabled:1,enabled:1,formnovalidate:1,hidden:1,indeterminate:1,inert:1,ismap:1,itemscope:1,loop:1,multiple:1,muted:1,nohref:1,noresize:1,noshade:1,novalidate:1,nowrap:1,open:1,pauseonexit:1,readonly:1,required:1,reversed:1,scoped:1,seamless:1,selected:1,sortable:1,translate:1,truespeed:1,typemustmatch:1,visible:1},Bu={area:1,base:1,br:1,col:1,command:1,doctype:1,embed:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},Ku={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Lu=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],Du=new RegExp("&(#?(?:x[\\w\\d]+|\\d+|"+Ka(Ku).join("|")+"));?","g"),Fu=u(String.fromCodePoint),zu=Fu?String.fromCodePoint:String.fromCharCode,Uu=/</g,$u=/>/g,qu=/&/g,Hu=65533,Zu="Expected a JavaScript expression",Wu="Expected closing paren",Gu=/^(?:[+-]?)0*(?:(?:(?:[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/,Qu=/^(?=.)[^"'\\]+?(?:(?!.)|(?=["'\\]))/,Yu=/^\\(?:[`'"\\bfnrt]|0(?![0-9])|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|(?=.)[^ux0-9])/,Ju=/^\\(?:\r\n|[\u000A\u000D\u2028\u2029])/,Xu=_t('"'),th=_t("'"),eh=/^[^`"\\\$]+?(?:(?=[`"\\\$]))/,nh=/[\r\n\t\b\f]/g,ih=/^[a-zA-Z_$][a-zA-Z_$0-9]*/,rh=/^\s*\.{3}/,sh=/^(?:[a-zA-Z$_0-9]|\\\.)+(?:(?:\.(?:[a-zA-Z$_0-9]|\\\.)+)|(?:\[[0-9]+\]))*/,ah=/^[a-zA-Z_$][-\/a-zA-Z_$0-9]*(?:\.(?:[a-zA-Z_$][-\/a-zA-Z_$0-9]*))*/,oh=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/,uh=/^(?:Array|console|Date|RegExp|decodeURIComponent|decodeURI|encodeURIComponent|encodeURI|isFinite|isNaN|parseFloat|parseInt|JSON|Math|NaN|undefined|null|Object|Number|String|Boolean)\b/,hh=/^(?:break|case|catch|continue|debugger|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|void|while|with)$/,lh=/^(?:\@\.|\@|~\/|(?:\^\^\/(?:\^\^\/)*(?:\.\.\/)*)|(?:\.\.\/)+|\.\/(?:\.\.\/)*|\.)/,ch=/^(key|index|keypath|rootpath|this|global|shared|context|event|node|local|style|helpers|last|macro)/,fh=function(t,e){return function(n){var i;return(i=e(n))?i:n.matchString(t)?(n.sp(),i=Dt(n),i||n.error(Zu),{s:t,o:i,t:fu}):null}};!function(){var t,e,n,i,r="! ~ + - typeof".split(" ");for(i=Kt,t=0,e=r.length;e>t;t+=1)n=fh(r[t],i),i=n;Io=i}();var dh,ph=Io,mh=function(t,e){return function(n){if(n.inUnquotedAttribute&&(">"===t||"/"===t))return e(n);var i,r,s;if(r=e(n),!r)return null;for(;;){if(i=n.pos,n.sp(),!n.matchString(t))return n.pos=i,r;if("in"===t&&/[a-zA-Z_$0-9]/.test(n.remaining().charAt(0)))return n.pos=i,r;if(n.sp(),s=e(n),!s)return n.pos=i,r;r={t:mu,s:t,o:[r,s]}}}};!function(){var t,e,n,i,r="* / % + - << >> >>> < <= > >= in instanceof == != === !== & ^ | && ||".split(" ");for(i=ph,t=0,e=r.length;e>t;t+=1)n=mh(r[t],i),i=n;dh=i}();var vh=dh,gh=/^[^\s"'>\/=(]+/,yh=/^on/,bh=/^on-([a-zA-Z\*\.$_]((?:[a-zA-Z\*\.$_0-9\-]|\\-)+))$/,wh=/^(?:change|reset|teardown|update|construct|config|init|render|complete|unrender|detach|insert|destruct|attachchild|detachchild)$/,xh=/^as-([a-z-A-Z][-a-zA-Z_0-9]*)$/,kh=/^([a-zA-Z](?:(?!-in-out)[-a-zA-Z_0-9])*)-(in|out|in-out)$/,_h=/^((bind|class)-(([-a-zA-Z0-9_])+))$/,Eh={lazy:{t:ju,v:"l"},twoway:{t:ju,v:"t"},"no-delegation":{t:Nu}},Ah=/^[^\s"'=<>\/`]+/,Ch=/^[^\s"'=<>@\[\]()]*/,Sh=/^\s+/,Oh=/\\/g,jh={t:qo,exclude:!0},Nh=/^(?:[a-zA-Z$_0-9]|\\\.)+(?:(?:(?:[a-zA-Z$_0-9]|\\\.)+)|(?:\[[0-9]+\]))*/,Th=/^as/i,Vh={"else":/^\s*else\s*/,elseif:/^\s*elseif\s+/,then:/^\s*then\s*/,"catch":/^\s*catch\s*/},Mh={"else":ku,elseif:_u,then:Eu,"catch":Au},Ph={each:bu,"if":gu,"with":xu,unless:yu},Ih=/^\s*:\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/,Rh=/^\s*,\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/,Bh=new RegExp("^("+Ka(Ph).join("|")+")\\b"),Kh="<!--",Lh="-->",Dh=/^[ \t\f\r\n]*\r?\n/,Fh=/\r?\n[ \t\f\r\n]*$/,zh=/[ \t\f\r\n]+/g,Uh=/^[ \t\f\r\n]+/,$h=/[ \t\f\r\n]+$/,qh=/^(?:\r\n|\r|\n)/,Hh=/(?:\r\n|\r|\n)$/,Zh=/^([a-zA-Z]{1,}:?[a-zA-Z0-9\-]*)\s*\>/,Wh=/^[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/,Gh=/^[a-zA-Z_$][-a-zA-Z0-9_$]*/,Qh=/^[\s\n\/>]/,Yh=/;\s*$/,Jh={exclude:!0},Xh={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]},tl=/^\s*(elseif|else|then|catch)\s*/,el=/^\s*#\s*partial\s+/,nl={},il=[le,oe,me,fe,ce],rl=[ae],sl=[re,ve,Ee,Oe],al=[je],ol={pre:1,script:1,style:1,textarea:1},ul={textarea:!0,script:!0,style:!0,template:!0},hl=Po.extend({init:function(t,e){var n=e.tripleDelimiters||nl.defaults.tripleDelimiters,i=e.staticDelimiters||nl.defaults.staticDelimiters,r=e.staticTripleDelimiters||nl.defaults.staticTripleDelimiters;this.standardDelimiters=e.delimiters||nl.defaults.delimiters,this.tags=[{isStatic:!1,isTriple:!1,open:this.standardDelimiters[0],close:this.standardDelimiters[1],readers:il},{isStatic:!1,isTriple:!0,open:n[0],close:n[1],readers:rl},{isStatic:!0,isTriple:!1,open:i[0],close:i[1],readers:il},{isStatic:!0,isTriple:!0,open:r[0],close:r[1],readers:rl}],this.contextLines=e.contextLines||nl.defaults.contextLines,this.sortMustacheTags(),this.sectionDepth=0,this.elementStack=[],this.interpolate=Pa({},ul,nl.defaults.interpolate,e.interpolate),e.sanitize===!0&&(e.sanitize={elements:"applet base basefont body frame frameset head html isindex link meta noframes noscript object param script style title".split(" "),eventAttributes:!0}),this.stripComments=e.stripComments!==!1,this.preserveWhitespace=o(e.preserveWhitespace)?!1:e.preserveWhitespace,this.sanitizeElements=e.sanitize&&e.sanitize.elements,this.sanitizeEventAttributes=e.sanitize&&e.sanitize.eventAttributes,this.includeLinePositions=e.includeLinePositions,this.textOnlyMode=e.textOnlyMode,this.csp=e.csp,this.allowExpressions=e.allowExpressions,e.expression&&(this.converters=[Dt]),e.attributes&&(this.inTag=!0),this.whiteSpaceElements=Pa({},e.preserveWhitespace,ol)},postProcess:function(t,e){var n=t[0];if(e.expression){var i=Ut(n);return i.e=ct(i.s,i.r.length),i}if(!t.length)return{t:[],v:To};if(this.sectionDepth>0&&this.error("A section was left open"),xe(n.t,this.stripComments,this.preserveWhitespace,!this.preserveWhitespace,!this.preserveWhitespace,this.whiteSpaceElements),this.csp!==!1){var r={};Te(n.t,r),Te(n.p||{},r),Ka(r).length&&(n.e=r)}return n},converters:[Ne],sortMustacheTags:function(){this.tags.sort(function(t,e){return e.open.length-t.open.length})}}),ll=["delimiters","tripleDelimiters","staticDelimiters","staticTripleDelimiters","csp","interpolate","preserveWhitespace","sanitize","stripComments","contextLines","allowExpressions","attributes"],cl="Either preparse or use a ractive runtime source that includes the parser. ",fl="Either include a version of Ractive that can parse or convert your computation strings to functions.",dl={fromId:function(t,e){if(!Ua){if(e&&e.noThrow)return;throw new Error("Cannot retrieve template #"+t+" as Ractive is not running in a browser.")}t&&(t=t.replace(/^#/,""));var n;if(!(n=Ua.getElementById(t))){if(e&&e.noThrow)return;throw new Error("Could not find template element with id #"+t)}if("SCRIPT"!==n.tagName.toUpperCase()){if(e&&e.noThrow)return;throw new Error("Template element with id #"+t+", must be a <script> element")}return"textContent"in n?n.textContent:n.innerHTML},isParsed:function(t){return!h(t)},getParseOptions:function(t){return t.defaults&&(t=t.defaults),ll.reduce(function(e,n){return e[n]=t[n],e},{})},parse:function(t,e){Re(Ie,"template",cl);var n=Ie(t,e);return dt(n),n},parseFor:function(t,e){return this.parse(t,this.getParseOptions(e))}},pl=0,ml=function(t,e){this.callback=t,this.parent=e,this.intros=[],this.outros=[],this.children=[],this.totalChildren=this.outroChildren=0,this.detachQueue=[],this.outrosComplete=!1,this.id=pl++,e&&e.addChild(this)},vl=ml.prototype;vl.add=function(t){var e=t.isIntro?this.intros:this.outros;t.starting=!0,e.push(t)},vl.addChild=function(t){this.children.push(t),this.totalChildren+=1,this.outroChildren+=1},vl.checkStart=function(){this.parent&&this.parent.started&&this.start()},vl.decrementOutros=function(){this.outroChildren-=1,De(this)},vl.decrementTotal=function(){this.totalChildren-=1,De(this)},vl.detachNodes=function(){for(var t=this,e=this.detachQueue.length,n=0;e>n;n++)t.detachQueue[n].detach();e=this.children.length;for(var i=0;e>i;i++)t.children[i].detachNodes();this.detachQueue=[]},vl.ready=function(){this.detachQueue.length&&Fe(this)},vl.remove=function(t){var e=t.isIntro?this.intros:this.outros;V(e,t),De(this)},vl.start=function(){this.started=!0,this.children.forEach(function(t){return t.start()}),this.intros.concat(this.outros).forEach(function(t){return t.start()}),De(this)};var gl,yl={active:function(){return!!gl},start:function(){var t,e=new Promise(function(e){return t=e});return gl={previousBatch:gl,transitionManager:new ml(t,gl&&gl.transitionManager),fragments:[],tasks:[],immediateObservers:[],deferredObservers:[],promise:e},e},end:function(){$e(),gl.previousBatch?gl.transitionManager.checkStart():gl.transitionManager.start(),gl=gl.previousBatch},addFragment:function(t){S(gl.fragments,t)},addFragmentToRoot:function(t){if(gl){for(var e=gl;e.previousBatch;)e=e.previousBatch;S(e.fragments,t)}},addObserver:function(t,e){gl?S(e?gl.deferredObservers:gl.immediateObservers,t):t.dispatch()},registerTransition:function(t){t._manager=gl.transitionManager,gl.transitionManager.add(t)},detachWhenReady:function(t){gl.transitionManager.detachQueue.push(t)},scheduleTask:function(t,e){var n;if(gl){for(n=gl;e&&n.previousBatch;)n=n.previousBatch;n.tasks.push(t)}else t()},promise:function(){if(!gl)return Promise.resolve();for(var t=gl;t.previousBatch;)t=t.previousBatch;return t.promise||Promise.resolve()}},bl=[],wl=!1,xl=function(t){this.duration=t.duration,this.step=t.step,this.complete=t.complete,this.easing=t.easing,this.start=performance.now(),this.end=this.start+this.duration,this.running=!0,bl.push(this),wl||requestAnimationFrame(qe)},kl=xl.prototype;kl.tick=function(t){if(!this.running)return!1;if(t>this.end)return this.step&&this.step(1),this.complete&&this.complete(1),!1;var e=t-this.start,n=this.easing(e/this.duration);return this.step&&this.step(n),!0},kl.stop=function(){this.abort&&this.abort(),this.running=!1};var _l={},El={},Al=function(e){function n(t,n){e.call(this,t),this.ticker=null,t&&(this.key=C(n),this.isReadonly=t.isReadonly,t.value&&(this.value=t.value[this.key],Da(this.value)&&(this.length=this.value.length),this.adapt()))}e&&(n.__proto__=e);var s=n.prototype=Object.create(e&&e.prototype);return s.constructor=n,s.adapt=function(){var t=this,e=this.root.adaptors,n=e.length;if(this.rewrap=!1,0!==n){var i=this.wrapper?"newWrapperValue"in this?this.newWrapperValue:this.wrapperValue:this.value,r=this.root.ractive,s=this.getKeypath();if(this.wrapper){var a=this.wrapperValue===i?!1:!this.wrapper.reset||this.wrapper.reset(i)===!1;if(!a)return delete this.newWrapperValue,void(this.value=this.wrapper.get());if(this.wrapper.teardown(),delete this.wrapper,delete this.wrapperValue,delete this.newWrapperValue,void 0!==this.value){var o=this.parent.value||this.parent.createBranch(this.key);o[this.key]!==i&&(o[this.key]=i),this.value=i}}var u;for(u=0;n>u;u+=1){var h=e[u];if(h.filter(i,s,r)){t.wrapper=h.wrap(r,i,s,Ze(s)),t.wrapperValue=i,t.wrapper.__model=t,t.value=t.wrapper.get();break}}}},s.animate=function(t,e,n,i){var r=this;this.ticker&&this.ticker.stop();var s,a=new Promise(function(t){return s=t});return this.ticker=new xl({duration:n.duration,easing:n.easing,step:function(t){var e=i(t);r.applyValue(e),n.step&&n.step(t,e)},complete:function(){r.applyValue(e),n.complete&&n.complete(e),r.ticker=null,s(e)}}),a.stop=this.ticker.stop,a},s.applyValue=function(t,e){if(void 0===e&&(e=!0),!i(t,this.value)){if(this.boundValue&&(this.boundValue=null),this.parent.wrapper&&this.parent.wrapper.set)this.parent.wrapper.set(this.key,t),this.parent.value=this.parent.wrapper.get(),this.value=this.parent.value[this.key],this.wrapper&&(this.newWrapperValue=this.value),this.adapt();else if(this.wrapper)this.newWrapperValue=t,this.adapt();else{var n=this.parent.value||this.parent.createBranch(this.key);if(!a(n))return void y("Attempted to set a property of a non-object '"+this.getKeypath()+"'");n[this.key]=t,this.value=t,this.adapt()}(this.dataModel||t&&t.viewmodel&&t.viewmodel.isRoot)&&U(this,t),Da(t)?(this.length=t.length,this.isArray=!0):this.isArray=!1,this.links.forEach(Q),this.children.forEach(Y),this.deps.forEach(Q),e&&this.notifyUpstream(),this.parent.isArray&&("length"===this.key?this.parent.length=t:this.parent.joinKey("length").mark())}},s.compute=function(t,e){var n=this.computed||(this.computed={});return n[t]?(n[t].signature=Le(this.root.ractive,t,e),n[t].mark()):n[t]=new El.Computation(this,Le(this.root.ractive,t,e),t),n[t]},s.createBranch=function(t){var e=r(t)?[]:{};return this.applyValue(e,!1),e},s.get=function(t,e){return this._link?this._link.get(t,e):(t&&H(this),e&&e.virtual?this.getVirtual(!1):K(this,(e&&"unwrap"in e?e.unwrap!==!1:t)&&this.wrapper?this.wrapperValue:this.value,!e||e.shouldBind!==!1))},s.joinKey=function(e,i){var r=this;if(this._link)return i&&i.lastLink!==!1&&(c(e)||""===e)?this:this._link.joinKey(e);if(c(e)||""===e)return this;var s;if(s=t(this.childByKey,e)?this.childByKey[e]:this.computed&&this.computed[e],!s){var a;if(this.isRoot&&this.ractive&&(a=this.ractive.computed[e]))s=this.compute(e,a);else if(!this.isRoot&&this.root.ractive){var o=this.root.ractive.computed;for(var u in o)a=o[u],a.pattern&&a.pattern.test(r.getKeypath()+"."+e)&&(s=r.compute(e,a))}}if(!s&&(s=new n(this,e),this.children.push(s),this.childByKey[e]=s,"data"===e)){var h=this.retrieve();h&&h.viewmodel&&h.viewmodel.isRoot&&(s.link(h.viewmodel,"data"),this.dataModel=h)}return!s._link||i&&i.lastLink===!1?s:s._link},s.mark=function(t){if(this._link)return this._link.mark(t);var e=this.value,n=this.retrieve();(this.dataModel||n&&n.viewmodel&&n.viewmodel.isRoot)&&U(this,n),(t||!i(n,e))&&(this.value=n,this.boundValue&&(this.boundValue=null),(e!==n||this.rewrap)&&(this.wrapper&&(this.newWrapperValue=n),this.adapt()),Da(n)?(this.length=n.length,this.isArray=!0):this.isArray=!1,this.children.forEach(t?J:Y),this.links.forEach(X),this.deps.forEach(Q))},s.merge=function(t,e){var n=R(this.value===t?We(this):this.value,t,e);this.parent.value[this.key]=t,this.shuffle(n,!0)},s.retrieve=function(){return this.parent.value?this.parent.value[this.key]:void 0},s.set=function(t){this.ticker&&this.ticker.stop(),this.applyValue(t)},s.shuffle=function(t,e){z(this,t,!1,e)},s.source=function(){return this},s.teardown=function(){var t=this;this._link&&(this._link.teardown(),this._link=null),this.children.forEach(it),this.wrapper&&this.wrapper.teardown(),this.computed&&Ka(this.computed).forEach(function(e){return t.computed[e].teardown()})},n}(Eo),Cl={},Sl=function(t){function e(e,n,i){t.call(this,null,"@"+n),this.key="@"+n,this.value=e,this.isRoot=!0,this.root=this,this.adaptors=[],this.ractive=i}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getKeypath=function(){return this.key},n.retrieve=function(){return this.value},e}(Al),Ol=new Sl(Cl,"shared"),jl=new Sl(qa,"global"),Nl={},Tl=function(t){this.ractive=t};Tl.prototype.findContext=function(){return this.ractive.viewmodel};var Vl=Tl.prototype;Vl.getContext=nn,Vl.find=Vl.findComponent=Vl.findAll=Vl.findAllComponents=f;var Ml=!1,Pl=/\*/,Il={virtual:!1},Rl={},Bl="Cannot add to a non-numeric value",Kl=oo.linear,Ll={},Dl={},Fl=function(t){this.event=t,this.method="on"+t};Fl.prototype.fire=function(t,e){var n=en(t),i=this.method;t[i]&&(e?t[i](n,e):t[i](n)),bn(t,this.event,n,e?[e,t]:[t])};var zl=function(t){this.hook=new Fl(t),this.inProcess={},this.queue={}},Ul=zl.prototype;Ul.begin=function(t){this.inProcess[t._guid]=!0},Ul.end=function(t){var e=t.parent;e&&this.inProcess[e._guid]?kn(this.queue,e).push(t):_n(this,t),delete this.inProcess[t._guid]};var $l={};["construct","config","attachchild","detach","detachchild","insert","complete","reset","render","unrendering","unrender","teardown","destruct","update"].forEach(function(t){$l[t]=new Fl(t)}),$l.init=new zl("init");var ql=Array.prototype,Hl=$n("push").model,Zl=$n("pop").model,Wl=$n("shift").model,Gl=$n("unshift").model,Ql=$n("sort").model,Yl=$n("splice").model,Jl=$n("reverse").model,Xl=function(t){function e(e){t.call(this,null,null),this.isRoot=!0,this.root=this,this.value={},this.ractive=e.ractive,this.adaptors=[],this.context=e.context}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getKeypath=function(){return"@context.data"},n.rebound=function(){},e}(Al),tc=function(t,e){this.fragment=t,this.element=e||Fn(t),this.node=this.element&&this.element.node,this.ractive=t.ractive,this.root=this},ec=tc.prototype,nc={decorators:{},_data:{}};nc.decorators.get=function(){var t={};return this.element?(this.element.decorators.forEach(function(e){return t[e.name]=e.handle}),t):t},nc._data.get=function(){return this.model||(this.root.model=new Xl({ractive:this.ractive,context:this.root}))},ec.add=function(t,e,n){var i=l(e)?+e:1,s=o(e)?e:n;return sn(Zn(this,t,i).map(function(t){var e=t[0],n=t[1],i=e.get();if(!r(n)||!r(i))throw new Error("Cannot add non-numeric value");return[e,i+n]}),s)},ec.animate=function(t,e,n){var i=Wn(this,t).model;return pn(this.ractive,i,e,n)},ec.find=function(t){return this.fragment.find(t)},ec.findAll=function(t){var e=[];return this.fragment.findAll(t,{result:e}),e},ec.findAllComponents=function(t){var e=[];return this.fragment.findAllComponents(t,{result:e}),e},ec.findComponent=function(t){return this.fragment.findComponent(t)},ec.get=function(t){if(!t)return this.fragment.findContext().get(!0);var e=Wn(this,t),n=e.model;return n?n.get(!0):void 0},ec.getParent=function(t){var e=this.fragment;return!e.parent&&t?e=e.componentParent:e.context?e=rn(e.parent):(e=rn(e.parent),e&&(e=!e.parent&&t?e.componentParent:rn(e.parent))),e&&e!==this.fragment?e.getContext():void 0},ec.hasListener=function(t,e){var n,i=this.fragment.owner.component?this.fragment.owner:this.element||this.fragment.owner;do{if(n=i.component||i,n.template.t===zo&&Gn(n,t))return!0;i=i.up&&i.up.owner,i&&i.component&&(i=i.component)}while(i&&e)},ec.link=function(t,e){var n=Wn(this,t).model,i=Wn(this,e).model,r=yl.start();return i.link(n,t),yl.end(),r},ec.listen=function(t,e){var n=this.element;return n.on(t,e),{cancel:function(){n.off(t,e)}}},ec.observe=function(t,e,n){return void 0===n&&(n={}),s(t)&&(n=e||{}),n.fragment=this.fragment,this.ractive.observe(t,e,n)},ec.observeOnce=function(t,e,n){return void 0===n&&(n={}),s(t)&&(n=e||{}),n.fragment=this.fragment,this.ractive.observeOnce(t,e,n)},ec.pop=function(t){return Zl(Wn(this,t).model,[])},ec.push=function(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];return Hl(Wn(this,t).model,e)},ec.raise=function(t,e){for(var n=[],i=arguments.length-2;i-->0;)n[i]=arguments[i+2];for(var r,s=this.element;s;){if(s.component&&(s=s.component),r=Gn(s,t))return r.fire(r.element.getContext(e||{},!e||"original"in e?{}:{original:{}}),n);s=s.up&&s.up.owner}},ec.readLink=function(t,e){return this.ractive.readLink(this.resolve(t),e)},ec.resolve=function(t,e){var n=Wn(this,t),i=n.model,r=n.instance;return i?i.getKeypath(e||r):t},ec.reverse=function(t){return Jl(Wn(this,t).model,[])},ec.set=function(t,e,n){return sn(Zn(this,t,e),n);
},ec.shift=function(t){return Wl(Wn(this,t).model,[])},ec.splice=function(t,e,n){for(var i=[],r=arguments.length-3;r-->0;)i[r]=arguments[r+3];return i.unshift(e,n),Yl(Wn(this,t).model,i)},ec.sort=function(t){return Ql(Wn(this,t).model,[])},ec.subtract=function(t,e,n){var i=l(e)?e:1,s=o(e)?e:n;return sn(Zn(this,t,i).map(function(t){var e=t[0],n=t[1],i=e.get();if(!r(n)||!r(i))throw new Error("Cannot add non-numeric value");return[e,i-n]}),s)},ec.toggle=function(t,e){var n=Wn(this,t),i=n.model;return sn([[i,!i.get()]],e)},ec.unlink=function(t){var e=Wn(this,t).model,n=yl.start();return e.owner&&e.owner._link&&e.owner.unlink(),yl.end(),n},ec.unlisten=function(t,e){this.element.off(t,e)},ec.unshift=function(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];return Gl(Wn(this,t).model,e)},ec.update=function(t,e){return qn(this.ractive,Wn(this,t).model,e)},ec.updateModel=function(t,e){var n=Wn(this,t),i=n.model,r=yl.start();return i.updateFromBindings(e),yl.end(),r},ec.isBound=function(){var t=this.getBindingModel(this),e=t.model;return!!e},ec.getBindingPath=function(t){var e=this.getBindingModel(this),n=e.model,i=e.instance;return n?n.getKeypath(t||i):void 0},ec.getBinding=function(){var t=this.getBindingModel(this),e=t.model;return e?e.get(!0):void 0},ec.getBindingModel=function(t){var e=t.element;return{model:e.binding&&e.binding.model,instance:e.up.ractive}},ec.setBinding=function(t){var e=this.getBindingModel(this),n=e.model;return sn([[n,t]])},Object.defineProperties(ec,nc),tc.forRactive=en,Nl.Context=tc;var ic,rc,sc,ac,oc,uc,hc,lc,cc,fc=Ua&&Ua.querySelector,dc="http://www.w3.org/1999/xhtml",pc="http://www.w3.org/1998/Math/MathML",mc="http://www.w3.org/2000/svg",vc="http://www.w3.org/1999/xlink",gc="http://www.w3.org/XML/1998/namespace",yc="http://www.w3.org/2000/xmlns",bc={html:dc,mathml:pc,svg:mc,xlink:vc,xml:gc,xmlns:yc};if(ic=Za?function(t,e,n){return e&&e!==dc?n?Ua.createElementNS(e,t,n):Ua.createElementNS(e,t):n?Ua.createElement(t,n):Ua.createElement(t)}:function(t,e,n){if(e&&e!==dc)throw"This browser does not support namespaces other than http://www.w3.org/1999/xhtml. The most likely cause of this error is that you're trying to render SVG in an older browser. See http://ractive.js.org/support/#svgs for more information";return n?Ua.createElement(t,n):Ua.createElement(t)},$a){for(sc=ic("div"),ac=["matches","matchesSelector"],cc=function(t){return function(e,n){return e[t](n)}},hc=ac.length;hc--&&!rc;)if(oc=ac[hc],sc[oc])rc=cc(oc);else for(lc=Wa.length;lc--;)if(uc=Wa[hc]+oc.substr(0,1).toUpperCase()+oc.substring(1),sc[uc]){rc=cc(uc);break}rc||(rc=function(t,e){var n,i;n=t.parentNode,n||(sc.innerHTML="",n=sc,t=t.cloneNode(),sc.appendChild(t));var r=n.querySelectorAll(e);for(i=r.length;i--;)if(r[i]===t)return!0;return!1})}else rc=null;var wc=function(t,e,n,i){this.context=i.context||t,this.callback=n,this.ractive=t,this.keypath=i.keypath,this.options=i,e&&this.resolved(e),u(i.old)&&(this.oldContext=Ia(t),this.oldFn=i.old),i.init!==!1?(this.dirty=!0,this.dispatch()):hi(this),this.dirty=!1},xc=wc.prototype;xc.cancel=function(){this.cancelled=!0,this.model?this.model.unregister(this):this.resolver.unbind(),V(this.ractive._observers,this)},xc.dispatch=function(){this.cancelled||(this.callback.call(this.context,this.newValue,this.oldValue,this.keypath),hi(this,!0),this.dirty=!1)},xc.handleChange=function(){var t=this;if(this.dirty)this.newValue=this.model.get();else{var e=this.model.get();if(i(e,this.oldValue))return;if(this.newValue=e,this.options.strict&&this.newValue===this.oldValue)return;yl.addObserver(this,this.options.defer),this.dirty=!0,this.options.once&&yl.scheduleTask(function(){return t.cancel()})}},xc.rebind=function(t,e){var n=this;return t=ht(this.keypath,t,e),t===this.model?!1:(this.model&&this.model.unregister(this),void(t&&t.addShuffleTask(function(){return n.resolved(t)})))},xc.resolved=function(t){this.model=t,this.oldValue=void 0,this.newValue=t.get(),t.register(this)};var kc=/\*+/g,_c=function(t,e,n,i,r){var s=this;this.context=r.context||t,this.ractive=t,this.baseModel=e,this.keys=n,this.callback=i;var a=n.join("\\.").replace(kc,"(.+)"),o=this.baseKeypath=e.getKeypath(t);this.pattern=new RegExp("^"+(o?o+"\\.":"")+a+"$"),this.recursive=1===n.length&&"**"===n[0],this.recursive&&(this.keys=["*"]),r.old&&(this.oldContext=Ia(t),this.oldFn=r.old),this.oldValues={},this.newValues={},this.defer=r.defer,this.once=r.once,this.strict=r.strict,this.dirty=!1,this.changed=[],this.partial=!1,this.links=r.links;var u=e.findMatches(this.keys);u.forEach(function(t){s.newValues[t.getKeypath(s.ractive)]=t.get()}),r.init!==!1?this.dispatch():li(this,this.newValues),e.registerPatternObserver(this)},Ec=_c.prototype;Ec.cancel=function(){this.baseModel.unregisterPatternObserver(this),V(this.ractive._observers,this)},Ec.dispatch=function(){var t=this,e=this.newValues;this.newValues={},Ka(e).forEach(function(n){var r=e[n],s=t.oldValues[n];if(!(t.strict&&r===s||i(r,s))){var a=[r,s,n];if(n){var o=t.pattern.exec(n);o&&(a=a.concat(o.slice(1)))}t.callback.apply(t.context,a)}}),li(this,e,this.partial),this.dirty=!1},Ec.notify=function(t){this.changed.push(t)},Ec.shuffle=function(t){var e=this;if(Da(this.baseModel.value)){for(var n=this.baseModel.value.length,i=0;i<t.length;i++)-1!==t[i]&&t[i]!==i&&e.changed.push([i]);for(var r=t.touchedFrom;n>r;r++)e.changed.push([r])}},Ec.handleChange=function(){var t=this;if(!this.dirty||this.changed.length){if(this.dirty||(this.newValues={}),this.changed.length){var e=0;if(this.recursive)this.changed.forEach(function(n){var i=t.baseModel.joinAll(n);(!i.isLink||t.links)&&(e++,t.newValues[i.getKeypath(t.ractive)]=i.get())});else{var n=this.baseModel.isRoot?this.changed.map(function(t){return t.map(_).join(".")}):this.changed.map(function(e){return t.baseKeypath+"."+e.map(_).join(".")});this.baseModel.findMatches(this.keys).forEach(function(i){var r=i.getKeypath(t.ractive),s=function(t){return 0===t.indexOf(r)&&(t.length===r.length||"."===t[r.length])||0===r.indexOf(t)&&(t.length===r.length||"."===r[t.length])};n.filter(s).length&&(e++,t.newValues[r]=i.get())})}if(!e)return;this.partial=!0}else this.baseModel.findMatches(this.keys).forEach(function(e){var n=e.getKeypath(t.ractive);t.newValues[n]=e.get()}),this.partial=!1;yl.addObserver(this,this.defer),this.dirty=!0,this.changed.length=0,this.once&&this.cancel()}};var Ac=function(t,e,n,i){this.ractive=t,this.model=e,this.keypath=e.getKeypath(),this.callback=n,this.options=i,this.pending=null,e.register(this),i.init!==!1?(this.sliced=[],this.shuffle([]),this.dispatch()):this.sliced=this.slice()},Cc=Ac.prototype;Cc.cancel=function(){this.model.unregister(this),V(this.ractive._observers,this)},Cc.dispatch=function(){this.callback(this.pending),this.pending=null,this.options.once&&this.cancel()},Cc.handleChange=function(t){this.pending?yl.addObserver(this,this.options.defer):t||(this.shuffle(this.sliced.map(ci)),this.handleChange())},Cc.shuffle=function(t){var e,n=this,i=this.slice(),r=[],s=[],a={};t.forEach(function(t,i){a[t]=!0,t!==i&&c(e)&&(e=i),-1===t&&s.push(n.sliced[i])}),c(e)&&(e=t.length);for(var o=i.length,u=0;o>u;u+=1)a[u]||r.push(i[u]);this.pending={inserted:r,deleted:s,start:e},this.sliced=i},Cc.slice=function(){var t=this.model.get();return Da(t)?t.slice():[]};var Sc={init:!1,once:!0},Oc=function(t){return t.trim()},jc=function(t){return""!==t},Nc=$n("pop").path,Tc=$n("push").path,Vc="/* Ractive.js component styles */",Mc=[],Pc=!1,Ic=null,Rc=null,Bc={extend:function(t,e,n){e.adapt=M(e.adapt,N(n.adapt))},init:function(){}},Kc=/\/\*(?:[\s\S]*?)\*\//g,Lc=/url\(\s*(['"])(?:\\[\s\S]|(?!\1).)*\1\s*\)|url\((?:\\[\s\S]|[^)])*\)|(['"])(?:\\[\s\S]|(?!\2).)*\2/gi,Dc=/\0(\d+)/g,Fc=/(?:^|\}|\{|\x01)\s*([^\{\}\0\x01]+)\s*(?=\{)/g,zc=/@import\s*\([^)]*\)\s*;?/gi,Uc=/\x01/g,$c=/@keyframes\s+[^\{\}]+\s*\{(?:[^{}]+|\{[^{}]+})*}/gi,qc=/((?:(?:\[[^\]]+\])|(?:[^\s\+\>~:]))+)((?:::?[^\s\+\>\~\(:]+(?:\([^\)]+\))?)*\s*[\s\+\>\~]?)\s*/g,Hc=/^(?:@|\d+%)/,Zc=/\[data-ractive-css~="\{[a-z0-9-]+\}"]/g,Wc=function(t){function e(e){t.call(this,e.cssData,"@style"),this.component=e}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.downstreamChanged=function(t,e){if(!this.locked){var n=this.component;n.extensions.forEach(function(n){var i=n._cssModel;i.mark(),i.downstreamChanged(t,e||1)}),e||Ti(n,!0)}},e}(Sl),Gc=/\{/,Qc={name:"css",extend:function(t,e,n,i){i._cssIds=Mi(t),Ra(i,"cssData",{configurable:!0,value:Pa(Ia(t.cssData),n.cssData||{})}),Ra(i,"_cssModel",{configurable:!0,value:new Wc(i)}),n.css&&Ii(n,i,e)},init:function(t,e,n){n.css&&y("\nThe css option is currently not supported on a per-instance basis and will be discarded. Instead, we recommend instantiating from a component definition with a css option.\n\nconst Component = Ractive.extend({\n	...\n	css: '/* your css */',\n	...\n});\n\nconst componentInstance = new Component({ ... })\n		")}},Yc={name:"data",extend:function(t,e,n){var i,r;if(n.data&&s(n.data))for(i in n.data)r=n.data[i],r&&o(r)&&(s(r)||Da(r))&&y("Passing a `data` option with object and array properties to Ractive.extend() is discouraged, as mutating them is likely to cause bugs. Consider using a data function instead:\n\n  // this...\n  data: function () {\n    return {\n      myObject: {}\n    };\n  })\n\n  // instead of this:\n  data: {\n    myObject: {}\n  }");e.data=Ki(e.data,n.data)},init:function(t,e,n){var i=Ki(t.prototype.data,n.data);if(u(i)&&(i=i.call(e)),i&&i.constructor===Object)for(var r in i)if(u(i[r])){var s=i[r];i[r]=B(s,e),i[r]._r_unbound=s}return i||{}},reset:function(t){var e=this.init(t.constructor,t,t.viewmodel);return t.viewmodel.root.set(e),!0}},Jc={name:"template",extend:function(t,e,n){if("template"in n){var i=n.template;u(i)?e.template=i:e.template=Ui(i,e)}},init:function(t,e,n){var i="template"in n?n.template:t.prototype.template;if(i=i||{v:To,t:[]},u(i)){var r=i;i=zi(e,r),e._config.template={fn:r,result:i}}i=Ui(i,e),e.template=i.t,i.p&&Hi(e.partials,i.p)},reset:function(t){var e=Fi(t);if(e){var n=Ui(e,t);return t.template=n.t,Hi(t.partials,n.p,!0),!0}}},Xc=["adaptors","components","computed","decorators","easing","events","helpers","interpolators","partials","transitions"],tf=["computed","helpers"],ef=function(t,e){this.name=t,this.useDefaults=e},nf=ef.prototype;nf.extend=function(t,e,n){var i=this.useDefaults?t.defaults:t,r=this.useDefaults?e:e.constructor;this.configure(i,r,n)},nf.init=function(){},nf.configure=function(t,e,n){var i=this.name,r=n[i],s=Ia(t[i]);Pa(s,r),e[i]=s,"partials"===i&&e[i]&&Ka(e[i]).forEach(function(t){dt(e[i][t])})},nf.reset=function(t){var e=t[this.name],n=!1;return Ka(e).forEach(function(t){var i=e[t];i._fn&&(i._fn.isOwner?e[t]=i._fn:delete e[t],n=!0)}),n};var rf=Xc.map(function(t){var e=tf.indexOf(t)>-1;return new ef(t,e)}),sf={extend:function(t,e,n,i){return Ji("extend",t,e,n,i)},init:function(t,e,n){return Ji("init",t,e,n)},reset:function(t){return lf.filter(function(e){return e.reset&&e.reset(t)}).map(function(t){return t.name})}},af={adapt:Bc,computed:sf,css:Qc,data:Yc,helpers:sf,template:Jc},of=Ka(ao),uf=tr(of.filter(function(t){return!af[t]})),hf=tr(of.concat(rf.map(function(t){return t.name}),["on","observe","attributes","cssData","use"])),lf=[].concat(of.filter(function(t){return!rf[t]&&!af[t]}),rf,af.template,af.css),cf=/\b_super\b/,ff=function(t){this.up=t.up,this.ractive=t.up.ractive,this.template=t.template,this.index=t.index,this.type=t.template.t,this.dirty=!1},df=ff.prototype;df.bubble=function(){this.dirty||(this.dirty=!0,this.up.bubble())},df.destroyed=function(){this.fragment&&this.fragment.destroyed()},df.find=function(){return null},df.findComponent=function(){return null},df.findNextNode=function(){return this.up.findNextNode(this)},df.rebound=function(t){this.fragment&&this.fragment.rebound(t)},df.shuffled=function(){this.fragment&&this.fragment.shuffled()},df.valueOf=function(){return this.toString()},ff.prototype.findAll=f,ff.prototype.findAllComponents=f;var pf=function(t){function e(e){t.call(this,e)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.detach=function(){return this.fragment?this.fragment.detach():ti()},n.find=function(t){return this.fragment?this.fragment.find(t):void 0},n.findAll=function(t,e){this.fragment&&this.fragment.findAll(t,e)},n.findComponent=function(t){return this.fragment?this.fragment.findComponent(t):void 0},n.findAllComponents=function(t,e){this.fragment&&this.fragment.findAllComponents(t,e)},n.firstNode=function(t){return this.fragment&&this.fragment.firstNode(t)},n.toString=function(t){return this.fragment?this.fragment.toString(t):""},e}(ff),mf=/\s+/,vf=[void 0,"text","search","url","email","hidden","password","search","reset","submit"],gf={"accept-charset":"acceptCharset",accesskey:"accessKey",bgcolor:"bgColor","class":"className",codebase:"codeBase",colspan:"colSpan",contenteditable:"contentEditable",datetime:"dateTime",dirname:"dirName","for":"htmlFor","http-equiv":"httpEquiv",ismap:"isMap",maxlength:"maxLength",novalidate:"noValidate",pubdate:"pubDate",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"},yf=Ua?ic("div"):null,bf=!1,wf=function(t){function e(e){t.call(this,e),this.attributes=[],this.owner=e.owner,this.fragment=new Vp({ractive:this.ractive,owner:this,template:this.template}),this.fragment.findNextNode=f,this.dirty=!1}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){this.fragment.bind()},n.bubble=function(){this.dirty||(this.dirty=!0,this.owner.bubble())},n.destroyed=function(){this.unrender()},n.render=function(){this.node=this.owner.node,this.node&&(this.isSvg=this.node.namespaceURI===mc),bf=!0,this.rendered||this.fragment.render(),this.rendered=!0,this.dirty=!0,this.update(),bf=!1},n.toString=function(){return this.fragment.toString()},n.unbind=function(t){this.fragment.unbind(t)},n.unrender=function(){this.rendered=!1,this.fragment.unrender()},n.update=function(){var t,e,n=this;if(this.dirty){this.dirty=!1;var i=bf;bf=!0,this.fragment.update(),this.rendered&&this.node&&(t=this.fragment.toString(),e=wr(t,this.isSvg),this.attributes.filter(function(t){return xr(e,t)}).forEach(function(t){n.node.removeAttribute(t.name)}),e.forEach(function(t){n.node.setAttribute(t.name,t.value)}),this.attributes=e),bf=i||!1}},e}(ff),xf=/^\s*$/,kf=!1,_f=function(t){function e(e){return t.call(this,e),this.name=e.template.n,this.namespace=null,this.owner=e.owner||e.up.owner||e.element||Fn(e.up),this.element=e.element||(this.owner.attributeByName?this.owner:Fn(e.up)),this.up=e.up,this.ractive=this.up.ractive,this.rendered=!1,this.updateDelegate=null,this.fragment=null,this.element.attributeByName[this.name]=this,Da(e.template.f)?(this.fragment=new Vp({owner:this,template:e.template.f}),this.interpolator=this.fragment&&1===this.fragment.items.length&&this.fragment.items[0].type===Bo&&this.fragment.items[0],void(this.interpolator&&(this.interpolator.owner=this))):(this.value=e.template.f,void(0===this.value?this.value="":c(this.value)&&(this.value=!0)))}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){this.fragment&&this.fragment.bind()},n.bubble=function(){this.dirty||(this.up.bubble(),this.element.bubble(),this.dirty=!0)},n.firstNode=function(){},n.getString=function(){kf=!0;var t=this.fragment?this.fragment.toString():null!=this.value?""+this.value:"";return kf=!1,t},n.getValue=function(){kf=!0;var t=this.fragment?this.fragment.valueOf():Ru[this.name.toLowerCase()]?!0:this.value;return kf=!1,t},n.render=function(){var t=this.element.node;if(this.node=t,t.namespaceURI&&t.namespaceURI!==bc.html||(this.propertyName=gf[this.name]||this.name,void 0!==t[this.propertyName]&&(this.useProperty=!0),(Ru[this.name.toLowerCase()]||this.isTwoway)&&(this.isBoolean=!0),"value"===this.propertyName&&(t._ractive.value=this.value)),t.namespaceURI){var e=this.name.indexOf(":");-1!==e?this.namespace=kr(t,this.name.slice(0,e)):this.namespace=t.namespaceURI}this.rendered=!0,this.updateDelegate=ir(this),this.updateDelegate()},n.toString=function(){if(br())return"";kf=!0;var t=this.getValue();if("value"!==this.name||void 0===this.element.getAttribute("contenteditable")&&"select"!==this.element.name&&"textarea"!==this.element.name){if("name"===this.name&&"input"===this.element.name&&this.interpolator&&"radio"===this.element.getAttribute("type"))return'name="{{'+this.interpolator.model.getKeypath()+'}}"';if(this.owner!==this.element||"style"!==this.name&&"class"!==this.name&&!this.style&&!this.inlineClass){if(!(this.rendered||this.owner!==this.element||this.name.indexOf("style-")&&this.name.indexOf("class-")))return void(this.name.indexOf("style-")?this.inlineClass=this.name.substr(6):this.style=_e(this.name.substr(6)));if(Ru[this.name.toLowerCase()])return t?h(t)?this.name+'="'+ri(t)+'"':this.name:"";if(null==t)return"";var e=ri(this.getString());return kf=!1,e?this.name+'="'+e+'"':this.name}}},n.unbind=function(t){this.fragment&&this.fragment.unbind(t)},n.unrender=function(){this.updateDelegate(!0),this.rendered=!1},n.update=function(){if(this.dirty){var t;if(this.dirty=!1,this.fragment&&this.fragment.update(),this.rendered&&this.updateDelegate(),this.isTwoway&&!this.locked)this.interpolator.twowayBinding.lastVal(!0,this.interpolator.model.get());else if("value"===this.name&&(t=this.element.binding)){var e=t.attribute;e&&!e.dirty&&e.rendered&&this.element.binding.attribute.updateDelegate()}}},e}(ff),Ef=function(t){function e(e){t.call(this,e),this.owner=e.owner||e.up.owner||Fn(e.up),this.element=this.owner.attributeByName?this.owner:Fn(e.up),this.flag="l"===e.template.v?"lazy":"twoway",this.bubbler=this.owner===this.element?this.element:this.up,this.element.type===zo&&(Da(e.template.f)&&(this.fragment=new Vp({owner:this,template:e.template.f})),this.interpolator=this.fragment&&1===this.fragment.items.length&&this.fragment.items[0].type===Bo&&this.fragment.items[0])}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){this.fragment&&this.fragment.bind(),Er(this,this.getValue(),!0)},n.bubble=function(){this.dirty||(this.bubbler.bubble(),this.dirty=!0)},n.getValue=function(){return this.fragment?this.fragment.valueOf():"value"in this?this.value:"f"in this.template?this.template.f:!0},n.render=function(){Er(this,this.getValue(),!0)},n.toString=function(){return""},n.unbind=function(t){this.fragment&&this.fragment.unbind(t),delete this.element[this.flag]},n.unrender=function(){this.element.rendered&&this.element.recreateTwowayBinding()},n.update=function(){this.dirty&&(this.dirty=!1,this.fragment&&this.fragment.update(),Er(this,this.getValue(),!0))},e}(ff),Af=Ia(ff.prototype);Pa(Af,{bind:f,unbind:f,update:f,detach:function(){return ni(this.node)},firstNode:function(){return this.node},render:function(t){this.rendered=!0,this.node=Ua.createComment(this.template.c),t.appendChild(this.node)},toString:function(){return"<!-- "+this.template.c+" -->"},unrender:function(t){this.rendered&&t&&this.detach(),this.rendered=!1}}),Ar.prototype=Af;var Cf=function(t){function e(e){t.call(this,e,"@this"),this.ractive=e}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.joinKey=function(e){var n=t.prototype.joinKey.call(this,e);return"root"!==e&&"parent"!==e||n.isLink?"data"===e?this.ractive.viewmodel:"cssData"===e?this.ractive.constructor._cssModel:n:Or(n,e)},e}(Sl),Sf={"@this":function(t){return t.getRactiveModel()},"@global":function(){return jl},"@shared":function(){return Ol},"@style":function(t){return t.getRactiveModel().joinKey("cssData")},"@helpers":function(t){return t.getHelpers()}};Sf["@"]=Sf["@this"];var Of=function(t){function e(e){t.call(this,null,null),this.isRoot=!0,this.root=this,this.ractive=e.ractive,this.value=e.data,this.adaptors=e.adapt,this.adapt()}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.attached=function(t){jr(this,t)},n.createLink=function(t,e,n,i){for(var r=A(t),s=this;r.length;){var a=r.shift();s=s.childByKey[a]||s.joinKey(a)}return s.link(e,n,i)},n.detached=function(){Nr(this)},n.get=function(t,e){return t&&H(this),e&&e.virtual===!1?this.value:this.getVirtual()},n.getHelpers=function(){return this.helpers||(this.helpers=new Sl(this.ractive.helpers,"helpers",this.ractive)),this.helpers},n.getKeypath=function(){return""},n.getRactiveModel=function(){return this.ractiveModel||(this.ractiveModel=new Cf(this.ractive))},n.getValueChildren=function(){var e=t.prototype.getValueChildren.call(this,this.value);return this.children.forEach(function(t){if(t._link){var n=e.indexOf(t);~n?e.splice(n,1,t._link):e.push(t._link)}}),e},n.has=function(e){if("~"===e[0]&&"/"===e[1]&&(e=e.slice(2)),Sf[e]||""===e)return!0;if(t.prototype.has.call(this,e))return!0;var n=C(e);return this.childByKey[n]&&this.childByKey[n]._link?!0:void 0},n.joinKey=function(e,n){if("~"===e[0]&&"/"===e[1]&&(e=e.slice(2)),"@"!==e[0])return t.prototype.joinKey.call(this,e,n);var i=Sf[e];return i?i(this):void 0},n.set=function(t){var e=this.wrapper;if(e){var n=!e.reset||e.reset(t)===!1;n&&(e.teardown(),this.wrapper=null,this.value=t,this.adapt())}else this.value=t,this.adapt();this.deps.forEach(Q),this.children.forEach(Y)},n.retrieve=function(){return this.wrapper?this.wrapper.get():this.value},n.teardown=function(){t.prototype.teardown.call(this),this.ractiveModel&&this.ractiveModel.teardown()},e}(Al);Of.prototype.update=f;var jf=["adaptors","components","decorators","easing","events","interpolators","partials","transitions"],Nf=["computed","helpers"],Tf=0,Vf=function(t){function e(e,n){var i=this;t.call(this,e);var r=e.template;this.isAnchor=r.t===Ho,this.type=this.isAnchor?Ho:Go;var s=r.m,a=r.p||{};if("content"in a||(a.content=r.f||[]),this._partials=a,this.isAnchor)this.name=r.n,this.addChild=Rr,this.removeChild=Br;else{var o=Ia(n.prototype);this.instance=o,this.name=r.e,(o.el||o.target)&&(y("The <"+this.name+"> component has a default '"+(o.el?"el":"target")+"' property; it has been disregarded"),o.el=o.target=null);for(var u,l=e.up;l;){if(l.owner.type===Qo){u=l.owner.container;break}l=l.parent}o.parent=this.up.ractive,o.container=u||null,o.root=o.parent.root,o.component=this,Vr(this.instance,{partials:a}),r=this.template,s=r.m,Da(this.mappings)?s=(s||[]).concat(this.mappings):h(this.mappings)&&(s=(s||[]).concat(dl.parse(this.mappings,{attributes:!0}).t)),o._inlinePartials=a}if(this.attributeByName={},this.attributes=[],s){var c=[];s.forEach(function(t){switch(t.t){case Zo:case Cu:i.attributes.push(Ws({owner:i,up:i.up,template:t}));break;case Ou:case ju:case Su:break;default:c.push(t)}}),c.length&&this.attributes.push(new wf({owner:this,up:this.up,template:c}))}this.eventHandlers=[]}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){this.isAnchor||(this.attributes.forEach(Z),this.eventHandlers.forEach(Z),Js(this.instance,{partials:this._partials},{cssIds:this.up.cssIds}),(this.instance.target||this.instance.el)&&(this.extern=!0),this.bound=!0)},n.bubble=function(){this.dirty||(this.dirty=!0,this.up.bubble())},n.destroyed=function(){!this.isAnchor&&this.instance.fragment&&this.instance.fragment.destroyed()},n.detach=function(){return this.isAnchor?this.instance?this.instance.fragment.detach():ti():this.instance.fragment.detach()},n.find=function(t,e){return this.instance?this.instance.fragment.find(t,e):void 0},n.findAll=function(t,e){this.instance&&this.instance.fragment.findAll(t,e)},n.findComponent=function(t,e){return t&&this.name!==t?this.instance.fragment?this.instance.fragment.findComponent(t,e):void 0:this.instance},n.findAllComponents=function(t,e){var n=e.result;!this.instance||t&&this.name!==t||n.push(this.instance),this.instance&&this.instance.findAllComponents(t,e)},n.firstNode=function(t){return this.instance?this.instance.fragment.firstNode(t):void 0},n.getContext=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.unshift(this.instance),en.apply(null,t)},n.rebound=function(t){this.attributes.forEach(function(e){return e.rebound(t)})},n.render=function(t,e){this.isAnchor?(this.rendered=!0,this.target=t,Mf.length||(Mf.push(this.ractive),e?(this.occupants=e,Dr(),this.occupants=null):yl.scheduleTask(Dr,!0))):(this.attributes.forEach(et),this.eventHandlers.forEach(et),this.extern?(this.instance.delegate=!1,this.instance.render()):ta(this.instance,t,null,e),this.rendered=!0)},n.shuffled=function(){t.prototype.shuffled.call(this),this.instance&&!this.instance.isolated&&this.instance.fragment&&this.instance.fragment.shuffled()},n.toString=function(){return this.instance?this.instance.toHTML():void 0},n.unbind=function(t){this.isAnchor||(this.bound=!1,this.attributes.forEach(rt),t?this.instance.fragment.unbind():Sr(this.instance,function(){return yl.promise()}))},n.unrender=function(t){this.shouldDestroy=t,this.isAnchor?(this.item&&Lr(this,this.item),this.target=null,Mf.length||(Mf.push(this.ractive),yl.scheduleTask(Dr,!0))):(this.instance.unrender(),this.instance.el=this.instance.target=null,this.attributes.forEach(st),this.eventHandlers.forEach(st)),this.rendered=!1},n.update=function(){this.dirty=!1,this.instance&&(this.instance.fragment.update(),this.attributes.forEach(at),this.eventHandlers.forEach(at))},e}(ff),Mf=[],Pf={update:f,teardown:f},If=function(t){this.owner=t.owner||t.up.owner||Fn(t.up),this.element=this.owner.attributeByName?this.owner:Fn(t.up),this.up=t.up||this.owner.up,this.ractive=this.owner.ractive;var e=this.template=t.template;this.name=e.n,this.node=null,this.handle=null,this.element.decorators.push(this)},Rf=If.prototype;Rf.bind=function(){var t=this.element===this.owner?new Vp({owner:this.owner}):this.up;Fr(this,this.template,t,{register:!0})},Rf.bubble=function(){this.dirty||(this.dirty=!0,this.owner.bubble(),this.up.bubble())},Rf.destroyed=function(){this.handle&&(this.handle.teardown(),this.handle=null),this.shouldDestroy=!0},Rf.handleChange=function(){this.bubble()},Rf.rebind=function(t,e,n){var i=this.models.indexOf(e);~i&&(t=ht(this.template.f.r[i],t,e),t!==e&&(e.unregister(this),this.models.splice(i,1,t),t&&t.addShuffleRegister(this,"mark"),n||this.bubble()))},Rf.rebound=function(t){Ur(this,this.template),Fr(this,this.template,this.up,{register:!0}),t&&this.bubble()},Rf.render=function(){var t=this;this.shouldDestroy=!1,this.handle&&this.unrender(),yl.scheduleTask(function(){if(t.element.rendered){var e=w("decorators",t.ractive,t.name);if(!e)return g(po(t.name,"decorator")),void(t.handle=Pf);t.node=t.element.node;var n;if(t.fn&&(n=t.models.map(function(t){return t?t.get():void 0}),n=t.fn.apply(t.ractive,n)),t.handle=e.apply(t.ractive,[t.node].concat(n)),!t.handle||!t.handle.teardown)throw new Error("The '"+t.name+"' decorator must return an object with a teardown method");t.shouldDestroy&&t.destroyed()}},!0)},Rf.toString=function(){return""},Rf.unbind=function(){Ur(this,this.template)},Rf.unrender=function(t){t&&!this.element.rendered||!this.handle||(this.handle.teardown(),this.handle=null)},Rf.update=function(){var t=this.handle;if(!this.dirty)return void(t&&t.invalidate&&yl.scheduleTask(function(){return t.invalidate()},!0));if(this.dirty=!1,t)if(t.update){var e=this.models.map(function(t){return t&&t.get()});t.update.apply(this.ractive,this.fn.apply(this.ractive,e))}else this.unrender(),this.render()},If.prototype.firstNode=f;var Bf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.toString=function(){return"<!DOCTYPE"+this.template.a+">"},e}(ff),Kf=Bf.prototype;Kf.bind=Kf.render=Kf.teardown=Kf.unbind=Kf.unrender=Kf.update=f;var Lf=function(t,e){void 0===e&&(e="value"),this.element=t,this.ractive=t.ractive,this.attribute=t.attributeByName[e];var n=this.attribute.interpolator;n.twowayBinding=this;var i=n.model;if(i.isReadonly&&!i.setRoot){var r=i.getKeypath().replace(/^@/,"");return b("Cannot use two-way binding on <"+t.name+"> element: "+r+" is read-only. To suppress this warning use <"+t.name+" twoway='false'...>",{ractive:this.ractive}),!1}this.attribute.isTwoway=!0,this.model=i;var s=i.get();this.wasUndefined=c(s),c(s)&&this.getInitialValue&&(s=this.getInitialValue(),i.set(s)),this.lastVal(!0,s);var a=Fn(this.element,!1,"form");a&&(this.resetValue=s,a.formBindings.push(this))},Df=Lf.prototype;Df.bind=function(){this.model.registerTwowayBinding(this)},Df.handleChange=function(){var t=this,e=this.getValue();this.lastVal()!==e&&(yl.start(),this.attribute.locked=!0,this.model.set(e),this.lastVal(!0,e),this.model.get()!==e?this.attribute.locked=!1:yl.scheduleTask(function(){return t.attribute.locked=!1}),yl.end())},Df.lastVal=function(t,e){return t?void(this.lastValue=e):this.lastValue},Df.rebind=function(t,e){var n=this;this.model&&this.model===e&&e.unregisterTwowayBinding(this),t&&(this.model=t,yl.scheduleTask(function(){return t.registerTwowayBinding(n)}))},Df.rebound=function(){this.model&&this.model.unregisterTwowayBinding(this),this.model=this.attribute.interpolator.model,this.model&&this.model.registerTwowayBinding(this)},Df.render=function(){this.node=this.element.node,this.node._ractive.binding=this,this.rendered=!0},Df.setFromNode=function(t){this.model.set(t.value)},Df.unbind=function(){this.model&&this.model.unregisterTwowayBinding(this)},Lf.prototype.unrender=f;var Ff=function(t){function e(e){t.call(this,e,"checked")}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.render=function(){t.prototype.render.call(this),this.element.on("change",$r),this.node.attachEvent&&this.element.on("click",$r)},n.unrender=function(){this.element.off("change",$r),this.node.attachEvent&&this.element.off("click",$r)},n.getInitialValue=function(){return!!this.element.getAttribute("checked")},n.getValue=function(){return this.node.checked},n.setFromNode=function(t){this.model.set(t.checked)},e}(Lf),zf=function(t,e,n){var i=this;this.model=e,this.hash=t,this.getValue=function(){return i.value=n.call(i),i.value},this.bindings=[]},Uf=zf.prototype;Uf.add=function(t){this.bindings.push(t)},Uf.bind=function(){this.value=this.model.get(),this.model.registerTwowayBinding(this),this.bound=!0},Uf.remove=function(t){V(this.bindings,t),this.bindings.length||this.unbind()},Uf.unbind=function(){this.model.unregisterTwowayBinding(this),this.bound=!1,delete this.model[this.hash]},zf.prototype.rebind=Lf.prototype.rebind;var $f=[].push,qf=function(t){function e(e){if(t.call(this,e,"name"),this.checkboxName=!0,this.group=qr("checkboxes",this.model,Hr),this.group.add(this),this.noInitialValue&&(this.group.noInitialValue=!0),this.group.noInitialValue&&this.element.getAttribute("checked")){var n=this.model.get(),i=this.element.getAttribute("value");this.arrayContains(n,i)||$f.call(n,i)}}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){this.group.bound||this.group.bind()},n.getInitialValue=function(){return this.noInitialValue=!0,[]},n.getValue=function(){return this.group.value},n.handleChange=function(){this.isChecked=this.element.node.checked,this.group.value=this.model.get().slice();var e=this.element.getAttribute("value");this.isChecked&&!this.arrayContains(this.group.value,e)?this.group.value.push(e):!this.isChecked&&this.arrayContains(this.group.value,e)&&this.removeFromArray(this.group.value,e),this.lastValue=null,t.prototype.handleChange.call(this)},n.render=function(){t.prototype.render.call(this);var e=this.node,n=this.model.get(),i=this.element.getAttribute("value");Da(n)?this.isChecked=this.arrayContains(n,i):this.isChecked=this.element.compare(n,i),e.name="{{"+this.model.getKeypath()+"}}",e.checked=this.isChecked,this.element.on("change",$r),this.node.attachEvent&&this.element.on("click",$r)},n.setFromNode=function(t){if(this.group.bindings.forEach(function(t){return t.wasUndefined=!0}),t.checked){
var e=this.group.getValue();e.push(this.element.getAttribute("value")),this.group.model.set(e)}},n.unbind=function(){this.group.remove(this)},n.unrender=function(){var t=this.element;t.off("change",$r),this.node.attachEvent&&t.off("click",$r)},n.arrayContains=function(t,e){for(var n=this,i=t.length;i--;)if(n.element.compare(e,t[i]))return!0;return!1},n.removeFromArray=function(t,e){var n=this;if(t)for(var i=t.length;i--;)n.element.compare(e,t[i])&&t.splice(i,1)},e}(Lf),Hf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getInitialValue=function(){return this.element.fragment?this.element.fragment.toString():""},n.getValue=function(){return this.element.node.innerHTML},n.render=function(){t.prototype.render.call(this);var e=this.element;e.on("change",$r),e.on("blur",$r),this.ractive.lazy||(e.on("input",$r),this.node.attachEvent&&e.on("keyup",$r))},n.setFromNode=function(t){this.model.set(t.innerHTML)},n.unrender=function(){var t=this.element;t.off("blur",$r),t.off("change",$r),t.off("input",$r),t.off("keyup",$r)},e}(Lf),Zf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getInitialValue=function(){return""},n.getValue=function(){return this.node.value},n.render=function(){t.prototype.render.call(this);var e=this.ractive.lazy,n=!1,i=this.element;"lazy"in this.element&&(e=this.element.lazy),r(e)&&(n=+e,e=!1),this.handler=n?Wr(n):$r;var s=this.node;i.on("change",$r),"file"!==s.type&&(e||(i.on("input",this.handler),s.attachEvent&&i.on("keyup",this.handler)),i.on("blur",Zr))},n.unrender=function(){var t=this.element;this.rendered=!1,t.off("change",$r),t.off("input",this.handler),t.off("keyup",this.handler),t.off("blur",Zr)},e}(Lf),Wf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getInitialValue=function(){return void 0},n.getValue=function(){return this.node.files},n.render=function(){this.element.lazy=!1,t.prototype.render.call(this)},n.setFromNode=function(t){this.model.set(t.files)},e}(Zf),Gf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getInitialValue=function(){return this.element.options.filter(function(t){return t.getAttribute("selected")}).map(function(t){return t.getAttribute("value")})},n.getValue=function(){for(var t=this.element.node.options,e=t.length,n=[],i=0;e>i;i+=1){var r=t[i];if(r.selected){var s=r._ractive?r._ractive.value:r.value;n.push(s)}}return n},n.handleChange=function(){var e=this.attribute,n=e.getValue(),i=this.getValue();return(c(n)||!j(i,n))&&t.prototype.handleChange.call(this),this},n.render=function(){t.prototype.render.call(this),this.element.on("change",$r),c(this.model.get())&&this.handleChange()},n.setFromNode=function(t){for(var e=Gr(t),n=e.length,i=new Array(n);n--;){var r=e[n];i[n]=r._ractive?r._ractive.value:r.value}this.model.set(i)},n.unrender=function(){this.element.off("change",$r)},e}(Lf),Qf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getInitialValue=function(){return void 0},n.getValue=function(){var t=parseFloat(this.node.value);return isNaN(t)?void 0:t},n.setFromNode=function(t){var e=parseFloat(t.value);isNaN(e)||this.model.set(e)},e}(Zf),Yf={},Jf=function(t){function e(e){t.call(this,e,"checked"),this.siblings=Qr(this.ractive._guid+this.element.getAttribute("name")),this.siblings.push(this)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getValue=function(){return this.node.checked},n.handleChange=function(){yl.start(),this.siblings.forEach(function(t){t.model.set(t.getValue())}),yl.end()},n.render=function(){t.prototype.render.call(this),this.element.on("change",$r),this.node.attachEvent&&this.element.on("click",$r)},n.setFromNode=function(t){this.model.set(t.checked)},n.unbind=function(){V(this.siblings,this)},n.unrender=function(){this.element.off("change",$r),this.node.attachEvent&&this.element.off("click",$r)},e}(Lf),Xf=function(t){function e(e){var n=this;t.call(this,e,"name"),this.group=qr("radioname",this.model,Yr),this.group.add(this),e.checked&&(this.group.value=this.getValue()),this.attribute.interpolator.pathChanged=function(){return n.updateName()}}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){this.group.bound||this.group.bind()},n.getInitialValue=function(){return this.element.getAttribute("checked")?this.element.getAttribute("value"):void 0},n.getValue=function(){return this.element.getAttribute("value")},n.handleChange=function(){this.node.checked&&(this.group.value=this.getValue(),t.prototype.handleChange.call(this)),this.updateName()},n.lastVal=function(t,e){return this.group?t?void(this.group.lastValue=e):this.group.lastValue:void 0},n.rebind=function(e,n){t.prototype.rebind.call(this,e,n),this.updateName()},n.rebound=function(e){t.prototype.rebound.call(this,e),this.updateName()},n.render=function(){t.prototype.render.call(this);var e=this.node;this.updateName(),e.checked=this.element.compare(this.model.get(),this.element.getAttribute("value")),this.element.on("change",$r),e.attachEvent&&this.element.on("click",$r)},n.setFromNode=function(t){t.checked&&this.group.model.set(this.element.getAttribute("value"))},n.unbind=function(){this.group.remove(this)},n.unrender=function(){var t=this.element;t.off("change",$r),this.node.attachEvent&&t.off("click",$r)},n.updateName=function(){this.node&&(this.node.name="{{"+this.model.getKeypath()+"}}")},e}(Lf),td=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.forceUpdate=function(){var t=this,e=this.getValue();void 0!==e&&(this.attribute.locked=!0,yl.scheduleTask(function(){return t.attribute.locked=!1}),this.model.set(e))},n.getInitialValue=function(){if(void 0===this.element.getAttribute("value")){var t=this.element.options,e=t.length;if(e){for(var n,i,r=e;r--;){var s=t[r];if(s.getAttribute("selected")){s.getAttribute("disabled")||(n=s.getAttribute("value")),i=!0;break}}if(!i)for(;++r<e;)if(!t[r].getAttribute("disabled")){n=t[r].getAttribute("value");break}return void 0!==n&&(this.element.attributeByName.value.value=n),n}}},n.getValue=function(){var t,e=this.node.options,n=e.length;for(t=0;n>t;t+=1){var i=e[t];if(e[t].selected&&!e[t].disabled)return i._ractive?i._ractive.value:i.value}},n.render=function(){t.prototype.render.call(this),this.element.on("change",$r)},n.setFromNode=function(t){var e=Gr(t)[0];this.model.set(e._ractive?e._ractive.value:e.value)},n.unrender=function(){this.element.off("change",$r)},e}(Lf),ed=/;\s*$/,nd=function(t){function e(e){var n=this;if(t.call(this,e),this.name=e.template.e.toLowerCase(),this.parent=Fn(this.up,!1),this.parent&&"option"===this.parent.name)throw new Error("An <option> element cannot contain other elements (encountered <"+this.name+">)");this.decorators=[],this.attributeByName={};for(var i,r,s,a,o,u,l,c,f=this.template.m,d=f&&f.length||0,p=0;d>p;p++)if(l=f[p],l.g)(n.statics||(n.statics={}))[l.n]=h(l.f)?l.f:l.n;else switch(l.t){case Zo:case ju:case Su:case Cu:case Ou:s=Ws({owner:n,up:n.up,template:l}),r=l.n,i=i||(i=n.attributes=[]),"value"===r?a=s:"name"===r?u=s:"class"===r?o=s:i.push(s);break;case Nu:n.delegate=!1;break;default:(c||(c=[])).push(l)}a&&i.push(a),u&&i.push(u),o&&i.unshift(o),c&&((i||(this.attributes=[])).push(new wf({owner:this,up:this.up,template:c})),c=[]),e.template.f&&!e.deferContent&&(this.fragment=new Vp({template:e.template.f,owner:this,cssIds:null})),this.binding=null}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){var t=this.attributes;if(t){t.binding=!0;for(var e=t.length,n=0;e>n;n++)t[n].bind();t.binding=!1}this.fragment&&this.fragment.bind(),this.binding?this.binding.bind():this.recreateTwowayBinding()},n.createTwowayBinding=function(){if("twoway"in this?this.twoway:this.ractive.twoway){var t=Xr(this);if(t){var e=new t(this);if(e&&e.model)return e}}},n.destroyed=function(){this.attributes&&this.attributes.forEach(G),this.fragment&&this.fragment.destroyed()},n.detach=function(){return this.rendered||this.destroyed(),ni(this.node)},n.find=function(t,e){return this.node&&rc(this.node,t)?this.node:this.fragment?this.fragment.find(t,e):void 0},n.findAll=function(t,e){var n=e.result;rc(this.node,t)&&n.push(this.node),this.fragment&&this.fragment.findAll(t,e)},n.findNextNode=function(){return null},n.firstNode=function(){return this.node},n.getAttribute=function(t){if(this.statics&&t in this.statics)return this.statics[t];var e=this.attributeByName[t];return e?e.getValue():void 0},n.getContext=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return this.fragment?(n=this.fragment).getContext.apply(n,t):(this.ctx||(this.ctx=new tc(this.up,this)),t.unshift(Ia(this.ctx)),Pa.apply(null,t));var n},n.off=function(t,e,n){void 0===n&&(n=!1);var i=this.up.delegate,r=this.listeners&&this.listeners[t];if(r)if(V(r,e),i){var s=(i.listeners||(i.listeners=[]))&&(i.listeners[t]||(i.listeners[t]=[]));s.refs&&!--s.refs&&i.off(t,is,!0)}else if(this.rendered){var a=this.node,o=a.addEventListener,u=a.removeEventListener;r.length?r.length&&!r.refs&&n&&(u.call(a,t,ss,!0),o.call(a,t,ss,!1)):u.call(a,t,ss,n)}},n.on=function(t,e,n){void 0===n&&(n=!1);var i=this.up.delegate,r=(this.listeners||(this.listeners={}))[t]||(this.listeners[t]=[]);if(i){var s=(i.listeners||(i.listeners=[]))&&i.listeners[t]||(i.listeners[t]=[]);s.refs?s.refs++:(s.refs=0,i.on(t,is,!0),s.refs++)}else if(this.rendered){var a=this.node,o=a.addEventListener,u=a.removeEventListener;r.length?r.length&&!r.refs&&n&&(u.call(a,t,ss,!1),o.call(a,t,ss,!0)):o.call(a,t,ss,n)}S(this.listeners[t],e)},n.recreateTwowayBinding=function(){this.binding&&(this.binding.unbind(),this.binding.unrender()),(this.binding=this.createTwowayBinding())&&(this.binding.bind(),this.rendered&&this.binding.render())},n.rebound=function(e){t.prototype.rebound.call(this,e),this.attributes&&this.attributes.forEach(function(t){return t.rebound(e)}),this.binding&&this.binding.rebound(e)},n.render=function(t,e){var n=this;this.namespace=ns(this);var i,r=!1;if(e)for(var s;s=e.shift();){if(s.nodeName.toUpperCase()===n.template.e.toUpperCase()&&s.namespaceURI===n.namespace){n.node=i=s,r=!0;break}ni(s)}if(!r&&this.node&&(i=this.node,t.appendChild(i),r=!0),!i){var a=this.template.e;i=ic(this.namespace===dc?a.toLowerCase():a,this.namespace,this.getAttribute("is")),this.node=i}Ra(i,"_ractive",{value:{proxy:this},configurable:!0}),this.statics&&Ka(this.statics).forEach(function(t){i.setAttribute(t,n.statics[t])}),r&&this.foundNode&&this.foundNode(i);var o=this.intro;if(o&&o.shouldFire("intro")&&(o.isIntro=!0,o.isOutro=!1,yl.registerTransition(o)),this.fragment){var u=r?P(i.childNodes):void 0;this.fragment.render(i,u),u&&u.forEach(ni)}if(r){this.binding&&this.binding.wasUndefined&&this.binding.setFromNode(i);for(var h=i.attributes.length;h--;){var l=i.attributes[h].name;l in n.attributeByName||n.statics&&l in n.statics||i.removeAttribute(l)}}if(this.up.cssIds&&i.setAttribute("data-ractive-css",this.up.cssIds.map(function(t){return"{"+t+"}"}).join(" ")),this.attributes)for(var c=this.attributes.length,f=0;c>f;f++)n.attributes[f].render();if(this.binding&&this.binding.render(),!this.up.delegate&&this.listeners){var d=this.listeners;for(var p in d)d[p]&&d[p].length&&n.node.addEventListener(p,ss,!!d[p].refs)}r||t.appendChild(i),this.rendered=!0},n.toString=function(){var t=this,e=this.template.e,n=this.attributes&&this.attributes.map(es).join("")||"";this.statics&&Ka(this.statics).forEach(function(e){return"class"!==e&&"style"!==e&&(n=" "+e+'="'+t.statics[e]+'"'+n)}),"option"===this.name&&this.isSelected()&&(n+=" selected"),"input"===this.name&&ts(this)&&(n+=" checked");var i=this.statics?this.statics.style:void 0,r=this.statics?this.statics["class"]:void 0;this.attributes&&this.attributes.forEach(function(t){"class"===t.name?r=(r||"")+(r?" ":"")+ri(t.getString()):"style"===t.name?(i=(i||"")+(i?" ":"")+ri(t.getString()),i&&!ed.test(i)&&(i+=";")):t.style?i=(i||"")+(i?" ":"")+t.style+": "+ri(t.getString())+";":t.inlineClass&&t.getValue()&&(r=(r||"")+(r?" ":"")+t.inlineClass)}),void 0!==i&&(n=" style"+(i?'="'+i+'"':"")+n),void 0!==r&&(n=" class"+(r?'="'+r+'"':"")+n),this.up.cssIds&&(n+=' data-ractive-css="'+this.up.cssIds.map(function(t){return"{"+t+"}"}).join(" ")+'"');var s="<"+e+n+">";return Bu[this.name.toLowerCase()]?s:("textarea"===this.name&&void 0!==this.getAttribute("value")?s+=bt(this.getAttribute("value")):void 0!==this.getAttribute("contenteditable")&&(s+=this.getAttribute("value")||""),this.fragment&&(s+=this.fragment.toString(!/^(?:script|style)$/i.test(this.template.e))),s+="</"+e+">")},n.unbind=function(t){var e=this.attributes;if(e){e.unbinding=!0;for(var n=e.length,i=0;n>i;i++)e[i].unbind(t);e.unbinding=!1}this.binding&&this.binding.unbind(t),this.fragment&&this.fragment.unbind(t)},n.unrender=function(t){if(this.rendered){this.rendered=!1;var e=this.intro;e&&e.complete&&e.complete(),"option"===this.name?this.detach():t&&yl.detachWhenReady(this);var n=this.outro;n&&n.shouldFire("outro")&&(n.isIntro=!1,n.isOutro=!0,yl.registerTransition(n)),this.fragment&&this.fragment.unrender(),this.binding&&this.binding.unrender()}},n.update=function(){if(this.dirty){this.dirty=!1;var t=this.attributes;if(t)for(var e=t.length,n=0;e>n;n++)t[n].update();this.fragment&&this.fragment.update()}},e}(pf),id=null!==za?za.UIEvent:null,rd=function(t){function e(e){t.call(this,e),this.formBindings=[]}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.render=function(e,n){t.prototype.render.call(this,e,n),this.on("reset",as)},n.unrender=function(e){this.off("reset",as),t.prototype.unrender.call(this,e)},e}(nd),sd=function(t,e){-1!==t.indexOf("*")&&p('Only component proxy-events may contain "*" wildcards, <'+e.name+" on-"+t+'="..."/> is not valid'),this.name=t,this.owner=e,this.handler=null},ad=sd.prototype;ad.bind=function(){},ad.render=function(t){var e=this,n=this.name,i=function(){var i=e.owner.node;e.owner.on(n,e.handler=function(e){return t.fire({node:i,original:e,event:e,name:n})})};"load"!==n?yl.scheduleTask(i,!0):i()},ad.unbind=function(){},ad.unrender=function(){this.handler&&this.owner.off(this.name,this.handler)};var od=function(t,e,n,i){this.eventPlugin=t,this.owner=e,this.name=n,this.handler=null,this.args=i},ud=od.prototype;ud.bind=function(){},ud.render=function(t){var e=this;yl.scheduleTask(function(){var n=e.owner.node;e.handler=e.eventPlugin.apply(e.owner.ractive,[n,function(i){return void 0===i&&(i={}),i.original?i.event=i.original:i.original=i.event,i.name=e.name,i.node=i.node||n,t.fire(i)}].concat(e.args||[]))})},ud.unbind=function(){},ud.unrender=function(){this.handler.teardown()};var hd=function(t,e){this.component=t,this.name=e,this.handler=null},ld=hd.prototype;ld.bind=function(t){var e=this.component.instance;this.handler=e.on(this.name,function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n[0]instanceof tc){var r=n.shift();r.component=e,t.fire(r,n)}else t.fire({},n);return!1})},ld.render=function(){},ld.unbind=function(){this.handler.cancel()},ld.unrender=function(){};var cd=/^(event|arguments|@node|@event|@context)(\..+)?$/,fd=/^\$(\d+)(\..+)?$/,dd=function(t){this.owner=t.owner||t.up.owner||Fn(t.up),this.element=this.owner.attributeByName?this.owner:Fn(t.up,!0),this.template=t.template,this.up=t.up,this.ractive=t.up.ractive,this.events=[]},pd=dd.prototype;pd.bind=function(){var t=this;if(this.events.length&&(this.events.forEach(function(t){return t.unrender()}),this.events=[]),this.element.type===Go||this.element.type===Ho)this.template.n.forEach(function(e){t.events.push(new hd(t.element,e))});else{var e;if(e=this.template.a){var n=e.r.map(function(e){var n=Qe(t.up,e);return n?n.get():void 0});try{e=ft(e.s,n.length).apply(null,n)}catch(i){e=null,y("Failed to compute args for event on-"+this.template.n.join("- ")+": "+(i.message||i))}}this.template.n.forEach(function(n){var i=w("events",t.ractive,n);i?t.events.push(new od(i,t.element,n,e)):t.events.push(new sd(n,t.element))})}this.models=null,S(this.element.events||(this.element.events=[]),this),Fr(this,this.template),this.fn||(this.action=this.template.f),this.events.forEach(function(e){return e.bind(t)})},pd.destroyed=function(){this.events.forEach(function(t){return t.unrender()})},pd.fire=function(t,e){var n=this;void 0===e&&(e=[]);var i=t instanceof tc&&t.refire?t:this.element.getContext(t);if(this.fn){var r=[],s=zr(this,this.template,this.up,{specialRef:function(t){var e=cd.exec(t);if(e)return{special:e[1],keys:e[2]?A(e[2].substr(1)):[]};var n=fd.exec(t);return n?{special:"arguments",keys:[n[1]-1].concat(n[2]?A(n[2].substr(1)):[])}:void 0}});s&&s.forEach(function(s){if(!s)return r.push(void 0);if(s.special){var a,o=s.special;"@node"===o?a=n.element.node:"@event"===o?a=t&&t.event:"event"===o?(b("The event reference available to event directives is deprecated and should be replaced with @context and @event"),a=i):a="@context"===o?i:e;for(var u=s.keys.slice();a&&u.length;)a=a[u.shift()];return r.push(a)}return s.wrapper?r.push(s.wrapperValue):void r.push(s.get())});var a=this.ractive,o=a.event;a.event=i;var u=this.fn.apply(a,r),l=u.pop();if(l===!1){var c=t?t.original:void 0;c?(c.preventDefault&&c.preventDefault(),c.stopPropagation&&c.stopPropagation()):b("handler '"+this.template.n.join(" ")+"' returned false, but there is no event available to cancel")}else!u.length&&Da(l)&&h(l[0])&&(l=bn(this.ractive,l.shift(),i,l));return a.event=o,l}return bn(this.ractive,this.action,i,e)},pd.handleChange=function(){},pd.render=function(){var t=this;this.events.forEach(function(e){return e.render(t)})},pd.toString=function(){return""},pd.unbind=function(t){V(this.element.events,this),this.events.forEach(function(e){return e.unbind(t)})},pd.unrender=function(){this.events.forEach(function(t){return t.unrender()})};var md=dd.prototype;md.firstNode=md.rebound=md.update=f;var vd=function(e){function n(t,n){e.call(this,t,n),this.isReadonly=!this.root.ractive.syncComputedChildren,this.dirty=!0,this.isComputed=!0}e&&(n.__proto__=e);var i=n.prototype=Object.create(e&&e.prototype);i.constructor=n;var r={setRoot:{}};return r.setRoot.get=function(){return this.parent.setRoot},i.applyValue=function(t){if(e.prototype.applyValue.call(this,t),!this.isReadonly){for(var n=this.parent;n&&n.shuffle;)n=n.parent;n&&n.dependencies.forEach(Y)}this.setRoot&&this.setRoot.set(this.setRoot.value)},i.get=function(t,e){if(t&&H(this),this.dirty){this.dirty=!1;var n=this.parent.get();this.value=n?n[this.key]:void 0,this.wrapper&&(this.newWrapperValue=this.value),this.adapt()}return(e&&"unwrap"in e?e.unwrap!==!1:t)&&this.wrapper?this.wrapperValue:this.value},i.handleChange=function(){this.dirty||(this.dirty=!0,this.boundValue&&(this.boundValue=null),this.links.forEach(X),this.deps.forEach(Q),this.children.forEach(Q))},i.joinKey=function(e){if(c(e)||""===e)return this;if(!t(this.childByKey,e)){var i=new n(this,e);this.children.push(i),this.childByKey[e]=i}return this.childByKey[e]},Object.defineProperties(i,r),n}(Al),gd=function(t){function e(e,n,i){t.call(this,e,i),this.signature=n,this.isReadonly=!this.signature.setter,this.isComputed=!0,this.dependencies=[],this.children=[],this.childByKey={},this.deps=[],this.dirty=!0,this.shuffle=void 0}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);n.constructor=e;var r={setRoot:{}};return r.setRoot.get=function(){return this.signature.setter?this:void 0},n.get=function(t,e){if(t&&H(this),this.dirty){this.dirty=!1;var n=this.value;this.value=this.getValue(),yl.active()?i(n,this.value)||this.notifyUpstream():(yl.start(),i(n,this.value)||this.notifyUpstream(),yl.end()),this.wrapper&&(this.newWrapperValue=this.value),this.adapt()}return K(this,this.wrapper&&(e&&"unwrap"in e?e.unwrap!==!1:t)?this.wrapperValue:this.value,!e||e.shouldBind!==!1)},n.getContext=function(){return this.parent.isRoot?this.root.ractive:this.parent.get(!1,_o)},n.getValue=function(){$();var t;try{t=this.signature.getter.call(this.root.ractive,this.getContext())}catch(e){if(y("Failed to compute "+this.getKeypath()+": "+(e.message||e)),Ha){console.groupCollapsed&&console.groupCollapsed("%cshow details","color: rgb(82, 140, 224); font-weight: normal; text-decoration: underline;");var n=this.signature;console.error(e.name+": "+e.message+"\n\n"+n.getterString+(n.getterUseStack?"\n\n"+e.stack:"")),console.groupCollapsed&&console.groupEnd()}}var i=q();return this.setDependencies(i),t},n.mark=function(){this.handleChange()},n.rebind=function(t,e){t!==e&&this.handleChange()},n.set=function(t){if(this.isReadonly)throw new Error("Cannot set read-only computed value '"+this.key+"'");this.signature.setter(t),this.mark()},n.setDependencies=function(t){for(var e=this,n=this.dependencies.length;n--;){var i=e.dependencies[n];~t.indexOf(i)||i.unregister(e)}for(n=t.length;n--;){var r=t[n];~e.dependencies.indexOf(r)||r.register(e)}this.dependencies=t},n.teardown=function(){for(var e=this,n=this.dependencies.length;n--;)e.dependencies[n]&&e.dependencies[n].unregister(e);this.parent.computed[this.key]===this&&delete this.parent.computed[this.key],t.prototype.teardown.call(this)},Object.defineProperties(n,r),e}(Al),yd=gd.prototype,bd=vd.prototype;yd.handleChange=bd.handleChange,yd.joinKey=bd.joinKey,El.Computation=gd;var wd=function(t){function e(e,n){var i=this;t.call(this,e.ractive.viewmodel,null),this.fragment=e,this.template=n,this.isReadonly=!0,this.isComputed=!0,this.dirty=!0,this.fn=e.ractive.allowExpressions===!1?f:ft(n.s,n.r.length),this.models=this.template.r.map(function(t){return Qe(i.fragment,t)}),this.dependencies=[],this.shuffle=void 0,this.bubble()}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bubble=function(t){void 0===t&&(t=!0),this.keypath=void 0,t&&this.handleChange()},n.getKeypath=function(){var t=this;return this.template?(this.keypath||(this.keypath="@"+this.template.s.replace(/_(\d+)/g,function(e,n){if(n>=t.models.length)return e;var i=t.models[n];return i?i.getKeypath():"@undefined"})),this.keypath):"@undefined"},n.getValue=function(){var t=this;$();var e;try{var n=this.models.map(function(t){return t?t.get(!0):void 0});e=this.fn.apply(this.fragment.ractive,n)}catch(i){y("Failed to compute "+this.getKeypath()+": "+(i.message||i))}var r=q();return this.dependencies.filter(function(t){return!~r.indexOf(t)}).forEach(function(e){e.unregister(t),V(t.dependencies,e)}),r.filter(function(e){return!~t.dependencies.indexOf(e)}).forEach(function(e){e.register(t),t.dependencies.push(e)}),e},n.notifyUpstream=function(){},n.rebind=function(t,e,n){var i=this.models.indexOf(e);~i&&(t=ht(this.template.r[i],t,e),t!==e&&(e.unregister(this),this.models.splice(i,1,t),t&&t.addShuffleRegister(this,"mark"))),this.bubble(!n)},n.rebound=function(t){var e=this;this.models=this.template.r.map(function(t){return Qe(e.fragment,t)}),t&&this.bubble(!0)},n.retrieve=function(){return this.get()},n.teardown=function(){var e=this;this.fragment=void 0,this.dependencies&&this.dependencies.forEach(function(t){return t.unregister(e)}),t.prototype.teardown.call(this)},n.unreference=function(){t.prototype.unreference.call(this),hs(this)},n.unregister=function(e){t.prototype.unregister.call(this,e),hs(this)},n.unregisterLink=function(e){t.prototype.unregisterLink.call(this,e),hs(this)},e}(Al),xd=wd.prototype,kd=gd.prototype;xd.get=kd.get,xd.handleChange=kd.handleChange,xd.joinKey=kd.joinKey,xd.mark=kd.mark,xd.unbind=f;var _d=function(t){function e(e,n){t.call(this,null,null,null,"@undefined"),this.root=e.ractive.viewmodel,this.template=n,this.rootLink=!0,this.template=n,this.fragment=e,this.rebound()}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.getKeypath=function(){return this.model?this.model.getKeypath():"@undefined"},n.rebound=function(){var t,e=this,n=this.fragment,i=this.template,r=this.base=fs(n,i);this.proxy&&ls(this);var s=this.proxy={rebind:function(n,o){o===r?(n=ht(i,n,o),n!==r&&(e.base=r=n)):~(t=a.indexOf(o))&&(n=ht(i.m[t].n,n,o),n!==a[t]&&a.splice(t,1,n||Oo)),n!==o&&(o.unregister(s),n&&n.addShuffleTask(function(){return n.register(s)}))},handleChange:function(){o()}};r.register(s);var a=this.members=i.m.map(function(t){if(h(t))return{get:function(){return t}};var e;return t.t===hu?(e=Qe(n,t.n),e.register(s),e):(e=new wd(n,t),e.register(s),e)}),o=function(){var t=r.joinAll(a.reduce(function(t,e){var n=e.get();return Da(n)?t.concat(n):(t.push(_(String(n))),t)},[]));t!==e.model&&(e.model=t,e.relinking(t),F(),cs(e))};o()},n.teardown=function(){ls(this),t.prototype.teardown.call(this)},n.unreference=function(){t.prototype.unreference.call(this),this.deps.length||this.refs||this.teardown()},n.unregister=function(e){t.prototype.unregister.call(this,e),this.deps.length||this.refs||this.teardown()},e}(jo),Ed=wd.prototype,Ad=_d.prototype;Ad.unreference=Ed.unreference,Ad.unregister=Ed.unregister,Ad.unregisterLink=Ed.unregisterLink;var Cd=function(t){function e(e){t.call(this,e),e.owner&&(this.parent=e.owner),this.isStatic=!!e.template.s,this.model=null,this.dirty=!1}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(t){var e=this.template.y?this.template.y.containerFragment:this.containerFragment||this.up,n=t||fs(e,this.template);if(n){var i=n.get();if(this.isStatic)return this.model={get:function(){return i}},void n.unreference();n.register(this),this.model=n}},n.handleChange=function(){this.bubble()},n.rebind=function(t,e,n){return this.isStatic?void 0:(t=ht(this.template,t,e,this.up),t===this.model?!1:(this.model&&this.model.unregister(this),t&&t.addShuffleRegister(this,"mark"),this.model=t,n||this.handleChange(),!0))},n.rebound=function(t){if(this.model){if(this.model.rebound)this.model.rebound(t);else{var e=this.template.y?this.template.y.containerFragment:this.containerFragment||this.up,n=fs(e,this.template);n!==this.model&&(this.model.unregister(this),this.bind(n))}t&&this.bubble()}this.fragment&&this.fragment.rebound(t)},n.unbind=function(){this.isStatic||(this.model&&this.model.unregister(this),this.model=void 0)},e}(ff),Sd=ds.prototype=Object.create(pf.prototype);Pa(Sd,Cd.prototype,{constructor:ds});var Od=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bubble=function(){this.owner&&this.owner.bubble(),t.prototype.bubble.call(this)},n.detach=function(){return ni(this.node)},n.firstNode=function(){return this.node},n.getString=function(){return this.model?ii(this.model.get()):""},n.render=function(t,e){if(!br()){var n=this.value=this.getString();this.rendered=!0,us(this,t,e,n)}},n.toString=function(t){var e=this.getString();return t?bt(e):e},n.unrender=function(t){t&&this.detach(),this.rendered=!1},n.update=function(){if(this.dirty&&(this.dirty=!1,this.rendered)){var t=this.getString();t!==this.value&&(this.node.data=this.value=t)}},n.valueOf=function(){return this.model?this.model.get():void 0},e}(Cd),jd=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.render=function(e,n){t.prototype.render.call(this,e,n),this.node.defaultValue=this.node.value},n.compare=function(t,e){var n=this.getAttribute("value-comparator");if(n){if(u(n))return n(t,e);if(t&&e)return t[n]==e[n]}return t==e},e}(nd),Nd={"true":!0,"false":!1,"null":null,undefined:void 0},Td=new RegExp("^(?:"+Ka(Nd).join("|")+")"),Vd=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/,Md=/\$\{([^\}]+)\}/g,Pd=/^\$\{([^\}]+)\}/,Id=/^\s*$/,Rd=Po.extend({init:function(t,e){this.values=e.values,this.sp()},postProcess:function(t){return 1===t.length&&Id.test(this.leftover)?{value:t[0].v}:null},converters:[function(e){if(!e.values)return null;var n=e.matchPattern(Pd);return n&&t(e.values,n)?{v:e.values[n]}:void 0},function(t){var e=t.matchPattern(Td);return e?{v:Nd[e]}:void 0},function(t){var e=t.matchPattern(Vd);return e?{v:+e}:void 0},function(t){var e=Et(t),n=t.values;return e&&n?{v:e.v.replace(Md,function(t,e){return e in n?n[e]:e})}:e},function(t){if(!t.matchString("{"))return null;var e={};if(t.sp(),t.matchString("}"))return{v:e};for(var n;n=ps(t);){if(e[n.key]=n.value,t.sp(),t.matchString("}"))return{v:e};if(!t.matchString(","))return null}return null},function(t){if(!t.matchString("["))return null;var e=[];if(t.sp(),t.matchString("]"))return{v:e};for(var n;n=t.read();){if(e.push(n.v),t.sp(),t.matchString("]"))return{v:e};if(!t.matchString(","))return null;t.sp()}return null}]}),Bd=function(t){function e(e){t.call(this,e),this.name=e.template.n,this.owner=e.owner||e.up.owner||e.element||Fn(e.up),this.element=e.element||(this.owner.attributeByName?this.owner:Fn(e.up)),this.up=this.element.up,this.ractive=this.up.ractive,this.element.attributeByName[this.name]=this,this.value=e.template.f}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){var t=this.template.f,e=this.element.instance.viewmodel;if(0===t)e.joinKey(this.name).set(!0);else if(h(t)){var n=ms(t);e.joinKey(this.name).set(n?n.value:t)}else Da(t)&&vs(this,!0)},n.rebound=function(t){if(this.boundFragment&&this.boundFragment.rebound(t),this.link){this.model=fs(this.up,this.template.f[0]);var e=this.element.instance.viewmodel.joinAll(A(this.name));e.link(this.model,this.name,{mapping:!0})}},n.render=function(){},n.unbind=function(t){this.model&&this.model.unregister(this),this.boundFragment&&this.boundFragment.unbind(t),this.element.bound&&this.link.target===this.model&&this.link.owner.unlink()},n.unrender=function(){},n.update=function(){this.dirty&&(this.dirty=!1,this.boundFragment&&this.boundFragment.update())},e}(ff),Kd=function(t){function e(e){var n=e.template;n.a||(n.a={}),!c(n.a.value)||"disabled"in n.a||(n.a.value=n.f||""),t.call(this,e),this.select=Fn(this.parent||this.up,!1,"select")}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){if(!this.select)return void t.prototype.bind.call(this);var e=this.attributeByName.selected;if(e&&void 0!==this.select.getAttribute("value")){var n=this.attributes.indexOf(e);this.attributes.splice(n,1),delete this.attributeByName.selected}t.prototype.bind.call(this),this.select.options.push(this)},n.bubble=function(){var e=this.getAttribute("value");this.node&&this.node.value!==e&&(this.node._ractive.value=e),t.prototype.bubble.call(this)},n.getAttribute=function(t){var e=this.attributeByName[t];return e?e.getValue():"value"===t&&this.fragment?this.fragment.valueOf():void 0},n.isSelected=function(){var t=this,e=this.getAttribute("value");if(c(e)||!this.select)return!1;var n=this.select.getAttribute("value");if(this.select.compare(n,e))return!0;if(this.select.getAttribute("multiple")&&Da(n))for(var i=n.length;i--;)if(t.select.compare(n[i],e))return!0},n.render=function(e,n){t.prototype.render.call(this,e,n),this.attributeByName.value||(this.node._ractive.value=this.getAttribute("value"))},n.unbind=function(e){t.prototype.unbind.call(this,e),this.select&&V(this.select.options,this)},e}(nd),Ld=ks.prototype=Ia(ds.prototype);Pa(Ld,{constructor:ks,bind:function(){var t=this.template;if(this.yielder){if(this.container=this.up.ractive,this.component=this.container.component,this.containerFragment=this.up,!this.component)return this.fragment=new Vp({owner:this,template:[]}),void this.fragment.bind();this.up=this.component.up,t.r||t.x||t.rx||(this.refName="content")}this.macro?this.fn=this.macro:(this.refName||(this.refName=t.r),
this.refName&&As(this,this.refName),this.partial||this.fn||(ds.prototype.bind.call(this),this.model&&As(this,this.model.get()))),this.partial||this.fn||b("Could not find template for partial '"+this.name+"'"),_s(this,this.partial||[]),this.fn&&Os(this),this.fragment.bind()},bubble:function(){this.dirty||(this.dirty=!0,this.yielder?this.containerFragment.bubble():this.up.bubble())},findNextNode:function(){return(this.containerFragment||this.up).findNextNode(this)},handleChange:function(){this.dirtyTemplate=!0,this.externalChange=!0,this.bubble()},rebound:function(t){var e=this;this._attrs&&Ka(this._attrs).forEach(function(n){return e._attrs[n].rebound(t)}),ds.prototype.rebound.call(this,t)},refreshAttrs:function(){var t=this;Ka(this._attrs).forEach(function(e){t.handle.attributes[e]=!t._attrs[e].items.length||t._attrs[e].valueOf()})},resetTemplate:function(){var t=this;if(this.fn&&this.proxy){if(this.last=0,!this.externalChange)return this.partial=this.fnTemplate,!0;u(this.proxy.teardown)&&this.proxy.teardown(),this.fn=this.proxy=null}if(this.partial=null,this.refName&&(this.partial=gs(this.ractive,this.refName,this.up)),!this.partial&&this.model&&As(this,this.model.get()),!this.fn){if(this.last&&this.partial===this.last)return!1;this.partial&&(this.last=this.partial,Es(this))}return this.unbindAttrs(),this.fn?(Os(this),u(this.proxy.render)&&yl.scheduleTask(function(){return t.proxy.render()})):this.partial||b("Could not find template for partial '"+this.name+"'"),!0},render:function(t,e){this.fn&&this.fn._cssDef&&!this.fn._cssDef.applied&&wi(),this.fragment.render(t,e),this.proxy&&u(this.proxy.render)&&this.proxy.render()},unbind:function(t){this.fragment.unbind(t),this.unbindAttrs(t),ds.prototype.unbind.call(this,t)},unbindAttrs:function(t){var e=this;this._attrs&&Ka(this._attrs).forEach(function(n){e._attrs[n].unbind(t)})},unrender:function(t){this.proxy&&u(this.proxy.teardown)&&this.proxy.teardown(),this.fragment.unrender(t)},update:function(){var t=this,e=this.proxy;this.updating=1,this.dirtyAttrs&&(this.dirtyAttrs=!1,Ka(this._attrs).forEach(function(e){return t._attrs[e].update()}),this.refreshAttrs(),u(e.update)&&e.update(this.handle.attributes)),this.dirtyTemplate&&(this.dirtyTemplate=!1,this.resetTemplate()&&this.fragment.resetTemplate(this.partial||[])),this.dirty&&(this.dirty=!1,e&&u(e.invalidate)&&e.invalidate(),this.fragment.update()),this.externalChange=!1,this.updating=0}});var Dd="extra-attributes",Fd=function(t,e,n){this.value=this.key=t,this.context=e,this.isReadonly=this.isKey=!0,this.deps=[],this.links=[],this.children=[],this.instance=n},zd=Fd.prototype;zd.applyValue=function(t){t!==this.value&&(this.value=this.key=t,this.deps.forEach(Q),this.links.forEach(Q),this.children.forEach(function(t){t.applyValue(t.context.getKeypath(t.instance))}))},zd.destroyed=function(){this.upstream&&this.upstream.unregisterChild(this)},zd.get=function(t){return t&&H(this),C(this.value)},zd.getKeypath=function(){return C(this.value)},zd.has=function(){return!1},zd.rebind=function(t,e){for(var n=this,i=this.deps.length;i--;)n.deps[i].rebind(t,e,!1);for(i=this.links.length;i--;)n.links[i].relinking(t,!1)},zd.register=function(t){this.deps.push(t)},zd.registerChild=function(t){S(this.children,t),t.upstream=this},zd.registerLink=function(t){S(this.links,t)},zd.unregister=function(t){V(this.deps,t)},zd.unregisterChild=function(t){V(this.children,t)},zd.unregisterLink=function(t){V(this.links,t)},Fd.prototype.reference=f,Fd.prototype.unreference=f;var Ud=/^"(\\"|[^"])+"$/,$d=function(t){this.parent=t.owner.up,this.up=this,this.owner=t.owner,this.ractive=this.parent.ractive,this.delegate=this.ractive.delegate!==!1&&(this.parent.delegate||Ns(this.parent)),this.delegate&&this.delegate.delegate===!1&&(this.delegate=!1),this.delegate&&(this.delegate.delegate=this.delegate),this.cssIds="cssIds"in t?t.cssIds:this.parent?this.parent.cssIds:null,this.context=null,this.rendered=!1,this.iterations=[],this.template=t.template,this.indexRef=t.indexRef,this.keyRef=t.keyRef,this.pendingNewIndices=null,this.previousIterations=null,this.isArray=!1},qd=$d.prototype;qd.bind=function(t){var e=this;this.context=t,this.bound=!0;var n=t.get(),i=this.aliases=this.owner.template.z&&this.owner.template.z.slice(),r=i&&i.find(function(t){return"shuffle"===t.n});r&&r.x&&r.x.x&&("true"===r.x.x.s?this.shuffler=!0:Ud.test(r.x.x.s)&&(this.shuffler=A(r.x.x.s.slice(1,-1)))),this.shuffler&&(this.values=Vs(this,this.shuffler)),this.source&&this.source.model.unbind(this.source);var a=t.isComputed&&i&&i.find(function(t){return"source"===t.n});if(a&&a.x&&a.x.r){var o=fs(this,a.x);this.source={handleChange:function(){},rebind:function(t){this.model.unregister(this),this.model=t,t.register(this)}},this.source.model=o,o.register(this.source)}if(this.isArray=Da(n)){this.iterations=[];for(var u=this.length=n.length,h=0;u>h;h+=1)e.iterations[h]=e.createIteration(h,h)}else if(s(n)){if(this.isArray=!1,this.indexRef){var l=this.indexRef.split(",");this.keyRef=l[0],this.indexRef=l[1]}var c=Ka(n);this.length=c.length,this.iterations=c.map(function(t,n){return e.createIteration(t,n)})}return this},qd.bubble=function(t){this.bubbled||(this.bubbled=[]),this.bubbled.push(t),this.rebounding||this.owner.bubble()},qd.createIteration=function(t,e){var n=new Vp({owner:this,template:this.template});return n.isIteration=!0,n.delegate=this.delegate,this.aliases&&(n.aliases={}),Ts(this,n,t,e),n.bind(n.context)},qd.destroyed=function(){for(var t=this,e=this.iterations.length,n=0;e>n;n++)t.iterations[n].destroyed();this.pathModel&&this.pathModel.destroyed(),this.rootModel&&this.rootModel.destroyed()},qd.detach=function(){var t=ti();return this.iterations.forEach(function(e){return t.appendChild(e.detach())}),t},qd.find=function(t,e){return I(this.iterations,function(n){return n.find(t,e)})},qd.findAll=function(t,e){return this.iterations.forEach(function(n){return n.findAll(t,e)})},qd.findAllComponents=function(t,e){return this.iterations.forEach(function(n){return n.findAllComponents(t,e)})},qd.findComponent=function(t,e){return I(this.iterations,function(n){return n.findComponent(t,e)})},qd.findContext=function(){return this.context},qd.findNextNode=function(t){var e=this;if(t.index<this.iterations.length-1)for(var n=t.index+1;n<this.iterations.length;n++){var i=e.iterations[n].firstNode(!0);if(i)return i}return this.owner.findNextNode()},qd.firstNode=function(t){return this.iterations[0]?this.iterations[0].firstNode(t):null},qd.getLast=function(){return this.lastModel||(this.lastModel=new Fd(this.length-1))},qd.rebind=function(t){var e=this;this.context=t,this.source||this.iterations.forEach(function(t){Ts(e,t,t.key,t.index)})},qd.rebound=function(t){var e=this;this.context=this.owner.model,this.iterations.forEach(function(n,i){n.context=Ms(e,n,i),n.rebound(t)})},qd.render=function(t,e){var n=this.iterations;if(n)for(var i=n.length,r=0;i>r;r++)n[r].render(t,e);this.rendered=!0},qd.shuffle=function(t,e){var n=this;this.pendingNewIndices||(this.previousIterations=this.iterations.slice()),this.pendingNewIndices||(this.pendingNewIndices=[]),this.pendingNewIndices.push(t);var i=[];t.forEach(function(t,r){if(-1!==t){var s=n.iterations[r];i[t]=s,t!==r&&s&&(s.dirty=!0,e&&(s.shouldRebind=1))}}),this.iterations=i,e||this.bubble()},qd.shuffled=function(){this.iterations.forEach(nt)},qd.toString=function(t){return this.iterations?this.iterations.map(t?ut:ot).join(""):""},qd.unbind=function(t){this.bound=!1,this.source&&this.source.model.unregister(this.source);for(var e=this.pendingNewIndices?this.previousIterations:this.iterations,n=e.length,i=0;n>i;i++)e[i].unbind(t);return this},qd.unrender=function(t){for(var e=this,n=this.iterations.length,i=0;n>i;i++)e.iterations[i].unrender(t);if(this.pendingNewIndices&&this.previousIterations){n=this.previousIterations.length;for(var r=0;n>r;r++)e.previousIterations[r].unrender(t)}this.rendered=!1},qd.update=function(){var t=this;if(this.pendingNewIndices)return this.bubbled.length=0,void this.updatePostShuffle();if(!this.updating){if(this.updating=!0,this.shuffler){var e=Vs(this,this.shuffler),n=R(this.values,e);n.same?this.iterations.forEach(at):(this.shuffle(n,!0),this.updatePostShuffle())}else{for(var i=this.iterations.length,r=0;i>r;r++){var a=t.iterations[r];a&&a.idxModel&&a.idxModel.applyValue(r)}var o,u,h,l=this.context.get(),c=this.isArray,f=!0;if(this.isArray=Da(l)){if(this.source){this.rebounding=1;var d=this.source.model.get();this.iterations.forEach(function(e,n){n<l.length&&e.lastValue!==l[n]&&~(h=d.indexOf(l[n]))&&(Ts(t,e,n,n),e.rebound(!0))}),this.rebounding=0}c&&(f=!1,this.iterations.length>l.length&&(o=this.iterations.splice(l.length)))}else if(s(l)&&!c)for(f=!1,o=[],u={},h=this.iterations.length;h--;){var p=t.iterations[h];p.key in l?u[p.key]=!0:(t.iterations.splice(h,1),o.push(p))}var m=Da(l)?l.length:s(l)?Ka(l).length:0;if(this.length=m,this.updateLast(),f&&(o=this.iterations,this.iterations=[]),o){i=o.length;for(var v=0;i>v;v++)o[v].unbind().unrender(!0)}if(!f&&this.isArray&&this.bubbled&&this.bubbled.length){var g=this.bubbled;this.bubbled=[],i=g.length;for(var y=0;i>y;y++)t.iterations[g[y]]&&t.iterations[g[y]].update()}else{i=this.iterations.length;for(var b=0;i>b;b++)t.iterations[b].update()}var w,x;if(m>this.iterations.length){if(w=this.rendered?ti():null,h=this.iterations.length,Da(l))for(;h<l.length;)x=t.createIteration(h,h),t.iterations.push(x),t.rendered&&x.render(w),h+=1;else if(s(l)){if(this.indexRef&&!this.keyRef){var k=this.indexRef.split(",");this.keyRef=k[0],this.indexRef=k[1]}Ka(l).forEach(function(e){u&&e in u||(x=t.createIteration(e,h),t.iterations.push(x),t.rendered&&x.render(w),h+=1)})}if(this.rendered){var _=this.parent.findParentNode(),E=this.parent.findNextNode(this.owner);_.insertBefore(w,E)}}}this.updating=!1}},qd.updateLast=function(){this.lastModel&&this.lastModel.applyValue(this.length-1)},qd.updatePostShuffle=function(){var t=this,e=this.pendingNewIndices[0],n=this.rendered?this.parent.findParentNode():null,i=n&&this.owner.findNextNode(),r=n?ti():null;this.pendingNewIndices.slice(1).forEach(function(t){e.forEach(function(n,i){e[i]=t[n]})});var s,a,u,h,l,f,d=this.length=this.context.get().length,p=this.previousIterations,m=this.iterations,v=this.context.get(),g={},y=new Array(e.length);for(e.forEach(function(t,e){return y[t]=e}),this.updateLast(),s=u=0;d>s;)c(y[s])?(h=m[s]=t.createIteration(s,s),n&&(l=p[u],l=l&&n&&l.firstNode()||i,h.render(r),n.insertBefore(r,l)),s++):(a=e[u],-1===a?(p[u]&&p[u].unbind().unrender(!0),p[u++]=0):a>s?(g[a]=p[u],p[u++]=null):(m[s]=h=m[s]||g[s]||t.createIteration(s,s),(g[s]||u!==s)&&(f=t.source&&h.lastValue!==v[s],Ts(t,h,s,s)),!n||!g[s]&&p[u]||(l=p[u+1],l=l&&n&&l.firstNode()||i,g[s]?n.insertBefore(h.detach(),l):(h.render(r),n.insertBefore(r,l))),p[u++]=0,s++),h&&o(h)&&((h.shouldRebind||f)&&(h.rebound(f),h.shouldRebind=0),h.update(),h.shuffled()));for(var b=p.length,w=0;b>w;w++)p[w]&&p[w].unbind().unrender(!0);this.shuffler&&(this.values=Vs(this,this.shuffler)),this.pendingNewIndices=null,this.previousIterations=null},$d.prototype.getContext=nn,$d.prototype.getKeypath=Ys;var Hd=function(t){function e(e){t.call(this,e),this.isAlias=e.template.t===Xo,this.sectionType=e.template.n||this.isAlias&&wu||null,this.templateSectionType=this.sectionType,this.subordinate=1===e.template.l,this.fragment=null}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bind=function(){t.prototype.bind.call(this),this.subordinate&&(this.sibling=this.up.items[this.up.items.indexOf(this)-1],this.sibling.nextSibling=this),this.model||this.isAlias?(this.dirty=!0,this.update()):!this.sectionType||this.sectionType!==yu||this.sibling&&this.sibling.isTruthy()||(this.fragment=new Vp({owner:this,template:this.template.f}).bind())},n.bubble=function(){!this.dirty&&this["yield"]?(this.dirty=!0,this.containerFragment.bubble()):t.prototype.bubble.call(this)},n.detach=function(){var e=this.fragment||this.detached;return e?e.detach():t.prototype.detach.call(this)},n.isTruthy=function(){if(this.subordinate&&this.sibling.isTruthy())return!0;var t=this.model?this.model.isRoot?this.model.value:this.model.get():void 0;return!(!t||this.templateSectionType!==xu&&Ps(t))},n.rebind=function(e,n,i){t.prototype.rebind.call(this,e,n,i)&&this.fragment&&this.sectionType!==gu&&this.sectionType!==yu&&this.fragment.rebind(e)},n.rebound=function(e){this.model&&(this.model.rebound?this.model.rebound(e):(t.prototype.unbind.call(this),t.prototype.bind.call(this),(this.sectionType===wu||this.sectionType===xu||this.sectionType===bu)&&this.fragment&&this.fragment.rebind(this.model),e&&this.bubble())),this.fragment&&this.fragment.rebound(e)},n.render=function(t,e){this.rendered=!0,this.fragment&&this.fragment.render(t,e)},n.shuffle=function(t){this.fragment&&this.sectionType===bu&&this.fragment.shuffle(t)},n.unbind=function(e){t.prototype.unbind.call(this,e),this.fragment&&this.fragment.unbind(e)},n.unrender=function(t){this.rendered&&this.fragment&&this.fragment.unrender(t),this.rendered=!1},n.update=function(){var t=this;if(this.dirty&&(this.fragment&&this.sectionType!==gu&&this.sectionType!==yu&&(this.fragment.context=this.model),this.model||this.sectionType===yu||this.isAlias)){this.dirty=!1;var e=this.model?this.model.isRoot?this.model.value:this.model.get():void 0,n=!this.subordinate||!this.sibling.isTruthy(),i=this.sectionType;this["yield"]&&this["yield"]!==e?(this.up=this.containerFragment,this.container=null,this["yield"]=null,this.rendered&&this.fragment.unbind().unrender(!0),this.fragment=null):this.rendered&&!this["yield"]&&e instanceof tc&&(this.rendered&&this.fragment.unbind().unrender(!0),this.fragment=null),(null===this.sectionType||null===this.templateSectionType)&&(this.sectionType=Is(e,this.template.i)),i&&i!==this.sectionType&&this.fragment&&(this.rendered&&this.fragment.unbind().unrender(!0),this.fragment=null);var r,s=this.sectionType===bu||this.sectionType===wu||n&&(this.sectionType===yu?!this.isTruthy():this.isTruthy())||this.isAlias;if(s)if(this.fragment||(this.fragment=this.detached),this.fragment)this.detached&&(Rs(this,this.fragment),this.detached=!1,this.rendered=!0),this.fragment.bound||this.fragment.bind(this.model),this.fragment.update();else if(this.sectionType===bu)r=new $d({owner:this,template:this.template.f,indexRef:this.template.i}).bind(this.model);else{var a=this.sectionType!==gu&&this.sectionType!==yu?this.model:null;e instanceof tc&&(this["yield"]=e,this.containerFragment=this.up,this.up=e.fragment,this.container=e.ractive,a=void 0),r=new Vp({owner:this,template:this.template.f}).bind(a)}else this.fragment&&this.rendered?Ml!==!0?this.fragment.unbind().unrender(!0):(this.unrender(!1),this.detached=this.fragment,yl.promise().then(function(){t.detached&&t.detach()})):this.fragment&&this.fragment.unbind(),this.fragment=null;r&&(this.rendered&&Rs(this,r),this.fragment=r),this.nextSibling&&(this.nextSibling.dirty=!0,this.nextSibling.update())}},e}(ds),Zd=function(t){function e(e){t.call(this,e),this.options=[]}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.foundNode=function(t){if(this.binding){var e=Gr(t);e.length>0&&(this.selectedOptions=e)}},n.render=function(e,n){t.prototype.render.call(this,e,n),this.sync();for(var i=this.node,r=i.options.length;r--;)i.options[r].defaultSelected=i.options[r].selected;this.rendered=!0},n.sync=function(){var t=this,e=this.node;if(e){var n=P(e.options);if(this.selectedOptions)return n.forEach(function(e){t.selectedOptions.indexOf(e)>=0?e.selected=!0:e.selected=!1}),this.binding.setFromNode(e),void delete this.selectedOptions;var i=this.getAttribute("value"),r=this.getAttribute("multiple"),s=r&&Da(i);if(void 0!==i){var a;n.forEach(function(e){var n=e._ractive?e._ractive.value:e.value,o=r?s&&t.valueContains(i,n):t.compare(i,n);o&&(a=!0),e.selected=o}),a||r||this.binding&&this.binding.forceUpdate()}else this.binding&&this.binding.forceUpdate&&this.binding.forceUpdate()}},n.valueContains=function(t,e){for(var n=this,i=t.length;i--;)if(n.compare(e,t[i]))return!0},n.compare=function(t,e){var n=this.getAttribute("value-comparator");if(n){if(u(n))return n(e,t);if(e&&t)return e[n]==t[n]}return e==t},n.update=function(){var e=this.dirty;t.prototype.update.call(this),e&&this.sync()},e}(nd),Wd=function(t){function e(e){var n=e.template;e.deferContent=!0,t.call(this,e),this.attributeByName.value||(n.f&&Jr({template:n})?(this.attributes||(this.attributes=[])).push(Ws({owner:this,template:{t:Zo,f:n.f,n:"value"},up:this.up})):this.fragment=new Vp({owner:this,cssIds:null,template:n.f}))}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.bubble=function(){var t=this;this.dirty||(this.dirty=!0,this.rendered&&!this.binding&&this.fragment&&yl.scheduleTask(function(){t.dirty=!1,t.node.value=t.fragment.toString()}),this.up.bubble())},e}(jd),Gd=function(t){function e(e){t.call(this,e),this.type=Ro}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.detach=function(){return ni(this.node)},n.firstNode=function(){return this.node},n.render=function(t,e){br()||(this.rendered=!0,us(this,t,e,this.template))},n.toString=function(t){return t?bt(this.template):this.template},n.unrender=function(t){this.rendered&&t&&this.detach(),this.rendered=!1},n.valueOf=function(){return this.template},e}(ff),Qd=Gd.prototype;Qd.bind=Qd.unbind=Qd.update=f;var Yd,Jd="hidden";if(Ua){var Xd;if(Jd in Ua)Xd="";else for(var tp=Wa.length;tp--;){var ep=Wa[tp];if(Jd=ep+"Hidden",Jd in Ua){Xd=ep;break}}void 0!==Xd?(Ua.addEventListener(Xd+"visibilitychange",Bs),Bs()):("onfocusout"in Ua?(Ua.addEventListener("focusout",Ks),Ua.addEventListener("focusin",Ls)):(za.addEventListener("pagehide",Ks),za.addEventListener("blur",Ks),za.addEventListener("pageshow",Ls),za.addEventListener("focus",Ls)),Yd=!0)}var np;if($a){var ip={},rp=ic("div").style;np=function(t){if(!ip[t]){var e=_e(t);if(void 0!==rp[t])ip[t]=e;else for(var n=Wa.length;n--;){var i="-"+Wa[n]+"-"+e;if(void 0!==rp[i]){ip[t]=i;break}}}return ip[t]}}else np=null;var sp,ap=np,op=new RegExp("^(?:"+Wa.join("|")+")([A-Z])");if($a){var up,hp,lp,cp,fp,dp,pp=ic("div").style,mp=function(t){return t},vp={},gp={};void 0!==pp.transition?(up="transition",hp="transitionend",lp=!0):void 0!==pp.webkitTransition?(up="webkitTransition",hp="webkitTransitionEnd",lp=!0):lp=!1,up&&(cp=up+"Duration",fp=up+"Property",dp=up+"TimingFunction"),sp=function(t,e,n,i,r){setTimeout(function(){function s(){clearTimeout(d)}function a(){c&&f&&(t.unregisterCompleteHandler(s),t.ractive.fire(t.name+":end",t.node,t.isIntro),r())}function o(e){if(e.target===t.node){var n=i.indexOf(e.propertyName);-1!==n&&i.splice(n,1),i.length||(clearTimeout(d),l())}}function l(){m[fp]=v.property,m[dp]=v.duration,m[cp]=v.timing,t.node.removeEventListener(hp,o,!1),f=!0,a()}var c,f,d,p=(t.node.namespaceURI||"")+t.node.tagName,m=t.node.style,v={property:m[fp],timing:m[dp],duration:m[cp]};t.node.addEventListener(hp,o,!1),d=setTimeout(function(){i=[],l()},n.duration+(n.delay||0)+50),t.registerCompleteHandler(s),m[fp]=i.join(",");var g=Ds(n.easing||"linear");m[dp]=g;var w=m[dp]===g;m[cp]=n.duration/1e3+"s",setTimeout(function(){for(var r,s,l,d,v,g=i.length,x=null,_=[];g--;){if(l=i[g],r=p+l,w&&lp&&!gp[r]){var E=m[l];m[l]=e[l],r in vp||(x=t.getStyle(l),vp[r]=t.getStyle(l)!=e[l],gp[r]=!vp[r],gp[r]&&(m[l]=E))}w&&lp&&!gp[r]||(null===x&&(x=t.getStyle(l)),s=i.indexOf(l),-1===s?y("Something very strange happened with transitions. Please raise an issue at https://github.com/ractivejs/ractive/issues - thanks!",{node:t.node}):i.splice(s,1),d=/[^\d]*$/.exec(x)[0],v=k(parseFloat(x),parseFloat(e[l])),v?_.push({name:l,interpolator:v,suffix:d}):m[l]=e[l],x=null)}if(_.length){var A;h(n.easing)?(A=t.ractive.easing[n.easing],A||(b(po(n.easing,"easing")),A=mp)):A=u(n.easing)?n.easing:mp,new xl({duration:n.duration,easing:A,step:function(t){for(var e=_.length;e--;){var n=_[e];m[n.name]=n.interpolator(t)+n.suffix}},complete:function(){c=!0,a()}})}else c=!0;i.length?m[fp]=i.join(","):(m[fp]="none",t.node.removeEventListener(hp,o,!1),f=!0,a())},0)},n.delay||0)}}else sp=null;var yp=sp,bp=za&&za.getComputedStyle,wp=Promise.resolve(),xp={t0:"intro-outro",t1:"intro",t2:"outro"},kp=function(t){this.owner=t.owner||t.up.owner||Fn(t.up),this.element=this.owner.attributeByName?this.owner:Fn(t.up),this.ractive=this.owner.ractive,this.template=t.template,this.up=t.up,this.options=t,this.onComplete=[]},_p=kp.prototype;_p.animateStyle=function(t,e,n){var i=this;if(4===arguments.length)throw new Error("t.animateStyle() returns a promise - use .then() instead of passing a callback");if(!Yd)return this.setStyle(t,e),wp;var r;return h(t)?(r={},r[t]=e):(r=t,n=e),new Promise(function(t){if(!n.duration)return i.setStyle(r),void t();for(var e=Ka(r),s=[],a=bp(i.node),o=e.length;o--;){var u=e[o],h=ap(u),l=a[ap(u)],c=i.node.style[h];h in i.originals||(i.originals[h]=i.node.style[h]),i.node.style[h]=r[u],i.targets[h]=i.node.style[h],i.node.style[h]=c,l!=r[u]&&(s.push(h),r[h]=r[u],i.node.style[h]=l)}return s.length?void yp(i,r,n,s,t):void t()})},_p.bind=function(){var t=this.options,e=t.template&&t.template.v;e&&(("t0"===e||"t1"===e)&&(this.element.intro=this),("t0"===e||"t2"===e)&&(this.element.outro=this),this.eventName=xp[e]);var n=this.owner.ractive;this.name=t.name||t.template.n,t.params&&(this.params=t.params),u(this.name)?(this._fn=this.name,this.name=this._fn.name):this._fn=w("transitions",n,this.name),this._fn||b(po(this.name,"transition"),{ractive:n}),Fr(this,t.template)},_p.getParams=function(){if(this.params)return this.params;if(this.fn){var t=zr(this,this.template,this.up).map(function(t){return t?t.get():void 0});return this.fn.apply(this.ractive,t)}},_p.getStyle=function(t){var e=bp(this.node);if(h(t))return e[ap(t)];if(!Da(t))throw new Error("Transition$getStyle must be passed a string, or an array of strings representing CSS properties");for(var n={},i=t.length;i--;){var r=t[i],s=e[ap(r)];"0px"===s&&(s=0),n[r]=s}return n},_p.processParams=function(t,e){return l(t)?t={duration:t}:h(t)?t="slow"===t?{duration:600}:"fast"===t?{duration:200}:{duration:400}:t||(t={}),Pa({},e,t)},_p.registerCompleteHandler=function(t){S(this.onComplete,t)},_p.setStyle=function(e,n){var i=this;if(h(e)){var r=ap(e);t(this.originals,r)||(this.originals[r]=this.node.style[r]),this.node.style[r]=n,this.targets[r]=this.node.style[r]}else{var s;for(s in e)t(e,s)&&i.setStyle(s,e[s])}return this},_p.shouldFire=function(t){if(!this.ractive.transitionsEnabled)return!1;if("intro"===t&&this.ractive.rendering&&Fs("noIntro",this.ractive,!0))return!1;if("outro"===t&&this.ractive.unrendering&&Fs("noOutro",this.ractive,!1))return!1;var e=this.getParams();if(!this.element.parent)return!0;if(e&&e[0]&&s(e[0])&&"nested"in e[0]){if(e[0].nested!==!1)return!0}else if(Fs("nestedTransitions",this.ractive)!==!1)return!0;for(var n=this.element.parent;n;){if(n[t]&&n[t].starting)return!1;n=n.parent}return!0},_p.start=function(){var t,e=this,n=this.node=this.element.node,i=this.originals={},r=this.targets={},s=this.getParams();if(this.complete=function(s){if(e.starting=!1,!t){if(e.onComplete.forEach(function(t){return t()}),!s&&e.isIntro)for(var a in r)n.style[a]===r[a]&&(n.style[a]=i[a]);e._manager.remove(e),t=!0}},!this._fn)return void this.complete();var a=this._fn.apply(this.ractive,[this].concat(s));a&&a.then(this.complete)},_p.toString=function(){return""},_p.unbind=function(){if(!this.element.attributes.unbinding){var t=this.options&&this.options.template&&this.options.template.v;("t0"===t||"t1"===t)&&(this.element.intro=null),("t0"===t||"t2"===t)&&(this.element.outro=null)}},_p.unregisterCompleteHandler=function(t){V(this.onComplete,t)};var Ep=kp.prototype;Ep.destroyed=Ep.firstNode=Ep.rebound=Ep.render=Ep.unrender=Ep.update=f;var Ap,Cp,Sp={};try{ic("table").innerHTML="foo"}catch(Op){Ap=!0,Cp={TABLE:['<table class="x">',"</table>"],THEAD:['<table><thead class="x">',"</thead></table>"],TBODY:['<table><tbody class="x">',"</tbody></table>"],TR:['<table><tr class="x">',"</tr></table>"],SELECT:['<select class="x">',"</select>"]}}var jp=function(t){function e(e){t.call(this,e)}t&&(e.__proto__=t);var n=e.prototype=Object.create(t&&t.prototype);return n.constructor=e,n.detach=function(){var t=ti();return this.nodes&&this.nodes.forEach(function(e){return t.appendChild(e)}),t},n.find=function(t){var e,n=this,i=this.nodes.length;for(e=0;i>e;e+=1){var r=n.nodes[e];if(1===r.nodeType){if(rc(r,t))return r;var s=r.querySelector(t);if(s)return s}}return null},n.findAll=function(t,e){var n,i=this,r=e.result,s=this.nodes.length;for(n=0;s>n;n+=1){var a=i.nodes[n];if(1===a.nodeType){rc(a,t)&&r.push(a);var o=a.querySelectorAll(t);o&&r.push.apply(r,o)}}},n.findComponent=function(){return null},n.firstNode=function(){return this.rendered&&this.nodes[0]},n.render=function(t,e,n){var i=this;if(!this.nodes){var r=this.model?this.model.get():"";this.nodes=zs(r,t)}var s=this.nodes;if(e){for(var a,o=-1;e.length&&(a=this.nodes[o+1]);)for(var u=void 0;u=e.shift();){var h=u.nodeType;if(h===a.nodeType&&(1===h&&u.outerHTML===a.outerHTML||(3===h||8===h)&&u.nodeValue===a.nodeValue)){i.nodes.splice(++o,1,u);break}t.removeChild(u)}o>=0&&(s=this.nodes.slice(o)),e.length&&(n=e[0])}if(s.length){var l=ti();s.forEach(function(t){return l.appendChild(t)}),n?t.insertBefore(l,n):t.appendChild(l)}this.rendered=!0},n.toString=function(){var t=this.model&&this.model.get();return t=null!=t?""+t:"",_r()?yt(t):t},n.unrender=function(){this.nodes&&this.nodes.forEach(function(t){yl.detachWhenReady({node:t,detach:function(){ni(t)}})}),this.rendered=!1,this.nodes=null},n.update=function(){this.rendered&&this.dirty?(this.dirty=!1,this.unrender(),this.render(this.up.findParentNode(),null,this.up.findNextNode(this))):this.dirty=!1},e}(Cd),Np={};Np[Xo]=Hd,Np[Ho]=Vf,Np[tu]=Zs,Np[Jo]=Bf,Np[Bo]=Od,Np[Uo]=ks,Np[Lo]=Hd,Np[Ko]=jp,Np[Qo]=ks,Np[Zo]=_f,Np[ju]=Ef,Np[Su]=If,Np[Cu]=dd,Np[Ou]=kp,Np[$o]=Ar;var Tp={doctype:Bf,form:rd,input:jd,option:Kd,select:Zd,textarea:Wd},Vp=function(t){this.owner=t.owner,this.isRoot=!t.owner.up,this.parent=this.isRoot?null:this.owner.up,this.ractive=t.ractive||(this.isRoot?t.owner:this.parent.ractive),this.componentParent=this.isRoot&&this.ractive.component?this.ractive.component.up:null,!this.isRoot||this.ractive.delegate?this.delegate=this.owner.containerFragment?this.owner.containerFragment&&this.owner.containerFragment.delegate:this.componentParent&&this.componentParent.delegate||this.parent&&this.parent.delegate:this.delegate=!1,this.context=null,this.rendered=!1,"cssIds"in t?this.cssIds=t.cssIds&&t.cssIds.length&&t.cssIds:this.cssIds=this.parent?this.parent.cssIds:null,this.dirty=!1,this.dirtyValue=!0,this.template=t.template||[],this.createItems()},Mp=Vp.prototype;Mp.bind=function(t){var e=this;this.context=t,this.owner.template.z&&(this.aliases=Qs(this.owner.template.z,this.owner.containerFragment||this.parent));for(var n=this.items.length,i=0;n>i;i++)e.items[i].bind();return this.bound=!0,this.dirty&&this.update(),this},Mp.bubble=function(){this.dirtyValue=!0,this.dirty||(this.dirty=!0,this.isRoot?this.ractive.component?this.ractive.component.bubble():this.bound&&yl.addFragment(this):this.owner.bubble(this.index))},Mp.createItems=function(){var t=this,e=this.template.length;this.items=[];for(var n=0;e>n;n++)t.items[n]=Ws({up:t,template:t.template[n],index:n})},Mp.destroyed=function(){for(var t=this,e=this.items.length,n=0;e>n;n++)t.items[n].destroyed();this.pathModel&&this.pathModel.destroyed(),this.rootModel&&this.rootModel.destroyed()},Mp.detach=function(){for(var t=ti(),e=this.items,n=e.length,i=0;n>i;i++)t.appendChild(e[i].detach());return t},Mp.find=function(t,e){return I(this.items,function(n){return n.find(t,e)})},Mp.findAll=function(t,e){this.items&&this.items.forEach(function(n){return n.findAll&&n.findAll(t,e)})},Mp.findComponent=function(t,e){return I(this.items,function(n){return n.findComponent(t,e)})},Mp.findAllComponents=function(t,e){this.items&&this.items.forEach(function(n){return n.findAllComponents&&n.findAllComponents(t,e)})},Mp.findContext=function(){var t=rn(this);return t&&t.context?t.context:this.ractive.viewmodel},Mp.findNextNode=function(t){var e=this;if(t)for(var n,i=t.index+1;i<this.items.length;i++)if(n=e.items[i],n&&n.firstNode){var r=n.firstNode(!0);if(r)return r}return this.isRoot?this.ractive.component?this.ractive.component.up.findNextNode(this.ractive.component):null:this.parent?this.owner.findNextNode(this):void 0},Mp.findParentNode=function(){var t=this;do{if(t.owner.type===zo)return t.owner.node;if(t.isRoot&&!t.ractive.component)return t.ractive.el;t=t.owner.type===Qo?t.owner.containerFragment:t.componentParent||t.parent}while(t);throw new Error("Could not find parent node")},Mp.firstNode=function(t){var e=I(this.items,function(t){return t.firstNode(!0)});return e?e:t?null:this.parent.findNextNode(this.owner)},Mp.getKey=function(){return this.keyModel||(this.keyModel=new Fd(this.key))},Mp.getIndex=function(){return this.idxModel||(this.idxModel=new Fd(this.index))},Mp.rebind=function(t){this.context=t,this.rootModel&&(this.rootModel.context=this.context),this.pathModel&&(this.pathModel.context=this.context)},Mp.rebound=function(t){if(this.owner.template.z){var e=this.aliases;for(var n in e)e[n].rebound?e[n].rebound(t):(e[n].unreference(),e[n]=0);Qs(this.owner.template.z,this.owner.containerFragment||this.parent,e)}this.items.forEach(function(e){return e.rebound(t)}),t&&(this.rootModel&&this.rootModel.applyValue(this.context.getKeypath(this.ractive.root)),this.pathModel&&this.pathModel.applyValue(this.context.getKeypath()))},Mp.render=function(t,e){if(this.rendered)throw new Error("Fragment is already rendered!");this.rendered=!0;for(var n=this.items,i=n.length,r=0;i>r;r++)n[r].render(t,e)},Mp.resetTemplate=function(t){var e=this.bound,n=this.rendered;if(e&&(n&&this.unrender(!0),this.unbind()),this.template=t,this.createItems(),e&&(this.bind(this.context),n)){var i=this.findParentNode(),r=this.findNextNode();if(r){var s=ti();this.render(s),i.insertBefore(s,r)}else this.render(i)}},Mp.shuffled=function(){this.items.forEach(nt),this.rootModel&&this.rootModel.applyValue(this.context.getKeypath(this.ractive.root)),this.pathModel&&this.pathModel.applyValue(this.context.getKeypath())},Mp.toString=function(t){return this.items.map(t?ut:ot).join("")},Mp.unbind=function(t){var e=this;if(this.owner.template.z&&!this.owner.yielder){for(var n in e.aliases)e.aliases[n].unreference();this.aliases={}}this.context=null;for(var i=this.items.length,r=0;i>r;r++)e.items[r].unbind(t);return this.bound=!1,this},Mp.unrender=function(t){for(var e=this,n=this.items.length,i=0;n>i;i++)e.items[i].unrender(t);this.rendered=!1},Mp.update=function(){var t=this;if(this.dirty)if(this.updating)this.isRoot&&yl.addFragmentToRoot(this);else{this.dirty=!1,this.updating=!0;for(var e=this.items.length,n=0;e>n;n++)t.items[n].update();this.updating=!1}},Mp.valueOf=function(){if(1===this.items.length)return this.items[0].valueOf();if(this.dirtyValue){var t={},e=Gs(this.items,t,this.ractive._guid),n=ms(e,t);this.value=n?n.value:this.toString(),this.dirtyValue=!1}return this.value},Vp.prototype.getContext=nn,Vp.prototype.getKeypath=Ys;var Pp=["template","partials","components","decorators","events"],Ip=$n("reverse").path,Rp=$n("shift").path,Bp=$n("sort").path,Kp=$n("splice").path,Lp=$n("unshift").path,Dp={add:cn,animate:mn,attachChild:On,compute:Vn,detach:Mn,detachChild:Pn,find:In,findAll:Rn,findAllComponents:Bn,findComponent:Kn,findContainer:Ln,findParent:Dn,fire:Qn,get:Yn,getContext:Xn,insert:si,link:oi,observe:fi,observeOnce:pi,off:mi,on:vi,once:gi,pop:Nc,push:Tc,readLink:yi,render:ea,reset:na,resetPartial:ra,resetTemplate:sa,reverse:Ip,set:aa,shift:Rp,sort:Bp,splice:Kp,subtract:oa,teardown:Cr,toggle:ua,toCSS:ha,toCss:ha,toHTML:la,toHtml:la,toText:ca,transition:fa,unlink:da,unrender:pa,unshift:Lp,update:Hn,updateModel:ma,use:va},Fp=[],zp=/super\s*\(|\.call\s*\(\s*this/;
if(Ba(Va,{sharedGet:{value:_a},sharedSet:{value:ka},styleGet:{configurable:!0,value:ya.bind(Va)},styleSet:{configurable:!0,value:Ni.bind(Va)},addCSS:{configurable:!1,value:ba.bind(Va)},hasCSS:{configurable:!1,value:xa.bind(Va)}}),za&&!za.Ractive){var Up="",$p=document.currentScript||document.querySelector("script[data-ractive-options]");$p&&(Up=$p.getAttribute("data-ractive-options")||""),~Up.indexOf("ForceGlobal")&&(za.Ractive=Va)}else za&&v("Ractive already appears to be loaded while loading 1.3.2.");return Pa(Va.prototype,Dp,ao),Va.prototype.constructor=Va,Va.defaults=Va.prototype,nl.defaults=Va.defaults,nl.Ractive=Va,Ba(Va,{DEBUG:{writable:!0,value:!0},DEBUG_PROMISES:{writable:!0,value:!0},extend:{value:Aa},extendWith:{value:Ca},escapeKey:{value:_},evalObjectString:{value:ms},findPlugin:{value:Ta},getContext:{value:Jn},getCSS:{value:xi},isInstance:{value:ga},joinKeys:{value:ja},macro:{value:Oa},normaliseKeypath:{value:E},parse:{value:Ie},splitKeypath:{value:Na},unescapeKey:{value:C},use:{value:Ea},enhance:{writable:!0,value:!1},svg:{value:Za},tick:{get:function(){return gl&&gl.promise}},VERSION:{value:"1.3.2"},adaptors:{writable:!0,value:{}},components:{writable:!0,value:{}},decorators:{writable:!0,value:{}},easing:{writable:!0,value:oo},events:{writable:!0,value:{}},extensions:{value:[]},helpers:{writable:!0,value:ao.helpers},interpolators:{writable:!0,value:mo},partials:{writable:!0,value:{}},transitions:{writable:!0,value:{}},cssData:{configurable:!0,value:{}},sharedData:{value:Cl},Ractive:{value:Va},Context:{value:Nl.Context.prototype}}),Ra(Va,"_cssModel",{configurable:!0,value:new Wc(Va)}),Ra(Va.prototype,"rendered",{get:function(){return this.fragment&&this.fragment.rendered}}),Va});
//# sourceMappingURL=ractive.min.js.map
