personal website

Commit 22bed345

22bed345400eMerged

Justin Dorfman <[email protected]> · 10 years ago · 4 files · ~4 modified

Description

Combined js

Details

Commit
22bed345400e
Parent
9fd005ee6b4b

public/2016/assets/js/main.jsmodifiedView file

@@ -437,3 +437,631 @@
437437
438438
439439 });
440+
441+/*!
442+ * @overview es6-promise - a tiny implementation of Promises/A+.
443+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
444+ * @license Licensed under MIT license
445+ * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
446+ * @version 3.0.2
447+ */
448+
449+(function(){"use strict";function lib$es6$promise$utils$$objectOrFunction(x){return typeof x==="function"||typeof x==="object"&&x!==null}function lib$es6$promise$utils$$isFunction(x){return typeof x==="function"}function lib$es6$promise$utils$$isMaybeThenable(x){return typeof x==="object"&&x!==null}var lib$es6$promise$utils$$_isArray;if(!Array.isArray){lib$es6$promise$utils$$_isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}}else{lib$es6$promise$utils$$_isArray=Array.isArray}var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;var lib$es6$promise$asap$$len=0;var lib$es6$promise$asap$$toString={}.toString;var lib$es6$promise$asap$$vertxNext;var lib$es6$promise$asap$$customSchedulerFn;var lib$es6$promise$asap$$asap=function asap(callback,arg){lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;lib$es6$promise$asap$$len+=2;if(lib$es6$promise$asap$$len===2){if(lib$es6$promise$asap$$customSchedulerFn){lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush)}else{lib$es6$promise$asap$$scheduleFlush()}}};function lib$es6$promise$asap$$setScheduler(scheduleFn){lib$es6$promise$asap$$customSchedulerFn=scheduleFn}function lib$es6$promise$asap$$setAsap(asapFn){lib$es6$promise$asap$$asap=asapFn}var lib$es6$promise$asap$$browserWindow=typeof window!=="undefined"?window:undefined;var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow||{};var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver||lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;var lib$es6$promise$asap$$isNode=typeof process!=="undefined"&&{}.toString.call(process)==="[object process]";var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray!=="undefined"&&typeof importScripts!=="undefined"&&typeof MessageChannel!=="undefined";function lib$es6$promise$asap$$useNextTick(){return function(){process.nextTick(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useVertxTimer(){return function(){lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useMutationObserver(){var iterations=0;var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);var node=document.createTextNode("");observer.observe(node,{characterData:true});return function(){node.data=iterations=++iterations%2}}function lib$es6$promise$asap$$useMessageChannel(){var channel=new MessageChannel;channel.port1.onmessage=lib$es6$promise$asap$$flush;return function(){channel.port2.postMessage(0)}}function lib$es6$promise$asap$$useSetTimeout(){return function(){setTimeout(lib$es6$promise$asap$$flush,1)}}var lib$es6$promise$asap$$queue=new Array(1e3);function lib$es6$promise$asap$$flush(){for(var i=0;i<lib$es6$promise$asap$$len;i+=2){var callback=lib$es6$promise$asap$$queue[i];var arg=lib$es6$promise$asap$$queue[i+1];callback(arg);lib$es6$promise$asap$$queue[i]=undefined;lib$es6$promise$asap$$queue[i+1]=undefined}lib$es6$promise$asap$$len=0}function lib$es6$promise$asap$$attemptVertx(){try{var r=require;var vertx=r("vertx");lib$es6$promise$asap$$vertxNext=vertx.runOnLoop||vertx.runOnContext;return lib$es6$promise$asap$$useVertxTimer()}catch(e){return lib$es6$promise$asap$$useSetTimeout()}}var lib$es6$promise$asap$$scheduleFlush;if(lib$es6$promise$asap$$isNode){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick()}else if(lib$es6$promise$asap$$BrowserMutationObserver){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver()}else if(lib$es6$promise$asap$$isWorker){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel()}else if(lib$es6$promise$asap$$browserWindow===undefined&&typeof require==="function"){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertx()}else{lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout()}function lib$es6$promise$$internal$$noop(){}var lib$es6$promise$$internal$$PENDING=void 0;var lib$es6$promise$$internal$$FULFILLED=1;var lib$es6$promise$$internal$$REJECTED=2;var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject;function lib$es6$promise$$internal$$selfFulfillment(){return new TypeError("You cannot resolve a promise with itself")}function lib$es6$promise$$internal$$cannotReturnOwn(){return new TypeError("A promises callback cannot return that same promise.")}function lib$es6$promise$$internal$$getThen(promise){try{return promise.then}catch(error){lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;return lib$es6$promise$$internal$$GET_THEN_ERROR}}function lib$es6$promise$$internal$$tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function lib$es6$promise$$internal$$handleForeignThenable(promise,thenable,then){lib$es6$promise$asap$$asap(function(promise){var sealed=false;var error=lib$es6$promise$$internal$$tryThen(then,thenable,function(value){if(sealed){return}sealed=true;if(thenable!==value){lib$es6$promise$$internal$$resolve(promise,value)}else{lib$es6$promise$$internal$$fulfill(promise,value)}},function(reason){if(sealed){return}sealed=true;lib$es6$promise$$internal$$reject(promise,reason)},"Settle: "+(promise._label||" unknown promise"));if(!sealed&&error){sealed=true;lib$es6$promise$$internal$$reject(promise,error)}},promise)}function lib$es6$promise$$internal$$handleOwnThenable(promise,thenable){if(thenable._state===lib$es6$promise$$internal$$FULFILLED){lib$es6$promise$$internal$$fulfill(promise,thenable._result)}else if(thenable._state===lib$es6$promise$$internal$$REJECTED){lib$es6$promise$$internal$$reject(promise,thenable._result)}else{lib$es6$promise$$internal$$subscribe(thenable,undefined,function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}}function lib$es6$promise$$internal$$handleMaybeThenable(promise,maybeThenable){if(maybeThenable.constructor===promise.constructor){lib$es6$promise$$internal$$handleOwnThenable(promise,maybeThenable)}else{var then=lib$es6$promise$$internal$$getThen(maybeThenable);if(then===lib$es6$promise$$internal$$GET_THEN_ERROR){lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$GET_THEN_ERROR.error)}else if(then===undefined){lib$es6$promise$$internal$$fulfill(promise,maybeThenable)}else if(lib$es6$promise$utils$$isFunction(then)){lib$es6$promise$$internal$$handleForeignThenable(promise,maybeThenable,then)}else{lib$es6$promise$$internal$$fulfill(promise,maybeThenable)}}}function lib$es6$promise$$internal$$resolve(promise,value){if(promise===value){lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$selfFulfillment())}else if(lib$es6$promise$utils$$objectOrFunction(value)){lib$es6$promise$$internal$$handleMaybeThenable(promise,value)}else{lib$es6$promise$$internal$$fulfill(promise,value)}}function lib$es6$promise$$internal$$publishRejection(promise){if(promise._onerror){promise._onerror(promise._result)}lib$es6$promise$$internal$$publish(promise)}function lib$es6$promise$$internal$$fulfill(promise,value){if(promise._state!==lib$es6$promise$$internal$$PENDING){return}promise._result=value;promise._state=lib$es6$promise$$internal$$FULFILLED;if(promise._subscribers.length!==0){lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,promise)}}function lib$es6$promise$$internal$$reject(promise,reason){if(promise._state!==lib$es6$promise$$internal$$PENDING){return}promise._state=lib$es6$promise$$internal$$REJECTED;promise._result=reason;lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection,promise)}function lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection){var subscribers=parent._subscribers;var length=subscribers.length;parent._onerror=null;subscribers[length]=child;subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;if(length===0&&parent._state){lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,parent)}}function lib$es6$promise$$internal$$publish(promise){var subscribers=promise._subscribers;var settled=promise._state;if(subscribers.length===0){return}var child,callback,detail=promise._result;for(var i=0;i<subscribers.length;i+=3){child=subscribers[i];callback=subscribers[i+settled];if(child){lib$es6$promise$$internal$$invokeCallback(settled,child,callback,detail)}else{callback(detail)}}promise._subscribers.length=0}function lib$es6$promise$$internal$$ErrorObject(){this.error=null}var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject;function lib$es6$promise$$internal$$tryCatch(callback,detail){try{return callback(detail)}catch(e){lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;return lib$es6$promise$$internal$$TRY_CATCH_ERROR}}function lib$es6$promise$$internal$$invokeCallback(settled,promise,callback,detail){var hasCallback=lib$es6$promise$utils$$isFunction(callback),value,error,succeeded,failed;if(hasCallback){value=lib$es6$promise$$internal$$tryCatch(callback,detail);if(value===lib$es6$promise$$internal$$TRY_CATCH_ERROR){failed=true;error=value.error;value=null}else{succeeded=true}if(promise===value){lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$cannotReturnOwn());return}}else{value=detail;succeeded=true}if(promise._state!==lib$es6$promise$$internal$$PENDING){}else if(hasCallback&&succeeded){lib$es6$promise$$internal$$resolve(promise,value)}else if(failed){lib$es6$promise$$internal$$reject(promise,error)}else if(settled===lib$es6$promise$$internal$$FULFILLED){lib$es6$promise$$internal$$fulfill(promise,value)}else if(settled===lib$es6$promise$$internal$$REJECTED){lib$es6$promise$$internal$$reject(promise,value)}}function lib$es6$promise$$internal$$initializePromise(promise,resolver){try{resolver(function resolvePromise(value){lib$es6$promise$$internal$$resolve(promise,value)},function rejectPromise(reason){lib$es6$promise$$internal$$reject(promise,reason)})}catch(e){lib$es6$promise$$internal$$reject(promise,e)}}function lib$es6$promise$enumerator$$Enumerator(Constructor,input){var enumerator=this;enumerator._instanceConstructor=Constructor;enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);if(enumerator._validateInput(input)){enumerator._input=input;enumerator.length=input.length;enumerator._remaining=input.length;enumerator._init();if(enumerator.length===0){lib$es6$promise$$internal$$fulfill(enumerator.promise,enumerator._result)}else{enumerator.length=enumerator.length||0;enumerator._enumerate();if(enumerator._remaining===0){lib$es6$promise$$internal$$fulfill(enumerator.promise,enumerator._result)}}}else{lib$es6$promise$$internal$$reject(enumerator.promise,enumerator._validationError())}}lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function(input){return lib$es6$promise$utils$$isArray(input)};lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")};lib$es6$promise$enumerator$$Enumerator.prototype._init=function(){this._result=new Array(this.length)};var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function(){var enumerator=this;var length=enumerator.length;var promise=enumerator.promise;var input=enumerator._input;for(var i=0;promise._state===lib$es6$promise$$internal$$PENDING&&i<length;i++){enumerator._eachEntry(input[i],i)}};lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function(entry,i){var enumerator=this;var c=enumerator._instanceConstructor;if(lib$es6$promise$utils$$isMaybeThenable(entry)){if(entry.constructor===c&&entry._state!==lib$es6$promise$$internal$$PENDING){entry._onerror=null;enumerator._settledAt(entry._state,i,entry._result)}else{enumerator._willSettleAt(c.resolve(entry),i)}}else{enumerator._remaining--;enumerator._result[i]=entry}};lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function(state,i,value){var enumerator=this;var promise=enumerator.promise;if(promise._state===lib$es6$promise$$internal$$PENDING){enumerator._remaining--;if(state===lib$es6$promise$$internal$$REJECTED){lib$es6$promise$$internal$$reject(promise,value)}else{enumerator._result[i]=value}}if(enumerator._remaining===0){lib$es6$promise$$internal$$fulfill(promise,enumerator._result)}};lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function(promise,i){var enumerator=this;lib$es6$promise$$internal$$subscribe(promise,undefined,function(value){enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED,i,value)},function(reason){enumerator._settledAt(lib$es6$promise$$internal$$REJECTED,i,reason)})};function lib$es6$promise$promise$all$$all(entries){return new lib$es6$promise$enumerator$$default(this,entries).promise}var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;function lib$es6$promise$promise$race$$race(entries){var Constructor=this;var promise=new Constructor(lib$es6$promise$$internal$$noop);if(!lib$es6$promise$utils$$isArray(entries)){lib$es6$promise$$internal$$reject(promise,new TypeError("You must pass an array to race."));return promise}var length=entries.length;function onFulfillment(value){lib$es6$promise$$internal$$resolve(promise,value)}function onRejection(reason){lib$es6$promise$$internal$$reject(promise,reason)}for(var i=0;promise._state===lib$es6$promise$$internal$$PENDING&&i<length;i++){lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]),undefined,onFulfillment,onRejection)}return promise}var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;function lib$es6$promise$promise$resolve$$resolve(object){var Constructor=this;if(object&&typeof object==="object"&&object.constructor===Constructor){return object}var promise=new Constructor(lib$es6$promise$$internal$$noop);lib$es6$promise$$internal$$resolve(promise,object);return promise}var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;function lib$es6$promise$promise$reject$$reject(reason){var Constructor=this;var promise=new Constructor(lib$es6$promise$$internal$$noop);lib$es6$promise$$internal$$reject(promise,reason);return promise}var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;var lib$es6$promise$promise$$counter=0;function lib$es6$promise$promise$$needsResolver(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function lib$es6$promise$promise$$needsNew(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;function lib$es6$promise$promise$$Promise(resolver){this._id=lib$es6$promise$promise$$counter++;this._state=undefined;this._result=undefined;this._subscribers=[];if(lib$es6$promise$$internal$$noop!==resolver){if(!lib$es6$promise$utils$$isFunction(resolver)){lib$es6$promise$promise$$needsResolver()}if(!(this instanceof lib$es6$promise$promise$$Promise)){lib$es6$promise$promise$$needsNew()}lib$es6$promise$$internal$$initializePromise(this,resolver)}}lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;lib$es6$promise$promise$$Promise.prototype={constructor:lib$es6$promise$promise$$Promise,then:function(onFulfillment,onRejection){var parent=this;var state=parent._state;if(state===lib$es6$promise$$internal$$FULFILLED&&!onFulfillment||state===lib$es6$promise$$internal$$REJECTED&&!onRejection){return this}var child=new this.constructor(lib$es6$promise$$internal$$noop);var result=parent._result;if(state){var callback=arguments[state-1];lib$es6$promise$asap$$asap(function(){lib$es6$promise$$internal$$invokeCallback(state,child,callback,result)})}else{lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection)}return child},"catch":function(onRejection){return this.then(null,onRejection)}};function lib$es6$promise$polyfill$$polyfill(){var local;if(typeof global!=="undefined"){local=global}else if(typeof self!=="undefined"){local=self}else{try{local=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}}var P=local.Promise;if(P&&Object.prototype.toString.call(P.resolve())==="[object Promise]"&&!P.cast){return}local.Promise=lib$es6$promise$promise$$default}var lib$es6$promise$polyfill$$default=lib$es6$promise$polyfill$$polyfill;var lib$es6$promise$umd$$ES6Promise={Promise:lib$es6$promise$promise$$default,polyfill:lib$es6$promise$polyfill$$default};if(typeof define==="function"&&define["amd"]){define(function(){return lib$es6$promise$umd$$ES6Promise})}else if(typeof module!=="undefined"&&module["exports"]){module["exports"]=lib$es6$promise$umd$$ES6Promise}else if(typeof this!=="undefined"){this["ES6Promise"]=lib$es6$promise$umd$$ES6Promise}lib$es6$promise$polyfill$$default()}).call(this);
450+
451+/*!
452+Fetch 0.9.0
453+Copyright (c) 2014-2016 GitHub, Inc.
454+*/
455+
456+!function(){"use strict";function t(t){if("string"!=typeof t&&(t=t.toString()),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function e(t){return"string"!=typeof t&&(t=t.toString()),t}function r(t){this.map={},t instanceof r?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function o(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function n(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader;return e.readAsArrayBuffer(t),n(e)}function i(t){var e=new FileReader;return e.readAsText(t),n(e)}function a(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(p.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(p.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else{if(t)throw new Error("unsupported BodyInit type");this._bodyText=""}},p.blob?(this.blob=function(){var t=o(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var t=o(this);if(t)return t;if(this._bodyBlob)return i(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=o(this);return t?t:Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(t){var e=t.toUpperCase();return c.indexOf(e)>-1?e:t}function f(t,e){if(e=e||{},this.url=t,this.credentials=e.credentials||"omit",this.headers=new r(e.headers),this.method=u(e.method||"GET"),this.mode=e.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e.body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(e.body)}function h(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function d(t){var e=new r,o=t.getAllResponseHeaders().trim().split("\n");return o.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function l(t,e){e||(e={}),this._initBody(t),this.type="default",this.url=null,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof r?e.headers:new r(e.headers),this.url=e.url||""}if(!self.fetch){r.prototype.append=function(r,o){r=t(r),o=e(o);var n=this.map[r];n||(n=[],this.map[r]=n),n.push(o)},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var r=this.map[t(e)];return r?r[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(r,o){this.map[t(r)]=[e(o)]},r.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)};var p={blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self},c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];a.call(f.prototype),a.call(l.prototype),self.Headers=r,self.Request=f,self.Response=l,self.fetch=function(t,e){var r;return r=f.prototype.isPrototypeOf(t)&&!e?t:new f(t,e),new Promise(function(t,e){function o(){return"responseURL"in n?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):void 0}var n=new XMLHttpRequest;n.onload=function(){var r=1223===n.status?204:n.status;if(100>r||r>599)return void e(new TypeError("Network request failed"));var s={status:r,statusText:n.statusText,headers:d(n),url:o()},i="response"in n?n.response:n.responseText;t(new l(i,s))},n.onerror=function(){e(new TypeError("Network request failed"))},n.open(r.method,r.url,!0),"include"===r.credentials&&(n.withCredentials=!0),"responseType"in n&&p.blob&&(n.responseType="blob"),r.headers.forEach(function(t,e){n.setRequestHeader(e,t)}),n.send("undefined"==typeof r._bodyInit?null:r._bodyInit)})},self.fetch.polyfill=!0}}();
457+
458+/*!
459+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
460+ * http://github.com/janl/mustache.js
461+ */
462+
463+/*global define: false*/
464+
465+(function (root, factory) {
466+ if (typeof exports === "object" && exports) {
467+ module.exports = factory; // CommonJS
468+ } else if (typeof define === "function" && define.amd) {
469+ define(factory); // AMD
470+ } else {
471+ root.Mustache = factory; // <script>
472+ }
473+}(this, (function () {
474+
475+ var exports = {};
476+
477+ exports.name = "mustache.js";
478+ exports.version = "0.7.2";
479+ exports.tags = ["{{", "}}"];
480+
481+ exports.Scanner = Scanner;
482+ exports.Context = Context;
483+ exports.Writer = Writer;
484+
485+ var whiteRe = /\s*/;
486+ var spaceRe = /\s+/;
487+ var nonSpaceRe = /\S/;
488+ var eqRe = /\s*=/;
489+ var curlyRe = /\s*\}/;
490+ var tagRe = /#|\^|\/|>|\{|&|=|!/;
491+
492+ // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577
493+ // See https://github.com/janl/mustache.js/issues/189
494+ function testRe(re, string) {
495+ return RegExp.prototype.test.call(re, string);
496+ }
497+
498+ function isWhitespace(string) {
499+ return !testRe(nonSpaceRe, string);
500+ }
501+
502+ var isArray = Array.isArray || function (obj) {
503+ return Object.prototype.toString.call(obj) === "[object Array]";
504+ };
505+
506+ function escapeRe(string) {
507+ return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
508+ }
509+
510+ var entityMap = {
511+ "&": "&amp;",
512+ "<": "&lt;",
513+ ">": "&gt;",
514+ '"': '&quot;',
515+ "'": '&#39;',
516+ "/": '&#x2F;'
517+ };
518+
519+ function escapeHtml(string) {
520+ return String(string).replace(/[&<>"'\/]/g, function (s) {
521+ return entityMap[s];
522+ });
523+ }
524+
525+ // Export the escaping function so that the user may override it.
526+ // See https://github.com/janl/mustache.js/issues/244
527+ exports.escape = escapeHtml;
528+
529+ function Scanner(string) {
530+ this.string = string;
531+ this.tail = string;
532+ this.pos = 0;
533+ }
534+
535+ /**
536+ * Returns `true` if the tail is empty (end of string).
537+ */
538+ Scanner.prototype.eos = function () {
539+ return this.tail === "";
540+ };
541+
542+ /**
543+ * Tries to match the given regular expression at the current position.
544+ * Returns the matched text if it can match, the empty string otherwise.
545+ */
546+ Scanner.prototype.scan = function (re) {
547+ var match = this.tail.match(re);
548+
549+ if (match && match.index === 0) {
550+ this.tail = this.tail.substring(match[0].length);
551+ this.pos += match[0].length;
552+ return match[0];
553+ }
554+
555+ return "";
556+ };
557+
558+ /**
559+ * Skips all text until the given regular expression can be matched. Returns
560+ * the skipped string, which is the entire tail if no match can be made.
561+ */
562+ Scanner.prototype.scanUntil = function (re) {
563+ var match, pos = this.tail.search(re);
564+
565+ switch (pos) {
566+ case -1:
567+ match = this.tail;
568+ this.pos += this.tail.length;
569+ this.tail = "";
570+ break;
571+ case 0:
572+ match = "";
573+ break;
574+ default:
575+ match = this.tail.substring(0, pos);
576+ this.tail = this.tail.substring(pos);
577+ this.pos += pos;
578+ }
579+
580+ return match;
581+ };
582+
583+ function Context(view, parent) {
584+ this.view = view;
585+ this.parent = parent;
586+ this.clearCache();
587+ }
588+
589+ Context.make = function (view) {
590+ return (view instanceof Context) ? view : new Context(view);
591+ };
592+
593+ Context.prototype.clearCache = function () {
594+ this._cache = {};
595+ };
596+
597+ Context.prototype.push = function (view) {
598+ return new Context(view, this);
599+ };
600+
601+ Context.prototype.lookup = function (name) {
602+ var value = this._cache[name];
603+
604+ if (!value) {
605+ if (name === ".") {
606+ value = this.view;
607+ } else {
608+ var context = this;
609+
610+ while (context) {
611+ if (name.indexOf(".") > 0) {
612+ var names = name.split("."), i = 0;
613+
614+ value = context.view;
615+
616+ while (value && i < names.length) {
617+ value = value[names[i++]];
618+ }
619+ } else {
620+ value = context.view[name];
621+ }
622+
623+ if (value != null) {
624+ break;
625+ }
626+
627+ context = context.parent;
628+ }
629+ }
630+
631+ this._cache[name] = value;
632+ }
633+
634+ if (typeof value === "function") {
635+ value = value.call(this.view);
636+ }
637+
638+ return value;
639+ };
640+
641+ function Writer() {
642+ this.clearCache();
643+ }
644+
645+ Writer.prototype.clearCache = function () {
646+ this._cache = {};
647+ this._partialCache = {};
648+ };
649+
650+ Writer.prototype.compile = function (template, tags) {
651+ var fn = this._cache[template];
652+
653+ if (!fn) {
654+ var tokens = exports.parse(template, tags);
655+ fn = this._cache[template] = this.compileTokens(tokens, template);
656+ }
657+
658+ return fn;
659+ };
660+
661+ Writer.prototype.compilePartial = function (name, template, tags) {
662+ var fn = this.compile(template, tags);
663+ this._partialCache[name] = fn;
664+ return fn;
665+ };
666+
667+ Writer.prototype.compileTokens = function (tokens, template) {
668+ var fn = compileTokens(tokens);
669+ var self = this;
670+
671+ return function (view, partials) {
672+ if (partials) {
673+ if (typeof partials === "function") {
674+ self._loadPartial = partials;
675+ } else {
676+ for (var name in partials) {
677+ self.compilePartial(name, partials[name]);
678+ }
679+ }
680+ }
681+
682+ return fn(self, Context.make(view), template);
683+ };
684+ };
685+
686+ Writer.prototype.render = function (template, view, partials) {
687+ return this.compile(template)(view, partials);
688+ };
689+
690+ Writer.prototype._section = function (name, context, text, callback) {
691+ var value = context.lookup(name);
692+
693+ switch (typeof value) {
694+ case "object":
695+ if (isArray(value)) {
696+ var buffer = "";
697+
698+ for (var i = 0, len = value.length; i < len; ++i) {
699+ buffer += callback(this, context.push(value[i]));
700+ }
701+
702+ return buffer;
703+ }
704+
705+ return value ? callback(this, context.push(value)) : "";
706+ case "function":
707+ var self = this;
708+ var scopedRender = function (template) {
709+ return self.render(template, context);
710+ };
711+
712+ var result = value.call(context.view, text, scopedRender);
713+ return result != null ? result : "";
714+ default:
715+ if (value) {
716+ return callback(this, context);
717+ }
718+ }
719+
720+ return "";
721+ };
722+
723+ Writer.prototype._inverted = function (name, context, callback) {
724+ var value = context.lookup(name);
725+
726+ // Use JavaScript's definition of falsy. Include empty arrays.
727+ // See https://github.com/janl/mustache.js/issues/186
728+ if (!value || (isArray(value) && value.length === 0)) {
729+ return callback(this, context);
730+ }
731+
732+ return "";
733+ };
734+
735+ Writer.prototype._partial = function (name, context) {
736+ if (!(name in this._partialCache) && this._loadPartial) {
737+ this.compilePartial(name, this._loadPartial(name));
738+ }
739+
740+ var fn = this._partialCache[name];
741+
742+ return fn ? fn(context) : "";
743+ };
744+
745+ Writer.prototype._name = function (name, context) {
746+ var value = context.lookup(name);
747+
748+ if (typeof value === "function") {
749+ value = value.call(context.view);
750+ }
751+
752+ return (value == null) ? "" : String(value);
753+ };
754+
755+ Writer.prototype._escaped = function (name, context) {
756+ return exports.escape(this._name(name, context));
757+ };
758+
759+ /**
760+ * Low-level function that compiles the given `tokens` into a function
761+ * that accepts three arguments: a Writer, a Context, and the template.
762+ */
763+ function compileTokens(tokens) {
764+ var subRenders = {};
765+
766+ function subRender(i, tokens, template) {
767+ if (!subRenders[i]) {
768+ var fn = compileTokens(tokens);
769+ subRenders[i] = function (writer, context) {
770+ return fn(writer, context, template);
771+ };
772+ }
773+
774+ return subRenders[i];
775+ }
776+
777+ return function (writer, context, template) {
778+ var buffer = "";
779+ var token, sectionText;
780+
781+ for (var i = 0, len = tokens.length; i < len; ++i) {
782+ token = tokens[i];
783+
784+ switch (token[0]) {
785+ case "#":
786+ sectionText = template.slice(token[3], token[5]);
787+ buffer += writer._section(token[1], context, sectionText, subRender(i, token[4], template));
788+ break;
789+ case "^":
790+ buffer += writer._inverted(token[1], context, subRender(i, token[4], template));
791+ break;
792+ case ">":
793+ buffer += writer._partial(token[1], context);
794+ break;
795+ case "&":
796+ buffer += writer._name(token[1], context);
797+ break;
798+ case "name":
799+ buffer += writer._escaped(token[1], context);
800+ break;
801+ case "text":
802+ buffer += token[1];
803+ break;
804+ }
805+ }
806+
807+ return buffer;
808+ };
809+ }
810+
811+ /**
812+ * Forms the given array of `tokens` into a nested tree structure where
813+ * tokens that represent a section have two additional items: 1) an array of
814+ * all tokens that appear in that section and 2) the index in the original
815+ * template that represents the end of that section.
816+ */
817+ function nestTokens(tokens) {
818+ var tree = [];
819+ var collector = tree;
820+ var sections = [];
821+
822+ var token;
823+ for (var i = 0, len = tokens.length; i < len; ++i) {
824+ token = tokens[i];
825+ switch (token[0]) {
826+ case '#':
827+ case '^':
828+ sections.push(token);
829+ collector.push(token);
830+ collector = token[4] = [];
831+ break;
832+ case '/':
833+ var section = sections.pop();
834+ section[5] = token[2];
835+ collector = sections.length > 0 ? sections[sections.length - 1][4] : tree;
836+ break;
837+ default:
838+ collector.push(token);
839+ }
840+ }
841+
842+ return tree;
843+ }
844+
845+ /**
846+ * Combines the values of consecutive text tokens in the given `tokens` array
847+ * to a single token.
848+ */
849+ function squashTokens(tokens) {
850+ var squashedTokens = [];
851+
852+ var token, lastToken;
853+ for (var i = 0, len = tokens.length; i < len; ++i) {
854+ token = tokens[i];
855+ if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {
856+ lastToken[1] += token[1];
857+ lastToken[3] = token[3];
858+ } else {
859+ lastToken = token;
860+ squashedTokens.push(token);
861+ }
862+ }
863+
864+ return squashedTokens;
865+ }
866+
867+ function escapeTags(tags) {
868+ return [
869+ new RegExp(escapeRe(tags[0]) + "\\s*"),
870+ new RegExp("\\s*" + escapeRe(tags[1]))
871+ ];
872+ }
873+
874+ /**
875+ * Breaks up the given `template` string into a tree of token objects. If
876+ * `tags` is given here it must be an array with two string values: the
877+ * opening and closing tags used in the template (e.g. ["<%", "%>"]). Of
878+ * course, the default is to use mustaches (i.e. Mustache.tags).
879+ */
880+ exports.parse = function (template, tags) {
881+ template = template || '';
882+ tags = tags || exports.tags;
883+
884+ if (typeof tags === 'string') tags = tags.split(spaceRe);
885+ if (tags.length !== 2) {
886+ throw new Error('Invalid tags: ' + tags.join(', '));
887+ }
888+
889+ var tagRes = escapeTags(tags);
890+ var scanner = new Scanner(template);
891+
892+ var sections = []; // Stack to hold section tokens
893+ var tokens = []; // Buffer to hold the tokens
894+ var spaces = []; // Indices of whitespace tokens on the current line
895+ var hasTag = false; // Is there a {{tag}} on the current line?
896+ var nonSpace = false; // Is there a non-space char on the current line?
897+
898+ // Strips all whitespace tokens array for the current line
899+ // if there was a {{#tag}} on it and otherwise only space.
900+ function stripSpace() {
901+ if (hasTag && !nonSpace) {
902+ while (spaces.length) {
903+ tokens.splice(spaces.pop(), 1);
904+ }
905+ } else {
906+ spaces = [];
907+ }
908+
909+ hasTag = false;
910+ nonSpace = false;
911+ }
912+
913+ var start, type, value, chr;
914+ while (!scanner.eos()) {
915+ start = scanner.pos;
916+ value = scanner.scanUntil(tagRes[0]);
917+
918+ if (value) {
919+ for (var i = 0, len = value.length; i < len; ++i) {
920+ chr = value.charAt(i);
921+
922+ if (isWhitespace(chr)) {
923+ spaces.push(tokens.length);
924+ } else {
925+ nonSpace = true;
926+ }
927+
928+ tokens.push(["text", chr, start, start + 1]);
929+ start += 1;
930+
931+ if (chr === "\n") {
932+ stripSpace(); // Check for whitespace on the current line.
933+ }
934+ }
935+ }
936+
937+ start = scanner.pos;
938+
939+ // Match the opening tag.
940+ if (!scanner.scan(tagRes[0])) {
941+ break;
942+ }
943+
944+ hasTag = true;
945+ type = scanner.scan(tagRe) || "name";
946+
947+ // Skip any whitespace between tag and value.
948+ scanner.scan(whiteRe);
949+
950+ // Extract the tag value.
951+ if (type === "=") {
952+ value = scanner.scanUntil(eqRe);
953+ scanner.scan(eqRe);
954+ scanner.scanUntil(tagRes[1]);
955+ } else if (type === "{") {
956+ var closeRe = new RegExp("\\s*" + escapeRe("}" + tags[1]));
957+ value = scanner.scanUntil(closeRe);
958+ scanner.scan(curlyRe);
959+ scanner.scanUntil(tagRes[1]);
960+ type = "&";
961+ } else {
962+ value = scanner.scanUntil(tagRes[1]);
963+ }
964+
965+ // Match the closing tag.
966+ if (!scanner.scan(tagRes[1])) {
967+ throw new Error('Unclosed tag at ' + scanner.pos);
968+ }
969+
970+ // Check section nesting.
971+ if (type === '/') {
972+ if (sections.length === 0) {
973+ throw new Error('Unopened section "' + value + '" at ' + start);
974+ }
975+
976+ var section = sections.pop();
977+
978+ if (section[1] !== value) {
979+ throw new Error('Unclosed section "' + section[1] + '" at ' + start);
980+ }
981+ }
982+
983+ var token = [type, value, start, scanner.pos];
984+ tokens.push(token);
985+
986+ if (type === '#' || type === '^') {
987+ sections.push(token);
988+ } else if (type === "name" || type === "{" || type === "&") {
989+ nonSpace = true;
990+ } else if (type === "=") {
991+ // Set the tags for the next time around.
992+ tags = value.split(spaceRe);
993+
994+ if (tags.length !== 2) {
995+ throw new Error('Invalid tags at ' + start + ': ' + tags.join(', '));
996+ }
997+
998+ tagRes = escapeTags(tags);
999+ }
1000+ }
1001+
1002+ // Make sure there are no open sections when we're done.
1003+ var section = sections.pop();
1004+ if (section) {
1005+ throw new Error('Unclosed section "' + section[1] + '" at ' + scanner.pos);
1006+ }
1007+
1008+ return nestTokens(squashTokens(tokens));
1009+ };
1010+
1011+ // The high-level clearCache, compile, compilePartial, and render functions
1012+ // use this default writer.
1013+ var _writer = new Writer();
1014+
1015+ /**
1016+ * Clears all cached templates and partials in the default writer.
1017+ */
1018+ exports.clearCache = function () {
1019+ return _writer.clearCache();
1020+ };
1021+
1022+ /**
1023+ * Compiles the given `template` to a reusable function using the default
1024+ * writer.
1025+ */
1026+ exports.compile = function (template, tags) {
1027+ return _writer.compile(template, tags);
1028+ };
1029+
1030+ /**
1031+ * Compiles the partial with the given `name` and `template` to a reusable
1032+ * function using the default writer.
1033+ */
1034+ exports.compilePartial = function (name, template, tags) {
1035+ return _writer.compilePartial(name, template, tags);
1036+ };
1037+
1038+ /**
1039+ * Compiles the given array of tokens (the output of a parse) to a reusable
1040+ * function using the default writer.
1041+ */
1042+ exports.compileTokens = function (tokens, template) {
1043+ return _writer.compileTokens(tokens, template);
1044+ };
1045+
1046+ /**
1047+ * Renders the `template` with the given `view` and `partials` using the
1048+ * default writer.
1049+ */
1050+ exports.render = function (template, view, partials) {
1051+ return _writer.render(template, view, partials);
1052+ };
1053+
1054+ // This is here for backwards compatibility with 0.4.x.
1055+ exports.to_html = function (template, view, partials, send) {
1056+ var result = exports.render(template, view, partials);
1057+
1058+ if (typeof send === "function") {
1059+ send(result);
1060+ } else {
1061+ return result;
1062+ }
1063+ };
1064+
1065+ return exports;
1066+
1067+}())));