diff --git a/package.json b/package.json index aa3c9e4..4ae9238 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "license": "AGPL-3.0-or-later", "dependencies": { "@fortawesome/fontawesome-free": "^5.13.0", - "@webrecorder/wabac": "^2.2.1", + "@webrecorder/wabac": "^2.2.2", "bulma": "^0.9.0", "fetch-ndjson": "^1.1.0", "flexsearch": "^0.6.32", diff --git a/src/chooser.js b/src/chooser.js index 1d3a0e0..d5583da 100644 --- a/src/chooser.js +++ b/src/chooser.js @@ -33,6 +33,10 @@ class Chooser extends LitElement } async onChooseNativeFile() { + if (!this.hasNativeFS) { + return; + } + const options = { types: [ { diff --git a/src/coll.js b/src/coll.js index 98c5c46..fa35d47 100644 --- a/src/coll.js +++ b/src/coll.js @@ -824,13 +824,11 @@ class Coll extends LitElement - -
Skipped
`; } - dragStart(event) { + dragStart() { const replay = this.renderRoot.querySelector("wr-coll-replay"); if (replay) { replay.setDisablePointer(true); diff --git a/sw.js b/sw.js index a5cbc9c..f47d98d 100644 --- a/sw.js +++ b/sw.js @@ -1,12 +1,12 @@ /*! 'sw.js is part of ReplayWeb.page (https://replayweb.page) Copyright (C) 2020, Webrecorder Software. Licensed under the Affero General Public License v3.' */ -!function(t,e){for(var r in e)t[r]=e[r]}(self,function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=209)}([function(t,e,r){"use strict";r.d(e,"o",(function(){return s})),r.d(e,"e",(function(){return o})),r.d(e,"h",(function(){return a})),r.d(e,"i",(function(){return u})),r.d(e,"p",(function(){return h})),r.d(e,"g",(function(){return c})),r.d(e,"f",(function(){return l})),r.d(e,"k",(function(){return p})),r.d(e,"l",(function(){return d})),r.d(e,"m",(function(){return w})),r.d(e,"j",(function(){return m})),r.d(e,"n",(function(){return E})),r.d(e,"b",(function(){return y})),r.d(e,"a",(function(){return _})),r.d(e,"c",(function(){return b})),r.d(e,"d",(function(){return n}));var i=r(18);const n=25e6;function s(t,e){for(const r of e)if(t.startsWith(r))return!0;return!1}function o(t,e){for(const r of e)if(t.indexOf(r)>=0)return!0;return!1}function a(t){return t.replace(/[-:T]/g,"").slice(0,14)}function u(t){return t.replace(/[-:.TZ]/g,"")}function h(t){if(!t)return new Date;t.length<17&&(t+="00000101000000000".substr(t.length));const e=t.substring(0,4)+"-"+t.substring(4,6)+"-"+t.substring(6,8)+"T"+t.substring(8,10)+":"+t.substring(10,12)+":"+t.substring(12,14)+"."+t.substring(14)+"Z";return new Date(e)}function c(t){if(!t)return"";try{return""+parseInt(t.getTime()/1e3)}catch(t){return""}}async function l(t,e){const r="string"==typeof t?(new TextEncoder).encode(t):t;return e+":"+function(t){return Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}(await crypto.subtle.digest(e,r))}function d(t){try{return new Headers(t)}catch(e){for(let e of Object.keys(t)){const r=t[e],i=r.replace(/[\r\n]+/g,", ");r!=i&&(t[e]=i)}return new Headers(t)}}const f=[101,204,205,304];function p(t){return f.includes(t)}function m(t){return"XMLHttpRequest"===t.headers.get("X-Pywb-Requested-With")}function w(t,e,r=404){let n,s;e||(e="Sorry, this url was not found in the archive."),"script"===t.destination||t.headers.get("x-pywb-requested-with")?(n=JSON.stringify(e),s="application/json"):(n=e,s="text/html");const o={status:r,statusText:Object(i.getStatusText)(r),headers:{"Content-Type":s}};return new Response(n,o)}class g{constructor(t={}){this.info=t}}class y extends g{}class _ extends g{}class b{}function E(t){return new Promise(e=>setTimeout(e,t))}},function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a})),r.d(e,"d",(function(){return b})),r.d(e,"f",(function(){return x})),r.d(e,"e",(function(){return _})),r.d(e,"c",(function(){return k}));var i=r(56);const n=new TextDecoder("utf-8");class s extends i.Inflate{constructor(t,e){super(t),this.reader=e}onEnd(t){this.err=t,this.err||(this.reader._rawOffset+=this.strm.total_in)}}class o{static concatChunks(t,e){if(1===t.length)return t[0];const r=new Uint8Array(e);let i=0;for(const e of t)r.set(e,i),i+=e.byteLength;return r}static splitChunk(t,e){return[t.slice(0,e),t.slice(e)]}static async readFully(t){const e=[];let r=0;for await(const i of t)e.push(i),r+=i.byteLength;return o.concatChunks(e,r)}getReadableStream(){const t=this[Symbol.asyncIterator]();return new ReadableStream({pull:e=>t.next().then(t=>{t.done||!t.value?e.close():e.enqueue(t.value)})})}readFully(){return o.readFully(this)}async readline(t=0){const e=await this.readlineRaw(t);return e?n.decode(e):""}async*iterLines(t=0){let e=null;for(;e=await this.readline(t);)yield e}}class a extends o{constructor(t,e="gzip",r=!1){if(super(),this.compressed=e,this.opts={raw:"deflateRaw"===e},this.inflator=e?new s(this.opts,this):null,"function"!=typeof t[Symbol.asyncIterator])if("function"==typeof t.getReader)t=a.fromReadable(t.getReader());else if("function"==typeof t.read)t=a.fromReadable(t);else{if("function"!=typeof t[Symbol.iterator])throw new TypeError("Invalid Stream Source");t=a.fromIter(t)}this._sourceIter=r?this.dechunk(t):t[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){const t=await this._sourceIter.next();return t.done?null:t.value}async*dechunk(t){const e=t instanceof a?t:new a(t,null);let r=-1,i=!0;for(;0!=r;){const t=await e.readlineRaw(64);let s=null;if(r=parseInt(n.decode(t),16),!r||r>2**32){if(Number.isNaN(r)||r>2**32){i||(this.errored=!0),yield t;break}}else if(s=await e.readSize(r),s.length!=r){i?yield t:this.errored=!0,yield s;break}const o=await e.readSize(2);if(13!=o[0]||10!=o[1]){i?yield t:this.errored=!0,yield s,yield o;break}if(i=!1,!s||0===r)return;yield s}yield*e}_unread(t){t.length&&(this._readOffset-=t.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=t)}async _next(){if(this._savedChunk){const t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){const t=this._getNextChunk();if(t)return t}let t=await this._loadNext();for(;this.compressed&&t;){this._push(t);const e=this._getNextChunk(t);if(e)return e;t=await this._loadNext()}return t}_push(t){this.lastValue=t,this.inflator.ended&&(this.inflator=new s(this.opts,this)),this.inflator.push(t),this.inflator.err&&this.inflator.ended&&"deflate"===this.compressed&&!1===this.opts.raw&&0===this.numChunks&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new s(this.opts,this),this.inflator.push(t))}_getNextChunk(t){for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(0!==this.inflator.err)return this.compressed=null,t;const e=this.inflator.strm.avail_in;if(e&&this.lastValue){this._push(this.lastValue.slice(-e));continue}}return null}}async*[Symbol.asyncIterator](){let t=null;for(;t=await this._next();)this._readOffset+=t.length,yield t}async readlineRaw(t){const e=[];let r,i=0,n=null;for await(const s of this){if(t&&i+s.byteLength>t){n=s,r=t-i-1;const e=s.slice(0,r+1).indexOf(10);e>=0&&(r=e);break}if(r=s.indexOf(10),r>=0){n=s;break}e.push(s),i+=s.byteLength}if(n){const[t,s]=a.splitChunk(n,r+1);e.push(t),i+=t.byteLength,this._unread(s)}else if(!e.length)return null;return a.concatChunks(e,i)}readFully(){return this.readSize()}async readSize(t=-1,e=!1){const r=[];let i=0;for await(const n of this){if(t>=0){if(n.length>t){const[s,o]=a.splitChunk(n,t);e||r.push(s),i+=s.byteLength,this._unread(o);break}if(n.length===t){e||r.push(n),i+=n.byteLength,t=0;break}t-=n.length}e||r.push(n),i+=n.byteLength}return e?i:a.concatChunks(r,i)}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(t){return this.compressed?this.inflator.strm.total_in:this._readOffset-t}static fromReadable(t){return{async*[Symbol.asyncIterator](){let e=null;for(;(e=await t.read())&&!e.done;)yield e.value}}}static fromIter(t){return{async*[Symbol.asyncIterator](){for(const e of t)yield e}}}}class u extends o{constructor(t,e,r=0){super(),this.sourceIter=t,this.length=e,this.limit=e,this.skip=r}setLimitSkip(t,e=0){this.limit=t,this.skip=e}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let t of this.sourceIter){if(this.skip>0){if(!(t.length>=this.skip)){this.skip-=t.length;continue}{const[e,r]=u.splitChunk(t,this.skip);t=r,this.skip=0}}if(t.length>this.limit){const[e,r]=u.splitChunk(t,this.limit);t=e,this.sourceIter._unread(r)}if(t.length&&(this.limit-=t.length,yield t),this.limit<=0)break}}async readlineRaw(t){if(this.limit<=0)return null;const e=await this.sourceIter.readlineRaw(t?Math.min(t,this.limit):this.limit);return this.limit-=e.length,e}async skipFully(){const t=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.readSize(this.limit,!0);return t}}const h=new Uint8Array([13,10]),c=new Uint8Array([13,10,13,10]);class l{constructor({statusline:t,headers:e}){this.statusline=t,this.headers=e}toString(){const t=[this.statusline];for(const[e,r]of this.headers)t.push(`${e}: ${r}`);return t.join("\r\n")+"\r\n"}async*iterSerialize(t){yield t.encode(this.statusline),yield h;for(const[e,r]of this.headers)yield t.encode(`${e}: ${r}\r\n`)}_parseResponseStatusLine(){const t=f(this.statusline," ",2);this._protocol=t[0],this._statusCode=t.length>1?Number(t[1]):"",this._statusText=t.length>2?t[2]:""}get statusCode(){return void 0===this._statusCode&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return void 0===this._protocol&&this._parseResponseStatusLine(),this._protocol}get statusText(){return void 0===this._statusText&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){const t=this.statusline.split(" ",2);this._method=t[0],this._requestPath=t.length>1?t[1]:""}get method(){return void 0===this._method&&this._parseRequestStatusLine(),this._method}get requestPath(){return void 0===this._requestPath&&this._parseRequestStatusLine(),this._requestPath}}class d{startsWithSpace(t){const e=t.charAt(0);return" "===e||"\t"===e}async parse(t,{headersClass:e=Map}={}){const r=await t.readline();if(!r)return null;let i=r.trimEnd();const n=new e;if(!i)return null;let s=(await t.readline()).trimEnd();for(;s;){let[e,r]=f(s,":",1);r&&(e=e.trimStart(),r=r.trim());let i=(await t.readline()).trimEnd();for(;this.startsWithSpace(i);)r&&(r+=i),i=(await t.readline()).trimEnd();if(r)try{n.set(e,r)}catch(t){}s=i}return new l({statusline:i,headers:n,totalRead:this.totalRead})}}function f(t,e,r){const i=t.split(e),n=i.slice(0,r);return i.slice(r).length>0&&n.push(i.slice(r).join(e)),n}var p=r(113),m=r.n(p);const w=new TextDecoder("utf-8"),g=new TextEncoder("utf-8"),y={warcinfo:"application/warc-fields",response:"application/http; msgtype=response",revisit:"application/http; msgtype=response",request:"application/http; msgtype=request",metadata:"application/warc-fields"};class _ extends o{static create({url:t,date:e,type:r,warcHeaders:i={},filename:n="",httpHeaders:s={},statusline:o="HTTP/1.1 200 OK",warcVersion:a="WARC/1.0",keepHeadersCase:u=!0,refersToUrl:h,refersToDate:c}={},d){function f(t){return"WARC/1.0"===a&&"Z"!=(t=t.split(".")[0]).charAt(e.length-1)&&(t+="Z"),t}if(e||(e=(new Date).toISOString()),e=f(e),i={...i},"warcinfo"===r?n&&(i["WARC-Filename"]=n):i["WARC-Target-URI"]=t,i["WARC-Date"]=e,i["WARC-Type"]=r,"revisit"===r&&(i["WARC-Profile"]="WARC/1.1"===a?"http://netpreserve.org/warc/1.1/revisit/identical-payload-digest":"http://netpreserve.org/warc/1.0/revisit/identical-payload-digest",i["WARC-Refers-To-Target-URI"]=h,i["WARC-Refers-To-Date"]=f(c)),(i=new l({statusline:a,headers:u?new Map(Object.entries(i)):new Headers(i)})).headers.get("WARC-Record-ID")||i.headers.set("WARC-Record-ID",`>>2),c[l++]=255&(r<<6|i<<1|n>>>4),c[l++]=255&(n<<4|s>>>1),c[l++]=255&(s<<7|o<<2|a>>>3),c[l++]=255&(a<<5|u);var m=d-p;return 2===m?(e=h[t.charAt(f++)],r=h[t.charAt(f++)],c[l++]=255&(e<<3|r>>>2)):4===m?(e=h[t.charAt(f++)],r=h[t.charAt(f++)],i=h[t.charAt(f++)],n=h[t.charAt(f++)],c[l++]=255&(e<<3|r>>>2),c[l++]=255&(r<<6|i<<1|n>>>4)):5===m?(e=h[t.charAt(f++)],r=h[t.charAt(f++)],i=h[t.charAt(f++)],n=h[t.charAt(f++)],s=h[t.charAt(f++)],c[l++]=255&(e<<3|r>>>2),c[l++]=255&(r<<6|i<<1|n>>>4),c[l++]=255&(n<<4|s>>>1)):7===m&&(e=h[t.charAt(f++)],r=h[t.charAt(f++)],i=h[t.charAt(f++)],n=h[t.charAt(f++)],s=h[t.charAt(f++)],o=h[t.charAt(f++)],a=h[t.charAt(f++)],c[l++]=255&(e<<3|r>>>2),c[l++]=255&(r<<6|i<<1|n>>>4),c[l++]=255&(n<<4|s>>>1),c[l++]=255&(s<<7|o<<2|a>>>3)),c},f=function(t,e){if(!e)return function(t){for(var e,r,i="",n=t.length,s=0,o=0;s >6,c[a++]=128|63&o):o<55296||o>=57344?(c[a++]=224|o>>12,c[a++]=128|o>>6&63,c[a++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++d)),c[a++]=240|o>>18,c[a++]=128|o>>12&63,c[a++]=128|o>>6&63,c[a++]=128|63&o);a-f,f=a-5,d===p&&++d,d>p&&a<6&&(h=!0),e=c[0],a>4?(r=c[1],i=c[2],n=c[3],s=c[4],l+=u[e>>>3]+u[31&(e<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|i>>>4)]+u[31&(i<<1|n>>>7)]+u[n>>>2&31]+u[31&(n<<3|s>>>5)]+u[31&s]):1===a?l+=u[e>>>3]+u[e<<2&31]+"======":2===a?(r=c[1],l+=u[e>>>3]+u[31&(e<<2|r>>>6)]+u[r>>>1&31]+u[r<<4&31]+"===="):3===a?(r=c[1],i=c[2],l+=u[e>>>3]+u[31&(e<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|i>>>4)]+u[i<<1&31]+"==="):(r=c[1],i=c[2],n=c[3],l+=u[e>>>3]+u[31&(e<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|i>>>4)]+u[31&(i<<1|n>>>7)]+u[n>>>2&31]+u[n<<3&31]+"=")}while(!h);return l}(t)},decode:f};f.asBytes=d,o?t.exports=p:(s.base32=p,a&&(void 0===(n=function(){return p}.call(p,r,p,t))||(t.exports=n)))}()}).call(this,r(13),r(5))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(168);var i=/\\(u\{([0-9A-Fa-f]+)\}|u([0-9A-Fa-f]{4})|x([0-9A-Fa-f]{2})|([1-7][0-7]{0,2}|[0-7]{2,3})|(['"tbrnfv0\\]))|\\U([0-9A-Fa-f]{8})/g,n={0:"\0",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v","'":"'",'"':'"',"\\":"\\"},s=function(t){return String.fromCodePoint(parseInt(t,16))};e.default=function(t){return t.replace(i,(function(t,e,r,i,o,a,u,h){return void 0!==r?s(r):void 0!==i?s(i):void 0!==o?s(o):void 0!==a?(c=a,String.fromCodePoint(parseInt(c,8))):void 0!==h?s(h):n[u];var c}))},t.exports=e.default},function(t,e,r){"use strict";t.exports=function(){function t(t,e,r,i,n){return t u&&0!=--n);return o<=t.lookahead?o:t.lookahead}function E(t){var e,r,i,s,u,h,c,d,f,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-l)){for(n.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;i=t.head[--e],t.head[e]=m<=i?i-m:0,--r;);for(e=r=m;i=t.prev[--e],t.prev[e]=m<=i?i-m:0,--r;);s+=m}if(0===t.strm.avail_in)break;if(h=t.strm,c=t.window,d=t.strstart+t.lookahead,p=void 0,(f=s)<(p=h.avail_in)&&(p=f),r=0===p?0:(h.avail_in-=p,n.arraySet(c,h.input,h.next_in,p,d),1===h.state.wrap?h.adler=o(h.adler,c,p,d):2===h.state.wrap&&(h.adler=a(h.adler,c,p,d)),h.next_in+=p,h.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<