ember-material-icons
Version:
Google Material icons for your ember-cli app
1,103 lines (910 loc) • 1.85 MB
JavaScript
;(function() {
/*!
* @overview Ember - JavaScript Application Framework
* @copyright Copyright 2011-2017 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
* @version 2.13.2
*/
var enifed, requireModule, Ember;
var mainContext = this; // Used in ember-environment/lib/global.js
(function() {
var isNode = typeof window === 'undefined' &&
typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
if (!isNode) {
Ember = this.Ember = this.Ember || {};
}
if (typeof Ember === 'undefined') { Ember = {}; }
if (typeof Ember.__loader === 'undefined') {
var registry = {};
var seen = {};
enifed = function(name, deps, callback) {
var value = { };
if (!callback) {
value.deps = [];
value.callback = deps;
} else {
value.deps = deps;
value.callback = callback;
}
registry[name] = value;
};
requireModule = function(name) {
return internalRequire(name, null);
};
// setup `require` module
requireModule['default'] = requireModule;
requireModule.has = function registryHas(moduleName) {
return !!registry[moduleName] || !!registry[moduleName + '/index'];
};
function missingModule(name, referrerName) {
if (referrerName) {
throw new Error('Could not find module ' + name + ' required by: ' + referrerName);
} else {
throw new Error('Could not find module ' + name);
}
}
function internalRequire(_name, referrerName) {
var name = _name;
var mod = registry[name];
if (!mod) {
name = name + '/index';
mod = registry[name];
}
var exports = seen[name];
if (exports !== undefined) {
return exports;
}
exports = seen[name] = {};
if (!mod) {
missingModule(_name, referrerName);
}
var deps = mod.deps;
var callback = mod.callback;
var reified = new Array(deps.length);
for (var i = 0; i < deps.length; i++) {
if (deps[i] === 'exports') {
reified[i] = exports;
} else if (deps[i] === 'require') {
reified[i] = requireModule;
} else {
reified[i] = internalRequire(deps[i], name);
}
}
callback.apply(this, reified);
return exports;
}
requireModule._eak_seen = registry;
Ember.__loader = {
define: enifed,
require: requireModule,
registry: registry
};
} else {
enifed = Ember.__loader.define;
requireModule = Ember.__loader.require;
}
})();
function classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError('Cannot call a class as a function');
}
}
function inherits(subClass, superClass) {
if (typeof superClass !== 'function' && superClass !== null) {
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass);
}
function taggedTemplateLiteralLoose(strings, raw) {
strings.raw = raw;
return strings;
}
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ('value' in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function createClass(Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
}
function interopExportWildcard(obj, defaults) {
var newObj = defaults({}, obj);
delete newObj['default'];
return newObj;
}
function defaults(obj, defaults) {
var keys = Object.getOwnPropertyNames(defaults);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = Object.getOwnPropertyDescriptor(defaults, key);
if (value && value.configurable && obj[key] === undefined) {
Object.defineProperty(obj, key, value);
}
}
return obj;
}
var babelHelpers = {
classCallCheck: classCallCheck,
inherits: inherits,
taggedTemplateLiteralLoose: taggedTemplateLiteralLoose,
slice: Array.prototype.slice,
createClass: createClass,
interopExportWildcard: interopExportWildcard,
defaults: defaults
};
enifed('@glimmer/di', ['exports', '@glimmer/util'], function (exports, _glimmerUtil) {
'use strict';
var Container = (function () {
function Container(registry) {
var resolver = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
this._registry = registry;
this._resolver = resolver;
this._lookups = _glimmerUtil.dict();
this._factoryLookups = _glimmerUtil.dict();
}
Container.prototype.factoryFor = function factoryFor(specifier) {
var factory = this._factoryLookups[specifier];
if (!factory) {
if (this._resolver) {
factory = this._resolver.retrieve(specifier);
}
if (!factory) {
factory = this._registry.registration(specifier);
}
if (factory) {
this._factoryLookups[specifier] = factory;
}
}
return factory;
};
Container.prototype.lookup = function lookup(specifier) {
var singleton = this._registry.registeredOption(specifier, 'singleton') !== false;
if (singleton && this._lookups[specifier]) {
return this._lookups[specifier];
}
var factory = this.factoryFor(specifier);
if (!factory) {
return;
}
if (this._registry.registeredOption(specifier, 'instantiate') === false) {
return factory;
}
var injections = this.buildInjections(specifier);
var object = factory.create(injections);
if (singleton && object) {
this._lookups[specifier] = object;
}
return object;
};
Container.prototype.defaultInjections = function defaultInjections(specifier) {
return {};
};
Container.prototype.buildInjections = function buildInjections(specifier) {
var hash = this.defaultInjections(specifier);
var injections = this._registry.registeredInjections(specifier);
var injection = undefined;
for (var i = 0; i < injections.length; i++) {
injection = injections[i];
hash[injection.property] = this.lookup(injection.source);
}
return hash;
};
return Container;
})();
var Registry = (function () {
function Registry() {
this._registrations = _glimmerUtil.dict();
this._registeredOptions = _glimmerUtil.dict();
this._registeredInjections = _glimmerUtil.dict();
}
// TODO - use symbol
Registry.prototype.register = function register(specifier, factory, options) {
this._registrations[specifier] = factory;
if (options) {
this._registeredOptions[specifier] = options;
}
};
Registry.prototype.registration = function registration(specifier) {
return this._registrations[specifier];
};
Registry.prototype.unregister = function unregister(specifier) {
delete this._registrations[specifier];
delete this._registeredOptions[specifier];
delete this._registeredInjections[specifier];
};
Registry.prototype.registerOption = function registerOption(specifier, option, value) {
var options = this._registeredOptions[specifier];
if (!options) {
options = {};
this._registeredOptions[specifier] = options;
}
options[option] = value;
};
Registry.prototype.registeredOption = function registeredOption(specifier, option) {
var options = this.registeredOptions(specifier);
if (options) {
return options[option];
}
};
Registry.prototype.registeredOptions = function registeredOptions(specifier) {
var options = this._registeredOptions[specifier];
if (options === undefined) {
var _specifier$split = specifier.split(':');
var type = _specifier$split[0];
options = this._registeredOptions[type];
}
return options;
};
Registry.prototype.unregisterOption = function unregisterOption(specifier, option) {
var options = this._registeredOptions[specifier];
if (options) {
delete options[option];
}
};
Registry.prototype.registerInjection = function registerInjection(specifier, property, source) {
var injections = this._registeredInjections[specifier];
if (injections === undefined) {
this._registeredInjections[specifier] = injections = [];
}
injections.push({
property: property,
source: source
});
};
Registry.prototype.registeredInjections = function registeredInjections(specifier) {
var _specifier$split2 = specifier.split(':');
var type = _specifier$split2[0];
var injections = [];
Array.prototype.push.apply(injections, this._registeredInjections[type]);
Array.prototype.push.apply(injections, this._registeredInjections[specifier]);
return injections;
};
return Registry;
})();
var OWNER = '__owner__';
function getOwner(object) {
return object[OWNER];
}
function setOwner(object, owner) {
object[OWNER] = owner;
}
function isSpecifierStringAbsolute(specifier) {
var _specifier$split3 = specifier.split(':');
var type = _specifier$split3[0];
var path = _specifier$split3[1];
return !!(type && path && path.indexOf('/') === 0 && path.split('/').length > 3);
}
function isSpecifierObjectAbsolute(specifier) {
return specifier.rootName !== undefined && specifier.collection !== undefined && specifier.name !== undefined && specifier.type !== undefined;
}
function serializeSpecifier(specifier) {
var type = specifier.type;
var path = serializeSpecifierPath(specifier);
if (path) {
return type + ':' + path;
} else {
return type;
}
}
function serializeSpecifierPath(specifier) {
var path = [];
if (specifier.rootName) {
path.push(specifier.rootName);
}
if (specifier.collection) {
path.push(specifier.collection);
}
if (specifier.namespace) {
path.push(specifier.namespace);
}
if (specifier.name) {
path.push(specifier.name);
}
if (path.length > 0) {
var fullPath = path.join('/');
if (isSpecifierObjectAbsolute(specifier)) {
fullPath = '/' + fullPath;
}
return fullPath;
}
}
function deserializeSpecifier(specifier) {
var obj = {};
if (specifier.indexOf(':') > -1) {
var _specifier$split4 = specifier.split(':');
var type = _specifier$split4[0];
var path = _specifier$split4[1];
obj.type = type;
var pathSegments = undefined;
if (path.indexOf('/') === 0) {
pathSegments = path.substr(1).split('/');
obj.rootName = pathSegments.shift();
obj.collection = pathSegments.shift();
} else {
pathSegments = path.split('/');
}
if (pathSegments.length > 0) {
obj.name = pathSegments.pop();
if (pathSegments.length > 0) {
obj.namespace = pathSegments.join('/');
}
}
} else {
obj.type = specifier;
}
return obj;
}
exports.Container = Container;
exports.Registry = Registry;
exports.getOwner = getOwner;
exports.setOwner = setOwner;
exports.OWNER = OWNER;
exports.isSpecifierStringAbsolute = isSpecifierStringAbsolute;
exports.isSpecifierObjectAbsolute = isSpecifierObjectAbsolute;
exports.serializeSpecifier = serializeSpecifier;
exports.deserializeSpecifier = deserializeSpecifier;
});
enifed('@glimmer/node', ['exports', '@glimmer/runtime'], function (exports, _glimmerRuntime) {
'use strict';
var NodeDOMTreeConstruction = (function (_DOMTreeConstruction) {
babelHelpers.inherits(NodeDOMTreeConstruction, _DOMTreeConstruction);
function NodeDOMTreeConstruction(doc) {
_DOMTreeConstruction.call(this, doc);
}
// override to prevent usage of `this.document` until after the constructor
NodeDOMTreeConstruction.prototype.setupUselessElement = function setupUselessElement() {};
NodeDOMTreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) {
var prev = reference ? reference.previousSibling : parent.lastChild;
var raw = this.document.createRawHTMLSection(html);
parent.insertBefore(raw, reference);
var first = prev ? prev.nextSibling : parent.firstChild;
var last = reference ? reference.previousSibling : parent.lastChild;
return new _glimmerRuntime.ConcreteBounds(parent, first, last);
};
// override to avoid SVG detection/work when in node (this is not needed in SSR)
NodeDOMTreeConstruction.prototype.createElement = function createElement(tag) {
return this.document.createElement(tag);
};
// override to avoid namespace shenanigans when in node (this is not needed in SSR)
NodeDOMTreeConstruction.prototype.setAttribute = function setAttribute(element, name, value) {
element.setAttribute(name, value);
};
return NodeDOMTreeConstruction;
})(_glimmerRuntime.DOMTreeConstruction);
exports.NodeDOMTreeConstruction = NodeDOMTreeConstruction;
});
enifed("@glimmer/reference", ["exports", "@glimmer/util"], function (exports, _glimmerUtil) {
"use strict";
var CONSTANT = 0;
var INITIAL = 1;
var VOLATILE = NaN;
var RevisionTag = (function () {
function RevisionTag() {}
RevisionTag.prototype.validate = function validate(snapshot) {
return this.value() === snapshot;
};
return RevisionTag;
})();
var $REVISION = INITIAL;
var DirtyableTag = (function (_RevisionTag) {
babelHelpers.inherits(DirtyableTag, _RevisionTag);
function DirtyableTag() {
var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0];
_RevisionTag.call(this);
this.revision = revision;
}
DirtyableTag.prototype.value = function value() {
return this.revision;
};
DirtyableTag.prototype.dirty = function dirty() {
this.revision = ++$REVISION;
};
return DirtyableTag;
})(RevisionTag);
function combineTagged(tagged) {
var optimized = [];
for (var i = 0, l = tagged.length; i < l; i++) {
var tag = tagged[i].tag;
if (tag === VOLATILE_TAG) return VOLATILE_TAG;
if (tag === CONSTANT_TAG) continue;
optimized.push(tag);
}
return _combine(optimized);
}
function combineSlice(slice) {
var optimized = [];
var node = slice.head();
while (node !== null) {
var tag = node.tag;
if (tag === VOLATILE_TAG) return VOLATILE_TAG;
if (tag !== CONSTANT_TAG) optimized.push(tag);
node = slice.nextNode(node);
}
return _combine(optimized);
}
function combine(tags) {
var optimized = [];
for (var i = 0, l = tags.length; i < l; i++) {
var tag = tags[i];
if (tag === VOLATILE_TAG) return VOLATILE_TAG;
if (tag === CONSTANT_TAG) continue;
optimized.push(tag);
}
return _combine(optimized);
}
function _combine(tags) {
switch (tags.length) {
case 0:
return CONSTANT_TAG;
case 1:
return tags[0];
case 2:
return new TagsPair(tags[0], tags[1]);
default:
return new TagsCombinator(tags);
}
;
}
var CachedTag = (function (_RevisionTag2) {
babelHelpers.inherits(CachedTag, _RevisionTag2);
function CachedTag() {
_RevisionTag2.apply(this, arguments);
this.lastChecked = null;
this.lastValue = null;
}
CachedTag.prototype.value = function value() {
var lastChecked = this.lastChecked;
var lastValue = this.lastValue;
if (lastChecked !== $REVISION) {
this.lastChecked = $REVISION;
this.lastValue = lastValue = this.compute();
}
return this.lastValue;
};
CachedTag.prototype.invalidate = function invalidate() {
this.lastChecked = null;
};
return CachedTag;
})(RevisionTag);
var TagsPair = (function (_CachedTag) {
babelHelpers.inherits(TagsPair, _CachedTag);
function TagsPair(first, second) {
_CachedTag.call(this);
this.first = first;
this.second = second;
}
TagsPair.prototype.compute = function compute() {
return Math.max(this.first.value(), this.second.value());
};
return TagsPair;
})(CachedTag);
var TagsCombinator = (function (_CachedTag2) {
babelHelpers.inherits(TagsCombinator, _CachedTag2);
function TagsCombinator(tags) {
_CachedTag2.call(this);
this.tags = tags;
}
TagsCombinator.prototype.compute = function compute() {
var tags = this.tags;
var max = -1;
for (var i = 0; i < tags.length; i++) {
var value = tags[i].value();
max = Math.max(value, max);
}
return max;
};
return TagsCombinator;
})(CachedTag);
var UpdatableTag = (function (_CachedTag3) {
babelHelpers.inherits(UpdatableTag, _CachedTag3);
function UpdatableTag(tag) {
_CachedTag3.call(this);
this.tag = tag;
this.lastUpdated = INITIAL;
}
//////////
UpdatableTag.prototype.compute = function compute() {
return Math.max(this.lastUpdated, this.tag.value());
};
UpdatableTag.prototype.update = function update(tag) {
if (tag !== this.tag) {
this.tag = tag;
this.lastUpdated = $REVISION;
this.invalidate();
}
};
return UpdatableTag;
})(CachedTag);
var CONSTANT_TAG = new ((function (_RevisionTag3) {
babelHelpers.inherits(ConstantTag, _RevisionTag3);
function ConstantTag() {
_RevisionTag3.apply(this, arguments);
}
ConstantTag.prototype.value = function value() {
return CONSTANT;
};
return ConstantTag;
})(RevisionTag))();
var VOLATILE_TAG = new ((function (_RevisionTag4) {
babelHelpers.inherits(VolatileTag, _RevisionTag4);
function VolatileTag() {
_RevisionTag4.apply(this, arguments);
}
VolatileTag.prototype.value = function value() {
return VOLATILE;
};
return VolatileTag;
})(RevisionTag))();
var CURRENT_TAG = new ((function (_DirtyableTag) {
babelHelpers.inherits(CurrentTag, _DirtyableTag);
function CurrentTag() {
_DirtyableTag.apply(this, arguments);
}
CurrentTag.prototype.value = function value() {
return $REVISION;
};
return CurrentTag;
})(DirtyableTag))();
var CachedReference = (function () {
function CachedReference() {
this.lastRevision = null;
this.lastValue = null;
}
CachedReference.prototype.value = function value() {
var tag = this.tag;
var lastRevision = this.lastRevision;
var lastValue = this.lastValue;
if (!lastRevision || !tag.validate(lastRevision)) {
lastValue = this.lastValue = this.compute();
this.lastRevision = tag.value();
}
return lastValue;
};
CachedReference.prototype.invalidate = function invalidate() {
this.lastRevision = null;
};
return CachedReference;
})();
var MapperReference = (function (_CachedReference) {
babelHelpers.inherits(MapperReference, _CachedReference);
function MapperReference(reference, mapper) {
_CachedReference.call(this);
this.tag = reference.tag;
this.reference = reference;
this.mapper = mapper;
}
MapperReference.prototype.compute = function compute() {
var reference = this.reference;
var mapper = this.mapper;
return mapper(reference.value());
};
return MapperReference;
})(CachedReference);
function map(reference, mapper) {
return new MapperReference(reference, mapper);
}
//////////
var ReferenceCache = (function () {
function ReferenceCache(reference) {
this.lastValue = null;
this.lastRevision = null;
this.initialized = false;
this.tag = reference.tag;
this.reference = reference;
}
ReferenceCache.prototype.peek = function peek() {
if (!this.initialized) {
return this.initialize();
}
return this.lastValue;
};
ReferenceCache.prototype.revalidate = function revalidate() {
if (!this.initialized) {
return this.initialize();
}
var reference = this.reference;
var lastRevision = this.lastRevision;
var tag = reference.tag;
if (tag.validate(lastRevision)) return NOT_MODIFIED;
this.lastRevision = tag.value();
var lastValue = this.lastValue;
var value = reference.value();
if (value === lastValue) return NOT_MODIFIED;
this.lastValue = value;
return value;
};
ReferenceCache.prototype.initialize = function initialize() {
var reference = this.reference;
var value = this.lastValue = reference.value();
this.lastRevision = reference.tag.value();
this.initialized = true;
return value;
};
return ReferenceCache;
})();
var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145";
function isModified(value) {
return value !== NOT_MODIFIED;
}
var ConstReference = (function () {
function ConstReference(inner) {
this.inner = inner;
this.tag = CONSTANT_TAG;
}
ConstReference.prototype.value = function value() {
return this.inner;
};
return ConstReference;
})();
function isConst(reference) {
return reference.tag === CONSTANT_TAG;
}
var ListItem = (function (_ListNode) {
babelHelpers.inherits(ListItem, _ListNode);
function ListItem(iterable, result) {
_ListNode.call(this, iterable.valueReferenceFor(result));
this.retained = false;
this.seen = false;
this.key = result.key;
this.iterable = iterable;
this.memo = iterable.memoReferenceFor(result);
}
ListItem.prototype.update = function update(item) {
this.retained = true;
this.iterable.updateValueReference(this.value, item);
this.iterable.updateMemoReference(this.memo, item);
};
ListItem.prototype.shouldRemove = function shouldRemove() {
return !this.retained;
};
ListItem.prototype.reset = function reset() {
this.retained = false;
this.seen = false;
};
return ListItem;
})(_glimmerUtil.ListNode);
var IterationArtifacts = (function () {
function IterationArtifacts(iterable) {
this.map = _glimmerUtil.dict();
this.list = new _glimmerUtil.LinkedList();
this.tag = iterable.tag;
this.iterable = iterable;
}
IterationArtifacts.prototype.isEmpty = function isEmpty() {
var iterator = this.iterator = this.iterable.iterate();
return iterator.isEmpty();
};
IterationArtifacts.prototype.iterate = function iterate() {
var iterator = this.iterator || this.iterable.iterate();
this.iterator = null;
return iterator;
};
IterationArtifacts.prototype.has = function has(key) {
return !!this.map[key];
};
IterationArtifacts.prototype.get = function get(key) {
return this.map[key];
};
IterationArtifacts.prototype.wasSeen = function wasSeen(key) {
var node = this.map[key];
return node && node.seen;
};
IterationArtifacts.prototype.append = function append(item) {
var map = this.map;
var list = this.list;
var iterable = this.iterable;
var node = map[item.key] = new ListItem(iterable, item);
list.append(node);
return node;
};
IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) {
var map = this.map;
var list = this.list;
var iterable = this.iterable;
var node = map[item.key] = new ListItem(iterable, item);
node.retained = true;
list.insertBefore(node, reference);
return node;
};
IterationArtifacts.prototype.move = function move(item, reference) {
var list = this.list;
item.retained = true;
list.remove(item);
list.insertBefore(item, reference);
};
IterationArtifacts.prototype.remove = function remove(item) {
var list = this.list;
list.remove(item);
delete this.map[item.key];
};
IterationArtifacts.prototype.nextNode = function nextNode(item) {
return this.list.nextNode(item);
};
IterationArtifacts.prototype.head = function head() {
return this.list.head();
};
return IterationArtifacts;
})();
var ReferenceIterator = (function () {
// if anyone needs to construct this object with something other than
// an iterable, let @wycats know.
function ReferenceIterator(iterable) {
this.iterator = null;
var artifacts = new IterationArtifacts(iterable);
this.artifacts = artifacts;
}
ReferenceIterator.prototype.next = function next() {
var artifacts = this.artifacts;
var iterator = this.iterator = this.iterator || artifacts.iterate();
var item = iterator.next();
if (!item) return null;
return artifacts.append(item);
};
return ReferenceIterator;
})();
var Phase;
(function (Phase) {
Phase[Phase["Append"] = 0] = "Append";
Phase[Phase["Prune"] = 1] = "Prune";
Phase[Phase["Done"] = 2] = "Done";
})(Phase || (Phase = {}));
var IteratorSynchronizer = (function () {
function IteratorSynchronizer(_ref) {
var target = _ref.target;
var artifacts = _ref.artifacts;
this.target = target;
this.artifacts = artifacts;
this.iterator = artifacts.iterate();
this.current = artifacts.head();
}
IteratorSynchronizer.prototype.sync = function sync() {
var phase = Phase.Append;
while (true) {
switch (phase) {
case Phase.Append:
phase = this.nextAppend();
break;
case Phase.Prune:
phase = this.nextPrune();
break;
case Phase.Done:
this.nextDone();
return;
}
}
};
IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) {
var current = this.current;
var artifacts = this.artifacts;
var seek = current;
while (seek && seek.key !== key) {
seek.seen = true;
seek = artifacts.nextNode(seek);
}
this.current = seek && artifacts.nextNode(seek);
};
IteratorSynchronizer.prototype.nextAppend = function nextAppend() {
var iterator = this.iterator;
var current = this.current;
var artifacts = this.artifacts;
var item = iterator.next();
if (item === null) {
return this.startPrune();
}
var key = item.key;
if (current && current.key === key) {
this.nextRetain(item);
} else if (artifacts.has(key)) {
this.nextMove(item);
} else {
this.nextInsert(item);
}
return Phase.Append;
};
IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) {
var artifacts = this.artifacts;
var current = this.current;
current = _glimmerUtil.expect(current, 'BUG: current is empty');
current.update(item);
this.current = artifacts.nextNode(current);
this.target.retain(item.key, current.value, current.memo);
};
IteratorSynchronizer.prototype.nextMove = function nextMove(item) {
var current = this.current;
var artifacts = this.artifacts;
var target = this.target;
var key = item.key;
var found = artifacts.get(item.key);
found.update(item);
if (artifacts.wasSeen(item.key)) {
artifacts.move(found, current);
target.move(found.key, found.value, found.memo, current ? current.key : null);
} else {
this.advanceToKey(key);
}
};
IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) {
var artifacts = this.artifacts;
var target = this.target;
var current = this.current;
var node = artifacts.insertBefore(item, current);
target.insert(node.key, node.value, node.memo, current ? current.key : null);
};
IteratorSynchronizer.prototype.startPrune = function startPrune() {
this.current = this.artifacts.head();
return Phase.Prune;
};
IteratorSynchronizer.prototype.nextPrune = function nextPrune() {
var artifacts = this.artifacts;
var target = this.target;
var current = this.current;
if (current === null) {
return Phase.Done;
}
var node = current;
this.current = artifacts.nextNode(node);
if (node.shouldRemove()) {
artifacts.remove(node);
target.delete(node.key);
} else {
node.reset();
}
return Phase.Prune;
};
IteratorSynchronizer.prototype.nextDone = function nextDone() {
this.target.done();
};
return IteratorSynchronizer;
})();
function referenceFromParts(root, parts) {
var reference = root;
for (var i = 0; i < parts.length; i++) {
reference = reference.get(parts[i]);
}
return reference;
}
exports.ConstReference = ConstReference;
exports.isConst = isConst;
exports.ListItem = ListItem;
exports.referenceFromParts = referenceFromParts;
exports.IterationArtifacts = IterationArtifacts;
exports.ReferenceIterator = ReferenceIterator;
exports.IteratorSynchronizer = IteratorSynchronizer;
exports.CONSTANT = CONSTANT;
exports.INITIAL = INITIAL;
exports.VOLATILE = VOLATILE;
exports.RevisionTag = RevisionTag;
exports.DirtyableTag = DirtyableTag;
exports.combineTagged = combineTagged;
exports.combineSlice = combineSlice;
exports.combine = combine;
exports.CachedTag = CachedTag;
exports.UpdatableTag = UpdatableTag;
exports.CONSTANT_TAG = CONSTANT_TAG;
exports.VOLATILE_TAG = VOLATILE_TAG;
exports.CURRENT_TAG = CURRENT_TAG;
exports.CachedReference = CachedReference;
exports.map = map;
exports.ReferenceCache = ReferenceCache;
exports.isModified = isModified;
});
enifed('@glimmer/runtime',['exports','@glimmer/util','@glimmer/reference','@glimmer/wire-format'],function(exports,_glimmerUtil,_glimmerReference,_glimmerWireFormat){'use strict';var PrimitiveReference=(function(_ConstReference){babelHelpers.inherits(PrimitiveReference,_ConstReference);function PrimitiveReference(value){_ConstReference.call(this,value);}PrimitiveReference.create = function create(value){if(value === undefined){return UNDEFINED_REFERENCE;}else if(value === null){return NULL_REFERENCE;}else if(value === true){return TRUE_REFERENCE;}else if(value === false){return FALSE_REFERENCE;}else if(typeof value === 'number'){return new ValueReference(value);}else {return new StringReference(value);}};PrimitiveReference.prototype.get = function get(_key){return UNDEFINED_REFERENCE;};return PrimitiveReference;})(_glimmerReference.ConstReference);var StringReference=(function(_PrimitiveReference){babelHelpers.inherits(StringReference,_PrimitiveReference);function StringReference(){_PrimitiveReference.apply(this,arguments);this.lengthReference = null;}StringReference.prototype.get = function get(key){if(key === 'length'){var lengthReference=this.lengthReference;if(lengthReference === null){lengthReference = this.lengthReference = new ValueReference(this.inner.length);}return lengthReference;}else {return _PrimitiveReference.prototype.get.call(this,key);}};return StringReference;})(PrimitiveReference);var ValueReference=(function(_PrimitiveReference2){babelHelpers.inherits(ValueReference,_PrimitiveReference2);function ValueReference(value){_PrimitiveReference2.call(this,value);}return ValueReference;})(PrimitiveReference);var UNDEFINED_REFERENCE=new ValueReference(undefined);var NULL_REFERENCE=new ValueReference(null);var TRUE_REFERENCE=new ValueReference(true);var FALSE_REFERENCE=new ValueReference(false);var ConditionalReference=(function(){function ConditionalReference(inner){this.inner = inner;this.tag = inner.tag;}ConditionalReference.prototype.value = function value(){return this.toBool(this.inner.value());};ConditionalReference.prototype.toBool = function toBool(value){return !!value;};return ConditionalReference;})();var Constants=(function(){function Constants(){ // `0` means NULL
this.references = [];this.strings = [];this.expressions = [];this.arrays = [];this.blocks = [];this.functions = [];this.others = [];this.NULL_REFERENCE = this.reference(NULL_REFERENCE);this.UNDEFINED_REFERENCE = this.reference(UNDEFINED_REFERENCE);}Constants.prototype.getReference = function getReference(value){return this.references[value - 1];};Constants.prototype.reference = function reference(value){var index=this.references.length;this.references.push(value);return index + 1;};Constants.prototype.getString = function getString(value){return this.strings[value - 1];};Constants.prototype.string = function string(value){var index=this.strings.length;this.strings.push(value);return index + 1;};Constants.prototype.getExpression = function getExpression(value){return this.expressions[value - 1];};Constants.prototype.expression = function expression(value){var index=this.expressions.length;this.expressions.push(value);return index + 1;};Constants.prototype.getArray = function getArray(value){return this.arrays[value - 1];};Constants.prototype.array = function array(values){var index=this.arrays.length;this.arrays.push(values);return index + 1;};Constants.prototype.getBlock = function getBlock(value){return this.blocks[value - 1];};Constants.prototype.block = function block(_block2){var index=this.blocks.length;this.blocks.push(_block2);return index + 1;};Constants.prototype.getFunction = function getFunction(value){return this.functions[value - 1];};Constants.prototype.function = function _function(f){var index=this.functions.length;this.functions.push(f);return index + 1;};Constants.prototype.getOther = function getOther(value){return this.others[value - 1];};Constants.prototype.other = function other(_other){var index=this.others.length;this.others.push(_other);return index + 1;};return Constants;})();var AppendOpcodes=(function(){function AppendOpcodes(){this.evaluateOpcode = _glimmerUtil.fillNulls(51 /* EvaluatePartial */ + 1);}AppendOpcodes.prototype.add = function add(name,evaluate){this.evaluateOpcode[name] = evaluate;};AppendOpcodes.prototype.evaluate = function evaluate(vm,opcode){var func=this.evaluateOpcode[opcode.type];func(vm,opcode);};return AppendOpcodes;})();var APPEND_OPCODES=new AppendOpcodes();var AbstractOpcode=(function(){function AbstractOpcode(){_glimmerUtil.initializeGuid(this);}AbstractOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type};};return AbstractOpcode;})();var UpdatingOpcode=(function(_AbstractOpcode){babelHelpers.inherits(UpdatingOpcode,_AbstractOpcode);function UpdatingOpcode(){_AbstractOpcode.apply(this,arguments);this.next = null;this.prev = null;}return UpdatingOpcode;})(AbstractOpcode);APPEND_OPCODES.add(20, /* OpenBlock */function(vm,_ref){var _getBlock=_ref.op1;var _args=_ref.op2;var inner=vm.constants.getOther(_getBlock);var rawArgs=vm.constants.getExpression(_args);var args=null;var block=inner.evaluate(vm);if(block){args = rawArgs.evaluate(vm);} // FIXME: can we avoid doing this when we don't have a block?
vm.pushCallerScope();if(block){vm.invokeBlock(block,args || null);}});APPEND_OPCODES.add(21, /* CloseBlock */function(vm){return vm.popScope();});APPEND_OPCODES.add(0, /* PushChildScope */function(vm){return vm.pushChildScope();});APPEND_OPCODES.add(1, /* PopScope */function(vm){return vm.popScope();});APPEND_OPCODES.add(2, /* PushDynamicScope */function(vm){return vm.pushDynamicScope();});APPEND_OPCODES.add(3, /* PopDynamicScope */function(vm){return vm.popDynamicScope();});APPEND_OPCODES.add(4, /* Put */function(vm,_ref2){var reference=_ref2.op1;vm.frame.setOperand(vm.constants.getReference(reference));});APPEND_OPCODES.add(5, /* EvaluatePut */function(vm,_ref3){var expression=_ref3.op1;var expr=vm.constants.getExpression(expression);vm.evaluateOperand(expr);});APPEND_OPCODES.add(6, /* PutArgs */function(vm,_ref4){var args=_ref4.op1;vm.evaluateArgs(vm.constants.getExpression(args));});APPEND_OPCODES.add(7, /* BindPositionalArgs */function(vm,_ref5){var _symbols=_ref5.op1;var symbols=vm.constants.getArray(_symbols);vm.bindPositionalArgs(symbols);});APPEND_OPCODES.add(8, /* BindNamedArgs */function(vm,_ref6){var _names=_ref6.op1;var _symbols=_ref6.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindNamedArgs(names,symbols);});APPEND_OPCODES.add(9, /* BindBlocks */function(vm,_ref7){var _names=_ref7.op1;var _symbols=_ref7.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindBlocks(names,symbols);});APPEND_OPCODES.add(10, /* BindPartialArgs */function(vm,_ref8){var symbol=_ref8.op1;vm.bindPartialArgs(symbol);});APPEND_OPCODES.add(11, /* BindCallerScope */function(vm){return vm.bindCallerScope();});APPEND_OPCODES.add(12, /* BindDynamicScope */function(vm,_ref9){var _names=_ref9.op1;var names=vm.constants.getArray(_names);vm.bindDynamicScope(names);});APPEND_OPCODES.add(13, /* Enter */function(vm,_ref10){var start=_ref10.op1;var end=_ref10.op2;return vm.enter(start,end);});APPEND_OPCODES.add(14, /* Exit */function(vm){return vm.exit();});APPEND_OPCODES.add(15, /* Evaluate */function(vm,_ref11){var _block=_ref11.op1;var block=vm.constants.getBlock(_block);var args=vm.frame.getArgs();vm.invokeBlock(block,args);});APPEND_OPCODES.add(16, /* Jump */function(vm,_ref12){var target=_ref12.op1;return vm.goto(target);});APPEND_OPCODES.add(17, /* JumpIf */function(vm,_ref13){var target=_ref13.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(18, /* JumpUnless */function(vm,_ref14){var target=_ref14.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(!reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(!cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});var ConstTest=function(ref,_env){return new _glimmerReference.ConstReference(!!ref.value());};var SimpleTest=function(ref,_env){return ref;};var EnvironmentTest=function(ref,env){return env.toConditionalReference(ref);};APPEND_OPCODES.add(19, /* Test */function(vm,_ref15){var _func=_ref15.op1;var operand=vm.frame.getOperand();var func=vm.constants.getFunction(_func);vm.frame.setCondition(func(operand,vm.env));});var Assert=(function(_UpdatingOpcode){babelHelpers.inherits(Assert,_UpdatingOpcode);function Assert(cache){_UpdatingOpcode.call(this);this.type = "assert";this.tag = cache.tag;this.cache = cache;}Assert.prototype.evaluate = function evaluate(vm){var cache=this.cache;if(_glimmerReference.isModified(cache.revalidate())){vm.throw();}};Assert.prototype.toJSON = function toJSON(){var type=this.type;var _guid=this._guid;var cache=this.cache;var expected=undefined;try{expected = JSON.stringify(cache.peek());}catch(e) {expected = String(cache.peek());}return {guid:_guid,type:type,args:[],details:{expected:expected}};};return Assert;})(UpdatingOpcode);var JumpIfNotModifiedOpcode=(function(_UpdatingOpcode2){babelHelpers.inherits(JumpIfNotModifiedOpcode,_UpdatingOpcode2);function JumpIfNotModifiedOpcode(tag,target){_UpdatingOpcode2.call(this);this.target = target;this.type = "jump-if-not-modified";this.tag = tag;this.lastRevision = tag.value();}JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm){var tag=this.tag;var target=this.target;var lastRevision=this.lastRevision;if(!vm.alwaysRevalidate && tag.validate(lastRevision)){vm.goto(target);}};JumpIfNotModifiedOpcode.prototype.didModify = function didModify(){this.lastRevision = this.tag.value();};JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.target.inspect())]};};return JumpIfNotModifiedOpcode;})(UpdatingOpcode);var DidModifyOpcode=(function(_UpdatingOpcode3){babelHelpers.inherits(DidModifyOpcode,_UpdatingOpcode3);function DidModifyOpcode(target){_UpdatingOpcode3.call(this);this.target = target;this.type = "did-modify";this.tag = _glimmerReference.CONSTANT_TAG;}DidModifyOpcode.prototype.evaluate = function evaluate(){this.target.didModify();};return DidModifyOpcode;})(UpdatingOpcode);var LabelOpcode=(function(){function LabelOpcode(label){this.tag = _glimmerReference.CONSTANT_TAG;this.type = "label";this.label = null;this.prev = null;this.next = null;_glimmerUtil.initializeGuid(this);if(label)this.label = label;}LabelOpcode.prototype.evaluate = function evaluate(){};LabelOpcode.prototype.inspect = function inspect(){return this.label + ' [' + this._guid + ']';};LabelOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.inspect())]};};return LabelOpcode;})();var EMPTY_ARRAY=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze([]):[];var EMPTY_DICT=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze(_glimmerUtil.dict()):_glimmerUtil.dict();var CompiledPositionalArgs=(function(){function CompiledPositionalArgs(values){this.values = values;this.length = values.length;}CompiledPositionalArgs.create = function create(values){if(values.length){return new this(values);}else {return COMPILED_EMPTY_POSITIONAL_ARGS;}};CompiledPositionalArgs.empty = function empty(){return COMPILED_EMPTY_POSITIONAL_ARGS;};CompiledPositionalArgs.prototype.evaluate = function evaluate(vm){var values=this.values;var length=this.length;var references=new Array(length);for(var i=0;i < length;i++) {references[i] = values[i].evaluate(vm);}return EvaluatedPositionalArgs.create(references);};CompiledPositionalArgs.prototype.toJSON = function toJSON(){return '[' + this.values.map(function(value){return value.toJSON();}).join(", ") + ']';};return CompiledPositionalArgs;})();var COMPILED_EMPTY_POSITIONAL_ARGS=new ((function(_CompiledPositionalArgs){babelHelpers.inherits(_class,_CompiledPositionalArgs);function _class(){_CompiledPositionalArgs.call(this,EMPTY_ARRAY);}_class.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_POSITIONAL_ARGS;};_class.prototype.toJSON = function toJSON(){return '<EMPTY>';};return _class;})(CompiledPositionalArgs))();var EvaluatedPositionalArgs=(function(){function EvaluatedPositionalArgs(values){this.values = values;this.tag = _glimmerReference.combineTagged(values);this.length = values.length;}EvaluatedPositionalArgs.create = function create(values){return new this(values);};EvaluatedPositionalArgs.empty = function empty(){return EVALUATED_EMPTY_POSITIONAL_ARGS;};EvaluatedPositionalArgs.prototype.at = function at(index){var values=this.values;var length=this.length;return index < length?values[index]:UNDEFINED_REFERENCE;};EvaluatedPositionalArgs.prototype.value = function value(){var values=this.values;var length=this.length;var ret=new Array(length);for(var i=0;i < length;i++) {ret[i] = values[i].value();}return ret;};return EvaluatedPositionalArgs;})();var EVALUATED_EMPTY_POSITIONAL_ARGS=new ((function(_EvaluatedPositionalArgs){babelHelpers.inherits(_class2,_EvaluatedPositionalArgs);function _class2(){_EvaluatedPositionalArgs.call(this,EMPTY_ARRAY);}_class2.prototype.at = function at(){return UNDEFINED_REFERENCE;};_class2.prototype.value = function value(){return this.values;};return _class2;})(EvaluatedPositionalArgs))();var CompiledNamedArgs=(function(){function CompiledNamedArgs(keys,values){this.keys = keys;this.values = values;this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}CompiledNamedArgs.empty = function empty(){return COMPILED_EMPTY_NAMED_ARGS;};CompiledNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=[];for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values);}else {return COMPILED_EMPTY_NAMED_ARGS;}};CompiledNamedArgs.prototype.evaluate = function evaluate(vm){var keys=this.keys;var values=this.values;var length=this.length;var evaluated=new Array(length);for(var i=0;i < length;i++) {evaluated[i] = values[i].evaluate(vm);}return new EvaluatedNamedArgs(keys,evaluated);};CompiledNamedArgs.prototype.toJSON = function toJSON(){var keys=this.keys;var values=this.values;var inner=keys.map(function(key,i){return key + ': ' + values[i].toJSON();}).join(", ");return '{' + inner + '}';};return CompiledNamedArgs;})();var COMPILED_EMPTY_NAMED_ARGS=new ((function(_CompiledNamedArgs){babelHelpers.inherits(_class3,_CompiledNamedArgs);function _class3(){_CompiledNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY);}_class3.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_NAMED_ARGS;};_class3.prototype.toJSON = function toJSON(){return '<EMPTY>';};return _class3;})(CompiledNamedArgs))();var EvaluatedNamedArgs=(function(){function EvaluatedNamedArgs(keys,values){var _map=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];this.keys = keys;this.values = values;this._map = _map;this.tag = _glimmerReference.combineTagged(values);this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}EvaluatedNamedArgs.create = function create(map){var key