diff --git a/CHANGES.md b/CHANGES.md
index 510a6e8..2ea6bb4 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,6 +2,7 @@
v1.2.1
- Loading/UI: Fix Google Drive Loading/Reauthorization: Only trigger when reauth is needed. For rate-limit errors, attempt reloading more slowly (exponential backoff)
+- Loading: ReplayWeb.page App supports opening WACZ, WARC and HAR files via double-clicking from OS and via command-line.
v1.2.0
- UI: Location bar fixes: Enter reloads same URL, Escape restores current URL, properly updated on navigation, Favicon displayed in location bar if available
diff --git a/package.json b/package.json
index adce8f9..d4368aa 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
"lit-element": "^2.3.1",
"marked": "^1.0.0",
"mime-types": "^2.1.27",
+ "minimist": "^1.2.5",
"pretty-bytes": "^5.3.0",
"register-service-worker": "^1.7.1",
"split.js": "^1.6.2"
@@ -52,7 +53,7 @@
"start-prod": "http-server -p 9990",
"pack": "CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --publish never",
"pack-signed": "electron-builder",
- "start-electron": "NODE_ENV=development electron ./dist/electron.js",
+ "start-electron": "NODE_ENV=development electron ./dist/electron.js $1",
"start-jekyll": "yarn run build-docs && bundle exec jekyll serve",
"dist": "yarn run build && yarn run pack",
"release": "yarn run build && electron-builder"
@@ -130,6 +131,12 @@
"name": "HAR File",
"description": "HAR File",
"role": "Viewer"
+ },
+ {
+ "ext": "wacz",
+ "name": "WACZ File",
+ "description": "Web Archive Collection Zipped (WACZ)",
+ "role": "Viewer"
}
]
}
diff --git a/src/appmain.js b/src/appmain.js
index 8c0d905..9657bea 100644
--- a/src/appmain.js
+++ b/src/appmain.js
@@ -374,6 +374,15 @@ class App extends LitElement
}
this.loadInfo.customColl = this.pageParams.get("customColl");
}
+
+ if (IS_APP && this.sourceUrl.startsWith("file://")) {
+ const url = new URL(__APP_FILE_SERVE_PREFIX__);
+ url.searchParams.set("filename", this.sourceUrl.slice("file://".length));
+ this.loadInfo = {
+ sourceUrl: this.sourceUrl,
+ loadUrl: url.href,
+ }
+ }
}
onStartLoad(event) {
diff --git a/src/electron-main.js b/src/electron-main.js
index 16e63dd..cf141f2 100644
--- a/src/electron-main.js
+++ b/src/electron-main.js
@@ -3,7 +3,7 @@
import fetch from 'node-fetch';
import { Headers } from 'node-fetch';
-import {app, session, BrowserWindow, ipcMain, shell} from 'electron';
+import {app, session, BrowserWindow, ipcMain, shell, dialog } from 'electron';
import path from 'path';
import fs from 'fs';
@@ -13,6 +13,7 @@ import { ArchiveResponse, Rewriter } from '@webrecorder/wabac/src/rewrite';
import { PassThrough } from 'stream';
import mime from 'mime-types';
+import { url } from 'inspector';
global.Headers = Headers;
@@ -30,55 +31,100 @@ const staticContentPath = path.join(__dirname, "../");
let pluginPath = "";
-switch (process.platform) {
- case 'win32':
- pluginPath = path.join(projPath, "plugins-win", `pepflashplayer-x86${process.arch === 'x64' ? '_64' : ''}.dll`);
- break;
-
- case 'darwin':
- pluginPath = path.join(projPath, "plugins-mac", "PepperFlashPlayer.plugin");
- break;
-
- case 'linux':
- pluginPath = path.join(projPath, "plugins-mac", "libpepflashplayer.so");
- break;
-
- default:
- console.log('platform unsupported: ' + process.platform);
- break;
-}
-
-
-console.log('app path', appPath);
-console.log('dir name', __dirname);
-console.log('proj path', projPath);
-console.log('plugin path', pluginPath);
-
-
-console.log('app data', app.getPath('appData'));
-
-app.setPath('userData', path.join(app.getPath('appData'), 'replaywebpage'));
-
-console.log('user data', app.getPath('userData'));
-
-app.commandLine.appendSwitch('ppapi-flash-path', pluginPath);
-
-
var proxyColl;
var proxyTS;
var mainWindow;
-// Single instance lock
-const gotTheLock = app.requestSingleInstanceLock();
+let openNextFile = null;
-if (!gotTheLock) {
- console.log("App already running, opening new window in first instance and quitting");
- app.quit();
-} else {
- app.on('second-instance', (event, commandLine, workingDirectory) => {
- // Just create a new window in case of second instance request
- createWindow();
+
+function main() {
+ switch (process.platform) {
+ case 'win32':
+ pluginPath = path.join(projPath, "plugins-win", `pepflashplayer-x86${process.arch === 'x64' ? '_64' : ''}.dll`);
+ break;
+
+ case 'darwin':
+ pluginPath = path.join(projPath, "plugins-mac", "PepperFlashPlayer.plugin");
+ break;
+
+ case 'linux':
+ pluginPath = path.join(projPath, "plugins-mac", "libpepflashplayer.so");
+ break;
+
+ default:
+ console.log('platform unsupported: ' + process.platform);
+ break;
+ }
+
+
+ console.log('app path', appPath);
+ console.log('dir name', __dirname);
+ console.log('proj path', projPath);
+ console.log('plugin path', pluginPath);
+
+
+ console.log('app data', app.getPath('appData'));
+
+ app.setPath('userData', path.join(app.getPath('appData'), 'replaywebpage'));
+
+ console.log('user data', app.getPath('userData'));
+
+ app.commandLine.appendSwitch('ppapi-flash-path', pluginPath);
+
+ app.on('will-finish-launching', function() {
+ app.on('open-file', function(event, filePath) {
+ openNextFile = filePath;
+ if (mainWindow) {
+ createWindow(process.argv)
+ }
+ });
+ });
+
+ // Single instance lock
+ const gotTheLock = app.requestSingleInstanceLock();
+
+ if (!gotTheLock) {
+ console.log("App already running, opening new window in first instance and quitting");
+ app.quit();
+ } else {
+ app.on('second-instance', (event, commandLine, workingDirectory) => {
+ // Just create a new window in case of second instance request
+ dialog.showErrorBox("new window", JSON.stringify(commandLine));
+ createWindow(commandLine);
+ });
+ }
+
+ app.on('web-contents-created', (event, contents) => {
+ contents.on('new-window', async (event, navigationUrl) => {
+
+ // load docs in native browser for now
+ if (navigationUrl === STATIC_PREFIX + "docs") {
+ event.preventDefault();
+ await shell.openExternal("https://replayweb.page/docs/");
+ }
+ });
+ });
+
+ app.whenReady().then(() => {
+ mainWindow = createWindow(process.argv);
+
+ app.on('activate', function () {
+ // On macOS it's common to re-create a window in the app when the
+ // dock icon is clicked and there are no other windows open.
+ if (BrowserWindow.getAllWindows().length === 0) {
+ mainWindow = createWindow();
+ }
+ })
+ })
+
+ // Quit when all windows are closed.
+ app.on('window-all-closed', function () {
+ // On macOS it is common for applications and their menu bar
+ // to stay active until the user quits explicitly with Cmd + Q
+ //if (process.platform !== 'darwin')
+ app.quit();
});
}
@@ -90,9 +136,6 @@ function bufferToStream(data) {
return rv;
}
-
-
-
async function doIntercept(request, callback) {
console.log(`${request.method} ${request.url} from ${request.referrer}`);
@@ -270,15 +313,17 @@ function parseRange(reqHeaders, headers, size) {
}
-function createWindow () {
+function createWindow(argv, secondWindow) {
const sesh = session.defaultSession;
- //sesh.protocol.interceptStreamProtocol("file", doIntercept);
- sesh.protocol.interceptStreamProtocol("http", doIntercept);
- //sesh.protocol.interceptStreamProtocol("https", doIntercept);
+ if (!secondWindow) {
+ sesh.protocol.interceptStreamProtocol("http", doIntercept);
+ }
+
+ const sourceString = getOpenUrl(argv);
// Create the browser window.
- mainWindow = new BrowserWindow({
+ const theWindow = new BrowserWindow({
width: 1024,
height: 768,
isMaximized: true,
@@ -291,66 +336,50 @@ function createWindow () {
enableRemoteModule: false
}
}).once('ready-to-show', () => {
-
- //const sesh = session.fromPartition("persist:replay");
-
- //const filter = {"urls": ['*://*/*']};
- //sesh.webRequest.onBeforeRequest(filter, (request, callback) => {
- // console.log("got onBeforeRequest");
- // callback({cancel: false});
- //});
-
- //sesh.protocol.interceptStreamProtocol("http", doIntercept);
- //sesh.protocol.interceptStreamProtocol("https", doIntercept);
-
- mainWindow.show();
- mainWindow.maximize();
+ theWindow.show();
+ theWindow.maximize();
});
- mainWindow.loadURL(STATIC_PREFIX + "index.html");
+ theWindow.loadURL(STATIC_PREFIX + "index.html" + sourceString);
if (process.env.NODE_ENV === "development") {
- mainWindow.webContents.openDevTools();
+ theWindow.webContents.openDevTools();
}
+
+ return theWindow;
}
-app.on('web-contents-created', (event, contents) => {
- contents.on('new-window', async (event, navigationUrl) => {
-
- // load docs in native browser for now
- if (navigationUrl === STATIC_PREFIX + "docs") {
- event.preventDefault();
- await shell.openExternal("https://replayweb.page/docs/");
+function getOpenUrl(argv) {
+ argv = require('minimist')(argv.slice(process.defaultApp ? 2 : 1));
+
+ const filename = openNextFile || argv.filename || argv.f || (argv._.length && argv._[0]);
+
+ let sourceString = "";
+
+ if (filename) {
+ const sourceParams = new URLSearchParams();
+ sourceParams.set("source", "file://" + filename);
+ sourceString = "?" + sourceParams.toString();
+
+ const urlParams = new URLSearchParams();
+
+ const openUrl = argv.url;
+
+ const openTS = argv.ts || argv.timestamp;
+
+ if (openUrl) {
+ urlParams.set("url", openUrl);
}
- });
-});
-// This method will be called when Electron has finished
-// initialization and is ready to create browser windows.
-// Some APIs can only be used after this event occurs.
-app.whenReady().then(() => {
- createWindow();
-
- app.on('activate', function () {
- // On macOS it's common to re-create a window in the app when the
- // dock icon is clicked and there are no other windows open.
- if (BrowserWindow.getAllWindows().length === 0) createWindow()
- })
-})
+ if (openTS) {
+ urlParams.set("ts", openTS);
+ }
-// Quit when all windows are closed.
-app.on('window-all-closed', function () {
- // On macOS it is common for applications and their menu bar
- // to stay active until the user quits explicitly with Cmd + Q
- //if (process.platform !== 'darwin')
- app.quit();
-});
+ sourceString += "#" + urlParams.toString();
-/*
-app.on('web-contents-created', (event, contents) => {
- if (contents.getType() === "webview") {
- contents.openDevTools();
- } else if (contents.getType() === "window") {
- console.log("main contents set")
- mainContents = contents;
+ console.log(`Opening Source: ${sourceString}`);
}
-});*/
+
+ return sourceString;
+}
+
+main();
diff --git a/ui.js b/ui.js
index c6682af..a6b334d 100644
--- a/ui.js
+++ b/ui.js
@@ -1,5 +1,5 @@
/*! ui.js is part of ReplayWeb.page (https://replayweb.page) Copyright (C) 2020, Webrecorder Software. Licensed under the Affero General Public License v3. */
-!function(e,t){for(var i in t)e[i]=t[i]}(self,function(e){var t={};function i(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(a,r,function(t){return e[t]}.bind(null,r));return a},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i(i.s=207)}({100:function(e,t){e.exports=''},101:function(e,t){e.exports=''},102:function(e,t){e.exports=''},103:function(e,t){e.exports=''},104:function(e,t,i){const a=i(122),r=i(124),o=i(64),n=i(65),s=i(66),l=i(67),{merge:c,checkSanitizeDeprecation:d,escape:h}=i(21),{getDefaults:f,changeDefaults:b,defaults:u}=i(20);function p(e,t,i){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(i||"function"==typeof t){i||(i=t,t=null),t=c({},p.defaults,t||{}),d(t);const o=t.highlight;let n,s,l=0;try{n=a.lex(e,t)}catch(e){return i(e)}s=n.length;const h=function(e){if(e)return t.highlight=o,i(e);let a;try{a=r.parse(n,t)}catch(t){e=t}return t.highlight=o,e?i(e):i(null,a)};if(!o||o.length<3)return h();if(delete t.highlight,!s)return h();for(;lAn error occurred:
"+h(e.message+"",!0)+"
";throw e}}p.options=p.setOptions=function(e){return c(p.defaults,e),b(p.defaults),p},p.getDefaults=f,p.defaults=u,p.use=function(e){const t=c({},e);if(e.renderer){const i=p.defaults.renderer||new n;for(const t in e.renderer){const a=i[t];i[t]=(...r)=>{let o=e.renderer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.renderer=i}if(e.tokenizer){const i=p.defaults.tokenizer||new o;for(const t in e.tokenizer){const a=i[t];i[t]=(...r)=>{let o=e.tokenizer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.tokenizer=i}p.setOptions(t)},p.Parser=r,p.parser=r.parse,p.Renderer=n,p.TextRenderer=s,p.Lexer=a,p.lexer=a.lex,p.Tokenizer=o,p.Slugger=l,p.parse=p,e.exports=p},105:function(e,t){e.exports=''},106:function(e,t,i){"use strict";var a=this&&this.__await||function(e){return this instanceof a?(this.v=e,this):new a(e)},r=this&&this.__asyncGenerator||function(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=i.apply(e,t||[]),n=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(i,a){n.push([e,t,i,a])>1||l(e,t)}))})}function l(e,t){try{(i=o[e](t)).value instanceof a?Promise.resolve(i.value.v).then(c,d):h(n[0][2],i)}catch(e){h(n[0][3],e)}var i}function c(e){l("next",e)}function d(e){l("throw",e)}function h(e,t){e(t),n.shift(),n.length&&l(n[0][0],n[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return r(this,arguments,(function*(){const t=/\r?\n/,i=new TextDecoder;let r="",o=e.read();for(;;){const{done:n,value:s}=yield a(o);if(n)return r.length>0&&(yield yield a(JSON.parse(r))),yield a(void 0);r+=i.decode(s,{stream:!0});const l=r.split(t);r=l.pop();for(const e of l)yield yield a(JSON.parse(e));o=e.read()}}))}},107:function(e,t,i){"use strict";!function(t,i,a){let r;(r=a.define)&&r.amd?r([],(function(){return i})):(r=a.modules)?r["FlexSearch".toLowerCase()]=i:e.exports=i}(0,function e(t){function i(e,t){const i=t?t.id:e&&e.id;this.id=i||0===i?i:L++,this.init(e,t),n(this,"index",(function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)})),n(this,"length",(function(){return this.index.length}))}function a(e,t,i,a){return this.u!==this.g&&(this.o=this.o.concat(i),this.u++,a&&this.o.length>=a&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(t,this.o),this.F&&this.F(this.o))),this}function r(e,t){const i=e.length,a=w(t),r=[];for(let o=0,n=0;o=n&&((e=(e=e[s-(r+.5>>0)])[i]||(e[i]=[]))[e.length]=a),r)}function d(e,t){if(e){const i=Object.keys(e);for(let a=0,r=i.length;a(e=e.length-t.length)?1:e?-1:0}function b(e,t){return(e=e[I])<(t=t[I])?-1:e>t?1:0}function u(e,t){const i=I.length;for(let a=0;at?1:0}function p(e,t,i){return e?{page:e,next:t?""+t:null,result:i}:i}function m(e,t,i,a,r,o,n){let s,l=[];if(!0===i){i="0";var c=""}else c=i&&i.split(":");const d=e.length;if(1n&&(c=0),s=(c=c||0)+t,s=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:e,content:t}),this.c[n]=""+this.C,i&&i(),this;if(!o){if(this.async&&"function"!=typeof importScripts){let r=this;return n=new Promise((function(i){setTimeout((function(){r.add(e,t,null,a,!0),r=null,i()}))})),i?(n.then(i),this):n}if(i)return this.add(e,t,null,a,!0),i(),this}if(!(t=this.encode(t)).length)return this;o=w(i=this.f)?i(t):t.split(this.split),this.filter&&(o=r(o,this.filter));const b=S();b._ctx=S();const u=o.length,p=this.threshold,m=this.depth,g=this.b,v=this.i,x=this.D;for(let t=0;tf;i--)c(v,b,h=s.substring(f,i),e,t,d,p,g-1)}break;default:if(l=c(v,b,s,e,1,d,p,g-1),m&&1=p)for(l=b._ctx[s]||(b._ctx[s]=S()),s=this.h[s]||(this.h[s]=y(g-(p||0))),0>(d=t-m)&&(d=0),(h=t+m+1)>u&&(h=u);dr;i--)a=o[i-1],o[i]=a,t[a]=i;o[r]=e,t[e]=r}}}return t},e}();return i}(function(){const e={},t="undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL;return function(i,a,r,o,n){return r=t?URL.createObjectURL(new Blob(["("+r.toString()+")()"],{type:"text/javascript"})):i+".min.js",e[i+="-"+a]||(e[i]=[]),e[i][n]=new Worker(r),e[i][n].onmessage=o,e[i][n]}}()),this)},108:function(e,t){e.exports=''},109:function(e,t){e.exports=''},110:function(e,t){e.exports=''},111:function(e,t){e.exports=''},121:function(e,t,i){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=function(e,t){var i=e[1]||"",a=e[3];if(!a)return i;if(t&&"function"==typeof btoa){var r=(n=a,s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),o=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[i].concat(o).concat([r]).join("\n")}var n,s,l;return[i].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,a){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(a)for(var o=0;o.5&&(i="x"+i.toString(16)),a+=""+i+";";return a}e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new a,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:o.normal,inline:n.normal};this.options.pedantic?(t.block=o.pedantic,t.inline=n.pedantic):this.options.gfm&&(t.block=o.gfm,this.options.breaks?t.inline=n.breaks:t.inline=n.gfm),this.tokenizer.rules=t}static get rules(){return{block:o,inline:n}}static lex(t,i){return new e(i).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],i=!0){let a,r,o;for(e=e.replace(/^ +$/gm,"");e;)if(a=this.tokenizer.space(e))e=e.substring(a.raw.length),a.type&&t.push(a);else if(a=this.tokenizer.code(e,t))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.fences(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.heading(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.nptable(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.hr(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.blockquote(e))e=e.substring(a.raw.length),a.tokens=this.blockTokens(a.text,[],i),t.push(a);else if(a=this.tokenizer.list(e)){for(e=e.substring(a.raw.length),o=a.items.length,r=0;r ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:a,table:a,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};n.def=r(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d{1,9}\.)/,n.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,n.item=r(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=r(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=//,n.html=r(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=r(n._paragraph).replace("hr",n.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.blockquote=r(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=o({},n),n.gfm=o({},n.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),n.gfm.nptable=r(n.gfm.nptable).replace("hr",n.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.gfm.table=r(n.gfm.table).replace("hr",n.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.pedantic=o({},n.normal,{html:r("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:a,paragraph:r(n.normal._paragraph).replace("hr",n.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",n.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const s={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:a,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^_([^\s_<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s*<\[])\*(?!\*)|^\*([^\s<"][\s\S]*?[^\s\[\*])\*(?![\]`punctuation])|^\*([^\s*"<\[][\s\S]*[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:a,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~"};s.em=r(s.em).replace(/punctuation/g,s._punctuation).getRegex(),s._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,s._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,s._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,s.autolink=r(s.autolink).replace("scheme",s._scheme).replace("email",s._email).getRegex(),s._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,s.tag=r(s.tag).replace("comment",n._comment).replace("attribute",s._attribute).getRegex(),s._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,s._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,s._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,s.link=r(s.link).replace("label",s._label).replace("href",s._href).replace("title",s._title).getRegex(),s.reflink=r(s.reflink).replace("label",s._label).getRegex(),s.normal=o({},s),s.pedantic=o({},s.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:r(/^!?\[(label)\]\((.*?)\)/).replace("label",s._label).getRegex(),reflink:r(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",s._label).getRegex()}),s.gfm=o({},s.normal,{escape:r(s.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=x+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:x}):m+=x),m+=this.parse(g.tokens,p),h+=this.renderer.listitem(m,w,v);k+=this.renderer.list(h,b,u);continue;case"html":k+=this.renderer.html(f.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case"text":for(h=f.tokens?this.parseInline(f.tokens):f.text;i+1'},20:function(e,t){function i(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1},getDefaults:i,changeDefaults:function(t){e.exports.defaults=t}}},207:function(e,t,i){"use strict";i.r(t);
+!function(e,t){for(var i in t)e[i]=t[i]}(self,function(e){var t={};function i(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(a,r,function(t){return e[t]}.bind(null,r));return a},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i(i.s=207)}({100:function(e,t){e.exports=''},101:function(e,t){e.exports=''},102:function(e,t){e.exports=''},103:function(e,t){e.exports=''},104:function(e,t,i){const a=i(122),r=i(124),o=i(64),n=i(65),s=i(66),l=i(67),{merge:c,checkSanitizeDeprecation:d,escape:h}=i(21),{getDefaults:f,changeDefaults:b,defaults:u}=i(20);function p(e,t,i){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(i||"function"==typeof t){i||(i=t,t=null),t=c({},p.defaults,t||{}),d(t);const o=t.highlight;let n,s,l=0;try{n=a.lex(e,t)}catch(e){return i(e)}s=n.length;const h=function(e){if(e)return t.highlight=o,i(e);let a;try{a=r.parse(n,t)}catch(t){e=t}return t.highlight=o,e?i(e):i(null,a)};if(!o||o.length<3)return h();if(delete t.highlight,!s)return h();for(;lAn error occurred:"+h(e.message+"",!0)+"
";throw e}}p.options=p.setOptions=function(e){return c(p.defaults,e),b(p.defaults),p},p.getDefaults=f,p.defaults=u,p.use=function(e){const t=c({},e);if(e.renderer){const i=p.defaults.renderer||new n;for(const t in e.renderer){const a=i[t];i[t]=(...r)=>{let o=e.renderer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.renderer=i}if(e.tokenizer){const i=p.defaults.tokenizer||new o;for(const t in e.tokenizer){const a=i[t];i[t]=(...r)=>{let o=e.tokenizer[t].apply(i,r);return!1===o&&(o=a.apply(i,r)),o}}t.tokenizer=i}p.setOptions(t)},p.Parser=r,p.parser=r.parse,p.Renderer=n,p.TextRenderer=s,p.Lexer=a,p.lexer=a.lex,p.Tokenizer=o,p.Slugger=l,p.parse=p,e.exports=p},105:function(e,t){e.exports=''},106:function(e,t,i){"use strict";var a=this&&this.__await||function(e){return this instanceof a?(this.v=e,this):new a(e)},r=this&&this.__asyncGenerator||function(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=i.apply(e,t||[]),n=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(i,a){n.push([e,t,i,a])>1||l(e,t)}))})}function l(e,t){try{(i=o[e](t)).value instanceof a?Promise.resolve(i.value.v).then(c,d):h(n[0][2],i)}catch(e){h(n[0][3],e)}var i}function c(e){l("next",e)}function d(e){l("throw",e)}function h(e,t){e(t),n.shift(),n.length&&l(n[0][0],n[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return r(this,arguments,(function*(){const t=/\r?\n/,i=new TextDecoder;let r="",o=e.read();for(;;){const{done:n,value:s}=yield a(o);if(n)return r.length>0&&(yield yield a(JSON.parse(r))),yield a(void 0);r+=i.decode(s,{stream:!0});const l=r.split(t);r=l.pop();for(const e of l)yield yield a(JSON.parse(e));o=e.read()}}))}},107:function(e,t,i){"use strict";!function(t,i,a){let r;(r=a.define)&&r.amd?r([],(function(){return i})):(r=a.modules)?r["FlexSearch".toLowerCase()]=i:e.exports=i}(0,function e(t){function i(e,t){const i=t?t.id:e&&e.id;this.id=i||0===i?i:L++,this.init(e,t),n(this,"index",(function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)})),n(this,"length",(function(){return this.index.length}))}function a(e,t,i,a){return this.u!==this.g&&(this.o=this.o.concat(i),this.u++,a&&this.o.length>=a&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(t,this.o),this.F&&this.F(this.o))),this}function r(e,t){const i=e.length,a=w(t),r=[];for(let o=0,n=0;o=n&&((e=(e=e[s-(r+.5>>0)])[i]||(e[i]=[]))[e.length]=a),r)}function d(e,t){if(e){const i=Object.keys(e);for(let a=0,r=i.length;a(e=e.length-t.length)?1:e?-1:0}function b(e,t){return(e=e[I])<(t=t[I])?-1:e>t?1:0}function u(e,t){const i=I.length;for(let a=0;at?1:0}function p(e,t,i){return e?{page:e,next:t?""+t:null,result:i}:i}function m(e,t,i,a,r,o,n){let s,l=[];if(!0===i){i="0";var c=""}else c=i&&i.split(":");const d=e.length;if(1n&&(c=0),s=(c=c||0)+t,s=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:e,content:t}),this.c[n]=""+this.C,i&&i(),this;if(!o){if(this.async&&"function"!=typeof importScripts){let r=this;return n=new Promise((function(i){setTimeout((function(){r.add(e,t,null,a,!0),r=null,i()}))})),i?(n.then(i),this):n}if(i)return this.add(e,t,null,a,!0),i(),this}if(!(t=this.encode(t)).length)return this;o=w(i=this.f)?i(t):t.split(this.split),this.filter&&(o=r(o,this.filter));const b=S();b._ctx=S();const u=o.length,p=this.threshold,m=this.depth,g=this.b,v=this.i,x=this.D;for(let t=0;tf;i--)c(v,b,h=s.substring(f,i),e,t,d,p,g-1)}break;default:if(l=c(v,b,s,e,1,d,p,g-1),m&&1=p)for(l=b._ctx[s]||(b._ctx[s]=S()),s=this.h[s]||(this.h[s]=y(g-(p||0))),0>(d=t-m)&&(d=0),(h=t+m+1)>u&&(h=u);dr;i--)a=o[i-1],o[i]=a,t[a]=i;o[r]=e,t[e]=r}}}return t},e}();return i}(function(){const e={},t="undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL;return function(i,a,r,o,n){return r=t?URL.createObjectURL(new Blob(["("+r.toString()+")()"],{type:"text/javascript"})):i+".min.js",e[i+="-"+a]||(e[i]=[]),e[i][n]=new Worker(r),e[i][n].onmessage=o,e[i][n]}}()),this)},108:function(e,t){e.exports=''},109:function(e,t){e.exports=''},110:function(e,t){e.exports=''},111:function(e,t){e.exports=''},121:function(e,t,i){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=function(e,t){var i=e[1]||"",a=e[3];if(!a)return i;if(t&&"function"==typeof btoa){var r=(n=a,s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),o=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[i].concat(o).concat([r]).join("\n")}var n,s,l;return[i].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,a){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(a)for(var o=0;o.5&&(i="x"+i.toString(16)),a+=""+i+";";return a}e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new a,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;const t={block:o.normal,inline:n.normal};this.options.pedantic?(t.block=o.pedantic,t.inline=n.pedantic):this.options.gfm&&(t.block=o.gfm,this.options.breaks?t.inline=n.breaks:t.inline=n.gfm),this.tokenizer.rules=t}static get rules(){return{block:o,inline:n}}static lex(t,i){return new e(i).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],i=!0){let a,r,o;for(e=e.replace(/^ +$/gm,"");e;)if(a=this.tokenizer.space(e))e=e.substring(a.raw.length),a.type&&t.push(a);else if(a=this.tokenizer.code(e,t))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.fences(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.heading(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.nptable(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.hr(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.blockquote(e))e=e.substring(a.raw.length),a.tokens=this.blockTokens(a.text,[],i),t.push(a);else if(a=this.tokenizer.list(e)){for(e=e.substring(a.raw.length),o=a.items.length,r=0;r ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:a,table:a,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};n.def=r(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d{1,9}\.)/,n.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,n.item=r(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=r(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=//,n.html=r(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=r(n._paragraph).replace("hr",n.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.blockquote=r(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=o({},n),n.gfm=o({},n.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),n.gfm.nptable=r(n.gfm.nptable).replace("hr",n.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.gfm.table=r(n.gfm.table).replace("hr",n.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.pedantic=o({},n.normal,{html:r("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:a,paragraph:r(n.normal._paragraph).replace("hr",n.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",n.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const s={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:a,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^_([^\s_<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s*<\[])\*(?!\*)|^\*([^\s<"][\s\S]*?[^\s\[\*])\*(?![\]`punctuation])|^\*([^\s*"<\[][\s\S]*[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:a,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~"};s.em=r(s.em).replace(/punctuation/g,s._punctuation).getRegex(),s._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,s._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,s._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,s.autolink=r(s.autolink).replace("scheme",s._scheme).replace("email",s._email).getRegex(),s._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,s.tag=r(s.tag).replace("comment",n._comment).replace("attribute",s._attribute).getRegex(),s._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,s._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,s._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,s.link=r(s.link).replace("label",s._label).replace("href",s._href).replace("title",s._title).getRegex(),s.reflink=r(s.reflink).replace("label",s._label).getRegex(),s.normal=o({},s),s.pedantic=o({},s.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:r(/^!?\[(label)\]\((.*?)\)/).replace("label",s._label).getRegex(),reflink:r(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",s._label).getRegex()}),s.gfm=o({},s.normal,{escape:r(s.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=x+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:x}):m+=x),m+=this.parse(g.tokens,p),h+=this.renderer.listitem(m,w,v);k+=this.renderer.list(h,b,u);continue;case"html":k+=this.renderer.html(f.text);continue;case"paragraph":k+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case"text":for(h=f.tokens?this.parseInline(f.tokens):f.text;i+1'},20:function(e,t){function i(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1},getDefaults:i,changeDefaults:function(t){e.exports.defaults=t}}},207:function(e,t,i){"use strict";i.r(t);
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -68,7 +68,7 @@ class y{constructor(e,t,i){this.__parts=[],this.template=e,this.processor=t,this
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-const $=e=>null===e||!("object"==typeof e||"function"==typeof e),_=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class C{constructor(e,t,i){this.dirty=!0,this.element=e,this.name=t,this.strings=i,this.parts=[];for(let e=0;e{try{const e={get capture(){return E=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class R{constructor(e,t,i){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=i,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;w(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=x,e(this)}if(this.__pendingValue===x)return;const e=this.__pendingValue,t=this.value,i=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),a=null!=e&&(null==t||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),a&&(this.__options=U(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=x}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const U=e=>e&&(E?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)
+const $=e=>null===e||!("object"==typeof e||"function"==typeof e),_=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class C{constructor(e,t,i){this.dirty=!0,this.element=e,this.name=t,this.strings=i,this.parts=[];for(let e=0;e{try{const e={get capture(){return E=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class U{constructor(e,t,i){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=i,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;w(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=x,e(this)}if(this.__pendingValue===x)return;const e=this.__pendingValue,t=this.value,i=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),a=null!=e&&(null==t||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),a&&(this.__options=R(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=x}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const R=e=>e&&(E?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -108,7 +108,7 @@ const $=e=>null===e||!("object"==typeof e||"function"==typeof e),_=e=>Array.isAr
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-class{handleAttributeExpressions(e,t,i,a){const r=t[0];if("."===r){return new T(e,t.slice(1),i).parts}return"@"===r?[new R(e,t.slice(1),a.eventContext)]:"?"===r?[new D(e,t.slice(1),i)]:new C(e,t,i).parts}handleTextExpression(e){return new L(e)}};
+class{handleAttributeExpressions(e,t,i,a){const r=t[0];if("."===r){return new T(e,t.slice(1),i).parts}return"@"===r?[new U(e,t.slice(1),a.eventContext)]:"?"===r?[new D(e,t.slice(1),i)]:new C(e,t,i).parts}handleTextExpression(e){return new L(e)}};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -196,7 +196,7 @@ const re=new WeakMap,oe=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeSVG
75% {stop-color: #4876ff}
100% {stop-color: #04cdff}
}
- `}});var ge;function ve(e,t){void 0===t&&(t={});var i=t.registrationOptions;void 0===i&&(i={}),delete t.registrationOptions;var a=function(e){for(var i=[],a=arguments.length-1;a-- >0;)i[a]=arguments[a+1];t&&t[e]&&t[e].apply(t,i)};"serviceWorker"in navigator&&ge.then((function(){Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))?(!function(e,t,i){fetch(e).then((function(a){404===a.status?(t("error",new Error("Service worker not found at "+e)),ke()):-1===a.headers.get("content-type").indexOf("javascript")?(t("error",new Error("Expected "+e+" to have javascript content-type, but received "+a.headers.get("content-type"))),ke()):xe(e,t,i)})).catch((function(e){return we(t,e)}))}(e,a,i),navigator.serviceWorker.ready.then((function(e){a("ready",e)}))):(xe(e,a,i),navigator.serviceWorker.ready.then((function(e){a("ready",e)})))}))}function we(e,t){navigator.onLine||e("offline"),e("error",t)}function xe(e,t,i){navigator.serviceWorker.register(e,i).then((function(e){t("registered",e),e.waiting?t("updated",e):e.onupdatefound=function(){t("updatefound",e);var i=e.installing;i.onstatechange=function(){"installed"===i.state&&(navigator.serviceWorker.controller?t("updated",e):t("cached",e))}}})).catch((function(e){return we(t,e)}))}function ke(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}async function ye(e="sw.js",t="./"){let i,a;const r=new Promise((e,t)=>{i=e,a=t});navigator.serviceWorker||(console.error("Service Workers not supported"),a()),ve(t+e,{registrationOptions:{scope:t},registered(e){console.log("Service worker is registered"),i()},error(e){console.error("Error during service worker registration:",e),a()}}),await r}"undefined"!=typeof window&&(ge="undefined"!=typeof Promise?new Promise((function(e){return window.addEventListener("load",e)})):{then:function(e){return window.addEventListener("load",e)}});let Se=null;function ze(){return null===Se&&(Se=new Worker("sw.js")),Se}function $e(e){let t=null;try{t=new Date(e.ts||e.date)}catch(e){}const i=t&&!isNaN(t)?_e(t.toISOString()):"";return{date:t,timestamp:i}}function _e(e){return e.replace(/[-:T]/g,"").slice(0,14)}function Ce(e,t,i){const a=new URLSearchParams;return a.set("view",e),a.set("url",t),a.set("ts",i),"#"+a.toString()}async function Pe(e){return{url:e,coll:"id-"+(await async function(e,t){const i=(new TextEncoder).encode(e),a=await crypto.subtle.digest(t,i);return Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,"0")).join("")}(e,"SHA-256")).slice(0,12)}}var Le=i(8),De=i.n(Le),Te=i(92),Ie=i.n(Te),Ee=i(29),Re=i.n(Ee),Ue=i(30),Ae=i.n(Ue),je=i(93),qe=i.n(je);customElements.define("replay-app-main",class extends ae{constructor(){super(),this.sourceUrl=null,this.collInfo=null,this.showTerms=!1,this.pageParams={},this.inited=!1,this.navMenuShown=!1,ye("sw.js"),ze(),this.safariKeyframes()}static get properties(){return{inited:{type:Boolean},pageParams:{type:Object},sourceUrl:{type:String},navMenuShown:{type:Boolean},showTerms:{type:Boolean},collInfo:{type:Object},loadInfo:{type:Object},embed:{type:String}}}static get styles(){return be(te`
+ `}});var ge;function ve(e,t){void 0===t&&(t={});var i=t.registrationOptions;void 0===i&&(i={}),delete t.registrationOptions;var a=function(e){for(var i=[],a=arguments.length-1;a-- >0;)i[a]=arguments[a+1];t&&t[e]&&t[e].apply(t,i)};"serviceWorker"in navigator&&ge.then((function(){Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))?(!function(e,t,i){fetch(e).then((function(a){404===a.status?(t("error",new Error("Service worker not found at "+e)),ke()):-1===a.headers.get("content-type").indexOf("javascript")?(t("error",new Error("Expected "+e+" to have javascript content-type, but received "+a.headers.get("content-type"))),ke()):xe(e,t,i)})).catch((function(e){return we(t,e)}))}(e,a,i),navigator.serviceWorker.ready.then((function(e){a("ready",e)}))):(xe(e,a,i),navigator.serviceWorker.ready.then((function(e){a("ready",e)})))}))}function we(e,t){navigator.onLine||e("offline"),e("error",t)}function xe(e,t,i){navigator.serviceWorker.register(e,i).then((function(e){t("registered",e),e.waiting?t("updated",e):e.onupdatefound=function(){t("updatefound",e);var i=e.installing;i.onstatechange=function(){"installed"===i.state&&(navigator.serviceWorker.controller?t("updated",e):t("cached",e))}}})).catch((function(e){return we(t,e)}))}function ke(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}async function ye(e="sw.js",t="./"){let i,a;const r=new Promise((e,t)=>{i=e,a=t});navigator.serviceWorker||(console.error("Service Workers not supported"),a()),ve(t+e,{registrationOptions:{scope:t},registered(e){console.log("Service worker is registered"),i()},error(e){console.error("Error during service worker registration:",e),a()}}),await r}"undefined"!=typeof window&&(ge="undefined"!=typeof Promise?new Promise((function(e){return window.addEventListener("load",e)})):{then:function(e){return window.addEventListener("load",e)}});let Se=null;function ze(){return null===Se&&(Se=new Worker("sw.js")),Se}function $e(e){let t=null;try{t=new Date(e.ts||e.date)}catch(e){}const i=t&&!isNaN(t)?_e(t.toISOString()):"";return{date:t,timestamp:i}}function _e(e){return e.replace(/[-:T]/g,"").slice(0,14)}function Ce(e,t,i){const a=new URLSearchParams;return a.set("view",e),a.set("url",t),a.set("ts",i),"#"+a.toString()}async function Pe(e){return{url:e,coll:"id-"+(await async function(e,t){const i=(new TextEncoder).encode(e),a=await crypto.subtle.digest(t,i);return Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,"0")).join("")}(e,"SHA-256")).slice(0,12)}}var Le=i(8),De=i.n(Le),Te=i(92),Ie=i.n(Te),Ee=i(29),Ue=i.n(Ee),Re=i(30),Ae=i.n(Re),je=i(93),qe=i.n(je);customElements.define("replay-app-main",class extends ae{constructor(){super(),this.sourceUrl=null,this.collInfo=null,this.showTerms=!1,this.pageParams={},this.inited=!1,this.navMenuShown=!1,ye("sw.js"),ze(),this.safariKeyframes()}static get properties(){return{inited:{type:Boolean},pageParams:{type:Object},sourceUrl:{type:String},navMenuShown:{type:Boolean},showTerms:{type:Boolean},collInfo:{type:Object},loadInfo:{type:Object},embed:{type:String}}}static get styles(){return be(te`
#wrlogo {
max-height: 2.5rem;
}
@@ -296,7 +296,7 @@ const re=new WeakMap,oe=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeSVG
${ue&&!this.collInfo?N`
window.history.back()}" @keyup="${pe}">
-
+
window.history.forward()}" @keyup="${pe}">
@@ -401,7 +401,7 @@ const re=new WeakMap,oe=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeSVG
- `:""} `:N``}firstUpdated(){this.initRoute(),window.addEventListener("popstate",e=>{this.initRoute()})}updated(e){e.has("sourceUrl")&&(this.collInfo=null)}onFavIcons(e){const t=document.querySelector("head"),i=document.querySelectorAll("link[rel*='icon']");for(const e of i)t.removeChild(e);for(const i of e.detail.icons){const e=document.createElement("link");e.rel=i.rel,e.href=i.href,t.appendChild(e)}}skipMenu(e){e.preventDefault(),this.renderRoot.querySelector("#skip-main-target").focus()}onNavMenu(e){e.preventDefault(),e.stopPropagation(),this.navMenuShown=!this.navMenuShown,this.navMenuShown&&(document.addEventListener("click",e=>{e.preventDefault(),this.navMenuShown=!1,this.renderRoot.querySelector("#menu-button").focus()},{once:!0}),document.addEventListener("keypress",e=>{"Escape"==e.key&&(e.preventDefault(),this.navMenuShown=!1,this.renderRoot.querySelector("#menu-button").focus())},{once:!0}))}initRoute(){this.inited=!0,this.pageParams=new URLSearchParams(window.location.search);let e=this.pageParams.get("state");if(e)try{if(e=JSON.parse(e),e.ids instanceof Array&&e.userId&&"open"===e.action)return this.pageParams.set("source","googledrive://"+e.ids[0]),this.pageParams.delete("state"),void(window.location.search=this.pageParams.toString())}catch(e){console.log(e)}if(this.sourceUrl=this.pageParams.get("source")||"",this.embed=this.pageParams.get("embed")||"",this.pageParams.has("terms")&&(this.showTerms=!0),this.pageParams.get("config")){this.loadInfo||(this.loadInfo={});try{this.loadInfo.extraConfig=JSON.parse(this.pageParams.get("config"))}catch(e){console.log("invalid config: "+e)}}this.pageParams.get("basePageUrl")&&(this.loadInfo||(this.loadInfo={extraConfig:{}}),this.loadInfo.extraConfig||(this.loadInfo.extraConfig={}),this.loadInfo.extraConfig.baseUrl=this.pageParams.get("basePageUrl")),this.pageParams.get("customColl")&&(this.loadInfo||(this.loadInfo={}),this.loadInfo.customColl=this.pageParams.get("customColl"))}onStartLoad(e){if(this.pageParams.set("source",e.detail.sourceUrl),e.detail.isFile){{const e=new URL(window.location.href);e.search=this.pageParams.toString(),window.history.pushState({},"",e.toString())}this.sourceUrl=e.detail.sourceUrl,this.loadInfo=e.detail}else window.location.search=this.pageParams.toString()}onCollLoaded(e){this.loadInfo=null,e.detail.collInfo&&(this.collInfo=e.detail.collInfo),e.detail.alreadyLoaded||e.detail.sourceUrl!==this.sourceUrl&&(this.pageParams.set("source",e.detail.sourceUrl),window.location.search=this.pageParams.toString())}safariKeyframes(){const e=document.createElement("style");document.head.appendChild(e),e.appendChild(document.createTextNode("\n @keyframes spinAround {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(359deg);\n }\n }\n "))}});var Me=i(94),Ne=i.n(Me);customElements.define("wr-chooser",class extends ae{constructor(){super(),this.fileDisplayName="",this.file=null}onChooseFile(e){0!==e.currentTarget.files.length&&(this.file=e.currentTarget.files[0],this.fileDisplayName="file://"+(this.file.path||this.file.name),this.requestUpdate())}onStartLoad(e){e.preventDefault();const t={sourceUrl:this.fileDisplayName};if(this.file){if(t.isFile=!0,this.file.path){const e=new URL("http://files.replayweb.page/");e.searchParams.set("filename",this.file.path),t.loadUrl=e.href}else t.loadUrl=URL.createObjectURL(this.file),t.blob=this.file;t.size=this.file.size,t.noCache=void 0!==this.file.path,t.name=this.fileDisplayName}return this.dispatchEvent(new CustomEvent("load-start",{detail:t})),!1}onInput(e){this.fileDisplayName=e.currentTarget.value,this.file&&this.fileDisplayName&&this.fileDisplayName.startsWith("file://")&&(this.file=null,this.fileDisplayName="")}static get styles(){return be(te`
+ `:""} `:N``}firstUpdated(){this.initRoute(),window.addEventListener("popstate",e=>{this.initRoute()})}updated(e){e.has("sourceUrl")&&(this.collInfo=null)}onFavIcons(e){const t=document.querySelector("head"),i=document.querySelectorAll("link[rel*='icon']");for(const e of i)t.removeChild(e);for(const i of e.detail.icons){const e=document.createElement("link");e.rel=i.rel,e.href=i.href,t.appendChild(e)}}skipMenu(e){e.preventDefault(),this.renderRoot.querySelector("#skip-main-target").focus()}onNavMenu(e){e.preventDefault(),e.stopPropagation(),this.navMenuShown=!this.navMenuShown,this.navMenuShown&&(document.addEventListener("click",e=>{e.preventDefault(),this.navMenuShown=!1,this.renderRoot.querySelector("#menu-button").focus()},{once:!0}),document.addEventListener("keypress",e=>{"Escape"==e.key&&(e.preventDefault(),this.navMenuShown=!1,this.renderRoot.querySelector("#menu-button").focus())},{once:!0}))}initRoute(){this.inited=!0,this.pageParams=new URLSearchParams(window.location.search);let e=this.pageParams.get("state");if(e)try{if(e=JSON.parse(e),e.ids instanceof Array&&e.userId&&"open"===e.action)return this.pageParams.set("source","googledrive://"+e.ids[0]),this.pageParams.delete("state"),void(window.location.search=this.pageParams.toString())}catch(e){console.log(e)}if(this.sourceUrl=this.pageParams.get("source")||"",this.embed=this.pageParams.get("embed")||"",this.pageParams.has("terms")&&(this.showTerms=!0),this.pageParams.get("config")){this.loadInfo||(this.loadInfo={});try{this.loadInfo.extraConfig=JSON.parse(this.pageParams.get("config"))}catch(e){console.log("invalid config: "+e)}}if(this.pageParams.get("basePageUrl")&&(this.loadInfo||(this.loadInfo={extraConfig:{}}),this.loadInfo.extraConfig||(this.loadInfo.extraConfig={}),this.loadInfo.extraConfig.baseUrl=this.pageParams.get("basePageUrl")),this.pageParams.get("customColl")&&(this.loadInfo||(this.loadInfo={}),this.loadInfo.customColl=this.pageParams.get("customColl")),ue&&this.sourceUrl.startsWith("file://")){const e=new URL("http://files.replayweb.page/");e.searchParams.set("filename",this.sourceUrl.slice("file://".length)),this.loadInfo={sourceUrl:this.sourceUrl,loadUrl:e.href}}}onStartLoad(e){if(this.pageParams.set("source",e.detail.sourceUrl),e.detail.isFile){{const e=new URL(window.location.href);e.search=this.pageParams.toString(),window.history.pushState({},"",e.toString())}this.sourceUrl=e.detail.sourceUrl,this.loadInfo=e.detail}else window.location.search=this.pageParams.toString()}onCollLoaded(e){this.loadInfo=null,e.detail.collInfo&&(this.collInfo=e.detail.collInfo),e.detail.alreadyLoaded||e.detail.sourceUrl!==this.sourceUrl&&(this.pageParams.set("source",e.detail.sourceUrl),window.location.search=this.pageParams.toString())}safariKeyframes(){const e=document.createElement("style");document.head.appendChild(e),e.appendChild(document.createTextNode("\n @keyframes spinAround {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(359deg);\n }\n }\n "))}});var Me=i(94),Ne=i.n(Me);customElements.define("wr-chooser",class extends ae{constructor(){super(),this.fileDisplayName="",this.file=null}onChooseFile(e){0!==e.currentTarget.files.length&&(this.file=e.currentTarget.files[0],this.fileDisplayName="file://"+(this.file.path||this.file.name),this.requestUpdate())}onStartLoad(e){e.preventDefault();const t={sourceUrl:this.fileDisplayName};if(this.file){if(t.isFile=!0,this.file.path){const e=new URL("http://files.replayweb.page/");e.searchParams.set("filename",this.file.path),t.loadUrl=e.href}else t.loadUrl=URL.createObjectURL(this.file),t.blob=this.file;t.size=this.file.size,t.noCache=void 0!==this.file.path,t.name=this.fileDisplayName}return this.dispatchEvent(new CustomEvent("load-start",{detail:t})),!1}onInput(e){this.fileDisplayName=e.currentTarget.value,this.file&&this.fileDisplayName&&this.fileDisplayName.startsWith("file://")&&(this.file=null,this.fileDisplayName="")}static get styles(){return be(te`
:host {
min-width: 0;
}
@@ -658,7 +658,7 @@ const re=new WeakMap,oe=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeSVG
`}
- `}onCopy(e,t){return e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(t),!1}}customElements.define("wr-coll-index",Ze);var Je=i(98),Ye=i.n(Je),Qe=i(59),Xe=i.n(Qe),et=i(99),tt=i.n(et),it=i(100),at=i.n(it),rt=i(60),ot=i.n(rt),nt=i(61),st=i.n(nt),lt=i(62),ct=i.n(lt),dt=i(101),ht=i.n(dt),ft=i(102),bt=i.n(ft),ut=i(103),pt=i.n(ut),mt="undefined"!=typeof window?window:null,gt=null===mt,vt=gt?void 0:mt.document,wt=function(){return!1},xt=gt?"calc":["","-webkit-","-moz-","-o-"].filter((function(e){var t=vt.createElement("div");return t.style.cssText="width:"+e+"calc(9px)",!!t.style.length})).shift()+"calc",kt=function(e){return"string"==typeof e||e instanceof String},yt=function(e){if(kt(e)){var t=vt.querySelector(e);if(!t)throw new Error("Selector "+e+" did not match a DOM element");return t}return e},St=function(e,t,i){var a=e[t];return void 0!==a?a:i},zt=function(e,t,i,a){if(t){if("end"===a)return 0;if("center"===a)return e/2}else if(i){if("start"===a)return 0;if("center"===a)return e/2}return e},$t=function(e,t){var i=vt.createElement("div");return i.className="gutter gutter-"+t,i},_t=function(e,t,i){var a={};return kt(t)?a[e]=t:a[e]=xt+"("+t+"% - "+i+"px)",a},Ct=function(e,t){var i;return(i={})[e]=t+"px",i},Pt=function(e,t){if(void 0===t&&(t={}),gt)return{};var i,a,r,o,n,s,l=e;Array.from&&(l=Array.from(l));var c=yt(l[0]).parentNode,d=getComputedStyle?getComputedStyle(c):null,h=d?d.flexDirection:null,f=St(t,"sizes")||l.map((function(){return 100/l.length})),b=St(t,"minSize",100),u=Array.isArray(b)?b:l.map((function(){return b})),p=St(t,"expandToMin",!1),m=St(t,"gutterSize",10),g=St(t,"gutterAlign","center"),v=St(t,"snapOffset",30),w=St(t,"dragInterval",1),x=St(t,"direction","horizontal"),k=St(t,"cursor","horizontal"===x?"col-resize":"row-resize"),y=St(t,"gutter",$t),S=St(t,"elementStyle",_t),z=St(t,"gutterStyle",Ct);function $(e,t,a,r){var o=S(i,t,a,r);Object.keys(o).forEach((function(t){e.style[t]=o[t]}))}function _(){return s.map((function(e){return e.size}))}function C(e){return"touches"in e?e.touches[0][a]:e[a]}function P(e){var t=s[this.a],i=s[this.b],a=t.size+i.size;t.size=e/this.size*a,i.size=a-e/this.size*a,$(t.element,t.size,this._b,t.i),$(i.element,i.size,this._c,i.i)}function L(e){var i,a=s[this.a],r=s[this.b];this.dragging&&(i=C(e)-this.start+(this._b-this.dragOffset),w>1&&(i=Math.round(i/w)*w),i<=a.minSize+v+this._b?i=a.minSize+this._b:i>=this.size-(r.minSize+v+this._c)&&(i=this.size-(r.minSize+this._c)),P.call(this,i),St(t,"onDrag",wt)(_()))}function D(){var e=s[this.a].element,t=s[this.b].element,a=e.getBoundingClientRect(),n=t.getBoundingClientRect();this.size=a[i]+n[i]+this._b+this._c,this.start=a[r],this.end=a[o]}function T(e){var t=function(e){if(!getComputedStyle)return null;var t=getComputedStyle(e);if(!t)return null;var i=e[n];return 0===i?null:i-="horizontal"===x?parseFloat(t.paddingLeft)+parseFloat(t.paddingRight):parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}(c);if(null===t)return e;if(u.reduce((function(e,t){return e+t}),0)>t)return e;var i=0,a=[],r=e.map((function(r,o){var n=t*r/100,s=zt(m,0===o,o===e.length-1,g),l=u[o]+s;return n0&&a[r]-i>0){var n=Math.min(i,a[r]-i);i-=n,o=e-n}return o/t*100}))}function I(){var e=s[this.a].element,i=s[this.b].element;this.dragging&&St(t,"onDragEnd",wt)(_()),this.dragging=!1,mt.removeEventListener("mouseup",this.stop),mt.removeEventListener("touchend",this.stop),mt.removeEventListener("touchcancel",this.stop),mt.removeEventListener("mousemove",this.move),mt.removeEventListener("touchmove",this.move),this.stop=null,this.move=null,e.removeEventListener("selectstart",wt),e.removeEventListener("dragstart",wt),i.removeEventListener("selectstart",wt),i.removeEventListener("dragstart",wt),e.style.userSelect="",e.style.webkitUserSelect="",e.style.MozUserSelect="",e.style.pointerEvents="",i.style.userSelect="",i.style.webkitUserSelect="",i.style.MozUserSelect="",i.style.pointerEvents="",this.gutter.style.cursor="",this.parent.style.cursor="",vt.body.style.cursor=""}function E(e){if(!("button"in e)||0===e.button){var i=s[this.a].element,a=s[this.b].element;this.dragging||St(t,"onDragStart",wt)(_()),e.preventDefault(),this.dragging=!0,this.move=L.bind(this),this.stop=I.bind(this),mt.addEventListener("mouseup",this.stop),mt.addEventListener("touchend",this.stop),mt.addEventListener("touchcancel",this.stop),mt.addEventListener("mousemove",this.move),mt.addEventListener("touchmove",this.move),i.addEventListener("selectstart",wt),i.addEventListener("dragstart",wt),a.addEventListener("selectstart",wt),a.addEventListener("dragstart",wt),i.style.userSelect="none",i.style.webkitUserSelect="none",i.style.MozUserSelect="none",i.style.pointerEvents="none",a.style.userSelect="none",a.style.webkitUserSelect="none",a.style.MozUserSelect="none",a.style.pointerEvents="none",this.gutter.style.cursor=k,this.parent.style.cursor=k,vt.body.style.cursor=k,D.call(this),this.dragOffset=C(e)-this.end}}"horizontal"===x?(i="width",a="clientX",r="left",o="right",n="clientWidth"):"vertical"===x&&(i="height",a="clientY",r="top",o="bottom",n="clientHeight"),f=T(f);var R=[];function U(e){var t=e.i===R.length,i=t?R[e.i-1]:R[e.i];D.call(i);var a=t?i.size-e.minSize-i._c:e.minSize+i._b;P.call(i,a)}return(s=l.map((function(e,t){var a,r={element:yt(e),size:f[t],minSize:u[t],i:t};if(t>0&&((a={a:t-1,b:t,dragging:!1,direction:x,parent:c})._b=zt(m,t-1==0,!1,g),a._c=zt(m,!1,t===l.length-1,g),"row-reverse"===h||"column-reverse"===h)){var o=a.a;a.a=a.b,a.b=o}if(t>0){var n=y(t,x,r.element);!function(e,t,a){var r=z(i,t,a);Object.keys(r).forEach((function(t){e.style[t]=r[t]}))}(n,m,t),a._a=E.bind(a),n.addEventListener("mousedown",a._a),n.addEventListener("touchstart",a._a),c.insertBefore(n,r.element),a.gutter=n}return $(r.element,r.size,zt(m,0===t,t===l.length-1,g),t),t>0&&R.push(a),r}))).forEach((function(e){var t=e.element.getBoundingClientRect()[i];t0){var a=R[i-1],r=s[a.a],o=s[a.b];r.size=t[i-1],o.size=e,$(r.element,r.size,a._b,r.i),$(o.element,o.size,a._c,o.i)}}))},getSizes:_,collapse:function(e){U(s[e])},destroy:function(e,t){R.forEach((function(a){if(!0!==t?a.parent.removeChild(a.gutter):(a.gutter.removeEventListener("mousedown",a._a),a.gutter.removeEventListener("touchstart",a._a)),!0!==e){var r=S(i,a.a.size,a._b);Object.keys(r).forEach((function(e){s[a.a].element.style[e]="",s[a.b].element.style[e]=""}))}}))},parent:c,pairs:R}};class Lt extends ae{constructor(){super(),this.sourceUrl=null,this.inited=!1,this.isLoading=!1,this.baseApiPrefix="./wabac/api",this.baseReplayPrefix="./wabac",this.apiPrefix="",this.replayPrefix="",this.coll="",this.collInfo=null,this._replaceLoc=!1,this._locUpdateNeeded=!1,this._locationHash="",this.tabData={},this.url="",this.ts="",this.tabNames=["pages","story","resources"],this.menuActive=!1,this.hasStory=!1,this.editable=!1,this.showSidebar="1"===localStorage.getItem("pages:showSidebar"),this.splitter=null,this.isVisible=!0,this.favIconUrl=""}static get properties(){return{inited:{type:Boolean},sourceUrl:{type:String},loadInfo:{type:Object,attribute:!1},showSidebar:{type:Boolean},collInfo:{type:Object,attribute:!1},coll:{type:String},hasStory:{type:Boolean},isLoading:{type:Boolean},tabData:{type:Object,attribute:!1},url:{type:String},ts:{type:String},isFullscreen:{type:Boolean},menuActive:{type:Boolean},embed:{type:String},editable:{type:Boolean},isVisible:{type:Boolean},favIconUrl:{type:String}}}firstUpdated(){this.inited=!0,window.addEventListener("hashchange",e=>this.onHashChange(e)),this.addEventListener("fullscreenchange",e=>{this.isFullscreen=!!document.fullscreenElement}),this.embed&&(this.observer=new IntersectionObserver((e,t)=>{this.isVisible=e[0].isIntersecting}),this.observer.observe(this))}updated(e){if(e.has("sourceUrl")&&this.doUpdateInfo(),e.has("editable")&&(this.editable?this._pollColl=setInterval(()=>this.doUpdateInfo(),1e4):this._pollColl&&clearInterval(this._pollColl)),e.has("tabData")){if(!this.collInfo||!this.collInfo.coll)return;Object.keys(this.tabData).forEach(e=>!this.tabData[e]&&delete this.tabData[e]);const t="#"+new URLSearchParams(this.tabData).toString();if(this.tabData.url||(this.url="search://"+decodeURIComponent(this._paramsToString(this.tabData))),t!==this._locationHash){if(this._locationHash=t,this._replaceLoc||0===Object.keys(e.get("tabData")).length){const e=new URL(window.location.href);e.hash=this._locationHash,window.history.replaceState({},"",e.href),this._replaceLoc=!1}else if(window.location.hash=this._locationHash,!this.showSidebar){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.focus()}this.embed&&window.parent!==window&&window.parent.postMessage(this.tabData,"*")}this._locUpdateNeeded=!1}e.has("showSidebar")&&(this.embed||localStorage.setItem("pages:showSidebar",this.showSidebar?"1":"0")),(e.has("tabData")||e.has("showSidebar"))&&this.configureSplitter()}configureSplitter(){if(this.tabData.url&&this.showSidebar){const e=this.renderRoot.querySelector("#contents"),t=this.renderRoot.querySelector("wr-coll-replay");if(e&&t&&!this.splitter){const i={sizes:[30,70],minSize:[300,300],gutterSize:4,onDragStart(){t.setDisablePointer(!0)},onDragEnd(){t.setDisablePointer(!1)}};this.splitter=Pt([e,t],i)}}else if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}}async doUpdateInfo(){let e=this.loadInfo&&this.loadInfo.customColl;if(!e){e=(await Pe(this.sourceUrl)).coll}this.coll=e;const t=this.baseApiPrefix+"/"+e,i=this.baseReplayPrefix+"/"+e,a=await fetch(t+"?all=1");if(200!=a.status)return void(this.collInfo={});const r=await a.json();this.collInfo={apiPrefix:t,replayPrefix:i,coll:e,...r},this.collInfo.title||(this.collInfo.title=this.collInfo.filename),"replayonly"===this.embed&&(this.showSidebar=!1),this.hasStory=this.collInfo.desc||this.collInfo.lists.length,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{collInfo:this.collInfo,alreadyLoaded:!0}})),this.onHashChange()}onCollLoaded(e){this.doUpdateInfo(),this.loadInfo=null,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{sourceUrl:this.sourceUrl,collInfo:this.collInfo}}))}onCollUpdate(e){this.editable&&(this.collInfo={...this.collInfo,...e.detail})}onHashChange(e){const t=window.location.hash;if(t&&t!==this._locationHash&&(this.tabData=Object.fromEntries(new URLSearchParams(t.slice(1)).entries()),this._locationHash=t),this.collInfo.coll&&!this.tabNames.includes(this.tabData.view)){const e=this.hasStory?"story":this.collInfo.pages.length?"pages":"resources";this.tabData={...this.tabData,view:e}}if(this.tabData.url&&this.tabData.url.startsWith("page:")){const e=Number(this.tabData.url.slice("page:".length));if(!isNaN(e)&&e1&&(i=Math.round(i/w)*w),i<=a.minSize+v+this._b?i=a.minSize+this._b:i>=this.size-(r.minSize+v+this._c)&&(i=this.size-(r.minSize+this._c)),P.call(this,i),St(t,"onDrag",wt)(_()))}function D(){var e=s[this.a].element,t=s[this.b].element,a=e.getBoundingClientRect(),n=t.getBoundingClientRect();this.size=a[i]+n[i]+this._b+this._c,this.start=a[r],this.end=a[o]}function T(e){var t=function(e){if(!getComputedStyle)return null;var t=getComputedStyle(e);if(!t)return null;var i=e[n];return 0===i?null:i-="horizontal"===x?parseFloat(t.paddingLeft)+parseFloat(t.paddingRight):parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)}(c);if(null===t)return e;if(u.reduce((function(e,t){return e+t}),0)>t)return e;var i=0,a=[],r=e.map((function(r,o){var n=t*r/100,s=zt(m,0===o,o===e.length-1,g),l=u[o]+s;return n0&&a[r]-i>0){var n=Math.min(i,a[r]-i);i-=n,o=e-n}return o/t*100}))}function I(){var e=s[this.a].element,i=s[this.b].element;this.dragging&&St(t,"onDragEnd",wt)(_()),this.dragging=!1,mt.removeEventListener("mouseup",this.stop),mt.removeEventListener("touchend",this.stop),mt.removeEventListener("touchcancel",this.stop),mt.removeEventListener("mousemove",this.move),mt.removeEventListener("touchmove",this.move),this.stop=null,this.move=null,e.removeEventListener("selectstart",wt),e.removeEventListener("dragstart",wt),i.removeEventListener("selectstart",wt),i.removeEventListener("dragstart",wt),e.style.userSelect="",e.style.webkitUserSelect="",e.style.MozUserSelect="",e.style.pointerEvents="",i.style.userSelect="",i.style.webkitUserSelect="",i.style.MozUserSelect="",i.style.pointerEvents="",this.gutter.style.cursor="",this.parent.style.cursor="",vt.body.style.cursor=""}function E(e){if(!("button"in e)||0===e.button){var i=s[this.a].element,a=s[this.b].element;this.dragging||St(t,"onDragStart",wt)(_()),e.preventDefault(),this.dragging=!0,this.move=L.bind(this),this.stop=I.bind(this),mt.addEventListener("mouseup",this.stop),mt.addEventListener("touchend",this.stop),mt.addEventListener("touchcancel",this.stop),mt.addEventListener("mousemove",this.move),mt.addEventListener("touchmove",this.move),i.addEventListener("selectstart",wt),i.addEventListener("dragstart",wt),a.addEventListener("selectstart",wt),a.addEventListener("dragstart",wt),i.style.userSelect="none",i.style.webkitUserSelect="none",i.style.MozUserSelect="none",i.style.pointerEvents="none",a.style.userSelect="none",a.style.webkitUserSelect="none",a.style.MozUserSelect="none",a.style.pointerEvents="none",this.gutter.style.cursor=k,this.parent.style.cursor=k,vt.body.style.cursor=k,D.call(this),this.dragOffset=C(e)-this.end}}"horizontal"===x?(i="width",a="clientX",r="left",o="right",n="clientWidth"):"vertical"===x&&(i="height",a="clientY",r="top",o="bottom",n="clientHeight"),f=T(f);var U=[];function R(e){var t=e.i===U.length,i=t?U[e.i-1]:U[e.i];D.call(i);var a=t?i.size-e.minSize-i._c:e.minSize+i._b;P.call(i,a)}return(s=l.map((function(e,t){var a,r={element:yt(e),size:f[t],minSize:u[t],i:t};if(t>0&&((a={a:t-1,b:t,dragging:!1,direction:x,parent:c})._b=zt(m,t-1==0,!1,g),a._c=zt(m,!1,t===l.length-1,g),"row-reverse"===h||"column-reverse"===h)){var o=a.a;a.a=a.b,a.b=o}if(t>0){var n=y(t,x,r.element);!function(e,t,a){var r=z(i,t,a);Object.keys(r).forEach((function(t){e.style[t]=r[t]}))}(n,m,t),a._a=E.bind(a),n.addEventListener("mousedown",a._a),n.addEventListener("touchstart",a._a),c.insertBefore(n,r.element),a.gutter=n}return $(r.element,r.size,zt(m,0===t,t===l.length-1,g),t),t>0&&U.push(a),r}))).forEach((function(e){var t=e.element.getBoundingClientRect()[i];t0){var a=U[i-1],r=s[a.a],o=s[a.b];r.size=t[i-1],o.size=e,$(r.element,r.size,a._b,r.i),$(o.element,o.size,a._c,o.i)}}))},getSizes:_,collapse:function(e){R(s[e])},destroy:function(e,t){U.forEach((function(a){if(!0!==t?a.parent.removeChild(a.gutter):(a.gutter.removeEventListener("mousedown",a._a),a.gutter.removeEventListener("touchstart",a._a)),!0!==e){var r=S(i,a.a.size,a._b);Object.keys(r).forEach((function(e){s[a.a].element.style[e]="",s[a.b].element.style[e]=""}))}}))},parent:c,pairs:U}};class Lt extends ae{constructor(){super(),this.sourceUrl=null,this.inited=!1,this.isLoading=!1,this.baseApiPrefix="./wabac/api",this.baseReplayPrefix="./wabac",this.apiPrefix="",this.replayPrefix="",this.coll="",this.collInfo=null,this._replaceLoc=!1,this._locUpdateNeeded=!1,this._locationHash="",this.tabData={},this.url="",this.ts="",this.tabNames=["pages","story","resources"],this.menuActive=!1,this.hasStory=!1,this.editable=!1,this.showSidebar="1"===localStorage.getItem("pages:showSidebar"),this.splitter=null,this.isVisible=!0,this.favIconUrl=""}static get properties(){return{inited:{type:Boolean},sourceUrl:{type:String},loadInfo:{type:Object,attribute:!1},showSidebar:{type:Boolean},collInfo:{type:Object,attribute:!1},coll:{type:String},hasStory:{type:Boolean},isLoading:{type:Boolean},tabData:{type:Object,attribute:!1},url:{type:String},ts:{type:String},isFullscreen:{type:Boolean},menuActive:{type:Boolean},embed:{type:String},editable:{type:Boolean},isVisible:{type:Boolean},favIconUrl:{type:String}}}firstUpdated(){this.inited=!0,window.addEventListener("hashchange",e=>this.onHashChange(e)),this.addEventListener("fullscreenchange",e=>{this.isFullscreen=!!document.fullscreenElement}),this.embed&&(this.observer=new IntersectionObserver((e,t)=>{this.isVisible=e[0].isIntersecting}),this.observer.observe(this))}updated(e){if(e.has("sourceUrl")&&this.doUpdateInfo(),e.has("editable")&&(this.editable?this._pollColl=setInterval(()=>this.doUpdateInfo(),1e4):this._pollColl&&clearInterval(this._pollColl)),e.has("tabData")){if(!this.collInfo||!this.collInfo.coll)return;Object.keys(this.tabData).forEach(e=>!this.tabData[e]&&delete this.tabData[e]);const t="#"+new URLSearchParams(this.tabData).toString();if(this.tabData.url||(this.url="search://"+decodeURIComponent(this._paramsToString(this.tabData))),t!==this._locationHash){if(this._locationHash=t,this._replaceLoc||0===Object.keys(e.get("tabData")).length){const e=new URL(window.location.href);e.hash=this._locationHash,window.history.replaceState({},"",e.href),this._replaceLoc=!1}else if(window.location.hash=this._locationHash,!this.showSidebar){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.focus()}this.embed&&window.parent!==window&&window.parent.postMessage(this.tabData,"*")}this._locUpdateNeeded=!1}e.has("showSidebar")&&(this.embed||localStorage.setItem("pages:showSidebar",this.showSidebar?"1":"0")),(e.has("tabData")||e.has("showSidebar"))&&this.configureSplitter()}configureSplitter(){if(this.tabData.url&&this.showSidebar){const e=this.renderRoot.querySelector("#contents"),t=this.renderRoot.querySelector("wr-coll-replay");if(e&&t&&!this.splitter){const i={sizes:[30,70],minSize:[300,300],gutterSize:4,onDragStart(){t.setDisablePointer(!0)},onDragEnd(){t.setDisablePointer(!1)}};this.splitter=Pt([e,t],i)}}else if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}}async doUpdateInfo(){let e=this.loadInfo&&this.loadInfo.customColl;if(!e){e=(await Pe(this.sourceUrl)).coll}this.coll=e;const t=this.baseApiPrefix+"/"+e,i=this.baseReplayPrefix+"/"+e,a=await fetch(t+"?all=1");if(200!=a.status)return void(this.collInfo={});const r=await a.json();this.collInfo={apiPrefix:t,replayPrefix:i,coll:e,...r},this.collInfo.title||(this.collInfo.title=this.collInfo.filename),"replayonly"===this.embed&&(this.showSidebar=!1),this.hasStory=this.collInfo.desc||this.collInfo.lists.length,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{collInfo:this.collInfo,alreadyLoaded:!0}})),this.onHashChange()}onCollLoaded(e){this.doUpdateInfo(),this.loadInfo=null,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:{sourceUrl:this.sourceUrl,collInfo:this.collInfo}}))}onCollUpdate(e){this.editable&&(this.collInfo={...this.collInfo,...e.detail})}onHashChange(e){const t=window.location.hash;if(t&&t!==this._locationHash&&(this.tabData=Object.fromEntries(new URLSearchParams(t.slice(1)).entries()),this._locationHash=t),this.collInfo.coll&&!this.tabNames.includes(this.tabData.view)){const e=this.hasStory?"story":this.collInfo.pages.length?"pages":"resources";this.tabData={...this.tabData,view:e}}if(this.tabData.url&&this.tabData.url.startsWith("page:")){const e=Number(this.tabData.url.slice("page:".length));if(!isNaN(e)&&et=>{if(!(t instanceof L))throw new Error("unsafeSVG
-
+
t=>{if(!(t instanceof L))throw new Error("unsafeSVG
-
+
Back
@@ -1107,7 +1107,7 @@ const re=new WeakMap,oe=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeSVG
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-const Dt=new WeakMap,Tt=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeHTML can only be used in text bindings");const i=Dt.get(t);if(void 0!==i&&$(e)&&e===i.value&&t.value===i.fragment)return;const a=document.createElement("template");a.innerHTML=e;const r=document.importNode(a.content,!0);t.setValue(r),Dt.set(t,{value:e,fragment:r})});var It=i(104),Et=i.n(It);class Rt extends ae{constructor(){super(),this.collInfo=null,this.curatedPageMap={},this.currList=0,this.active=!1,this.lastST=0,this.clickTime=0,this.isSidebar=!1,this.splitDirection=!1}static get properties(){return{collInfo:{type:Object},active:{type:Boolean},curatedPageMap:{type:Object},currList:{type:Number},isSidebar:{type:Boolean},splitDirection:{type:Boolean}}}recalcSplitter(e){this.splitDirection=this.isSidebar||e<769?"vertical":"horizontal"}firstUpdated(){this.recalcSplitter(document.documentElement.clientWidth),this.obs=new ResizeObserver((e,t)=>{this.recalcSplitter(e[0].contentRect.width)}),this.obs.observe(this)}updated(e){e.has("collInfo")&&this.doLoadCurated(),(e.has("collInfo")||e.has("isSidebar"))&&this.recalcSplitter(document.documentElement.clientWidth),e.has("splitDirection")&&this.configureSplitter(),e.has("currList")&&this.active&&this.sendChangeEvent({currList:this.currList})}configureSplitter(){const e=this.renderRoot.querySelector(".sidebar"),t=this.renderRoot.querySelector(".main-content");if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}if(e&&t&&!this.splitter){const i={sizes:[20,80],gutterSize:4,direction:this.splitDirection};this.splitter=Pt([e,t],i)}}async doLoadCurated(){this.curatedPageMap={};const e={};for(const t of this.collInfo.pages)e[t.id]=t;for(const t of this.collInfo.curatedPages){this.curatedPageMap[t.list]||(this.curatedPageMap[t.list]=[]);const i=e[t.page];if(!i){console.log("No Page with id: "+i);continue}const a=i.url,r=i.ts,o=i.title||i.url,n=t.desc;this.curatedPageMap[t.list].push({url:a,ts:r,title:o,desc:n})}this.scrollToList()}static get styles(){return be(te`
+const Dt=new WeakMap,Tt=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeHTML can only be used in text bindings");const i=Dt.get(t);if(void 0!==i&&$(e)&&e===i.value&&t.value===i.fragment)return;const a=document.createElement("template");a.innerHTML=e;const r=document.importNode(a.content,!0);t.setValue(r),Dt.set(t,{value:e,fragment:r})});var It=i(104),Et=i.n(It);class Ut extends ae{constructor(){super(),this.collInfo=null,this.curatedPageMap={},this.currList=0,this.active=!1,this.lastST=0,this.clickTime=0,this.isSidebar=!1,this.splitDirection=!1}static get properties(){return{collInfo:{type:Object},active:{type:Boolean},curatedPageMap:{type:Object},currList:{type:Number},isSidebar:{type:Boolean},splitDirection:{type:Boolean}}}recalcSplitter(e){this.splitDirection=this.isSidebar||e<769?"vertical":"horizontal"}firstUpdated(){this.recalcSplitter(document.documentElement.clientWidth),this.obs=new ResizeObserver((e,t)=>{this.recalcSplitter(e[0].contentRect.width)}),this.obs.observe(this)}updated(e){e.has("collInfo")&&this.doLoadCurated(),(e.has("collInfo")||e.has("isSidebar"))&&this.recalcSplitter(document.documentElement.clientWidth),e.has("splitDirection")&&this.configureSplitter(),e.has("currList")&&this.active&&this.sendChangeEvent({currList:this.currList})}configureSplitter(){const e=this.renderRoot.querySelector(".sidebar"),t=this.renderRoot.querySelector(".main-content");if(this.splitter){try{this.splitter.destroy()}catch(e){}this.splitter=null}if(e&&t&&!this.splitter){const i={sizes:[20,80],gutterSize:4,direction:this.splitDirection};this.splitter=Pt([e,t],i)}}async doLoadCurated(){this.curatedPageMap={};const e={};for(const t of this.collInfo.pages)e[t.id]=t;for(const t of this.collInfo.curatedPages){this.curatedPageMap[t.list]||(this.curatedPageMap[t.list]=[]);const i=e[t.page];if(!i){console.log("No Page with id: "+i);continue}const a=i.url,r=i.ts,o=i.title||i.url,n=t.desc;this.curatedPageMap[t.list].push({url:a,ts:r,title:o,desc:n})}this.scrollToList()}static get styles(){return be(te`
:host {
width: 100%;
height: 100%;
@@ -1128,7 +1128,7 @@ const Dt=new WeakMap,Tt=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeHTM
width: 100% !important;
}
- ${Rt.sidebarStyles(ee(":host(.sidebar)"))}
+ ${Ut.sidebarStyles(ee(":host(.sidebar)"))}
.desc p {
margin-bottom: 1.0em;
@@ -1174,7 +1174,7 @@ const Dt=new WeakMap,Tt=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeHTM
}
@media screen and (max-width: 768px) {
- ${Rt.sidebarStyles()}
+ ${Ut.sidebarStyles()}
}
.gutter.gutter-vertical:hover {
@@ -1260,7 +1260,7 @@ const Dt=new WeakMap,Tt=v(e=>t=>{if(!(t instanceof L))throw new Error("unsafeHTM
${e.desc}
- `}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts")};return this.sendChangeEvent(t),!1}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}onClickScroll(e){return e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list")),this.scrollToList(),!1}scrollToList(){this.currList>this.collInfo.lists.length&&(this.currList=0);const e={behavior:"smooth",block:"nearest",inline:"nearest"};this.clickTime=(new Date).getTime();const t=this.renderRoot.getElementById("list-"+this.currList);t&&t.scrollIntoView(e)}onScroll(e){const t=e.currentTarget,i=this.renderRoot.getElementById("list-"+this.currList);if(!i)return;let a=i;const r=t.offsetTop,o=t.scrollTop;if(o>this.lastST)for(;a.nextElementSibling&&a.nextElementSibling.getBoundingClientRect().top=r;)a=a.previousElementSibling;if(this.lastST=o,a&&a!=i&&a.id.startsWith("list-")&&(this.currList=Number(a.id.slice(5))),(new Date).getTime()-this.clickTime<1e3)return;const n=this.renderRoot.querySelector(`a[data-list="${this.currList}"]`);if(n){const e={behavior:"smooth",block:"nearest",inline:"nearest"};n.scrollIntoView(e)}}}customElements.define("wr-coll-story",Rt);var Ut=i(105),At=i.n(Ut);customElements.define("wr-gdrive",class extends ae{constructor(){super(),this.state="trypublic",this.sourceUrl="",this.scriptLoaded=!1,this.error=!1}static get properties(){return{state:{type:String},sourceUrl:{type:String},error:{type:Boolean},reauth:{type:Boolean}}}updated(e){e.has("sourceUrl")&&(this.error=!1,this.state="trypublic",this.tryPublicAccess().then(e=>{e||(this.state="tryauto",this.requestUpdate())}))}async tryPublicAccess(){try{const e=this.sourceUrl,t="https://helper-proxy.webrecorder.workers.dev/g/"+e.slice("googledrive://".length);let i=null;try{i=await fetch(t)}catch(e){return!1}const a=await i.json();if(!a.url||!a.name||!a.size)return!1;if(a.size>15e6)return!1;const r=a.url;try{const e=new AbortController,t=e.signal;if(i=await fetch(r,{signal:t}),e.abort(),200!=i.status)return!1}catch(e){return!1}const o=a.name,n={publicUrl:r},s=Number(a.size);return this.dispatchEvent(new CustomEvent("load-ready",{detail:{name:o,extra:n,size:s,sourceUrl:e}})),!0}catch(e){return!1}}onLoad(){this.scriptLoaded=!0,this.gauth("none",e=>{e.error?"implicitonly"!==this.state&&(this.state="trymanual"):this.authed(e)})}onClickAuth(){this.gauth("select_account",e=>{e.error||this.authed(e)})}async authed(e){const t=this.sourceUrl,i="https://www.googleapis.com/drive/v3/files/"+t.slice("googledrive://".length),a={Authorization:"Bearer "+e.access_token},r=await fetch(i+"?fields=name,size&supportsAllDrives=true",{headers:a});if(404===r.status||403==r.status)return"implicitonly"!==this.state&&(this.state="trymanual"),void(this.error=!0);this.error=!1;const o=await r.json(),n=o.name,s=Number(o.size);this.dispatchEvent(new CustomEvent("load-ready",{detail:{sourceUrl:t,headers:a,size:s,name:n}}))}static get styles(){return be(te``)}render(){return N`
+ `}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts")};return this.sendChangeEvent(t),!1}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}onClickScroll(e){return e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list")),this.scrollToList(),!1}scrollToList(){this.currList>this.collInfo.lists.length&&(this.currList=0);const e={behavior:"smooth",block:"nearest",inline:"nearest"};this.clickTime=(new Date).getTime();const t=this.renderRoot.getElementById("list-"+this.currList);t&&t.scrollIntoView(e)}onScroll(e){const t=e.currentTarget,i=this.renderRoot.getElementById("list-"+this.currList);if(!i)return;let a=i;const r=t.offsetTop,o=t.scrollTop;if(o>this.lastST)for(;a.nextElementSibling&&a.nextElementSibling.getBoundingClientRect().top=r;)a=a.previousElementSibling;if(this.lastST=o,a&&a!=i&&a.id.startsWith("list-")&&(this.currList=Number(a.id.slice(5))),(new Date).getTime()-this.clickTime<1e3)return;const n=this.renderRoot.querySelector(`a[data-list="${this.currList}"]`);if(n){const e={behavior:"smooth",block:"nearest",inline:"nearest"};n.scrollIntoView(e)}}}customElements.define("wr-coll-story",Ut);var Rt=i(105),At=i.n(Rt);customElements.define("wr-gdrive",class extends ae{constructor(){super(),this.state="trypublic",this.sourceUrl="",this.scriptLoaded=!1,this.error=!1}static get properties(){return{state:{type:String},sourceUrl:{type:String},error:{type:Boolean},reauth:{type:Boolean}}}updated(e){e.has("sourceUrl")&&(this.error=!1,this.state="trypublic",this.tryPublicAccess().then(e=>{e||(this.state="tryauto",this.requestUpdate())}))}async tryPublicAccess(){try{const e=this.sourceUrl,t="https://helper-proxy.webrecorder.workers.dev/g/"+e.slice("googledrive://".length);let i=null;try{i=await fetch(t)}catch(e){return!1}const a=await i.json();if(!a.url||!a.name||!a.size)return!1;if(a.size>15e6)return!1;const r=a.url;try{const e=new AbortController,t=e.signal;if(i=await fetch(r,{signal:t}),e.abort(),200!=i.status)return!1}catch(e){return!1}const o=a.name,n={publicUrl:r},s=Number(a.size);return this.dispatchEvent(new CustomEvent("load-ready",{detail:{name:o,extra:n,size:s,sourceUrl:e}})),!0}catch(e){return!1}}onLoad(){this.scriptLoaded=!0,this.gauth("none",e=>{e.error?"implicitonly"!==this.state&&(this.state="trymanual"):this.authed(e)})}onClickAuth(){this.gauth("select_account",e=>{e.error||this.authed(e)})}async authed(e){const t=this.sourceUrl,i="https://www.googleapis.com/drive/v3/files/"+t.slice("googledrive://".length),a={Authorization:"Bearer "+e.access_token},r=await fetch(i+"?fields=name,size&supportsAllDrives=true",{headers:a});if(404===r.status||403==r.status)return"implicitonly"!==this.state&&(this.state="trymanual"),void(this.error=!0);this.error=!1;const o=await r.json(),n=o.name,s=Number(o.size);this.dispatchEvent(new CustomEvent("load-ready",{detail:{sourceUrl:t,headers:a,size:s,name:n}}))}static get styles(){return be(te``)}render(){return N`
${this.script()}
${"trymanual"!==this.state?N`
Connecting to Google Drive...
diff --git a/webpack.config.js b/webpack.config.js
index 4b3fb47..e8f6d19 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -35,7 +35,7 @@ const electronMainConfig = (env, argv) => {
__APP_FILE_SERVE_PREFIX__ : JSON.stringify(APP_FILE_SERVE_PREFIX),
__HELPER_PROXY__ : JSON.stringify(HELPER_PROXY)
})
- ]
+ ],
}
};