vanilla-breeze 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/components/adr-record.js +383 -0
- package/dist/cdn/components/adr-wc.js +403 -0
- package/dist/cdn/components/analytics-panel.js +34 -0
- package/dist/cdn/components/author-index.js +3 -0
- package/dist/cdn/components/brand-mark.js +2 -0
- package/dist/cdn/components/calendar-wc.js +2 -2
- package/dist/cdn/components/carousel-wc.js +1 -1
- package/dist/cdn/components/chart-wc.js +25 -25
- package/dist/cdn/components/color-palette.js +13 -7
- package/dist/cdn/components/comment-wc.js +2 -0
- package/dist/cdn/components/consent-banner.js +1 -1
- package/dist/cdn/components/content-lens.js +2 -0
- package/dist/cdn/components/day-view.js +2 -0
- package/dist/cdn/components/empathy-map.js +42 -25
- package/dist/cdn/components/flow-diagram.js +2 -0
- package/dist/cdn/components/font-pairer.js +108 -0
- package/dist/cdn/components/gantt-chart.js +2 -0
- package/dist/cdn/components/geo-map.js +7 -7
- package/dist/cdn/components/glossary-wc.js +2 -0
- package/dist/cdn/components/gradient-builder.js +52 -0
- package/dist/cdn/components/highlight-wc.js +3 -0
- package/dist/cdn/components/manifest.json +134 -26
- package/dist/cdn/components/markdown-viewer.js +3 -3
- package/dist/cdn/components/motion-specimen.js +21 -0
- package/dist/cdn/components/note-wc.js +3 -0
- package/dist/cdn/components/notification-wc.js +37 -0
- package/dist/cdn/components/page-info.js +55 -24
- package/dist/cdn/components/page-toc.js +1 -1
- package/dist/cdn/components/popularity-index.js +9 -0
- package/dist/cdn/components/print-page.js +1 -1
- package/dist/cdn/components/recently-visited.js +3 -0
- package/dist/cdn/components/review-surface.js +541 -0
- package/dist/cdn/components/selection-menu.js +2 -0
- package/dist/cdn/components/semantic-palette.js +30 -0
- package/dist/cdn/components/settings-panel.js +55 -51
- package/dist/cdn/components/share-wc.js +2 -2
- package/dist/cdn/components/site-map-wc.js +2 -0
- package/dist/cdn/components/spacing-specimen.js +5 -5
- package/dist/cdn/components/split-surface.js +1 -1
- package/dist/cdn/components/text-reader.js +2 -2
- package/dist/cdn/components/theme-export.js +18 -0
- package/dist/cdn/components/theme-picker.js +58 -58
- package/dist/cdn/components/token-specimen.js +25 -20
- package/dist/cdn/components/topic-map.js +3 -0
- package/dist/cdn/components/trust-filter.js +4 -0
- package/dist/cdn/components/type-specimen.js +16 -13
- package/dist/cdn/components/user-journey.js +48 -30
- package/dist/cdn/components/user-persona.js +17 -15
- package/dist/cdn/components/user-story.js +55 -22
- package/dist/cdn/components/watch-wc.js +3 -0
- package/dist/cdn/components/week-view.js +2 -0
- package/dist/cdn/components/work-item.js +446 -0
- package/dist/cdn/packs/design-system.full.js +124 -47
- package/dist/cdn/packs/effects.full.js +1 -1
- package/dist/cdn/packs/kawaii.full.css +1 -1
- package/dist/cdn/packs/kawaii.full.js +1 -1
- package/dist/cdn/packs/kawaii.theme.css +1 -1
- package/dist/cdn/packs/manifest.json +10 -40
- package/dist/cdn/packs/prototype.full.js +1 -1
- package/dist/cdn/packs/ui.full.css +1 -1
- package/dist/cdn/packs/ui.full.js +50 -50
- package/dist/cdn/packs/ux-planning.full.css +1 -1
- package/dist/cdn/packs/ux-planning.full.js +1546 -92
- package/dist/cdn/themes/8bit.css +1 -1
- package/dist/cdn/themes/alpha1999.css +1 -1
- package/dist/cdn/themes/bauhaus.css +1 -1
- package/dist/cdn/themes/brutalist.css +1 -1
- package/dist/cdn/themes/claymorphism.css +1 -1
- package/dist/cdn/themes/cottagecore.css +1 -1
- package/dist/cdn/themes/cyber.css +1 -1
- package/dist/cdn/themes/genai.css +1 -1
- package/dist/cdn/themes/glassmorphism.css +1 -1
- package/dist/cdn/themes/kawaii.css +1 -1
- package/dist/cdn/themes/magna.css +1 -1
- package/dist/cdn/themes/manifest.json +20 -20
- package/dist/cdn/themes/nes.css +1 -1
- package/dist/cdn/themes/neumorphism.css +1 -1
- package/dist/cdn/themes/organic.css +1 -1
- package/dist/cdn/themes/rough.css +1 -1
- package/dist/cdn/themes/startup.css +1 -1
- package/dist/cdn/themes/super2026.css +1 -1
- package/dist/cdn/themes/terminal.css +1 -1
- package/dist/cdn/themes/vaporwave.css +1 -1
- package/dist/cdn/themes/win9x.css +1 -1
- package/dist/cdn/vanilla-breeze-charts.js +25 -25
- package/dist/cdn/vanilla-breeze-core.css +1 -1
- package/dist/cdn/vanilla-breeze-core.js +119 -47
- package/dist/cdn/vanilla-breeze-dev.js +1 -1
- package/dist/cdn/vanilla-breeze-extras.js +154 -74
- package/dist/cdn/vanilla-breeze.css +1 -1
- package/dist/cdn/vanilla-breeze.js +1988 -248
- package/package.json +8 -6
- package/dist/cdn/packs/retro.bundle.js +0 -2
- package/dist/cdn/packs/retro.components.js +0 -1
- package/dist/cdn/packs/retro.effects.css +0 -2
- package/dist/cdn/packs/retro.effects.js +0 -16
- package/dist/cdn/packs/retro.full.css +0 -5
- package/dist/cdn/packs/retro.full.js +0 -16
- package/dist/cdn/packs/retro.theme.css +0 -2
|
@@ -23,7 +23,7 @@ ${c}`:c;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
23
23
|
`+u}f=!u.trim(),h+=D+`
|
|
24
24
|
`,n=n.substring(D.length+1),g=A.slice(k)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),t.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=h}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a of t.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(a.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};a.checked=c.checked,t.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!t.loose){let h=a.tokens.filter(g=>g.type==="space"),c=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));t.loose=c}}if(t.loose)for(let a of t.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return t}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:t}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=ae(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
25
|
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of t)i.rows.push(ae(l,i.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[a]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let r=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=v(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=st(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),oe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return oe(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+t);(s=h.exec(e))
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=v(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=st(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),oe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return oe(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+t);(s=h.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){o+=l;continue}else if((s[5]||s[6])&&t%3&&!((t+l)%3)){a+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+a);let c=[...s[0]][0].length,g=n.slice(0,t+s.index+c+l);if(Math.min(t,l)%2){let f=g.slice(1,-1);return{type:"em",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}let u=g.slice(2,-2);return{type:"strong",raw:g,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,r=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*n.length+t);(s=a.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==t))continue;if(s[3]||s[4]){o+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o);let h=[...s[0]][0].length,c=n.slice(0,t+s.index+h+l),g=c.slice(t,-t);return{type:"del",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},x=class N{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R,this.options.tokenizer=this.options.tokenizer||new q,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:b,block:_.normal,inline:z.normal};this.options.pedantic?(r.block=_.pedantic,r.inline=z.pedantic):this.options.gfm&&(r.block=_.gfm,this.options.breaks?r.inline=z.breaks:r.inline=z.gfm),this.tokenizer.rules=r}static get rules(){return{block:_,inline:z}}static lex(e,r){return new N(r).lex(e)}static lexInline(e,r){return new N(r).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
|
|
27
27
|
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(l=>(t=l.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=r.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
|
|
28
28
|
`:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
29
29
|
`)?"":`
|
|
@@ -37,7 +37,7 @@ ${c}`:c;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
37
37
|
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t),s=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
38
38
|
`)?"":`
|
|
39
39
|
`)+t.raw,l.text+=`
|
|
40
|
-
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))
|
|
40
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)i=t[2]?t[2].length:0,s=s.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,o="";for(;e;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,g=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},g),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(h)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},I=class{options;parser;constructor(n){this.options=n||R}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(b.notSpaceStart)?.[0],t=n.replace(b.endingNewline,"")+`
|
|
41
41
|
`;return s?'<pre><code class="language-'+w(s)+'">'+(r?t:w(t,!0))+`</code></pre>
|
|
42
42
|
`:"<pre><code>"+(r?t:w(t,!0))+`</code></pre>
|
|
43
43
|
`}blockquote({tokens:n}){return`<blockquote>
|
|
@@ -55,6 +55,6 @@ ${this.parser.parse(n)}</blockquote>
|
|
|
55
55
|
`}tablerow({text:n}){return`<tr>
|
|
56
56
|
${n}</tr>
|
|
57
57
|
`}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
|
|
58
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${w(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=le(n);if(t===null)return s;n=t;let i='<a href="'+n+'"';return e&&(i+=' title="'+w(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=le(n);if(t===null)return w(r);n=t;let i=`<img src="${n}" alt="${w(r)}"`;return e&&(i+=` title="${w(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:w(n.text)}},J=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},m=class O{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new I,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new J}static parse(e,r){return new O(r).parse(e)}static parseInline(e,r){return new O(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let t=e[s];if(this.options.extensions?.renderers?.[t.type]){let l=t,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=o||"";continue}}let i=t;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=o||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"checkbox":{s+=r.checkbox(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},E=class{options;block;constructor(n){this.options=n||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return
|
|
58
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${w(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=le(n);if(t===null)return s;n=t;let i='<a href="'+n+'"';return e&&(i+=' title="'+w(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=le(n);if(t===null)return w(r);n=t;let i=`<img src="${n}" alt="${w(r)}"`;return e&&(i+=` title="${w(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:w(n.text)}},J=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},m=class O{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new I,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new J}static parse(e,r){return new O(r).parse(e)}static parseInline(e,r){return new O(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let t=e[s];if(this.options.extensions?.renderers?.[t.type]){let l=t,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=o||"";continue}}let i=t;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=o||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"checkbox":{s+=r.checkbox(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},E=class{options;block;constructor(n){this.options=n||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?x.lex:x.lexInline}provideParser(n=this.block){return n?m.parse:m.parseInline}},at=class{defaults=Q();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=m;Renderer=I;TextRenderer=J;Lexer=x;Tokenizer=q;Hooks=E;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let o=t.renderer.apply(this,l);return o===!1&&(o=i.apply(this,l)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new I(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,o=r.renderer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new q(this.defaults);for(let i in r.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,o=r.tokenizer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new E;for(let i in r.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,o=r.hooks[l],a=t[l];E.passThroughHooks.has(i)?t[l]=h=>{if(this.defaults.async&&E.passThroughHooksRespectAsync.has(i))return(async()=>{let g=await o.call(t,h);return a.call(t,g)})();let c=o.call(t,h);return a.call(t,c)}:t[l]=(...h)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(t,h);return g===!1&&(g=await a.apply(t,h)),g})();let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(l){let o=[];return o.push(i.call(this,l)),t&&(o=o.concat(t.call(this,l))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return x.lex(n,e??this.defaults)}parser(n,e){return m.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=n),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,o=await(t.hooks?await t.hooks.provideLexer(n):n?x.lex:x.lexInline)(l,t),a=t.hooks?await t.hooks.processAllTokens(o):o;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser(n):n?m.parse:m.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer(n):n?x.lex:x.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let o=(t.hooks?t.hooks.provideParser(n):n?m.parse:m.parseInline)(l,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(l){return i(l)}}}onError(n,e){return r=>{if(r.message+=`
|
|
59
59
|
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+w(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},S=new at;function d(n,e){return S.parse(n,e)}d.options=d.setOptions=function(n){return S.setOptions(n),d.defaults=S.defaults,ce(d.defaults),d};d.getDefaults=Q;d.defaults=R;d.use=function(...n){return S.use(...n),d.defaults=S.defaults,ce(d.defaults),d};d.walkTokens=function(n,e){return S.walkTokens(n,e)};d.parseInline=S.parseInline;d.Parser=m;d.parser=m.parse;d.Renderer=I;d.TextRenderer=J;d.Lexer=x;d.lexer=x.lex;d.Tokenizer=q;d.Hooks=E;d.parse=d;var pt=d.options,ut=d.setOptions,gt=d.use,dt=d.walkTokens,kt=d.parseInline;var ft=m.parse,bt=x.lex;var K=class extends C{#t=null;#n=null;#e=null;static get observedAttributes(){return["src"]}setup(){this.#s()}teardown(){this.#n?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,r,s){e==="src"&&s&&r!==s&&this.isConnected&&this.#s()}get parser(){return this.#t}set parser(e){this.#t=typeof e=="function"?e:null}async render(){await this.#s()}async reload(){this.getAttribute("src")&&await this.#s()}#i(){if(this.getAttribute("src"))return null;let e=this.querySelector('script[type="text/markdown"]');if(e)return e.textContent;let r=this.querySelector("template[data-md]");if(r)return r.content.textContent;let s=this.querySelector(":scope > pre");return s?s.textContent:null}async#s(){let e=this.getAttribute("src"),r;if(this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),e){this.#n?.abort(),this.#n=new AbortController,this.setAttribute("data-loading",""),this.#r("markdown-viewer:fetch",{src:e});try{let i=await fetch(e,{signal:this.#n.signal});if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);r=await i.text()}catch(i){if(i.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#r("markdown-viewer:error",{error:i.message});return}this.removeAttribute("data-loading")}else r=this.#i();if(r==null)return;let s;try{s=await(await this.#l())(r)}catch(i){this.setAttribute("data-error",""),this.#r("markdown-viewer:error",{error:i.message});return}this.#e||(this.#e=document.createElement("div"),this.#e.className="md-content",this.#e.setAttribute("part","content"),this.appendChild(this.#e)),this.#e.innerHTML=s,this.#a(),this.setAttribute("data-rendered","");let t=this.getAttribute("ping");if(t&&navigator.sendBeacon?.(t,JSON.stringify({src:e||"inline"})),this.#r("markdown-viewer:rendered",{src:e,node:this.#e}),this.hasAttribute("highlight"))for(let i of this.#e.querySelectorAll('pre > code[class*="language-"]')){let l=i.className.match(/language-(\S+)/)?.[1]||"";this.#r("markdown-viewer:highlight",{node:i,language:l})}}async#l(){return this.#t?this.#t:e=>d.parse(e,{gfm:!0})}#a(){if(!this.#e)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#e.dataset.theme=e)}#r(e,r){this.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,composed:!0}))}};re("markdown-viewer",K);export{K as MarkdownViewer};
|
|
60
60
|
//# sourceMappingURL=markdown-viewer.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function f(i,t,n={}){let s=n.priority??10,r={impl:t,bundle:n.bundle,contract:n.contract,priority:s},e=m.get(i);if(customElements.get(i)){if(!e||e.priority>=s){e&&e.priority===s&&e.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}" (priority ${e.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${e.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(e&&e.priority>=s){e.priority===s&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}m.set(i,r),customElements.define(i,t)}var l=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,n,s,r){t.addEventListener(n,s,r),this.#e.push(()=>t.removeEventListener(n,s,r))}setup(){}teardown(){}};var g="1,2,3,4,5,in-1,in-2,in-3,out-1,out-2,out-3,out-4,out-5,elastic-1,elastic-2,squish-1,squish-2",v="instant,fast,normal,slow,slower",p="ms-keyframes",E=`
|
|
2
|
+
@keyframes ms-slide { from { inset-inline-start: 0 } to { inset-inline-start: calc(100% - 1rem) } }
|
|
3
|
+
@keyframes ms-fill { 0% { transform: scaleX(0) } 60% { transform: scaleX(1) } 100% { transform: scaleX(1); opacity: 0.3 } }
|
|
4
|
+
@media (prefers-reduced-motion: reduce) {
|
|
5
|
+
motion-specimen .ms-dot { animation: none !important; inset-inline-start: calc(50% - 0.5rem) !important }
|
|
6
|
+
motion-specimen .ms-bar-fill { animation: none !important; transform: scaleX(0.6) !important; opacity: 0.6 !important }
|
|
7
|
+
}
|
|
8
|
+
`;function k(){if(typeof document>"u"||document.getElementById(p))return;let i=document.createElement("style");i.id=p,i.textContent=E,document.head.append(i)}var b="var(--font-mono, monospace)",h="var(--color-text-muted, #666)",y="var(--color-interactive, oklch(55% 0.2 260))",$="var(--color-surface-sunken, #f1f1f1)",u=class extends l{static observedAttributes=["type","tokens","prefix","duration","show-values","label"];setup(){k(),this.#e()}attributeChangedCallback(){this.isConnected&&this.hasAttribute("data-upgraded")&&this.#e()}#e(){let t=this.getAttribute("type")||"easing",n=this.getAttribute("duration")||"1.2s",s=this.getAttribute("show-values")!=="false",r=this.getAttribute("label")||"",e="";r&&(e+=`<p style="font-weight:600;margin:0 0 var(--size-s,0.75rem)">${r}</p>`),(t==="easing"||t==="both")&&(e+=this.#r(n,s)),(t==="duration"||t==="both")&&(t==="both"&&(e+='<div aria-hidden="true" style="block-size:var(--size-m,1rem)"></div>'),e+=this.#o(s)),this.innerHTML=e,s&&requestAnimationFrame(()=>this.#a())}#t(){return"display:grid;grid-template-columns:5rem 1fr auto;align-items:center;gap:var(--size-s,0.75rem);min-block-size:1.75rem"}#n(){return`font-family:${b};font-size:var(--font-size-sm,0.875rem);color:${h};text-align:end`}#s(){return`font-family:${b};font-size:var(--font-size-xs,0.75rem);color:${h};font-variant-numeric:tabular-nums;white-space:nowrap`}#i(){return"list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--size-2xs,0.375rem)"}#r(t,n){let s=(this.getAttribute("tokens")||g).split(",").map(o=>o.trim()),r=this.getAttribute("prefix")||"--ease-",e=`position:relative;display:block;block-size:0.5rem;background:${$};border-radius:999px`,c=`position:absolute;inset-block-start:50%;inset-inline-start:0;inline-size:1rem;block-size:1rem;background:${y};border-radius:50%;transform:translateY(-50%)`,a=s.map(o=>{let d=`${r}${o}`;return`<li class="ms-row ms-row-ease" role="listitem" style="${this.#t()}">
|
|
9
|
+
<span style="${this.#n()}">${o}</span>
|
|
10
|
+
<span style="${e}" aria-hidden="true">
|
|
11
|
+
<span class="ms-dot" style="${c};animation: ms-slide ${t} var(${d}) infinite alternate"></span>
|
|
12
|
+
</span>
|
|
13
|
+
${n?`<span class="ms-value" data-var="${d}" style="${this.#s()}"></span>`:""}
|
|
14
|
+
</li>`}).join("");return`<ul class="ms-list" role="list" aria-label="Easing scale" style="${this.#i()}">${a}</ul>`}#o(t){let n=(this.getAttribute("tokens")||v).split(",").map(a=>a.trim()),s=this.getAttribute("prefix")||"--duration-",r=`position:relative;display:block;block-size:0.5rem;background:${$};border-radius:999px;overflow:hidden`,e=`position:absolute;inset-block:0;inset-inline-start:0;inline-size:100%;background:${y};transform-origin:left center;animation-name:ms-fill;animation-iteration-count:infinite;animation-timing-function:linear`,c=n.map(a=>{let o=`${s}${a}`;return`<li class="ms-row ms-row-dur" role="listitem" style="${this.#t()}">
|
|
15
|
+
<span style="${this.#n()}">${a}</span>
|
|
16
|
+
<span style="${r}" aria-hidden="true">
|
|
17
|
+
<span class="ms-bar-fill" style="${e};animation-duration: var(${o})"></span>
|
|
18
|
+
</span>
|
|
19
|
+
${t?`<span class="ms-value" data-var="${o}" style="${this.#s()}"></span>`:""}
|
|
20
|
+
</li>`}).join("");return`<ul class="ms-list" role="list" aria-label="Duration scale" style="${this.#i()}">${c}</ul>`}#a(){this.querySelectorAll(".ms-value").forEach(t=>{let n=t.getAttribute("data-var");if(!n)return;let s=getComputedStyle(this).getPropertyValue(n).trim();t.textContent=s||"\u2014"})}};f("motion-specimen",u);
|
|
21
|
+
//# sourceMappingURL=motion-specimen.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var S=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,i){t.addEventListener(e,n,i),this.#t.push(()=>t.removeEventListener(e,n,i))}setup(){}teardown(){}};var it=window.matchMedia("(prefers-reduced-motion: reduce)");var P=new Map;function F(o,t,e={}){let n=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:n},s=P.get(o);if(customElements.get(o)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}P.set(o,i),customElements.define(o,t)}function j(){let o=globalThis.localStorage;if(!o)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return o.getItem(t)},async setRaw(t,e){o.setItem(t,e)},async removeRaw(t){o.removeItem(t)},async keys(t){let e=[];for(let n=0;n<o.length;n++){let i=o.key(n);i&&i.startsWith(t)&&e.push(i)}return e}}}var k=null;function g(){return k||(k=j()),k}function O(o,t){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${o}:${t}`}function I(o){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${o}:`}function q(o){try{let t=JSON.parse(o);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var x={configure(o={}){k=o.backend??null},async set(o,t,e){let n={data:e,timestamp:Date.now()};await g().setRaw(O(o,t),JSON.stringify(n))},async get(o,t,e){let n=await g().getRaw(O(o,t));if(n==null)return null;let i=q(n);return!i||e?.maxAge!=null&&Date.now()-i.timestamp>e.maxAge?null:i.data},async remove(o,t){await g().removeRaw(O(o,t))},async list(o){let t=I(o),e=await g().keys(t),n=[];for(let i of e){let s=await g().getRaw(i);if(s==null)continue;let r=q(s);r&&n.push({key:i.slice(t.length),data:r.data,timestamp:r.timestamp})}return n},async clear(o){let t=I(o),e=await g().keys(t);for(let n of e)await g().removeRaw(n)},async clearAll(){let o=await g().keys("vb:");for(let t of o)await g().removeRaw(t)},async setMany(o,t){for(let[e,n]of t)await x.set(o,e,n)}};var M="[data-highlights]",D="highlights",J=["yellow","green","blue","pink"],_=8,L=8,K=typeof CSS<"u"&&"highlights"in CSS;function V(o){let t=2166136261;for(let e=0;e<o.length;e++)t^=o.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function z(){return"hn-"+crypto.randomUUID().slice(0,8)}function U(o,t){return getComputedStyle(o).getPropertyValue(`--highlight-${t}`).trim()}var v=null,A=0;function Y(o){if(v){A++;return}v=new CSSStyleSheet;let t=o.map(e=>`::highlight(hn-${e}) { background-color: var(--highlight-${e}); text-decoration-line: underline; text-decoration-color: var(--highlight-${e}); text-underline-offset: 2px; }`).join(`
|
|
2
|
+
`);v.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,v],A=1}function Q(){A--,A<=0&&v&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(o=>o!==v),v=null,A=0)}var d=null,N=null;function Z(){return d||(d=document.createElement("div"),d.className="hn-toolbar",d.setAttribute("role","toolbar"),d.setAttribute("aria-label","Highlight tools"),d.setAttribute("popover","auto"),d.hidden=!0,document.body.appendChild(d),d.addEventListener("toggle",o=>{o.newState==="closed"&&(d.hidden=!0,N=null)}),d)}function R(o,t,e){let n=Z();n.innerHTML="",N=t;let i=t.colors,s=t.element,r=e?.color,l=document.createElement("div");if(l.className="hn-swatches",l.setAttribute("role","group"),l.setAttribute("aria-label","Highlight colors"),i.forEach((a,c)=>{let h=document.createElement("button");h.type="button",h.className="hn-swatch",h.dataset.color=a,h.setAttribute("aria-label",`Highlight ${a}${r===a?" (current)":""}`),h.setAttribute("tabindex",c===0?"0":"-1");let f=U(s,a);f&&(h.style.backgroundColor=f),r===a&&h.setAttribute("aria-pressed","true"),h.addEventListener("click",()=>{e?t._changeColor(e.id,a):t._createFromSelection(a),C()}),l.appendChild(h)}),n.appendChild(l),e){let a=document.createElement("span");a.className="hn-separator",a.setAttribute("aria-hidden","true"),n.appendChild(a);let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent=e.note?"Edit Note":"Add Note",c.addEventListener("click",()=>{w(t,e),C()}),n.appendChild(c);let h=document.createElement("button");h.type="button",h.className="hn-action hn-action-remove",h.textContent="Remove",h.addEventListener("click",()=>{t.removeHighlight(e.id),C()}),n.appendChild(h)}l.addEventListener("keydown",a=>{let c=[...l.querySelectorAll("button")],h=c.indexOf(document.activeElement);if(h<0)return;let f=-1;if(a.key==="ArrowRight"||a.key==="ArrowDown")a.preventDefault(),f=(h+1)%c.length;else if(a.key==="ArrowLeft"||a.key==="ArrowUp")a.preventDefault(),f=(h-1+c.length)%c.length;else if(a.key==="Escape"){C();return}f>=0&&(c[h].setAttribute("tabindex","-1"),c[f].setAttribute("tabindex","0"),c[f].focus())}),n.hidden=!1;try{n.showPopover()}catch{}tt(o),requestAnimationFrame(()=>{let a=n.querySelector(".hn-swatch");a&&a.focus()})}var u=null;function w(o,t){y();let e=o.element,n=b(e,t.startOffset,t.endOffset);if(!n)return;u=document.createElement("div"),u.className="hn-note-panel",u.setAttribute("role","dialog"),u.setAttribute("aria-label","Private note");let i=document.createElement("header");i.className="hn-note-header",i.innerHTML="<small>PRIVATE NOTE</small>",u.appendChild(i);let s=document.createElement("blockquote");s.className="hn-note-quote",s.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,u.appendChild(s);let r=document.createElement("textarea");r.className="hn-note-textarea",r.placeholder="Add a note\u2026",r.value=t.note||"",r.rows=3,r.setAttribute("aria-label","Note for highlighted text"),u.appendChild(r);let l=document.createElement("footer");l.className="hn-note-actions";let a=document.createElement("button");a.type="button",a.className="hn-action hn-action-save",a.textContent="Save",a.addEventListener("click",()=>{o._updateNote(t.id,r.value.trim()),y()});let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent="Cancel",c.addEventListener("click",()=>y()),l.append(a,c),u.appendChild(l),r.addEventListener("keydown",m=>{m.key==="Escape"&&(m.preventDefault(),y()),m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),o._updateNote(t.id,r.value.trim()),y())}),e.style.position="relative",e.appendChild(u);let h=n.getClientRects()[0],f=e.getBoundingClientRect();if(h){let m=h.top-f.top;u.style.top=`${m}px`}requestAnimationFrame(()=>{r.focus(),document.addEventListener("pointerdown",G)})}function G(o){u&&!u.contains(o.target)&&y()}function y(){u&&(document.removeEventListener("pointerdown",G),u.remove(),u=null)}function tt(o){d&&requestAnimationFrame(()=>{let t=d.getBoundingClientRect(),e=t.width||200,n=t.height||40,i=o.top-n-_,s=o.left+o.width/2-e/2;i<L&&(i=o.bottom+_);let r=window.innerWidth-e-L;s=Math.max(L,Math.min(s,r)),d.style.top=`${i}px`,d.style.left=`${s}px`})}function C(){if(d){try{d.hidePopover()}catch{}d.hidden=!0,N=null}}var p=null;function T(o){p||(p=document.createElement("div"),p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true"),p.className="hn-sr-only",document.body.appendChild(p)),p.textContent="",requestAnimationFrame(()=>{p.textContent=o})}function W(o,t,e){let n=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),i=0;for(;n.nextNode();){if(n.currentNode===t)return i+e;i+=(n.currentNode.textContent??"").length}return-1}function b(o,t,e){let n=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),i=0,s=null,r=0,l=null,a=0;for(;n.nextNode();){let c=n.currentNode,h=(c.textContent??"").length;if(!s&&i+h>t&&(s=c,r=t-i),i+h>=e){l=c,a=e-i;break}i+=h}if(!s||!l)return null;try{let c=document.createRange();return c.setStart(s,Math.min(r,(s.textContent??"").length)),c.setEnd(l,Math.min(a,(l.textContent??"").length)),c}catch{return null}}var B=class{#t;#s;#n;#u;#e=[];#a=!K;#c;#l;#h=!1;#d=[];constructor(t){this.#t=t,this.#u=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#s=e&&e!==""?e:location.pathname;let n=t.dataset.highlightsColors;this.#n=n?n.split(",").map(i=>i.trim()).filter(Boolean):[...J],this.#a||Y(this.#n),this.#o(),this.#u||(this.#c=this.#m.bind(this),this.#l=this.#p.bind(this),t.addEventListener("pointerup",this.#c),t.addEventListener("click",this.#l)),t.setAttribute("data-highlights-init",""),this.#y().then(()=>{this.#h||this.#o()})}get colors(){return[...this.#n]}get element(){return this.#t}getHighlights(){return this.#e.map(t=>({...t}))}removeHighlight(t){let e=this.#e.findIndex(n=>n.id===t);e<0||(this.#e.splice(e,1),this.#i(),this.#o(),this.#r("highlights:removed",{id:t}),T("Highlight removed"))}clearAll(){this.#e=[],this.#i(),this.#o()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#e})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#e=e.highlights,this.#i(),this.#o()}catch{}}destroy(){if(!this.#h){if(this.#h=!0,this.#c&&this.#t.removeEventListener("pointerup",this.#c),this.#l&&this.#t.removeEventListener("click",this.#l),this.#a)this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()});else{for(let t of this.#n)CSS.highlights.delete(`hn-${t}`);Q()}this.#f(),this.#t.removeAttribute("data-highlights-init"),N===this&&C(),y()}}#m(){requestAnimationFrame(()=>{if(this.#h||this.#t.hasAttribute("data-selection-menu"))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);if(!this.#t.contains(e.commonAncestorContainer))return;let n=e.getBoundingClientRect();R(n,this,null)})}#p(t){if(this.#t.hasAttribute("data-selection-menu"))return;let e=t.target.closest?.(".hn-margin-annotation");if(e){let i=e.dataset.hnId,s=this.#e.find(r=>r.id===i);if(s){w(this,s);return}}let n=t.target.closest?.("mark[data-hn-id]");if(n){let i=n.dataset.hnId,s=this.#e.find(r=>r.id===i);if(s){this.#r("highlights:clicked",{id:i});let r=n.getBoundingClientRect();R(r,this,s);return}}if(!this.#a){let i=this.#b(t.clientX,t.clientY);if(i){this.#r("highlights:clicked",{id:i.id});let s=b(this.#t,i.startOffset,i.endOffset);s&&R(s.getBoundingClientRect(),this,i)}}}#b(t,e){for(let n of this.#e){let i=b(this.#t,n.startOffset,n.endOffset);if(!i)continue;let s=i.getClientRects();for(let r of s)if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)return n}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let n=e.getRangeAt(0);if(!this.#t.contains(n.commonAncestorContainer))return;let i=W(this.#t,n.startContainer,n.startOffset),s=W(this.#t,n.endContainer,n.endOffset);if(i<0||s<0||i>=s)return;let r=e.toString().trim(),l={id:z(),startOffset:i,endOffset:s,text:r,color:t,note:"",created:Date.now()};this.#e.push(l),this.#i(),this.#o(),e.removeAllRanges(),this.#r("highlights:added",{id:l.id,text:r,color:t,note:""}),T("Highlight added")}_changeColor(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.color=e,this.#i(),this.#o())}_updateNote(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.note=e,this.#i(),this.#g(),this.#r("highlights:note-changed",{id:t,note:e}),T("Note saved"))}async#y(){let t=await x.get(D,this.#s);if(!t||!Array.isArray(t.highlights))return;let e=V(this.#t.textContent);t.contentHash&&t.contentHash!==e?(this.#e=t.highlights.filter(n=>{let i=b(this.#t,n.startOffset,n.endOffset);return i?i.toString().trim()===n.text:!1}),this.#i()):this.#e=t.highlights}#i(){let t={version:1,contentHash:V(this.#t.textContent),highlights:this.#e};x.set(D,this.#s,t).catch(()=>{})}#o(){this.#a?this.#E():this.#v(),this.#g()}#v(){let t=new Map;for(let e of this.#n)t.set(e,[]);for(let e of this.#e){let n=b(this.#t,e.startOffset,e.endOffset);n&&t.has(e.color)&&t.get(e.color).push(n)}for(let[e,n]of t){let i=`hn-${e}`;n.length===0?CSS.highlights.delete(i):CSS.highlights.set(i,new Highlight(...n))}}#E(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let n=e.parentNode;for(;e.firstChild;)n.insertBefore(e.firstChild,e);n.removeChild(e)}),this.#t.normalize();let t=[...this.#e].sort((e,n)=>n.startOffset-e.startOffset);for(let e of t){let n=b(this.#t,e.startOffset,e.endOffset);if(!n)continue;let i=U(this.#t,e.color),s=document.createElement("mark");s.dataset.hnId=e.id,s.dataset.hnColor=e.color,i&&(s.style.backgroundColor=i,s.style.textDecorationColor=i);try{n.surroundContents(s)}catch{let r=n.extractContents();s.appendChild(r),n.insertNode(s)}}}#f(){for(let t of this.#d)t.remove();this.#d=[]}#g(){if(this.#f(),this.#e.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");for(let e of this.#e){let n=b(this.#t,e.startOffset,e.endOffset);if(!n)continue;let i=n.getClientRects();if(i.length===0)continue;let s=i[0],r=this.#t.getBoundingClientRect(),l=s.top-r.top,a=document.createElement("span");a.className="hn-margin-annotation",a.dataset.hnId=e.id,a.setAttribute("aria-hidden","true"),a.style.top=`${l}px`,e.note?(a.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',a.classList.add("hn-has-note")):a.textContent="You highlighted",this.#t.appendChild(a),this.#d.push(a)}}#r(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},$=new WeakMap;function E(o){if($.has(o))return $.get(o);let t=new B(o);return $.set(o,t),t}function X(o=document){o.querySelectorAll(M).forEach(t=>{t.hasAttribute("data-highlights-init")||E(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>X()):X();var et=new MutationObserver(o=>{for(let t of o)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=e;n.matches(M)&&E(n),n.querySelectorAll(M).forEach(i=>{i.hasAttribute("data-highlights-init")||E(i)})}});et.observe(document.documentElement,{childList:!0,subtree:!0});var H=class extends S{#t=!1;setup(){this.#t=!!this.closest("selection-menu");let t=document.createElement("button");t.type="button",t.setAttribute("aria-label",this.#t?"Add private note":"View notes");let e=document.createElement("icon-wc");e.setAttribute("name","sticky-note"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),this.#t?t.addEventListener("click",()=>this.#s()):t.addEventListener("click",()=>this.#n()),this.appendChild(t)}#s(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let n=e.target;n.hasAttribute("data-highlights-init")||n.setAttribute("data-highlights","");let i=E(n),s=i.getHighlights(),r=null;for(let l of s)if(e.text&&l.text&&e.text.includes(l.text.slice(0,20))){r=l;break}if(!r){i._createFromSelection("yellow");let l=i.getHighlights();r=l[l.length-1]}r&&w(i,r),t.dismiss()}#n(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let n=E(e),i=n.getHighlights(),s=i.filter(r=>r.note);s.length>0?w(n,s[0]):i.length>0&&w(n,i[0])}};F("note-wc",H);
|
|
3
|
+
//# sourceMappingURL=note-wc.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var B=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function E(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},a=k.get(s);if(customElements.get(s)){if(!a||a.priority>=i){a&&a.priority===i&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=i){a.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}k.set(s,n),customElements.define(s,t)}var y=class extends HTMLElement{#i=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#i)t();this.#i=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#i.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function q(){let s=globalThis.localStorage;if(!s)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return s.getItem(t)},async setRaw(t,e){s.setItem(t,e)},async removeRaw(t){s.removeItem(t)},async keys(t){let e=[];for(let i=0;i<s.length;i++){let n=s.key(i);n&&n.startsWith(t)&&e.push(n)}return e}}}var m=null;function u(){return m||(m=q()),m}function g(s,t){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${s}:${t}`}function A(s){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${s}:`}function $(s){try{let t=JSON.parse(s);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var h={configure(s={}){m=s.backend??null},async set(s,t,e){let i={data:e,timestamp:Date.now()};await u().setRaw(g(s,t),JSON.stringify(i))},async get(s,t,e){let i=await u().getRaw(g(s,t));if(i==null)return null;let n=$(i);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(s,t){await u().removeRaw(g(s,t))},async list(s){let t=A(s),e=await u().keys(t),i=[];for(let n of e){let a=await u().getRaw(n);if(a==null)continue;let r=$(a);r&&i.push({key:n.slice(t.length),data:r.data,timestamp:r.timestamp})}return i},async clear(s){let t=A(s),e=await u().keys(t);for(let i of e)await u().removeRaw(i)},async clearAll(){let s=await u().keys("vb:");for(let t of s)await u().removeRaw(t)},async setMany(s,t){for(let[e,i]of t)await h.set(s,e,i)}};var d={baseUrl:"/go",headers:{},services:{}},b=class extends Error{constructor(t,e,i,n){super(`VBService(${i}): ${t} ${n}`),this.name="VBServiceError",this.status=t,this.body=e,this.role=i,this.path=n}};function C(s,t){if(!t)return s;let e=s??new URLSearchParams;for(let[i,n]of Object.entries(t))n!=null&&e.set(i,String(n));return e}async function x(s){if((s.headers.get("content-type")??"").includes("application/json"))try{return await s.json()}catch{return null}try{return await s.text()}catch{return null}}var w=class s{static configure(t={}){d={baseUrl:t.baseUrl??d.baseUrl,headers:{...d.headers,...t.headers??{}},services:{...d.services,...t.services??{}}}}static resolve(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");return d.services[t]?T(d.services[t]):d.baseUrl?`${T(d.baseUrl)}/${t}`:`/go/${t}`}static _reset(){d={baseUrl:"/go",headers:{},services:{}}}constructor(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");this.role=t}async get(t,e){return this.#i("GET",t,{params:e})}async post(t,e){return this.#i("POST",t,{body:e})}async patch(t,e){return this.#i("PATCH",t,{body:e})}async delete(t){return this.#i("DELETE",t,{})}async#i(t,e,i){let n=s.resolve(this.role),a=e?e.startsWith("/")?e:`/${e}`:"",r=new URL(`${n}${a}`,globalThis.location?.origin??"http://localhost"),l=C(r.searchParams,i.params);l&&(r.search=l.toString());let o={method:t,headers:{...d.headers}};i.body!==void 0&&(o.body=JSON.stringify(i.body),o.headers["content-type"]="application/json");let p=r.toString(),f=await fetch(p,o),S=await x(f);if(!f.ok)throw new b(f.status,S,this.role,`${a||"/"}`);return S}};function T(s){return s.endsWith("/")?s.slice(0,-1):s}var N={update:"package",alert:"alert-triangle",watch:"eye",system:"settings",message:"mail",stewardship:"shield"};function c(s){return String(s??"").replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var v=class extends y{#i="panel";#w=null;#e=null;#t=null;#a=null;#s=new Set;#f=[];#o=!1;#r=null;#g=new Set;#p="all";#n=[];setup(){return this.#i=this.getAttribute("mode")==="banner"?"banner":"panel",this.#i==="banner"?this.#v():this.#k()}teardown(){this.#r!=null&&(clearInterval(this.#r),this.#r=null)}async#v(){let t=this.getAttribute("persist");if(t||console.warn("[notification-wc] banner mode requires a persist attribute"),this.dataset.mode="banner",this.dataset.variant=this.getAttribute("variant")||"info",this.dataset.position=this.getAttribute("position")||"top",t){let i=Number(this.getAttribute("expires")??""),n=Number.isFinite(i)&&i>0?i*864e5:void 0,a=await h.get("notifications",t,n?{maxAge:n}:void 0);if(a&&a.dismissed){this.hidden=!0;return}}let e=this.querySelector('[value="dismiss"], [data-dismiss]');e&&(this.#w=e,this.listen(e,"click",this.#S))}#S=async t=>{t.preventDefault();let e=this.getAttribute("persist");e&&await h.set("notifications",e,{dismissed:!0}),this.dispatchEvent(new CustomEvent("notification-wc:dismiss",{bubbles:!0,composed:!0,detail:{id:e}})),this.hidden=!0};async#k(){if(this.dataset.mode="panel",await this.#E(),this.#A(),this.#$(),await this.#c(),this.#u(),this.listen(document,"click",this.#B),this.listen(document,"keydown",this.#L),this.listen(document,"page-watch:add",()=>this.#c()),this.listen(document,"page-watch:remove",()=>this.#c()),this.getAttribute("src")){await this.#m();let t=Number(this.getAttribute("poll"));Number.isFinite(t)&&t>0&&(this.#r=setInterval(()=>this.#m(),t))}}async#E(){let t=this.getAttribute("storage-key")||"notifications",e=await h.get(t,"read-ids");Array.isArray(e)&&(this.#s=new Set(e.filter(i=>typeof i=="string")))}async#b(){let t=this.getAttribute("storage-key")||"notifications";await h.set(t,"read-ids",Array.from(this.#s))}#A(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#e){let t=this.#e.querySelector(".notification-badge");t||(t=document.createElement("span"),t.className="notification-badge",t.hidden=!0,this.#e.appendChild(t))}else{let t=document.createElement("button");t.type="button",t.setAttribute("data-trigger",""),t.className="notification-trigger",t.setAttribute("aria-label","Notifications"),t.innerHTML='<icon-wc name="bell" size="sm"></icon-wc><span class="notification-badge" hidden>0</span>',this.#e=t,this.prepend(t)}this.#a=this.#e.querySelector(".notification-badge"),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.listen(this.#e,"click",this.#N)}#$(){this.#t=document.createElement("div"),this.#t.className="notification-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label","Notifications"),this.#t.hidden=!0;let t=`notification-panel-${crypto.randomUUID().slice(0,8)}`;this.#t.id=t,this.#e?.setAttribute("aria-controls",t),this.#t.innerHTML=`
|
|
2
|
+
<header class="notification-header">
|
|
3
|
+
<strong>Notifications</strong>
|
|
4
|
+
<button type="button" class="notification-mark-all">Mark all read</button>
|
|
5
|
+
</header>
|
|
6
|
+
<nav class="notification-tabs" role="tablist" aria-label="Notification categories">
|
|
7
|
+
<button type="button" role="tab" data-tab="all" aria-selected="true">All</button>
|
|
8
|
+
<button type="button" role="tab" data-tab="watching" aria-selected="false">Watching <span class="notification-tab-count" hidden>0</span></button>
|
|
9
|
+
</nav>
|
|
10
|
+
<ul class="notification-list" role="list" data-tab-panel="all"></ul>
|
|
11
|
+
<ul class="notification-watch-list" role="list" data-tab-panel="watching" hidden></ul>
|
|
12
|
+
<footer class="notification-footer" hidden>
|
|
13
|
+
<em>No notifications</em>
|
|
14
|
+
</footer>
|
|
15
|
+
`,this.appendChild(this.#t);let e=this.#t.querySelector(".notification-mark-all");e&&this.listen(e,"click",this.#R);for(let i of this.#t.querySelectorAll('[role="tab"]'))this.listen(i,"click",this.#C);this.#d()}#l(){let t=Array.from(this.querySelectorAll(":scope > article")),e=new Map;for(let i of t){let n=i.getAttribute("data-id")||i.id||`static-${e.size}`,a=i.getAttribute("data-type")||"update",r=i.getAttribute("data-date")||"",l=i.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim()||n,p=i.querySelector("p")?.textContent?.trim()||"",f=i.querySelector("a");e.set(n,{id:n,type:a,date:r,title:l,body:p,url:f?.getAttribute("href")||null,source:"static"})}for(let i of this.#f)if(!(!i||typeof i.id!="string")){if(i.dismissed){e.delete(i.id);continue}e.set(i.id,{...e.get(i.id),...i,source:"dynamic"})}return Array.from(e.values()).sort((i,n)=>{let a=i.date?Date.parse(i.date):0;return(n.date?Date.parse(n.date):0)-a})}#d(){if(!this.#t)return;let t=this.#t.querySelector(".notification-list"),e=this.#t.querySelector(".notification-footer");if(!t)return;let i=this.#l();t.innerHTML=i.map(n=>this.#T(n)).join(""),e&&(e.hidden=i.length>0);for(let n of t.querySelectorAll("[data-notification-id]"))this.listen(n,"click",this.#M);this.#u()}#T(t){let e=N[t.type]||"bell",i=this.#s.has(t.id),n=t.date?new Date(t.date).toLocaleString():"",a=`
|
|
16
|
+
<icon-wc class="notification-type-icon" name="${c(e)}" size="sm"></icon-wc>
|
|
17
|
+
<div class="notification-body">
|
|
18
|
+
<h4>${c(t.title)}</h4>
|
|
19
|
+
${t.body?`<p>${c(t.body)}</p>`:""}
|
|
20
|
+
${n?`<time datetime="${c(t.date)}">${c(n)}</time>`:""}
|
|
21
|
+
</div>
|
|
22
|
+
`,r=t.url?"a":"button",l=t.url?`href="${c(t.url)}"`:'type="button"';return`<li role="listitem" data-notification-id="${c(t.id)}" data-type="${c(t.type||"update")}"${i?" data-read":""}>
|
|
23
|
+
<${r} class="notification-row" ${l}>${a}</${r}>
|
|
24
|
+
</li>`}#u(){if(!this.#a)return;let e=this.#l().filter(i=>!this.#s.has(i.id)).length;e>0?(this.#a.textContent=String(e),this.#a.hidden=!1,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell-dot")):(this.#a.hidden=!0,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell"))}async#c(){try{this.#n=await h.list("watches")}catch{this.#n=[]}this.#y()}#y(){if(!this.#t)return;let t=this.#t.querySelector(".notification-watch-list"),e=this.#t.querySelector(".notification-tab-count");if(t){if(t.innerHTML=this.#n.map(i=>this.#q(i)).join("")||`<li class="notification-empty"><em>You aren't watching any pages yet. Use the “Watch” button on a page to start.</em></li>`,e){let i=this.#n.length;i>0?(e.textContent=String(i),e.hidden=!1):e.hidden=!0}for(let i of t.querySelectorAll("[data-watch-unwatch]"))this.listen(i,"click",this.#x)}}#q(t){let e=t.data||{},i=e.url||t.key,n=e.title||i,a=e.lastChecked?new Date(e.lastChecked).toLocaleString():"\u2014",r=!!e.lastChanged;return`<li class="notification-watch-item"${r?" data-changed":""}>
|
|
25
|
+
<a class="notification-watch-row" href="${c(i)}">
|
|
26
|
+
<icon-wc class="notification-type-icon" name="eye" size="sm"></icon-wc>
|
|
27
|
+
<div class="notification-body">
|
|
28
|
+
<h4>${c(n)}${r?' <span class="notification-changed-badge">Changed</span>':""}</h4>
|
|
29
|
+
<p>${c(i)}</p>
|
|
30
|
+
<time>Last checked: ${c(a)}</time>
|
|
31
|
+
</div>
|
|
32
|
+
</a>
|
|
33
|
+
<button type="button" class="notification-unwatch" data-watch-unwatch data-watch-key="${c(t.key)}" aria-label="Unwatch ${c(n)}">
|
|
34
|
+
<icon-wc name="x" size="xs"></icon-wc>
|
|
35
|
+
</button>
|
|
36
|
+
</li>`}#C=t=>{let e=t.currentTarget.dataset.tab;if(!e||e===this.#p||(this.#p=e,!this.#t))return;for(let n of this.#t.querySelectorAll('[role="tab"]')){let a=n.dataset.tab===e;n.setAttribute("aria-selected",a?"true":"false")}for(let n of this.#t.querySelectorAll("[data-tab-panel]"))n.hidden=n.dataset.tabPanel!==e;let i=this.#t.querySelector(".notification-footer");i&&(i.hidden=!0)};#x=async t=>{t.preventDefault(),t.stopPropagation();let i=t.currentTarget.getAttribute("data-watch-key");if(!i)return;let n=this.#n.find(a=>a.key===i);await h.remove("watches",i),this.#n=this.#n.filter(a=>a.key!==i),this.#y(),this.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:n?.data?.url||i,subscriptionId:n?.data?.subscriptionId||null}}))};#N=t=>{t.stopPropagation(),this.#o?this.#h():this.#I()};#B=t=>{this.#o&&!this.contains(t.target)&&this.#h()};#L=t=>{t.key==="Escape"&&this.#o&&(t.preventDefault(),this.#h(),this.#e?.focus())};#M=async t=>{let e=t.currentTarget.closest("[data-notification-id]");if(!e)return;let i=e.getAttribute("data-notification-id");i&&(this.#s.has(i)||(this.#s.add(i),e.setAttribute("data-read",""),await this.#b(),this.#u(),this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:i}}))))};#R=async()=>{let t=this.#l();for(let e of t)this.#s.add(e.id);await this.#b(),this.#d();for(let e of t)this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:e.id}}))};#I(){this.#t&&(this.#o=!0,this.#t.hidden=!1,this.#e?.setAttribute("aria-expanded","true"),this.#c(),this.dispatchEvent(new CustomEvent("notification-wc:open",{bubbles:!0,composed:!0})))}#h(){this.#t&&(this.#o=!1,this.#t.hidden=!0,this.#e?.setAttribute("aria-expanded","false"),this.dispatchEvent(new CustomEvent("notification-wc:close",{bubbles:!0,composed:!0})))}async#m(){let t=this.getAttribute("src");if(!t)return;let e,i=0;try{if(t.startsWith("http")||t.startsWith("/")){let o=await fetch(t,{headers:{accept:"application/json"}});if(i=o.status,!o.ok)throw new Error(`${o.status}`);e=await o.json()}else e=await new w(t).get("/")}catch(o){let p=o instanceof b?o.status:i;if(p===404||p===503)return;let f=o instanceof b?`${o.status}`:String(o);console.warn("[notification-wc] failed to fetch",t,f);return}let n=Array.isArray(e)?e:Array.isArray(e?.notifications)?e.notifications:[],a=this.#g,r=a.size===0,l=this.hasAttribute("toast-new")?document.querySelector("toast-msg"):null;for(let o of n)o?.id&&(a.has(o.id)||(this.dispatchEvent(new CustomEvent("notification-wc:new",{bubbles:!0,composed:!0,detail:{notification:o}})),!r&&l&&typeof l.show=="function"&&l.show({message:o.title||o.body||"New notification",variant:o.type==="alert"||o.type==="stewardship"?"warning":"info",duration:5e3})),a.add(o.id));this.#f=n,this.#d()}};E("notification-wc",v);export{v as NotificationWc};
|
|
37
|
+
//# sourceMappingURL=notification-wc.js.map
|
|
@@ -1,51 +1,82 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Y=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;function x(t,e,r={}){let i=r.priority??10,o={impl:e,bundle:r.bundle,contract:r.contract,priority:i},n=M.get(t);if(customElements.get(t)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}M.set(t,o),customElements.define(t,e)}var y=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,i,o){e.addEventListener(r,i,o),this.#t.push(()=>e.removeEventListener(r,i,o))}setup(){}teardown(){}};var B="https://vanilla-breeze.com/specs/canonical-document-v1",F=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT","NAV","ASIDE","HEADER","FOOTER","FIGCAPTION","PAGE-INFO","CHANGE-SET","PAGE-TOC","PAGE-TOOLS","PAGE-STATS","CONTENT-LENS","BUTTON","DIALOG","MENU","FORM","DEL"]),U=new Set(["ARTICLE","SECTION","ASIDE","NAV","HEADER","FOOTER","DIV","MAIN","HGROUP","H1","H2","H3","H4","H5","H6","P","BLOCKQUOTE","PRE","HR","OL","UL","LI","DL","DT","DD","TABLE","THEAD","TBODY","TFOOT","TR","TD","TH","CAPTION","FIGURE","DETAILS","SUMMARY","ADDRESS","FORM","FIELDSET","LEGEND"]),V=new Set(["PRE","TEXTAREA"]);function _(t){return!t||t.nodeType!==1?!1:!!(F.has(t.tagName)||t.hasAttribute("hidden")||t.getAttribute("aria-hidden")==="true"||t.getAttribute("data-signable")==="false")}function D(t,e,r){if(_(t))return;let i=U.has(t.tagName),o=r||V.has(t.tagName);for(let n of t.childNodes)if(n.nodeType===3){let s=n.nodeValue||"";if(!s)continue;if(o)N(e,s.normalize("NFC"));else{let a=s.normalize("NFC").replace(/\s+/g," ");if(a===""||a===" "&&(e.text===""||e.text.endsWith(" ")||e.text.endsWith(`
|
|
2
|
+
`)))continue;N(e,a)}}else if(n.nodeType===1){if(n.tagName==="BR"){w(e,`
|
|
3
|
+
`);continue}D(n,e,o)}i&&w(e,`
|
|
4
|
+
|
|
5
|
+
`),t.tagName==="HR"&&w(e,`
|
|
6
|
+
|
|
7
|
+
`)}function N(t,e){t.text+=e}function w(t,e){if(!t.text.endsWith(e)){if(e===`
|
|
8
|
+
|
|
9
|
+
`&&t.text.endsWith(`
|
|
10
|
+
`)){t.text=t.text.replace(/\n+$/,"")+`
|
|
11
|
+
|
|
12
|
+
`;return}e===`
|
|
13
|
+
`&&t.text.endsWith(`
|
|
14
|
+
|
|
15
|
+
`)||(t.text+=e)}}function G(t){let e=[...t.querySelectorAll("[data-signable]")],r=e.filter(o=>!e.some(n=>n!==o&&n.contains(o))),i={text:""};for(let o of r)D(o,i,!1);return i.text.replace(/^\s+/,"").replace(/\s+$/,"")}function u(t,e){return t.querySelector(`meta[name="${$(e)}"]`)?.getAttribute("content")||""}function E(t,e){return t.querySelector(`meta[property="${$(e)}"]`)?.getAttribute("content")||""}function z(t,e){return t.querySelector(`meta[itemprop="${$(e)}"]`)?.getAttribute("content")||""}function R(t,e){return t.querySelector(`link[rel="${$(e)}"]`)?.getAttribute("href")||""}function $(t){return String(t).replace(/[^a-zA-Z0-9:_\-/]/g,"")}function j(t){if(!t)return"";try{let e=new URL(t);e.search="",e.hash="";let r=`${e.protocol}//${e.hostname.toLowerCase()}`;return e.port&&(r+=`:${e.port}`),r+=e.pathname,r}catch{return t}}function O(t){if(!t)return"";let e=String(t).match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:""}function K(t){return E(t,"og:title")||t.title||""}function W(t){let e=u(t,"keywords");return e?e.split(",").map(r=>r.trim()).filter(Boolean):[]}function X(t){return R(t,"license")||u(t,"license")}function H(t,e={}){let r=e.url??t?.location?.href??"",i=O(E(t,"article:published_time")),o=O(u(t,"last-modified")||E(t,"article:modified_time"));return{"@context":B,"@version":1,url:j(r),title:K(t),author:u(t,"author"),authorUrl:E(t,"article:author")||R(t,"author"),published:i,modified:o,version:z(t,"version"),keywords:W(t),topic:u(t,"vb:topic"),provenance:u(t,"vb:provenance"),review:u(t,"vb:review"),status:u(t,"vb:status"),license:X(t),content:G(t)}}function P(t){return JSON.stringify(t)}var C=class t extends y{setup(){this.hasAttribute("auto")&&this.#l(),this.#t(),this.#r(),this.#i(),this.#o()}#t(){for(let e of this.querySelectorAll("time[data-relative]")){let r=e.getAttribute("datetime");if(!r)continue;let i=t.#n(new Date(r));i&&(e.textContent=i)}}static#n(e){let i=Date.now()-e.getTime();if(i<0)return null;let o=Math.floor(i/1e3),n=Math.floor(o/60),s=Math.floor(n/60),a=Math.floor(s/24);return a>365?`${Math.floor(a/365)} year${Math.floor(a/365)!==1?"s":""} ago`:a>30?`${Math.floor(a/30)} month${Math.floor(a/30)!==1?"s":""} ago`:a>0?`${a} day${a!==1?"s":""} ago`:s>0?`${s} hour${s!==1?"s":""} ago`:n>0?`${n} minute${n!==1?"s":""} ago`:"just now"}#r(){let e=this.querySelector("[data-reading-time]");if(!e)return;let r=document.querySelectorAll("[data-signable]");if(!r.length)return;let i=0;for(let n of r){let s=n.textContent?.trim()||"";i+=s.split(/\s+/).filter(Boolean).length}let o=Math.max(1,Math.ceil(i/200));e.textContent=`~${o} min`}#i(){let e=!!document.querySelector('meta[name="vb:provenance"], meta[name="author"]'),r=e?"declared":"undeclared",i=this.querySelector(".page-info-badge");i&&i.setAttribute("data-trust",r),this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:r,tier:e?1:0},bubbles:!0}))}async#o(){let r=document.querySelector('meta[name="vb:signature"]')?.content;if(!r)return;let i=document.querySelector('meta[name="vb:signature-algorithm"]')?.content;if(i&&i!=="ECDSA-P256-SHA256"){this.#e("failed",{reason:`unsupported-algorithm:${i}`});return}let o=document.querySelector('link[rel="author-key"]')?.getAttribute("href");if(!o){this.#e("failed",{reason:"missing-author-key"});return}let n;try{let c=new URL(o,document.baseURI),l=await fetch(c,{credentials:"omit"});if(!l.ok)throw new Error(`status ${l.status}`);let d=await l.json(),h={kty:d.kty,crv:d.crv,x:d.x,y:d.y,use:d.use||"sig",key_ops:["verify"]};n=await crypto.subtle.importKey("jwk",h,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}catch(c){this.#e("key-unavailable",{reason:c.message});return}let s;try{let c=document.querySelector('link[rel="canonical"]')?.href||document.location.href;s=P(H(document,{url:c}))}catch(c){this.#e("failed",{reason:`canonicalize:${c.message}`});return}let a;try{let c=new TextEncoder().encode(s),l=Uint8Array.from(atob(r),d=>d.charCodeAt(0));a=await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},n,l,c)}catch(c){this.#e("failed",{reason:`verify:${c.message}`});return}this.#e(a?"verified":"failed",{reason:a?"ok":"mismatch"})}#e(e,r={}){let o={undeclared:0,declared:1,"domain-anchored":2,verified:3,failed:-1,"key-unavailable":-2}[e]??0,n=this.querySelector(".page-info-badge");if(n){n.setAttribute("data-trust",e);let s=n.getAttribute("aria-label")||"";e==="verified"&&!s.includes("verified")?n.setAttribute("aria-label",`${s} \u2014 verified`.trim()):e==="failed"?n.setAttribute("aria-label",`${s} \u2014 verification failed`.trim()):e==="key-unavailable"&&n.setAttribute("aria-label",`${s} \u2014 author key unavailable`.trim())}this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:e,tier:o,...r},bubbles:!0}))}static#a={human:"Human written","ai-assisted":"Human-written, AI-assisted","ai-generated":"AI-generated",translated:"Translated",synthesized:"Synthesized from sources",migrated:"Migrated content"};static#s={unreviewed:"Unreviewed","fact-checked":"Fact-checked","editor-reviewed":"Editor-reviewed"};static#c={draft:"Draft",published:"Published",archived:"Archived"};static#d(e){if(!e)return"";let r=String(e).trim().split(/\s+/).filter(Boolean);return r.length?r.map(o=>t.#a[o]||o).join(" \xB7 "):""}#l(){let e=f=>document.querySelector(`meta[name="${f}"]`)?.content,r=f=>document.querySelector(`meta[property="${f}"]`)?.content,i=f=>document.querySelector(`meta[itemprop="${f}"]`)?.content,o=f=>document.querySelector(`link[rel="${f}"]`)?.href,n=e("author"),s=r("article:author")||o("author"),a=e("last-modified")||r("article:modified_time"),c=r("article:published_time"),l=e("keywords"),d=e("license"),h=o("license"),p=i("version"),b=e("vb:provenance"),v=e("vb:review"),m=e("vb:status"),S=e("vb:ai-tools"),A=e("vb:topic"),L=e("vb:version-url"),g=t.#d(b),k=t.#s[v]||v||"",T=t.#c[m]||m||"",q=b||S||v||d,I=a||c||p;this.innerHTML=`
|
|
2
16
|
<details>
|
|
3
17
|
<summary>
|
|
4
|
-
${
|
|
18
|
+
${n?`
|
|
5
19
|
<span class="page-info-author">
|
|
6
|
-
${
|
|
20
|
+
${s?`<a href="${s}" rel="author">${n}</a>`:n}
|
|
7
21
|
</span>
|
|
8
22
|
<span class="page-info-sep" aria-hidden="true">·</span>
|
|
9
23
|
`:""}
|
|
10
|
-
${
|
|
11
|
-
<time datetime="${
|
|
24
|
+
${a?`
|
|
25
|
+
<time datetime="${a}" data-relative>${a}</time>
|
|
12
26
|
<span class="page-info-sep" aria-hidden="true">·</span>
|
|
13
27
|
`:""}
|
|
14
|
-
${
|
|
28
|
+
${g?`
|
|
15
29
|
<span class="page-info-badge"
|
|
16
|
-
data-provenance="${
|
|
30
|
+
data-provenance="${b||""}"
|
|
17
31
|
data-trust="declared"
|
|
18
|
-
aria-label="Content provenance: ${
|
|
19
|
-
${
|
|
32
|
+
aria-label="Content provenance: ${g}">
|
|
33
|
+
${g}
|
|
20
34
|
</span>
|
|
21
35
|
`:""}
|
|
36
|
+
${m&&m!=="published"?`
|
|
37
|
+
<span class="page-info-sep" aria-hidden="true">·</span>
|
|
38
|
+
<span class="page-info-badge" data-status="${m}">${T}</span>
|
|
39
|
+
`:""}
|
|
22
40
|
</summary>
|
|
23
41
|
<div class="page-info-panel">
|
|
24
|
-
${
|
|
42
|
+
${n?`
|
|
25
43
|
<section>
|
|
26
44
|
<h2 class="page-info-section-heading">Author</h2>
|
|
27
|
-
<p>${
|
|
45
|
+
<p>${s?`<a href="${s}" rel="author">${n}</a>`:n}</p>
|
|
28
46
|
</section>
|
|
29
47
|
`:""}
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
${I?`
|
|
49
|
+
<section>
|
|
50
|
+
<h2 class="page-info-section-heading">History</h2>
|
|
51
|
+
<dl>
|
|
52
|
+
${c?`<dl-item><dt>Published</dt><dd><time datetime="${c}" data-relative>${c}</time></dd></dl-item>`:""}
|
|
53
|
+
${a?`<dl-item><dt>Last updated</dt><dd><time datetime="${a}" data-relative>${a}</time></dd></dl-item>`:""}
|
|
54
|
+
${p?`<dl-item><dt>Version</dt><dd>${L?`<a href="${L}">${p}</a>`:p}</dd></dl-item>`:""}
|
|
55
|
+
</dl>
|
|
56
|
+
</section>
|
|
57
|
+
`:""}
|
|
58
|
+
${q?`
|
|
38
59
|
<section>
|
|
39
60
|
<h2 class="page-info-section-heading">How this was made</h2>
|
|
40
61
|
<dl>
|
|
41
|
-
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
${
|
|
62
|
+
${b?`<dl-item><dt>Authorship</dt><dd>${g}</dd></dl-item>`:""}
|
|
63
|
+
${S?`<dl-item><dt>AI tools used</dt><dd>${S}</dd></dl-item>`:""}
|
|
64
|
+
${k?`<dl-item><dt>Review</dt><dd>${k}</dd></dl-item>`:""}
|
|
65
|
+
${T?`<dl-item><dt>Status</dt><dd>${T}</dd></dl-item>`:""}
|
|
66
|
+
${d?`<dl-item><dt>License</dt><dd>${h?`<a href="${h}" rel="license">${d}</a>`:d}</dd></dl-item>`:""}
|
|
67
|
+
</dl>
|
|
68
|
+
</section>
|
|
69
|
+
`:""}
|
|
70
|
+
${l||A?`
|
|
71
|
+
<section>
|
|
72
|
+
<h2 class="page-info-section-heading">Topic</h2>
|
|
73
|
+
<dl>
|
|
74
|
+
${A?`<dl-item><dt>Subject</dt><dd>${A}</dd></dl-item>`:""}
|
|
75
|
+
${l?`<dl-item><dt>Keywords</dt><dd>${l}</dd></dl-item>`:""}
|
|
45
76
|
</dl>
|
|
46
77
|
</section>
|
|
47
78
|
`:""}
|
|
48
79
|
</div>
|
|
49
80
|
</details>
|
|
50
|
-
`}};
|
|
81
|
+
`}};x("page-info",C);export{C as PageInfo};
|
|
51
82
|
//# sourceMappingURL=page-info.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var w=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function y(c,e,t={}){let i=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:i},n=g.get(c);if(customElements.get(c)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}g.set(c,s),customElements.define(c,e)}var f=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,s){e.addEventListener(t,i,s),this.#t.push(()=>e.removeEventListener(t,i,s))}setup(){}teardown(){}};var p=class extends f{#t;#i=[];#n=new Map;#c;#e;#r;#o=!1;setup(){requestAnimationFrame(()=>this.#a())}teardown(){this.#t?.disconnect(),clearTimeout(this.#r)}#a(){this.#o=this.#h(),this.#o?this.#u():this.#y(),this.#w(),this.#f(),this.#b()}#h(){return this.querySelector("nav, details")!==null}#u(){this.#e=this.querySelector("details");let e=this.querySelectorAll('a[href^="#"]');for(let t of e){let i=t.getAttribute("href");if(!i)continue;let s=i.slice(1);if(s){let n=document.getElementById(s);n&&(this.#i.push(n),this.#n.set(s,t),t.classList.contains("link")||t.classList.add("link"),t.addEventListener("click",a=>{a.preventDefault(),this.#d(n)}))}}}#f(){this.#c=window.matchMedia("(min-width: 64rem)"),this.listen(this.#c,"change",this.#m),this.listen(window,"resize",this.#p)}#m=e=>{e.matches&&this.#e&&(this.#e.open=!0)};#p=()=>{clearTimeout(this.#r),this.#r=setTimeout(()=>this.#s(),150)};#b(){this.listen(window,"hashchange",this.#g),this.#s()}#g=()=>{this.#s()};#s(){let e=window.location.hash.slice(1);e&&this.#n.has(e)&&this.#l(e)}#l(e){for(let i of this.#n.values())i.classList.remove("active"),i.removeAttribute("aria-current");let t=this.#n.get(e);t&&(t.classList.add("active"),t.setAttribute("aria-current","true"))}#y(){let e=(this.getAttribute("levels")||"h2,h3").split(",").map(r=>r.trim().toLowerCase()),t=this.getAttribute("scope")||"main",i=this.getAttribute("title")||"On this page",s=document.querySelector(t);if(!s||(this.#i=Array.from(s.querySelectorAll(e.join(","))).filter(r=>r.id).filter(r=>!r.hasAttribute("data-toc-ignore")&&!r.closest("[data-toc-ignore]")),this.#i.length===0))return;let n={depth:-1,children:[]},a=[n];for(let r of this.#i){let l=e.indexOf(r.tagName.toLowerCase());for(;a[a.length-1].depth>=l;)a.pop();let o={heading:r,depth:l,children:[]};a[a.length-1].children.push(o),a.push(o)}let b=r=>{let l=document.createElement("ul");l.className="list";for(let o of r){let h=document.createElement("li");h.className="item",h.dataset.level=String(o.depth);let d=document.createElement("a");d.href=`#${o.heading.id}`,d.className="link",d.textContent=this.#v(o.heading),d.addEventListener("click",v=>{v.preventDefault(),this.#d(o.heading)}),h.appendChild(d),o.children.length&&h.appendChild(b(o.children)),l.appendChild(h),this.#n.set(o.heading.id,d)}return l};this.#e=document.createElement("details"),this.#e.className="details",this.#e.open=!0;let m=document.createElement("summary");m.className="summary",m.textContent=i,this.#e.appendChild(m);let u=document.createElement("nav");u.className="nav",u.setAttribute("aria-label",i),u.appendChild(b(n.children)),this.#e.appendChild(u),this.appendChild(this.#e)}#v(e){let t=e.cloneNode(!0);return t.querySelectorAll(".heading-anchor").forEach(s=>s.remove()),t.textContent.trim()}#d(e){let t=new URL(window.location.href);t.hash=e.id,window.history.pushState(null,"",t),e.scrollIntoView({behavior:"smooth",block:"start"}),e.focus(),this.dispatchEvent(new CustomEvent("page-toc:navigate",{bubbles:!0,detail:{id:e.id}}))}#w(){if(this.#i.length===0)return;let e=new Set;this.#t=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?e.add(i.target.id):e.delete(i.target.id);this.#E(e)},{rootMargin:"-80px 0px -70% 0px",threshold:0});for(let t of this.#i)this.#t.observe(t)}#E(e){for(let t of this.#i)if(e.has(t.id)){this.#l(t.id);return}this.#s()}refresh(){this.#o||(this.innerHTML=""),this.#n.clear(),this.#i=[],this.#t?.disconnect(),this.#a()}};y("page-toc",p);export{p as PageToc};
|
|
2
2
|
//# sourceMappingURL=page-toc.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function y(r,e,n={}){let o=n.priority??10,s={impl:e,bundle:n.bundle,contract:n.contract,priority:o},t=m.get(r);if(customElements.get(r)){if(!t||t.priority>=o){t&&t.priority===o&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=o){t.priority===o&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${t.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}m.set(r,s),customElements.define(r,e)}var d=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,n,o,s){e.addEventListener(n,o,s),this.#e.push(()=>e.removeEventListener(n,o,s))}setup(){}teardown(){}};var f=class extends d{setup(){this.#e().catch(()=>{})}async#e(){let e=this.getAttribute("data-lens-src")||"/api/analytics/popular",n=this.getAttribute("window"),o=new URL(e,document.baseURI);n&&o.searchParams.set("window",n);let s=null;try{let i=await fetch(o,{credentials:"omit"});if(!i.ok)throw new Error(`status ${i.status}`);s=await i.json()}catch(i){this.#r(i.message);return}let t=Array.isArray(s?.pages)?s.pages:Array.isArray(s)?s:[];if(!t.length){this.#n();return}let a=this.getAttribute("data-meta-src"),c=null;if(a)try{let i=await fetch(a,{credentials:"omit"});if(i.ok){let l=await i.json(),u=Array.isArray(l)?l:l?.pages||[];c=new Map(u.map(h=>[h.url,h]))}}catch{}this.#t(t,c)}#t(e,n){let o=parseInt(this.getAttribute("limit")||"10",10)||10,s=e.slice(0,o),t=['<h2 class="popularity-heading">Most visited</h2>'];t.push('<ol class="popularity-list">');for(let a of s){let c=n?.get(a.url)||{},i=a.title||c.title||a.url,l=g(a.views??a.count??0),u=c.provenance?`<span class="popularity-prov" data-provenance="${b(c.provenance)}">${p(c.provenance)}</span>`:"";t.push(`<li><a href="${b(a.url)}">${p(i)}</a><small>${l} views${u?` \xB7 ${u}`:""}</small></li>`)}t.push("</ol>"),this.innerHTML=t.join(`
|
|
2
|
+
`)}#r(e){this.innerHTML=`
|
|
3
|
+
<h2 class="popularity-heading">Most visited</h2>
|
|
4
|
+
<p class="popularity-empty">Popularity data is unavailable right now${e?` (${p(e)})`:""}.</p>
|
|
5
|
+
`}#n(){this.innerHTML=`
|
|
6
|
+
<h2 class="popularity-heading">Most visited</h2>
|
|
7
|
+
<p class="popularity-empty">Not enough data yet to surface most-visited pages.</p>
|
|
8
|
+
`}};function g(r){let e=Number(r)||0;return e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function p(r){return String(r??"").replace(/[&<>]/g,e=>({"&":"&","<":"<",">":">"})[e])}function b(r){return String(r??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}y("popularity-index",f);export{f as PopularityIndex};
|
|
9
|
+
//# sourceMappingURL=popularity-index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function u(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=l.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(r,s),customElements.define(r,t)}var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#e.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}};var a=class extends c{#e;#t;#n=null;setup(){this.#n===null&&(this.#n=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#n,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&this.setAttribute("role","group");let i=this.getAttribute("variant")||"icon";this.#e=document.createElement("button"),this.#e.type="button",this.#e.className="print-trigger",this.#e.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#e.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#e.appendChild(o)}if(this.listen(this.#e,"click",this.#i),this.append(this.#e),e){let o=document.createElement("label");this.#t=document.createElement("input"),this.#t.type="checkbox";let d=document.createElement("span");d.textContent="Print without VB styles",o.append(this.#t,d),this.append(o)}}teardown(){this.#e=null,this.#t=null}#i=()=>{let t=this.#t?.checked;if(t&&document.documentElement.setAttribute("data-print-raw",""),window.print(),t){let e=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",e),clearTimeout(i)};window.addEventListener("afterprint",e,{once:!0});let i=setTimeout(e,5e3)}}};u("print-page",a);export{a as PrintPage};
|
|
2
2
|
//# sourceMappingURL=print-page.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var p=window.matchMedia("(prefers-reduced-motion: reduce)");var a=new Map;function l(r,e,s={}){let i=s.priority??10,t={impl:e,bundle:s.bundle,contract:s.contract,priority:i},n=a.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${s.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${s.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${s.bundle}" (first wins at equal priority).`);return}a.set(r,t),customElements.define(r,e)}var o=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,s,i,t){e.addEventListener(s,i,t),this.#e.push(()=>e.removeEventListener(s,i,t))}setup(){}teardown(){}};var c=class r extends o{static STORAGE_KEY="vb:recently-visited";static PAUSE_KEY="vb:recently-visited:paused";setup(){!this.hasAttribute("no-track")&&!this.#e()&&this.#o(),this.#n()}#e(){try{return localStorage.getItem(r.PAUSE_KEY)==="1"}catch{return!1}}#i(e){try{e?localStorage.setItem(r.PAUSE_KEY,"1"):localStorage.removeItem(r.PAUSE_KEY)}catch{}}#t(){try{let e=localStorage.getItem(r.STORAGE_KEY);if(!e)return[];let s=JSON.parse(e);return Array.isArray(s)?s:[]}catch{return[]}}#r(e){try{localStorage.setItem(r.STORAGE_KEY,JSON.stringify(e))}catch{}}#s(){let e=parseInt(this.getAttribute("limit")||"25",10);return Number.isFinite(e)&&e>0?e:25}#o(){let e=location.pathname+location.search,s=document.title,i=Date.now(),t=this.#t().filter(n=>n.url!==e);t.unshift({url:e,title:s,ts:i}),this.#r(t.slice(0,this.#s()))}#n(){let e=this.#t().slice(0,this.#s()),s=this.getAttribute("empty-text")||"No recently visited pages yet.",i=this.#e(),t=[];if(t.push('<header class="recently-visited-header">'),t.push('<h2 class="recently-visited-heading">Recently visited</h2>'),t.push('<menu class="recently-visited-actions">'),t.push(`<li><label class="recently-visited-pause"><input type="checkbox" data-recently-visited-pause${i?" checked":""}> <span>Pause</span></label></li>`),t.push('<li><button type="button" data-recently-visited-clear class="ghost">Clear</button></li>'),t.push("</menu>"),t.push("</header>"),t.push('<p class="recently-visited-explainer"><small>Stored on this device only. Never sent to a server.</small></p>'),e.length===0)t.push(`<p class="recently-visited-empty">${d(s)}</p>`);else{t.push('<ol class="recently-visited-list">');for(let n of e){let u=f(n.ts);t.push(`<li><a href="${h(n.url)}">${d(n.title||n.url)}</a><small>${u}</small></li>`)}t.push("</ol>")}this.innerHTML=t.join(`
|
|
2
|
+
`),this.#c()}#c(){let e=this.querySelector("[data-recently-visited-clear]");e&&e.addEventListener("click",()=>{this.#r([]),this.#n(),this.dispatchEvent(new CustomEvent("recently-visited:clear",{bubbles:!0}))});let s=this.querySelector("[data-recently-visited-pause]");s&&s.addEventListener("change",()=>{this.#i(s.checked)})}};function d(r){return String(r??"").replace(/[&<>]/g,e=>({"&":"&","<":"<",">":">"})[e])}function h(r){return String(r??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function f(r){let e=Date.now()-r;return e<6e4?"just now":e<36e5?`${Math.floor(e/6e4)}m ago`:e<864e5?`${Math.floor(e/36e5)}h ago`:`${Math.floor(e/864e5)}d ago`}l("recently-visited",c);export{c as RecentlyVisited};
|
|
3
|
+
//# sourceMappingURL=recently-visited.js.map
|