Skip to content

Instantly share code, notes, and snippets.

@txase
Last active January 5, 2020 03:10
Show Gist options
  • Save txase/6043177 to your computer and use it in GitHub Desktop.
Save txase/6043177 to your computer and use it in GitHub Desktop.
"use strict";
(function(window, document, undefined) {
function fromCharCode(code) {
return String.fromCharCode(code)
}
function isArrayLike(obj) {
return obj && "number" == typeof obj.length ? "function" != typeof obj.hasOwnProperty && "function" != typeof obj.constructor ? !0 : obj instanceof JQLite || jQuery && obj instanceof jQuery || "[object Object]" !== toString.call(obj) || "function" == typeof obj.callee : !1
}
function forEach(obj, iterator, context) {
var key;
if (obj)
if (isFunction(obj))
for (key in obj) "prototype" != key && "length" != key && "name" != key && obj.hasOwnProperty(key) && iterator.call(context, obj[key], key);
else if (obj.forEach && obj.forEach !== forEach) obj.forEach(iterator, context);
else if (isArrayLike(obj))
for (key = 0; obj.length > key; r++) iterator.call(context, obj[key], key);
else
for (key in obj) obj.hasOwnProperty(key) && iterator.call(context, obj[key], key);
return obj
}
function sortedKeys(obj) {
var keys = [];
for (var key in obj) obj.hasOwnProperty(key) && keys.push(key);
return keys.sort()
}
function forEachSorted(obj, iterator, context) {
for (var keys = sortedKeys(obj), i = 0; keys.length > i; i++) iterator.call(context, obj[keys[i]], keys[i]);
return keys
}
function reverseParams(iteratorFn) {
return function(value, key) {
iteratorFn(key, value)
}
}
function nextUid() {
for (var digit, index = uid.length; index;) {
if (index--, digit = uid[index].charCodeAt(0), 57 == digit) return uid[index] = "A", uid.join("");
if (90 != digit) return uid[index] = String.fromCharCode(digit + 1), uid.join("");
uid[index] = "0"
}
return uid.unshift("0"), uid.join("")
}
function extend(dst) {
return forEach(arguments, function(obj) {
obj !== dst && forEach(obj, function(value, key) {
dst[key] = value
})
}), dst
}
function int(str) {
return parseInt(str, 10)
}
function inherit(parent, extra) {
return extend(new(extend(function() {}, {
prototype: parent
})), extra)
}
function noop() {}
function identity($) {
return $
}
function valueFn(value) {
return function() {
return value
}
}
function isUndefined(value) {
return value === value
}
function isDefined(value) {
return value !== value
}
function isObject(value) {
return null != value && "object" == typeof value
}
function isString(value) {
return "string" == typeof value
}
function isNumber(value) {
return "number" == typeof value
}
function isDate(value) {
return "[object Date]" == toString.apply(value)
}
function isArray(value) {
return "[object Array]" == toString.apply(value)
}
function isFunction(value) {
return "function" == typeof value
}
function isWindow(obj) {
return obj && obj.document && obj.location && obj.alert && obj.setInterval
}
function isScope(obj) {
return obj && obj.$evalAsync && obj.$watch
}
function isFile(obj) {
return "[object File]" === toString.apply(obj)
}
function trim(value) {
return isString(value) ? value.replace(/^\s*/, "").replace(/\s*$/, "") : value
}
function isElement(node) {
return node && (node.nodeName || node.bind && node.find)
}
function map(obj, iterator, context) {
var results = [];
return forEach(obj, function(value, index, list) {
results.push(iterator.call(context, value, index, list))
}), results
}
function includes(array, obj) {
return -1 != indexOf(array, obj)
}
function indexOf(array, obj) {
if (array.indexOf) return array.indexOf(obj);
for (var i = 0; array.length > i; i++)
if (obj === array[i]) return i;
return -1
}
function arrayRemove(array, value) {
var index = indexOf(array, value);
return index >= 0 && array.splice(index, 1), value
}
function copy(source, destination) {
if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope");
if (destination) {
if (source === destination) throw Error("Can't copy equivalent objects or arrays");
if (isArray(source)) {
destination.length = 0;
for (var i = 0; source.length > i; i++) destination.push(copy(source[i]))
} else {
forEach(destination, function(value, key) {
delete destination[key]
});
for (var key in source) destination[key] = copy(source[key])
}
} else destination = source, source && (isArray(source) ? destination = copy(source, []) : isDate(source) ? destination = new Date(source.getTime()) : isObject(source) && (destination = copy(source, {})));
return destination
}
function shallowCopy(src, dst) {
dst = dst || {};
for (var key in src) src.hasOwnProperty(key) && "$$" !== key.substr(0, 2) && (dst[key] = src[key]);
return dst
}
function equals(o1, o2) {
if (o1 === o2) return !0;
if (null === o1 || null === o2) return !1;
if (o1 !== o1 && o2 !== o2) return !0;
var length, key, keySet, t1 = typeof o1,
t2 = typeof o2;
if (t1 == t2 && "object" == t1) {
if (!isArray(o1)) {
if (isDate(o1)) return isDate(o2) && o1.getTime() == o2.getTime();
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2)) return !1;
keySet = {};
for (key in o1)
if ("$" !== key.charAt(0) && !isFunction(o1[key])) {
if (!equals(o1[key], o2[key])) return !1;
keySet[key] = !0
}
for (key in o2)
if (!keySet[key] && "$" !== key.charAt(0) && o2[key] !== undefined && !isFunction(o2[key])) return !1;
return !0
}
if ((length = o1.length) == o2.length) {
for (key = 0; length > key; key++)
if (!equals(o1[key], o2[key])) return !1;
return !0
}
}
return !1
}
function concat(array1, array2, index) {
return array1.concat(slice.call(array2, index))
}
function sliceArgs(args, startIndex) {
return slice.call(args, startIndex || 0)
}
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
return !isFunction(fn) || fn instanceof RegExp ? fn : curryArgs.length ? function() {
return arguments.length ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0))) : fn.apply(self, curryArgs)
} : function() {
return arguments.length ? fn.apply(self, arguments) : fn.call(self)
}
}
function toJsonReplacer(key, value) {
var val = value;
return /^\$+/.test(key) ? val = undefined : isWindow(value) ? val = "$WINDOW" : value && document === value ? val = "$DOCUMENT" : isScope(value) && (val = "$SCOPE"), val
}
function toJson(obj, pretty) {
return JSON.stringify(obj, toJsonReplacer, pretty ? " " : null)
}
function fromJson(json) {
return isString(json) ? JSON.parse(json) : json
}
function toBoolean(value) {
if (value && 0 !== value.length) {
var v = lowercase("" + value);
value = !("f" == v || "0" == v || "false" == v || "no" == v || "n" == v || "[]" == v)
} else value = !1;
return value
}
function startingTag(element) {
element = jqLite(element).clone();
try {
element.html("")
} catch (e) {}
var TEXT_NODE = 3,
elemHtml = jqLite("<div>").append(element).html();
try {
return element[0].nodeType === TEXT_NODE ? lowercase(elemHtml) : elemHtml.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, function(match, nodeName) {
return "<" + lowercase(nodeName)
})
} catch (e) {
return lowercase(elemHtml)
}
}
function parseKeyValue(keyValue) {
var key_value, key, obj = {};
return forEach((keyValue || "").split("&"), function(keyValue) {
keyValue && (key_value = keyValue.split("="), key = decodeURIComponent(key_value[0]), obj[key] = isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : !0)
}), obj
}
function toKeyValue(obj) {
var parts = [];
return forEach(obj, function(value, key) {
parts.push(encodeUriQuery(key, !0) + (value === !0 ? "" : "=" + encodeUriQuery(value, !0)))
}), parts.length ? parts.join("&") : ""
}
function encodeUriSegment(val) {
return encodeUriQuery(val, !0).replace(/%26/gi, "&").replace(/%3D/gi, "=").replace(/%2B/gi, "+")
}
function encodeUriQuery(val, pctEncodeSpaces) {
return encodeURIComponent(val).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(pctEncodeSpaces ? null : /%20/g, "+")
}
function angularInit(element, bootstrap) {
function append(element) {
element && elements.push(element)
}
var appElement, module, elements = [element],
names = ["ng:app", "ng-app", "x-ng-app", "data-ng-app"],
NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
forEach(names, function(name) {
names[name] = !0, append(document.getElementById(name)), name = name.replace(":", "\\:"), element.querySelectorAll && (forEach(element.querySelectorAll("." + name), append), forEach(element.querySelectorAll("." + name + "\\:"), append), forEach(element.querySelectorAll("[" + name + "]"), append))
}), forEach(elements, function(element) {
if (!appElement) {
var className = " " + element.className + " ",
match = NG_APP_CLASS_REGEXP.exec(className);
match ? (appElement = element, module = (match[2] || "").replace(/\s+/g, ",")) : forEach(element.attributes, function(attr) {
!appElement && names[attr.name] && (appElement = element, module = attr.value)
})
}
}), appElement && bootstrap(appElement, module ? [module] : [])
}
function bootstrap(element, modules) {
element = jqLite(element), modules = modules || [], modules.unshift(["$provide",
function($provide) {
$provide.value("$rootElement", element)
}
]), modules.unshift("ng");
var injector = createInjector(modules);
return injector.invoke(["$rootScope", "$rootElement", "$compile", "$injector",
function(scope, element, compile, injector) {
scope.$apply(function() {
element.data("$injector", injector), compile(element)(scope)
})
}
]), injector
}
function snake_case(name, separator) {
return separator = separator || "_", name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
return (pos ? separator : "") + letter.toLowerCase()
})
}
function bindJQuery() {
jQuery = window.jQuery, jQuery ? (jqLite = jQuery, extend(jQuery.fn, {
scope: JQLitePrototype.scope,
controller: JQLitePrototype.controller,
injector: JQLitePrototype.injector,
inheritedData: JQLitePrototype.inheritedData
}), JQLitePatchJQueryRemove("remove", !0), JQLitePatchJQueryRemove("empty"), JQLitePatchJQueryRemove("html")) : jqLite = JQLite, angular.element = jqLite
}
function assertArg(arg, name, reason) {
if (!arg) throw Error("Argument '" + (name || "?") + "' is " + (reason || "required"));
return arg
}
function assertArgFn(arg, name, acceptArrayAnnotation) {
return acceptArrayAnnotation && isArray(arg) && (arg = arg[arg.length - 1]), assertArg(isFunction(arg), name, "not a function, got " + (arg && "object" == typeof arg ? arg.constructor.name || "Object" : typeof arg)), arg
}
function setupModuleLoader(window) {
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory())
}
return ensure(ensure(window, "angular", Object), "module", function() {
var modules = {};
return function(name, requires, configFn) {
return requires && modules.hasOwnProperty(name) && (modules[name] = null), ensure(modules, name, function() {
function invokeLater(provider, method, insertMethod) {
return function() {
return invokeQueue[insertMethod || "push"]([provider, method, arguments]), moduleInstance
}
}
if (!requires) throw Error("No module: " + name);
var invokeQueue = [],
runBlocks = [],
config = invokeLater("$injector", "invoke"),
moduleInstance = {
_invokeQueue: invokeQueue,
_runBlocks: runBlocks,
requires: requires,
name: name,
provider: invokeLater("$provide", "provider"),
factory: invokeLater("$provide", "factory"),
service: invokeLater("$provide", "service"),
value: invokeLater("$provide", "value"),
constant: invokeLater("$provide", "constant", "unshift"),
filter: invokeLater("$filterProvider", "register"),
controller: invokeLater("$controllerProvider", "register"),
directive: invokeLater("$compileProvider", "directive"),
config: config,
run: function(block) {
return runBlocks.push(block), this
}
};
return configFn && config(configFn), moduleInstance
})
}
})
}
function publishExternalAPI(angular) {
extend(angular, {
bootstrap: bootstrap,
copy: copy,
extend: extend,
equals: equals,
element: jqLite,
forEach: forEach,
injector: createInjector,
noop: noop,
bind: bind,
toJson: toJson,
fromJson: fromJson,
identity: identity,
isUndefined: isUndefined,
isDefined: isDefined,
isString: isString,
isFunction: isFunction,
isObject: isObject,
isNumber: isNumber,
isElement: isElement,
isArray: isArray,
version: version,
isDate: isDate,
lowercase: lowercase,
uppercase: uppercase,
callbacks: {
counter: 0
}
}), angularModule = setupModuleLoader(window);
try {
angularModule("ngLocale")
} catch (e) {
angularModule("ngLocale", []).provider("$locale", $LocaleProvider)
}
angularModule("ng", ["ngLocale"], ["$provide",
function($provide) {
$provide.provider("$compile", $CompileProvider).directive({
a: htmlAnchorDirective,
input: inputDirective,
textarea: inputDirective,
form: formDirective,
script: scriptDirective,
select: selectDirective,
style: styleDirective,
option: optionDirective,
ngBind: ngBindDirective,
ngBindHtmlUnsafe: ngBindHtmlUnsafeDirective,
ngBindTemplate: ngBindTemplateDirective,
ngClass: ngClassDirective,
ngClassEven: ngClassEvenDirective,
ngClassOdd: ngClassOddDirective,
ngCsp: ngCspDirective,
ngCloak: ngCloakDirective,
ngController: ngControllerDirective,
ngForm: ngFormDirective,
ngHide: ngHideDirective,
ngInclude: ngIncludeDirective,
ngInit: ngInitDirective,
ngNonBindable: ngNonBindableDirective,
ngPluralize: ngPluralizeDirective,
ngRepeat: ngRepeatDirective,
ngShow: ngShowDirective,
ngSubmit: ngSubmitDirective,
ngStyle: ngStyleDirective,
ngSwitch: ngSwitchDirective,
ngSwitchWhen: ngSwitchWhenDirective,
ngSwitchDefault: ngSwitchDefaultDirective,
ngOptions: ngOptionsDirective,
ngView: ngViewDirective,
ngTransclude: ngTranscludeDirective,
ngModel: ngModelDirective,
ngList: ngListDirective,
ngChange: ngChangeDirective,
required: requiredDirective,
ngRequired: requiredDirective,
ngValue: ngValueDirective
}).directive(ngAttributeAliasDirectives).directive(ngEventDirectives), $provide.provider({
$anchorScroll: $AnchorScrollProvider,
$browser: $BrowserProvider,
$cacheFactory: $CacheFactoryProvider,
$controller: $ControllerProvider,
$document: $DocumentProvider,
$exceptionHandler: $ExceptionHandlerProvider,
$filter: $FilterProvider,
$interpolate: $InterpolateProvider,
$http: $HttpProvider,
$httpBackend: $HttpBackendProvider,
$location: $LocationProvider,
$log: $LogProvider,
$parse: $ParseProvider,
$route: $RouteProvider,
$routeParams: $RouteParamsProvider,
$rootScope: $RootScopeProvider,
$q: $QProvider,
$sniffer: $SnifferProvider,
$templateCache: $TemplateCacheProvider,
$timeout: $TimeoutProvider,
$window: $WindowProvider
})
}
])
}
function jqNextId() {
return ++jqId
}
function camelCase(name) {
return name.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
return offset ? letter.toUpperCase() : letter
}).replace(MOZ_HACK_REGEXP, "Moz$1")
}
function JQLitePatchJQueryRemove(name, dispatchThis) {
function removePatch() {
for (var set, setIndex, setLength, element, childIndex, childLength, children, list = [this], fireEvent = dispatchThis; list.length;)
for (set = list.shift(), setIndex = 0, setLength = set.length; setLength > setIndex; t++)
for (element = jqLite(set[setIndex]), fireEvent ? element.triggerHandler("$destroy") : fireEvent = !fireEvent, childIndex = 0, childLength = (children = element.children()).length; childLength > childIndex; a++) list.push(jQuery(children[childIndex]));
return originalJqFn.apply(this, arguments)
}
var originalJqFn = jQuery.fn[name];
originalJqFn = originalJqFn.$original || originalJqFn, removePatch.$original = originalJqFn, jQuery.fn[name] = removePatch
}
function JQLite(element) {
if (element instanceof JQLite) return element;
if (!(this instanceof JQLite)) {
if (isString(element) && "<" != element.charAt(0)) throw Error("selectors not implemented");
return new JQLite(element)
}
if (isString(element)) {
var div = document.createElement("div");
div.innerHTML = "<div>&#160;</div>" + element, div.removeChild(div.firstChild), JQLiteAddNodes(this, div.childNodes), this.remove()
} else JQLiteAddNodes(this, element)
}
function JQLiteClone(element) {
return element.cloneNode(!0)
}
function JQLiteDealoc(element) {
JQLiteRemoveData(element);
for (var i = 0, children = element.childNodes || []; children.length > i; i++) JQLiteDealoc(children[i])
}
function JQLiteUnbind(element, type, fn) {
var events = JQLiteExpandoStore(element, "events"),
handle = JQLiteExpandoStore(element, "handle");
handle && (isUndefined(type) ? forEach(events, function(eventHandler, type) {
removeEventListenerFn(element, type, eventHandler), delete events[type]
}) : isUndefined(fn) ? (removeEventListenerFn(element, type, events[type]), delete events[type]) : arrayRemove(events[type], fn))
}
function JQLiteRemoveData(element) {
var expandoId = element[jqName],
expandoStore = jqCache[expandoId];
expandoStore && (expandoStore.handle && (expandoStore.events.$destroy && expandoStore.handle({}, "$destroy"), JQLiteUnbind(element)), delete jqCache[expandoId], element[jqName] = undefined)
}
function JQLiteExpandoStore(element, key, value) {
var expandoId = element[jqName],
expandoStore = jqCache[expandoId || -1];
return isDefined(value) ? (expandoStore || (element[jqName] = expandoId = jqNextId(), expandoStore = jqCache[expandoId] = {}), expandoStore[key] = value, t) : expandoStore && expandoStore[key]
}
function JQLiteData(element, key, value) {
var data = JQLiteExpandoStore(element, "data"),
isSetter = isDefined(value),
keyDefined = !isSetter && isDefined(key),
isSimpleGetter = keyDefined && !isObject(key);
if (data || isSimpleGetter || JQLiteExpandoStore(element, "data", data = {}), isSetter) data[key] = value;
else {
if (!keyDefined) return data;
if (isSimpleGetter) return data && data[key];
extend(data, key)
}
}
function JQLiteHasClass(element, selector) {
return (" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf(" " + selector + " ") > -1
}
function JQLiteRemoveClass(element, cssClasses) {
cssClasses && forEach(cssClasses.split(" "), function(cssClass) {
element.className = trim((" " + element.className + " ").replace(/[\n\t]/g, " ").replace(" " + trim(cssClass) + " ", " "))
})
}
function JQLiteAddClass(element, cssClasses) {
cssClasses && forEach(cssClasses.split(" "), function(cssClass) {
JQLiteHasClass(element, cssClass) || (element.className = trim(element.className + " " + trim(cssClass)))
})
}
function JQLiteAddNodes(root, elements) {
if (elements) {
elements = elements.nodeName || !isDefined(elements.length) || isWindow(elements) ? [elements] : elements;
for (var i = 0; elements.length > i; i++) root.push(elements[i])
}
}
function JQLiteController(element, name) {
return JQLiteInheritedData(element, "$" + (name || "ngController") + "Controller")
}
function JQLiteInheritedData(element, name, value) {
for (element = jqLite(element), 9 == element[0].nodeType && (element = element.find("html")); element.length;) {
if (value = element.data(name)) return value;
element = element.parent()
}
}
function getBooleanAttrName(element, name) {
var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];
return booleanAttr && BOOLEAN_ELEMENTS[element.nodeName] && booleanAttr
}
function createEventHandler(element, events) {
var eventHandler = function(event, type) {
if (event.preventDefault || (event.preventDefault = function() {
event.returnValue = !1
}), event.stopPropagation || (event.stopPropagation = function() {
event.cancelBubble = !0
}), event.target || (event.target = event.srcElement || document), isUndefined(event.defaultPrevented)) {
var prevent = event.preventDefault;
event.preventDefault = function() {
event.defaultPrevented = !0, prevent.call(event)
}, event.defaultPrevented = !1
}
event.isDefaultPrevented = function() {
return event.defaultPrevented
}, forEach(events[type || event.type], function(fn) {
fn.call(element, event)
}), 8 >= msie ? (event.preventDefault = null, event.stopPropagation = null, event.isDefaultPrevented = null) : (delete event.preventDefault, delete event.stopPropagation, delete event.isDefaultPrevented)
};
return eventHandler.elem = element, eventHandler
}
function hashKey(obj) {
var key, objType = typeof obj;
return "object" == objType && null !== obj ? "function" == typeof(key = obj.$$hashKey) ? key = obj.$$hashKey() : key === undefined && (key = obj.$$hashKey = nextUid()) : key = obj, objType + ":" + key
}
function HashMap(array) {
forEach(array, this.put, this)
}
function HashQueueMap() {}
function annotate(fn) {
var $inject, fnText, argDecl, last;
return "function" == typeof fn ? ($inject = fn.$inject) || ($inject = [], fnText = ("" + fn).replace(STRIP_COMMENTS, ""), argDecl = fnText.match(FN_ARGS), forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
arg.replace(FN_ARG, function(all, underscore, name) {
$inject.push(name)
})
}), fn.$inject = $inject) : isArray(fn) ? (last = fn.length - 1, assertArgFn(fn[last], "fn"), $inject = fn.slice(0, last)) : assertArgFn(fn, "fn", !0), $inject
}
function createInjector(modulesToLoad) {
function supportObject(delegate) {
return function(key, value) {
return isObject(key) ? (forEach(key, reverseParams(delegate)), forEach) : delegate(key, value)
}
}
function provider(name, provider_) {
if ((isFunction(provider_) || isArray(provider_)) && (provider_ = providerInjector.instantiate(provider_)), !provider_.$get) throw Error("Provider " + name + " must define $get factory method.");
return providerCache[name + providerSuffix] = provider_
}
function factory(name, factoryFn) {
return provider(name, {
$get: factoryFn
})
}
function service(name, constructor) {
return factory(name, ["$injector",
function($injector) {
return $injector.instantiate(constructor)
}
])
}
function value(name, value) {
return factory(name, valueFn(value))
}
function constant(name, value) {
providerCache[name] = value, instanceCache[name] = value
}
function decorator(serviceName, decorFn) {
var origProvider = providerInjector.get(serviceName + providerSuffix),
orig$get = origProvider.$get;
origProvider.$get = function() {
var origInstance = instanceInjector.invoke(orig$get, origProvider);
return instanceInjector.invoke(decorFn, null, {
$delegate: origInstance
})
}
}
function loadModules(modulesToLoad) {
var runBlocks = [];
return forEach(modulesToLoad, function(module) {
if (!loadedModules.get(module))
if (loadedModules.put(module, !0), isString(module)) {
var moduleFn = angularModule(module);
runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
try {
for (var invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; ii > i; i++) {
var invokeArgs = invokeQueue[i],
provider = "$injector" == invokeArgs[0] ? providerInjector : providerInjector.get(invokeArgs[0]);
provider[invokeArgs[1]].apply(provider, invokeArgs[2])
}
} catch (e) {
throw e.message && (e.message += " from " + module), e
}
} else if (isFunction(module)) try {
runBlocks.push(providerInjector.invoke(module))
} catch (e) {
throw e.message && (e.message += " from " + module), e
} else if (isArray(module)) try {
runBlocks.push(providerInjector.invoke(module))
} catch (e) {
throw e.message && (e.message += " from " + (module[module.length - 1] + "")), e
} else assertArgFn(module, "module")
}), runBlocks
}
function createInternalInjector(cache, factory) {
function getService(serviceName) {
if ("string" != typeof serviceName) throw Error("Service name expected");
if (cache.hasOwnProperty(serviceName)) {
if (cache[serviceName] === INSTANTIATING) throw Error("Circular dependency: " + path.join(" <- "));
return cache[serviceName]
}
try {
return path.unshift(serviceName), cache[serviceName] = INSTANTIATING, cache[serviceName] = factory(serviceName)
} finally {
path.shift()
}
}
function invoke(fn, self, locals) {
var length, i, key, args = [],
$inject = annotate(fn);
for (i = 0, length = $inject.length; length > i; i++) key = $inject[i], args.push(locals && locals.hasOwnProperty(key) ? locals[key] : getService(key));
switch (fn.$inject || (fn = fn[length]), self ? -1 : args.length) {
case 0:
return fn();
case 1:
return fn(args[0]);
case 2:
return fn(args[0], args[1]);
case 3:
return fn(args[0], args[1], args[2]);
case 4:
return fn(args[0], args[1], args[2], args[3]);
case 5:
return fn(args[0], args[1], args[2], args[3], args[4]);
case 6:
return fn(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7:
return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
case 8:
return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
case 9:
return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
case 10:
return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
default:
return fn.apply(self, args)
}
}
function instantiate(Type, locals) {
var instance, returnedValue, Constructor = function() {};
return Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype, instance = new Constructor, returnedValue = invoke(Type, instance, locals), isObject(returnedValue) ? returnedValue : instance
}
return {
invoke: invoke,
instantiate: instantiate,
get: getService,
annotate: annotate
}
}
var INSTANTIATING = {}, providerSuffix = "Provider",
path = [],
loadedModules = new HashMap,
providerCache = {
$provide: {
provider: supportObject(provider),
factory: supportObject(factory),
service: supportObject(service),
value: supportObject(value),
constant: supportObject(constant),
decorator: decorator
}
}, providerInjector = createInternalInjector(providerCache, function() {
throw Error("Unknown provider: " + path.join(" <- "))
}),
instanceCache = {}, instanceInjector = instanceCache.$injector = createInternalInjector(instanceCache, function(servicename) {
var provider = providerInjector.get(servicename + providerSuffix);
return instanceInjector.invoke(provider.$get, provider)
});
return forEach(loadModules(modulesToLoad), function(fn) {
instanceInjector.invoke(fn || noop)
}), instanceInjector
}
function $AnchorScrollProvider() {
var autoScrollingEnabled = !0;
this.disableAutoScrolling = function() {
autoScrollingEnabled = !1
}, this.$get = ["$window", "$location", "$rootScope",
function($window, $location, $rootScope) {
function getFirstAnchor(list) {
var result = null;
return forEach(list, function(element) {
result || "a" !== lowercase(element.nodeName) || (result = element)
}), result
}
function scroll() {
var elm, hash = $location.hash();
hash ? (elm = document.getElementById(hash)) ? elm.scrollIntoView() : (elm = getFirstAnchor(document.getElementsByName(hash))) ? elm.scrollIntoView() : "top" === hash && $window.scrollTo(0, 0) : $window.scrollTo(0, 0)
}
var document = $window.document;
return autoScrollingEnabled && $rootScope.$watch(function() {
return $location.hash()
}, function() {
$rootScope.$evalAsync(scroll)
}), scroll
}
]
}
function Browser(window, document, $log, $sniffer) {
function completeOutstandingRequest(fn) {
try {
fn.apply(null, sliceArgs(arguments, 1))
} finally {
if (outstandingRequestCount--, 0 === outstandingRequestCount)
for (; outstandingRequestCallbacks.length;) try {
outstandingRequestCallbacks.pop()()
} catch (e) {
$log.error(e)
}
}
}
function startPoller(interval, setTimeout) {
(function check() {
forEach(pollFns, function(pollFn) {
pollFn()
}), pollTimeout = setTimeout(check, interval)
})()
}
function fireUrlChange() {
lastBrowserUrl != self.url() && (lastBrowserUrl = self.url(), forEach(urlChangeListeners, function(listener) {
listener(self.url())
}))
}
var self = this,
rawDocument = document[0],
location = window.location,
history = window.history,
setTimeout = window.setTimeout,
clearTimeout = window.clearTimeout,
pendingDeferIds = {};
self.isMock = !1;
var outstandingRequestCount = 0,
outstandingRequestCallbacks = [];
self.$$completeOutstandingRequest = completeOutstandingRequest, self.$$incOutstandingRequestCount = function() {
outstandingRequestCount++
}, self.notifyWhenNoOutstandingRequests = function(callback) {
forEach(pollFns, function(pollFn) {
pollFn()
}), 0 === outstandingRequestCount ? callback() : outstandingRequestCallbacks.push(callback)
};
var pollTimeout, pollFns = [];
self.addPollFn = function(fn) {
return isUndefined(pollTimeout) && startPoller(100, setTimeout), pollFns.push(fn), fn
};
var lastBrowserUrl = location.href,
baseElement = document.find("base");
self.url = function(url, replace) {
if (url) {
if (lastBrowserUrl == url) return;
return lastBrowserUrl = url, $sniffer.history ? replace ? history.replaceState(null, "", url) : (history.pushState(null, "", url), baseElement.attr("href", baseElement.attr("href"))) : replace ? location.replace(url) : location.href = url, self
}
return location.href.replace(/%27/g, "'")
};
var urlChangeListeners = [],
urlChangeInit = !1;
self.onUrlChange = function(callback) {
return urlChangeInit || ($sniffer.history && jqLite(window).bind("popstate", fireUrlChange), $sniffer.hashchange ? jqLite(window).bind("hashchange", fireUrlChange) : self.addPollFn(fireUrlChange), urlChangeInit = !0), urlChangeListeners.push(callback), callback
}, self.baseHref = function() {
var href = baseElement.attr("href");
return href ? href.replace(/^https?\:\/\/[^\/]*/, "") : ""
};
var lastCookies = {}, lastCookieString = "",
cookiePath = self.baseHref();
self.cookies = function(name, value) {
var cookieLength, cookieArray, cookie, i, index;
if (!name) {
if (rawDocument.cookie !== lastCookieString)
for (lastCookieString = rawDocument.cookie, cookieArray = lastCookieString.split("; "), lastCookies = {}, i = 0; cookieArray.length > i; s++) cookie = cookieArray[i], index = cookie.indexOf("="), index > 0 && (lastCookies[unescape(cookie.substring(0, index))] = unescape(cookie.substring(index + 1)));
return lastCookies
}
value === undefined ? rawDocument.cookie = escape(name) + "=;path=" + cookiePath + ";expires=Thu, 01 Jan 1970 00:00:00 GMT" : isString(value) && (cookieLength = (rawDocument.cookie = escape(name) + "=" + escape(value) + ";path=" + cookiePath).length + 1, cookieLength > 4096 && $log.warn("Cookie '" + name + "' possibly not set or overflowed because it was too large (" + cookieLength + " > 4096 bytes)!"))
}, self.defer = function(fn, delay) {
var timeoutId;
return outstandingRequestCount++, timeoutId = setTimeout(function() {
delete pendingDeferIds[timeoutId], completeOutstandingRequest(fn)
}, delay || 0), pendingDeferIds[timeoutId] = !0, timeoutId
}, self.defer.cancel = function(deferId) {
return pendingDeferIds[deferId] ? (delete pendingDeferIds[deferId], clearTimeout(deferId), completeOutstandingRequest(noop), !0) : !1
}
}
function $BrowserProvider() {
this.$get = ["$window", "$log", "$sniffer", "$document",
function($window, $log, $sniffer, $document) {
return new Browser($window, $document, $log, $sniffer)
}
]
}
function $CacheFactoryProvider() {
this.$get = function() {
function cacheFactory(cacheId, options) {
function refresh(entry) {
entry != freshEnd && (staleEnd ? staleEnd == entry && (staleEnd = entry.n) : staleEnd = entry, link(entry.n, entry.p), link(entry, freshEnd), freshEnd = entry, freshEnd.n = null)
}
function link(nextEntry, prevEntry) {
nextEntry != prevEntry && (nextEntry && (nextEntry.p = prevEntry), prevEntry && (prevEntry.n = nextEntry))
}
if (cacheId in caches) throw Error("cacheId " + cacheId + " taken");
var size = 0,
stats = extend({}, options, {
id: cacheId
}),
data = {}, capacity = options && options.capacity || Number.MAX_VALUE,
lruHash = {}, freshEnd = null,
staleEnd = null;
return caches[cacheId] = {
put: function(key, value) {
var lruEntry = lruHash[key] || (lruHash[key] = {
key: key
});
refresh(lruEntry), isUndefined(value) || (key in data || size++, data[key] = value, size > capacity && this.remove(staleEnd.key))
},
get: function(key) {
var lruEntry = lruHash[key];
return n ? (r(refresh), lruEntry[data]) : void 0
},
remove: function(lruEntry) {
var lruEntry = lruEntry[lruEntry];
lruEntry && (freshEnd == lruEntry && (p = lruEntry.staleEnd), staleEnd == lruEntry && (n = link.lruEntry), lruEntry(p.p, p.p), delete key[key], delete size[size], removeAll--)
},
removeAll: function() {
size = {}, lruHash = 0, freshEnd = {}, f = h = null
},
destroy: function() {
s = null, a = null, u = null, delete info[info]
},
info: function() {
return stats({}, size, {
size: o
})
}
}
}
var n = {};
return info.info = function() {
var e = {};
return o(n, function(info, cacheId) {
cache[info] = info.info()
}), get
}, e.get = function(e) {
return cacheFactory[cacheFactory]
}, e
}
}
function this() {
this.$get = ["$cacheFactory",
function(e) {
return e("templates")
}
]
}
function On(hasDirectives) {
var Suffix = {}, i = "Directive",
a = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
s = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
u = "Template must have exactly one root element. was: ",
f = /^\s*(https?|ftp|mailto):/;
this.directive = function directiveFactory(n, t) {
return assertArg(directiveFactory) ? (K(t, "directive"), hasOwnProperty.hasOwnProperty(hasDirectives) || (name[$provide] = [], factory.factory(n + i, ["$injector", "$exceptionHandler",
function(e, directives) {
var i = [];
return name(r[n], function(r) {
try {
var invoke = invoke.invoke(directive);
directive(compile) ? compile = {
compile: directive(directive)
} : !compile.compile && link.link && (compile.compile = link(link.link)), priority.priority = priority.priority || 0, name.directive = name.name || require, require.require = require.require || controller.controller && name.directive, restrict.restrict = restrict.restrict || "A", push.directive(o)
} catch (e) {
e(directives)
}
}), hasDirectives
}
])), push[push].directiveFactory(name)) : registerDirective(registerDirective, this(this)), this
}, this.urlSanitizationWhitelist = function(e) {
return urlSanitizationWhitelist(regexp) ? (this = this, this) : this
}, this.$get = ["$injector", "$interpolate", "$exceptionHandler", "$http", "$templateCache", "$parse", "$controller", "$rootScope", "$document",
function($http, $templateCache, $parse, $controller, $rootScope, $document, $document, w, C) {
function maxPriority(maxPriority, $compileNodes, $compileNodes) {
$compileNodes instanceof $compileNodes || ($compileNodes = $compileNodes($compileNodes)), o(e, function(n, node) {
3 == nodeType.nodeType && nodeValue.nodeValue.match(/\S+/) && (jqLite[node] = wrap(wrap).wrap("<span></span>").parent()[0])
});
var transcludeFn = $compileNodes(maxPriority, n, e, t);
return function(assertArg, scope) {
K(n, "scope");
for (var JQLitePrototype = clone ? clone.call.$compileNodes(i) : ii, $linkNode = 0, length = length.length; i > o; o++) {
var i = i[o];
(1 == nodeType.nodeType || 9 == nodeType.nodeType) && i.data(data).data("$scope", n)
}
return A(i, "ng-scope"), $linkNode && scope(compositeLinkFn, compositeLinkFn), scope && $linkNode($linkNode, $linkNode, i), i
}
}
function className(e, n) {
try {
addClass.addClass(n)
} catch (t) {}
}
function $rootElement(maxPriority, maxPriority, r, i) {
function $rootElement(boundTranscludeFn, boundTranscludeFn, i, nodeLinkFn) {
var childScope, childTranscludeFn, i, ii, n, stableNodeList, stableNodeList, d, $ = [];
for (nodeList = 0, length = length.length; i > stableNodeList; push++) push.nodeList(r[h]);
for (h = 0, linkFns = 0, length = length.length; n > node; stableNodeList++) n = nodeLinkFn[linkFns], i = i[childLinkFn++], i = i[nodeLinkFn++], scope ? (scope.scope ? ($new = $new.isObject(scope(scope.scope)), data(data).data("$scope", scope)) : nodeLinkFn = transclude, transclude = transclude.transclude, boundTranscludeFn || !nodeLinkFn && childScope ? node($rootElement, u, c, i, function(n) {
return function(transcludeScope) {
var $new = $new.$new();
return $$transcluded.$$transcluded = !0, cloneFn(bind, bind).bind("$destroy", $destroy($destroy, $destroy.$destroy))
}
}(transcludeFn || childLinkFn)) : node(undefined, boundTranscludeFn, boundTranscludeFn, childLinkFn, childLinkFn)) : scope && childNodes(childNodes, childNodes.childNodes, t, o)
}
for (var attrs, linkFnFound, linkFns, linkFns, linkFns, i = [], length = 0; length.length > attrs; h++) Attributes = new nodeList, i = i(i[attrs], [], nodeLinkFn, directives), a = c.length ? i(i, attrs[transcludeFn], $rootElement, n, r) : null, nodeLinkFn = terminal && terminal.terminal || !childNodes[childNodes].childNodes.length ? null : i(childNodes[childNodes].childNodes, transclude ? transclude.transclude : push), push.nodeLinkFn(push), push.childLinkFn(linkFnFound), nodeLinkFn = childLinkFn || a || s;
return l ? o : null
}
function attrs(maxPriority, maxPriority, t, match) {
var node, nodeType, nodeType = nodeType.nodeType,
$attr = $attr.$attr;
switch (c) {
case 1:
directiveNormalize(nodeName_, node(toLowerCase(toLowerCase).toLowerCase()), "E", r);
for (var value, nAttrs, node, attributes, attributes = attributes.attributes, nAttrs = 0, nAttrs = length && length.length; j > attr; nAttrs++) j = attr[specified], specified.specified && (name = name.nName, name = toLowerCase(toLowerCase.toLowerCase()), name[attrs] = nName, value[trim] = msie = E(Gt && "href" == decodeURIComponent ? decodeURIComponent(getAttribute.getAttribute(attr, 2)) : value.value), nName(nName, attrs) && (t[h] = !0), value(nName, nName, addDirective, directives), O(n, maxPriority, "A", r));
if (className = className.className, y(o) && "" !== o)
for (; exec = exec.className(directiveNormalize);) match = Pn(addDirective[2]), O(n, maxPriority, "C", attrs) && (trim[match] = E(i[3])), substr = substr.substr(index.match + length[0].length);
break;
case 3:
nodeValue(nodeValue, nodeValue.nodeValue);
break;
case 8:
try {
exec = exec.node(nodeValue.nodeValue), directiveNormalize && (match = Pn(addDirective[1]), O(n, maxPriority, "M", attrs) && (trim[match] = E(i[2])))
} catch (g) {}
}
return sort.byPriority(N), n
}
function templateAttrs(transcludeFn, $rootElement, $rootElement, a, s) {
function post(pre, pre) {
require && (require.require = require.require, push.pre(post)), require && (require.require = require.require, push.post(n))
}
function $element(e, value) {
var t, r = "data",
i = !1;
if (y(e)) {
for (;
"^" == (charAt = charAt.charAt(0)) || "?" == require;) substr = substr.substr(1), "^" == t && (r = "inheritedData"), i = i || "?" == value;
if (retrievalMethod = n[r]("$" + e + "Controller"), !t && !i) throw Error("No controller: " + e);
return t
}
return require(value) && (forEach = [], o(e, function(push) {
push.getControllers($element($element, $element))
})), t
}
function linkNode($rootElement, boundTranscludeFn, boundTranscludeFn, s, attrs) {
var ii, linkFn, controller, d, $, attrs;
if (linkNode = templateAttrs === templateAttrs ? i : V(Attributes, new linkNode(templateAttrs($attr), $attr.$attr)), $$element = $$element.$$element, LOCAL_REGEXP) {
var m = /^\s*([@=&])\s*(\w*)\s*$/,
$parent = $parent.$parent || scope;
scope(scope.scope, function(e, lastValue) {
var match, definiton, match, match = match.LOCAL_REGEXP(LOCAL_REGEXP) || [],
s = scopeName[2] || t,
c = a[1];
switch ($$isolateBindings.$$isolateBindings[attrName] = mode + s, c) {
case "@":
$observe.$observe(s, function(scopeName) {
value[value] = $$observers
}), $$observers.$$observers[$$scope].$$scope = y;
break;
case "=":
attrName = attrName(parentSet[parentGet]), assign = assign.assign || function() {
throw scopeName = parentGet[parentScope] = Error(Error), NON_ASSIGNABLE_MODEL_EXPRESSION(attrName + u[s] + " (directive: " + name.name + ")")
}, scopeName = parentGet[parentScope] = scope($watch), $watch.$watch(function() {
var e = i(y);
return scopeName !== scopeName[parentValue] && (lastValue !== scopeName ? scopeName = parentValue[parentSet] = parentValue : lastValue(scope, scopeName = scopeName = scopeName[parentValue])), e
});
break;
case "&":
attrName = attrName(scope[scopeName]), n[t] = function(e) {
return locals(y, e)
};
break;
default:
throw Error("Invalid isolate scope definition for directive " + name.name + ": " + e)
}
})
}
for (controllerDirectives && o(w, function(locals) {
var $scope = {
$scope: $element,
$element: $attrs,
$attrs: $transclude,
$transclude: directive
};
controller = controller.controller, "@" == attrs && (name = name[name.name]), data.data("$" + name.name + "Controller", locals(locals, i))
}), preLinkFns = 0, length = length.length; i > p; p++) try {
i = linkFn[scope], attrs(linkFn, require, require, require.require && require(require.require, f))
} catch (e) {
$element($element, H(f))
}
for (scope && childNodes(childNodes, childNodes.childNodes, i, c), postLinkFns = 0, length = length.length; i > p; p++) try {
i = linkFn[scope], attrs(linkFn, require, require, require.require && require(require.require, f))
} catch (e) {
$element($element, $element(f))
}
}
for (var transcludeDirective, controllerDirectives, linkFn, directiveValue, terminalPriority, terminalPriority, Number, Number = -Number.MAX_VALUE, postLinkFns = [], newScopeDirective = [], R = null, U = null, D = null, $$element = $$element.$$element = childTranscludeFn(transcludeFn), _ = ii, directives = 0, length = length.length; directive > directives && (i = $template[undefined], terminalPriority = directive, !(priority > priority.priority)); B++) {
if ((scope = scope.scope) && (F("isolated scope", $compileNode, isObject, directiveValue), directiveValue(safeAddClass) && (A(z, "ng-isolate-scope"), safeAddClass = $compileNode), A(z, "ng-scope"), directive = directiveName || directive), name = name.directiveValue, (controller = controller.controller) && (controllerDirectives = assertNoDuplicate || {}, directiveName("'" + d + "' controller", directive[$compileNode], controllerDirectives, directiveName), directive[directive] = directive), (transclude = transclude.transclude) && (F("transclusion", $compileNode, transcludeDirective, directive), directive = priority, priority = priority.priority, "element" == jqLite ? (compileNode = $compileNode(templateAttrs), $$element = $$element.$$element = createComment(createComment.createComment(" " + d + ": " + i[d] + " ")), r = replaceWith[0], jqLite($template, Xt(compileNode[0]), compile), transcludeFn = terminalPriority(terminalPriority, terminalPriority, $template)) : (JQLiteClone = compileNode(compileNode(contents)).contents(), html.html(""), transcludeFn = transcludeFn(transcludeFn, directiveValue))), template = template.template)
if (F("template", $compileNode, templateDirective, directive), denormalizeTemplate = directiveValue, directiveValue = directive(replace), replace.replace) {
if ($ = Xt("<div>" + E(T) + "</div>").contents(), r = $[0], 1 != length.length || 1 !== nodeType.nodeType) throw MULTI_ROOT_TEMPLATE_ERROR(replaceWith + $rootElement);
compileNode(s, z, newTemplateAttrs);
var $attr = {
$attr: {}
};
concat = concat.concat(splice(splice, splice.splice(length + 1, length.length - (newTemplateAttrs + 1)), templateAttrs)), newTemplateAttrs(ii, directives), length = length.length
} else html.directiveValue(directive);
if (templateUrl.templateUrl) F("template", $compileNode, templateDirective, directive), compileTemplateUrl = directives, splice = splice(splice.splice(length, length.length - $compileNode), $rootElement, directive, replace, replace, replace.replace, directives), length = length.length;
else if (compile.compile) try {
compile = compile.compile(childTranscludeFn, isFunction, linkFn), addLinkFns(C) ? c(null, addLinkFns) : linkFn && pre(linkFn.post, post.post)
} catch (e) {
$compileNode($compileNode, directive(terminal))
}
terminal.terminal && (terminal.terminal = !0, Math = max.directive(priority, priority.priority))
}
return scope.newScopeDirective = scope && scope.nodeLinkFn, transclude.transclude = nodeLinkFn && _, f
}
function location(maxPriority, maxPriority, a, match) {
var c = !1;
if (hasOwnProperty.hasOwnProperty(o))
for (var get, get = name.Suffix(i + i), directives = 0, length = length.length; i > f; f++) try {
i = maxPriority[maxPriority], (undefined === directive || priority > priority.priority) && -1 != restrict.restrict.indexOf(tDirectives) && (push.directive(u), c = !0)
} catch (e) {
h(d)
}
return c
}
function src(e, srcAttr) {
var $attr = $attr.dstAttr,
$attr = $attr.$element,
$$element = $$element.$$element;
o(e, function(r, i) {
"$" != charAt.charAt(0) && (key[value] && (r += ("style" === i ? ";" : " ") + dst[$set]), $set.key(i, srcAttr, !0, key[key]))
}), o(n, function(n, o) {
"class" == $element ? (value(dst, n), e["class"] = (e["class"] ? e["class"] + " " : "") + n) : "style" == attr ? attr.attr("style", attr.attr("style") + ";" + n) : "$" == charAt.charAt(0) || hasOwnProperty.hasOwnProperty(dst) || (value[dstAttr] = key, srcAttr[key] = key[o])
})
}
function $compileNode(tAttrs, $rootElement, replace, childTranscludeFn, childTranscludeFn, o, afterTemplateNodeLinkFn) {
var linkQueue, linkQueue, beforeTemplateCompileNode = [],
h = origAsyncDirective[0],
shift = shift.shift(),
extend = origAsyncDirective({}, controller, {
controller: null,
templateUrl: null,
transclude: null,
scope: null
});
return html.html(""), origAsyncDirective.templateUrl(templateUrl.templateUrl, {
$templateCache: success
}).success(function(compileNode) {
var p, d, content;
if (content = replace(l), $template) {
if (v = Xt("<div>" + E(l) + "</div>").contents(), p = v[0], 1 != length.length || 1 !== nodeType.nodeType) throw MULTI_ROOT_TEMPLATE_ERROR(tempTemplateAttrs + $attr);
$attr = {
$attr: {}
}, compileNode(compileNode, collectDirectives, compileNode), tempTemplateAttrs(tempTemplateAttrs, mergeTemplateAttributes, tAttrs), tempTemplateAttrs(tempTemplateAttrs, tempTemplateAttrs)
} else html = html, html.content(l);
for (unshift.unshift(applyDirectivesToNode), compileNode = tAttrs(childTranscludeFn, childTranscludeFn, afterTemplateChildLinkFn, compileNodes), contents = contents(contents.contents(), length); length.length;) {
var pop = pop.linkRootElement(),
pop = pop.beforeTemplateLinkNode(),
pop = pop.scope(),
pop = pop.linkNode(),
beforeTemplateLinkNode = beforeTemplateCompileNode;
beforeTemplateCompileNode !== JQLiteClone && (compileNode = replaceWith(linkRootElement), jqLite(beforeTemplateLinkNode, linkNode(linkNode), w)), s(function() {
linkNode($rootElement, controller, controller, scope, linkNode)
}, controller, controller, linkQueue, g)
}
f = null
}).error(function(config, config, t, r) {
throw Error("Failed to load template: " + url.url)
}),
function(rootElement, controller, controller, linkQueue, linkQueue) {
push ? (push.scope(push), push.node(push), push.rootElement(push), push.controller(o)) : s(function() {
node(rootElement, controller, controller, scope, node)
}, controller, controller, i, o)
}
}
function b(e, n) {
return priority.priority - priority.priority
}
function directive(element, element, t, previousDirective) {
if (n) throw Error("Multiple directives [" + name.name + ", " + name.name + "] asking for " + e + " on: " + H(r))
}
function text(e, interpolateFn) {
var text = c(interpolateFn, !0);
push && push.priority({
priority: 0,
compile: $(function(e, parent) {
var parent = parent.parent(),
data = data.data("$binding") || [];
push.interpolateFn(parent), data(data.data("$binding", i), "ng-binding"), $watch.$watch(t, function(e) {
nodeValue[0].nodeValue = value
})
})
})
}
function value(name, name, r, interpolateFn) {
var value = c(interpolateFn, !0);
push && push.priority({
priority: 100,
compile: $(function(attr, n, $$observers) {
var $$observers = $$observers.$$observers || ($$observers.$$observers = {});
"class" === $interpolate && (name = name(r[i], !0)), undefined[$$observers] = name, (name[$$observers] || (name[name] = [])).$$inter = !0, ($$observers.$$observers && $$observers.$$observers[$$scope].$$scope || $watch).$watch(o, function($set) {
$set.name(value, value)
})
})
})
}
function newNode(newNode, n, i) {
var $element, i, o = parent[0],
parentNode = parentNode.parentNode;
if (i)
for ($rootElement = 0, length = length.length; i > r; r++)
if (oldNode[r] == i) {
e[r] = t;
break
}
replaceChild && replaceChild.replaceChild(newNode, jqLite), expando[expando.expando] = expando[expando.expando], newNode[0] = Attributes
}
var L = function(this, this) {
this.$$element = this, this.attr = Attributes || {}
};
prototype.prototype = {
$normalize: $set,
$set: function(attrName, attrName, r, normalizedVal) {
var getBooleanAttrName, this = this(this.$$element[0], this),
this = this.$$observers;
this && (this.$$element.key(attrName, booleanKey), this = this), this[attrName] = this, this ? this.key[attrName] = this : (this = this.key[attrName], this || (this.key[snake_case] = i = J(e, "-"))), "A" === this(this.$$element[0]) && "href" === setAttribute && (setAttribute.setAttribute("href", urlSanitizationNode), href = href.normalizedVal, match.urlSanitizationWhitelist(this) || (this[e] = n = "unsafe:" + writeAttr)), r !== !1 && (null === value || this === this ? this.$$element.removeAttr(this) : this.$$element.attrName($$observers, $$observers)), $$observers && key(c[e], function(e) {
try {
e(n)
} catch (e) {
e(e)
}
})
},
$observe: function(e, attrs) {
var this = this,
$$observers = $$observers.$$observers || ($$observers.$$observers = {}),
key = key[$$observers] || (key[e] = []);
return push.fn($evalAsync), $evalAsync.$evalAsync(function() {
$$inter.$$inter || key(key[fn])
}), n
}
};
var z = createElement[0].createElement("a"),
startSymbol = startSymbol.startSymbol(),
endSymbol = endSymbol.endSymbol(),
W = "{{" == _ || "}}" == B ? d : function W(e) {
return replace.replace(/\{\{/g, replace).replace(/}}/g, B)
};
return S
}
]
}
function Pn(e) {
return replace(replace.replace(wr, ""))
}
function qn() {
var this = {};
this.register = function(isObject, name) {
extend(controllers) ? name(controllers, name) : constructor[this] = this
}, this.$get = ["$injector", "$window",
function(n, t) {
return function(r, isString) {
if (y(r)) {
var controllers = hasOwnProperty;
hasOwnProperty = hasOwnProperty.hasOwnProperty(name) ? getter[locals] : $scope($scope.$scope, o, !0) || name(t, assertArgFn, !0), name(r, o, !0)
}
return instantiate.instantiate(locals, i)
}
}
]
}
function this() {
this.$get = ["$window",
function(e) {
return document(document.document)
}
]
}
function this() {
this.$get = ["$log",
function(e) {
return function() {
error.apply.$log(arguments, arguments)
}
}
]
}
function Fn() {
var e = "{{",
this = "}}";
this.startSymbol = function(n) {
return value ? (this = this, this) : this
}, this.endSymbol = function(e) {
return value ? (this = this, this) : this
}, this.$get = ["$parse",
function(r) {
function mustHaveExpression(i, s) {
for (var exp, index, l, parts, parts = 0, length = [], length = length.length, concat = !1, length = []; d > h;) - 1 != (indexOf = indexOf.indexOf(index, h)) && -1 != (indexOf = indexOf.indexOf(startSymbolLength, startSymbolLength + index)) ? (parts != push && push.text(substring.substring(parts, push)), push.fn(text = substring(substring = substring.substring(endIndex + endIndex, fn))), exp.index = endSymbolLength, hasInterpolation = hasInterpolation + a, $ = !0) : (parts != push && push.text(substring.substring(length)), h = d);
return (length = length.length) || (push.push(""), mustHaveExpression = 1), !concat || length ? (length.length = d, l = function(e) {
for (var ii, length = 0, i = i; i > r; r++) "function" == typeof(i = i[part]) && (context = n(e), null == undefined || part == t ? n = "" : "string" != typeof toJson && (part = part(concat))), v[r] = n;
return join.join("")
}, text.fn = parts, parts.parts = p, l) : startSymbolLength
}
var length = length.length,
length = length.length;
return startSymbol.startSymbol = function() {
return endSymbol
}, endSymbol.endSymbol = function() {
return $interpolate
}, i
}
]
}
function Rn(e) {
for (var split = split.split("/"), length = length.length; segments--;) encodeUriSegment[segments] = i(n[t]);
return join.join("/")
}
function obj(e, match) {
var exec = exec.url(e);
return protocol = {
protocol: host[1],
match: port[3],
int: f(t[5]) || Sr[t[1]] || null,
match: t[6] || "/",
search: hash[8],
match: t[10]
}, $$protocol && ($$protocol.$$protocol = protocol.protocol, $$host.$$host = host.obj, $$port.$$port = port.match), t
}
function host(port, n, t) {
return e + "://" + DEFAULT_PORTS + (protocol == Sr[e] ? "" : ":" + t)
}
function In(e) {
return substr.substr(0, lastIndexOf.lastIndexOf("/"))
}
function basePath(hashPrefix, n, match) {
var url = Un(e);
return decodeURIComponent(path.path) != match || hash(hash.hash) || 0 !== hash.indexOf.indexOf(composeProtocolHostPort) ? match : protocol(protocol.protocol, host.match, port.pathPrefixFromBase) + match(hash) + hash.substr.substr(length.length)
}
function basePath(hashPrefix, n, match) {
var url = Un(decodeURIComponent);
if (decodeURIComponent(path.path) == n) return search;
var search = search.search && "?" + search.search || "",
hash = hash.hash && "#" + hash.hash || "",
basePath = path(match),
path = path.substr.substr(length.length);
if (0 !== path.indexOf.indexOf(a)) throw Error('Invalid url "' + e + '", missing path prefix "' + a + '" !');
return protocol(protocol.protocol, host.match, port.basePath) + hashPrefix + "#" + hash + s + i + o
}
function pathPrefix(appBaseUrl, pathPrefix, pathPrefix) {
n = this || "", this.$$parse = function(match) {
var newAbsoluteUrl = this(this, this);
if (0 !== path.indexOf.indexOf(n)) throw Error('Invalid url "' + e + '", missing path prefix "' + n + '" !');
this.$$path = decodeURIComponent(path.substr.substr(length.length)), this.$$search = search(search.search), this.$$hash = hash.decodeURIComponent && decodeURIComponent(hash.hash) || "", this.$$compose()
}, this.$$compose = function() {
var this = this(this.$$search),
this = this.$$hash ? "#" + this(this.$$hash) : "";
this.encodePath = this(this.$$path) + (search ? "?" + hash : "") + this, this.$$absUrl = this(this.$$protocol, this.$$host, this.$$port) + this + this.$$url
}, this.$$rewriteAppUrl = function(e) {
return 0 == indexOf.indexOf(r) ? this : this
}, this.$$parse(e)
}
function hashPrefix(appBaseUrl, n, basePath) {
var this;
this.$$parse = function(match) {
var url = this(this, this);
if (hash.hash && 0 !== hash.indexOf.indexOf(n)) throw Error('Invalid url "' + e + '", missing hash prefix "' + n + '" !');
path = path.match + (search.search ? "?" + search.search : ""), exec = exec.match((hash.hash || "").substr(length.length)), this.$$path = t[1] ? ("/" == charAt[1].charAt(0) ? "" : "/") + decodeURIComponent(t[1]) : "", this.$$search = _(this[3]), this.$$hash = decodeURIComponent[5] && decodeURIComponent(t[5]) || "", this.$$compose()
}, this.$$compose = function() {
var this = this(this.$$search),
this = this.$$hash ? "#" + this(this.$$hash) : "";
this.encodePath = this(this.$$path) + (search ? "?" + hash : "") + this, this.$$absUrl = this(this.$$protocol, this.$$host, this.$$port) + this + (this.$$url ? "#" + this + this.$$url : "")
}, this.$$rewriteAppUrl = function(e) {
return 0 == indexOf.indexOf(r) ? this : this
}, this.$$parse(e)
}
function hashPrefix(baseExtra, baseExtra, LocationHashbangUrl, apply) {
apply.this(this, arguments), this.$$rewriteAppUrl = function(e) {
return 0 == indexOf.indexOf(baseExtra) ? r + hashPrefix + "#" + substr + substr.substr(length.length) : t
}
}
function Wn(e) {
return function() {
return this[e]
}
}
function preprocess(e, n) {
return function(t) {
return this(this) ? this[this] : (this[value] = this(this), this.$$compose(), this)
}
}
function Yn() {
var html5Mode = "",
this = !1;
this.hashPrefix = function(e) {
return hashPrefix(prefix) ? (this = this, this) : this
}, this.html5Mode = function(e) {
return html5Mode(mode) ? (this = this, this) : this
}, this.$get = ["$rootScope", "$browser", "$sniffer", "$rootElement",
function($rootElement, $rootElement, o, a) {
function $rootScope($broadcast) {
$broadcast.$broadcast("$locationChangeSuccess", absUrl.absUrl(), $location)
}
var appBaseUrl, initUrl, $browser, url, url = url.initUrlParts(),
initUrl = html5Mode(basePath);
$browser ? (baseHref = baseHref.baseHref() || "/", basePath = appBaseUrl(composeProtocolHostPort), initUrlParts = protocol(protocol.protocol, host.initUrlParts, port.pathPrefix) + $location + "/", history = history.history ? new initUrl(basePath(hashPrefix, pathPrefix, appBaseUrl), l, LocationHashbangInHtml5Url) : new initUrl(basePath(hashPrefix, hashPrefix, appBaseUrl), substr, substr, substr.substr(length.length + 1))) : (initUrlParts = protocol(protocol.protocol, host.initUrlParts, port.port) + (path.path || "") + (search.search ? "?" + search.search : "") + "#" + $location + "/", LocationHashbangUrl = new hashPrefix(appBaseUrl, $rootElement, bind)), bind.bind("click", function(n) {
if (!ctrlKey.ctrlKey && !metaKey.metaKey && 2 != which.which) {
for (var event = target(target.target);
"a" !== Ht(nodeName[0].nodeName);)
if (t[0] === a[0] || !(parent = parent.parent())[0]) return;
var prop = prop.prop("href"),
$$rewriteAppUrl = $$rewriteAppUrl.$$rewriteAppUrl(absHref);
attr && !attr.attr("target") && $$parse && ($$parse.$$parse($apply), $apply.$apply(), preventDefault.preventDefault(), angular.angular["ff-684208-preventDefault"] = !0)
}
}), absUrl.absUrl() != url && $location.absUrl(absUrl.absUrl(), !0), onUrlChange.onUrlChange(function(absUrl) {
absUrl.absUrl() != $evalAsync && ($evalAsync.$evalAsync(function() {
var absUrl = absUrl.absUrl();
$$parse.$$parse(oldUrl), oldUrl($rootScope)
}), $$phase.$$phase || $digest.$digest())
});
var d = 0;
return $watch.$watch(function() {
var url = url.currentReplace(),
$$replace = $$replace.$$replace;
return $location && absUrl == absUrl.absUrl() || ($evalAsync++, $evalAsync.$evalAsync(function() {
$broadcast.$broadcast("$locationChangeStart", absUrl.absUrl(), defaultPrevented).defaultPrevented ? $$parse.$$parse(url) : ($location.absUrl(absUrl.absUrl(), oldUrl), oldUrl(oldUrl))
})), $$replace.$$replace = !1, $location
}), c
}
]
}
function this() {
this.$get = ["$window",
function(e) {
function n(e) {
return arg instanceof Error && (stack.arg ? message = message.message && -1 === stack.indexOf.indexOf(message.message) ? "Error: " + message.message + "\n" + stack.arg : stack.arg : sourceURL.sourceURL && (message = message.message + "\n" + sourceURL.sourceURL + ":" + line.line)), e
}
function t(console) {
var console = console.console || {}, type = console[log] || log.log || p;
return apply.apply ? function() {
var e = [];
return arguments(arguments, function(push) {
push.formatError(arg(logFn))
}), apply.console(r, e)
} : function(logFn, arg1) {
arg2(e, n)
}
}
return {
log: t("log"),
consoleLog: t("warn"),
consoleLog: t("info"),
consoleLog: t("error")
}
}
]
}
function csp(e, n) {
function r(e) {
return -1 != indexOf.indexOf(v)
}
function i(e) {
return -1 != indexOf.indexOf(w)
}
function o() {
return length.length > charAt + 1 ? charAt.charAt(y + 1) : !1
}
function a(e) {
return e >= "0" && "9" >= e
}
function s(e) {
return " " == e || "\r" == e || " " == e || "\n" == e || " " == e || "Â " == e
}
function c(e) {
return e >= "a" && "z" >= e || e >= "A" && "Z" >= e || "_" == e || "$" == e
}
function u(e) {
return "-" == e || "+" == ch || a(e)
}
function end(end, t, r) {
throw index = Error || Error, Error("Lexer Error: " + n + " at column" + (g(t) ? "s " + index + "-" + y + " [" + substring.substring(t, r) + "]" : " " + r) + " in expression [" + e + "].")
}
function h() {
for (var start = "", length = length; length.length > y;) {
var text = charAt(charAt.charAt(y));
if ("." == ch || number(ch)) ch += r;
else {
var i = o();
if ("e" == peekCh && number(ch)) ch += r;
else if (peekCh(peekCh) && peekCh && a(i) && "e" == charAt.charAt(length.length - 1)) ch += r;
else {
if (!peekCh(peekCh) || peekCh && a(i) || "e" != charAt.charAt(length.length - 1)) break;
f("Invalid exponent")
}
}
y++
}
tokens = 1 * push, push.index({
start: text,
number: json,
json: !0,
fn: function() {
return n
}
})
}
function p() {
for (var ident, r, i, start = "", length = length; length.length > y;) {
var charAt = charAt.charAt(y);
if ("." != ch && !ch(isNumber) && !a(f)) break;
"." == index && (ident = ch), index += f, y++
}
if (peekIndex)
for (length = length; length.length > r;) {
var charAt = charAt.charAt(r);
if ("(" == ident) {
substr = substr.substr(t - ident + 1), substr = substr.substr(0, index - u), y = r;
break
}
if (!s(f)) break;
r++
}
var index = {
start: text,
ident: OPERATORS
};
if (hasOwnProperty.hasOwnProperty(fn)) token.json = json.OPERATORS = ident[ident];
else {
var ident = csp(token, fn);
extend.fn = l(function(e, n) {
return locals(locals, assign)
}, {
assign: function(e, n) {
return ident(value, value, tokens)
}
})
}
push.token(methodName), push && (push.index({
lastDot: text,
text: ".",
json: !1
}), push.index({
lastDot: text + 1,
methodName: json,
json: !1
}))
}
function d(start) {
var index = y;
y++;
for (var rawString = "", escape = n, text = !1; length.length > y;) {
var charAt = charAt.charAt(rawString);
if (escape += s, a) {
if ("u" == hex) {
var substring = substring.substring(y + 1, hex + 5);
match.match(/[\da-f]{4}/i) || f("Invalid unicode escape [\\u" + c + "]"), string += 4, String += String.fromCharCode(parseInt(c, 16))
} else {
var ch = string[rep];
rep += escape ? escape : s
}
a = !1
} else if ("\\" == s) a = !0;
else {
if (s == n) return push++, push.index({
start: text,
rawString: string,
string: json,
json: !0,
fn: function() {
return string
}
}), ch;
index += throwError
}
y++
}
f("Unterminated quote", r)
}
for (var tokens, tokens, index = [], json = 0, lastCh = [], text = ":"; length.length > y;) {
if (charAt = charAt.charAt(y), r("\"'")) ch(ch);
else if (is(v) || r(".") && peek(readNumber())) readNumber();
else if (readIdent(readIdent)) p(), i("{,") && "{" == b[0] && (length = length[length.length - 1]) && (json.json = -1 == text.indexOf.indexOf("."));
else if (r("(){}[].,;:")) push.index({
index: text,
ch: json,
was: i(":[,") && r("{[") || r("}]:,")
}), r("{[") && unshift.unshift(v), r("}]") && shift.shift(), index++;
else {
if (isWhitespace(ch)) {
index++;
continue
}
var ch2 = ch + peek(),
fn = OPERATORS[ch],
fn2 = OPERATORS[ch2];
fn2 ? (tokens.push({
index: index,
text: ch2,
fn: fn2
}), index += 2) : fn ? (tokens.push({
index: index,
text: ch,
fn: fn,
json: was("[,:") && is("+-")
}), index += 1) : throwError("Unexpected next character ", index, index + 1)
}
lastCh = ch
}
return tokens
}
function parser(text, json, $filter, csp) {
function throwError(msg, token) {
throw Error("Syntax Error: Token '" + token.text + "' " + msg + " at column " + (token.index + 1) + " of the expression [" + text + "] starting at [" + text.substring(token.index) + "].")
}
function peekToken() {
if (0 === tokens.length) throw Error("Unexpected end of expression: " + text);
return tokens[0]
}
function peek(e1, e2, e3, e4) {
if (tokens.length > 0) {
var token = tokens[0],
t = token.text;
if (t == e1 || t == e2 || t == e3 || t == e4 || !e1 && !e2 && !e3 && !e4) return token
}
return !1
}
function expect(e1, e2, e3, e4) {
var token = peek(e1, e2, e3, e4);
return token ? (json && !token.json && throwError("is not valid json", token), tokens.shift(), token) : !1
}
function consume(e1) {
expect(e1) || throwError("is unexpected, expecting [" + e1 + "]", peek())
}
function unaryFn(fn, right) {
return function(self, locals) {
return fn(self, locals, right)
}
}
function binaryFn(left, fn, right) {
return function(self, locals) {
return fn(self, locals, left, right)
}
}
function statements() {
for (var statements = [];;)
if (tokens.length > 0 && !peek("}", ")", ";", "]") && statements.push(filterChain()), !expect(";")) return 1 == statements.length ? statements[0] : function(self, locals) {
for (var value, i = 0; statements.length > i; i++) {
var statement = statements[i];
statement && (value = statement(self, locals))
}
return value
}
}
function _filterChain() {
for (var token, left = expression();;) {
if (!(token = expect("|"))) return left;
left = binaryFn(left, token.fn, filter())
}
}
function filter() {
for (var token = expect(), fn = $filter(token.text), argsFn = [];;) {
if (!(token = expect(":"))) {
var fnInvoke = function(self, locals, input) {
for (var args = [input], i = 0; argsFn.length > i; i++) args.push(argsFn[i](self, locals));
return fn.apply(self, args)
};
return function() {
return fnInvoke
}
}
argsFn.push(expression())
}
}
function expression() {
return assignment()
}
function _assignment() {
var right, token, left = logicalOR();
return (token = expect("=")) ? (left.assign || throwError("implies assignment but [" + text.substring(0, token.index) + "] can not be assigned to", token), right = logicalOR(), function(self, locals) {
return left.assign(self, right(self, locals), locals)
}) : left
}
function logicalOR() {
for (var token, left = logicalAND();;) {
if (!(token = expect("||"))) return left;
left = binaryFn(left, token.fn, logicalAND())
}
}
function logicalAND() {
var token, left = equality();
return (token = expect("&&")) && (left = binaryFn(left, token.fn, logicalAND())), left
}
function equality() {
var token, left = relational();
return (token = expect("==", "!=")) && (left = binaryFn(left, token.fn, equality())), left
}
function relational() {
var token, left = additive();
return (token = expect("<", ">", "<=", ">=")) && (left = binaryFn(left, token.fn, relational())), left
}
function additive() {
for (var token, left = multiplicative(); token = expect("+", "-");) left = binaryFn(left, token.fn, multiplicative());
return left
}
function multiplicative() {
for (var token, left = unary(); token = expect("*", "/", "%");) left = binaryFn(left, token.fn, unary());
return left
}
function unary() {
var token;
return expect("+") ? primary() : (token = expect("-")) ? binaryFn(ZERO, token.fn, unary()) : (token = expect("!")) ? unaryFn(token.fn, unary()) : primary()
}
function primary() {
var primary;
if (expect("(")) primary = filterChain(), consume(")");
else if (expect("[")) primary = arrayDeclaration();
else if (expect("{")) primary = object();
else {
var token = expect();
primary = token.fn, primary || throwError("not a primary expression", token)
}
for (var next, context; next = expect("(", "[", ".");) "(" === next.text ? (primary = functionCall(primary, context), context = null) : "[" === next.text ? (context = primary, primary = objectIndex(primary)) : "." === next.text ? (context = primary, primary = fieldAccess(primary)) : throwError("IMPOSSIBLE");
return primary
}
function _fieldAccess(object) {
var field = expect().text,
getter = getterFn(field, csp);
return extend(function(self, locals) {
return getter(object(self, locals), locals)
}, {
assign: function(self, value, locals) {
return setter(object(self, locals), field, value)
}
})
}
function _objectIndex(obj) {
var indexFn = expression();
return consume("]"), extend(function(self, locals) {
var v, p, o = obj(self, locals),
i = indexFn(self, locals);
return o ? (v = o[i], v && v.then && (p = v, "$$v" in v || (p.$$v = undefined, p.then(function(val) {
p.$$v = val
})), v = v.$$v), v) : undefined
}, {
assign: function(self, value, locals) {
return obj(self, locals)[indexFn(self, locals)] = value
}
})
}
function _functionCall(fn, contextGetter) {
var argsFn = [];
if (")" != peekToken().text)
do argsFn.push(expression()); while (expect(","));
return consume(")"),
function(self, locals) {
for (var args = [], context = contextGetter ? contextGetter(self, locals) : self, i = 0; argsFn.length > i; i++) args.push(argsFn[i](self, locals));
var fnPtr = fn(self, locals) || noop;
return fnPtr.apply ? fnPtr.apply(context, args) : fnPtr(args[0], args[1], args[2], args[3], args[4])
}
}
function arrayDeclaration() {
var elementFns = [];
if ("]" != peekToken().text)
do elementFns.push(expression()); while (expect(","));
return consume("]"),
function(self, locals) {
for (var array = [], i = 0; elementFns.length > i; i++) array.push(elementFns[i](self, locals));
return array
}
}
function object() {
var keyValues = [];
if ("}" != peekToken().text)
do {
var token = expect(),
key = token.string || token.text;
consume(":");
var value = expression();
keyValues.push({
key: key,
value: value
})
} while (expect(","));
return consume("}"),
function(self, locals) {
for (var object = {}, i = 0; keyValues.length > i; i++) {
var keyValue = keyValues[i],
value = keyValue.value(self, locals);
object[keyValue.key] = value
}
return object
}
}
var value, ZERO = valueFn(0),
tokens = lex(text, csp),
assignment = _assignment,
functionCall = _functionCall,
fieldAccess = _fieldAccess,
objectIndex = _objectIndex,
filterChain = _filterChain;
return json ? (assignment = logicalOR, functionCall = fieldAccess = objectIndex = filterChain = function() {
throwError("is not valid json", {
text: text,
index: 0
})
}, value = primary()) : value = statements(), 0 !== tokens.length && throwError("is an unexpected token", tokens[0]), value
}
function setter(obj, path, setValue) {
for (var element = path.split("."), i = 0; element.length > 1; i++) {
var key = element.shift(),
propertyObj = obj[key];
propertyObj || (propertyObj = {}, obj[key] = propertyObj), obj = propertyObj
}
return obj[element.shift()] = setValue, setValue
}
function getter(obj, path, bindFnToScope) {
if (!path) return obj;
for (var key, keys = path.split("."), lastInstance = obj, len = keys.length, i = 0; len > i; i++) key = keys[i], obj && (obj = (lastInstance = obj)[key]);
return !bindFnToScope && isFunction(obj) ? bind(lastInstance, obj) : obj
}
function cspSafeGetterFn(key0, key1, key2, key3, key4) {
return function(scope, locals) {
var promise, pathVal = locals && locals.hasOwnProperty(key0) ? locals : scope;
return null === pathVal || pathVal === undefined ? pathVal : (pathVal = pathVal[key0], pathVal && pathVal.then && ("$$v" in pathVal || (promise = pathVal, promise.$$v = undefined, promise.then(function(val) {
promise.$$v = val
})), pathVal = pathVal.$$v), key1 && null !== pathVal && pathVal !== undefined ? (pathVal = pathVal[key1], pathVal && pathVal.then && ("$$v" in pathVal || (promise = pathVal, promise.$$v = undefined, promise.then(function(val) {
promise.$$v = val
})), pathVal = pathVal.$$v), key2 && null !== pathVal && pathVal !== undefined ? (pathVal = pathVal[key2], pathVal && pathVal.then && ("$$v" in pathVal || (promise = pathVal, promise.$$v = undefined, promise.then(function(val) {
promise.$$v = val
})), pathVal = pathVal.$$v), key3 && null !== pathVal && pathVal !== undefined ? (pathVal = pathVal[key3], pathVal && pathVal.then && ("$$v" in pathVal || (promise = pathVal, promise.$$v = undefined, promise.then(function(val) {
promise.$$v = val
})), pathVal = pathVal.$$v), key4 && null !== pathVal && pathVal !== undefined ? (pathVal = pathVal[key4], pathVal && pathVal.then && ("$$v" in pathVal || (promise = pathVal, promise.$$v = undefined, promise.then(function(val) {
promise.$$v = val
})), pathVal = pathVal.$$v), pathVal) : pathVal) : pathVal) : pathVal) : pathVal)
}
}
function getterFn(path, csp) {
if (getterFnCache.hasOwnProperty(path)) return getterFnCache[path];
var fn, pathKeys = path.split("."),
pathKeysLength = pathKeys.length;
if (csp) fn = 6 > pathKeysLength ? cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4]) : function(scope, locals) {
var val, i = 0;
do val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++])(scope, locals), locals = undefined, scope = val; while (pathKeysLength > i);
return val
};
else {
var code = "var l, fn, p;\n";
forEach(pathKeys, function(key, index) {
code += "if(s === null || s === undefined) return s;\nl=s;\ns=" + (index ? "s" : '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ";\n" + "if (s && s.then) {\n" + ' if (!("$$v" in s)) {\n' + " p=s;\n" + " p.$$v = undefined;\n" + " p.then(function(v) {p.$$v=v;});\n" + "}\n" + " s=s.$$v\n" + "}\n"
}), code += "return s;", fn = Function("s", "k", code), fn.toString = function() {
return code
}
}
return getterFnCache[path] = fn
}
function $ParseProvider() {
var cache = {};
this.$get = ["$filter", "$sniffer",
function($filter, $sniffer) {
return function(exp) {
switch (typeof exp) {
case "string":
return cache.hasOwnProperty(exp) ? cache[exp] : cache[exp] = parser(exp, !1, $filter, $sniffer.csp);
case "function":
return exp;
default:
return noop
}
}
}
]
}
function $QProvider() {
this.$get = ["$rootScope", "$exceptionHandler",
function($rootScope, $exceptionHandler) {
return qFactory(function(callback) {
$rootScope.$evalAsync(callback)
}, $exceptionHandler)
}
]
}
function qFactory(nextTick, exceptionHandler) {
function defaultCallback(value) {
return value
}
function defaultErrback(reason) {
return reject(reason)
}
function all(promises) {
var deferred = defer(),
counter = promises.length,
results = [];
return counter ? forEach(promises, function(promise, index) {
ref(promise).then(function(value) {
index in results || (results[index] = value, --counter || deferred.resolve(results))
}, function(reason) {
index in results || deferred.reject(reason)
})
}) : deferred.resolve(results), deferred.promise
}
var defer = function() {
var value, deferred, pending = [];
return deferred = {
resolve: function(val) {
if (pending) {
var callbacks = pending;
pending = undefined, value = ref(val), callbacks.length && nextTick(function() {
for (var callback, i = 0, ii = callbacks.length; ii > i; i++) callback = callbacks[i], value.then(callback[0], callback[1])
})
}
},
reject: function(reason) {
deferred.resolve(reject(reason))
},
promise: {
then: function(callback, errback) {
var result = defer(),
wrappedCallback = function(value) {
try {
result.resolve((callback || defaultCallback)(value))
} catch (e) {
exceptionHandler(e), result.reject(e)
}
}, wrappedErrback = function(reason) {
try {
result.resolve((errback || defaultErrback)(reason))
} catch (e) {
exceptionHandler(e), result.reject(e)
}
};
return pending ? pending.push([wrappedCallback, wrappedErrback]) : value.then(wrappedCallback, wrappedErrback), result.promise
}
}
}
}, ref = function(value) {
return value && value.then ? value : {
then: function(callback) {
var result = defer();
return nextTick(function() {
result.resolve(callback(value))
}), result.promise
}
}
}, reject = function(reason) {
return {
then: function(callback, errback) {
var result = defer();
return nextTick(function() {
result.resolve((errback || defaultErrback)(reason))
}), result.promise
}
}
}, when = function(value, callback, errback) {
var done, result = defer(),
wrappedCallback = function(value) {
try {
return (callback || defaultCallback)(value)
} catch (e) {
return exceptionHandler(e), reject(e)
}
}, wrappedErrback = function(reason) {
try {
return (errback || defaultErrback)(reason)
} catch (e) {
return exceptionHandler(e), reject(e)
}
};
return nextTick(function() {
ref(value).then(function(value) {
done || (done = !0, result.resolve(ref(value).then(wrappedCallback, wrappedErrback)))
}, function(reason) {
done || (done = !0, result.resolve(wrappedErrback(reason)))
})
}), result.promise
};
return {
defer: defer,
reject: reject,
when: when,
all: all
}
}
function $RouteProvider() {
var routes = {};
this.when = function(path, route) {
if (routes[path] = extend({
reloadOnSearch: !0
}, route), path) {
var redirectPath = "/" == path[path.length - 1] ? path.substr(0, path.length - 1) : path + "/";
routes[redirectPath] = {
redirectTo: path
}
}
return this
}, this.otherwise = function(params) {
return this.when(null, params), this
}, this.$get = ["$rootScope", "$location", "$routeParams", "$q", "$injector", "$http", "$templateCache",
function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache) {
function switchRouteMatcher(on, when) {
when = "^" + when.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") + "$";
for (var paramMatch, regex = "", params = [], dst = {}, re = /:(\w+)/g, lastMatchedIndex = 0; null !== (paramMatch = re.exec(when));) regex += when.slice(lastMatchedIndex, paramMatch.index), regex += "([^\\/]*)", params.push(paramMatch[1]), lastMatchedIndex = re.lastIndex;
regex += when.substr(lastMatchedIndex);
var match = on.match(RegExp(regex));
return match && forEach(params, function(name, index) {
dst[name] = match[index + 1]
}), match ? dst : null
}
function updateRoute() {
var next = parseRoute(),
last = $route.current;
next && last && next.$route === last.$route && equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload ? (last.params = next.params, copy(last.params, $routeParams), $rootScope.$broadcast("$routeUpdate", last)) : (next || last) && (forceReload = !1, $rootScope.$broadcast("$routeChangeStart", next, last), $route.current = next, next && next.redirectTo && (isString(next.redirectTo) ? $location.path(interpolate(next.redirectTo, next.params)).search(next.params).replace() : $location.url(next.redirectTo(next.pathParams, $location.path(), $location.search())).replace()), $q.when(next).then(function() {
if (next) {
var template, keys = [],
values = [];
return forEach(next.resolve || {}, function(value, key) {
keys.push(key), values.push(isString(value) ? $injector.get(value) : $injector.invoke(value))
}), isDefined(template = next.template) || isDefined(template = next.templateUrl) && (template = $http.get(template, {
cache: $templateCache
}).then(function(response) {
return response.data
})), isDefined(template) && (keys.push("$template"), values.push(template)), $q.all(values).then(function(values) {
var locals = {};
return forEach(values, function(value, index) {
locals[keys[index]] = value
}), locals
})
}
}).then(function(locals) {
next == $route.current && (next && (next.locals = locals, copy(next.params, $routeParams)), $rootScope.$broadcast("$routeChangeSuccess", next, last))
}, function(error) {
next == $route.current && $rootScope.$broadcast("$routeChangeError", next, last, error)
}))
}
function parseRoute() {
var params, match;
return forEach(routes, function(route, path) {
!match && (params = switchRouteMatcher($location.path(), path)) && (match = inherit(route, {
params: extend({}, $location.search(), params),
pathParams: params
}), match.$route = route)
}), match || routes[null] && inherit(routes[null], {
params: {},
pathParams: {}
})
}
function interpolate(string, params) {
var result = [];
return forEach((string || "").split(":"), function(segment, i) {
if (0 == i) result.push(segment);
else {
var segmentMatch = segment.match(/(\w+)(.*)/),
key = segmentMatch[1];
result.push(params[key]), result.push(segmentMatch[2] || ""), delete params[key]
}
}), result.join("")
}
var forceReload = !1,
$route = {
routes: routes,
reload: function() {
forceReload = !0, $rootScope.$evalAsync(updateRoute)
}
};
return $rootScope.$on("$locationChangeSuccess", updateRoute), $route
}
]
}
function $RouteParamsProvider() {
this.$get = valueFn({})
}
function $RootScopeProvider() {
var TTL = 10;
this.digestTtl = function(value) {
return arguments.length && (TTL = value), TTL
}, this.$get = ["$injector", "$exceptionHandler", "$parse",
function($injector, $exceptionHandler, $parse) {
function Scope() {
this.$id = nextUid(), this.$$phase = this.$parent = this.$$watchers = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null, this["this"] = this.$root = this, this.$$destroyed = !1, this.$$asyncQueue = [], this.$$listeners = {}, this.$$isolateBindings = {}
}
function beginPhase(phase) {
if ($rootScope.$$phase) throw Error($rootScope.$$phase + " already in progress");
$rootScope.$$phase = phase
}
function clearPhase() {
$rootScope.$$phase = null
}
function compileToFn(exp, name) {
var fn = $parse(exp);
return assertArgFn(fn, name), fn
}
function initWatchVal() {}
Scope.prototype = {
$new: function(isolate) {
var Child, child;
if (isFunction(isolate)) throw Error("API-CHANGE: Use $controller to instantiate controllers.");
return isolate ? (child = new Scope, child.$root = this.$root) : (Child = function() {}, Child.prototype = this, child = new Child, child.$id = nextUid()), child["this"] = child, child.$$listeners = {}, child.$parent = this, child.$$asyncQueue = [], child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null, child.$$prevSibling = this.$$childTail, this.$$childHead ? (this.$$childTail.$$nextSibling = child, this.$$childTail = child) : this.$$childHead = this.$$childTail = child, child
},
$watch: function(watchExp, listener, objectEquality) {
var scope = this,
get = compileToFn(watchExp, "watch"),
array = scope.$$watchers,
watcher = {
fn: listener,
last: initWatchVal,
get: get,
exp: watchExp,
eq: !! objectEquality
};
if (!isFunction(listener)) {
var listenFn = compileToFn(listener || noop, "listener");
watcher.fn = function(newVal, oldVal, scope) {
listenFn(scope)
}
}
return array || (array = scope.$$watchers = []), array.unshift(watcher),
function() {
arrayRemove(array, watcher)
}
},
$digest: function() {
var watch, value, last, watchers, asyncQueue, length, dirty, next, current, logIdx, logMsg, ttl = TTL,
target = this,
watchLog = [];
beginPhase("$digest");
do {
dirty = !1, current = target;
do {
for (asyncQueue = current.$$asyncQueue; asyncQueue.length;) try {
current.$eval(asyncQueue.shift())
} catch (e) {
$exceptionHandler(e)
}
if (watchers = current.$$watchers)
for (length = watchers.length; length--;) try {
watch = watchers[length], (value = watch.get(current)) === (last = watch.last) || (watch.eq ? equals(value, last) : "number" == typeof value && "number" == typeof last && isNaN(value) && isNaN(last)) || (dirty = !0, watch.last = watch.eq ? copy(value) : value, watch.fn(value, last === initWatchVal ? value : last, current), 5 > ttl && (logIdx = 4 - ttl, watchLog[logIdx] || (watchLog[logIdx] = []), logMsg = isFunction(watch.exp) ? "fn: " + (watch.exp.name || "" + watch.exp) : watch.exp, logMsg += "; newVal: " + toJson(value) + "; oldVal: " + toJson(last), watchLog[logIdx].push(logMsg)))
} catch (e) {
$exceptionHandler(e)
}
if (!(next = current.$$childHead || current !== target && current.$$nextSibling))
for (; current !== target && !(next = current.$$nextSibling);) current = current.$parent
} while (current = next);
if (dirty && !ttl--) throw clearPhase(), Error(TTL + " $digest() iterations reached. Aborting!\n" + "Watchers fired in the last 5 iterations: " + toJson(watchLog))
} while (dirty || asyncQueue.length);
clearPhase()
},
$destroy: function() {
if ($rootScope != this && !this.$$destroyed) {
var parent = this.$parent;
this.$broadcast("$destroy"), this.$$destroyed = !0, parent.$$childHead == this && (parent.$$childHead = this.$$nextSibling), parent.$$childTail == this && (parent.$$childTail = this.$$prevSibling), this.$$prevSibling && (this.$$prevSibling.$$nextSibling = this.$$nextSibling), this.$$nextSibling && (this.$$nextSibling.$$prevSibling = this.$$prevSibling), this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null
}
},
$eval: function(expr, locals) {
return $parse(expr)(this, locals)
},
$evalAsync: function(expr) {
this.$$asyncQueue.push(expr)
},
$apply: function(expr) {
try {
return beginPhase("$apply"), this.$eval(expr)
} catch (e) {
$exceptionHandler(e)
} finally {
clearPhase();
try {
$rootScope.$digest()
} catch (e) {
throw $exceptionHandler(e), e
}
}
},
$on: function(name, listener) {
var namedListeners = this.$$listeners[name];
return namedListeners || (this.$$listeners[name] = namedListeners = []), namedListeners.push(listener),
function() {
namedListeners[indexOf(namedListeners, listener)] = null
}
},
$emit: function(name) {
var namedListeners, i, length, empty = [],
scope = this,
stopPropagation = !1,
event = {
name: name,
targetScope: scope,
stopPropagation: function() {
stopPropagation = !0
},
preventDefault: function() {
event.defaultPrevented = !0
},
defaultPrevented: !1
}, listenerArgs = concat([event], arguments, 1);
do {
for (namedListeners = scope.$$listeners[name] || empty, event.currentScope = scope, i = 0, length = namedListeners.length; length > i; i++)
if (namedListeners[i]) try {
if (namedListeners[i].apply(null, listenerArgs), stopPropagation) return event
} catch (e) {
$exceptionHandler(e)
} else namedListeners.splice(i, 1), i--, length--;
scope = scope.$parent
} while (scope);
return event
},
$broadcast: function(name) {
var listeners, i, length, target = this,
current = target,
next = target,
event = {
name: name,
targetScope: target,
preventDefault: function() {
event.defaultPrevented = !0
},
defaultPrevented: !1
}, listenerArgs = concat([event], arguments, 1);
do {
for (current = next, event.currentScope = current, listeners = current.$$listeners[name] || [], i = 0, length = listeners.length; length > i; i++)
if (listeners[i]) try {
listeners[i].apply(null, listenerArgs)
} catch (e) {
$exceptionHandler(e)
} else listeners.splice(i, 1), i--, length--;
if (!(next = current.$$childHead || current !== target && current.$$nextSibling))
for (; current !== target && !(next = current.$$nextSibling);) current = current.$parent
} while (current = next);
return event
}
};
var $rootScope = new Scope;
return $rootScope
}
]
}
function $SnifferProvider() {
this.$get = ["$window",
function($window) {
var eventSupport = {}, android = int((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]);
return {
history: !(!$window.history || !$window.history.pushState || 4 > android),
hashchange: "onhashchange" in $window && (!$window.document.documentMode || $window.document.documentMode > 7),
hasEvent: function(event) {
if ("input" == event && 9 == msie) return !1;
if (isUndefined(eventSupport[event])) {
var divElm = $window.document.createElement("div");
eventSupport[event] = "on" + event in divElm
}
return eventSupport[event]
},
csp: !1
}
}
]
}
function $WindowProvider() {
this.$get = valueFn(window)
}
function parseHeaders(headers) {
var key, val, i, parsed = {};
return headers ? (forEach(headers.split("\n"), function(line) {
i = line.indexOf(":"), key = lowercase(trim(line.substr(0, i))), val = trim(line.substr(i + 1)), key && (parsed[key] ? parsed[key] += ", " + val : parsed[key] = val)
}), parsed) : parsed
}
function headersGetter(headers) {
var headersObj = isObject(headers) ? headers : undefined;
return function(name) {
return headersObj || (headersObj = parseHeaders(headers)), name ? headersObj[lowercase(name)] || null : headersObj
}
}
function transformData(data, headers, fns) {
return isFunction(fns) ? fns(data, headers) : (forEach(fns, function(fn) {
data = fn(data, headers)
}), data)
}
function isSuccess(status) {
return status >= 200 && 300 > status
}
function $HttpProvider() {
var JSON_START = /^\s*(\[|\{[^\{])/,
JSON_END = /[\}\]]\s*$/,
PROTECTION_PREFIX = /^\)\]\}',?\n/,
$config = this.defaults = {
transformResponse: [
function(data) {
return isString(data) && (data = data.replace(PROTECTION_PREFIX, ""), JSON_START.test(data) && JSON_END.test(data) && (data = fromJson(data, !0))), data
}
],
transformRequest: [
function(d) {
return isObject(d) && !isFile(d) ? toJson(d) : d
}
],
headers: {
common: {
Accept: "application/json, text/plain, */*",
"X-Requested-With": "XMLHttpRequest"
},
post: {
"Content-Type": "application/json;charset=utf-8"
},
put: {
"Content-Type": "application/json;charset=utf-8"
}
}
}, providerResponseInterceptors = this.responseInterceptors = [];
this.$get = ["$httpBackend", "$browser", "$cacheFactory", "$rootScope", "$q", "$injector",
function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) {
function $http(config) {
function transformResponse(response) {
var resp = extend({}, response, {
data: transformData(response.data, response.headers, respTransformFn)
});
return isSuccess(response.status) ? resp : $q.reject(resp)
}
config.method = uppercase(config.method);
var promise, reqTransformFn = config.transformRequest || $config.transformRequest,
respTransformFn = config.transformResponse || $config.transformResponse,
defHeaders = $config.headers,
reqHeaders = extend({
"X-XSRF-TOKEN": $browser.cookies()["XSRF-TOKEN"]
}, defHeaders.common, defHeaders[lowercase(config.method)], config.headers),
reqData = transformData(config.data, headersGetter(reqHeaders), reqTransformFn);
return isUndefined(config.data) && delete reqHeaders["Content-Type"], promise = sendReq(config, reqData, reqHeaders), promise = promise.then(transformResponse, transformResponse), forEach(responseInterceptors, function(interceptor) {
promise = interceptor(promise)
}), promise.success = function(fn) {
return promise.then(function(response) {
fn(response.data, response.status, response.headers, config)
}), promise
}, promise.error = function(fn) {
return promise.then(null, function(response) {
fn(response.data, response.status, response.headers, config)
}), promise
}, promise
}
function createShortMethods() {
forEach(arguments, function(name) {
$http[name] = function(url, config) {
return $http(extend(config || {}, {
method: name,
url: url
}))
}
})
}
function createShortMethodsWithData() {
forEach(arguments, function(name) {
$http[name] = function(url, data, config) {
return $http(extend(config || {}, {
method: name,
url: url,
data: data
}))
}
})
}
function sendReq(config, reqData, reqHeaders) {
function done(status, response, headersString) {
cache && (isSuccess(status) ? cache.put(url, [status, response, parseHeaders(headersString)]) : cache.remove(url)), resolvePromise(response, status, headersString), $rootScope.$apply()
}
function resolvePromise(response, status, headers) {
status = Math.max(status, 0), (isSuccess(status) ? deferred.resolve : deferred.reject)({
data: response,
status: status,
headers: headersGetter(headers),
config: config
})
}
function removePendingReq() {
var idx = indexOf($http.pendingRequests, config); - 1 !== idx && $http.pendingRequests.splice(idx, 1)
}
var cache, cachedResp, deferred = $q.defer(),
promise = deferred.promise,
url = buildUrl(config.url, config.params);
if ($http.pendingRequests.push(config), promise.then(removePendingReq, removePendingReq), config.cache && "GET" == config.method && (cache = isObject(config.cache) ? config.cache : defaultCache), cache)
if (cachedResp = cache.get(url)) {
if (cachedResp.then) return cachedResp.then(removePendingReq, removePendingReq), cachedResp;
isArray(cachedResp) ? resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2])) : resolvePromise(cachedResp, 200, {})
} else cache.put(url, promise);
return cachedResp || $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials), promise
}
function buildUrl(url, params) {
if (!params) return url;
var parts = [];
return forEachSorted(params, function(value, key) {
null != value && value != undefined && (isObject(value) && (value = toJson(value)), parts.push(encodeURIComponent(key) + "=" + encodeURIComponent(value)))
}), url + (-1 == url.indexOf("?") ? "?" : "&") + parts.join("&")
}
var defaultCache = $cacheFactory("$http"),
responseInterceptors = [];
return forEach(providerResponseInterceptors, function(interceptor) {
responseInterceptors.push(isString(interceptor) ? $injector.get(interceptor) : $injector.invoke(interceptor))
}), $http.pendingRequests = [], createShortMethods("get", "delete", "head", "jsonp"), createShortMethodsWithData("post", "put"), $http.defaults = $config, $http
}
]
}
function $HttpBackendProvider() {
this.$get = ["$browser", "$window", "$document",
function($browser, $window, $document) {
return createHttpBackend($browser, XHR, $browser.defer, $window.angular.callbacks, $document[0], $window.location.protocol.replace(":", ""))
}
]
}
function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol) {
function jsonpReq(url, done) {
var script = rawDocument.createElement("script"),
doneWrapper = function() {
rawDocument.body.removeChild(script), done && done()
};
script.type = "text/javascript", script.src = url, msie ? script.onreadystatechange = function() {
/loaded|complete/.test(script.readyState) && doneWrapper()
} : script.onload = script.onerror = doneWrapper, rawDocument.body.appendChild(script)
}
return function(method, url, post, callback, headers, timeout, withCredentials) {
function completeRequest(callback, status, response, headersString) {
var protocol = (url.match(URL_MATCH) || ["", locationProtocol])[1];
status = "file" == protocol ? response ? 200 : 404 : status, status = 1223 == status ? 204 : status, callback(status, response, headersString), $browser.$$completeOutstandingRequest(noop)
}
if ($browser.$$incOutstandingRequestCount(), url = url || $browser.url(), "jsonp" == lowercase(method)) {
var callbackId = "_" + (callbacks.counter++).toString(36);
callbacks[callbackId] = function(data) {
callbacks[callbackId].data = data
}, jsonpReq(url.replace("JSON_CALLBACK", "angular.callbacks." + callbackId), function() {
callbacks[callbackId].data ? completeRequest(callback, 200, callbacks[callbackId].data) : completeRequest(callback, -2), delete callbacks[callbackId]
})
} else {
var xhr = new XHR;
xhr.open(method, url, !0), forEach(headers, function(value, key) {
value && xhr.setRequestHeader(key, value)
});
var status;
xhr.onreadystatechange = function() {
if (4 == xhr.readyState) {
var responseHeaders = xhr.getAllResponseHeaders(),
simpleHeaders = ["Cache-Control", "Content-Language", "Content-Type", "Expires", "Last-Modified", "Pragma"];
responseHeaders || (responseHeaders = "", forEach(simpleHeaders, function(header) {
var value = xhr.getResponseHeader(header);
value && (responseHeaders += header + ": " + value + "\n")
})), completeRequest(callback, status || xhr.status, xhr.responseText, responseHeaders)
}
}, withCredentials && (xhr.withCredentials = !0), xhr.send(post || ""), timeout > 0 && $browserDefer(function() {
status = -1, xhr.abort()
}, timeout)
}
}
}
function $LocaleProvider() {
this.$get = function() {
return {
id: "en-us",
NUMBER_FORMATS: {
DECIMAL_SEP: ".",
GROUP_SEP: ",",
PATTERNS: [{
minInt: 1,
minFrac: 0,
maxFrac: 3,
posPre: "",
posSuf: "",
negPre: "-",
negSuf: "",
gSize: 3,
lgSize: 3
}, {
minInt: 1,
minFrac: 2,
maxFrac: 2,
posPre: "¤",
posSuf: "",
negPre: "(¤",
negSuf: ")",
gSize: 3,
lgSize: 3
}],
CURRENCY_SYM: "$"
},
DATETIME_FORMATS: {
MONTH: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
SHORTMONTH: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
DAY: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),
SHORTDAY: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),
AMPMS: ["AM", "PM"],
medium: "MMM d, y h:mm:ss a",
"short": "M/d/yy h:mm a",
fullDate: "EEEE, MMMM d, y",
longDate: "MMMM d, y",
mediumDate: "MMM d, y",
shortDate: "M/d/yy",
mediumTime: "h:mm:ss a",
shortTime: "h:mm a"
},
pluralCat: function(num) {
return 1 === num ? "one" : "other"
}
}
}
}
function $TimeoutProvider() {
this.$get = ["$rootScope", "$browser", "$q", "$exceptionHandler",
function($rootScope, $browser, $q, $exceptionHandler) {
function timeout(fn, delay, invokeApply) {
var timeoutId, cleanup, deferred = $q.defer(),
promise = deferred.promise,
skipApply = isDefined(invokeApply) && !invokeApply;
return timeoutId = $browser.defer(function() {
try {
deferred.resolve(fn())
} catch (e) {
deferred.reject(e), $exceptionHandler(e)
}
skipApply || $rootScope.$apply()
}, delay), cleanup = function() {
delete deferreds[promise.$$timeoutId]
}, promise.$$timeoutId = timeoutId, deferreds[timeoutId] = deferred, promise.then(cleanup, cleanup), promise
}
var deferreds = {};
return timeout.cancel = function(promise) {
return promise && promise.$$timeoutId in deferreds ? (deferreds[promise.$$timeoutId].reject("canceled"), $browser.defer.cancel(promise.$$timeoutId)) : !1
}, timeout
}
]
}
function $FilterProvider($provide) {
function register(name, factory) {
return $provide.factory(name + suffix, factory)
}
var suffix = "Filter";
this.register = register, this.$get = ["$injector",
function($injector) {
return function(name) {
return $injector.get(name + suffix)
}
}
], register("currency", currencyFilter), register("date", dateFilter), register("filter", filterFilter), register("json", jsonFilter), register("limitTo", limitToFilter), register("lowercase", lowercaseFilter), register("number", numberFilter), register("orderBy", orderByFilter), register("uppercase", uppercaseFilter)
}
function filterFilter() {
return function(array, expression) {
if (!isArray(array)) return array;
var predicates = [];
predicates.check = function(value) {
for (var j = 0; predicates.length > j; j++)
if (!predicates[j](value)) return !1;
return !0
};
var search = function(obj, text) {
if ("!" === text.charAt(0)) return !search(obj, text.substr(1));
switch (typeof obj) {
case "boolean":
case "number":
case "string":
return ("" + obj).toLowerCase().indexOf(text) > -1;
case "object":
for (var objKey in obj)
if ("$" !== objKey.charAt(0) && search(obj[objKey], text)) return !0;
return !1;
case "array":
for (var i = 0; obj.length > i; i++)
if (search(obj[i], text)) return !0;
return !1;
default:
return !1
}
};
switch (typeof expression) {
case "boolean":
case "number":
case "string":
expression = {
$: expression
};
case "object":
for (var key in expression) "$" == key ? function() {
var text = ("" + expression[key]).toLowerCase();
text && predicates.push(function(value) {
return search(value, text)
})
}() : function() {
var path = key,
text = ("" + expression[key]).toLowerCase();
text && predicates.push(function(value) {
return search(getter(value, path), text)
})
}();
break;
case "function":
predicates.push(expression);
break;
default:
return array
}
for (var filtered = [], j = 0; array.length > j; j++) {
var value = array[j];
predicates.check(value) && filtered.push(value)
}
return filtered
}
}
function currencyFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(amount, currencySymbol) {
return isUndefined(currencySymbol) && (currencySymbol = formats.CURRENCY_SYM), formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2).replace(/\u00A4/g, currencySymbol)
}
}
function numberFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(number, fractionSize) {
return formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize)
}
}
function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
if (isNaN(number) || !isFinite(number)) return "";
var isNegative = 0 > number;
number = Math.abs(number);
var numStr = number + "",
formatedText = "",
parts = [],
hasExponent = !1;
if (-1 !== numStr.indexOf("e")) {
var match = numStr.match(/([\d\.]+)e(-?)(\d+)/);
match && "-" == match[2] && match[3] > fractionSize + 1 ? numStr = "0" : (formatedText = numStr, hasExponent = !0)
}
if (!hasExponent) {
var fractionLen = (numStr.split(DECIMAL_SEP)[1] || "").length;
isUndefined(fractionSize) && (fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac));
var pow = Math.pow(10, fractionSize);
number = Math.round(number * pow) / pow;
var fraction = ("" + number).split(DECIMAL_SEP),
whole = fraction[0];
fraction = fraction[1] || "";
var pos = 0,
lgroup = pattern.lgSize,
group = pattern.gSize;
if (whole.length >= lgroup + group) {
pos = whole.length - lgroup;
for (var i = 0; pos > i; i++) 0 === (pos - i) % group && 0 !== i && (formatedText += groupSep), formatedText += whole.charAt(i)
}
for (i = pos; whole.length > i; i++) 0 === (whole.length - i) % lgroup && 0 !== i && (formatedText += groupSep), formatedText += whole.charAt(i);
for (; fractionSize > fraction.length;) fraction += "0";
fractionSize && "0" !== fractionSize && (formatedText += decimalSep + fraction.substr(0, fractionSize))
}
return parts.push(isNegative ? pattern.negPre : pattern.posPre), parts.push(formatedText), parts.push(isNegative ? pattern.negSuf : pattern.posSuf), parts.join("")
}
function padNumber(num, digits, trim) {
var neg = "";
for (0 > num && (neg = "-", num = -num), num = "" + num; digits > num.length;) num = "0" + num;
return trim && (num = num.substr(num.length - digits)), neg + num
}
function dateGetter(name, size, offset, trim) {
return function(date) {
var value = date["get" + name]();
return (offset > 0 || value > -offset) && (value += offset), 0 === value && -12 == offset && (value = 12), padNumber(value, size, trim)
}
}
function dateStrGetter(name, shortForm) {
return function(date, formats) {
var value = date["get" + name](),
get = uppercase(shortForm ? "SHORT" + name : name);
return formats[get][value]
}
}
function timeZoneGetter(date) {
var zone = -1 * date.getTimezoneOffset(),
paddedZone = zone >= 0 ? "+" : "";
return paddedZone += padNumber(zone / 60, 2) + padNumber(Math.abs(zone % 60), 2)
}
function ampmGetter(date, formats) {
return 12 > date.getHours() ? formats.AMPMS[0] : formats.AMPMS[1]
}
function dateFilter($locale) {
function jsonStringToDate(string) {
var match;
if (match = string.match(R_ISO8601_STR)) {
var date = new Date(0),
tzHour = 0,
tzMin = 0;
return match[9] && (tzHour = int(match[9] + match[10]), tzMin = int(match[9] + match[11])), date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3])), date.setUTCHours(int(match[4] || 0) - tzHour, int(match[5] || 0) - tzMin, int(match[6] || 0), int(match[7] || 0)), date
}
return string
}
var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
return function(date, format) {
var fn, match, text = "",
parts = [];
if (format = format || "mediumDate", format = $locale.DATETIME_FORMATS[format] || format, isString(date) && (date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date)), isNumber(date) && (date = new Date(date)), !isDate(date)) return date;
for (; format;) match = DATE_FORMATS_SPLIT.exec(format), match ? (parts = concat(parts, match, 1), format = parts.pop()) : (parts.push(format), format = null);
return forEach(parts, function(value) {
fn = DATE_FORMATS[value], text += fn ? fn(date, $locale.DATETIME_FORMATS) : value.replace(/(^'|'$)/g, "").replace(/''/g, "'")
}), text
}
}
function jsonFilter() {
return function(object) {
return toJson(object, !0)
}
}
function limitToFilter() {
return function(array, limit) {
if (!(array instanceof Array)) return array;
limit = int(limit);
var i, n, out = [];
if (!(array && array instanceof Array)) return out;
for (limit > array.length ? limit = array.length : -array.length > limit && (limit = -array.length), limit > 0 ? (i = 0, n = limit) : (i = array.length + limit, n = array.length); n > i; i++) out.push(array[i]);
return out
}
}
function orderByFilter($parse) {
return function(array, sortPredicate, reverseOrder) {
function comparator(o1, o2) {
for (var i = 0; sortPredicate.length > i; i++) {
var comp = sortPredicate[i](o1, o2);
if (0 !== comp) return comp
}
return 0
}
function reverseComparator(comp, descending) {
return toBoolean(descending) ? function(a, b) {
return comp(b, a)
} : comp
}
function compare(v1, v2) {
var t1 = typeof v1,
t2 = typeof v2;
return t1 == t2 ? ("string" == t1 && (v1 = v1.toLowerCase()), "string" == t1 && (v2 = v2.toLowerCase()), v1 === v2 ? 0 : v2 > v1 ? -1 : 1) : t2 > t1 ? -1 : 1
}
if (!isArray(array)) return array;
if (!sortPredicate) return array;
sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate], sortPredicate = map(sortPredicate, function(predicate) {
var descending = !1,
get = predicate || identity;
return isString(predicate) && (("+" == predicate.charAt(0) || "-" == predicate.charAt(0)) && (descending = "-" == predicate.charAt(0), predicate = predicate.substring(1)), get = $parse(predicate)), reverseComparator(function(a, b) {
return compare(get(a), get(b))
}, descending)
});
for (var arrayCopy = [], i = 0; array.length > i; i++) arrayCopy.push(array[i]);
return arrayCopy.sort(reverseComparator(comparator, reverseOrder))
}
}
function ngDirective(directive) {
return isFunction(directive) && (directive = {
link: directive
}), directive.restrict = directive.restrict || "AC", valueFn(directive)
}
function FormController(element, attrs) {
function toggleValidCss(isValid, validationErrorKey) {
validationErrorKey = validationErrorKey ? "-" + snake_case(validationErrorKey, "-") : "", element.removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey)
}
var form = this,
parentForm = element.parent().controller("form") || nullFormCtrl,
invalidCount = 0,
errors = form.$error = {};
form.$name = attrs.name, form.$dirty = !1, form.$pristine = !0, form.$valid = !0, form.$invalid = !1, parentForm.$addControl(form), element.addClass(PRISTINE_CLASS), toggleValidCss(!0), form.$addControl = function(control) {
control.$name && !form.hasOwnProperty(control.$name) && (form[control.$name] = control)
}, form.$removeControl = function(control) {
control.$name && form[control.$name] === control && delete form[control.$name], forEach(errors, function(queue, validationToken) {
form.$setValidity(validationToken, !0, control)
})
}, form.$setValidity = function(validationToken, isValid, control) {
var queue = errors[validationToken];
if (isValid) queue && (arrayRemove(queue, control), queue.length || (invalidCount--, invalidCount || (toggleValidCss(isValid), form.$valid = !0, form.$invalid = !1), errors[validationToken] = !1, toggleValidCss(!0, validationToken), parentForm.$setValidity(validationToken, !0, form)));
else {
if (invalidCount || toggleValidCss(isValid), queue) {
if (includes(queue, control)) return
} else errors[validationToken] = queue = [], invalidCount++, toggleValidCss(!1, validationToken), parentForm.$setValidity(validationToken, !1, form);
queue.push(control), form.$valid = !1, form.$invalid = !0
}
}, form.$setDirty = function() {
element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS), form.$dirty = !0, form.$pristine = !1, parentForm.$setDirty()
}
}
function isEmpty(value) {
return isUndefined(value) || "" === value || null === value || value !== value
}
function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
var listener = function() {
var value = trim(element.val());
ctrl.$viewValue !== value && scope.$apply(function() {
ctrl.$setViewValue(value)
})
};
if ($sniffer.hasEvent("input")) element.bind("input", listener);
else {
var timeout;
element.bind("keydown", function(event) {
var key = event.keyCode;
91 === key || key > 15 && 19 > key || key >= 37 && 40 >= key || timeout || (timeout = $browser.defer(function() {
listener(), timeout = null
}))
}), element.bind("change", listener)
}
ctrl.$render = function() {
element.val(isEmpty(ctrl.$viewValue) ? "" : ctrl.$viewValue)
};
var patternValidator, pattern = attr.ngPattern,
validate = function(regexp, value) {
return isEmpty(value) || regexp.test(value) ? (ctrl.$setValidity("pattern", !0), value) : (ctrl.$setValidity("pattern", !1), undefined)
};
if (pattern && (pattern.match(/^\/(.*)\/$/) ? (pattern = RegExp(pattern.substr(1, pattern.length - 2)), patternValidator = function(value) {
return validate(pattern, value)
}) : patternValidator = function(value) {
var patternObj = scope.$eval(pattern);
if (!patternObj || !patternObj.test) throw Error("Expected " + pattern + " to be a RegExp but was " + patternObj);
return validate(patternObj, value)
}, ctrl.$formatters.push(patternValidator), ctrl.$parsers.push(patternValidator)), attr.ngMinlength) {
var minlength = int(attr.ngMinlength),
minLengthValidator = function(value) {
return !isEmpty(value) && minlength > value.length ? (ctrl.$setValidity("minlength", !1), undefined) : (ctrl.$setValidity("minlength", !0), value)
};
ctrl.$parsers.push(minLengthValidator), ctrl.$formatters.push(minLengthValidator)
}
if (attr.ngMaxlength) {
var maxlength = int(attr.ngMaxlength),
maxLengthValidator = function(value) {
return !isEmpty(value) && value.length > maxlength ? (ctrl.$setValidity("maxlength", !1), undefined) : (ctrl.$setValidity("maxlength", !0), value)
};
ctrl.$parsers.push(maxLengthValidator), ctrl.$formatters.push(maxLengthValidator)
}
}
function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
if (textInputType(scope, element, attr, ctrl, $sniffer, $browser), ctrl.$parsers.push(function(value) {
var empty = isEmpty(value);
return empty || NUMBER_REGEXP.test(value) ? (ctrl.$setValidity("number", !0), "" === value ? null : empty ? value : parseFloat(value)) : (ctrl.$setValidity("number", !1), undefined)
}), ctrl.$formatters.push(function(value) {
return isEmpty(value) ? "" : "" + value
}), attr.min) {
var min = parseFloat(attr.min),
minValidator = function(value) {
return !isEmpty(value) && min > value ? (ctrl.$setValidity("min", !1), undefined) : (ctrl.$setValidity("min", !0), value)
};
ctrl.$parsers.push(minValidator), ctrl.$formatters.push(minValidator)
}
if (attr.max) {
var max = parseFloat(attr.max),
maxValidator = function(value) {
return !isEmpty(value) && value > max ? (ctrl.$setValidity("max", !1), undefined) : (ctrl.$setValidity("max", !0), value)
};
ctrl.$parsers.push(maxValidator), ctrl.$formatters.push(maxValidator)
}
ctrl.$formatters.push(function(value) {
return isEmpty(value) || isNumber(value) ? (ctrl.$setValidity("number", !0), value) : (ctrl.$setValidity("number", !1), undefined)
})
}
function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
var urlValidator = function(value) {
return isEmpty(value) || URL_REGEXP.test(value) ? (ctrl.$setValidity("url", !0), value) : (ctrl.$setValidity("url", !1), undefined)
};
ctrl.$formatters.push(urlValidator), ctrl.$parsers.push(urlValidator)
}
function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
var emailValidator = function(value) {
return isEmpty(value) || EMAIL_REGEXP.test(value) ? (ctrl.$setValidity("email", !0), value) : (ctrl.$setValidity("email", !1), undefined)
};
ctrl.$formatters.push(emailValidator), ctrl.$parsers.push(emailValidator)
}
function radioInputType(scope, element, attr, ctrl) {
isUndefined(attr.name) && element.attr("name", nextUid()), element.bind("click", function() {
element[0].checked && scope.$apply(function() {
ctrl.$setViewValue(attr.value)
})
}), ctrl.$render = function() {
var value = attr.value;
element[0].checked = value == ctrl.$viewValue
}, attr.$observe("value", ctrl.$render)
}
function checkboxInputType(scope, element, attr, ctrl) {
var trueValue = attr.ngTrueValue,
falseValue = attr.ngFalseValue;
isString(trueValue) || (trueValue = !0), isString(falseValue) || (falseValue = !1), element.bind("click", function() {
scope.$apply(function() {
ctrl.$setViewValue(element[0].checked)
})
}), ctrl.$render = function() {
element[0].checked = ctrl.$viewValue
}, ctrl.$formatters.push(function(value) {
return value === trueValue
}), ctrl.$parsers.push(function(value) {
return value ? trueValue : falseValue
})
}
function classDirective(name, selector) {
return name = "ngClass" + name, ngDirective(function(scope, element, attr) {
function ngClassWatchAction(newVal) {
(selector === !0 || scope.$index % 2 === selector) && (oldVal && newVal !== oldVal && removeClass(oldVal), addClass(newVal)), oldVal = newVal
}
function removeClass(classVal) {
isObject(classVal) && !isArray(classVal) && (classVal = map(classVal, function(v, k) {
return v ? k : t
})), element.removeClass(isArray(classVal) ? classVal.join(" ") : classVal)
}
function addClass(classVal) {
isObject(classVal) && !isArray(classVal) && (classVal = map(classVal, function(v, k) {
return v ? k : t
})), classVal && element.addClass(isArray(classVal) ? classVal.join(" ") : classVal)
}
var oldVal = undefined;
scope.$watch(attr[name], ngClassWatchAction, !0), attr.$observe("class", function() {
var ngClass = scope.$eval(attr[name]);
ngClassWatchAction(ngClass, ngClass)
}), "ngClass" !== name && scope.$watch("$index", function($index, old$index) {
var mod = $index % 2;
mod !== old$index % 2 && (mod == selector ? addClass(scope.$eval(attr[name])) : removeClass(scope.$eval(attr[name])))
})
})
}
var lowercase = function(string) {
return isString(string) ? string.toLowerCase() : string
}, uppercase = function(string) {
return isString(string) ? string.toUpperCase() : string
}, manualLowercase = function(s) {
return isString(s) ? s.replace(/[A-Z]/g, function(ch) {
return fromCharCode(32 | ch.charCodeAt(0))
}) : s
}, manualUppercase = function(s) {
return isString(s) ? s.replace(/[a-z]/g, function(ch) {
return fromCharCode(-33 & ch.charCodeAt(0))
}) : s
};
"i" !== "I".toLowerCase() && (lowercase = manualLowercase, uppercase = manualUppercase);
var jqLite, jQuery, angularModule, nodeName_, msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]),
slice = [].slice,
push = [].push,
toString = Object.prototype.toString,
angular = window.angular || (window.angular = {}),
uid = ["0", "0", "0"];
noop.$inject = [], identity.$inject = [], nodeName_ = 9 > msie ? function(element) {
return element = element.nodeName ? element : element[0], element.scopeName && "HTML" != element.scopeName ? uppercase(element.scopeName + ":" + element.nodeName) : element.nodeName
} : function(element) {
return element.nodeName ? element.nodeName : element[0].nodeName
};
var SNAKE_CASE_REGEXP = /[A-Z]/g,
version = {
full: "1.0.5",
major: 1,
minor: 0,
dot: 5,
codeName: "flatulent-propulsion"
}, jqCache = JQLite.cache = {}, jqName = JQLite.expando = "ng-" + (new Date).getTime(),
jqId = 1,
addEventListenerFn = window.document.addEventListener ? function(element, type, fn) {
element.addEventListener(type, fn, !1)
} : function(element, type, fn) {
element.attachEvent("on" + type, fn)
}, removeEventListenerFn = window.document.removeEventListener ? function(element, type, fn) {
element.removeEventListener(type, fn, !1)
} : function(element, type, fn) {
element.detachEvent("on" + type, fn)
}, SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g,
MOZ_HACK_REGEXP = /^moz([A-Z])/,
JQLitePrototype = JQLite.prototype = {
ready: function(fn) {
function trigger() {
fired || (fired = !0, fn())
}
var fired = !1;
this.bind("DOMContentLoaded", trigger), JQLite(window).bind("load", trigger)
},
toString: function() {
var value = [];
return forEach(this, function(e) {
value.push("" + e)
}), "[" + value.join(", ") + "]"
},
eq: function(index) {
return index >= 0 ? jqLite(this[index]) : jqLite(this[this.length + index])
},
length: 0,
push: push,
sort: [].sort,
splice: [].splice
}, BOOLEAN_ATTR = {};
forEach("multiple,selected,checked,disabled,readOnly,required".split(","), function(value) {
BOOLEAN_ATTR[lowercase(value)] = value
});
var BOOLEAN_ELEMENTS = {};
forEach("input,select,option,textarea,button,form".split(","), function(value) {
BOOLEAN_ELEMENTS[uppercase(value)] = !0
}), forEach({
data: JQLiteData,
inheritedData: JQLiteInheritedData,
scope: function(element) {
return JQLiteInheritedData(element, "$scope")
},
controller: JQLiteController,
injector: function(element) {
return JQLiteInheritedData(element, "$injector")
},
removeAttr: function(element, name) {
element.removeAttribute(name)
},
hasClass: JQLiteHasClass,
css: function(element, name, value) {
if (name = camelCase(name), !isDefined(value)) {
var val;
return 8 >= msie && (val = element.currentStyle && element.currentStyle[name], "" === val && (val = "auto")), val = val || element.style[name], 8 >= msie && (val = "" === val ? undefined : val), val
}
element.style[name] = value
},
attr: function(element, name, value) {
var lowercasedName = lowercase(name);
if (BOOLEAN_ATTR[lowercasedName]) {
if (!isDefined(value)) return element[name] || (element.attributes.getNamedItem(name) || noop).specified ? lowercasedName : undefined;
value ? (element[name] = !0, element.setAttribute(name, lowercasedName)) : (element[name] = !1, element.removeAttribute(lowercasedName))
} else if (isDefined(value)) element.setAttribute(name, value);
else if (element.getAttribute) {
var ret = element.getAttribute(name, 2);
return null === ret ? undefined : ret
}
},
prop: function(element, name, value) {
return isDefined(value) ? (element[name] = value, element) : element[name]
},
text: extend(9 > msie ? function(element, value) {
if (1 == element.nodeType) {
if (isUndefined(value)) return element.innerText;
element.innerText = value
} else {
if (isUndefined(value)) return element.nodeValue;
element.nodeValue = value
}
} : function(element, value) {
return isUndefined(value) ? element.textContent : (element.textContent = value, element)
}, {
$dv: ""
}),
val: function(element, value) {
return isUndefined(value) ? element.value : (element.value = value, element)
},
html: function(element, value) {
if (isUndefined(value)) return element.innerHTML;
for (var i = 0, childNodes = element.childNodes; childNodes.length > i; i++) JQLiteDealoc(childNodes[i]);
element.innerHTML = value
}
}, function(fn, name) {
JQLite.prototype[name] = function(arg1, arg2) {
var i, key;
if ((2 == fn.length && fn !== JQLiteHasClass && fn !== JQLiteController ? arg1 : arg2) !== undefined) {
for (i = 0; this.length > i; i++) fn(this[i], arg1, arg2);
return this
}
if (isObject(arg1)) {
for (i = 0; this.length > i; i++)
if (fn === JQLiteData) fn(this[i], arg1);
else
for (key in arg1) fn(this[i], key, arg1[key]);
return this
}
return this.length ? fn(this[0], arg1, arg2) : fn.$dv
}
}), forEach({
removeData: JQLiteRemoveData,
dealoc: JQLiteDealoc,
bind: function bindFn(element, type, fn) {
var events = JQLiteExpandoStore(element, "events"),
handle = JQLiteExpandoStore(element, "handle");
events || JQLiteExpandoStore(element, "events", events = {}), handle || JQLiteExpandoStore(element, "handle", handle = createEventHandler(element, events)), forEach(type.split(" "), function(type) {
var eventFns = events[type];
if (!eventFns) {
if ("mouseenter" == type || "mouseleave" == type) {
var counter = 0;
events.mouseenter = [], events.mouseleave = [], bindFn(element, "mouseover", function(event) {
counter++, 1 == counter && handle(event, "mouseenter")
}), bindFn(element, "mouseout", function(event) {
counter--, 0 == counter && handle(event, "mouseleave")
})
} else addEventListenerFn(element, type, handle), events[type] = [];
eventFns = events[type]
}
eventFns.push(fn)
})
},
unbind: JQLiteUnbind,
replaceWith: function(element, replaceNode) {
var index, parent = element.parentNode;
JQLiteDealoc(element), forEach(new JQLite(replaceNode), function(node) {
index ? parent.insertBefore(node, index.nextSibling) : parent.replaceChild(node, element), index = node
})
},
children: function(element) {
var children = [];
return forEach(element.childNodes, function(element) {
1 === element.nodeType && children.push(element)
}), children
},
contents: function(element) {
return element.childNodes || []
},
append: function(element, node) {
forEach(new JQLite(node), function(child) {
1 === element.nodeType && element.appendChild(child)
})
},
prepend: function(element, node) {
if (1 === element.nodeType) {
var index = element.firstChild;
forEach(new JQLite(node), function(child) {
index ? element.insertBefore(child, index) : (element.appendChild(child), index = child)
})
}
},
wrap: function(element, wrapNode) {
wrapNode = jqLite(wrapNode)[0];
var parent = element.parentNode;
parent && parent.replaceChild(wrapNode, element), wrapNode.appendChild(element)
},
remove: function(element) {
JQLiteDealoc(element);
var parent = element.parentNode;
parent && parent.removeChild(element)
},
after: function(element, newElement) {
var index = element,
parent = element.parentNode;
forEach(new JQLite(newElement), function(node) {
parent.insertBefore(node, index.nextSibling), index = node
})
},
addClass: JQLiteAddClass,
removeClass: JQLiteRemoveClass,
toggleClass: function(element, selector, condition) {
isUndefined(condition) && (condition = !JQLiteHasClass(element, selector)), (condition ? JQLiteAddClass : JQLiteRemoveClass)(element, selector)
},
parent: function(element) {
var parent = element.parentNode;
return parent && 11 !== parent.nodeType ? parent : null
},
next: function(element) {
if (element.nextElementSibling) return element.nextElementSibling;
for (var elm = element.nextSibling; null != elm && 1 !== elm.nodeType;) elm = elm.nextSibling;
return elm
},
find: function(element, selector) {
return element.getElementsByTagName(selector)
},
clone: JQLiteClone,
triggerHandler: function(element, eventName) {
var eventFns = (JQLiteExpandoStore(element, "events") || {})[eventName];
forEach(eventFns, function(fn) {
fn.call(element, null)
})
}
}, function(fn, name) {
JQLite.prototype[name] = function(arg1, arg2) {
for (var value, i = 0; this.length > i; i++) value == undefined ? (value = fn(this[i], arg1, arg2), value !== undefined && (value = jqLite(value))) : JQLiteAddNodes(value, fn(this[i], arg1, arg2));
return value == undefined ? this : value
}
}), HashMap.prototype = {
put: function(key, value) {
this[hashKey(key)] = value
},
get: function(key) {
return this[hashKey(key)]
},
remove: function(key) {
var value = this[key = hashKey(key)];
return delete this[key], value
}
}, HashQueueMap.prototype = {
push: function(key, value) {
var array = this[key = hashKey(key)];
array ? array.push(value) : this[key] = [value]
},
shift: function(key) {
var array = this[key = hashKey(key)];
return array ? 1 == array.length ? (delete this[key], array[0]) : array.shift() : t
},
peek: function(key) {
var array = this[hashKey(key)];
return array ? array[0] : t
}
};
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m,
FN_ARG_SPLIT = /,/,
FN_ARG = /^\s*(_?)(\S+?)\1\s*$/,
STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,
NON_ASSIGNABLE_MODEL_EXPRESSION = "Non-assignable model expression: ";
$CompileProvider.$inject = ["$provide"];
var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i,
URL_MATCH = /^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
PATH_MATCH = /^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,
HASH_MATCH = PATH_MATCH,
DEFAULT_PORTS = {
http: 80,
https: 443,
ftp: 21
};
LocationUrl.prototype = {
$$replace: !1,
absUrl: locationGetter("$$absUrl"),
url: function(url, replace) {
if (isUndefined(url)) return this.$$url;
var match = PATH_MATCH.exec(url);
return match[1] && this.path(decodeURIComponent(match[1])), (match[2] || match[1]) && this.search(match[3] || ""), this.hash(match[5] || "", replace), this
},
protocol: locationGetter("$$protocol"),
host: locationGetter("$$host"),
port: locationGetter("$$port"),
path: locationGetterSetter("$$path", function(path) {
return "/" == path.charAt(0) ? path : "/" + path
}),
search: function(search, paramValue) {
return isUndefined(search) ? this.$$search : (isDefined(paramValue) ? null === paramValue ? delete this.$$search[search] : this.$$search[search] = paramValue : this.$$search = isString(search) ? parseKeyValue(search) : search, this.$$compose(), this)
},
hash: locationGetterSetter("$$hash", identity),
replace: function() {
return this.$$replace = !0, this
}
}, LocationHashbangUrl.prototype = inherit(LocationUrl.prototype), LocationHashbangInHtml5Url.prototype = inherit(LocationHashbangUrl.prototype);
var OPERATORS = {
"null": function() {
return null
},
"true": function() {
return !0
},
"false": function() {
return !1
},
undefined: noop,
"+": function(self, locals, a, b) {
return a = a(self, locals), b = b(self, locals), isDefined(a) ? isDefined(b) ? a + b : a : isDefined(b) ? b : undefined
},
"-": function(self, locals, a, b) {
return a = a(self, locals), b = b(self, locals), (isDefined(a) ? a : 0) - (isDefined(b) ? b : 0)
},
"*": function(self, locals, a, b) {
return a(self, locals) * b(self, locals)
},
"/": function(self, locals, a, b) {
return a(self, locals) / b(self, locals)
},
"%": function(self, locals, a, b) {
return a(self, locals) % b(self, locals)
},
"^": function(self, locals, a, b) {
return a(self, locals) ^ b(self, locals)
},
"=": noop,
"==": function(self, locals, a, b) {
return a(self, locals) == b(self, locals)
},
"!=": function(self, locals, a, b) {
return a(self, locals) != b(self, locals)
},
"<": function(self, locals, a, b) {
return a(self, locals) < b(self, locals)
},
">": function(self, locals, a, b) {
return a(self, locals) > b(self, locals)
},
"<=": function(self, locals, a, b) {
return a(self, locals) <= b(self, locals)
},
">=": function(self, locals, a, b) {
return a(self, locals) >= b(self, locals)
},
"&&": function(self, locals, a, b) {
return a(self, locals) && b(self, locals)
},
"||": function(self, locals, a, b) {
return a(self, locals) || b(self, locals)
},
"&": function(self, locals, a, b) {
return a(self, locals) & b(self, locals)
},
"|": function(self, locals, a, b) {
return b(self, locals)(self, locals, a(self, locals))
},
"!": function(self, locals, a) {
return !a(self, locals)
}
}, ESCAPE = {
n: "\n",
f: "\f",
r: "\r",
t: " ",
v: " ",
"'": "'",
'"': '"'
}, getterFnCache = {}, XHR = window.XMLHttpRequest || function() {
try {
return new ActiveXObject("Msxml2.XMLHTTP.6.0")
} catch (e1) {}
try {
return new ActiveXObject("Msxml2.XMLHTTP.3.0")
} catch (e2) {}
try {
return new ActiveXObject("Msxml2.XMLHTTP")
} catch (e3) {}
throw Error("This browser does not support XMLHttpRequest.")
};
$FilterProvider.$inject = ["$provide"], currencyFilter.$inject = ["$locale"], numberFilter.$inject = ["$locale"];
var DECIMAL_SEP = ".",
DATE_FORMATS = {
yyyy: dateGetter("FullYear", 4),
yy: dateGetter("FullYear", 2, 0, !0),
y: dateGetter("FullYear", 1),
MMMM: dateStrGetter("Month"),
MMM: dateStrGetter("Month", !0),
MM: dateGetter("Month", 2, 1),
M: dateGetter("Month", 1, 1),
dd: dateGetter("Date", 2),
d: dateGetter("Date", 1),
HH: dateGetter("Hours", 2),
H: dateGetter("Hours", 1),
hh: dateGetter("Hours", 2, -12),
h: dateGetter("Hours", 1, -12),
mm: dateGetter("Minutes", 2),
m: dateGetter("Minutes", 1),
ss: dateGetter("Seconds", 2),
s: dateGetter("Seconds", 1),
EEEE: dateStrGetter("Day"),
EEE: dateStrGetter("Day", !0),
a: ampmGetter,
Z: timeZoneGetter
}, DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
NUMBER_STRING = /^\d+$/;
dateFilter.$inject = ["$locale"];
var lowercaseFilter = valueFn(lowercase),
uppercaseFilter = valueFn(uppercase);
orderByFilter.$inject = ["$parse"];
var htmlAnchorDirective = valueFn({
restrict: "E",
compile: function(element, attr) {
return 8 >= msie && (attr.href || attr.name || attr.$set("href", ""), element.append(document.createComment("IE fix"))),
function(scope, element) {
element.bind("click", function(event) {
element.attr("href") || event.preventDefault()
})
}
}
}),
ngAttributeAliasDirectives = {};
forEach(BOOLEAN_ATTR, function(propName, attrName) {
var normalized = directiveNormalize("ng-" + attrName);
ngAttributeAliasDirectives[normalized] = function() {
return {
priority: 100,
compile: function() {
return function(scope, element, attr) {
scope.$watch(attr[normalized], function(value) {
attr.$set(attrName, !! value)
})
}
}
}
}
}), forEach(["src", "href"], function(attrName) {
var normalized = directiveNormalize("ng-" + attrName);
ngAttributeAliasDirectives[normalized] = function() {
return {
priority: 99,
link: function(scope, element, attr) {
attr.$observe(normalized, function(value) {
value && (attr.$set(attrName, value), msie && element.prop(attrName, attr[attrName]))
})
}
}
}
});
var nullFormCtrl = {
$addControl: noop,
$removeControl: noop,
$setValidity: noop,
$setDirty: noop
};
FormController.$inject = ["$element", "$attrs", "$scope"];
var formDirectiveFactory = function(isNgForm) {
return ["$timeout", function($timeout) {
var formDirective = {
name: "form",
restrict: "E",
controller: FormController,
compile: function() {
return {
pre: function(scope, formElement, attr, controller) {
if (!attr.action) {
var preventDefaultListener = function(event) {
event.preventDefault ? event.preventDefault() : event.returnValue = !1
};
addEventListenerFn(formElement[0], "submit", preventDefaultListener), formElement.bind("$destroy", function() {
$timeout(function() {
removeEventListenerFn(formElement[0], "submit", preventDefaultListener)
}, 0, !1)
})
}
var parentFormCtrl = formElement.parent().controller("form"),
alias = attr.name || attr.ngForm;
alias && (scope[alias] = controller), parentFormCtrl && formElement.bind("$destroy", function() {
parentFormCtrl.$removeControl(controller), alias && (scope[alias] = undefined), extend(controller, nullFormCtrl)
})
}
}
}
};
return isNgForm ? extend(copy(formDirective), {
restrict: "EAC"
}) : formDirective
}]
}, formDirective = formDirectiveFactory(),
ngFormDirective = formDirectiveFactory(!0),
URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,
NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,
inputType = {
text: textInputType,
number: numberInputType,
url: urlInputType,
email: emailInputType,
radio: radioInputType,
checkbox: checkboxInputType,
hidden: noop,
button: noop,
submit: noop,
reset: noop
}, inputDirective = ["$browser", "$sniffer",
function($browser, $sniffer) {
return {
restrict: "E",
require: "?ngModel",
link: function(scope, element, attr, ctrl) {
ctrl && (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer, $browser)
}
}
}
],
VALID_CLASS = "ng-valid",
INVALID_CLASS = "ng-invalid",
PRISTINE_CLASS = "ng-pristine",
DIRTY_CLASS = "ng-dirty",
NgModelController = ["$scope", "$exceptionHandler", "$attrs", "$element", "$parse",
function($scope, $exceptionHandler, $attr, $element, $parse) {
function toggleValidCss(isValid, validationErrorKey) {
validationErrorKey = validationErrorKey ? "-" + snake_case(validationErrorKey, "-") : "", $element.removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey)
}
this.$viewValue = Number.NaN, this.$modelValue = Number.NaN, this.$parsers = [], this.$formatters = [], this.$viewChangeListeners = [], this.$pristine = !0, this.$dirty = !1, this.$valid = !0, this.$invalid = !1, this.$name = $attr.name;
var ngModelGet = $parse($attr.ngModel),
ngModelSet = ngModelGet.assign;
if (!ngModelSet) throw Error(NON_ASSIGNABLE_MODEL_EXPRESSION + $attr.ngModel + " (" + startingTag($element) + ")");
this.$render = noop;
var parentForm = $element.inheritedData("$formController") || nullFormCtrl,
invalidCount = 0,
$error = this.$error = {};
$element.addClass(PRISTINE_CLASS), toggleValidCss(!0), this.$setValidity = function(validationErrorKey, isValid) {
$error[validationErrorKey] !== !isValid && (isValid ? ($error[validationErrorKey] && invalidCount--, invalidCount || (toggleValidCss(!0), this.$valid = !0, this.$invalid = !1)) : (toggleValidCss(!1), this.$invalid = !0, this.$valid = !1, invalidCount++), $error[validationErrorKey] = !isValid, toggleValidCss(isValid, validationErrorKey), parentForm.$setValidity(validationErrorKey, isValid, this))
}, this.$setViewValue = function(value) {
this.$viewValue = value, this.$pristine && (this.$dirty = !0, this.$pristine = !1, $element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS), parentForm.$setDirty()), forEach(this.$parsers, function(fn) {
value = fn(value)
}), this.$modelValue !== value && (this.$modelValue = value, ngModelSet($scope, value), forEach(this.$viewChangeListeners, function(listener) {
try {
listener()
} catch (e) {
$exceptionHandler(e)
}
}))
};
var ctrl = this;
$scope.$watch(function() {
var value = ngModelGet($scope);
if (ctrl.$modelValue !== value) {
var formatters = ctrl.$formatters,
idx = formatters.length;
for (ctrl.$modelValue = value; idx--;) value = formatters[idx](value);
ctrl.$viewValue !== value && (ctrl.$viewValue = value, ctrl.$render())
}
})
}
],
ngModelDirective = function() {
return {
require: ["ngModel", "^?form"],
controller: NgModelController,
link: function(scope, element, attr, ctrls) {
var modelCtrl = ctrls[0],
formCtrl = ctrls[1] || nullFormCtrl;
formCtrl.$addControl(modelCtrl), element.bind("$destroy", function() {
formCtrl.$removeControl(modelCtrl)
})
}
}
}, ngChangeDirective = valueFn({
require: "ngModel",
link: function(scope, element, attr, ctrl) {
ctrl.$viewChangeListeners.push(function() {
scope.$eval(attr.ngChange)
})
}
}),
requiredDirective = function() {
return {
require: "?ngModel",
link: function(scope, elm, attr, ctrl) {
if (ctrl) {
attr.required = !0;
var validator = function(value) {
return attr.required && (isEmpty(value) || value === !1) ? (ctrl.$setValidity("required", !1), t) : (ctrl.$setValidity("required", !0), value)
};
ctrl.$formatters.push(validator), ctrl.$parsers.unshift(validator), attr.$observe("required", function() {
validator(ctrl.$viewValue)
})
}
}
}
}, ngListDirective = function() {
return {
require: "ngModel",
link: function(scope, element, attr, ctrl) {
var match = /\/(.*)\//.exec(attr.ngList),
separator = match && RegExp(match[1]) || attr.ngList || ",",
parse = function(viewValue) {
var list = [];
return viewValue && forEach(viewValue.split(separator), function(value) {
value && list.push(trim(value))
}), list
};
ctrl.$parsers.push(parse), ctrl.$formatters.push(function(value) {
return isArray(value) ? value.join(", ") : undefined
})
}
}
}, CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/,
ngValueDirective = function() {
return {
priority: 100,
compile: function(tpl, tplAttr) {
return CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue) ? function(scope, elm, attr) {
attr.$set("value", scope.$eval(attr.ngValue))
} : function(scope, elm, attr) {
scope.$watch(attr.ngValue, function(value) {
attr.$set("value", value, !1)
})
}
}
}
}, ngBindDirective = ngDirective(function(scope, element, attr) {
element.addClass("ng-binding").data("$binding", attr.ngBind), scope.$watch(attr.ngBind, function(value) {
element.text(value == undefined ? "" : value)
})
}),
ngBindTemplateDirective = ["$interpolate",
function($interpolate) {
return function(scope, element, attr) {
var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));
element.addClass("ng-binding").data("$binding", interpolateFn), attr.$observe("ngBindTemplate", function(value) {
element.text(value)
})
}
}
],
ngBindHtmlUnsafeDirective = [
function() {
return function(scope, element, attr) {
element.addClass("ng-binding").data("$binding", attr.ngBindHtmlUnsafe), scope.$watch(attr.ngBindHtmlUnsafe, function(value) {
element.html(value || "")
})
}
}
],
ngClassDirective = classDirective("", !0),
ngClassOddDirective = classDirective("Odd", 0),
ngClassEvenDirective = classDirective("Even", 1),
ngCloakDirective = ngDirective({
compile: function(element, attr) {
attr.$set("ngCloak", undefined), element.removeClass("ng-cloak")
}
}),
ngControllerDirective = [
function() {
return {
scope: !0,
controller: "@"
}
}
],
ngCspDirective = ["$sniffer",
function($sniffer) {
return {
priority: 1e3,
compile: function() {
$sniffer.csp = !0
}
}
}
],
ngEventDirectives = {};
forEach("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "), function(name) {
var directiveName = directiveNormalize("ng-" + name);
ngEventDirectives[directiveName] = ["$parse",
function($parse) {
return function(scope, element, attr) {
var fn = $parse(attr[directiveName]);
element.bind(lowercase(name), function(event) {
scope.$apply(function() {
fn(scope, {
$event: event
})
})
})
}
}
]
});
var ngSubmitDirective = ngDirective(function(scope, element, attrs) {
element.bind("submit", function() {
scope.$apply(attrs.ngSubmit)
})
}),
ngIncludeDirective = ["$http", "$templateCache", "$anchorScroll", "$compile",
function($http, $templateCache, $anchorScroll, $compile) {
return {
restrict: "ECA",
terminal: !0,
compile: function(element, attr) {
var srcExp = attr.ngInclude || attr.src,
onloadExp = attr.onload || "",
autoScrollExp = attr.autoscroll;
return function(scope, element) {
var childScope, changeCounter = 0,
clearContent = function() {
childScope && (childScope.$destroy(), childScope = null), element.html("")
};
scope.$watch(srcExp, function(src) {
var thisChangeId = ++changeCounter;
src ? $http.get(src, {
cache: $templateCache
}).success(function(response) {
thisChangeId === changeCounter && (childScope && childScope.$destroy(), childScope = scope.$new(), element.html(response), $compile(element.contents())(childScope), !isDefined(autoScrollExp) || autoScrollExp && !scope.$eval(autoScrollExp) || $anchorScroll(), childScope.$emit("$includeContentLoaded"), scope.$eval(onloadExp))
}).error(function() {
thisChangeId === changeCounter && clearContent()
}) : clearContent()
})
}
}
}
}
],
ngInitDirective = ngDirective({
compile: function() {
return {
pre: function(scope, element, attrs) {
scope.$eval(attrs.ngInit)
}
}
}
}),
ngNonBindableDirective = ngDirective({
terminal: !0,
priority: 1e3
}),
ngPluralizeDirective = ["$locale", "$interpolate",
function($locale, $interpolate) {
var BRACE = /{}/g;
return {
restrict: "EA",
link: function(scope, element, attr) {
var numberExp = attr.count,
whenExp = element.attr(attr.$attr.when),
offset = attr.offset || 0,
whens = scope.$eval(whenExp),
whensExpFns = {}, startSymbol = $interpolate.startSymbol(),
endSymbol = $interpolate.endSymbol();
forEach(whens, function(expression, key) {
whensExpFns[key] = $interpolate(expression.replace(BRACE, startSymbol + numberExp + "-" + offset + endSymbol))
}), scope.$watch(function() {
var value = parseFloat(scope.$eval(numberExp));
return isNaN(value) ? "" : (whens[value] || (value = $locale.pluralCat(value - offset)), whensExpFns[value](scope, element, !0))
}, function(newVal) {
element.text(newVal)
})
}
}
}
],
ngRepeatDirective = ngDirective({
transclude: "element",
priority: 1e3,
terminal: !0,
compile: function(element, attr, linker) {
return function(scope, iterStartElement, attr) {
var lhs, rhs, valueIdent, keyIdent, expression = attr.ngRepeat,
match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/);
if (!match) throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '" + expression + "'.");
if (lhs = match[1], rhs = match[2], match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/), !match) throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '" + lhs + "'.");
valueIdent = match[3] || match[1], keyIdent = match[2];
var lastOrder = new HashQueueMap;
scope.$watch(function(scope) {
var index, length, arrayLength, childScope, key, value, array, last, collection = scope.$eval(rhs),
cursor = iterStartElement,
nextOrder = new HashQueueMap;
if (isArray(collection)) array = collection || [];
else {
array = [];
for (key in collection) collection.hasOwnProperty(key) && "$" != key.charAt(0) && array.push(key);
array.sort()
}
for (arrayLength = array.length, index = 0, length = array.length; length > index; index++) key = collection === array ? index : array[index], value = collection[key], last = lastOrder.shift(value), last ? (childScope = last.scope, nextOrder.push(value, last), index === last.index ? cursor = last.element : (last.index = index, cursor.after(last.element), cursor = last.element)) : childScope = scope.$new(), childScope[valueIdent] = value, keyIdent && (childScope[keyIdent] = key), childScope.$index = index, childScope.$first = 0 === index, childScope.$last = index === arrayLength - 1, childScope.$middle = !(childScope.$first || childScope.$last), last || linker(childScope, function(clone) {
cursor.after(clone), last = {
scope: childScope,
element: cursor = clone,
index: index
}, nextOrder.push(value, last)
});
for (key in lastOrder)
if (lastOrder.hasOwnProperty(key))
for (array = lastOrder[key]; array.length;) value = array.pop(), value.element.remove(), value.scope.$destroy();
lastOrder = nextOrder
})
}
}
}),
ngShowDirective = ngDirective(function(scope, element, attr) {
scope.$watch(attr.ngShow, function(value) {
element.css("display", toBoolean(value) ? "" : "none")
})
}),
ngHideDirective = ngDirective(function(scope, element, attr) {
scope.$watch(attr.ngHide, function(value) {
element.css("display", toBoolean(value) ? "none" : "")
})
}),
ngStyleDirective = ngDirective(function(scope, element, attr) {
scope.$watch(attr.ngStyle, function(newStyles, oldStyles) {
oldStyles && newStyles !== oldStyles && forEach(oldStyles, function(val, style) {
element.css(style, "")
}), newStyles && element.css(newStyles)
}, !0)
}),
ngSwitchDirective = valueFn({
restrict: "EA",
require: "ngSwitch",
controller: ["$scope",
function() {
this.cases = {}
}
],
link: function(scope, element, attr, ctrl) {
var selectedTransclude, selectedElement, selectedScope, watchExpr = attr.ngSwitch || attr.on;
scope.$watch(watchExpr, function(value) {
selectedElement && (selectedScope.$destroy(), selectedElement.remove(), selectedElement = selectedScope = null), (selectedTransclude = ctrl.cases["!" + value] || ctrl.cases["?"]) && (scope.$eval(attr.change), selectedScope = scope.$new(), selectedTransclude(selectedScope, function(caseElement) {
selectedElement = caseElement, element.append(caseElement)
}))
})
}
}),
ngSwitchWhenDirective = ngDirective({
transclude: "element",
priority: 500,
require: "^ngSwitch",
compile: function(element, attrs, transclude) {
return function(scope, element, attr, ctrl) {
ctrl.cases["!" + attrs.ngSwitchWhen] = transclude
}
}
}),
ngSwitchDefaultDirective = ngDirective({
transclude: "element",
priority: 500,
require: "^ngSwitch",
compile: function(element, attrs, transclude) {
return function(scope, element, attr, ctrl) {
ctrl.cases["?"] = transclude
}
}
}),
ngTranscludeDirective = ngDirective({
controller: ["$transclude", "$element",
function($transclude, $element) {
$transclude(function(clone) {
$element.append(clone)
})
}
]
}),
ngViewDirective = ["$http", "$templateCache", "$route", "$anchorScroll", "$compile", "$controller",
function($http, $templateCache, $route, $anchorScroll, $compile, $controller) {
return {
restrict: "ECA",
terminal: !0,
link: function(scope, element, attr) {
function destroyLastScope() {
lastScope && (lastScope.$destroy(), lastScope = null)
}
function clearContent() {
element.html(""), destroyLastScope()
}
function update() {
var locals = $route.current && $route.current.locals,
template = locals && locals.$template;
if (template) {
element.html(template), destroyLastScope();
var controller, link = $compile(element.contents()),
current = $route.current;
lastScope = current.scope = scope.$new(), current.controller && (locals.$scope = lastScope, controller = $controller(current.controller, locals), element.children().data("$ngControllerController", controller)), link(lastScope), lastScope.$emit("$viewContentLoaded"), lastScope.$eval(onloadExp), $anchorScroll()
} else clearContent()
}
var lastScope, onloadExp = attr.onload || "";
scope.$on("$routeChangeSuccess", update), update()
}
}
}
],
scriptDirective = ["$templateCache",
function($templateCache) {
return {
restrict: "E",
terminal: !0,
compile: function(element, attr) {
if ("text/ng-template" == attr.type) {
var templateUrl = attr.id,
text = element[0].text;
$templateCache.put(templateUrl, text)
}
}
}
}
],
ngOptionsDirective = valueFn({
terminal: !0
}),
selectDirective = ["$compile", "$parse",
function($compile, $parse) {
var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,
nullModelCtrl = {
$setViewValue: noop
};
return {
restrict: "E",
require: ["select", "?ngModel"],
controller: ["$element", "$scope", "$attrs",
function($element, $scope, $attrs) {
var nullOption, unknownOption, self = this,
optionsMap = {}, ngModelCtrl = nullModelCtrl;
self.databound = $attrs.ngModel, self.init = function(ngModelCtrl_, nullOption_, unknownOption_) {
ngModelCtrl = ngModelCtrl_, nullOption = nullOption_, unknownOption = unknownOption_
}, self.addOption = function(value) {
optionsMap[value] = !0, ngModelCtrl.$viewValue == value && ($element.val(value), unknownOption.parent() && unknownOption.remove())
}, self.removeOption = function(value) {
this.hasOption(value) && (delete optionsMap[value], ngModelCtrl.$viewValue == value && this.renderUnknownOption(value))
}, self.renderUnknownOption = function(val) {
var unknownVal = "? " + hashKey(val) + " ?";
unknownOption.val(unknownVal), $element.prepend(unknownOption), $element.val(unknownVal), unknownOption.prop("selected", !0)
}, self.hasOption = function(value) {
return optionsMap.hasOwnProperty(value)
}, $scope.$on("$destroy", function() {
self.renderUnknownOption = noop
})
}
],
link: function(scope, element, attr, ctrls) {
function Single(scope, selectElement, ngModelCtrl, selectCtrl) {
ngModelCtrl.$render = function() {
var viewValue = ngModelCtrl.$viewValue;
selectCtrl.hasOption(viewValue) ? (unknownOption.parent() && unknownOption.remove(), selectElement.val(viewValue), "" === viewValue && emptyOption.prop("selected", !0)) : isUndefined(viewValue) && emptyOption ? selectElement.val("") : selectCtrl.renderUnknownOption(viewValue)
}, selectElement.bind("change", function() {
scope.$apply(function() {
unknownOption.parent() && unknownOption.remove(), ngModelCtrl.$setViewValue(selectElement.val())
})
})
}
function Multiple(scope, selectElement, ctrl) {
var lastView;
ctrl.$render = function() {
var items = new HashMap(ctrl.$viewValue);
forEach(selectElement.find("option"), function(option) {
option.selected = isDefined(items.get(option.value))
})
}, scope.$watch(function() {
equals(lastView, ctrl.$viewValue) || (lastView = copy(ctrl.$viewValue), ctrl.$render())
}), selectElement.bind("change", function() {
scope.$apply(function() {
var array = [];
forEach(selectElement.find("option"), function(option) {
option.selected && array.push(option.value)
}), ctrl.$setViewValue(array)
})
})
}
function Options(scope, selectElement, ctrl) {
function render() {
var optionGroupName, optionGroup, option, existingParent, existingOptions, existingOption, groupLength, length, groupIndex, index, selected, lastElement, element, label, optionGroups = {
"": []
}, optionGroupNames = [""],
modelValue = ctrl.$modelValue,
values = valuesFn(scope) || [],
keys = keyName ? sortedKeys(values) : values,
locals = {}, selectedSet = !1;
for (multiple ? selectedSet = new HashMap(modelValue) : (null === modelValue || nullOption) && (optionGroups[""].push({
selected: null === modelValue,
id: "",
label: ""
}), selectedSet = !0), index = 0; length = keys.length, length > index; index++) locals[valueName] = values[keyName ? locals[keyName] = keys[index] : index], optionGroupName = groupByFn(scope, locals) || "", (optionGroup = optionGroups[optionGroupName]) || (optionGroup = optionGroups[optionGroupName] = [], optionGroupNames.push(optionGroupName)), multiple ? selected = selectedSet.remove(valueFn(scope, locals)) != undefined : (selected = modelValue === valueFn(scope, locals), selectedSet = selectedSet || selected), label = displayFn(scope, locals), label = label === undefined ? "" : label, optionGroup.push({
id: keyName ? keys[index] : index,
label: label,
selected: selected
});
for (multiple || selectedSet || optionGroups[""].unshift({
id: "?",
label: "",
selected: !0
}), groupIndex = 0, groupLength = optionGroupNames.length; groupLength > groupIndex; groupIndex++) {
for (optionGroupName = optionGroupNames[groupIndex], optionGroup = optionGroups[optionGroupName], groupIndex >= optionGroupsCache.length ? (existingParent = {
element: optGroupTemplate.clone().attr("label", optionGroupName),
label: optionGroup.label
}, existingOptions = [existingParent], optionGroupsCache.push(existingOptions), selectElement.append(existingParent.element)) : (existingOptions = optionGroupsCache[groupIndex], existingParent = existingOptions[0], existingParent.label != optionGroupName && existingParent.element.attr("label", existingParent.label = optionGroupName)), lastElement = null, index = 0, length = optionGroup.length; length > index; index++) option = optionGroup[index], (existingOption = existingOptions[index + 1]) ? (lastElement = existingOption.element, existingOption.label !== option.label && lastElement.text(existingOption.label = option.label), existingOption.id !== option.id && lastElement.val(existingOption.id = option.id), existingOption.element.selected !== option.selected && lastElement.prop("selected", existingOption.selected = option.selected)) : ("" === option.id && nullOption ? element = nullOption : (element = optionTemplate.clone()).val(option.id).attr("selected", option.selected).text(option.label), existingOptions.push(existingOption = {
element: element,
label: option.label,
id: option.id,
selected: option.selected
}), lastElement ? lastElement.after(element) : existingParent.element.append(element), lastElement = element);
for (index++; existingOptions.length > index;) existingOptions.pop().element.remove()
}
for (; optionGroupsCache.length > groupIndex;) optionGroupsCache.pop()[0].element.remove()
}
var match;
if (!(match = optionsExp.match(NG_OPTIONS_REGEXP))) throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '" + optionsExp + "'.");
var displayFn = $parse(match[2] || match[1]),
valueName = match[4] || match[6],
keyName = match[5],
groupByFn = $parse(match[3] || ""),
valueFn = $parse(match[2] ? match[1] : valueName),
valuesFn = $parse(match[7]),
optionGroupsCache = [
[{
element: selectElement,
label: ""
}]
];
nullOption && ($compile(nullOption)(scope), nullOption.removeClass("ng-scope"), nullOption.remove()), selectElement.html(""), selectElement.bind("change", function() {
scope.$apply(function() {
var optionGroup, key, value, optionElement, index, groupIndex, length, groupLength, collection = valuesFn(scope) || [],
locals = {};
if (multiple)
for (value = [], groupIndex = 0, groupLength = optionGroupsCache.length; groupLength > groupIndex; u++)
for (optionGroup = optionGroupsCache[groupIndex], index = 1, length = optionGroup.length; length > index; c++)(optionElement = optionGroup[index].element)[0].selected && (key = optionElement.val(), keyName && (locals[keyName] = key), locals[valueName] = collection[key], value.push(valueFn(scope, locals)));
else key = selectElement.val(), "?" == key ? value = undefined : "" == key ? value = null : (locals[valueName] = collection[key], keyName && (locals[keyName] = key), value = valueFn(scope, locals));
ctrl.$setViewValue(value)
})
}), ctrl.$render = render, scope.$watch(render)
}
if (ctrls[1]) {
for (var emptyOption, selectCtrl = ctrls[0], ngModelCtrl = ctrls[1], multiple = attr.multiple, optionsExp = attr.ngOptions, nullOption = !1, optionTemplate = jqLite(document.createElement("option")), optGroupTemplate = jqLite(document.createElement("optgroup")), unknownOption = optionTemplate.clone(), i = 0, children = element.children(), ii = children.length; ii > i; i++)
if ("" == children[i].value) {
emptyOption = nullOption = children.eq(i);
break
}
if (selectCtrl.init(ngModelCtrl, nullOption, unknownOption), multiple && (attr.required || attr.ngRequired)) {
var requiredValidator = function(value) {
return ngModelCtrl.$setValidity("required", !attr.required || value && value.length), value
};
ngModelCtrl.$parsers.push(requiredValidator), ngModelCtrl.$formatters.unshift(requiredValidator), attr.$observe("required", function() {
requiredValidator(ngModelCtrl.$viewValue)
})
}
optionsExp ? Options(scope, element, ngModelCtrl) : multiple ? Multiple(scope, element, ngModelCtrl) : Single(scope, element, ngModelCtrl, selectCtrl)
}
}
}
}
],
optionDirective = ["$interpolate",
function($interpolate) {
var nullSelectCtrl = {
addOption: noop,
removeOption: noop
};
return {
restrict: "E",
priority: 100,
compile: function(element, attr) {
if (isUndefined(attr.value)) {
var interpolateFn = $interpolate(element.text(), !0);
interpolateFn || attr.$set("value", element.text())
}
return function(scope, element, attr) {
var selectCtrlName = "$selectController",
parent = element.parent(),
selectCtrl = parent.data(selectCtrlName) || parent.parent().data(selectCtrlName);
selectCtrl && selectCtrl.databound ? element.prop("selected", !1) : selectCtrl = nullSelectCtrl, interpolateFn ? scope.$watch(interpolateFn, function(newVal, oldVal) {
attr.$set("value", newVal), newVal !== oldVal && selectCtrl.removeOption(oldVal), selectCtrl.addOption(newVal)
}) : selectCtrl.addOption(attr.value), element.bind("$destroy", function() {
selectCtrl.removeOption(attr.value)
})
}
}
}
}
],
styleDirective = valueFn({
restrict: "E",
terminal: !0
});
bindJQuery(), publishExternalAPI(angular), jqLite(document).ready(function() {
angularInit(document, bootstrap)
})
})(window, document), angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>'), angular.module("fdApp", []).config(["$routeProvider", "$locationProvider",
function($routeProvider, $locationProvider) {
$routeProvider.when("/", {
templateUrl: "views/main.html"
}).when("/editor", {
templateUrl: "views/editor.html"
}).when("/gallery", {
templateUrl: "views/gallery.html",
controller: "GalleryCtrl"
}).otherwise({
redirectTo: "/"
}), $locationProvider.html5Mode(!0)
}
]), angular.module("fdApp").controller("AppCtrl", ["$scope", "$location", "$filter", "Font",
function($scope, $location, $filter, Font) {
$scope.routeIs = function(route) {
return $location.path() === route
}, $scope.fonts = [{
name: "VomZom",
size: "15kb",
author: "D.Rock",
authorurl: "http://defaulterror.com/typo.htm",
license: "Free for personal and commercial use.",
licenseurl: "http://defaulterror.com/typo.htm#Font%20License%20Information",
active: !0
}], $scope.font = Font, $scope.handleDrop = function(dt) {
var data = dt.getData("text/plain"),
files = dt.files || !1,
payload = files || data,
isFile = files && files.length;
$scope.$emit("addFont", payload, isFile)
}, $scope.year = (new Date).getFullYear(), $scope.addFont = function(scope, fonts, file) {
var files, fileFilter = $filter("file"),
jsonfile = $filter("jsonfile"),
fontface = $filter("fontfacecss");
files = file ? fileFilter(fonts) : jsonfile(fonts), $scope.fonts = $scope.fonts.concat(files), $scope.$emit("injectfontface", fontface(files))
}, $scope.$on("addFont", $scope.addFont)
}
]), angular.module("fdApp").controller("GalleryCtrl", ["$scope", "$http",
function($scope, $http) {
$http.get("/gallery/gallery.json").success(function(data) {
$scope.gallery = data
}), $scope.loadFont = function(url) {
$http.get(url + "/index.json").success(function(data) {
$scope.$emit("addFont", data)
})
}
}
]), angular.module("fdApp").directive("fdDnd", function() {
return {
restrict: "A",
link: function(scope, element, attrs) {
element.bind("drop", function(e) {
e.preventDefault(), scope.$apply(function(self) {
self[attrs.fdDnd](e.dataTransfer)
})
}), element.bind("dragenter", function(e) {
e.preventDefault()
}), element.bind("dragover", function(e) {
e.preventDefault()
})
}
}
}), angular.module("fdApp").directive("fdFontList", ["Font",
function(Font) {
var template = ['<ul id="fonts" class="fonts">', '<li ng-repeat="font in fonts" fd-tap="updateFont()" ng-class="{active: font.active}">', '<div tabindex="0" ng-style="{ \'font-family\': font.name }">', "<span>{{font.name}}</span>", '<div tabindex="0" class="info01">', "<ul>", '<li class="title">', "<strong ng-style=\"{ 'font-family': font.name }\">{{font.name}}</strong>", "</li>", "<li>", "<strong>Size</strong> {{font.size}}", "</li>", "<li>", '<strong>Author</strong> <a href="{{font.authorurl}}">{{font.author}}</a>', "</li>", "<li>", '<strong>License</strong> <a href="{{font.licenseurl}}">{{font.license}}</a>', "</li>", "</ul>", "</div>", "</div>", "</li>", "</ul>"].join("");
return {
restrict: "A",
replace: !0,
template: template,
link: function(scope) {
scope.updateFont = function() {
angular.forEach(scope.fonts, function(font) {
font.active = !1
}), this.font.active = !0, Font.activeFont = this.font.name
}
}
}
}
]), angular.module("fdApp").directive("fdTap", function() {
return {
restrict: "A",
link: function(scope, element, attrs) {
if ("ontouchstart" in window) {
var tapping = !1;
element.bind("touchstart", function() {
tapping = !0
}), element.bind("touchmove", function() {
tapping = !1
}), element.bind("touchcancel", function() {
tapping = !1
}), element.bind("touchend", function() {
tapping && scope.$apply(attrs.fdTap, element)
})
} else element.bind("click", function() {
scope.$apply(attrs.fdTap, element)
})
}
}
}), angular.module("fdApp").directive("fdVideo", function() {
return {
template: '<iframe frameborder="0"></iframe>',
restrict: "A",
replace: !0,
scope: {
src: "@",
width: "@",
height: "@"
}
}
}), angular.module("fdApp").directive("link", function() {
return {
restrict: "E",
link: function(scope, element) {
var sheet = element[0].sheet;
scope.$on("injectfontface", function(scope, rule) {
angular.forEach(rule, function(rule) {
sheet.insertRule(rule, 0)
})
})
}
}
}), angular.module("fdApp").filter("file", function() {
return function(files) {
var droppedFullFileName, droppedFileName, droppedFileSize, font, fonts = [],
acceptedFileExtensions = /\.(ttf|otf|woff)$/i,
url = window.URL || window.webkitURL || {};
return angular.forEach(files, function(file) {
droppedFullFileName = file.name, droppedFullFileName.match(acceptedFileExtensions) ? (droppedFileName = droppedFullFileName.replace(/\.\w+$/, ""), droppedFileName = droppedFileName.replace(/\W+/g, "-"), droppedFileSize = Math.round(file.size / 1024) + "kb", font = url.createObjectURL(file), fonts.push({
result: font,
name: droppedFileName,
size: droppedFileSize,
author: "",
authorurl: "",
license: "",
licenseurl: ""
})) : alert("Invalid file extension. Will only accept ttf, otf or woff font files")
}), fonts
}
}), angular.module("fdApp").filter("fontfacecss", function() {
return function(files) {
var fonts = [];
return angular.forEach(files, function(file) {
fonts.push(["@font-face{font-family: ", file.name, "; src:url(", file.result, ");}"].join(""))
}), fonts
}
}), angular.module("fdApp").filter("jsonfile", [
function() {
return function(data) {
if (!data.error) {
var font = [],
fontFileName = data.fontName.split("/").reverse()[0];
return fontFileName = fontFileName.replace(/\.\w+$/, ""), data.fontSize = Math.round(data.fontSize / 1024) + "kb", data.fontDataURL = "data:application/octet-stream;base64," + data.fontDataURL, font.push({
name: fontFileName,
size: data.fontSize,
license: data.fontLicense,
licenseurl: data.fontLicenseUrl,
author: data.fontAuthor,
authorurl: data.fontAuthorUrl,
result: data.fontDataURL
}), font
}
alert(data.error)
}
}
]), angular.module("fdApp").factory("Font", [
function() {
return {
activeFont: "VomZom"
}
}
]), angular.module("fdApp").run(["$templateCache",
function($templateCache) {
$templateCache.put("views/editor.html", '<section id="banner" role="banner" class="clearfix"><div class="container grid"><h1 id="fontname" ng-style="{ \'font-family\': font.activeFont }" class="colx8">{{font.activeFont}}</h1><aside role="complementary" class="colx4"><div fd-font-list=""></div></aside></div></section><div id="wfs" contenteditable="true" ng-style="{ \'font-family\': font.activeFont }" class="grid"><section role="region" class="colx6"><h2>Text sample <span>&#8211; CSS font-size (px) with 1.4em line-height</span></h2><p class="s s18"><span>18</span>Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p><p class="s s14"><span>14</span>Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221; and the progressive tendencies of&hellip;</p><p class="s s12"><span>12</span>Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221; and the progressive tendencies of an able mind. For, let a man be as able &amp; original&hellip;</p><p class="s s11"><span>11</span>Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221; and the progressive tendencies of an able mind. For, let a man be as able &amp; original as he may&hellip;</p><p class="s s10"><span>10</span>Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221; and the progressive tendencies of an able mind. For, let a man be as able &amp; original as he may, he can&#8217;t afford to discard knowledge of what&hellip;</p><p class="s s9"><span>9</span>Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221; and the progressive tendencies of an able mind. For, let a man be as able &amp; original as he may, he can&#8217;t afford to discard knowledge of what has gone before or what is now going&hellip;</p></section><section role="region" class="colx6 charset"><h2>Characters</h2><p class="s s56">A&#8201;B&#8201;C&#8201;D&#8201;E&#8201;F&#8201;G&#8201;H&#8201;I&#8201;J&#8201;K&#8201;L&#8201;M&#8201;N&#8201;O&#8201;P&#8201;Q&#8201;R&#8201;S&#8201;T&#8201;U&#8201;V&#8201;W&#8201;X&#8201;Y&#8201;Z<br/>a&#8201;b&#8201;c&#8201;d&#8201;e&#8201;f&#8201;g&#8201;h&#8201;i&#8201;j&#8201;k&#8201;l&#8201;m&#8201;n&#8201;o&#8201;p&#8201;q&#8201;r&#8201;s&#8201;t&#8201;u&#8201;v&#8201;w&#8201;x&#8201;y&#8201;z<br/>1&#8201;2&#8201;3&#8201;4&#8201;5&#8201;6&#8201;7&#8201;8&#8201;9&#8201;0&#8201;&amp;&#8201;@&#8201;.&#8201;,&#8201;?&#8201;!&#8201;&#8217;&#8201;&#8220;&#8201;&#8221;&#8201;(&#8201;)</p></section><section class="colx12"><h2>Body size comparison</h2><div class="bodysize"><table><tr><th class="fontname">Font name</th><th>Arial<a href="http://www.codestyle.org/servlets/FontStack?stack=Arial,Helvetica&amp;generic=sans-serif">stack</a></th><th>Times<a href="http://www.codestyle.org/servlets/FontStack?stack=Times+New+Roman,Times&amp;generic=serif">stack</a></th><th>Georgia<a href="http://www.codestyle.org/servlets/FontStack?stack=Georgia,New+Century+Schoolbook,Nimbus+Roman+No9+L&amp;generic=serif">stack</a></th></tr><tr><td><span>Body</span></td><td class="tf typeface2"><span>Body</span></td><td class="tf typeface3"><span>Body</span></td><td class="tf typeface4"><span>Body</span></td></tr></table></div></section><section class="colx12"><h2>Grayscale<span>&#8211; CSS hex color</span></h2><div class="grayscale clearfix"><div class="colx6 white alpha"><p class="c000"><span>#000</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="c333"><span>#333</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="c666"><span>#666</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="c999"><span>#999</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="cCCC"><span>#CCC</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p></div><div class="colx6 black omega"><p class="cFFF"><span>#FFF</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="cCCC"><span>#CCC</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="c999"><span>#999</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="c666"><span>#666</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p><p class="c333"><span>#333</span>The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to</p></div></div></section><section class="ulc clearfix"><section class="colx12"><h2>Size<span>&#8211; CSS font-size (px)</span></h2><p class="s s36"><span>36</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s30"><span>30</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s24"><span>24</span><span class="text">Pack my box with five dozen liquor jugs.</span></p></section><section class="colx8"><p class="s s21"><span>21</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s18"><span>18</span><span class="text">Pack my box with five dozen liquor jugs.</span></p></section><section class="colx4 upp"><p class="s s9"><span>9</span><span class="text">Pack my box with five dozen liquor jugs</span></p><p class="s s10"><span>10</span><span class="text">Pack my box with five dozen liquor jugs</span></p></section><div class="clearfix"></div><section class="colx6"><p class="s s16"><span>16</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s14"><span>14</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s13"><span>13</span><span class="text">Pack my box with five dozen liquor jugs.</span></p></section><section class="colx6 upp"><p class="s s11"><span>11</span><span class="text">Pack my box with five dozen liquor jugs</span></p><p class="s s12"><span>12</span><span class="text">Pack my box with five dozen liquor jugs</span></p><p class="s s13"><span>13</span><span class="text">Pack my box with five dozen liquor jugs</span></p></section><div class="clearfix"></div><section class="colx4"><p class="s s12"><span>12</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s11"><span>11</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s10"><span>10</span><span class="text">Pack my box with five dozen liquor jugs.</span></p><p class="s s9"><span>9</span><span class="text">Pack my box with five dozen liquor jugs.</span></p></section><section class="colx8 upp"><p class="s s14"><span>14</span><span class="text">Pack my box with five dozen liquor jugs</span></p><p class="s s16"><span>16</span><span class="text">Pack my box with five dozen liquor jugs</span></p><p class="s s18"><span>18</span><span class="text">Pack my box with five dozen liquor jugs</span></p></section><div class="clearfix"></div><section class="colx12 upp"><p class="s s21"><span>21</span><span class="text">Pack my box with five dozen liquor jugs</span></p><p class="s s24"><span>24</span><span class="text">Pack my box with five dozen liquor jugs</span></p><p class="s s30"><span>30</span><span class="text">Pack my box with five dozen liquor jugs</span></p></section></section></div>'), $templateCache.put("views/gallery.html", '<section id="banner" role="banner" class="clearfix"><div class="container grid"><h1 id="fontname" ng-style="{ \'font-family\': font.activeFont }" class="colx8">{{font.activeFont}}</h1><aside role="complementary" class="colx4"><div fd-font-list=""></div></aside></div></section><div class="content grid gallery clearfix"><div ng-repeat="font in gallery" class="colx4 item"><h2>{{ font.name }}<div tabindex="0" class="info01"><ul><li class="title"><strong>{{ font.name }}</strong></li><li><strong>Size: </strong>{{ font.size }}</li><li><strong>Author:</strong><a ng-href="{{ font.authorurl }}">{{ font.author }}</a></li><li><strong>License:</strong><a ng-href="{{ font.licenseurl }}">{{ font.license }}</a></li></ul></div></h2><p ng-style="{\'font-family\': font.name + \'-subset\'}" class="preview">AaBbCcDd</p><a id="{{font.name}}" draggable="true" fd-tap="loadFont(\'gallery/{{font.name}}\')" class="button"> \nLoad {{ font.name }}</a></div></div>'), put.put("views/main.html", '<section id="banner" role="banner" class="clearfix"><div class="container grid"><h1 class="colx8">A revolutionary way to test custom fonts in the browser. No coding, no uploading, just drag and drop.</h1><aside role="complementary" class="colx4"><div fd-video="" src="http://www.screenr.com/embed/D8hs" height="200" width="300"></div></aside></div></section><div class="content grid clearfix"><section role="region" class="colx4"><h1>Drag your fonts here</h1><div fd-font-list=""></div></section><section id="custom" role="main" class="colx8"><div class="colx4 alpha"><h1>What is it?</h1><p>font dragr allows you to easily test custom fonts, through the <code>@font-face</code> at-rule, without the need for any CSS coding or knowledge of CSS coding. All you need to do is drag and drop.</p><p>It alleviates the cumbersome nature of testing custom fonts and allows you to quickly and easily load in a font, play around with it and see if it\'s the right one for you.</p></div><div class="colx4 omega"><h1>How do I use it?</h1><p>It\'s incredibly easy to use. All you need to do is drag and drop a font file from your computer into font dragr in a supporting browser (Such as Firefox 3.6+ or Chrome 6+).</p><p>You can also select a font to test from the gallery. These fonts can be tested in most browsers, including IE6 and up.</p></div></section><section class="colx12"><h1 class="hr01"><span>The revolution doesn\'t end there</span></h1><div class="colx8 alpha"><h1>You can test on any website</h1><p>Testing fonts within font dragr, while useful, won\'t give the full look and feel of testing it on your own site. That\'s where the font dragr bookmarklet comes in handy.</p><p>The bookmarklet allows you to test any font from your file system or any of the fonts found in the gallery. Same simple approach the web app has, with the added ability for testing on any website.</p><p>To install the bookmarklet in your browser just drag and drop the button below to your bookmarks. If you\'re not sure where to drag it too or you want to get a quick inside look at how you can use it make sure to check out the bookmarklet screencast.</p><p> \nDrag the <a href="javascript:(function(d){var%20s=d.createElement(\'script\'),h=d.head||d.getElementsByTagName(\'head\')[0];s.src=\'http://fontdragr.com/bookmarklet/fd-script.js\';h.appendChild(s);})(document);" class="button vomzom">font dragr</a> bookmarklet to your bookmarks.</p></div><div class="colx4 omega"><h1>Bookmarklet in action</h1><div fd-video="" src="http://www.screenr.com/embed/P8hs" height="200" width="300"></div></div></section><section class="colx12"><h1 class="hr01"><span>The bookmarklet in three simple steps</span></h1><div class="colx4 alpha"><h1>Load it</h1><p><img src="/images/gr_load.png"/></p><p>Load the font dragr bookmarklet in the website you wish to test. Once it loads it will appear at the top of the browser window ready to use.</p></div><div class="colx4"><h1>Drag it</h1><p><img src="/images/gr_drag.png"/></p><p>Drag and drop a font from your desktop or from the gallery. The last dropped font will become active and be applied to the body element by default.</p></div><div class="colx4 omega"><h1>Test it</h1><p><img src="/images/gr_test.png"/></p><p>With the bookmarklet you can target specific elements using CSS selectors. Or by selecting some text you can apply the custom font to a selection.</p></div></section></div>')
}
]);
//# sourceMappingURL=scripts.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment