filer/dist/idbfs.min.js

3 lines
48 KiB
JavaScript
Raw Normal View History

2013-07-26 16:07:45 +00:00
/*! idbfs 2013-07-26 */
(function(n,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):n.IDBFS||(n.IDBFS=t())})(this,function(){var n,t,e;(function(r){function o(n,t){return _.call(n,t)}function i(n,t){var e,r,o,i,a,c,s,u,l,f,p=t&&t.split("/"),h=m.map,d=h&&h["*"]||{};if(n&&"."===n.charAt(0))if(t){for(p=p.slice(0,p.length-1),n=p.concat(n.split("/")),u=0;n.length>u;u+=1)if(f=n[u],"."===f)n.splice(u,1),u-=1;else if(".."===f){if(1===u&&(".."===n[2]||".."===n[0]))break;u>0&&(n.splice(u-1,2),u-=2)}n=n.join("/")}else 0===n.indexOf("./")&&(n=n.substring(2));if((p||d)&&h){for(e=n.split("/"),u=e.length;u>0;u-=1){if(r=e.slice(0,u).join("/"),p)for(l=p.length;l>0;l-=1)if(o=h[p.slice(0,l).join("/")],o&&(o=o[r])){i=o,a=u;break}if(i)break;!c&&d&&d[r]&&(c=d[r],s=u)}!i&&c&&(i=c,a=s),i&&(e.splice(0,a,i),n=e.join("/"))}return n}function a(n,t){return function(){return h.apply(r,x.call(arguments,0).concat([n,t]))}}function c(n){return function(t){return i(t,n)}}function s(n){return function(t){g[n]=t}}function u(n){if(o(y,n)){var t=y[n];delete y[n],b[n]=!0,p.apply(r,t)}if(!o(g,n)&&!o(b,n))throw Error("No "+n);return g[n]}function l(n){var t,e=n?n.indexOf("!"):-1;return e>-1&&(t=n.substring(0,e),n=n.substring(e+1,n.length)),[t,n]}function f(n){return function(){return m&&m.config&&m.config[n]||{}}}var p,h,d,v,g={},y={},m={},b={},_=Object.prototype.hasOwnProperty,x=[].slice;d=function(n,t){var e,r=l(n),o=r[0];return n=r[1],o&&(o=i(o,t),e=u(o)),o?n=e&&e.normalize?e.normalize(n,c(t)):i(n,t):(n=i(n,t),r=l(n),o=r[0],n=r[1],o&&(e=u(o))),{f:o?o+"!"+n:n,n:n,pr:o,p:e}},v={require:function(n){return a(n)},exports:function(n){var t=g[n];return t!==void 0?t:g[n]={}},module:function(n){return{id:n,uri:"",exports:g[n],config:f(n)}}},p=function(n,t,e,i){var c,l,f,p,h,m,_=[];if(i=i||n,"function"==typeof e){for(t=!t.length&&e.length?["require","exports","module"]:t,h=0;t.length>h;h+=1)if(p=d(t[h],i),l=p.f,"require"===l)_[h]=v.require(n);else if("exports"===l)_[h]=v.exports(n),m=!0;else if("module"===l)c=_[h]=v.module(n);else if(o(g,l)||o(y,l)||o(b,l))_[h]=u(l);else{if(!p.p)throw Error(n+" missing "+l);p.p.load(p.n,a(i,!0),s(l),{}),_[h]=g[l]}f=e.apply(g[n],_),n&&(c&&c.exports!==r&&c.exports!==g[n]?g[n]=c.exports:f===r&&m||(g[n]=f))}else n&&(g[n]=e)},n=t=h=function(n,t,e,o,i){return"string"==typeof n?v[n]?v[n](t):u(d(n,t).f):(n.splice||(m=n,t.splice?(n=t,t=e,e=null):n=r),t=t||function(){},"function"==typeof e&&(e=o,o=i),o?p(r,n,t,e):setTimeout(function(){p(r,n,t,e)},4),h)},h.config=function(n){return m=n,m.deps&&h(m.deps,m.callback),h},e=function(n,t,e){t.splice||(e=t,t=[]),o(g,n)||o(y,n)||(y[n]=[n,t,e])},e.amd={jQuery:!0}})(),e("build/almond",function(){}),function(n,t){function r(n){return n&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,t):new r(n)}function o(n,t,e){t||(t=0);var r=n.length,o=r-t>=(e||Dt),i=o?{}:n;if(o)for(var a,c=t-1;r>++c;)a=n[c]+"",(Gt.call(i,a)?i[a]:i[a]=[]).push(n[c]);return function(n){if(o){var e=n+"";return Gt.call(i,e)&&C(i[e],n)>-1}return C(i,n,t)>-1}}function i(n,e){var r=n.index,o=e.index;if(n=n.criteria,e=e.criteria,n!==e){if(n>e||n===t)return 1;if(e>n||e===t)return-1}return o>r?-1:1}function a(n,t,e){function r(){var c=arguments,s=i?this:t;if(o||(n=t[a]),e.length&&(c=c.length?e.concat(Jt.call(c)):e),this instanceof r){f.prototype=n.prototype,s=new f;var u=n.apply(s,c);return u&&Le[typeof u]?u:s}return n.apply(s,c)}var o=d(n),i=!e,a=n;return i&&(e=t),r}function c(n,e){return n?"function"!=typeof n?function(t){return t[n]}:e!==t?function(t,r,o){return n.call(e,t,r,o)}:n:pt}function s(){for(var n=-1,t=arguments.length,e={bottom:"",hasDontEnumBug:It,isKeysFast:Ae,noArgsEnum:be,noCharByIndex:Ee,shadowed:Yt,top:"",useHas:!0,useStrict:Oe,arrayBranch:{},objectBranch:{}};t>++n;){var r=arguments[n];for(var o in r){var a=r[o];/beforeLoop|inLoop/.test(o)?("string"==typeof a&&(a={array:a,object:a}),e.arrayBranch[o]=a.array,e.objectBranch[o]=a.object):e[o]=a}}var s=e.args,u=/^[^,]+/.exec(s)[0],l=e.init;e.firstArg=u,e.init=null==l?u:l,"collection"==u&&e.arrayBranch.inLoop||(e.arrayBranch=null);var f=Function("array
},clone:function(){var n=o.clone.call(this);return n.words=this.words.slice(0),n},random:function(t){for(var e=[],r=0;t>r;r+=4)e.push(0|4294967296*n.random());return i.create(e,t)}}),a=e.enc={},c=a.Hex={stringify:function(n){for(var t=n.words,n=n.sigBytes,e=[],r=0;n>r;r++){var o=255&t[r>>>2]>>>24-8*(r%4);e.push((o>>>4).toString(16)),e.push((15&o).toString(16))}return e.join("")},parse:function(n){for(var t=n.length,e=[],r=0;t>r;r+=2)e[r>>>3]|=parseInt(n.substr(r,2),16)<<24-4*(r%8);return i.create(e,t/2)}},s=a.Latin1={stringify:function(n){for(var t=n.words,n=n.sigBytes,e=[],r=0;n>r;r++)e.push(String.fromCharCode(255&t[r>>>2]>>>24-8*(r%4)));return e.join("")},parse:function(n){for(var t=n.length,e=[],r=0;t>r;r++)e[r>>>2]|=(255&n.charCodeAt(r))<<24-8*(r%4);return i.create(e,t)}},u=a.Utf8={stringify:function(n){try{return decodeURIComponent(escape(s.stringify(n)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(n){return s.parse(unescape(encodeURIComponent(n)))}},l=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=i.create(),this._nDataBytes=0},_append:function(n){"string"==typeof n&&(n=u.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes},_process:function(t){var e=this._data,r=e.words,o=e.sigBytes,a=this.blockSize,c=o/(4*a),c=t?n.ceil(c):n.max((0|c)-this._minBufferSize,0),t=c*a,o=n.min(4*t,o);if(t){for(var s=0;t>s;s+=a)this._doProcessBlock(r,s);s=r.splice(0,t),e.sigBytes-=o}return i.create(s,o)},clone:function(){var n=o.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0});r.Hasher=l.extend({init:function(){this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(n){return this._append(n),this._process(),this},finalize:function(n){return n&&this._append(n),this._doFinalize(),this._hash},clone:function(){var n=l.clone.call(this);return n._hash=this._hash.clone(),n},blockSize:16,_createHelper:function(n){return function(t,e){return n.create(e).finalize(t)}},_createHmacHelper:function(n){return function(t,e){return f.HMAC.create(n,e).finalize(t)}}});var f=e.algo={};return e}(Math);(function(n){var t=r,e=t.lib,o=e.WordArray,e=e.Hasher,i=t.algo,a=[],c=[];(function(){function t(t){for(var e=n.sqrt(t),r=2;e>=r;r++)if(!(t%r))return!1;return!0}function e(n){return 0|4294967296*(n-(0|n))}for(var r=2,o=0;64>o;)t(r)&&(8>o&&(a[o]=e(n.pow(r,.5))),c[o]=e(n.pow(r,1/3)),o++),r++})();var s=[],i=i.SHA256=e.extend({_doReset:function(){this._hash=o.create(a.slice(0))},_doProcessBlock:function(n,t){for(var e=this._hash.words,r=e[0],o=e[1],i=e[2],a=e[3],u=e[4],l=e[5],f=e[6],p=e[7],h=0;64>h;h++){if(16>h)s[h]=0|n[t+h];else{var d=s[h-15],v=s[h-2];s[h]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+s[h-7]+((v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10)+s[h-16]}d=p+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&l^~u&f)+c[h]+s[h],v=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&o^r&i^o&i),p=f,f=l,l=u,u=0|a+d,a=i,i=o,o=r,r=0|d+v}e[0]=0|e[0]+r,e[1]=0|e[1]+o,e[2]=0|e[2]+i,e[3]=0|e[3]+a,e[4]=0|e[4]+u,e[5]=0|e[5]+l,e[6]=0|e[6]+f,e[7]=0|e[7]+p},_doFinalize:function(){var n=this._data,t=n.words,e=8*this._nDataBytes,r=8*n.sigBytes;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+15]=e,n.sigBytes=4*t.length,this._process()}});t.SHA256=e._createHelper(i),t.HmacSHA256=e._createHmacHelper(i)})(Math),e("crypto-js/rollups/sha256",function(){}),e("src/shared",["require","crypto-js/rollups/sha256"],function(n){function t(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=0|16*Math.random(),e="x"==n?t:8|3&t;return e.toString(16)}).toUpperCase()}function e(n){return i.SHA256(n).toString(i.enc.hex)}function o(){}n("crypto-js/rollups/sha256");var i=r;return{guid:t,hash:e,nop:o}}),e("src/error",["require"],function(){function n(n){this.message=n||""}function t(n){this.message=n||""}function e(n){this.message=n||""}function r(n){this.message=n||""}function o(n){this.message=n||""}function i(n){this.message=n||""}function a(n){this.message=n||""}function c(n){this.message=n||""}function s(n){this.message=n||""}function u(n){this.message=n||""}function l(n){this.message=n||""}function f(n)