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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{for(var e in t)pi(r,e,{get:t[e],enumerable:!0})};function Ee(r,t,e){let i=Math.pow(2,e),s=r*Math.PI/180,n=(t+180)/360*i,o=(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i,a=Math.floor(n),l=Math.floor(o),c=Math.round((n-a)*256),h=Math.round((o-l)*256);return{tileX:a,tileY:l,pixelX:c,pixelY:h}}function Se(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function Y(r,t,e,i){switch(r){case"carto-light":return`https://basemaps.cartocdn.com/light_all/${t}/${e}/${i}.png`;case"carto-dark":return`https://basemaps.cartocdn.com/dark_all/${t}/${e}/${i}.png`;default:return`https://tile.openstreetmap.org/${t}/${e}/${i}.png`}}var kt=ft(()=>{});var Ce={};we(Ce,{MapInteraction:()=>xt});var xt,Te=ft(()=>{kt();xt=class{#t;#e;#i;#r;#n;#s=0;#o=0;#a=15;#u=1;#l=19;#c=0;#m=0;#p=new Map;#h=null;#y=0;#b=0;#g=!1;#d=0;#f=0;constructor({shadow:t,host:e,lat:i,lng:s,zoom:n,provider:o,onDeactivate:a}){this.#t=t,this.#e=e,this.#r=o,this.#n=a,this.#a=n,this.#i=t.querySelector('[part="tiles"]'),this.#h=t.querySelector('[part="marker"]');let l=256*Math.pow(2,n),c=i*Math.PI/180;this.#s=(s+180)/360*l,this.#o=(1-Math.log(Math.tan(c)+1/Math.cos(c))/Math.PI)/2*l,this.#y=this.#s,this.#b=this.#o,this.#c=this.#e.offsetWidth||400,this.#m=this.#e.offsetHeight||300,this.#i.innerHTML="",this.#i.style.transform="",this.#h&&(this.#h.style.position="absolute",this.#h.style.top="",this.#h.style.left="",this.#i.appendChild(this.#h)),this.#v(),this.#x()}#v(){this.#i.addEventListener("pointerdown",this.#w),this.#i.addEventListener("wheel",this.#A,{passive:!1}),this.#e.addEventListener("keydown",this.#C)}#w=t=>{t.button===0&&(t.preventDefault(),this.#g=!0,this.#d=t.clientX,this.#f=t.clientY,this.#i.setPointerCapture(t.pointerId),this.#i.setAttribute("data-dragging",""),this.#i.addEventListener("pointermove",this.#E),this.#i.addEventListener("pointerup",this.#S))};#E=t=>{if(!this.#g)return;let e=t.clientX-this.#d,i=t.clientY-this.#f;this.#d=t.clientX,this.#f=t.clientY,this.#s-=e,this.#o-=i,this.#k(),this.#x()};#S=t=>{this.#g=!1,this.#i.releasePointerCapture(t.pointerId),this.#i.removeAttribute("data-dragging"),this.#i.removeEventListener("pointermove",this.#E),this.#i.removeEventListener("pointerup",this.#S),this.#M()};#A=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#u,Math.min(this.#l,this.#a+e)));if(i===this.#a)return;let s=this.#e.getBoundingClientRect(),n=t.clientX-s.left,o=t.clientY-s.top;this.#$(i,n,o)};#C=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.#s-=80,this.#k(),this.#x(),this.#M();break;case"ArrowRight":t.preventDefault(),this.#s+=80,this.#k(),this.#x(),this.#M();break;case"ArrowUp":t.preventDefault(),this.#o-=80,this.#k(),this.#x(),this.#M();break;case"ArrowDown":t.preventDefault(),this.#o+=80,this.#k(),this.#x(),this.#M();break;case"+":case"=":t.preventDefault(),this.#$(this.#a+1,this.#c/2,this.#m/2);break;case"-":t.preventDefault(),this.#$(this.#a-1,this.#c/2,this.#m/2);break;case"Escape":t.preventDefault(),this.#n();break}};#$(t,e,i){if(t=Math.max(this.#u,Math.min(this.#l,t)),t===this.#a)return;let s=this.#s-this.#c/2,n=this.#o-this.#m/2,o=s+e,a=n+i,l=Math.pow(2,t-this.#a);this.#s=o*l-e+this.#c/2,this.#o=a*l-i+this.#m/2,this.#y*=l,this.#b*=l,this.#a=t,this.#j(),this.#k(),this.#x(),this.#M()}#k(){let t=256*Math.pow(2,this.#a);this.#s=(this.#s%t+t)%t,this.#o=Math.max(this.#m/2,Math.min(t-this.#m/2,this.#o))}#x(){let t=-(this.#s-this.#c/2),e=-(this.#o-this.#m/2);this.#i.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#N(),this.#_(),this.#L()}#N(){let t=this.#a,e=Math.pow(2,t),i=this.#s-this.#c/2,s=this.#o-this.#m/2,n=i+this.#c,o=s+this.#m,a=Math.floor(i/256)-1,l=Math.max(0,Math.floor(s/256)-1),c=Math.ceil(n/256)+1,h=Math.min(e,Math.ceil(o/256)+1);for(let u=l;u<h;u++)for(let d=a;d<c;d++){let p=(d%e+e)%e,g=`${t}/${p}/${u}`;this.#p.has(g)||this.#T(t,d,u,p)}}#T(t,e,i,s){let n=`${t}/${s}/${i}`;if(this.#p.has(n))return;let o=e*256,a=i*256,l=document.createElement("img");l.src=Y(this.#r,t,s,i),l.alt="",l.draggable=!1,l.style.left=o+"px",l.style.top=a+"px",l.style.width="256px",l.style.height="256px",l._wx=o,l._wy=a,this.#p.set(n,l),this.#i.appendChild(l)}#_(){let t=this.#s-this.#c/2,e=this.#o-this.#m/2,i=512;for(let[s,n]of this.#p){let o=n._wx,a=n._wy;(o+256<t-i||o>t+this.#c+i||a+256<e-i||a>e+this.#m+i)&&(n.remove(),this.#p.delete(s))}}#L(){if(!this.#h)return;let t=this.#h.offsetWidth||32;this.#h.style.left=`${Math.round(this.#y-t/2)}px`,this.#h.style.top=`${Math.round(this.#b-t)}px`,this.#h.style.transform=""}#M(){let{lat:t,lng:e}=Se(this.#s,this.#o,this.#a);this.#e.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#a}}))}#j(){for(let t of this.#p.values())t.remove();this.#p.clear()}destroy(){if(this.#i.removeEventListener("pointerdown",this.#w),this.#i.removeEventListener("wheel",this.#A),this.#e.removeEventListener("keydown",this.#C),this.#i.removeEventListener("pointermove",this.#E),this.#i.removeEventListener("pointerup",this.#S),this.#h&&this.#h.parentNode===this.#i){let t=this.#t.querySelector('[part="container"]');t&&(t.insertBefore(this.#h,this.#i.nextSibling),this.#h.style.position="",this.#h.style.left="",this.#h.style.top="",this.#h.style.transform="")}this.#j(),this.#e.removeAttribute("data-interactive-active")}}});var Et={};we(Et,{EMOJI_ALIASES:()=>_e,EMOJI_GROUPS:()=>vi,EMOJI_GROUP_ICONS:()=>wi,EMOJI_GROUP_LABELS:()=>yi,EMOJI_MAP:()=>H,getByGroup:()=>xi,resolveEmoji:()=>ki,searchEmoji:()=>Ai});function Me(r){for(let[t,e,i,s]of r){if(H.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};H.set(t,n),Q.push(n)}}function ki(r){let t=H.get(r);if(t)return t;let e=_e.get(r);return e&&H.get(e)||null}function xi(r){let t=Z.filter(i=>i.group===r),e=Q.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function Ai(r){let t=r.toLowerCase().trim(),e=Q.length>0?Z.concat(Q):Z;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var Z,H,_e,vi,yi,wi,Q,St=ft(()=>{Z=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],H=new Map(Z.map(r=>[r.shortcode,r])),_e=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["raised_fist","muscle"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["poop","skull"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),vi=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],yi={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},wi={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},Q=[];globalThis.__vbEmojiRegister=Me;globalThis.__vbEmojiExtended&&(Me(globalThis.__vbEmojiExtended),delete globalThis.__vbEmojiExtended)});var $r=window.matchMedia("(prefers-reduced-motion: reduce)");var ke=new Map;function m(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=ke.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}ke.set(r,s),customElements.define(r,t)}var f=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,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}};var gt=class extends f{#t=null;#e=null;#i=!1;#r=null;#n=null;#s=null;#o=null;#a=null;#u=null;#l=null;#c=null;#m=null;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;this.#p(),t&&(this.#y(),this.#b(),this.#g()),this.#E(),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#m=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#m)}teardown(){this.#t&&this.#t.setAttribute("controls","")}#p(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
-
<style>${this.#
|
|
1
|
+
var Ls=Object.defineProperty;var Bt=(r,t)=>()=>(r&&(t=r(r=0)),t);var gi=(r,t)=>{for(var e in t)Ls(r,e,{get:t[e],enumerable:!0})};function wi(r,t,e){let i=Math.pow(2,e),s=r*Math.PI/180,n=(t+180)/360*i,o=(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i,a=Math.floor(n),l=Math.floor(o),c=Math.round((n-a)*256),h=Math.round((o-l)*256);return{tileX:a,tileY:l,pixelX:c,pixelY:h}}function ki(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function mt(r,t,e,i,s){if(s)return s.replace("{z}",String(t)).replace("{x}",String(e)).replace("{y}",String(i));switch(r){case"carto-light":return`https://basemaps.cartocdn.com/light_all/${t}/${e}/${i}.png`;case"carto-dark":return`https://basemaps.cartocdn.com/dark_all/${t}/${e}/${i}.png`;default:return`https://tile.openstreetmap.org/${t}/${e}/${i}.png`}}var Ht=Bt(()=>{});var xi={};gi(xi,{MapInteraction:()=>Ut});var Ut,Ai=Bt(()=>{Ht();Ut=class{#t;#e;#i;#n;#r;#s;#a=0;#o=0;#c=15;#l=1;#h=19;#f=0;#d=0;#u=new Map;#m=null;#b=0;#v=0;#p=!1;#g=0;#y=0;constructor({shadow:t,host:e,lat:i,lng:s,zoom:n,provider:o,tileUrl:a,onDeactivate:l}){this.#t=t,this.#e=e,this.#n=o,this.#r=a||"",this.#s=l,this.#c=n,this.#i=t.querySelector('[part="tiles"]'),this.#m=t.querySelector('[part="marker"]');let c=256*Math.pow(2,n),h=i*Math.PI/180;this.#a=(s+180)/360*c,this.#o=(1-Math.log(Math.tan(h)+1/Math.cos(h))/Math.PI)/2*c,this.#b=this.#a,this.#v=this.#o,this.#f=this.#e.offsetWidth||400,this.#d=this.#e.offsetHeight||300,this.#i.innerHTML="",this.#i.style.transform="",this.#m&&(this.#m.style.position="absolute",this.#m.style.top="",this.#m.style.left="",this.#i.appendChild(this.#m)),this.#w(),this.#$()}#w(){this.#i.addEventListener("pointerdown",this.#k),this.#i.addEventListener("wheel",this.#A,{passive:!1}),this.#e.addEventListener("keydown",this.#T)}#k=t=>{t.button===0&&(t.preventDefault(),this.#p=!0,this.#g=t.clientX,this.#y=t.clientY,this.#i.setPointerCapture(t.pointerId),this.#i.setAttribute("data-dragging",""),this.#i.addEventListener("pointermove",this.#C),this.#i.addEventListener("pointerup",this.#x))};#C=t=>{if(!this.#p)return;let e=t.clientX-this.#g,i=t.clientY-this.#y;this.#g=t.clientX,this.#y=t.clientY,this.#a-=e,this.#o-=i,this.#S(),this.#$()};#x=t=>{this.#p=!1,this.#i.releasePointerCapture(t.pointerId),this.#i.removeAttribute("data-dragging"),this.#i.removeEventListener("pointermove",this.#C),this.#i.removeEventListener("pointerup",this.#x),this.#_()};#A=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#l,Math.min(this.#h,this.#c+e)));if(i===this.#c)return;let s=this.#e.getBoundingClientRect(),n=t.clientX-s.left,o=t.clientY-s.top;this.#E(i,n,o)};#T=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.#a-=80,this.#S(),this.#$(),this.#_();break;case"ArrowRight":t.preventDefault(),this.#a+=80,this.#S(),this.#$(),this.#_();break;case"ArrowUp":t.preventDefault(),this.#o-=80,this.#S(),this.#$(),this.#_();break;case"ArrowDown":t.preventDefault(),this.#o+=80,this.#S(),this.#$(),this.#_();break;case"+":case"=":t.preventDefault(),this.#E(this.#c+1,this.#f/2,this.#d/2);break;case"-":t.preventDefault(),this.#E(this.#c-1,this.#f/2,this.#d/2);break;case"Escape":t.preventDefault(),this.#s();break}};#E(t,e,i){if(t=Math.max(this.#l,Math.min(this.#h,t)),t===this.#c)return;let s=this.#a-this.#f/2,n=this.#o-this.#d/2,o=s+e,a=n+i,l=Math.pow(2,t-this.#c);this.#a=o*l-e+this.#f/2,this.#o=a*l-i+this.#d/2,this.#b*=l,this.#v*=l,this.#c=t,this.#z(),this.#S(),this.#$(),this.#_()}#S(){let t=256*Math.pow(2,this.#c);this.#a=(this.#a%t+t)%t,this.#o=Math.max(this.#d/2,Math.min(t-this.#d/2,this.#o))}#$(){let t=-(this.#a-this.#f/2),e=-(this.#o-this.#d/2);this.#i.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#L(),this.#R(),this.#j()}#L(){let t=this.#c,e=Math.pow(2,t),i=this.#a-this.#f/2,s=this.#o-this.#d/2,n=i+this.#f,o=s+this.#d,a=Math.floor(i/256)-1,l=Math.max(0,Math.floor(s/256)-1),c=Math.ceil(n/256)+1,h=Math.min(e,Math.ceil(o/256)+1);for(let u=l;u<h;u++)for(let d=a;d<c;d++){let f=(d%e+e)%e,g=`${t}/${f}/${u}`;this.#u.has(g)||this.#M(t,d,u,f)}}#M(t,e,i,s){let n=`${t}/${s}/${i}`;if(this.#u.has(n))return;let o=e*256,a=i*256,l=document.createElement("img");l.src=mt(this.#n,t,s,i,this.#r),l.alt="",l.draggable=!1,l.style.left=o+"px",l.style.top=a+"px",l.style.width="256px",l.style.height="256px",l._wx=o,l._wy=a,this.#u.set(n,l),this.#i.appendChild(l)}#R(){let t=this.#a-this.#f/2,e=this.#o-this.#d/2,i=512;for(let[s,n]of this.#u){let o=n._wx,a=n._wy;(o+256<t-i||o>t+this.#f+i||a+256<e-i||a>e+this.#d+i)&&(n.remove(),this.#u.delete(s))}}#j(){if(!this.#m)return;let t=this.#m.offsetWidth||32;this.#m.style.left=`${Math.round(this.#b-t/2)}px`,this.#m.style.top=`${Math.round(this.#v-t)}px`,this.#m.style.transform=""}#_(){let{lat:t,lng:e}=ki(this.#a,this.#o,this.#c);this.#e.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#c}}))}#z(){for(let t of this.#u.values())t.remove();this.#u.clear()}destroy(){if(this.#i.removeEventListener("pointerdown",this.#k),this.#i.removeEventListener("wheel",this.#A),this.#e.removeEventListener("keydown",this.#T),this.#i.removeEventListener("pointermove",this.#C),this.#i.removeEventListener("pointerup",this.#x),this.#m&&this.#m.parentNode===this.#i){let t=this.#t.querySelector('[part="container"]');t&&(t.insertBefore(this.#m,this.#i.nextSibling),this.#m.style.position="",this.#m.style.left="",this.#m.style.top="",this.#m.style.transform="")}this.#z(),this.#e.removeAttribute("data-interactive-active")}}});var Wt={};gi(Wt,{EMOJI_ALIASES:()=>Ei,EMOJI_GROUPS:()=>js,EMOJI_GROUP_ICONS:()=>Ps,EMOJI_GROUP_LABELS:()=>zs,EMOJI_MAP:()=>st,getByGroup:()=>qs,resolveEmoji:()=>Bs,searchEmoji:()=>Is});function Si(r){for(let[t,e,i,s]of r){if(st.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};st.set(t,n),gt.push(n)}}function Bs(r){let t=st.get(r);if(t)return t;let e=Ei.get(r);return e&&st.get(e)||null}function qs(r){let t=ft.filter(i=>i.group===r),e=gt.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function Is(r){let t=r.toLowerCase().trim(),e=gt.length>0?ft.concat(gt):ft;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var ft,st,Ei,js,zs,Ps,gt,Gt=Bt(()=>{ft=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],st=new Map(ft.map(r=>[r.shortcode,r])),Ei=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["raised_fist","muscle"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["poop","skull"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),js=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],zs={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},Ps={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},gt=[];globalThis.__vbEmojiRegister=Si;globalThis.__vbEmojiExtended&&(Si(globalThis.__vbEmojiExtended),delete globalThis.__vbEmojiExtended)});var go=window.matchMedia("(prefers-reduced-motion: reduce)");var bi=new Map;function p(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=bi.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}bi.set(r,s),customElements.define(r,t)}var m=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,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}};var qt=class extends m{#t=null;#e=null;#i=!1;#n=null;#r=null;#s=null;#a=null;#o=null;#c=null;#l=null;#h=null;#f=null;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;this.#d(),t&&(this.#m(),this.#b(),this.#v()),this.#k(),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#f=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#f)}teardown(){this.#t&&this.#t.setAttribute("controls","")}#d(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
+
<style>${this.#u()}</style>
|
|
3
3
|
<div part="player" class="player">
|
|
4
4
|
<div part="controls" class="controls" role="group" aria-label="Audio controls">
|
|
5
5
|
<button part="play-button" class="play-btn" type="button" aria-label="Play">
|
|
@@ -42,7 +42,7 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
42
42
|
</div>
|
|
43
43
|
<slot></slot>
|
|
44
44
|
</div>
|
|
45
|
-
`,this.#
|
|
45
|
+
`,this.#n=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#s=t.querySelector(".timeline"),this.#a=t.querySelector(".timeline-fill"),this.#o=t.querySelector(".volume"),this.#c=t.querySelector(".current-time"),this.#l=t.querySelector(".duration"),this.#h=t.querySelector(".track-title")}#u(){return`
|
|
46
46
|
:host {
|
|
47
47
|
display: block;
|
|
48
48
|
--_accent: var(--audio-player-accent, var(--color-primary, oklch(55% 0.2 260)));
|
|
@@ -336,7 +336,7 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
336
336
|
transform: none;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
`}#
|
|
339
|
+
`}#m(){this.#t.addEventListener("timeupdate",()=>this.#y()),this.#t.addEventListener("loadedmetadata",()=>this.#w()),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#r.setAttribute("aria-label","Pause"),this.#x("audio-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#r.setAttribute("aria-label","Play"),this.#x("audio-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#r.setAttribute("aria-label","Play");let t=this.#e?.querySelector("li[data-audio-active]");t&&t.setAttribute("data-audio-played",""),this.#e&&this.#g(),this.#x("audio-player:ended",{src:this.#t.currentSrc})})}#b(){this.#r.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#s.addEventListener("input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#s.value)/100*this.#t.duration)}),this.#o.addEventListener("input",()=>{this.#t.volume=Number(this.#o.value),this.#t.muted=!1,this.removeAttribute("muted"),this.#o.style.setProperty("--_vol",this.#o.value)});let t=this.shadowRoot?.querySelector(".mute-btn");t&&(t.addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#o.style.setProperty("--_vol",this.#t.muted?"0":this.#o.value)}),this.addEventListener("keydown",e=>{let i=e.target;if(!(i?.tagName==="INPUT"||i?.tagName==="TEXTAREA"))switch(e.key){case" ":e.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":e.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10);break;case"ArrowRight":e.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10);break;case"m":case"M":this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#o.style.setProperty("--_vol",this.#t.muted?"0":this.#o.value);break}}),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"))}#v(){this.#e&&this.#e.addEventListener("click",t=>{let i=t.target?.closest("a[href]");i&&(t.preventDefault(),this.#p(i.href,i.closest("li")))})}#p(t,e){if(!this.#e)return;this.#e.querySelectorAll("li").forEach(s=>s.removeAttribute("data-audio-active")),e&&e.setAttribute("data-audio-active",""),this.#t.src=t,this.#t.play().catch(()=>{}),this.#k(),this.#x("audio-player:track-change",{src:t,title:e?.querySelector("a")?.textContent??""})}#g(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-audio-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#p(o.href,n)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#p(s.href,t[i])}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#p(s.href,t[0])}}#y(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#c.textContent=this.#C(t),this.#s.value=String(i),this.#a.style.width=`${i}%`}#w(){let t=this.#t.duration||0;this.#l.textContent=this.#C(t)}#k(){if(!this.#h)return;if(this.#e){let e=this.#e.querySelector("li[data-audio-active] a");if(e){this.#h.textContent=e.textContent;return}}let t=this.#t.currentSrc||this.#t.querySelector("source")?.src||"";if(t){let e=t.split("/").pop().split("?")[0];this.#h.textContent=e.replace(/\.[^.]+$/,"").replace(/[-_]/g," ")}}#C(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60).toString().padStart(2,"0");return`${e}:${i}`}#x(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};p("audio-player",qt);var It=new Map;function Ms(){if(!It.has("default"))try{It.set("default",new AudioContext)}catch{return null}return It.get("default")}var Dt=new WeakMap;function _s(r,t){if(Dt.has(r))return Dt.get(r);let e=t.createMediaElementSource(r);return Dt.set(r,e),e}var Ot=class extends m{#t=null;#e=null;#i=null;#n=null;#r=null;#s=null;#a=null;#o=null;#c=!0;#l=!1;#h=!1;#f=null;static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){this.#h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let t=!this.shadowRoot;this.#d(),this.#u(),t&&(this.#k(),this.#C()),this.#f=()=>{let e=this.shadowRoot?.querySelector("canvas");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#f)}teardown(){this.#v(),this.#o?.disconnect()}attributeChangedCallback(t){t==="for"&&this.#u()}#d(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
340
340
|
<style>
|
|
341
341
|
:host {
|
|
342
342
|
display: block;
|
|
@@ -354,8 +354,8 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
354
354
|
}
|
|
355
355
|
</style>
|
|
356
356
|
<canvas aria-hidden="true"></canvas>
|
|
357
|
-
`,this.#t=t.querySelector("canvas")}#
|
|
358
|
-
<style>${this.#
|
|
357
|
+
`,this.#t=t.querySelector("canvas")}#u(){let t=this.getAttribute("for");t&&(this.#i=document.getElementById(t),!(!this.#i||this.#i.tagName!=="AUDIO")&&(this.#l||this.#i.addEventListener("play",()=>this.#m(),{once:!0})))}#m(){if(this.#l||(this.#l=!0,this.#n=Ms(),!this.#n))return;this.#n.state==="suspended"&&this.#n.resume();let t=parseInt(this.getAttribute("data-fft-size")||"256",10);this.#r=this.#n.createAnalyser(),this.#r.fftSize=t,this.#r.smoothingTimeConstant=.8,this.#s=_s(this.#i,this.#n),this.#s.connect(this.#r),this.#r.connect(this.#n.destination),this.#b()}#b(){if(this.#h)return;let t=()=>{if(!this.#c||this.#h){this.#a=null;return}this.#a=requestAnimationFrame(t),this.#p()};this.#a=requestAnimationFrame(t)}#v(){this.#a&&(cancelAnimationFrame(this.#a),this.#a=null)}#p(){let t=this.#t,e=t.getContext("2d");if(!e)return;let i=t.width=t.offsetWidth*(window.devicePixelRatio||1),s=t.height=t.offsetHeight*(window.devicePixelRatio||1),n=getComputedStyle(this),o=n.getPropertyValue("--_color").trim()||"oklch(55% 0.2 260)",a=n.getPropertyValue("--_bg").trim();if(e.clearRect(0,0,i,s),a&&a!=="transparent"&&(e.fillStyle=a,e.fillRect(0,0,i,s)),!this.#r)return;let l=this.getAttribute("data-mode")||"bars",c=this.#r.frequencyBinCount,h=new Uint8Array(c);l==="waveform"?(this.#r.getByteTimeDomainData(h),this.#y(e,i,s,o,h)):l==="circle"?(this.#r.getByteFrequencyData(h),this.#w(e,i,s,o,h)):(this.#r.getByteFrequencyData(h),this.#g(e,i,s,o,h))}#g(t,e,i,s,n){let o=Math.min(n.length,64),a=e/o-1;t.fillStyle=s;for(let l=0;l<o;l++){let h=n[l]/255*i,u=l*(e/o);t.fillRect(u,i-h,a,h)}}#y(t,e,i,s,n){let o=e/n.length;t.strokeStyle=s,t.lineWidth=2,t.beginPath();for(let a=0;a<n.length;a++){let c=n[a]/128*i/2;a===0?t.moveTo(0,c):t.lineTo(a*o,c)}t.stroke()}#w(t,e,i,s,n){let o=e/2,a=i/2,l=Math.min(e,i)*.25,c=n.length;t.strokeStyle=s,t.lineWidth=2,t.beginPath();for(let h=0;h<c;h++){let u=h/c*Math.PI*2,d=n[h]/255*(l*.8),f=l+d,g=o+f*Math.cos(u),v=a+f*Math.sin(u);h===0?t.moveTo(g,v):t.lineTo(g,v)}t.closePath(),t.stroke()}#k(){this.#o=new IntersectionObserver(([t])=>{this.#c=t.isIntersecting,this.#c&&this.#l&&!this.#a&&!this.#h&&this.#b()}),this.#o.observe(this)}#C(){window.matchMedia("(prefers-reduced-motion: reduce)").addEventListener("change",t=>{this.#h=t.matches,t.matches?this.#v():this.#l&&this.#c&&this.#b()})}};p("audio-visualizer",Ot);var vi=[.5,.75,1,1.25,1.5,2],Rs=3e3,Ft=class extends m{#t=null;#e=null;#i=!1;#n=null;#r=null;#s=null;#a=null;#o=null;#c=null;#l=null;#h=null;#f=null;#d=null;#u=null;#m=null;#b=null;#v=null;#p=null;#g=2;#y=null;#w=null;setup(){if(this.#t=this.querySelector("video"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;this.#k(),t&&(this.#x(),this.#A(),this.#$(),this.#T()),this.hasAttribute("muted")&&(this.#t.muted=!0,this.setAttribute("muted","")),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#E(),this.#y=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#y),this.#w=()=>{let e=!!document.fullscreenElement;this.toggleAttribute("data-fullscreen",e),this.#m.setAttribute("aria-label",e?"Exit fullscreen":"Fullscreen"),this.#N("video-player:fullscreen",{active:e})},this.listen(document,"fullscreenchange",this.#w),this.setAttribute("state","idle")}teardown(){this.#t&&this.#t.setAttribute("controls",""),this.#p!=null&&clearTimeout(this.#p)}#k(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
358
|
+
<style>${this.#C()}</style>
|
|
359
359
|
<div part="player" class="player">
|
|
360
360
|
<slot></slot>
|
|
361
361
|
<button part="play-overlay" class="play-overlay" type="button" aria-label="Play video">
|
|
@@ -438,7 +438,7 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
438
438
|
</div>
|
|
439
439
|
<div class="sr-status" role="status" aria-live="polite"></div>
|
|
440
440
|
</div>
|
|
441
|
-
`,this.#
|
|
441
|
+
`,this.#n=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#s=t.querySelector(".play-overlay"),this.#a=t.querySelector(".timeline"),this.#o=t.querySelector(".timeline-fill"),this.#c=t.querySelector(".timeline-buffer"),this.#l=t.querySelector(".volume"),this.#h=t.querySelector(".current-time"),this.#f=t.querySelector(".duration"),this.#d=t.querySelector(".speed-btn"),this.#u=t.querySelector(".captions-btn"),this.#m=t.querySelector(".fullscreen-btn"),this.#b=t.querySelector(".buffer-indicator"),this.#v=t.querySelector(".sr-status"),this.#t.querySelector('track[kind="captions"], track[kind="subtitles"]')||(this.#u.hidden=!0)}#C(){return`
|
|
442
442
|
:host {
|
|
443
443
|
display: block;
|
|
444
444
|
--_accent: var(--video-player-accent, var(--color-primary, oklch(55% 0.2 260)));
|
|
@@ -864,7 +864,7 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
864
864
|
cursor: auto;
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
`}#
|
|
867
|
+
`}#x(){this.#t.addEventListener("timeupdate",()=>this.#j()),this.#t.addEventListener("loadedmetadata",()=>this.#_()),this.#t.addEventListener("progress",()=>this.#z()),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#r.setAttribute("aria-label","Pause"),this.#q("Playing"),this.#N("video-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#r.setAttribute("aria-label","Play"),this.#E(),this.#q("Paused"),this.#N("video-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#r.setAttribute("aria-label","Play"),this.#E();let t=this.#e?.querySelector("li[data-video-active]");t&&t.setAttribute("data-video-played",""),this.#e&&this.#R(),this.#q("Ended"),this.#N("video-player:ended",{src:this.#t.currentSrc})}),this.#t.addEventListener("waiting",()=>{this.#i&&(this.setAttribute("state","buffering"),this.#q("Buffering"))}),this.#t.addEventListener("playing",()=>{this.getAttribute("state")==="buffering"&&this.setAttribute("state","playing")})}#A(){this.#s.addEventListener("click",n=>{n.stopPropagation(),this.#t.play().catch(()=>{})}),(this.shadowRoot?.querySelector(".player")).addEventListener("click",n=>{n.target.closest(".controls")||n.target.closest(".play-overlay")||(this.#i?this.#t.pause():this.#t.play().catch(()=>{}))}),this.#r.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#a.addEventListener("input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#a.value)/100*this.#t.duration)}),(this.shadowRoot?.querySelector(".skip-back-btn")).addEventListener("click",()=>{this.#t.currentTime=Math.max(0,this.#t.currentTime-10)}),(this.shadowRoot?.querySelector(".skip-forward-btn")).addEventListener("click",()=>{this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10)}),this.#l.addEventListener("input",()=>{this.#t.volume=Number(this.#l.value),this.#t.muted=!1,this.removeAttribute("muted"),this.#l.style.setProperty("--_vol",this.#l.value)}),(this.shadowRoot?.querySelector(".mute-btn")).addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#l.style.setProperty("--_vol",this.#t.muted?"0":this.#l.value)}),this.#d.addEventListener("click",()=>{this.#g=(this.#g+1)%vi.length;let n=vi[this.#g];this.#t.playbackRate=n;let o=this.#d.querySelector("span");o.textContent=`${n}x`,this.#d.setAttribute("aria-label",`Playback speed ${n}x`),this.#N("video-player:speed",{rate:n})}),this.#u.addEventListener("click",()=>{let n=this.#F();if(!n)return;let o=n.mode==="showing";n.mode=o?"hidden":"showing";let a=!o;this.toggleAttribute("captions",a),this.#u.setAttribute("aria-pressed",String(a)),this.#N("video-player:captions",{active:a,label:n.label})}),this.#m.addEventListener("click",()=>this.#P()),this.addEventListener("keydown",n=>this.#H(n)),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}#T(){let t=this.shadowRoot?.querySelector(".player"),e=()=>{this.#E(),this.#p!=null&&clearTimeout(this.#p),this.#i&&(this.#p=setTimeout(()=>this.#S(),Rs))};t.addEventListener("mousemove",e),t.addEventListener("mouseenter",e),t.addEventListener("mouseleave",()=>{this.#i&&(this.#p!=null&&clearTimeout(this.#p),this.#p=setTimeout(()=>this.#S(),500))}),t.addEventListener("touchstart",()=>{this.hasAttribute("controls")?this.#S():e()},{passive:!0}),this.#n.addEventListener("mouseenter",()=>{this.#p!=null&&clearTimeout(this.#p),this.#E()}),this.#n.addEventListener("focusin",()=>{this.#p!=null&&clearTimeout(this.#p),this.#E()})}#E(){this.setAttribute("controls","")}#S(){this.removeAttribute("controls")}#$(){this.#e&&this.#e.addEventListener("click",t=>{let e=t.target.closest("a[href]");e&&(t.preventDefault(),this.#L(e.href,e.closest("li"),e))})}#L(t,e,i){this.#e.querySelectorAll("li").forEach(a=>a.removeAttribute("data-video-active")),e&&e.setAttribute("data-video-active",""),this.#t.src=t;let n=i?.getAttribute("data-poster");n&&(this.#t.poster=n);let o=i?.getAttribute("data-captions");this.#M(o),this.#t.play().catch(()=>{}),this.#N("video-player:track-change",{src:t,title:i?.textContent??""})}#M(t){if(this.#t.querySelectorAll("track[data-dynamic]").forEach(s=>s.remove()),t){let s=document.createElement("track");s.kind="captions",s.src=t,s.default=!0,s.setAttribute("data-dynamic",""),this.#t.appendChild(s),this.hasAttribute("captions")&&(s.track.mode="showing")}let i=this.#t.querySelector('track[kind="captions"], track[kind="subtitles"]');this.#u.hidden=!i}#R(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-video-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#L(o.href,n,o)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#L(s.href,t[i],s)}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#L(s.href,t[0],s)}}#j(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#h.textContent=this.#I(t),this.#a.value=String(i),this.#a.setAttribute("aria-valuetext",this.#D(t)),this.#o.style.width=`${i}%`}#_(){let t=this.#t.duration||0;this.#f.textContent=this.#I(t)}#z(){let t=this.#t.buffered,e=this.#t.duration||0;if(t.length>0&&e){let i=t.end(t.length-1);this.#c.style.width=`${i/e*100}%`}}#P(){document.fullscreenElement?document.exitFullscreen():this.requestFullscreen().catch(()=>{this.#t.requestFullscreen?.().catch(()=>{})})}#F(){let t=this.#t.textTracks;for(let e=0;e<t.length;e++)if(t[e].kind==="captions"||t[e].kind==="subtitles")return t[e];return null}#H(t){if(!(t.target.tagName==="INPUT"||t.target.tagName==="TEXTAREA"))switch(t.key){case" ":case"k":case"K":t.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":t.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10),this.#E();break;case"ArrowRight":t.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10),this.#E();break;case"ArrowUp":t.preventDefault(),this.#t.volume=Math.min(1,this.#t.volume+.05),this.#l.value=String(this.#t.volume),this.#l.style.setProperty("--_vol",String(this.#t.volume)),this.#E();break;case"ArrowDown":t.preventDefault(),this.#t.volume=Math.max(0,this.#t.volume-.05),this.#l.value=String(this.#t.volume),this.#l.style.setProperty("--_vol",String(this.#t.volume)),this.#E();break;case"m":case"M":this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#l.style.setProperty("--_vol",this.#t.muted?"0":this.#l.value);break;case"f":case"F":this.#P();break;case"c":case"C":this.#u.click();break;case"Escape":document.fullscreenElement&&document.exitFullscreen();break}}#I(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/3600),i=Math.floor(t%3600/60),s=Math.floor(t%60);return e>0?`${e}:${String(i).padStart(2,"0")}:${String(s).padStart(2,"0")}`:`${i}:${String(s).padStart(2,"0")}`}#D(t){if(!Number.isFinite(t))return"0 seconds";let e=Math.floor(t/3600),i=Math.floor(t%3600/60),s=Math.floor(t%60),n=[];return e>0&&n.push(`${e} hour${e!==1?"s":""}`),i>0&&n.push(`${i} minute${i!==1?"s":""}`),n.push(`${s} second${s!==1?"s":""}`),n.join(" ")}#q(t){this.#v&&(this.#v.textContent=t)}#N(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};p("video-player",Ft);var yi=`
|
|
868
868
|
:host {
|
|
869
869
|
display: block;
|
|
870
870
|
position: relative;
|
|
@@ -1046,11 +1046,11 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
1046
1046
|
text-align: center;
|
|
1047
1047
|
padding: 1rem;
|
|
1048
1048
|
}
|
|
1049
|
-
`;
|
|
1049
|
+
`;Ht();function Ns(r){return`<svg viewBox="0 0 24 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1050
1050
|
<path d="M12 0C5.373 0 0 5.373 0 12c0 9 12 24 12 24s12-15 12-24C24 5.373 18.627 0 12 0z" fill="${r}"/>
|
|
1051
1051
|
<circle cx="12" cy="12" r="5" fill="white" opacity="0.9"/>
|
|
1052
|
-
</svg>`}var
|
|
1053
|
-
<style>${
|
|
1052
|
+
</svg>`}var Vt=class extends m{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place"]}#t=null;#e=!1;constructor(){super(),this.attachShadow({mode:"open"})}get lat(){return parseFloat(this.getAttribute("lat")??"")}get lng(){return parseFloat(this.getAttribute("lng")??"")}get zoom(){let t=parseInt(this.getAttribute("zoom")??"",10);return t>=1&&t<=19?t:15}get showMarker(){return this.getAttribute("marker")!=="false"}get markerColor(){return this.getAttribute("marker-color")||"#e74c3c"}get provider(){return this.getAttribute("provider")||"osm"}get tileUrl(){return this.getAttribute("tile-url")||""}get interactive(){let t=this.getAttribute("interactive");return t==="eager"||t==="none"?t:"click"}get staticOnly(){return this.hasAttribute("static-only")}#i(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let i=this.getAttribute("src");if(i){let a=this.#n(i);if(a)return a}let s=this.querySelector("address[data-lat][data-lng]");if(s){let a=parseFloat(s.dataset.lat??""),l=parseFloat(s.dataset.lng??"");if(!isNaN(a)&&!isNaN(l))return{lat:a,lng:l}}let n=this.getAttribute("place");if(n){let a=this.#r(n);if(a)return a}let o=document.querySelector('meta[name="geo.position"]');if(o){let l=(o.getAttribute("content")||"").split(";");if(l.length===2){let c=parseFloat(l[0]),h=parseFloat(l[1]);if(!isNaN(c)&&!isNaN(h))return{lat:c,lng:h}}}return null}#n(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let i=parseFloat(e.dataset.lat),s=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(s))return{lat:i,lng:s}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#s(e):null}#r(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let s=JSON.parse(i.textContent);if(s.name===t){let n=s.geo;if(n){let o=parseFloat(n.latitude),a=parseFloat(n.longitude);if(!isNaN(o)&&!isNaN(a))return{lat:o,lng:a}}}}catch{}return null}#s(t){try{let i=JSON.parse(t.textContent).geo;if(i){let s=parseFloat(i.latitude),n=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(n))return{lat:s,lng:n}}}catch{}return null}setup(){this.render(),this.loadTiles(),this.#a()}attributeChangedCallback(t,e,i){e!==i&&this.isConnected&&(this.#t&&this.#l(),this.render(),this.loadTiles(),this.#a())}teardown(){this.#t&&(this.#t.destroy(),this.#t=null)}render(){let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN,s=!isNaN(e)&&!isNaN(i);this.children.length>0?this.setAttribute("data-has-caption",""):this.removeAttribute("data-has-caption");let o=s?`Map of ${e.toFixed(4)}, ${i.toFixed(4)}`:"Map",a=this.showMarker&&s?`<div part="marker" aria-hidden="true">${Ns(this.markerColor)}</div>`:"",c=s&&this.interactive!=="none"&&!this.staticOnly?'<div part="overlay"><button part="activate" aria-label="Activate interactive map" tabindex="0">Click to interact</button></div>':"";this.shadowRoot.innerHTML=`
|
|
1053
|
+
<style>${yi}</style>
|
|
1054
1054
|
<div part="container">
|
|
1055
1055
|
<div part="tiles" role="img" aria-label="${o}"></div>
|
|
1056
1056
|
${a}
|
|
@@ -1060,51 +1060,123 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
1060
1060
|
<a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">© OpenStreetMap</a>
|
|
1061
1061
|
</div>
|
|
1062
1062
|
</div>
|
|
1063
|
-
`}loadTiles(){let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i)){this.handleError("Missing or invalid lat/lng coordinates");return}let s=this.zoom,n=this.provider,{tileX:o,tileY:a,pixelX:l,pixelY:c}=Ee(e,i,s),h=this.shadowRoot.querySelector('[part="tiles"]');if(!h)return;h.innerHTML="";let u=this,d=u.offsetWidth||400,p=u.offsetHeight||300,g=Math.round(d/2-256-l),v=Math.round(p/2-256-c);h.style.transform=`translate(${g}px, ${v}px)`;let w=0,S=0,A=9;for(let N=-1;N<=1;N++)for(let z=-1;z<=1;z++){let j=o+z,L=a+N,di=Y(n,s,j,L),P=document.createElement("img");P.src=di,P.alt="",P.loading="lazy",P.draggable=!1,P.addEventListener("load",()=>{w++,w+S===A&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),P.addEventListener("error",()=>{S++,S===A?this.handleError("Failed to load map tiles"):w+S===A&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),h.appendChild(P)}}#o(){let t=this.shadowRoot.querySelector('[part="overlay"]');if(!t)return;let e=t.querySelector('[part="activate"]');t.addEventListener("mouseenter",()=>this.#a(),{once:!0}),e&&e.addEventListener("focus",()=>this.#a(),{once:!0}),e&&e.addEventListener("click",()=>this.#u()),this.interactive==="eager"&&requestAnimationFrame(()=>this.#u())}#a(){if(this.#e)return;this.#e=!0;let t=this.provider,e;t==="carto-light"||t==="carto-dark"?e="https://basemaps.cartocdn.com":e="https://tile.openstreetmap.org";let i=document.createElement("link");i.rel="preconnect",i.href=e,i.crossOrigin="",document.head.appendChild(i)}async#u(){if(this.#t)return;let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i))return;let{MapInteraction:s}=await Promise.resolve().then(()=>(Te(),Ce));this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.focus(),this.setAttribute("data-interactive-active",""),this.#t=new s({shadow:this.shadowRoot,host:this,lat:e,lng:i,zoom:this.zoom,provider:this.provider,onDeactivate:()=>this.#l()}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:e,lng:i,zoom:this.zoom}}))}#l(){this.#t&&(this.#t.destroy(),this.#t=null,this.removeAttribute("data-interactive-active"),this.render(),this.loadTiles(),this.#o())}handleError(t){let e=this.shadowRoot.querySelector('[part="container"]');e&&(e.setAttribute("data-state","error"),e.setAttribute("data-error",t)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};m("geo-map",At);var tt=null;async function Ei(){return tt||(tt=await Promise.resolve().then(()=>(St(),Et)),tt)}var Ct=8,Si=150,$e="vb-emoji-recent",Tt=class extends f{#t;#e;#i;#r;#n;#s=!1;#o=[];#a=-1;#u=null;#l="";#c=null;#m=!1;#p=null;#h=null;async setup(){this.#c=await Ei(),this.#m||(this.#y(),this.#m=!0),this.#t&&this.listen(this.#t,"click",this.#v),this.listen(document,"click",this.#w),this.listen(document,"keydown",this.#E)}teardown(){this.#u&&clearTimeout(this.#u)}#y(){this.#t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#t||(this.#t=document.createElement("button"),this.#t.type="button",this.#t.textContent="\u{1F600}",this.#t.setAttribute("data-trigger",""),this.prepend(this.#t)),this.#t.setAttribute("aria-haspopup","dialog"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-label",this.#t.getAttribute("aria-label")||"Open emoji picker"),this.#b()}#b(){this.#e=document.createElement("div"),this.#e.classList.add("picker"),this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label","Emoji picker"),this.#e.hidden=!0,this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder="Search emoji\u2026",this.#i.setAttribute("aria-label","Search emoji"),this.#i.addEventListener("input",this.#S),this.#i.addEventListener("keydown",this.#A),this.#e.appendChild(this.#i),this.#n=document.createElement("nav"),this.#n.classList.add("categories"),this.#n.setAttribute("role","tablist"),this.#n.setAttribute("aria-label","Emoji categories");for(let t of this.#c.EMOJI_GROUPS){let e=document.createElement("button");e.type="button",e.setAttribute("role","tab"),e.setAttribute("aria-selected",t===this.#c.EMOJI_GROUPS[0]?"true":"false"),e.setAttribute("data-group",t),e.setAttribute("aria-label",this.#c.EMOJI_GROUP_LABELS[t]),e.title=this.#c.EMOJI_GROUP_LABELS[t],e.textContent=this.#c.EMOJI_GROUP_ICONS[t],e.addEventListener("click",this.#C),this.#n.appendChild(e)}this.#e.appendChild(this.#n),this.#r=document.createElement("div"),this.#r.classList.add("grid"),this.#r.setAttribute("role","grid"),this.#r.setAttribute("aria-label","Emoji"),this.#r.addEventListener("keydown",this.#$),this.#e.appendChild(this.#r),this.appendChild(this.#e),this.#g()}#g(t=null){this.#r.innerHTML="",this.#o=[],this.#a=-1;let e=this.#_();if(!this.#l&&e.length>0){let s=document.createElement("div");s.classList.add("group-label"),s.textContent="Recently Used",s.setAttribute("data-group-heading","recent"),this.#r.appendChild(s);for(let n of e){let o=this.#c.EMOJI_MAP.get(n);o&&this.#d(o)}}let i=t||null;if(i)if(i.length===0){let s=document.createElement("div");s.classList.add("no-results"),s.textContent="No emoji found",this.#r.appendChild(s)}else for(let s of i)this.#d(s);else for(let s of this.#c.EMOJI_GROUPS){let n=document.createElement("div");n.classList.add("group-label"),n.textContent=this.#c.EMOJI_GROUP_LABELS[s],n.setAttribute("data-group-heading",s),this.#r.appendChild(n);let o=this.#c.getByGroup(s);for(let a of o)this.#d(a)}}#d(t){let e=document.createElement("button");e.type="button",e.setAttribute("role","gridcell"),e.setAttribute("tabindex","-1"),e.setAttribute("data-shortcode",t.shortcode),e.title=`${t.name} :${t.shortcode}:`,e.textContent=t.emoji,e.addEventListener("click",this.#k),this.#r.appendChild(e),this.#o.push(e)}#f(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);if(e){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"){let i=e;this.#p={start:i.selectionStart??i.value.length,end:i.selectionEnd??i.value.length},this.#h=null}else if(e.isContentEditable){let i=window.getSelection();i&&i.rangeCount>0&&(this.#h=i.getRangeAt(0).cloneRange()),this.#p=null}}}#v=t=>{t.stopPropagation(),this.toggle()};#w=t=>{this.#s&&!this.contains(t.target)&&this.close()};#E=t=>{t.key==="Escape"&&this.#s&&(t.preventDefault(),this.close(),this.#t?.focus())};#S=()=>{this.#u&&clearTimeout(this.#u),this.#u=setTimeout(()=>{if(this.#l=this.#i.value.trim(),this.#l){let t=this.#c.searchEmoji(this.#l);this.#g(t)}else this.#g()},Si)};#A=t=>{t.key==="ArrowDown"&&(t.preventDefault(),this.#o.length>0&&this.#x(0))};#C=t=>{let e=t.currentTarget.getAttribute("data-group");for(let s of this.#n.querySelectorAll('[role="tab"]'))s.setAttribute("aria-selected",s===t.currentTarget?"true":"false");this.#l&&(this.#i.value="",this.#l="",this.#g());let i=this.#r.querySelector(`[data-group-heading="${e}"]`);i&&i.scrollIntoView({block:"start",behavior:"smooth"})};#$=t=>{let e=this.#o.length;if(e!==0)switch(t.key){case"ArrowRight":t.preventDefault(),this.#x(this.#a+1);break;case"ArrowLeft":t.preventDefault(),this.#x(this.#a-1);break;case"ArrowDown":t.preventDefault(),this.#x(this.#a+Ct);break;case"ArrowUp":t.preventDefault(),this.#a<Ct?(this.#i.focus(),this.#a=-1):this.#x(this.#a-Ct);break;case"Home":t.preventDefault(),this.#x(0);break;case"End":t.preventDefault(),this.#x(e-1);break;case"Enter":case" ":t.preventDefault(),this.#a>=0&&this.#o[this.#a].click();break;case"Tab":this.close();break}};#k=t=>{let e=t.currentTarget.getAttribute("data-shortcode"),i=this.#c.EMOJI_MAP.get(e);i&&(this.#L(e),this.#N(i),this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),this.#T())};#x(t){let e=this.#o.length;e!==0&&(t<0&&(t=0),t>=e&&(t=e-1),this.#a=t,this.#o[t].focus())}#N(t){let e=this.getAttribute("for");if(!e)return;let i=document.getElementById(e);if(i){if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"){let s=i,n=this.#p?.start??s.value.length,o=this.#p?.end??n,a=s.value.slice(0,n),l=s.value.slice(o);s.value=a+t.emoji+l;let c=n+t.emoji.length;s.setSelectionRange(c,c),this.#p={start:c,end:c},i.dispatchEvent(new Event("input",{bubbles:!0}))}else if(i.isContentEditable){i.focus();let s=window.getSelection();if(s&&this.#h){s.removeAllRanges(),s.addRange(this.#h);let n=s.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n),this.#h=n.cloneRange()}else if(s){let n=document.createRange();n.selectNodeContents(i),n.collapse(!1);let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n)}}}}#T(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);e&&e.focus()}#_(){try{return JSON.parse(localStorage.getItem($e)||"[]")}catch{return[]}}#L(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#_();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem($e,JSON.stringify(i))}catch{}}open(){this.#s||(this.#f(),this.#s=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#i.value="",this.#l="",this.#g(),requestAnimationFrame(()=>{this.#i.focus()}),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0})))}close(){this.#s&&(this.#s=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#e.hidden=!0,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0})))}toggle(){this.#s?this.close():this.open()}get isOpen(){return this.#s}};m("emoji-picker",Tt);var _t=class r extends f{#t=null;#e=null;#i=!1;#r=null;setup(){this.setAttribute("role","list"),this.#i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#s(),this.#a(),this.#h(),this.#n()}teardown(){this.#t&&(this.#t.remove(),this.#t=null),r.#C?.source===this&&(r.#C=null)}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")||"vertical"}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#n(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("aria-grabbed")||t.setAttribute("aria-grabbed","false")}#s(){this.#t=document.createElement("div"),this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.#t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);",this.prepend(this.#t)}#o(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#a(){this.listen(this,"pointerdown",t=>{this.#r=t.target}),this.listen(this,"dragstart",this.#u.bind(this)),this.listen(this,"dragover",this.#l.bind(this)),this.listen(this,"dragleave",this.#c.bind(this)),this.listen(this,"drop",this.#m.bind(this)),this.listen(this,"dragend",this.#p.bind(this))}#u(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#r)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#f(e);r.#C={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#l(t){let e=r.#C;if(!e||(this.group||e.source.group)&&this.group!==e.source.group)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over","");let i=this.orientation==="horizontal"?t.clientX:t.clientY;this.#S(i)}#c(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#A())}#m(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#A();let e=r.#C;if(!e)return;let{item:i,source:s,originalIndex:n}=e,o=this.orientation==="horizontal"?t.clientX:t.clientY,a=this.#E(o);if(s===this){this.#v(i,a),this.#w();let l=this.#f(i);this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,oldIndex:n,newIndex:l,order:this.sortedOrder}}))}else this.#v(i,a),this.#w(),s.#w(),this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,fromSurface:s,toSurface:this,newIndex:this.#f(i),fromOrder:s.sortedOrder,toOrder:this.sortedOrder}}))}#p(){let t=r.#C;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#A(),r.#C=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#h(){this.listen(this,"keydown",this.#y.bind(this))}#y(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.getAttribute("aria-grabbed")==="true",s=this.orientation==="horizontal",n=s?"ArrowLeft":"ArrowUp",o=s?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),i){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#w(),this.#b(e);let c=this.#f(e),h=this.draggableChildren;this.#o(`${this.#d(e)}, dropped at position ${c+1} of ${h.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#e,newIndex:c,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null}else{this.#e=this.#f(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let c=this.draggableChildren;this.#o(`${this.#d(e)}, grabbed. Position ${this.#e+1} of ${c.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&c[u].focus();return}if(i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&(this.#v(e,u),e.focus(),this.#o(`Position ${u+1} of ${c.length}`));return}let a=s?"ArrowUp":"ArrowLeft",l=s?"ArrowDown":"ArrowRight";if(i&&(t.key===a||t.key===l)){if(t.preventDefault(),!this.group)return;let c=t.key===l?1:-1,h=this.#g(c);if(!h)return;h.appendChild(e),h.#w(),this.#w(),h.#b(e),e.focus();let u=h.getAttribute("aria-label")||"next surface";h.#o(`Moved to ${u}`),h.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:h,newIndex:h.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:h.sortedOrder}})),this.removeAttribute("data-reorder-mode"),h.setAttribute("data-reorder-mode",""),this.#e=null;return}if(i&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#e!=null&&(this.#v(e,this.#e),e.focus()),this.#o("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null;return}!i&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#b(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#g(t){if(!this.group)return null;let e=[...document.querySelectorAll(`drag-surface[group="${this.group}"]`)];if(e.length<2)return null;e.sort((n,o)=>{let a=n.getBoundingClientRect(),l=o.getBoundingClientRect();return a.left-l.left||a.top-l.top});let i=e.indexOf(this);return e[i+t]||null}#d(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#f(t){return this.draggableChildren.indexOf(t)}#v(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#w(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#E(t){let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o)return s}return i.length}#S(t){this.#A();let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o){i[s].setAttribute("data-drop-target","before");return}}i.length>0&&i[i.length-1].setAttribute("data-drop-target","after")}#A(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#C=null};m("drag-surface",_t);var Mt=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),Le={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",shift:"\u21E7",ctrl:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",shift:"Shift",ctrl:"Ctrl"}};function V(r){let t=Mt?Le.mac:Le.other;return r.split("+").map(e=>{let i=e.trim().toLowerCase();return t[i]??i.toUpperCase()}).join(Mt?"":"+")}function je(r){let t=r.toLowerCase().split("+").map(i=>i.trim());return{key:t.pop()??"",meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),shift:t.includes("shift"),alt:t.includes("alt")}}function Re(r,t){if(r.key.toLowerCase()!==t.key)return!1;let e,i;return Mt?(e=t.meta,i=t.ctrl):(e=!1,i=t.meta||t.ctrl),!(e!==r.metaKey||i!==r.ctrlKey||t.shift!==r.shiftKey||t.alt!==r.altKey)}var Ci=new Set(["INPUT","TEXTAREA","SELECT"]),U=[],Ne=!1;function Ti(r){let t=Ci.has(r.target.tagName)||r.target.isContentEditable;for(let e of U)if(!(t&&!e.global)&&Re(r,e.descriptor)){r.preventDefault(),e.callback(r);return}}function _i(){Ne||(document.addEventListener("keydown",Ti),Ne=!0)}function D(r,t,e={}){_i();let i=je(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0};return U.find(o=>o.combo===r)&&console.warn(`[hotkey-bind] Shortcut "${r}" already bound. Last-connected-wins.`),U.unshift(s),function(){let a=U.indexOf(s);a!==-1&&U.splice(a,1)}}var $t=class extends f{#t;#e;#i;#r=[];#n=-1;#s=[];#o=null;#a=[];setup(){this.#u(),this.#l(),this.hasAttribute("discover")&&this.#b()}teardown(){this.#o?.()}#u(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()});let t=document.createElement("div");t.className="command-search",this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.addEventListener("input",this.#c),this.#e.addEventListener("keydown",this.#m),t.appendChild(this.#e),this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.setAttribute("role","listbox"),this.#s=Array.from(this.querySelectorAll("command-group")),this.#s.forEach(i=>{let s=document.createElement("div");s.className="command-group-header",s.textContent=i.getAttribute("label")||"",s.setAttribute("role","presentation");let n=Array.from(i.querySelectorAll("command-item"));this.#i.appendChild(s),n.forEach(o=>{let a=document.createElement("button");a.className="command-option",a.setAttribute("role","option"),a.dataset.value=o.getAttribute("value")||"",a.dataset.searchText=o.textContent.toLowerCase().trim();let l=o.querySelector('[slot="icon"]');if(l){let u=document.createElement("span");u.className="command-icon",u.appendChild(l.cloneNode(!0)),a.appendChild(u)}let c=document.createElement("span");c.className="command-label",c.textContent=o.textContent.trim(),a.appendChild(c);let h=o.getAttribute("data-hotkey");if(h){let u=document.createElement("kbd");u.className="command-kbd",u.textContent=V(h),a.appendChild(u)}a.addEventListener("click",()=>{this.#y(a.dataset.value)}),this.#i.appendChild(a),this.#r.push({btn:a,header:s,group:i})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#l(){let t=this.getAttribute("hotkey")||"meta+k";this.#o=D(t,()=>{this.#t.open?this.close():this.open()},{global:!0})}#c=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#r.forEach(({btn:n,header:o})=>{let a=!t||n.dataset.searchText.includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(".command-group-header").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#n=-1,e>0&&this.#h(0)};#m=t=>{let e=this.#p();switch(t.key){case"ArrowDown":t.preventDefault(),this.#h(this.#n+1);break;case"ArrowUp":t.preventDefault(),this.#h(this.#n-1);break;case"Enter":t.preventDefault(),this.#n>=0&&e[this.#n]&&e[this.#n].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#p(){return this.#r.filter(({btn:t})=>!t.hidden)}#h(t){let e=this.#p();if(e.length===0)return;e.forEach(({btn:s})=>s.removeAttribute("data-active")),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#n=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.scrollIntoView({block:"nearest"})}#y(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#b(){this.listen(document,"vb:command-registry-change",this.#g)}#g=()=>{this.#t?.open&&(this.#d(),this.#c())};#d(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#r=this.#r.filter(n=>!n.discovered),this.#a.forEach(n=>n.remove()),this.#a=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=document.createElement("div");a.className="command-group-header",a.textContent=n,a.setAttribute("role","presentation"),this.#i.insertBefore(a,i),this.#a.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#f(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),this.#i.insertBefore(c,i),this.#r.push({btn:c,header:a,group:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=document.createElement("div");c.className="command-group-header",c.textContent=a,c.setAttribute("role","presentation"),this.#i.insertBefore(c,i),this.#a.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#f(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),this.#i.insertBefore(u,i),this.#r.push({btn:u,header:c,group:null,discovered:!0})}}}}#f(t,e,i){let s=document.createElement("button");if(s.className="command-option",s.setAttribute("role","option"),s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");o.className="command-icon";let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a),s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.textContent=V(i),s.appendChild(o)}return s}open(){this.#t.open||(this.#d(),this.#t.showModal(),this.#e.value="",this.#c(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t.open&&(this.#t.close(),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0})))}get isOpen(){return this.#t?.open??!1}},Lt=class extends HTMLElement{},jt=class extends HTMLElement{};m("command-palette",$t);m("command-group",Lt);m("command-item",jt);var Rt=class extends f{#t;#e=null;setup(){this.#i(),this.#e=D("shift+?",()=>{this.#t.open?this.#t.close():this.#r()})}teardown(){this.#e?.(),this.#e=null,this.#t?.remove(),this.#t=null}#i(){this.#t=document.createElement("dialog"),this.#t.className="shortcut-dialog",this.#t.addEventListener("click",t=>{t.target===this.#t&&this.#t.close()}),this.appendChild(this.#t)}#r(){this.#t.innerHTML="";let t=document.createElement("div");t.className="shortcut-header",t.innerHTML="<h2>Keyboard Shortcuts</h2>",this.#t.appendChild(t);let e=document.createElement("div");e.className="shortcut-body";let{getRegisteredCommands:i}=window.__commandRegistry||{},s=new Map;if(s.set("General",[{label:"Show keyboard shortcuts",shortcut:"shift+?"}]),i)for(let[o,a]of i())for(let l of a){if(!l.shortcut)continue;let c=s.get(o)||[];c.push({label:l.label,shortcut:l.shortcut}),s.set(o,c)}let{getHotkeyActions:n}=window.__hotkeyActionRegistry||{};if(n)for(let[o,a]of n()){let l=s.get(o)||[];for(let c of a)l.push({label:c.label,shortcut:c.shortcut});s.set(o,l)}for(let[o,a]of s){let l=document.createElement("div");l.className="shortcut-group";let c=document.createElement("div");c.className="shortcut-group-header",c.textContent=o,l.appendChild(c);for(let h of a){let u=document.createElement("div");u.className="shortcut-row";let d=document.createElement("span");d.className="shortcut-label",d.textContent=h.label;let p=document.createElement("kbd");p.className="shortcut-kbd",p.textContent=V(h.shortcut),u.appendChild(d),u.appendChild(p),l.appendChild(u)}e.appendChild(l)}this.#t.appendChild(e),this.#t.showModal()}};m("short-cuts",Rt);var Nt=class extends f{#t;#e=!1;setup(){let t=[...this.children];if(t.length<2)return!1;t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children will be ignored.");let e=this.getAttribute("position"),i=e!==null?Number(e):50,s=Math.min(100,Math.max(0,isNaN(i)?50:i));this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-label","Comparison slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow",String(Math.round(s))),this.#t.setAttribute("tabindex","0"),this.appendChild(this.#t),this.#o(s),this.listen(this.#t,"pointerdown",this.#i),this.listen(this.#t,"keydown",this.#s)}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#e=!1}#i=t=>{t.preventDefault(),this.#e=!0,this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#r),this.#t.addEventListener("pointerup",this.#n)};#r=t=>{if(!this.#e)return;let e=this.getBoundingClientRect(),i=t.clientX-e.left,s=Math.min(100,Math.max(0,i/e.width*100));this.#o(s)};#n=t=>{this.#e=!1,this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#r),this.#t.removeEventListener("pointerup",this.#n)};#s=t=>{let e=t.shiftKey?10:1,i=Number(this.#t.getAttribute("aria-valuenow"));t.key==="ArrowLeft"||t.key==="ArrowDown"?(t.preventDefault(),this.#o(Math.max(0,i-e))):(t.key==="ArrowRight"||t.key==="ArrowUp")&&(t.preventDefault(),this.#o(Math.min(100,i+e)))};#o(t){let e=Math.round(t);this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(e)),this.#t.style.left=`${t}%`),this.setAttribute("position",String(e)),this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:t},bubbles:!0}))}get position(){return Number(this.getAttribute("position"))||0}set position(t){let e=Math.min(100,Math.max(0,Number(t)||0));this.#o(e)}};m("compare-surface",Nt);var zt=class extends f{#t;#e;#i;#r=!1;#n=50;#s=!1;#o=50;get#a(){return this.getAttribute("direction")==="vertical"}get#u(){let t=this.getAttribute("min"),e=Number(t);return t!==null&&!isNaN(e)?e:10}get#l(){let t=this.getAttribute("max"),e=Number(t);return t!==null&&!isNaN(e)?e:90}get position(){return this.#n}set position(t){this.#d(Number(t))}get collapsed(){return this.#s}set collapsed(t){t?this.#b():this.#g()}reset(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:50;this.#s=!1,this.#d(i),this.#w()}setup(){let t=[...this.children].filter(a=>!a.classList.contains("split-divider"));if(t.length<2)return!1;this.#e=t[0],this.#i=t[1];let e=this.getAttribute("position"),i=Number(e),s=e!==null&&!isNaN(i)?i:null,n=this.#f(),o=s??n??50;this.#t=document.createElement("div"),this.#t.className="split-divider",this.#t.setAttribute("role","separator"),this.#t.setAttribute("aria-orientation",this.#a?"vertical":"horizontal"),this.#t.setAttribute("aria-valuenow",String(Math.round(o))),this.#t.setAttribute("aria-valuemin",String(this.#u)),this.#t.setAttribute("aria-valuemax",String(this.#l)),this.#t.setAttribute("aria-label","Resize panels"),this.#t.setAttribute("tabindex","0"),this.insertBefore(this.#t,this.#i),this.#d(o),this.listen(this.#t,"pointerdown",this.#c),this.listen(this.#t,"keydown",this.#h),this.hasAttribute("collapsible")&&this.listen(this.#t,"dblclick",this.#y)}teardown(){this.#t&&(this.#t.remove(),this.#t=null)}#c=t=>{t.preventDefault(),this.#r=!0,this.#t.setPointerCapture(t.pointerId),this.style.userSelect="none",this.#t.addEventListener("pointermove",this.#m),this.#t.addEventListener("pointerup",this.#p)};#m=t=>{if(!this.#r)return;let e=this.getBoundingClientRect(),i;this.#a?i=(t.clientY-e.top)/e.height*100:i=(t.clientX-e.left)/e.width*100,this.#s&&(this.#s=!1),this.#d(i)};#p=t=>{this.#r=!1,this.#t.releasePointerCapture(t.pointerId),this.style.userSelect="",this.#t.removeEventListener("pointermove",this.#m),this.#t.removeEventListener("pointerup",this.#p),this.#v()};#h=t=>{let e=t.shiftKey?10:1,i=this.#n,s=this.#a?["ArrowUp"]:["ArrowLeft"],n=this.#a?["ArrowDown"]:["ArrowRight"];s.includes(t.key)?(t.preventDefault(),this.#d(i-e),this.#v()):n.includes(t.key)?(t.preventDefault(),this.#d(i+e),this.#v()):t.key==="Home"?(t.preventDefault(),this.#d(this.#u),this.#v()):t.key==="End"&&(t.preventDefault(),this.#d(this.#l),this.#v())};#y=()=>{this.#s?this.#g():this.#b(),this.#v()};#b(){this.#o=this.#n,this.#s=!0,this.#e.style.flexBasis="0%",this.#e.style.overflow="hidden",this.#t.setAttribute("aria-valuenow","0"),this.#n=0,this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0},bubbles:!0}))}#g(){this.#s=!1,this.#e.style.overflow="auto",this.#d(this.#o),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1},bubbles:!0}))}#d(t){let e=this.#s?0:Math.min(this.#l,Math.max(this.#u,t));this.#n=e,this.#e.style.flexBasis=`${e}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#t.setAttribute("aria-valuenow",String(Math.round(e))),this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:e},bubbles:!0}))}#f(){let t=this.getAttribute("persist");if(!t)return null;try{let e=localStorage.getItem(`split-surface:${t}`);return e!==null?Number(e):null}catch{return null}}#v(){let t=this.getAttribute("persist");if(t)try{localStorage.setItem(`split-surface:${t}`,String(Math.round(this.#n)))}catch{}}#w(){let t=this.getAttribute("persist");if(t)try{localStorage.removeItem(`split-surface:${t}`)}catch{}}};m("split-surface",zt);var Pt=class extends f{#t;#e=null;setup(){this.#e===null&&(this.#e=this.getAttribute("value")||this.textContent.trim());let t=this.#e;if(!t)return!1;let e=parseInt(this.getAttribute("size")??"200",10)||200,i=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t=document.createElement("canvas"),this.#t.width=e,this.#t.height=e,this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`QR code: ${t}`),this.#i(t,e,i)}static get observedAttributes(){return["value","size"]}attributeChangedCallback(t,e,i){if(!this.#t||!this.isConnected)return;t==="value"&&i&&(this.#e=i);let s=this.#e||this.getAttribute("value")||"";if(!s)return;let n=parseInt(this.getAttribute("size")??"200",10)||200,o=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t.width=n,this.#t.height=n,this.#t.setAttribute("aria-label",`QR code: ${s}`),this.#i(s,n,o)}#i(t,e,i){let s=$i(t,i),n=this.#t.getContext("2d"),o=s.length,a=e/o,l=getComputedStyle(this),c=this.getAttribute("color")||l.color||"#000",h=this.getAttribute("background")||"transparent";n.clearRect(0,0,e,e),h!=="transparent"&&(n.fillStyle=h,n.fillRect(0,0,e,e)),n.fillStyle=c;for(let d=0;d<o;d++)for(let p=0;p<o;p++)s[d][p]&&n.fillRect(Math.round(p*a),Math.round(d*a),Math.ceil(a),Math.ceil(a));this.textContent="",this.appendChild(this.#t);let u=document.createElement("span");u.className="sr-only",u.textContent=t,this.appendChild(u)}toDataURL(t="image/png"){return this.#t?.toDataURL(t)??""}},et=[[[26,7],[44,10],[70,15],[100,20],[134,26],[172,18],[196,20],[242,24],[292,30],[346,18]],[[26,10],[44,16],[70,26],[100,18],[134,24],[172,16],[196,18],[242,22],[292,22],[346,26]],[[26,13],[44,22],[70,18],[100,26],[134,18],[172,24],[196,18],[242,22],[292,20],[346,28]],[[26,17],[44,28],[70,22],[100,16],[134,22],[172,28],[196,26],[242,26],[292,24],[346,28]]],Mi=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,52]];function $i(r,t=1){let e=new TextEncoder().encode(r),i=Li(e.length,t),s=et[t][i-1][0],n=et[t][i-1][1],o=s-n,a=ji(e,i,o),l=Ri(a,o,n),c=i*4+17,h=Array.from({length:c},()=>new Uint8Array(c)),u=Array.from({length:c},()=>new Uint8Array(c));return zi(h,u,c),Pi(h,u,i),Bi(h,u,c),Ii(u,c),qi(h,u,l,c),Gi(h,u,c,t)}function Li(r,t){for(let e=1;e<=10;e++){let i=et[t][e-1][0],s=et[t][e-1][1],n=i-s,o=e<=9?8:16,a=Math.ceil((4+o)/8);if(r<=n-a)return e}return 10}function ji(r,t,e){let i=[],s=(u,d)=>{for(let p=d-1;p>=0;p--)i.push(u>>p&1)};s(4,4);let n=t<=9?8:16;s(r.length,n);for(let u of r)s(u,8);let o=e*8,a=Math.min(4,o-i.length);for(s(0,a);i.length%8!==0;)i.push(0);let l=[236,17],c=0;for(;i.length<o;)s(l[c%2],8),c++;let h=[];for(let u=0;u<i.length;u+=8){let d=0;for(let p=0;p<8;p++)d=d<<1|(i[u+p]||0);h.push(d)}return h}function Ri(r,t,e){let i=Ni(e),s=new Uint8Array(t+e);for(let o=0;o<t;o++)s[o]=r[o];for(let o=0;o<t;o++){let a=s[o];if(a===0)continue;let l=it[a];for(let c=0;c<i.length;c++)s[o+c]^=G[(l+it[i[c]])%255]}let n=[...r.slice(0,t)];for(let o=0;o<e;o++)n.push(s[t+o]);return n}var G=new Uint8Array(512),it=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)G[e]=t,it[t]=e,t<<=1,t>=256&&(t^=285);for(let e=255;e<512;e++)G[e]=G[e-255]})();function Ni(r){let t=new Uint8Array([1]);for(let e=0;e<r;e++){let i=new Uint8Array(t.length+1),s=e;for(let n=0;n<t.length;n++)i[n]^=t[n],i[n+1]^=G[(it[t[n]]+s)%255];t=i}return t}function zi(r,t,e){let i=[[0,0],[e-7,0],[0,e-7]];for(let[s,n]of i){for(let o=0;o<7;o++)for(let a=0;a<7;a++){let l=o===0||o===6||a===0||a===6||o>=2&&o<=4&&a>=2&&a<=4;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}for(let o=-1;o<=7;o++)for(let[a,l]of[[o,-1],[o,7],[-1,o],[7,o]]){let c=s+a,h=n+l;c>=0&&c<e&&h>=0&&h<e&&(r[c][h]=0,t[c][h]=1)}}}function Pi(r,t,e){if(e<2)return;let i=Mi[e-1];for(let s of i)for(let n of i)if(!t[s][n])for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++){let l=Math.abs(o)===2||Math.abs(a)===2||o===0&&a===0;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}}function Bi(r,t,e){for(let i=8;i<e-8;i++){let s=i%2===0?1:0;t[6][i]||(r[6][i]=s,t[6][i]=1),t[i][6]||(r[i][6]=s,t[i][6]=1)}}function Ii(r,t){for(let e=0;e<=8;e++)e<t&&(r[8][e]=1),e<t&&(r[e][8]=1);for(let e=0;e<=7;e++)r[8][t-1-e]=1,r[t-1-e][8]=1;r[t-8][8]=1}function qi(r,t,e,i){let s=[];for(let a of e)for(let l=7;l>=0;l--)s.push(a>>l&1);let n=0,o=!0;for(let a=i-1;a>=1;a-=2){a===6&&(a=5);let l=o?Array.from({length:i},(c,h)=>i-1-h):Array.from({length:i},(c,h)=>h);for(let c of l)for(let h of[a,a-1])h<0||h>=i||t[c][h]||(r[c][h]=n<s.length?s[n]:0,n++);o=!o}}var Di=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107];function Fi(r,t){let i=[1,0,3,2][r]*8+t;return Di[i]}var Oi=[(r,t)=>(r+t)%2===0,r=>r%2===0,(r,t)=>t%3===0,(r,t)=>(r+t)%3===0,(r,t)=>(Math.floor(r/2)+Math.floor(t/3))%2===0,(r,t)=>r*t%2+r*t%3===0,(r,t)=>(r*t%2+r*t%3)%2===0,(r,t)=>((r+t)%2+r*t%3)%2===0];function Hi(r,t,e,i){let s=r.map(o=>new Uint8Array(o)),n=Oi[i];for(let o=0;o<e;o++)for(let a=0;a<e;a++)!t[o][a]&&n(o,a)&&(s[o][a]^=1);return s}function Vi(r,t,e,i){let s=Fi(e,i),n=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]];for(let a=0;a<15;a++){let[l,c]=n[a];r[l][c]=s>>14-a&1}let o=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[8,t-8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let a=0;a<15;a++){let[l,c]=o[a];r[l][c]=s>>14-a&1}r[t-8][8]=1}function Ui(r,t){let e=0;for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[i][n]===r[i][n-1]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[n][i]===r[n-1][i]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t-1;i++)for(let s=0;s<t-1;s++){let n=r[i][s];n===r[i][s+1]&&n===r[i+1][s]&&n===r[i+1][s+1]&&(e+=3)}return e}function Gi(r,t,e,i){let s=1/0,n=null;for(let o=0;o<8;o++){let a=Hi(r,t,e,o);Vi(a,e,i,o);let l=Ui(a,e);l<s&&(s=l,n=a)}return n}m("qr-code",Pt);var Bt=class extends f{#t;#e;#i;#r=!1;#n=0;#s=0;#o=0;#a=!1;#u=!1;get activated(){return this.#a}get#l(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}setup(){this.#u||(this.#c(),this.#u=!0),this.listen(this.#t,"pointerdown",this.#m),this.listen(this.#t,"keydown",this.#y),this.listen(this.#t,"transitionend",this.#b)}#c(){this.#i=document.createElement("div"),this.#i.className="slide-track",this.#e=document.createElement("span"),this.#e.className="slide-label",this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow","0"),this.#t.setAttribute("aria-label",this.getAttribute("label")||"Slide to confirm"),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#i.append(this.#e,this.#t),this.textContent="",this.appendChild(this.#i),this.#f(0)}reset(){this.#a=!1,this.removeAttribute("data-activated"),this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t.removeAttribute("aria-disabled"),this.#t.setAttribute("tabindex","0"),this.#f(0),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}#m=t=>{if(!this.#a){if(t.preventDefault(),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#i).getPropertyValue("--_handle-inset")||"0"),n=this.#t.offsetWidth,o=i.width-n-s*2,a=e.left-i.left-s;this.removeAttribute("transitioning"),this.#n=o>0?Math.max(0,Math.min(100,a/o*100)):0,this.#f(this.#n)}this.#r=!0,this.#s=t.clientX,this.#o=this.#n,this.#t.setPointerCapture(t.pointerId),this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#p),this.#t.addEventListener("pointerup",this.#h),this.#t.addEventListener("pointercancel",this.#h)}};#p=t=>{if(!this.#r)return;let e=this.#i.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let s=(t.clientX-this.#s)/e*100,n=Math.min(100,Math.max(0,this.#o+s));this.#f(n)};#h=t=>{this.#r&&(this.#r=!1,this.removeAttribute("data-dragging"),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#p),this.#t.removeEventListener("pointerup",this.#h),this.#t.removeEventListener("pointercancel",this.#h),this.#n>=this.#l?this.#g():this.#d())};#y=t=>{if(this.#a)return;let e=t.shiftKey?20:5;t.key==="ArrowRight"?(t.preventDefault(),this.#f(Math.min(100,this.#n+e))):t.key==="ArrowLeft"?(t.preventDefault(),this.#f(Math.max(0,this.#n-e))):t.key==="End"?(t.preventDefault(),this.#g()):t.key==="Home"&&(t.preventDefault(),this.#f(0)),t.key==="ArrowRight"&&this.#n>=this.#l&&this.#g()};#b=()=>{this.removeAttribute("transitioning")};#g(){this.#a=!0,this.#f(100),this.setAttribute("data-activated",""),this.#e.textContent=this.getAttribute("activated-label")||"Confirmed!",this.#t.setAttribute("aria-disabled","true"),this.#t.removeAttribute("tabindex"),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0}))}#d(){this.setAttribute("transitioning",""),this.#f(0),setTimeout(()=>{this.hasAttribute("transitioning")&&this.removeAttribute("transitioning")},500)}#f(t){this.#n=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t)))}};m("slide-accept",Bt);var It=class extends f{static observedAttributes=["colors","names","layout","show-values","show-names","size"];setup(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}#t(){let t=this.getAttribute("colors")||"",e=this.getAttribute("names")||"",i=this.getAttribute("layout")||"inline",s=this.getAttribute("size")||"md",n=this.hasAttribute("show-values"),o=this.hasAttribute("show-names")||e.length>0,a=this.#i(t),l=e?e.split(",").map(p=>p.trim()):[],h={sm:48,md:80,lg:120}[s]||80,u="display:flex;flex-wrap:wrap;gap:var(--size-xs,0.5rem)";i==="grid"?u=`display:grid;grid-template-columns:repeat(auto-fill,minmax(${h}px,1fr));gap:var(--size-xs,0.5rem)`:i==="list"&&(u="display:flex;flex-direction:column;gap:var(--size-xs,0.5rem)");let d=a.map((p,g)=>{let v=l[g]||"",w=this.#r(p),S=i==="list"?"display:flex;flex-direction:row;align-items:center;gap:0.75rem":`display:flex;flex-direction:column;align-items:center;gap:0.25rem;max-inline-size:${h}px`,A=i==="list"?36:h;return`<div class="swatch-wrap" role="listitem" style="${S}">
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1063
|
+
`}loadTiles(){let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i)){this.handleError("Missing or invalid lat/lng coordinates");return}let s=this.zoom,n=this.provider,{tileX:o,tileY:a,pixelX:l,pixelY:c}=wi(e,i,s),h=this.shadowRoot.querySelector('[part="tiles"]');if(!h)return;h.innerHTML="";let u=this,d=u.offsetWidth||400,f=u.offsetHeight||300,g=Math.round(d/2-256-l),v=Math.round(f/2-256-c);h.style.transform=`translate(${g}px, ${v}px)`;let b=0,k=0,S=9;for(let N=-1;N<=1;N++)for(let j=-1;j<=1;j++){let z=o+j,I=a+N,Ts=mt(n,s,z,I,this.tileUrl),H=document.createElement("img");H.src=Ts,H.alt="",H.loading="lazy",H.draggable=!1,H.addEventListener("load",()=>{b++,b+k===S&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),H.addEventListener("error",()=>{k++,k===S?this.handleError("Failed to load map tiles"):b+k===S&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),h.appendChild(H)}}#a(){let t=this.shadowRoot.querySelector('[part="overlay"]');if(!t)return;let e=t.querySelector('[part="activate"]');t.addEventListener("mouseenter",()=>this.#o(),{once:!0}),e&&e.addEventListener("focus",()=>this.#o(),{once:!0}),e&&e.addEventListener("click",()=>this.#c()),this.interactive==="eager"&&requestAnimationFrame(()=>this.#c())}#o(){if(this.#e)return;let t=this.tileUrl;if(t)try{let n=new URL(t,location.origin);if(n.origin===location.origin){this.#e=!0;return}this.#e=!0;let o=document.createElement("link");o.rel="preconnect",o.href=n.origin,o.crossOrigin="",document.head.appendChild(o);return}catch{}this.#e=!0;let e=this.provider,i;e==="carto-light"||e==="carto-dark"?i="https://basemaps.cartocdn.com":i="https://tile.openstreetmap.org";let s=document.createElement("link");s.rel="preconnect",s.href=i,s.crossOrigin="",document.head.appendChild(s)}async#c(){if(this.#t)return;let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i))return;let{MapInteraction:s}=await Promise.resolve().then(()=>(Ai(),xi));this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.focus(),this.setAttribute("data-interactive-active",""),this.#t=new s({shadow:this.shadowRoot,host:this,lat:e,lng:i,zoom:this.zoom,provider:this.provider,tileUrl:this.tileUrl,onDeactivate:()=>this.#l()}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:e,lng:i,zoom:this.zoom}}))}#l(){this.#t&&(this.#t.destroy(),this.#t=null,this.removeAttribute("data-interactive-active"),this.render(),this.loadTiles(),this.#a())}handleError(t){let e=this.shadowRoot.querySelector('[part="container"]');e&&(e.setAttribute("data-state","error"),e.setAttribute("data-error",t)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};p("geo-map",Vt);var bt=null;async function Ds(){return bt||(bt=await Promise.resolve().then(()=>(Gt(),Wt)),bt)}var Kt=8,Os=150,Ci="vb-emoji-recent",Xt=class extends m{#t;#e;#i;#n;#r;#s=!1;#a=[];#o=-1;#c=null;#l="";#h=null;#f=!1;#d=null;#u=null;async setup(){this.#h=await Ds(),this.#f||(this.#m(),this.#f=!0),this.#t&&this.listen(this.#t,"click",this.#y),this.listen(document,"click",this.#w),this.listen(document,"keydown",this.#k)}teardown(){this.#c&&clearTimeout(this.#c)}#m(){this.#t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#t||(this.#t=document.createElement("button"),this.#t.type="button",this.#t.textContent="\u{1F600}",this.#t.setAttribute("data-trigger",""),this.prepend(this.#t)),this.#t.setAttribute("aria-haspopup","dialog"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-label",this.#t.getAttribute("aria-label")||"Open emoji picker"),this.#b()}#b(){this.#e=document.createElement("div"),this.#e.classList.add("picker"),this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label","Emoji picker"),this.#e.hidden=!0,this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder="Search emoji\u2026",this.#i.setAttribute("aria-label","Search emoji"),this.#i.addEventListener("input",this.#C),this.#i.addEventListener("keydown",this.#x),this.#e.appendChild(this.#i),this.#r=document.createElement("nav"),this.#r.classList.add("categories"),this.#r.setAttribute("role","tablist"),this.#r.setAttribute("aria-label","Emoji categories");for(let t of this.#h.EMOJI_GROUPS){let e=document.createElement("button");e.type="button",e.setAttribute("role","tab"),e.setAttribute("aria-selected",t===this.#h.EMOJI_GROUPS[0]?"true":"false"),e.setAttribute("data-group",t),e.setAttribute("aria-label",this.#h.EMOJI_GROUP_LABELS[t]),e.title=this.#h.EMOJI_GROUP_LABELS[t],e.textContent=this.#h.EMOJI_GROUP_ICONS[t],e.addEventListener("click",this.#A),this.#r.appendChild(e)}this.#e.appendChild(this.#r),this.#n=document.createElement("div"),this.#n.classList.add("grid"),this.#n.setAttribute("role","grid"),this.#n.setAttribute("aria-label","Emoji"),this.#n.addEventListener("keydown",this.#T),this.#e.appendChild(this.#n),this.appendChild(this.#e),this.#v()}#v(t=null){this.#n.innerHTML="",this.#a=[],this.#o=-1;let e=this.#M();if(!this.#l&&e.length>0){let s=document.createElement("div");s.classList.add("group-label"),s.textContent="Recently Used",s.setAttribute("data-group-heading","recent"),this.#n.appendChild(s);for(let n of e){let o=this.#h.EMOJI_MAP.get(n);o&&this.#p(o)}}let i=t||null;if(i)if(i.length===0){let s=document.createElement("div");s.classList.add("no-results"),s.textContent="No emoji found",this.#n.appendChild(s)}else for(let s of i)this.#p(s);else for(let s of this.#h.EMOJI_GROUPS){let n=document.createElement("div");n.classList.add("group-label"),n.textContent=this.#h.EMOJI_GROUP_LABELS[s],n.setAttribute("data-group-heading",s),this.#n.appendChild(n);let o=this.#h.getByGroup(s);for(let a of o)this.#p(a)}}#p(t){let e=document.createElement("button");e.type="button",e.setAttribute("role","gridcell"),e.setAttribute("tabindex","-1"),e.setAttribute("data-shortcode",t.shortcode),e.title=`${t.name} :${t.shortcode}:`,e.textContent=t.emoji,e.addEventListener("click",this.#E),this.#n.appendChild(e),this.#a.push(e)}#g(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);if(e){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"){let i=e;this.#d={start:i.selectionStart??i.value.length,end:i.selectionEnd??i.value.length},this.#u=null}else if(e.isContentEditable){let i=window.getSelection();i&&i.rangeCount>0&&(this.#u=i.getRangeAt(0).cloneRange()),this.#d=null}}}#y=t=>{t.stopPropagation(),this.toggle()};#w=t=>{this.#s&&!this.contains(t.target)&&this.close()};#k=t=>{t.key==="Escape"&&this.#s&&(t.preventDefault(),this.close(),this.#t?.focus())};#C=()=>{this.#c&&clearTimeout(this.#c),this.#c=setTimeout(()=>{if(this.#l=this.#i.value.trim(),this.#l){let t=this.#h.searchEmoji(this.#l);this.#v(t)}else this.#v()},Os)};#x=t=>{t.key==="ArrowDown"&&(t.preventDefault(),this.#a.length>0&&this.#S(0))};#A=t=>{let e=t.currentTarget.getAttribute("data-group");for(let s of this.#r.querySelectorAll('[role="tab"]'))s.setAttribute("aria-selected",s===t.currentTarget?"true":"false");this.#l&&(this.#i.value="",this.#l="",this.#v());let i=this.#n.querySelector(`[data-group-heading="${e}"]`);i&&i.scrollIntoView({block:"start",behavior:"smooth"})};#T=t=>{let e=this.#a.length;if(e!==0)switch(t.key){case"ArrowRight":t.preventDefault(),this.#S(this.#o+1);break;case"ArrowLeft":t.preventDefault(),this.#S(this.#o-1);break;case"ArrowDown":t.preventDefault(),this.#S(this.#o+Kt);break;case"ArrowUp":t.preventDefault(),this.#o<Kt?(this.#i.focus(),this.#o=-1):this.#S(this.#o-Kt);break;case"Home":t.preventDefault(),this.#S(0);break;case"End":t.preventDefault(),this.#S(e-1);break;case"Enter":case" ":t.preventDefault(),this.#o>=0&&this.#a[this.#o].click();break;case"Tab":this.close();break}};#E=t=>{let e=t.currentTarget.getAttribute("data-shortcode"),i=this.#h.EMOJI_MAP.get(e);i&&(this.#R(e),this.#$(i),this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),this.#L())};#S(t){let e=this.#a.length;e!==0&&(t<0&&(t=0),t>=e&&(t=e-1),this.#o=t,this.#a[t].focus())}#$(t){let e=this.getAttribute("for");if(!e)return;let i=document.getElementById(e);if(i){if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"){let s=i,n=this.#d?.start??s.value.length,o=this.#d?.end??n,a=s.value.slice(0,n),l=s.value.slice(o);s.value=a+t.emoji+l;let c=n+t.emoji.length;s.setSelectionRange(c,c),this.#d={start:c,end:c},i.dispatchEvent(new Event("input",{bubbles:!0}))}else if(i.isContentEditable){i.focus();let s=window.getSelection();if(s&&this.#u){s.removeAllRanges(),s.addRange(this.#u);let n=s.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n),this.#u=n.cloneRange()}else if(s){let n=document.createRange();n.selectNodeContents(i),n.collapse(!1);let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n)}}}}#L(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);e&&e.focus()}#M(){try{return JSON.parse(localStorage.getItem(Ci)||"[]")}catch{return[]}}#R(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#M();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem(Ci,JSON.stringify(i))}catch{}}open(){this.#s||(this.#g(),this.#s=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#i.value="",this.#l="",this.#v(),requestAnimationFrame(()=>{this.#i.focus()}),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0})))}close(){this.#s&&(this.#s=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#e.hidden=!0,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0})))}toggle(){this.#s?this.close():this.open()}get isOpen(){return this.#s}};p("emoji-picker",Xt);var Jt=class r extends m{#t=null;#e=null;#i=!1;#n=null;setup(){this.setAttribute("role","list"),this.#i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#s(),this.#o(),this.#u(),this.#r()}teardown(){this.#t&&(this.#t.remove(),this.#t=null),r.#A?.source===this&&(r.#A=null)}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")||"vertical"}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#r(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("aria-grabbed")||t.setAttribute("aria-grabbed","false")}#s(){this.#t=document.createElement("div"),this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.#t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);",this.prepend(this.#t)}#a(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#o(){this.listen(this,"pointerdown",t=>{this.#n=t.target}),this.listen(this,"dragstart",this.#c.bind(this)),this.listen(this,"dragover",this.#l.bind(this)),this.listen(this,"dragleave",this.#h.bind(this)),this.listen(this,"drop",this.#f.bind(this)),this.listen(this,"dragend",this.#d.bind(this))}#c(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#n)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#g(e);r.#A={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#l(t){let e=r.#A;if(!e||(this.group||e.source.group)&&this.group!==e.source.group)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over","");let i=this.orientation==="horizontal"?t.clientX:t.clientY;this.#C(i)}#h(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#x())}#f(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#x();let e=r.#A;if(!e)return;let{item:i,source:s,originalIndex:n}=e,o=this.orientation==="horizontal"?t.clientX:t.clientY,a=this.#k(o);if(s===this){this.#y(i,a),this.#w();let l=this.#g(i);this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,oldIndex:n,newIndex:l,order:this.sortedOrder}}))}else this.#y(i,a),this.#w(),s.#w(),this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,fromSurface:s,toSurface:this,newIndex:this.#g(i),fromOrder:s.sortedOrder,toOrder:this.sortedOrder}}))}#d(){let t=r.#A;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#x(),r.#A=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#u(){this.listen(this,"keydown",this.#m.bind(this))}#m(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.getAttribute("aria-grabbed")==="true",s=this.orientation==="horizontal",n=s?"ArrowLeft":"ArrowUp",o=s?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),i){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#w(),this.#b(e);let c=this.#g(e),h=this.draggableChildren;this.#a(`${this.#p(e)}, dropped at position ${c+1} of ${h.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#e,newIndex:c,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null}else{this.#e=this.#g(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let c=this.draggableChildren;this.#a(`${this.#p(e)}, grabbed. Position ${this.#e+1} of ${c.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&c[u].focus();return}if(i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&(this.#y(e,u),e.focus(),this.#a(`Position ${u+1} of ${c.length}`));return}let a=s?"ArrowUp":"ArrowLeft",l=s?"ArrowDown":"ArrowRight";if(i&&(t.key===a||t.key===l)){if(t.preventDefault(),!this.group)return;let c=t.key===l?1:-1,h=this.#v(c);if(!h)return;h.appendChild(e),h.#w(),this.#w(),h.#b(e),e.focus();let u=h.getAttribute("aria-label")||"next surface";h.#a(`Moved to ${u}`),h.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:h,newIndex:h.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:h.sortedOrder}})),this.removeAttribute("data-reorder-mode"),h.setAttribute("data-reorder-mode",""),this.#e=null;return}if(i&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#e!=null&&(this.#y(e,this.#e),e.focus()),this.#a("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null;return}!i&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#b(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#v(t){if(!this.group)return null;let e=[...document.querySelectorAll(`drag-surface[group="${this.group}"]`)];if(e.length<2)return null;e.sort((n,o)=>{let a=n.getBoundingClientRect(),l=o.getBoundingClientRect();return a.left-l.left||a.top-l.top});let i=e.indexOf(this);return e[i+t]||null}#p(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#g(t){return this.draggableChildren.indexOf(t)}#y(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#w(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#k(t){let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o)return s}return i.length}#C(t){this.#x();let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o){i[s].setAttribute("data-drop-target","before");return}}i.length>0&&i[i.length-1].setAttribute("data-drop-target","after")}#x(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#A=null};p("drag-surface",Jt);var Yt=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),$i={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",shift:"\u21E7",ctrl:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",shift:"Shift",ctrl:"Ctrl"}};function rt(r){let t=Yt?$i.mac:$i.other;return r.split("+").map(e=>{let i=e.trim().toLowerCase();return t[i]??i.toUpperCase()}).join(Yt?"":"+")}function Ti(r){let t=r.toLowerCase().split("+").map(i=>i.trim());return{key:t.pop()??"",meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),shift:t.includes("shift"),alt:t.includes("alt")}}function Li(r,t){if(r.key.toLowerCase()!==t.key)return!1;let e,i;return Yt?(e=t.meta,i=t.ctrl):(e=!1,i=t.meta||t.ctrl),!(e!==r.metaKey||i!==r.ctrlKey||t.shift!==r.shiftKey||t.alt!==r.altKey)}var Fs=new Set(["INPUT","TEXTAREA","SELECT"]),nt=[],Mi=!1;function Hs(r){let t=Fs.has(r.target.tagName)||r.target.isContentEditable;for(let e of nt)if(!(t&&!e.global)&&Li(r,e.descriptor)){r.preventDefault(),e.callback(r);return}}function Us(){Mi||(document.addEventListener("keydown",Hs),Mi=!0)}function Y(r,t,e={}){Us();let i=Ti(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0};return nt.find(o=>o.combo===r)&&console.warn(`[hotkey-bind] Shortcut "${r}" already bound. Last-connected-wins.`),nt.unshift(s),function(){let a=nt.indexOf(s);a!==-1&&nt.splice(a,1)}}var Zt=class extends m{#t;#e;#i;#n=[];#r=-1;#s=[];#a=null;#o=[];setup(){this.#c(),this.#l(),this.hasAttribute("discover")&&this.#b()}teardown(){this.#a?.()}#c(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()});let t=document.createElement("div");t.className="command-search",this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.addEventListener("input",this.#h),this.#e.addEventListener("keydown",this.#f),t.appendChild(this.#e),this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.setAttribute("role","listbox"),this.#s=Array.from(this.querySelectorAll("command-group")),this.#s.forEach(i=>{let s=document.createElement("div");s.className="command-group-header",s.textContent=i.getAttribute("label")||"",s.setAttribute("role","presentation");let n=Array.from(i.querySelectorAll("command-item"));this.#i.appendChild(s),n.forEach(o=>{let a=document.createElement("button");a.className="command-option",a.setAttribute("role","option"),a.dataset.value=o.getAttribute("value")||"",a.dataset.searchText=o.textContent.toLowerCase().trim();let l=o.querySelector('[slot="icon"]');if(l){let u=document.createElement("span");u.className="command-icon",u.appendChild(l.cloneNode(!0)),a.appendChild(u)}let c=document.createElement("span");c.className="command-label",c.textContent=o.textContent.trim(),a.appendChild(c);let h=o.getAttribute("data-hotkey");if(h){let u=document.createElement("kbd");u.className="command-kbd",u.textContent=rt(h),a.appendChild(u)}a.addEventListener("click",()=>{this.#m(a.dataset.value)}),this.#i.appendChild(a),this.#n.push({btn:a,header:s,group:i})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#l(){let t=this.getAttribute("hotkey")||"meta+k";this.#a=Y(t,()=>{this.#t.open?this.close():this.open()},{global:!0})}#h=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#n.forEach(({btn:n,header:o})=>{let a=!t||n.dataset.searchText.includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(".command-group-header").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#r=-1,e>0&&this.#u(0)};#f=t=>{let e=this.#d();switch(t.key){case"ArrowDown":t.preventDefault(),this.#u(this.#r+1);break;case"ArrowUp":t.preventDefault(),this.#u(this.#r-1);break;case"Enter":t.preventDefault(),this.#r>=0&&e[this.#r]&&e[this.#r].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#d(){return this.#n.filter(({btn:t})=>!t.hidden)}#u(t){let e=this.#d();if(e.length===0)return;e.forEach(({btn:s})=>s.removeAttribute("data-active")),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#r=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.scrollIntoView({block:"nearest"})}#m(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#b(){this.listen(document,"vb:command-registry-change",this.#v)}#v=()=>{this.#t?.open&&(this.#p(),this.#h())};#p(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#n=this.#n.filter(n=>!n.discovered),this.#o.forEach(n=>n.remove()),this.#o=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=document.createElement("div");a.className="command-group-header",a.textContent=n,a.setAttribute("role","presentation"),this.#i.insertBefore(a,i),this.#o.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#g(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),this.#i.insertBefore(c,i),this.#n.push({btn:c,header:a,group:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=document.createElement("div");c.className="command-group-header",c.textContent=a,c.setAttribute("role","presentation"),this.#i.insertBefore(c,i),this.#o.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#g(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),this.#i.insertBefore(u,i),this.#n.push({btn:u,header:c,group:null,discovered:!0})}}}}#g(t,e,i){let s=document.createElement("button");if(s.className="command-option",s.setAttribute("role","option"),s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");o.className="command-icon";let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a),s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.textContent=rt(i),s.appendChild(o)}return s}open(){this.#t.open||(this.#p(),this.#t.showModal(),this.#e.value="",this.#h(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t.open&&(this.#t.close(),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0})))}get isOpen(){return this.#t?.open??!1}},Qt=class extends HTMLElement{},te=class extends HTMLElement{};p("command-palette",Zt);p("command-group",Qt);p("command-item",te);var ee=class extends m{#t;#e=null;setup(){this.#i(),this.#e=Y("shift+?",()=>{this.#t.open?this.#t.close():this.#n()})}teardown(){this.#e?.(),this.#e=null,this.#t?.remove(),this.#t=null}#i(){this.#t=document.createElement("dialog"),this.#t.className="shortcut-dialog",this.#t.addEventListener("click",t=>{t.target===this.#t&&this.#t.close()}),this.appendChild(this.#t)}#n(){this.#t.innerHTML="";let t=document.createElement("div");t.className="shortcut-header",t.innerHTML="<h2>Keyboard Shortcuts</h2>",this.#t.appendChild(t);let e=document.createElement("div");e.className="shortcut-body";let{getRegisteredCommands:i}=window.__commandRegistry||{},s=new Map;if(s.set("General",[{label:"Show keyboard shortcuts",shortcut:"shift+?"}]),i)for(let[o,a]of i())for(let l of a){if(!l.shortcut)continue;let c=s.get(o)||[];c.push({label:l.label,shortcut:l.shortcut}),s.set(o,c)}let{getHotkeyActions:n}=window.__hotkeyActionRegistry||{};if(n)for(let[o,a]of n()){let l=s.get(o)||[];for(let c of a)l.push({label:c.label,shortcut:c.shortcut});s.set(o,l)}for(let[o,a]of s){let l=document.createElement("div");l.className="shortcut-group";let c=document.createElement("div");c.className="shortcut-group-header",c.textContent=o,l.appendChild(c);for(let h of a){let u=document.createElement("div");u.className="shortcut-row";let d=document.createElement("span");d.className="shortcut-label",d.textContent=h.label;let f=document.createElement("kbd");f.className="shortcut-kbd",f.textContent=rt(h.shortcut),u.appendChild(d),u.appendChild(f),l.appendChild(u)}e.appendChild(l)}this.#t.appendChild(e),this.#t.showModal()}};p("short-cuts",ee);var ie=class extends m{#t;#e=!1;setup(){let t=[...this.children];if(t.length<2)return!1;t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children will be ignored.");let e=this.getAttribute("position"),i=e!==null?Number(e):50,s=Math.min(100,Math.max(0,isNaN(i)?50:i));this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-label","Comparison slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow",String(Math.round(s))),this.#t.setAttribute("tabindex","0"),this.appendChild(this.#t),this.#a(s),this.listen(this.#t,"pointerdown",this.#i),this.listen(this.#t,"keydown",this.#s)}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#e=!1}#i=t=>{t.preventDefault(),this.#e=!0,this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#n),this.#t.addEventListener("pointerup",this.#r)};#n=t=>{if(!this.#e)return;let e=this.getBoundingClientRect(),i=t.clientX-e.left,s=Math.min(100,Math.max(0,i/e.width*100));this.#a(s)};#r=t=>{this.#e=!1,this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#n),this.#t.removeEventListener("pointerup",this.#r)};#s=t=>{let e=t.shiftKey?10:1,i=Number(this.#t.getAttribute("aria-valuenow"));t.key==="ArrowLeft"||t.key==="ArrowDown"?(t.preventDefault(),this.#a(Math.max(0,i-e))):(t.key==="ArrowRight"||t.key==="ArrowUp")&&(t.preventDefault(),this.#a(Math.min(100,i+e)))};#a(t){let e=Math.round(t);this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(e)),this.#t.style.left=`${t}%`),this.setAttribute("position",String(e)),this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:t},bubbles:!0}))}get position(){return Number(this.getAttribute("position"))||0}set position(t){let e=Math.min(100,Math.max(0,Number(t)||0));this.#a(e)}};p("compare-surface",ie);function Vs(){let r=globalThis.localStorage;if(!r)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return r.getItem(t)},async setRaw(t,e){r.setItem(t,e)},async removeRaw(t){r.removeItem(t)},async keys(t){let e=[];for(let i=0;i<r.length;i++){let s=r.key(i);s&&s.startsWith(t)&&e.push(s)}return e}}}var vt=null;function D(){return vt||(vt=Vs()),vt}function se(r,t){if(typeof r!="string"||!r)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:${r}:${t}`}function _i(r){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${r}:`}function Ri(r){try{let t=JSON.parse(r);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var T={configure(r={}){vt=r.backend??null},async set(r,t,e){let i={data:e,timestamp:Date.now()};await D().setRaw(se(r,t),JSON.stringify(i))},async get(r,t,e){let i=await D().getRaw(se(r,t));if(i==null)return null;let s=Ri(i);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(r,t){await D().removeRaw(se(r,t))},async list(r){let t=_i(r),e=await D().keys(t),i=[];for(let s of e){let n=await D().getRaw(s);if(n==null)continue;let o=Ri(n);o&&i.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return i},async clear(r){let t=_i(r),e=await D().keys(t);for(let i of e)await D().removeRaw(i)},async clearAll(){let r=await D().keys("vb:");for(let t of r)await D().removeRaw(t)},async setMany(r,t){for(let[e,i]of t)await T.set(r,e,i)}};var re=class extends m{#t;#e;#i;#n=!1;#r=50;#s=!1;#a=50;get#o(){return this.getAttribute("direction")==="vertical"}get#c(){let t=this.getAttribute("min"),e=Number(t);return t!==null&&!isNaN(e)?e:10}get#l(){let t=this.getAttribute("max"),e=Number(t);return t!==null&&!isNaN(e)?e:90}get position(){return this.#r}set position(t){this.#p(Number(t))}get collapsed(){return this.#s}set collapsed(t){t?this.#b():this.#v()}reset(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:50;this.#s=!1,this.#p(i),this.#w()}async setup(){let t=[...this.children].filter(a=>!a.classList.contains("split-divider"));if(t.length<2)return!1;this.#e=t[0],this.#i=t[1];let e=this.getAttribute("position"),i=Number(e),s=e!==null&&!isNaN(i)?i:null,n=await this.#g(),o=s??n??50;this.#t=document.createElement("div"),this.#t.className="split-divider",this.#t.setAttribute("role","separator"),this.#t.setAttribute("aria-orientation",this.#o?"vertical":"horizontal"),this.#t.setAttribute("aria-valuenow",String(Math.round(o))),this.#t.setAttribute("aria-valuemin",String(this.#c)),this.#t.setAttribute("aria-valuemax",String(this.#l)),this.#t.setAttribute("aria-label","Resize panels"),this.#t.setAttribute("tabindex","0"),this.insertBefore(this.#t,this.#i),this.#p(o),this.listen(this.#t,"pointerdown",this.#h),this.listen(this.#t,"keydown",this.#u),this.hasAttribute("collapsible")&&this.listen(this.#t,"dblclick",this.#m)}teardown(){this.#t&&(this.#t.remove(),this.#t=null)}#h=t=>{t.preventDefault(),this.#n=!0,this.#t.setPointerCapture(t.pointerId),this.style.userSelect="none",this.#t.addEventListener("pointermove",this.#f),this.#t.addEventListener("pointerup",this.#d)};#f=t=>{if(!this.#n)return;let e=this.getBoundingClientRect(),i;this.#o?i=(t.clientY-e.top)/e.height*100:i=(t.clientX-e.left)/e.width*100,this.#s&&(this.#s=!1),this.#p(i)};#d=t=>{this.#n=!1,this.#t.releasePointerCapture(t.pointerId),this.style.userSelect="",this.#t.removeEventListener("pointermove",this.#f),this.#t.removeEventListener("pointerup",this.#d),this.#y()};#u=t=>{let e=t.shiftKey?10:1,i=this.#r,s=this.#o?["ArrowUp"]:["ArrowLeft"],n=this.#o?["ArrowDown"]:["ArrowRight"];s.includes(t.key)?(t.preventDefault(),this.#p(i-e),this.#y()):n.includes(t.key)?(t.preventDefault(),this.#p(i+e),this.#y()):t.key==="Home"?(t.preventDefault(),this.#p(this.#c),this.#y()):t.key==="End"&&(t.preventDefault(),this.#p(this.#l),this.#y())};#m=()=>{this.#s?this.#v():this.#b(),this.#y()};#b(){this.#a=this.#r,this.#s=!0,this.#e.style.flexBasis="0%",this.#e.style.overflow="hidden",this.#t.setAttribute("aria-valuenow","0"),this.#r=0,this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0},bubbles:!0}))}#v(){this.#s=!1,this.#e.style.overflow="auto",this.#p(this.#a),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1},bubbles:!0}))}#p(t){let e=this.#s?0:Math.min(this.#l,Math.max(this.#c,t));this.#r=e,this.#e.style.flexBasis=`${e}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#t.setAttribute("aria-valuenow",String(Math.round(e))),this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:e},bubbles:!0}))}async#g(){let t=this.getAttribute("persist");if(!t)return null;let e=await T.get("layout",`split:${t}`);return typeof e=="number"?e:null}#y(){let t=this.getAttribute("persist");t&&T.set("layout",`split:${t}`,Math.round(this.#r)).catch(()=>{})}#w(){let t=this.getAttribute("persist");t&&T.remove("layout",`split:${t}`).catch(()=>{})}};p("split-surface",re);var ne=class extends m{#t;#e=null;setup(){this.#e===null&&(this.#e=this.getAttribute("value")||this.textContent.trim());let t=this.#e;if(!t)return!1;let e=parseInt(this.getAttribute("size")??"200",10)||200,i=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t=document.createElement("canvas"),this.#t.width=e,this.#t.height=e,this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`QR code: ${t}`),this.#i(t,e,i)}static get observedAttributes(){return["value","size"]}attributeChangedCallback(t,e,i){if(!this.#t||!this.isConnected)return;t==="value"&&i&&(this.#e=i);let s=this.#e||this.getAttribute("value")||"";if(!s)return;let n=parseInt(this.getAttribute("size")??"200",10)||200,o=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t.width=n,this.#t.height=n,this.#t.setAttribute("aria-label",`QR code: ${s}`),this.#i(s,n,o)}#i(t,e,i){let s=Gs(t,i),n=this.#t.getContext("2d"),o=s.length,a=e/o,l=getComputedStyle(this),c=this.getAttribute("color")||l.color||"#000",h=this.getAttribute("background")||"transparent";n.clearRect(0,0,e,e),h!=="transparent"&&(n.fillStyle=h,n.fillRect(0,0,e,e)),n.fillStyle=c;for(let d=0;d<o;d++)for(let f=0;f<o;f++)s[d][f]&&n.fillRect(Math.round(f*a),Math.round(d*a),Math.ceil(a),Math.ceil(a));this.textContent="",this.appendChild(this.#t);let u=document.createElement("span");u.className="sr-only",u.textContent=t,this.appendChild(u)}toDataURL(t="image/png"){return this.#t?.toDataURL(t)??""}},yt=[[[26,7],[44,10],[70,15],[100,20],[134,26],[172,18],[196,20],[242,24],[292,30],[346,18]],[[26,10],[44,16],[70,26],[100,18],[134,24],[172,16],[196,18],[242,22],[292,22],[346,26]],[[26,13],[44,22],[70,18],[100,26],[134,18],[172,24],[196,18],[242,22],[292,20],[346,28]],[[26,17],[44,28],[70,22],[100,16],[134,22],[172,28],[196,26],[242,26],[292,24],[346,28]]],Ws=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,52]];function Gs(r,t=1){let e=new TextEncoder().encode(r),i=Ks(e.length,t),s=yt[t][i-1][0],n=yt[t][i-1][1],o=s-n,a=Xs(e,i,o),l=Js(a,o,n),c=i*4+17,h=Array.from({length:c},()=>new Uint8Array(c)),u=Array.from({length:c},()=>new Uint8Array(c));return Zs(h,u,c),Qs(h,u,i),tr(h,u,c),er(u,c),ir(h,u,l,c),cr(h,u,c,t)}function Ks(r,t){for(let e=1;e<=10;e++){let i=yt[t][e-1][0],s=yt[t][e-1][1],n=i-s,o=e<=9?8:16,a=Math.ceil((4+o)/8);if(r<=n-a)return e}return 10}function Xs(r,t,e){let i=[],s=(u,d)=>{for(let f=d-1;f>=0;f--)i.push(u>>f&1)};s(4,4);let n=t<=9?8:16;s(r.length,n);for(let u of r)s(u,8);let o=e*8,a=Math.min(4,o-i.length);for(s(0,a);i.length%8!==0;)i.push(0);let l=[236,17],c=0;for(;i.length<o;)s(l[c%2],8),c++;let h=[];for(let u=0;u<i.length;u+=8){let d=0;for(let f=0;f<8;f++)d=d<<1|(i[u+f]||0);h.push(d)}return h}function Js(r,t,e){let i=Ys(e),s=new Uint8Array(t+e);for(let o=0;o<t;o++)s[o]=r[o];for(let o=0;o<t;o++){let a=s[o];if(a===0)continue;let l=wt[a];for(let c=0;c<i.length;c++)s[o+c]^=ot[(l+wt[i[c]])%255]}let n=[...r.slice(0,t)];for(let o=0;o<e;o++)n.push(s[t+o]);return n}var ot=new Uint8Array(512),wt=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)ot[e]=t,wt[t]=e,t<<=1,t>=256&&(t^=285);for(let e=255;e<512;e++)ot[e]=ot[e-255]})();function Ys(r){let t=new Uint8Array([1]);for(let e=0;e<r;e++){let i=new Uint8Array(t.length+1),s=e;for(let n=0;n<t.length;n++)i[n]^=t[n],i[n+1]^=ot[(wt[t[n]]+s)%255];t=i}return t}function Zs(r,t,e){let i=[[0,0],[e-7,0],[0,e-7]];for(let[s,n]of i){for(let o=0;o<7;o++)for(let a=0;a<7;a++){let l=o===0||o===6||a===0||a===6||o>=2&&o<=4&&a>=2&&a<=4;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}for(let o=-1;o<=7;o++)for(let[a,l]of[[o,-1],[o,7],[-1,o],[7,o]]){let c=s+a,h=n+l;c>=0&&c<e&&h>=0&&h<e&&(r[c][h]=0,t[c][h]=1)}}}function Qs(r,t,e){if(e<2)return;let i=Ws[e-1];for(let s of i)for(let n of i)if(!t[s][n])for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++){let l=Math.abs(o)===2||Math.abs(a)===2||o===0&&a===0;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}}function tr(r,t,e){for(let i=8;i<e-8;i++){let s=i%2===0?1:0;t[6][i]||(r[6][i]=s,t[6][i]=1),t[i][6]||(r[i][6]=s,t[i][6]=1)}}function er(r,t){for(let e=0;e<=8;e++)e<t&&(r[8][e]=1),e<t&&(r[e][8]=1);for(let e=0;e<=7;e++)r[8][t-1-e]=1,r[t-1-e][8]=1;r[t-8][8]=1}function ir(r,t,e,i){let s=[];for(let a of e)for(let l=7;l>=0;l--)s.push(a>>l&1);let n=0,o=!0;for(let a=i-1;a>=1;a-=2){a===6&&(a=5);let l=o?Array.from({length:i},(c,h)=>i-1-h):Array.from({length:i},(c,h)=>h);for(let c of l)for(let h of[a,a-1])h<0||h>=i||t[c][h]||(r[c][h]=n<s.length?s[n]:0,n++);o=!o}}var sr=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107];function rr(r,t){let i=[1,0,3,2][r]*8+t;return sr[i]}var nr=[(r,t)=>(r+t)%2===0,r=>r%2===0,(r,t)=>t%3===0,(r,t)=>(r+t)%3===0,(r,t)=>(Math.floor(r/2)+Math.floor(t/3))%2===0,(r,t)=>r*t%2+r*t%3===0,(r,t)=>(r*t%2+r*t%3)%2===0,(r,t)=>((r+t)%2+r*t%3)%2===0];function or(r,t,e,i){let s=r.map(o=>new Uint8Array(o)),n=nr[i];for(let o=0;o<e;o++)for(let a=0;a<e;a++)!t[o][a]&&n(o,a)&&(s[o][a]^=1);return s}function ar(r,t,e,i){let s=rr(e,i),n=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]];for(let a=0;a<15;a++){let[l,c]=n[a];r[l][c]=s>>14-a&1}let o=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[8,t-8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let a=0;a<15;a++){let[l,c]=o[a];r[l][c]=s>>14-a&1}r[t-8][8]=1}function lr(r,t){let e=0;for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[i][n]===r[i][n-1]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[n][i]===r[n-1][i]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t-1;i++)for(let s=0;s<t-1;s++){let n=r[i][s];n===r[i][s+1]&&n===r[i+1][s]&&n===r[i+1][s+1]&&(e+=3)}return e}function cr(r,t,e,i){let s=1/0,n=null;for(let o=0;o<8;o++){let a=or(r,t,e,o);ar(a,e,i,o);let l=lr(a,e);l<s&&(s=l,n=a)}return n}p("qr-code",ne);var oe=class extends m{#t;#e;#i;#n=!1;#r=0;#s=0;#a=0;#o=!1;#c=!1;get activated(){return this.#o}get#l(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}setup(){this.#c||(this.#h(),this.#c=!0),this.listen(this.#t,"pointerdown",this.#f),this.listen(this.#t,"keydown",this.#m),this.listen(this.#t,"transitionend",this.#b)}#h(){this.#i=document.createElement("div"),this.#i.className="slide-track",this.#e=document.createElement("span"),this.#e.className="slide-label",this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow","0"),this.#t.setAttribute("aria-label",this.getAttribute("label")||"Slide to confirm"),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#i.append(this.#e,this.#t),this.textContent="",this.appendChild(this.#i),this.#g(0)}reset(){this.#o=!1,this.removeAttribute("data-activated"),this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t.removeAttribute("aria-disabled"),this.#t.setAttribute("tabindex","0"),this.#g(0),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}#f=t=>{if(!this.#o){if(t.preventDefault(),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#i).getPropertyValue("--_handle-inset")||"0"),n=this.#t.offsetWidth,o=i.width-n-s*2,a=e.left-i.left-s;this.removeAttribute("transitioning"),this.#r=o>0?Math.max(0,Math.min(100,a/o*100)):0,this.#g(this.#r)}this.#n=!0,this.#s=t.clientX,this.#a=this.#r,this.#t.setPointerCapture(t.pointerId),this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#d),this.#t.addEventListener("pointerup",this.#u),this.#t.addEventListener("pointercancel",this.#u)}};#d=t=>{if(!this.#n)return;let e=this.#i.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let s=(t.clientX-this.#s)/e*100,n=Math.min(100,Math.max(0,this.#a+s));this.#g(n)};#u=t=>{this.#n&&(this.#n=!1,this.removeAttribute("data-dragging"),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#d),this.#t.removeEventListener("pointerup",this.#u),this.#t.removeEventListener("pointercancel",this.#u),this.#r>=this.#l?this.#v():this.#p())};#m=t=>{if(this.#o)return;let e=t.shiftKey?20:5;t.key==="ArrowRight"?(t.preventDefault(),this.#g(Math.min(100,this.#r+e))):t.key==="ArrowLeft"?(t.preventDefault(),this.#g(Math.max(0,this.#r-e))):t.key==="End"?(t.preventDefault(),this.#v()):t.key==="Home"&&(t.preventDefault(),this.#g(0)),t.key==="ArrowRight"&&this.#r>=this.#l&&this.#v()};#b=()=>{this.removeAttribute("transitioning")};#v(){this.#o=!0,this.#g(100),this.setAttribute("data-activated",""),this.#e.textContent=this.getAttribute("activated-label")||"Confirmed!",this.#t.setAttribute("aria-disabled","true"),this.#t.removeAttribute("tabindex"),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0}))}#p(){this.setAttribute("transitioning",""),this.#g(0),setTimeout(()=>{this.hasAttribute("transitioning")&&this.removeAttribute("transitioning")},500)}#g(t){this.#r=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t)))}};p("slide-accept",oe);var ae=class extends m{static observedAttributes=["colors","names","layout","show-values","show-names","size","editable"];#t=[];setup(){this.#e()}attributeChangedCallback(){this.isConnected&&this.#e()}#e(){let t=this.getAttribute("colors")||"",e=this.getAttribute("names")||"",i=this.getAttribute("layout")||"inline",s=this.getAttribute("size")||"md",n=this.hasAttribute("show-values"),o=this.hasAttribute("show-names")||e.length>0,a=this.hasAttribute("editable"),l=this.#c(t);this.#t=l.slice();let c=e?e.split(",").map(g=>g.trim()):[],u={sm:48,md:80,lg:120}[s]||80,d="display:flex;flex-wrap:wrap;gap:var(--size-xs,0.5rem)";i==="grid"?d=`display:grid;grid-template-columns:repeat(auto-fill,minmax(${u}px,1fr));gap:var(--size-xs,0.5rem)`:i==="list"&&(d="display:flex;flex-direction:column;gap:var(--size-xs,0.5rem)");let f=l.map((g,v)=>{let b=c[v]||"",k=this.#l(g),S=i==="list"?"display:flex;flex-direction:row;align-items:center;gap:0.75rem":`display:flex;flex-direction:column;align-items:center;gap:0.25rem;max-inline-size:${u}px`,N=i==="list"?36:u,j=`background:${g};color:${k};width:${N}px;height:${N}px;border:1px solid oklch(0% 0 0/0.15);border-radius:var(--radius-s,0.25rem);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;font-family:var(--font-mono,monospace);position:relative;overflow:hidden;flex-shrink:0`;if(a){let z=this.#a(g);return`<div class="swatch-wrap" role="listitem" style="${S}">
|
|
1064
|
+
<label class="color-box color-box-edit" style="${j};cursor:pointer" data-index="${v}" title="Click to edit${b?": "+b:""}" aria-label="${b||"Color "+(v+1)}: ${g}. Click to edit.">
|
|
1065
|
+
<input type="color" class="color-input" value="${z}" data-index="${v}" style="position:absolute;inset:0;opacity:0;cursor:pointer;inline-size:100%;block-size:100%" aria-label="${b||"Color "+(v+1)} picker">
|
|
1066
|
+
<span class="color-value" style="font-size:0.625rem;line-height:1.2;opacity:${n?"1":"0"};text-align:center;padding:2px 4px;word-break:break-all;transition:opacity 0.15s ease;pointer-events:none">${this.#o(g)}</span>
|
|
1067
|
+
</label>
|
|
1068
|
+
${o&&b?`<span style="font-size:var(--font-size-xs,0.75rem);color:var(--color-text-muted,#666);text-align:center;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${b}</span>`:""}
|
|
1069
|
+
</div>`}return`<div class="swatch-wrap" role="listitem" style="${S}">
|
|
1070
|
+
<button type="button" class="color-box" data-index="${v}"
|
|
1071
|
+
style="${j}"
|
|
1072
|
+
title="Click to copy${b?": "+b:""}"
|
|
1073
|
+
aria-label="${b||"Color "+(v+1)}: ${g}">
|
|
1074
|
+
<span class="color-value" style="font-size:0.625rem;line-height:1.2;opacity:${n?"1":"0"};text-align:center;padding:2px 4px;word-break:break-all;transition:opacity 0.15s ease">${this.#o(g)}</span>
|
|
1069
1075
|
</button>
|
|
1070
|
-
${o&&
|
|
1071
|
-
</div>`}).join("");this.innerHTML=`<div class="palette ${i}" role="list" aria-label="Color palette" style="${
|
|
1072
|
-
<button type="button" class="color-box" data-index="${
|
|
1073
|
-
style="background:${
|
|
1074
|
-
title="Click to copy${
|
|
1075
|
-
aria-label="${
|
|
1076
|
-
<span class="color-value" style="font-size:0.625rem;line-height:1.2;opacity:${s?"1":"0"};text-align:center;padding:2px 4px;word-break:break-all;transition:opacity 0.15s ease">${
|
|
1076
|
+
${o&&b?`<span style="font-size:var(--font-size-xs,0.75rem);color:var(--color-text-muted,#666);text-align:center;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${b}</span>`:""}
|
|
1077
|
+
</div>`}).join("");this.innerHTML=`<div class="palette ${i}" role="list" aria-label="Color palette" style="${d}">${f}</div>`,a?this.#n(c):(this.#r(l,c),this.#i(l,c,n))}#i(t,e,i){this.querySelectorAll(".color-box").forEach(s=>{i||(s.addEventListener("pointerenter",()=>{let n=s.querySelector(".color-value");n&&(n.style.opacity="1")}),s.addEventListener("pointerleave",()=>{let n=s.querySelector(".color-value");n&&(n.style.opacity="0")})),s.addEventListener("click",()=>{let n=Number(s.dataset.index),o=t[n],a=e[n]||"";navigator.clipboard?.writeText(o),this.dispatchEvent(new CustomEvent("color-palette:select",{bubbles:!0,detail:{color:o,name:a,index:n}})),s.style.outline="3px solid currentColor",s.style.outlineOffset="2px",setTimeout(()=>{s.style.outline="",s.style.outlineOffset=""},600)})})}#n(t){this.querySelectorAll(".color-input").forEach(e=>{e.addEventListener("input",()=>{let i=Number(e.dataset.index),s=e.value;this.#t[i]=s;let n=e.parentElement;if(n){n.style.background=s,n.style.color=this.#l(s);let o=n.querySelector(".color-value");o&&(o.textContent=this.#o(s)),n.title=`Click to edit${t[i]?": "+t[i]:""} (${s})`,n.setAttribute("aria-label",`${t[i]||"Color "+(i+1)}: ${s}. Click to edit.`)}this.setAttribute("colors",this.#t.join(",")),this.dispatchEvent(new CustomEvent("color-palette:change",{bubbles:!0,detail:{color:s,name:t[i]||"",index:i,colors:this.#t.slice()}}))})})}get colors(){return this.#t.slice()}#r(t,e){this.querySelectorAll(".color-box").forEach(i=>{let s=Number(i.dataset.index),n=t[s];if(!n||!n.includes("var("))return;let o=getComputedStyle(i).backgroundColor,a=this.#s(o)||o;t[s]=a,this.#t[s]=a;let l=i.querySelector(".color-value");l&&(l.textContent=a),i.style.color=this.#l(a);let c=e[s]||"";i.title=`Click to copy${c?": "+c:""} (${a})`,i.setAttribute("aria-label",`${c||"Color "+(s+1)}: ${a}`)})}#s(t){let e=t.match(/rgba?\(\s*([\d.]+),?\s*([\d.]+),?\s*([\d.]+)/);if(!e)return null;let[,i,s,n]=e,o=a=>Math.round(Number(a)).toString(16).padStart(2,"0");return`#${o(i)}${o(s)}${o(n)}`}#a(t){if(/^#[0-9a-f]{6}$/i.test(t))return t.toLowerCase();if(/^#[0-9a-f]{3}$/i.test(t))return("#"+t.slice(1).split("").map(s=>s+s).join("")).toLowerCase();if(typeof document>"u")return"#000000";let e=document.createElement("span");e.style.color=t,e.style.display="none",document.body.appendChild(e);let i=getComputedStyle(e).color;return e.remove(),this.#s(i)||"#000000"}#o(t){if(t.startsWith("#"))return t;let e=t.match(/oklch\(\s*([\d.]+)%?\s+([\d.]+)\s+([\d.]+)/);return e?`${e[1]}% .${e[2].replace("0.","")}`:t.length>12?t.slice(0,12)+"\u2026":t}#c(t){if(!t)return[];let e=[],i=0,s="";for(let n of t)n==="("?i++:n===")"&&i--,n===","&&i===0?(e.push(s.trim()),s=""):s+=n;return s.trim()&&e.push(s.trim()),e}#l(t){let e=t.match(/oklch\(\s*([\d.]+)%?\s/);if(e){let i=parseFloat(e[1]);return(i>1?i/100:i)>.6?"#000":"#fff"}if(t.startsWith("#")){let i=t.replace("#",""),s=parseInt(i.substring(0,2),16)/255,n=parseInt(i.substring(2,4),16)/255,o=parseInt(i.substring(4,6),16)/255;return .2126*s+.7152*n+.0722*o>.4?"#000":"#fff"}return"#000"}};p("color-palette",ae);function hr(r,t,e){t/=100,e/=100;let i=o=>(o+r/30)%12,s=t*Math.min(e,1-e),n=o=>e-s*Math.max(-1,Math.min(i(o)-3,9-i(o),1));return{r:Math.round(n(0)*255),g:Math.round(n(8)*255),b:Math.round(n(4)*255)}}function ur(r,t,e){r/=255,t/=255,e/=255;let i=Math.max(r,t,e),s=Math.min(r,t,e),n=(i+s)/2,o=0,a=0;if(i!==s){let l=i-s;switch(a=n>.5?l/(2-i-s):l/(i+s),i){case r:o=((t-e)/l+(t<e?6:0))/6;break;case t:o=((e-r)/l+2)/6;break;case e:o=((r-t)/l+4)/6;break}}return{h:Math.round(o*360),s:Math.round(a*100),l:Math.round(n*100)}}function Z(r){r=r.replace(/^#/,""),r.length===3&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);let t=parseInt(r,16);return{r:t>>16&255,g:t>>8&255,b:t&255}}function kt(r,t,e){return"#"+[r,t,e].map(i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0")).join("")}function Ni(r){let{r:t,g:e,b:i}=Z(r);return ur(t,e,i)}function E(r,t,e){let{r:i,g:s,b:n}=hr(r,t,e);return kt(i,s,n)}var P=r=>(r%360+360)%360;function dr(r,t,e){return{colors:[E(r,t,e),E(P(r+180),t,e)],names:["Base","Complement"]}}function pr(r,t,e){return{colors:[E(P(r-30),t,e),E(r,t,e),E(P(r+30),t,e)],names:["Analog A","Base","Analog B"]}}function mr(r,t,e){return{colors:[E(r,t,e),E(P(r+120),t,e),E(P(r+240),t,e)],names:["Base","Triad A","Triad B"]}}function fr(r,t,e){return{colors:[E(r,t,e),E(P(r+150),t,e),E(P(r+210),t,e)],names:["Base","Split A","Split B"]}}function gr(r,t,e){return{colors:[E(r,t,e),E(P(r+90),t,e),E(P(r+180),t,e),E(P(r+270),t,e)],names:["Base","Tetrad A","Tetrad B","Tetrad C"]}}var br=[{label:"50",l:96},{label:"100",l:90},{label:"200",l:80},{label:"300",l:70},{label:"400",l:60},{label:"500",l:50},{label:"600",l:40},{label:"700",l:30},{label:"800",l:22},{label:"900",l:15},{label:"950",l:10}];function vr(r,t,e){let i=[],s=[];for(let n of br){let o=n.l>85||n.l<20?Math.max(t*.6,5):t;i.push(E(r,Math.round(o),n.l)),s.push(n.label)}return{colors:i,names:s}}var ji={complementary:dr,analogous:pr,triadic:mr,"split-complementary":fr,tetradic:gr,monochromatic:vr};function xt(r,t){let{h:e,s:i,l:s}=Ni(r);return(ji[t]||ji.complementary)(e,i,s)}var le=class extends m{static observedAttributes=["seed","harmony","include-seed","show-export","layout","size","show-values","show-names"];#t=null;#e="";#i=[];#n=[];setup(){this.#t=this.querySelector("color-picker")||this.querySelector('input[type="color"]'),this.#e=this.#r(),this.#e&&(this.#s(),this.#o(),this.#d())}attributeChangedCallback(){this.isConnected&&this.hasAttribute("data-upgraded")&&(this.#e=this.#r(),this.#e&&this.#s())}#r(){if(this.#t){let t=this.#t;if(t.tagName==="COLOR-PICKER"){let e=t.value;return e&&e!=="#000000"?e:t.querySelector('input[type="color"]')?.value||e||""}return t.value||""}return this.getAttribute("seed")||""}#s(){let t=this.getAttribute("harmony")||"complementary",e=this.getAttribute("layout")||"inline",i=this.getAttribute("size")||"md",s=this.hasAttribute("show-values"),n=this.hasAttribute("show-names"),o=this.hasAttribute("show-export"),{colors:a,names:l}=xt(this.#e,t);this.#i=a,this.#n=l;let h={sm:48,md:80,lg:120}[i]||80,u="display:flex;flex-wrap:wrap;gap:var(--size-xs,0.5rem)";e==="grid"?u=`display:grid;grid-template-columns:repeat(auto-fill,minmax(${h}px,1fr));gap:var(--size-xs,0.5rem)`:e==="list"&&(u="display:flex;flex-direction:column;gap:var(--size-xs,0.5rem)");let d=a.map((b,k)=>{let S=l[k]||"",N=this.#l(b),j=e==="list"?"display:flex;flex-direction:row;align-items:center;gap:0.75rem":`display:flex;flex-direction:column;align-items:center;gap:0.25rem;max-inline-size:${h}px`,z=e==="list"?36:h,I=b.length>12?b.slice(0,12)+"\u2026":b;return`<div class="swatch-wrap" role="listitem" style="${j}">
|
|
1078
|
+
<button type="button" class="color-box" data-index="${k}"
|
|
1079
|
+
style="background:${b};color:${N};width:${z}px;height:${z}px;border:1px solid oklch(0% 0 0/0.15);border-radius:var(--radius-s,0.25rem);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;font-family:var(--font-mono,monospace);position:relative;overflow:hidden;flex-shrink:0"
|
|
1080
|
+
title="Click to copy${S?": "+S:""}"
|
|
1081
|
+
aria-label="${S||"Color "+(k+1)}: ${b}">
|
|
1082
|
+
<span class="color-value" style="font-size:0.625rem;line-height:1.2;opacity:${s?"1":"0"};text-align:center;padding:2px 4px;word-break:break-all;transition:opacity 0.15s ease">${I}</span>
|
|
1077
1083
|
</button>
|
|
1078
|
-
${n&&
|
|
1079
|
-
</div>`}).join(""),
|
|
1084
|
+
${n&&S?`<span style="font-size:var(--font-size-xs,0.75rem);color:var(--color-text-muted,#666);text-align:center;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${S}</span>`:""}
|
|
1085
|
+
</div>`}).join(""),f="";o&&(f=`<div class="pg-export" role="toolbar" aria-label="Export palette" style="display:flex;gap:0.5rem;margin-block-start:var(--size-xs,0.5rem)">
|
|
1080
1086
|
<button type="button" class="pg-copy-hex" style="padding:0.25rem 0.75rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface,#fff);color:var(--color-text,#333);cursor:pointer;font-size:var(--font-size-xs,0.75rem);font-family:inherit">Copy Hex</button>
|
|
1081
1087
|
<button type="button" class="pg-copy-css" style="padding:0.25rem 0.75rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface,#fff);color:var(--color-text,#333);cursor:pointer;font-size:var(--font-size-xs,0.75rem);font-family:inherit">Copy CSS</button>
|
|
1082
|
-
</div>`);let g=this.#t;for(let
|
|
1083
|
-
`):this.#i.map((e,i)=>`--palette-${this.#
|
|
1084
|
-
`)}#
|
|
1085
|
-
<
|
|
1088
|
+
</div>`);let g=this.#t;for(let b of[...this.children])b!==g&&(b.classList?.contains("pg-seed-label")||b.remove());if(g&&!this.querySelector(".pg-seed-label")){let b=document.createElement("span");b.className="pg-seed-label",b.textContent="Seed Color",g.before(b)}let v=document.createElement("div");if(v.className=`palette ${e}`,v.setAttribute("role","list"),v.setAttribute("aria-label","Color palette"),v.style.cssText=u,v.innerHTML=d,g?g.after(v):this.prepend(v),f){let b=document.createElement("div");b.innerHTML=f,this.append(b.firstElementChild)}this.#a(v,a,l,s),o&&this.#c()}#a(t,e,i,s){t.querySelectorAll(".color-box").forEach(n=>{s||(n.addEventListener("pointerenter",()=>{let o=n.querySelector(".color-value");o&&(o.style.opacity="1")}),n.addEventListener("pointerleave",()=>{let o=n.querySelector(".color-value");o&&(o.style.opacity="0")})),n.addEventListener("click",()=>{let o=Number(n.dataset.index),a=e[o],l=i[o]||"";navigator.clipboard?.writeText(a),this.dispatchEvent(new CustomEvent("color-palette:select",{bubbles:!0,detail:{color:a,name:l,index:o}})),n.style.outline="3px solid currentColor",n.style.outlineOffset="2px",setTimeout(()=>{n.style.outline="",n.style.outlineOffset=""},600)})})}#o(){let t=this.#t;t&&(t.tagName==="COLOR-PICKER"?this.listen(t,"color-picker:change",e=>{this.#e=e.detail.hex,this.#s(),this.#d()}):this.listen(t,"input",()=>{this.#e=t.value,this.#s(),this.#d()}))}#c(){let t=this.querySelector(".pg-copy-hex"),e=this.querySelector(".pg-copy-css");t&&t.addEventListener("click",()=>{navigator.clipboard?.writeText(this.#i.join(", ")),this.#f(t,"Copy Hex")}),e&&e.addEventListener("click",()=>{let i=this.getAttribute("harmony")||"complementary",s=this.#h(i);navigator.clipboard?.writeText(s),this.#f(e,"Copy CSS")})}#l(t){if(t.startsWith("#")){let{r:e,g:i,b:s}=Z(t);return .2126*(e/255)+.7152*(i/255)+.0722*(s/255)>.4?"#000":"#fff"}return"#000"}#h(t){return t==="monochromatic"?this.#i.map((e,i)=>`--color-seed-${this.#n[i]||i+1}: ${e};`).join(`
|
|
1089
|
+
`):this.#i.map((e,i)=>`--palette-${this.#n[i]?this.#n[i].toLowerCase().replace(/\s+/g,"-"):`${i+1}`}: ${e};`).join(`
|
|
1090
|
+
`)}#f(t,e){t.textContent="Copied!",setTimeout(()=>{t.textContent=e},1500)}#d(){let t=this.getAttribute("harmony")||"complementary";this.dispatchEvent(new CustomEvent("palette-generator:generate",{bubbles:!0,detail:{colors:[...this.#i],harmony:t,seed:this.#e}}))}};p("palette-generator",le);var ce=r=>r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4),he=r=>r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055,ue=r=>r<0?0:r>1?1:r;function Q(r){let{r:t,g:e,b:i}=Z(r),s=ce(t/255),n=ce(e/255),o=ce(i/255),a=.4122214708*s+.5363325363*n+.0514459929*o,l=.2119034982*s+.6806995451*n+.1073969566*o,c=.0883024619*s+.2817188376*n+.6299787005*o,h=Math.cbrt(a),u=Math.cbrt(l),d=Math.cbrt(c),f=.2104542553*h+.793617785*u-.0040720468*d,g=1.9779984951*h-2.428592205*u+.4505937099*d,v=.0259040371*h+.7827717662*u-.808675766*d,b=Math.sqrt(g*g+v*v),k=Math.atan2(v,g)*180/Math.PI;return k<0&&(k+=360),{l:f,c:b,h:k}}function at(r,t,e){let i=e*Math.PI/180,s=t*Math.cos(i),n=t*Math.sin(i),o=r+.3963377774*s+.2158037573*n,a=r-.1055613458*s-.0638541728*n,l=r-.0894841775*s-1.291485548*n,c=o*o*o,h=a*a*a,u=l*l*l,d=4.0767416621*c-3.3077115913*h+.2309699292*u,f=-1.2684380046*c+2.6097574011*h-.3413193965*u,g=-.0041960863*c-.7034186147*h+1.707614701*u,v=ue(he(d)),b=ue(he(f)),k=ue(he(g));return kt(Math.round(v*255),Math.round(b*255),Math.round(k*255))}function pe(r,t){if(!r)return null;let e=String(r).trim();if(/^#[0-9a-f]{6}$/i.test(e))return e.toLowerCase();if(/^#[0-9a-f]{3}$/i.test(e))return("#"+e.slice(1).split("").map(o=>o+o).join("")).toLowerCase();if(typeof document>"u")return null;let i=t||document.createElement("span");t||(i.style.display="none",document.body.appendChild(i)),i.style.color="",i.style.color=e;let s=getComputedStyle(i).color;t||i.remove();let n=s.match(/rgba?\(\s*([0-9.]+)[\s,]+([0-9.]+)[\s,]+([0-9.]+)/);return n?kt(Math.round(+n[1]),Math.round(+n[2]),Math.round(+n[3])):null}function zi({l:r,c:t,h:e}){return`oklch(${(r*100).toFixed(1)}% ${t.toFixed(3)} ${e.toFixed(1)})`}function de(r){let{r:t,g:e,b:i}=Z(r),s=n=>{let o=n/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)};return .2126*s(t)+.7152*s(e)+.0722*s(i)}function Pi(r,t){let e=de(r),i=de(t),s=Math.max(e,i),n=Math.min(e,i);return(s+.05)/(n+.05)}function Bi(r){return r>=7?"AAA":r>=4.5?"AA":"Fail"}function me(r){return de(r)>.4?"#000000":"#ffffff"}var At=["primary","secondary","accent"],Di=["success","warning","error","info"],yr=[...At,...Di],qi={primary:"Primary",secondary:"Secondary",accent:"Accent",success:"Success",warning:"Warning",error:"Error",info:"Info"},wr={aaa:{bg:"oklch(92% 0.08 145)",fg:"oklch(30% 0.12 145)"},aa:{bg:"oklch(94% 0.08 90)",fg:"oklch(35% 0.12 70)"},fail:{bg:"oklch(92% 0.08 25)",fg:"oklch(35% 0.15 25)"}},fe="var(--font-mono, monospace)",ge="var(--color-text-muted, #666)",be="var(--color-border, #ddd)",Ii="var(--color-surface, #fff)",kr="var(--color-text, #222)",U="var(--radius-s, 0.25rem)",xr="var(--radius-m, 0.5rem)",ve=class extends m{static observedAttributes=["colors","roles","show-export","label"];#t=[];#e=[];#i=null;#n=null;#r=null;setup(){this.#r=document.createElement("span"),this.#r.style.cssText="position:absolute;visibility:hidden;pointer-events:none",this.append(this.#r),this.#i=this.querySelector("color-palette, palette-generator"),this.#a(),this.#s(),this.#c(),this.#l("init"),this.#b(),this.#v(),this.#E("init")}attributeChangedCallback(t){!this.isConnected||!this.hasAttribute("data-upgraded")||(t==="roles"&&this.#a(),t==="colors"&&this.#s(),this.#c(),this.#l("attribute"),this.#v(),this.#E("attribute"))}teardown(){this.#r?.remove(),this.#r=null}#s(){let t=this.querySelector("color-palette");if(t){if(typeof t.colors<"u"&&t.colors.length){this.#t=t.colors.slice();return}let n=(t.getAttribute("colors")||"").split(",").map(o=>o.trim()).filter(Boolean);if(n.length){this.#t=n;return}}let e=this.querySelector("palette-generator");if(e){let s=e.getAttribute("seed")||e.querySelector('input[type="color"]')?.value||"",n=e.getAttribute("harmony")||"complementary";if(s)try{let{colors:o}=xt(s,n);this.#t=o.slice();return}catch{}}let i=this.getAttribute("colors")||"";this.#t=i.split(",").map(s=>s.trim()).filter(Boolean)}#a(){let e=(this.getAttribute("roles")||At.join(",")).split(",").map(i=>i.trim().toLowerCase()).filter(i=>yr.includes(i));this.#e=e.length?e:[...At]}#o(){let t={};for(let e=0;e<this.#e.length;e++)t[this.#e[e]]=this.#t[e]||this.#t[this.#t.length-1]||"#888888";return t}#c(){let t=this.querySelector(":scope > .sp-shell");t&&t.remove();let e=this.getAttribute("label"),i=this.hasAttribute("show-export"),s=document.createElement("div");if(s.className="sp-shell",s.style.cssText="display:flex;flex-direction:column;gap:var(--size-m,1rem);margin-block-start:var(--size-s,0.75rem)",e){let o=document.createElement("p");o.style.cssText="font-weight:600;margin:0",o.textContent=e,s.append(o)}let n=document.createElement("section");n.className="sp-previews",n.setAttribute("aria-label","Role previews"),n.style.cssText="display:grid;grid-template-columns:repeat(auto-fill,minmax(min(22rem,100%),1fr));gap:var(--size-m,1rem)",s.append(n),this.#n=n,i&&s.insertAdjacentHTML("beforeend",this.#m()),this.append(s)}#l(t){if(!this.#n)return;let e=this.#o();this.#n.innerHTML=this.#e.map(i=>this.#h(i,e[i])).join("")}#h(t,e){let i=qi[t]||t,n=Di.includes(t)?this.#d(t,e):this.#f(t,e),o=`display:flex;flex-direction:column;gap:var(--size-s,0.75rem);padding:var(--size-m,1rem);border:1px solid ${be};border-radius:${xr};background:${Ii};min-inline-size:0`;return`<article class="sp-card" data-role="${t}" aria-label="${i} role preview" style="${o}">
|
|
1091
|
+
<header style="display:flex;align-items:center;justify-content:space-between;gap:var(--size-s,0.75rem)">
|
|
1092
|
+
<div>
|
|
1093
|
+
<code style="font-family:${fe};font-size:var(--font-size-sm,0.875rem);font-weight:600">${t}</code>
|
|
1094
|
+
<span style="display:block;font-size:var(--font-size-xs,0.75rem);color:${ge}">${i}</span>
|
|
1095
|
+
</div>
|
|
1096
|
+
<div style="display:flex;align-items:center;gap:0.5rem">
|
|
1097
|
+
<span class="sp-swatch" style="display:inline-block;inline-size:1.75rem;block-size:1.75rem;border-radius:${U};border:1px solid oklch(0% 0 0 / 0.15);background:${e}"></span>
|
|
1098
|
+
<code style="font-family:${fe};font-size:var(--font-size-xs,0.75rem);color:${ge}">${e}</code>
|
|
1099
|
+
</div>
|
|
1100
|
+
</header>
|
|
1101
|
+
<div class="sp-samples" style="display:flex;flex-wrap:wrap;gap:var(--size-s,0.75rem);align-items:flex-start">${n}</div>
|
|
1102
|
+
</article>`}#f(t,e){let i=this.#y(t,e),s=this.#g(),n=this.#w(t,e),o=this.#x(e);return[this.#u({render:`<button type="button" tabindex="-1" style="all:unset;display:inline-block;padding:0.375rem 0.875rem;border-radius:${U};background:${e};color:${i};font-family:inherit;font-size:var(--font-size-sm,0.875rem);font-weight:600;cursor:default">Button</button>`,fg:i,bg:e,caption:"On role"}),this.#u({render:`<span style="color:${e};background:${s};padding:0.25rem 0.5rem;border-radius:${U};font-size:var(--font-size-sm,0.875rem);font-weight:500;text-decoration:underline">Linked text</span>`,fg:e,bg:s||"#ffffff",caption:"On surface"}),this.#u({render:`<span style="display:inline-block;padding:0.125rem 0.5rem;border-radius:999px;background:${n};color:${o};font-size:var(--font-size-xs,0.75rem);font-weight:600;letter-spacing:0.04em;text-transform:uppercase">Badge</span>`,fg:o,bg:n,caption:"Subtle"})].join("")}#d(t,e){let i=this.#g(),s=this.#k(t,e),n=this.#C(t,e),o=me(e);return[this.#u({render:`<div style="display:flex;align-items:center;gap:0.5rem;padding:0.5rem 0.75rem;border-radius:${U};background:${s};color:${n};border:1px solid ${e};font-size:var(--font-size-sm,0.875rem);max-inline-size:100%">
|
|
1103
|
+
<span style="display:inline-block;inline-size:0.5rem;block-size:0.5rem;border-radius:50%;background:${e};flex-shrink:0"></span>
|
|
1104
|
+
<span><strong>${qi[t]||t}</strong> \u2014 message text</span>
|
|
1105
|
+
</div>`,fg:n,bg:s,caption:"Alert"}),this.#u({render:`<span style="display:inline-block;padding:0.125rem 0.5rem;border-radius:999px;background:${e};color:${o};font-size:var(--font-size-xs,0.75rem);font-weight:700;letter-spacing:0.04em;text-transform:uppercase">${t}</span>`,fg:o,bg:e,caption:"Badge"}),this.#u({render:`<span style="color:${e};background:${i};padding:0.25rem 0.5rem;border-radius:${U};font-size:var(--font-size-sm,0.875rem);font-weight:600">Inline status</span>`,fg:e,bg:i||"#ffffff",caption:"On surface"})].join("")}#u({render:t,fg:e,bg:i,caption:s}){let n=pe(e,this.#r)||"#000000",o=pe(i,this.#r)||"#ffffff",a=Pi(n,o),l=Bi(a).toLowerCase(),c=wr[l],h=`display:inline-flex;align-items:center;gap:0.25rem;padding:0.125rem 0.375rem;border-radius:${U};font-family:${fe};font-size:var(--font-size-xs,0.75rem);background:${c.bg};color:${c.fg}`;return`<div style="display:flex;flex-direction:column;gap:0.25rem;align-items:flex-start;min-inline-size:0;max-inline-size:100%">
|
|
1106
|
+
<div style="max-inline-size:100%">${t}</div>
|
|
1107
|
+
<div style="display:flex;align-items:center;gap:0.375rem;font-size:var(--font-size-xs,0.75rem);color:${ge}">
|
|
1108
|
+
<span style="${h}" title="${s}: ${a.toFixed(2)}:1">${a.toFixed(2)} <small>${l.toUpperCase()}</small></span>
|
|
1109
|
+
<span>${s}</span>
|
|
1110
|
+
</div>
|
|
1111
|
+
</div>`}#m(){let t=`display:flex;gap:var(--size-2xs,0.375rem);padding-block-start:var(--size-xs,0.5rem);border-block-start:1px solid ${be}`,e=`padding:0.375rem 0.875rem;border:1px solid ${be};border-radius:${U};background:${Ii};color:${kr};cursor:pointer;font:inherit;font-size:var(--font-size-sm,0.875rem)`;return`<div class="sp-export" role="toolbar" aria-label="Export semantic palette" style="${t}">
|
|
1112
|
+
<button type="button" class="sp-copy-css" style="${e}">Copy Theme CSS</button>
|
|
1113
|
+
<button type="button" class="sp-copy-json" style="${e}">Copy JSON</button>
|
|
1114
|
+
</div>`}#b(){let t=this.querySelector("color-palette");t&&this.listen(t,"color-palette:change",()=>{this.#s(),this.#l("palette"),this.#E("palette")});let e=this.querySelector("palette-generator");e&&this.listen(e,"palette-generator:generate",()=>{this.#s(),this.#l("palette"),this.#E("palette")})}#v(){let t=this.querySelector(".sp-copy-css"),e=this.querySelector(".sp-copy-json");t&&this.listen(t,"click",()=>{navigator.clipboard?.writeText(this.#A()),this.#T(t,"Copy Theme CSS")}),e&&this.listen(e,"click",()=>{navigator.clipboard?.writeText(JSON.stringify(this.#o(),null,2)),this.#T(e,"Copy JSON")})}#p(){return getComputedStyle(this)}#g(){return this.#p().getPropertyValue("--color-surface").trim()||"#ffffff"}#y(t,e){return this.#p().getPropertyValue(`--color-text-on-${t}`).trim()||me(e)}#w(t,e){let i=this.#p().getPropertyValue(`--color-${t}-subtle`).trim();if(i)return i;let{h:s}=Q(e);return at(.95,.03,s)}#k(t,e){let i=this.#p().getPropertyValue(`--color-${t}-subtle`).trim();if(i)return i;let{h:s}=Q(e);return at(.94,.05,s)}#C(t,e){let i=this.#p().getPropertyValue(`--color-${t}-text`).trim();if(i)return i;let{h:s}=Q(e);return at(.3,.14,s)}#x(t){let{l:e,c:i,h:s}=Q(t);return at(Math.max(.2,e-.25),i,s)}#A(){let t=this.#o(),e=[],i=[];for(let n of this.#e){let o=t[n];if(!o)continue;let{l:a,c:l,h:c}=Q(o);At.includes(n)?e.push(` --hue-${n}: ${c.toFixed(1)};`,` --lightness-${n}: ${(a*100).toFixed(1)}%;`,` --chroma-${n}: ${l.toFixed(3)};`):i.push(` --color-${n}: ${zi({l:a,c:l,h:c})};`)}let s=[];return e.length&&s.push(" /* Brand seeds */",...e),i.length&&(e.length&&s.push(""),s.push(" /* Status colors */",...i)),`:root {
|
|
1115
|
+
${s.join(`
|
|
1116
|
+
`)}
|
|
1117
|
+
}
|
|
1118
|
+
`}#T(t,e){t.textContent="Copied!",setTimeout(()=>{t.textContent=e},1500)}#E(t){this.dispatchEvent(new CustomEvent("semantic-palette:change",{bubbles:!0,detail:{mapping:this.#o(),tokens:this.#A(),source:t}}))}};p("semantic-palette",ve);var Ar=["system-ui","Georgia","Inter, sans-serif",'"JetBrains Mono", monospace',"Verdana","Cambria","ui-serif"],ye=class extends m{static observedAttributes=["font-family","label","sample","show-scale","show-weights","show-characters","weights","editable","target","token"];setup(){this.#t(),this.#e()}attributeChangedCallback(){this.isConnected&&(this.#t(),this.#e())}#t(){let t=this.getAttribute("font-family")||"system-ui",e=this.getAttribute("label")||t.replace(/['"]/g,"").split(",")[0],i=this.getAttribute("sample")||"The quick brown fox jumps over the lazy dog",s=this.hasAttribute("show-scale"),n=this.hasAttribute("show-weights"),o=this.hasAttribute("show-characters"),l=(this.getAttribute("weights")||"300,400,500,600,700").split(",").map(d=>d.trim()),c="",u=this.hasAttribute("editable")?`<input type="text" class="specimen-font-input" value="${t.replace(/"/g,""")}" aria-label="Font family" style="font:inherit;padding:0.25rem 0.5rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);min-inline-size:18rem;max-inline-size:100%;font-family:${t};font-size:var(--font-size-sm,0.875rem)">
|
|
1119
|
+
<span class="specimen-quick" style="display:inline-flex;flex-wrap:wrap;gap:0.25rem;margin-inline-start:0.5rem">
|
|
1120
|
+
${Ar.map(d=>`<button type="button" class="specimen-quick-btn" data-font="${d.replace(/"/g,""")}" style="font:inherit;font-size:var(--font-size-xs,0.75rem);padding:0.125rem 0.5rem;border:1px solid var(--color-border,#ccc);border-radius:999px;background:var(--color-surface,#fff);color:var(--color-text,#222);cursor:pointer">${d.split(",")[0].replace(/["']/g,"")}</button>`).join("")}
|
|
1121
|
+
</span>`:`<span class="specimen-label">${e}</span>`;if(c+=`<div class="specimen-header" style="font-family:${t}">
|
|
1122
|
+
${u}
|
|
1086
1123
|
<p class="specimen-sample" contenteditable="plaintext-only" spellcheck="false">${i}</p>
|
|
1087
1124
|
</div>`,o&&(c+=`<div class="specimen-chars" style="font-family:${t}">
|
|
1088
|
-
<div class="char-row"><span class="char-label">Upper</span>${"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map(
|
|
1089
|
-
<div class="char-row"><span class="char-label">Lower</span>${"abcdefghijklmnopqrstuvwxyz".split("").map(
|
|
1090
|
-
<div class="char-row"><span class="char-label">Digits</span>${"0123456789".split("").map(
|
|
1091
|
-
<div class="char-row"><span class="char-label">Punct</span>${"!@#$%^&*()_+-=[]{}|;:,.<>?".split("").map(
|
|
1092
|
-
</div>`),n){c+='<div class="specimen-weights">';for(let
|
|
1093
|
-
<span class="weight-label">${
|
|
1125
|
+
<div class="char-row"><span class="char-label">Upper</span>${"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map(d=>`<span>${d}</span>`).join("")}</div>
|
|
1126
|
+
<div class="char-row"><span class="char-label">Lower</span>${"abcdefghijklmnopqrstuvwxyz".split("").map(d=>`<span>${d}</span>`).join("")}</div>
|
|
1127
|
+
<div class="char-row"><span class="char-label">Digits</span>${"0123456789".split("").map(d=>`<span>${d}</span>`).join("")}</div>
|
|
1128
|
+
<div class="char-row"><span class="char-label">Punct</span>${"!@#$%^&*()_+-=[]{}|;:,.<>?".split("").map(d=>`<span>${d==="<"?"<":d===">"?">":d==="&"?"&":d}</span>`).join("")}</div>
|
|
1129
|
+
</div>`),n){c+='<div class="specimen-weights">';for(let d of l)c+=`<div class="weight-sample" style="font-family:${t};font-weight:${d}">
|
|
1130
|
+
<span class="weight-label">${d}</span>
|
|
1094
1131
|
<span class="weight-text">Aa</span>
|
|
1095
|
-
</div>`;c+="</div>"}if(s){let
|
|
1096
|
-
<span class="scale-label">${
|
|
1132
|
+
</div>`;c+="</div>"}if(s){let d=[{name:"xs",rem:.75},{name:"sm",rem:.875},{name:"md",rem:1},{name:"lg",rem:1.125},{name:"xl",rem:1.25},{name:"2xl",rem:1.5},{name:"3xl",rem:1.875},{name:"4xl",rem:2.25},{name:"5xl",rem:3}];c+='<div class="specimen-scale">';for(let f of d)c+=`<div class="scale-step" style="font-family:${t};font-size:${f.rem}rem">
|
|
1133
|
+
<span class="scale-label">${f.name}</span>
|
|
1097
1134
|
<span class="scale-text">${i.substring(0,30)}</span>
|
|
1098
|
-
</div>`;c+="</div>"}this.innerHTML=c}};
|
|
1099
|
-
<span style="font-family:var(--font-mono,monospace);font-size:0.875rem;color:var(--color-text-muted,#666);text-align:end">${
|
|
1100
|
-
<div class="scale-bar" style="display:block;block-size:var(--size-m,1rem);min-inline-size:2px;inline-size:var(${
|
|
1101
|
-
${
|
|
1102
|
-
</div>`}
|
|
1135
|
+
</div>`;c+="</div>"}this.innerHTML=c}#e(){if(!this.hasAttribute("editable"))return;let t=this.querySelector(".specimen-font-input");t&&this.listen(t,"input",()=>this.#i(t.value)),this.querySelectorAll(".specimen-quick-btn").forEach(e=>{this.listen(e,"click",()=>{let i=e.getAttribute("data-font")||"";t&&(t.value=i),this.#i(i)})})}#i(t){let e=this.#n(),i=this.getAttribute("token")||"font-family-base";e&&e.style.setProperty(`--${i}`,t),this.setAttribute("font-family",t),this.dispatchEvent(new CustomEvent("type-specimen:change",{bubbles:!0,detail:{fontFamily:t,token:i,target:this.getAttribute("target")||":root"}}))}#n(){let t=this.getAttribute("target")||":root";try{return t===":root"?document.documentElement:document.querySelector(t)}catch{return document.documentElement}}};p("type-specimen",ye);var we=class extends m{static observedAttributes=["tokens","prefix","show-values","label","editable","target"];setup(){this.#t(),this.#e()}attributeChangedCallback(){this.isConnected&&(this.#t(),this.#e())}#t(){let t=this.getAttribute("tokens")||"3xs,2xs,xs,s,m,l,xl,2xl,3xl",e=this.getAttribute("prefix")||"--size-",i=this.getAttribute("show-values")!=="false",s=this.getAttribute("label")||"",n=this.hasAttribute("editable"),o=t.split(",").map(l=>l.trim()),a="";s&&(a+=`<div style="font-size:0.75rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-muted,#666);margin-block-end:0.75rem;font-family:var(--font-sans,system-ui)">${s}</div>`),a+=`<div role="list" aria-label="${s||"Spacing scale"}" style="display:flex;flex-direction:column;gap:0.25rem">`;for(let l of o){let c=`${e}${l}`,h=n?`<input type="text" class="scale-edit" data-token="${l}" aria-label="${l} value" style="font-family:var(--font-mono,monospace);font-size:0.75rem;padding:0.125rem 0.375rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface,#fff);color:var(--color-text,#222);inline-size:6rem;text-align:end">`:i?'<span class="scale-value" style="font-family:var(--font-mono,monospace);font-size:0.75rem;color:var(--color-text-muted,#666);font-variant-numeric:tabular-nums;min-inline-size:3.5rem;text-align:end"></span>':"";a+=`<div role="listitem" style="display:grid;grid-template-columns:3rem 1fr auto;align-items:center;gap:0.75rem;min-block-size:1.75rem">
|
|
1136
|
+
<span style="font-family:var(--font-mono,monospace);font-size:0.875rem;color:var(--color-text-muted,#666);text-align:end">${l}</span>
|
|
1137
|
+
<div class="scale-bar" style="display:block;block-size:var(--size-m,1rem);min-inline-size:2px;inline-size:var(${c});background:var(--color-interactive,oklch(55% 0.2 260));border-radius:var(--radius-s,0.25rem)" aria-hidden="true"></div>
|
|
1138
|
+
${h}
|
|
1139
|
+
</div>`}a+="</div>",this.innerHTML=a,requestAnimationFrame(()=>{if(n){let l=getComputedStyle(this);this.querySelectorAll(".scale-edit").forEach(c=>{let h=c.getAttribute("data-token"),u=l.getPropertyValue(`${e}${h}`).trim();c.value=u||""})}else i&&this.querySelectorAll(".scale-bar").forEach(l=>{let c=l.getBoundingClientRect().width,h=l.nextElementSibling;h&&(h.textContent=`${Math.round(c*100)/100}px`)})})}#e(){if(!this.hasAttribute("editable"))return;let t=this.getAttribute("prefix")||"--size-";this.querySelectorAll(".scale-edit").forEach(e=>{this.listen(e,"change",()=>this.#i(e,t)),this.listen(e,"keydown",i=>{i.key==="Enter"&&this.#i(e,t)})})}#i(t,e){let i=t.getAttribute("data-token"),s=t.value.trim();if(!i||!s)return;let n=this.#n(),o=`${e}${i}`;n&&n.style.setProperty(o,s),this.dispatchEvent(new CustomEvent("spacing-specimen:change",{bubbles:!0,detail:{name:i,value:s,token:o,target:this.getAttribute("target")||":root"}}))}#n(){let t=this.getAttribute("target")||":root";try{return t===":root"?document.documentElement:document.querySelector(t)}catch{return document.documentElement}}};p("spacing-specimen",we);var Er="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",Sr="instant,fast,normal,slow,slower",Oi="ms-keyframes",Cr=`
|
|
1140
|
+
@keyframes ms-slide { from { inset-inline-start: 0 } to { inset-inline-start: calc(100% - 1rem) } }
|
|
1141
|
+
@keyframes ms-fill { 0% { transform: scaleX(0) } 60% { transform: scaleX(1) } 100% { transform: scaleX(1); opacity: 0.3 } }
|
|
1142
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1143
|
+
motion-specimen .ms-dot { animation: none !important; inset-inline-start: calc(50% - 0.5rem) !important }
|
|
1144
|
+
motion-specimen .ms-bar-fill { animation: none !important; transform: scaleX(0.6) !important; opacity: 0.6 !important }
|
|
1145
|
+
}
|
|
1146
|
+
`;function $r(){if(typeof document>"u"||document.getElementById(Oi))return;let r=document.createElement("style");r.id=Oi,r.textContent=Cr,document.head.append(r)}var Fi="var(--font-mono, monospace)",Hi="var(--color-text-muted, #666)",Ui="var(--color-interactive, oklch(55% 0.2 260))",Vi="var(--color-surface-sunken, #f1f1f1)",ke=class extends m{static observedAttributes=["type","tokens","prefix","duration","show-values","label"];setup(){$r(),this.#t()}attributeChangedCallback(){this.isConnected&&this.hasAttribute("data-upgraded")&&this.#t()}#t(){let t=this.getAttribute("type")||"easing",e=this.getAttribute("duration")||"1.2s",i=this.getAttribute("show-values")!=="false",s=this.getAttribute("label")||"",n="";s&&(n+=`<p style="font-weight:600;margin:0 0 var(--size-s,0.75rem)">${s}</p>`),(t==="easing"||t==="both")&&(n+=this.#s(e,i)),(t==="duration"||t==="both")&&(t==="both"&&(n+='<div aria-hidden="true" style="block-size:var(--size-m,1rem)"></div>'),n+=this.#a(i)),this.innerHTML=n,i&&requestAnimationFrame(()=>this.#o())}#e(){return"display:grid;grid-template-columns:5rem 1fr auto;align-items:center;gap:var(--size-s,0.75rem);min-block-size:1.75rem"}#i(){return`font-family:${Fi};font-size:var(--font-size-sm,0.875rem);color:${Hi};text-align:end`}#n(){return`font-family:${Fi};font-size:var(--font-size-xs,0.75rem);color:${Hi};font-variant-numeric:tabular-nums;white-space:nowrap`}#r(){return"list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--size-2xs,0.375rem)"}#s(t,e){let i=(this.getAttribute("tokens")||Er).split(",").map(l=>l.trim()),s=this.getAttribute("prefix")||"--ease-",n=`position:relative;display:block;block-size:0.5rem;background:${Vi};border-radius:999px`,o=`position:absolute;inset-block-start:50%;inset-inline-start:0;inline-size:1rem;block-size:1rem;background:${Ui};border-radius:50%;transform:translateY(-50%)`,a=i.map(l=>{let c=`${s}${l}`;return`<li class="ms-row ms-row-ease" role="listitem" style="${this.#e()}">
|
|
1147
|
+
<span style="${this.#i()}">${l}</span>
|
|
1148
|
+
<span style="${n}" aria-hidden="true">
|
|
1149
|
+
<span class="ms-dot" style="${o};animation: ms-slide ${t} var(${c}) infinite alternate"></span>
|
|
1150
|
+
</span>
|
|
1151
|
+
${e?`<span class="ms-value" data-var="${c}" style="${this.#n()}"></span>`:""}
|
|
1152
|
+
</li>`}).join("");return`<ul class="ms-list" role="list" aria-label="Easing scale" style="${this.#r()}">${a}</ul>`}#a(t){let e=(this.getAttribute("tokens")||Sr).split(",").map(a=>a.trim()),i=this.getAttribute("prefix")||"--duration-",s=`position:relative;display:block;block-size:0.5rem;background:${Vi};border-radius:999px;overflow:hidden`,n=`position:absolute;inset-block:0;inset-inline-start:0;inline-size:100%;background:${Ui};transform-origin:left center;animation-name:ms-fill;animation-iteration-count:infinite;animation-timing-function:linear`,o=e.map(a=>{let l=`${i}${a}`;return`<li class="ms-row ms-row-dur" role="listitem" style="${this.#e()}">
|
|
1153
|
+
<span style="${this.#i()}">${a}</span>
|
|
1154
|
+
<span style="${s}" aria-hidden="true">
|
|
1155
|
+
<span class="ms-bar-fill" style="${n};animation-duration: var(${l})"></span>
|
|
1156
|
+
</span>
|
|
1157
|
+
${t?`<span class="ms-value" data-var="${l}" style="${this.#n()}"></span>`:""}
|
|
1158
|
+
</li>`}).join("");return`<ul class="ms-list" role="list" aria-label="Duration scale" style="${this.#r()}">${o}</ul>`}#o(){this.querySelectorAll(".ms-value").forEach(t=>{let e=t.getAttribute("data-var");if(!e)return;let i=getComputedStyle(this).getPropertyValue(e).trim();t.textContent=i||"\u2014"})}};p("motion-specimen",ke);var Tr="--color-,--hue-,--lightness-,--chroma-,--font-,--size-,--radius-,--shadow-,--border-width-,--ease-,--duration-",Lr=["type-specimen:change","spacing-specimen:change","token-specimen:change","semantic-palette:change"],xe=class extends m{static observedAttributes=["scope","selector","include","format","label","live"];setup(){this.#r(),this.#s(),this.#a(),this.#c()}attributeChangedCallback(){this.isConnected&&this.hasAttribute("data-upgraded")&&(this.#r(),this.#s(),this.#a(),this.#c())}#t(){let t=this.getAttribute("scope")||":root";try{return t===":root"?document.documentElement:document.querySelector(t)}catch{return document.documentElement}}#e(){return(this.getAttribute("include")||Tr).split(",").map(e=>e.trim()).filter(Boolean)}#i(){let t=this.#t();if(!t)return[];let e=this.#e(),i=t.style,s=[];for(let n=0;n<i.length;n++){let o=i.item(n);if(!o.startsWith("--")||!e.some(l=>o.startsWith(l)))continue;let a=i.getPropertyValue(o).trim();a&&s.push([o,a])}return s}#n(t){if((this.getAttribute("format")||"css")==="json"){let n=Object.fromEntries(t);return JSON.stringify(n,null,2)}let i=this.getAttribute("selector")||":root";if(!t.length)return`${i} {
|
|
1159
|
+
/* No theme overrides detected yet. Edit a specimen to populate. */
|
|
1160
|
+
}
|
|
1161
|
+
`;let s=t.map(([n,o])=>` ${n}: ${o};`).join(`
|
|
1162
|
+
`);return`${i} {
|
|
1163
|
+
${s}
|
|
1164
|
+
}
|
|
1165
|
+
`}#r(){let t=this.getAttribute("label")||"",e=t?`<p style="font-weight:600;margin:0 0 var(--size-xs,0.5rem)">${t}</p>`:"",i="display:flex;gap:var(--size-2xs,0.375rem);margin-block-end:var(--size-xs,0.5rem)",s="padding:0.375rem 0.75rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface,#fff);color:var(--color-text,#222);cursor:pointer;font:inherit;font-size:var(--font-size-xs,0.75rem)",n="inline-size:100%;block-size:16rem;padding:var(--size-s,0.75rem);border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface-sunken,#f8f8f8);color:var(--color-text,#222);font-family:var(--font-mono,monospace);font-size:var(--font-size-xs,0.75rem);white-space:pre;overflow:auto;tab-size:2;resize:vertical;box-sizing:border-box";this.innerHTML=`
|
|
1166
|
+
${e}
|
|
1167
|
+
<div class="te-toolbar" style="${i}">
|
|
1168
|
+
<button type="button" class="te-refresh" style="${s}" aria-label="Refresh">Refresh</button>
|
|
1169
|
+
<button type="button" class="te-copy" style="${s}">Copy</button>
|
|
1170
|
+
<button type="button" class="te-download" style="${s}">Download</button>
|
|
1171
|
+
<span class="te-count" style="align-self:center;font-size:var(--font-size-xs,0.75rem);color:var(--color-text-muted,#666);margin-inline-start:auto"></span>
|
|
1172
|
+
</div>
|
|
1173
|
+
<textarea class="te-output" readonly aria-label="Theme output" style="${n}"></textarea>
|
|
1174
|
+
`}#s(){let t=this.#i(),e=this.#n(t),i=this.querySelector(".te-output"),s=this.querySelector(".te-count");i&&(i.value=e),s&&(s.textContent=`${t.length} token${t.length===1?"":"s"}`),this.dispatchEvent(new CustomEvent("theme-export:change",{bubbles:!0,detail:{output:e,format:this.getAttribute("format")||"css",tokens:Object.fromEntries(t)}}))}#a(){let t=this.querySelector(".te-refresh"),e=this.querySelector(".te-copy"),i=this.querySelector(".te-download");t&&this.listen(t,"click",()=>this.#s()),e&&this.listen(e,"click",()=>{let s=this.querySelector(".te-output");if(!s)return;navigator.clipboard?.writeText(s.value);let n=e.textContent;e.textContent="Copied!",setTimeout(()=>{e.textContent=n},1500)}),i&&this.listen(i,"click",()=>this.#o())}#o(){let t=this.querySelector(".te-output");if(!t)return;let e=this.getAttribute("format")||"css",i=e==="json"?"json":"css",s=new Blob([t.value],{type:e==="json"?"application/json":"text/css"}),n=URL.createObjectURL(s),o=document.createElement("a");o.href=n,o.download=`theme.${i}`,o.click(),URL.revokeObjectURL(n)}#c(){if(this.hasAttribute("live"))for(let t of Lr)this.listen(document,t,()=>this.#s())}};p("theme-export",xe);var Ae=class extends m{#t=null;static get observedAttributes(){return["position"]}get#e(){return this.getAttribute("persist")||"banner"}get#i(){let t=this.getAttribute("expires");return t==="0"||t==="never"?0:t?parseInt(t,10):365}get#n(){let t=this.#i;return t>0?t*864e5:void 0}async setup(){if(this.#t=this.querySelector("dialog"),!this.#t)return!1;if(this.getAttribute("trigger")&&this.listen(document,"click",this.#c),await this.#l())return this.getAttribute("trigger")?this.hidden=!0:this.remove(),!1;this.#r()}#r(){(this.getAttribute("position")||"bottom")==="center"?(this.#t.showModal(),this.#t.addEventListener("cancel",this.#a)):this.#t.show(),this.addEventListener("click",this.#o)}#s(){this.#t.removeEventListener("cancel",this.#a),this.removeEventListener("click",this.#o),this.#t.close(),this.getAttribute("trigger")?this.hidden=!0:this.remove()}#a=t=>{t.preventDefault()};#o=async t=>{let e=t.target.closest("button[value]");if(!e)return;let i=e.value;if(!["accept","reject","save"].includes(i))return;let s=[...this.querySelectorAll('input[type="checkbox"]')],n={};i==="accept"?s.forEach(o=>{n[o.name]=!0}):i==="reject"?s.forEach(o=>{n[o.name]=!!o.disabled}):s.forEach(o=>{n[o.name]=o.checked}),await this.#h({preferences:n,action:i}),this.dispatchEvent(new CustomEvent("consent-banner:change",{bubbles:!0,detail:{preferences:n,action:i}})),this.#s()};#c=async t=>{let e=this.getAttribute("trigger");if(!e||!t.target.closest(e))return;t.preventDefault();let s=await this.#l();if(s?.preferences)for(let[n,o]of Object.entries(s.preferences)){let a=this.querySelector(`input[type="checkbox"][name="${CSS.escape(n)}"]`);a&&!a.disabled&&(a.checked=o)}this.hidden=!1,this.#r()};async#l(){let t=this.#n;return await T.get("consent",this.#e,t?{maxAge:t}:void 0)}async#h(t){await T.set("consent",this.#e,t)}static async reset(t="banner"){await T.remove("consent",t)}static async getConsent(t="banner"){return await T.get("consent",t)}};p("consent-banner",Ae);var Ee=class extends m{#t=null;#e=null;#i=[];#n="";#r=0;#s=null;#a=null;#o=null;#c=null;#l=!1;#h=!1;#f=0;#d=null;#u=null;#m=null;#b=null;#v=null;#p=null;#g=null;#y=!1;#w=null;#k=null;static get observedAttributes(){return["speed","voice","for"]}attributeChangedCallback(t,e,i){if(e!==i&&(t==="for"&&(this.stop(),this.#z()),(t==="speed"||t==="voice")&&this.#l&&this.#D(),t==="speed")){let s=this.#O(parseFloat(i)||1);this.#v&&(this.#v.value=String(s)),this.#p&&(this.#p.textContent=`${s}\xD7`)}}setup(){if(!("speechSynthesis"in window))return this.style.display="none",!1;this.getAttribute("variant")==="icon"?this.#T():this.#C(),this.#z(),this.#J(),this.#c=this.#G(),this.#c.then(t=>this.#tt(t)),this.listen(window,"beforeunload",this.#et)}teardown(){this.stop(),this.#Y(),this.#k&&(this.#k.remove(),this.#k=null),this.#w&&(this.#w.remove(),this.#w=null)}play(){if(this.#h){this.resume();return}this.#l||this.#I(0)}pause(){!this.#l||this.#h||(speechSynthesis.pause(),this.#h=!0,this.#X(!0),this.#B("text-reader:pause"))}resume(){this.#h&&(speechSynthesis.resume(),this.#h=!1,this.#X(!1),this.#B("text-reader:resume"))}stop(){speechSynthesis.cancel(),this.#U(),this.#B("text-reader:stop")}get voices(){return this.#c||this.#G()}get speaking(){return this.#l}get paused(){return this.#h}get progress(){return this.#n.length?Math.min(this.#r/this.#n.length,1):0}#C(){let t=document.createElement("div");t.setAttribute("part","controls"),t.setAttribute("role","group"),t.setAttribute("aria-label","Article reader");let e=this.#x("play",this.getAttribute("label-play")||"Play","\u25B6");e.addEventListener("click",()=>this.play());let i=this.#x("pause",this.getAttribute("label-pause")||"Pause","\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#x("stop",this.getAttribute("label-stop")||"Stop","\u23F9");s.disabled=!0,s.addEventListener("click",()=>this.stop());let n=document.createElement("select");n.setAttribute("aria-label","Voice");let o=document.createElement("option");o.textContent="Loading voices\u2026",n.append(o),n.addEventListener("change",()=>{this.#l&&this.#D()});let a=document.createElement("label");a.setAttribute("data-speed-group","");let l=document.createElement("span");l.setAttribute("data-speed-value","");let c=this.#O(parseFloat(this.getAttribute("speed")??"1")||1);l.textContent=`${c}\xD7`;let h=document.createElement("input");h.type="range",h.min="0.5",h.max="2",h.step="0.1",h.value=String(c),h.setAttribute("aria-label","Speed"),h.addEventListener("input",()=>{let u=parseFloat(h.value);l.textContent=`${u}\xD7`,this.#l&&this.#D()}),a.append(l,h),this.#A("icon-play",e),this.#A("icon-pause",i),this.#A("icon-stop",s),t.append(e,i,s,n,a),this.prepend(t),this.#g=t,this.#d=e,this.#u=i,this.#m=s,this.#b=n,this.#v=h,this.#p=l}#x(t,e,i){let s=document.createElement("button");return s.type="button",s.setAttribute("part",`button ${t}`),s.setAttribute("aria-label",e),s.textContent=i,s}#A(t,e){let i=this.querySelector(`[slot="${t}"]`);i&&(i.removeAttribute("slot"),e.textContent="",e.append(i))}#T(){this.#y=!0;for(let i of this.querySelectorAll(':scope > [part="trigger"]'))i.remove();let t=document.createElement("button");t.type="button",t.setAttribute("part","trigger"),t.setAttribute("aria-label","Article reader"),t.setAttribute("aria-pressed","false");let e=this.querySelector('[slot="icon-trigger"]');if(e)e.removeAttribute("slot"),t.append(e);else{let i=document.createElement("icon-wc");i.setAttribute("name","volume-2"),i.setAttribute("aria-hidden","true"),t.append(i)}t.addEventListener("click",()=>this.#S()),this.append(t),this.#w=t,this.#E()}#E(){let t=document.createElement("div");t.setAttribute("data-text-reader-toolbar",""),t.setAttribute("role","group"),t.setAttribute("aria-label","Reader controls"),t.hidden=!0;let e=this.#x("play",this.getAttribute("label-play")||"Play","\u25B6");e.addEventListener("click",()=>this.play());let i=this.#x("pause",this.getAttribute("label-pause")||"Pause","\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#x("stop",this.getAttribute("label-stop")||"Stop","\u23F9");s.addEventListener("click",()=>this.stop());let n=this.#x("speed-down","Slower","\u2212");n.addEventListener("click",()=>this.#R(-.1));let o=document.createElement("span");o.setAttribute("data-speed-value","");let a=this.#O(parseFloat(this.getAttribute("speed")??"1")||1);o.textContent=`${a}\xD7`;let l=this.#x("speed-up","Faster","+");l.addEventListener("click",()=>this.#R(.1)),this.#A("icon-play",e),this.#A("icon-pause",i),this.#A("icon-stop",s),t.append(e,i,s,n,o,l),document.body.append(t),this.#d=e,this.#u=i,this.#m=s,this.#p=o,this.#k=t,this.listen(document,"pointerdown",this.#j),this.listen(document,"keydown",this.#_)}#S(){if(!this.#l){this.play();return}this.#k?.hidden&&this.#$(),this.#h?this.resume():this.pause()}#$(){if(!this.#k||!this.#w)return;let t=this.#k;t.hidden=!1,t.style.visibility="hidden",requestAnimationFrame(()=>{this.#M(),t.style.visibility=""})}#L(){this.#k&&(this.#k.hidden=!0)}#M(){let t=this.#k,e=this.#w;if(!t||!e)return;let i=e.getBoundingClientRect(),s=t.offsetWidth,n=t.offsetHeight,o=8,a=8,l=i.top-n-o;l<a&&(l=i.bottom+o);let c=i.left+i.width/2-s/2,h=window.innerWidth-s-a;c=Math.max(a,Math.min(c,h)),t.style.top=`${l}px`,t.style.left=`${c}px`}#R(t){let e=parseFloat(this.getAttribute("speed")??"1")||1,i=this.#O(e+t);this.setAttribute("speed",String(i))}#j=t=>{!this.#k||this.#k.hidden||this.#k.contains(t.target)||this.#w?.contains(t.target)||this.#L()};#_=t=>{t.key==="Escape"&&this.#k&&!this.#k.hidden&&this.#L()};#z(){let t=this.getAttribute("for");if(!t){console.warn('<text-reader>: missing "for" attribute'),this.#P();return}if(this.#t=document.getElementById(t),!this.#t){console.warn(`<text-reader>: no element found with id="${t}"`),this.#P();return}this.#H(),this.#F()}#P(){this.#d&&(this.#d.disabled=!0),this.#m&&(this.#m.disabled=!0)}#F(){this.#d&&(this.#d.disabled=!1)}#H(){let t=this.#t;if(!t)return;let e=this.getAttribute("selectors")||"p,li",i=[...t.querySelectorAll(e)],s=o=>o.closest("pre")||o.closest("code")||o.closest('[aria-hidden="true"]');this.#i=[];let n=0;for(let o of i){if(s(o))continue;let a=o.textContent.trim();a&&(this.#i.push({element:o,text:a,speechStart:n,speechEnd:n+a.length}),n+=a.length+1)}this.#n=this.#i.map(o=>o.text).join(" ")}#I(t){if(!this.#n)return;let e=t>0?this.#n.slice(t):this.#n;if(!e.trim())return;let i=e.replace(/[<>]/g," "),s=new SpeechSynthesisUtterance(i);s.rate=this.#O(parseFloat(this.#v?.value??this.getAttribute("speed")??"1")||1);let n=this.#b?.selectedOptions[0];if(n?.dataset.voiceUri){let o=speechSynthesis.getVoices().find(a=>a.voiceURI===n.dataset.voiceUri);o&&(s.voice=o)}s.onboundary=o=>{if(o.name!=="word")return;let a=t+o.charIndex;this.#r=a;let l=o.charLength;if(!l){let h=this.#n.slice(a).match(/^\S+/);l=h?h[0].length:1}this.#Z(a,l),this.#B("text-reader:word",{word:this.#n.slice(a,a+l),charIndex:a,element:this.#W(a)?.element})},s.onend=()=>{let o=Date.now()-this.#f;this.#U(),this.#B("text-reader:end",{duration:o})},s.onerror=o=>{o.error==="interrupted"||o.error==="canceled"||(console.warn("<text-reader>: SpeechSynthesisUtterance error:",o.error),this.#U(),this.#B("text-reader:error",{error:o.error}))},this.#e=s,this.#l=!0,this.#h=!1,this.#f=Date.now(),this.#r=t,this.#K(!0),speechSynthesis.cancel(),speechSynthesis.speak(s),this.#q(),this.#B("text-reader:play",{voice:s.voice?.name,speed:s.rate})}#D(){let t=this.#r;speechSynthesis.cancel(),this.#N(),requestAnimationFrame(()=>this.#I(t))}#q(){this.#N(),this.#s=setInterval(()=>{if(!speechSynthesis.speaking){this.#N();return}speechSynthesis.pause(),speechSynthesis.resume()},1e4)}#N(){this.#s&&clearInterval(this.#s),this.#s=null}#J(){if(!CSS.highlights)return;let t=new CSSStyleSheet;t.replaceSync(`
|
|
1103
1175
|
::highlight(text-reader-word) {
|
|
1104
1176
|
background-color: var(--text-reader-highlight, Mark);
|
|
1105
1177
|
color: var(--text-reader-highlight-text, MarkText);
|
|
1106
1178
|
}
|
|
1107
|
-
`),this.#o=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#L(){let t=this.#o;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#o=null),this.#j()}#M(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#B(t);if(!i)return;let s=t-i.speechStart,n=this.#I(i.element,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#a=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;(a.top<0||a.bottom>l)&&i.element.scrollIntoView({behavior:"smooth",block:"nearest"})}}#j(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#a=null}#B(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#I(t,e,i){let s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),n=0;for(;s.nextNode();){let o=s.currentNode,a=o.textContent??"";if(!a.trim())continue;let l=a.length;if(n+l>e){let c=e-n,h=document.createRange();h.setStart(o,Math.min(c,l));let u=c+i;return u<=l?h.setEnd(o,u):h.setEnd(o,l),h}n+=l}return null}async#D(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#O(t){if(!this.#b||!t.length)return;let e=this.#b;e.innerHTML="";let i=document.documentElement.lang||"en",s=t.filter(l=>l.lang.startsWith(i)),n=t.filter(l=>!l.lang.startsWith(i)),o=[...s,...n],a=this.getAttribute("voice");for(let l of o){let c=document.createElement("option");c.textContent=`${l.name} (${l.lang})`,c.dataset.voiceUri=l.voiceURI,a&&l.voiceURI===a&&(c.selected=!0),e.append(c)}if(!a){let l=s.find(c=>c.default)||s[0];if(l){let c=[...e.options].find(h=>h.dataset.voiceUri===l.voiceURI);c&&(c.selected=!0)}}}#q(t){!this.#p||!this.#h||!this.#y||(t?(this.#p.hidden=!0,this.#h.hidden=!1,this.#y.disabled=!1):(this.#p.hidden=!1,this.#h.hidden=!0,this.#y.disabled=!0))}#F(t){!this.#p||!this.#h||(this.#p.hidden=!t,this.#h.hidden=t)}#z(){this.#l=!1,this.#c=!1,this.#n=0,this.#e=null,this.#T(),this.#j(),this.#q(!1)}#R(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#P(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#H=()=>{speechSynthesis.cancel()}};m("text-reader",Vt);function Ut(r){if(!r||typeof r!="string")return"";let t=document.createElement("template");return t.innerHTML=r,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(s=>s.remove()),t.content.querySelectorAll("*").forEach(s=>{for(let n of[...s.attributes]){if(n.name.startsWith("on")){s.removeAttribute(n.name);continue}if(["href","src","action","formaction","xlink:href"].includes(n.name)){let o=n.value.trim().toLowerCase();(o.startsWith("javascript:")||o.startsWith("data:text/html"))&&s.removeAttribute(n.name);continue}(n.name==="srcdoc"||n.name==="data"&&s.tagName==="OBJECT")&&s.removeAttribute(n.name)}}),t.innerHTML}var Gt=class extends f{#t=null;#e=null;#i=null;#r=new Map;#n=null;setup(){this.#s(),this.#o(),this.#l(),this.#a(),this.#d(),this.#c()}teardown(){}#s(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#o(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#r=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#a(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#u(t)}#u(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#r.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#l(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#c(){this.listen(this,"chat-input:send",this.#m),this.#i&&this.listen(this.#i,"change",this.#p)}#m=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#h("user",e,"user");this.#t.appendChild(i),this.#f(),this.#d();let s=this.#g(),n=this.#y(s);this.#t.appendChild(n),this.#f(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o)try{let a=await this.#v(o,e);this.#b(n,a)}catch(a){this.#b(n,"<p>Sorry, something went wrong.</p>"),n.setAttribute("data-status","error"),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:a.message,status:a.status??0}}))}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.#e.focus()),this.#f()};#p=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#h(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#u(s));let n=document.createElement("chat-bubble");if(e.includes("<"))n.innerHTML=Ut(e);else{let o=document.createElement("p");o.textContent=e,n.appendChild(o)}return s.appendChild(n),s}#y(t){let e=document.createElement("chat-message");if(e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing"),t){e.setAttribute("data-from",t),this.#u(e);let o=this.#r.get(t)?.name??t;e.setAttribute("aria-label",`${o} is typing`)}else e.setAttribute("aria-label","Agent is typing");let i=this.getAttribute("model");i&&e.setAttribute("data-model",i);let s=document.createElement("chat-bubble");return e.appendChild(s),e}#b(t,e){let i=t.querySelector("chat-bubble");i&&(i.innerHTML=Ut(e)),t.removeAttribute("data-status"),t.removeAttribute("aria-label")}#g(){for(let[t,e]of this.#r)if(e.role==="agent")return t;return null}#d(){if(!this.#t)return;this.#t.querySelector("chat-message")!==null?(this.#n&&(this.#n.remove(),this.#n=null),this.#t.hidden=!1):(this.#t.hidden=!0,this.#n||(this.#n=document.createElement("p"),this.#n.setAttribute("data-chat-empty",""),this.#n.textContent=this.getAttribute("empty-message")||"Send a message to start.",this.#t.insertAdjacentElement("afterend",this.#n)))}#f(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}async#v(t,e){let i={message:e,model:this.getAttribute("model")||void 0},s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.ok){let o=new Error(`Chat request failed: ${s.status}`);throw o.status=s.status,o}let n=await s.json();return n.html??n.message??n.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#r}set participants(t){this.#r=t instanceof Map?t:new Map(Object.entries(t)),this.#a()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#d()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#h(t,e,i);this.#t.appendChild(s),this.#f(),this.#d()}};m("chat-window",Gt);var Wt=class extends f{static formAssociated=!0;#t;#e;#i;#r;constructor(){super(),this.#t=this.attachInternals()}setup(){if(this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),!this.#e)return!1;this.listen(this.#e,"keydown",this.#n),this.listen(this.#e,"input",this.#s),this.#i&&this.listen(this.#i,"click",this.#o),this.#u(),this.#l(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e.focus())}teardown(){clearTimeout(this.#r)}#n=t=>{switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#a());break;case"Escape":t.preventDefault(),this.reset();break}};#s=()=>{this.#u(),this.#l(),clearTimeout(this.#r),this.#r=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#o=t=>{t.preventDefault(),this.#a()};#a(){let t=this.value.trim(),e=parseInt(this.getAttribute("minlength")??"1",10)||1;t.length<e||this.disabled||(this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:t,from:null,model:null}})),this.reset())}#u(){let t=this.value;t?this.#t.setFormValue(t):this.#t.setFormValue(null)}#l(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#u(),this.#l())}get value(){return this.#e?.value??""}set value(t){this.#e&&(this.#e.value=t,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#u(),this.#l())}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?(this.setAttribute("disabled",""),this.#e&&(this.#e.disabled=!0),this.#i&&(this.#i.disabled=!0)):(this.removeAttribute("disabled"),this.#e&&(this.#e.disabled=!1),this.#i&&(this.#i.disabled=!1))}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#u(),this.#l())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,i){if(t==="disabled"){let s=i!==null;this.#e&&(this.#e.disabled=s),this.#i&&(this.#i.disabled=s)}}};m("chat-input",Wt);var st="http://www.w3.org/2000/svg";function ss(r){return r.trim().split(/[\s,]+/).map(Number)}function rs(r,t){let e=ss(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function ns(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(st,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(st,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(st,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function os(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var Kt=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},Xt=class extends f{#t=null;#e=null;#i=null;#r=[];#n=[];#s=null;#o=null;#a=null;setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}this.#t.classList.add("image-map-img"),this.#t.complete?this.#u():this.#t.addEventListener("load",()=>this.#u(),{once:!0})}teardown(){this.#o?.disconnect(),this.#c(),this.#e?.remove(),this.#i?.remove();for(let t of this.#n)t.anchor?.remove();this.#n=[],this.#r=[]}#u(){let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0){this.setAttribute("data-upgraded","");return}this.#e=document.createElementNS(st,"svg"),this.#e.setAttribute("viewBox","0 0 100 100"),this.#e.setAttribute("preserveAspectRatio","none"),this.#e.setAttribute("aria-hidden","true"),this.#e.classList.add("image-map-overlay"),this.#i=document.createElement("div"),this.#i.className="image-map-tooltip",this.#i.setAttribute("role","tooltip"),this.#i.setAttribute("aria-live","polite"),this.#i.id=`imap-tip-${crypto.randomUUID().slice(0,8)}`;for(let e of t){let i=e,s=i.shape,n=i.coords,o=rs(s,n),a=ns(o);if(!a)continue;let l=os(o),c=i.href?document.createElement("a"):document.createElement("button");i.href&&(c.href=i.href,i.target&&(c.target=i.target)),c.className="image-map-anchor",c.setAttribute("aria-label",i.label),c.setAttribute("aria-describedby",this.#i.id),c.textContent=i.label,c.style.left=`${l.x}%`,c.style.top=`${l.y}%`,c.style.width=`${l.width}%`,c.style.height=`${l.height}%`,i.disabled&&(a.setAttribute("data-disabled",""),c.setAttribute("tabindex","-1"),c.setAttribute("aria-disabled","true"));let h=e.innerHTML,u={area:e,parsed:o,svgShape:a,anchor:c,contentHTML:h};if(!i.disabled){let d=i.tooltipMode;this.listen(a,"pointerenter",()=>{d==="hover"&&this.#l(u),a.setAttribute("data-hover",""),this.#h("image-map:area-enter",i)}),this.listen(a,"pointerleave",()=>{d==="hover"&&this.#c(),a.removeAttribute("data-hover"),this.#h("image-map:area-leave",i)}),this.listen(a,"click",()=>{d==="click"&&(this.#s===u?this.#c():this.#l(u)),this.#h("image-map:area-activate",i),i.href&&d!=="click"&&(i.target==="_blank"?window.open(i.href,"_blank","noopener"):window.location.href=i.href)}),this.listen(a,"touchstart",p=>{d==="hover"&&(this.#a!==u?(p.preventDefault(),this.#a=u,this.#l(u)):this.#a=null)},{passive:!1}),this.listen(c,"focus",()=>{this.#l(u),a.setAttribute("data-hover","")}),this.listen(c,"blur",()=>{this.#c(),a.removeAttribute("data-hover")})}this.#e.appendChild(a),this.#n.push(u),this.#r.push(c)}this.appendChild(this.#e);for(let e of this.#r)this.appendChild(e);this.appendChild(this.#i),this.listen(this,"keydown",this.#p),this.#o=new ResizeObserver(()=>{this.#s&&this.#m(this.#s.svgShape)}),this.#o.observe(this.#t),this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.#t.alt||"Image map"),this.setAttribute("data-upgraded","")}#l(t){this.#i&&(this.#s=t,this.#i.innerHTML=t.contentHTML,this.#i.setAttribute("data-visible",""),this.#m(t.svgShape))}#c(){this.#i&&(this.#s=null,this.#i.removeAttribute("data-visible"))}#m(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#p=t=>{let e=this.#r.filter(s=>!s.hasAttribute("aria-disabled")),i=e.indexOf(document.activeElement);switch(t.key){case"ArrowDown":case"ArrowRight":{t.preventDefault();let s=i<e.length-1?i+1:0;e[s]?.focus();break}case"ArrowUp":case"ArrowLeft":{t.preventDefault();let s=i>0?i-1:e.length-1;e[s]?.focus();break}case"Escape":this.#c(),this.#a=null;break}};#h(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{area:e},bubbles:!0}))}};m("map-area",Kt);m("image-map",Xt);var as='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',ls={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},Jt=class extends f{#t;#e;setup(){if(this.#t=this.getAttribute("video-id"),this.#e=this.getAttribute("title")??"Play video",!this.#t)return console.warn("youtube-player: missing required video-id attribute"),!1;this.hasAttribute("autoplay")?this.#a():this.#n()}#i(){let t=new URLSearchParams({autoplay:"1"}),e=this.getAttribute("start");e&&t.set("start",e);let i=this.getAttribute("list");return i&&t.set("list",i),this.getAttribute("params")&&new URLSearchParams(this.getAttribute("params")).forEach((s,n)=>t.set(n,s)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#r(){let t=this.getAttribute("thumbnail")??"hq";return`https://i.ytimg.com/vi/${this.#t}/${ls[t]??"hqdefault"}.jpg`}#n(){this.setAttribute("state","ready"),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",`Play ${this.#e}`),this.innerHTML=`<img src="${this.#r()}" alt="" loading="lazy" decoding="async"><button type="button" aria-label="Play ${this.#e}">${as}</button>`,this.addEventListener("click",this.#s,{once:!0}),this.addEventListener("keydown",this.#o)}#s=()=>{this.removeEventListener("keydown",this.#o),this.#a()};#o=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.removeEventListener("click",this.#s),this.#a())};#a(){this.setAttribute("state","active"),this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.innerHTML=`<iframe src="${this.#i()}" title="${this.#e}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"></iframe>`,this.querySelector("iframe")?.focus()}};m("youtube-player",Jt);var rt=CSS.supports("anchor-name","--x"),Ie=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,Yt=class extends HTMLElement{get target(){return this.dataset.target}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}},Zt=class r extends f{#t=[];#e=0;#i=!1;#r=null;#n=null;#s=null;#o=null;#a=null;#u=null;#l=null;#c=null;static#m=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target.closest(`[data-tour="${this.id}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#B();e?.complete||e?.skipped?this.setAttribute("data-complete",""):setTimeout(()=>this.start(e?.step??0),400)}}teardown(){this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.#v(s)}}start(t=0){r.#m&&r.#m!==this&&r.#m.stop(),this.#a=document.activeElement,this.#i=!0,r.#m=this,this.#p(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#_("tour:start",{step:t}),this.#v(t)}stop(){this.#N(),this.#i=!1,this.removeAttribute("data-active"),r.#m===this&&(r.#m=null)}next(){!this.#i||this.#s?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting")||(this.#e<this.#t.length-1?this.#v(this.#e+1,"next"):this.#x())}prev(){this.#i&&this.#e>0&&this.#v(this.#e-1,"prev")}goto(t){this.#i&&t>=0&&t<this.#t.length&&this.#v(t)}skip(){!this.#i||(this.dataset.mode??"passive")==="forced"||(this.#_("tour:skip",{step:this.#e}),this.#j({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#I(),this.removeAttribute("data-complete"),this.dataset.step="0"}#p(){this.#r=document.createElement("div"),this.#r.className="page-tour-backdrop",this.#r.setAttribute("aria-hidden","true"),this.#r.addEventListener("click",()=>{(this.dataset.mode??"passive")!=="forced"&&this.skip()}),this.#n=document.createElement("div"),this.#n.className="page-tour-spotlight",this.#n.setAttribute("aria-hidden","true"),this.#s=document.createElement("div"),this.#s.className="page-tour-card",this.#s.setAttribute("popover","manual"),this.#s.setAttribute("role","dialog"),this.#s.setAttribute("aria-modal","true"),this.#s.setAttribute("aria-label",this.dataset.title??"Page Tour"),this.#s.addEventListener("keydown",t=>this.#E(t)),this.#s.addEventListener("click",t=>this.#A(t)),this.#o=document.createElement("div"),this.#o.setAttribute("aria-live","polite"),this.#o.setAttribute("aria-atomic","true"),this.#o.className="sr-only",this.#o.id=`page-tour-announcer-${crypto.randomUUID().slice(0,8)}`,this.append(this.#r,this.#n,this.#s,this.#o),this.#s.showPopover(),requestAnimationFrame(()=>{this.#r?.setAttribute("data-visible","")})}#h(t){let e=parseInt(this.dataset.spotlightPadding,10)||8,i=t.getBoundingClientRect();Object.assign(this.#n.style,{top:`${i.top-e}px`,left:`${i.left-e}px`,width:`${i.width+e*2}px`,height:`${i.height+e*2}px`})}#y(t,e){if(this.#s){if(rt){this.#b(t,e);return}this.#g(t,e)}}#b(t,e){let i="--tour-target";t.style.anchorName=i,this.#s.style.positionAnchor=i,this.#s.style.position="fixed",this.#s.style.top="",this.#s.style.left="",this.#s.style.bottom="",this.#s.style.right="";let s="var(--tour-card-offset, 0.75rem)";switch(e==="auto"?this.#d(t):e){case"bottom":this.#s.style.top="anchor(bottom)",this.#s.style.left="anchor(center)",this.#s.style.translate="0 calc("+s+")";break;case"top":this.#s.style.bottom="anchor(top)",this.#s.style.left="anchor(center)",this.#s.style.translate="0 calc(-1 * "+s+")";break;case"right":this.#s.style.left="anchor(right)",this.#s.style.top="anchor(center)",this.#s.style.translate=s+" 0";break;case"left":this.#s.style.right="anchor(left)",this.#s.style.top="anchor(center)",this.#s.style.translate="calc(-1 * "+s+") 0";break}}#g(t,e){let i=t.getBoundingClientRect(),s=12,n=8,o=e==="auto"?this.#d(t):e;this.#s.style.position="fixed",this.#s.style.visibility="hidden",this.#s.style.top="0",this.#s.style.left="0",this.#s.style.translate="";let a=this.#s.getBoundingClientRect();this.#s.style.visibility="";let l,c,h=parseInt(this.dataset.spotlightPadding,10)||8;switch(o){case"bottom":l=i.bottom+h+s,c=i.left+(i.width-a.width)/2;break;case"top":l=i.top-h-s-a.height,c=i.left+(i.width-a.width)/2;break;case"right":l=i.top+(i.height-a.height)/2,c=i.right+h+s;break;case"left":l=i.top+(i.height-a.height)/2,c=i.left-h-s-a.width;break}c=Math.max(n,Math.min(c,window.innerWidth-a.width-n)),l=Math.max(n,Math.min(l,window.innerHeight-a.height-n)),Object.assign(this.#s.style,{top:`${l}px`,left:`${c}px`,translate:""})}#d(t){let e=t.getBoundingClientRect(),i=window.innerWidth,n=window.innerHeight-e.bottom,o=e.top,a=i-e.right,l=e.left,c=Math.max(n,o,a,l);return c===n?"bottom":c===o?"top":c===a?"right":"left"}#f(t,e){let i=this.#t.length,s=e===i-1,n=e===0,a=(this.dataset.mode??"passive")!=="forced",l=t.action!=="none";this.#s.innerHTML=`
|
|
1179
|
+
`),this.#a=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#Y(){let t=this.#a;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#a=null),this.#V()}#Z(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#W(t);if(!i)return;let s=t-i.speechStart,n=this.#Q(i.element,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#o=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;(a.top<0||a.bottom>l)&&i.element.scrollIntoView({behavior:"smooth",block:"nearest"})}}#V(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#o=null}#W(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#Q(t,e,i){let s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),n=0;for(;s.nextNode();){let o=s.currentNode,a=o.textContent??"";if(!a.trim())continue;let l=a.length;if(n+l>e){let c=e-n,h=document.createRange();h.setStart(o,Math.min(c,l));let u=c+i;return u<=l?h.setEnd(o,u):h.setEnd(o,l),h}n+=l}return null}async#G(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#tt(t){if(!this.#b||!t.length)return;let e=this.#b;e.innerHTML="";let i=document.documentElement.lang||"en",s=t.filter(l=>l.lang.startsWith(i)),n=t.filter(l=>!l.lang.startsWith(i)),o=[...s,...n],a=this.getAttribute("voice");for(let l of o){let c=document.createElement("option");c.textContent=`${l.name} (${l.lang})`,c.dataset.voiceUri=l.voiceURI,a&&l.voiceURI===a&&(c.selected=!0),e.append(c)}if(!a){let l=s.find(c=>c.default)||s[0];if(l){let c=[...e.options].find(h=>h.dataset.voiceUri===l.voiceURI);c&&(c.selected=!0)}}}#K(t){!this.#d||!this.#u||!this.#m||(t?(this.#d.hidden=!0,this.#u.hidden=!1,this.#m.disabled=!1):(this.#d.hidden=!1,this.#u.hidden=!0,this.#m.disabled=!0),this.#y&&(this.#w&&this.#w.setAttribute("aria-pressed",String(t)),t?this.#$():this.#L()))}#X(t){!this.#d||!this.#u||(this.#d.hidden=!t,this.#u.hidden=t)}#U(){this.#l=!1,this.#h=!1,this.#r=0,this.#e=null,this.#N(),this.#V(),this.#K(!1)}#O(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#B(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#et=()=>{speechSynthesis.cancel()}};p("text-reader",Ee);function Se(r){if(!r||typeof r!="string")return"";let t=document.createElement("template");return t.innerHTML=r,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(s=>s.remove()),t.content.querySelectorAll("*").forEach(s=>{for(let n of[...s.attributes]){if(n.name.startsWith("on")){s.removeAttribute(n.name);continue}if(["href","src","action","formaction","xlink:href"].includes(n.name)){let o=n.value.trim().toLowerCase();(o.startsWith("javascript:")||o.startsWith("data:text/html"))&&s.removeAttribute(n.name);continue}(n.name==="srcdoc"||n.name==="data"&&s.tagName==="OBJECT")&&s.removeAttribute(n.name)}}),t.innerHTML}var Ce=class extends m{#t=null;#e=null;#i=null;#n=new Map;#r=null;setup(){this.#s(),this.#a(),this.#l(),this.#o(),this.#p(),this.#h()}teardown(){}#s(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#a(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#n=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#o(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#c(t)}#c(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#n.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#l(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#h(){this.listen(this,"chat-input:send",this.#f),this.#i&&this.listen(this.#i,"change",this.#d)}#f=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#u("user",e,"user");this.#t.appendChild(i),this.#g(),this.#p();let s=this.#v(),n=this.#m(s);this.#t.appendChild(n),this.#g(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o)try{let a=await this.#y(o,e);this.#b(n,a)}catch(a){this.#b(n,"<p>Sorry, something went wrong.</p>"),n.setAttribute("data-status","error"),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:a.message,status:a.status??0}}))}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.#e.focus()),this.#g()};#d=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#u(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#c(s));let n=document.createElement("chat-bubble");if(e.includes("<"))n.innerHTML=Se(e);else{let o=document.createElement("p");o.textContent=e,n.appendChild(o)}return s.appendChild(n),s}#m(t){let e=document.createElement("chat-message");if(e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing"),t){e.setAttribute("data-from",t),this.#c(e);let o=this.#n.get(t)?.name??t;e.setAttribute("aria-label",`${o} is typing`)}else e.setAttribute("aria-label","Agent is typing");let i=this.getAttribute("model");i&&e.setAttribute("data-model",i);let s=document.createElement("chat-bubble");return e.appendChild(s),e}#b(t,e){let i=t.querySelector("chat-bubble");i&&(i.innerHTML=Se(e)),t.removeAttribute("data-status"),t.removeAttribute("aria-label")}#v(){for(let[t,e]of this.#n)if(e.role==="agent")return t;return null}#p(){if(!this.#t)return;this.#t.querySelector("chat-message")!==null?(this.#r&&(this.#r.remove(),this.#r=null),this.#t.hidden=!1):(this.#t.hidden=!0,this.#r||(this.#r=document.createElement("p"),this.#r.setAttribute("data-chat-empty",""),this.#r.textContent=this.getAttribute("empty-message")||"Send a message to start.",this.#t.insertAdjacentElement("afterend",this.#r)))}#g(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}async#y(t,e){let i={message:e,model:this.getAttribute("model")||void 0},s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.ok){let o=new Error(`Chat request failed: ${s.status}`);throw o.status=s.status,o}let n=await s.json();return n.html??n.message??n.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#n}set participants(t){this.#n=t instanceof Map?t:new Map(Object.entries(t)),this.#o()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#p()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#u(t,e,i);this.#t.appendChild(s),this.#g(),this.#p()}};p("chat-window",Ce);var $e=class extends m{static formAssociated=!0;#t;#e;#i;#n;constructor(){super(),this.#t=this.attachInternals()}setup(){if(this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),!this.#e)return!1;this.listen(this.#e,"keydown",this.#r),this.listen(this.#e,"input",this.#s),this.#i&&this.listen(this.#i,"click",this.#a),this.#c(),this.#l(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e.focus())}teardown(){clearTimeout(this.#n)}#r=t=>{switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#o());break;case"Escape":t.preventDefault(),this.reset();break}};#s=()=>{this.#c(),this.#l(),clearTimeout(this.#n),this.#n=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#a=t=>{t.preventDefault(),this.#o()};#o(){let t=this.value.trim(),e=parseInt(this.getAttribute("minlength")??"1",10)||1;t.length<e||this.disabled||(this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:t,from:null,model:null}})),this.reset())}#c(){let t=this.value;t?this.#t.setFormValue(t):this.#t.setFormValue(null)}#l(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#c(),this.#l())}get value(){return this.#e?.value??""}set value(t){this.#e&&(this.#e.value=t,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#c(),this.#l())}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?(this.setAttribute("disabled",""),this.#e&&(this.#e.disabled=!0),this.#i&&(this.#i.disabled=!0)):(this.removeAttribute("disabled"),this.#e&&(this.#e.disabled=!1),this.#i&&(this.#i.disabled=!1))}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#c(),this.#l())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,i){if(t==="disabled"){let s=i!==null;this.#e&&(this.#e.disabled=s),this.#i&&(this.#i.disabled=s)}}};p("chat-input",$e);var Et="http://www.w3.org/2000/svg";function Mr(r){return r.trim().split(/[\s,]+/).map(Number)}function _r(r,t){let e=Mr(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function Rr(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(Et,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(Et,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(Et,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function Nr(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var Te=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},Le=class extends m{#t=null;#e=null;#i=null;#n=[];#r=[];#s=null;#a=null;#o=null;setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}this.#t.classList.add("image-map-img"),this.#t.complete?this.#c():this.#t.addEventListener("load",()=>this.#c(),{once:!0})}teardown(){this.#a?.disconnect(),this.#h(),this.#e?.remove(),this.#i?.remove();for(let t of this.#r)t.anchor?.remove();this.#r=[],this.#n=[]}#c(){let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0){this.setAttribute("data-upgraded","");return}this.#e=document.createElementNS(Et,"svg"),this.#e.setAttribute("viewBox","0 0 100 100"),this.#e.setAttribute("preserveAspectRatio","none"),this.#e.setAttribute("aria-hidden","true"),this.#e.classList.add("image-map-overlay"),this.#i=document.createElement("div"),this.#i.className="image-map-tooltip",this.#i.setAttribute("role","tooltip"),this.#i.setAttribute("aria-live","polite"),this.#i.id=`imap-tip-${crypto.randomUUID().slice(0,8)}`;for(let e of t){let i=e,s=i.shape,n=i.coords,o=_r(s,n),a=Rr(o);if(!a)continue;let l=Nr(o),c=i.href?document.createElement("a"):document.createElement("button");i.href&&(c.href=i.href,i.target&&(c.target=i.target)),c.className="image-map-anchor",c.setAttribute("aria-label",i.label),c.setAttribute("aria-describedby",this.#i.id),c.textContent=i.label,c.style.left=`${l.x}%`,c.style.top=`${l.y}%`,c.style.width=`${l.width}%`,c.style.height=`${l.height}%`,i.disabled&&(a.setAttribute("data-disabled",""),c.setAttribute("tabindex","-1"),c.setAttribute("aria-disabled","true"));let h=e.innerHTML,u={area:e,parsed:o,svgShape:a,anchor:c,contentHTML:h};if(!i.disabled){let d=i.tooltipMode;this.listen(a,"pointerenter",()=>{d==="hover"&&this.#l(u),a.setAttribute("data-hover",""),this.#u("image-map:area-enter",i)}),this.listen(a,"pointerleave",()=>{d==="hover"&&this.#h(),a.removeAttribute("data-hover"),this.#u("image-map:area-leave",i)}),this.listen(a,"click",()=>{d==="click"&&(this.#s===u?this.#h():this.#l(u)),this.#u("image-map:area-activate",i),i.href&&d!=="click"&&(i.target==="_blank"?window.open(i.href,"_blank","noopener"):window.location.href=i.href)}),this.listen(a,"touchstart",f=>{d==="hover"&&(this.#o!==u?(f.preventDefault(),this.#o=u,this.#l(u)):this.#o=null)},{passive:!1}),this.listen(c,"focus",()=>{this.#l(u),a.setAttribute("data-hover","")}),this.listen(c,"blur",()=>{this.#h(),a.removeAttribute("data-hover")})}this.#e.appendChild(a),this.#r.push(u),this.#n.push(c)}this.appendChild(this.#e);for(let e of this.#n)this.appendChild(e);this.appendChild(this.#i),this.listen(this,"keydown",this.#d),this.#a=new ResizeObserver(()=>{this.#s&&this.#f(this.#s.svgShape)}),this.#a.observe(this.#t),this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.#t.alt||"Image map"),this.setAttribute("data-upgraded","")}#l(t){this.#i&&(this.#s=t,this.#i.innerHTML=t.contentHTML,this.#i.setAttribute("data-visible",""),this.#f(t.svgShape))}#h(){this.#i&&(this.#s=null,this.#i.removeAttribute("data-visible"))}#f(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#d=t=>{let e=this.#n.filter(s=>!s.hasAttribute("aria-disabled")),i=e.indexOf(document.activeElement);switch(t.key){case"ArrowDown":case"ArrowRight":{t.preventDefault();let s=i<e.length-1?i+1:0;e[s]?.focus();break}case"ArrowUp":case"ArrowLeft":{t.preventDefault();let s=i>0?i-1:e.length-1;e[s]?.focus();break}case"Escape":this.#h(),this.#o=null;break}};#u(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{area:e},bubbles:!0}))}};p("map-area",Te);p("image-map",Le);var jr='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',zr={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},Me=class extends m{#t;#e;setup(){if(this.#t=this.getAttribute("video-id"),this.#e=this.getAttribute("title")??"Play video",!this.#t)return console.warn("youtube-player: missing required video-id attribute"),!1;this.hasAttribute("autoplay")?this.#o():this.#r()}#i(){let t=new URLSearchParams({autoplay:"1"}),e=this.getAttribute("start");e&&t.set("start",e);let i=this.getAttribute("list");return i&&t.set("list",i),this.getAttribute("params")&&new URLSearchParams(this.getAttribute("params")).forEach((s,n)=>t.set(n,s)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#n(){let t=this.getAttribute("thumbnail")??"hq";return`https://i.ytimg.com/vi/${this.#t}/${zr[t]??"hqdefault"}.jpg`}#r(){this.setAttribute("state","ready"),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",`Play ${this.#e}`),this.innerHTML=`<img src="${this.#n()}" alt="" loading="lazy" decoding="async"><button type="button" aria-label="Play ${this.#e}">${jr}</button>`,this.addEventListener("click",this.#s,{once:!0}),this.addEventListener("keydown",this.#a)}#s=()=>{this.removeEventListener("keydown",this.#a),this.#o()};#a=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.removeEventListener("click",this.#s),this.#o())};#o(){this.setAttribute("state","active"),this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.innerHTML=`<iframe src="${this.#i()}" title="${this.#e}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"></iframe>`,this.querySelector("iframe")?.focus()}};p("youtube-player",Me);var St=CSS.supports("anchor-name","--x"),Wi=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,_e=class extends HTMLElement{get target(){return this.dataset.target}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}},Re=class r extends m{#t=[];#e=0;#i=!1;#n=null;#r=null;#s=null;#a=null;#o=null;#c=null;#l=null;#h=null;static#f=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target.closest(`[data-tour="${this.id}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#z();e?.complete||e?.skipped?this.setAttribute("data-complete",""):setTimeout(()=>this.start(e?.step??0),400)}}teardown(){this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.#y(s)}}start(t=0){r.#f&&r.#f!==this&&r.#f.stop(),this.#o=document.activeElement,this.#i=!0,r.#f=this,this.#d(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#M("tour:start",{step:t}),this.#y(t)}stop(){this.#$(),this.#i=!1,this.removeAttribute("data-active"),r.#f===this&&(r.#f=null)}next(){!this.#i||this.#s?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting")||(this.#e<this.#t.length-1?this.#y(this.#e+1,"next"):this.#S())}prev(){this.#i&&this.#e>0&&this.#y(this.#e-1,"prev")}goto(t){this.#i&&t>=0&&t<this.#t.length&&this.#y(t)}skip(){!this.#i||(this.dataset.mode??"passive")==="forced"||(this.#M("tour:skip",{step:this.#e}),this.#_({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#P(),this.removeAttribute("data-complete"),this.dataset.step="0"}#d(){this.#n=document.createElement("div"),this.#n.className="page-tour-backdrop",this.#n.setAttribute("aria-hidden","true"),this.#n.addEventListener("click",()=>{(this.dataset.mode??"passive")!=="forced"&&this.skip()}),this.#r=document.createElement("div"),this.#r.className="page-tour-spotlight",this.#r.setAttribute("aria-hidden","true"),this.#s=document.createElement("div"),this.#s.className="page-tour-card",this.#s.setAttribute("popover","manual"),this.#s.setAttribute("role","dialog"),this.#s.setAttribute("aria-modal","true"),this.#s.setAttribute("aria-label",this.dataset.title??"Page Tour"),this.#s.addEventListener("keydown",t=>this.#k(t)),this.#s.addEventListener("click",t=>this.#x(t)),this.#a=document.createElement("div"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.#a.className="sr-only",this.#a.id=`page-tour-announcer-${crypto.randomUUID().slice(0,8)}`,this.append(this.#n,this.#r,this.#s,this.#a),this.#s.showPopover(),requestAnimationFrame(()=>{this.#n?.setAttribute("data-visible","")})}#u(t){let e=parseInt(this.dataset.spotlightPadding,10)||8,i=t.getBoundingClientRect();Object.assign(this.#r.style,{top:`${i.top-e}px`,left:`${i.left-e}px`,width:`${i.width+e*2}px`,height:`${i.height+e*2}px`})}#m(t,e){if(this.#s){if(St){this.#b(t,e);return}this.#v(t,e)}}#b(t,e){let i="--tour-target";t.style.anchorName=i,this.#s.style.positionAnchor=i,this.#s.style.position="fixed",this.#s.style.top="",this.#s.style.left="",this.#s.style.bottom="",this.#s.style.right="";let s="var(--tour-card-offset, 0.75rem)";switch(e==="auto"?this.#p(t):e){case"bottom":this.#s.style.top="anchor(bottom)",this.#s.style.left="anchor(center)",this.#s.style.translate="0 calc("+s+")";break;case"top":this.#s.style.bottom="anchor(top)",this.#s.style.left="anchor(center)",this.#s.style.translate="0 calc(-1 * "+s+")";break;case"right":this.#s.style.left="anchor(right)",this.#s.style.top="anchor(center)",this.#s.style.translate=s+" 0";break;case"left":this.#s.style.right="anchor(left)",this.#s.style.top="anchor(center)",this.#s.style.translate="calc(-1 * "+s+") 0";break}}#v(t,e){let i=t.getBoundingClientRect(),s=12,n=8,o=e==="auto"?this.#p(t):e;this.#s.style.position="fixed",this.#s.style.visibility="hidden",this.#s.style.top="0",this.#s.style.left="0",this.#s.style.translate="";let a=this.#s.getBoundingClientRect();this.#s.style.visibility="";let l,c,h=parseInt(this.dataset.spotlightPadding,10)||8;switch(o){case"bottom":l=i.bottom+h+s,c=i.left+(i.width-a.width)/2;break;case"top":l=i.top-h-s-a.height,c=i.left+(i.width-a.width)/2;break;case"right":l=i.top+(i.height-a.height)/2,c=i.right+h+s;break;case"left":l=i.top+(i.height-a.height)/2,c=i.left-h-s-a.width;break}c=Math.max(n,Math.min(c,window.innerWidth-a.width-n)),l=Math.max(n,Math.min(l,window.innerHeight-a.height-n)),Object.assign(this.#s.style,{top:`${l}px`,left:`${c}px`,translate:""})}#p(t){let e=t.getBoundingClientRect(),i=window.innerWidth,n=window.innerHeight-e.bottom,o=e.top,a=i-e.right,l=e.left,c=Math.max(n,o,a,l);return c===n?"bottom":c===o?"top":c===a?"right":"left"}#g(t,e){let i=this.#t.length,s=e===i-1,n=e===0,a=(this.dataset.mode??"passive")!=="forced",l=t.action!=="none";this.#s.innerHTML=`
|
|
1108
1180
|
<div class="page-tour-progress" aria-hidden="true">
|
|
1109
1181
|
${this.#t.map((c,h)=>`
|
|
1110
1182
|
<span class="page-tour-pip" ${h===e?"data-active":""} ${h<e?"data-visited":""}></span>
|
|
@@ -1141,33 +1213,33 @@ var pi=Object.defineProperty;var ft=(r,t)=>()=>(r&&(t=r(r=0)),t);var we=(r,t)=>{
|
|
|
1141
1213
|
</button>
|
|
1142
1214
|
</nav>
|
|
1143
1215
|
</footer>
|
|
1144
|
-
`}#v(t,e="next"){if(this.#l?.abort(),this.#l=null,this.#e!==t){let c=this.#t[this.#e],h=c?document.querySelector(c.target):null;h&&(rt&&(h.style.anchorName=""),h.removeAttribute("data-tour-target"))}this.#$(),this.#e=t;let i=this.#t[t],s=document.querySelector(i.target);if(!s){console.warn(`[page-tour] Target "${i.target}" not found, skipping step ${t}`),e==="next"&&t<this.#t.length-1?this.#v(t+1,"next"):e==="prev"&&t>0&&this.#v(t-1,"prev");return}s.setAttribute("data-tour-target","");let n=Ie()?"instant":i.scrollBehavior;i.scrollBehavior!=="none"&&s.scrollIntoView({block:"nearest",behavior:n});let o=()=>{this.#h(s),this.#y(s,i.placement)};o(),setTimeout(o,Ie()?0:300),this.#f(i,t),this.#s.hasAttribute("tabindex")||this.#s.setAttribute("tabindex","-1"),this.#s.focus(),requestAnimationFrame(()=>{let c=this.#s?.querySelector(".page-tour-content h3, .page-tour-content h2, .page-tour-content h4");c?(c.hasAttribute("tabindex")||c.setAttribute("tabindex","-1"),c.focus()):this.#s?.querySelector('[data-action="next"]')?.focus()});let l=i.querySelector("h3, h2, h4")?.textContent??`Step ${t+1}`;this.#T(`Step ${t+1} of ${this.#t.length}: ${l}`),this.dataset.step=String(t),i.action!=="none"&&this.#w(i),this.#C(s),this.#j({step:t}),this.#i&&this.#_("tour:step",{step:t,target:s,direction:e})}#w(t){let e=document.querySelector(t.target);if(!e)return;let i=this.#s?.querySelector('[data-action="next"]'),s=new AbortController;this.#l=s;let o={click:"click",focus:"focus",input:"input",change:"change"}[t.action];o?e.addEventListener(o,()=>{i?.removeAttribute("data-waiting"),this.#s?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),this.#_("tour:action",{step:this.#e,action:t.action}),s.abort()},{signal:s.signal,once:!0}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i?.removeAttribute("data-waiting"),this.#s?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),s.abort()},{signal:s.signal,once:!0})}#E(t){let e=this.dataset.mode??"passive",s=this.#t[this.#e]?.action!=="none",o=this.#s?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting");switch(t.key){case"Escape":e!=="forced"&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":t.preventDefault(),s&&o||this.next();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.prev();break;case"Home":t.preventDefault(),this.goto(0);break;case"End":t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#S(t,s&&o);break}}#S(t,e){let i=[...this.#s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(c=>!c.disabled&&c.offsetParent!==null),s=[];if(e){let c=this.#t[this.#e],h=document.querySelector(c.target);h&&(s=(h.matches("input, select, textarea, button, [href], [tabindex]")?[h]:[...h.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')]).filter(d=>!d.disabled&&d.offsetParent!==null))}let n=[...i,...s];if(n.length===0)return;let o=n[0],a=n[n.length-1],l=document.activeElement;t.shiftKey?(l===o||!n.includes(l))&&(t.preventDefault(),a.focus()):(l===a||!n.includes(l))&&(t.preventDefault(),o.focus())}#A(t){let e=t.target.closest("[data-action]");if(!e)return;switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#C(t){this.#u=new ResizeObserver(()=>{this.#k(t)}),this.#u.observe(t),this.listen(window,"scroll",()=>this.#k(t),{passive:!0})}#$(){this.#u&&(this.#u.disconnect(),this.#u=null),this.#c&&(cancelAnimationFrame(this.#c),this.#c=null)}#k(t){this.#c||(this.#c=requestAnimationFrame(()=>{if(this.#c=null,!this.#i)return;this.#h(t);let e=this.#t[this.#e];rt||this.#g(t,e.placement)}))}#x(){this.#_("tour:complete",{steps:this.#t.length}),this.#j({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#N(){this.#l?.abort(),this.#l=null,this.#$();let t=this.#t[this.#e],e=t?document.querySelector(t.target):null;e&&(rt&&(e.style.anchorName=""),e.removeAttribute("data-tour-target")),this.#r?.remove(),this.#n?.remove(),this.#s?.hidePopover?.(),this.#s?.remove(),this.#o?.remove(),this.#r=null,this.#n=null,this.#s=null,this.#o=null,this.#a&&typeof this.#a.focus=="function"&&(this.#a.focus(),this.#a=null)}#T(t){this.#o&&(this.#o.textContent="",requestAnimationFrame(()=>{this.#o&&(this.#o.textContent=t)}))}#_(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#L(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#M(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#j(t){let e=this.#L();if(!e)return;let i=this.#M(),s={};try{s=JSON.parse(e.getItem(i))??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#B(){let t=this.#L();if(!t)return null;try{return JSON.parse(t.getItem(this.#M()))}catch{return null}}#I(){let t=this.#L();t&&t.removeItem(this.#M())}};m("page-tour",Zt);m("tour-step",Yt);function ie(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=ie();function Ue(r){q=r}var B={exec:()=>null};function b(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(E.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var cs=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),E={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},hs=/^(?:[ \t]*(?:\n|$))+/,us=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ds=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,J=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ps=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,se=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ge=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,We=b(Ge).replace(/bull/g,se).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ms=b(Ge).replace(/bull/g,se).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),re=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,fs=/^[^\n]+/,ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,gs=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bs=b(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,se).getRegex(),ct="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",oe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vs=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",oe).replace("tag",ct).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ke=b(re).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ct).getRegex(),ys=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ke).getRegex(),ae={blockquote:ys,code:us,def:gs,fences:ds,heading:ps,hr:J,html:vs,lheading:We,list:bs,newline:hs,paragraph:Ke,table:B,text:fs},qe=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ct).getRegex(),ws={...ae,lheading:ms,table:qe,paragraph:b(re).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ct).getRegex()},ks={...ae,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(re).replace("hr",J).replace("heading",` *#{1,6} *[^
|
|
1145
|
-
]`).replace("lheading",
|
|
1216
|
+
`}#y(t,e="next"){if(this.#l?.abort(),this.#l=null,this.#e!==t){let c=this.#t[this.#e],h=c?document.querySelector(c.target):null;h&&(St&&(h.style.anchorName=""),h.removeAttribute("data-tour-target"))}this.#T(),this.#e=t;let i=this.#t[t],s=document.querySelector(i.target);if(!s){console.warn(`[page-tour] Target "${i.target}" not found, skipping step ${t}`),e==="next"&&t<this.#t.length-1?this.#y(t+1,"next"):e==="prev"&&t>0&&this.#y(t-1,"prev");return}s.setAttribute("data-tour-target","");let n=Wi()?"instant":i.scrollBehavior;i.scrollBehavior!=="none"&&s.scrollIntoView({block:"nearest",behavior:n});let o=()=>{this.#u(s),this.#m(s,i.placement)};o(),setTimeout(o,Wi()?0:300),this.#g(i,t),this.#s.hasAttribute("tabindex")||this.#s.setAttribute("tabindex","-1"),this.#s.focus(),requestAnimationFrame(()=>{let c=this.#s?.querySelector(".page-tour-content h3, .page-tour-content h2, .page-tour-content h4");c?(c.hasAttribute("tabindex")||c.setAttribute("tabindex","-1"),c.focus()):this.#s?.querySelector('[data-action="next"]')?.focus()});let l=i.querySelector("h3, h2, h4")?.textContent??`Step ${t+1}`;this.#L(`Step ${t+1} of ${this.#t.length}: ${l}`),this.dataset.step=String(t),i.action!=="none"&&this.#w(i),this.#A(s),this.#_({step:t}),this.#i&&this.#M("tour:step",{step:t,target:s,direction:e})}#w(t){let e=document.querySelector(t.target);if(!e)return;let i=this.#s?.querySelector('[data-action="next"]'),s=new AbortController;this.#l=s;let o={click:"click",focus:"focus",input:"input",change:"change"}[t.action];o?e.addEventListener(o,()=>{i?.removeAttribute("data-waiting"),this.#s?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),this.#M("tour:action",{step:this.#e,action:t.action}),s.abort()},{signal:s.signal,once:!0}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i?.removeAttribute("data-waiting"),this.#s?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),s.abort()},{signal:s.signal,once:!0})}#k(t){let e=this.dataset.mode??"passive",s=this.#t[this.#e]?.action!=="none",o=this.#s?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting");switch(t.key){case"Escape":e!=="forced"&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":t.preventDefault(),s&&o||this.next();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.prev();break;case"Home":t.preventDefault(),this.goto(0);break;case"End":t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#C(t,s&&o);break}}#C(t,e){let i=[...this.#s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(c=>!c.disabled&&c.offsetParent!==null),s=[];if(e){let c=this.#t[this.#e],h=document.querySelector(c.target);h&&(s=(h.matches("input, select, textarea, button, [href], [tabindex]")?[h]:[...h.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')]).filter(d=>!d.disabled&&d.offsetParent!==null))}let n=[...i,...s];if(n.length===0)return;let o=n[0],a=n[n.length-1],l=document.activeElement;t.shiftKey?(l===o||!n.includes(l))&&(t.preventDefault(),a.focus()):(l===a||!n.includes(l))&&(t.preventDefault(),o.focus())}#x(t){let e=t.target.closest("[data-action]");if(!e)return;switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#A(t){this.#c=new ResizeObserver(()=>{this.#E(t)}),this.#c.observe(t),this.listen(window,"scroll",()=>this.#E(t),{passive:!0})}#T(){this.#c&&(this.#c.disconnect(),this.#c=null),this.#h&&(cancelAnimationFrame(this.#h),this.#h=null)}#E(t){this.#h||(this.#h=requestAnimationFrame(()=>{if(this.#h=null,!this.#i)return;this.#u(t);let e=this.#t[this.#e];St||this.#v(t,e.placement)}))}#S(){this.#M("tour:complete",{steps:this.#t.length}),this.#_({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#$(){this.#l?.abort(),this.#l=null,this.#T();let t=this.#t[this.#e],e=t?document.querySelector(t.target):null;e&&(St&&(e.style.anchorName=""),e.removeAttribute("data-tour-target")),this.#n?.remove(),this.#r?.remove(),this.#s?.hidePopover?.(),this.#s?.remove(),this.#a?.remove(),this.#n=null,this.#r=null,this.#s=null,this.#a=null,this.#o&&typeof this.#o.focus=="function"&&(this.#o.focus(),this.#o=null)}#L(t){this.#a&&(this.#a.textContent="",requestAnimationFrame(()=>{this.#a&&(this.#a.textContent=t)}))}#M(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#R(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#j(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#_(t){let e=this.#R();if(!e)return;let i=this.#j(),s={};try{s=JSON.parse(e.getItem(i))??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#z(){let t=this.#R();if(!t)return null;try{return JSON.parse(t.getItem(this.#j()))}catch{return null}}#P(){let t=this.#R();t&&t.removeItem(this.#j())}};p("page-tour",Re);p("tour-step",_e);function Pe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var G=Pe();function Qi(r){G=r}var V={exec:()=>null};function y(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(C.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var Pr=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),C={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},Br=/^(?:[ \t]*(?:\n|$))+/,qr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ir=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ut=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Be=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ts=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,es=y(ts).replace(/bull/g,Be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Or=y(ts).replace(/bull/g,Be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fr=/^[^\n]+/,Ie=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Hr=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ie).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ur=y(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Be).getRegex(),Mt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",De=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vr=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",De).replace("tag",Mt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),is=y(qe).replace("hr",ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mt).getRegex(),Wr=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",is).getRegex(),Oe={blockquote:Wr,code:qr,def:Hr,fences:Ir,heading:Dr,hr:ut,html:Vr,lheading:es,list:Ur,newline:Br,paragraph:is,table:V,text:Fr},Gi=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mt).getRegex(),Gr={...Oe,lheading:Or,table:Gi,paragraph:y(qe).replace("hr",ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mt).getRegex()},Kr={...Oe,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",De).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:V,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(qe).replace("hr",ut).replace("heading",` *#{1,6} *[^
|
|
1217
|
+
]`).replace("lheading",es).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ss=/^( {2,}|\\)\n(?!\s*$)/,Yr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tt=/[\p{P}\p{S}]/u,_t=/[\s\p{P}\p{S}]/u,Fe=/[^\s\p{P}\p{S}]/u,Zr=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_t).getRegex(),rs=/(?!~)[\p{P}\p{S}]/u,Qr=/(?!~)[\s\p{P}\p{S}]/u,tn=/(?:[^\s\p{P}\p{S}]|~)/u,en=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pr?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ns=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,sn=y(ns,"u").replace(/punct/g,tt).getRegex(),rn=y(ns,"u").replace(/punct/g,rs).getRegex(),os="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nn=y(os,"gu").replace(/notPunctSpace/g,Fe).replace(/punctSpace/g,_t).replace(/punct/g,tt).getRegex(),on=y(os,"gu").replace(/notPunctSpace/g,tn).replace(/punctSpace/g,Qr).replace(/punct/g,rs).getRegex(),an=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Fe).replace(/punctSpace/g,_t).replace(/punct/g,tt).getRegex(),ln=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,tt).getRegex(),cn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",hn=y(cn,"gu").replace(/notPunctSpace/g,Fe).replace(/punctSpace/g,_t).replace(/punct/g,tt).getRegex(),un=y(/\\(punct)/,"gu").replace(/punct/g,tt).getRegex(),dn=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pn=y(De).replace("(?:-->|$)","-->").getRegex(),mn=y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",pn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),$t=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,fn=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",$t).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),as=y(/^!?\[(label)\]\[(ref)\]/).replace("label",$t).replace("ref",Ie).getRegex(),ls=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ie).getRegex(),gn=y("reflink|nolink(?!\\()","g").replace("reflink",as).replace("nolink",ls).getRegex(),Ki=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,He={_backpedal:V,anyPunctuation:un,autolink:dn,blockSkip:en,br:ss,code:Jr,del:V,delLDelim:V,delRDelim:V,emStrongLDelim:sn,emStrongRDelimAst:nn,emStrongRDelimUnd:an,escape:Xr,link:fn,nolink:ls,punctuation:Zr,reflink:as,reflinkSearch:gn,tag:mn,text:Yr,url:V},bn={...He,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",$t).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$t).getRegex()},Ne={...He,emStrongRDelimAst:on,emStrongLDelim:rn,delLDelim:ln,delRDelim:hn,url:y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ki).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ki).getRegex()},vn={...Ne,br:y(ss).replace("{2,}","*").getRegex(),text:y(Ne.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ct={normal:Oe,gfm:Gr,pedantic:Kr},lt={normal:He,gfm:Ne,breaks:vn,pedantic:bn},yn={"&":"&","<":"<",">":">",'"':""","'":"'"},Xi=r=>yn[r];function B(r,t){if(t){if(C.escapeTest.test(r))return r.replace(C.escapeReplace,Xi)}else if(C.escapeTestNoEncode.test(r))return r.replace(C.escapeReplaceNoEncode,Xi);return r}function Ji(r){try{r=encodeURI(r).replace(C.percentDecode,"%")}catch{return null}return r}function Yi(r,t){let e=r.replace(C.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=e.split(C.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(C.slashPipe,"|");return i}function ct(r,t,e){let i=r.length;if(i===0)return"";let s=0;for(;s<i;){let n=r.charAt(i-s-1);if(n===t&&!e)s++;else if(n!==t&&e)s++;else break}return r.slice(0,i-s)}function wn(r,t){if(r.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<r.length;i++)if(r[i]==="\\")i++;else if(r[i]===t[0])e++;else if(r[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function kn(r,t=0){let e=t,i="";for(let s of r)if(s===" "){let n=4-e%4;i+=" ".repeat(n),e+=n}else i+=s,e++;return i}function Zi(r,t,e,i,s){let n=t.href,o=t.title||null,a=r[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:e,href:n,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function xn(r,t,e){let i=r.match(e.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
|
|
1146
1218
|
`).map(n=>{let o=n.match(e.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=s.length?n.slice(s.length):n}).join(`
|
|
1147
|
-
`)}var
|
|
1148
|
-
`)}}}fences(r){let t=this.rules.block.fences.exec(r);if(t){let e=t[0],i=
|
|
1149
|
-
`)}}blockquote(r){let t=this.rules.block.blockquote.exec(r);if(t){let e=
|
|
1219
|
+
`)}var Tt=class{options;rules;lexer;constructor(r){this.options=r||G}space(r){let t=this.rules.block.newline.exec(r);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(r){let t=this.rules.block.code.exec(r);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ct(e,`
|
|
1220
|
+
`)}}}fences(r){let t=this.rules.block.fences.exec(r);if(t){let e=t[0],i=xn(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(r){let t=this.rules.block.heading.exec(r);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let i=ct(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(r){let t=this.rules.block.hr.exec(r);if(t)return{type:"hr",raw:ct(t[0],`
|
|
1221
|
+
`)}}blockquote(r){let t=this.rules.block.blockquote.exec(r);if(t){let e=ct(t[0],`
|
|
1150
1222
|
`).split(`
|
|
1151
1223
|
`),i="",s="",n=[];for(;e.length>0;){let o=!1,a=[],l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))a.push(e[l]),o=!0;else if(!o)a.push(e[l]);else break;e=e.slice(l);let c=a.join(`
|
|
1152
1224
|
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
1153
1225
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
1154
1226
|
${c}`:c,s=s?`${s}
|
|
1155
|
-
${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,n,!0),this.lexer.state.top=u,e.length===0)break;let d=n.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let
|
|
1227
|
+
${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,n,!0),this.lexer.state.top=u,e.length===0)break;let d=n.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let f=d,g=f.raw+`
|
|
1156
1228
|
`+e.join(`
|
|
1157
|
-
`),v=this.blockquote(g);n[n.length-1]=v,i=i.substring(0,i.length-
|
|
1229
|
+
`),v=this.blockquote(g);n[n.length-1]=v,i=i.substring(0,i.length-f.raw.length)+v.raw,s=s.substring(0,s.length-f.text.length)+v.text;break}else if(d?.type==="list"){let f=d,g=f.raw+`
|
|
1158
1230
|
`+e.join(`
|
|
1159
|
-
`),v=this.list(g);n[n.length-1]=v,i=i.substring(0,i.length-d.raw.length)+v.raw,s=s.substring(0,s.length-
|
|
1160
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:n,text:s}}}list(r){let t=this.rules.block.list.exec(r);if(t){let e=t[1].trim(),i=e.length>1,s={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let n=this.rules.other.listItemRegex(e),o=!1;for(;r;){let l=!1,c="",h="";if(!(t=n.exec(r))||this.rules.block.hr.test(r))break;c=t[0],r=r.substring(c.length);let u=
|
|
1231
|
+
`),v=this.list(g);n[n.length-1]=v,i=i.substring(0,i.length-d.raw.length)+v.raw,s=s.substring(0,s.length-f.raw.length)+v.raw,e=g.substring(n.at(-1).raw.length).split(`
|
|
1232
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:n,text:s}}}list(r){let t=this.rules.block.list.exec(r);if(t){let e=t[1].trim(),i=e.length>1,s={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let n=this.rules.other.listItemRegex(e),o=!1;for(;r;){let l=!1,c="",h="";if(!(t=n.exec(r))||this.rules.block.hr.test(r))break;c=t[0],r=r.substring(c.length);let u=kn(t[2].split(`
|
|
1161
1233
|
`,1)[0],t[1].length),d=r.split(`
|
|
1162
|
-
`,1)[0],
|
|
1163
|
-
`,r=r.substring(d.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(g),
|
|
1164
|
-
`,1)[0],
|
|
1165
|
-
`+
|
|
1166
|
-
`+d}
|
|
1167
|
-
`,r=r.substring(
|
|
1168
|
-
`):[],n={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<e.length;o++)n.header.push({text:e[o],tokens:this.lexer.inline(e[o]),header:!0,align:n.align[o]});for(let o of s)n.rows.push(
|
|
1169
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(r){let t=this.rules.block.text.exec(r);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(r){let t=this.rules.inline.escape.exec(r);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(r){let t=this.rules.inline.tag.exec(r);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(r){let t=this.rules.inline.link.exec(r);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let n=
|
|
1170
|
-
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(
|
|
1234
|
+
`,1)[0],f=!u.trim(),g=0;if(this.options.pedantic?(g=2,h=u.trimStart()):f?g=t[1].length+1:(g=u.search(this.rules.other.nonSpaceChar),g=g>4?1:g,h=u.slice(g),g+=t[1].length),f&&this.rules.other.blankLine.test(d)&&(c+=d+`
|
|
1235
|
+
`,r=r.substring(d.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(g),b=this.rules.other.hrRegex(g),k=this.rules.other.fencesBeginRegex(g),S=this.rules.other.headingBeginRegex(g),N=this.rules.other.htmlBeginRegex(g),j=this.rules.other.blockquoteBeginRegex(g);for(;r;){let z=r.split(`
|
|
1236
|
+
`,1)[0],I;if(d=z,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),I=d):I=d.replace(this.rules.other.tabCharGlobal," "),k.test(d)||S.test(d)||N.test(d)||j.test(d)||v.test(d)||b.test(d))break;if(I.search(this.rules.other.nonSpaceChar)>=g||!d.trim())h+=`
|
|
1237
|
+
`+I.slice(g);else{if(f||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(u)||S.test(u)||b.test(u))break;h+=`
|
|
1238
|
+
`+d}f=!d.trim(),c+=z+`
|
|
1239
|
+
`,r=r.substring(z.length+1),u=I.slice(g)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),s.raw+=c}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let h={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=h.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=h.raw+l.tokens[0].raw,l.tokens[0].text=h.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(h)):l.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):l.tokens.unshift(h)}}if(!s.loose){let c=l.tokens.filter(u=>u.type==="space"),h=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=h}}if(s.loose)for(let l of s.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return s}}html(r){let t=this.rules.block.html.exec(r);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(r){let t=this.rules.block.def.exec(r);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:s}}}table(r){let t=this.rules.block.table.exec(r);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=Yi(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
1240
|
+
`):[],n={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<e.length;o++)n.header.push({text:e[o],tokens:this.lexer.inline(e[o]),header:!0,align:n.align[o]});for(let o of s)n.rows.push(Yi(o,n.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[l]})));return n}}lheading(r){let t=this.rules.block.lheading.exec(r);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(r){let t=this.rules.block.paragraph.exec(r);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
1241
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(r){let t=this.rules.block.text.exec(r);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(r){let t=this.rules.inline.escape.exec(r);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(r){let t=this.rules.inline.tag.exec(r);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(r){let t=this.rules.inline.link.exec(r);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let n=ct(e.slice(0,-1),"\\");if((e.length-n.length)%2===0)return}else{let n=wn(t[2],"()");if(n===-2)return;if(n>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(i);n&&(i=n[1],s=n[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),Zi(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(r,t){let e;if((e=this.rules.inline.reflink.exec(r))||(e=this.rules.inline.nolink.exec(r))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){let n=e[0].charAt(0);return{type:"text",raw:n,text:n}}return Zi(e,s,e[0],this.lexer,this.rules)}}emStrong(r,t,e=""){let i=this.rules.inline.emStrongLDelim.exec(r);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*r.length+s);(i=c.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(o=[...n].length,i[3]||i[4]){a+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...i[0]][0].length,u=r.slice(0,s+i.index+h+o);if(Math.min(s,o)%2){let f=u.slice(1,-1);return{type:"em",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}let d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){let t=this.rules.inline.code.exec(r);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),s=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&s&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(r){let t=this.rules.inline.br.exec(r);if(t)return{type:"br",raw:t[0]}}del(r,t,e=""){let i=this.rules.inline.delLDelim.exec(r);if(i&&(!i[1]||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*r.length+s);(i=l.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n||(o=[...n].length,o!==s))continue;if(i[3]||i[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...i[0]][0].length,h=r.slice(0,s+i.index+c+o),u=h.slice(s,-s);return{type:"del",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(r){let t=this.rules.inline.autolink.exec(r);if(t){let e,i;return t[2]==="@"?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(r){let t;if(t=this.rules.inline.url.exec(r)){let e,i;if(t[2]==="@")e=t[0],i="mailto:"+e;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);e=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(r){let t=this.rules.inline.text.exec(r);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},M=class je{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||G,this.options.tokenizer=this.options.tokenizer||new Tt,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 e={other:C,block:Ct.normal,inline:lt.normal};this.options.pedantic?(e.block=Ct.pedantic,e.inline=lt.pedantic):this.options.gfm&&(e.block=Ct.gfm,this.options.breaks?e.inline=lt.breaks:e.inline=lt.gfm),this.tokenizer.rules=e}static get rules(){return{block:Ct,inline:lt}}static lex(t,e){return new je(e).lex(t)}static lexInline(t,e){return new je(e).inlineTokens(t)}lex(t){t=t.replace(C.carriageReturn,`
|
|
1242
|
+
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(C.tabCharGlobal," ").replace(C.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},t,e))?(t=t.substring(s.raw.length),e.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let o=e.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
|
|
1171
1243
|
`:e.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let o=e.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
1172
1244
|
`)?"":`
|
|
1173
1245
|
`)+s.raw,o.text+=`
|
|
@@ -1180,9 +1252,9 @@ ${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
1180
1252
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(s),i=n.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let o=e.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
1181
1253
|
`)?"":`
|
|
1182
1254
|
`)+s.raw,o.text+=`
|
|
1183
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(s);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){this.tokenizer.lexer=this;let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))
|
|
1184
|
-
`;return i?'<pre><code class="language-'
|
|
1185
|
-
`:"<pre><code>"+(e?s
|
|
1255
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(s);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){this.tokenizer.lexer=this;let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)n=s[2]?s[2].length:0,i=i.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let o=!1,a="";for(;t;){o||(a=""),o=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,e))?(t=t.substring(l.raw.length),e.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=e.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):e.push(l);continue}if(l=this.tokenizer.emStrong(t,i,a)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.del(t,i,a)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),e.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),e.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},u),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),o=!0;let h=e.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):e.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return e}},Lt=class{options;parser;constructor(r){this.options=r||G}space(r){return""}code({text:r,lang:t,escaped:e}){let i=(t||"").match(C.notSpaceStart)?.[0],s=r.replace(C.endingNewline,"")+`
|
|
1256
|
+
`;return i?'<pre><code class="language-'+B(i)+'">'+(e?s:B(s,!0))+`</code></pre>
|
|
1257
|
+
`:"<pre><code>"+(e?s:B(s,!0))+`</code></pre>
|
|
1186
1258
|
`}blockquote({tokens:r}){return`<blockquote>
|
|
1187
1259
|
${this.parser.parse(r)}</blockquote>
|
|
1188
1260
|
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:t}){return`<h${t}>${this.parser.parseInline(r)}</h${t}>
|
|
@@ -1198,27 +1270,32 @@ ${this.parser.parse(r)}</blockquote>
|
|
|
1198
1270
|
`}tablerow({text:r}){return`<tr>
|
|
1199
1271
|
${r}</tr>
|
|
1200
1272
|
`}tablecell(r){let t=this.parser.parseInline(r.tokens),e=r.header?"th":"td";return(r.align?`<${e} align="${r.align}">`:`<${e}>`)+t+`</${e}>
|
|
1201
|
-
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${
|
|
1202
|
-
Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error occurred:</p><pre>"
|
|
1273
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${B(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:t,tokens:e}){let i=this.parser.parseInline(e),s=Ji(r);if(s===null)return i;r=s;let n='<a href="'+r+'"';return t&&(n+=' title="'+B(t)+'"'),n+=">"+i+"</a>",n}image({href:r,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let s=Ji(r);if(s===null)return B(e);r=s;let n=`<img src="${r}" alt="${B(e)}"`;return t&&(n+=` title="${B(t)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:B(r.text)}},Ue=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},_=class ze{options;renderer;textRenderer;constructor(t){this.options=t||G,this.options.renderer=this.options.renderer||new Lt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ue}static parse(t,e){return new ze(e).parse(t)}static parseInline(t,e){return new ze(e).parseInline(t)}parse(t){this.renderer.parser=this;let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=s,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){e+=a||"";continue}}let n=s;switch(n.type){case"space":{e+=this.renderer.space(n);break}case"hr":{e+=this.renderer.hr(n);break}case"heading":{e+=this.renderer.heading(n);break}case"code":{e+=this.renderer.code(n);break}case"table":{e+=this.renderer.table(n);break}case"blockquote":{e+=this.renderer.blockquote(n);break}case"list":{e+=this.renderer.list(n);break}case"checkbox":{e+=this.renderer.checkbox(n);break}case"html":{e+=this.renderer.html(n);break}case"def":{e+=this.renderer.def(n);break}case"paragraph":{e+=this.renderer.paragraph(n);break}case"text":{e+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return e}parseInline(t,e=this.renderer){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let n=t[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=a||"";continue}}let o=n;switch(o.type){case"escape":{i+=e.text(o);break}case"html":{i+=e.html(o);break}case"link":{i+=e.link(o);break}case"image":{i+=e.image(o);break}case"checkbox":{i+=e.checkbox(o);break}case"strong":{i+=e.strong(o);break}case"em":{i+=e.em(o);break}case"codespan":{i+=e.codespan(o);break}case"br":{i+=e.br(o);break}case"del":{i+=e.del(o);break}case"text":{i+=e.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},ht=class{options;block;constructor(r){this.options=r||G}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?M.lex:M.lexInline}provideParser(r=this.block){return r?_.parse:_.parseInline}},An=class{defaults=Pe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_;Renderer=Lt;TextRenderer=Ue;Lexer=M;Tokenizer=Tt;Hooks=ht;constructor(...r){this.use(...r)}walkTokens(r,t){let e=[];for(let i of r)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let s=i;for(let n of s.header)e=e.concat(this.walkTokens(n.tokens,t));for(let n of s.rows)for(let o of n)e=e.concat(this.walkTokens(o.tokens,t));break}case"list":{let s=i;e=e.concat(this.walkTokens(s.items,t));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let o=s[n].flat(1/0);e=e.concat(this.walkTokens(o,t))}):s.tokens&&(e=e.concat(this.walkTokens(s.tokens,t)))}}return e}use(...r){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(e=>{let i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=t.renderers[s.name];n?t.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=t[s.level];n?n.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),e.renderer){let s=this.defaults.renderer||new Lt(this.defaults);for(let n in e.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=e.renderer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h||""}}i.renderer=s}if(e.tokenizer){let s=this.defaults.tokenizer||new Tt(this.defaults);for(let n in e.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=e.tokenizer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.tokenizer=s}if(e.hooks){let s=this.defaults.hooks||new ht;for(let n in e.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=e.hooks[o],l=s[o];ht.passThroughHooks.has(n)?s[o]=c=>{if(this.defaults.async&&ht.passThroughHooksRespectAsync.has(n))return(async()=>{let u=await a.call(s,c);return l.call(s,u)})();let h=a.call(s,c);return l.call(s,h)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,c);return u===!1&&(u=await l.apply(s,c)),u})();let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.hooks=s}if(e.walkTokens){let s=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,t){return M.lex(r,t??this.defaults)}parser(r,t){return _.parse(r,t??this.defaults)}parseMarkdown(r){return(t,e)=>{let i={...e},s={...this.defaults,...i},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return n(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 t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=r),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(r):r?M.lex:M.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(r):r?_.parse:_.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(n);try{s.hooks&&(t=s.hooks.preprocess(t));let o=(s.hooks?s.hooks.provideLexer(r):r?M.lex:M.lexInline)(t,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(r):r?_.parse:_.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,t){return e=>{if(e.message+=`
|
|
1274
|
+
Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error occurred:</p><pre>"+B(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},W=new An;function w(r,t){return W.parse(r,t)}w.options=w.setOptions=function(r){return W.setOptions(r),w.defaults=W.defaults,Qi(w.defaults),w};w.getDefaults=Pe;w.defaults=G;w.use=function(...r){return W.use(...r),w.defaults=W.defaults,Qi(w.defaults),w};w.walkTokens=function(r,t){return W.walkTokens(r,t)};w.parseInline=W.parseInline;w.Parser=_;w.parser=_.parse;w.Renderer=Lt;w.TextRenderer=Ue;w.Lexer=M;w.lexer=M.lex;w.Tokenizer=Tt;w.Hooks=ht;w.parse=w;var cl=w.options,hl=w.setOptions,ul=w.use,dl=w.walkTokens,pl=w.parseInline;var ml=_.parse,fl=M.lex;var Ve=class extends m{#t=null;#e=null;#i=null;static get observedAttributes(){return["src"]}setup(){this.#r()}teardown(){this.#e?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(t,e,i){t==="src"&&i&&e!==i&&this.isConnected&&this.#r()}get parser(){return this.#t}set parser(t){this.#t=typeof t=="function"?t:null}async render(){await this.#r()}async reload(){this.getAttribute("src")&&await this.#r()}#n(){if(this.getAttribute("src"))return null;let t=this.querySelector('script[type="text/markdown"]');if(t)return t.textContent;let e=this.querySelector("template[data-md]");if(e)return e.content.textContent;let i=this.querySelector(":scope > pre");return i?i.textContent:null}async#r(){let t=this.getAttribute("src"),e;if(this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),t){this.#e?.abort(),this.#e=new AbortController,this.setAttribute("data-loading",""),this.#o("markdown-viewer:fetch",{src:t});try{let n=await fetch(t,{signal:this.#e.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);e=await n.text()}catch(n){if(n.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#o("markdown-viewer:error",{error:n.message});return}this.removeAttribute("data-loading")}else e=this.#n();if(e==null)return;let i;try{i=await(await this.#s())(e)}catch(n){this.setAttribute("data-error",""),this.#o("markdown-viewer:error",{error:n.message});return}this.#i||(this.#i=document.createElement("div"),this.#i.className="md-content",this.#i.setAttribute("part","content"),this.appendChild(this.#i)),this.#i.innerHTML=i,this.#a(),this.setAttribute("data-rendered","");let s=this.getAttribute("ping");if(s&&navigator.sendBeacon?.(s,JSON.stringify({src:t||"inline"})),this.#o("markdown-viewer:rendered",{src:t,node:this.#i}),this.hasAttribute("highlight"))for(let n of this.#i.querySelectorAll('pre > code[class*="language-"]')){let o=n.className.match(/language-(\S+)/)?.[1]||"";this.#o("markdown-viewer:highlight",{node:n,language:o})}}async#s(){return this.#t?this.#t:t=>w.parse(t,{gfm:!0})}#a(){if(!this.#i)return;let t=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;t&&(this.#i.dataset.theme=t)}#o(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};p("markdown-viewer",Ve);var We=class extends m{#t=null;#e=null;#i=null;#n=null;#r="";#s=0;static get observedAttributes(){return["name","placeholder","rows"]}setup(){this.#a(),this.#o(),this.#l()}teardown(){clearTimeout(this.#s),this.removeAttribute("data-editing")}attributeChangedCallback(t,e,i){!this.#t||e===i||(t==="name"&&(this.#t.name=i||""),t==="placeholder"&&(this.#t.placeholder=i||""),t==="rows"&&(this.#t.rows=parseInt(i,10)||10))}get value(){return this.#t?.value??""}set value(t){this.#t&&(this.#t.value=t,this.#l())}get textarea(){return this.#t}#a(){let e=this.querySelector("textarea")?.value||"";this.#i=document.createElement("section"),this.#i.className="md-editor-pane",this.#i.setAttribute("aria-label","Markdown source"),this.#n=document.createElement("section"),this.#n.className="md-preview-pane",this.#n.setAttribute("aria-label","Rendered preview"),this.#n.setAttribute("aria-live","polite"),this.#t=document.createElement("textarea"),this.#t.className="md-editor-input",this.#t.value=e,this.#t.name=this.getAttribute("name")||"",this.#t.placeholder=this.getAttribute("placeholder")||"Write markdown here...",this.#t.rows=parseInt(this.getAttribute("rows"),10)||10,this.#t.setAttribute("spellcheck","true"),this.#e=document.createElement("markdown-viewer"),this.hasAttribute("highlight")&&this.#e.setAttribute("highlight","");let i=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;i&&(this.#e.dataset.theme=i),this.#i.appendChild(this.#t),this.#n.appendChild(this.#e),this.innerHTML="",this.appendChild(this.#i),this.appendChild(this.#n),this.#r=e}#o(){this.listen(this.#t,"input",()=>{this.#h("markdown-editor:input",{value:this.#t.value}),this.#c()}),this.listen(this.#t,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(this.#t,"blur",()=>{this.removeAttribute("data-editing"),this.#t.value!==this.#r&&(this.#r=this.#t.value,this.#h("markdown-editor:change",{value:this.#t.value}))}),this.hasAttribute("data-tab-indent")&&this.listen(this.#t,"keydown",t=>{if(t.key==="Tab"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey){t.preventDefault();let{selectionStart:e,selectionEnd:i}=this.#t;this.#t.setRangeText(" ",e,i,"end"),this.#t.dispatchEvent(new Event("input",{bubbles:!0}))}})}#c(){clearTimeout(this.#s),this.#s=setTimeout(()=>this.#l(),150)}#l(){if(!this.#e)return;let t=this.#t?.value||"";if(!t.trim()){let i=this.#e.querySelector(".md-content");i&&(i.innerHTML="");return}let e=this.#e.querySelector('script[type="text/markdown"]');e||(e=document.createElement("script"),e.type="text/markdown",this.#e.prepend(e)),e.textContent=t,this.#e.removeAttribute("data-rendered"),this.#e.render()}#h(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};p("markdown-editor",We);var cs={shadow:{prefix:"--shadow-",tokens:"xs,s,m,l,xl,2xl"},radius:{prefix:"--radius-",tokens:"xs,s,m,l,xl,2xl,full"},border:{prefix:"--border-width-",tokens:"thin,medium,thick"},color:{prefix:"--color-",tokens:"primary,secondary,accent,success,warning,error,info"},size:{prefix:"--size-",tokens:"3xs,2xs,xs,s,m,l,xl,2xl,3xl"},icon:{prefix:"",tokens:"home,search,settings,user,bell,heart,star,check,x,chevron-right,menu,trash"}},hs={shadow:En,radius:Sn,border:Cn,color:$n,size:Tn,icon:Ln},Ge=class extends m{static observedAttributes=["type","tokens","prefix","show-values","label","size","icon-set","editable","target"];setup(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}#t(){let t=this.getAttribute("type")||"shadow",e=cs[t]||cs.shadow,i=this.getAttribute("prefix")||e.prefix,s=this.getAttribute("tokens")||e.tokens,n=this.getAttribute("show-values")!=="false",o=this.getAttribute("label")||"",a=s.split(",").map(u=>u.trim()),l=hs[t]||hs.shadow,c="";o&&(c+=`<p style="font-size:0.75rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-muted,#666);margin-block-end:0.75rem;font-family:var(--font-sans,system-ui)">${o}</p>`),c+=l(a,i,n,this),this.innerHTML=c;let h=this.hasAttribute("editable")&&t!=="icon";n&&t!=="icon"?requestAnimationFrame(()=>{this.#r(t,i,a),h&&this.#e(t,i)}):h&&requestAnimationFrame(()=>this.#e(t,i))}#e(t,e){let i=getComputedStyle(this);this.querySelectorAll("[data-token-value]").forEach(s=>{let n=s.dataset.tokenValue,o=i.getPropertyValue(`${e}${n}`).trim(),a=document.createElement("input");a.type=t==="color"&&/^#[0-9a-f]{3,8}$/i.test(o)?"color":"text",a.value=o||"",a.className="ts-edit",a.setAttribute("data-token",n),a.setAttribute("aria-label",`${n} value`),a.style.cssText=`font-family:var(--font-mono,monospace);font-size:0.625rem;padding:0.125rem 0.25rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface,#fff);color:var(--color-text,#222);inline-size:${t==="color"?"3rem":"100%"};${t==="color"?"block-size:1.5rem;padding:0;":"max-inline-size:8rem;"}`,s.replaceWith(a),this.listen(a,"change",()=>this.#i(a,e)),this.listen(a,"keydown",l=>{l.key==="Enter"&&this.#i(a,e)})})}#i(t,e){let i=t.getAttribute("data-token"),s=t.value.trim();if(!i||!s)return;let n=this.#n(),o=`${e}${i}`;n&&n.style.setProperty(o,s),this.dispatchEvent(new CustomEvent("token-specimen:change",{bubbles:!0,detail:{name:i,value:s,token:o,target:this.getAttribute("target")||":root"}}))}#n(){let t=this.getAttribute("target")||":root";try{return t===":root"?document.documentElement:document.querySelector(t)}catch{return document.documentElement}}#r(t,e,i){let s=getComputedStyle(this);this.querySelectorAll("[data-token-value]").forEach(n=>{let o=n.dataset.tokenValue,a=s.getPropertyValue(`${e}${o}`).trim();if(t==="radius"||t==="size"){let l=this.querySelector(`[data-token-sample="${o}"]`);if(l){let c=t==="radius"?"borderRadius":"width",h=t==="size"?l.getBoundingClientRect().width:null;n.textContent=h!=null?`${Math.round(h*100)/100}px`:a||"\u2014"}}else n.textContent=a||"\u2014"})}};function En(r,t,e){let i='<div role="list" style="display:flex;flex-wrap:wrap;gap:1rem;align-items:end">';for(let s of r)i+=`<div role="listitem" style="text-align:center">
|
|
1203
1275
|
<div style="width:7rem;height:5rem;background:var(--color-surface,#fff);border-radius:var(--radius-m,0.5rem);box-shadow:var(${t}${s})" aria-hidden="true"></div>
|
|
1204
1276
|
<p style="font-family:var(--font-mono,monospace);font-size:0.75rem;color:var(--color-text-muted,#666);margin-block-start:0.5rem">${s}</p>
|
|
1205
1277
|
${e?`<p data-token-value="${s}" style="font-family:var(--font-mono,monospace);font-size:0.625rem;color:var(--color-text-muted,#999);max-width:7rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"></p>`:""}
|
|
1206
|
-
</div>`;return i+="</div>",i}function
|
|
1278
|
+
</div>`;return i+="</div>",i}function Sn(r,t,e){let i='<div role="list" style="display:flex;flex-wrap:wrap;gap:1rem;align-items:end">';for(let s of r)i+=`<div role="listitem" style="text-align:center">
|
|
1207
1279
|
<div data-token-sample="${s}" style="width:4.5rem;height:4.5rem;background:var(--color-primary,oklch(55% 0.2 260));border-radius:var(${t}${s});display:flex;align-items:center;justify-content:center;color:#fff;font-size:0.75rem;font-family:var(--font-mono,monospace)" aria-hidden="true">${s}</div>
|
|
1208
1280
|
${e?`<p data-token-value="${s}" style="font-family:var(--font-mono,monospace);font-size:0.625rem;color:var(--color-text-muted,#999);margin-block-start:0.25rem"></p>`:""}
|
|
1209
|
-
</div>`;return i+="</div>",i}function
|
|
1281
|
+
</div>`;return i+="</div>",i}function Cn(r,t,e){let i='<div role="list" style="display:flex;flex-direction:column;gap:0.75rem">';for(let s of r)i+=`<div role="listitem" style="display:grid;grid-template-columns:4rem 1fr auto;align-items:center;gap:0.75rem">
|
|
1210
1282
|
<span style="font-family:var(--font-mono,monospace);font-size:0.875rem;color:var(--color-text-muted,#666);text-align:end">${s}</span>
|
|
1211
1283
|
<div style="border-block-start:var(${t}${s}) solid var(--color-text,#333);min-inline-size:4rem" aria-hidden="true"></div>
|
|
1212
1284
|
${e?`<span data-token-value="${s}" style="font-family:var(--font-mono,monospace);font-size:0.75rem;color:var(--color-text-muted,#666);font-variant-numeric:tabular-nums"></span>`:""}
|
|
1213
|
-
</div>`;return i+="</div>",i}function
|
|
1285
|
+
</div>`;return i+="</div>",i}function $n(r,t,e){let i='<div role="list" style="display:flex;flex-wrap:wrap;gap:0.75rem">';for(let s of r)i+=`<div role="listitem" style="text-align:center">
|
|
1214
1286
|
<div style="width:4rem;height:3rem;background:var(${t}${s});border-radius:var(--radius-s,0.25rem);border:1px solid var(--color-border,#ddd)" aria-hidden="true"></div>
|
|
1215
1287
|
<p style="font-family:var(--font-mono,monospace);font-size:0.625rem;color:var(--color-text-muted,#666);margin-block-start:0.25rem">${s}</p>
|
|
1216
1288
|
${e?`<p data-token-value="${s}" style="font-family:var(--font-mono,monospace);font-size:0.5625rem;color:var(--color-text-muted,#999);max-width:4rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"></p>`:""}
|
|
1217
|
-
</div>`;return i+="</div>",i}function
|
|
1289
|
+
</div>`;return i+="</div>",i}function Tn(r,t,e){let i='<div role="list" style="display:flex;flex-direction:column;gap:0.25rem">';for(let s of r)i+=`<div role="listitem" style="display:grid;grid-template-columns:3rem 1fr auto;align-items:center;gap:0.75rem;min-block-size:1.75rem">
|
|
1218
1290
|
<span style="font-family:var(--font-mono,monospace);font-size:0.875rem;color:var(--color-text-muted,#666);text-align:end">${s}</span>
|
|
1219
1291
|
<div data-token-sample="${s}" style="display:block;block-size:var(--size-m,1rem);min-inline-size:2px;inline-size:var(${t}${s});background:var(--color-interactive,oklch(55% 0.2 260));border-radius:var(--radius-s,0.25rem)" aria-hidden="true"></div>
|
|
1220
1292
|
${e?`<span data-token-value="${s}" style="font-family:var(--font-mono,monospace);font-size:0.75rem;color:var(--color-text-muted,#666);font-variant-numeric:tabular-nums;min-inline-size:3.5rem;text-align:end"></span>`:""}
|
|
1221
|
-
</div>`;return i+="</div>",i}
|
|
1293
|
+
</div>`;return i+="</div>",i}function Ln(r,t,e,i){let s=i?.getAttribute("size")||"md",n=i?.getAttribute("icon-set")||"",o=n?` set="${n}"`:"",a='<div role="list" style="display:flex;flex-wrap:wrap;gap:1rem">';for(let l of r)a+=`<div role="listitem" style="display:flex;flex-direction:column;align-items:center;gap:0.375rem;min-inline-size:4.5rem">
|
|
1294
|
+
<span style="display:inline-flex;align-items:center;justify-content:center;padding:var(--size-s,0.75rem);background:var(--color-surface-raised,#f5f5f5);border-radius:var(--radius-s,0.25rem);border:1px solid var(--color-border,#ddd);color:var(--color-text,#222)">
|
|
1295
|
+
<icon-wc name="${l}" size="${s}"${o}></icon-wc>
|
|
1296
|
+
</span>
|
|
1297
|
+
${e?`<code style="font-family:var(--font-mono,monospace);font-size:0.625rem;color:var(--color-text-muted,#666);max-inline-size:5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${l}</code>`:""}
|
|
1298
|
+
</div>`;return a+="</div>",a}p("token-specimen",Ge);var Mn={button:()=>`
|
|
1222
1299
|
<layout-cluster data-layout-gap="s">
|
|
1223
1300
|
<button>Primary</button>
|
|
1224
1301
|
<button class="secondary">Secondary</button>
|
|
@@ -1258,8 +1335,11 @@ Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error
|
|
|
1258
1335
|
<progress value="100" max="100">100%</progress>
|
|
1259
1336
|
</layout-stack>`,range:()=>`
|
|
1260
1337
|
<input type="range" min="0" max="100" value="50" aria-label="Sample range"/>`,textarea:()=>`
|
|
1261
|
-
<textarea rows="3" placeholder="Textarea sample" aria-label="Sample textarea" style="width:100%"></textarea>`},
|
|
1338
|
+
<textarea rows="3" placeholder="Textarea sample" aria-label="Sample textarea" style="width:100%"></textarea>`},Ke=class extends m{static observedAttributes=["components","label","compact"];setup(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}#t(){let t=this.getAttribute("components")||"button,input,select,checkbox,radio,badge,progress",e=this.getAttribute("label")||"",i=this.hasAttribute("compact"),s=t.split(",").map(a=>a.trim()),n=i?"0.75rem":"1.25rem",o="";e&&(o+=`<p style="font-size:0.75rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-muted,#666);margin-block-end:0.75rem;font-family:var(--font-sans,system-ui)">${e}</p>`),o+=`<section style="display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));gap:${n}">`;for(let a of s){let l=Mn[a];l&&(o+=`<article style="border:1px solid var(--color-border,#ddd);border-radius:var(--radius-m,0.5rem);padding:var(--size-m,1rem);background:var(--color-surface,#fff)">
|
|
1262
1339
|
<p style="font-size:0.625rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-muted,#999);margin-block-end:var(--size-s,0.5rem);font-family:var(--font-sans,system-ui)">${a}</p>
|
|
1263
1340
|
${l()}
|
|
1264
|
-
</article>`)}o+="</section>",this.innerHTML=o}};m("component-sampler",me);var fe='track[kind="chapters"][data-chapter-list]';function si(r=document){r.querySelectorAll(fe).forEach(t=>ge(t))}function ge(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?ri(t,e):r.addEventListener("load",()=>ri(t,e),{once:!0})}function ri(r,t){let e=t.cues;if(!e||e.length===0)return;let i=document.createElement("nav");i.setAttribute("aria-label","Video chapters"),i.classList.add("chapter-list");let s=document.createElement("ol");for(let o of e){let a=document.createElement("li"),l=document.createElement("button");l.type="button";let c=document.createElement("span");c.textContent=o.text;let h=document.createElement("time");h.textContent=ir(o.startTime),h.setAttribute("datetime",sr(o.startTime)),l.appendChild(c),l.appendChild(h),l.addEventListener("click",()=>{r.currentTime=o.startTime,r.paused&&r.play()}),a.appendChild(l),s.appendChild(a)}i.appendChild(s),r.insertAdjacentElement("afterend",i);let n=null;r.addEventListener("timeupdate",()=>{let o=r.currentTime,a=-1;for(let l=0;l<e.length;l++)if(o>=e[l].startTime&&o<e[l].endTime){a=l;break}n&&n.removeAttribute("data-active"),a>=0?(n=s.children[a],n.setAttribute("data-active","")):n=null})}function ir(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function sr(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>si()):si();var rr=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.(fe)&&ge(i),i.querySelectorAll?.(fe).forEach(s=>ge(s))}});rr.observe(document.documentElement,{childList:!0,subtree:!0});var O="[data-command], [commandfor]",nr="Page Actions",_=new Map;function ut(r){if(_.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||nr,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=D(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};_.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function be(r){let t=_.get(r);t&&(t.unbind?.(),_.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function or(){let r=new Map;for(let t of _.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function ni(r=document){r.querySelectorAll(O).forEach(ut)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ni()):ni();var ar=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(O)&&ut(i),i.querySelectorAll(O).forEach(ut)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;_.has(i)&&be(i),i.querySelectorAll(O).forEach(s=>{_.has(s)&&be(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(O)&&!_.has(e)?ut(e):!e.matches(O)&&_.has(e)&&be(e)}}});ar.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function lr(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||_.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||_.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:or,scanAutoDiscoverable:lr};var cr=window.matchMedia("(prefers-reduced-motion: reduce)");function oi(){return cr.matches||document.documentElement.hasAttribute("data-motion-reduced")}var ai=0,k={_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_transitionCleanups:new WeakMap,_observer:null,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{(e.getAttribute("data-effect")||"").split(/\s+/).includes(r)&&this._initEffect(e,r)})},trigger(r,t){this._triggers.set(r,t)},transition(r,t){this._transitions.set(r,t)},uid(r){return r.id?r.id:(r._vbUid||(ai++,r._vbUid=`vb-${ai}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){return document.startViewTransition?document.startViewTransition(r):r()},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{for(let i of e){if(i.type==="childList"){for(let s of i.addedNodes)s.nodeType===Node.ELEMENT_NODE&&this._processTree(s);for(let s of i.removedNodes)s.nodeType===Node.ELEMENT_NODE&&this._cleanupTree(s)}if(i.type==="attributes"){let s=i.target;i.attributeName==="data-effect"&&this._reconcileEffects(s),i.attributeName==="data-trigger"&&this._reconcileTrigger(s),i.attributeName==="data-stagger"&&this._processStagger(s),i.attributeName==="data-transition"&&this._processTransition(s)}}});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]})},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:oi,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(r.hasAttribute("data-effect-processed"))return;r.setAttribute("data-effect-processed","");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;oi();let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e){this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);for(let s of i){let n=s.indexOf(":"),o=n>-1?s.slice(0,n):s,a=n>-1?s.slice(n+1):null,l=this._triggers.get(o);if(!l)continue;let c=l(r,()=>this._activateEffects(r),a);if(c){let h=this._triggerCleanups.get(r);if(h){let u=h;this._triggerCleanups.set(r,()=>{u(),c()})}else this._triggerCleanups.set(r,c)}}},_activateEffects(r){r.setAttribute("data-effect-active","");let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r))},_reconcileEffects(r){let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);r.hasAttribute("data-effect-processed")||(r.setAttribute("data-effect-processed",""),this._wireTrigger(r,t))},_reconcileTrigger(r){let t=this._triggerCleanups.get(r);t&&(t(),this._triggerCleanups.delete(r));let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_processStagger(r){let t=r.children;for(let e=0;e<t.length;e++)t[e].style.setProperty("--vb-stagger-index",String(e))},_processTransition(r){if(r.hasAttribute("data-transition-processed"))return;r.setAttribute("data-transition-processed","");let t=r.getAttribute("data-transition");if(!t)return;let e=this._transitions.get(t);if(e){let i=e(r);i&&this._transitionCleanups.set(r,i)}else r.style.viewTransitionName=`${t}-${this.uid(r)}`},_cleanupTransition(r){let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),r.style.viewTransitionName=""}};typeof window<"u"&&(window.VB=k);k.effect("glitch",r=>{r.hasAttribute("data-effect-glitch-init")||(r.setAttribute("data-effect-glitch-init",""),r.setAttribute("data-glitch-text",r.textContent))});function hr(r){let t=r.textContent;r.setAttribute("aria-label",t),r.innerHTML="",t.split(/(\s+)/).forEach((i,s)=>{if(/^\s+$/.test(i)){r.appendChild(document.createTextNode(i));return}let n=document.createElement("span");n.className="vb-blur-chunk",n.textContent=i,n.style.setProperty("--i",String(Math.floor(s/2))),n.setAttribute("aria-hidden","true"),r.appendChild(n)})}function ur(r){let t=r.textContent;r.setAttribute("aria-label",t);let e=t.split(/\s+/).filter(Boolean),i=[],s="",n=r.offsetWidth,o=document.createElement("span");o.style.visibility="hidden",o.style.position="absolute",o.style.font=getComputedStyle(r).font,document.body.appendChild(o),e.forEach(a=>{let l=s?s+" "+a:a;o.textContent=l,o.offsetWidth>n&&s?(i.push(s),s=a):s=l}),s&&i.push(s),document.body.removeChild(o),i.length===0&&i.push(t),r.innerHTML="",i.forEach((a,l)=>{let c=document.createElement("span");c.className="vb-blur-chunk",c.textContent=a,c.style.setProperty("--i",String(l)),c.setAttribute("aria-hidden","true"),r.appendChild(c),l<i.length-1&&r.appendChild(document.createTextNode(" "))})}k.effect("blur-reveal",r=>{if(r.hasAttribute("data-effect-blur-reveal-init")||(r.setAttribute("data-effect-blur-reveal-init",""),k.prefersReducedMotion()))return;let t=r.classList.contains("line")?"line":"word",e=k.params(r).get("blur-reveal-delay")||"80ms";return r.style.setProperty("--blur-delay",e),t==="line"?ur(r):hr(r),{activate(){r.setAttribute("data-effect-active","")},cleanup(){}}});function dr(r,t,e,i){let s=0;function n(){s<=t.length?(r.firstChild.textContent=t.slice(0,s),s++,setTimeout(n,e)):i&&i()}n()}function pr(r,t,e){let i=r.firstChild.textContent,s=i.length;function n(){s>=0?(r.firstChild.textContent=i.slice(0,s),s--,setTimeout(n,t/2)):e&&e()}n()}function mr(r){let t=r.getAttribute("data-typewriter-text"),e=k.params(r),i=e.getNumber("typewriter-speed",50),s=e.getNumber("typewriter-delay",0),o=r.classList.contains("loop")?2e3:null;r.textContent="";let a=document.createTextNode("");if(r.appendChild(a),!r.classList.contains("no-cursor")){let h=document.createElement("span");h.className="vb-typewriter-cursor",h.textContent="|",h.setAttribute("aria-hidden","true"),r.appendChild(h)}function c(){dr(r,t,i,()=>{o!==null&&setTimeout(()=>{pr(r,i,()=>{setTimeout(c,400)})},o)})}setTimeout(c,s)}k.effect("typewriter",r=>{if(r.hasAttribute("data-effect-typewriter-init"))return;r.setAttribute("data-effect-typewriter-init","");let t=r.textContent.trim();if(r.setAttribute("data-typewriter-text",t),r.setAttribute("aria-label",t),!k.prefersReducedMotion())return r.textContent="",{activate(){mr(r)},cleanup(){}}});var li="!<>-_\\/[]{}=+*^?#";function ci(r){return r[Math.floor(Math.random()*r.length)]}function fr(r){let t=r.getAttribute("data-scramble-text"),e=k.params(r),i=e.getNumber("scramble-duration",1500),s=e.get("scramble-chars")||li,n=e.getNumber("scramble-speed",30),o=t.length,a=0,l=Math.ceil(i/n);function c(){let h=a/l,u=Math.floor(h*o),d="";for(let p=0;p<o;p++)p<u?d+=t[p]:t[p]===" "?d+=" ":d+=ci(s);r.textContent=d,a++,a<=l?setTimeout(c,n):r.textContent=t}c()}k.effect("scramble",r=>{if(r.hasAttribute("data-effect-scramble-init"))return;r.setAttribute("data-effect-scramble-init","");let t=r.textContent.trim();if(r.setAttribute("data-scramble-text",t),r.setAttribute("aria-label",t),k.prefersReducedMotion())return;let e=k.params(r).get("scramble-chars")||li;return r.textContent=t.replace(/\S/g,()=>ci(e)),{activate(){fr(r)},cleanup(){}}});k.effect("animate-image",r=>{if(r.hasAttribute("data-effect-animate-image-init"))return;r.setAttribute("data-effect-animate-image-init","");let t=r,e=document.createElement("div");if(e.className="animate-image-wrapper",!t.parentNode)return;t.parentNode.insertBefore(e,t),e.appendChild(t);let i=document.createElement("button");i.type="button",i.className="animate-image-toggle",i.setAttribute("aria-label","Pause animation"),e.appendChild(i);let s=t.src,n=null,o=!1;function a(){let u=document.createElement("canvas");u.width=t.naturalWidth||t.width,u.height=t.naturalHeight||t.height;let d=u.getContext("2d");if(d){d.drawImage(t,0,0);try{n=u.toDataURL("image/png")}catch{n=null}}}function l(){o||(o=!0,t.setAttribute("data-animate-image-paused",""),i.setAttribute("aria-label","Play animation"),i.classList.add("paused"),n&&(t.src=n))}function c(){o&&(o=!1,t.removeAttribute("data-animate-image-paused"),i.setAttribute("aria-label","Pause animation"),i.classList.remove("paused"),t.src=s)}i.addEventListener("click",()=>o?c():l()),t.complete&&t.naturalWidth?a():t.addEventListener("load",a,{once:!0});let h=window.matchMedia("(prefers-reduced-motion: reduce)");return(h.matches||document.documentElement.dataset.motionReduced!==void 0)&&(t.complete?(a(),l()):t.addEventListener("load",()=>{a(),l()},{once:!0})),h.addEventListener("change",u=>{u.matches&&l()}),t.hasAttribute("data-animate-image-paused")&&(t.complete?(a(),o=!1,l()):t.addEventListener("load",()=>{a(),o=!1,l()},{once:!0})),{cleanup(){e.parentNode&&(e.parentNode.insertBefore(t,e),e.remove())}}});var dt=new Map,ve=null,pt=!1;function gr(r){for(let[t,e]of dt)r.querySelectorAll(t).forEach(e)}function br(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of dt)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function vr(){ve||(ve=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)br(e)}),ve.observe(document.documentElement,{childList:!0,subtree:!0}))}function yr(){pt||(pt=!0,gr(document))}function hi(r,t){dt.set(r,t),vr(),pt||document.readyState!=="loading"?(pt=!0,document.querySelectorAll(r).forEach(t)):dt.size===1&&document.addEventListener("DOMContentLoaded",yr)}var mt=null;async function wr(){if(mt)return;mt=(await Promise.resolve().then(()=>(St(),Et))).resolveEmoji}var kr="[data-emoji]",R=/:([a-z0-9_+-]+):/g,xr=new Set(["SCRIPT","STYLE","CODE","PRE","TEXTAREA"]),Ar=new Set(["INPUT","TEXTAREA"]),Er=100;function Sr(r){if(r.hasAttribute("data-emoji-init"))return;if(r.setAttribute("data-emoji-init",""),Ar.has(r.tagName)){Cr(r);return}let t=r.getAttribute("data-emoji-unknown")||"keep";if(ui(r,t),r.getAttribute("data-emoji-scan")==="observe"){let e=null;new MutationObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{ui(r,t),e=null},Er)}).observe(r,{childList:!0,subtree:!0,characterData:!0})}}function Cr(r){let t=!1;r.addEventListener("compositionstart",()=>{t=!0}),r.addEventListener("compositionend",()=>{t=!1,ye(r)}),r.addEventListener("input",()=>{t||ye(r)}),r.value&&R.test(r.value)&&(R.lastIndex=0,ye(r))}function ye(r){let t=r.value;R.lastIndex=0;let e,i="",s=0,n=0,o=r.selectionStart??t.length,a=!1;for(;(e=R.exec(t))!==null;){let c=e[0],h=e[1],u=mt(h);if(i+=t.slice(s,e.index),u){i+=u.emoji,a=!0;let d=e.index+c.length;o>=d?n+=c.length-u.emoji.length:o>e.index&&(n+=o-e.index-u.emoji.length)}else i+=c;s=e.index+c.length}if(!a)return;i+=t.slice(s),r.value=i;let l=Math.max(0,o-n);r.setSelectionRange(l,l)}function ui(r,t){let e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(s){let n=s.parentElement;return!n||xr.has(n.tagName)||n.isContentEditable||n.hasAttribute("data-emoji-processed")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];for(;e.nextNode();)R.test(e.currentNode.textContent??"")&&i.push(e.currentNode),R.lastIndex=0;for(let s of i)Tr(s,t)}function Tr(r,t){let e=r.textContent;R.lastIndex=0;let i,s=0,n=[],o=!1;for(;(i=R.exec(e))!==null;){let a=i[1],l=mt(a);i.index>s&&n.push(e.slice(s,i.index)),l?(n.push(l.emoji),o=!0):t==="strip"?o=!0:n.push(i[0]),s=i.index+i[0].length}o&&(s<e.length&&n.push(e.slice(s)),r.textContent=n.join(""))}function _r(r){wr().then(()=>Sr(r))}hi(kr,_r);
|
|
1341
|
+
</article>`)}o+="</section>",this.innerHTML=o}};p("component-sampler",Ke);var _n=0,Xe=class extends m{#t=null;#e=null;#i=null;#n=!1;#r=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#s(),this.#a();let t=this.dataset.breakpoint||"48rem";this.#i=matchMedia(`(max-width: ${t})`),this.#o(this.#i),this.listen(this.#i,"change",e=>this.#o(e)),this.#r=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&this.#n&&this.#h()}),this.#r.observe(this,{childList:!0})}teardown(){this.#r?.disconnect(),this.#r=null,this.#n&&this.#l(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null}get tools(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-page-tools-internal"))}#s(){if((this.dataset.orientation||"auto")!=="auto")return;let i=(this.dataset.position||"sticky")==="inline"?"horizontal":"vertical";this.dataset.resolvedOrientation=i}#a(){let t=`pt-${++_n}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0,this.#t.innerHTML=`<icon-wc name="${e}" size="md"></icon-wc>`,this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.#e.hidden=!0,this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"toggle",s=>{s.newState==="closed"&&this.#t.focus()})}#o(t){t.matches??t?this.#c():this.#l()}#c(){if(this.#n)return;this.#n=!0;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#t.hidden=!1,this.#e.hidden=!1,this.dataset.collapsed=""}#l(){if(!this.#n)return;this.#n=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.#e.hidden=!0,delete this.dataset.collapsed}#h(){let t=this.tools;for(let e of t)this.#e.appendChild(e)}};p("page-tools",Xe);var Je=class extends m{#t;#e;#i=null;setup(){this.#i===null&&(this.#i=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#i,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&this.setAttribute("role","group");let i=this.getAttribute("variant")||"icon";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="print-trigger",this.#t.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.#t.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#t.appendChild(o)}if(this.listen(this.#t,"click",this.#n),this.append(this.#t),e){let o=document.createElement("label");this.#e=document.createElement("input"),this.#e.type="checkbox";let a=document.createElement("span");a.textContent="Print without VB styles",o.append(this.#e,a),this.append(o)}}teardown(){this.#t=null,this.#e=null}#n=()=>{let t=this.#e?.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)}}};p("print-page",Je);var Ye=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${L(r)}&text=${L(t)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${L(r)}&text=${L(t)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${L(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${L(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://wa.me/?text=${L(`${t} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://t.me/share/url?url=${L(r)}&text=${L(t)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://bsky.app/intent/compose?text=${L(`${t} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:t},e="mastodon.social")=>`https://${e}/share?text=${L(`${t} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:t,text:e})=>`mailto:?subject=${L(t)}&body=${L(`${e}
|
|
1342
|
+
|
|
1343
|
+
${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),Ze="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function L(r){return encodeURIComponent(r)}var Qe=class extends m{#t;#e;#i;#n;#r=null;#s=null;get url(){return this.#t}set url(t){this.#t=t}get title(){return this.#e??""}set title(t){this.#e=t}get text(){return this.#i}set text(t){this.#i=t}setup(){if(this.#a(),this.#o(),this.closest("selection-menu")){this.#c(),this.setAttribute("data-tier-resolved","selection");return}this.#n==="native"?this.#l():this.#n==="hidden"?this.style.display="none":this.children.length>0?this.#f():this.#h(),this.setAttribute("data-tier-resolved",this.#n)}teardown(){this.removeAttribute("data-tier-resolved"),this.#r&&(clearTimeout(this.#r),this.#r=null),this.#s&&(this.#s.removeEventListener("click",this.#m),this.#s.remove(),this.#s=null),this.querySelector(".share-trigger")?.remove()}async share(){this.#n==="native"&&await this.#u()}#a(){this.#t=this.getAttribute("url")||document.querySelector('link[rel="canonical"]')?.getAttribute("href")||location.href,this.#e=this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title,this.#i=this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||""}#o(){let t=this.getAttribute("tier");if(t==="platforms"||t==="native"){t==="native"&&!navigator.share?this.#n="hidden":this.#n=t;return}if((this.getAttribute("platforms")||Ze)==="native-only"){this.#n=typeof navigator.share=="function"?"native":"hidden";return}this.#n=typeof navigator.share=="function"?"native":"platforms"}#c(){let t=document.createElement("button");t.type="button",t.setAttribute("aria-label","Share selection");let e=document.createElement("icon-wc");e.setAttribute("name","share-2"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),t.addEventListener("click",()=>{let i=this.closest("selection-menu"),n=i?.getSelection?.()?.text||window.getSelection()?.toString()||"";n&&navigator.share?navigator.share({text:`"${n}" \u2014 ${location.href}`}).catch(()=>{}):n&&navigator.clipboard?.writeText(`"${n}" \u2014 ${location.href}`).catch(()=>{}),i?.dismiss?.()}),this.appendChild(t)}#l(){let t=this.getAttribute("label")||"Share",e=document.createElement("button");e.type="button",e.className="share-trigger",e.setAttribute("aria-label","Share this page"),e.innerHTML=`<icon-wc name="share-2" size="sm" aria-hidden="true"></icon-wc><span class="share-label">${t}</span>`,e.addEventListener("click",this.#d),this.appendChild(e)}#h(){let t=(this.getAttribute("platforms")||Ze).split(",").map(e=>e.trim()).filter(Boolean);this.#s=document.createElement("nav"),this.#s.setAttribute("aria-label","Share this page");for(let e of t){let i=Ye.get(e);if(!i)continue;let s=document.createElement("button");s.type="button",s.dataset.platform=e,s.setAttribute("aria-label",e==="copy"?"Copy link":`Share on ${i.label}`);let n=i.iconSet?` set="${i.iconSet}"`:"";s.innerHTML=`<icon-wc name="${i.iconName}" size="sm"${n} aria-hidden="true"></icon-wc><span class="share-label">${i.label}</span>`,this.#s.appendChild(s)}this.#s.addEventListener("click",this.#m),this.appendChild(this.#s)}#f(){if(this.querySelector("nav"))this.#s=this.querySelector("nav");else{let i=document.createElement("nav");for(i.setAttribute("aria-label","Share this page");this.firstChild;)i.appendChild(this.firstChild);this.appendChild(i),this.#s=i}let t=this.querySelectorAll("a[data-platform]");for(let i of t){let s=i.getAttribute("href")||"";i.setAttribute("href",s.replace(/\{url\}/g,encodeURIComponent(this.#t||"")).replace(/\{title\}/g,encodeURIComponent(this.#e||"")).replace(/\{text\}/g,encodeURIComponent(this.#i||"")))}let e=this.querySelectorAll('[data-platform="copy"]');for(let i of e)i.addEventListener("click",this.#b);this.#s.addEventListener("click",this.#m)}#d=async()=>{await this.#u()};async#u(){let t={url:this.#t||"",title:this.#e||"",text:this.#i||""};this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(t))throw new Error("Payload not shareable");await navigator.share(t),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0}))}catch(e){e.name!=="AbortError"&&this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:e},bubbles:!0}))}}#m=t=>{let e=t.target.closest("[data-platform]");if(!e)return;let i=e.dataset.platform;if(i==="copy"){this.#b(t,e);return}if(e.tagName==="A"||!i)return;let s=Ye.get(i);if(!s)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:i},bubbles:!0}));let n={url:this.#t||"",title:this.#e||"",text:this.#i||""};if(i==="email")location.href=s.buildUrl(n);else if(i==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",a=s.buildUrl(n,o);window.open(a,"_blank","noopener,noreferrer")}else window.open(s.buildUrl(n),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:i},bubbles:!0}))};#b=async(t,e)=>{let i=e||t?.target?.closest('[data-platform="copy"]');if(i)try{await navigator.clipboard.writeText(this.#t||""),i.dataset.state="copied";let s=i.querySelector(".share-label"),n=s?.textContent;s&&(s.textContent="Copied!");let o=i.querySelector("[aria-live]")||i;i.querySelector("[aria-live]")||i.setAttribute("aria-live","polite"),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0})),this.#r&&clearTimeout(this.#r),this.#r=setTimeout(()=>{delete i.dataset.state,s&&n&&(s.textContent=n),i.removeAttribute("aria-live"),this.#r=null},2e3)}catch(s){this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy",error:s},bubbles:!0}))}}};p("share-wc",Qe);var ri="[data-highlights]",us="highlights",Rn=["yellow","green","blue","pink"],ds=8,ti=8,Nn=typeof CSS<"u"&&"highlights"in CSS;function ps(r){let t=2166136261;for(let e=0;e<r.length;e++)t^=r.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function jn(){return"hn-"+crypto.randomUUID().slice(0,8)}function gs(r,t){return getComputedStyle(r).getPropertyValue(`--highlight-${t}`).trim()}var J=null,pt=0;function zn(r){if(J){pt++;return}J=new CSSStyleSheet;let t=r.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(`
|
|
1344
|
+
`);J.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,J],pt=1}function Pn(){pt--,pt<=0&&J&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==J),J=null,pt=0)}var x=null,Rt=null;function Bn(){return x||(x=document.createElement("div"),x.className="hn-toolbar",x.setAttribute("role","toolbar"),x.setAttribute("aria-label","Highlight tools"),x.setAttribute("popover","auto"),x.hidden=!0,document.body.appendChild(x),x.addEventListener("toggle",r=>{r.newState==="closed"&&(x.hidden=!0,Rt=null)}),x)}function ei(r,t,e){let i=Bn();i.innerHTML="",Rt=t;let s=t.colors,n=t.element,o=e?.color,a=document.createElement("div");if(a.className="hn-swatches",a.setAttribute("role","group"),a.setAttribute("aria-label","Highlight colors"),s.forEach((l,c)=>{let h=document.createElement("button");h.type="button",h.className="hn-swatch",h.dataset.color=l,h.setAttribute("aria-label",`Highlight ${l}${o===l?" (current)":""}`),h.setAttribute("tabindex",c===0?"0":"-1");let u=gs(n,l);u&&(h.style.backgroundColor=u),o===l&&h.setAttribute("aria-pressed","true"),h.addEventListener("click",()=>{e?t._changeColor(e.id,l):t._createFromSelection(l),dt()}),a.appendChild(h)}),i.appendChild(a),e){let l=document.createElement("span");l.className="hn-separator",l.setAttribute("aria-hidden","true"),i.appendChild(l);let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent=e.note?"Edit Note":"Add Note",c.addEventListener("click",()=>{et(t,e),dt()}),i.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),dt()}),i.appendChild(h)}a.addEventListener("keydown",l=>{let c=[...a.querySelectorAll("button")],h=c.indexOf(document.activeElement);if(h<0)return;let u=-1;if(l.key==="ArrowRight"||l.key==="ArrowDown")l.preventDefault(),u=(h+1)%c.length;else if(l.key==="ArrowLeft"||l.key==="ArrowUp")l.preventDefault(),u=(h-1+c.length)%c.length;else if(l.key==="Escape"){dt();return}u>=0&&(c[h].setAttribute("tabindex","-1"),c[u].setAttribute("tabindex","0"),c[u].focus())}),i.hidden=!1;try{i.showPopover()}catch{}qn(r),requestAnimationFrame(()=>{let l=i.querySelector(".hn-swatch");l&&l.focus()})}var $=null;function et(r,t){X();let e=r.element,i=K(e,t.startOffset,t.endOffset);if(!i)return;$=document.createElement("div"),$.className="hn-note-panel",$.setAttribute("role","dialog"),$.setAttribute("aria-label","Private note");let s=document.createElement("header");s.className="hn-note-header",s.innerHTML="<small>PRIVATE NOTE</small>",$.appendChild(s);let n=document.createElement("blockquote");n.className="hn-note-quote",n.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,$.appendChild(n);let o=document.createElement("textarea");o.className="hn-note-textarea",o.placeholder="Add a note\u2026",o.value=t.note||"",o.rows=3,o.setAttribute("aria-label","Note for highlighted text"),$.appendChild(o);let a=document.createElement("footer");a.className="hn-note-actions";let l=document.createElement("button");l.type="button",l.className="hn-action hn-action-save",l.textContent="Save",l.addEventListener("click",()=>{r._updateNote(t.id,o.value.trim()),X()});let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent="Cancel",c.addEventListener("click",()=>X()),a.append(l,c),$.appendChild(a),o.addEventListener("keydown",d=>{d.key==="Escape"&&(d.preventDefault(),X()),d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),r._updateNote(t.id,o.value.trim()),X())}),e.style.position="relative",e.appendChild($);let h=i.getClientRects()[0],u=e.getBoundingClientRect();if(h){let d=h.top-u.top;$.style.top=`${d}px`}requestAnimationFrame(()=>{o.focus(),document.addEventListener("pointerdown",bs)})}function bs(r){$&&!$.contains(r.target)&&X()}function X(){$&&(document.removeEventListener("pointerdown",bs),$.remove(),$=null)}function qn(r){x&&requestAnimationFrame(()=>{let t=x.getBoundingClientRect(),e=t.width||200,i=t.height||40,s=r.top-i-ds,n=r.left+r.width/2-e/2;s<ti&&(s=r.bottom+ds);let o=window.innerWidth-e-ti;n=Math.max(ti,Math.min(n,o)),x.style.top=`${s}px`,x.style.left=`${n}px`})}function dt(){if(x){try{x.hidePopover()}catch{}x.hidden=!0,Rt=null}}var O=null;function ii(r){O||(O=document.createElement("div"),O.setAttribute("aria-live","polite"),O.setAttribute("aria-atomic","true"),O.className="hn-sr-only",document.body.appendChild(O)),O.textContent="",requestAnimationFrame(()=>{O.textContent=r})}function ms(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0;for(;i.nextNode();){if(i.currentNode===t)return s+e;s+=(i.currentNode.textContent??"").length}return-1}function K(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0,n=null,o=0,a=null,l=0;for(;i.nextNode();){let c=i.currentNode,h=(c.textContent??"").length;if(!n&&s+h>t&&(n=c,o=t-s),s+h>=e){a=c,l=e-s;break}s+=h}if(!n||!a)return null;try{let c=document.createRange();return c.setStart(n,Math.min(o,(n.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var ni=class{#t;#e;#i;#n;#r=[];#s=!Nn;#a;#o;#c=!1;#l=[];constructor(t){this.#t=t,this.#n=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#e=e&&e!==""?e:location.pathname;let i=t.dataset.highlightsColors;this.#i=i?i.split(",").map(s=>s.trim()).filter(Boolean):[...Rn],this.#s||zn(this.#i),this.#b(),this.#n||(this.#a=this.#h.bind(this),this.#o=this.#f.bind(this),t.addEventListener("pointerup",this.#a),t.addEventListener("click",this.#o)),t.setAttribute("data-highlights-init",""),this.#u().then(()=>{this.#c||this.#b()})}get colors(){return[...this.#i]}get element(){return this.#t}getHighlights(){return this.#r.map(t=>({...t}))}removeHighlight(t){let e=this.#r.findIndex(i=>i.id===t);e<0||(this.#r.splice(e,1),this.#m(),this.#b(),this.#w("highlights:removed",{id:t}),ii("Highlight removed"))}clearAll(){this.#r=[],this.#m(),this.#b()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#r})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#r=e.highlights,this.#m(),this.#b()}catch{}}destroy(){if(!this.#c){if(this.#c=!0,this.#a&&this.#t.removeEventListener("pointerup",this.#a),this.#o&&this.#t.removeEventListener("click",this.#o),this.#s)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.#i)CSS.highlights.delete(`hn-${t}`);Pn()}this.#g(),this.#t.removeAttribute("data-highlights-init"),Rt===this&&dt(),X()}}#h(){requestAnimationFrame(()=>{if(this.#c||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 i=e.getBoundingClientRect();ei(i,this,null)})}#f(t){if(this.#t.hasAttribute("data-selection-menu"))return;let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){et(this,n);return}}let i=t.target.closest?.("mark[data-hn-id]");if(i){let s=i.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#w("highlights:clicked",{id:s});let o=i.getBoundingClientRect();ei(o,this,n);return}}if(!this.#s){let s=this.#d(t.clientX,t.clientY);if(s){this.#w("highlights:clicked",{id:s.id});let n=K(this.#t,s.startOffset,s.endOffset);n&&ei(n.getBoundingClientRect(),this,s)}}}#d(t,e){for(let i of this.#r){let s=K(this.#t,i.startOffset,i.endOffset);if(!s)continue;let n=s.getClientRects();for(let o of n)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return i}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let i=e.getRangeAt(0);if(!this.#t.contains(i.commonAncestorContainer))return;let s=ms(this.#t,i.startContainer,i.startOffset),n=ms(this.#t,i.endContainer,i.endOffset);if(s<0||n<0||s>=n)return;let o=e.toString().trim(),a={id:jn(),startOffset:s,endOffset:n,text:o,color:t,note:"",created:Date.now()};this.#r.push(a),this.#m(),this.#b(),e.removeAllRanges(),this.#w("highlights:added",{id:a.id,text:o,color:t,note:""}),ii("Highlight added")}_changeColor(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.color=e,this.#m(),this.#b())}_updateNote(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.note=e,this.#m(),this.#y(),this.#w("highlights:note-changed",{id:t,note:e}),ii("Note saved"))}async#u(){let t=await T.get(us,this.#e);if(!t||!Array.isArray(t.highlights))return;let e=ps(this.#t.textContent);t.contentHash&&t.contentHash!==e?(this.#r=t.highlights.filter(i=>{let s=K(this.#t,i.startOffset,i.endOffset);return s?s.toString().trim()===i.text:!1}),this.#m()):this.#r=t.highlights}#m(){let t={version:1,contentHash:ps(this.#t.textContent),highlights:this.#r};T.set(us,this.#e,t).catch(()=>{})}#b(){this.#s?this.#p():this.#v(),this.#y()}#v(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#r){let i=K(this.#t,e.startOffset,e.endOffset);i&&t.has(e.color)&&t.get(e.color).push(i)}for(let[e,i]of t){let s=`hn-${e}`;i.length===0?CSS.highlights.delete(s):CSS.highlights.set(s,new Highlight(...i))}}#p(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let i=e.parentNode;for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}),this.#t.normalize();let t=[...this.#r].sort((e,i)=>i.startOffset-e.startOffset);for(let e of t){let i=K(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=gs(this.#t,e.color),n=document.createElement("mark");n.dataset.hnId=e.id,n.dataset.hnColor=e.color,s&&(n.style.backgroundColor=s,n.style.textDecorationColor=s);try{i.surroundContents(n)}catch{let o=i.extractContents();n.appendChild(o),i.insertNode(n)}}}#g(){for(let t of this.#l)t.remove();this.#l=[]}#y(){if(this.#g(),this.#r.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");for(let e of this.#r){let i=K(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=i.getClientRects();if(s.length===0)continue;let n=s[0],o=this.#t.getBoundingClientRect(),a=n.top-o.top,l=document.createElement("span");l.className="hn-margin-annotation",l.dataset.hnId=e.id,l.setAttribute("aria-hidden","true"),l.style.top=`${a}px`,e.note?(l.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',l.classList.add("hn-has-note")):l.textContent="You highlighted",this.#t.appendChild(l),this.#l.push(l)}}#w(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},si=new WeakMap;function q(r){if(si.has(r))return si.get(r);let t=new ni(r);return si.set(r,t),t}function fs(r=document){r.querySelectorAll(ri).forEach(t=>{t.hasAttribute("data-highlights-init")||q(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>fs()):fs();var In=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(ri)&&q(i),i.querySelectorAll(ri).forEach(s=>{s.hasAttribute("data-highlights-init")||q(s)})}});In.observe(document.documentElement,{childList:!0,subtree:!0});var Dn=["yellow","green","blue","pink"],oi=class extends m{#t=null;#e="yellow";#i=!1;#n=null;setup(){this.#i=!!this.closest("selection-menu"),this.#i?this.#r():this.#o()}teardown(){this.#t?.destroy(),this.#t=null,this.#n?.remove(),this.#n=null}#r(){let t=this.#l(),e=document.createElement("button");e.type="button",e.setAttribute("aria-label","Highlight selection");let i=document.createElement("icon-wc");i.setAttribute("name","highlighter"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i),e.addEventListener("click",s=>{s.stopPropagation(),this.#s()}),this.appendChild(e),this.#n=document.createElement("div"),this.#n.className="highlight-color-dropdown",this.#n.setAttribute("role","group"),this.#n.setAttribute("aria-label","Highlight color"),this.#n.hidden=!0,t.forEach(s=>{let n=document.createElement("button");n.type="button",n.className="highlight-color-swatch",n.dataset.color=s,n.setAttribute("aria-label",`${s}`),n.setAttribute("aria-pressed",s===this.#e?"true":"false"),n.style.backgroundColor=`var(--highlight-${s})`,n.addEventListener("click",o=>{o.stopPropagation(),this.#e=s,this.#n.querySelectorAll(".highlight-color-swatch").forEach(a=>a.setAttribute("aria-pressed",a.dataset.color===s?"true":"false")),this.#n.hidden=!0,this.#a()}),this.#n.appendChild(n)}),this.appendChild(this.#n)}#s(){this.#n&&(this.#n.hidden=!this.#n.hidden)}#a(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target;if(i.hasAttribute("data-highlights-init"))this.#t||(this.#t=q(i));else{let s=this.getAttribute("storage-key")||"";i.setAttribute("data-highlights",s),this.hasAttribute("colors")&&i.setAttribute("data-highlights-colors",this.getAttribute("colors")),this.#t=q(i)}this.#t._createFromSelection(this.#e),t.dismiss()}#o(){let t=this.#c();if(!t)return!1;let e=this.getAttribute("storage-key")||"";t.setAttribute("data-highlights",e),this.hasAttribute("colors")&&t.setAttribute("data-highlights-colors",this.getAttribute("colors")),this.hasAttribute("readonly")&&t.setAttribute("data-highlights-readonly",""),this.#t=q(t)}#c(){let t=this.getAttribute("for");return t?document.getElementById(t):this.firstElementChild}#l(){let t=this.getAttribute("colors");return t?t.split(",").map(e=>e.trim()).filter(Boolean):[...Dn]}getHighlights(){return this.#t?.getHighlights()??[]}removeHighlight(t){this.#t?.removeHighlight(t)}clearAll(){this.#t?.clearAll()}exportHighlights(){return this.#t?.exportHighlights()??'{"version":1,"highlights":[]}'}importHighlights(t){this.#t?.importHighlights(t)}};p("highlight-wc",oi);var vs=8,ai=8,li=class extends m{#t=null;#e=new Set;#i=!1;setup(){this.hidden=!0,this.#n(),this.listen(document,"pointerup",this.#r),this.listen(document,"pointerdown",this.#c),this.listen(document,"keydown",this.#l),this.id&&new MutationObserver(()=>this.#n()).observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]})}getSelection(){return this.#t?{...this.#t}:null}dismiss(){this.#o()}#n(){this.#e.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#e.add(e),e.hasAttribute("data-selection-menu")||e.setAttribute("data-selection-menu",this.id||""))}this.id&&document.querySelectorAll(`[data-selection-menu="${this.id}"]`).forEach(e=>{this.#e.add(e)})}#r=()=>{requestAnimationFrame(()=>{this.isConnected&&this.#s()})};#s(){let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let a of this.#e)if(a.contains(s)){n=a;break}if(!n)return;let o=t.toString().trim();this.#t={range:e.cloneRange(),text:o,target:n},this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#t.range,text:o,target:n},bubbles:!0})),this.#a(e.getBoundingClientRect())}#a(t){this.hidden=!1,this.#i=!0,requestAnimationFrame(()=>{let e=this.getBoundingClientRect(),i=e.width||200,s=e.height||40,n=t.top-s-vs,o=t.left+t.width/2-i/2;n<ai&&(n=t.bottom+vs);let a=window.innerWidth-i-ai;o=Math.max(ai,Math.min(o,a)),this.style.top=`${n}px`,this.style.left=`${o}px`})}#o(){this.hidden=!0,this.#i=!1,this.#t=null,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0}))}#c=t=>{this.#i&&(this.contains(t.target)||this.#o())};#l=t=>{t.key==="Escape"&&this.#i&&this.#o()}};p("selection-menu",li);var ci=class extends m{#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.#e()):t.addEventListener("click",()=>this.#i()),this.appendChild(t)}#e(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target;i.hasAttribute("data-highlights-init")||i.setAttribute("data-highlights","");let s=q(i),n=s.getHighlights(),o=null;for(let a of n)if(e.text&&a.text&&e.text.includes(a.text.slice(0,20))){o=a;break}if(!o){s._createFromSelection("yellow");let a=s.getHighlights();o=a[a.length-1]}o&&et(s,o),t.dismiss()}#i(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let i=q(e),s=i.getHighlights(),n=s.filter(o=>o.note);n.length>0?et(i,n[0]):s.length>0&&et(i,s[0])}};p("note-wc",ci);var hi=class extends m{setup(){let t=document.createElement("button");t.type="button";let e=document.createElement("icon-wc");e.setAttribute("name","message-circle"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e);let i=this.closest("selection-menu")?.getAttribute("for"),s=this.closest("review-surface")||(i?document.querySelector(`review-surface[for="${i}"]`):null);s?(t.setAttribute("aria-label","Add comment"),t.addEventListener("click",()=>this.#t(s))):(t.setAttribute("aria-label","Comments not available"),t.style.opacity="0.4",t.setAttribute("title","Wrap content in <review-surface> to enable comments")),this.appendChild(t)}#t(t){let e=this.closest("selection-menu");if(!e)return;let i=e.getSelection();if(!i)return;let s=i.range.getBoundingClientRect(),n=t.getBoundingClientRect(),o=(s.left+s.width/2-n.left)/n.width*100,a=(s.top-n.top)/n.height*100;typeof t.addPin=="function"&&t.addPin({x:o,y:a,text:i.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:i.text,x:o,y:a},bubbles:!0})),e.dismiss()}};p("comment-wc",hi);var ui='track[kind="chapters"][data-chapter-list]';function ys(r=document){r.querySelectorAll(ui).forEach(t=>di(t))}function di(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?ws(t,e):r.addEventListener("load",()=>ws(t,e),{once:!0})}function ws(r,t){let e=t.cues;if(!e||e.length===0)return;let i=document.createElement("nav");i.setAttribute("aria-label","Video chapters"),i.classList.add("chapter-list");let s=document.createElement("ol");for(let o of e){let a=document.createElement("li"),l=document.createElement("button");l.type="button";let c=document.createElement("span");c.textContent=o.text;let h=document.createElement("time");h.textContent=On(o.startTime),h.setAttribute("datetime",Fn(o.startTime)),l.appendChild(c),l.appendChild(h),l.addEventListener("click",()=>{r.currentTime=o.startTime,r.paused&&r.play()}),a.appendChild(l),s.appendChild(a)}i.appendChild(s),r.insertAdjacentElement("afterend",i);let n=null;r.addEventListener("timeupdate",()=>{let o=r.currentTime,a=-1;for(let l=0;l<e.length;l++)if(o>=e[l].startTime&&o<e[l].endTime){a=l;break}n&&n.removeAttribute("data-active"),a>=0?(n=s.children[a],n.setAttribute("data-active","")):n=null})}function On(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function Fn(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ys()):ys();var Hn=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.(ui)&&di(i),i.querySelectorAll?.(ui).forEach(s=>di(s))}});Hn.observe(document.documentElement,{childList:!0,subtree:!0});var it="[data-command], [commandfor]",Un="Page Actions",R=new Map;function Nt(r){if(R.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||Un,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=Y(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};R.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function pi(r){let t=R.get(r);t&&(t.unbind?.(),R.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function Vn(){let r=new Map;for(let t of R.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function ks(r=document){r.querySelectorAll(it).forEach(Nt)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ks()):ks();var Wn=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(it)&&Nt(i),i.querySelectorAll(it).forEach(Nt)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;R.has(i)&&pi(i),i.querySelectorAll(it).forEach(s=>{R.has(s)&&pi(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(it)&&!R.has(e)?Nt(e):!e.matches(it)&&R.has(e)&&pi(e)}}});Wn.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function Gn(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||R.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||R.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:Vn,scanAutoDiscoverable:Gn};var Kn=window.matchMedia("(prefers-reduced-motion: reduce)");function xs(){return Kn.matches||document.documentElement.hasAttribute("data-motion-reduced")}var As=0,A={_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_transitionCleanups:new WeakMap,_observer:null,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{(e.getAttribute("data-effect")||"").split(/\s+/).includes(r)&&this._initEffect(e,r)})},trigger(r,t){this._triggers.set(r,t)},transition(r,t){this._transitions.set(r,t)},uid(r){return r.id?r.id:(r._vbUid||(As++,r._vbUid=`vb-${As}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){return document.startViewTransition?document.startViewTransition(r):r()},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{for(let i of e){if(i.type==="childList"){for(let s of i.addedNodes)s.nodeType===Node.ELEMENT_NODE&&this._processTree(s);for(let s of i.removedNodes)s.nodeType===Node.ELEMENT_NODE&&this._cleanupTree(s)}if(i.type==="attributes"){let s=i.target;i.attributeName==="data-effect"&&this._reconcileEffects(s),i.attributeName==="data-trigger"&&this._reconcileTrigger(s),i.attributeName==="data-stagger"&&this._processStagger(s),i.attributeName==="data-transition"&&this._processTransition(s)}}});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]})},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},getTime(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();if(!s)return i;let n=parseFloat(s);return Number.isFinite(n)?/s\s*$/.test(s)&&!/ms\s*$/.test(s)?n*1e3:n:i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:xs,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(r.hasAttribute("data-effect-processed"))return;r.setAttribute("data-effect-processed","");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;xs();let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e){this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);for(let s of i){let n=s.indexOf(":"),o=n>-1?s.slice(0,n):s,a=n>-1?s.slice(n+1):null,l=this._triggers.get(o);if(!l)continue;let c=l(r,()=>this._activateEffects(r),a);if(c){let h=this._triggerCleanups.get(r);if(h){let u=h;this._triggerCleanups.set(r,()=>{u(),c()})}else this._triggerCleanups.set(r,c)}}},_activateEffects(r){r.setAttribute("data-effect-active","");let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r))},_reconcileEffects(r){let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);r.hasAttribute("data-effect-processed")||(r.setAttribute("data-effect-processed",""),this._wireTrigger(r,t))},_reconcileTrigger(r){let t=this._triggerCleanups.get(r);t&&(t(),this._triggerCleanups.delete(r));let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_processStagger(r){let t=r.children;for(let e=0;e<t.length;e++)t[e].style.setProperty("--vb-stagger-index",String(e))},_processTransition(r){if(r.hasAttribute("data-transition-processed"))return;r.setAttribute("data-transition-processed","");let t=r.getAttribute("data-transition");if(!t)return;let e=this._transitions.get(t);if(e){let i=e(r);i&&this._transitionCleanups.set(r,i)}else r.style.viewTransitionName=`${t}-${this.uid(r)}`},_cleanupTransition(r){let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),r.style.viewTransitionName=""}};typeof window<"u"&&(window.VB=A);A.effect("glitch",r=>{r.hasAttribute("data-effect-glitch-init")||(r.setAttribute("data-effect-glitch-init",""),r.setAttribute("data-glitch-text",r.textContent))});function Xn(r){let t=r.textContent;r.setAttribute("aria-label",t),r.innerHTML="",t.split(/(\s+)/).forEach((i,s)=>{if(/^\s+$/.test(i)){r.appendChild(document.createTextNode(i));return}let n=document.createElement("span");n.className="vb-blur-chunk",n.textContent=i,n.style.setProperty("--i",String(Math.floor(s/2))),n.setAttribute("aria-hidden","true"),r.appendChild(n)})}function Jn(r){let t=r.textContent;r.setAttribute("aria-label",t);let e=t.split(/\s+/).filter(Boolean),i=[],s="",n=r.offsetWidth,o=document.createElement("span");o.style.visibility="hidden",o.style.position="absolute",o.style.font=getComputedStyle(r).font,document.body.appendChild(o),e.forEach(a=>{let l=s?s+" "+a:a;o.textContent=l,o.offsetWidth>n&&s?(i.push(s),s=a):s=l}),s&&i.push(s),document.body.removeChild(o),i.length===0&&i.push(t),r.innerHTML="",i.forEach((a,l)=>{let c=document.createElement("span");c.className="vb-blur-chunk",c.textContent=a,c.style.setProperty("--i",String(l)),c.setAttribute("aria-hidden","true"),r.appendChild(c),l<i.length-1&&r.appendChild(document.createTextNode(" "))})}A.effect("blur-reveal",r=>{if(r.hasAttribute("data-effect-blur-reveal-init")||(r.setAttribute("data-effect-blur-reveal-init",""),A.prefersReducedMotion()))return;let t=r.classList.contains("line")?"line":"word",e=A.params(r).get("blur-reveal-delay")||"80ms";return r.style.setProperty("--blur-delay",e),t==="line"?Jn(r):Xn(r),{activate(){r.setAttribute("data-effect-active","")},cleanup(){}}});function Yn(r,t,e,i){let s=0;function n(){s<=t.length?(r.firstChild.textContent=t.slice(0,s),s++,setTimeout(n,e)):i&&i()}n()}function Zn(r,t,e){let i=r.firstChild.textContent,s=i.length;function n(){s>=0?(r.firstChild.textContent=i.slice(0,s),s--,setTimeout(n,t/2)):e&&e()}n()}function Qn(r){let t=r.getAttribute("data-typewriter-text"),e=A.params(r),i=e.getTime("typewriter-speed",50),s=e.getTime("typewriter-delay",0),o=r.classList.contains("loop")?2e3:null;r.textContent="";let a=document.createTextNode("");if(r.appendChild(a),!r.classList.contains("no-cursor")){let h=document.createElement("span");h.className="vb-typewriter-cursor",h.textContent="|",h.setAttribute("aria-hidden","true"),r.appendChild(h)}function c(){Yn(r,t,i,()=>{o!==null&&setTimeout(()=>{Zn(r,i,()=>{setTimeout(c,400)})},o)})}setTimeout(c,s)}A.effect("typewriter",r=>{if(r.hasAttribute("data-effect-typewriter-init"))return;r.setAttribute("data-effect-typewriter-init","");let t=r.textContent.trim();if(r.setAttribute("data-typewriter-text",t),r.setAttribute("aria-label",t),!A.prefersReducedMotion())return r.textContent="",{activate(){Qn(r)},cleanup(){}}});var Es="!<>-_\\/[]{}=+*^?#";function Ss(r){return r[Math.floor(Math.random()*r.length)]}function to(r){let t=r.getAttribute("data-scramble-text"),e=A.params(r),i=e.getTime("scramble-duration",1500),s=e.get("scramble-chars")||Es,n=e.getTime("scramble-speed",30),o=t.length,a=0,l=Math.ceil(i/n);function c(){let h=a/l,u=Math.floor(h*o),d="";for(let f=0;f<o;f++)f<u?d+=t[f]:t[f]===" "?d+=" ":d+=Ss(s);r.textContent=d,a++,a<=l?setTimeout(c,n):r.textContent=t}c()}A.effect("scramble",r=>{if(r.hasAttribute("data-effect-scramble-init"))return;r.setAttribute("data-effect-scramble-init","");let t=r.textContent.trim();if(r.setAttribute("data-scramble-text",t),r.setAttribute("aria-label",t),A.prefersReducedMotion())return;let e=A.params(r).get("scramble-chars")||Es;return r.textContent=t.replace(/\S/g,()=>Ss(e)),{activate(){to(r)},cleanup(){}}});A.effect("animate-image",r=>{if(r.hasAttribute("data-effect-animate-image-init"))return;r.setAttribute("data-effect-animate-image-init","");let t=r,e=document.createElement("div");if(e.className="animate-image-wrapper",!t.parentNode)return;t.parentNode.insertBefore(e,t),e.appendChild(t);let i=document.createElement("button");i.type="button",i.className="animate-image-toggle",i.setAttribute("aria-label","Pause animation"),e.appendChild(i);let s=t.src,n=null,o=!1;function a(){let u=document.createElement("canvas");u.width=t.naturalWidth||t.width,u.height=t.naturalHeight||t.height;let d=u.getContext("2d");if(d){d.drawImage(t,0,0);try{n=u.toDataURL("image/png")}catch{n=null}}}function l(){o||(o=!0,t.setAttribute("data-animate-image-paused",""),i.setAttribute("aria-label","Play animation"),i.classList.add("paused"),n&&(t.src=n))}function c(){o&&(o=!1,t.removeAttribute("data-animate-image-paused"),i.setAttribute("aria-label","Pause animation"),i.classList.remove("paused"),t.src=s)}i.addEventListener("click",()=>o?c():l()),t.complete&&t.naturalWidth?a():t.addEventListener("load",a,{once:!0});let h=window.matchMedia("(prefers-reduced-motion: reduce)");return(h.matches||document.documentElement.dataset.motionReduced!==void 0)&&(t.complete?(a(),l()):t.addEventListener("load",()=>{a(),l()},{once:!0})),h.addEventListener("change",u=>{u.matches&&l()}),t.hasAttribute("data-animate-image-paused")&&(t.complete?(a(),o=!1,l()):t.addEventListener("load",()=>{a(),o=!1,l()},{once:!0})),{cleanup(){e.parentNode&&(e.parentNode.insertBefore(t,e),e.remove())}}});var jt=new Map,mi=null,zt=!1;function eo(r){for(let[t,e]of jt)r.querySelectorAll(t).forEach(e)}function io(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of jt)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function so(){mi||(mi=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)io(e)}),mi.observe(document.documentElement,{childList:!0,subtree:!0}))}function ro(){zt||(zt=!0,eo(document))}function Cs(r,t){jt.set(r,t),so(),zt||document.readyState!=="loading"?(zt=!0,document.querySelectorAll(r).forEach(t)):jt.size===1&&document.addEventListener("DOMContentLoaded",ro)}var Pt=null;async function no(){if(Pt)return;Pt=(await Promise.resolve().then(()=>(Gt(),Wt))).resolveEmoji}var oo="[data-emoji]",F=/:([a-z0-9_+-]+):/g,ao=new Set(["SCRIPT","STYLE","CODE","PRE","TEXTAREA"]),lo=new Set(["INPUT","TEXTAREA"]),co=100;function ho(r){if(r.hasAttribute("data-emoji-init"))return;if(r.setAttribute("data-emoji-init",""),lo.has(r.tagName)){uo(r);return}let t=r.getAttribute("data-emoji-unknown")||"keep";if($s(r,t),r.getAttribute("data-emoji-scan")==="observe"){let e=null;new MutationObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{$s(r,t),e=null},co)}).observe(r,{childList:!0,subtree:!0,characterData:!0})}}function uo(r){let t=!1;r.addEventListener("compositionstart",()=>{t=!0}),r.addEventListener("compositionend",()=>{t=!1,fi(r)}),r.addEventListener("input",()=>{t||fi(r)}),r.value&&F.test(r.value)&&(F.lastIndex=0,fi(r))}function fi(r){let t=r.value;F.lastIndex=0;let e,i="",s=0,n=0,o=r.selectionStart??t.length,a=!1;for(;(e=F.exec(t))!==null;){let c=e[0],h=e[1],u=Pt(h);if(i+=t.slice(s,e.index),u){i+=u.emoji,a=!0;let d=e.index+c.length;o>=d?n+=c.length-u.emoji.length:o>e.index&&(n+=o-e.index-u.emoji.length)}else i+=c;s=e.index+c.length}if(!a)return;i+=t.slice(s),r.value=i;let l=Math.max(0,o-n);r.setSelectionRange(l,l)}function $s(r,t){let e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(s){let n=s.parentElement;return!n||ao.has(n.tagName)||n.isContentEditable||n.hasAttribute("data-emoji-processed")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];for(;e.nextNode();)F.test(e.currentNode.textContent??"")&&i.push(e.currentNode),F.lastIndex=0;for(let s of i)po(s,t)}function po(r,t){let e=r.textContent;F.lastIndex=0;let i,s=0,n=[],o=!1;for(;(i=F.exec(e))!==null;){let a=i[1],l=Pt(a);i.index>s&&n.push(e.slice(s,i.index)),l?(n.push(l.emoji),o=!0):t==="strip"?o=!0:n.push(i[0]),s=i.index+i[0].length}o&&(s<e.length&&n.push(e.slice(s)),r.textContent=n.join(""))}function mo(r){no().then(()=>ho(r))}Cs(oo,mo);
|
|
1265
1345
|
//# sourceMappingURL=vanilla-breeze-extras.js.map
|