/*! 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){function t(t){for(var i,r,o=t[0],n=t[1],s=0,c=[];s'},101:function(e,t){e.exports=''},102:function(e,t){e.exports=''},103:function(e,t,i){const a=i(123),r=i(125),o=i(65),n=i(66),s=i(67),l=i(68),{merge:c,checkSanitizeDeprecation:d,escape:h}=i(21),{getDefaults:f,changeDefaults:b,defaults:u}=i(20);function m(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({},m.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}}m.options=m.setOptions=function(e){return c(m.defaults,e),b(m.defaults),m},m.getDefaults=f,m.defaults=u,m.use=function(e){const t=c({},e);if(e.renderer){const i=m.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=m.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}m.setOptions(t)},m.Parser=r,m.parser=r.parse,m.Renderer=n,m.TextRenderer=s,m.Lexer=a,m.lexer=a.lex,m.Tokenizer=o,m.Slugger=l,m.parse=m,e.exports=m},104:function(e,t){e.exports=''},105: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()}}))}},106: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:T++,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[A])<(t=t[A])?-1:e>t?1:0}function u(e,t){const i=A.length;for(let a=0;at?1:0}function m(e,t,i){return e?{page:e,next:t?""+t:null,result:i}:i}function p(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=$();b._ctx=$();const u=o.length,m=this.threshold,p=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,m,g-1)}break;default:if(l=c(v,b,s,e,1,d,m,g-1),p&&1=m)for(l=b._ctx[s]||(b._ctx[s]=$()),s=this.h[s]||(this.h[s]=y(g-(m||0))),0>(d=t-p)&&(d=0),(h=t+p+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)},107:function(e,t){e.exports=''},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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\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",")|<(?: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",")|<(?: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",")|<(?:script|pre|style|!--)").replace("tag",n._tag).getRegex(),n.pedantic=o({},n.normal,{html:r("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\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-]*(?: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}):p+=x),p+=this.parse(g.tokens,m),h+=this.renderer.listitem(p,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{for(;t!==i;){const i=t.nextSibling;e.insertBefore(t,a),t=i}},o=(e,t,i=null)=>{for(;t!==i;){const i=t.nextSibling;e.removeChild(t),t=i}},n=`{{lit-${String(Math.random()).slice(2)}}}`,s=`\x3c!--${n}--\x3e`,l=new RegExp(`${n}|${s}`);class c{constructor(e,t){this.parts=[],this.element=t;const i=[],a=[],r=document.createTreeWalker(t.content,133,null,!1);let o=0,s=-1,c=0;const{strings:h,values:{length:u}}=e;for(;c0;){const t=h[c],i=b.exec(t)[2],a=i.toLowerCase()+"$lit$",r=e.getAttribute(a);e.removeAttribute(a);const o=r.split(l);this.parts.push({type:"attribute",index:s,name:i,strings:o}),c+=o.length-1}}"TEMPLATE"===e.tagName&&(a.push(e),r.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(n)>=0){const a=e.parentNode,r=t.split(l),o=r.length-1;for(let t=0;t{const i=e.length-t.length;return i>=0&&e.slice(i)===t},h=e=>-1!==e.index,f=()=>document.createComment(""),b=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function u(e,t){const{element:{content:i},parts:a}=e,r=document.createTreeWalker(i,133,null,!1);let o=g(a),n=a[o],s=-1,l=0;const c=[];let d=null;for(;r.nextNode();){s++;const e=r.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(c.push(e),null===d&&(d=e)),null!==d&&l++;void 0!==n&&n.index===s;)n.index=null!==d?-1:n.index-l,o=g(a,o),n=a[o]}c.forEach(e=>e.parentNode.removeChild(e))}const m=e=>{let t=11===e.nodeType?0:1;const i=document.createTreeWalker(e,133,null,!1);for(;i.nextNode();)t++;return t},g=(e,t=-1)=>{for(let i=t+1;i(...t)=>{const i=e(...t);return v.set(i,!0),i},x=e=>"function"==typeof e&&v.has(e),k={},y={}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ class ${constructor(e,t,i){this.__parts=[],this.template=e,this.processor=t,this.options=i}update(e){let t=0;for(const i of this.__parts)void 0!==i&&i.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=a?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],i=this.template.parts,r=document.createTreeWalker(e,133,null,!1);let o,n=0,s=0,l=r.nextNode();for(;n-1||i)&&-1===e.indexOf("--\x3e",r+1);const o=b.exec(e);t+=null===o?e+(i?S:s):e.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+n}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * 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),C=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class P{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 I=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class E{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(;x(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=k,e(this)}if(this.__pendingValue===k)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=k}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const U=e=>e&&(I?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */;function j(e){let t=N.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},N.set(e.type,t));let i=t.stringsArray.get(e.strings);if(void 0!==i)return i;const a=e.strings.join(n);return i=t.keyString.get(a),void 0===i&&(i=new c(e,e.getTemplateElement()),t.keyString.set(a,i)),t.stringsArray.set(e.strings,i),i}const N=new Map,M=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */const q=new /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * 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 A(e,t.slice(1),i).parts}return"@"===r?[new E(e,t.slice(1),a.eventContext)]:"?"===r?[new R(e,t.slice(1),i)]:new P(e,t,i).parts}handleTextExpression(e){return new L(e)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.2.1");const O=(e,...t)=>new z(e,t,"html",q),B=(e,t)=>`${e}--${t}`;let G=!0;void 0===window.ShadyCSS?G=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),G=!1);const H=e=>t=>{const i=B(t.type,e);let a=N.get(i);void 0===a&&(a={stringsArray:new WeakMap,keyString:new Map},N.set(i,a));let r=a.stringsArray.get(t.strings);if(void 0!==r)return r;const o=t.strings.join(n);if(r=a.keyString.get(o),void 0===r){const i=t.getTemplateElement();G&&window.ShadyCSS.prepareTemplateDom(i,e),r=new c(t,i),a.keyString.set(o,r)}return a.stringsArray.set(t.strings,r),r},F=["html","svg"],W=new Set,V=(e,t,i)=>{W.add(e);const a=i?i.element:document.createElement("template"),r=t.querySelectorAll("style"),{length:o}=r;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(a,e);const n=document.createElement("style");for(let e=0;e{F.forEach(t=>{const i=N.get(B(t,e));void 0!==i&&i.keyString.forEach(e=>{const{element:{content:t}}=e,i=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{i.add(e)}),u(e,i)})})})(e);const s=a.content;i?function(e,t,i=null){const{element:{content:a},parts:r}=e;if(null==i)return void a.appendChild(t);const o=document.createTreeWalker(a,133,null,!1);let n=g(r),s=0,l=-1;for(;o.nextNode();){for(l++,o.currentNode===i&&(s=m(t),i.parentNode.insertBefore(t,i));-1!==n&&r[n].index===l;){if(s>0){for(;-1!==n;)r[n].index+=s,n=g(r,n);return}n=g(r,n)}}}(i,n,s.firstChild):s.insertBefore(n,s.firstChild),window.ShadyCSS.prepareTemplateStyles(a,e);const l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(i){s.insertBefore(n,s.firstChild);const e=new Set;e.add(n),u(i,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const K={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},Z=(e,t)=>t!==e&&(t==t||e==e),J={attribute:!0,type:String,converter:K,reflect:!1,hasChanged:Z};class Y extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,i)=>{const a=this._attributeNameForProperty(i,t);void 0!==a&&(this._attributeToPropertyMap.set(a,i),e.push(a))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=J){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const i="symbol"==typeof e?Symbol():"__"+e,a=this.getPropertyDescriptor(e,i,t);void 0!==a&&Object.defineProperty(this.prototype,e,a)}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(i){const a=this[e];this[t]=i,this._requestUpdate(e,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||J}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const i of t)this.createProperty(i,e[i])}}static _attributeNameForProperty(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,i=Z){return i(e,t)}static _propertyValueFromAttribute(e,t){const i=t.type,a=t.converter||K,r="function"==typeof a?a:a.fromAttribute;return r?r(e,i):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const i=t.type,a=t.converter;return(a&&a.toAttribute||K.toAttribute)(e,i)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,i){t!==i&&this._attributeToProperty(e,i)}_propertyToAttribute(e,t,i=J){const a=this.constructor,r=a._attributeNameForProperty(e,i);if(void 0!==r){const e=a._propertyValueToAttribute(t,i);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(r):this.setAttribute(r,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const i=this.constructor,a=i._attributeToPropertyMap.get(e);if(void 0!==a){const e=i.getPropertyOptions(a);this._updateState=16|this._updateState,this[a]=i._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}_requestUpdate(e,t){let i=!0;if(void 0!==e){const a=this.constructor,r=a.getPropertyOptions(e);a._valueHasChanged(this[e],t,r.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==r.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,r))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this._requestUpdate(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}Y.finalized=!0; /** @license Copyright (c) 2019 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ const Q="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol();class ee{constructor(e,t){if(t!==X)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(Q?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const te=(e,...t)=>{const i=t.reduce((t,i,a)=>t+(e=>{if(e instanceof ee)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[a+1],e[0]);return new ee(i,X)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ (window.litElementVersions||(window.litElementVersions=[])).push("2.3.1");const ie={};class ae extends Y{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(void 0===e)this._styles=[];else if(Array.isArray(e)){const t=(e,i)=>e.reduceRight((e,i)=>Array.isArray(i)?t(i,e):(e.add(i),e),i),i=t(e,new Set),a=[];i.forEach(e=>a.unshift(e)),this._styles=a}else this._styles=[e]}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==ie&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return ie}}ae.finalized=!0,ae.render=(e,t,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const a=i.scopeName,r=M.has(t),n=G&&11===t.nodeType&&!!t.host,s=n&&!W.has(a),l=s?document.createDocumentFragment():t;if(((e,t,i)=>{let a=M.get(t);void 0===a&&(o(t,t.firstChild),M.set(t,a=new L(Object.assign({templateFactory:j},i))),a.appendInto(t)),a.setValue(e),a.commit()})(e,l,Object.assign({templateFactory:H(a)},i)),s){const e=M.get(l);M.delete(l);const i=e.value instanceof $?e.value.template:void 0;V(a,l,i),o(t,t.firstChild),t.appendChild(l),M.set(t,e)}!r&&n&&window.ShadyCSS.styleElement(t.host)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ const re=new WeakMap,oe=w(e=>t=>{if(!(t instanceof L))throw new Error("unsafeSVG can only be used in text bindings");const i=re.get(t);if(void 0!==i&&_(e)&&e===i.value&&t.value===i.fragment)return;const a=document.createElement("template");a.innerHTML=`${e}`;const o=a.content,n=o.firstChild;o.removeChild(n),r(o,n.firstChild);const s=document.importNode(o,!0);t.setValue(s),re.set(t,{value:e,fragment:s})}),ne=new WeakMap,se=w(e=>t=>{if(!(t instanceof T)||t instanceof D||"style"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=t,{style:a}=i.element;let r=ne.get(t);void 0===r&&(a.cssText=i.strings.join(" "),ne.set(t,r=new Set)),r.forEach(t=>{t in e||(r.delete(t),-1===t.indexOf("-")?a[t]=null:a.removeProperty(t))});for(const t in e)r.add(t),-1===t.indexOf("-")?a[t]=e[t]:a.setProperty(t,e[t])});var le=i(92),ce=i.n(le),de=i(53),he=i.n(de);const fe=(be=ce.a,new ee(String(be),X));var be;function ue(e){return[fe,e]}const me=window.IS_APP||window.electron&&window.electron.IS_APP||window.matchMedia("(display-mode: standalone)").matches;class pe extends ae{constructor(){super(),this.size="1.1em",this.width=null,this.height=null}static get properties(){return{svg:{type:String},size:{type:String},width:{type:String},height:{type:String}}}static get styles(){return te` :host { display: inline-block; padding: 0; margin: 0; line-height: 1.0em; } :host svg { fill: var(--fa-icon-fill-color, currentcolor); width: var(--fa-icon-width, 19px); height: var(--fa-icon-height, 19px); } `}render(){if(!this.svg)return O``;const e={};return this.size?(e.width=this.size,e.height=this.size):(this.width&&(e.width=this.width),this.height&&(e.height=this.height)),O`${oe(this.svg)}`}}customElements.define("fa-icon",pe),customElements.define("wr-anim-logo",class extends pe{constructor(){super(),this.svg=he.a}static get styles(){return te` #wrlogo #stop5687 { animation: animLeft 7s linear infinite; } #wrlogo #stop5689 { animation: animRight 7s linear infinite; } @keyframes animLeft { 0% {stop-color: #4876ff} 25% {stop-color: #1b0921} 50% {stop-color: #4876ff} 75% {stop-color: #04cdff} 100% {stop-color: #4876ff} } @keyframes animRight { 0% {stop-color: #04cdff} 25% {stop-color: #4876ff} 50% {stop-color: #1b0921} 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 $e=null;function Se(){return null===$e&&($e=new Worker("sw.js")),$e}function ze(e){return e.replace(/[-:T]/g,"").slice(0,14)}async function _e(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 Ce=i(8),Pe=i.n(Ce),Te=i(93),Le=i.n(Te),Re=i(29),Ae=i.n(Re),De=i(30),Ie=i.n(De),Ee=i(94),Ue=i.n(Ee);customElements.define("replay-app-main",class extends ae{constructor(){super(),this.sourceUrl=null,this.collInfo=null,this.showTerms=!1,this.pageParams={},this.inited=!1,ye("sw.js"),Se()}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 ue(te` #wrlogo { max-height: 2.5rem; } .wr-logo-item { padding-right: 8px; } .has-allcaps { font-variant-caps: small-caps; } :host { position: fixed; left: 0px; top: 0px; bottom: 0px; right: 0px; display: flex; flex-direction: column; } wr-coll { height: 100%; } .navbar { padding: 0 0.5em; } div.navbar-menu fa-icon { vertical-align: sub; } .tagline { margin-top: 1.0rem; } @media screen and (min-width: 840px) { .menu-only { display: none; } a.arrow-button { padding-left: 4px; padding-right: 4px; } .info-menu { padding: 0 1.0em; } .logo-text { padding-left: 0px; } a.navbar-item.logo-text:hover { background-color: initial; } } @media screen and (max-width: 840px) { .wide-only { display: none; } } `)}render(){return this.inited?O` ${this.embed&&"full"!==this.embed?"":O` `} ${this.sourceUrl?O` `:O` ${me?"":O`

Explore and Replay Interactive Archived Webpages Directly in your Browser. (See Examples)

`}
`} ${this.showTerms?O` `:""} `:O``}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)}}onNavMenu(e){e.stopPropagation(),this.navMenuShown=!this.navMenuShown,this.navMenuShown&&document.addEventListener("click",()=>{this.navMenuShown=!1},{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())}});var je=i(95),Ne=i.n(je);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 ue(te` .extra-padding { padding: 2em; } .less-padding { padding-top: 1.0em; padding-bottom: 1.0em; } div.field.has-addons { flex: auto; } .panel-heading { background-color: #cff3ff; } form { flex-grow: 1; flex-shrink: 0; } input.input.file-name:invalid { border: 1px dashed red; } input.input.file-name { max-width: 100%; border-width: 1px; margin-left: -1px; } @media screen and (max-width: 1023px) { .file-icon { margin-right: 0px; } } @media screen and (max-width: 768px) { #filename { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } } `)}render(){return O`
`}});var Me=i(96),qe=i.n(Me),Oe=i(97),Be=i.n(Oe),Ge=i(98),He=i.n(Ge),Fe=i(18),We=i.n(Fe);class Ve extends ae{constructor(){super(),this.colls=[],this.filteredColls=[],this.sortedColls=[],this.query="",this.hideHeader="1"===localStorage.getItem("index:hideHeader"),this._deleting={}}static get sortKeys(){return[{key:"title",name:"Title"},{key:"sourceUrl",name:"Source"},{key:"ctime",name:"Date Loaded"},{key:"size",name:"Total Size"}]}static get properties(){return{colls:{type:Array},query:{type:String},filteredColls:{type:Array},sortedColls:{type:Array},hideHeader:{type:Boolean},_deleting:{type:Object}}}firstUpdated(){this.loadColls()}updated(e){e.has("hideHeader")&&localStorage.setItem("index:hideHeader",this.hideHeader?"1":"0"),(e.has("colls")||e.has("query"))&&this.filter()}filter(){if(this.query){this.filteredColls=[];for(const e of this.colls)(e.sourceUrl.indexOf(this.query)>=0||e.filename.indexOf(this.query)>=0||e.title&&e.title.indexOf(this.query)>=0)&&this.filteredColls.push(e)}else this.filteredColls=this.colls}async loadColls(){const e=await fetch("./wabac/api/index");try{const t=await e.json();this.colls=t.colls.map(e=>(e.title=e.title||e.filename,e))}catch(e){}this._deleting={}}async onDeleteColl(e){if(e.preventDefault(),e.stopPropagation(),!this.sortedColls)return;const t=Number(e.currentTarget.getAttribute("data-coll-index")),i=this.sortedColls[t];if(!i||this._deleting[i.sourceUrl])return;this._deleting[i.sourceUrl]=!0,this.requestUpdate();const a=await fetch("./wabac/api/"+i.id,{method:"DELETE"});if(200===a.status){const e=await a.json();this.colls=e.colls}return!1}static get styles(){return ue(te` :host { overflow-y: auto; } .size { margin-right: 20px; } .extra-padding { padding: 2em; } .no-top-padding { padding-top: 1.0em; } button.is-loading { line-height: 1.5em; height: 1.5em; border: 0px; background-color: transparent !important; width: auto; } nav.panel.is-light { margin-bottom: 2em; } fa-icon { vertical-align: middle; } .copy { color: black; margin: 0px; margin: 0; line-height: 0.4em; padding: 6px; border-radius: 10px; display: none; position: absolute; } .copy:active { background-color: lightgray; } .sort-header { padding: 0.3rem 0.3rem 0.3rem 0; display: flex; flex-direction: row; flex-flow: row wrap; } .sort-header .control { flex: auto; padding-left: 0.3rem; width: initial; } wr-sorter { padding: 0.3rem; } a.button.is-small.collapse { border-radius: 6px; } .icon.is-left { margin-left: 0.5rem; } .columns { width: 100vw; } .column { word-break: break-word; position: relative; } .col-title:hover { } .col-title a { display: block; height: 100%; } .column:hover > .copy, .source-text:hover + .copy, .copy:hover { display: inline; } .coll-block { position: relative; } .delete { position: absolute; top: 10px; right: 10px; } .minihead { font-size: 10px; font-weight: bold; } #sort-select::after { display: none; } header { transform: translate(0px, 0px); transition: all 0.5s ease 0s; visibility: visible; display: flex; flex-direction: column; } header.closed { transform: translate(0, -100%); transition: all 0.5s ease 0s; visibility: visible; height: 269px; margin-top: -269px; } `)}render(){return O`
`}onCopy(e,t){return e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(t),!1}}customElements.define("wr-coll-index",Ve);var Ke=i(99),Ze=i.n(Ke),Je=i(59),Ye=i.n(Je),Qe=i(100),Xe=i.n(Qe),et=i(101),tt=i.n(et),it=i(60),at=i.n(it),rt=i(61),ot=i.n(rt),nt=i(62),st=i.n(nt),lt=i(102),ct=i.n(lt),dt=(i(64),i(54));!function(){if(void 0!==window.Reflect&&void 0!==window.customElements){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}();class ht 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","replay"],this.menuActive=!1,this.hasStory=!1,this.editable=!1,this.showSidebar="1"===localStorage.getItem("pages:showSidebar")}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}}}firstUpdated(){var e;this.inited=!0,window.addEventListener("hashchange",e=>this.onHashChange(e)),this.addEventListener("fullscreenchange",e=>{this.isFullscreen=!!document.fullscreenElement}),window,Object(dt.a)().then((function(){Object(dt.b)([["split-me",[[1,"split-me",{n:[2],d:[1],fixed:[4],sizes:[1],minSizes:[1,"min-sizes"],maxSizes:[1,"max-sizes"],throttle:[2],slotEnd:[32]}]]]],e)}))}updated(e){if(e.has("sourceUrl")&&this.doUpdateInfo(),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("replay"!==this.tabData.view&&(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 window.location.hash=this._locationHash;this.embed&&window.parent!==window&&window.parent.postMessage(this.tabData,"*")}this._locUpdateNeeded=!1}}async doUpdateInfo(){let e=this.loadInfo&&this.loadInfo.customColl;if(!e){e=(await _e(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),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}}))}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}}this.hasStory||"story"!==this.tabData.view||(this.tabData.view="pages"),"replay"===this.tabData.view&&this.tabData.query&&(this.showSidebar=!0)}onTabClick(e){e.preventDefault();const t=e.currentTarget.getAttribute("href");return this.tabData={...this.tabData,view:t.slice(1)},!1}onCollTabNav(e){if(e.target.id===this.tabData.view)this.updateTabData(e.detail.data,e.detail.replaceLoc,!1);else if(this.showSidebar&&"pages"===e.target.id&&"replay"===this.tabData.view){if(!1===e.detail.data.showSidebar)return void(this.showSidebar=!1);this.updateTabData(e.detail.data,e.detail.replaceLoc,!0)}}updateTabData(e,t=!1,i=!1){this.tabData={...this.tabData,...e},this.tabData.url&&(this.url=this.tabData.url||""),this.tabData.ts&&(this.ts=this.tabData.ts||""),this._replaceLoc=!this._locUpdateNeeded&&t,this._locUpdateNeeded=!0}static get styles(){return ue(te` :host { display: flex; flex-direction: column; height: 100%; } .icon { vertical-align: text-top; } .back fa-icon { width: 1.5em; vertical-align: bottom; line-height: 0.5em; } li.is-active { font-weight: bold; } .tab-label { display: inline; } @media screen and (max-width: ${me?te`1163px`:te`1053px`}) { .tab-label { display: none; } .main.tabs span.icon { margin: 0px; } } .main.tabs { display: flex; flex-direction: row; margin-bottom: 0px; } .main.tabs li { line-height: 1.5; padding: 8px 0 6px 0; } @media screen and (max-width: 319px) { .main.tabs li a { padding-right: 4px; padding-left: 4px; } } #contents { height: 100%; width: 100%; display: flex; flex-direction: row; min-height: 0px; flex: auto; } ${ht.replayBarStyles} `)}static get replayBarStyles(){return te` .replay-bar { padding: 1em; max-width: none; border-bottom: solid .1rem #97989A; width: 100%; background-color: white; } input#url { border-radius: 4px; } #datetime { position: absolute; right: 1em; z-index: 10; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #FFF 15%, #FFF); margin: -35px 0 0 0px; padding-left: 3em; line-height: 2; } .menu-head { font-size: 10px; font-weight: bold; display: block; } .menu-logo { vertical-align: middle; } .menu-version { font-size: 10px; } .dropdown-item.info { font-style: italic; } input:focus + #datetime { display: none; } .grey-disabled { --fa-icon-fill-color: lightgrey; color: lightgrey; } .replay-bar .button:focus { box-shadow: none; } .dropdown .button { padding-right: 0px; } .is-borderless { border: 0px; } .modal { top: 174px; } form { width: 100%; } .sidebar { transition: transform 0.5s; opacity: 1.0; } split-me { --phantom-divider-thickness: 4px; --divider-thickness: 0.1rem; --divider-color: rgb(151, 152, 154); --divider-shadow: 0; width: 100%; height: 100%; display: block; } wr-page-view, wr-coll-replay { width: 100%; } `}render(){return this.inited?this.collInfo&&!this.collInfo.coll?O` `:this.collInfo?O` ${this.renderLocationBar()} ${this.renderTabHeader()} `:O``:O``}renderTabHeader(){return"replay"===this.tabData.view?"":O`
`}renderLocationBar(){if("replayonly"===this.embed)return"";const e=function(e){if(!e)return"";e.length<14&&(e+="00000000000000".substr(e.length));const t=e.substring(0,4)+"-"+e.substring(4,6)+"-"+e.substring(6,8)+"T"+e.substring(8,10)+":"+e.substring(10,12)+":"+e.substring(12,14)+"-00:00";return new Date(t)}(this.ts).toLocaleString(),t="replay"===this.tabData.view;return O`
${t?O`

${e}

`:O``}
`}dragStart(e){const t=this.renderRoot.querySelector("wr-coll-replay");t&&t.setDisablePointer(!0),e.path[0].addEventListener("mouseup",e=>this.dragEnd(),{once:!0})}dragEnd(){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.setDisablePointer(!1)}renderCollTabs(){const e="story"===this.tabData.view,t="pages"===this.tabData.view,i="resources"===this.tabData.view,a="replay"===this.tabData.view,r=a&&this.showSidebar;return O` ${this.hasStory?O` `:""} ${a?O` `:""} `}onKeyDown(e){"Esc"!==e.key&&"Escape"!==e.key||(e.target.value=this.url)}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",()=>{this.menuActive=!1},{once:!0})}onFullscreenToggle(){this.menuActive=!1,this.isFullscreen?document.exitFullscreen():this.requestFullscreen()}onGoBack(){this.menuActive=!1,window.history.back()}onGoForward(){this.menuActive=!1,window.history.forward()}onShowPages(e){e.preventDefault(),this.showSidebar||document.documentElement.clientWidth>=769?this.showSidebar=!this.showSidebar:this.tabData&&"replay"===this.tabData.view&&this.updateTabData({view:"pages"}),localStorage.setItem("pages:showSidebar",this.showSidebar?"1":"0")}onReAuthed(e){this.reauthWait=(async()=>{const t=e.detail.headers;await fetch(this.collInfo.apiPrefix+"/updateAuth",{method:"POST",body:JSON.stringify({headers:t})});this.showAuth&&(this.onRefresh(null,!0),this.showAuth=!1)})()}async onPurgeCache(e){e.preventDefault();const t=await fetch(""+this.collInfo.apiPrefix,{method:"DELETE"});200===t.status&&window.parent?window.parent.location.reload():console.warn("purge failed: "+t.status)}onSubmit(e){e.preventDefault();const t=this.renderRoot.querySelector("input").value;return this.navigateTo(t),!1}navigateTo(e){let t;t=e.startsWith("http://")||e.startsWith("https://")?{url:e,view:"replay"}:e.startsWith("search://")?this._stringToParams(e):{query:e,view:"pages"},this.updateTabData(t)}_stringToParams(e){const t=new URLSearchParams(e.slice("search://".length)),i={};for(const e of["query","view","currList","currMime","urlSearchType"])t.has(e)&&(i[e]=t.get(e));return i}_paramsToString(e){const t=new URLSearchParams;for(const i of["query","view","currList","currMime","urlSearchType"])i in e&&t.set(i,e[i]);return t.toString()}onRefresh(e,t){if(e&&e.preventDefault(),this.menuActive=!1,"replay"===this.tabData.view){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.refresh()}else window.location.reload()}}customElements.define("wr-coll",ht); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ const ft=new WeakMap,bt=w(e=>t=>{if(!(t instanceof L))throw new Error("unsafeHTML can only be used in text bindings");const i=ft.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),ft.set(t,{value:e,fragment:r})});var ut=i(103),mt=i.n(ut);customElements.define("wr-coll-story",class extends ae{constructor(){super(),this.collInfo=null,this.curatedPageMap={},this.currList=0,this.active=!1,this.lastST=0,this.clickTime=0}static get properties(){return{collInfo:{type:Object},active:{type:Boolean},curatedPageMap:{type:Object},currList:{type:Number}}}updated(e){e.has("collInfo")&&this.doLoadCurated(),e.has("currList")&&this.active&&this.sendChangeEvent({currList:this.currList})}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 ue(te` :host { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; } .columns { width: 100%; height: 100%; justify-self: stretch; margin: 1.0em 0 0 0; min-height: 0; } .column.main-content { min-height: 0; display: flex; flex-direction: column; padding: 0px; margin-left: 0.75em; } .column.main-content.main-scroll { padding-right: 0.75em; word-break: break-all; } ul.menu-list a.is-active { background-color: #55be6f; } ol { margin-left: 30px; } @media screen and (min-width: 768px) { .columns { margin-top: 0.75em; } .column.sidebar { max-height: 100%; overflow-y: auto; } } @media screen and (max-width: 767px) { .columns { position: relative; } .column.sidebar { max-height: 150px; overflow-y: auto; margin-top: 0.75em; } .column.main-content { position: relative; overflow-y: auto; border-top: 1px solid black; height: 100%; max-height: calc(100% - 150px - 0.75em); } .menu { font-size: 0.80rem; } } `)}render(){const e=this.currList;return O`

${this.collInfo.title}

${this.collInfo.desc?bt(mt()(this.collInfo.desc)):""}
${this.renderLists()}
`}renderLists(){return O` ${this.collInfo.lists.map((e,t)=>O`

${e.title}

${e.desc}

    ${this.curatedPageMap[e.id]?this.curatedPageMap[e.id].map(e=>this.renderCPage(e)):O``}
`)}`}renderCPage(e){const t=new Date(e.ts);return O`
  • ${e.url}

    ${t.toLocaleString()}

    ${e.desc}


  • `}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts"),view:"replay"};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)}}});var pt=i(104),gt=i.n(pt);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 ue(te``)}render(){return O` ${this.script()} ${"trymanual"!==this.state?O`

    Connecting to Google Drive...

    `:O` ${this.error?O`

    ${this.reauth?"Some resources are loaded on demand from Google Drive, which requires reauthorization.":"Could not access this file with the current Google Drive account."}

    If you have multiple Google Drive accounts, be sure to select the correct one.


    `:""} `}`}script(){if("trypublic"===this.state||this.scriptLoaded)return O``;const e=document.createElement("script");return e.onload=()=>this.onLoad(),e.src="https://apis.google.com/js/platform.js",e}gauth(e,t){gapi.load("auth2",()=>{gapi.auth2.authorize({client_id:"160798412227-tko4c82uopud11q105b2lvbogsj77hlg.apps.googleusercontent.com",scope:"https://www.googleapis.com/auth/drive.file",response_type:"token",prompt:e},t)})}});customElements.define("wr-loader",class extends ae{constructor(){super(),this.progress=0,this.total=0,this.percent=0,this.coll="",this.state="waiting",this.loadInfo=null,this.currentSize=0,this.totalSize=0,this.dbworker=Se()}static get properties(){return{sourceUrl:{type:String},loadInfo:{type:Object},state:{type:String},progress:{type:Number},percent:{type:Number},currentSize:{type:Number},totalSize:{type:Number},error:{type:String},total:{type:Number},status:{type:String},coll:{type:String},embed:{type:String}}}firstUpdated(e){this.initMessages()}initMessages(){this.dbworker.addEventListener("message",e=>{switch(e.data.msg_type){case"collProgress":e.data.name===this.coll&&(this.percent=e.data.percent,e.data.error&&(this.error=e.data.error,this.state="errored"),e.data.currentSize&&e.data.totalSize&&(this.currentSize=e.data.currentSize,this.totalSize=e.data.totalSize));break;case"collAdded":e.data.name===this.coll&&(this.total||(this.total=100),this.progress=this.total,this.percent=100,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:e.data})))}})}async doLoad(){let e=this.sourceUrl,t=null;if(this.percent=this.currentSize=this.totalSize=0,!navigator.serviceWorker)return this.state="errored",void(this.error="Sorry, this browser is not supported. Please try a different browser\n(If you're using Firefox, try without Private Mode)");try{const{scheme:i,host:a,path:r}=function(e){let t=e.indexOf("://"),i=0,a="",r="",o="";return t>=0?(a=e.slice(0,t),t+=3):(t++,e.startsWith("//")&&(t+=2)),i=e.indexOf("/",t),i>0?(r=e.slice(t,i),o=e.slice(i)):(r=e.slice(t),o=""),{scheme:a,host:r,path:o}}(e);switch(i){case"googledrive":this.state="googledrive",t=await this.googledriveInit();break;case"s3":t={sourceUrl:e,loadUrl:`https://${a}.s3.amazonaws.com${r}`,name:this.sourceUrl};break;case"file":if(!this.loadInfo)return this.state="errored",void(this.error="File URLs can not be entered directly or shared.\nYou can select a file to upload from the main page by clicking the 'Choose File...' button.");t=this.loadInfo}}catch(e){}t||(t={sourceUrl:e}),this.state="started";const i={msg_type:"addColl",name:this.coll,skipExisting:!0,file:t};this.loadInfo&&this.loadInfo.extraConfig&&(i.extraConfig=this.loadInfo.extraConfig),this.dbworker.postMessage(i)}googledriveInit(){return this._gdWait=new Promise(e=>this._gdResolve=e),this._gdWait}async onLoadReady(e){this._gdResolve&&this._gdResolve(e.detail)}onCancel(){this.dbworker.postMessage({msg_type:"cancelLoad",name:this.coll})}updated(e){this.sourceUrl&&e.has("sourceUrl")&&this.doLoad()}static get styles(){return ue(te` :host { height: 100%; display: flex; } .logo { width: 96px; height: 96px; margin: 1em; flex-grow: 1; } .progress-div { position: relative; width: 400px !important; } .progress-label { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: calc(1.5rem / 1.5); line-height: 1.5rem; } .loaded-prog { margin-bottom: 1em; } .error { white-space: pre-wrap; margin-bottom: 2em; } section.container { margin: auto; } `)}render(){return O`
    ${this.embed?"":O`

    Loading ${this.sourceUrl}...

    `}
    ${this.renderContent()}
    `}renderContent(){switch(this.state){case"googledrive":return O``;case"started":return O`
    ${this.currentSize&&this.totalSize?O`

    Loaded ${Pe()(this.currentSize)} of ${Pe()(this.totalSize)}

    `:O``} ${this.embed?"":O` `}
    `;case"errored":return O`
    ${this.error}
    `;case"waiting":default:return O``}}});var vt=i(105),wt=i.n(vt),xt=i(106),kt=i.n(xt),yt=i(107),$t=i.n(yt),St=i(108),zt=i.n(St),_t=i(109),Ct=i.n(_t);class Pt extends ae{constructor(){super(),this.filteredPages=[],this.sortedPages=[],this.query="",this.flex=null,this.newQuery=null,this.loading=!1,this.updatingSearch=!1,this.currList=0,this.active=!1,this.editable=!1,this.changeNeeded=!1,this.selectedPages=new Set,this.menuActive=!1,this.sortKey="ts",this.sortDesc=!0,this.isSidebar=!1,this.url="",this.ts=""}static get sortKeys(){return[{key:"",name:"Best Match"},{key:"title",name:"Title"},{key:"ts",name:"Date"}]}static get properties(){return{active:{type:Boolean},collInfo:{type:Object},currList:{type:Number},filteredPages:{type:Array},sortedPages:{type:Array},query:{type:String},loading:{type:Boolean},updatingSearch:{type:Boolean},editable:{type:Boolean},selectedPages:{type:Set},allSelected:{type:Boolean},menuActive:{type:Boolean},sortKey:{type:String},sortDesc:{type:Boolean},isSidebar:{type:Boolean},url:{type:String},ts:{type:String}}}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null,this.filter())}async updated(e){if(e.has("collInfo")?this.updateTextSearch():e.has("query")?(this.filter(),this.sortKey=this.query?"":"ts",this.sortDesc=!this.query):e.has("currList")&&this.filter(),e.has("active")&&this.active&&this.changeNeeded&&this.filter(),e.has("sortedPages")&&this.isSidebar){const e=this.renderRoot.querySelector(".current");if(e){const t={behavior:"smooth",block:"nearest",inline:"nearest"};setTimeout(()=>e.scrollIntoView(t),100)}}}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout(()=>this._timedUpdate(),250)}async filter(){if(this.loading)return;if(this.active||(this.changeNeeded=!0),this.loading=!0,this.flex&&this.query){const e=await this.flex.search(this.query,{limit:25});this.filteredPages=e}else this.filteredPages=[...this.collInfo.pages];0!==this.currList&&await this.filterCurated(),this.loading=!1,this.changeNeeded=!1;const e={query:this.query,currList:this.currList};this.sendChangeEvent(e)}async filterCurated(){const e=await fetch(`${this.collInfo.apiPrefix}/curated/${this.currList}`),t=await e.json(),i=[];for(const e of t.curated)for(const t of this.filteredPages)if(t.id===e.page){i.push(t);break}this.filteredPages=i}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}async updateTextSearch(){if(this.updatingSearch)return;this.updatingSearch=!0;let e=0;try{const i=new kt.a({doc:{id:"id",field:["url","title","text"]},async:!0});this.flex=i;const a=await caches.open("cache:"+this.collInfo.coll),r=this.collInfo.apiPrefix+"/textIndex";let o=await a.match(r);o&&Number(o.headers.get("Content-Length"))||(o=await fetch(this.collInfo.apiPrefix+"/textIndex"),200===o.status&&Number(o.headers.get("Content-Length"))&&a.put(r,o.clone()));let n=[];async function t(){let t=n;n=[],await i.add(t),console.log("added "+e+" "+t.length),console.log(i.info())}for await(const i of wt()(o.body.getReader()))i.text&&(i.id=++e,n.push(i),e%100==0&&await t());await t()}finally{0===e&&this.flex.add(this.collInfo.pages),this.updatingSearch=!1}await this.filter()}static get styles(){return ue(te` :host { width: 100%; height: 100%; display: flex; min-width: 0px; flex-direction: column; box-sizing: border-box !important; } .main.columns { width: 100%; justify-self: stretch; min-height: 0px; margin: 0px; } .header.columns { width: 100%; margin-bottom: 0px; } .header a { color: black; } .header .column.pagetitle { margin-left: 2.5em; } .column.main-content { min-height: 0px; display: flex; flex-direction: column; padding: 0px; margin-top: 0.5em; margin-left: 0.75em; } .index-bar { display: flex; flex-direction: column; border-right: 3px solid rgb(237, 237, 237); background-color: whitesmoke; padding-right: 0px; } .index-bar-title { font-size: 1.25rem; text-transform: uppercase; margin-bottom: 1.0rem; word-break: break-word; } .index-bar-status { display: flex; flex-direction: row; margin-bottom: 0.5rem; padding-right: 0.75em; } .index-bar-menu { margin-top: 1.0rem; } #filter-label { margin-bottom: 0px; } .num-results { font-style: italic; font-weight: normal; line-height: 2.5; } .asc:after { content: "▼"; font-size: 0.75em; } .desc:after { content: "▲"; font-size: 0.75em; } @media screen and (min-width: 769px) { .full .main.columns { max-height: 100%; height: 100%; } .full .index-bar-menu { max-height: 100%; overflow-y: auto; } } @media screen and (max-width: 768px) { ${Pt.sidebarStyles()} } ${Pt.sidebarStyles(te`.sidebar `)} .full, .sidebar { min-height: 0px; margin: 0; display: flex; flex-direction: column; height: 100%; } .mobile-lists { display: block !important; } .sidebar .columns.is-hidden-mobile, .sidebar .is-hidden-mobile { display: none !important; } .sidebar .mobile-header { display: flex !important; } .sidebar .columns { display: flex !important; } .scroller { overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; flex: auto; padding-bottom: 1.0em; min-height: 0px; } .current { /*background-color: rgb(207, 243, 255);*/ } .page-header { display: flex; flex-flow: row wrap; width: 100%; min-height: fit-content; margin-bottom: 1.0em; border-bottom: 3px solid rgb(237, 237, 237); } .check-select { padding-right: 1.0em; } .search-bar { width: auto; display: flex; flex-direction: column; } .flex-auto { flex: auto; } .sidebar-nav { display: flex; justify-content: space-between; vertical-align: middle; } .sidebar-nav span { vertical-align: baseline; } .sidebar-nav fa-icon { vertical-align: middle; } `)}static sidebarStyles(e=te``){return te` ${e} .main.columns { position: relative; max-height: 100%; height: 100%; } ${e} .index-bar-menu { max-height: 75px; overflow-y: auto; margin-top: 0.75em; } ${e} .column.main-content { position: relative; overflow-y: auto; width: 100%; min-height: 0px; height: 100%; padding: 0px; margin: 0px; } ${e} .mobile-header { margin: 0.5rem; margin-left: 1.0rem; align-items: center; display: flex; justify-content: space-between; flex-flow: row wrap; min-height: 24px; width: 100%; } ${e} .menu { font-size: 0.80rem; }`}onSelectList(e){e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list"))}onSelectListDrop(e){e.preventDefault(),this.currList=Number(e.currentTarget.value)}render(){const e=this.currList;return O` ${this.isSidebar?O` `:""}
    ${this.collInfo.title}
    ${this.formatResults()} ${this.editable?O`
    ${this.renderDownloadMenu()}
    `:""} ${this.collInfo.lists.length?O` `:""}
    ${this.renderPages()}
    `}renderDownloadMenu(){return O` `}renderPageHeader(){return O` ${this.editable?O`
    `:O``}
    ${this.query?O` Match`:""} Date Page Title
    ${this.formatResults()}
    `}isCurrPage(e){if(this.isSidebar&&e.url===this.url){let t=e.timestamp;return!t&&e.date?t=ze(e.date):"string"==typeof e.ts&&(t=ze(e.ts)),t===this.ts}return!!this.editable&&this.selectedPages.has(p.id)}renderPages(){return O`
    ${this.sortedPages.length?O` ${this.sortedPages.map((e,t)=>{const i=this.isCurrPage(e);return O`
    `})}`:O`

    ${this.getNoResultsMessage()}

    `}
    `}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",()=>{this.menuActive=!1},{once:!0})}onSort(e){e.preventDefault();const t=e.currentTarget.getAttribute("data-key")||"";t===this.sortKey?this.sortDesc=!this.sortDesc:(this.sortDesc=!1,this.sortKey=t)}onSortChanged(e){this.sortedPages=e.detail.sortedData,this.sortKey=e.detail.sortKey,this.sortDesc=e.detail.sortDesc}onSelectToggle(e){const{page:t,selected:i}=e.detail;i?this.selectedPages.add(t):this.selectedPages.delete(t),this.allSelected=this.selectedPages.size===this.sortedPages.length,this.requestUpdate()}onSelectAll(e){this.allSelected=e.currentTarget.checked,this.allSelected?this.sortedPages.forEach(e=>{this.selectedPages.add(e.id)}):this.selectedPages.clear(),this.requestUpdate()}onFullPageView(e){e.preventDefault();this.sendChangeEvent({view:"pages",url:"",ts:""})}onHideSidebar(e){e.preventDefault();this.sendChangeEvent({showSidebar:!1})}async onDownload(e,t,i){e.preventDefault();const a=new URLSearchParams;a.set("pages",i?Array.from(this.selectedPages.keys()).join(","):"all"),a.set("format",t),this.collInfo.filename&&a.set("filename",this.collInfo.filename),window.location.href=this.collInfo.apiPrefix+"/dl?"+a.toString()}async onDeletePage(e){const t=e.currentTarget.page,i=await fetch(`${this.collInfo.apiPrefix}/page/${t.id}`,{method:"DELETE"}),a=(await i.json(),this.collInfo.pages.indexOf(t));a<0||(this.collInfo.pages.splice(a,1),this.updateTextSearch(),this.requestUpdate())}formatResults(){return 1===this.sortedPages.length?"1 Page Found":this.sortedPages.length+" Pages Found"}getNoResultsMessage(){return this.collInfo&&this.collInfo.pages.length?this.updatingSearch?"Initializing Search...":this.loading?"Searching...":this.query?"No Pages Found":"No Pages Found. Try changing the search query.":O`No Pages defined this archive. Check out Page Resources to search by URL.`}onScroll(e){const t=e.currentTarget;if(t.scrollHeight-t.scrollTop-t.clientHeight<40){const e=this.renderRoot.querySelector("wr-sorter");e&&e.getMore()}}}customElements.define("wr-page-view",Pt);const Tt=new RegExp(`[${["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")}]`,"g"),Lt=e=>e.replace(Tt,"\\$&");class Rt extends HTMLElement{static get observedAttributes(){return["keywords"]}get keywords(){return this.getAttribute("keywords")||""}set keywords(e){this.setAttribute("keywords",e)}constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,t,i){"keywords"===e&&i!==t&&this._render()}connectedCallback(){this._render(),this.__observer=new MutationObserver(()=>{this._render()}),this.__observer.observe(this,{childList:!0,characterData:!0,subtree:!0})}disconnectedCallback(){this.__observer&&(this.__observer.disconnect(),this.__observer=void 0)}_render(){if(!this.shadowRoot)return;const e=this.textContent||"",t=this.getAttribute("keywords");if(!t)return void(this.shadowRoot.textContent=e);const i=e.toLowerCase(),a=t.toLowerCase().split(/\s+/),r=new RegExp(""+a.map(Lt).join("|"),"gi"),o=e.split(r),n=document.createElement("div");let s=0;for(const t of o)if(n.appendChild(document.createTextNode(t)),s+=t.length,st.startsWith(e));if(r){const t=document.createElement("mark");t.textContent=e.substr(s,r.length),n.appendChild(t),s+=r.length}}this.shadowRoot.innerHTML=`\n \n ${n.innerHTML}\n `}}customElements.define("keyword-mark",Rt);class At extends ae{constructor(){super(),this.query="",this.textSnippet="",this.page=null,this.replayPrefix="",this.deleting=!1,this.editable=!1,this.iconValid=!1,this.index=0,this.isSidebar=!1,this.isCurrent=!1,this.timestamp="",this.date=null}static get properties(){return{query:{type:String},textSnippet:{type:String},page:{type:Object},replayPrefix:{type:String},deleting:{type:Boolean},selected:{type:Boolean},editable:{type:Boolean},iconValid:{type:Boolean},index:{type:Number},isSidebar:{type:Boolean},isCurrent:{type:Boolean},timestamp:{type:String},date:{type:Object}}}static get styles(){return ue(te` :host { min-height: min-content; width: 100%; word-break: break-all; position: relative; display: flex; flex-direction: row; background: transparent; } .check-select { padding-right: 1.0em; height: 100%; margin: auto 0 auto 0; } .columns { width: 100%; } .full { flex: auto; min-height: 0px; } .sidebar .column { width: unset !important; } .sidebar { width: 100%; } .favicon { width: 24px !important; height: 24px !important; display: inline-block; vertical-align: text-bottom; } img.favicon { filter: drop-shadow(1px 1px 2px grey); } .media-left { align-self: center; } .delete { position: absolute; top: 8px; right: 8px; } .delete:hover { background-color: rgb(241, 70, 104); } @media screen and (max-width: 768px) { ${At.sidebarStyles()} } ${At.sidebarStyles(te`.sidebar `)} .current a { background-color: rgb(207, 243, 255); font-style: italic; display: block; } .current .curr-page { font-style: italic; font-size: 9px; color: black; } .is-inline-date { display: none; } `)}static sidebarStyles(e=te``){return te` ${e} .col-date { margin-left: calc(24px + 1rem); display: none; } ${e} .col-date div { display: inline; } ${e} .col-index { position: absolute; top: 0px; left: 0px; margin-top: -0.75em; } ${e} .columns { display: flex; flex-direction: column-reverse; } ${e} .is-inline-date { display: initial !important; font-style: italic; } `}updated(e){if(e.has("page")||e.has("query")){this.updateSnippet(),this.iconValid=!!this.page.favIconUrl,this.deleting=!1;const e=this.getDateTS();this.timestamp=e.timestamp,this.date=e.date}}getDateTS(){let e=null;this.page.ts;try{e=new Date(this.page.ts||this.page.date)}catch(e){}const t=e&&!isNaN(e)?ze(e.toISOString()):"";return{date:e,timestamp:t}}render(){const e=this.page,t=this.date,i="number"==typeof e.size;return O` ${this.editable?O`
    `:""}
    ${this.index?O`
    ${this.index}.
    `:""}
    ${t?t.toLocaleDateString():""}
    ${t?t.toLocaleTimeString():""}
    ${this.editable?O` ${this.deleting?O` `:O` `}`:""} `}async updateFavIcon(){if(!this.page.favIconUrl)return void(this.favIconData=null);const e=await fetch(`${this.replayPrefix}/${this.timestamp}id_/${this.page.favIconUrl}`);if(200!=e.status)return void(this.favIconData=null);const t=await e.arrayBuffer(),i=e.headers.get("content-type");try{this.favIconData=`data:${i};base64,${btoa(String.fromCharCode.apply(null,t))}`}catch(e){console.log(e),this.favIconData=null}}updateSnippet(){const e=this.textSnippet;if(!this.query||!this.page.text)return this.textSnippet=null,void this.requestUpdate("textSnippet",e);let t=this.page.text,i=this.query,a=t.indexOf(this.query);if(a<0){let r=t.toLowerCase(),o=i.toLowerCase();if(a=r.indexOf(o),a<0)return this.textSnippet=null,void this.requestUpdate("textSnippet",e);t=r,i=o}let r=a;a=Math.max(a-100,0),r=Math.min(r+200,t.length),0===a&&r===t.length?this.textSnippet=t:this.textSnippet="..."+t.slice(a,r)+"...",this.requestUpdate("textSnippet",e)}onReplay(e){e.preventDefault();const t={url:this.page.url,ts:this.timestamp,view:"replay"};return this.sendChangeEvent(t),!1}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{bubbles:!0,composed:!0,detail:{data:e}}))}onSendDeletePage(e){const t=this.page.id;this.deleting=!0,this.dispatchEvent(new CustomEvent("delete-page",{detail:{page:t}}))}onSendSelToggle(e){const t=this.page.id,i=e.currentTarget.checked;this.dispatchEvent(new CustomEvent("sel-page",{detail:{page:t,selected:i}}))}}customElements.define("wr-page-entry",At);customElements.define("wr-coll-replay",class extends ae{constructor(){super(),this.replayUrl="",this.replayTS="",this.url="",this.ts="",this.title="",this.showAuth=!1,this.reauthWait=null}static get properties(){return{collInfo:{type:Object},sourceUrl:{type:String},url:{type:String},ts:{type:String},replayUrl:{type:String},replayTS:{type:String},title:{type:String},iframeUrl:{type:String},showAuth:{type:Boolean}}}firstUpdated(){window.addEventListener("message",e=>this.onReplayMessage(e)),navigator.serviceWorker.addEventListener("message",async e=>{"authneeded"===e.data.type&&this.collInfo&&e.data.coll===this.collInfo.coll&&(this.reauthWait?await this.reauthWait:this.showAuth=!0)})}doSetIframeUrl(){this.iframeUrl=this.url?`${this.collInfo.replayPrefix}/${this.ts||""}mp_/${this.url}`:""}updated(e){if((e.has("sourceUrl")||e.has("collInfo"))&&(this.isAuthable=this.sourceUrl.startsWith("googledrive://")&&this.collInfo&&this.collInfo.onDemand,this.reauthWait=null),!this.url||this.replayUrl==this.url&&this.replayTS==this.ts||!e.has("url")&&!e.has("ts")||(this.replayUrl=this.url,this.replayTS=this.ts,this.doSetIframeUrl()),this.iframeUrl&&e.has("iframeUrl")&&this.waitForLoad(),this.replayUrl&&e.has("replayUrl")){const e={url:this.replayUrl,ts:this.replayTS};this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{replaceLoc:!0,data:e}}))}}setDisablePointer(e){const t=this.renderRoot.querySelector("iframe");t&&(t.style.pointerEvents=e?"none":"all")}onReplayMessage(e){const t=this.renderRoot.querySelector("iframe");if(t&&e.source===t.contentWindow)if("load"===e.data.wb_type||"replace-url"===e.data.wb_type){if(this.replayTS=e.data.ts,this.replayUrl=e.data.url,this.title=e.data.title||this.title,this.clearLoading(t.contentWindow),e.data.icons){const t=e.data.icons;this.dispatchEvent(new CustomEvent("replay-favicons",{bubbles:!0,composed:!0,detail:{icons:t}}))}}else"title"===e.data.wb_type&&(this.title=e.data.title)}waitForLoad(){this.setLoading(),this._loadPoll=window.setInterval(()=>{const e=this.renderRoot.querySelector("iframe");e&&e.contentDocument&&e.contentWindow&&("complete"!==e.contentDocument.readyState||e.contentWindow._WBWombat)||this.clearLoading(e&&e.contentWindow)},5e3)}clearLoading(e){this.dispatchEvent(new CustomEvent("replay-loading",{detail:{loading:!1}})),this._loadPoll&&(window.clearInterval(this._loadPoll),this._loadPoll=null),e&&e.addEventListener("beforeunload",()=>{this.setLoading()})}setLoading(){this.dispatchEvent(new CustomEvent("replay-loading",{detail:{loading:!0}}))}refresh(){const e=this.renderRoot.querySelector("iframe");e&&(this.waitForLoad(),e.contentWindow.location.reload())}static get styles(){return ue(te` :host { display: flex; flex-direction: column; height: 100%; } iframe { width: 100%; #height: calc(100vh - 150px); height: 100%; border: 0px; } .intro-panel .panel-heading { font-size: 1.0em; } .intro-panel .panel-block { padding: 1.0em; flex-direction: column; } nav.intro-panel.panel { min-width: 40%; display: flex; flex-direction: column; margin: auto; } `)}render(){return O` ${this.iframeUrl?O` `:O` `} ${this.isAuthable?O` `:""} `}});var Dt=i(110),It=i.n(Dt),Et=i(111),Ut=i.n(Et);customElements.define("wr-sorter",class extends ae{constructor(){super(),this.sortedData=[],this.data=[],this.numResults=100,this.defaultDesc=!1,this.sortKey="url",this.sortDesc=!1,this.defaultKey="",this.defaultDesc=!1}static get properties(){return{id:{type:String},defaultKey:{type:String},defaultDesc:{type:Boolean},data:{type:Array},sortedData:{type:Array},sortKey:{type:String},sortDesc:{type:Boolean}}}firstUpdated(){this.sortKey=localStorage.getItem(this.id+":sortKey")||this.defaultKey;const e=localStorage.getItem(this.id+":sortDesc");this.sortDesc=e?"1"===e:this.defaultDesc}updated(e){const t=e.has("sortKey"),i=e.has("sortDesc"),a=e.has("data");e.has("numResults");t&&localStorage.setItem(this.id+":sortKey",this.sortKey),i&&localStorage.setItem(this.id+":sortDesc",this.sortDesc?"1":"0"),(t||i||a)&&this.sortData()}sortData(){this.sortedData=[...this.data],this.numResults=100,""===this.sortKey?this.sortDesc&&this.sortedData.reverse():this.sortedData.sort((e,t)=>e[this.sortKey]===t[this.sortKey]?0:this.sortDesc==e[this.sortKey]=this.sortedData.length||(this.numResults+=e,this.sendSortChanged())}static get styles(){return ue(te` :host { min-width: 100px; box-sizing: border-box !important; } button.button.is-small { border-radius: 4px; } `)}render(){return O`
    `}});class jt extends ae{static get filters(){return[{name:"HTML",filter:""},{name:"Images",filter:"image/"},{name:"Audio/Video",filter:"audio/,video/"},{name:"PDF",filter:"application/pdf"},{name:"Javascript",filter:"application/javascript,application/x-javascript"},{name:"CSS",filter:"text/css"},{name:"Fonts",filter:"font/,application/font-woff"},{name:"Plain Text",filter:"text/plain"},{name:"JSON",filter:"application/json"},{name:"DASH/HLS",filter:"application/dash+xml,application/x-mpegURL,application/vnd.apple.mpegurl"},{name:"All URLs",filter:"all"}]}static get sortKeys(){return[{key:"url",name:"URL"},{key:"ts",name:"Date"},{key:"mime",name:"Mime Type"},{key:"status",name:"Status"}]}constructor(){super(),this.collInfo=null,this.currMime="",this.query="",this.urlSearchType="",this.filteredResults=[],this.sortedResults=[],this.results=[],this.newQuery=null,this.tryMore=!1,this.loading=!1,this.sortKey="url",this.sortDesc=!1}static get properties(){return{collInfo:{type:Object},currMime:{type:String},query:{type:String},urlSearchType:{type:String},filteredResults:{type:Array},sortedResults:{type:Array},loading:{type:Boolean},sortKey:{type:String},sortDesc:{type:Boolean}}}firstUpdated(){}_timedUpdate(){null!==this.newQuery&&(this.query=this.newQuery,this.newQuery=null)}updated(e){if(e.has("query")||e.has("urlSearchType")||e.has("currMime")){this.doLoadResources();const t={query:this.query,urlSearchType:this.urlSearchType,currMime:this.currMime},i=!e.has("currMime")&&!e.has("urlSearchType");this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{replaceLoc:i,data:t}}))}(e.has("sortKey")||e.has("sortDesc"))&&this.filter()}async doLoadResources(e=!1){if(e&&(!this.tryMore||!this.results.length))return;if(this.loading)return;this.loading=!0;let t=""!==this.urlSearchType?this.query:"";const i=t&&"prefix"===this.urlSearchType?1:0;let a;switch(t&&!t.startsWith("http")&&(t="https://"+t),this.currMime){case"all":a="";break;case"":a="text/html,text/xhtml";break;default:a=this.currMime}const r=new URLSearchParams({mime:a,url:t,prefix:i,count:100});if(e){const e=this.results[this.results.length-1];r.set("fromMime",e.mime),r.set("fromUrl",e.url),r.set("fromTs",new Date(e.date).getTime())}let o=await fetch(`${this.collInfo.apiPrefix}/urls?${r.toString()}`);o=await o.json(),this.results=e?this.results.concat(o.urls):o.urls,this.tryMore=o.urls.length>=100,this.filter(),this.loading=!1}onChangeTypeSearch(e){this.currMime=e.currentTarget.value}onChangeQuery(e){this.newQuery=e.currentTarget.value,this._ival&&window.clearTimeout(this._ival),this._ival=window.setTimeout(()=>this._timedUpdate(),250)}onClickUrlType(e){this.urlSearchType=e.currentTarget.value}filter(){const e=[],t=""===this.urlSearchType?this.query:"";for(const i of this.results)(!t||i.url.indexOf(t)>=0)&&e.push(i);this.filteredResults=e}onScroll(e){const t=e.currentTarget,i=t.scrollHeight-t.scrollTop-t.clientHeight;this.tryMore&&i<40&&this.doLoadResources(!0)}static get styles(){return ue(te` :host { width: 100%; height: 100%; display: flex; flex-direction: column; } .notification { width: 100%; } .all-results { margin: 0 0 0 0.5em; display: flex; flex-direction: column; min-height: 0; } .main-scroll { flex-grow: 1; } .minihead { font-size: 10px; font-weight: bold; } .columns { margin: 0px; } .result { border-bottom: 1px #dbdbdb solid; min-height: fit-content; } .results-head { border-bottom: 2px #dbdbdb solid; margin-right: 16px; min-height: fit-content; } .results-head a { color: black; } .all-results .column { word-break: break-word; } div.sort-header { padding: 10px; margin-bottom: 0px !important; } .flex-auto { flex: auto; } .asc:after { content: "▼"; font-size: 0.75em; } .desc:after { content: "▲"; font-size: 0.75em; } .num-results { margin-left: 1em; font-style: italic; } `)}render(){return O`
    Search:  
    ${this.filteredResults.length} Result(s)
    ${this.sortedResults.length?this.sortedResults.map(e=>O`

    Date

    ${new Date(e.date).toLocaleString()}

    Mime Type

    ${e.mime}

    Status

    ${e.status}
    `):O`
    No Results Found.
    `}
    `}onSort(e){e.preventDefault();const t=e.currentTarget.getAttribute("data-key");t===this.sortKey?this.sortDesc=!this.sortDesc:(this.sortDesc=!1,this.sortKey=t)}onSortChanged(e){this.sortedResults=e.detail.sortedData,this.sortKey=e.detail.sortKey,this.sortDesc=e.detail.sortDesc}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts"),view:"replay"};return this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:t}})),!1}}customElements.define("wr-coll-resources",jt);var Nt=document.currentScript&&document.currentScript.src;class Mt extends ae{constructor(){super(),this.replaybase=window.location.origin+"/replay/",this.swName="sw.js",this.view="replay",this.ts="",this.url="",this.query="",this.config="",this.coll="",this.paramString=null,this.deepLink=!1,this.swInited=!1,this.embed=null,this.reloadCount=0}static get properties(){return{url:{type:String},ts:{type:String},query:{type:String},source:{type:String},view:{type:String},embed:{type:String},replaybase:{type:String},swName:{type:String},title:{type:String},coll:{type:String},config:{type:String},swInited:{type:Boolean},paramString:{type:String},hashString:{type:String},deepLink:{type:Boolean},noSW:{type:Boolean}}}async doRegister(){try{await ye(this.swName,this.replaybase),console.log("done"),this.swInited=!0}catch(e){console.log(e),this.noSW=!0}}firstUpdated(){this.doRegister(),window.addEventListener("message",e=>{const t=this.renderRoot.querySelector("iframe");if(t&&e.source===t.contentWindow){if(e.data.title&&(this.title=e.data.title),!this.deepLink)return;const t=new URLSearchParams(e.data),i=new URL(window.location.href);i.hash="#"+t.toString(),window.history.replaceState({},"",i)}}),this.deepLink&&(this.updateFromHash(),window.addEventListener("hashchange",e=>this.updateFromHash()))}updateFromHash(){const e=new URLSearchParams(window.location.hash.slice(1));e.has("url")&&(this.url=e.get("url")),e.has("ts")&&(this.ts=e.get("ts")),e.has("query")&&(this.query=e.get("query")),e.has("view")&&(this.view=e.get("view"))}updated(e){(e.has("url")||e.has("ts")||e.has("query")||e.has("view")||e.has("source"))&&(this.embed=this.embed||"default",this.paramString=new URLSearchParams({source:this.source,customColl:this.coll,config:this.config,basePageUrl:window.location.href.split("#")[0],embed:this.embed}).toString(),this.hashString=new URLSearchParams({url:this.url,ts:this.ts,query:this.query,view:this.view}).toString())}static get styles(){return ue(te` .logo { margin: 1em; flex-grow: 1; } .error { white-space: pre-wrap; text-align: center; } .full-width { width: 100%; } iframe { width: 100%; height: 100%; border: 0px; padding: 0px; margin: 0px; } :host { width: 100%; height: 100%; } `)}render(){return O` ${this.paramString&&this.hashString&&this.swInited?O` `:O``} ${this.noSW?O`
    Sorry, ReplayWeb.page won't work in this browser as Service Workers are not supported. Please try a different browser.\n (Service Workers are disabled in Firefox in Private Mode. If Using Private Mode in Firefox, try regular mode).
    `:""}`}onLoad(e){const t=e.target.contentWindow,i=e.target.contentDocument;if(t.navigator.serviceWorker&&!t.navigator.serviceWorker.controller&&this.reloadCount<=2)return this.reloadCount++,void setTimeout(()=>t.location.reload(),100);if(this.reloadCount=0,t.customElements.get("replay-app-main"))return;const a=i.createElement("script");a.src=Nt,i.head.appendChild(a)}}!async function(){customElements.define("replay-web-page",Mt)}()},21:function(e,t){const i=/[&<>"']/,a=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,n={"&":"&","<":"<",">":">",'"':""","'":"'"},s=e=>n[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const d=/(^|[^\[])\^/g;const h=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const b={},u=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,p=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(e,t){b[" "+e]||(u.test(e)?b[" "+e]=e+"/":b[" "+e]=v(e,"/",!0));const i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(p,"$1")+t:e+t}function v(e,t,i){const a=e.length;if(0===a)return"";let r=0;for(;r(a=(a=a.source||a).replace(d,"$1"),e=e.replace(t,a),i),getRegex:()=>new RegExp(e,t)};return i},cleanUrl:function(e,t,i){if(e){let e;try{e=decodeURIComponent(c(i)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!f.test(i)&&(i=g(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i},resolveUrl:g,noopTest:{exec:function(){}},merge:function(e){let t,i,a=1;for(;a{let a=!1,r=t;for(;--r>=0&&"\\"===i[r];)a=!a;return a?"|":" |"}).split(/ \|/);let a=0;if(i.length>t)i.splice(t);else for(;i.length