ember-source 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ember-source might be problematic. Click here for more details.
- data/dist/ember-data-deps.js +1506 -1309
- data/dist/ember-data-deps.min.js +5 -5
- data/dist/ember-data-deps.prod.js +1499 -1302
- data/dist/ember-debug.js +2 -2
- data/dist/ember-old-router.js +2864 -4816
- data/dist/ember-old-router.min.js +8 -9
- data/dist/ember-old-router.prod.js +2849 -4801
- data/dist/ember-runtime.js +1505 -1308
- data/dist/ember-runtime.min.js +5 -5
- data/dist/ember-runtime.prod.js +1492 -1295
- data/dist/ember-spade.js +1 -1
- data/dist/ember-template-compiler.js +3 -3
- data/dist/ember-template-compiler.min.js +2 -2
- data/dist/ember-template-compiler.prod.js +1 -1
- data/dist/ember-tests.js +1 -1
- data/dist/ember.js +2746 -4636
- data/dist/ember.min.js +8 -9
- data/dist/ember.prod.js +2750 -4640
- metadata +2 -2
data/dist/ember-data-deps.min.js
CHANGED
@@ -8,10 +8,10 @@
|
|
8
8
|
// ==========================================================================
|
9
9
|
|
10
10
|
|
11
|
-
// Version: v1.0.0-rc.1-
|
12
|
-
// Last commit:
|
11
|
+
// Version: v1.0.0-rc.1-188-gb6bb967
|
12
|
+
// Last commit: b6bb967 (2013-03-16 18:09:42 -0700)
|
13
13
|
|
14
14
|
|
15
|
-
(function(){var e,t;(function(){var n={},r={};e=function(e,t,r){n[e]={deps:t,callback:r}},t=function(e){if(r[e])return r[e];r[e]={};var i=n[e],s=i.deps,o=i.callback,u=[],a;for(var f=0,l=s.length;f<l;f++)s[f]==="exports"?u.push(a={}):u.push(t(s[f]));var c=o.apply(this,u);return r[e]=a||c}})(),function(){function r(t){if(e.console&&e.console[t])return e.console[t].apply?function(){e.console[t].apply(e.console,arguments)}:function(){var n=Array.prototype.join.call(arguments,", ");e.console[t](n)}}"undefined"==typeof Ember&&(Ember={});var e=Ember.imports=Ember.imports||this,t=Ember.exports=Ember.exports||this,n=Ember.lookup=Ember.lookup||this;t.Em=t.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.0-rc.1",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,typeof Ember.EXTEND_PROTOTYPES=="undefined"&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.LOG_VERSION=Ember.ENV.LOG_VERSION===!1?!1:!0,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.debug&&(Ember.debug=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(e,t){return t}),Ember.uuid=0,Ember.Logger={log:r("log")||Ember.K,warn:r("warn")||Ember.K,error:r("error")||Ember.K,info:r("info")||Ember.K,debug:r("debug")||r("info")||Ember.K},Ember.onerror=null,Ember.handleErrors=function(e,t){if("function"!=typeof Ember.onerror)return e.apply(t||this);try{return e.apply(t||this)}catch(n){Ember.onerror(n)}},Ember.merge=function(e,t){for(var n in t){if(!t.hasOwnProperty(n))continue;e[n]=t[n]}}}(),function(){var e=Ember.platform={};Ember.create=Object.create;if(!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,n){t.prototype=e,e=new t;if(n){t.prototype=e;for(var r in n)t.prototype[r]=n[r].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var n=Object.defineProperty,r,i;if(n)try{n({},"a",{get:function(){}})}catch(s){n=null}n&&(r=function(){var e={};return n(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),n(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),i=function(){try{return n(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?i||(n=function(e,t,n){var r;return typeof Node=="object"?r=e instanceof Node:r=typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",r?e[t]=n.value:Object.defineProperty(e,t,n)}):n=null),e.defineProperty=n,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,n){n.get||(e[t]=n.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){function h(e){this.descs={},this.watching={},this.cache={},this.source=e}function p(e,t){return!!e&&typeof e[t]=="function"}var e=Ember.platform.defineProperty,t=Ember.create,n="__ember"+ +(new Date),r=0,i=[],s={},o=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=n;var u={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(i,s){s||(s="ember");var o=s+r++;return i&&(u.value=o,e(i,n,u)),o},Ember.guidFor=function(o){if(o===undefined)return"(undefined)";if(o===null)return"(null)";var a,f,l=typeof o;switch(l){case"number":return f=i[o],f||(f=i[o]="nu"+o),f;case"string":return f=s[o],f||(f=s[o]="st"+r++),f;case"boolean":return o?"(true)":"(false)";default:if(o[n])return o[n];if(o===Object)return"(Object)";if(o===Array)return"(Array)";return f="ember"+r++,u.value=f,e(o,n,u),f}};var a={writable:!0,configurable:!1,enumerable:!1,value:null},f=Ember.GUID_KEY+"_meta";Ember.META_KEY=f;var l={descs:{},watching:{}};o&&(l.values={}),Ember.EMPTY_META=l,Object.freeze&&Object.freeze(l);var c=Ember.platform.defineProperty.isSimulated;c&&(h.prototype.__preventPlainObject__=!0,h.prototype.toJSON=function(){}),Ember.meta=function(r,i){var s=r[f];return i===!1?s||l:(s?s.source!==r&&(c||e(r,f,a),s=t(s),s.descs=t(s.descs),s.watching=t(s.watching),s.cache={},s.source=r,o&&(s.values=t(s.values)),r[f]=s):(c||e(r,f,a),s=new h(r),o&&(s.values={}),r[f]=s,s.descs.constructor=null),s)},Ember.getMeta=function(t,n){var r=Ember.meta(t,!1);return r[n]},Ember.setMeta=function(t,n,r){var i=Ember.meta(t,!0);return i[n]=r,r},Ember.metaPath=function(n,r,i){var s=Ember.meta(n,i),o,u;for(var a=0,f=r.length;a<f;a++){o=r[a],u=s[o];if(!u){if(!i)return undefined;u=s[o]={__ember_source__:n}}else if(u.__ember_source__!==n){if(!i)return undefined;u=s[o]=t(u),u.__ember_source__=n}s=u}return u},Ember.wrap=function(e,t){function n(){}function r(){var r,i=this._super;return this._super=t||n,r=e.apply(this,arguments),this._super=i,r}return r.wrappedFunction=e,r.__ember_observes__=e.__ember_observes__,r.__ember_observesBefore__=e.__ember_observesBefore__,r},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:e.length!==undefined&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return e===null||e===undefined?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=p,Ember.tryInvoke=function(e,t,n){if(p(e,t))return e[t].apply(e,n||[])};var d=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return e!==1}();d?Ember.tryFinally=function(e,t,n){var r,i,s;n=n||this;try{r=e.call(n)}finally{try{i=t.call(n)}catch(o){s=o}}if(s)throw s;return i===undefined?r:i}:Ember.tryFinally=function(e,t,n){var r,i;n=n||this;try{r=e.call(n)}finally{i=t.call(n)}return i===undefined?r:i},d?Ember.tryCatchFinally=function(e,t,n,r){var i,s,o,u;r=r||this;try{i=e.call(r)}catch(a){i=t.call(r,a)}finally{try{s=n.call(r)}catch(f){o=f}}if(o)throw o;return s===undefined?i:s}:Ember.tryCatchFinally=function(e,t,n,r){var i,s;r=r||this;try{i=e.call(r)}catch(o){i=t.call(r,o)}finally{s=n.call(r)}return s===undefined?i:s}}(),function(){Ember.Instrumentation={};var e=[],t={},n=function(n){var r=[],i;for(var s=0,o=e.length;s<o;s++)i=e[s],i.regex.test(n)&&r.push(i.object);return t[n]=r,r},r=function(){var e="undefined"!=typeof window?window.performance||{}:{},t=e.now||e.mozNow||e.webkitNow||e.msNow||e.oNow;return t?t.bind(e):function(){return+(new Date)}}();Ember.Instrumentation.instrument=function(e,i,s,o){function d(){for(h=0,p=u.length;h<p;h++)c=u[h],l[h]=c.before(e,r(),i);return s.call(o)}function v(e){i=i||{},i.exception=e}function m(){for(h=0,p=u.length;h<p;h++)c=u[h],c.after(e,r(),i,l[h]);Ember.STRUCTURED_PROFILE&&console.timeEnd(a)}var u=t[e],a,f;Ember.STRUCTURED_PROFILE&&(a=e+": "+i.object,console.time(a)),u||(u=n(e));if(u.length===0)return f=s.call(o),Ember.STRUCTURED_PROFILE&&console.timeEnd(a),f;var l=[],c,h,p;return Ember.tryCatchFinally(d,v,m)},Ember.Instrumentation.subscribe=function(n,r){var i=n.split("."),s,o=[];for(var u=0,a=i.length;u<a;u++)s=i[u],s==="*"?o.push("[^\\.]*"):o.push(s);o=o.join("\\."),o+="(\\..*)?";var f={pattern:n,regex:new RegExp("^"+o+"$"),object:r};return e.push(f),t={},f},Ember.Instrumentation.unsubscribe=function(n){var r;for(var i=0,s=e.length;i<s;i++)e[i]===n&&(r=i);e.splice(r,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e=Ember.EnumerableUtils={map:function(e,t,n){return e.map?e.map.call(e,t,n):Array.prototype.map.call(e,t,n)},forEach:function(e,t,n){return e.forEach?e.forEach.call(e,t,n):Array.prototype.forEach.call(e,t,n)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):Array.prototype.indexOf.call(e,t,n)},indexesOf:function(t,n){return n===undefined?[]:e.map(n,function(n){return e.indexOf(t,n)})},addObject:function(t,n){var r=e.indexOf(t,n);r===-1&&t.push(n)},removeObject:function(t,n){var r=e.indexOf(t,n);r!==-1&&t.splice(r,1)},replace:function(e,t,n,r){if(e.replace)return e.replace(t,n,r);var i=Array.prototype.concat.apply([t,n],r);return e.splice.apply(e,i)},intersection:function(e,t){var n=[];return e.forEach(function(e){t.indexOf(e)>=0&&n.push(e)}),n}}}(),function(){var e=function(e){return e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1},t=e(Array.prototype.map)?Array.prototype.map:function(e){if(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=new Array(n),i=arguments[1];for(var s=0;s<n;s++)s in t&&(r[s]=e.call(i,t[s],s,t));return r},n=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=arguments[1];for(var i=0;i<n;i++)i in t&&e.call(r,t[i],i,t)},r=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){t===null||t===undefined?t=0:t<0&&(t=Math.max(0,this.length+t));for(var n=t,r=this.length;n<r;n++)if(this[n]===e)return n;return-1};Ember.ArrayPolyfills={map:t,forEach:n,indexOf:r},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=n),Array.prototype.indexOf||(Array.prototype.indexOf=r))}(),function(){var e=Ember.guidFor,t=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,t.values=i,t},i=Ember.OrderedSet=function(){this.clear()};i.create=function(){return new i},i.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(t){var n=e(t),r=this.presenceSet,i=this.list;if(n in r)return;r[n]=!0,i.push(t)},remove:function(n){var r=e(n),i=this.presenceSet,s=this.list;delete i[r];var o=t.call(s,n);o>-1&&s.splice(o,1)},isEmpty:function(){return this.list.length===0},has:function(t){var n=e(t),r=this.presenceSet;return n in r},forEach:function(e,t){var n=this.list.slice();for(var r=0,i=n.length;r<i;r++)e.call(t,n[r])},toArray:function(){return this.list.slice()},copy:function(){var e=new i;return e.presenceSet=n(this.presenceSet),e.list=this.list.slice(),e}};var s=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};s.create=function(){return new s},s.prototype={get:function(t){var n=this.values,r=e(t);return n[r]},set:function(t,n){var r=this.keys,i=this.values,s=e(t);r.add(t),i[s]=n},remove:function(t){var n=this.keys,r=this.values,i=e(t),s;return r.hasOwnProperty(i)?(n.remove(t),s=r[i],delete r[i],!0):!1},has:function(t){var n=this.values,r=e(t);return n.hasOwnProperty(r)},forEach:function(t,n){var r=this.keys,i=this.values;r.forEach(function(r){var s=e(r);t.call(n,r,i[s])})},copy:function(){return r(this,new s)}};var o=Ember.MapWithDefault=function(e){s.call(this),this.defaultValue=e.defaultValue};o.create=function(e){return e?new o(e):new s},o.prototype=Ember.create(s.prototype),o.prototype.get=function(e){var t=this.has(e);if(t)return s.prototype.get.call(this,e);var n=this.defaultValue(e);return this.set(e,n),n},o.prototype.copy=function(){return r(this,new o({defaultValue:this.defaultValue}))}}(),function(){function a(e){return e.match(u)[0]}function f(e,n){var r=o.test(n),i=!r&&s.test(n),u;if(!e||i)e=Ember.lookup;r&&(n=n.slice(5)),e===Ember.lookup&&(u=a(n),e=t(e,u),n=n.slice(u.length+1));if(!n||n.length===0)throw new Error("Invalid Path");return[e,n]}function l(e,n){var r,i,s,u,a;if(e===null&&n.indexOf(".")===-1)return t(Ember.lookup,n);r=o.test(n);if(!e||r)s=f(e,n),e=s[0],n=s[1],s.length=0;i=n.split("."),a=i.length;for(u=0;e&&u<a;u++){e=t(e,i[u],!0);if(e&&e.isDestroyed)return undefined}return e}function c(e,t,r,i){var s;s=t.slice(t.lastIndexOf(".")+1),t=t.slice(0,t.length-(s.length+1)),t!=="this"&&(e=l(e,t));if(!s||s.length===0)throw new Error("You passed an empty path");if(!e){if(i)return;throw new Error("Object in path "+t+" could not be found or was destroyed.")}return n(e,s,r)}var e=Ember.META_KEY,t,n,r=Ember.ENV.MANDATORY_SETTER,i=/^([A-Z$]|([0-9][A-Z$]))/,s=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,o=/^this[\.\*]/,u=/^([^\.\*]+)/;t=function(n,i){if(i==="")return n;!i&&"string"==typeof n&&(i=n,n=null);if(!n||i.indexOf(".")!==-1)return l(n,i);var s=n[e],o=s&&s.descs[i],u;return o?o.get(n,i):(r&&s&&s.watching[i]>0?u=s.values[i]:u=n[i],u!==undefined||"object"!=typeof n||i in n||"function"!=typeof n.unknownProperty?u:n.unknownProperty(i))},n=function(n,i,s,o){typeof n=="string"&&(s=i,i=n,n=null);if(!n||i.indexOf(".")!==-1)return c(n,i,s,o);var u=n[e],a=u&&u.descs[i],f,l;return a?a.set(n,i,s):(f="object"==typeof n&&!(i in n),f&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,s):u&&u.watching[i]>0?(r?l=u.values[i]:l=n[i],s!==l&&(Ember.propertyWillChange(n,i),r?l!==undefined||i in n?u.values[i]=s:Ember.defineProperty(n,i,null,s):n[i]=s,Ember.propertyDidChange(n,i))):n[i]=s),s},Ember.config.overrideAccessors&&(Ember.get=t,Ember.set=n,Ember.config.overrideAccessors(),t=Ember.get,n=Ember.set),Ember.normalizeTuple=function(e,t){return f(e,t)},Ember.getWithDefault=function(e,n,r){var i=t(e,n);return i===undefined?r:i},Ember.get=t,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get),Ember.set=n,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(e,t,r){return n(e,t,r,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet),Ember.isGlobalPath=function(e){return i.test(e)}}(),function(){var e=Ember.GUID_KEY,t=Ember.META_KEY,n=Ember.EMPTY_META,r=Ember.meta,i=Ember.create,s=Ember.platform.defineProperty,o=Ember.ENV.MANDATORY_SETTER,u=Ember.Descriptor=function(){},a=Ember.MANDATORY_SETTER_FUNCTION=function(e){},f=Ember.DEFAULT_GETTER_FUNCTION=function(e){return function(){var n=this[t];return n&&n.values[e]}};Ember.defineProperty=function(e,t,n,i,u){var l,c,h,p;return u||(u=r(e)),l=u.descs,c=u.descs[t],h=u.watching[t]>0,c instanceof Ember.Descriptor&&c.teardown(e,t),n instanceof Ember.Descriptor?(p=n,l[t]=n,o&&h?s(e,t,{configurable:!0,enumerable:!0,writable:!0,value:undefined}):e[t]=undefined,n.setup(e,t)):(l[t]=undefined,n==null?(p=i,o&&h?(u.values[t]=i,s(e,t,{configurable:!0,enumerable:!0,set:a,get:f(t)})):e[t]=i):(p=n,s(e,t,n))),h&&Ember.overrideChains(e,t,u),e.didDefineProperty&&e.didDefineProperty(e,t,p),this}}(),function(){function i(){this.clear()}function u(t){return t+e}function a(e){return e+t}var e=":change",t=":before",n=Ember.guidFor,r=0;i.prototype.add=function(e,t,n){var r=this.observerSet,i=this.observers,s=Ember.guidFor(e),o=r[s],u;return o||(r[s]=o={}),u=o[t],u===undefined&&(u=i.push({sender:e,keyName:t,eventName:n,listeners:[]})-1,o[t]=u),i[u].listeners},i.prototype.flush=function(){var e=this.observers,t,n,r,i;this.clear();for(t=0,n=e.length;t<n;++t){r=e[t],i=r.sender;if(i.isDestroying||i.isDestroyed)continue;Ember.sendEvent(i,r.eventName,[i,r.keyName],r.listeners)}},i.prototype.clear=function(){this.observerSet={},this.observers=[]};var s=new i,o=new i;Ember.beginPropertyChanges=function(){r++},Ember.endPropertyChanges=function(){r--,r<=0&&(s.clear(),o.flush())},Ember.changeProperties=function(e,t){Ember.beginPropertyChanges(),Ember.tryFinally(e,Ember.endPropertyChanges,t)},Ember.setProperties=function(e,t){return Ember.changeProperties(function(){for(var n in t)t.hasOwnProperty(n)&&Ember.set(e,n,t[n])}),e},Ember.addObserver=function(e,t,n,r){return Ember.addListener(e,u(t),n,r),Ember.watch(e,t),this},Ember.observersFor=function(e,t){return Ember.listenersFor(e,u(t))},Ember.removeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,u(t),n,r),this},Ember.addBeforeObserver=function(e,t,n,r){return Ember.addListener(e,a(t),n,r),Ember.watch(e,t),this},Ember._suspendBeforeObserver=function(e,t,n,r,i){return Ember._suspendListener(e,a(t),n,r,i)},Ember._suspendObserver=function(e,t,n,r,i){return Ember._suspendListener(e,u(t),n,r,i)};var f=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,t,n,r,i){var s=f.call(t,a);return Ember._suspendListeners(e,s,n,r,i)},Ember._suspendObservers=function(e,t,n,r,i){var s=f.call(t,u);return Ember._suspendListeners(e,s,n,r,i)},Ember.beforeObserversFor=function(e,t){return Ember.listenersFor(e,a(t))},Ember.removeBeforeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,a(t),n,r),this},Ember.notifyBeforeObservers=function(e,t){if(e.isDestroying)return;var n=a(t),i,o;r?(i=s.add(e,t,n),o=Ember.listenersDiff(e,n,i),Ember.sendEvent(e,n,[e,t],o)):Ember.sendEvent(e,n,[e,t])},Ember.notifyObservers=function(e,t){if(e.isDestroying)return;var n=u(t),i;r?(i=o.add(e,t,n),Ember.listenersUnion(e,n,i)):Ember.sendEvent(e,n,[e,t])}}(),function(){function p(e){return e.match(f)[0]}function d(e){return e==="*"||!l.test(e)}function v(t,n,r,i,s){var o=e(n);i[o]||(i[o]={});if(i[o][r])return;i[o][r]=!0;var u=s.deps;u=u&&u[r];if(u)for(var a in u){var f=s.descs[a];if(f&&f._suspended===n)continue;t(n,a)}}function y(e,t,n){if(e.isDestroying)return;var r=m,i=!r;i&&(r=m={}),v(O,e,t,r,n),i&&(m=null)}function b(e,t,n){if(e.isDestroying)return;var r=g,i=!r;i&&(r=g={}),v(M,e,t,r,n),i&&(g=null)}function w(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e),s=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(s=i.chainWatchers={}),s[n]||(s[n]=[]),s[n].push(r),Ember.watch(e,n)}function E(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e,!1);if(!i.hasOwnProperty("chainWatchers"))return;var s=i.chainWatchers;if(s[n]){s=s[n];for(var o=0,u=s.length;o<u;o++)s[o]===r&&s.splice(o,1)}Ember.unwatch(e,n)}function x(){if(S.length===0)return;var e=S;S=[],a.call(e,function(e){e[0].add(e[1])})}function T(e){return t(e,!1).proto===e}function k(e){var n=t(e),r=n.chains;return r?r.value()!==e&&(r=n.chains=r.copy(e)):r=n.chains=new N(null,null,e),r}function L(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=0,o=i.length;s<o;s++)i[s].willChange(r)}function A(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=i.length-1;s>=0;s--)i[s].didChange(r)}function O(e,n,r){var i=t(e,!1),s=i.watching[n]>0||n==="length",o=i.proto,u=i.descs[n];if(!s)return;if(o===e)return;u&&u.willChange&&u.willChange(e,n),y(e,n,i),L(e,n,i),Ember.notifyBeforeObservers(e,n)}function M(e,n){var r=t(e,!1),i=r.watching[n]>0||n==="length",s=r.proto,o=r.descs[n];if(s===e)return;o&&o.didChange&&o.didChange(e,n);if(!i&&n!=="length")return;b(e,n,r),A(e,n,r),Ember.notifyObservers(e,n)}var e=Ember.guidFor,t=Ember.meta,n=Ember.get,r=Ember.set,i=Ember.normalizeTuple,s=Ember.GUID_KEY,o=Ember.META_KEY,u=Ember.notifyObservers,a=Ember.ArrayPolyfills.forEach,f=/^([^\.\*]+)/,l=/[\.\*]/,c=Ember.ENV.MANDATORY_SETTER,h=Ember.platform.defineProperty,m,g,S=[],N=function(e,t,n){var r;this._parent=e,this._key=t,this._watching=n===undefined,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&w(this._object,this._key,this)),this._parent&&this._parent._key==="@each"&&this.value()},C=N.prototype;C.value=function(){if(this._value===undefined&&this._watching){var e=this._parent.value();this._value=e&&!T(e)?n(e,this._key):undefined}return this._value},C.destroy=function(){if(this._watching){var e=this._object;e&&E(e,this._key,this),this._watching=!1}},C.copy=function(e){var t=new N(null,null,e),n=this._paths,r;for(r in n){if(n[r]<=0)continue;t.add(r)}return t},C.add=function(e){var t,n,r,s,o;o=this._paths,o[e]=(o[e]||0)+1,t=this.value(),n=i(t,e);if(n[0]&&n[0]===t)e=n[1],r=p(e),e=e.slice(r.length+1);else{if(!n[0]){S.push([this,e]),n.length=0;return}s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]}n.length=0,this.chain(r,e,s)},C.remove=function(e){var t,n,r,s,o;o=this._paths,o[e]>0&&o[e]--,t=this.value(),n=i(t,e),n[0]===t?(e=n[1],r=p(e),e=e.slice(r.length+1)):(s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]),n.length=0,this.unchain(r,e)},C.count=0,C.chain=function(e,t,n){var r=this._chains,i;r||(r=this._chains={}),i=r[e],i||(i=r[e]=new N(this,e,n)),i.count++,t&&t.length>0&&(e=p(t),t=t.slice(e.length+1),i.chain(e,t))},C.unchain=function(e,t){var n=this._chains,r=n[e];t&&t.length>1&&(e=p(t),t=t.slice(e.length+1),r.unchain(e,t)),r.count--,r.count<=0&&(delete n[r._key],r.destroy())},C.willChange=function(){var e=this._chains;if(e)for(var t in e){if(!e.hasOwnProperty(t))continue;e[t].willChange()}this._parent&&this._parent.chainWillChange(this,this._key,1)},C.chainWillChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,n+1):(n>1&&Ember.propertyWillChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyWillChange(this.value(),t))},C.chainDidChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,n+1):(n>1&&Ember.propertyDidChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyDidChange(this.value(),t))},C.didChange=function(e){if(this._watching){var t=this._parent.value();t!==this._object&&(E(this._object,this._key,this),this._object=t,w(t,this._key,this)),this._value=undefined,this._parent&&this._parent._key==="@each"&&this.value()}var n=this._chains;if(n)for(var r in n){if(!n.hasOwnProperty(r))continue;n[r].didChange(e)}if(e)return;this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.overrideChains=function(e,t,n){A(e,t,n,!0)},Ember.watch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]?i[n]=(i[n]||0)+1:(i[n]=1,d(n)?(s=r.descs[n],s&&s.willWatch&&s.willWatch(e,n),"function"==typeof e.willWatchProperty&&e.willWatchProperty(n),c&&n in e&&(r.values[n]=e[n],h(e,n,{configurable:!0,enumerable:!0,set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(n)}))):k(e).add(n)),this},Ember.isWatching=function(t,n){var r=t[o];return(r&&r.watching[n])>0},Ember.watch.flushPending=x,Ember.unwatch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]===1?(i[n]=0,d(n)?(s=r.descs[n],s&&s.didUnwatch&&s.didUnwatch(e,n),"function"==typeof e.didUnwatchProperty&&e.didUnwatchProperty(n),c&&n in e&&(h(e,n,{configurable:!0,enumerable:!0,writable:!0,value:r.values[n]}),delete r.values[n])):k(e).remove(n)):i[n]>1&&i[n]--,this},Ember.rewatch=function(e){var n=t(e,!1),r=n.chains;return s in e&&!e.hasOwnProperty(s)&&Ember.generateGuid(e,"ember"),r&&r.value()!==e&&(n.chains=r.copy(e)),this},Ember.finishChains=function(e){var n=t(e,!1),r=n.chains;r&&(r.value()!==e&&(n.chains=r=r.copy(e)),r.didChange(!0))},Ember.propertyWillChange=O,Ember.propertyDidChange=M;var _=[];Ember.destroy=function(e){var t=e[o],n,r,i,s;if(t){e[o]=null,n=t.chains;if(n){_.push(n);while(_.length>0){n=_.pop(),r=n._chains;if(r)for(i in r)r.hasOwnProperty(i)&&_.push(r[i]);n._watching&&(s=n._object,s&&E(s,n._key,n))}}}}}(),function(){function f(e,t,n){var r=t[n];return r?t.hasOwnProperty(n)||(r=t[n]=s(r)):r=t[n]={},r}function l(e,t){var n=t.deps;return n?t.hasOwnProperty("deps")||(n=t.deps=s(n)):n=t.deps={},n}function c(e,t,n,r){var i=e._dependentKeys,s,o,a,c,h;if(!i)return;s=l(t,r);for(o=0,a=i.length;o<a;o++)c=i[o],h=f(t,s,c),h[n]=(h[n]||0)+1,u(t,c)}function h(e,t,n,r){var i=e._dependentKeys,s,o,u,c,h;if(!i)return;s=l(t,r);for(o=0,u=i.length;o<u;o++)c=i[o],h=f(t,s,c),h[n]=(h[n]||0)-1,a(t,c)}function p(e,t){this.func=e,this._cacheable=t&&t.cacheable!==undefined?t.cacheable:!0,this._dependentKeys=t&&t.dependentKeys}var e=Ember.get,t=Ember.set,n=Ember.meta,r=Ember.guidFor,i=[].slice,s=Ember.create,o=Ember.META_KEY,u=Ember.watch,a=Ember.unwatch;Ember.ComputedProperty=p,p.prototype=new Ember.Descriptor;var d=p.prototype;d.cacheable=function(e){return this._cacheable=e!==!1,this},d.volatile=function(){return this.cacheable(!1)},d.property=function(){var e=[];for(var t=0,n=arguments.length;t<n;t++)e.push(arguments[t]);return this._dependentKeys=e,this},d.meta=function(e){return arguments.length===0?this._meta||{}:(this._meta=e,this)},d.willWatch=function(e,t){var n=e[o];t in n.cache||c(this,e,t,n)},d.didUnwatch=function(e,t){var n=e[o];t in n.cache||h(this,e,t,n)},d.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=n(e);t in r.cache&&(delete r.cache[t],r.watching[t]||h(this,e,t,r))}},d.get=function(e,t){var r,i,s;if(this._cacheable){s=n(e),i=s.cache;if(t in i)return i[t];r=i[t]=this.func.call(e,t),s.watching[t]||c(this,e,t,s)}else r=this.func.call(e,t);return r},d.set=function(e,t,r){var i=this._cacheable,s=this.func,o=n(e,i),u=o.watching[t],a=this._suspended,f=!1,l=o.cache,h,p;this._suspended=e;try{i&&l.hasOwnProperty(t)&&(h=l[t],f=!0),s.wrappedFunction&&(s=s.wrappedFunction);if(s.length===3)p=s.call(e,t,r,h);else{if(s.length!==2){Ember.defineProperty(e,t,null,h),Ember.set(e,t,r);return}p=s.call(e,t,r)}if(f&&h===p)return;u&&Ember.propertyWillChange(e,t),f&&delete l[t],i&&(!u&&!f&&c(this,e,t,o),l[t]=p),u&&Ember.propertyDidChange(e,t)}finally{this._suspended=a}return p},d.setup=function(e,t){var r=e[o];r&&r.watching[t]&&c(this,e,t,n(e))},d.teardown=function(e,t){var r=n(e);return(r.watching[t]||t in r.cache)&&h(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;arguments.length>1&&(t=i.call(arguments,0,-1),e=i.call(arguments,-1)[0]);var n=new p(e);return t&&n.property.apply(n,t),n},Ember.cacheFor=function(t,r){var i=n(t,!1).cache;if(i&&r in i)return i[r]},Ember.computed.not=function(t){return Ember.computed(t,function(n){return!e(this,t)})},Ember.computed.empty=function(t){return Ember.computed(t,function(n){var r=e(this,t);return r===undefined||r===null||r===""||Ember.isArray(r)&&e(r,"length")===0})},Ember.computed.bool=function(t){return Ember.computed(t,function(n){return!!e(this,t)})},Ember.computed.alias=function(n){return Ember.computed(n,function(r,i){return arguments.length===1?e(this,n):(t(this,n,i),i)})}}(),function(){function i(e,t,n){var r=-1;for(var i=0,s=e.length;i<s;i++)if(t===e[i][0]&&n===e[i][1]){r=i;break}return r}function s(n,r){var i=t(n,!0),s;return i.listeners||(i.listeners={}),i.hasOwnProperty("listeners")||(i.listeners=e(i.listeners)),s=i.listeners[r],s&&!i.listeners.hasOwnProperty(r)?s=i.listeners[r]=i.listeners[r].slice():s||(s=i.listeners[r]=[]),s}function o(e,t,n){var s=e[r],o=s&&s.listeners&&s.listeners[t];if(!o)return;for(var u=o.length-1;u>=0;u--){var a=o[u][0],f=o[u][1],l=o[u][2],c=o[u][3],h=i(n,a,f);h===-1&&n.push([a,f,l,c])}}function u(e,t,n){var s=e[r],o=s&&s.listeners&&s.listeners[t],u=[];if(!o)return;for(var a=o.length-1;a>=0;a--){var f=o[a][0],l=o[a][1],c=o[a][2],h=o[a][3],p=i(n,f,l);if(p!==-1)continue;n.push([f,l,c,h]),u.push([f,l,c,h])}return u}function a(e,t,n,r,o){!r&&"function"==typeof n&&(r=n,n=null);var u=s(e,t),a=i(u,n,r);if(a!==-1)return;u.push([n,r,o,undefined]),"function"==typeof e.didAddListener&&e.didAddListener(t,n,r)}function f(e,t,n,o){function u(n,r,o){var u=s(e,t),a=i(u,n,r);if(a===-1)return;u.splice(a,1),"function"==typeof e.didRemoveListener&&e.didRemoveListener(t,n,r)}!o&&"function"==typeof n&&(o=n,n=null);if(o)u(n,o);else{var a=e[r],f=a&&a.listeners&&a.listeners[t];if(!f)return;for(var l=f.length-1;l>=0;l--)u(f[l][0],f[l][1])}}function l(e,t,n,r,o){function l(){return o.call(n)}function c(){f&&(f[3]=undefined)}!r&&"function"==typeof n&&(r=n,n=null);var u=s(e,t),a=i(u,n,r),f;return a!==-1&&(f=u[a].slice(),f[3]=!0,u[a]=f),Ember.tryFinally(l,c)}function c(e,t,n,r,o){function d(){return o.call(n)}function v(){for(c=0,h=u.length;c<h;c++)u[c][3]=undefined}!r&&"function"==typeof n&&(r=n,n=null);var u=[],a,f,l,c,h;for(c=0,h=t.length;c<h;c++){a=t[c],f=s(e,a);var p=i(f,n,r);p!==-1&&(l=f[p].slice(),l[3]=!0,f[p]=l,u.push(l))}return Ember.tryFinally(d,v)}function h(e){var t=e[r].listeners,n=[];if(t)for(var i in t)t[i]&&n.push(i);return n}function p(e,t,n,i){e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,n);if(!i){var s=e[r];i=s&&s.listeners&&s.listeners[t]}if(!i)return;for(var o=i.length-1;o>=0;o--){if(!i[o]||i[o][3]===!0)continue;var u=i[o][0],a=i[o][1],l=i[o][2];l&&f(e,t,u,a),u||(u=e),"string"==typeof a&&(a=u[a]),n?a.apply(u,n):a.apply(u)}return!0}function d(e,t){var n=e[r],i=n&&n.listeners&&n.listeners[t];return!!i&&!!i.length}function v(e,t){var n=[],i=e[r],s=i&&i.listeners&&i.listeners[t];if(!s)return n;for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];n.push([a,f])}return n}var e=Ember.create,t=Ember.meta,n=Ember.metaPath,r=Ember.META_KEY;Ember.addListener=a,Ember.removeListener=f,Ember._suspendListener=l,Ember._suspendListeners=c,Ember.sendEvent=p,Ember.hasListeners=d,Ember.watchedEvents=h,Ember.listenersFor=v,Ember.listenersDiff=u,Ember.listenersUnion=o}(),function(){function n(t,n,r,i){return n===undefined&&(n=t,t=undefined),"string"==typeof n&&(n=t[n]),r&&i>0&&(r=r.length>i?e.call(r,i):null),Ember.handleErrors(function(){return n.apply(t||this,r||[])},this)}function u(){o=null,s.currentRunLoop&&s.end()}function l(){f=null;var e=+(new Date),t=-1;for(var r in a){if(!a.hasOwnProperty(r))continue;var i=a[r];if(i&&i.expires)if(e>=i.expires)delete a[r],n(i.target,i.method,i.args,2);else if(t<0||i.expires<t)t=i.expires}t>0&&(f=setTimeout(l,t- +(new Date)))}function c(e,t){t[this.tguid]&&delete t[this.tguid][this.mguid],a[e]&&n(this.target,this.method,this.args),delete a[e]}function h(e,t,n,r){var i=Ember.guidFor(t),o=Ember.guidFor(n),u=s.autorun().onceTimers,f=u[i]&&u[i][o],l;return f&&a[f]?a[f].args=r:(l={target:t,method:n,args:r,tguid:i,mguid:o},f=Ember.guidFor(l),a[f]=l,u[i]||(u[i]={}),u[i][o]=f,s.schedule(e,l,c,f,u)),f}function d(){p=null;for(var e in a){if(!a.hasOwnProperty(e))continue;var t=a[e];t.next&&(delete a[e],n(t.target,t.method,t.args,2))}}var e=[].slice,t=Ember.ArrayPolyfills.forEach,r,i=function(e){this._prev=e||null,this.onceTimers={}};i.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(t,n,r){var i=this._queues,s;i||(i=this._queues={}),s=i[t],s||(s=i[t]=[]);var o=arguments.length>3?e.call(arguments,3):null;return s.push({target:n,method:r,args:o}),this},flush:function(e){function f(e){n(e.target,e.method,e.args)}function l(){t.call(u,f)}var i,s,o,u,a;if(!this._queues)return this;Ember.watch.flushPending();if(e)while(this._queues&&(u=this._queues[e]))this._queues[e]=null,e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f);else{i=Ember.run.queues,o=i.length,s=0;e:while(s<o){e=i[s],u=this._queues&&this._queues[e],delete this._queues[e],u&&(e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f));for(var c=0;c<=s;c++)if(this._queues&&this._queues[i[c]]){s=c;continue e}s++}}return r=null,this}},Ember.RunLoop=i,Ember.run=function(e,t){function o(){if(e||t)return n(e,t,i,2)}var r,i=arguments;return s.begin(),Ember.tryFinally(o,s.end)};var s=Ember.run;Ember.run.begin=function(){s.currentRunLoop=new i(s.currentRunLoop)},Ember.run.end=function(){function e(){s.currentRunLoop.end()}function t(){s.currentRunLoop=s.currentRunLoop.prev()}Ember.tryFinally(e,t)},Ember.run.queues=["sync","actions","destroy","timers"],Ember.run.schedule=function(e,t,n){var r=s.autorun();r.schedule.apply(r,arguments)};var o;Ember.run.hasScheduledTimers=function(){return!!(o||f||p)},Ember.run.cancelTimers=function(){o&&(clearTimeout(o),o=null),f&&(clearTimeout(f),f=null),p&&(clearTimeout(p),p=null),a={}},Ember.run.autorun=function(){return s.currentRunLoop||(s.begin(),o||(o=setTimeout(u,1))),s.currentRunLoop},Ember.run.sync=function(){s.autorun(),s.currentRunLoop.flush("sync")};var a={},f;Ember.run.later=function(t,n){var r,i,o,u,f;return arguments.length===2&&"function"==typeof t?(f=n,n=t,t=undefined,r=[t,n]):(r=e.call(arguments),f=r.pop()),i=+(new Date)+f,o={target:t,method:n,expires:i,args:r},u=Ember.guidFor(o),a[u]=o,s.once(a,l),u},Ember.run.once=function(t,n){return h("actions",t,n,e.call(arguments,2))},Ember.run.scheduleOnce=function(t,n,r,i){return h(t,n,r,e.call(arguments,3))};var p;Ember.run.next=function(t,n){var r,i={target:t,method:n,args:e.call(arguments),next:!0};return r=Ember.guidFor(i),a[r]=i,p||(p=setTimeout(d,1)),r},Ember.run.cancel=function(e){delete a[e]}}(),function(){function i(t,n){return e(r(n)?Ember.lookup:t,n)}function o(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}Ember.LOG_BINDINGS=!!Ember.ENV.LOG_BINDINGS;var e=Ember.get,t=Ember.set,n=Ember.guidFor,r=Ember.isGlobalPath,s=function(
|
16
|
-
e,t){this._direction="fwd",this._from=t,this._to=e,this._directionMap=Ember.Map.create()};s.prototype={copy:function(){var e=new s(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+n(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(e){var t=this._from,n=this._to;return Ember.trySet(e,n,i(e,t)),Ember.addObserver(e,t,this,this.fromDidChange),this._oneWay||Ember.addObserver(e,n,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(e){var t=!this._oneWay;return Ember.removeObserver(e,this._from,this,this.fromDidChange),t&&Ember.removeObserver(e,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync(e,"fwd")},toDidChange:function(e){this._scheduleSync(e,"back")},_scheduleSync:function(e,t){var n=this._directionMap,r=n.get(e);r||(Ember.run.schedule("sync",this,this._sync,e),n.set(e,t)),r==="back"&&t==="fwd"&&n.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(t.isDestroyed||!this._readyToSync)return;var r=this._directionMap,s=r.get(t),o=this._from,u=this._to;r.remove(t);if(s==="fwd"){var a=i(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",a,t),this._oneWay?Ember.trySet(t,u,a):Ember._suspendObserver(t,u,this,this.toDidChange,function(){Ember.trySet(t,u,a)})}else if(s==="back"){var f=e(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",f,t),Ember._suspendObserver(t,o,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(o)?Ember.lookup:t,o,f)})}}},o(s,{from:function(){var e=this,t=new e;return t.from.apply(t,arguments)},to:function(){var e=this,t=new e;return t.to.apply(t,arguments)},oneWay:function(e,t){var n=this,r=new n(null,e);return r.oneWay(t)}}),Ember.Binding=s,Ember.bind=function(e,t,n){return(new Ember.Binding(t,n)).connect(e)},Ember.oneWay=function(e,t,n){return(new Ember.Binding(t,n)).oneWay().connect(e)}}(),function(){function c(e){var t=Ember.meta(e,!0),n=t.mixins;return n?t.hasOwnProperty("mixins")||(n=t.mixins=a(n)):n=t.mixins={},n}function h(t,n){return n&&n.length>0&&(t.mixins=r.call(n,function(t){if(t instanceof e)return t;var n=new e;return n.properties=t,n})),t}function p(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function v(t,n){var r;return n instanceof e?(r=l(n),t[r]?d:(t[r]=n,n.properties)):n}function m(e,t,n){var r;return r=t.concatenatedProperties||n.concatenatedProperties,e.concatenatedProperties&&(r=r?r.concat(e.concatenatedProperties):e.concatenatedProperties),r}function g(e,t,n,r,i){var s;return r[t]===undefined&&(s=i[t]),s=s||e.descs[t],!!s&&s instanceof Ember.ComputedProperty?(n=a(n),n.func=Ember.wrap(n.func,s.func),n):n}function y(e,t,n,r,i){var s;return i[t]===undefined&&(s=r[t]),s=s||e[t],"function"!=typeof s?n:Ember.wrap(n,s)}function b(e,t,n,r){var i=r[t]||e[t];return i?"function"==typeof i.concat?i.concat(n):Ember.makeArray(i).concat(n):Ember.makeArray(n)}function w(e,n,r,s,o,u,a){if(r instanceof Ember.Descriptor){if(r===t&&o[n])return d;r.func&&(r=g(s,n,r,u,o)),o[n]=r,u[n]=undefined}else{if(p(r))r=y(e,n,r,u,o);else if(a&&i.call(a,n)>=0||n==="concatenatedProperties")r=b(e,n,r,u);o[n]=undefined,u[n]=r}}function E(e,t,n,r,i){function c(e){delete n[e],delete r[e]}var o,u,a,f,l;for(var h=0,p=e.length;h<p;h++){o=e[h],u=v(t,o);if(u===d)continue;if(u){l=Ember.meta(i),f=m(u,r,i);for(a in u){if(!u.hasOwnProperty(a))continue;w(i,a,u[a],l,n,r,f)}u.hasOwnProperty("toString")&&(i.toString=u.toString)}else o.mixins&&(E(o.mixins,t,n,r,i),o._without&&s.call(o._without,c))}}function S(e){var t=Ember.meta(e),n=t.required;if(!n||!t.hasOwnProperty("required"))n=t.required=n?a(n):{};return n}function T(e,t,n,r){if(x.test(t)){var i=r.bindings;i?r.hasOwnProperty("bindings")||(i=r.bindings=a(r.bindings)):i=r.bindings={},i[t]=n}}function N(e,t){var n=t.bindings,r,i,s;if(n){for(r in n)i=n[r],i&&(s=r.slice(0,-7),i instanceof Ember.Binding?(i=i.copy(),i.to(s)):i=new Ember.Binding(s,i),i.connect(e),e[r]=i);t.bindings={}}}function C(e,t){return N(e,t||Ember.meta(e)),e}function k(e,t,n,r,i){var s=t.methodName,o;return r[s]||i[s]?(o=i[s],t=r[s]):n.descs[s]?(t=n.descs[s],o=undefined):(t=undefined,o=e[s]),{desc:t,value:o}}function L(e,t,n,r,i){if("function"!=typeof n)return;var s=n[r];if(s)for(var o=0,u=s.length;o<u;o++)Ember[i](e,s[o],null,t)}function A(e,t,n){var r=e[t];L(e,t,r,"__ember_observesBefore__","removeBeforeObserver"),L(e,t,r,"__ember_observes__","removeObserver"),L(e,t,n,"__ember_observesBefore__","addBeforeObserver"),L(e,t,n,"__ember_observes__","addObserver")}function O(e,r,i){var s={},o={},u=Ember.meta(e),a,l,h;E(r,c(e),s,o,e);for(a in o){if(a==="contructor"||!o.hasOwnProperty(a))continue;h=s[a],l=o[a];if(h===t)continue;while(h&&h instanceof n){var p=k(e,h,u,s,o);h=p.desc,l=p.value}if(h===undefined&&l===undefined)continue;A(e,a,l),T(e,a,l,u),f(e,a,h,l,u)}return i||C(e,u),e}function _(e,t,n){var r=l(e);if(n[r])return!1;n[r]=!0;if(e===t)return!0;var i=e.mixins,s=i?i.length:0;while(--s>=0)if(_(i[s],t,n))return!0;return!1}function D(e,t,n){if(n[l(t)])return;n[l(t)]=!0;if(t.properties){var r=t.properties;for(var i in r)r.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&s.call(t.mixins,function(t){D(e,t,n)})}var e,t,n,r=Ember.ArrayPolyfills.map,i=Ember.ArrayPolyfills.indexOf,s=Ember.ArrayPolyfills.forEach,o=[].slice,u={},a=Ember.create,f=Ember.defineProperty,l=Ember.guidFor,d={},x=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=o.call(arguments,1);return O(e,t,!1),e},Ember.Mixin=function(){return h(this,arguments)},e=Ember.Mixin,e._apply=O,e.applyPartial=function(e){var t=o.call(arguments,1);return O(e,t,!0)},e.finishPartial=C,Ember.anyUnprocessedMixins=!1,e.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return h(new e,arguments)};var M=e.prototype;M.reopen=function(){var t,n;this.properties?(t=e.create(),t.properties=this.properties,delete this.properties,this.mixins=[t]):this.mixins||(this.mixins=[]);var r=arguments.length,i=this.mixins,s;for(s=0;s<r;s++)t=arguments[s],t instanceof e?i.push(t):(n=e.create(),n.properties=t,i.push(n));return this},M.apply=function(e){return O(e,[this],!1)},M.applyPartial=function(e){return O(e,[this],!0)},M.detect=function(t){if(!t)return!1;if(t instanceof e)return _(t,this,{});var n=Ember.meta(t,!1).mixins;return n?!!n[l(this)]:!1},M.without=function(){var t=new e(this);return t._without=o.call(arguments),t},M.keys=function(){var e={},t={},n=[];D(e,this,t);for(var r in e)e.hasOwnProperty(r)&&n.push(r);return n},e.mixins=function(e){var t=Ember.meta(e,!1).mixins,n=[];if(!t)return n;for(var r in t){var i=t[r];i.properties||n.push(i)}return n},t=new Ember.Descriptor,t.toString=function(){return"(Required Property)"},Ember.required=function(){return t},n=function(e){this.methodName=e},n.prototype=new Ember.Descriptor,Ember.alias=function(e){return new n(e)},Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.",Ember.alias),Ember.aliasMethod=function(e){return new n(e)},Ember.observer=function(e){var t=o.call(arguments,1);return e.__ember_observes__=t,e},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;e<t;e++)var n=arguments[e];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(e){var t=o.call(arguments,1);return e.__ember_observesBefore__=t,e}}(),function(){}(),function(){e("rsvp",[],function(){"use strict";function d(e,t){n.async(function(){e.trigger("promise:resolved",{detail:t}),e.isResolved=!0,e.resolvedValue=t})}function v(e,t){n.async(function(){e.trigger("promise:failed",{detail:t}),e.isRejected=!0,e.rejectedValue=t})}function m(e){var t,n=[],r=new c,i=e.length;i===0&&r.resolve([]);var s=function(e){return function(t){o(e,t)}},o=function(e,t){n[e]=t,--i===0&&r.resolve(n)},u=function(e){r.reject(e)};for(t=0;t<i;t++)e[t].then(s(t),u);return r}var e=typeof window!="undefined"?window:{},t=e.MutationObserver||e.WebKitMutationObserver,n,r;if(typeof process!="undefined"&&{}.toString.call(process)==="[object process]")r=function(e,t){process.nextTick(function(){e.call(t)})};else if(t){var i=[],s=new t(function(){var e=i.slice();i=[],e.forEach(function(e){var t=e[0],n=e[1];t.call(n)})}),o=document.createElement("div");s.observe(o,{attributes:!0}),window.addEventListener("unload",function(){s.disconnect(),s=null}),r=function(e,t){i.push([e,t]),o.setAttribute("drainQueue","drainQueue")}}else r=function(e,t){setTimeout(function(){e.call(t)},1)};var u=function(e,t){this.type=e;for(var n in t){if(!t.hasOwnProperty(n))continue;this[n]=t[n]}},a=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n][0]===t)return n;return-1},f=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t},l={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e},on:function(e,t,n){var r=f(this),i,s;e=e.split(/\s+/),n=n||this;while(s=e.shift())i=r[s],i||(i=r[s]=[]),a(i,t)===-1&&i.push([t,n])},off:function(e,t){var n=f(this),r,i,s;e=e.split(/\s+/);while(i=e.shift()){if(!t){n[i]=[];continue}r=n[i],s=a(r,t),s!==-1&&r.splice(s,1)}},trigger:function(e,t){var n=f(this),r,i,s,o,a;if(r=n[e])for(var l=0;l<r.length;l++)i=r[l],s=i[0],o=i[1],typeof t!="object"&&(t={detail:t}),a=new u(e,t),s.call(o,a)}},c=function(){this.on("promise:resolved",function(e){this.trigger("success",{detail:e.detail})},this),this.on("promise:failed",function(e){this.trigger("error",{detail:e.detail})},this)},h=function(){},p=function(e,t,n,r){var i=typeof n=="function",s,o,u,a;if(i)try{s=n(r.detail),u=!0}catch(f){a=!0,o=f}else s=r.detail,u=!0;s&&typeof s.then=="function"?s.then(function(e){t.resolve(e)},function(e){t.reject(e)}):i&&u?t.resolve(s):a?t.reject(o):t[e](s)};return c.prototype={then:function(e,t){var r=new c;return this.isResolved&&n.async(function(){p("resolve",r,e,{detail:this.resolvedValue})},this),this.isRejected&&n.async(function(){p("reject",r,t,{detail:this.rejectedValue})},this),this.on("promise:resolved",function(t){p("resolve",r,e,t)}),this.on("promise:failed",function(e){p("reject",r,t,e)}),r},resolve:function(e){d(this,e),this.resolve=h,this.reject=h},reject:function(e){v(this,e),this.resolve=h,this.reject=h}},l.mixin(c.prototype),n={async:r,Promise:c,Event:u,EventTarget:l,all:m,raiseOnUncaughtExceptions:!0},n})}(),function(){e("container",[],function(){function e(e){this.parent=e,this.dict={}}function t(t){this.parent=t,this.children=[],this.resolver=t&&t.resolver||function(){},this.registry=new e(t&&t.registry),this.cache=new e(t&&t.cache),this.typeInjections=new e(t&&t.typeInjections),this.injections={},this._options=new e(t&&t._options),this._typeOptions=new e(t&&t._typeOptions)}function n(e){throw new Error(e+" is not currently supported on child containers")}function r(e,t){var n=s(e,t,"singleton");return n!==!1}function i(e,t){var n={};if(!t)return n;var r,i;for(var s=0,o=t.length;s<o;s++)r=t[s],i=e.lookup(r.fullName),n[r.property]=i;return n}function s(e,t,n){var r=e._options.get(t);if(r&&r[n]!==undefined)return r[n];var i=t.split(":")[0];r=e._typeOptions.get(i);if(r)return r[n]}function o(e,t){var n=e.normalize(t);return e.resolve(n)}function u(e,t){var n=o(e,t),r=t.split(":"),u=r[0],a=r[1],f;if(s(e,t,"instantiate")===!1)return n;if(n){var l=[];l=l.concat(e.typeInjections.get(u)||[]),l=l.concat(e.injections[t]||[]);var c=i(e,l);return c.container=e,c._debugContainerKey=t,f=n.create(c),f}}function a(e,t){e.cache.eachLocal(function(n,r){if(s(e,n,"instantiate")===!1)return;t(r)})}function f(e){e.cache.eachLocal(function(t,n){if(s(e,t,"instantiate")===!1)return;n.destroy()}),e.cache.dict={}}return e.prototype={get:function(e){var t=this.dict;if(t.hasOwnProperty(e))return t[e];if(this.parent)return this.parent.get(e)},set:function(e,t){this.dict[e]=t},has:function(e){var t=this.dict;return t.hasOwnProperty(e)?!0:this.parent?this.parent.has(e):!1},eachLocal:function(e,t){var n=this.dict;for(var r in n)n.hasOwnProperty(r)&&e.call(t,r,n[r])}},t.prototype={child:function(){var e=new t(this);return this.children.push(e),e},set:function(e,t,n){e[t]=n},register:function(e,t,n,r){var i;e.indexOf(":")!==-1?(r=n,n=t,i=e):i=e+":"+t;var s=this.normalize(i);this.registry.set(s,n),this._options.set(s,r||{})},resolve:function(e){return this.resolver(e)||this.registry.get(e)},normalize:function(e){return e},lookup:function(e,t){e=this.normalize(e),t=t||{};if(this.cache.has(e)&&t.singleton!==!1)return this.cache.get(e);var n=u(this,e);if(!n)return;return r(this,e)&&t.singleton!==!1&&this.cache.set(e,n),n},has:function(e){return this.cache.has(e)?!0:!!o(this,e)},optionsForType:function(e,t){this.parent&&n("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){this.parent&&n("typeInjection");var i=this.typeInjections.get(e);i||(i=[],this.typeInjections.set(e,i)),i.push({property:t,fullName:r})},injection:function(e,t,r){this.parent&&n("injection");if(e.indexOf(":")===-1)return this.typeInjection(e,t,r);var i=this.injections[e]=this.injections[e]||[];i.push({property:t,fullName:r})},destroy:function(){this.isDestroyed=!0;for(var e=0,t=this.children.length;e<t;e++)this.children[e].destroy();this.children=[],a(this,function(e){e.isDestroying=!0}),a(this,function(e){e.destroy()}),delete this.parent,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;e<t;e++)f(this.children[e]);f(this)}},t})}(),function(){function i(t,n,r,s){var o,u,a;if("object"!=typeof t||t===null)return t;if(n&&(u=e(r,t))>=0)return s[u];if(Ember.typeOf(t)==="array"){o=t.slice();if(n){u=o.length;while(--u>=0)o[u]=i(o[u],n,r,s)}}else if(Ember.Copyable&&Ember.Copyable.detect(t))o=t.copy(n,r,s);else{o={};for(a in t){if(!t.hasOwnProperty(a))continue;if(a.substring(0,2)==="__")continue;o[a]=n?i(t[a],n,r,s):t[a]}}return n&&(r.push(t),s.push(o)),o}var e=Ember.EnumerableUtils.indexOf,t={},n="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(n,function(e){t["[object "+e+"]"]=e.toLowerCase()});var r=Object.prototype.toString;Ember.typeOf=function(e){var n;return n=e===null||e===undefined?String(e):t[r.call(e)]||"object",n==="function"?Ember.Object&&Ember.Object.detect(e)&&(n="class"):n==="object"&&(e instanceof Error?n="error":Ember.Object&&e instanceof Ember.Object?n="instance":n="object"),n},Ember.isNone=function(e){return e===null||e===undefined},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return e===null||e===undefined||e.length===0&&typeof e!="function"||typeof e=="object"&&Ember.get(e,"length")===0},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty),Ember.compare=function o(e,t){if(e===t)return 0;var n=Ember.typeOf(e),r=Ember.typeOf(t),i=Ember.Comparable;if(i){if(n==="instance"&&i.detect(e.constructor))return e.constructor.compare(e,t);if(r==="instance"&&i.detect(t.constructor))return 1-t.constructor.compare(t,e)}var s=Ember.ORDER_DEFINITION_MAPPING;if(!s){var u=Ember.ORDER_DEFINITION;s=Ember.ORDER_DEFINITION_MAPPING={};var a,f;for(a=0,f=u.length;a<f;++a)s[u[a]]=a;delete Ember.ORDER_DEFINITION}var l=s[n],c=s[r];if(l<c)return-1;if(l>c)return 1;switch(n){case"boolean":case"number":if(e<t)return-1;if(e>t)return 1;return 0;case"string":var h=e.localeCompare(t);if(h<0)return-1;if(h>0)return 1;return 0;case"array":var p=e.length,d=t.length,v=Math.min(p,d),m=0,g=0;while(m===0&&g<v)m=o(e[g],t[g]),g++;if(m!==0)return m;if(p<d)return-1;if(p>d)return 1;return 0;case"instance":if(Ember.Comparable&&Ember.Comparable.detect(e))return e.compare(e,t);return 0;case"date":var y=e.getTime(),b=t.getTime();if(y<b)return-1;if(y>b)return 1;return 0;default:return 0}},Ember.copy=function(e,t){return"object"!=typeof e||e===null?e:Ember.Copyable&&Ember.Copyable.detect(e)?e.copy(t):i(e,t,t?[]:null,t?[]:null)},Ember.inspect=function(e){if(typeof e!="object"||e===null)return e+"";var t,n=[];for(var r in e)if(e.hasOwnProperty(r)){t=e[r];if(t==="toString")continue;Ember.typeOf(t)==="function"&&(t="function() { ... }"),n.push(r+": "+t)}return"{"+n.join(", ")+"}"},Ember.isEqual=function(e,t){return e&&"function"==typeof e.isEqual?e.isEqual(t):e===t},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,Ember.keys||(Ember.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t});var s=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var e=Error.prototype.constructor.apply(this,arguments);for(var t=0;t<s.length;t++)this[s[t]]=e[s[t]]},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){Ember.RSVP=t("rsvp")}(),function(){var e=/[ _]/g,t={},n=/([a-z])([A-Z])/g,r=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,s=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var n=0;return e.replace(/%@([0-9]+)?/g,function(e,r){return r=r?parseInt(r,0)-1:n++,e=t[r],(e===null?"(null)":e===undefined?"":e).toString()})},loc:function(e,t){return e=Ember.STRINGS[e]||e,Ember.String.fmt(e,t)},w:function(e){return e.split(/\s+/)},decamelize:function(e){return e.replace(n,"$1_$2").toLowerCase()},dasherize:function(n){var r=t,i=r[n];return i?i:(i=Ember.String.decamelize(n).replace(e,"-"),r[n]=i,i)},camelize:function(e){return e.replace(r,function(e,t,n){return n?n.toUpperCase():""}).replace(/^([A-Z])/,function(e,t,n){return e.toLowerCase()})},classify:function(e){var t=e.split("."),n=[];for(var r=0,i=t.length;r<i;r++){var s=Ember.String.camelize(t[r]);n.push(s.charAt(0).toUpperCase()+s.substr(1))}return n.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(s,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,n=Ember.String.loc,r=Ember.String.camelize,i=Ember.String.decamelize,s=Ember.String.dasherize,o=Ember.String.underscore,u=Ember.String.capitalize,a=Ember.String.classify;if(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)String.prototype.fmt=function(){return e(this,arguments)},String.prototype.w=function(){return t(this)},String.prototype.loc=function(){return n(this,arguments)},String.prototype.camelize=function(){return r(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return s(this)},String.prototype.underscore=function(){return o(this)},String.prototype.classify=function(){return a(this)},String.prototype.capitalize=function(){return u(this)}}(),function(){var e=Array.prototype.slice;if(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)Function.prototype.property=function(){var e=Ember.computed(this);return e.property.apply(e,arguments)},Function.prototype.observes=function(){return this.__ember_observes__=e.call(arguments),this},Function.prototype.observesBefore=function(){return this.__ember_observesBefore__=e.call(arguments),this}}(),function(){}(),function(){function s(){return i.length===0?{}:i.pop()}function o(e){return i.push(e),null}function u(t,n){function i(i){var s=e(i,t);return r?n===s:!!s}var r=arguments.length===2;return i}var e=Ember.get,t=Ember.set,n=Array.prototype.slice,r=Ember.EnumerableUtils.indexOf,i=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(e(this,"length")===0)return undefined;var t=s(),n;return n=this.nextObject(0,null,t),o(t),n}).property("[]"),lastObject:Ember.computed(function(){var t=e(this,"length");if(t===0)return undefined;var n=s(),r=0,i,u=null;do u=i,i=this.nextObject(r++,u,n);while(i!==undefined);return o(n),u}).property("[]"),contains:function(e){return this.find(function(t){return t===e})!==undefined},forEach:function(t,n){if(typeof t!="function")throw new TypeError;var r=e(this,"length"),i=null,u=s();n===undefined&&(n=null);for(var a=0;a<r;a++){var f=this.nextObject(a,i,u);t.call(n,f,a,this),i=f}return i=null,u=o(u),this},getEach:function(e){return this.mapProperty(e)},setEach:function(e,n){return this.forEach(function(r){t(r,e,n)})},map:function(e,t){var n=[];return this.forEach(function(r,i,s){n[i]=e.call(t,r,i,s)}),n},mapProperty:function(t){return this.map(function(n){return e(n,t)})},filter:function(e,t){var n=[];return this.forEach(function(r,i,s){e.call(t,r,i,s)&&n.push(r)}),n},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterProperty:function(e,t){return this.filter(u.apply(this,arguments))},rejectProperty:function(t,n){var r=function(r){return e(r,t)===n},i=function(n){return!!e(n,t)},s=arguments.length===2?r:i;return this.reject(s)},find:function(t,n){var r=e(this,"length");n===undefined&&(n=null);var i=null,u,a=!1,f,l=s();for(var c=0;c<r&&!a;c++){u=this.nextObject(c,i,l);if(a=t.call(n,u,c,this))f=u;i=u}return u=i=null,l=o(l),f},findProperty:function(e,t){return this.find(u.apply(this,arguments))},every:function(e,t){return!this.find(function(n,r,i){return!e.call(t,n,r,i)})},everyProperty:function(e,t){return this.every(u.apply(this,arguments))},some:function(e,t){return!!this.find(function(n,r,i){return!!e.call(t,n,r,i)})},someProperty:function(e,t){return this.some(u.apply(this,arguments))},reduce:function(e,t,n){if(typeof e!="function")throw new TypeError;var r=t;return this.forEach(function(t,i){r=e.call(null,r,t,i,this,n)},this),r},invoke:function(e){var t,r=[];return arguments.length>1&&(t=n.call(arguments,1)),this.forEach(function(n,i){var s=n&&n[e];"function"==typeof s&&(r[i]=t?s.apply(n,t):s.call(n))},this),r},toArray:function(){var e=[];return this.forEach(function(t,n){e[n]=t}),e},compact:function(){return this.without(null)},without:function(e){if(!this.contains(e))return this;var t=[];return this.forEach(function(n){n!==e&&(t[t.length]=n)}),t},uniq:function(){var e=[];return this.forEach(function(t){r(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(e,t){return this}),addEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",t,r),Ember.addListener(this,"@enumerable:change",t,i),s||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",t,r),Ember.removeListener(this,"@enumerable:change",t,i),s&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(t,n){var r,i,s;return"number"==typeof t?r=t:t?r=e(t,"length"):r=t=-1,"number"==typeof n?i=n:n?i=e(n,"length"):i=n=-1,s=i<0||r<0||i-r!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.propertyWillChange(this,"[]"),s&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,t,n]),this},enumerableContentDidChange:function(t,n){var r=this.propertyDidChange,i,s,o;return"number"==typeof t?i=t:t?i=e(t,"length"):i=t=-1,"number"==typeof n?s=n:n?s=e(n,"length"):s=n=-1,o=s<0||i<0||s-i!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.sendEvent(this,"@enumerable:change",[this,t,n]),o&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function s(e){return e===null||e===undefined}var e=Ember.get,t=Ember.set,n=Ember.meta,r=Ember.EnumerableUtils.map,i=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(t){return t<0||t>=e(this,"length")?undefined:e(this,t)},objectsAt:function(e){var t=this;return r(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(t,n){return n!==undefined&&this.replace(0,e(this,"length"),n),this}),firstObject:Ember.computed(function(){return this.objectAt(0)}),lastObject:Ember.computed(function(){return this.objectAt(e(this,"length")-1)}),contains:function(e){return this.indexOf(e)>=0},slice:function(t,n){var r=[],i=e(this,"length");s(t)&&(t=0);if(s(n)||n>i)n=i;while(t<n)r[r.length]=this.objectAt(t++);return r},indexOf:function(t,n){var r,i=e(this,"length");n===undefined&&(n=0),n<0&&(n+=i);for(r=n;r<i;r++)if(this.objectAt(r,!0)===t)return r;return-1},lastIndexOf:function(t,n){var r,i=e(this,"length");if(n===undefined||n>=i)n=i-1;n<0&&(n+=i);for(r=n;r>=0;r--)if(this.objectAt(r)===t)return r;return-1},addArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,r),Ember.addListener(this,"@array:change",t,i),s||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,r),Ember.removeListener(this,"@array:change",t,i),s&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(t,n,r){t===undefined?(t=0,n=r=-1):(n===undefined&&(n=-1),r===undefined&&(r=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,n,r]);var i,s;if(t>=0&&n>=0&&e(this,"hasEnumerableObservers")){i=[],s=t+n;for(var o=t;o<s;o++)i.push(this.objectAt(o))}else i=n;return this.enumerableContentWillChange(i,r),this},arrayContentDidChange:function(t,n,r){t===undefined?(t=0,n=r=-1):(n===undefined&&(n=-1),r===undefined&&(r=-1));var s,o;if(t>=0&&r>=0&&e(this,"hasEnumerableObservers")){s=[],o=t+r;for(var u=t;u<o;u++)s.push(this.objectAt(u))}else s=r;this.enumerableContentDidChange(n,s),Ember.sendEvent(this,"@array:change",[this,t,n,r]);var a=e(this,"length"),f=i(this,"firstObject"),l=i(this,"lastObject");return this.objectAt(0)!==f&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(a-1)!==l&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each})})}(),function(){Ember.Comparable=Ember.Mixin.create({isComparable:!0,compare:Ember.required(Function)})}(),function(){var e=Ember.get,t=Ember.set;Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return e(this,"isFrozen")?this:this.copy().freeze();throw new Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return e(this,"isFrozen")?this:(t(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var e=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.addObject(e)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.removeObject(e)},this),Ember.endPropertyChanges(this),this}})}(),function(){var e="Index out of range",t=[],n=Ember.get,r=Ember.set,i=Ember.EnumerableUtils.forEach;Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=n(this,"length");return e===0?this:(this.replace(0,e,t),this)},insertAt:function(t,r){if(t>n(this,"length"))throw new Error(e);return this.replace(t,0,[r]),this},removeAt:function(r,i){if("number"==typeof r){if(r<0||r>=n(this,"length"))throw new Error(e);i===undefined&&(i=1),this.replace(r,i,t)}return this},pushObject:function(e){return this.insertAt(n(this,"length"),e),e},pushObjects:function(e){return this.replace(n(this,"length"),0,e),this},popObject:function(){var e=n(this,"length");if(e===0)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(n(this,"length")===0)return null;var e=this.objectAt(0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=n(this,"length");if(e===0)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(e.length===0)return this.clear();var t=n(this,"length");return this.replace(0,t,e),this},removeObject:function(e){var t=n(this,"length")||0;while(--t>=0){var r=this.objectAt(t);r===e&&this.removeAt(t)}return this},addObject:function(e){return this.contains(e)||this.pushObject(e),this}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.defineProperty;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){var t={},n=arguments;arguments.length===1&&Ember.typeOf(arguments[0])==="array"&&(n=arguments[0]);for(var r=0;r<n.length;r++)t[n[r]]=e(this,n[r]);return t},set:function(e,n){return t(this,e,n),this},setProperties:function(e){return Ember.setProperties(this,e)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(e){return Ember.propertyWillChange(this,e),this},propertyDidChange:function(e){return Ember.propertyDidChange(this,e),this},notifyPropertyChange:function(e){return this.propertyWillChange(e),this.propertyDidChange(e),this},addBeforeObserver:function(e,t,n){Ember.addBeforeObserver(this,e,t,n)},addObserver:function(e,t,n){Ember.addObserver(this,e,t,n)},removeObserver:function(e,t,n){Ember.removeObserver(this,e,t,n)},hasObserverFor:function(e){return Ember.hasListeners(this,e+":change")},getPath:function(e){return this.get(e)},setPath:function(e,t){return this.set(e,t)},getWithDefault:function(e,t){return Ember.getWithDefault(this,e,t)},incrementProperty:function(n,r){return r||(r=1),t(this,n,(e(this,n)||0)+r),e(this,n)},decrementProperty:function(n,r){return r||(r=1),t(this,n,(e(this,n)||0)-r),e(this,n)},toggleProperty:function(n){return t(this,n,!e(this,n)),e(this,n)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){var e=Ember.get,t=Ember.set;Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,targetObject:Ember.computed(function(){var t=e(this,"target");if(Ember.typeOf(t)==="string"){var n=e(this,t);return n===undefined&&(n=e(Ember.lookup,t)),n}return t}).property("target"),triggerAction:function(){var t=e(this,"action"),n=e(this,"targetObject");if(n&&t){var r;return typeof n.send=="function"?r=n.send(t,this):(typeof t=="string"&&(t=n[t]),r=t.call(n,this)),r!==!1&&(r=!0),r}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,n){Ember.addListener(this,e,t,n)},one:function(e,t,n){n||(n=t,t=null),Ember.addListener(this,e,t,n,!0)},trigger:function(e){var t=[],n,r;for(n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);Ember.sendEvent(this,e,t)},fire:function(e){this.trigger.apply(this,arguments)},off:function(e,t,n){Ember.removeListener(this,e,t,n)},has:function(e){return Ember.hasListeners(this,e)}})}(),function(){var e=t("rsvp");e.async=function(e,t){Ember.run.schedule("actions",t,e)};var n=Ember.get,r=Array.prototype.slice;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t){var r=n(this,"promise");return r.then.apply(r,arguments)},resolve:function(e){n(this,"promise").resolve(e)},reject:function(e){n(this,"promise").reject(e)},promise:Ember.computed(function(){return new e.Promise})})}(),function(){}(),function(){Ember.Container=t("container"),Ember.Container.set=Ember.set}(),function(){function w(){var e=!1,t,i,o=function(){e||o.proto(),r(this,s,b),r(this,"_super",b);var u=a(this);u.proto=this;if(t){var f=t;t=null,this.reopen.apply(this,f)}if(i){var c=i;i=null;var h=
|
17
|
-
this.concatenatedProperties;for(var p=0,d=c.length;p<d;p++){var m=c[p];for(var w in m){if(!m.hasOwnProperty(w))continue;var E=m[w],S=Ember.IS_BINDING;if(S.test(w)){var x=u.bindings;x?u.hasOwnProperty("bindings")||(x=u.bindings=n(u.bindings)):x=u.bindings={},x[w]=E}var T=u.descs[w];if(h&&y(h,w)>=0){var N=this[w];N?"function"==typeof N.concat?E=N.concat(E):E=Ember.makeArray(N).concat(E):E=Ember.makeArray(E)}T?T.set(this,w,E):typeof this.setUnknownProperty!="function"||w in this?g?Ember.defineProperty(this,w,null,E):this[w]=E:this.setUnknownProperty(w,E)}}}v(this,u),delete u.proto,l(this),this.init.apply(this,arguments)};return o.toString=p.prototype.toString,o.willReopen=function(){e&&(o.PrototypeMixin=p.create(o.PrototypeMixin)),e=!1},o._initMixins=function(e){t=e},o._initProperties=function(e){i=e},o.proto=function(){var t=o.superclass;return t&&t.proto(),e||(e=!0,o.PrototypeMixin.applyPartial(o.prototype),f(o.prototype)),this.prototype},o}function S(e){return function(){return e}}var e=Ember.set,t=Ember.get,n=Ember.create,r=Ember.platform.defineProperty,i=Array.prototype.slice,s=Ember.GUID_KEY,o=Ember.guidFor,u=Ember.generateGuid,a=Ember.meta,f=Ember.rewatch,l=Ember.finishChains,c=Ember.destroy,h=Ember.run.schedule,p=Ember.Mixin,d=p._apply,v=p.finishPartial,m=p.prototype.reopen,g=Ember.ENV.MANDATORY_SETTER,y=Ember.EnumerableUtils.indexOf,b={configurable:!0,writable:!0,enumerable:!1,value:undefined},E=w();E.toString=function(){return"Ember.CoreObject"},E.PrototypeMixin=p.create({reopen:function(){return d(this,arguments,!0),this},isInstance:!0,init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){if(this._didCallDestroy)return;return this.isDestroying=!0,this._didCallDestroy=!0,this.willDestroy&&this.willDestroy(),h("destroy",this,this._scheduledDestroy),this},_scheduledDestroy:function(){c(this),e(this,"isDestroyed",!0),this.didDestroy&&this.didDestroy()},bind:function(e,t){return t instanceof Ember.Binding||(t=Ember.Binding.from(t)),t.to(e).connect(this),t},toString:function T(){var e=typeof this.toStringExtension=="function",t=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+o(this)+t+">";return this.toString=S(n),n}}),E.PrototypeMixin.ownerConstructor=E,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(E.PrototypeMixin),E.__super__=null;var x=p.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var e=w(),t;return e.ClassMixin=p.create(this.ClassMixin),e.PrototypeMixin=p.create(this.PrototypeMixin),e.ClassMixin.ownerConstructor=e,e.PrototypeMixin.ownerConstructor=e,m.apply(e.PrototypeMixin,arguments),e.superclass=this,e.__super__=this.prototype,t=e.prototype=n(this.prototype),t.constructor=e,u(t,"ember"),a(t).proto=t,e.ClassMixin.apply(e),e},createWithMixins:function(){var e=this;return arguments.length>0&&this._initMixins(arguments),new e},create:function(){var e=this;return arguments.length>0&&this._initProperties(arguments),new e},reopen:function(){return this.willReopen(),m.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return m.apply(this.ClassMixin,arguments),d(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;while(e){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=a(this.proto(),!1).descs[e];return t._meta||{}},eachComputedProperty:function(e,t){var n=this.proto(),r=a(n).descs,i={},s;for(var o in r)s=r[o],s instanceof Ember.ComputedProperty&&e.call(t||this,o,s._meta||i)}});x.ownerConstructor=E,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(x),E.ClassMixin=x,x.apply(E),Ember.CoreObject=E}(),function(){var e=Ember.get,t=Ember.set,n=Ember.guidFor,r=Ember.isNone;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Error(Ember.FROZEN_ERROR);var r=e(this,"length");if(r===0)return this;var i;this.enumerableContentWillChange(r,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var s=0;s<r;s++)i=n(this[s]),delete this[i],delete this[s];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(r,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var n=e(this,"length");if(e(t,"length")!==n)return!1;while(--n>=0)if(!t.contains(this[n]))return!1;return!0},add:Ember.aliasMethod("addObject"),remove:Ember.aliasMethod("removeObject"),pop:function(){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);var t=this.length>0?this[this.length-1]:null;return this.remove(t),t},push:Ember.aliasMethod("addObject"),shift:Ember.aliasMethod("pop"),unshift:Ember.aliasMethod("push"),addEach:Ember.aliasMethod("addObjects"),removeEach:Ember.aliasMethod("removeObjects"),init:function(e){this._super(),e&&this.addObjects(e)},nextObject:function(e){return this[e]},firstObject:Ember.computed(function(){return this.length>0?this[0]:undefined}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:undefined}),addObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a;return o>=0&&o<u&&this[o]===i?this:(a=[i],this.enumerableContentWillChange(null,a),Ember.propertyWillChange(this,"lastObject"),u=e(this,"length"),this[s]=u,this[u]=i,t(this,"length",u+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,a),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a=o===0,f=o===u-1,l,c;return o>=0&&o<u&&this[o]===i&&(c=[i],this.enumerableContentWillChange(c,null),a&&Ember.propertyWillChange(this,"firstObject"),f&&Ember.propertyWillChange(this,"lastObject"),o<u-1&&(l=this[u-1],this[o]=l,this[n(l)]=o),delete this[s],delete this[u-1],t(this,"length",u-1),a&&Ember.propertyDidChange(this,"firstObject"),f&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(c,null)),this},contains:function(e){return this[n(e)]>=0},copy:function(){var r=this.constructor,i=new r,s=e(this,"length");t(i,"length",s);while(--s>=0)i[s]=this[s],i[n(this[s])]=s;return i},toString:function(){var e=this.length,t,n=[];for(t=0;t<e;t++)n[t]=this[t];return"Ember.Set<%@>".fmt(n.join(","))}})}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function o(e,t,n){var u=e.length;r[e.join(".")]=t;for(var f in t){if(!i.call(t,f))continue;var c=t[f];e[u]=f;if(c&&c.toString===l)c.toString=h(e.join(".")),c[a]=e.join(".");else if(c&&c.isNamespace){if(n[s(c)])continue;n[s(c)]=!0,o(e,c,n)}}e.length=u}function u(){var e=Ember.Namespace,t=Ember.lookup,n,r;if(e.PROCESSED)return;for(var i in t){if(i==="parent"||i==="top"||i==="frameElement")continue;if(i==="globalStorage"&&t.StorageList&&t.globalStorage instanceof t.StorageList)continue;if(t.hasOwnProperty&&!t.hasOwnProperty(i))continue;try{n=Ember.lookup[i],r=n&&n.isNamespace}catch(s){continue}r&&(n[a]=i)}}function f(e){var t=e.superclass;if(t)return t[a]?t[a]:f(t);return}function l(){!Ember.BOOTED&&!this[a]&&c();var e;if(this[a])e=this[a];else{var t=f(this);t?e="(subclass of "+t+")":e="(unknown mixin)",this.toString=h(e)}return e}function c(){var e=!n.PROCESSED,t=Ember.anyUnprocessedMixins;e&&(u(),n.PROCESSED=!0);if(e||t){var r=n.NAMESPACES,i;for(var s=0,a=r.length;s<a;s++)i=r[s],o([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function h(e){return function(){return e}}var e=Ember.get,t=Ember.ArrayPolyfills.indexOf,n=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var t=e(this,"name");return t?t:(u(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){o([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=undefined,e.splice(t.call(e,this),1),this._super()}});n.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:c,byName:function(e){return Ember.BOOTED||c(),r[e]}});var r=n.NAMESPACES_BY_ID,i={}.hasOwnProperty,s=Ember.guidFor,a=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=l}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var e=Ember.get,t=Ember.set;Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(t){return e(this,"arrangedContent").objectAt(t)},replaceContent:function(t,n,r){e(this,"content").replace(t,n,r)},_contentWillChange:Ember.beforeObserver(function(){this._teardownContent()},"content"),_teardownContent:function(){var t=e(this,"content");t&&t.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){var t=e(this,"content");this._setupContent()},"content"),_setupContent:function(){var t=e(this,"content");t&&t.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver(function(){var t=e(this,"arrangedContent"),n=t?e(t,"length"):0;this.arrangedContentArrayWillChange(this,0,n,undefined),this.arrangedContentWillChange(this),this._teardownArrangedContent(t)},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var t=e(this,"arrangedContent"),n=t?e(t,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,undefined,n)},"arrangedContent"),_setupArrangedContent:function(){var t=e(this,"arrangedContent");t&&t.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var t=e(this,"arrangedContent");t&&t.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(t){return e(this,"content")&&this.objectAtContent(t)},length:Ember.computed(function(){var t=e(this,"arrangedContent");return t?e(t,"length"):0}),replace:function(t,n,r){return e(this,"content")&&this.replaceContent(t,n,r),this},arrangedContentArrayWillChange:function(e,t,n,r){this.arrayContentWillChange(t,n,r)},arrangedContentArrayDidChange:function(e,t,n,r){this.arrayContentDidChange(t,n,r)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function f(e,t){var n=t.slice(8);if(n in this)return;u(this,n)}function l(e,t){var n=t.slice(8);if(n in this)return;a(this,n)}var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=Ember.addBeforeObserver,i=Ember.addObserver,s=Ember.removeBeforeObserver,o=Ember.removeObserver,u=Ember.propertyWillChange,a=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(e){var t="content."+e;r(this,t,null,f),i(this,t,null,l)},didUnwatchProperty:function(e){var t="content."+e;s(this,t,null,f),o(this,t,null,l)},unknownProperty:function(t){var n=e(this,"content");if(n)return e(n,t)},setUnknownProperty:function(n,r){var i=e(this,"content");return t(i,n,r)}}),Ember.ObjectProxy.reopenClass({create:function(){var e,t,n,r,i,s;if(arguments.length){t=this.proto();for(n=0,r=arguments.length;n<r;n++){i=arguments[n];for(s in i){if(!i.hasOwnProperty(s)||s in t)continue;e||(e={}),e[s]=null}}e&&this._initMixins([e])}return this._super.apply(this,arguments)}})}(),function(){function o(e,t,r,i,s){var o=r._objects,u;o||(o=r._objects={});while(--s>=i){var a=e.objectAt(s);a&&(Ember.addBeforeObserver(a,t,r,"contentKeyWillChange"),Ember.addObserver(a,t,r,"contentKeyDidChange"),u=n(a),o[u]||(o[u]=[]),o[u].push(s))}}function u(e,t,r,i,s){var o=r._objects;o||(o=r._objects={});var u,a;while(--s>=i){var f=e.objectAt(s);f&&(Ember.removeBeforeObserver(f,t,r,"contentKeyWillChange"),Ember.removeObserver(f,t,r,"contentKeyDidChange"),a=n(f),u=o[a],u[u.indexOf(s)]=null)}}var e=Ember.set,t=Ember.get,n=Ember.guidFor,r=Ember.EnumerableUtils.forEach,i=Ember.Object.extend(Ember.Array,{init:function(e,t,n){this._super(),this._keyName=t,this._owner=n,this._content=e},objectAt:function(e){var n=this._content.objectAt(e);return n&&t(n,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?t(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),r(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e,t){var n;return n=new i(this._content,e,this),Ember.defineProperty(this,e,null,n),this.beginObservingContentKey(e),n},arrayWillChange:function(e,t,n,r){var i=this._keys,s,o,a;a=n>0?t+n:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;a>0&&u(e,s,this,t,a),Ember.propertyWillChange(this,s)}Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(e,t,n,r){var i=this._keys,s,u,a;a=r>0?t+r:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;a>0&&o(e,s,this,t,a),Ember.propertyDidChange(this,s)}Ember.propertyDidChange(this._content,"@each"),Ember.endPropertyChanges(this)},didAddListener:function(e){s.test(e)&&this.beginObservingContentKey(e.slice(0,-7))},didRemoveListener:function(e){s.test(e)&&this.stopObservingContentKey(e.slice(0,-7))},beginObservingContentKey:function(e){var n=this._keys;n||(n=this._keys={});if(!n[e]){n[e]=1;var r=this._content,i=t(r,"length");o(r,e,this,0,i)}else n[e]++},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var r=this._content,i=t(r,"length");u(r,e,this,0,i)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return e==="length"?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(t,n,r){if(this.isFrozen)throw Ember.FROZEN_ERROR;var i=r?e(r,"length"):0;this.arrayContentWillChange(t,n,i);if(!r||r.length===0)this.splice(t,n);else{var s=[t,n].concat(r);this.splice.apply(this,s)}return this.arrayContentDidChange(t,n,i),this},unknownProperty:function(e,t){var n;return t!==undefined&&n===undefined&&(n=this[e]=t),n},indexOf:function(e,t){var n,r=this.length;t===undefined?t=0:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n<r;n++)if(this[n]===e)return n;return-1},lastIndexOf:function(e,t){var n,r=this.length;t===undefined?t=r-1:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n>=0;n--)if(this[n]===e)return n;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),r=["length"];Ember.EnumerableUtils.forEach(n.keys(),function(e){Array.prototype[e]&&r.push(e)}),r.length>0&&(n=n.without.apply(n,r)),Ember.NativeArray=n,Ember.A=function(e){return e===undefined&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){n.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.DeferredMixin,t=Ember.Object,n=Ember.get,r=Ember.Object.extend(e);r.reopenClass({promise:function(e,t){var i=r.create();return e.call(t,i),n(i,"promise")}}),Ember.Deferred=r}(),function(){var e=Ember.ENV.EMBER_LOAD_HOOKS||{},t={};Ember.onLoad=function(n,r){var i;e[n]=e[n]||Ember.A(),e[n].pushObject(r),(i=t[n])&&r(i)},Ember.runLoadHooks=function(n,r){var i;t[n]=r,(i=e[n])&&e[n].forEach(function(e){e(r)})}}(),function(){}(),function(){var e=Ember.get;Ember.ControllerMixin=Ember.Mixin.create({isController:!0,target:null,container:null,store:null,model:Ember.computed.alias("content"),send:function(t){var n=[].slice.call(arguments,1),r;this[t]?this[t].apply(this,n):(r=e(this,"target"))&&r.send.apply(r,arguments)}}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=Ember.set,n=Ember.EnumerableUtils.forEach;Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,orderBy:function(t,r){var i=0,s=e(this,"sortProperties"),o=e(this,"sortAscending");return n(s,function(n){i===0&&(i=Ember.compare(e(t,n),e(r,n)),i!==0&&!o&&(i=-1*i))}),i},destroy:function(){var t=e(this,"content"),r=e(this,"sortProperties");return t&&r&&n(t,function(e){n(r,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(t,r){var i=e(this,"content"),s=e(this,"isSorted"),o=e(this,"sortProperties"),u=this;return i&&s?(i=i.slice(),i.sort(function(e,t){return u.orderBy(e,t)}),n(i,function(e){n(o,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(i)):i}),_contentWillChange:Ember.beforeObserver(function(){var t=e(this,"content"),r=e(this,"sortProperties");t&&r&&n(t,function(e){n(r,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},"content"),sortAscendingWillChange:Ember.beforeObserver(function(){this._lastSortAscending=e(this,"sortAscending")},"sortAscending"),sortAscendingDidChange:Ember.observer(function(){if(e(this,"sortAscending")!==this._lastSortAscending){var t=e(this,"arrangedContent");t.reverseObjects()}},"sortAscending"),contentArrayWillChange:function(t,r,i,s){var o=e(this,"isSorted");if(o){var u=e(this,"arrangedContent"),a=t.slice(r,r+i),f=e(this,"sortProperties");n(a,function(e){u.removeObject(e),n(f,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},contentArrayDidChange:function(t,r,i,s){var o=e(this,"isSorted"),u=e(this,"sortProperties");if(o){var a=t.slice(r,r+s),f=e(this,"arrangedContent");n(a,function(e){this.insertItemSorted(e),n(u,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},insertItemSorted:function(t){var n=e(this,"arrangedContent"),r=e(n,"length"),i=this._binarySearch(t,0,r);n.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var n=e(this,"arrangedContent"),r=n.indexOf(t),i=n.objectAt(r-1),s=n.objectAt(r+1),o=i&&this.orderBy(t,i),u=s&&this.orderBy(t,s);if(o<0||u>0)n.removeObject(t),this.insertItemSorted(t)},_binarySearch:function(t,n,r){var i,s,o,u;return n===r?n:(u=e(this,"arrangedContent"),i=n+Math.floor((r-n)/2),s=u.objectAt(i),o=this.orderBy(s,t),o<0?this._binarySearch(t,i+1,r):o>0?this._binarySearch(t,n,i):i)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.isGlobalPath,r=Ember.EnumerableUtils.forEach,i=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(t){return e(this,"itemController")},objectAtContent:function(t){var n=e(this,"length"),r=e(this,"arrangedContent"),i=r&&r.objectAt(t);if(t>=0&&t<n){var s=this.lookupItemController(i);if(s)return this.controllerAt(t,i,s)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(t,n,s){var o=e(this,"_subControllers"),u=o.slice(t,t+n);r(u,function(e){e&&e.destroy()}),i(o,t,n,new Array(s)),this._super(t,n,s)},init:function(){this._super(),this.get("content")||Ember.defineProperty(this,"content",undefined,Ember.A()),this.set("_subControllers",Ember.A())},controllerAt:function(t,n,r){var i=e(this,"container"),s=e(this,"_subControllers"),o=s[t];o||(o=i.lookup("controller:"+r,{singleton:!1}),s[t]=o);if(!o)throw new Error('Could not resolve itemController: "'+r+'"');return o.set("target",this),o.set("content",n),o},_subControllers:null,_resetSubControllers:function(){var t=e(this,"_subControllers");r(t,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){}(),function(){}(),function(){var e=Ember.get,t=Ember.set;Ember.State=Ember.Object.extend(Ember.Evented,{isState:!0,parentState:null,start:null,name:null,path:Ember.computed(function(){var t=e(this,"parentState.path"),n=e(this,"name");return t&&(n=t+"."+n),n}),trigger:function(e){this[e]&&this[e].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var n=e(this,"states"),r;t(this,"childStates",Ember.A()),t(this,"eventTransitions",e(this,"eventTransitions")||{});var i,s,o;if(!n){n={};for(i in this){if(i==="constructor")continue;if(s=this[i]){if(o=s.transitionTarget)this.eventTransitions[i]=o;this.setupChild(n,i,s)}}t(this,"states",n)}else for(i in n)this.setupChild(n,i,n[i]);t(this,"pathsCache",{}),t(this,"pathsCacheNoContext",{})},setupChild:function(n,r,i){if(!i)return!1;i.isState?t(i,"name",r):Ember.State.detect(i)&&(i=i.create({name:r}));if(i.isState)return t(i,"parentState",this),e(this,"childStates").pushObject(i),n[r]=i,i},lookupEventTransition:function(e){var t,n=this;while(n&&!t)t=n.eventTransitions[e],n=n.get("parentState");return t},isLeaf:Ember.computed(function(){return!e(this,"childStates").length}),hasContext:!0,setup:Ember.K,enter:Ember.K,exit:Ember.K}),Ember.State.reopenClass({transitionTo:function(e){var t=function(t,n){var r=[],i,s=Ember.$&&Ember.$.Event;n&&s&&n instanceof s?n.hasOwnProperty("contexts")&&(r=n.contexts.slice()):r=[].slice.call(arguments,1),r.unshift(e),t.transitionTo.apply(t,r)};return t.transitionTarget=e,t}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=Ember.ArrayPolyfills.forEach,i=function(e){this.enterStates=e.enterStates.slice(),this.exitStates=e.exitStates.slice(),this.resolveState=e.resolveState,this.finalState=e.enterStates[e.enterStates.length-1]||e.resolveState};i.prototype={normalize:function(e,t){return this.matchContextsToStates(t),this.addInitialStates(),this.removeUnchangedContexts(e),this},matchContextsToStates:function(t){var n=this.enterStates.length-1,r=[],i,s;while(t.length>0){if(n>=0)i=this.enterStates[n--];else{if(this.enterStates.length){i=e(this.enterStates[0],"parentState");if(!i)throw"Cannot match all contexts to states"}else i=this.resolveState;this.enterStates.unshift(i),this.exitStates.unshift(i)}e(i,"hasContext")?s=t.pop():s=null,r.unshift(s)}this.contexts=r},addInitialStates:function(){var t=this.finalState,n;for(;;){n=e(t,"initialState")||"start",t=e(t,"states."+n);if(!t)break;this.finalState=t,this.enterStates.push(t),this.contexts.push(undefined)}},removeUnchangedContexts:function(e){while(this.enterStates.length>0){if(this.enterStates[0]!==this.exitStates[0])break;if(this.enterStates.length===this.contexts.length){if(e.getStateMeta(this.enterStates[0],"context")!==this.contexts[0])break;this.contexts.shift()}this.resolveState=this.enterStates.shift(),this.exitStates.shift()}}};var s=function(t,r,i){var u=this.enableLogging,a=i?"unhandledEvent":t,f=r[a],l,c,h;l=[].slice.call(arguments,3);if(typeof f=="function")return u&&(i?Ember.Logger.log(n("STATEMANAGER: Unhandled event '%@' being sent to state %@.",[t,e(r,"path")])):Ember.Logger.log(n("STATEMANAGER: Sending event '%@' to state %@.",[t,e(r,"path")]))),h=l,i&&h.unshift(t),h.unshift(this),f.apply(r,h);var p=e(r,"parentState");if(p)return c=l,c.unshift(t,p,i),s.apply(this,c);if(!i)return o.call(this,t,l,!0)},o=function(t,n,r){return n.unshift(t,e(this,"currentState"),r),s.apply(this,n)};Ember.StateManager=Ember.State.extend({init:function(){this._super(),t(this,"stateMeta",Ember.Map.create());var n=e(this,"initialState");!n&&e(this,"states.start")&&(n="start"),n&&this.transitionTo(n)},stateMetaFor:function(t){var n=e(this,"stateMeta"),r=n.get(t);return r||(r={},n.set(t,r)),r},setStateMeta:function(e,n,r){return t(this.stateMetaFor(e),n,r)},getStateMeta:function(t,n){return e(this.stateMetaFor(t),n)},currentState:null,currentPath:Ember.computed.alias("currentState.path"),transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(e){var t=[].slice.call(arguments,1);return o.call(this,e,t,!1)},unhandledEvent:function(t,n){if(e(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+n+" in state "+e(this,"currentState.path")+".")},getStateByPath:function(t,n){var r=n.split("."),i=t;for(var s=0,o=r.length;s<o;s++){i=e(e(i,"states"),r[s]);if(!i)break}return i},findStateByPath:function(t,n){var r;while(!r&&t)r=this.getStateByPath(t,n),t=e(t,"parentState");return r},getStatesInPath:function(t,n){if(!n||n==="")return undefined;var r=n.split("."),i=[],s,o;for(var u=0,a=r.length;u<a;u++){s=e(t,"states");if(!s)return undefined;o=e(s,r[u]);if(!o)return undefined;t=o,i.push(o)}return i},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(t,n){if(Ember.isEmpty(t))return;var r=n?Array.prototype.slice.call(arguments,1):[],s=e(this,"currentState")||this,o=this.contextFreeTransition(s,t),u=(new i(o)).normalize(this,r);this.enterState(u),this.triggerSetupContext(u)},contextFreeTransition:function(t,n){var r=t.pathsCache[n];if(r)return r;var i=this.getStatesInPath(t,n),s=[],o=t;while(o&&!i){s.unshift(o),o=e(o,"parentState");if(!o){i=this.getStatesInPath(this,n);if(!i)return}i=this.getStatesInPath(o,n)}while(i.length>0&&i[0]===s[0])o=i.shift(),s.shift();var u=t.pathsCache[n]={exitStates:s,enterStates:i,resolveState:o};return u},triggerSetupContext:function(t){var n=t.contexts,i=t.enterStates.length-n.length,s=t.enterStates,o=e(this,"transitionEvent");r.call(s,function(e,t){e.trigger(o,this,n[t-i])},this)},getState:function(t){var n=e(this,t),r=e(this,"parentState");if(n)return n;if(r)return r.getState(t)},enterState:function(n){var i=this.enableLogging,s=n.exitStates.slice(0).reverse();r.call(s,function(e){e.trigger("exit",this)},this),r.call(n.enterStates,function(t){i&&Ember.Logger.log("STATEMANAGER: Entering "+e(t,"path")),t.trigger("enter",this)},this),t(this,"currentState",n.finalState)}})}(),function(){}()})(),typeof location!="undefined"&&(location.hostname==="localhost"||location.hostname==="127.0.0.1")&&console.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website.");
|
15
|
+
(function(){var e,t;(function(){var n={},r={};e=function(e,t,r){n[e]={deps:t,callback:r}},t=function(e){if(r[e])return r[e];r[e]={};var i=n[e],s=i.deps,o=i.callback,u=[],a;for(var f=0,l=s.length;f<l;f++)s[f]==="exports"?u.push(a={}):u.push(t(s[f]));var c=o.apply(this,u);return r[e]=a||c}})(),function(){function r(t){if(e.console&&e.console[t])return e.console[t].apply?function(){e.console[t].apply(e.console,arguments)}:function(){var n=Array.prototype.join.call(arguments,", ");e.console[t](n)}}"undefined"==typeof Ember&&(Ember={});var e=Ember.imports=Ember.imports||this,t=Ember.exports=Ember.exports||this,n=Ember.lookup=Ember.lookup||this;t.Em=t.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.0-rc.1",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,typeof Ember.EXTEND_PROTOTYPES=="undefined"&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.LOG_VERSION=Ember.ENV.LOG_VERSION===!1?!1:!0,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.debug&&(Ember.debug=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(e,t){return t}),Ember.uuid=0,Ember.Logger={log:r("log")||Ember.K,warn:r("warn")||Ember.K,error:r("error")||Ember.K,info:r("info")||Ember.K,debug:r("debug")||r("info")||Ember.K},Ember.onerror=null,Ember.handleErrors=function(e,t){if("function"!=typeof Ember.onerror)return e.apply(t||this);try{return e.apply(t||this)}catch(n){Ember.onerror(n)}},Ember.merge=function(e,t){for(var n in t){if(!t.hasOwnProperty(n))continue;e[n]=t[n]}},Ember.isNone=function(e){return e===null||e===undefined},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return e===null||e===undefined||e.length===0&&typeof e!="function"||typeof e=="object"&&Ember.get(e,"length")===0},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty)}(),function(){var e=Ember.platform={};Ember.create=Object.create;if(!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,n){t.prototype=e,e=new t;if(n){t.prototype=e;for(var r in n)t.prototype[r]=n[r].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var n=Object.defineProperty,r,i;if(n)try{n({},"a",{get:function(){}})}catch(s){n=null}n&&(r=function(){var e={};return n(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),n(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),i=function(){try{return n(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?i||(n=function(e,t,n){var r;return typeof Node=="object"?r=e instanceof Node:r=typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",r?e[t]=n.value:Object.defineProperty(e,t,n)}):n=null),e.defineProperty=n,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,n){n.get||(e[t]=n.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){function h(e){this.descs={},this.watching={},this.cache={},this.source=e}function p(e,t){return!!e&&typeof e[t]=="function"}var e=Ember.platform.defineProperty,t=Ember.create,n="__ember"+ +(new Date),r=0,i=[],s={},o=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=n;var u={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(i,s){s||(s="ember");var o=s+r++;return i&&(u.value=o,e(i,n,u)),o},Ember.guidFor=function(o){if(o===undefined)return"(undefined)";if(o===null)return"(null)";var a,f,l=typeof o;switch(l){case"number":return f=i[o],f||(f=i[o]="nu"+o),f;case"string":return f=s[o],f||(f=s[o]="st"+r++),f;case"boolean":return o?"(true)":"(false)";default:if(o[n])return o[n];if(o===Object)return"(Object)";if(o===Array)return"(Array)";return f="ember"+r++,u.value=f,e(o,n,u),f}};var a={writable:!0,configurable:!1,enumerable:!1,value:null},f=Ember.GUID_KEY+"_meta";Ember.META_KEY=f;var l={descs:{},watching:{}};o&&(l.values={}),Ember.EMPTY_META=l,Object.freeze&&Object.freeze(l);var c=Ember.platform.defineProperty.isSimulated;c&&(h.prototype.__preventPlainObject__=!0,h.prototype.toJSON=function(){}),Ember.meta=function(r,i){var s=r[f];return i===!1?s||l:(s?s.source!==r&&(c||e(r,f,a),s=t(s),s.descs=t(s.descs),s.watching=t(s.watching),s.cache={},s.source=r,o&&(s.values=t(s.values)),r[f]=s):(c||e(r,f,a),s=new h(r),o&&(s.values={}),r[f]=s,s.descs.constructor=null),s)},Ember.getMeta=function(t,n){var r=Ember.meta(t,!1);return r[n]},Ember.setMeta=function(t,n,r){var i=Ember.meta(t,!0);return i[n]=r,r},Ember.metaPath=function(n,r,i){var s=Ember.meta(n,i),o,u;for(var a=0,f=r.length;a<f;a++){o=r[a],u=s[o];if(!u){if(!i)return undefined;u=s[o]={__ember_source__:n}}else if(u.__ember_source__!==n){if(!i)return undefined;u=s[o]=t(u),u.__ember_source__=n}s=u}return u},Ember.wrap=function(e,t){function n(){}function r(){var r,i=this._super;return this._super=t||n,r=e.apply(this,arguments),this._super=i,r}return r.wrappedFunction=e,r.__ember_observes__=e.__ember_observes__,r.__ember_observesBefore__=e.__ember_observesBefore__,r},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:e.length!==undefined&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return e===null||e===undefined?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=p,Ember.tryInvoke=function(e,t,n){if(p(e,t))return e[t].apply(e,n||[])};var d=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return e!==1}();d?Ember.tryFinally=function(e,t,n){var r,i,s;n=n||this;try{r=e.call(n)}finally{try{i=t.call(n)}catch(o){s=o}}if(s)throw s;return i===undefined?r:i}:Ember.tryFinally=function(e,t,n){var r,i;n=n||this;try{r=e.call(n)}finally{i=t.call(n)}return i===undefined?r:i},d?Ember.tryCatchFinally=function(e,t,n,r){var i,s,o,u;r=r||this;try{i=e.call(r)}catch(a){i=t.call(r,a)}finally{try{s=n.call(r)}catch(f){o=f}}if(o)throw o;return s===undefined?i:s}:Ember.tryCatchFinally=function(e,t,n,r){var i,s;r=r||this;try{i=e.call(r)}catch(o){i=t.call(r,o)}finally{s=n.call(r)}return s===undefined?i:s}}(),function(){Ember.Instrumentation={};var e=[],t={},n=function(n){var r=[],i;for(var s=0,o=e.length;s<o;s++)i=e[s],i.regex.test(n)&&r.push(i.object);return t[n]=r,r},r=function(){var e="undefined"!=typeof window?window.performance||{}:{},t=e.now||e.mozNow||e.webkitNow||e.msNow||e.oNow;return t?t.bind(e):function(){return+(new Date)}}();Ember.Instrumentation.instrument=function(e,i,s,o){function d(){for(h=0,p=u.length;h<p;h++)c=u[h],l[h]=c.before(e,r(),i);return s.call(o)}function v(e){i=i||{},i.exception=e}function m(){for(h=0,p=u.length;h<p;h++)c=u[h],c.after(e,r(),i,l[h]);Ember.STRUCTURED_PROFILE&&console.timeEnd(a)}var u=t[e],a,f;Ember.STRUCTURED_PROFILE&&(a=e+": "+i.object,console.time(a)),u||(u=n(e));if(u.length===0)return f=s.call(o),Ember.STRUCTURED_PROFILE&&console.timeEnd(a),f;var l=[],c,h,p;return Ember.tryCatchFinally(d,v,m)},Ember.Instrumentation.subscribe=function(n,r){var i=n.split("."),s,o=[];for(var u=0,a=i.length;u<a;u++)s=i[u],s==="*"?o.push("[^\\.]*"):o.push(s);o=o.join("\\."),o+="(\\..*)?";var f={pattern:n,regex:new RegExp("^"+o+"$"),object:r};return e.push(f),t={},f},Ember.Instrumentation.unsubscribe=function(n){var r;for(var i=0,s=e.length;i<s;i++)e[i]===n&&(r=i);e.splice(r,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e=Ember.EnumerableUtils={map:function(e,t,n){return e.map?e.map.call(e,t,n):Array.prototype.map.call(e,t,n)},forEach:function(e,t,n){return e.forEach?e.forEach.call(e,t,n):Array.prototype.forEach.call(e,t,n)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):Array.prototype.indexOf.call(e,t,n)},indexesOf:function(t,n){return n===undefined?[]:e.map(n,function(n){return e.indexOf(t,n)})},addObject:function(t,n){var r=e.indexOf(t,n);r===-1&&t.push(n)},removeObject:function(t,n){var r=e.indexOf(t,n);r!==-1&&t.splice(r,1)},replace:function(e,t,n,r){if(e.replace)return e.replace(t,n,r);var i=Array.prototype.concat.apply([t,n],r);return e.splice.apply(e,i)},intersection:function(e,t){var n=[];return e.forEach(function(e){t.indexOf(e)>=0&&n.push(e)}),n}}}(),function(){var e=function(e){return e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1},t=e(Array.prototype.map)?Array.prototype.map:function(e){if(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=new Array(n),i=arguments[1];for(var s=0;s<n;s++)s in t&&(r[s]=e.call(i,t[s],s,t));return r},n=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(this===void 0||this===null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")throw new TypeError;var r=arguments[1];for(var i=0;i<n;i++)i in t&&e.call(r,t[i],i,t)},r=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){t===null||t===undefined?t=0:t<0&&(t=Math.max(0,this.length+t));for(var n=t,r=this.length;n<r;n++)if(this[n]===e)return n;return-1};Ember.ArrayPolyfills={map:t,forEach:n,indexOf:r},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=n),Array.prototype.indexOf||(Array.prototype.indexOf=r))}(),function(){var e=Ember.guidFor,t=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,t.values=i,t},i=Ember.OrderedSet=function(){this.clear()};i.create=function(){return new i},i.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(t){var n=e(t),r=this.presenceSet,i=this.list;if(n in r)return;r[n]=!0,i.push(t)},remove:function(n){var r=e(n),i=this.presenceSet,s=this.list;delete i[r];var o=t.call(s,n);o>-1&&s.splice(o,1)},isEmpty:function(){return this.list.length===0},has:function(t){var n=e(t),r=this.presenceSet;return n in r},forEach:function(e,t){var n=this.list.slice();for(var r=0,i=n.length;r<i;r++)e.call(t,n[r])},toArray:function(){return this.list.slice()},copy:function(){var e=new i;return e.presenceSet=n(this.presenceSet),e.list=this.list.slice(),e}};var s=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};s.create=function(){return new s},s.prototype={get:function(t){var n=this.values,r=e(t);return n[r]},set:function(t,n){var r=this.keys,i=this.values,s=e(t);r.add(t),i[s]=n},remove:function(t){var n=this.keys,r=this.values,i=e(t),s;return r.hasOwnProperty(i)?(n.remove(t),s=r[i],delete r[i],!0):!1},has:function(t){var n=this.values,r=e(t);return n.hasOwnProperty(r)},forEach:function(t,n){var r=this.keys,i=this.values;r.forEach(function(r){var s=e(r);t.call(n,r,i[s])})},copy:function(){return r(this,new s)}};var o=Ember.MapWithDefault=function(e){s.call(this),this.defaultValue=e.defaultValue};o.create=function(e){return e?new o(e):new s},o.prototype=Ember.create(s.prototype),o.prototype.get=function(e){var t=this.has(e);if(t)return s.prototype.get.call(this,e);var n=this.defaultValue(e);return this.set(e,n),n},o.prototype.copy=function(){return r(this,new o({defaultValue:this.defaultValue}))}}(),function(){function a(e){return e.match(u)[0]}function f(e,n){var r=o.test(n),i=!r&&s.test(n),u;if(!e||i)e=Ember.lookup;r&&(n=n.slice(5)),e===Ember.lookup&&(u=a(n),e=t(e,u),n=n.slice(u.length+1));if(!n||n.length===0)throw new Error("Invalid Path");return[e,n]}function l(e,n){var r,i,s,u,a;if(e===null&&n.indexOf(".")===-1)return t(Ember.lookup,n);r=o.test(n);if(!e||r)s=f(e,n),e=s[0],n=s[1],s.length=0;i=n.split("."),a=i.length;for(u=0;e&&u<a;u++){e=t(e,i[u],!0);if(e&&e.isDestroyed)return undefined}return e}function c(e,t,r,i){var s;s=t.slice(t.lastIndexOf(".")+1),t=t.slice(0,t.length-(s.length+1)),t!=="this"&&(e=l(e,t));if(!s||s.length===0)throw new Error("You passed an empty path");if(!e){if(i)return;throw new Error("Object in path "+t+" could not be found or was destroyed.")}return n(e,s,r)}var e=Ember.META_KEY,t,n,r=Ember.ENV.MANDATORY_SETTER,i=/^([A-Z$]|([0-9][A-Z$]))/,s=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,o=/^this[\.\*]/,u=/^([^\.\*]+)/;t=function(n,i){if(i==="")return n;!i&&"string"==typeof n&&(i=n,n=null);if(!n||i.indexOf(".")!==-1)return l(n,i);var s=n[e],o=s&&s.descs[i],u;return o?o.get(n,i):(r&&s&&s.watching[i]>0?u=s.values[i]:u=n[i],u!==undefined||"object"!=typeof n||i in n||"function"!=typeof n.unknownProperty?u:n.unknownProperty(i))},n=function(n,i,s,o){typeof n=="string"&&(s=i,i=n,n=null);if(!n||i.indexOf(".")!==-1)return c(n,i,s,o);var u=n[e],a=u&&u.descs[i],f,l;return a?a.set(n,i,s):(f="object"==typeof n&&!(i in n),f&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,s):u&&u.watching[i]>0?(r?l=u.values[i]:l=n[i],s!==l&&(Ember.propertyWillChange(n,i),r?l!==undefined||i in n?u.values[i]=s:Ember.defineProperty(n,i,null,s):n[i]=s,Ember.propertyDidChange(n,i))):n[i]=s),s},Ember.config.overrideAccessors&&(Ember.get=t,Ember.set=n,Ember.config.overrideAccessors(),t=Ember.get,n=Ember.set),Ember.normalizeTuple=function(e,t){return f(e,t)},Ember.getWithDefault=function(e,n,r){var i=t(e,n);return i===undefined?r:i},Ember.get=t,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get),Ember.set=n,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(e,t,r){return n(e,t,r,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet),Ember.isGlobalPath=function(e){return i.test(e)}}(),function(){var e=Ember.META_KEY,t=Ember.meta,n=Ember.platform.defineProperty,r=Ember.ENV.MANDATORY_SETTER,i=Ember.Descriptor=function(){},s=Ember.MANDATORY_SETTER_FUNCTION=function(e){},o=Ember.DEFAULT_GETTER_FUNCTION=function(t){return function(){var n=this[e];return n&&n.values[t]}};Ember.defineProperty=function(e,i,u,a,f){var l,c,h,p;return f||(f=t(e)),l=f.descs,c=f.descs[i],h=f.watching[i]>0,c instanceof Ember.Descriptor&&c.teardown(e,i),u instanceof Ember.Descriptor?(p=u,l[i]=u,r&&h?n(e,i,{configurable:!0,enumerable:!0,writable:!0,value:undefined}):e[i]=undefined,u.setup(e,i)):(l[i]=undefined,u==null?(p=a,r&&h?(f.values[i]=a,n(e,i,{configurable:!0,enumerable:!0,set:s,get:o(i)})):e[i]=a):(p=u,n(e,i,u))),h&&Ember.overrideChains(e,i,f),e.didDefineProperty&&e.didDefineProperty(e,i,p),this}}(),function(){function i(){this.clear()}function u(t){return t+e}function a(e){return e+t}var e=":change",t=":before",n=Ember.guidFor,r=0;i.prototype.add=function(e,t,n){var r=this.observerSet,i=this.observers,s=Ember.guidFor(e),o=r[s],u;return o||(r[s]=o={}),u=o[t],u===undefined&&(u=i.push({sender:e,keyName:t,eventName:n,listeners:[]})-1,o[t]=u),i[u].listeners},i.prototype.flush=function(){var e=this.observers,t,n,r,i;this.clear();for(t=0,n=e.length;t<n;++t){r=e[t],i=r.sender;if(i.isDestroying||i.isDestroyed)continue;Ember.sendEvent(i,r.eventName,[i,r.keyName],r.listeners)}},i.prototype.clear=function(){this.observerSet={},this.observers=[]};var s=new i,o=new i;Ember.beginPropertyChanges=function(){r++},Ember.endPropertyChanges=function(){r--,r<=0&&(s.clear(),o.flush())},Ember.changeProperties=function(e,t){Ember.beginPropertyChanges(),Ember.tryFinally(e,Ember.endPropertyChanges,t)},Ember.setProperties=function(e,t){return Ember.changeProperties(function(){for(var n in t)t.hasOwnProperty(n)&&Ember.set(e,n,t[n])}),e},Ember.addObserver=function(e,t,n,r){return Ember.addListener(e,u(t),n,r),Ember.watch(e,t),this},Ember.observersFor=function(e,t){return Ember.listenersFor(e,u(t))},Ember.removeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,u(t),n,r),this},Ember.addBeforeObserver=function(e,t,n,r){return Ember.addListener(e,a(t),n,r),Ember.watch(e,t),this},Ember._suspendBeforeObserver=function(e,t,n,r,i){return Ember._suspendListener(e,a(t),n,r,i)},Ember._suspendObserver=function(e,t,n,r,i){return Ember._suspendListener(e,u(t),n,r,i)};var f=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,t,n,r,i){var s=f.call(t,a);return Ember._suspendListeners(e,s,n,r,i)},Ember._suspendObservers=function(e,t,n,r,i){var s=f.call(t,u);return Ember._suspendListeners(e,s,n,r,i)},Ember.beforeObserversFor=function(e,t){return Ember.listenersFor(e,a(t))},Ember.removeBeforeObserver=function(e,t,n,r){return Ember.unwatch(e,t),Ember.removeListener(e,a(t),n,r),this},Ember.notifyBeforeObservers=function(e,t){if(e.isDestroying)return;var n=a(t),i,o;r?(i=s.add(e,t,n),o=Ember.listenersDiff(e,n,i),Ember.sendEvent(e,n,[e,t],o)):Ember.sendEvent(e,n,[e,t])},Ember.notifyObservers=function(e,t){if(e.isDestroying)return;var n=u(t),i;r?(i=o.add(e,t,n),Ember.listenersUnion(e,n,i)):Ember.sendEvent(e,n,[e,t])}}(),function(){function h(e){return e.match(a)[0]}function p(e){return e==="*"||!f.test(e)}function d(t,n,r,i,s){var o=e(n);i[o]||(i[o]={});if(i[o][r])return;i[o][r]=!0;var u=s.deps;u=u&&u[r];if(u)for(var a in u){var f=s.descs[a];if(f&&f._suspended===n)continue;t(n,a)}}function g(e,t,n){if(e.isDestroying)return;var r=v,i=!r;i&&(r=v={}),d(A,e,t,r,n),i&&(v=null)}function y(e,t,n){if(e.isDestroying)return;var r=m,i=!r;i&&(r=m={}),d(O,e,t,r,n),i&&(m=null)}function b(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e),s=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(s=i.chainWatchers={}),s[n]||(s[n]=[]),s[n].push(r),Ember.watch(e,n)}function w(e,n,r){if(!e||"object"!=typeof e)return;var i=t(e,!1);if(!i.hasOwnProperty("chainWatchers"))return;var s=i.chainWatchers;if(s[n]){s=s[n];for(var o=0,u=s.length;o<u;o++)s[o]===r&&s.splice(o,1)}Ember.unwatch(e,n)}function S(){if(E.length===0)return;var e=E;E=[],u.call(e,function(e){e[0].add(e[1])})}function x(e){return t(e,!1).proto===e}function C(e){var n=t(e),r=n.chains;return r?r.value()!==e&&(r=n.chains=r.copy(e)):r=n.chains=new T(null,null,e),r}function k(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=0,o=i.length;s<o;s++)i[s].willChange(r)}function L(e,t,n,r){if(!n.hasOwnProperty("chainWatchers"))return;var i=n.chainWatchers;i=i[t];if(!i)return;for(var s=i.length-1;s>=0;s--)i[s].didChange(r)}function A(e,n){var r=t(e,!1),i=r.watching[n]>0||n==="length",s=r.proto,o=r.descs[n];if(!i)return;if(s===e)return;o&&o.willChange&&o.willChange(e,n),g(e,n,r),k(e,n,r),Ember.notifyBeforeObservers(e,n)}function O(e,n){var r=t(e,!1),i=r.watching[n]>0||n==="length",s=r.proto,o=r.descs[n];if(s===e)return;o&&o.didChange&&o.didChange(e,n);if(!i&&n!=="length")return;y(e,n,r),L(e,n,r),Ember.notifyObservers(e,n)}var e=Ember.guidFor,t=Ember.meta,n=Ember.get,r=Ember.set,i=Ember.normalizeTuple,s=Ember.GUID_KEY,o=Ember.META_KEY,u=Ember.ArrayPolyfills.forEach,a=/^([^\.\*]+)/,f=/[\.\*]/,l=Ember.ENV.MANDATORY_SETTER,c=Ember.platform.defineProperty,v,m,E=[],T=function(e,t,n){var r;this._parent=e,this._key=t,this._watching=n===undefined,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&b(this._object,this._key,this)),this._parent&&this._parent._key==="@each"&&this.value()},N=T.prototype;N.value=function(){if(this._value===undefined&&this._watching){var e=this._parent.value();this._value=e&&!x(e)?n(e,this._key):undefined}return this._value},N.destroy=function(){if(this._watching){var e=this._object;e&&w(e,this._key,this),this._watching=!1}},N.copy=function(e){var t=new T(null,null,e),n=this._paths,r;for(r in n){if(n[r]<=0)continue;t.add(r)}return t},N.add=function(e){var t,n,r,s,o;o=this._paths,o[e]=(o[e]||0)+1,t=this.value(),n=i(t,e);if(n[0]&&n[0]===t)e=n[1],r=h(e),e=e.slice(r.length+1);else{if(!n[0]){E.push([this,e]),n.length=0;return}s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]}n.length=0,this.chain(r,e,s)},N.remove=function(e){var t,n,r,s,o;o=this._paths,o[e]>0&&o[e]--,t=this.value(),n=i(t,e),n[0]===t?(e=n[1],r=h(e),e=e.slice(r.length+1)):(s=n[0],r=e.slice(0,0-(n[1].length+1)),e=n[1]),n.length=0,this.unchain(r,e)},N.count=0,N.chain=function(e,t,n){var r=this._chains,i;r||(r=this._chains={}),i=r[e],i||(i=r[e]=new T(this,e,n)),i.count++,t&&t.length>0&&(e=h(t),t=t.slice(e.length+1),i.chain(e,t))},N.unchain=function(e,t){var n=this._chains,r=n[e];t&&t.length>1&&(e=h(t),t=t.slice(e.length+1),r.unchain(e,t)),r.count--,r.count<=0&&(delete n[r._key],r.destroy())},N.willChange=function(){var e=this._chains;if(e)for(var t in e){if(!e.hasOwnProperty(t))continue;e[t].willChange()}this._parent&&this._parent.chainWillChange(this,this._key,1)},N.chainWillChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,n+1):(n>1&&Ember.propertyWillChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyWillChange(this.value(),t))},N.chainDidChange=function(e,t,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,n+1):(n>1&&Ember.propertyDidChange(this.value(),t),t="this."+t,this._paths[t]>0&&Ember.propertyDidChange(this.value(),t))},N.didChange=function(e){if(this._watching){var t=this._parent.value();t!==this._object&&(w(this._object,this._key,this),this._object=t,b(t,this._key,this)),this._value=undefined,this._parent&&this._parent._key==="@each"&&this.value()}var n=this._chains;if(n)for(var r in n){if(!n.hasOwnProperty(r))continue;n[r].didChange(e)}if(e)return;this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.overrideChains=function(e,t,n){L(e,t,n,!0)},Ember.watch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]?i[n]=(i[n]||0)+1:(i[n]=1,p(n)?(s=r.descs[n],s&&s.willWatch&&s.willWatch(e,n),"function"==typeof e.willWatchProperty&&e.willWatchProperty(n),l&&n in e&&(r.values[n]=e[n],c(e,n,{configurable:!0,enumerable:!0,set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(n)}))):C(e).add(n)),this},Ember.isWatching=function(t,n){var r=t[o];return(r&&r.watching[n])>0},Ember.watch.flushPending=S,Ember.unwatch=function(e,n){if(n==="length"&&Ember.typeOf(e)==="array")return this;var r=t(e),i=r.watching,s;return i[n]===1?(i[n]=0,p(n)?(s=r.descs[n],s&&s.didUnwatch&&s.didUnwatch(e,n),"function"==typeof e.didUnwatchProperty&&e.didUnwatchProperty(n),l&&n in e&&(c(e,n,{configurable:!0,enumerable:!0,writable:!0,value:r.values[n]}),delete r.values[n])):C(e).remove(n)):i[n]>1&&i[n]--,this},Ember.rewatch=function(e){var n=t(e,!1),r=n.chains;return s in e&&!e.hasOwnProperty(s)&&Ember.generateGuid(e,"ember"),r&&r.value()!==e&&(n.chains=r.copy(e)),this},Ember.finishChains=function(e){var n=t(e,!1),r=n.chains;r&&(r.value()!==e&&(n.chains=r=r.copy(e)),r.didChange(!0))},Ember.propertyWillChange=A,Ember.propertyDidChange=O;var M=[];Ember.destroy=function(e){var t=e[o],n,r,i,s;if(t){e[o]=null,n=t.chains;if(n){M.push(n);while(M.length>0){n=M.pop(),r=n._chains;if(r)for(i in r)r.hasOwnProperty(i)&&M.push(r[i]);n._watching&&(s=n._object,s&&w(s,n._key,n))}}}}}(),function(){function a(e,t,n){var r=t[n];return r?t.hasOwnProperty(n)||(r=t[n]=i(r)):r=t[n]={},r}function f(e,t){return a(e,t,"deps")}function l(e,t,n,r){var i=e._dependentKeys,s,u,l,c,h;if(!i)return;s=f(t,r);for(u=0,l=i.length;u<l;u++)c=i[u],h=a(t,s,c),h[n]=(h[n]||0)+1,o(t,c)}function c(e,t,n,r){var i=e._dependentKeys,s,o,l,c,h;if(!i)return;s=f(t,r);for(o=0,l=i.length;o<l;o++)c=i[o],h=a(t,s,c),h[n]=(h[n]||0)-1,u(t,c)}function h(e,t){this.func=e,this._cacheable=t&&t.cacheable!==undefined?t.cacheable:!0,this._dependentKeys=t&&t.dependentKeys,this._readOnly=t&&(t.readOnly!==undefined||!!t.readOnly)}var e=Ember.get,t=Ember.set,n=Ember.meta,r=[].slice,i=Ember.create,s=Ember.META_KEY,o=Ember.watch,u=Ember.unwatch;Ember.ComputedProperty=h,h.prototype=new Ember.Descriptor;var p=h.prototype;p.cacheable=function(e){return this._cacheable=e!==!1,this},p.volatile=function(){return this.cacheable(!1)},p.readOnly=function(e){return this._readOnly=e===undefined||!!e,this},p.property=function(){var e=[];for(var t=0,n=arguments.length;t<n;t++)e.push(arguments[t]);return this._dependentKeys=e,this},p.meta=function(e){return arguments.length===0?this._meta||{}:(this._meta=e,this)},p.willWatch=function(e,t){var n=e[s];t in n.cache||l(this,e,t,n)},p.didUnwatch=function(e,t){var n=e[s];t in n.cache||c(this,e,t,n)},p.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=n(e);t in r.cache&&(delete r.cache[t],r.watching[t]||c(this,e,t,r))}},p.get=function(e,t){var r,i,s;if(this._cacheable){s=n(e),i=s.cache;if(t in i)return i[t];r=i[t]=this.func.call(e,t),s.watching[t]||l(this,e,t,s)}else r=this.func.call(e,t);return r},p.set=function(e,t,r){var i=this._cacheable,s=this.func,o=n(e,i),u=o.watching[t],a=this._suspended,f=!1,c=o.cache,h,p;if(this._readOnly)throw new Error("Cannot Set: "+t+" on: "+e.toString());this._suspended=e;try{i&&c.hasOwnProperty(t)&&(h=c[t],f=!0),s.wrappedFunction&&(s=s.wrappedFunction);if(s.length===3)p=s.call(e,t,r,h);else{if(s.length!==2){Ember.defineProperty(e,t,null,h),Ember.set(e,t,r);return}p=s.call(e,t,r)}if(f&&h===p)return;u&&Ember.propertyWillChange(e,t),f&&delete c[t],i&&(!u&&!f&&l(this,e,t,o),c[t]=p),u&&Ember.propertyDidChange(e,t)}finally{this._suspended=a}return p},p.setup=function(e,t){var r=e[s];r&&r.watching[t]&&l(this,e,t,n(e))},p.teardown=function(e,t){var r=n(e);return(r.watching[t]||t in r.cache)&&c(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;arguments.length>1&&(t=r.call(arguments,0,-1),e=r.call(arguments,-1)[0]);if(typeof e!="function")throw new Error("Computed Property declared without a property function");var n=new h(e);return t&&n.property.apply(n,t),n},Ember.cacheFor=function(t,r){var i=n(t,!1).cache;if(i&&r in i)return i[r]},Ember.computed.not=function(t){return Ember.computed(t,function(n){return!e(this,t)})},Ember.computed.none=function(t){return Ember.computed(t,function(n){var r=e(this,t);return Ember.isNone(r)})},Ember.computed.empty=function(t){return Ember.computed(t,function(n){var r=e(this,t);return Ember.isEmpty(r)})},Ember.computed.bool=function(t){return Ember.computed(t,function(n){return!!e(this,t)})},Ember.computed.alias=function(n){return Ember.computed(n,function(r,i){return arguments.length>1?(t(this,n,i),i):e(this,n)})}}(),function(){function r(e,t,n){var r=-1;for(var i=0,s=e.length;i<s;i++)if(t===e[i][0]&&n===e[i][1]){r=i;break}return r}function i(n,r){var i=t(n,!0),s;return i.listeners||(i.listeners={}),i.hasOwnProperty("listeners")||(i.listeners=e(i.listeners)),s=i.listeners[r],s&&!i.listeners.hasOwnProperty(r)?s=i.listeners[r]=i.listeners[r].slice():s||(s=i.listeners[r]=[]),s}function s(e,t,i){var s=e[n],o=s&&s.listeners&&s.listeners[t];if(!o)return;for(var u=o.length-1;u>=0;u--){var a=o[u][0],f=o[u][1],l=o[u][2],c=o[u][3],h=r(i,a,f);h===-1&&i.push([a,f,l,c])}}function o(e,t,i){var s=e[n],o=s&&s.listeners&&s.listeners[t],u=[];if(!o)return;for(var a=o.length-1;a>=0;a--){var f=o[a][0],l=o[a][1],c=o[a][2],h=o[a][3],p=r(i,f,l);if(p!==-1)continue;i.push([f,l,c,h]),u.push([f,l,c,h])}return u}function u(e,t,n,s,o){!s&&"function"==typeof n&&(s=n,n=null);var u=i(e,t),a=r(u,n,s);if(a!==-1)return;u.push([n,s,o,undefined]),"function"==typeof e.didAddListener&&e.didAddListener(t,n,s)}function a(e,t,s,o){function u(n,s,o){var u=i(e,t),a=r(u,n,s);if(a===-1)return;u.splice(a,1),"function"==typeof e.didRemoveListener&&e.didRemoveListener(t,n,s)}!o&&"function"==typeof s&&(o=s,s=null);if(o)u(s,o);else{var a=e[n],f=a&&a.listeners&&a.listeners[t];if(!f)return;for(var l=f.length-1;l>=0;l--)u(f[l][0],f[l][1])}}function f(e,t,n,s,o){function l(){return o.call(n)}function c(){f&&(f[3]=undefined)}!s&&"function"==typeof n&&(s=n,n=null);var u=i(e,t),a=r(u,n,s),f;return a!==-1&&(f=u[a].slice(),f[3]=!0,u[a]=f),Ember.tryFinally(l,c)}function l(e,t,n,s,o){function d(){return o.call(n)}function v(){for(c=0,h=u.length;c<h;c++)u[c][3]=undefined}!s&&"function"==typeof n&&(s=n,n=null);var u=[],a,f,l,c,h;for(c=0,h=t.length;c<h;c++){a=t[c],f=i(e,a);var p=r(f,n,s);p!==-1&&(l=f[p].slice(),l[3]=!0,f[p]=l,u.push(l))}return Ember.tryFinally(d,v)}function c(e){var t=e[n].listeners,r=[];if(t)for(var i in t)t[i]&&r.push(i);return r}function h(e,t,r,i){e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,r);if(!i){var s=e[n];i=s&&s.listeners&&s.listeners[t]}if(!i)return;for(var o=i.length-1;o>=0;o--){if(!i[o]||i[o][3]===!0)continue;var u=i[o][0],f=i[o][1],l=i[o][2];l&&a(e,t,u,f),u||(u=e),"string"==typeof f&&(f=u[f]),r?f.apply(u,r):f.apply(u)}return!0}function p(e,t){var r=e[n],i=r&&r.listeners&&r.listeners[t];return!!i&&!!i.length}function d(e,t){var r=[],i=e[n],s=i&&i.listeners&&i.listeners[t];if(!s)return r;for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];r.push([a,f])}return r}var e=Ember.create,t=Ember.meta,n=Ember.META_KEY;Ember.addListener=u,Ember.removeListener=a,Ember._suspendListener=f,Ember._suspendListeners=l,Ember.sendEvent=h,Ember.hasListeners=p,Ember.watchedEvents=c,Ember.listenersFor=d,Ember.listenersDiff=o,Ember.listenersUnion=s}(),function(){function n(t,n,r,i){return n===undefined&&(n=t,t=undefined),"string"==typeof n&&(n=t[n]),r&&i>0&&(r=r.length>i?e.call(r,i):null),Ember.handleErrors(function(){return n.apply(t||this,r||[])},this)}function u(){o=null,s.currentRunLoop&&s.end()}function c(){f=null,s(function(){var e=+(new Date),t=-1;for(var r in a){if(!a.hasOwnProperty(r))continue;var i=a[r];if(i&&i.expires)if(e>=i.expires)delete a[r],n(i.target,i.method,i.args,2);else if(t<0||i.expires<t)t=i.expires}t>0&&(f=setTimeout(c,t-e),l=t)})}function h(e,t){t[this.tguid]&&delete t[this.tguid][this.mguid],a[e]&&n(this.target,this.method,this.args),delete a[e]}function p(e,t,n,r){var i=Ember.guidFor(t),o=Ember.guidFor(n),u=s.autorun().onceTimers,f=u[i]&&u[i][o],l;return f&&a[f]?a[f].args=r:(l={target:t,method:n,args:r,tguid:i,mguid:o},f=Ember.guidFor(l),a[f]=l,u[i]||(u[i]={}),u[i][o]=f,s.schedule(e,l,h,f,u)),f}var e=[].slice,t=Ember.ArrayPolyfills.forEach,r,i=function(e){this._prev=e||null,this.onceTimers={}};i.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(t,n,r){var i=this._queues,s;i||(i=this._queues={}),s=i[t],s||(s=i[t]=[]);var o=arguments.length>3?e.call(arguments,3):null;return s.push({target:n,method:r,args:o}),this},flush:function(e){function f(e){n(e.target,e.method,e.args)}function l(){t.call(u,f)}var i,s,o,u,a;if(!this._queues)return this;Ember.watch.flushPending();if(e)while(this._queues&&(u=this._queues[e]))this._queues[e]=null,e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f);else{i=Ember.run.queues,o=i.length,s=0;e:while(s<o){e=i[s],u=this._queues&&this._queues[e],delete this._queues[e],u&&(e==="sync"?(a=Ember.LOG_BINDINGS,a&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges(),Ember.tryFinally(l,Ember.endPropertyChanges),a&&Ember.Logger.log("End: Flush Sync Queue")):t.call(u,f));for(var c=0;c<=s;c++)if(this._queues&&this._queues[i[c]]){s=c;continue e}s++}}return r=null,this}},Ember.RunLoop=i,Ember.run=function(e,t){function i(){if(e||t)return n(e,t,r,2)}var r=arguments;return s.begin(),Ember.tryFinally(i,s.end)};var s=Ember.run;Ember.run.begin=function(){s.currentRunLoop=new i(s.currentRunLoop)},Ember.run.end=function(){function e(){s.currentRunLoop.end()}function t(){s.currentRunLoop=s.currentRunLoop.prev()}Ember.tryFinally(e,t)},Ember.run.queues=["sync","actions","destroy"],Ember.run.schedule=function(e,t,n){var r=s.autorun();r.schedule.apply(r,arguments)};var o;Ember.run.hasScheduledTimers=function(){return!!o||!!f},Ember.run.cancelTimers=function(){o&&(clearTimeout(o),o=null),f&&(clearTimeout(f),f=null),a={}},Ember.run.autorun=function(){return s.currentRunLoop||(s.begin(),o||(o=setTimeout(u,1))),s.currentRunLoop},Ember.run.sync=function(){s.autorun(),s.currentRunLoop.flush("sync")};var a={},f,l;Ember.run.later=function(t,n){var r,i,s,o,u;return arguments.length===2&&"function"==typeof t?(u=n,n=t,t=undefined,r=[t,n]):(r=e.call(arguments),u=r.pop()),i=+(new Date)+u,s={target:t,method:n,expires:i,args:r},o=Ember.guidFor(s),a[o]=s,f&&i<l&&(clearTimeout(f),f=null),f||(f=setTimeout(c,u),l=i),o},Ember.run.once=function(t,n){return p("actions",t,n,e.call(arguments,2))},Ember.run.scheduleOnce=function(t
|
16
|
+
,n,r,i){return p(t,n,r,e.call(arguments,3))},Ember.run.next=function(){var t=e.call(arguments);return t.push(1),s.later.apply(this,t)},Ember.run.cancel=function(e){delete a[e]}}(),function(){function i(t,n){return e(r(n)?Ember.lookup:t,n)}function o(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}Ember.LOG_BINDINGS=!!Ember.ENV.LOG_BINDINGS;var e=Ember.get,t=Ember.set,n=Ember.guidFor,r=Ember.isGlobalPath,s=function(e,t){this._direction="fwd",this._from=t,this._to=e,this._directionMap=Ember.Map.create()};s.prototype={copy:function(){var e=new s(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+n(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(e){var t=this._from,n=this._to;return Ember.trySet(e,n,i(e,t)),Ember.addObserver(e,t,this,this.fromDidChange),this._oneWay||Ember.addObserver(e,n,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(e){var t=!this._oneWay;return Ember.removeObserver(e,this._from,this,this.fromDidChange),t&&Ember.removeObserver(e,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync(e,"fwd")},toDidChange:function(e){this._scheduleSync(e,"back")},_scheduleSync:function(e,t){var n=this._directionMap,r=n.get(e);r||(Ember.run.schedule("sync",this,this._sync,e),n.set(e,t)),r==="back"&&t==="fwd"&&n.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(t.isDestroyed||!this._readyToSync)return;var r=this._directionMap,s=r.get(t),o=this._from,u=this._to;r.remove(t);if(s==="fwd"){var a=i(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",a,t),this._oneWay?Ember.trySet(t,u,a):Ember._suspendObserver(t,u,this,this.toDidChange,function(){Ember.trySet(t,u,a)})}else if(s==="back"){var f=e(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",f,t),Ember._suspendObserver(t,o,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(o)?Ember.lookup:t,o,f)})}}},o(s,{from:function(){var e=this,t=new e;return t.from.apply(t,arguments)},to:function(){var e=this,t=new e;return t.to.apply(t,arguments)},oneWay:function(e,t){var n=this,r=new n(null,e);return r.oneWay(t)}}),Ember.Binding=s,Ember.bind=function(e,t,n){return(new Ember.Binding(t,n)).connect(e)},Ember.oneWay=function(e,t,n){return(new Ember.Binding(t,n)).oneWay().connect(e)}}(),function(){function l(e){var t=Ember.meta(e,!0),n=t.mixins;return n?t.hasOwnProperty("mixins")||(n=t.mixins=u(n)):n=t.mixins={},n}function c(t,n){return n&&n.length>0&&(t.mixins=r.call(n,function(t){if(t instanceof e)return t;var n=new e;return n.properties=t,n})),t}function h(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function d(t,n){var r;return n instanceof e?(r=f(n),t[r]?p:(t[r]=n,n.properties)):n}function v(e,t,n){var r;return r=t.concatenatedProperties||n.concatenatedProperties,e.concatenatedProperties&&(r=r?r.concat(e.concatenatedProperties):e.concatenatedProperties),r}function m(e,t,n,r,i){var s;return r[t]===undefined&&(s=i[t]),s=s||e.descs[t],!!s&&s instanceof Ember.ComputedProperty?(n=u(n),n.func=Ember.wrap(n.func,s.func),n):n}function g(e,t,n,r,i){var s;return i[t]===undefined&&(s=r[t]),s=s||e[t],"function"!=typeof s?n:Ember.wrap(n,s)}function y(e,t,n,r){var i=r[t]||e[t];return i?"function"==typeof i.concat?i.concat(n):Ember.makeArray(i).concat(n):Ember.makeArray(n)}function b(e,n,r,s,o,u,a){if(r instanceof Ember.Descriptor){if(r===t&&o[n])return p;r.func&&(r=m(s,n,r,u,o)),o[n]=r,u[n]=undefined}else{if(h(r))r=g(e,n,r,u,o);else if(a&&i.call(a,n)>=0||n==="concatenatedProperties")r=y(e,n,r,u);o[n]=undefined,u[n]=r}}function w(e,t,n,r,i){function c(e){delete n[e],delete r[e]}var o,u,a,f,l;for(var h=0,m=e.length;h<m;h++){o=e[h],u=d(t,o);if(u===p)continue;if(u){l=Ember.meta(i),f=v(u,r,i);for(a in u){if(!u.hasOwnProperty(a))continue;b(i,a,u[a],l,n,r,f)}u.hasOwnProperty("toString")&&(i.toString=u.toString)}else o.mixins&&(w(o.mixins,t,n,r,i),o._without&&s.call(o._without,c))}}function E(e){var t=Ember.meta(e),n=t.required;if(!n||!t.hasOwnProperty("required"))n=t.required=n?u(n):{};return n}function x(e,t,n,r){if(S.test(t)){var i=r.bindings;i?r.hasOwnProperty("bindings")||(i=r.bindings=u(r.bindings)):i=r.bindings={},i[t]=n}}function T(e,t){var n=t.bindings,r,i,s;if(n){for(r in n)i=n[r],i&&(s=r.slice(0,-7),i instanceof Ember.Binding?(i=i.copy(),i.to(s)):i=new Ember.Binding(s,i),i.connect(e),e[r]=i);t.bindings={}}}function N(e,t){return T(e,t||Ember.meta(e)),e}function C(e,t,n,r,i){var s=t.methodName,o;return r[s]||i[s]?(o=i[s],t=r[s]):n.descs[s]?(t=n.descs[s],o=undefined):(t=undefined,o=e[s]),{desc:t,value:o}}function k(e,t,n,r,i){if("function"!=typeof n)return;var s=n[r];if(s)for(var o=0,u=s.length;o<u;o++)Ember[i](e,s[o],null,t)}function L(e,t,n){var r=e[t];k(e,t,r,"__ember_observesBefore__","removeBeforeObserver"),k(e,t,r,"__ember_observes__","removeObserver"),k(e,t,n,"__ember_observesBefore__","addBeforeObserver"),k(e,t,n,"__ember_observes__","addObserver")}function A(e,r,i){var s={},o={},u=Ember.meta(e),f,c,h;w(r,l(e),s,o,e);for(f in o){if(f==="contructor"||!o.hasOwnProperty(f))continue;h=s[f],c=o[f];if(h===t)continue;while(h&&h instanceof n){var p=C(e,h,u,s,o);h=p.desc,c=p.value}if(h===undefined&&c===undefined)continue;L(e,f,c),x(e,f,c,u),a(e,f,h,c,u)}return i||N(e,u),e}function M(e,t,n){var r=f(e);if(n[r])return!1;n[r]=!0;if(e===t)return!0;var i=e.mixins,s=i?i.length:0;while(--s>=0)if(M(i[s],t,n))return!0;return!1}function _(e,t,n){if(n[f(t)])return;n[f(t)]=!0;if(t.properties){var r=t.properties;for(var i in r)r.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&s.call(t.mixins,function(t){_(e,t,n)})}var e,t,n,r=Ember.ArrayPolyfills.map,i=Ember.ArrayPolyfills.indexOf,s=Ember.ArrayPolyfills.forEach,o=[].slice,u=Ember.create,a=Ember.defineProperty,f=Ember.guidFor,p={},S=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=o.call(arguments,1);return A(e,t,!1),e},Ember.Mixin=function(){return c(this,arguments)},e=Ember.Mixin,e._apply=A,e.applyPartial=function(e){var t=o.call(arguments,1);return A(e,t,!0)},e.finishPartial=N,Ember.anyUnprocessedMixins=!1,e.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return c(new e,arguments)};var O=e.prototype;O.reopen=function(){var t,n;this.properties?(t=e.create(),t.properties=this.properties,delete this.properties,this.mixins=[t]):this.mixins||(this.mixins=[]);var r=arguments.length,i=this.mixins,s;for(s=0;s<r;s++)t=arguments[s],t instanceof e?i.push(t):(n=e.create(),n.properties=t,i.push(n));return this},O.apply=function(e){return A(e,[this],!1)},O.applyPartial=function(e){return A(e,[this],!0)},O.detect=function(t){if(!t)return!1;if(t instanceof e)return M(t,this,{});var n=Ember.meta(t,!1).mixins;return n?!!n[f(this)]:!1},O.without=function(){var t=new e(this);return t._without=o.call(arguments),t},O.keys=function(){var e={},t={},n=[];_(e,this,t);for(var r in e)e.hasOwnProperty(r)&&n.push(r);return n},e.mixins=function(e){var t=Ember.meta(e,!1).mixins,n=[];if(!t)return n;for(var r in t){var i=t[r];i.properties||n.push(i)}return n},t=new Ember.Descriptor,t.toString=function(){return"(Required Property)"},Ember.required=function(){return t},n=function(e){this.methodName=e},n.prototype=new Ember.Descriptor,Ember.alias=function(e){return new n(e)},Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.",Ember.alias),Ember.aliasMethod=function(e){return new n(e)},Ember.observer=function(e){var t=o.call(arguments,1);return e.__ember_observes__=t,e},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;e<t;e++)var n=arguments[e];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(e){var t=o.call(arguments,1);return e.__ember_observesBefore__=t,e}}(),function(){}(),function(){e("rsvp",[],function(){"use strict";function d(e,t){n.async(function(){e.trigger("promise:resolved",{detail:t}),e.isResolved=!0,e.resolvedValue=t})}function v(e,t){n.async(function(){e.trigger("promise:failed",{detail:t}),e.isRejected=!0,e.rejectedValue=t})}function m(e){var t,n=[],r=new c,i=e.length;i===0&&r.resolve([]);var s=function(e){return function(t){o(e,t)}},o=function(e,t){n[e]=t,--i===0&&r.resolve(n)},u=function(e){r.reject(e)};for(t=0;t<i;t++)e[t].then(s(t),u);return r}var e=typeof window!="undefined"?window:{},t=e.MutationObserver||e.WebKitMutationObserver,n,r;if(typeof process!="undefined"&&{}.toString.call(process)==="[object process]")r=function(e,t){process.nextTick(function(){e.call(t)})};else if(t){var i=[],s=new t(function(){var e=i.slice();i=[],e.forEach(function(e){var t=e[0],n=e[1];t.call(n)})}),o=document.createElement("div");s.observe(o,{attributes:!0}),window.addEventListener("unload",function(){s.disconnect(),s=null}),r=function(e,t){i.push([e,t]),o.setAttribute("drainQueue","drainQueue")}}else r=function(e,t){setTimeout(function(){e.call(t)},1)};var u=function(e,t){this.type=e;for(var n in t){if(!t.hasOwnProperty(n))continue;this[n]=t[n]}},a=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n][0]===t)return n;return-1},f=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t},l={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e},on:function(e,t,n){var r=f(this),i,s;e=e.split(/\s+/),n=n||this;while(s=e.shift())i=r[s],i||(i=r[s]=[]),a(i,t)===-1&&i.push([t,n])},off:function(e,t){var n=f(this),r,i,s;e=e.split(/\s+/);while(i=e.shift()){if(!t){n[i]=[];continue}r=n[i],s=a(r,t),s!==-1&&r.splice(s,1)}},trigger:function(e,t){var n=f(this),r,i,s,o,a;if(r=n[e])for(var l=0;l<r.length;l++)i=r[l],s=i[0],o=i[1],typeof t!="object"&&(t={detail:t}),a=new u(e,t),s.call(o,a)}},c=function(){this.on("promise:resolved",function(e){this.trigger("success",{detail:e.detail})},this),this.on("promise:failed",function(e){this.trigger("error",{detail:e.detail})},this)},h=function(){},p=function(e,t,n,r){var i=typeof n=="function",s,o,u,a;if(i)try{s=n(r.detail),u=!0}catch(f){a=!0,o=f}else s=r.detail,u=!0;s&&typeof s.then=="function"?s.then(function(e){t.resolve(e)},function(e){t.reject(e)}):i&&u?t.resolve(s):a?t.reject(o):t[e](s)};return c.prototype={then:function(e,t){var r=new c;return this.isResolved&&n.async(function(){p("resolve",r,e,{detail:this.resolvedValue})},this),this.isRejected&&n.async(function(){p("reject",r,t,{detail:this.rejectedValue})},this),this.on("promise:resolved",function(t){p("resolve",r,e,t)}),this.on("promise:failed",function(e){p("reject",r,t,e)}),r},resolve:function(e){d(this,e),this.resolve=h,this.reject=h},reject:function(e){v(this,e),this.resolve=h,this.reject=h}},l.mixin(c.prototype),n={async:r,Promise:c,Event:u,EventTarget:l,all:m,raiseOnUncaughtExceptions:!0},n})}(),function(){e("container",[],function(){function e(e){this.parent=e,this.dict={}}function t(t){this.parent=t,this.children=[],this.resolver=t&&t.resolver||function(){},this.registry=new e(t&&t.registry),this.cache=new e(t&&t.cache),this.typeInjections=new e(t&&t.typeInjections),this.injections={},this._options=new e(t&&t._options),this._typeOptions=new e(t&&t._typeOptions)}function n(e){throw new Error(e+" is not currently supported on child containers")}function r(e,t){var n=s(e,t,"singleton");return n!==!1}function i(e,t){var n={};if(!t)return n;var r,i;for(var s=0,o=t.length;s<o;s++)r=t[s],i=e.lookup(r.fullName),n[r.property]=i;return n}function s(e,t,n){var r=e._options.get(t);if(r&&r[n]!==undefined)return r[n];var i=t.split(":")[0];r=e._typeOptions.get(i);if(r)return r[n]}function o(e,t){var n=e.normalize(t);return e.resolve(n)}function u(e,t){var n=o(e,t),r=t.split(":"),u=r[0],a=r[1],f;if(s(e,t,"instantiate")===!1)return n;if(n){var l=[];l=l.concat(e.typeInjections.get(u)||[]),l=l.concat(e.injections[t]||[]);var c=i(e,l);return c.container=e,c._debugContainerKey=t,f=n.create(c),f}}function a(e,t){e.cache.eachLocal(function(n,r){if(s(e,n,"instantiate")===!1)return;t(r)})}function f(e){e.cache.eachLocal(function(t,n){if(s(e,t,"instantiate")===!1)return;n.destroy()}),e.cache.dict={}}return e.prototype={get:function(e){var t=this.dict;if(t.hasOwnProperty(e))return t[e];if(this.parent)return this.parent.get(e)},set:function(e,t){this.dict[e]=t},has:function(e){var t=this.dict;return t.hasOwnProperty(e)?!0:this.parent?this.parent.has(e):!1},eachLocal:function(e,t){var n=this.dict;for(var r in n)n.hasOwnProperty(r)&&e.call(t,r,n[r])}},t.prototype={child:function(){var e=new t(this);return this.children.push(e),e},set:function(e,t,n){e[t]=n},register:function(e,t,n,r){var i;e.indexOf(":")!==-1?(r=n,n=t,i=e):i=e+":"+t;var s=this.normalize(i);this.registry.set(s,n),this._options.set(s,r||{})},resolve:function(e){return this.resolver(e)||this.registry.get(e)},normalize:function(e){return e},lookup:function(e,t){e=this.normalize(e),t=t||{};if(this.cache.has(e)&&t.singleton!==!1)return this.cache.get(e);var n=u(this,e);if(!n)return;return r(this,e)&&t.singleton!==!1&&this.cache.set(e,n),n},has:function(e){return this.cache.has(e)?!0:!!o(this,e)},optionsForType:function(e,t){this.parent&&n("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){this.parent&&n("typeInjection");var i=this.typeInjections.get(e);i||(i=[],this.typeInjections.set(e,i)),i.push({property:t,fullName:r})},injection:function(e,t,r){this.parent&&n("injection");if(e.indexOf(":")===-1)return this.typeInjection(e,t,r);var i=this.injections[e]=this.injections[e]||[];i.push({property:t,fullName:r})},destroy:function(){this.isDestroyed=!0;for(var e=0,t=this.children.length;e<t;e++)this.children[e].destroy();this.children=[],a(this,function(e){e.isDestroying=!0}),a(this,function(e){e.destroy()}),delete this.parent,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;e<t;e++)f(this.children[e]);f(this)}},t})}(),function(){function i(t,n,r,s){var o,u,a;if("object"!=typeof t||t===null)return t;if(n&&(u=e(r,t))>=0)return s[u];if(Ember.typeOf(t)==="array"){o=t.slice();if(n){u=o.length;while(--u>=0)o[u]=i(o[u],n,r,s)}}else if(Ember.Copyable&&Ember.Copyable.detect(t))o=t.copy(n,r,s);else{o={};for(a in t){if(!t.hasOwnProperty(a))continue;if(a.substring(0,2)==="__")continue;o[a]=n?i(t[a],n,r,s):t[a]}}return n&&(r.push(t),s.push(o)),o}var e=Ember.EnumerableUtils.indexOf,t={},n="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(n,function(e){t["[object "+e+"]"]=e.toLowerCase()});var r=Object.prototype.toString;Ember.typeOf=function(e){var n;return n=e===null||e===undefined?String(e):t[r.call(e)]||"object",n==="function"?Ember.Object&&Ember.Object.detect(e)&&(n="class"):n==="object"&&(e instanceof Error?n="error":Ember.Object&&e instanceof Ember.Object?n="instance":n="object"),n},Ember.compare=function o(e,t){if(e===t)return 0;var n=Ember.typeOf(e),r=Ember.typeOf(t),i=Ember.Comparable;if(i){if(n==="instance"&&i.detect(e.constructor))return e.constructor.compare(e,t);if(r==="instance"&&i.detect(t.constructor))return 1-t.constructor.compare(t,e)}var s=Ember.ORDER_DEFINITION_MAPPING;if(!s){var u=Ember.ORDER_DEFINITION;s=Ember.ORDER_DEFINITION_MAPPING={};var a,f;for(a=0,f=u.length;a<f;++a)s[u[a]]=a;delete Ember.ORDER_DEFINITION}var l=s[n],c=s[r];if(l<c)return-1;if(l>c)return 1;switch(n){case"boolean":case"number":if(e<t)return-1;if(e>t)return 1;return 0;case"string":var h=e.localeCompare(t);if(h<0)return-1;if(h>0)return 1;return 0;case"array":var p=e.length,d=t.length,v=Math.min(p,d),m=0,g=0;while(m===0&&g<v)m=o(e[g],t[g]),g++;if(m!==0)return m;if(p<d)return-1;if(p>d)return 1;return 0;case"instance":if(Ember.Comparable&&Ember.Comparable.detect(e))return e.compare(e,t);return 0;case"date":var y=e.getTime(),b=t.getTime();if(y<b)return-1;if(y>b)return 1;return 0;default:return 0}},Ember.copy=function(e,t){return"object"!=typeof e||e===null?e:Ember.Copyable&&Ember.Copyable.detect(e)?e.copy(t):i(e,t,t?[]:null,t?[]:null)},Ember.inspect=function(e){if(typeof e!="object"||e===null)return e+"";var t,n=[];for(var r in e)if(e.hasOwnProperty(r)){t=e[r];if(t==="toString")continue;Ember.typeOf(t)==="function"&&(t="function() { ... }"),n.push(r+": "+t)}return"{"+n.join(", ")+"}"},Ember.isEqual=function(e,t){return e&&"function"==typeof e.isEqual?e.isEqual(t):e===t},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,Ember.keys||(Ember.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t});var s=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var e=Error.prototype.constructor.apply(this,arguments);for(var t=0;t<s.length;t++)this[s[t]]=e[s[t]]},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){Ember.RSVP=t("rsvp")}(),function(){var e=/[ _]/g,t={},n=/([a-z])([A-Z])/g,r=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,s=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var n=0;return e.replace(/%@([0-9]+)?/g,function(e,r){return r=r?parseInt(r,0)-1:n++,e=t[r],(e===null?"(null)":e===undefined?"":e).toString()})},loc:function(e,t){return e=Ember.STRINGS[e]||e,Ember.String.fmt(e,t)},w:function(e){return e.split(/\s+/)},decamelize:function(e){return e.replace(n,"$1_$2").toLowerCase()},dasherize:function(n){var r=t,i=r.hasOwnProperty(n),s;return i?r[n]:(s=Ember.String.decamelize(n).replace(e,"-"),r[n]=s,s)},camelize:function(e){return e.replace(r,function(e,t,n){return n?n.toUpperCase():""}).replace(/^([A-Z])/,function(e,t,n){return e.toLowerCase()})},classify:function(e){var t=e.split("."),n=[];for(var r=0,i=t.length;r<i;r++){var s=Ember.String.camelize(t[r]);n.push(s.charAt(0).toUpperCase()+s.substr(1))}return n.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(s,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,n=Ember.String.loc,r=Ember.String.camelize,i=Ember.String.decamelize,s=Ember.String.dasherize,o=Ember.String.underscore,u=Ember.String.capitalize,a=Ember.String.classify;if(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)String.prototype.fmt=function(){return e(this,arguments)},String.prototype.w=function(){return t(this)},String.prototype.loc=function(){return n(this,arguments)},String.prototype.camelize=function(){return r(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return s(this)},String.prototype.underscore=function(){return o(this)},String.prototype.classify=function(){return a(this)},String.prototype.capitalize=function(){return u(this)}}(),function(){var e=Array.prototype.slice;if(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)Function.prototype.property=function(){var e=Ember.computed(this);return e.property.apply(e,arguments)},Function.prototype.observes=function(){return this.__ember_observes__=e.call(arguments),this},Function.prototype.observesBefore=function(){return this.__ember_observesBefore__=e.call(arguments),this}}(),function(){}(),function(){function s(){return i.length===0?{}:i.pop()}function o(e){return i.push(e),null}function u(t,n){function i(i){var s=e(i,t);return r?n===s:!!s}var r=arguments.length===2;return i}var e=Ember.get,t=Ember.set,n=Array.prototype.slice,r=Ember.EnumerableUtils.indexOf,i=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(e(this,"length")===0)return undefined;var t=s(),n;return n=this.nextObject(0,null,t),o(t),n}).property("[]"),lastObject:Ember.computed(function(){var t=e(this,"length");if(t===0)return undefined;var n=s(),r=0,i,u=null;do u=i,i=this.nextObject(r++,u,n);while(i!==undefined);return o(n),u}).property("[]"),contains:function(e){return this.find(function(t){return t===e})!==undefined},forEach:function(t,n){if(typeof t!="function")throw new TypeError;var r=e(this,"length"),i=null,u=s();n===undefined&&(n=null);for(var a=0;a<r;a++){var f=this.nextObject(a,i,u);t.call(n,f,a,this),i=f}return i=null,u=o(u),this},getEach:function(e){return this.mapProperty(e)},setEach:function(e,n){return this.forEach(function(r){t(r,e,n)})},map:function(e,t){var n=Ember.A([]);return this.forEach(function(r,i,s){n[i]=e.call(t,r,i,s)}),n},mapProperty:function(t){return this.map(function(n){return e(n,t)})},filter:function(e,t){var n=Ember.A([]);return this.forEach(function(r,i,s){e.call(t,r,i,s)&&n.push(r)}),n},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterProperty:function(e,t){return this.filter(u.apply(this,arguments))},rejectProperty:function(t,n){var r=function(r){return e(r,t)===n},i=function(n){return!!e(n,t)},s=arguments.length===2?r:i;return this.reject(s)},find:function(t,n){var r=e(this,"length");n===undefined&&(n=null);var i=null,u,a=!1,f,l=s();for(var c=0;c<r&&!a;c++){u=this.nextObject(c,i,l);if(a=t.call(n,u,c,this))f=u;i=u}return u=i=null,l=o(l),f},findProperty:function(e,t){return this.find(u.apply(this,arguments))},every:function(e,t){return!this.find(function(n,r,i){return!e.call(t,n,r,i)})},everyProperty:function(e,t){return this.every(u.apply(this,arguments))},some:function(e,t){return!!this.find(function(n,r,i){return!!e.call(t,n,r,i)})},someProperty:function(e,t){return this.some(u.apply(this,arguments))},reduce:function(e,t,n){if(typeof e!="function")throw new TypeError;var r=t;return this.forEach(function(t,i){r=e.call(null,r,t,i,this,n)},this),r},invoke:function(e){var t,r=Ember.A([]);return arguments.length>1&&(t=n.call(arguments,1)),this.forEach(function(n,i){var s=n&&n[e];"function"==typeof s&&(r[i]=t?s.apply(n,t):s.call(n))},this),r},toArray:function(){var e=Ember.A([]);return this.forEach(function(t,n){e[n]=t}),e},compact:function(){return this.without(null)},without:function(e){if(!this.contains(e))return this;var t=Ember.A([]);return this.forEach(function(n){n!==e&&(t[t.length]=n)}),t},uniq:function(){var e=Ember.A([]);return this.forEach(function(t){r(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(e,t){return this}),addEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",t,r),Ember.addListener(this,"@enumerable:change",t,i),s||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(t,n){var r=n&&n.willChange||"enumerableWillChange",i=n&&n.didChange||"enumerableDidChange",s=e(this,"hasEnumerableObservers");return s&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",t,r),Ember.removeListener(this,"@enumerable:change",t,i),s&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(t,n){var r,i,s;return"number"==typeof t?r=t:t?r=e(t,"length"):r=t=-1,"number"==typeof n?i=n:n?i=e(n,"length"):i=n=-1,s=i<0||r<0||i-r!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.propertyWillChange(this,"[]"),s&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,t,n]),this},enumerableContentDidChange:function(t,n){var r,i,s;return"number"==typeof t?r=t:t?r=e(t,"length"):r=t=-1,"number"==typeof n?i=n:n?i=e(n,"length"):i=n=-1,s=i<0||r<0||i-r!==0,t===-1&&(t=null),n===-1&&(n=null),Ember.sendEvent(this,"@enumerable:change",[this,t,n]),s&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function i(e){return e===null||e===undefined}var e=Ember.get,t=Ember.set,n=Ember.EnumerableUtils.map,r=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(t){return t<0||t>=e(this,"length")?undefined:e(this,t)},objectsAt:function(e){var t=this;return n(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(t,n){return n!==undefined&&this.replace(0,e(this,"length"),n),this}),firstObject:Ember.computed(function(){return this.objectAt(0)}),lastObject:Ember.computed(function(){return this.objectAt(e(this,"length")-1)}),contains:function(e){return this.indexOf(e)>=0},slice:function(t,n){var r=Ember.A([]),s=e(this,"length");i(t)&&(t=0);if(i(n)||n>s)n=s;t<0&&(t=s+t),n<0&&(n=s+n);while(t<n)r[r.length]=this.objectAt(t++);return r},indexOf:function(t,n){var r,i=e(this,"length");n===undefined&&(n=0),n<0&&(n+=i);for(r=n;r<i;r++)if(this.objectAt(r,!0)===t)return r;return-1},lastIndexOf:function(t,n){var r,i=e(this,"length");if(n===undefined||n>=i)n=i-1;n<0&&(n+=i);for(r=n;r>=0;r--)if(this.objectAt(r)===t)return r;return-1},addArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,r),Ember.addListener(this,"@array:change",t,i),s||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,n){var r=n&&n.willChange||"arrayWillChange",i=n&&n.didChange||"arrayDidChange",s=e(this,"hasArrayObservers");return s&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,r),Ember.removeListener(this,"@array:change",t,i),s&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(t,n,r){t===undefined?(t=0,n=r=-1):(n===undefined&&(n=-1),r===undefined&&(r=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,n,r]);var i,s;if(t>=0&&n>=0&&e(this,"hasEnumerableObservers")){i=[],s=t+n;for(var o=t;o<s;o++)i.push(this.objectAt(o))}else i=n;return this.enumerableContentWillChange(i,r),this},arrayContentDidChange:function(t,n,i){t===undefined?(t=0,n=i=-1):(n===undefined&&(n=-1),i===undefined&&(i=-1));var s,o;if(t>=0&&i>=0&&e(this,"hasEnumerableObservers")){s=[],o=t+i;for(var u=t;u<o;u++)s.push(this.objectAt(u))}else s=i;this.enumerableContentDidChange(n,s),Ember.sendEvent(this,"@array:change",[this,t,n,i]);var a=e(this,"length"),f=r(this,"firstObject"),l=r(this,"lastObject");return this.objectAt(0)!==f&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(a-1)!==l&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each})})}(),function(){Ember.Comparable=Ember.Mixin.create({isComparable:!0,compare:Ember.required(Function)})}(),function(){var e=Ember.get,t=Ember.set;Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return e(this,"isFrozen")?this:this.copy().freeze();throw new Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return e(this,"isFrozen")?this:(t(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var e=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.addObject(e)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.removeObject(e)},this),Ember.endPropertyChanges(this),this}})}(),function(){var e="Index out of range",t=[],n=Ember.get,r=Ember.set;Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=n(this,"length");return e===0?this:(this.replace(0,e,t),this)},insertAt:function(t,r){if(t>n(this,"length"))throw new Error(e);return this.replace(t,0,[r]),this},removeAt:function(r,i){if("number"==typeof r){if(r<0||r>=n(this,"length"))throw new Error(e);i===undefined&&(i=1),this.replace(r,i,t)}return this},pushObject:function(e){return this.insertAt(n(this,"length"),e),e},pushObjects:function(e){return this.replace(n(this,"length"),0,e),this},popObject:function(){var e=n(this,"length");if(e===0)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(n(this,"length")===0)return null;var e=this.objectAt(0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=n(this,"length");if(e===0)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(e.length===0)return this.clear();var t=n(this,"length");return this.replace(0,t,e),this},removeObject:function(e){var t=n(this,"length")||0;while(--t>=0){var r=this.objectAt(t);r===e&&this.removeAt(t)}return this},addObject:function(e){return this.contains(e)||this.pushObject(e),this}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){var t={},n=arguments;arguments.length===1&&Ember.typeOf(arguments[0])==="array"&&(n=arguments[0]);for(var r=0;r<n.length;r++)t[n[r]]=e(this,n[r]);return t},set:function(e,n){return t(this,e,n),this},setProperties:function(e){return Ember.setProperties(this,e)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(e){return Ember.propertyWillChange(this,e),this},propertyDidChange:function(e){return Ember.propertyDidChange(this,e),this},notifyPropertyChange:function(e){return this.propertyWillChange(e),this.propertyDidChange(e),this},addBeforeObserver:function(e,t,n){Ember.addBeforeObserver(this,e,t,n)},addObserver:function(e,t,n){Ember.addObserver(this,e,t,n)},removeObserver:function(e,t,n){Ember.removeObserver(this,e,t,n)},hasObserverFor:function(e){return Ember.hasListeners(this,e+":change")},getPath:function(e){return this.get(e)},setPath:function(e,t){return this.set(e,t)},getWithDefault:function(e,t){return Ember.getWithDefault(this,e,t)},incrementProperty:function(n,r){return r||(r=1),t(this,n,(e(this,n)||0)+r),e(this,n)},decrementProperty:function(n,r){return r||(r=1),t(this,n,(e(this,n)||0)-r),e(this,n)},toggleProperty:function(n){return t(this,n,!e(this,n)),e(this,n)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){var e=Ember.get,t=Ember.set;Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,targetObject:Ember.computed(function(){var t=e(this,"target");if(Ember.typeOf(t)==="string"){var n=e(this,t);return n===undefined&&(n=e(Ember.lookup,t)),n}return t}).property("target"),triggerAction:function(){var t=e(this,"action"),n=e(this,"targetObject");if(n&&t){var r;return typeof n.send=="function"?r=n.send(t,this):(typeof t=="string"&&(t=n[t]),r=t.call(n,this)),r!==!1&&(r=!0),r}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,n){return Ember.addListener(this,e,t,n),this},one:function(e,t,n){return n||(n=t,t=null),Ember.addListener(this,e,t,n,!0),this},trigger:function(e){var t=[],n,r;for(n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);Ember.sendEvent(this,e,t)},fire:function(e){this.trigger.apply(this,arguments)},off:function(e,t,n){return Ember.removeListener(this,e,t,n),this},has:function(e){return Ember.hasListeners(this,e)}})}(),function(){var e=t("rsvp");e.async=function(e,t){Ember.run.schedule("actions",t,e)};var n=Ember.get;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t){var r=n(this,"promise");return r.then.apply(r,arguments)},resolve:function(e){n(this,"promise").resolve(e)},reject:function(e){n(this,"promise").reject(e)},promise:Ember.computed(function(){return new e.Promise})})}(),function(){}(),function(){Ember.Container=t("container"),Ember.Container.set=Ember.set}(),function(){function b(){var e=!1,t,s,o=function(){e||o.proto(),r(this,i,y),r(this,"_super",y);var a=u(this);a.proto=this;if(t){var l=t;t=null,this.reopen.apply(this
|
17
|
+
,l)}if(s){var c=s;s=null;var h=this.concatenatedProperties;for(var p=0,v=c.length;p<v;p++){var b=c[p];for(var w in b){if(!b.hasOwnProperty(w))continue;var E=b[w],S=Ember.IS_BINDING;if(S.test(w)){var x=a.bindings;x?a.hasOwnProperty("bindings")||(x=a.bindings=n(a.bindings)):x=a.bindings={},x[w]=E}var T=a.descs[w];if(h&&g(h,w)>=0){var N=this[w];N?"function"==typeof N.concat?E=N.concat(E):E=Ember.makeArray(N).concat(E):E=Ember.makeArray(E)}T?T.set(this,w,E):typeof this.setUnknownProperty!="function"||w in this?m?Ember.defineProperty(this,w,null,E):this[w]=E:this.setUnknownProperty(w,E)}}}d(this,a),delete a.proto,f(this),this.init.apply(this,arguments)};return o.toString=h.prototype.toString,o.willReopen=function(){e&&(o.PrototypeMixin=h.create(o.PrototypeMixin)),e=!1},o._initMixins=function(e){t=e},o._initProperties=function(e){s=e},o.proto=function(){var t=o.superclass;return t&&t.proto(),e||(e=!0,o.PrototypeMixin.applyPartial(o.prototype),a(o.prototype)),this.prototype},o}function E(e){return function(){return e}}var e=Ember.set,t=Ember.get,n=Ember.create,r=Ember.platform.defineProperty,i=Ember.GUID_KEY,s=Ember.guidFor,o=Ember.generateGuid,u=Ember.meta,a=Ember.rewatch,f=Ember.finishChains,l=Ember.destroy,c=Ember.run.schedule,h=Ember.Mixin,p=h._apply,d=h.finishPartial,v=h.prototype.reopen,m=Ember.ENV.MANDATORY_SETTER,g=Ember.EnumerableUtils.indexOf,y={configurable:!0,writable:!0,enumerable:!1,value:undefined},w=b();w.toString=function(){return"Ember.CoreObject"},w.PrototypeMixin=h.create({reopen:function(){return p(this,arguments,!0),this},isInstance:!0,init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){if(this._didCallDestroy)return;return this.isDestroying=!0,this._didCallDestroy=!0,this.willDestroy&&this.willDestroy(),c("destroy",this,this._scheduledDestroy),this},_scheduledDestroy:function(){l(this),e(this,"isDestroyed",!0),this.didDestroy&&this.didDestroy()},bind:function(e,t){return t instanceof Ember.Binding||(t=Ember.Binding.from(t)),t.to(e).connect(this),t},toString:function x(){var e=typeof this.toStringExtension=="function",t=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+s(this)+t+">";return this.toString=E(n),n}}),w.PrototypeMixin.ownerConstructor=w,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(w.PrototypeMixin),w.__super__=null;var S=h.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var e=b(),t;return e.ClassMixin=h.create(this.ClassMixin),e.PrototypeMixin=h.create(this.PrototypeMixin),e.ClassMixin.ownerConstructor=e,e.PrototypeMixin.ownerConstructor=e,v.apply(e.PrototypeMixin,arguments),e.superclass=this,e.__super__=this.prototype,t=e.prototype=n(this.prototype),t.constructor=e,o(t,"ember"),u(t).proto=t,e.ClassMixin.apply(e),e},createWithMixins:function(){var e=this;return arguments.length>0&&this._initMixins(arguments),new e},create:function(){var e=this;return arguments.length>0&&this._initProperties(arguments),new e},reopen:function(){return this.willReopen(),v.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return v.apply(this.ClassMixin,arguments),p(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;while(e){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=u(this.proto(),!1).descs[e];return t._meta||{}},eachComputedProperty:function(e,t){var n=this.proto(),r=u(n).descs,i={},s;for(var o in r)s=r[o],s instanceof Ember.ComputedProperty&&e.call(t||this,o,s._meta||i)}});S.ownerConstructor=w,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(S),w.ClassMixin=S,S.apply(w),Ember.CoreObject=w}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function o(e,t,n){var u=e.length;r[e.join(".")]=t;for(var f in t){if(!i.call(t,f))continue;var c=t[f];e[u]=f;if(c&&c.toString===l)c.toString=h(e.join(".")),c[a]=e.join(".");else if(c&&c.isNamespace){if(n[s(c)])continue;n[s(c)]=!0,o(e,c,n)}}e.length=u}function u(){var e=Ember.Namespace,t=Ember.lookup,n,r;if(e.PROCESSED)return;for(var i in t){if(i==="parent"||i==="top"||i==="frameElement")continue;if(i==="globalStorage"&&t.StorageList&&t.globalStorage instanceof t.StorageList)continue;if(t.hasOwnProperty&&!t.hasOwnProperty(i))continue;try{n=Ember.lookup[i],r=n&&n.isNamespace}catch(s){continue}r&&(n[a]=i)}}function f(e){var t=e.superclass;if(t)return t[a]?t[a]:f(t);return}function l(){!Ember.BOOTED&&!this[a]&&c();var e;if(this[a])e=this[a];else{var t=f(this);t?e="(subclass of "+t+")":e="(unknown mixin)",this.toString=h(e)}return e}function c(){var e=!n.PROCESSED,t=Ember.anyUnprocessedMixins;e&&(u(),n.PROCESSED=!0);if(e||t){var r=n.NAMESPACES,i;for(var s=0,a=r.length;s<a;s++)i=r[s],o([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function h(e){return function(){return e}}var e=Ember.get,t=Ember.ArrayPolyfills.indexOf,n=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var t=e(this,"name");return t?t:(u(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){o([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=undefined,e.splice(t.call(e,this),1),this._super()}});n.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:c,byName:function(e){return Ember.BOOTED||c(),r[e]}});var r=n.NAMESPACES_BY_ID,i={}.hasOwnProperty,s=Ember.guidFor,a=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=l}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var e="Index out of range",t=[],n=Ember.get,r=Ember.set;Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(e){return n(this,"arrangedContent").objectAt(e)},replaceContent:function(e,t,r){n(this,"content").replace(e,t,r)},_contentWillChange:Ember.beforeObserver(function(){this._teardownContent()},"content"),_teardownContent:function(){var e=n(this,"content");e&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){var e=n(this,"content");this._setupContent()},"content"),_setupContent:function(){var e=n(this,"content");e&&e.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver(function(){var e=n(this,"arrangedContent"),t=e?n(e,"length"):0;this.arrangedContentArrayWillChange(this,0,t,undefined),this.arrangedContentWillChange(this),this._teardownArrangedContent(e)},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var e=n(this,"arrangedContent"),t=e?n(e,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,undefined,t)},"arrangedContent"),_setupArrangedContent:function(){var e=n(this,"arrangedContent");e&&e.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var e=n(this,"arrangedContent");e&&e.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(e){return n(this,"content")&&this.objectAtContent(e)},length:Ember.computed(function(){var e=n(this,"arrangedContent");return e?n(e,"length"):0}),_replace:function(e,t,r){var i=n(this,"content");return i&&this.replaceContent(e,t,r),this},replace:function(){if(n(this,"arrangedContent")!==n(this,"content"))throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");this._replace.apply(this,arguments)},_insertAt:function(t,r){if(t>n(this,"content.length"))throw new Error(e);return this._replace(t,0,[r]),this},insertAt:function(e,t){if(n(this,"arrangedContent")===n(this,"content"))return this._insertAt(e,t);throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(r,i){if("number"==typeof r){var s=n(this,"content"),o=n(this,"arrangedContent"),u=[],a;if(r<0||r>=n(this,"length"))throw new Error(e);i===undefined&&(i=1);for(a=r;a<r+i;a++)u.push(s.indexOf(o.objectAt(a)));u.sort(function(e,t){return t-e}),Ember.beginPropertyChanges();for(a=0;a<u.length;a++)this._replace(u[a],1,t);Ember.endPropertyChanges()}return this},pushObject:function(e){return this._insertAt(n(this,"content.length"),e),e},pushObjects:function(e){return this._replace(n(this,"length"),0,e),this},setObjects:function(e){if(e.length===0)return this.clear();var t=n(this,"length");return this._replace(0,t,e),this},unshiftObject:function(e){return this._insertAt(0,e),e},unshiftObjects:function(e){return this._replace(0,0,e),this},slice:function(){var e=this.toArray();return e.slice.apply(e,arguments)},arrangedContentArrayWillChange:function(e,t,n,r){this.arrayContentWillChange(t,n,r)},arrangedContentArrayDidChange:function(e,t,n,r){this.arrayContentDidChange(t,n,r)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function f(e,t){var n=t.slice(8);if(n in this)return;u(this,n)}function l(e,t){var n=t.slice(8);if(n in this)return;a(this,n)}var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=Ember.addBeforeObserver,i=Ember.addObserver,s=Ember.removeBeforeObserver,o=Ember.removeObserver,u=Ember.propertyWillChange,a=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(e){var t="content."+e;r(this,t,null,f),i(this,t,null,l)},didUnwatchProperty:function(e){var t="content."+e;s(this,t,null,f),o(this,t,null,l)},unknownProperty:function(t){var n=e(this,"content");if(n)return e(n,t)},setUnknownProperty:function(n,r){var i=e(this,"content");return t(i,n,r)}}),Ember.ObjectProxy.reopenClass({create:function(){var e,t,n,r,i,s;if(arguments.length){t=this.proto();for(n=0,r=arguments.length;n<r;n++){i=arguments[n];for(s in i){if(!i.hasOwnProperty(s)||s in t)continue;e||(e={}),e[s]=null}}e&&this._initMixins([e])}return this._super.apply(this,arguments)}})}(),function(){function o(e,t,r,i,s){var o=r._objects,u;o||(o=r._objects={});while(--s>=i){var a=e.objectAt(s);a&&(Ember.addBeforeObserver(a,t,r,"contentKeyWillChange"),Ember.addObserver(a,t,r,"contentKeyDidChange"),u=n(a),o[u]||(o[u]=[]),o[u].push(s))}}function u(e,t,r,i,s){var o=r._objects;o||(o=r._objects={});var u,a;while(--s>=i){var f=e.objectAt(s);f&&(Ember.removeBeforeObserver(f,t,r,"contentKeyWillChange"),Ember.removeObserver(f,t,r,"contentKeyDidChange"),a=n(f),u=o[a],u[u.indexOf(s)]=null)}}var e=Ember.set,t=Ember.get,n=Ember.guidFor,r=Ember.EnumerableUtils.forEach,i=Ember.Object.extend(Ember.Array,{init:function(e,t,n){this._super(),this._keyName=t,this._owner=n,this._content=e},objectAt:function(e){var n=this._content.objectAt(e);return n&&t(n,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?t(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),r(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e,t){var n;return n=new i(this._content,e,this),Ember.defineProperty(this,e,null,n),this.beginObservingContentKey(e),n},arrayWillChange:function(e,t,n,r){var i=this._keys,s,o;o=n>0?t+n:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;o>0&&u(e,s,this,t,o),Ember.propertyWillChange(this,s)}Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(e,t,n,r){var i=this._keys,s,u;u=r>0?t+r:-1,Ember.beginPropertyChanges(this);for(s in i){if(!i.hasOwnProperty(s))continue;u>0&&o(e,s,this,t,u),Ember.propertyDidChange(this,s)}Ember.propertyDidChange(this._content,"@each"),Ember.endPropertyChanges(this)},didAddListener:function(e){s.test(e)&&this.beginObservingContentKey(e.slice(0,-7))},didRemoveListener:function(e){s.test(e)&&this.stopObservingContentKey(e.slice(0,-7))},beginObservingContentKey:function(e){var n=this._keys;n||(n=this._keys={});if(!n[e]){n[e]=1;var r=this._content,i=t(r,"length");o(r,e,this,0,i)}else n[e]++},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var r=this._content,i=t(r,"length");u(r,e,this,0,i)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return e==="length"?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(t,n,r){if(this.isFrozen)throw Ember.FROZEN_ERROR;var i=r?e(r,"length"):0;this.arrayContentWillChange(t,n,i);if(!r||r.length===0)this.splice(t,n);else{var s=[t,n].concat(r);this.splice.apply(this,s)}return this.arrayContentDidChange(t,n,i),this},unknownProperty:function(e,t){var n;return t!==undefined&&n===undefined&&(n=this[e]=t),n},indexOf:function(e,t){var n,r=this.length;t===undefined?t=0:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n<r;n++)if(this[n]===e)return n;return-1},lastIndexOf:function(e,t){var n,r=this.length;t===undefined?t=r-1:t=t<0?Math.ceil(t):Math.floor(t),t<0&&(t+=r);for(n=t;n>=0;n--)if(this[n]===e)return n;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),r=["length"];Ember.EnumerableUtils.forEach(n.keys(),function(e){Array.prototype[e]&&r.push(e)}),r.length>0&&(n=n.without.apply(n,r)),Ember.NativeArray=n,Ember.A=function(e){return e===undefined&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){n.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.get,t=Ember.set,n=Ember.guidFor,r=Ember.isNone,i=Ember.String.fmt;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Error(Ember.FROZEN_ERROR);var r=e(this,"length");if(r===0)return this;var i;this.enumerableContentWillChange(r,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var s=0;s<r;s++)i=n(this[s]),delete this[i],delete this[s];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(r,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var n=e(this,"length");if(e(t,"length")!==n)return!1;while(--n>=0)if(!t.contains(this[n]))return!1;return!0},add:Ember.aliasMethod("addObject"),remove:Ember.aliasMethod("removeObject"),pop:function(){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);var t=this.length>0?this[this.length-1]:null;return this.remove(t),t},push:Ember.aliasMethod("addObject"),shift:Ember.aliasMethod("pop"),unshift:Ember.aliasMethod("push"),addEach:Ember.aliasMethod("addObjects"),removeEach:Ember.aliasMethod("removeObjects"),init:function(e){this._super(),e&&this.addObjects(e)},nextObject:function(e){return this[e]},firstObject:Ember.computed(function(){return this.length>0?this[0]:undefined}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:undefined}),addObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a;return o>=0&&o<u&&this[o]===i?this:(a=[i],this.enumerableContentWillChange(null,a),Ember.propertyWillChange(this,"lastObject"),u=e(this,"length"),this[s]=u,this[u]=i,t(this,"length",u+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,a),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(r(i))return this;var s=n(i),o=this[s],u=e(this,"length"),a=o===0,f=o===u-1,l,c;return o>=0&&o<u&&this[o]===i&&(c=[i],this.enumerableContentWillChange(c,null),a&&Ember.propertyWillChange(this,"firstObject"),f&&Ember.propertyWillChange(this,"lastObject"),o<u-1&&(l=this[u-1],this[o]=l,this[n(l)]=o),delete this[s],delete this[u-1],t(this,"length",u-1),a&&Ember.propertyDidChange(this,"firstObject"),f&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(c,null)),this},contains:function(e){return this[n(e)]>=0},copy:function(){var r=this.constructor,i=new r,s=e(this,"length");t(i,"length",s);while(--s>=0)i[s]=this[s],i[n(this[s])]=s;return i},toString:function(){var e=this.length,t,n=[];for(t=0;t<e;t++)n[t]=this[t];return i("Ember.Set<%@>",[n.join(",")])}})}(),function(){var e=Ember.DeferredMixin,t=Ember.get,n=Ember.Object.extend(e);n.reopenClass({promise:function(e,r){var i=n.create();return e.call(r,i),t(i,"promise")}}),Ember.Deferred=n}(),function(){var e=Ember.ENV.EMBER_LOAD_HOOKS||{},t={};Ember.onLoad=function(n,r){var i;e[n]=e[n]||Ember.A(),e[n].pushObject(r),(i=t[n])&&r(i)},Ember.runLoadHooks=function(n,r){var i;t[n]=r,(i=e[n])&&e[n].forEach(function(e){e(r)})}}(),function(){}(),function(){var e=Ember.get;Ember.ControllerMixin=Ember.Mixin.create({isController:!0,target:null,container:null,store:null,model:Ember.computed.alias("content"),send:function(t){var n=[].slice.call(arguments,1),r;this[t]?this[t].apply(this,n):(r=e(this,"target"))&&r.send.apply(r,arguments)}}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=Ember.set,n=Ember.EnumerableUtils.forEach;Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,orderBy:function(t,r){var i=0,s=e(this,"sortProperties"),o=e(this,"sortAscending");return n(s,function(n){i===0&&(i=Ember.compare(e(t,n),e(r,n)),i!==0&&!o&&(i=-1*i))}),i},destroy:function(){var t=e(this,"content"),r=e(this,"sortProperties");return t&&r&&n(t,function(e){n(r,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(t,r){var i=e(this,"content"),s=e(this,"isSorted"),o=e(this,"sortProperties"),u=this;return i&&s?(i=i.slice(),i.sort(function(e,t){return u.orderBy(e,t)}),n(i,function(e){n(o,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(i)):i}),_contentWillChange:Ember.beforeObserver(function(){var t=e(this,"content"),r=e(this,"sortProperties");t&&r&&n(t,function(e){n(r,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},"content"),sortAscendingWillChange:Ember.beforeObserver(function(){this._lastSortAscending=e(this,"sortAscending")},"sortAscending"),sortAscendingDidChange:Ember.observer(function(){if(e(this,"sortAscending")!==this._lastSortAscending){var t=e(this,"arrangedContent");t.reverseObjects()}},"sortAscending"),contentArrayWillChange:function(t,r,i,s){var o=e(this,"isSorted");if(o){var u=e(this,"arrangedContent"),a=t.slice(r,r+i),f=e(this,"sortProperties");n(a,function(e){u.removeObject(e),n(f,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},contentArrayDidChange:function(t,r,i,s){var o=e(this,"isSorted"),u=e(this,"sortProperties");if(o){var a=t.slice(r,r+s);n(a,function(e){this.insertItemSorted(e),n(u,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(t,r,i,s)},insertItemSorted:function(t){var n=e(this,"arrangedContent"),r=e(n,"length"),i=this._binarySearch(t,0,r);n.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var n=e(this,"arrangedContent"),r=n.indexOf(t),i=n.objectAt(r-1),s=n.objectAt(r+1),o=i&&this.orderBy(t,i),u=s&&this.orderBy(t,s);if(o<0||u>0)n.removeObject(t),this.insertItemSorted(t)},_binarySearch:function(t,n,r){var i,s,o,u;return n===r?n:(u=e(this,"arrangedContent"),i=n+Math.floor((r-n)/2),s=u.objectAt(i),o=this.orderBy(s,t),o<0?this._binarySearch(t,i+1,r):o>0?this._binarySearch(t,n,i):i)}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.EnumerableUtils.forEach,r=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(t){return e(this,"itemController")},objectAtContent:function(t){var n=e(this,"length"),r=e(this,"arrangedContent"),i=r&&r.objectAt(t);if(t>=0&&t<n){var s=this.lookupItemController(i);if(s)return this.controllerAt(t,i,s)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(t,i,s){var o=e(this,"_subControllers"),u=o.slice(t,t+i);n(u,function(e){e&&e.destroy()}),r(o,t,i,new Array(s)),this._super(t,i,s)},init:function(){this._super(),this.get("content")||Ember.defineProperty(this,"content",undefined,Ember.A()),this.set("_subControllers",Ember.A())},controllerAt:function(t,n,r){var i=e(this,"container"),s=e(this,"_subControllers"),o=s[t];o||(o=i.lookup("controller:"+r,{singleton:!1}),s[t]=o);if(!o)throw new Error('Could not resolve itemController: "'+r+'"');return o.set("target",this),o.set("content",n),o},_subControllers:null,_resetSubControllers:function(){var t=e(this,"_subControllers");n(t,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){}(),function(){}(),function(){var e=Ember.get,t=Ember.set;Ember.State=Ember.Object.extend(Ember.Evented,{isState:!0,parentState:null,start:null,name:null,path:Ember.computed(function(){var t=e(this,"parentState.path"),n=e(this,"name");return t&&(n=t+"."+n),n}),trigger:function(e){this[e]&&this[e].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var n=e(this,"states");t(this,"childStates",Ember.A()),t(this,"eventTransitions",e(this,"eventTransitions")||{});var r,i,s;if(!n){n={};for(r in this){if(r==="constructor")continue;if(i=this[r]){if(s=i.transitionTarget)this.eventTransitions[r]=s;this.setupChild(n,r,i)}}t(this,"states",n)}else for(r in n)this.setupChild(n,r,n[r]);t(this,"pathsCache",{}),t(this,"pathsCacheNoContext",{})},setupChild:function(n,r,i){if(!i)return!1;i.isState?t(i,"name",r):Ember.State.detect(i)&&(i=i.create({name:r}));if(i.isState)return t(i,"parentState",this),e(this,"childStates").pushObject(i),n[r]=i,i},lookupEventTransition:function(e){var t,n=this;while(n&&!t)t=n.eventTransitions[e],n=n.get("parentState");return t},isLeaf:Ember.computed(function(){return!e(this,"childStates").length}),hasContext:!0,setup:Ember.K,enter:Ember.K,exit:Ember.K}),Ember.State.reopenClass({transitionTo:function(e){var t=function(t,n){var r=[],i=Ember.$&&Ember.$.Event;n&&i&&n instanceof i?n.hasOwnProperty("contexts")&&(r=n.contexts.slice()):r=[].slice.call(arguments,1),r.unshift(e),t.transitionTo.apply(t,r)};return t.transitionTarget=e,t}})}(),function(){var e=Ember.get,t=Ember.set,n=Ember.String.fmt,r=Ember.ArrayPolyfills.forEach,i=function(e){this.enterStates=e.enterStates.slice(),this.exitStates=e.exitStates.slice(),this.resolveState=e.resolveState,this.finalState=e.enterStates[e.enterStates.length-1]||e.resolveState};i.prototype={normalize:function(e,t){return this.matchContextsToStates(t),this.addInitialStates(),this.removeUnchangedContexts(e),this},matchContextsToStates:function(t){var n=this.enterStates.length-1,r=[],i,s;while(t.length>0){if(n>=0)i=this.enterStates[n--];else{if(this.enterStates.length){i=e(this.enterStates[0],"parentState");if(!i)throw"Cannot match all contexts to states"}else i=this.resolveState;this.enterStates.unshift(i),this.exitStates.unshift(i)}e(i,"hasContext")?s=t.pop():s=null,r.unshift(s)}this.contexts=r},addInitialStates:function(){var t=this.finalState,n;for(;;){n=e(t,"initialState")||"start",t=e(t,"states."+n);if(!t)break;this.finalState=t,this.enterStates.push(t),this.contexts.push(undefined)}},removeUnchangedContexts:function(e){while(this.enterStates.length>0){if(this.enterStates[0]!==this.exitStates[0])break;if(this.enterStates.length===this.contexts.length){if(e.getStateMeta(this.enterStates[0],"context")!==this.contexts[0])break;this.contexts.shift()}this.resolveState=this.enterStates.shift(),this.exitStates.shift()}}};var s=function(t,r,i){var u=this.enableLogging,a=i?"unhandledEvent":t,f=r[a],l,c,h;l=[].slice.call(arguments,3);if(typeof f=="function")return u&&(i?Ember.Logger.log(n("STATEMANAGER: Unhandled event '%@' being sent to state %@.",[t,e(r,"path")])):Ember.Logger.log(n("STATEMANAGER: Sending event '%@' to state %@.",[t,e(r,"path")]))),h=l,i&&h.unshift(t),h.unshift(this),f.apply(r,h);var p=e(r,"parentState");if(p)return c=l,c.unshift(t,p,i),s.apply(this,c);if(!i)return o.call(this,t,l,!0)},o=function(t,n,r){return n.unshift(t,e(this,"currentState"),r),s.apply(this,n)};Ember.StateManager=Ember.State.extend({init:function(){this._super(),t(this,"stateMeta",Ember.Map.create());var n=e(this,"initialState");!n&&e(this,"states.start")&&(n="start"),n&&this.transitionTo(n)},stateMetaFor:function(t){var n=e(this,"stateMeta"),r=n.get(t);return r||(r={},n.set(t,r)),r},setStateMeta:function(e,n,r){return t(this.stateMetaFor(e),n,r)},getStateMeta:function(t,n){return e(this.stateMetaFor(t),n)},currentState:null,currentPath:Ember.computed.alias("currentState.path"),transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(e){var t=[].slice.call(arguments,1);return o.call(this,e,t,!1)},unhandledEvent:function(t,n){if(e(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+n+" in state "+e(this,"currentState.path")+".")},getStateByPath:function(t,n){var r=n.split("."),i=t;for(var s=0,o=r.length;s<o;s++){i=e(e(i,"states"),r[s]);if(!i)break}return i},findStateByPath:function(t,n){var r;while(!r&&t)r=this.getStateByPath(t,n),t=e(t,"parentState");return r},getStatesInPath:function(t,n){if(!n||n==="")return undefined;var r=n.split("."),i=[],s,o;for(var u=0,a=r.length;u<a;u++){s=e(t,"states");if(!s)return undefined;o=e(s,r[u]);if(!o)return undefined;t=o,i.push(o)}return i},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(t,n){if(Ember.isEmpty(t))return;var r=n?Array.prototype.slice.call(arguments,1):[],s=e(this,"currentState")||this,o=this.contextFreeTransition(s,t),u=(new i(o)).normalize(this,r);this.enterState(u),this.triggerSetupContext(u)},contextFreeTransition:function(t,n){var r=t.pathsCache[n];if(r)return r;var i=this.getStatesInPath(t,n),s=[],o=t;while(o&&!i){s.unshift(o),o=e(o,"parentState");if(!o){i=this.getStatesInPath(this,n);if(!i)return}i=this.getStatesInPath(o,n)}while(i.length>0&&i[0]===s[0])o=i.shift(),s.shift();var u=t.pathsCache[n]={exitStates:s,enterStates:i,resolveState:o};return u},triggerSetupContext:function(t){var n=t.contexts,i=t.enterStates.length-n.length,s=t.enterStates,o=e(this,"transitionEvent");r.call(s,function(e,t){e.trigger(o,this,n[t-i])},this)},getState:function(t){var n=e(this,t),r=e(this,"parentState");if(n)return n;if(r)return r.getState(t)},enterState:function(n){var i=this.enableLogging,s=n.exitStates.slice(0).reverse();r.call(s,function(e){e.trigger("exit",this)},this),r.call(n.enterStates,function(t){i&&Ember.Logger.log("STATEMANAGER: Entering "+e(t,"path")),t.trigger("enter",this)},this),t(this,"currentState",n.finalState)}})}(),function(){}()})(),typeof location!="undefined"&&(location.hostname==="localhost"||location.hostname==="127.0.0.1")&&console.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website.");
|
@@ -262,6 +262,58 @@ Ember.merge = function(original, updates) {
|
|
262
262
|
}
|
263
263
|
};
|
264
264
|
|
265
|
+
/**
|
266
|
+
Returns true if the passed value is null or undefined. This avoids errors
|
267
|
+
from JSLint complaining about use of ==, which can be technically
|
268
|
+
confusing.
|
269
|
+
|
270
|
+
```javascript
|
271
|
+
Ember.isNone(); // true
|
272
|
+
Ember.isNone(null); // true
|
273
|
+
Ember.isNone(undefined); // true
|
274
|
+
Ember.isNone(''); // false
|
275
|
+
Ember.isNone([]); // false
|
276
|
+
Ember.isNone(function(){}); // false
|
277
|
+
```
|
278
|
+
|
279
|
+
@method isNone
|
280
|
+
@for Ember
|
281
|
+
@param {Object} obj Value to test
|
282
|
+
@return {Boolean}
|
283
|
+
*/
|
284
|
+
Ember.isNone = function(obj) {
|
285
|
+
return obj === null || obj === undefined;
|
286
|
+
};
|
287
|
+
Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.", Ember.isNone);
|
288
|
+
|
289
|
+
/**
|
290
|
+
Verifies that a value is `null` or an empty string, empty array,
|
291
|
+
or empty function.
|
292
|
+
|
293
|
+
Constrains the rules on `Ember.isNone` by returning false for empty
|
294
|
+
string and empty arrays.
|
295
|
+
|
296
|
+
```javascript
|
297
|
+
Ember.isEmpty(); // true
|
298
|
+
Ember.isEmpty(null); // true
|
299
|
+
Ember.isEmpty(undefined); // true
|
300
|
+
Ember.isEmpty(''); // true
|
301
|
+
Ember.isEmpty([]); // true
|
302
|
+
Ember.isEmpty('Adam Hawkins'); // false
|
303
|
+
Ember.isEmpty([0,1,2]); // false
|
304
|
+
```
|
305
|
+
|
306
|
+
@method isEmpty
|
307
|
+
@for Ember
|
308
|
+
@param {Object} obj Value to test
|
309
|
+
@return {Boolean}
|
310
|
+
*/
|
311
|
+
Ember.isEmpty = function(obj) {
|
312
|
+
return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
|
313
|
+
};
|
314
|
+
Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty) ;
|
315
|
+
|
316
|
+
|
265
317
|
})();
|
266
318
|
|
267
319
|
|
@@ -1605,7 +1657,7 @@ var MapWithDefault = Ember.MapWithDefault = function(options) {
|
|
1605
1657
|
@static
|
1606
1658
|
@param [options]
|
1607
1659
|
@param {anything} [options.defaultValue]
|
1608
|
-
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
|
1660
|
+
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
|
1609
1661
|
`Ember.MapWithDefault` otherwise returns `Ember.Map`
|
1610
1662
|
*/
|
1611
1663
|
MapWithDefault.create = function(options) {
|
@@ -1668,7 +1720,7 @@ var FIRST_KEY = /^([^\.\*]+)/;
|
|
1668
1720
|
// ..........................................................
|
1669
1721
|
// GET AND SET
|
1670
1722
|
//
|
1671
|
-
// If we are on a platform that supports accessors we can
|
1723
|
+
// If we are on a platform that supports accessors we can use those.
|
1672
1724
|
// Otherwise simulate accessors by looking up the property directly on the
|
1673
1725
|
// object.
|
1674
1726
|
|
@@ -1679,7 +1731,7 @@ var FIRST_KEY = /^([^\.\*]+)/;
|
|
1679
1731
|
|
1680
1732
|
If you plan to run on IE8 and older browsers then you should use this
|
1681
1733
|
method anytime you want to retrieve a property on an object that you don't
|
1682
|
-
know for sure is private. (Properties beginning with an underscore '_'
|
1734
|
+
know for sure is private. (Properties beginning with an underscore '_'
|
1683
1735
|
are considered private.)
|
1684
1736
|
|
1685
1737
|
On all newer browsers, you only need to use this method to retrieve
|
@@ -1740,7 +1792,7 @@ get = function get(obj, keyName) {
|
|
1740
1792
|
|
1741
1793
|
If you plan to run on IE8 and older browsers then you should use this
|
1742
1794
|
method anytime you want to set a property on an object that you don't
|
1743
|
-
know for sure is private. (Properties beginning with an underscore '_'
|
1795
|
+
know for sure is private. (Properties beginning with an underscore '_'
|
1744
1796
|
are considered private.)
|
1745
1797
|
|
1746
1798
|
On all newer browsers, you only need to use this method to set
|
@@ -1970,11 +2022,8 @@ Ember.isGlobalPath = function(path) {
|
|
1970
2022
|
@module ember-metal
|
1971
2023
|
*/
|
1972
2024
|
|
1973
|
-
var
|
1974
|
-
META_KEY = Ember.META_KEY,
|
1975
|
-
EMPTY_META = Ember.EMPTY_META,
|
2025
|
+
var META_KEY = Ember.META_KEY,
|
1976
2026
|
metaFor = Ember.meta,
|
1977
|
-
o_create = Ember.create,
|
1978
2027
|
objectDefineProperty = Ember.platform.defineProperty;
|
1979
2028
|
|
1980
2029
|
var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
|
@@ -2394,7 +2443,6 @@ var guidFor = Ember.guidFor, // utils.js
|
|
2394
2443
|
META_KEY = Ember.META_KEY, // utils.js
|
2395
2444
|
// circular reference observer depends on Ember.watch
|
2396
2445
|
// we should move change events to this file or its own property_events.js
|
2397
|
-
notifyObservers = Ember.notifyObservers, // observer.js
|
2398
2446
|
forEach = Ember.ArrayPolyfills.forEach, // array.js
|
2399
2447
|
FIRST_KEY = /^([^\.\*]+)/,
|
2400
2448
|
IS_PATH = /[\.\*]/;
|
@@ -2933,7 +2981,7 @@ Ember.finishChains = function(obj) {
|
|
2933
2981
|
@param {String} keyName The property key (or path) that will change.
|
2934
2982
|
@return {void}
|
2935
2983
|
*/
|
2936
|
-
function propertyWillChange(obj, keyName
|
2984
|
+
function propertyWillChange(obj, keyName) {
|
2937
2985
|
var m = metaFor(obj, false),
|
2938
2986
|
watching = m.watching[keyName] > 0 || keyName === 'length',
|
2939
2987
|
proto = m.proto,
|
@@ -3040,7 +3088,6 @@ Ember.destroy = function (obj) {
|
|
3040
3088
|
var get = Ember.get,
|
3041
3089
|
set = Ember.set,
|
3042
3090
|
metaFor = Ember.meta,
|
3043
|
-
guidFor = Ember.guidFor,
|
3044
3091
|
a_slice = [].slice,
|
3045
3092
|
o_create = Ember.create,
|
3046
3093
|
META_KEY = Ember.META_KEY,
|
@@ -3076,20 +3123,8 @@ function keysForDep(obj, depsMeta, depKey) {
|
|
3076
3123
|
return keys;
|
3077
3124
|
}
|
3078
3125
|
|
3079
|
-
/* return obj[META_KEY].deps */
|
3080
3126
|
function metaForDeps(obj, meta) {
|
3081
|
-
|
3082
|
-
// If the current object has no dependencies...
|
3083
|
-
if (!deps) {
|
3084
|
-
// initialize the dependencies with a pointer back to
|
3085
|
-
// the current object
|
3086
|
-
deps = meta.deps = {};
|
3087
|
-
} else if (!meta.hasOwnProperty('deps')) {
|
3088
|
-
// otherwise if the dependencies are inherited from the
|
3089
|
-
// object's superclass, clone the deps
|
3090
|
-
deps = meta.deps = o_create(deps);
|
3091
|
-
}
|
3092
|
-
return deps;
|
3127
|
+
return keysForDep(obj, meta, 'deps');
|
3093
3128
|
}
|
3094
3129
|
|
3095
3130
|
function addDependentKeys(desc, obj, keyName, meta) {
|
@@ -3142,8 +3177,10 @@ function removeDependentKeys(desc, obj, keyName, meta) {
|
|
3142
3177
|
*/
|
3143
3178
|
function ComputedProperty(func, opts) {
|
3144
3179
|
this.func = func;
|
3180
|
+
|
3145
3181
|
this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;
|
3146
3182
|
this._dependentKeys = opts && opts.dependentKeys;
|
3183
|
+
this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly);
|
3147
3184
|
}
|
3148
3185
|
|
3149
3186
|
Ember.ComputedProperty = ComputedProperty;
|
@@ -3198,6 +3235,28 @@ ComputedPropertyPrototype.volatile = function() {
|
|
3198
3235
|
return this.cacheable(false);
|
3199
3236
|
};
|
3200
3237
|
|
3238
|
+
/**
|
3239
|
+
Call on a computed property to set it into read-only mode. When in this
|
3240
|
+
mode the computed property will throw an error when set.
|
3241
|
+
|
3242
|
+
```javascript
|
3243
|
+
MyApp.person = Ember.Object.create({
|
3244
|
+
guid: function() {
|
3245
|
+
return 'guid-guid-guid';
|
3246
|
+
}.property().readOnly()
|
3247
|
+
});
|
3248
|
+
|
3249
|
+
MyApp.person.set('guid', 'new-guid'); // will throw an exception
|
3250
|
+
```
|
3251
|
+
|
3252
|
+
@method readOnly
|
3253
|
+
@chainable
|
3254
|
+
*/
|
3255
|
+
ComputedPropertyPrototype.readOnly = function(readOnly) {
|
3256
|
+
this._readOnly = readOnly === undefined || !!readOnly;
|
3257
|
+
return this;
|
3258
|
+
};
|
3259
|
+
|
3201
3260
|
/**
|
3202
3261
|
Sets the dependent keys on this computed property. Pass any number of
|
3203
3262
|
arguments containing key paths that this computed property depends on.
|
@@ -3322,9 +3381,14 @@ ComputedPropertyPrototype.set = function(obj, keyName, value) {
|
|
3322
3381
|
cache = meta.cache,
|
3323
3382
|
cachedValue, ret;
|
3324
3383
|
|
3384
|
+
if (this._readOnly) {
|
3385
|
+
throw new Error('Cannot Set: ' + keyName + ' on: ' + obj.toString() );
|
3386
|
+
}
|
3387
|
+
|
3325
3388
|
this._suspended = obj;
|
3326
3389
|
|
3327
3390
|
try {
|
3391
|
+
|
3328
3392
|
if (cacheable && cache.hasOwnProperty(keyName)) {
|
3329
3393
|
cachedValue = cache[keyName];
|
3330
3394
|
hadCachedValue = true;
|
@@ -3415,6 +3479,10 @@ Ember.computed = function(func) {
|
|
3415
3479
|
func = a_slice.call(arguments, -1)[0];
|
3416
3480
|
}
|
3417
3481
|
|
3482
|
+
if ( typeof func !== "function" ) {
|
3483
|
+
throw new Error("Computed Property declared without a property function");
|
3484
|
+
}
|
3485
|
+
|
3418
3486
|
var cp = new ComputedProperty(func);
|
3419
3487
|
|
3420
3488
|
if (args) {
|
@@ -3455,6 +3523,18 @@ Ember.computed.not = function(dependentKey) {
|
|
3455
3523
|
});
|
3456
3524
|
};
|
3457
3525
|
|
3526
|
+
/**
|
3527
|
+
@method computed.none
|
3528
|
+
@for Ember
|
3529
|
+
@param {String} dependentKey
|
3530
|
+
*/
|
3531
|
+
Ember.computed.none = function(dependentKey) {
|
3532
|
+
return Ember.computed(dependentKey, function(key) {
|
3533
|
+
var val = get(this, dependentKey);
|
3534
|
+
return Ember.isNone(val);
|
3535
|
+
});
|
3536
|
+
};
|
3537
|
+
|
3458
3538
|
/**
|
3459
3539
|
@method computed.empty
|
3460
3540
|
@for Ember
|
@@ -3463,7 +3543,7 @@ Ember.computed.not = function(dependentKey) {
|
|
3463
3543
|
Ember.computed.empty = function(dependentKey) {
|
3464
3544
|
return Ember.computed(dependentKey, function(key) {
|
3465
3545
|
var val = get(this, dependentKey);
|
3466
|
-
return
|
3546
|
+
return Ember.isEmpty(val);
|
3467
3547
|
});
|
3468
3548
|
};
|
3469
3549
|
|
@@ -3481,15 +3561,16 @@ Ember.computed.bool = function(dependentKey) {
|
|
3481
3561
|
/**
|
3482
3562
|
@method computed.alias
|
3483
3563
|
@for Ember
|
3564
|
+
|
3484
3565
|
@param {String} dependentKey
|
3485
3566
|
*/
|
3486
3567
|
Ember.computed.alias = function(dependentKey) {
|
3487
3568
|
return Ember.computed(dependentKey, function(key, value){
|
3488
|
-
if (arguments.length
|
3489
|
-
return get(this, dependentKey);
|
3490
|
-
} else {
|
3569
|
+
if (arguments.length > 1) {
|
3491
3570
|
set(this, dependentKey, value);
|
3492
3571
|
return value;
|
3572
|
+
} else {
|
3573
|
+
return get(this, dependentKey);
|
3493
3574
|
}
|
3494
3575
|
});
|
3495
3576
|
};
|
@@ -3505,7 +3586,6 @@ Ember.computed.alias = function(dependentKey) {
|
|
3505
3586
|
|
3506
3587
|
var o_create = Ember.create,
|
3507
3588
|
metaFor = Ember.meta,
|
3508
|
-
metaPath = Ember.metaPath,
|
3509
3589
|
META_KEY = Ember.META_KEY;
|
3510
3590
|
|
3511
3591
|
/*
|
@@ -4078,7 +4158,7 @@ Ember.RunLoop = RunLoop;
|
|
4078
4158
|
|
4079
4159
|
```javascript
|
4080
4160
|
Ember.run(function(){
|
4081
|
-
// code to be execute within a RunLoop
|
4161
|
+
// code to be execute within a RunLoop
|
4082
4162
|
});
|
4083
4163
|
```
|
4084
4164
|
|
@@ -4094,8 +4174,7 @@ Ember.RunLoop = RunLoop;
|
|
4094
4174
|
@return {Object} return value from invoking the passed function.
|
4095
4175
|
*/
|
4096
4176
|
Ember.run = function(target, method) {
|
4097
|
-
var
|
4098
|
-
args = arguments;
|
4177
|
+
var args = arguments;
|
4099
4178
|
run.begin();
|
4100
4179
|
|
4101
4180
|
function tryable() {
|
@@ -4113,11 +4192,11 @@ var run = Ember.run;
|
|
4113
4192
|
/**
|
4114
4193
|
Begins a new RunLoop. Any deferred actions invoked after the begin will
|
4115
4194
|
be buffered until you invoke a matching call to `Ember.run.end()`. This is
|
4116
|
-
|
4195
|
+
a lower-level way to use a RunLoop instead of using `Ember.run()`.
|
4117
4196
|
|
4118
4197
|
```javascript
|
4119
4198
|
Ember.run.begin();
|
4120
|
-
// code to be execute within a RunLoop
|
4199
|
+
// code to be execute within a RunLoop
|
4121
4200
|
Ember.run.end();
|
4122
4201
|
```
|
4123
4202
|
|
@@ -4135,7 +4214,7 @@ Ember.run.begin = function() {
|
|
4135
4214
|
|
4136
4215
|
```javascript
|
4137
4216
|
Ember.run.begin();
|
4138
|
-
// code to be execute within a RunLoop
|
4217
|
+
// code to be execute within a RunLoop
|
4139
4218
|
Ember.run.end();
|
4140
4219
|
```
|
4141
4220
|
|
@@ -4159,9 +4238,9 @@ Ember.run.end = function() {
|
|
4159
4238
|
|
4160
4239
|
@property queues
|
4161
4240
|
@type Array
|
4162
|
-
@default ['sync', 'actions', 'destroy'
|
4241
|
+
@default ['sync', 'actions', 'destroy']
|
4163
4242
|
*/
|
4164
|
-
Ember.run.queues = ['sync', 'actions', 'destroy'
|
4243
|
+
Ember.run.queues = ['sync', 'actions', 'destroy'];
|
4165
4244
|
|
4166
4245
|
/**
|
4167
4246
|
Adds the passed target/method and any optional arguments to the named
|
@@ -4174,19 +4253,19 @@ Ember.run.queues = ['sync', 'actions', 'destroy', 'timers'];
|
|
4174
4253
|
the `run.queues` property.
|
4175
4254
|
|
4176
4255
|
```javascript
|
4177
|
-
Ember.run.schedule('timers', this, function(){
|
4178
|
-
// this will be executed at the end of the RunLoop, when timers are run
|
4179
|
-
console.log("scheduled on timers queue");
|
4180
|
-
});
|
4181
|
-
|
4182
4256
|
Ember.run.schedule('sync', this, function(){
|
4183
|
-
// this will be executed
|
4257
|
+
// this will be executed in the first RunLoop queue, when bindings are synced
|
4184
4258
|
console.log("scheduled on sync queue");
|
4185
4259
|
});
|
4186
4260
|
|
4261
|
+
Ember.run.schedule('actions', this, function(){
|
4262
|
+
// this will be executed in the 'actions' queue, after bindings have synced.
|
4263
|
+
console.log("scheduled on actions queue");
|
4264
|
+
});
|
4265
|
+
|
4187
4266
|
// Note the functions will be run in order based on the run queues order. Output would be:
|
4188
4267
|
// scheduled on sync queue
|
4189
|
-
// scheduled on
|
4268
|
+
// scheduled on actions queue
|
4190
4269
|
```
|
4191
4270
|
|
4192
4271
|
@method schedule
|
@@ -4212,7 +4291,7 @@ function autorun() {
|
|
4212
4291
|
|
4213
4292
|
// Used by global test teardown
|
4214
4293
|
Ember.run.hasScheduledTimers = function() {
|
4215
|
-
return !!(scheduledAutorun || scheduledLater
|
4294
|
+
return !!(scheduledAutorun || scheduledLater);
|
4216
4295
|
};
|
4217
4296
|
|
4218
4297
|
// Used by global test teardown
|
@@ -4225,10 +4304,6 @@ Ember.run.cancelTimers = function () {
|
|
4225
4304
|
clearTimeout(scheduledLater);
|
4226
4305
|
scheduledLater = null;
|
4227
4306
|
}
|
4228
|
-
if (scheduledNext) {
|
4229
|
-
clearTimeout(scheduledNext);
|
4230
|
-
scheduledNext = null;
|
4231
|
-
}
|
4232
4307
|
timers = {};
|
4233
4308
|
};
|
4234
4309
|
|
@@ -4263,7 +4338,8 @@ Ember.run.autorun = function() {
|
|
4263
4338
|
bindings in the application to sync.
|
4264
4339
|
|
4265
4340
|
You should call this method anytime you need any changed state to propagate
|
4266
|
-
throughout the app immediately without repainting the UI
|
4341
|
+
throughout the app immediately without repainting the UI (which happens
|
4342
|
+
in the later 'render' queue added by the `ember-views` package).
|
4267
4343
|
|
4268
4344
|
```javascript
|
4269
4345
|
Ember.run.sync();
|
@@ -4283,25 +4359,30 @@ Ember.run.sync = function() {
|
|
4283
4359
|
|
4284
4360
|
var timers = {}; // active timers...
|
4285
4361
|
|
4286
|
-
var scheduledLater;
|
4362
|
+
var scheduledLater, scheduledLaterExpires;
|
4287
4363
|
function invokeLaterTimers() {
|
4288
4364
|
scheduledLater = null;
|
4289
|
-
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4293
|
-
|
4294
|
-
if (
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
|
4365
|
+
run(function() {
|
4366
|
+
var now = (+ new Date()), earliest = -1;
|
4367
|
+
for (var key in timers) {
|
4368
|
+
if (!timers.hasOwnProperty(key)) { continue; }
|
4369
|
+
var timer = timers[key];
|
4370
|
+
if (timer && timer.expires) {
|
4371
|
+
if (now >= timer.expires) {
|
4372
|
+
delete timers[key];
|
4373
|
+
invoke(timer.target, timer.method, timer.args, 2);
|
4374
|
+
} else {
|
4375
|
+
if (earliest < 0 || (timer.expires < earliest)) { earliest = timer.expires; }
|
4376
|
+
}
|
4299
4377
|
}
|
4300
4378
|
}
|
4301
|
-
}
|
4302
4379
|
|
4303
|
-
|
4304
|
-
|
4380
|
+
// schedule next timeout to fire when the earliest timer expires
|
4381
|
+
if (earliest > 0) {
|
4382
|
+
scheduledLater = setTimeout(invokeLaterTimers, earliest - now);
|
4383
|
+
scheduledLaterExpires = earliest;
|
4384
|
+
}
|
4385
|
+
});
|
4305
4386
|
}
|
4306
4387
|
|
4307
4388
|
/**
|
@@ -4349,7 +4430,19 @@ Ember.run.later = function(target, method) {
|
|
4349
4430
|
timer = { target: target, method: method, expires: expires, args: args };
|
4350
4431
|
guid = Ember.guidFor(timer);
|
4351
4432
|
timers[guid] = timer;
|
4352
|
-
|
4433
|
+
|
4434
|
+
if(scheduledLater && expires < scheduledLaterExpires) {
|
4435
|
+
// Cancel later timer (then reschedule earlier timer below)
|
4436
|
+
clearTimeout(scheduledLater);
|
4437
|
+
scheduledLater = null;
|
4438
|
+
}
|
4439
|
+
|
4440
|
+
if (!scheduledLater) {
|
4441
|
+
// Schedule later timers to be run.
|
4442
|
+
scheduledLater = setTimeout(invokeLaterTimers, wait);
|
4443
|
+
scheduledLaterExpires = expires;
|
4444
|
+
}
|
4445
|
+
|
4353
4446
|
return guid;
|
4354
4447
|
};
|
4355
4448
|
|
@@ -4405,6 +4498,21 @@ function scheduleOnce(queue, target, method, args) {
|
|
4405
4498
|
});
|
4406
4499
|
```
|
4407
4500
|
|
4501
|
+
Also note that passing an anonymous function to `Ember.run.once` will
|
4502
|
+
not prevent additional calls with an identical anonymous function from
|
4503
|
+
scheduling the items multiple times, e.g.:
|
4504
|
+
|
4505
|
+
```javascript
|
4506
|
+
function scheduleIt() {
|
4507
|
+
Ember.run.once(myContext, function() { console.log("Closure"); });
|
4508
|
+
}
|
4509
|
+
scheduleIt();
|
4510
|
+
scheduleIt();
|
4511
|
+
// "Closure" will print twice, even though we're using `Ember.run.once`,
|
4512
|
+
// because the function we pass to it is anonymous and won't match the
|
4513
|
+
// previously scheduled operation.
|
4514
|
+
```
|
4515
|
+
|
4408
4516
|
@method once
|
4409
4517
|
@param {Object} [target] target of method to invoke
|
4410
4518
|
@param {Function|String} method The method to invoke.
|
@@ -4421,22 +4529,9 @@ Ember.run.scheduleOnce = function(queue, target, method, args) {
|
|
4421
4529
|
return scheduleOnce(queue, target, method, slice.call(arguments, 3));
|
4422
4530
|
};
|
4423
4531
|
|
4424
|
-
var scheduledNext;
|
4425
|
-
function invokeNextTimers() {
|
4426
|
-
scheduledNext = null;
|
4427
|
-
for(var key in timers) {
|
4428
|
-
if (!timers.hasOwnProperty(key)) { continue; }
|
4429
|
-
var timer = timers[key];
|
4430
|
-
if (timer.next) {
|
4431
|
-
delete timers[key];
|
4432
|
-
invoke(timer.target, timer.method, timer.args, 2);
|
4433
|
-
}
|
4434
|
-
}
|
4435
|
-
}
|
4436
|
-
|
4437
4532
|
/**
|
4438
4533
|
Schedules an item to run after control has been returned to the system.
|
4439
|
-
This is
|
4534
|
+
This is equivalent to calling `Ember.run.later` with a wait time of 1ms.
|
4440
4535
|
|
4441
4536
|
```javascript
|
4442
4537
|
Ember.run.next(myContext, function(){
|
@@ -4452,20 +4547,10 @@ function invokeNextTimers() {
|
|
4452
4547
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
4453
4548
|
@return {Object} timer
|
4454
4549
|
*/
|
4455
|
-
Ember.run.next = function(
|
4456
|
-
var
|
4457
|
-
|
4458
|
-
|
4459
|
-
method: method,
|
4460
|
-
args: slice.call(arguments),
|
4461
|
-
next: true
|
4462
|
-
};
|
4463
|
-
|
4464
|
-
guid = Ember.guidFor(timer);
|
4465
|
-
timers[guid] = timer;
|
4466
|
-
|
4467
|
-
if (!scheduledNext) { scheduledNext = setTimeout(invokeNextTimers, 1); }
|
4468
|
-
return guid;
|
4550
|
+
Ember.run.next = function() {
|
4551
|
+
var args = slice.call(arguments);
|
4552
|
+
args.push(1); // 1 millisecond wait
|
4553
|
+
return run.later.apply(this, args);
|
4469
4554
|
};
|
4470
4555
|
|
4471
4556
|
/**
|
@@ -4970,7 +5055,6 @@ var Mixin, REQUIRED, Alias,
|
|
4970
5055
|
a_indexOf = Ember.ArrayPolyfills.indexOf,
|
4971
5056
|
a_forEach = Ember.ArrayPolyfills.forEach,
|
4972
5057
|
a_slice = [].slice,
|
4973
|
-
EMPTY_META = {}, // dummy for non-writable meta
|
4974
5058
|
o_create = Ember.create,
|
4975
5059
|
defineProperty = Ember.defineProperty,
|
4976
5060
|
guidFor = Ember.guidFor;
|
@@ -5339,6 +5423,38 @@ Mixin.finishPartial = finishPartial;
|
|
5339
5423
|
Ember.anyUnprocessedMixins = false;
|
5340
5424
|
|
5341
5425
|
/**
|
5426
|
+
Creates an instance of a class. Accepts either no arguments, or an object
|
5427
|
+
containing values to initialize the newly instantiated object with.
|
5428
|
+
|
5429
|
+
```javascript
|
5430
|
+
App.Person = Ember.Object.extend({
|
5431
|
+
helloWorld: function() {
|
5432
|
+
alert("Hi, my name is " + this.get('name'));
|
5433
|
+
}
|
5434
|
+
});
|
5435
|
+
|
5436
|
+
var tom = App.Person.create({
|
5437
|
+
name: 'Tom Dale'
|
5438
|
+
});
|
5439
|
+
|
5440
|
+
tom.helloWorld(); // alerts "Hi, my name is Tom Dale".
|
5441
|
+
```
|
5442
|
+
|
5443
|
+
`create` will call the `init` function if defined during
|
5444
|
+
`Ember.AnyObject.extend`
|
5445
|
+
|
5446
|
+
If no arguments are passed to `create`, it will not set values to the new
|
5447
|
+
instance during initialization:
|
5448
|
+
|
5449
|
+
```javascript
|
5450
|
+
var noName = App.Person.create();
|
5451
|
+
noName.helloWorld(); // alerts undefined
|
5452
|
+
```
|
5453
|
+
|
5454
|
+
NOTE: For performance reasons, you cannot declare methods or computed
|
5455
|
+
properties during `create`. You should instead declare methods and computed
|
5456
|
+
properties when using `extend`.
|
5457
|
+
|
5342
5458
|
@method create
|
5343
5459
|
@static
|
5344
5460
|
@param arguments*
|
@@ -5854,35 +5970,35 @@ define("rsvp",
|
|
5854
5970
|
}
|
5855
5971
|
|
5856
5972
|
function all(promises) {
|
5857
|
-
|
5858
|
-
|
5859
|
-
|
5973
|
+
var i, results = [];
|
5974
|
+
var allPromise = new Promise();
|
5975
|
+
var remaining = promises.length;
|
5860
5976
|
|
5861
5977
|
if (remaining === 0) {
|
5862
5978
|
allPromise.resolve([]);
|
5863
5979
|
}
|
5864
5980
|
|
5865
|
-
|
5866
|
-
|
5867
|
-
|
5868
|
-
|
5869
|
-
|
5981
|
+
var resolver = function(index) {
|
5982
|
+
return function(value) {
|
5983
|
+
resolve(index, value);
|
5984
|
+
};
|
5985
|
+
};
|
5870
5986
|
|
5871
|
-
|
5872
|
-
|
5873
|
-
|
5874
|
-
|
5875
|
-
|
5876
|
-
|
5987
|
+
var resolve = function(index, value) {
|
5988
|
+
results[index] = value;
|
5989
|
+
if (--remaining === 0) {
|
5990
|
+
allPromise.resolve(results);
|
5991
|
+
}
|
5992
|
+
};
|
5877
5993
|
|
5878
|
-
|
5879
|
-
|
5880
|
-
|
5994
|
+
var reject = function(error) {
|
5995
|
+
allPromise.reject(error);
|
5996
|
+
};
|
5881
5997
|
|
5882
|
-
|
5883
|
-
|
5884
|
-
|
5885
|
-
|
5998
|
+
for (i = 0; i < remaining; i++) {
|
5999
|
+
promises[i].then(resolver(i), reject);
|
6000
|
+
}
|
6001
|
+
return allPromise;
|
5886
6002
|
}
|
5887
6003
|
|
5888
6004
|
EventTarget.mixin(Promise.prototype);
|
@@ -6258,57 +6374,6 @@ Ember.typeOf = function(item) {
|
|
6258
6374
|
return ret;
|
6259
6375
|
};
|
6260
6376
|
|
6261
|
-
/**
|
6262
|
-
Returns true if the passed value is null or undefined. This avoids errors
|
6263
|
-
from JSLint complaining about use of ==, which can be technically
|
6264
|
-
confusing.
|
6265
|
-
|
6266
|
-
```javascript
|
6267
|
-
Ember.isNone(); // true
|
6268
|
-
Ember.isNone(null); // true
|
6269
|
-
Ember.isNone(undefined); // true
|
6270
|
-
Ember.isNone(''); // false
|
6271
|
-
Ember.isNone([]); // false
|
6272
|
-
Ember.isNone(function(){}); // false
|
6273
|
-
```
|
6274
|
-
|
6275
|
-
@method isNone
|
6276
|
-
@for Ember
|
6277
|
-
@param {Object} obj Value to test
|
6278
|
-
@return {Boolean}
|
6279
|
-
*/
|
6280
|
-
Ember.isNone = function(obj) {
|
6281
|
-
return obj === null || obj === undefined;
|
6282
|
-
};
|
6283
|
-
Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.", Ember.isNone);
|
6284
|
-
|
6285
|
-
/**
|
6286
|
-
Verifies that a value is `null` or an empty string, empty array,
|
6287
|
-
or empty function.
|
6288
|
-
|
6289
|
-
Constrains the rules on `Ember.isNone` by returning false for empty
|
6290
|
-
string and empty arrays.
|
6291
|
-
|
6292
|
-
```javascript
|
6293
|
-
Ember.isEmpty(); // true
|
6294
|
-
Ember.isEmpty(null); // true
|
6295
|
-
Ember.isEmpty(undefined); // true
|
6296
|
-
Ember.isEmpty(''); // true
|
6297
|
-
Ember.isEmpty([]); // true
|
6298
|
-
Ember.isEmpty('Adam Hawkins'); // false
|
6299
|
-
Ember.isEmpty([0,1,2]); // false
|
6300
|
-
```
|
6301
|
-
|
6302
|
-
@method isEmpty
|
6303
|
-
@for Ember
|
6304
|
-
@param {Object} obj Value to test
|
6305
|
-
@return {Boolean}
|
6306
|
-
*/
|
6307
|
-
Ember.isEmpty = function(obj) {
|
6308
|
-
return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
|
6309
|
-
};
|
6310
|
-
Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty) ;
|
6311
|
-
|
6312
6377
|
/**
|
6313
6378
|
This will compare two javascript values of possibly different types.
|
6314
6379
|
It will tell you which one is greater than the other by returning:
|
@@ -6763,10 +6828,11 @@ Ember.String = {
|
|
6763
6828
|
*/
|
6764
6829
|
dasherize: function(str) {
|
6765
6830
|
var cache = STRING_DASHERIZE_CACHE,
|
6766
|
-
|
6831
|
+
hit = cache.hasOwnProperty(str),
|
6832
|
+
ret;
|
6767
6833
|
|
6768
|
-
if (
|
6769
|
-
return
|
6834
|
+
if (hit) {
|
6835
|
+
return cache[str];
|
6770
6836
|
} else {
|
6771
6837
|
ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');
|
6772
6838
|
cache[str] = ret;
|
@@ -6776,7 +6842,7 @@ Ember.String = {
|
|
6776
6842
|
},
|
6777
6843
|
|
6778
6844
|
/**
|
6779
|
-
Returns the
|
6845
|
+
Returns the lowerCamelCase form of a string.
|
6780
6846
|
|
6781
6847
|
```javascript
|
6782
6848
|
'innerHTML'.camelize(); // 'innerHTML'
|
@@ -6847,10 +6913,10 @@ Ember.String = {
|
|
6847
6913
|
/**
|
6848
6914
|
Returns the Capitalized form of a string
|
6849
6915
|
|
6850
|
-
'innerHTML'.capitalize()
|
6851
|
-
'action_name'.capitalize()
|
6852
|
-
'css-class-name'.capitalize()
|
6853
|
-
'my favorite items'.capitalize()
|
6916
|
+
'innerHTML'.capitalize() // 'InnerHTML'
|
6917
|
+
'action_name'.capitalize() // 'Action_name'
|
6918
|
+
'css-class-name'.capitalize() // 'Css-class-name'
|
6919
|
+
'my favorite items'.capitalize() // 'My favorite items'
|
6854
6920
|
|
6855
6921
|
@method capitalize
|
6856
6922
|
@param {String} str
|
@@ -7194,8 +7260,7 @@ function iter(key, value) {
|
|
7194
7260
|
@extends Ember.Mixin
|
7195
7261
|
@since Ember 0.9
|
7196
7262
|
*/
|
7197
|
-
Ember.Enumerable = Ember.Mixin.create(
|
7198
|
-
/** @scope Ember.Enumerable.prototype */ {
|
7263
|
+
Ember.Enumerable = Ember.Mixin.create({
|
7199
7264
|
|
7200
7265
|
// compatibility
|
7201
7266
|
isEnumerable: true,
|
@@ -7228,7 +7293,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7228
7293
|
|
7229
7294
|
@method nextObject
|
7230
7295
|
@param {Number} index the current index of the iteration
|
7231
|
-
@param {Object} previousObject the value returned by the last call to
|
7296
|
+
@param {Object} previousObject the value returned by the last call to
|
7232
7297
|
`nextObject`.
|
7233
7298
|
@param {Object} context a context object you can use to maintain state.
|
7234
7299
|
@return {Object} the next object in the iteration or undefined
|
@@ -7247,10 +7312,10 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7247
7312
|
|
7248
7313
|
```javascript
|
7249
7314
|
var arr = ["a", "b", "c"];
|
7250
|
-
arr.firstObject
|
7315
|
+
arr.get('firstObject'); // "a"
|
7251
7316
|
|
7252
7317
|
var arr = [];
|
7253
|
-
arr.firstObject
|
7318
|
+
arr.get('firstObject'); // undefined
|
7254
7319
|
```
|
7255
7320
|
|
7256
7321
|
@property firstObject
|
@@ -7273,10 +7338,10 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7273
7338
|
|
7274
7339
|
```javascript
|
7275
7340
|
var arr = ["a", "b", "c"];
|
7276
|
-
arr.lastObject
|
7341
|
+
arr.get('lastObject'); // "c"
|
7277
7342
|
|
7278
7343
|
var arr = [];
|
7279
|
-
arr.lastObject
|
7344
|
+
arr.get('lastObject'); // undefined
|
7280
7345
|
```
|
7281
7346
|
|
7282
7347
|
@property lastObject
|
@@ -7409,7 +7474,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7409
7474
|
@return {Array} The mapped array.
|
7410
7475
|
*/
|
7411
7476
|
map: function(callback, target) {
|
7412
|
-
var ret = [];
|
7477
|
+
var ret = Ember.A([]);
|
7413
7478
|
this.forEach(function(x, idx, i) {
|
7414
7479
|
ret[idx] = callback.call(target, x, idx,i);
|
7415
7480
|
});
|
@@ -7459,7 +7524,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7459
7524
|
@return {Array} A filtered array.
|
7460
7525
|
*/
|
7461
7526
|
filter: function(callback, target) {
|
7462
|
-
var ret = [];
|
7527
|
+
var ret = Ember.A([]);
|
7463
7528
|
this.forEach(function(x, idx, i) {
|
7464
7529
|
if (callback.call(target, x, idx, i)) ret.push(x);
|
7465
7530
|
});
|
@@ -7748,7 +7813,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7748
7813
|
@return {Array} return values from calling invoke.
|
7749
7814
|
*/
|
7750
7815
|
invoke: function(methodName) {
|
7751
|
-
var args, ret = [];
|
7816
|
+
var args, ret = Ember.A([]);
|
7752
7817
|
if (arguments.length>1) args = a_slice.call(arguments, 1);
|
7753
7818
|
|
7754
7819
|
this.forEach(function(x, idx) {
|
@@ -7769,7 +7834,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7769
7834
|
@return {Array} the enumerable as an array.
|
7770
7835
|
*/
|
7771
7836
|
toArray: function() {
|
7772
|
-
var ret = [];
|
7837
|
+
var ret = Ember.A([]);
|
7773
7838
|
this.forEach(function(o, idx) { ret[idx] = o; });
|
7774
7839
|
return ret ;
|
7775
7840
|
},
|
@@ -7803,7 +7868,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7803
7868
|
*/
|
7804
7869
|
without: function(value) {
|
7805
7870
|
if (!this.contains(value)) return this; // nothing to do
|
7806
|
-
var ret = []
|
7871
|
+
var ret = Ember.A([]);
|
7807
7872
|
this.forEach(function(k) {
|
7808
7873
|
if (k !== value) ret[ret.length] = k;
|
7809
7874
|
}) ;
|
@@ -7823,7 +7888,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7823
7888
|
@return {Ember.Enumerable}
|
7824
7889
|
*/
|
7825
7890
|
uniq: function() {
|
7826
|
-
var ret = [];
|
7891
|
+
var ret = Ember.A([]);
|
7827
7892
|
this.forEach(function(k){
|
7828
7893
|
if (a_indexOf(ret, k)<0) ret.push(k);
|
7829
7894
|
});
|
@@ -7855,7 +7920,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7855
7920
|
|
7856
7921
|
@method addEnumerableObserver
|
7857
7922
|
@param {Object} target
|
7858
|
-
@param {Hash} opts
|
7923
|
+
@param {Hash} [opts]
|
7859
7924
|
*/
|
7860
7925
|
addEnumerableObserver: function(target, opts) {
|
7861
7926
|
var willChange = (opts && opts.willChange) || 'enumerableWillChange',
|
@@ -7953,7 +8018,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7953
8018
|
@chainable
|
7954
8019
|
*/
|
7955
8020
|
enumerableContentDidChange: function(removing, adding) {
|
7956
|
-
var
|
8021
|
+
var removeCnt, addCnt, hasDelta;
|
7957
8022
|
|
7958
8023
|
if ('number' === typeof removing) removeCnt = removing;
|
7959
8024
|
else if (removing) removeCnt = get(removing, 'length');
|
@@ -7991,7 +8056,7 @@ Ember.Enumerable = Ember.Mixin.create(
|
|
7991
8056
|
// HELPERS
|
7992
8057
|
//
|
7993
8058
|
|
7994
|
-
var get = Ember.get, set = Ember.set,
|
8059
|
+
var get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
|
7995
8060
|
|
7996
8061
|
function none(obj) { return obj===null || obj===undefined; }
|
7997
8062
|
|
@@ -8133,15 +8198,19 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
8133
8198
|
```
|
8134
8199
|
|
8135
8200
|
@method slice
|
8136
|
-
@param
|
8137
|
-
@param
|
8201
|
+
@param {Integer} beginIndex (Optional) index to begin slicing from.
|
8202
|
+
@param {Integer} endIndex (Optional) index to end the slice at.
|
8138
8203
|
@return {Array} New array with specified slice
|
8139
8204
|
*/
|
8140
8205
|
slice: function(beginIndex, endIndex) {
|
8141
|
-
var ret = [];
|
8206
|
+
var ret = Ember.A([]);
|
8142
8207
|
var length = get(this, 'length') ;
|
8143
8208
|
if (none(beginIndex)) beginIndex = 0 ;
|
8144
8209
|
if (none(endIndex) || (endIndex > length)) endIndex = length ;
|
8210
|
+
|
8211
|
+
if (beginIndex < 0) beginIndex = length + beginIndex;
|
8212
|
+
if (endIndex < 0) endIndex = length + endIndex;
|
8213
|
+
|
8145
8214
|
while(beginIndex < endIndex) {
|
8146
8215
|
ret[ret.length] = this.objectAt(beginIndex++) ;
|
8147
8216
|
}
|
@@ -8295,9 +8364,9 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
8295
8364
|
|
8296
8365
|
@method arrayContentWillChange
|
8297
8366
|
@param {Number} startIdx The starting index in the array that will change.
|
8298
|
-
@param {Number} removeAmt The number of items that will be removed. If you
|
8367
|
+
@param {Number} removeAmt The number of items that will be removed. If you
|
8299
8368
|
pass `null` assumes 0
|
8300
|
-
@param {Number} addAmt The number of items that will be added If you
|
8369
|
+
@param {Number} addAmt The number of items that will be added If you
|
8301
8370
|
pass `null` assumes 0.
|
8302
8371
|
@return {Ember.Array} receiver
|
8303
8372
|
*/
|
@@ -8658,8 +8727,7 @@ var forEach = Ember.EnumerableUtils.forEach;
|
|
8658
8727
|
@extends Ember.Mixin
|
8659
8728
|
@uses Ember.Enumerable
|
8660
8729
|
*/
|
8661
|
-
Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable,
|
8662
|
-
/** @scope Ember.MutableEnumerable.prototype */ {
|
8730
|
+
Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {
|
8663
8731
|
|
8664
8732
|
/**
|
8665
8733
|
__Required.__ You must implement this method to apply this mixin.
|
@@ -8744,7 +8812,7 @@ var EMPTY = [];
|
|
8744
8812
|
// HELPERS
|
8745
8813
|
//
|
8746
8814
|
|
8747
|
-
var get = Ember.get, set = Ember.set
|
8815
|
+
var get = Ember.get, set = Ember.set;
|
8748
8816
|
|
8749
8817
|
/**
|
8750
8818
|
This mixin defines the API for modifying array-like objects. These methods
|
@@ -8771,11 +8839,11 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
|
|
8771
8839
|
passed array. You should also call `this.enumerableContentDidChange()`
|
8772
8840
|
|
8773
8841
|
@method replace
|
8774
|
-
@param {Number} idx Starting index in the array to replace. If
|
8842
|
+
@param {Number} idx Starting index in the array to replace. If
|
8775
8843
|
idx >= length, then append to the end of the array.
|
8776
|
-
@param {Number} amt Number of elements that should be removed from
|
8844
|
+
@param {Number} amt Number of elements that should be removed from
|
8777
8845
|
the array, starting at *idx*.
|
8778
|
-
@param {Array} objects An array of zero or more objects that should be
|
8846
|
+
@param {Array} objects An array of zero or more objects that should be
|
8779
8847
|
inserted into the array at *idx*
|
8780
8848
|
*/
|
8781
8849
|
replace: Ember.required(),
|
@@ -9040,7 +9108,7 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
|
|
9040
9108
|
@submodule ember-runtime
|
9041
9109
|
*/
|
9042
9110
|
|
9043
|
-
var get = Ember.get, set = Ember.set
|
9111
|
+
var get = Ember.get, set = Ember.set;
|
9044
9112
|
|
9045
9113
|
/**
|
9046
9114
|
## Overview
|
@@ -9638,6 +9706,16 @@ Ember.TargetActionSupport = Ember.Mixin.create({
|
|
9638
9706
|
// outputs: 'Our person has greeted'
|
9639
9707
|
```
|
9640
9708
|
|
9709
|
+
You can also chain multiple event subscriptions:
|
9710
|
+
|
9711
|
+
```javascript
|
9712
|
+
person.on('greet', function() {
|
9713
|
+
console.log('Our person has greeted');
|
9714
|
+
}).one('greet', function() {
|
9715
|
+
console.log('Offer one-time special');
|
9716
|
+
}).off('event', this, forgetThis);
|
9717
|
+
```
|
9718
|
+
|
9641
9719
|
@class Evented
|
9642
9720
|
@namespace Ember
|
9643
9721
|
@extends Ember.Mixin
|
@@ -9665,6 +9743,7 @@ Ember.Evented = Ember.Mixin.create({
|
|
9665
9743
|
*/
|
9666
9744
|
on: function(name, target, method) {
|
9667
9745
|
Ember.addListener(this, name, target, method);
|
9746
|
+
return this;
|
9668
9747
|
},
|
9669
9748
|
|
9670
9749
|
/**
|
@@ -9688,6 +9767,7 @@ Ember.Evented = Ember.Mixin.create({
|
|
9688
9767
|
}
|
9689
9768
|
|
9690
9769
|
Ember.addListener(this, name, target, method, true);
|
9770
|
+
return this;
|
9691
9771
|
},
|
9692
9772
|
|
9693
9773
|
/**
|
@@ -9731,6 +9811,7 @@ Ember.Evented = Ember.Mixin.create({
|
|
9731
9811
|
*/
|
9732
9812
|
off: function(name, target, method) {
|
9733
9813
|
Ember.removeListener(this, name, target, method);
|
9814
|
+
return this;
|
9734
9815
|
},
|
9735
9816
|
|
9736
9817
|
/**
|
@@ -9761,8 +9842,7 @@ RSVP.async = function(callback, binding) {
|
|
9761
9842
|
@submodule ember-runtime
|
9762
9843
|
*/
|
9763
9844
|
|
9764
|
-
var get = Ember.get
|
9765
|
-
slice = Array.prototype.slice;
|
9845
|
+
var get = Ember.get;
|
9766
9846
|
|
9767
9847
|
/**
|
9768
9848
|
@class Deferred
|
@@ -9838,7 +9918,6 @@ Ember.Container.set = Ember.set;
|
|
9838
9918
|
var set = Ember.set, get = Ember.get,
|
9839
9919
|
o_create = Ember.create,
|
9840
9920
|
o_defineProperty = Ember.platform.defineProperty,
|
9841
|
-
a_slice = Array.prototype.slice,
|
9842
9921
|
GUID_KEY = Ember.GUID_KEY,
|
9843
9922
|
guidFor = Ember.guidFor,
|
9844
9923
|
generateGuid = Ember.generateGuid,
|
@@ -9985,6 +10064,37 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
9985
10064
|
|
9986
10065
|
isInstance: true,
|
9987
10066
|
|
10067
|
+
/**
|
10068
|
+
An overridable method called when objects are instantiated. By default,
|
10069
|
+
does nothing unless it is overridden during class definition.
|
10070
|
+
|
10071
|
+
Example:
|
10072
|
+
|
10073
|
+
```javascript
|
10074
|
+
App.Person = Ember.Object.extend({
|
10075
|
+
init: function() {
|
10076
|
+
this._super();
|
10077
|
+
alert('Name is ' + this.get('name'));
|
10078
|
+
}
|
10079
|
+
});
|
10080
|
+
|
10081
|
+
var steve = App.Person.create({
|
10082
|
+
name: "Steve"
|
10083
|
+
});
|
10084
|
+
|
10085
|
+
// alerts 'Name is Steve'.
|
10086
|
+
```
|
10087
|
+
|
10088
|
+
NOTE: If you do override `init` for a framework class like `Ember.View` or
|
10089
|
+
`Ember.ArrayController`, be sure to call `this._super()` in your
|
10090
|
+
`init` declaration! If you don't, Ember may not have an opportunity to
|
10091
|
+
do important setup work, and you'll see strange behavior in your
|
10092
|
+
application.
|
10093
|
+
|
10094
|
+
```
|
10095
|
+
|
10096
|
+
@method init
|
10097
|
+
*/
|
9988
10098
|
init: function() {},
|
9989
10099
|
|
9990
10100
|
/**
|
@@ -10029,14 +10139,14 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
10029
10139
|
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
10030
10140
|
```
|
10031
10141
|
Adding a single property that is not an array will just add it in the array:
|
10032
|
-
|
10142
|
+
|
10033
10143
|
```javascript
|
10034
10144
|
var view = App.FooBarView.create({
|
10035
10145
|
classNames: 'baz'
|
10036
10146
|
})
|
10037
10147
|
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
10038
10148
|
```
|
10039
|
-
|
10149
|
+
|
10040
10150
|
Using the `concatenatedProperties` property, we can tell to Ember that mix
|
10041
10151
|
the content of the properties.
|
10042
10152
|
|
@@ -10135,7 +10245,7 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
10135
10245
|
}
|
10136
10246
|
});
|
10137
10247
|
teacher = App.Teacher.create()
|
10138
|
-
teacher.toString();
|
10248
|
+
teacher.toString(); //=> "<App.Teacher:ember1026:Tom Dale>"
|
10139
10249
|
|
10140
10250
|
@method toString
|
10141
10251
|
@return {String} string representation
|
@@ -10313,687 +10423,721 @@ Ember.CoreObject = CoreObject;
|
|
10313
10423
|
@submodule ember-runtime
|
10314
10424
|
*/
|
10315
10425
|
|
10316
|
-
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.isNone;
|
10317
|
-
|
10318
10426
|
/**
|
10319
|
-
|
10427
|
+
`Ember.Object` is the main base class for all Ember objects. It is a subclass
|
10428
|
+
of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,
|
10429
|
+
see the documentation for each of these.
|
10320
10430
|
|
10321
|
-
|
10322
|
-
|
10323
|
-
|
10324
|
-
|
10431
|
+
@class Object
|
10432
|
+
@namespace Ember
|
10433
|
+
@extends Ember.CoreObject
|
10434
|
+
@uses Ember.Observable
|
10435
|
+
*/
|
10436
|
+
Ember.Object = Ember.CoreObject.extend(Ember.Observable);
|
10437
|
+
Ember.Object.toString = function() { return "Ember.Object"; };
|
10325
10438
|
|
10326
|
-
|
10327
|
-
on any enumerable object including both Sets and Arrays.
|
10439
|
+
})();
|
10328
10440
|
|
10329
|
-
## Creating a Set
|
10330
10441
|
|
10331
|
-
You can create a set like you would most objects using
|
10332
|
-
`new Ember.Set()`. Most new sets you create will be empty, but you can
|
10333
|
-
also initialize the set with some content by passing an array or other
|
10334
|
-
enumerable of objects to the constructor.
|
10335
10442
|
|
10336
|
-
|
10337
|
-
|
10443
|
+
(function() {
|
10444
|
+
/**
|
10445
|
+
@module ember
|
10446
|
+
@submodule ember-runtime
|
10447
|
+
*/
|
10338
10448
|
|
10339
|
-
|
10340
|
-
// creates a new empty set
|
10341
|
-
var foundNames = new Ember.Set();
|
10449
|
+
var get = Ember.get, indexOf = Ember.ArrayPolyfills.indexOf;
|
10342
10450
|
|
10343
|
-
|
10344
|
-
|
10451
|
+
/**
|
10452
|
+
A Namespace is an object usually used to contain other objects or methods
|
10453
|
+
such as an application or framework. Create a namespace anytime you want
|
10454
|
+
to define one of these new containers.
|
10345
10455
|
|
10346
|
-
|
10347
|
-
var namesCopy = new Ember.Set(names);
|
10456
|
+
# Example Usage
|
10348
10457
|
|
10349
|
-
|
10350
|
-
|
10458
|
+
```javascript
|
10459
|
+
MyFramework = Ember.Namespace.create({
|
10460
|
+
VERSION: '1.0.0'
|
10461
|
+
});
|
10351
10462
|
```
|
10352
10463
|
|
10353
|
-
|
10354
|
-
|
10355
|
-
|
10356
|
-
|
10357
|
-
|
10464
|
+
@class Namespace
|
10465
|
+
@namespace Ember
|
10466
|
+
@extends Ember.Object
|
10467
|
+
*/
|
10468
|
+
var Namespace = Ember.Namespace = Ember.Object.extend({
|
10469
|
+
isNamespace: true,
|
10358
10470
|
|
10359
|
-
|
10360
|
-
|
10361
|
-
|
10362
|
-
|
10363
|
-
you add the object to the set again.
|
10471
|
+
init: function() {
|
10472
|
+
Ember.Namespace.NAMESPACES.push(this);
|
10473
|
+
Ember.Namespace.PROCESSED = false;
|
10474
|
+
},
|
10364
10475
|
|
10365
|
-
|
10366
|
-
|
10476
|
+
toString: function() {
|
10477
|
+
var name = get(this, 'name');
|
10478
|
+
if (name) { return name; }
|
10367
10479
|
|
10368
|
-
|
10369
|
-
|
10370
|
-
|
10371
|
-
queue when you don't care which order the jobs are executed in.
|
10480
|
+
findNamespaces();
|
10481
|
+
return this[Ember.GUID_KEY+'_name'];
|
10482
|
+
},
|
10372
10483
|
|
10373
|
-
|
10484
|
+
nameClasses: function() {
|
10485
|
+
processNamespace([this.toString()], this, {});
|
10486
|
+
},
|
10374
10487
|
|
10375
|
-
|
10376
|
-
|
10488
|
+
destroy: function() {
|
10489
|
+
var namespaces = Ember.Namespace.NAMESPACES;
|
10490
|
+
Ember.lookup[this.toString()] = undefined;
|
10491
|
+
namespaces.splice(indexOf.call(namespaces, this), 1);
|
10492
|
+
this._super();
|
10493
|
+
}
|
10494
|
+
});
|
10377
10495
|
|
10378
|
-
|
10496
|
+
Namespace.reopenClass({
|
10497
|
+
NAMESPACES: [Ember],
|
10498
|
+
NAMESPACES_BY_ID: {},
|
10499
|
+
PROCESSED: false,
|
10500
|
+
processAll: processAllNamespaces,
|
10501
|
+
byName: function(name) {
|
10502
|
+
if (!Ember.BOOTED) {
|
10503
|
+
processAllNamespaces();
|
10504
|
+
}
|
10379
10505
|
|
10380
|
-
|
10381
|
-
|
10382
|
-
|
10383
|
-
removed from the set. See `Ember.Enumerable` for more information on
|
10384
|
-
enumerables.
|
10506
|
+
return NAMESPACES_BY_ID[name];
|
10507
|
+
}
|
10508
|
+
});
|
10385
10509
|
|
10386
|
-
|
10387
|
-
it is very inefficient to re-filter all of the items each time the set
|
10388
|
-
changes. It would be better if you could just adjust the filtered set based
|
10389
|
-
on what was changed on the original set. The same issue applies to merging
|
10390
|
-
sets, as well.
|
10510
|
+
var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;
|
10391
10511
|
|
10392
|
-
|
10512
|
+
var hasOwnProp = ({}).hasOwnProperty,
|
10513
|
+
guidFor = Ember.guidFor;
|
10393
10514
|
|
10394
|
-
|
10395
|
-
|
10396
|
-
The most useful ones will be `Ember.Enumerable` and
|
10397
|
-
`Ember.MutableEnumerable` which implement most of the common iterator
|
10398
|
-
methods you are used to on Array.
|
10515
|
+
function processNamespace(paths, root, seen) {
|
10516
|
+
var idx = paths.length;
|
10399
10517
|
|
10400
|
-
|
10401
|
-
APIs on `Ember.Set` as well. Once a set is frozen it can no longer be
|
10402
|
-
modified. The benefit of this is that when you call `frozenCopy()` on it,
|
10403
|
-
Ember will avoid making copies of the set. This allows you to write
|
10404
|
-
code that can know with certainty when the underlying set data will or
|
10405
|
-
will not be modified.
|
10518
|
+
NAMESPACES_BY_ID[paths.join('.')] = root;
|
10406
10519
|
|
10407
|
-
|
10408
|
-
|
10409
|
-
|
10410
|
-
|
10411
|
-
@uses Ember.Copyable
|
10412
|
-
@uses Ember.Freezable
|
10413
|
-
@since Ember 0.9
|
10414
|
-
*/
|
10415
|
-
Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,
|
10416
|
-
/** @scope Ember.Set.prototype */ {
|
10520
|
+
// Loop over all of the keys in the namespace, looking for classes
|
10521
|
+
for(var key in root) {
|
10522
|
+
if (!hasOwnProp.call(root, key)) { continue; }
|
10523
|
+
var obj = root[key];
|
10417
10524
|
|
10418
|
-
|
10419
|
-
|
10420
|
-
|
10525
|
+
// If we are processing the `Ember` namespace, for example, the
|
10526
|
+
// `paths` will start with `["Ember"]`. Every iteration through
|
10527
|
+
// the loop will update the **second** element of this list with
|
10528
|
+
// the key, so processing `Ember.View` will make the Array
|
10529
|
+
// `['Ember', 'View']`.
|
10530
|
+
paths[idx] = key;
|
10421
10531
|
|
10422
|
-
|
10423
|
-
|
10532
|
+
// If we have found an unprocessed class
|
10533
|
+
if (obj && obj.toString === classToString) {
|
10534
|
+
// Replace the class' `toString` with the dot-separated path
|
10535
|
+
// and set its `NAME_KEY`
|
10536
|
+
obj.toString = makeToString(paths.join('.'));
|
10537
|
+
obj[NAME_KEY] = paths.join('.');
|
10424
10538
|
|
10425
|
-
|
10426
|
-
|
10427
|
-
|
10428
|
-
|
10429
|
-
|
10539
|
+
// Support nested namespaces
|
10540
|
+
} else if (obj && obj.isNamespace) {
|
10541
|
+
// Skip aliased namespaces
|
10542
|
+
if (seen[guidFor(obj)]) { continue; }
|
10543
|
+
seen[guidFor(obj)] = true;
|
10430
10544
|
|
10431
|
-
|
10432
|
-
|
10433
|
-
|
10545
|
+
// Process the child namespace
|
10546
|
+
processNamespace(paths, obj, seen);
|
10547
|
+
}
|
10548
|
+
}
|
10434
10549
|
|
10435
|
-
|
10436
|
-
|
10437
|
-
colors.length; // 3
|
10438
|
-
colors.clear();
|
10439
|
-
colors.length; // 0
|
10440
|
-
```
|
10550
|
+
paths.length = idx; // cut out last item
|
10551
|
+
}
|
10441
10552
|
|
10442
|
-
|
10443
|
-
|
10444
|
-
*/
|
10445
|
-
clear: function() {
|
10446
|
-
if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }
|
10553
|
+
function findNamespaces() {
|
10554
|
+
var Namespace = Ember.Namespace, lookup = Ember.lookup, obj, isNamespace;
|
10447
10555
|
|
10448
|
-
|
10449
|
-
if (len === 0) { return this; }
|
10556
|
+
if (Namespace.PROCESSED) { return; }
|
10450
10557
|
|
10451
|
-
|
10558
|
+
for (var prop in lookup) {
|
10559
|
+
// These don't raise exceptions but can cause warnings
|
10560
|
+
if (prop === "parent" || prop === "top" || prop === "frameElement") { continue; }
|
10452
10561
|
|
10453
|
-
|
10454
|
-
|
10455
|
-
|
10562
|
+
// get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.
|
10563
|
+
// globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage
|
10564
|
+
if (prop === "globalStorage" && lookup.StorageList && lookup.globalStorage instanceof lookup.StorageList) { continue; }
|
10565
|
+
// Unfortunately, some versions of IE don't support window.hasOwnProperty
|
10566
|
+
if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }
|
10456
10567
|
|
10457
|
-
|
10458
|
-
|
10459
|
-
|
10460
|
-
|
10568
|
+
// At times we are not allowed to access certain properties for security reasons.
|
10569
|
+
// There are also times where even if we can access them, we are not allowed to access their properties.
|
10570
|
+
try {
|
10571
|
+
obj = Ember.lookup[prop];
|
10572
|
+
isNamespace = obj && obj.isNamespace;
|
10573
|
+
} catch (e) {
|
10574
|
+
continue;
|
10461
10575
|
}
|
10462
10576
|
|
10463
|
-
|
10577
|
+
if (isNamespace) {
|
10464
10578
|
|
10465
|
-
|
10466
|
-
|
10467
|
-
|
10579
|
+
obj[NAME_KEY] = prop;
|
10580
|
+
}
|
10581
|
+
}
|
10582
|
+
}
|
10468
10583
|
|
10469
|
-
|
10470
|
-
},
|
10584
|
+
var NAME_KEY = Ember.NAME_KEY = Ember.GUID_KEY + '_name';
|
10471
10585
|
|
10472
|
-
|
10473
|
-
|
10474
|
-
|
10586
|
+
function superClassString(mixin) {
|
10587
|
+
var superclass = mixin.superclass;
|
10588
|
+
if (superclass) {
|
10589
|
+
if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }
|
10590
|
+
else { return superClassString(superclass); }
|
10591
|
+
} else {
|
10592
|
+
return;
|
10593
|
+
}
|
10594
|
+
}
|
10475
10595
|
|
10476
|
-
|
10477
|
-
|
10478
|
-
|
10596
|
+
function classToString() {
|
10597
|
+
if (!Ember.BOOTED && !this[NAME_KEY]) {
|
10598
|
+
processAllNamespaces();
|
10599
|
+
}
|
10479
10600
|
|
10480
|
-
|
10481
|
-
same_colors.isEqual(["purple", "brown"]); // false
|
10482
|
-
```
|
10601
|
+
var ret;
|
10483
10602
|
|
10484
|
-
|
10485
|
-
|
10486
|
-
|
10487
|
-
|
10488
|
-
|
10489
|
-
|
10490
|
-
|
10603
|
+
if (this[NAME_KEY]) {
|
10604
|
+
ret = this[NAME_KEY];
|
10605
|
+
} else {
|
10606
|
+
var str = superClassString(this);
|
10607
|
+
if (str) {
|
10608
|
+
ret = "(subclass of " + str + ")";
|
10609
|
+
} else {
|
10610
|
+
ret = "(unknown mixin)";
|
10611
|
+
}
|
10612
|
+
this.toString = makeToString(ret);
|
10613
|
+
}
|
10491
10614
|
|
10492
|
-
|
10493
|
-
|
10615
|
+
return ret;
|
10616
|
+
}
|
10494
10617
|
|
10495
|
-
|
10496
|
-
|
10497
|
-
|
10618
|
+
function processAllNamespaces() {
|
10619
|
+
var unprocessedNamespaces = !Namespace.PROCESSED,
|
10620
|
+
unprocessedMixins = Ember.anyUnprocessedMixins;
|
10498
10621
|
|
10499
|
-
|
10500
|
-
|
10622
|
+
if (unprocessedNamespaces) {
|
10623
|
+
findNamespaces();
|
10624
|
+
Namespace.PROCESSED = true;
|
10625
|
+
}
|
10501
10626
|
|
10502
|
-
|
10503
|
-
|
10504
|
-
|
10505
|
-
|
10627
|
+
if (unprocessedNamespaces || unprocessedMixins) {
|
10628
|
+
var namespaces = Namespace.NAMESPACES, namespace;
|
10629
|
+
for (var i=0, l=namespaces.length; i<l; i++) {
|
10630
|
+
namespace = namespaces[i];
|
10631
|
+
processNamespace([namespace.toString()], namespace, {});
|
10632
|
+
}
|
10506
10633
|
|
10507
|
-
|
10634
|
+
Ember.anyUnprocessedMixins = false;
|
10635
|
+
}
|
10636
|
+
}
|
10508
10637
|
|
10509
|
-
|
10510
|
-
|
10511
|
-
|
10512
|
-
colors.add("blue"); // ["blue"]
|
10513
|
-
colors.add("red"); // ["blue", "red"]
|
10514
|
-
colors.add(null); // ["blue", "red"]
|
10515
|
-
colors.add(undefined); // ["blue", "red"]
|
10516
|
-
```
|
10638
|
+
function makeToString(ret) {
|
10639
|
+
return function() { return ret; };
|
10640
|
+
}
|
10517
10641
|
|
10518
|
-
|
10519
|
-
@param {Object} obj The object to add.
|
10520
|
-
@return {Ember.Set} The set itself.
|
10521
|
-
*/
|
10522
|
-
add: Ember.aliasMethod('addObject'),
|
10642
|
+
Ember.Mixin.prototype.toString = classToString;
|
10523
10643
|
|
10524
|
-
|
10525
|
-
Removes the object from the set if it is found. If you pass a `null` value
|
10526
|
-
or an object that is already not in the set, this method will have no
|
10527
|
-
effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.
|
10644
|
+
})();
|
10528
10645
|
|
10529
|
-
```javascript
|
10530
|
-
var colors = new Ember.Set(["red", "green", "blue"]);
|
10531
|
-
colors.remove("red"); // ["blue", "green"]
|
10532
|
-
colors.remove("purple"); // ["blue", "green"]
|
10533
|
-
colors.remove(null); // ["blue", "green"]
|
10534
|
-
```
|
10535
10646
|
|
10536
|
-
@method remove
|
10537
|
-
@param {Object} obj The object to remove
|
10538
|
-
@return {Ember.Set} The set itself.
|
10539
|
-
*/
|
10540
|
-
remove: Ember.aliasMethod('removeObject'),
|
10541
10647
|
|
10542
|
-
|
10543
|
-
|
10648
|
+
(function() {
|
10649
|
+
Ember.Application = Ember.Namespace.extend();
|
10544
10650
|
|
10545
|
-
|
10546
|
-
var colors = new Ember.Set(["green", "blue"]);
|
10547
|
-
colors.pop(); // "blue"
|
10548
|
-
colors.pop(); // "green"
|
10549
|
-
colors.pop(); // null
|
10550
|
-
```
|
10651
|
+
})();
|
10551
10652
|
|
10552
|
-
@method pop
|
10553
|
-
@return {Object} The removed object from the set or null.
|
10554
|
-
*/
|
10555
|
-
pop: function() {
|
10556
|
-
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
10557
|
-
var obj = this.length > 0 ? this[this.length-1] : null;
|
10558
|
-
this.remove(obj);
|
10559
|
-
return obj;
|
10560
|
-
},
|
10561
10653
|
|
10562
|
-
/**
|
10563
|
-
Inserts the given object on to the end of the set. It returns
|
10564
|
-
the set itself.
|
10565
10654
|
|
10566
|
-
|
10655
|
+
(function() {
|
10656
|
+
/**
|
10657
|
+
@module ember
|
10658
|
+
@submodule ember-runtime
|
10659
|
+
*/
|
10567
10660
|
|
10568
|
-
|
10569
|
-
|
10570
|
-
colors.push("red"); // ["red"]
|
10571
|
-
colors.push("green"); // ["red", "green"]
|
10572
|
-
colors.push("blue"); // ["red", "green", "blue"]
|
10573
|
-
```
|
10661
|
+
var OUT_OF_RANGE_EXCEPTION = "Index out of range";
|
10662
|
+
var EMPTY = [];
|
10574
10663
|
|
10575
|
-
|
10576
|
-
@return {Ember.Set} The set itself.
|
10577
|
-
*/
|
10578
|
-
push: Ember.aliasMethod('addObject'),
|
10664
|
+
var get = Ember.get, set = Ember.set;
|
10579
10665
|
|
10580
|
-
|
10581
|
-
|
10666
|
+
/**
|
10667
|
+
An ArrayProxy wraps any other object that implements `Ember.Array` and/or
|
10668
|
+
`Ember.MutableArray,` forwarding all requests. This makes it very useful for
|
10669
|
+
a number of binding use cases or other cases where being able to swap
|
10670
|
+
out the underlying array is useful.
|
10582
10671
|
|
10583
|
-
|
10672
|
+
A simple example of usage:
|
10584
10673
|
|
10585
|
-
|
10586
|
-
|
10587
|
-
|
10588
|
-
colors.shift(); // "green"
|
10589
|
-
colors.shift(); // null
|
10590
|
-
```
|
10674
|
+
```javascript
|
10675
|
+
var pets = ['dog', 'cat', 'fish'];
|
10676
|
+
var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });
|
10591
10677
|
|
10592
|
-
|
10593
|
-
|
10594
|
-
|
10595
|
-
|
10678
|
+
ap.get('firstObject'); // 'dog'
|
10679
|
+
ap.set('content', ['amoeba', 'paramecium']);
|
10680
|
+
ap.get('firstObject'); // 'amoeba'
|
10681
|
+
```
|
10596
10682
|
|
10597
|
-
|
10598
|
-
|
10599
|
-
|
10683
|
+
This class can also be useful as a layer to transform the contents of
|
10684
|
+
an array, as they are accessed. This can be done by overriding
|
10685
|
+
`objectAtContent`:
|
10600
10686
|
|
10601
|
-
|
10687
|
+
```javascript
|
10688
|
+
var pets = ['dog', 'cat', 'fish'];
|
10689
|
+
var ap = Ember.ArrayProxy.create({
|
10690
|
+
content: Ember.A(pets),
|
10691
|
+
objectAtContent: function(idx) {
|
10692
|
+
return this.get('content').objectAt(idx).toUpperCase();
|
10693
|
+
}
|
10694
|
+
});
|
10602
10695
|
|
10603
|
-
|
10604
|
-
|
10605
|
-
colors.unshift("red"); // ["red"]
|
10606
|
-
colors.unshift("green"); // ["red", "green"]
|
10607
|
-
colors.unshift("blue"); // ["red", "green", "blue"]
|
10608
|
-
```
|
10696
|
+
ap.get('firstObject'); // . 'DOG'
|
10697
|
+
```
|
10609
10698
|
|
10610
|
-
|
10611
|
-
|
10612
|
-
|
10613
|
-
|
10699
|
+
@class ArrayProxy
|
10700
|
+
@namespace Ember
|
10701
|
+
@extends Ember.Object
|
10702
|
+
@uses Ember.MutableArray
|
10703
|
+
*/
|
10704
|
+
Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
|
10705
|
+
/** @scope Ember.ArrayProxy.prototype */ {
|
10614
10706
|
|
10615
10707
|
/**
|
10616
|
-
|
10708
|
+
The content array. Must be an object that implements `Ember.Array` and/or
|
10709
|
+
`Ember.MutableArray.`
|
10617
10710
|
|
10618
|
-
|
10711
|
+
@property content
|
10712
|
+
@type Ember.Array
|
10713
|
+
*/
|
10714
|
+
content: null,
|
10619
10715
|
|
10620
|
-
|
10621
|
-
|
10622
|
-
|
10623
|
-
|
10716
|
+
/**
|
10717
|
+
The array that the proxy pretends to be. In the default `ArrayProxy`
|
10718
|
+
implementation, this and `content` are the same. Subclasses of `ArrayProxy`
|
10719
|
+
can override this property to provide things like sorting and filtering.
|
10624
10720
|
|
10625
|
-
|
10626
|
-
@param {Ember.Enumerable} objects the objects to add.
|
10627
|
-
@return {Ember.Set} The set itself.
|
10721
|
+
@property arrangedContent
|
10628
10722
|
*/
|
10629
|
-
|
10723
|
+
arrangedContent: Ember.computed.alias('content'),
|
10630
10724
|
|
10631
10725
|
/**
|
10632
|
-
|
10633
|
-
|
10634
|
-
|
10726
|
+
Should actually retrieve the object at the specified index from the
|
10727
|
+
content. You can override this method in subclasses to transform the
|
10728
|
+
content item to something new.
|
10635
10729
|
|
10636
|
-
|
10637
|
-
var colors = new Ember.Set(["red", "green", "blue"]);
|
10638
|
-
colors.removeEach(["red", "blue"]); // ["green"]
|
10639
|
-
```
|
10730
|
+
This method will only be called if content is non-`null`.
|
10640
10731
|
|
10641
|
-
@method
|
10642
|
-
@param {
|
10643
|
-
@return {
|
10732
|
+
@method objectAtContent
|
10733
|
+
@param {Number} idx The index to retrieve.
|
10734
|
+
@return {Object} the value or undefined if none found
|
10644
10735
|
*/
|
10645
|
-
|
10736
|
+
objectAtContent: function(idx) {
|
10737
|
+
return get(this, 'arrangedContent').objectAt(idx);
|
10738
|
+
},
|
10646
10739
|
|
10647
|
-
|
10648
|
-
|
10649
|
-
|
10740
|
+
/**
|
10741
|
+
Should actually replace the specified objects on the content array.
|
10742
|
+
You can override this method in subclasses to transform the content item
|
10743
|
+
into something new.
|
10650
10744
|
|
10651
|
-
|
10652
|
-
this._super();
|
10653
|
-
if (items) this.addObjects(items);
|
10654
|
-
},
|
10745
|
+
This method will only be called if content is non-`null`.
|
10655
10746
|
|
10656
|
-
|
10657
|
-
|
10658
|
-
|
10747
|
+
@method replaceContent
|
10748
|
+
@param {Number} idx The starting index
|
10749
|
+
@param {Number} amt The number of items to remove from the content.
|
10750
|
+
@param {Array} objects Optional array of objects to insert or null if no
|
10751
|
+
objects.
|
10752
|
+
@return {void}
|
10753
|
+
*/
|
10754
|
+
replaceContent: function(idx, amt, objects) {
|
10755
|
+
get(this, 'content').replace(idx, amt, objects);
|
10659
10756
|
},
|
10660
10757
|
|
10661
|
-
|
10662
|
-
|
10663
|
-
return this.length > 0 ? this[0] : undefined;
|
10664
|
-
}),
|
10758
|
+
/**
|
10759
|
+
@private
|
10665
10760
|
|
10666
|
-
|
10667
|
-
|
10668
|
-
return this.length > 0 ? this[this.length-1] : undefined;
|
10669
|
-
}),
|
10761
|
+
Invoked when the content property is about to change. Notifies observers that the
|
10762
|
+
entire array content will change.
|
10670
10763
|
|
10671
|
-
|
10672
|
-
|
10673
|
-
|
10674
|
-
|
10764
|
+
@method _contentWillChange
|
10765
|
+
*/
|
10766
|
+
_contentWillChange: Ember.beforeObserver(function() {
|
10767
|
+
this._teardownContent();
|
10768
|
+
}, 'content'),
|
10675
10769
|
|
10676
|
-
|
10677
|
-
|
10678
|
-
len = get(this, 'length'),
|
10679
|
-
added ;
|
10770
|
+
_teardownContent: function() {
|
10771
|
+
var content = get(this, 'content');
|
10680
10772
|
|
10681
|
-
if (
|
10773
|
+
if (content) {
|
10774
|
+
content.removeArrayObserver(this, {
|
10775
|
+
willChange: 'contentArrayWillChange',
|
10776
|
+
didChange: 'contentArrayDidChange'
|
10777
|
+
});
|
10778
|
+
}
|
10779
|
+
},
|
10682
10780
|
|
10683
|
-
|
10781
|
+
contentArrayWillChange: Ember.K,
|
10782
|
+
contentArrayDidChange: Ember.K,
|
10684
10783
|
|
10685
|
-
|
10686
|
-
|
10784
|
+
/**
|
10785
|
+
@private
|
10687
10786
|
|
10688
|
-
|
10689
|
-
|
10690
|
-
this[len] = obj;
|
10691
|
-
set(this, 'length', len+1);
|
10787
|
+
Invoked when the content property changes. Notifies observers that the
|
10788
|
+
entire array content has changed.
|
10692
10789
|
|
10693
|
-
|
10694
|
-
|
10790
|
+
@method _contentDidChange
|
10791
|
+
*/
|
10792
|
+
_contentDidChange: Ember.observer(function() {
|
10793
|
+
var content = get(this, 'content');
|
10695
10794
|
|
10696
|
-
|
10795
|
+
|
10796
|
+
this._setupContent();
|
10797
|
+
}, 'content'),
|
10798
|
+
|
10799
|
+
_setupContent: function() {
|
10800
|
+
var content = get(this, 'content');
|
10801
|
+
|
10802
|
+
if (content) {
|
10803
|
+
content.addArrayObserver(this, {
|
10804
|
+
willChange: 'contentArrayWillChange',
|
10805
|
+
didChange: 'contentArrayDidChange'
|
10806
|
+
});
|
10807
|
+
}
|
10697
10808
|
},
|
10698
10809
|
|
10699
|
-
|
10700
|
-
|
10701
|
-
|
10702
|
-
if (none(obj)) return this; // nothing to do
|
10810
|
+
_arrangedContentWillChange: Ember.beforeObserver(function() {
|
10811
|
+
var arrangedContent = get(this, 'arrangedContent'),
|
10812
|
+
len = arrangedContent ? get(arrangedContent, 'length') : 0;
|
10703
10813
|
|
10704
|
-
|
10705
|
-
|
10706
|
-
len = get(this, 'length'),
|
10707
|
-
isFirst = idx === 0,
|
10708
|
-
isLast = idx === len-1,
|
10709
|
-
last, removed;
|
10814
|
+
this.arrangedContentArrayWillChange(this, 0, len, undefined);
|
10815
|
+
this.arrangedContentWillChange(this);
|
10710
10816
|
|
10817
|
+
this._teardownArrangedContent(arrangedContent);
|
10818
|
+
}, 'arrangedContent'),
|
10711
10819
|
|
10712
|
-
|
10713
|
-
|
10820
|
+
_arrangedContentDidChange: Ember.observer(function() {
|
10821
|
+
var arrangedContent = get(this, 'arrangedContent'),
|
10822
|
+
len = arrangedContent ? get(arrangedContent, 'length') : 0;
|
10714
10823
|
|
10715
|
-
this.enumerableContentWillChange(removed, null);
|
10716
|
-
if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }
|
10717
|
-
if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }
|
10718
10824
|
|
10719
|
-
|
10720
|
-
if (idx < len-1) {
|
10721
|
-
last = this[len-1];
|
10722
|
-
this[idx] = last;
|
10723
|
-
this[guidFor(last)] = idx;
|
10724
|
-
}
|
10825
|
+
this._setupArrangedContent();
|
10725
10826
|
|
10726
|
-
|
10727
|
-
|
10728
|
-
|
10827
|
+
this.arrangedContentDidChange(this);
|
10828
|
+
this.arrangedContentArrayDidChange(this, 0, undefined, len);
|
10829
|
+
}, 'arrangedContent'),
|
10729
10830
|
|
10730
|
-
|
10731
|
-
|
10732
|
-
this.enumerableContentDidChange(removed, null);
|
10733
|
-
}
|
10831
|
+
_setupArrangedContent: function() {
|
10832
|
+
var arrangedContent = get(this, 'arrangedContent');
|
10734
10833
|
|
10735
|
-
|
10834
|
+
if (arrangedContent) {
|
10835
|
+
arrangedContent.addArrayObserver(this, {
|
10836
|
+
willChange: 'arrangedContentArrayWillChange',
|
10837
|
+
didChange: 'arrangedContentArrayDidChange'
|
10838
|
+
});
|
10839
|
+
}
|
10736
10840
|
},
|
10737
10841
|
|
10738
|
-
|
10739
|
-
|
10740
|
-
return this[guidFor(obj)]>=0;
|
10741
|
-
},
|
10842
|
+
_teardownArrangedContent: function() {
|
10843
|
+
var arrangedContent = get(this, 'arrangedContent');
|
10742
10844
|
|
10743
|
-
|
10744
|
-
|
10745
|
-
|
10746
|
-
|
10747
|
-
|
10748
|
-
ret[guidFor(this[loc])] = loc;
|
10845
|
+
if (arrangedContent) {
|
10846
|
+
arrangedContent.removeArrayObserver(this, {
|
10847
|
+
willChange: 'arrangedContentArrayWillChange',
|
10848
|
+
didChange: 'arrangedContentArrayDidChange'
|
10849
|
+
});
|
10749
10850
|
}
|
10750
|
-
return ret;
|
10751
10851
|
},
|
10752
10852
|
|
10753
|
-
|
10754
|
-
|
10755
|
-
for(idx = 0; idx < len; idx++) {
|
10756
|
-
array[idx] = this[idx];
|
10757
|
-
}
|
10758
|
-
return "Ember.Set<%@>".fmt(array.join(','));
|
10759
|
-
}
|
10853
|
+
arrangedContentWillChange: Ember.K,
|
10854
|
+
arrangedContentDidChange: Ember.K,
|
10760
10855
|
|
10761
|
-
|
10856
|
+
objectAt: function(idx) {
|
10857
|
+
return get(this, 'content') && this.objectAtContent(idx);
|
10858
|
+
},
|
10762
10859
|
|
10763
|
-
|
10860
|
+
length: Ember.computed(function() {
|
10861
|
+
var arrangedContent = get(this, 'arrangedContent');
|
10862
|
+
return arrangedContent ? get(arrangedContent, 'length') : 0;
|
10863
|
+
// No dependencies since Enumerable notifies length of change
|
10864
|
+
}),
|
10764
10865
|
|
10866
|
+
_replace: function(idx, amt, objects) {
|
10867
|
+
var content = get(this, 'content');
|
10765
10868
|
|
10869
|
+
if (content) this.replaceContent(idx, amt, objects);
|
10870
|
+
return this;
|
10871
|
+
},
|
10766
10872
|
|
10767
|
-
|
10768
|
-
|
10769
|
-
|
10770
|
-
|
10771
|
-
|
10873
|
+
replace: function() {
|
10874
|
+
if (get(this, 'arrangedContent') === get(this, 'content')) {
|
10875
|
+
this._replace.apply(this, arguments);
|
10876
|
+
} else {
|
10877
|
+
throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");
|
10878
|
+
}
|
10879
|
+
},
|
10772
10880
|
|
10773
|
-
|
10774
|
-
|
10775
|
-
|
10776
|
-
|
10881
|
+
_insertAt: function(idx, object) {
|
10882
|
+
if (idx > get(this, 'content.length')) throw new Error(OUT_OF_RANGE_EXCEPTION);
|
10883
|
+
this._replace(idx, 0, [object]);
|
10884
|
+
return this;
|
10885
|
+
},
|
10777
10886
|
|
10778
|
-
|
10779
|
-
|
10780
|
-
|
10781
|
-
|
10782
|
-
|
10783
|
-
|
10784
|
-
|
10887
|
+
insertAt: function(idx, object) {
|
10888
|
+
if (get(this, 'arrangedContent') === get(this, 'content')) {
|
10889
|
+
return this._insertAt(idx, object);
|
10890
|
+
} else {
|
10891
|
+
throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.");
|
10892
|
+
}
|
10893
|
+
},
|
10785
10894
|
|
10786
|
-
|
10895
|
+
removeAt: function(start, len) {
|
10896
|
+
if ('number' === typeof start) {
|
10897
|
+
var content = get(this, 'content'),
|
10898
|
+
arrangedContent = get(this, 'arrangedContent'),
|
10899
|
+
indices = [], i;
|
10787
10900
|
|
10901
|
+
if ((start < 0) || (start >= get(this, 'length'))) {
|
10902
|
+
throw new Error(OUT_OF_RANGE_EXCEPTION);
|
10903
|
+
}
|
10788
10904
|
|
10905
|
+
if (len === undefined) len = 1;
|
10789
10906
|
|
10790
|
-
|
10791
|
-
|
10792
|
-
|
10793
|
-
|
10794
|
-
|
10907
|
+
// Get a list of indices in original content to remove
|
10908
|
+
for (i=start; i<start+len; i++) {
|
10909
|
+
// Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent
|
10910
|
+
indices.push(content.indexOf(arrangedContent.objectAt(i)));
|
10911
|
+
}
|
10795
10912
|
|
10796
|
-
|
10913
|
+
// Replace in reverse order since indices will change
|
10914
|
+
indices.sort(function(a,b) { return b - a; });
|
10797
10915
|
|
10798
|
-
|
10799
|
-
|
10800
|
-
|
10801
|
-
|
10916
|
+
Ember.beginPropertyChanges();
|
10917
|
+
for (i=0; i<indices.length; i++) {
|
10918
|
+
this._replace(indices[i], 1, EMPTY);
|
10919
|
+
}
|
10920
|
+
Ember.endPropertyChanges();
|
10921
|
+
}
|
10802
10922
|
|
10803
|
-
|
10923
|
+
return this ;
|
10924
|
+
},
|
10804
10925
|
|
10805
|
-
|
10806
|
-
|
10807
|
-
|
10808
|
-
}
|
10809
|
-
```
|
10926
|
+
pushObject: function(obj) {
|
10927
|
+
this._insertAt(get(this, 'content.length'), obj) ;
|
10928
|
+
return obj ;
|
10929
|
+
},
|
10810
10930
|
|
10811
|
-
|
10812
|
-
|
10813
|
-
|
10814
|
-
|
10815
|
-
var Namespace = Ember.Namespace = Ember.Object.extend({
|
10816
|
-
isNamespace: true,
|
10931
|
+
pushObjects: function(objects) {
|
10932
|
+
this._replace(get(this, 'length'), 0, objects);
|
10933
|
+
return this;
|
10934
|
+
},
|
10817
10935
|
|
10818
|
-
|
10819
|
-
|
10820
|
-
|
10936
|
+
setObjects: function(objects) {
|
10937
|
+
if (objects.length === 0) return this.clear();
|
10938
|
+
|
10939
|
+
var len = get(this, 'length');
|
10940
|
+
this._replace(0, len, objects);
|
10941
|
+
return this;
|
10821
10942
|
},
|
10822
10943
|
|
10823
|
-
|
10824
|
-
|
10825
|
-
|
10944
|
+
unshiftObject: function(obj) {
|
10945
|
+
this._insertAt(0, obj) ;
|
10946
|
+
return obj ;
|
10947
|
+
},
|
10826
10948
|
|
10827
|
-
|
10828
|
-
|
10949
|
+
unshiftObjects: function(objects) {
|
10950
|
+
this._replace(0, 0, objects);
|
10951
|
+
return this;
|
10829
10952
|
},
|
10830
10953
|
|
10831
|
-
|
10832
|
-
|
10954
|
+
slice: function() {
|
10955
|
+
var arr = this.toArray();
|
10956
|
+
return arr.slice.apply(arr, arguments);
|
10833
10957
|
},
|
10834
10958
|
|
10835
|
-
|
10836
|
-
|
10837
|
-
|
10838
|
-
namespaces.splice(indexOf.call(namespaces, this), 1);
|
10839
|
-
this._super();
|
10840
|
-
}
|
10841
|
-
});
|
10959
|
+
arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {
|
10960
|
+
this.arrayContentWillChange(idx, removedCnt, addedCnt);
|
10961
|
+
},
|
10842
10962
|
|
10843
|
-
|
10844
|
-
|
10845
|
-
|
10846
|
-
PROCESSED: false,
|
10847
|
-
processAll: processAllNamespaces,
|
10848
|
-
byName: function(name) {
|
10849
|
-
if (!Ember.BOOTED) {
|
10850
|
-
processAllNamespaces();
|
10851
|
-
}
|
10963
|
+
arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {
|
10964
|
+
this.arrayContentDidChange(idx, removedCnt, addedCnt);
|
10965
|
+
},
|
10852
10966
|
|
10853
|
-
|
10967
|
+
init: function() {
|
10968
|
+
this._super();
|
10969
|
+
this._setupContent();
|
10970
|
+
this._setupArrangedContent();
|
10971
|
+
},
|
10972
|
+
|
10973
|
+
willDestroy: function() {
|
10974
|
+
this._teardownArrangedContent();
|
10975
|
+
this._teardownContent();
|
10854
10976
|
}
|
10855
10977
|
});
|
10856
10978
|
|
10857
|
-
var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;
|
10858
10979
|
|
10859
|
-
|
10860
|
-
guidFor = Ember.guidFor;
|
10980
|
+
})();
|
10861
10981
|
|
10862
|
-
function processNamespace(paths, root, seen) {
|
10863
|
-
var idx = paths.length;
|
10864
10982
|
|
10865
|
-
NAMESPACES_BY_ID[paths.join('.')] = root;
|
10866
|
-
|
10867
|
-
// Loop over all of the keys in the namespace, looking for classes
|
10868
|
-
for(var key in root) {
|
10869
|
-
if (!hasOwnProp.call(root, key)) { continue; }
|
10870
|
-
var obj = root[key];
|
10871
|
-
|
10872
|
-
// If we are processing the `Ember` namespace, for example, the
|
10873
|
-
// `paths` will start with `["Ember"]`. Every iteration through
|
10874
|
-
// the loop will update the **second** element of this list with
|
10875
|
-
// the key, so processing `Ember.View` will make the Array
|
10876
|
-
// `['Ember', 'View']`.
|
10877
|
-
paths[idx] = key;
|
10878
10983
|
|
10879
|
-
|
10880
|
-
|
10881
|
-
|
10882
|
-
|
10883
|
-
|
10884
|
-
obj[NAME_KEY] = paths.join('.');
|
10984
|
+
(function() {
|
10985
|
+
/**
|
10986
|
+
@module ember
|
10987
|
+
@submodule ember-runtime
|
10988
|
+
*/
|
10885
10989
|
|
10886
|
-
|
10887
|
-
|
10888
|
-
|
10889
|
-
|
10890
|
-
|
10990
|
+
var get = Ember.get,
|
10991
|
+
set = Ember.set,
|
10992
|
+
fmt = Ember.String.fmt,
|
10993
|
+
addBeforeObserver = Ember.addBeforeObserver,
|
10994
|
+
addObserver = Ember.addObserver,
|
10995
|
+
removeBeforeObserver = Ember.removeBeforeObserver,
|
10996
|
+
removeObserver = Ember.removeObserver,
|
10997
|
+
propertyWillChange = Ember.propertyWillChange,
|
10998
|
+
propertyDidChange = Ember.propertyDidChange;
|
10891
10999
|
|
10892
|
-
|
10893
|
-
|
10894
|
-
|
10895
|
-
|
11000
|
+
function contentPropertyWillChange(content, contentKey) {
|
11001
|
+
var key = contentKey.slice(8); // remove "content."
|
11002
|
+
if (key in this) { return; } // if shadowed in proxy
|
11003
|
+
propertyWillChange(this, key);
|
11004
|
+
}
|
10896
11005
|
|
10897
|
-
|
11006
|
+
function contentPropertyDidChange(content, contentKey) {
|
11007
|
+
var key = contentKey.slice(8); // remove "content."
|
11008
|
+
if (key in this) { return; } // if shadowed in proxy
|
11009
|
+
propertyDidChange(this, key);
|
10898
11010
|
}
|
10899
11011
|
|
10900
|
-
|
10901
|
-
|
11012
|
+
/**
|
11013
|
+
`Ember.ObjectProxy` forwards all properties not defined by the proxy itself
|
11014
|
+
to a proxied `content` object.
|
10902
11015
|
|
10903
|
-
|
11016
|
+
```javascript
|
11017
|
+
object = Ember.Object.create({
|
11018
|
+
name: 'Foo'
|
11019
|
+
});
|
10904
11020
|
|
10905
|
-
|
10906
|
-
|
10907
|
-
|
11021
|
+
proxy = Ember.ObjectProxy.create({
|
11022
|
+
content: object
|
11023
|
+
});
|
10908
11024
|
|
10909
|
-
|
10910
|
-
|
10911
|
-
|
10912
|
-
|
10913
|
-
if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }
|
11025
|
+
// Access and change existing properties
|
11026
|
+
proxy.get('name') // 'Foo'
|
11027
|
+
proxy.set('name', 'Bar');
|
11028
|
+
object.get('name') // 'Bar'
|
10914
11029
|
|
10915
|
-
|
10916
|
-
|
10917
|
-
|
10918
|
-
|
10919
|
-
isNamespace = obj && obj.isNamespace;
|
10920
|
-
} catch (e) {
|
10921
|
-
continue;
|
10922
|
-
}
|
11030
|
+
// Create new 'description' property on `object`
|
11031
|
+
proxy.set('description', 'Foo is a whizboo baz');
|
11032
|
+
object.get('description') // 'Foo is a whizboo baz'
|
11033
|
+
```
|
10923
11034
|
|
10924
|
-
|
11035
|
+
While `content` is unset, setting a property to be delegated will throw an
|
11036
|
+
Error.
|
10925
11037
|
|
10926
|
-
|
10927
|
-
|
10928
|
-
|
10929
|
-
|
11038
|
+
```javascript
|
11039
|
+
proxy = Ember.ObjectProxy.create({
|
11040
|
+
content: null,
|
11041
|
+
flag: null
|
11042
|
+
});
|
11043
|
+
proxy.set('flag', true);
|
11044
|
+
proxy.get('flag'); // true
|
11045
|
+
proxy.get('foo'); // undefined
|
11046
|
+
proxy.set('foo', 'data'); // throws Error
|
11047
|
+
```
|
10930
11048
|
|
10931
|
-
|
11049
|
+
Delegated properties can be bound to and will change when content is updated.
|
10932
11050
|
|
10933
|
-
|
10934
|
-
var superclass = mixin.superclass;
|
10935
|
-
if (superclass) {
|
10936
|
-
if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }
|
10937
|
-
else { return superClassString(superclass); }
|
10938
|
-
} else {
|
10939
|
-
return;
|
10940
|
-
}
|
10941
|
-
}
|
11051
|
+
Computed properties on the proxy itself can depend on delegated properties.
|
10942
11052
|
|
10943
|
-
|
10944
|
-
|
10945
|
-
|
10946
|
-
|
11053
|
+
```javascript
|
11054
|
+
ProxyWithComputedProperty = Ember.ObjectProxy.extend({
|
11055
|
+
fullName: function () {
|
11056
|
+
var firstName = this.get('firstName'),
|
11057
|
+
lastName = this.get('lastName');
|
11058
|
+
if (firstName && lastName) {
|
11059
|
+
return firstName + ' ' + lastName;
|
11060
|
+
}
|
11061
|
+
return firstName || lastName;
|
11062
|
+
}.property('firstName', 'lastName')
|
11063
|
+
});
|
10947
11064
|
|
10948
|
-
|
11065
|
+
proxy = ProxyWithComputedProperty.create();
|
10949
11066
|
|
10950
|
-
|
10951
|
-
|
10952
|
-
|
10953
|
-
|
10954
|
-
if (str) {
|
10955
|
-
ret = "(subclass of " + str + ")";
|
10956
|
-
} else {
|
10957
|
-
ret = "(unknown mixin)";
|
10958
|
-
}
|
10959
|
-
this.toString = makeToString(ret);
|
10960
|
-
}
|
11067
|
+
proxy.get('fullName'); // undefined
|
11068
|
+
proxy.set('content', {
|
11069
|
+
firstName: 'Tom', lastName: 'Dale'
|
11070
|
+
}); // triggers property change for fullName on proxy
|
10961
11071
|
|
10962
|
-
|
10963
|
-
|
11072
|
+
proxy.get('fullName'); // 'Tom Dale'
|
11073
|
+
```
|
10964
11074
|
|
10965
|
-
|
10966
|
-
|
10967
|
-
|
11075
|
+
@class ObjectProxy
|
11076
|
+
@namespace Ember
|
11077
|
+
@extends Ember.Object
|
11078
|
+
*/
|
11079
|
+
Ember.ObjectProxy = Ember.Object.extend(
|
11080
|
+
/** @scope Ember.ObjectProxy.prototype */ {
|
11081
|
+
/**
|
11082
|
+
The object whose properties will be forwarded.
|
10968
11083
|
|
10969
|
-
|
10970
|
-
|
10971
|
-
|
10972
|
-
|
11084
|
+
@property content
|
11085
|
+
@type Ember.Object
|
11086
|
+
@default null
|
11087
|
+
*/
|
11088
|
+
content: null,
|
11089
|
+
_contentDidChange: Ember.observer(function() {
|
10973
11090
|
|
10974
|
-
|
10975
|
-
var namespaces = Namespace.NAMESPACES, namespace;
|
10976
|
-
for (var i=0, l=namespaces.length; i<l; i++) {
|
10977
|
-
namespace = namespaces[i];
|
10978
|
-
processNamespace([namespace.toString()], namespace, {});
|
10979
|
-
}
|
11091
|
+
}, 'content'),
|
10980
11092
|
|
10981
|
-
|
10982
|
-
}
|
10983
|
-
}
|
11093
|
+
isTruthy: Ember.computed.bool('content'),
|
10984
11094
|
|
10985
|
-
|
10986
|
-
return function() { return ret; };
|
10987
|
-
}
|
11095
|
+
_debugContainerKey: null,
|
10988
11096
|
|
10989
|
-
|
11097
|
+
willWatchProperty: function (key) {
|
11098
|
+
var contentKey = 'content.' + key;
|
11099
|
+
addBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
11100
|
+
addObserver(this, contentKey, null, contentPropertyDidChange);
|
11101
|
+
},
|
10990
11102
|
|
10991
|
-
|
11103
|
+
didUnwatchProperty: function (key) {
|
11104
|
+
var contentKey = 'content.' + key;
|
11105
|
+
removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
11106
|
+
removeObserver(this, contentKey, null, contentPropertyDidChange);
|
11107
|
+
},
|
11108
|
+
|
11109
|
+
unknownProperty: function (key) {
|
11110
|
+
var content = get(this, 'content');
|
11111
|
+
if (content) {
|
11112
|
+
return get(content, key);
|
11113
|
+
}
|
11114
|
+
},
|
10992
11115
|
|
11116
|
+
setUnknownProperty: function (key, value) {
|
11117
|
+
var content = get(this, 'content');
|
10993
11118
|
|
11119
|
+
return set(content, key, value);
|
11120
|
+
}
|
11121
|
+
});
|
10994
11122
|
|
10995
|
-
(
|
10996
|
-
|
11123
|
+
Ember.ObjectProxy.reopenClass({
|
11124
|
+
create: function () {
|
11125
|
+
var mixin, prototype, i, l, properties, keyName;
|
11126
|
+
if (arguments.length) {
|
11127
|
+
prototype = this.proto();
|
11128
|
+
for (i = 0, l = arguments.length; i < l; i++) {
|
11129
|
+
properties = arguments[i];
|
11130
|
+
for (keyName in properties) {
|
11131
|
+
if (!properties.hasOwnProperty(keyName) || keyName in prototype) { continue; }
|
11132
|
+
if (!mixin) mixin = {};
|
11133
|
+
mixin[keyName] = null;
|
11134
|
+
}
|
11135
|
+
}
|
11136
|
+
if (mixin) this._initMixins([mixin]);
|
11137
|
+
}
|
11138
|
+
return this._super.apply(this, arguments);
|
11139
|
+
}
|
11140
|
+
});
|
10997
11141
|
|
10998
11142
|
})();
|
10999
11143
|
|
@@ -11006,235 +11150,203 @@ Ember.Application = Ember.Namespace.extend();
|
|
11006
11150
|
*/
|
11007
11151
|
|
11008
11152
|
|
11009
|
-
var get = Ember.get,
|
11010
|
-
|
11011
|
-
/**
|
11012
|
-
An ArrayProxy wraps any other object that implements `Ember.Array` and/or
|
11013
|
-
`Ember.MutableArray,` forwarding all requests. This makes it very useful for
|
11014
|
-
a number of binding use cases or other cases where being able to swap
|
11015
|
-
out the underlying array is useful.
|
11153
|
+
var set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;
|
11154
|
+
var forEach = Ember.EnumerableUtils.forEach;
|
11016
11155
|
|
11017
|
-
|
11156
|
+
var EachArray = Ember.Object.extend(Ember.Array, {
|
11018
11157
|
|
11019
|
-
|
11020
|
-
|
11021
|
-
|
11158
|
+
init: function(content, keyName, owner) {
|
11159
|
+
this._super();
|
11160
|
+
this._keyName = keyName;
|
11161
|
+
this._owner = owner;
|
11162
|
+
this._content = content;
|
11163
|
+
},
|
11022
11164
|
|
11023
|
-
|
11024
|
-
|
11025
|
-
|
11026
|
-
|
11027
|
-
|
11028
|
-
This class can also be useful as a layer to transform the contents of
|
11029
|
-
an array, as they are accessed. This can be done by overriding
|
11030
|
-
`objectAtContent`:
|
11165
|
+
objectAt: function(idx) {
|
11166
|
+
var item = this._content.objectAt(idx);
|
11167
|
+
return item && get(item, this._keyName);
|
11168
|
+
},
|
11031
11169
|
|
11032
|
-
|
11033
|
-
|
11034
|
-
|
11035
|
-
|
11036
|
-
objectAtContent: function(idx) {
|
11037
|
-
return this.get('content').objectAt(idx).toUpperCase();
|
11038
|
-
}
|
11039
|
-
});
|
11170
|
+
length: Ember.computed(function() {
|
11171
|
+
var content = this._content;
|
11172
|
+
return content ? get(content, 'length') : 0;
|
11173
|
+
})
|
11040
11174
|
|
11041
|
-
|
11042
|
-
```
|
11175
|
+
});
|
11043
11176
|
|
11044
|
-
|
11045
|
-
@namespace Ember
|
11046
|
-
@extends Ember.Object
|
11047
|
-
@uses Ember.MutableArray
|
11048
|
-
*/
|
11049
|
-
Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
|
11050
|
-
/** @scope Ember.ArrayProxy.prototype */ {
|
11177
|
+
var IS_OBSERVER = /^.+:(before|change)$/;
|
11051
11178
|
|
11052
|
-
|
11053
|
-
|
11054
|
-
|
11179
|
+
function addObserverForContentKey(content, keyName, proxy, idx, loc) {
|
11180
|
+
var objects = proxy._objects, guid;
|
11181
|
+
if (!objects) objects = proxy._objects = {};
|
11055
11182
|
|
11056
|
-
|
11057
|
-
|
11058
|
-
|
11059
|
-
|
11183
|
+
while(--loc>=idx) {
|
11184
|
+
var item = content.objectAt(loc);
|
11185
|
+
if (item) {
|
11186
|
+
Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
|
11187
|
+
Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');
|
11060
11188
|
|
11061
|
-
|
11062
|
-
|
11063
|
-
|
11064
|
-
|
11189
|
+
// keep track of the index each item was found at so we can map
|
11190
|
+
// it back when the obj changes.
|
11191
|
+
guid = guidFor(item);
|
11192
|
+
if (!objects[guid]) objects[guid] = [];
|
11193
|
+
objects[guid].push(loc);
|
11194
|
+
}
|
11195
|
+
}
|
11196
|
+
}
|
11065
11197
|
|
11066
|
-
|
11067
|
-
|
11068
|
-
|
11198
|
+
function removeObserverForContentKey(content, keyName, proxy, idx, loc) {
|
11199
|
+
var objects = proxy._objects;
|
11200
|
+
if (!objects) objects = proxy._objects = {};
|
11201
|
+
var indicies, guid;
|
11069
11202
|
|
11070
|
-
|
11071
|
-
|
11072
|
-
|
11073
|
-
|
11203
|
+
while(--loc>=idx) {
|
11204
|
+
var item = content.objectAt(loc);
|
11205
|
+
if (item) {
|
11206
|
+
Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
|
11207
|
+
Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');
|
11074
11208
|
|
11075
|
-
|
11209
|
+
guid = guidFor(item);
|
11210
|
+
indicies = objects[guid];
|
11211
|
+
indicies[indicies.indexOf(loc)] = null;
|
11212
|
+
}
|
11213
|
+
}
|
11214
|
+
}
|
11076
11215
|
|
11077
|
-
|
11078
|
-
|
11079
|
-
|
11080
|
-
|
11081
|
-
objectAtContent: function(idx) {
|
11082
|
-
return get(this, 'arrangedContent').objectAt(idx);
|
11083
|
-
},
|
11216
|
+
/**
|
11217
|
+
This is the object instance returned when you get the `@each` property on an
|
11218
|
+
array. It uses the unknownProperty handler to automatically create
|
11219
|
+
EachArray instances for property names.
|
11084
11220
|
|
11085
|
-
|
11086
|
-
|
11087
|
-
|
11088
|
-
|
11221
|
+
@private
|
11222
|
+
@class EachProxy
|
11223
|
+
@namespace Ember
|
11224
|
+
@extends Ember.Object
|
11225
|
+
*/
|
11226
|
+
Ember.EachProxy = Ember.Object.extend({
|
11089
11227
|
|
11090
|
-
|
11228
|
+
init: function(content) {
|
11229
|
+
this._super();
|
11230
|
+
this._content = content;
|
11231
|
+
content.addArrayObserver(this);
|
11091
11232
|
|
11092
|
-
|
11093
|
-
|
11094
|
-
|
11095
|
-
|
11096
|
-
|
11097
|
-
@return {void}
|
11098
|
-
*/
|
11099
|
-
replaceContent: function(idx, amt, objects) {
|
11100
|
-
get(this, 'content').replace(idx, amt, objects);
|
11233
|
+
// in case someone is already observing some keys make sure they are
|
11234
|
+
// added
|
11235
|
+
forEach(Ember.watchedEvents(this), function(eventName) {
|
11236
|
+
this.didAddListener(eventName);
|
11237
|
+
}, this);
|
11101
11238
|
},
|
11102
11239
|
|
11103
11240
|
/**
|
11104
|
-
|
11105
|
-
|
11106
|
-
Invoked when the content property is about to change. Notifies observers that the
|
11107
|
-
entire array content will change.
|
11241
|
+
You can directly access mapped properties by simply requesting them.
|
11242
|
+
The `unknownProperty` handler will generate an EachArray of each item.
|
11108
11243
|
|
11109
|
-
@method
|
11244
|
+
@method unknownProperty
|
11245
|
+
@param keyName {String}
|
11246
|
+
@param value {anything}
|
11110
11247
|
*/
|
11111
|
-
|
11112
|
-
|
11113
|
-
|
11114
|
-
|
11115
|
-
|
11116
|
-
|
11117
|
-
|
11118
|
-
if (content) {
|
11119
|
-
content.removeArrayObserver(this, {
|
11120
|
-
willChange: 'contentArrayWillChange',
|
11121
|
-
didChange: 'contentArrayDidChange'
|
11122
|
-
});
|
11123
|
-
}
|
11248
|
+
unknownProperty: function(keyName, value) {
|
11249
|
+
var ret;
|
11250
|
+
ret = new EachArray(this._content, keyName, this);
|
11251
|
+
Ember.defineProperty(this, keyName, null, ret);
|
11252
|
+
this.beginObservingContentKey(keyName);
|
11253
|
+
return ret;
|
11124
11254
|
},
|
11125
11255
|
|
11126
|
-
|
11127
|
-
|
11128
|
-
|
11129
|
-
/**
|
11130
|
-
@private
|
11131
|
-
|
11132
|
-
Invoked when the content property changes. Notifies observers that the
|
11133
|
-
entire array content has changed.
|
11256
|
+
// ..........................................................
|
11257
|
+
// ARRAY CHANGES
|
11258
|
+
// Invokes whenever the content array itself changes.
|
11134
11259
|
|
11135
|
-
|
11136
|
-
|
11137
|
-
_contentDidChange: Ember.observer(function() {
|
11138
|
-
var content = get(this, 'content');
|
11260
|
+
arrayWillChange: function(content, idx, removedCnt, addedCnt) {
|
11261
|
+
var keys = this._keys, key, lim;
|
11139
11262
|
|
11263
|
+
lim = removedCnt>0 ? idx+removedCnt : -1;
|
11264
|
+
Ember.beginPropertyChanges(this);
|
11140
11265
|
|
11141
|
-
|
11142
|
-
|
11266
|
+
for(key in keys) {
|
11267
|
+
if (!keys.hasOwnProperty(key)) { continue; }
|
11143
11268
|
|
11144
|
-
|
11145
|
-
var content = get(this, 'content');
|
11269
|
+
if (lim>0) removeObserverForContentKey(content, key, this, idx, lim);
|
11146
11270
|
|
11147
|
-
|
11148
|
-
content.addArrayObserver(this, {
|
11149
|
-
willChange: 'contentArrayWillChange',
|
11150
|
-
didChange: 'contentArrayDidChange'
|
11151
|
-
});
|
11271
|
+
Ember.propertyWillChange(this, key);
|
11152
11272
|
}
|
11153
|
-
},
|
11154
11273
|
|
11155
|
-
|
11156
|
-
|
11157
|
-
|
11274
|
+
Ember.propertyWillChange(this._content, '@each');
|
11275
|
+
Ember.endPropertyChanges(this);
|
11276
|
+
},
|
11158
11277
|
|
11159
|
-
|
11160
|
-
this.
|
11278
|
+
arrayDidChange: function(content, idx, removedCnt, addedCnt) {
|
11279
|
+
var keys = this._keys, key, lim;
|
11161
11280
|
|
11162
|
-
|
11163
|
-
|
11281
|
+
lim = addedCnt>0 ? idx+addedCnt : -1;
|
11282
|
+
Ember.beginPropertyChanges(this);
|
11164
11283
|
|
11165
|
-
|
11166
|
-
|
11167
|
-
len = arrangedContent ? get(arrangedContent, 'length') : 0;
|
11284
|
+
for(key in keys) {
|
11285
|
+
if (!keys.hasOwnProperty(key)) { continue; }
|
11168
11286
|
|
11287
|
+
if (lim>0) addObserverForContentKey(content, key, this, idx, lim);
|
11169
11288
|
|
11170
|
-
|
11289
|
+
Ember.propertyDidChange(this, key);
|
11290
|
+
}
|
11171
11291
|
|
11172
|
-
|
11173
|
-
|
11174
|
-
},
|
11292
|
+
Ember.propertyDidChange(this._content, '@each');
|
11293
|
+
Ember.endPropertyChanges(this);
|
11294
|
+
},
|
11175
11295
|
|
11176
|
-
|
11177
|
-
|
11296
|
+
// ..........................................................
|
11297
|
+
// LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS
|
11298
|
+
// Start monitoring keys based on who is listening...
|
11178
11299
|
|
11179
|
-
|
11180
|
-
|
11181
|
-
|
11182
|
-
didChange: 'arrangedContentArrayDidChange'
|
11183
|
-
});
|
11300
|
+
didAddListener: function(eventName) {
|
11301
|
+
if (IS_OBSERVER.test(eventName)) {
|
11302
|
+
this.beginObservingContentKey(eventName.slice(0, -7));
|
11184
11303
|
}
|
11185
11304
|
},
|
11186
11305
|
|
11187
|
-
|
11188
|
-
|
11189
|
-
|
11190
|
-
if (arrangedContent) {
|
11191
|
-
arrangedContent.removeArrayObserver(this, {
|
11192
|
-
willChange: 'arrangedContentArrayWillChange',
|
11193
|
-
didChange: 'arrangedContentArrayDidChange'
|
11194
|
-
});
|
11306
|
+
didRemoveListener: function(eventName) {
|
11307
|
+
if (IS_OBSERVER.test(eventName)) {
|
11308
|
+
this.stopObservingContentKey(eventName.slice(0, -7));
|
11195
11309
|
}
|
11196
11310
|
},
|
11197
11311
|
|
11198
|
-
|
11199
|
-
|
11312
|
+
// ..........................................................
|
11313
|
+
// CONTENT KEY OBSERVING
|
11314
|
+
// Actual watch keys on the source content.
|
11200
11315
|
|
11201
|
-
|
11202
|
-
|
11316
|
+
beginObservingContentKey: function(keyName) {
|
11317
|
+
var keys = this._keys;
|
11318
|
+
if (!keys) keys = this._keys = {};
|
11319
|
+
if (!keys[keyName]) {
|
11320
|
+
keys[keyName] = 1;
|
11321
|
+
var content = this._content,
|
11322
|
+
len = get(content, 'length');
|
11323
|
+
addObserverForContentKey(content, keyName, this, 0, len);
|
11324
|
+
} else {
|
11325
|
+
keys[keyName]++;
|
11326
|
+
}
|
11203
11327
|
},
|
11204
11328
|
|
11205
|
-
|
11206
|
-
var
|
11207
|
-
|
11208
|
-
|
11209
|
-
|
11210
|
-
|
11211
|
-
|
11212
|
-
|
11213
|
-
if (get(this, 'content')) this.replaceContent(idx, amt, objects);
|
11214
|
-
return this;
|
11215
|
-
},
|
11216
|
-
|
11217
|
-
arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {
|
11218
|
-
this.arrayContentWillChange(idx, removedCnt, addedCnt);
|
11219
|
-
},
|
11220
|
-
|
11221
|
-
arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {
|
11222
|
-
this.arrayContentDidChange(idx, removedCnt, addedCnt);
|
11329
|
+
stopObservingContentKey: function(keyName) {
|
11330
|
+
var keys = this._keys;
|
11331
|
+
if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {
|
11332
|
+
var content = this._content,
|
11333
|
+
len = get(content, 'length');
|
11334
|
+
removeObserverForContentKey(content, keyName, this, 0, len);
|
11335
|
+
}
|
11223
11336
|
},
|
11224
11337
|
|
11225
|
-
|
11226
|
-
|
11227
|
-
this._setupContent();
|
11228
|
-
this._setupArrangedContent();
|
11338
|
+
contentKeyWillChange: function(obj, keyName) {
|
11339
|
+
Ember.propertyWillChange(this, keyName);
|
11229
11340
|
},
|
11230
11341
|
|
11231
|
-
|
11232
|
-
|
11233
|
-
this._teardownContent();
|
11342
|
+
contentKeyDidChange: function(obj, keyName) {
|
11343
|
+
Ember.propertyDidChange(this, keyName);
|
11234
11344
|
}
|
11345
|
+
|
11235
11346
|
});
|
11236
11347
|
|
11237
11348
|
|
11349
|
+
|
11238
11350
|
})();
|
11239
11351
|
|
11240
11352
|
|
@@ -11245,524 +11357,611 @@ Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
|
|
11245
11357
|
@submodule ember-runtime
|
11246
11358
|
*/
|
11247
11359
|
|
11248
|
-
var get = Ember.get,
|
11249
|
-
set = Ember.set,
|
11250
|
-
fmt = Ember.String.fmt,
|
11251
|
-
addBeforeObserver = Ember.addBeforeObserver,
|
11252
|
-
addObserver = Ember.addObserver,
|
11253
|
-
removeBeforeObserver = Ember.removeBeforeObserver,
|
11254
|
-
removeObserver = Ember.removeObserver,
|
11255
|
-
propertyWillChange = Ember.propertyWillChange,
|
11256
|
-
propertyDidChange = Ember.propertyDidChange;
|
11257
|
-
|
11258
|
-
function contentPropertyWillChange(content, contentKey) {
|
11259
|
-
var key = contentKey.slice(8); // remove "content."
|
11260
|
-
if (key in this) { return; } // if shadowed in proxy
|
11261
|
-
propertyWillChange(this, key);
|
11262
|
-
}
|
11263
|
-
|
11264
|
-
function contentPropertyDidChange(content, contentKey) {
|
11265
|
-
var key = contentKey.slice(8); // remove "content."
|
11266
|
-
if (key in this) { return; } // if shadowed in proxy
|
11267
|
-
propertyDidChange(this, key);
|
11268
|
-
}
|
11269
|
-
|
11270
|
-
/**
|
11271
|
-
`Ember.ObjectProxy` forwards all properties not defined by the proxy itself
|
11272
|
-
to a proxied `content` object.
|
11273
|
-
|
11274
|
-
```javascript
|
11275
|
-
object = Ember.Object.create({
|
11276
|
-
name: 'Foo'
|
11277
|
-
});
|
11278
|
-
|
11279
|
-
proxy = Ember.ObjectProxy.create({
|
11280
|
-
content: object
|
11281
|
-
});
|
11282
|
-
|
11283
|
-
// Access and change existing properties
|
11284
|
-
proxy.get('name') // 'Foo'
|
11285
|
-
proxy.set('name', 'Bar');
|
11286
|
-
object.get('name') // 'Bar'
|
11287
|
-
|
11288
|
-
// Create new 'description' property on `object`
|
11289
|
-
proxy.set('description', 'Foo is a whizboo baz');
|
11290
|
-
object.get('description') // 'Foo is a whizboo baz'
|
11291
|
-
```
|
11292
|
-
|
11293
|
-
While `content` is unset, setting a property to be delegated will throw an
|
11294
|
-
Error.
|
11295
11360
|
|
11296
|
-
|
11297
|
-
proxy = Ember.ObjectProxy.create({
|
11298
|
-
content: null,
|
11299
|
-
flag: null
|
11300
|
-
});
|
11301
|
-
proxy.set('flag', true);
|
11302
|
-
proxy.get('flag'); // true
|
11303
|
-
proxy.get('foo'); // undefined
|
11304
|
-
proxy.set('foo', 'data'); // throws Error
|
11305
|
-
```
|
11361
|
+
var get = Ember.get, set = Ember.set;
|
11306
11362
|
|
11307
|
-
|
11363
|
+
// Add Ember.Array to Array.prototype. Remove methods with native
|
11364
|
+
// implementations and supply some more optimized versions of generic methods
|
11365
|
+
// because they are so common.
|
11366
|
+
var NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {
|
11308
11367
|
|
11309
|
-
|
11368
|
+
// because length is a built-in property we need to know to just get the
|
11369
|
+
// original property.
|
11370
|
+
get: function(key) {
|
11371
|
+
if (key==='length') return this.length;
|
11372
|
+
else if ('number' === typeof key) return this[key];
|
11373
|
+
else return this._super(key);
|
11374
|
+
},
|
11310
11375
|
|
11311
|
-
|
11312
|
-
|
11313
|
-
|
11314
|
-
var firstName = this.get('firstName'),
|
11315
|
-
lastName = this.get('lastName');
|
11316
|
-
if (firstName && lastName) {
|
11317
|
-
return firstName + ' ' + lastName;
|
11318
|
-
}
|
11319
|
-
return firstName || lastName;
|
11320
|
-
}.property('firstName', 'lastName')
|
11321
|
-
});
|
11376
|
+
objectAt: function(idx) {
|
11377
|
+
return this[idx];
|
11378
|
+
},
|
11322
11379
|
|
11323
|
-
|
11380
|
+
// primitive for array support.
|
11381
|
+
replace: function(idx, amt, objects) {
|
11324
11382
|
|
11325
|
-
|
11326
|
-
proxy.set('content', {
|
11327
|
-
firstName: 'Tom', lastName: 'Dale'
|
11328
|
-
}); // triggers property change for fullName on proxy
|
11383
|
+
if (this.isFrozen) throw Ember.FROZEN_ERROR ;
|
11329
11384
|
|
11330
|
-
|
11331
|
-
|
11385
|
+
// if we replaced exactly the same number of items, then pass only the
|
11386
|
+
// replaced range. Otherwise, pass the full remaining array length
|
11387
|
+
// since everything has shifted
|
11388
|
+
var len = objects ? get(objects, 'length') : 0;
|
11389
|
+
this.arrayContentWillChange(idx, amt, len);
|
11332
11390
|
|
11333
|
-
|
11334
|
-
|
11335
|
-
|
11336
|
-
|
11337
|
-
|
11338
|
-
|
11339
|
-
/**
|
11340
|
-
The object whose properties will be forwarded.
|
11391
|
+
if (!objects || objects.length === 0) {
|
11392
|
+
this.splice(idx, amt) ;
|
11393
|
+
} else {
|
11394
|
+
var args = [idx, amt].concat(objects) ;
|
11395
|
+
this.splice.apply(this,args) ;
|
11396
|
+
}
|
11341
11397
|
|
11342
|
-
|
11343
|
-
|
11344
|
-
|
11345
|
-
*/
|
11346
|
-
content: null,
|
11347
|
-
_contentDidChange: Ember.observer(function() {
|
11398
|
+
this.arrayContentDidChange(idx, amt, len);
|
11399
|
+
return this ;
|
11400
|
+
},
|
11348
11401
|
|
11349
|
-
|
11402
|
+
// If you ask for an unknown property, then try to collect the value
|
11403
|
+
// from member items.
|
11404
|
+
unknownProperty: function(key, value) {
|
11405
|
+
var ret;// = this.reducedProperty(key, value) ;
|
11406
|
+
if ((value !== undefined) && ret === undefined) {
|
11407
|
+
ret = this[key] = value;
|
11408
|
+
}
|
11409
|
+
return ret ;
|
11410
|
+
},
|
11350
11411
|
|
11351
|
-
|
11412
|
+
// If browser did not implement indexOf natively, then override with
|
11413
|
+
// specialized version
|
11414
|
+
indexOf: function(object, startAt) {
|
11415
|
+
var idx, len = this.length;
|
11352
11416
|
|
11353
|
-
|
11417
|
+
if (startAt === undefined) startAt = 0;
|
11418
|
+
else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
|
11419
|
+
if (startAt < 0) startAt += len;
|
11354
11420
|
|
11355
|
-
|
11356
|
-
|
11357
|
-
|
11358
|
-
|
11421
|
+
for(idx=startAt;idx<len;idx++) {
|
11422
|
+
if (this[idx] === object) return idx ;
|
11423
|
+
}
|
11424
|
+
return -1;
|
11359
11425
|
},
|
11360
11426
|
|
11361
|
-
|
11362
|
-
var
|
11363
|
-
removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
11364
|
-
removeObserver(this, contentKey, null, contentPropertyDidChange);
|
11365
|
-
},
|
11427
|
+
lastIndexOf: function(object, startAt) {
|
11428
|
+
var idx, len = this.length;
|
11366
11429
|
|
11367
|
-
|
11368
|
-
|
11369
|
-
if (
|
11370
|
-
|
11430
|
+
if (startAt === undefined) startAt = len-1;
|
11431
|
+
else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
|
11432
|
+
if (startAt < 0) startAt += len;
|
11433
|
+
|
11434
|
+
for(idx=startAt;idx>=0;idx--) {
|
11435
|
+
if (this[idx] === object) return idx ;
|
11371
11436
|
}
|
11437
|
+
return -1;
|
11372
11438
|
},
|
11373
11439
|
|
11374
|
-
|
11375
|
-
|
11440
|
+
copy: function(deep) {
|
11441
|
+
if (deep) {
|
11442
|
+
return this.map(function(item){ return Ember.copy(item, true); });
|
11443
|
+
}
|
11376
11444
|
|
11377
|
-
return
|
11445
|
+
return this.slice();
|
11378
11446
|
}
|
11379
11447
|
});
|
11380
11448
|
|
11381
|
-
|
11382
|
-
|
11383
|
-
|
11384
|
-
|
11385
|
-
prototype = this.proto();
|
11386
|
-
for (i = 0, l = arguments.length; i < l; i++) {
|
11387
|
-
properties = arguments[i];
|
11388
|
-
for (keyName in properties) {
|
11389
|
-
if (!properties.hasOwnProperty(keyName) || keyName in prototype) { continue; }
|
11390
|
-
if (!mixin) mixin = {};
|
11391
|
-
mixin[keyName] = null;
|
11392
|
-
}
|
11393
|
-
}
|
11394
|
-
if (mixin) this._initMixins([mixin]);
|
11395
|
-
}
|
11396
|
-
return this._super.apply(this, arguments);
|
11397
|
-
}
|
11449
|
+
// Remove any methods implemented natively so we don't override them
|
11450
|
+
var ignore = ['length'];
|
11451
|
+
Ember.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {
|
11452
|
+
if (Array.prototype[methodName]) ignore.push(methodName);
|
11398
11453
|
});
|
11399
11454
|
|
11400
|
-
|
11455
|
+
if (ignore.length>0) {
|
11456
|
+
NativeArray = NativeArray.without.apply(NativeArray, ignore);
|
11457
|
+
}
|
11401
11458
|
|
11459
|
+
/**
|
11460
|
+
The NativeArray mixin contains the properties needed to to make the native
|
11461
|
+
Array support Ember.MutableArray and all of its dependent APIs. Unless you
|
11462
|
+
have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to
|
11463
|
+
false, this will be applied automatically. Otherwise you can apply the mixin
|
11464
|
+
at anytime by calling `Ember.NativeArray.activate`.
|
11402
11465
|
|
11466
|
+
@class NativeArray
|
11467
|
+
@namespace Ember
|
11468
|
+
@extends Ember.Mixin
|
11469
|
+
@uses Ember.MutableArray
|
11470
|
+
@uses Ember.MutableEnumerable
|
11471
|
+
@uses Ember.Copyable
|
11472
|
+
@uses Ember.Freezable
|
11473
|
+
*/
|
11474
|
+
Ember.NativeArray = NativeArray;
|
11403
11475
|
|
11404
|
-
(function() {
|
11405
11476
|
/**
|
11406
|
-
|
11407
|
-
|
11408
|
-
*/
|
11477
|
+
Creates an `Ember.NativeArray` from an Array like object.
|
11478
|
+
Does not modify the original object.
|
11409
11479
|
|
11480
|
+
@method A
|
11481
|
+
@for Ember
|
11482
|
+
@return {Ember.NativeArray}
|
11483
|
+
*/
|
11484
|
+
Ember.A = function(arr){
|
11485
|
+
if (arr === undefined) { arr = []; }
|
11486
|
+
return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);
|
11487
|
+
};
|
11410
11488
|
|
11411
|
-
|
11412
|
-
|
11489
|
+
/**
|
11490
|
+
Activates the mixin on the Array.prototype if not already applied. Calling
|
11491
|
+
this method more than once is safe.
|
11413
11492
|
|
11414
|
-
|
11493
|
+
@method activate
|
11494
|
+
@for Ember.NativeArray
|
11495
|
+
@static
|
11496
|
+
@return {void}
|
11497
|
+
*/
|
11498
|
+
Ember.NativeArray.activate = function() {
|
11499
|
+
NativeArray.apply(Array.prototype);
|
11415
11500
|
|
11416
|
-
|
11417
|
-
|
11418
|
-
this._keyName = keyName;
|
11419
|
-
this._owner = owner;
|
11420
|
-
this._content = content;
|
11421
|
-
},
|
11501
|
+
Ember.A = function(arr) { return arr || []; };
|
11502
|
+
};
|
11422
11503
|
|
11423
|
-
|
11424
|
-
|
11425
|
-
|
11426
|
-
},
|
11504
|
+
if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {
|
11505
|
+
Ember.NativeArray.activate();
|
11506
|
+
}
|
11427
11507
|
|
11428
|
-
length: Ember.computed(function() {
|
11429
|
-
var content = this._content;
|
11430
|
-
return content ? get(content, 'length') : 0;
|
11431
|
-
})
|
11432
11508
|
|
11433
|
-
});
|
11509
|
+
})();
|
11434
11510
|
|
11435
|
-
var IS_OBSERVER = /^.+:(before|change)$/;
|
11436
11511
|
|
11437
|
-
function addObserverForContentKey(content, keyName, proxy, idx, loc) {
|
11438
|
-
var objects = proxy._objects, guid;
|
11439
|
-
if (!objects) objects = proxy._objects = {};
|
11440
11512
|
|
11441
|
-
|
11442
|
-
|
11443
|
-
|
11444
|
-
|
11445
|
-
|
11513
|
+
(function() {
|
11514
|
+
/**
|
11515
|
+
@module ember
|
11516
|
+
@submodule ember-runtime
|
11517
|
+
*/
|
11446
11518
|
|
11447
|
-
|
11448
|
-
// it back when the obj changes.
|
11449
|
-
guid = guidFor(item);
|
11450
|
-
if (!objects[guid]) objects[guid] = [];
|
11451
|
-
objects[guid].push(loc);
|
11452
|
-
}
|
11453
|
-
}
|
11454
|
-
}
|
11519
|
+
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.isNone, fmt = Ember.String.fmt;
|
11455
11520
|
|
11456
|
-
|
11457
|
-
|
11458
|
-
if (!objects) objects = proxy._objects = {};
|
11459
|
-
var indicies, guid;
|
11521
|
+
/**
|
11522
|
+
An unordered collection of objects.
|
11460
11523
|
|
11461
|
-
|
11462
|
-
|
11463
|
-
|
11464
|
-
|
11465
|
-
Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');
|
11524
|
+
A Set works a bit like an array except that its items are not ordered. You
|
11525
|
+
can create a set to efficiently test for membership for an object. You can
|
11526
|
+
also iterate through a set just like an array, even accessing objects by
|
11527
|
+
index, however there is no guarantee as to their order.
|
11466
11528
|
|
11467
|
-
|
11468
|
-
|
11469
|
-
indicies[indicies.indexOf(loc)] = null;
|
11470
|
-
}
|
11471
|
-
}
|
11472
|
-
}
|
11529
|
+
All Sets are observable via the Enumerable Observer API - which works
|
11530
|
+
on any enumerable object including both Sets and Arrays.
|
11473
11531
|
|
11474
|
-
|
11475
|
-
This is the object instance returned when you get the `@each` property on an
|
11476
|
-
array. It uses the unknownProperty handler to automatically create
|
11477
|
-
EachArray instances for property names.
|
11532
|
+
## Creating a Set
|
11478
11533
|
|
11479
|
-
|
11480
|
-
|
11534
|
+
You can create a set like you would most objects using
|
11535
|
+
`new Ember.Set()`. Most new sets you create will be empty, but you can
|
11536
|
+
also initialize the set with some content by passing an array or other
|
11537
|
+
enumerable of objects to the constructor.
|
11538
|
+
|
11539
|
+
Finally, you can pass in an existing set and the set will be copied. You
|
11540
|
+
can also create a copy of a set by calling `Ember.Set#copy()`.
|
11541
|
+
|
11542
|
+
```javascript
|
11543
|
+
// creates a new empty set
|
11544
|
+
var foundNames = new Ember.Set();
|
11545
|
+
|
11546
|
+
// creates a set with four names in it.
|
11547
|
+
var names = new Ember.Set(["Charles", "Tom", "Juan", "Alex"]); // :P
|
11548
|
+
|
11549
|
+
// creates a copy of the names set.
|
11550
|
+
var namesCopy = new Ember.Set(names);
|
11551
|
+
|
11552
|
+
// same as above.
|
11553
|
+
var anotherNamesCopy = names.copy();
|
11554
|
+
```
|
11555
|
+
|
11556
|
+
## Adding/Removing Objects
|
11557
|
+
|
11558
|
+
You generally add or remove objects from a set using `add()` or
|
11559
|
+
`remove()`. You can add any type of object including primitives such as
|
11560
|
+
numbers, strings, and booleans.
|
11561
|
+
|
11562
|
+
Unlike arrays, objects can only exist one time in a set. If you call `add()`
|
11563
|
+
on a set with the same object multiple times, the object will only be added
|
11564
|
+
once. Likewise, calling `remove()` with the same object multiple times will
|
11565
|
+
remove the object the first time and have no effect on future calls until
|
11566
|
+
you add the object to the set again.
|
11567
|
+
|
11568
|
+
NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do
|
11569
|
+
so will be ignored.
|
11570
|
+
|
11571
|
+
In addition to add/remove you can also call `push()`/`pop()`. Push behaves
|
11572
|
+
just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary
|
11573
|
+
object, remove it and return it. This is a good way to use a set as a job
|
11574
|
+
queue when you don't care which order the jobs are executed in.
|
11575
|
+
|
11576
|
+
## Testing for an Object
|
11577
|
+
|
11578
|
+
To test for an object's presence in a set you simply call
|
11579
|
+
`Ember.Set#contains()`.
|
11580
|
+
|
11581
|
+
## Observing changes
|
11582
|
+
|
11583
|
+
When using `Ember.Set`, you can observe the `"[]"` property to be
|
11584
|
+
alerted whenever the content changes. You can also add an enumerable
|
11585
|
+
observer to the set to be notified of specific objects that are added and
|
11586
|
+
removed from the set. See `Ember.Enumerable` for more information on
|
11587
|
+
enumerables.
|
11588
|
+
|
11589
|
+
This is often unhelpful. If you are filtering sets of objects, for instance,
|
11590
|
+
it is very inefficient to re-filter all of the items each time the set
|
11591
|
+
changes. It would be better if you could just adjust the filtered set based
|
11592
|
+
on what was changed on the original set. The same issue applies to merging
|
11593
|
+
sets, as well.
|
11594
|
+
|
11595
|
+
## Other Methods
|
11596
|
+
|
11597
|
+
`Ember.Set` primary implements other mixin APIs. For a complete reference
|
11598
|
+
on the methods you will use with `Ember.Set`, please consult these mixins.
|
11599
|
+
The most useful ones will be `Ember.Enumerable` and
|
11600
|
+
`Ember.MutableEnumerable` which implement most of the common iterator
|
11601
|
+
methods you are used to on Array.
|
11602
|
+
|
11603
|
+
Note that you can also use the `Ember.Copyable` and `Ember.Freezable`
|
11604
|
+
APIs on `Ember.Set` as well. Once a set is frozen it can no longer be
|
11605
|
+
modified. The benefit of this is that when you call `frozenCopy()` on it,
|
11606
|
+
Ember will avoid making copies of the set. This allows you to write
|
11607
|
+
code that can know with certainty when the underlying set data will or
|
11608
|
+
will not be modified.
|
11609
|
+
|
11610
|
+
@class Set
|
11481
11611
|
@namespace Ember
|
11482
|
-
@extends Ember.
|
11612
|
+
@extends Ember.CoreObject
|
11613
|
+
@uses Ember.MutableEnumerable
|
11614
|
+
@uses Ember.Copyable
|
11615
|
+
@uses Ember.Freezable
|
11616
|
+
@since Ember 0.9
|
11483
11617
|
*/
|
11484
|
-
Ember.
|
11485
|
-
|
11486
|
-
init: function(content) {
|
11487
|
-
this._super();
|
11488
|
-
this._content = content;
|
11489
|
-
content.addArrayObserver(this);
|
11618
|
+
Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,
|
11619
|
+
/** @scope Ember.Set.prototype */ {
|
11490
11620
|
|
11491
|
-
|
11492
|
-
|
11493
|
-
|
11494
|
-
this.didAddListener(eventName);
|
11495
|
-
}, this);
|
11496
|
-
},
|
11621
|
+
// ..........................................................
|
11622
|
+
// IMPLEMENT ENUMERABLE APIS
|
11623
|
+
//
|
11497
11624
|
|
11498
11625
|
/**
|
11499
|
-
|
11500
|
-
The `unknownProperty` handler will generate an EachArray of each item.
|
11626
|
+
This property will change as the number of objects in the set changes.
|
11501
11627
|
|
11502
|
-
@
|
11503
|
-
@
|
11504
|
-
@
|
11628
|
+
@property length
|
11629
|
+
@type number
|
11630
|
+
@default 0
|
11505
11631
|
*/
|
11506
|
-
|
11507
|
-
var ret;
|
11508
|
-
ret = new EachArray(this._content, keyName, this);
|
11509
|
-
Ember.defineProperty(this, keyName, null, ret);
|
11510
|
-
this.beginObservingContentKey(keyName);
|
11511
|
-
return ret;
|
11512
|
-
},
|
11632
|
+
length: 0,
|
11513
11633
|
|
11514
|
-
|
11515
|
-
|
11516
|
-
|
11634
|
+
/**
|
11635
|
+
Clears the set. This is useful if you want to reuse an existing set
|
11636
|
+
without having to recreate it.
|
11517
11637
|
|
11518
|
-
|
11519
|
-
var
|
11638
|
+
```javascript
|
11639
|
+
var colors = new Ember.Set(["red", "green", "blue"]);
|
11640
|
+
colors.length; // 3
|
11641
|
+
colors.clear();
|
11642
|
+
colors.length; // 0
|
11643
|
+
```
|
11520
11644
|
|
11521
|
-
|
11522
|
-
Ember.
|
11645
|
+
@method clear
|
11646
|
+
@return {Ember.Set} An empty Set
|
11647
|
+
*/
|
11648
|
+
clear: function() {
|
11649
|
+
if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }
|
11523
11650
|
|
11524
|
-
|
11525
|
-
|
11651
|
+
var len = get(this, 'length');
|
11652
|
+
if (len === 0) { return this; }
|
11526
11653
|
|
11527
|
-
|
11654
|
+
var guid;
|
11528
11655
|
|
11529
|
-
|
11656
|
+
this.enumerableContentWillChange(len, 0);
|
11657
|
+
Ember.propertyWillChange(this, 'firstObject');
|
11658
|
+
Ember.propertyWillChange(this, 'lastObject');
|
11659
|
+
|
11660
|
+
for (var i=0; i < len; i++){
|
11661
|
+
guid = guidFor(this[i]);
|
11662
|
+
delete this[guid];
|
11663
|
+
delete this[i];
|
11530
11664
|
}
|
11531
11665
|
|
11532
|
-
|
11533
|
-
|
11666
|
+
set(this, 'length', 0);
|
11667
|
+
|
11668
|
+
Ember.propertyDidChange(this, 'firstObject');
|
11669
|
+
Ember.propertyDidChange(this, 'lastObject');
|
11670
|
+
this.enumerableContentDidChange(len, 0);
|
11671
|
+
|
11672
|
+
return this;
|
11534
11673
|
},
|
11535
11674
|
|
11536
|
-
|
11537
|
-
|
11675
|
+
/**
|
11676
|
+
Returns true if the passed object is also an enumerable that contains the
|
11677
|
+
same objects as the receiver.
|
11538
11678
|
|
11539
|
-
|
11540
|
-
|
11679
|
+
```javascript
|
11680
|
+
var colors = ["red", "green", "blue"],
|
11681
|
+
same_colors = new Ember.Set(colors);
|
11541
11682
|
|
11542
|
-
|
11543
|
-
|
11683
|
+
same_colors.isEqual(colors); // true
|
11684
|
+
same_colors.isEqual(["purple", "brown"]); // false
|
11685
|
+
```
|
11544
11686
|
|
11545
|
-
|
11687
|
+
@method isEqual
|
11688
|
+
@param {Ember.Set} obj the other object.
|
11689
|
+
@return {Boolean}
|
11690
|
+
*/
|
11691
|
+
isEqual: function(obj) {
|
11692
|
+
// fail fast
|
11693
|
+
if (!Ember.Enumerable.detect(obj)) return false;
|
11546
11694
|
|
11547
|
-
|
11695
|
+
var loc = get(this, 'length');
|
11696
|
+
if (get(obj, 'length') !== loc) return false;
|
11697
|
+
|
11698
|
+
while(--loc >= 0) {
|
11699
|
+
if (!obj.contains(this[loc])) return false;
|
11548
11700
|
}
|
11549
11701
|
|
11550
|
-
|
11551
|
-
Ember.endPropertyChanges(this);
|
11702
|
+
return true;
|
11552
11703
|
},
|
11553
11704
|
|
11554
|
-
|
11555
|
-
|
11556
|
-
|
11705
|
+
/**
|
11706
|
+
Adds an object to the set. Only non-`null` objects can be added to a set
|
11707
|
+
and those can only be added once. If the object is already in the set or
|
11708
|
+
the passed value is null this method will have no effect.
|
11557
11709
|
|
11558
|
-
|
11559
|
-
if (IS_OBSERVER.test(eventName)) {
|
11560
|
-
this.beginObservingContentKey(eventName.slice(0, -7));
|
11561
|
-
}
|
11562
|
-
},
|
11710
|
+
This is an alias for `Ember.MutableEnumerable.addObject()`.
|
11563
11711
|
|
11564
|
-
|
11565
|
-
|
11566
|
-
|
11567
|
-
|
11568
|
-
|
11712
|
+
```javascript
|
11713
|
+
var colors = new Ember.Set();
|
11714
|
+
colors.add("blue"); // ["blue"]
|
11715
|
+
colors.add("blue"); // ["blue"]
|
11716
|
+
colors.add("red"); // ["blue", "red"]
|
11717
|
+
colors.add(null); // ["blue", "red"]
|
11718
|
+
colors.add(undefined); // ["blue", "red"]
|
11719
|
+
```
|
11569
11720
|
|
11570
|
-
|
11571
|
-
|
11572
|
-
|
11721
|
+
@method add
|
11722
|
+
@param {Object} obj The object to add.
|
11723
|
+
@return {Ember.Set} The set itself.
|
11724
|
+
*/
|
11725
|
+
add: Ember.aliasMethod('addObject'),
|
11573
11726
|
|
11574
|
-
|
11575
|
-
|
11576
|
-
|
11577
|
-
|
11578
|
-
keys[keyName] = 1;
|
11579
|
-
var content = this._content,
|
11580
|
-
len = get(content, 'length');
|
11581
|
-
addObserverForContentKey(content, keyName, this, 0, len);
|
11582
|
-
} else {
|
11583
|
-
keys[keyName]++;
|
11584
|
-
}
|
11585
|
-
},
|
11727
|
+
/**
|
11728
|
+
Removes the object from the set if it is found. If you pass a `null` value
|
11729
|
+
or an object that is already not in the set, this method will have no
|
11730
|
+
effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.
|
11586
11731
|
|
11587
|
-
|
11588
|
-
var
|
11589
|
-
|
11590
|
-
|
11591
|
-
|
11592
|
-
|
11593
|
-
|
11732
|
+
```javascript
|
11733
|
+
var colors = new Ember.Set(["red", "green", "blue"]);
|
11734
|
+
colors.remove("red"); // ["blue", "green"]
|
11735
|
+
colors.remove("purple"); // ["blue", "green"]
|
11736
|
+
colors.remove(null); // ["blue", "green"]
|
11737
|
+
```
|
11738
|
+
|
11739
|
+
@method remove
|
11740
|
+
@param {Object} obj The object to remove
|
11741
|
+
@return {Ember.Set} The set itself.
|
11742
|
+
*/
|
11743
|
+
remove: Ember.aliasMethod('removeObject'),
|
11744
|
+
|
11745
|
+
/**
|
11746
|
+
Removes the last element from the set and returns it, or `null` if it's empty.
|
11747
|
+
|
11748
|
+
```javascript
|
11749
|
+
var colors = new Ember.Set(["green", "blue"]);
|
11750
|
+
colors.pop(); // "blue"
|
11751
|
+
colors.pop(); // "green"
|
11752
|
+
colors.pop(); // null
|
11753
|
+
```
|
11754
|
+
|
11755
|
+
@method pop
|
11756
|
+
@return {Object} The removed object from the set or null.
|
11757
|
+
*/
|
11758
|
+
pop: function() {
|
11759
|
+
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
11760
|
+
var obj = this.length > 0 ? this[this.length-1] : null;
|
11761
|
+
this.remove(obj);
|
11762
|
+
return obj;
|
11594
11763
|
},
|
11595
11764
|
|
11596
|
-
|
11597
|
-
|
11598
|
-
|
11765
|
+
/**
|
11766
|
+
Inserts the given object on to the end of the set. It returns
|
11767
|
+
the set itself.
|
11768
|
+
|
11769
|
+
This is an alias for `Ember.MutableEnumerable.addObject()`.
|
11770
|
+
|
11771
|
+
```javascript
|
11772
|
+
var colors = new Ember.Set();
|
11773
|
+
colors.push("red"); // ["red"]
|
11774
|
+
colors.push("green"); // ["red", "green"]
|
11775
|
+
colors.push("blue"); // ["red", "green", "blue"]
|
11776
|
+
```
|
11777
|
+
|
11778
|
+
@method push
|
11779
|
+
@return {Ember.Set} The set itself.
|
11780
|
+
*/
|
11781
|
+
push: Ember.aliasMethod('addObject'),
|
11782
|
+
|
11783
|
+
/**
|
11784
|
+
Removes the last element from the set and returns it, or `null` if it's empty.
|
11785
|
+
|
11786
|
+
This is an alias for `Ember.Set.pop()`.
|
11787
|
+
|
11788
|
+
```javascript
|
11789
|
+
var colors = new Ember.Set(["green", "blue"]);
|
11790
|
+
colors.shift(); // "blue"
|
11791
|
+
colors.shift(); // "green"
|
11792
|
+
colors.shift(); // null
|
11793
|
+
```
|
11794
|
+
|
11795
|
+
@method shift
|
11796
|
+
@return {Object} The removed object from the set or null.
|
11797
|
+
*/
|
11798
|
+
shift: Ember.aliasMethod('pop'),
|
11799
|
+
|
11800
|
+
/**
|
11801
|
+
Inserts the given object on to the end of the set. It returns
|
11802
|
+
the set itself.
|
11599
11803
|
|
11600
|
-
|
11601
|
-
Ember.propertyDidChange(this, keyName);
|
11602
|
-
}
|
11804
|
+
This is an alias of `Ember.Set.push()`
|
11603
11805
|
|
11604
|
-
|
11806
|
+
```javascript
|
11807
|
+
var colors = new Ember.Set();
|
11808
|
+
colors.unshift("red"); // ["red"]
|
11809
|
+
colors.unshift("green"); // ["red", "green"]
|
11810
|
+
colors.unshift("blue"); // ["red", "green", "blue"]
|
11811
|
+
```
|
11605
11812
|
|
11813
|
+
@method unshift
|
11814
|
+
@return {Ember.Set} The set itself.
|
11815
|
+
*/
|
11816
|
+
unshift: Ember.aliasMethod('push'),
|
11606
11817
|
|
11818
|
+
/**
|
11819
|
+
Adds each object in the passed enumerable to the set.
|
11607
11820
|
|
11608
|
-
|
11821
|
+
This is an alias of `Ember.MutableEnumerable.addObjects()`
|
11609
11822
|
|
11823
|
+
```javascript
|
11824
|
+
var colors = new Ember.Set();
|
11825
|
+
colors.addEach(["red", "green", "blue"]); // ["red", "green", "blue"]
|
11826
|
+
```
|
11610
11827
|
|
11828
|
+
@method addEach
|
11829
|
+
@param {Ember.Enumerable} objects the objects to add.
|
11830
|
+
@return {Ember.Set} The set itself.
|
11831
|
+
*/
|
11832
|
+
addEach: Ember.aliasMethod('addObjects'),
|
11611
11833
|
|
11612
|
-
|
11613
|
-
|
11614
|
-
@module ember
|
11615
|
-
@submodule ember-runtime
|
11616
|
-
*/
|
11834
|
+
/**
|
11835
|
+
Removes each object in the passed enumerable to the set.
|
11617
11836
|
|
11837
|
+
This is an alias of `Ember.MutableEnumerable.removeObjects()`
|
11618
11838
|
|
11619
|
-
|
11839
|
+
```javascript
|
11840
|
+
var colors = new Ember.Set(["red", "green", "blue"]);
|
11841
|
+
colors.removeEach(["red", "blue"]); // ["green"]
|
11842
|
+
```
|
11620
11843
|
|
11621
|
-
|
11622
|
-
|
11623
|
-
|
11624
|
-
|
11844
|
+
@method removeEach
|
11845
|
+
@param {Ember.Enumerable} objects the objects to remove.
|
11846
|
+
@return {Ember.Set} The set itself.
|
11847
|
+
*/
|
11848
|
+
removeEach: Ember.aliasMethod('removeObjects'),
|
11625
11849
|
|
11626
|
-
//
|
11627
|
-
//
|
11628
|
-
|
11629
|
-
|
11630
|
-
|
11631
|
-
|
11850
|
+
// ..........................................................
|
11851
|
+
// PRIVATE ENUMERABLE SUPPORT
|
11852
|
+
//
|
11853
|
+
|
11854
|
+
init: function(items) {
|
11855
|
+
this._super();
|
11856
|
+
if (items) this.addObjects(items);
|
11632
11857
|
},
|
11633
11858
|
|
11634
|
-
|
11859
|
+
// implement Ember.Enumerable
|
11860
|
+
nextObject: function(idx) {
|
11635
11861
|
return this[idx];
|
11636
11862
|
},
|
11637
11863
|
|
11638
|
-
//
|
11639
|
-
|
11640
|
-
|
11641
|
-
|
11642
|
-
|
11643
|
-
// if we replaced exactly the same number of items, then pass only the
|
11644
|
-
// replaced range. Otherwise, pass the full remaining array length
|
11645
|
-
// since everything has shifted
|
11646
|
-
var len = objects ? get(objects, 'length') : 0;
|
11647
|
-
this.arrayContentWillChange(idx, amt, len);
|
11864
|
+
// more optimized version
|
11865
|
+
firstObject: Ember.computed(function() {
|
11866
|
+
return this.length > 0 ? this[0] : undefined;
|
11867
|
+
}),
|
11648
11868
|
|
11649
|
-
|
11650
|
-
|
11651
|
-
|
11652
|
-
|
11653
|
-
this.splice.apply(this,args) ;
|
11654
|
-
}
|
11869
|
+
// more optimized version
|
11870
|
+
lastObject: Ember.computed(function() {
|
11871
|
+
return this.length > 0 ? this[this.length-1] : undefined;
|
11872
|
+
}),
|
11655
11873
|
|
11656
|
-
|
11657
|
-
|
11658
|
-
|
11874
|
+
// implements Ember.MutableEnumerable
|
11875
|
+
addObject: function(obj) {
|
11876
|
+
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
11877
|
+
if (none(obj)) return this; // nothing to do
|
11659
11878
|
|
11660
|
-
|
11661
|
-
|
11662
|
-
|
11663
|
-
|
11664
|
-
if ((value !== undefined) && ret === undefined) {
|
11665
|
-
ret = this[key] = value;
|
11666
|
-
}
|
11667
|
-
return ret ;
|
11668
|
-
},
|
11879
|
+
var guid = guidFor(obj),
|
11880
|
+
idx = this[guid],
|
11881
|
+
len = get(this, 'length'),
|
11882
|
+
added ;
|
11669
11883
|
|
11670
|
-
|
11671
|
-
// specialized version
|
11672
|
-
indexOf: function(object, startAt) {
|
11673
|
-
var idx, len = this.length;
|
11884
|
+
if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added
|
11674
11885
|
|
11675
|
-
|
11676
|
-
else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
|
11677
|
-
if (startAt < 0) startAt += len;
|
11886
|
+
added = [obj];
|
11678
11887
|
|
11679
|
-
|
11680
|
-
|
11681
|
-
}
|
11682
|
-
return -1;
|
11683
|
-
},
|
11888
|
+
this.enumerableContentWillChange(null, added);
|
11889
|
+
Ember.propertyWillChange(this, 'lastObject');
|
11684
11890
|
|
11685
|
-
|
11686
|
-
|
11891
|
+
len = get(this, 'length');
|
11892
|
+
this[guid] = len;
|
11893
|
+
this[len] = obj;
|
11894
|
+
set(this, 'length', len+1);
|
11687
11895
|
|
11688
|
-
|
11689
|
-
|
11690
|
-
if (startAt < 0) startAt += len;
|
11896
|
+
Ember.propertyDidChange(this, 'lastObject');
|
11897
|
+
this.enumerableContentDidChange(null, added);
|
11691
11898
|
|
11692
|
-
|
11693
|
-
if (this[idx] === object) return idx ;
|
11694
|
-
}
|
11695
|
-
return -1;
|
11899
|
+
return this;
|
11696
11900
|
},
|
11697
11901
|
|
11698
|
-
|
11699
|
-
|
11700
|
-
|
11701
|
-
|
11902
|
+
// implements Ember.MutableEnumerable
|
11903
|
+
removeObject: function(obj) {
|
11904
|
+
if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
|
11905
|
+
if (none(obj)) return this; // nothing to do
|
11702
11906
|
|
11703
|
-
|
11704
|
-
|
11705
|
-
|
11907
|
+
var guid = guidFor(obj),
|
11908
|
+
idx = this[guid],
|
11909
|
+
len = get(this, 'length'),
|
11910
|
+
isFirst = idx === 0,
|
11911
|
+
isLast = idx === len-1,
|
11912
|
+
last, removed;
|
11706
11913
|
|
11707
|
-
// Remove any methods implemented natively so we don't override them
|
11708
|
-
var ignore = ['length'];
|
11709
|
-
Ember.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {
|
11710
|
-
if (Array.prototype[methodName]) ignore.push(methodName);
|
11711
|
-
});
|
11712
11914
|
|
11713
|
-
if (
|
11714
|
-
|
11715
|
-
}
|
11915
|
+
if (idx>=0 && idx<len && (this[idx] === obj)) {
|
11916
|
+
removed = [obj];
|
11716
11917
|
|
11717
|
-
|
11718
|
-
|
11719
|
-
|
11720
|
-
have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to
|
11721
|
-
false, this will be applied automatically. Otherwise you can apply the mixin
|
11722
|
-
at anytime by calling `Ember.NativeArray.activate`.
|
11918
|
+
this.enumerableContentWillChange(removed, null);
|
11919
|
+
if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }
|
11920
|
+
if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }
|
11723
11921
|
|
11724
|
-
|
11725
|
-
|
11726
|
-
|
11727
|
-
|
11728
|
-
|
11729
|
-
|
11730
|
-
@uses Ember.Freezable
|
11731
|
-
*/
|
11732
|
-
Ember.NativeArray = NativeArray;
|
11922
|
+
// swap items - basically move the item to the end so it can be removed
|
11923
|
+
if (idx < len-1) {
|
11924
|
+
last = this[len-1];
|
11925
|
+
this[idx] = last;
|
11926
|
+
this[guidFor(last)] = idx;
|
11927
|
+
}
|
11733
11928
|
|
11734
|
-
|
11735
|
-
|
11736
|
-
|
11929
|
+
delete this[guid];
|
11930
|
+
delete this[len-1];
|
11931
|
+
set(this, 'length', len-1);
|
11737
11932
|
|
11738
|
-
|
11739
|
-
|
11740
|
-
|
11741
|
-
|
11742
|
-
Ember.A = function(arr){
|
11743
|
-
if (arr === undefined) { arr = []; }
|
11744
|
-
return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);
|
11745
|
-
};
|
11933
|
+
if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }
|
11934
|
+
if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }
|
11935
|
+
this.enumerableContentDidChange(removed, null);
|
11936
|
+
}
|
11746
11937
|
|
11747
|
-
|
11748
|
-
|
11749
|
-
this method more than once is safe.
|
11938
|
+
return this;
|
11939
|
+
},
|
11750
11940
|
|
11751
|
-
|
11752
|
-
|
11753
|
-
|
11754
|
-
|
11755
|
-
*/
|
11756
|
-
Ember.NativeArray.activate = function() {
|
11757
|
-
NativeArray.apply(Array.prototype);
|
11941
|
+
// optimized version
|
11942
|
+
contains: function(obj) {
|
11943
|
+
return this[guidFor(obj)]>=0;
|
11944
|
+
},
|
11758
11945
|
|
11759
|
-
|
11760
|
-
|
11946
|
+
copy: function() {
|
11947
|
+
var C = this.constructor, ret = new C(), loc = get(this, 'length');
|
11948
|
+
set(ret, 'length', loc);
|
11949
|
+
while(--loc>=0) {
|
11950
|
+
ret[loc] = this[loc];
|
11951
|
+
ret[guidFor(this[loc])] = loc;
|
11952
|
+
}
|
11953
|
+
return ret;
|
11954
|
+
},
|
11761
11955
|
|
11762
|
-
|
11763
|
-
|
11764
|
-
|
11956
|
+
toString: function() {
|
11957
|
+
var len = this.length, idx, array = [];
|
11958
|
+
for(idx = 0; idx < len; idx++) {
|
11959
|
+
array[idx] = this[idx];
|
11960
|
+
}
|
11961
|
+
return fmt("Ember.Set<%@>", [array.join(',')]);
|
11962
|
+
}
|
11765
11963
|
|
11964
|
+
});
|
11766
11965
|
|
11767
11966
|
})();
|
11768
11967
|
|
@@ -11770,7 +11969,6 @@ if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {
|
|
11770
11969
|
|
11771
11970
|
(function() {
|
11772
11971
|
var DeferredMixin = Ember.DeferredMixin, // mixins/deferred
|
11773
|
-
EmberObject = Ember.Object, // system/object
|
11774
11972
|
get = Ember.get;
|
11775
11973
|
|
11776
11974
|
var Deferred = Ember.Object.extend(DeferredMixin);
|
@@ -12093,7 +12291,6 @@ Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {
|
|
12093
12291
|
|
12094
12292
|
if (isSorted) {
|
12095
12293
|
var addedObjects = array.slice(idx, idx+addedCount);
|
12096
|
-
var arrangedContent = get(this, 'arrangedContent');
|
12097
12294
|
|
12098
12295
|
forEach(addedObjects, function(item) {
|
12099
12296
|
this.insertItemSorted(item);
|
@@ -12163,8 +12360,8 @@ Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {
|
|
12163
12360
|
@submodule ember-runtime
|
12164
12361
|
*/
|
12165
12362
|
|
12166
|
-
var get = Ember.get, set = Ember.set,
|
12167
|
-
|
12363
|
+
var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,
|
12364
|
+
replace = Ember.EnumerableUtils.replace;
|
12168
12365
|
|
12169
12366
|
/**
|
12170
12367
|
`Ember.ArrayController` provides a way for you to publish a collection of
|
@@ -12487,7 +12684,7 @@ Ember.State = Ember.Object.extend(Ember.Evented,
|
|
12487
12684
|
},
|
12488
12685
|
|
12489
12686
|
init: function() {
|
12490
|
-
var states = get(this, 'states')
|
12687
|
+
var states = get(this, 'states');
|
12491
12688
|
set(this, 'childStates', Ember.A());
|
12492
12689
|
set(this, 'eventTransitions', get(this, 'eventTransitions') || {});
|
12493
12690
|
|
@@ -12637,7 +12834,7 @@ Ember.State.reopenClass({
|
|
12637
12834
|
transitionTo: function(target) {
|
12638
12835
|
|
12639
12836
|
var transitionFunction = function(stateManager, contextOrEvent) {
|
12640
|
-
var contexts = [],
|
12837
|
+
var contexts = [],
|
12641
12838
|
Event = Ember.$ && Ember.$.Event;
|
12642
12839
|
|
12643
12840
|
if (contextOrEvent && (Event && contextOrEvent instanceof Event)) {
|