sliccy 4.20.0 → 4.22.0
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/README.md +1 -1
- package/dist/ui/assets/{account-store-C8g3fKdM.js → account-store-BbOugMGQ.js} +2 -2
- package/dist/ui/assets/{account-store-CgHBjbbG.js → account-store-IyPhtzhJ.js} +2 -2
- package/dist/ui/assets/{adobe-5CUA8f3A.js → adobe-DgwUObWJ.js} +1 -1
- package/dist/ui/assets/{adobe-DNhzuVou.js → adobe-VPKLgSWT.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-76w-FNYN.js → agent-message-to-chat-y24E_cxL.js} +1 -1
- package/dist/ui/assets/{apps-DbxFmmuv.js → apps-DUeem2tA.js} +1 -1
- package/dist/ui/assets/{azure-openai-I_2Fr2ei.js → azure-openai-BZIgRwqd.js} +1 -1
- package/dist/ui/assets/{azure-openai-C08V02pE.js → azure-openai-DoRxmkwZ.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-BjZO27m1.js → bsh-watchdog-C9h2IaS0.js} +1 -1
- package/dist/ui/assets/{composer-speech-0Ot5cPsk.js → composer-speech-DYshRh0w.js} +1 -1
- package/dist/ui/assets/{connect-surface-DYRt9iDK.js → connect-surface-CVGFqUbD.js} +1 -1
- package/dist/ui/assets/dip-CvR0Cqr1.js +1 -0
- package/dist/ui/assets/{dist-DRIqTlgR.js → dist-BRXlUPtR.js} +1 -1
- package/dist/ui/assets/{dist-DLpXvbWf.js → dist-CFUSBJZQ.js} +1 -1
- package/dist/ui/assets/{es-DoaY-_o8.js → es-B9Xns6VP.js} +1 -1
- package/dist/ui/assets/{fs-BFKzxjb8.js → fs-BCZV-DeG.js} +2 -2
- package/dist/ui/assets/{fs-CnhcYjgs.js → fs-BWEPe_lI.js} +1 -1
- package/dist/ui/assets/{github-3ZZMkAon.js → github-BD8TM8E4.js} +1 -1
- package/dist/ui/assets/{github-DC0rxciH.js → github-D1-sIysd.js} +2 -2
- package/dist/ui/assets/{github-copilot-DBxyYzi7.js → github-copilot-BeL7S_RM.js} +1 -1
- package/dist/ui/assets/{github-copilot-C1MzZObd.js → github-copilot-CVOOYEif.js} +1 -1
- package/dist/ui/assets/{hear-CRNbaNdj.js → hear-DD8kXpu3.js} +1 -1
- package/dist/ui/assets/{kernel-worker-DlmwwkzH.js → kernel-worker-B1z5Mep_.js} +18 -18
- package/dist/ui/assets/{kokoro-engine-C7USyEPM.js → kokoro-engine-BAKhtzKA.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-Ch4_y-93.js → lick-ws-bridge-C76WNbyz.js} +1 -1
- package/dist/ui/assets/{local-llm-C-giTmpp.js → local-llm-Bx2yDR6Y.js} +1 -1
- package/dist/ui/assets/{main-z68dFlZH.js → main-ZPWrsiEH.js} +3 -3
- package/dist/ui/assets/{mount-BIjhLD3y.js → mount-BZGOqIjJ.js} +1 -1
- package/dist/ui/assets/{mount-Dhwo-lkx.js → mount-CJTp3rsY.js} +2 -2
- package/dist/ui/assets/{new-session-n9Pw21UG.js → new-session-Boyp0jbl.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-BffIMYJb.js → oauth-bootstrap-B-FGqNIA.js} +2 -2
- package/dist/ui/assets/{openai-codex-MTN7ECAs.js → openai-codex-2NIZy82T.js} +1 -1
- package/dist/ui/assets/{openai-codex-C_G67oth.js → openai-codex-kCbaxA3p.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-D6WaEGtJ.js → panel-rpc-handlers-DB-Ug9qU.js} +1 -1
- package/dist/ui/assets/{provider-WPgAB5r5.js → provider-C-QlPwy9.js} +1 -1
- package/dist/ui/assets/{provider-BqHRpW7H.js → provider-Dz3gmrdh.js} +2 -2
- package/dist/ui/assets/provider-store-access-DoN2yB7H.js +1 -0
- package/dist/ui/assets/provider-store-access-KBTPjy08.js +1 -0
- package/dist/ui/assets/{providers-nT4uopjz.js → providers-wvXqnMMs.js} +1 -1
- package/dist/ui/assets/{quick-llm-BlS37CdD.js → quick-llm-BrfU7BId.js} +1 -1
- package/dist/ui/assets/session-freezer-BXDSvoMT.js +1 -0
- package/dist/ui/assets/setup-sudo-DQpQyGGT.js +1 -0
- package/dist/ui/assets/{speak-CkGYh6VK.js → speak-BfxsOvBC.js} +1 -1
- package/dist/ui/assets/speech-CqQdPtyQ.js +1 -0
- package/dist/ui/assets/{sprinkle-manager-BsJQCdnC.js → sprinkle-manager-D9bGw9q8.js} +1 -1
- package/dist/ui/assets/{store-3AchXz_a.js → store-CvNWCf_K.js} +1 -1
- package/dist/ui/assets/{sudo-CiBDfApM.js → sudo-DNg2E0j8.js} +1 -1
- package/dist/ui/assets/{transformers-env-PHAO9_dU.js → transformers-env-Vns8FfCl.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-BMjyrLi8.js → tray-leave-runtime-Dblg03Av.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-DVEgwJRE.js → upgrade-detection-CWy_ieEK.js} +1 -1
- package/dist/ui/assets/wc-attach-D2l7z2MI.js +13 -0
- package/dist/ui/assets/{wc-detached-JemF2Bdg.js → wc-detached-CNJ_gW__.js} +1 -1
- package/dist/ui/assets/{wc-extension-DRCc4zkV.js → wc-extension-BwrsCjZl.js} +2 -2
- package/dist/ui/assets/{wc-live-0QxX2QkK.js → wc-live-DjrJGzlN.js} +5 -5
- package/dist/ui/assets/{wc-nav-6YgjNKht.js → wc-nav-BmtdkU_z.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-QuN4uOHp.js → wc-onboarding-Ct6Arm5m.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-DiAF2RXS.js → wc-placeholder-CWOudEXO.js} +3 -3
- package/dist/ui/assets/{wc-settings-LlERspSV.js → wc-settings-3CEFgt8u.js} +2 -2
- package/dist/ui/assets/{wc-shell-B2CX4Qtl.js → wc-shell-CjN33a2b.js} +307 -103
- package/dist/ui/assets/{wc-sprinkles-C3xVtp0L.js → wc-sprinkles-smmPR4Ja.js} +2 -2
- package/dist/ui/assets/{wc-tray-DtlggGO8.js → wc-tray-CVAaAkxz.js} +3 -3
- package/dist/ui/assets/{xai-grok-D_Uh_K8H.js → xai-grok-CcpOkuUW.js} +1 -1
- package/dist/ui/assets/{xai-grok-Cqhj-JuO.js → xai-grok-DxDfANmg.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/ui/packages/webapp/index.html +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/dip-C4SxeEOj.js +0 -1
- package/dist/ui/assets/provider-store-access-BKJ1pLa1.js +0 -1
- package/dist/ui/assets/provider-store-access-Bs3EiEzd.js +0 -1
- package/dist/ui/assets/session-freezer-12wEjTPP.js +0 -1
- package/dist/ui/assets/setup-sudo-Bgt5hM-V.js +0 -1
- package/dist/ui/assets/speech-GZe1rUoJ.js +0 -1
- package/dist/ui/assets/wc-attach-WQfsCkBz.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/quick-llm-
|
|
2
|
-
import{n as e}from"./chunk-aKtaBQYM.js";import{t}from"./preload-helper-zJ_50EbN.js";import{s as n}from"./main-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/quick-llm-BrfU7BId.js","assets/chunk-aKtaBQYM.js","assets/account-store-IyPhtzhJ.js","assets/preload-helper-zJ_50EbN.js","assets/dist-BmWy99kl.js","assets/event-stream-BJI_nGaK.js","assets/json-parse-BUunmmNl.js","assets/__vite-browser-external-C7iut881.js","assets/context-compaction-CFWyOzX1.js","assets/logger-DDBAeTLF.js","assets/src-DlEHAkLd.js","assets/panel-rpc-DqT2FG7c.js","assets/bedrock-camp-9-QEmC9Z.js","assets/transform-messages-DzB_lMo-.js","assets/tool-ui-YOPqzMmL.js","assets/icons-BU6llBsN.js","assets/main-ZPWrsiEH.js","assets/modulepreload-polyfill-Dezn_h7o.js","assets/clipboard-DgFtRQbq.js","assets/llm-session-id-DVmZ9C2t.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e}from"./chunk-aKtaBQYM.js";import{t}from"./preload-helper-zJ_50EbN.js";import{s as n}from"./main-ZPWrsiEH.js";import{n as r,r as i,t as a}from"./speech-CqQdPtyQ.js";import{t as o}from"./soundscape-cues-5_sT5Un6.js";import{n as s,t as c}from"./icons-BU6llBsN.js";var l=e({applyDictationMarkers:()=>m,consumeDictationFirst:()=>ee,resetDictationPriming:()=>te,stripDictationMarkers:()=>h}),u=`◁This message has been sent through text to speech, consider possible phonetic alternatives and transcription errors. Future dictated messages will have the 🎙️ emoji appended. Your responses to dictated messages will be read out loud, avoid urls, acronyms, numbers, formatting▷`,d=/\uD83C\uDF99\uFE0F?/g,f=/\u25C1[\s\S]*?\u25B7/g,p=!0;function m(e,t){let n=e.endsWith(` `)?e:`${e} `;return t?`${n}\uD83C\uDF99\uFE0F${u}`:`${n}\uD83C\uDF99\uFE0F`}function h(e){return e.replace(f,``).replace(d,``).replace(/[ \t]+$/g,``).trimEnd()}function ee(){return p?(p=!1,!0):!1}function te(){p=!0}var ne=new Set([`webhook`,`cron`,`sprinkle`,`fswatch`,`session-reload`,`navigate`,`upgrade`,`workflow`,`scoop-notify`,`scoop-idle`,`scoop-wait`,`sudo-request`]);function g(e){return e!=null&&ne.has(e)}function _(e,t){typeof customElements>`u`||customElements.get(e)||customElements.define(e,t)}function v(e,t){for(let n of t)n==null||n===!1||e.append(typeof n==`string`||typeof n==`number`?document.createTextNode(String(n)):n)}function y(e,t,...n){let r=document.createElement(e);if(t)for(let[e,n]of Object.entries(t))n==null||n===!1||(e===`class`?r.className=String(n):r.setAttribute(e,n===!0?``:String(n)));return v(r,n),r}function b(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var re=20,ie=16,ae=18,x=b(`
|
|
3
3
|
:host{display:block;width:100%;
|
|
4
4
|
--am-accent:var(--accent,#3b63fb);
|
|
5
5
|
--am-accent-subtle:color-mix(in oklab,var(--am-accent) 12%,var(--canvas,#fff));
|
|
@@ -55,7 +55,7 @@ import{n as e}from"./chunk-aKtaBQYM.js";import{t}from"./preload-helper-zJ_50EbN.
|
|
|
55
55
|
.sep{height:1px;background:var(--line,#e1e1e1);margin:6px 4px;}
|
|
56
56
|
.drop{position:absolute;inset:0;border-radius:10px;display:none;align-items:center;justify-content:center;text-align:center;background:var(--am-accent-subtle);border:2px dashed var(--am-accent);color:var(--am-accent);font-size:13px;font-weight:600;pointer-events:none;}
|
|
57
57
|
:host([data-dropping]) .drop{display:flex;}
|
|
58
|
-
`),oe=[{kind:`file`,label:`Files`,icon:`file`,entries:[{id:`/workspace/README.md`,label:`README.md`,sub:`/workspace`},{id:`/workspace/src/main.ts`,label:`main.ts`,sub:`/workspace/src`},{id:`/workspace/src/orchestrator.ts`,label:`orchestrator.ts`,sub:`/workspace/src`},{id:`/workspace/notes/launch-plan.md`,label:`launch-plan.md`,sub:`/workspace/notes`},{id:`/shared/CLAUDE.md`,label:`CLAUDE.md`,sub:`/shared`},{id:`/tmp/screenshot-3.png`,label:`screenshot-3.png`,sub:`/tmp`}]},{kind:`skill`,label:`Skills`,icon:`sparkles`,entries:[{id:`slicc-handoff`,label:`slicc-handoff`,sub:`Continue work in the SLICC browser agent`},{id:`playwright-cli`,label:`playwright-cli`,sub:`Automate browser interactions`},{id:`mixtape`,label:`mixtape`,sub:`Curate themed music playlists`},{id:`wavespeed`,label:`wavespeed`,sub:`Generate images, video and speech`},{id:`save-the-cat`,label:`save-the-cat`,sub:`Screenwriting beat sheets`}]},{kind:`conversation`,label:`Conversations`,icon:`message-square`,entries:[{id:`c1`,label:`Dark mode toggle`,sub:`Frozen · 2h ago`},{id:`c2`,label:`Refactor the mount backend`,sub:`Frozen · yesterday`},{id:`c3`,label:`Add slash menu (declined)`,sub:`Frozen · 3 days ago`},{id:`c4`,label:`WebGL shader walkthrough`,sub:`Frozen · last week`}]}],
|
|
58
|
+
`),oe=[{kind:`file`,label:`Files`,icon:`file`,entries:[{id:`/workspace/README.md`,label:`README.md`,sub:`/workspace`},{id:`/workspace/src/main.ts`,label:`main.ts`,sub:`/workspace/src`},{id:`/workspace/src/orchestrator.ts`,label:`orchestrator.ts`,sub:`/workspace/src`},{id:`/workspace/notes/launch-plan.md`,label:`launch-plan.md`,sub:`/workspace/notes`},{id:`/shared/CLAUDE.md`,label:`CLAUDE.md`,sub:`/shared`},{id:`/tmp/screenshot-3.png`,label:`screenshot-3.png`,sub:`/tmp`}]},{kind:`skill`,label:`Skills`,icon:`sparkles`,entries:[{id:`slicc-handoff`,label:`slicc-handoff`,sub:`Continue work in the SLICC browser agent`},{id:`playwright-cli`,label:`playwright-cli`,sub:`Automate browser interactions`},{id:`mixtape`,label:`mixtape`,sub:`Curate themed music playlists`},{id:`wavespeed`,label:`wavespeed`,sub:`Generate images, video and speech`},{id:`save-the-cat`,label:`save-the-cat`,sub:`Screenwriting beat sheets`}]},{kind:`conversation`,label:`Conversations`,icon:`message-square`,entries:[{id:`c1`,label:`Dark mode toggle`,sub:`Frozen · 2h ago`},{id:`c2`,label:`Refactor the mount backend`,sub:`Frozen · yesterday`},{id:`c3`,label:`Add slash menu (declined)`,sub:`Frozen · 3 days ago`},{id:`c4`,label:`WebGL shader walkthrough`,sub:`Frozen · last week`}]}],se=[{kind:`upload`,icon:`upload`,label:`Upload from this computer`,sub:`Drag & drop or click to browse`,quick:!0},{kind:`capture`,mode:`photo`,icon:`image`,label:`Take a photo`,quick:!0},{kind:`capture`,mode:`screenshot`,icon:`monitor`,label:`Take a screenshot`,quick:!0}];_(`slicc-add-menu`,class extends HTMLElement{static observedAttributes=[`theme`,`global-drop`];#e;#t=null;#n=null;#r=!1;#i=``;#a=0;#o=[];#s=0;#c;#l;#u;#d;#f;#p;#m=e=>{this.#r&&!this.contains(e.target)&&this.close()};#h=!1;#g=0;#_=!1;#v(e){let t=e.dataTransfer?.types;return!!t&&Array.from(t).includes(`Files`)}#y(){this.#r||(this.#_=!0,this.open()),this.setAttribute(`data-dropping`,``)}#b(){this.#g=0,this.removeAttribute(`data-dropping`),this.#_&&(this.#_=!1,this.close())}#x=e=>{this.#v(e)&&(e.preventDefault(),this.#g++,!e.composedPath().includes(this.#u)&&this.#y())};#S=e=>{this.#v(e)&&e.preventDefault()};#C=e=>{this.#v(e)&&(this.#g=Math.max(0,this.#g-1),this.#g===0&&this.#b())};#w=e=>{if(!this.#v(e))return;if(e.preventDefault(),this.#g=0,e.composedPath().includes(this.#u)){this.#_=!1;return}this.removeAttribute(`data-dropping`),this.#_=!1;let t=e.dataTransfer?.files;if(t?.length)for(let e of Array.from(t))this.#z({kind:`upload`,name:e.name,size:e.size,file:e});this.close()};#T(){this.isConnected&&this.hasAttribute(`global-drop`)?this.#E():this.#D()}#E(){if(this.#h)return;this.#h=!0;let e=this.ownerDocument;e.addEventListener(`dragenter`,this.#x),e.addEventListener(`dragover`,this.#S),e.addEventListener(`dragleave`,this.#C),e.addEventListener(`drop`,this.#w)}#D(){if(!this.#h)return;this.#h=!1;let e=this.ownerDocument;e.removeEventListener(`dragenter`,this.#x),e.removeEventListener(`dragover`,this.#S),e.removeEventListener(`dragleave`,this.#C),e.removeEventListener(`drop`,this.#w),this.#g=0,this.#_=!1}constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[x]}connectedCallback(){this.#O(),this.#T()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#m),this.#D()}attributeChangedCallback(e){e===`global-drop`&&this.#T()}get results(){return this.#t}set results(e){this.#t=e,this.#r&&this.#N()}get provider(){return this.#n}set provider(e){this.#n=e,this.#r&&this.#N()}get isOpen(){return this.#r}#O(){let e=y(`input`,{type:`file`,multiple:!0,hidden:!0}),t=y(`div`,{class:`body`}),n=y(`div`,{class:`results`,part:`results`,role:`listbox`},t,y(`div`,{class:`drop`},`Drop files to add`)),r=y(`span`,{class:`ti`},s(`plus`,{size:re})),i=y(`button`,{class:`trigger`,part:`trigger`,"aria-haspopup":`true`,"aria-expanded":`false`,title:`Add to prompt`},r),a=y(`input`,{type:`text`,placeholder:`Search files, skills, conversations…`}),o=y(`div`,{class:`wrap`,part:`wrap`},n,y(`div`,{class:`row`},i,y(`div`,{class:`searchbox`},y(`span`,{class:`si`},s(`search`,{size:ie})),a)));this.#e.replaceChildren(e,o),this.#c=i,this.#l=r,this.#u=o,this.#d=a,this.#f=t,this.#p=e,this.#k(),this.#N()}#k(){this.#c.addEventListener(`click`,()=>this.toggle()),this.#d.addEventListener(`input`,()=>{this.#i=this.#d.value,this.#a=0,this.#N()}),this.#d.addEventListener(`keydown`,e=>this.#L(e)),this.#p.addEventListener(`change`,()=>{for(let e of Array.from(this.#p.files??[]))this.#z({kind:`upload`,name:e.name,size:e.size,file:e});this.#p.value=``,this.close()});for(let e of[`dragenter`,`dragover`])this.#u.addEventListener(e,e=>{e.preventDefault(),this.#r||this.open(),this.setAttribute(`data-dropping`,``)});for(let e of[`dragleave`,`drop`])this.#u.addEventListener(e,t=>{t.preventDefault();let n=t;e===`dragleave`&&this.#u.contains(n.relatedTarget)||this.removeAttribute(`data-dropping`)});this.#u.addEventListener(`drop`,e=>{let t=e.dataTransfer?.files;if(t?.length){for(let e of Array.from(t))this.#z({kind:`upload`,name:e.name,size:e.size,file:e});this.close()}})}toggle(){this.#r?this.close():this.open()}#A(e){this.#l.replaceChildren(s(e?`x`:`plus`,{size:re}))}open(){this.#r||(this.#r=!0,this.setAttribute(`data-open`,``),this.#c.setAttribute(`aria-expanded`,`true`),this.#A(!0),document.addEventListener(`mousedown`,this.#m),this.#i=``,this.#d.value=``,this.#a=0,this.#N(),requestAnimationFrame(()=>this.#d.focus()))}close(){this.#r&&(this.#r=!1,this.removeAttribute(`data-open`),this.removeAttribute(`data-dropping`),this.#c.setAttribute(`aria-expanded`,`false`),this.#A(!1),document.removeEventListener(`mousedown`,this.#m))}async#j(e){if(this.#n){let t=await this.#n(e);if(t)return t}return this.#t??oe}#M(e){let t=this.#i.trim().toLowerCase(),n=e=>!t||`${e.label} ${e.sub??``}`.toLowerCase().includes(t),r=[];if(!t)for(let e of se)r.push({type:`quick`,data:e});else if(`upload take a photo screenshot`.includes(t))for(let e of se)e.label.toLowerCase().includes(t)&&r.push({type:`quick`,data:e});for(let i of e){let e=i.entries.filter(n).slice(0,t?8:4);if(e.length){r.push({type:`sec`,label:i.label});for(let t of e)r.push({type:`row`,section:i,data:t})}}return r}async#N(){let e=++this.#s,t=await this.#j(this.#i.trim().toLowerCase());if(e!==this.#s)return;let n=this.#M(t);this.#o=[];let r=[],i=!1;for(let e of n)if(e.type===`sec`)i&&r.push(y(`div`,{class:`sep`})),r.push(y(`div`,{class:`sec`},e.label)),i=!1;else if(e.type===`quick`){let t=this.#o.length;this.#o.push(e.data.kind===`upload`?{kind:`upload`,name:``,size:0}:{kind:`capture`,mode:e.data.mode??`photo`,label:e.data.label});let n=y(`span`,{class:`tx`},y(`div`,{class:`lb`},e.data.label));e.data.sub&&n.append(y(`div`,{class:`sb`},e.data.sub)),r.push(y(`div`,{class:`item quick`,"data-i":t},y(`span`,{class:`ic`},s(e.data.icon,{size:ae})),n)),i=!0}else{let t=this.#o.length;this.#o.push({kind:e.section.kind,id:e.data.id,label:e.data.label}),r.push(y(`div`,{class:`item`,"data-i":t},y(`span`,{class:`ic`},s(e.section.icon,{size:ae})),y(`span`,{class:`tx`},y(`div`,{class:`lb`},e.data.label),y(`div`,{class:`sb`},e.data.sub??``))))}r.length?this.#f.replaceChildren(...r):this.#f.replaceChildren(y(`div`,{class:`empty`},`No matches for “${this.#i}”.`));for(let e of Array.from(this.#f.querySelectorAll(`.item`))){let t=Number(e.dataset.i);e.addEventListener(`mouseenter`,()=>this.#F(t)),e.addEventListener(`click`,()=>this.#R(t))}this.#a>=this.#o.length&&(this.#a=0),this.#P()}#P(){for(let e of Array.from(this.#f.querySelectorAll(`.item`)))e.classList.toggle(`active`,Number(e.dataset.i)===this.#a)}#F(e){this.#a=e,this.#P()}#I(e){if(!this.#o.length)return;this.#a=(this.#a+e+this.#o.length)%this.#o.length,this.#P();let t=this.#f.querySelector(`.item[data-i="${this.#a}"]`);t&&t.scrollIntoView({block:`nearest`})}#L(e){e.key===`ArrowDown`?(e.preventDefault(),this.#I(1)):e.key===`ArrowUp`?(e.preventDefault(),this.#I(-1)):e.key===`Enter`?(e.preventDefault(),this.#R(this.#a)):e.key===`Escape`&&(e.preventDefault(),this.close(),this.#c.focus())}#R(e){let t=this.#o[e];if(t){if(t.kind===`upload`){this.#p.click();return}this.#z(t),this.close()}}#z(e){this.dispatchEvent(new CustomEvent(`slicc-add`,{detail:e,bubbles:!0,composed:!0}))}});var ce=b(`
|
|
59
59
|
:host {
|
|
60
60
|
display: inline-grid;
|
|
61
61
|
grid-auto-flow: column;
|
|
@@ -89,7 +89,7 @@ import{n as e}from"./chunk-aKtaBQYM.js";import{t}from"./preload-helper-zJ_50EbN.
|
|
|
89
89
|
.glyph { display: grid; place-items: center; pointer-events: none; }
|
|
90
90
|
.glyph svg { display: block; }
|
|
91
91
|
.label { pointer-events: none; }
|
|
92
|
-
`),
|
|
92
|
+
`),le=[{cue:`sent`,label:`Sent`,icon:`send`},{cue:`tool-start`,label:`Tool start`,icon:`play`},{cue:`tool-finish`,label:`Tool finish`,icon:`check`}],ue=14;_(`slicc-soundboard`,class extends HTMLElement{#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ce]}connectedCallback(){this.#i()}get audioContext(){return this.#t}#n(){return typeof AudioContext>`u`?null:((!this.#t||this.#t.state===`closed`)&&(this.#t=new AudioContext),this.#t)}#r(e){let t=this.#n();t&&(t.state===`suspended`&&t.resume(),o(t,e))}#i(){let e=le.map(({cue:e,label:t,icon:n})=>{let r=s(n,{size:ue,part:`icon`}),i=y(`button`,{type:`button`,class:`cue`,part:`button`,"data-cue":e,"aria-label":`Play ${t} cue`,title:`Play ${t} cue`},y(`span`,{class:`glyph`},r),y(`span`,{class:`label`,part:`label`},t));return i.addEventListener(`click`,()=>this.#r(e)),i});this.#e.replaceChildren(...e)}});var de=`
|
|
93
93
|
slicc-action-card { display: block; }
|
|
94
94
|
|
|
95
95
|
/* in-chat tool / terminal / git card (.tcard) */
|
|
@@ -202,7 +202,7 @@ slicc-action-card .prcard .pmeta {
|
|
|
202
202
|
slicc-action-card .prcard .pmeta b { color: var(--ink); }
|
|
203
203
|
slicc-action-card .prcard .pmeta .add { color: #1a7f37; }
|
|
204
204
|
slicc-action-card .prcard .pmeta .del { color: #cf222e; }
|
|
205
|
-
`,
|
|
205
|
+
`,fe=`slicc-action-card-style`;function pe(e){if(e.getElementById(fe))return;let t=e.createElement(`style`);t.id=fe,t.textContent=de,(e.head??e.documentElement).appendChild(t)}var me=new Set([`tool`,`light`,`pr`]),S=new Set([`ink`,`cy`,`vi`,`am`,`gh`]);_(`slicc-action-card`,class extends HTMLElement{static observedAttributes=[`variant`,`glyph`,`tone`,`title`,`badge`,`number`,`status`,`branch`,`files`,`add`,`del`,`checks`];#e=[];#t=!1;connectedCallback(){pe(this.ownerDocument),this.classList.add(`slicc-action-card`),this.#a(),this.#n()}attributeChangedCallback(e,t,n){!this.isConnected||t===n||(this.#n(),e===`variant`&&this.dispatchEvent(new CustomEvent(`slicc-action-card-change`,{bubbles:!0,composed:!0,detail:{variant:this.variant}})))}get variant(){let e=this.getAttribute(`variant`);return e&&me.has(e)?e:`tool`}set variant(e){this.setAttribute(`variant`,me.has(e)?e:`tool`)}get glyph(){return this.getAttribute(`glyph`)}set glyph(e){e==null?this.removeAttribute(`glyph`):this.setAttribute(`glyph`,e)}get tone(){let e=this.getAttribute(`tone`);return e&&S.has(e)?e:`ink`}set tone(e){this.setAttribute(`tone`,S.has(e)?e:`ink`)}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get badge(){return this.getAttribute(`badge`)}set badge(e){e==null?this.removeAttribute(`badge`):this.setAttribute(`badge`,e)}get number(){return this.getAttribute(`number`)}set number(e){e==null?this.removeAttribute(`number`):this.setAttribute(`number`,e)}get status(){return this.getAttribute(`status`)}set status(e){e==null?this.removeAttribute(`status`):this.setAttribute(`status`,e)}get branch(){return this.getAttribute(`branch`)}set branch(e){e==null?this.removeAttribute(`branch`):this.setAttribute(`branch`,e)}get files(){return this.getAttribute(`files`)}set files(e){e==null?this.removeAttribute(`files`):this.setAttribute(`files`,e)}get add(){return this.getAttribute(`add`)}set add(e){e==null?this.removeAttribute(`add`):this.setAttribute(`add`,e)}get del(){return this.getAttribute(`del`)}set del(e){e==null?this.removeAttribute(`del`):this.setAttribute(`del`,e)}get checks(){return this.getAttribute(`checks`)}set checks(e){e==null?this.removeAttribute(`checks`):this.setAttribute(`checks`,e)}#n(){let e=this.variant;e===`pr`?this.#i():this.#r(e===`light`)}#r(e){let t=this.glyph,n=this.tone,r=this.title,i=this.badge,a=n===`ink`?`ic`:`ic ${n}`,o=y(`div`,{class:`th`,part:`header`});v(o,[y(`span`,{class:a,part:`icon`},t??null),` `,y(`span`,{class:`nm`,part:`title`},r),i==null?null:y(`span`,{class:`badge`,part:`badge`},i)]);let s=y(`div`,{class:`tb`,part:`body`});s.append(...this.#e);let c=y(`div`,{class:e?`tcard light`:`tcard`,part:`card`},o,s);this.replaceChildren(c)}#i(){let e=this.title,t=this.number,n=this.status??`Open`,r=this.branch,i=this.files,a=this.add,o=this.del,s=this.checks,c=y(`div`,{class:`ph`,part:`header`});v(c,[y(`span`,{class:`gi`,part:`icon`},`⎇`),y(`span`,{class:`pt`,part:`title`},e),t==null?null:y(`span`,{class:`pn`,part:`number`},t),y(`span`,{class:`open`,part:`status`},n)]);let l=y(`div`,{class:`pmeta`,part:`meta`}),u=this.#e.filter(e=>e instanceof HTMLElement&&e.getAttribute(`slot`)===`meta`);u.length>0?l.append(...u):v(l,[r==null?null:y(`span`,null,r),i==null?null:y(`span`,null,y(`b`,null,i),` files`),a==null?null:y(`span`,{class:`add`},`+${a}`),o==null?null:y(`span`,{class:`del`},`−${o}`),s==null?null:y(`span`,null,`checks `,y(`b`,{style:`color:#1a7f37`},s))]);let d=y(`div`,{class:`prcard`,part:`card`},c,l);this.replaceChildren(d)}#a(){this.#t||(this.#t=!0,this.#e=Array.from(this.childNodes))}});var he=`
|
|
206
206
|
slicc-action-row {
|
|
207
207
|
display: block;
|
|
208
208
|
margin: -2px 0 16px;
|
|
@@ -301,7 +301,7 @@ slicc-action-row .vlink {
|
|
|
301
301
|
slicc-action-row .vlink:hover {
|
|
302
302
|
border-bottom-style: solid;
|
|
303
303
|
}
|
|
304
|
-
`,
|
|
304
|
+
`,C=`slicc-action-row-style`;function ge(e){if(e.getElementById(C))return;let t=e.createElement(`style`);t.id=C,t.textContent=he,(e.head??e.documentElement).appendChild(t)}var w=new Set([`ink`,`vi`,`am`,`cy`,`gh`]);_(`slicc-action-row`,class extends HTMLElement{static observedAttributes=[`open`,`icon`,`tone`,`label`,`result`];#e;#t;#n;#r;#i;#a=!1;#o=()=>this.#s();connectedCallback(){ge(this.ownerDocument),this.#c(),this.#l()}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#o)}attributeChangedCallback(e,t,n){t===n||!this.#a||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-action-row-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#l())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tone(){let e=this.getAttribute(`tone`);return e&&w.has(e)?e:`ink`}set tone(e){this.setAttribute(`tone`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get result(){return this.getAttribute(`result`)}set result(e){e==null?this.removeAttribute(`result`):this.setAttribute(`result`,e)}#s(){this.open=!this.open}#c(){if(this.#a)return;this.#a=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-act__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-act__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-act__head`,this.#e.setAttribute(`part`,`head`),this.#t=y(`span`,{class:`slicc-act__ic`,part:`icon`}),this.#n=y(`span`,{class:`slicc-act__label`,part:`label`}),this.#r=y(`span`,{class:`slicc-act__badge`,part:`badge`}),v(this.#e,[this.#t,this.#n,this.#r,y(`span`,{class:`slicc-act__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#i=this.ownerDocument.createElement(`div`),this.#i.className=`slicc-act__body`,this.#i.setAttribute(`part`,`body`);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`body`?this.#i.appendChild(t):this.#n.appendChild(t);this.replaceChildren(this.#e,this.#i),this.#e.addEventListener(`click`,this.#o)}#l(){if(!this.#a)return;let e=this.tone;this.#t.className=`slicc-act__ic${e===`ink`?``:` ${e}`}`;let t=this.icon??``;t&&c(t)?this.#t.replaceChildren(s(t,{size:12})):this.#t.textContent=t;let n=this.label;n!=null&&(this.#n.textContent=n),this.#e.setAttribute(`aria-expanded`,String(this.open)),this.#r.textContent=this.result??``}});var _e=`
|
|
305
305
|
slicc-agent-message { display: block; margin-bottom: 18px; font-size: 15px; line-height: 1.5; --accent: color-mix(in srgb, var(--ctx) 55%, var(--ink)); }
|
|
306
306
|
slicc-agent-message .body { font-family: var(--ui); font-size: 14px; }
|
|
307
307
|
slicc-agent-message .body p { margin: 0 0 8px; }
|
|
@@ -358,7 +358,7 @@ slicc-agent-message .dots i:nth-child(3) { animation-delay: .32s; }
|
|
|
358
358
|
@keyframes slicc-am-bdot { 0%, 75%, 100% { transform: translateY(0); opacity: .45; } 38% { transform: translateY(-8px); opacity: 1; } }
|
|
359
359
|
slicc-agent-message .tw-caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: -2px; margin-left: 1px; background: var(--ink); animation: slicc-am-cblink .9s steps(1) infinite; }
|
|
360
360
|
@keyframes slicc-am-cblink { 50% { opacity: 0; } }
|
|
361
|
-
`,
|
|
361
|
+
`,ve=`slicc-agent-message-style`;function T(e){if(e.getElementById(ve))return;let t=e.createElement(`style`);t.id=ve,t.textContent=_e,(e.head??e.documentElement).appendChild(t)}var ye=[`#f43f5e`,`#06b6d4`,`#8b5cf6`],be=new Set([``,`r`,`cy`,`vi`,`am`]);function xe(){let e=y(`div`,{class:`dots`,part:`dots`,"aria-hidden":`true`});for(let t of ye)e.append(y(`i`,{style:`--d:${t}`}));return e}function Se(e){let t=y(`ul`,{class:`plan`,part:`plan`});for(let n of e)t.append(y(`li`,null,n));return t}function Ce(e){let t=y(`ul`,{class:`check`,part:`check`});for(let n of e){let e=n.variant&&be.has(n.variant)?n.variant:``,r=e?`ck ${e}`:`ck`,i=n.glyph??`✓`;t.append(y(`li`,null,y(`span`,{class:r},i),y(`span`,{class:`ctext`},n.text)))}return t}_(`slicc-agent-message`,class extends HTMLElement{static observedAttributes=[`thinking`,`streaming`,`progress`];#e;#t=null;#n=null;#r=null;#i=!1;connectedCallback(){T(this.ownerDocument),this.#o(),this.#s(),this.#l()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||(e===`thinking`?(this.#s(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-thinking`,{bubbles:!0,composed:!0,detail:{thinking:n!==null}}))):e===`progress`?this.#c():e===`streaming`&&(this.#l(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-streaming`,{bubbles:!0,composed:!0,detail:{streaming:n!==null}}))))}get thinking(){return this.hasAttribute(`thinking`)}set thinking(e){e?this.setAttribute(`thinking`,``):this.removeAttribute(`thinking`)}get streaming(){return this.hasAttribute(`streaming`)}set streaming(e){e?this.setAttribute(`streaming`,``):this.removeAttribute(`streaming`)}get progress(){return this.getAttribute(`progress`)}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,e)}get body(){return this.#o(),this.#e}setBodyHtml(e){this.#o();let t=this.ownerDocument.createRange();t.selectNodeContents(this.#e),this.#a(t.createContextualFragment(e))}setPlan(e){this.#a(Se(e))}setCheck(e){this.#a(Ce(e))}#a(e){this.#o(),this.#e.replaceChildren(e),this.#l()}#o(){if(this.#i)return;this.#i=!0,this.classList.add(`msg`,`bot`);let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`body`)));this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`body`,this.#e.setAttribute(`part`,`body`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}#s(){let e=this.thinking;this.classList.toggle(`thinkrow`,e),e?(this.#e.style.display=`none`,this.#t||(this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`thinkrow-row`,this.#t.appendChild(xe()),this.insertBefore(this.#t,this.#e)),this.#c()):(this.#e.style.removeProperty(`display`),this.#t&&(this.#t.remove(),this.#t=null,this.#n=null))}#c(){if(!this.#t)return;let e=this.progress;e?(this.#n||(this.#n=this.ownerDocument.createElement(`span`),this.#n.className=`progress`,this.#n.setAttribute(`part`,`progress`),this.#n.setAttribute(`aria-live`,`polite`),this.#t.appendChild(this.#n)),this.#n.textContent=e):this.#n&&=(this.#n.remove(),null)}#l(){this.streaming?this.#r?.isConnected?this.#e.appendChild(this.#r):(this.#r=this.ownerDocument.createElement(`span`),this.#r.className=`tw-caret`,this.#r.setAttribute(`part`,`caret`),this.#r.setAttribute(`aria-hidden`,`true`),this.#e.appendChild(this.#r)):this.#r&&=(this.#r.remove(),null)}});var we=`
|
|
362
362
|
slicc-chat-table { display: block; }
|
|
363
363
|
slicc-chat-table > .ctable {
|
|
364
364
|
width: 100%;
|
|
@@ -397,7 +397,7 @@ slicc-chat-table > .ctable code {
|
|
|
397
397
|
border-radius: 5px;
|
|
398
398
|
padding: 1px 5px;
|
|
399
399
|
}
|
|
400
|
-
`,
|
|
400
|
+
`,E=`slicc-chat-table-style`;function Te(e){if(e.getElementById(E))return;let t=e.createElement(`style`);t.id=E,t.textContent=we,(e.head??e.documentElement).appendChild(t)}function Ee(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}_(`slicc-chat-table`,class extends HTMLElement{static observedAttributes=[`headers`];#e;#t;#n;#r=!1;connectedCallback(){Te(this.ownerDocument),this.#i()}attributeChangedCallback(e,t,n){e!==`headers`||t===n||(this.#r&&this.#a(),this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-chat-table-change`,{bubbles:!0,composed:!0,detail:{headers:this.headers}})))}get headers(){let e=this.getAttribute(`headers`);return e?Ee(e):[]}set headers(e){e==null?this.removeAttribute(`headers`):Array.isArray(e)?this.setAttribute(`headers`,e.join(`,`)):this.setAttribute(`headers`,e)}#i(){if(this.#r)return;this.#r=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLTableElement&&e.classList.contains(`ctable`)));this.#e=this.ownerDocument.createElement(`table`),this.#e.className=`ctable`,this.#e.setAttribute(`part`,`table`),this.#t=this.ownerDocument.createElement(`thead`),this.#t.setAttribute(`part`,`head`),this.#n=this.ownerDocument.createElement(`tbody`),this.#n.setAttribute(`part`,`body`),this.#e.append(this.#t,this.#n);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`head`?this.#t.appendChild(t):this.#n.appendChild(t);this.#a(),this.appendChild(this.#e)}#a(){if(!this.#r)return;let e=this.#t.querySelector(`tr`);if(e&&!e.hasAttribute(`data-slicc-generated`))return;let t=this.headers;if(t.length===0){this.#t.replaceChildren();return}let n=y(`tr`,{"data-slicc-generated":``});for(let e of t)n.append(y(`th`,null,e));this.#t.replaceChildren(n)}});function D(e){if(typeof window>`u`||!window.location)return null;try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function De(e,t,n={}){if(!(typeof window>`u`||!window.history?.replaceState))try{let r=new URL(window.location.href),i=r.searchParams.get(e);if(i===t||i===null&&(t===null||t===``))return;t==null||t===``?r.searchParams.delete(e):r.searchParams.set(e,t),n.push?window.history.pushState(window.history.state,``,r):window.history.replaceState(window.history.state,``,r)}catch{}}var Oe=`
|
|
401
401
|
slicc-chat-thread {
|
|
402
402
|
flex: 1 1 auto;
|
|
403
403
|
display: block;
|
|
@@ -473,7 +473,7 @@ slicc-chat-thread[open] > .slicc-thread__inner {
|
|
|
473
473
|
padding: 16px 14px;
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
`,ke=`slicc-chat-thread-style`;function Ae(e){if(e.getElementById(ke))return;let t=e.createElement(`style`);t.id=ke,t.textContent=Oe,(e.head??e.documentElement).appendChild(t)}
|
|
476
|
+
`,ke=`slicc-chat-thread-style`;function Ae(e){if(e.getElementById(ke))return;let t=e.createElement(`style`);t.id=ke,t.textContent=Oe,(e.head??e.documentElement).appendChild(t)}_(`slicc-chat-thread`,class e extends HTMLElement{static observedAttributes=[`open`,`context`,`accent`,`url-state`];#e;#t=!1;#n=null;#r=null;#i=null;#a=null;#o=()=>{this.urlState&&(this.#a!=null&&clearTimeout(this.#a),this.#a=setTimeout(()=>{this.#a=null,De(`at`,String(Math.round(this.scrollTop)))},300))};#s=()=>{if(!this.urlState)return;let e=D(`ctx`);if(e&&e!==this.context)this.dispatchEvent(new CustomEvent(`slicc-url-context`,{bubbles:!0,composed:!0,detail:{context:e}}));else{let e=D(`at`);e!=null&&(this.scrollTop=Number.parseInt(e,10)||0)}};#c=null;#l=new Map;connectedCallback(){Ae(this.ownerDocument),this.#m(),this.#p(),this.scrollToBottom(),this.urlState&&(this.#r=D(`at`),this.#i=D(`ctx`),this.addEventListener(`scroll`,this.#o,{passive:!0}),window.addEventListener(`popstate`,this.#s))}disconnectedCallback(){this.#n&&=(this.#e?.removeEventListener(`click`,this.#n),null),this.removeEventListener(`scroll`,this.#o),window.removeEventListener(`popstate`,this.#s),this.#a!=null&&(clearTimeout(this.#a),this.#a=null)}attributeChangedCallback(e,t,n){t!==n&&(e===`accent`&&this.#t&&this.#p(),e===`context`&&this.urlState&&n!=null&&this.isConnected&&(n!==this.#i&&(this.#r=null),De(`ctx`,n,{push:!0})))}get urlState(){return this.hasAttribute(`url-state`)}set urlState(e){this.toggleAttribute(`url-state`,e)}get urlContext(){return this.urlState?D(`ctx`):null}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get context(){return this.getAttribute(`context`)}set context(e){e==null?this.removeAttribute(`context`):this.setAttribute(`context`,e)}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get inner(){return this.#m(),this.#e}switchContext(e){this.#m();let t=this.context;if(e===t)return;t!=null&&this.#l.set(t,this.#f());let n=this.#l.get(e);this.#e.replaceChildren(...n?Array.from(n.cloneNode(!0).childNodes):[]),this.context=e,this.removeAttribute(`has-new`),this.dispatchEvent(new CustomEvent(`slicc-context-change`,{bubbles:!0,composed:!0,detail:{context:e,previous:t}})),this.scrollToBottom()}append(...e){this.#m(),e.length>0&&(this.#r=null),this.#e.append(...e),this.requestFollow()}static FOLLOW_SLACK=80;#u(){return this.scrollHeight-this.scrollTop-this.clientHeight<=e.FOLLOW_SLACK}requestFollow(){this.#m(),this.#u()?(this.scrollToBottom(),this.removeAttribute(`has-new`)):this.setAttribute(`has-new`,``)}#d=()=>{this.hasAttribute(`has-new`)&&this.#u()&&this.removeAttribute(`has-new`)};replaceContent(...e){this.#m(),this.#e.replaceChildren(...e),this.removeAttribute(`has-new`),this.scrollToBottom();let t=this.#r;t!=null&&e.length>0&&requestAnimationFrame(()=>{this.#r===t&&(this.scrollTop=Number.parseInt(t,10)||0)})}scrollToBottom(){this.scrollTop=this.scrollHeight}#f(){let e=this.ownerDocument.createDocumentFragment();for(let t of Array.from(this.#e.childNodes))e.appendChild(t.cloneNode(!0));return e}#p(){let e=this.accent;e?this.style.setProperty(`--ctx`,e):this.style.removeProperty(`--ctx`)}#m(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-thread__inner`);if(e instanceof HTMLElement)this.#e=e;else{let e=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-thread__inner`,this.#e.setAttribute(`part`,`inner`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}this.#c=this.ownerDocument.createElement(`div`),this.#c.className=`slicc-thread__follow`;let t=this.ownerDocument.createElement(`button`);t.type=`button`,t.append(`New messages ↓`),t.addEventListener(`click`,()=>{this.scrollToBottom(),this.removeAttribute(`has-new`)}),this.#c.append(t),this.appendChild(this.#c),this.addEventListener(`scroll`,this.#d,{passive:!0}),this.#n=e=>{let t=e.target;t instanceof HTMLElement&&this.dispatchEvent(new CustomEvent(`slicc-thread-action`,{bubbles:!0,composed:!0,detail:{target:t}}))},this.#e.addEventListener(`click`,this.#n)}});var je=b(`
|
|
477
477
|
:host {
|
|
478
478
|
display: flex;
|
|
479
479
|
align-items: center;
|
|
@@ -509,7 +509,7 @@ code {
|
|
|
509
509
|
border-radius: 5px;
|
|
510
510
|
padding: 1px 5px;
|
|
511
511
|
}
|
|
512
|
-
`),Me=[`feed`,`scoop`,`drop`,`sprinkle`],Ne={feed:`arrow-right`,scoop:`circle-plus`,drop:`circle-check`,sprinkle:`sparkles`},
|
|
512
|
+
`),Me=[`feed`,`scoop`,`drop`,`sprinkle`],Ne={feed:`arrow-right`,scoop:`circle-plus`,drop:`circle-check`,sprinkle:`sparkles`},O={feed:`Delegated to`,scoop:`Spun up`,drop:`Wrapped up`,sprinkle:``},Pe={feed_scoop:`Delegated to`,scoop_scoop:`Spun up`,drop_scoop:`Wrapped up`,"sprinkle-opened":`Opened`};function Fe(e){return Pe[e]??e}function Ie(e){return Me.includes(e??``)?e:`feed`}function Le(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}_(`slicc-delegation-line`,class extends HTMLElement{static observedAttributes=[`kind`,`hue`,`verb`,`scoop`,`label`,`args`,`source`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[je]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get kind(){return Ie(this.getAttribute(`kind`))}set kind(e){this.setAttribute(`kind`,Ie(e))}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get verb(){return this.getAttribute(`verb`)}set verb(e){e==null?this.removeAttribute(`verb`):this.setAttribute(`verb`,e)}get scoop(){return this.getAttribute(`scoop`)}set scoop(e){e==null?this.removeAttribute(`scoop`):this.setAttribute(`scoop`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get args(){return this.getAttribute(`args`)}set args(e){e==null?this.removeAttribute(`args`):this.setAttribute(`args`,e)}get source(){return this.hasAttribute(`source`)}set source(e){this.toggleAttribute(`source`,e)}#t(){let e=this.kind,t=this.hue,n=this.verb,r=n==null?O[e]:Fe(n),i=this.scoop,a=this.label,o=this.args?Le(this.args):[];t?this.style.setProperty(`--c`,t):this.style.removeProperty(`--c`);let c=y(`span`,{class:`darrow`,part:`arrow`},y(`slot`,{name:`arrow`},s(Ne[e],{size:13}))),l=y(`slot`,{name:`label`});r&&l.append(y(`span`,{class:`verb`},r)),i&&l.append(y(`b`,{class:`scoop`,part:`scoop`,style:t?`color:${t}`:void 0},i)),a&&l.append(y(`span`,{class:`prose`},a));let u=y(`span`,{class:`label`,part:`label`},l),d=y(`slot`,{name:`args`});for(let e of o)d.append(y(`code`,{part:`code`},e));this.#e.replaceChildren(c,u,d)}});var Re=b(`
|
|
513
513
|
:host {
|
|
514
514
|
display: block;
|
|
515
515
|
border: 1px solid var(--line);
|
|
@@ -535,7 +535,7 @@ code {
|
|
|
535
535
|
/* palette chips carry inline-style light backgrounds — tone them down for dark mode */
|
|
536
536
|
:host-context(.dark) .ch,
|
|
537
537
|
:host-context([data-theme="dark"]) .ch { filter: brightness(.55) saturate(.85); }
|
|
538
|
-
`);
|
|
538
|
+
`);_(`slicc-palette-cell`,class extends HTMLElement{static observedAttributes=[`color`,`label`,`group`,`selected`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Re]}connectedCallback(){this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.setAttribute(`role`,`button`),this.#o(),this.#i()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#o()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get group(){return this.getAttribute(`group`)}set group(e){e==null?this.removeAttribute(`group`):this.setAttribute(`group`,e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,e)}select(){this.#r(),this.selected=!0,this.dispatchEvent(new CustomEvent(`palette-select`,{bubbles:!0,composed:!0,detail:{color:this.color,label:this.label,group:this.group}}))}#r(){let e=this.group;if(!e)return;let t=this.getRootNode().querySelectorAll(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);for(let e of t)e!==this&&(e.selected=!1)}#i(){this.#t||(this.#t=()=>this.select(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.select())},this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n))}#a(){this.#t&&this.removeEventListener(`click`,this.#t),this.#n&&this.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}#o(){this.setAttribute(`aria-pressed`,this.selected?`true`:`false`);let e=this.color??`transparent`,t=this.label,n=y(`div`,{class:`ch`,part:`chip`,style:`background:${e}`}),r=y(`div`,{class:`cl`,part:`label`},t??y(`slot`));this.#e.replaceChildren(n,r)}});var ze=[`#f43f5e`,`#f59e0b`,`#06b6d4`,`#8b5cf6`,`#ec4899`,`#22c55e`],Be=46,k=72,Ve=6.283185;function A(e,t){return e+Math.random()*(t-e)}var He=[{color:`#faf6f1`,label:`paper`},{color:`#fff7ed`,label:`cream`},{color:`#f5f3ff`,label:`lilac`},{color:`#fef2f2`,label:`blush`}],Ue=[{color:`#8b5cf6`,label:`violet`},{color:`#f43f5e`,label:`rose`},{color:`#06b6d4`,label:`cyan`},{color:`#ef7000`,label:`cone`}],We=0,Ge=b(`
|
|
539
539
|
:host {
|
|
540
540
|
position: relative;
|
|
541
541
|
display: block;
|
|
@@ -622,7 +622,7 @@ canvas.sprk {
|
|
|
622
622
|
@media (prefers-reduced-motion: reduce) {
|
|
623
623
|
canvas.sprk { display: none; }
|
|
624
624
|
}
|
|
625
|
-
`);
|
|
625
|
+
`);_(`slicc-dip`,class extends HTMLElement{static observedAttributes=[`name`,`hue`,`prompt`];#e;#t=`d${++We}`;#n=null;#r=null;#i=0;#a=null;#o=[];#s=0;#c=0;#l=-999;#u=-999;#d=null;#f=null;#p=null;#m=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ge]}connectedCallback(){this.#v(),this.#b(),this.#w()}disconnectedCallback(){this.#T(),this.#x()}attributeChangedCallback(){this.isConnected&&(this.#v(),this.#b(),this.#w())}get name(){return this.getAttribute(`name`)??`palette.shtml`}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get prompt(){return this.getAttribute(`prompt`)}set prompt(e){e==null?this.removeAttribute(`prompt`):this.setAttribute(`prompt`,e)}get selectedCanvas(){return this.#h(`canvas:${this.#t}`)}get selectedAccent(){return this.#h(`accent:${this.#t}`)}#h(e){let t=this.querySelector(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);return t?{color:t.getAttribute(`color`)??``,label:t.getAttribute(`label`)??``}:null}#g(e,t,n){let r=e.startsWith(`canvas`)?`canvas`:`accent`;if(!this.querySelector(`slicc-palette-cell[slot="${r}"]`))for(let i of t){let t=this.ownerDocument.createElement(`slicc-palette-cell`);t.setAttribute(`slot`,r),t.setAttribute(`color`,i.color),t.setAttribute(`label`,i.label),t.setAttribute(`group`,e),i.label===n&&t.setAttribute(`selected`,``),this.appendChild(t)}}#_(){return[document.createTextNode(`Tune the hero’s `),y(`b`,null,`canvas`),document.createTextNode(` & `),y(`b`,null,`accent`),document.createTextNode(`, then apply:`)]}#v(){let e=this.hue,t=e?`--c:${e}`:void 0,n=y(`slot`,{name:`prompt`});this.prompt?n.append(this.prompt):n.append(...this.#_()),this.#e.replaceChildren(y(`canvas`,{class:`sprk`,part:`field`,"aria-hidden":`true`}),y(`div`,{class:`dh`,part:`header`,style:t},y(`span`,{class:`sg`,part:`glyph`},s(`sparkles`,{size:12})),y(`span`,{class:`nm`,part:`name`},this.name),y(`span`,{class:`tag`,part:`tag`},`sprinkle · dip`)),y(`div`,{class:`dbody`,part:`body`,style:t},y(`p`,{class:`dprompt`,part:`prompt`},n),y(`div`,{class:`pgrid canvas`,part:`grid-canvas`},y(`slot`,{name:`canvas`})),y(`div`,{class:`pgrid accent`,part:`grid-accent`},y(`slot`,{name:`accent`})),y(`div`,{class:`dfoot`},y(`button`,{class:`dapply`,part:`apply`,type:`button`},`Apply to hero →`),y(`span`,{class:`dnote`,part:`note`})))),this.#g(`canvas:${this.#t}`,He,`paper`),this.#g(`accent:${this.#t}`,Ue,`cone`),this.#y()}#y(){let e=this.#e.querySelector(`.dnote`);e&&(e.textContent=`${this.selectedCanvas?.label??`paper`} · ${this.selectedAccent?.label??`violet`}`)}#b(){this.#p||(this.#p=()=>this.#y(),this.addEventListener(`palette-select`,this.#p)),this.#m||=()=>this.#S(),this.#e.querySelector(`.dapply`)?.addEventListener(`click`,this.#m)}#x(){this.#p&&=(this.removeEventListener(`palette-select`,this.#p),null),this.#m=null}#S(){this.#y(),this.dispatchEvent(new CustomEvent(`slicc-dip-apply`,{bubbles:!0,composed:!0,detail:{canvas:this.selectedCanvas,accent:this.selectedAccent}}))}#C(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}#w(){if(this.#T(),this.#C())return;let e=this.#e.querySelector(`canvas.sprk`),t=e?.getContext(`2d`)??null;!e||!t||(this.#n=e,this.#r=t,this.#o=[],this.#E(),typeof ResizeObserver==`function`&&(this.#a=new ResizeObserver(()=>this.#E()),this.#a.observe(this)),this.#d=e=>{let t=this.getBoundingClientRect();this.#l=e.clientX-t.left,this.#u=e.clientY-t.top},this.#f=()=>{this.#l=-999,this.#u=-999},this.addEventListener(`pointermove`,this.#d),this.addEventListener(`pointerleave`,this.#f),this.#i=requestAnimationFrame(()=>this.#O()))}#T(){this.#i&&cancelAnimationFrame(this.#i),this.#i=0,this.#a?.disconnect(),this.#a=null,this.#d&&this.removeEventListener(`pointermove`,this.#d),this.#f&&this.removeEventListener(`pointerleave`,this.#f),this.#d=null,this.#f=null}#E(){let e=this.#n,t=this.#r;if(!e||!t)return;let n=this.getBoundingClientRect(),r=Math.min(typeof devicePixelRatio==`number`?devicePixelRatio:1,2);if(this.#s=n.width,this.#c=n.height||90,e.width=Math.max(1,Math.round(this.#s*r)),e.height=Math.max(1,Math.round(this.#c*r)),t.setTransform(r,0,0,r,0,0),!this.#o.length)for(let e=0;e<Be;e++)this.#o.push({x:A(0,this.#s),y:A(0,this.#c),vx:A(-.1,.1),vy:A(-.08,.08),rot:A(0,Ve),rv:A(-.014,.014),s:A(1.2,2.2),col:ze[e%ze.length]})}#D(e,t,n,r,i){let a=this.#r;a&&(a.roundRect?(a.beginPath(),a.roundRect(e,t,n,r,i)):(a.beginPath(),a.moveTo(e+i,t),a.arcTo(e+n,t,e+n,t+r,i),a.arcTo(e+n,t+r,e,t+r,i),a.arcTo(e,t+r,e,t,i),a.arcTo(e,t,e+n,t,i),a.closePath()))}#O(){let e=this.#r;if(e){e.clearRect(0,0,this.#s,this.#c);for(let t of this.#o){let n=t.x-this.#l,r=t.y-this.#u,i=n*n+r*r;if(i<k*k){let e=Math.sqrt(i)||1,a=(k-e)/k*.5;t.vx+=n/e*a,t.vy+=r/e*a}t.vx*=.95,t.vy*=.95,t.x+=t.vx+.04,t.y+=t.vy,t.rot+=t.rv,t.x<-6&&(t.x=this.#s+6),t.x>this.#s+6&&(t.x=-6),t.y<-6&&(t.y=this.#c+6),t.y>this.#c+6&&(t.y=-6);let a=t.s*4,o=t.s*1.55;e.save(),e.translate(t.x,t.y),e.rotate(t.rot),e.globalAlpha=.5,e.fillStyle=t.col,this.#D(-a/2,-o/2,a,o,o/2),e.fill(),e.globalAlpha=.85,e.fillStyle=`#fff`,this.#D(-a/2+o*.3,-o*.34,a-o*.6,o*.3,o*.15),e.fill(),e.restore(),e.globalAlpha=1}this.#i=requestAnimationFrame(()=>this.#O())}}});var Ke=14,qe=12,Je=`Something went wrong`,j={retry:`Try again`,settings:`Open Settings`,"change-model":`Change model`},Ye={retry:`rotate-ccw`,settings:`settings`,"change-model":`sparkles`},Xe=b(`
|
|
626
626
|
:host{
|
|
627
627
|
/* Error cards sit in the assistant column (left-aligned). Tokens default to
|
|
628
628
|
the light palette and flip in dark mode via the library's outer scopes
|
|
@@ -681,7 +681,7 @@ canvas.sprk {
|
|
|
681
681
|
.retry:hover{filter:brightness(1.08);}
|
|
682
682
|
.retry:focus-visible{outline:2px solid color-mix(in srgb,var(--err-btn-bg) 60%,var(--ink));outline-offset:2px;}
|
|
683
683
|
.retry svg{display:block;}
|
|
684
|
-
`);
|
|
684
|
+
`);_(`slicc-error-card`,class extends HTMLElement{static observedAttributes=[`label`,`message`,`button-label`,`message-id`,`action`,`theme`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Xe]}connectedCallback(){this.#n()}disconnectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#n()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get message(){return this.getAttribute(`message`)}set message(e){e==null?this.removeAttribute(`message`):this.setAttribute(`message`,e)}get buttonLabel(){return this.getAttribute(`button-label`)}set buttonLabel(e){e==null?this.removeAttribute(`button-label`):this.setAttribute(`button-label`,e)}get messageId(){return this.getAttribute(`message-id`)}set messageId(e){e==null?this.removeAttribute(`message-id`):this.setAttribute(`message-id`,e)}get action(){let e=this.getAttribute(`action`);return e===`settings`||e===`change-model`?e:`retry`}set action(e){e==null?this.removeAttribute(`action`):this.setAttribute(`action`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}retry(){this.dispatchEvent(new CustomEvent(`slicc-error-retry`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}openSettings(){this.dispatchEvent(new CustomEvent(`slicc-error-open-settings`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}changeModel(){this.dispatchEvent(new CustomEvent(`slicc-error-change-model`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}#n(){let e=this.action,t=this.label??Je,n=this.message,r=this.buttonLabel??j[e],i=Ye[e],a=y(`span`,{class:`ic`,part:`icon`,"aria-hidden":!0});a.append(s(`triangle-alert`,{size:Ke}));let o=y(`div`,{class:`err`,part:`card`},y(`div`,{class:`eh`,part:`header`},a,y(`span`,{class:`lbl`,part:`label`},t)),y(`div`,{class:`eb`,part:`body`},n??y(`slot`)),y(`div`,{class:`foot`},y(`button`,{type:`button`,class:`retry`,part:`button`,"aria-label":r},s(i,{size:qe}),r)));this.#e.replaceChildren(o),this.#r()}#r(){this.#i();let e=this.#e.querySelector(`.retry`);if(!e)return;let t=this.action;this.#t=()=>{t===`settings`?this.openSettings():t===`change-model`?this.changeModel():this.retry()},e.addEventListener(`click`,this.#t)}#i(){let e=this.#e.querySelector(`.retry`);e&&this.#t&&e.removeEventListener(`click`,this.#t),this.#t=null}});var Ze=9,Qe=3,$e=45,et=b(`
|
|
685
685
|
:host {
|
|
686
686
|
display: inline-flex;
|
|
687
687
|
align-items: center;
|
|
@@ -762,7 +762,7 @@ canvas.sprk {
|
|
|
762
762
|
@media (prefers-reduced-motion: reduce) {
|
|
763
763
|
:host([blink]) .eye { animation: none; }
|
|
764
764
|
}
|
|
765
|
-
`);
|
|
765
|
+
`);_(`slicc-googly-eyes`,class extends HTMLElement{static observedAttributes=[`inverted`,`tracking`,`blink`,`eyes`,`size`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[et]}connectedCallback(){this.#r(),this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`size`||e===`eyes`?(this.#r(),this.#i()):e===`tracking`&&this.#i())}get inverted(){return this.hasAttribute(`inverted`)}set inverted(e){this.toggleAttribute(`inverted`,e)}get tracking(){return this.getAttribute(`tracking`)!==`off`}set tracking(e){e?this.setAttribute(`tracking`,`on`):this.setAttribute(`tracking`,`off`)}get blink(){return this.hasAttribute(`blink`)}set blink(e){this.toggleAttribute(`blink`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}get size(){let e=Number.parseFloat(this.getAttribute(`size`)??``);return Number.isFinite(e)&&e>0?e:Ze}set size(e){this.setAttribute(`size`,String(e))}#r(){let e=this.size,t=1.3/Ze*e,n=this.eyes===`dead`,r=e=>y(`span`,{class:`eye`,part:e},n?y(`span`,{class:`x`,"aria-hidden":`true`},`×`):null),i=y(`span`,{class:`eyes`,part:`eyes`,style:`--_eye:${e}px;--_border:${t}px`,role:`img`,"aria-label":n?`dead eyes`:`googly eyes`},r(`eye eye-left`),y(`slot`),r(`eye eye-right`));this.#e.replaceChildren(i),this.#t=Array.from(this.#e.querySelectorAll(`.eye`)),this.#s()}#i(){this.tracking&&this.eyes===`open`?this.#a():(this.#o(),this.#s())}#a(){this.#n||(this.#n=e=>this.#c(e),document.addEventListener(`mousemove`,this.#n))}#o(){this.#n&&=(document.removeEventListener(`mousemove`,this.#n),null)}#s(){for(let e of this.#t)e.style.setProperty(`--px`,`0px`),e.style.setProperty(`--py`,`0px`)}#c(e){for(let t of this.#t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,a=Math.atan2(e.clientY-i,e.clientX-r),o=Math.min(Qe,Math.hypot(e.clientX-r,e.clientY-i)/$e);t.style.setProperty(`--px`,`${(Math.cos(a)*o).toFixed(2)}px`),t.style.setProperty(`--py`,`${(Math.sin(a)*o).toFixed(2)}px`)}}});var tt=b(`
|
|
766
766
|
:host{display:block;font-family:var(--ui);}
|
|
767
767
|
:host([hidden]){display:none;}
|
|
768
768
|
.handoff{border:1px solid var(--line);border-radius:13px;padding:13px 15px;margin:2px 0 18px;}
|
|
@@ -782,7 +782,7 @@ canvas.sprk {
|
|
|
782
782
|
.opened .sg{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;color:#fff;background:var(--rainbow);flex:0 0 auto;}
|
|
783
783
|
.opened .sg svg{display:block;}
|
|
784
784
|
.opened b{color:var(--ink);font-weight:600;}
|
|
785
|
-
`),
|
|
785
|
+
`),nt=`Handoff request from`;_(`slicc-handoff-card`,class extends HTMLElement{static observedAttributes=[`variant`,`name`,`pre`,`text`,`eyes`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[tt]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get variant(){return this.getAttribute(`variant`)===`opened`?`opened`:`handoff`}set variant(e){this.setAttribute(`variant`,e===`opened`?`opened`:`handoff`)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get pre(){return this.getAttribute(`pre`)}set pre(e){e==null?this.removeAttribute(`pre`):this.setAttribute(`pre`,e)}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}#t(){this.variant===`opened`?this.#i():this.#r()}#n(){let e=this.text;return e==null?y(`slot`):document.createTextNode(e)}#r(){let e=this.pre??nt,t=this.name,n=y(`slicc-googly-eyes`,{class:`eyes`});this.eyes===`dead`&&n.setAttribute(`eyes`,`dead`);let r=y(`div`,{class:`top`,part:`top`},y(`span`,{class:`av`,part:`avatar`},n),y(`span`,{class:`lbl2`,part:`label`},y(`span`,{class:`hand`,part:`hand`,"aria-hidden":`true`},s(`hand`,{size:13})),y(`span`,{class:`pre`},e),` `,t==null?null:y(`b`,{part:`name`},t))),i=y(`p`,{part:`text`},this.#n());this.#e.replaceChildren(y(`div`,{class:`handoff`,part:`card`},r,i))}#i(){let e=this.name,t=y(`span`,{class:`sg`,part:`glyph`,"aria-hidden":`true`},s(`sparkles`,{size:12})),n=y(`span`,{part:`text`},e==null?null:y(`b`,{part:`name`},e),e==null?null:` `,this.#n());this.#e.replaceChildren(y(`div`,{class:`opened`,part:`card`},t,n))}});var M=14,rt=`event`,it={webhook:`webhook`,cron:`clock`,workflow:`workflow`,"session-reload":`rotate-ccw`,navigate:`compass`,upgrade:`circle-arrow-up`,sprinkle:`sparkles`,fswatch:`eye`,"scoop-notify":`bell-ring`,"scoop-idle":`moon`,"scoop-wait":`hourglass`,"sudo-request":`key-round`},at=`bell`;function ot(e){return e&&it[e.toLowerCase()]||at}var N={confirmed:`circle-check`,dismissed:`circle-x`},st=b(`
|
|
786
786
|
:host{
|
|
787
787
|
/* Licks are right-aligned in the chat column (mirroring the lickIn slide-in
|
|
788
788
|
from the right): the host is a full-width flex row that pushes the card to
|
|
@@ -870,7 +870,7 @@ canvas.sprk {
|
|
|
870
870
|
:host([collapsed]) .lb{display:none;}
|
|
871
871
|
|
|
872
872
|
@keyframes lickIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
|
|
873
|
-
`),
|
|
873
|
+
`),ct=`·`;_(`slicc-lick-card`,class extends HTMLElement{static observedAttributes=[`kind`,`event-label`,`body`,`count`,`no-animate`,`collapsible`,`collapsed`,`theme`,`hue`,`state`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[st]}connectedCallback(){this.#r()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#r()}get kind(){return this.getAttribute(`kind`)}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get eventLabel(){return this.getAttribute(`event-label`)}set eventLabel(e){e==null?this.removeAttribute(`event-label`):this.setAttribute(`event-label`,e)}get body(){return this.getAttribute(`body`)}set body(e){e==null?this.removeAttribute(`body`):this.setAttribute(`body`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:1}set count(e){e>1?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get noAnimate(){return this.hasAttribute(`no-animate`)}set noAnimate(e){this.toggleAttribute(`no-animate`,e)}get collapsible(){return this.hasAttribute(`collapsible`)}set collapsible(e){this.toggleAttribute(`collapsible`,e)}get collapsed(){return this.hasAttribute(`collapsed`)}set collapsed(e){this.toggleAttribute(`collapsed`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}get state(){let e=this.getAttribute(`state`);return e===`confirmed`||e===`dismissed`?e:`pending`}set state(e){e==null||e===`pending`?this.removeAttribute(`state`):this.setAttribute(`state`,e)}toggle(){this.collapsible&&(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent(`slicc-lick-toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}#r(){let e=this.kind??``,t=this.count,n=this.getAttribute(`hue`);n?(this.style.setProperty(`--lick-pill`,n),this.style.setProperty(`--lick-pill-ink`,`#fff`)):(this.style.removeProperty(`--lick-pill`),this.style.removeProperty(`--lick-pill-ink`));let r=this.eventLabel??rt,i=t>1?`${r} ×${t}`:r,a=this.body,o=this.collapsible,c=e?`lick ${ct} ${e}`:`lick ${ct}`,l=y(`span`,{class:`bell`,part:`bell`,"aria-hidden":!0});l.append(s(ot(e),{size:M}));let u={class:`lh`,part:`header`};o&&(u.tabindex=`0`,u.role=`button`,u[`aria-expanded`]=this.collapsed?`false`:`true`);let d=y(`div`,u,l,` `,y(`span`,{class:`kind`,part:`kind`},`${c} `),y(`span`,{class:`lk`,part:`event`},i)),f=this.state;if(f!==`pending`){let e=y(`span`,{class:`status`,part:`status`,"aria-hidden":!0});e.append(s(N[f],{size:M})),d.append(e)}let p=y(`div`,{class:`lick`,part:`card`},d,y(`div`,{class:`lb`,part:`body`},a??y(`slot`)));this.#e.replaceChildren(p),this.#i()}#i(){if(this.#a(),!this.collapsible)return;let e=this.#e.querySelector(`.lh`);e&&(this.#t=()=>this.toggle(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},e.addEventListener(`click`,this.#t),e.addEventListener(`keydown`,this.#n))}#a(){let e=this.#e.querySelector(`.lh`);e&&this.#t&&e.removeEventListener(`click`,this.#t),e&&this.#n&&e.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}});var lt=`
|
|
874
874
|
slicc-tool-cluster {
|
|
875
875
|
display: block;
|
|
876
876
|
margin: -2px 0 16px;
|
|
@@ -946,7 +946,7 @@ slicc-tool-cluster[open] .slicc-cluster__body {
|
|
|
946
946
|
slicc-tool-cluster .slicc-cluster__body slicc-action-row {
|
|
947
947
|
margin-bottom: 4px;
|
|
948
948
|
}
|
|
949
|
-
`,
|
|
949
|
+
`,ut=`slicc-tool-cluster-style`;function dt(e){if(e.getElementById(ut))return;let t=e.createElement(`style`);t.id=ut,t.textContent=lt,(e.head??e.documentElement).appendChild(t)}var ft=`A few quick steps`;_(`slicc-tool-cluster`,class extends HTMLElement{static observedAttributes=[`open`,`label`,`count`];#e;#t;#n;#r;#i=!1;#a=()=>{this.open=!this.open};connectedCallback(){dt(this.ownerDocument),this.#o(),this.#s()}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#a)}attributeChangedCallback(e,t,n){t===n||!this.#i||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-tool-cluster-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get label(){return this.getAttribute(`label`)??ft}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:0}set count(e){e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get body(){return this.#o(),this.#r}append(...e){this.#o(),this.#r.append(...e),this.#s()}#o(){if(this.#i)return;this.#i=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-cluster__head`,this.#e.setAttribute(`part`,`head`),this.#t=y(`span`,{class:`slicc-cluster__label`,part:`label`}),this.#n=y(`span`,{class:`slicc-cluster__count`,part:`count`}),v(this.#e,[y(`span`,{class:`slicc-cluster__ic`,part:`icon`},s(`layers`,{size:12})),this.#t,this.#n,y(`span`,{class:`slicc-cluster__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#r=this.ownerDocument.createElement(`div`),this.#r.className=`slicc-cluster__body`,this.#r.setAttribute(`part`,`body`);for(let t of e)this.#r.appendChild(t);this.replaceChildren(this.#e,this.#r),this.#e.addEventListener(`click`,this.#a)}#s(){if(!this.#i)return;this.#t.textContent=this.label;let e=this.count||this.#r.children.length;this.#n.textContent=e>0?`${e} steps`:``,this.#e.setAttribute(`aria-expanded`,String(this.open))}});var pt=b(`
|
|
950
950
|
:host{display:block;margin-bottom:18px;font-family:var(--ui);font-size:15px;line-height:1.5;}
|
|
951
951
|
:host([hidden]){display:none;}
|
|
952
952
|
.msg{display:flex;justify-content:flex-end;}
|
|
@@ -986,7 +986,7 @@ slicc-tool-cluster .slicc-cluster__body slicc-action-row {
|
|
|
986
986
|
:host([queued]) .b{opacity:.62;}
|
|
987
987
|
.queued-tag{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;color:var(--txt-3);}
|
|
988
988
|
.queued-tag svg{display:block;}
|
|
989
|
-
`),
|
|
989
|
+
`),mt={image:`image`,text:`file-text`,file:`file`};function ht(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}_(`slicc-user-message`,class extends HTMLElement{static observedAttributes=[`text`,`queued`];#e;#t=null;#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[pt]}connectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#a()}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get queued(){return this.hasAttribute(`queued`)}set queued(e){this.toggleAttribute(`queued`,e)}setBodyHtml(e){this.#t=e,this.#a()}setAttachments(e){this.#n=e.slice(),this.#a()}#r(){if(this.#t!=null)return this.ownerDocument.createRange().createContextualFragment(this.#t);let e=this.text;return e==null?y(`slot`):this.ownerDocument.createTextNode(e)}#i(e){let t=e.kind??`file`,n=y(`span`,{class:`attachment-chip__visual`});t===`image`&&e.src?n.append(y(`img`,{src:e.src,alt:e.name||`Attached image`})):n.append(s(mt[t],{size:16}));let r=e.size==null?e.mime:`${e.mime||`file`} · ${ht(e.size)}`,i=y(`span`,{class:`attachment-chip__body`},y(`span`,{class:`attachment-chip__name`},e.name),r?y(`span`,{class:`attachment-chip__meta`},r):null);return y(`div`,{class:`attachment-chip attachment-chip--${t}`},n,i)}#a(){let e=this.#n.length>0,t=this.text!=null||this.#t!=null,n=this.childNodes.length>0,r=t||n||!e,i=y(`div`,{class:`stack`,part:`stack`});if(e){let e=y(`div`,{class:`attachments`,part:`attachments`});for(let t of this.#n)e.append(this.#i(t));i.append(e)}r&&i.append(y(`div`,{class:`b`,part:`bubble`},this.#r())),this.queued&&i.append(y(`span`,{class:`queued-tag`,part:`queued`},s(`clock`,{size:11}),`queued`));let a=y(`div`,{class:`msg user`,part:`message`},i);this.#e.replaceChildren(a)}});var gt=`
|
|
990
990
|
slicc-composer {
|
|
991
991
|
flex: 0 0 auto;
|
|
992
992
|
display: block;
|
|
@@ -1263,7 +1263,211 @@ slicc-composer .slicc-composer__ptt.is-picking {
|
|
|
1263
1263
|
animation-name: none;
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
`,gt=`slicc-composer-style`;function _t(e){if(e.getElementById(gt))return;let t=e.createElement(`style`);t.id=gt,t.textContent=ht,(e.head??e.documentElement).appendChild(t)}var vt=3e3,yt=60,bt=`slicc-composer:mic-device`;function xt(){try{return typeof localStorage>`u`?null:localStorage.getItem(bt)}catch{return null}}function St(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(bt,e):localStorage.removeItem(bt)}catch{}}function Ct(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}g(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=`unknown`;#d=xt();#f=null;#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=[];connectedCallback(){_t(this.ownerDocument),this.#S(),this.addEventListener(`pointerdown`,this.#C)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#C),this.#c?.cancel(),this.#c=null,this.#i=!1,this.#o=null,this.#a++,this.#P(),this.#M(),this.#f&&clearTimeout(this.#f),this.#f=null,this.#N(),this.#z(),this.#J()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#l??=r(),this.#l}set speech(e){this.#l=e,this.#u=`unknown`}get device(){return this.#d}set device(e){this.#d=e,St(e)}get inner(){return this.#S(),this.#e}append(...e){this.#S(),this.#e.append(...e)}#S(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#C=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t))return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}this.setAttribute(`data-ptt-pressed`,``),this.ownerDocument.addEventListener(`pointerup`,this.#D),this.addEventListener(`pointercancel`,this.#O);let n=this.#a;this.#p=setTimeout(()=>{this.#p=null,this.#w(this.speech,n)},100)};async#w(e,t){let n=await Promise.race([e.permission().then(e=>(this.#u=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),yt))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#E(e,t);return}if(n===`denied`){this.#V(`denied`);return}this.#V(`enable`),this.#f=setTimeout(()=>{this.#f=null,this.#T(e,t)},vt),n===`pending`&&e.permission().then(n=>{this.#u=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#j(),this.#E(e,t)):n===`denied`&&(this.#j(),this.#V(`denied`)))})}}#T(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#V(`prompting`),e.requestPermission().then(n=>{this.#u=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#E(e,t):n?this.#J():this.#i?this.#V(`denied`):this.#J())}))}#E(e,t){this.#r=`recording`,this.#V(`recording`),e.warmup(),this.#m?.(),this.#m=e.onStatus(e=>{this.#h=e,this.#K()}),e.microphones().then(e=>{t===this.#a&&e.length>1&&this.#q(e)}),e.start({deviceId:this.#d??void 0,onPartial:e=>{t===this.#a&&this.#G(e)},onError:e=>{t===this.#a&&this.#G(e,!0)}}).then(e=>{if(t!==this.#a||this.#r!==`recording`){e.cancel();return}if(!this.#i){e.cancel(),this.#o=null,this.#J();return}this.#c=e}).catch(e=>{t===this.#a&&this.#G(e instanceof Error?e.message:String(e),!0)})}#D=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#y,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#P(),this.#N(),this.#c?.cancel(),this.#c=null,this.#o=null,this.#F();return}this.#k(!0)};#O=e=>{this.#s!=null&&e.pointerId!==this.#s||this.#k(!1)};#k(e){if(!this.#i)return;switch(this.#i=!1,this.#M(),this.#P(),this.#N(),this.#r){case`enable`:this.#j(),this.#o=null,this.#J();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#J();return;case`recording`:break;default:this.#o=null,this.#J();return}let t=this.#c;if(this.#c=null,!e){t?.cancel(),this.#o=null,this.#J();return}if(!t){this.#o=null,this.#J();return}this.#r=`finalizing`,this.#G(`Transcribing…`);let n=this.#a;t.stop().then(e=>{n===this.#a&&(this.#J(),this.#A(e))}).catch(()=>{n===this.#a&&(this.#J(),this.#o=null)})}#A(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#j(){this.#f&&clearTimeout(this.#f),this.#f=null}#M(){this.#p&&clearTimeout(this.#p),this.#p=null}#N(){this.ownerDocument.removeEventListener(`pointerup`,this.#D),this.removeEventListener(`pointercancel`,this.#O)}#P(){let e=this.#s;if(this.#s=null,this.removeAttribute(`data-ptt-pressed`),e!=null)try{this.releasePointerCapture(e)}catch{}}#F(){this.#r=`picking`,this.#W(`picking`),this.#g&&(this.#g.textContent=`Choose a microphone`),this.#_&&(this.#_.hidden=!0),this.#I();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#L,!0),e.addEventListener(`keydown`,this.#R,!0)}#I(){let e=this.#y;if(!e||this.#b)return;let t=v(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),n=null;for(let e of this.#x){let r=e.deviceId===this.#d,i=v(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":r?`true`:`false`,"data-device-id":e.deviceId},e.label,v(`span`,{class:`tick`},a(`check`,{size:14})));i.addEventListener(`click`,()=>{this.device=e.deviceId,this.#B()}),(r||!n)&&(n=i),t.appendChild(i)}this.#b=t,e.appendChild(t),n?.focus()}#L=e=>{this.#y&&e.composedPath().includes(this.#y)||this.#B()};#R=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#B())};#z(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#L,!0),e.removeEventListener(`keydown`,this.#R,!0)}#B(){this.#z(),this.#J()}#V(e){switch(this.#r=e,this.#n||(this.#n=v(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#W(e),e){case`enable`:this.#H(a(`mic`,{size:28}),`Hold to enable push to talk`,this.#U(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#H(a(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#U(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:this.#H(a(`mic-off`,{size:28}),`Microphone access is blocked`,v(`div`,{class:`slicc-composer__ptt-load-text`},`Enable the microphone for this site in your browser settings, then hold again.`)),this.#n.setAttribute(`aria-label`,`Microphone access is blocked`);break;case`recording`:{this.#y=v(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#_=v(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#v=v(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=v(`div`,{class:`slicc-composer__ptt-microw`},v(`div`,{class:`slicc-composer__ptt-mic`},a(`mic`,{size:28})),this.#y);this.#g=v(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#g,this.#_,this.#v),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#K();break}}}#H(e,t,n){this.#n&&(this.#g=v(`div`,{class:`slicc-composer__ptt-label`},t),this.#_=null,this.#v=null,this.#y=null,this.#b=null,this.#x=[],this.#n.replaceChildren(v(`div`,{class:`slicc-composer__ptt-mic`},e),this.#g,n))}#U(e){return v(`div`,{class:`slicc-composer__ptt-load`},v(`span`,{class:`slicc-composer__ptt-load-text`},e),v(`div`,{class:`slicc-composer__ptt-bar`},v(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#W(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#G(e,t=!1){let n=this.#_;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#K(){let e=this.#v;if(!e)return;let t=this.#h;if(t?.state===`downloading`){let n=Ct(t.download?.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`,e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.hidden=!1):e.hidden=!0}#q(e){let t=this.#y;if(!t)return;this.#x=e;let n=v(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},a(`chevron-down`,{size:12}));n.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(n),t.hidden=!1}#J(){this.#m?.(),this.#m=null,this.#n?.remove(),this.#n=null,this.#g=null,this.#_=null,this.#v=null,this.#y=null,this.#b=null,this.#x=[],this.#r=`idle`}});var wt=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],Tt={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},Et=`max`,Dt=`Opus 4.8`,Ot=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],kt=8;function At(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var jt=`max`,Mt=13;function Nt(){return a(`sparkles`,{size:Mt,class:`ic`,part:`model-icon`})}function Pt(){return a(`brain`,{size:Mt,class:`brain`,part:`brain`})}function Ft(){return a(`chevron-down`,{size:11,part:`caret`})}var It=`http://www.w3.org/2000/svg`;function Lt(){let e=document.createElementNS(It,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(It,`defs`),n=document.createElementNS(It,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(It,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var Rt=y(`
|
|
1266
|
+
`,_t=`slicc-composer-style`;function vt(e){if(e.getElementById(_t))return;let t=e.createElement(`style`);t.id=_t,t.textContent=gt,(e.head??e.documentElement).appendChild(t)}var yt=3e3,bt=60,xt=`slicc-composer:mic-device`;function St(){try{return typeof localStorage>`u`?null:localStorage.getItem(xt)}catch{return null}}function Ct(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(xt,e):localStorage.removeItem(xt)}catch{}}function wt(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}_(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=`unknown`;#d=St();#f=null;#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=[];connectedCallback(){vt(this.ownerDocument),this.#S(),this.addEventListener(`pointerdown`,this.#C)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#C),this.#c?.cancel(),this.#c=null,this.#i=!1,this.#o=null,this.#a++,this.#P(),this.#M(),this.#f&&clearTimeout(this.#f),this.#f=null,this.#N(),this.#z(),this.#J()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#l??=a(),this.#l}set speech(e){this.#l=e,this.#u=`unknown`}get device(){return this.#d}set device(e){this.#d=e,Ct(e)}get inner(){return this.#S(),this.#e}append(...e){this.#S(),this.#e.append(...e)}#S(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#C=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t))return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}this.setAttribute(`data-ptt-pressed`,``),this.ownerDocument.addEventListener(`pointerup`,this.#D),this.addEventListener(`pointercancel`,this.#O);let n=this.#a;this.#p=setTimeout(()=>{this.#p=null,this.#w(this.speech,n)},100)};async#w(e,t){let n=await Promise.race([e.permission().then(e=>(this.#u=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),bt))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#E(e,t);return}if(n===`denied`){this.#V(`denied`);return}this.#V(`enable`),this.#f=setTimeout(()=>{this.#f=null,this.#T(e,t)},yt),n===`pending`&&e.permission().then(n=>{this.#u=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#j(),this.#E(e,t)):n===`denied`&&(this.#j(),this.#V(`denied`)))})}}#T(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#V(`prompting`),e.requestPermission().then(n=>{this.#u=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#E(e,t):n?this.#J():this.#i?this.#V(`denied`):this.#J())}))}#E(e,t){this.#r=`recording`,this.#V(`recording`),e.warmup(),this.#m?.(),this.#m=e.onStatus(e=>{this.#h=e,this.#K()}),e.microphones().then(e=>{t===this.#a&&i(e)&&this.#q(e)}),e.start({deviceId:this.#d??void 0,onPartial:e=>{t===this.#a&&this.#G(e)},onError:e=>{t===this.#a&&this.#G(e,!0)}}).then(e=>{if(t!==this.#a||this.#r!==`recording`){e.cancel();return}if(!this.#i){e.cancel(),this.#o=null,this.#J();return}this.#c=e}).catch(e=>{t===this.#a&&this.#G(e instanceof Error?e.message:String(e),!0)})}#D=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#y,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#P(),this.#N(),this.#c?.cancel(),this.#c=null,this.#o=null,this.#F();return}this.#k(!0)};#O=e=>{this.#s!=null&&e.pointerId!==this.#s||this.#k(!1)};#k(e){if(!this.#i)return;switch(this.#i=!1,this.#M(),this.#P(),this.#N(),this.#r){case`enable`:this.#j(),this.#o=null,this.#J();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#J();return;case`recording`:break;default:this.#o=null,this.#J();return}let t=this.#c;if(this.#c=null,!e){t?.cancel(),this.#o=null,this.#J();return}if(!t){this.#o=null,this.#J();return}this.#r=`finalizing`,this.#G(`Transcribing…`);let n=this.#a;t.stop().then(e=>{n===this.#a&&(this.#J(),this.#A(e))}).catch(()=>{n===this.#a&&(this.#J(),this.#o=null)})}#A(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#j(){this.#f&&clearTimeout(this.#f),this.#f=null}#M(){this.#p&&clearTimeout(this.#p),this.#p=null}#N(){this.ownerDocument.removeEventListener(`pointerup`,this.#D),this.removeEventListener(`pointercancel`,this.#O)}#P(){let e=this.#s;if(this.#s=null,this.removeAttribute(`data-ptt-pressed`),e!=null)try{this.releasePointerCapture(e)}catch{}}#F(){this.#r=`picking`,this.#W(`picking`),this.#g&&(this.#g.textContent=`Choose a microphone`),this.#_&&(this.#_.hidden=!0),this.#I();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#L,!0),e.addEventListener(`keydown`,this.#R,!0)}#I(){let e=this.#y;if(!e||this.#b)return;let t=y(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),n=null;for(let e of this.#x){let r=e.deviceId===this.#d,i=y(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":r?`true`:`false`,"data-device-id":e.deviceId},e.label,y(`span`,{class:`tick`},s(`check`,{size:14})));i.addEventListener(`click`,()=>{this.device=e.deviceId,this.#B()}),(r||!n)&&(n=i),t.appendChild(i)}this.#b=t,e.appendChild(t),n?.focus()}#L=e=>{this.#y&&e.composedPath().includes(this.#y)||this.#B()};#R=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#B())};#z(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#L,!0),e.removeEventListener(`keydown`,this.#R,!0)}#B(){this.#z(),this.#J()}#V(e){switch(this.#r=e,this.#n||(this.#n=y(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#W(e),e){case`enable`:this.#H(s(`mic`,{size:28}),`Hold to enable push to talk`,this.#U(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#H(s(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#U(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:this.#H(s(`mic-off`,{size:28}),`Microphone access is blocked`,y(`div`,{class:`slicc-composer__ptt-load-text`},`Enable the microphone for this site in your browser settings, then hold again.`)),this.#n.setAttribute(`aria-label`,`Microphone access is blocked`);break;case`recording`:{this.#y=y(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#_=y(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#v=y(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=y(`div`,{class:`slicc-composer__ptt-microw`},y(`div`,{class:`slicc-composer__ptt-mic`},s(`mic`,{size:28})),this.#y);this.#g=y(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#g,this.#_,this.#v),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#K();break}}}#H(e,t,n){this.#n&&(this.#g=y(`div`,{class:`slicc-composer__ptt-label`},t),this.#_=null,this.#v=null,this.#y=null,this.#b=null,this.#x=[],this.#n.replaceChildren(y(`div`,{class:`slicc-composer__ptt-mic`},e),this.#g,n))}#U(e){return y(`div`,{class:`slicc-composer__ptt-load`},y(`span`,{class:`slicc-composer__ptt-load-text`},e),y(`div`,{class:`slicc-composer__ptt-bar`},y(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#W(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#G(e,t=!1){let n=this.#_;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#K(){let e=this.#v;if(!e)return;let t=this.#h;if(t?.state===`downloading`){let n=wt(t.download?.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`,e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.hidden=!1):e.hidden=!0}#q(e){let t=this.#y;if(!t)return;this.#x=e;let n=y(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},s(`chevron-down`,{size:12}));n.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(n),t.hidden=!1}#J(){this.#m?.(),this.#m=null,this.#n?.remove(),this.#n=null,this.#g=null,this.#_=null,this.#v=null,this.#y=null,this.#b=null,this.#x=[],this.#r=`idle`}});var Tt=`
|
|
1267
|
+
slicc-composer-capture {
|
|
1268
|
+
position: relative;
|
|
1269
|
+
display: block;
|
|
1270
|
+
width: 100%;
|
|
1271
|
+
/* Self-bounded box: the surface fills the composer area at a responsive
|
|
1272
|
+
ratio (3:4 portrait on desktop / 4:3 landscape on mobile), clamped
|
|
1273
|
+
between a usable min and a sensible max, so the absolutely positioned
|
|
1274
|
+
bar / close / status overlays always sit inside the host rect rather
|
|
1275
|
+
than being pushed below by the <video>'s intrinsic size. The desktop
|
|
1276
|
+
max-width:360px lets the 3:4 ratio actually manifest as portrait
|
|
1277
|
+
within the wider 680px composer column (480px tall x 360px wide),
|
|
1278
|
+
with the box centered via margin:0 auto; the control bar stays one
|
|
1279
|
+
row at the bottom. */
|
|
1280
|
+
aspect-ratio: 3 / 4;
|
|
1281
|
+
max-width: 360px;
|
|
1282
|
+
margin: 0 auto;
|
|
1283
|
+
min-height: 220px;
|
|
1284
|
+
max-height: min(60vh, 480px);
|
|
1285
|
+
border-radius: 14px;
|
|
1286
|
+
overflow: hidden;
|
|
1287
|
+
background: #000;
|
|
1288
|
+
font-family: var(--ui);
|
|
1289
|
+
color: #fff;
|
|
1290
|
+
isolation: isolate;
|
|
1291
|
+
}
|
|
1292
|
+
slicc-composer-capture[hidden] {
|
|
1293
|
+
display: none;
|
|
1294
|
+
}
|
|
1295
|
+
/* Narrow / mobile: switch to landscape 4:3 and drop the desktop width
|
|
1296
|
+
cap so the box fills the column (matches the WC shell's 560px narrow
|
|
1297
|
+
breakpoint used by the chat thread / meta hint / logo). */
|
|
1298
|
+
@media (max-width: 560px) {
|
|
1299
|
+
slicc-composer-capture {
|
|
1300
|
+
aspect-ratio: 4 / 3;
|
|
1301
|
+
max-width: 100%;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
slicc-composer-capture .slicc-capture__video {
|
|
1305
|
+
position: absolute;
|
|
1306
|
+
inset: 0;
|
|
1307
|
+
width: 100%;
|
|
1308
|
+
height: 100%;
|
|
1309
|
+
display: block;
|
|
1310
|
+
object-fit: cover;
|
|
1311
|
+
background: #000;
|
|
1312
|
+
}
|
|
1313
|
+
slicc-composer-capture .slicc-capture__video[data-mirrored] {
|
|
1314
|
+
transform: scaleX(-1);
|
|
1315
|
+
}
|
|
1316
|
+
slicc-composer-capture .slicc-capture__status {
|
|
1317
|
+
position: absolute;
|
|
1318
|
+
top: 8px;
|
|
1319
|
+
left: 10px;
|
|
1320
|
+
/* Leave clearance for the absolutely-positioned close button in the
|
|
1321
|
+
top-right corner so the status text never visually collides with it. */
|
|
1322
|
+
right: 44px;
|
|
1323
|
+
font-size: 11.5px;
|
|
1324
|
+
color: rgba(255, 255, 255, 0.85);
|
|
1325
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
|
|
1326
|
+
pointer-events: none;
|
|
1327
|
+
min-height: 14px;
|
|
1328
|
+
}
|
|
1329
|
+
slicc-composer-capture .slicc-capture__close {
|
|
1330
|
+
position: absolute;
|
|
1331
|
+
top: 8px;
|
|
1332
|
+
right: 8px;
|
|
1333
|
+
z-index: 1;
|
|
1334
|
+
display: inline-flex;
|
|
1335
|
+
align-items: center;
|
|
1336
|
+
justify-content: center;
|
|
1337
|
+
width: 28px;
|
|
1338
|
+
height: 28px;
|
|
1339
|
+
padding: 0;
|
|
1340
|
+
color: #fff;
|
|
1341
|
+
background: color-mix(in srgb, #000 55%, transparent);
|
|
1342
|
+
border: 1px solid color-mix(in srgb, #fff 35%, transparent);
|
|
1343
|
+
border-radius: 50%;
|
|
1344
|
+
cursor: pointer;
|
|
1345
|
+
backdrop-filter: blur(8px) saturate(1.2);
|
|
1346
|
+
-webkit-backdrop-filter: blur(8px) saturate(1.2);
|
|
1347
|
+
}
|
|
1348
|
+
slicc-composer-capture .slicc-capture__close:hover {
|
|
1349
|
+
background: color-mix(in srgb, #fff 18%, transparent);
|
|
1350
|
+
}
|
|
1351
|
+
slicc-composer-capture .slicc-capture__bar {
|
|
1352
|
+
position: absolute;
|
|
1353
|
+
left: 8px;
|
|
1354
|
+
right: 8px;
|
|
1355
|
+
bottom: 8px;
|
|
1356
|
+
display: flex;
|
|
1357
|
+
align-items: center;
|
|
1358
|
+
gap: 8px;
|
|
1359
|
+
/* Single row: selects shrink (min-width: 0 + flex: 0 1 auto below) instead
|
|
1360
|
+
of wrapping so the bar never becomes two rows when the mic <select>
|
|
1361
|
+
appears in video mode. */
|
|
1362
|
+
flex-wrap: nowrap;
|
|
1363
|
+
padding: 6px 8px;
|
|
1364
|
+
border-radius: 10px;
|
|
1365
|
+
background: color-mix(in srgb, #000 55%, transparent);
|
|
1366
|
+
backdrop-filter: blur(8px) saturate(1.2);
|
|
1367
|
+
-webkit-backdrop-filter: blur(8px) saturate(1.2);
|
|
1368
|
+
}
|
|
1369
|
+
slicc-composer-capture .slicc-capture__spacer {
|
|
1370
|
+
flex: 1 1 auto;
|
|
1371
|
+
}
|
|
1372
|
+
slicc-composer-capture .slicc-capture__select {
|
|
1373
|
+
font: 400 12px var(--ui);
|
|
1374
|
+
color: #fff;
|
|
1375
|
+
background: color-mix(in srgb, #000 35%, transparent);
|
|
1376
|
+
border: 1px solid color-mix(in srgb, #fff 35%, transparent);
|
|
1377
|
+
border-radius: 8px;
|
|
1378
|
+
padding: 5px 8px;
|
|
1379
|
+
outline: none;
|
|
1380
|
+
/* Allow shrinking below intrinsic width so long device labels truncate
|
|
1381
|
+
instead of forcing the control bar onto a second row. */
|
|
1382
|
+
min-width: 0;
|
|
1383
|
+
max-width: 140px;
|
|
1384
|
+
flex: 0 1 auto;
|
|
1385
|
+
overflow: hidden;
|
|
1386
|
+
text-overflow: ellipsis;
|
|
1387
|
+
white-space: nowrap;
|
|
1388
|
+
}
|
|
1389
|
+
slicc-composer-capture .slicc-capture__select[hidden] {
|
|
1390
|
+
display: none;
|
|
1391
|
+
}
|
|
1392
|
+
slicc-composer-capture .slicc-capture__select:focus {
|
|
1393
|
+
border-color: var(--ctx);
|
|
1394
|
+
}
|
|
1395
|
+
slicc-composer-capture .slicc-capture__mode {
|
|
1396
|
+
display: inline-flex;
|
|
1397
|
+
border: 1px solid color-mix(in srgb, #fff 35%, transparent);
|
|
1398
|
+
border-radius: 8px;
|
|
1399
|
+
overflow: hidden;
|
|
1400
|
+
flex: 0 0 auto;
|
|
1401
|
+
}
|
|
1402
|
+
slicc-composer-capture .slicc-capture__mode-btn {
|
|
1403
|
+
display: inline-flex;
|
|
1404
|
+
align-items: center;
|
|
1405
|
+
justify-content: center;
|
|
1406
|
+
font: 500 12px var(--ui);
|
|
1407
|
+
color: #fff;
|
|
1408
|
+
background: transparent;
|
|
1409
|
+
border: 0;
|
|
1410
|
+
/* Icon-only buttons: square-ish padding centers the 14px lucide glyph. */
|
|
1411
|
+
padding: 5px 8px;
|
|
1412
|
+
cursor: pointer;
|
|
1413
|
+
}
|
|
1414
|
+
slicc-composer-capture .slicc-capture__mode-btn[aria-pressed='true'] {
|
|
1415
|
+
background: color-mix(in srgb, #fff 22%, transparent);
|
|
1416
|
+
}
|
|
1417
|
+
slicc-composer-capture .slicc-capture__btn {
|
|
1418
|
+
display: inline-flex;
|
|
1419
|
+
align-items: center;
|
|
1420
|
+
gap: 6px;
|
|
1421
|
+
font: 500 12px var(--ui);
|
|
1422
|
+
color: #fff;
|
|
1423
|
+
background: color-mix(in srgb, #000 35%, transparent);
|
|
1424
|
+
border: 1px solid color-mix(in srgb, #fff 35%, transparent);
|
|
1425
|
+
border-radius: 8px;
|
|
1426
|
+
padding: 6px 12px;
|
|
1427
|
+
cursor: pointer;
|
|
1428
|
+
}
|
|
1429
|
+
slicc-composer-capture .slicc-capture__btn:hover {
|
|
1430
|
+
background: color-mix(in srgb, #fff 18%, transparent);
|
|
1431
|
+
}
|
|
1432
|
+
slicc-composer-capture .slicc-capture__btn--primary {
|
|
1433
|
+
background: var(--canvas, #fff);
|
|
1434
|
+
color: var(--ink, #111);
|
|
1435
|
+
border-color: var(--canvas, #fff);
|
|
1436
|
+
}
|
|
1437
|
+
slicc-composer-capture .slicc-capture__btn--primary:hover {
|
|
1438
|
+
background: color-mix(in srgb, var(--canvas, #fff) 85%, var(--ink, #111));
|
|
1439
|
+
}
|
|
1440
|
+
slicc-composer-capture .slicc-capture__btn--rec {
|
|
1441
|
+
background: #d9362b;
|
|
1442
|
+
color: #fff;
|
|
1443
|
+
border-color: #d9362b;
|
|
1444
|
+
}
|
|
1445
|
+
slicc-composer-capture .slicc-capture__btn--rec:hover {
|
|
1446
|
+
background: color-mix(in srgb, #d9362b 88%, #fff);
|
|
1447
|
+
}
|
|
1448
|
+
slicc-composer-capture .slicc-capture__dot {
|
|
1449
|
+
width: 10px;
|
|
1450
|
+
height: 10px;
|
|
1451
|
+
border-radius: 50%;
|
|
1452
|
+
background: currentColor;
|
|
1453
|
+
display: inline-block;
|
|
1454
|
+
}
|
|
1455
|
+
slicc-composer-capture .slicc-capture__square {
|
|
1456
|
+
width: 10px;
|
|
1457
|
+
height: 10px;
|
|
1458
|
+
background: currentColor;
|
|
1459
|
+
display: inline-block;
|
|
1460
|
+
}
|
|
1461
|
+
slicc-composer-capture .slicc-capture__timer {
|
|
1462
|
+
font: 500 12px var(--ui);
|
|
1463
|
+
color: #fff;
|
|
1464
|
+
font-variant-numeric: tabular-nums;
|
|
1465
|
+
padding: 0 4px;
|
|
1466
|
+
}
|
|
1467
|
+
slicc-composer-capture .slicc-capture__timer[hidden] {
|
|
1468
|
+
display: none;
|
|
1469
|
+
}
|
|
1470
|
+
`,Et=`slicc-composer-capture-style`;function Dt(e){if(e.getElementById(Et))return;let t=e.createElement(`style`);t.id=Et,t.textContent=Tt,(e.head??e.documentElement).appendChild(t)}var Ot=`photo`,kt=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`];function At(){if(typeof MediaRecorder>`u`)return`video/webm`;for(let e of kt)if(MediaRecorder.isTypeSupported?.(e))return e;return`video/webm`}function jt(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}_(`slicc-composer-capture`,class extends HTMLElement{static observedAttributes=[`mode`,`preferred-device`,`preferred-audio-device`];media=null;recorderFactory=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=null;#d=null;#f=null;#p=[];#m=0;#h=null;#g=null;#_=e=>{e.key===`Escape`&&this.#g&&this.#L()};connectedCallback(){Dt(this.ownerDocument),this.#H(),this.ownerDocument.addEventListener(`keydown`,this.#_)}disconnectedCallback(){if(this.ownerDocument.removeEventListener(`keydown`,this.#_),this.#N(),this.#P(),this.#I(),this.#g){let e=this.#g;this.#g=null,e(null)}}attributeChangedCallback(e,t,n){e===`mode`&&this.#l&&this.#z(n??Ot)}get mode(){return this.getAttribute(`mode`)===`video`?`video`:`photo`}set mode(e){e==null?this.removeAttribute(`mode`):this.setAttribute(`mode`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}get preferredAudioDevice(){return this.getAttribute(`preferred-audio-device`)}set preferredAudioDevice(e){e==null?this.removeAttribute(`preferred-audio-device`):this.setAttribute(`preferred-audio-device`,e)}#v(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}#y(e,t){return this.recorderFactory?this.recorderFactory(e,t):new MediaRecorder(e,t)}async open(e){this.#H(),e&&(this.mode=e),this.#z(this.mode);let t=this.#v();if(!t)return null;try{this.#u=await this.#b(t,this.preferredDevice,this.preferredAudioDevice,this.mode)}catch{return null}return this.#S(),this.#C(this.#u),await this.#w(t),await this.#T(t),this.hidden=!1,new Promise(e=>{this.#g=e})}async#b(e,t,n,r){let i=this.#x(n,r);if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}},audio:i})}catch{}try{return await e.getUserMedia({video:!0,audio:i})}catch(t){if(i===!1)throw t;return this.#r.textContent=`Microphone unavailable — recording video only.`,e.getUserMedia({video:!0,audio:!1})}}#x(e,t){return t===`video`?e?{deviceId:{exact:e}}:!0:!1}#S(){this.#d=this.#u?.getAudioTracks()[0]??null}#C(e){this.#e.srcObject=e,this.#e.muted=!0,this.#e.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#e.toggleAttribute(`data-mirrored`,t!==`environment`)}async#w(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}let n=r(t,`camera`);this.#t.replaceChildren(...n.map(e=>y(`option`,{value:e.deviceId},e.label)));let a=this.#u?.getVideoTracks()[0]?.getSettings?.().deviceId;a&&(this.#t.value=a),this.#t.toggleAttribute(`hidden`,!i(n))}async#T(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{t=[]}let n=r(t,`microphone`);this.#n.replaceChildren(...n.map(e=>y(`option`,{value:e.deviceId},e.label)));let i=this.#d?.getSettings?.().deviceId??this.preferredAudioDevice??null;i&&n.some(e=>e.deviceId===i)&&(this.#n.value=i),this.#E()}#E(){if(!this.#n)return;let e=this.#n.options.length>=2,t=this.mode===`video`&&e;this.#n.toggleAttribute(`hidden`,!t)}async#D(e){let t=this.#v();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#F();let r=n;if(this.mode===`video`&&this.#d&&this.#d.readyState===`live`)r.addTrack(this.#d);else if(this.mode===`video`)try{let e=await t.getUserMedia({audio:this.#x(this.preferredAudioDevice,`video`)});for(let t of e.getAudioTracks())this.#d=t,r.addTrack(t)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}this.#u=r,this.#C(r),this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`camera`},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}async#O(e){let t=this.#v();if(!t||!this.#u)return;this.#r.textContent=``;let n;try{n=await t.getUserMedia({audio:{deviceId:{exact:e}}})}catch{this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}let r=n.getAudioTracks()[0];if(!r){this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}if(this.#d){try{this.#u.removeTrack(this.#d)}catch{}this.#d.stop()}this.#u.addTrack(r),this.#d=r,this.preferredAudioDevice=e,this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`microphone`},bubbles:!0,composed:!0}))}#k(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#e.videoWidth,e.height=this.#e.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#e,0,0);let t=`image/png`,n=e.toDataURL(t);this.#R({kind:`image`,dataUrl:n,mimeType:t,width:e.width,height:e.height})}#A(){if(!this.#u||this.#f)return;this.#p=[];let e=At(),t;try{t=this.#y(this.#u,{mimeType:e})}catch{this.#r.textContent=`Recording is not supported in this browser.`;return}t.ondataavailable=e=>{e.data&&e.data.size>0&&this.#p.push(e.data)},t.onstop=()=>this.#M(e);try{t.start()}catch{this.#r.textContent=`Could not start recording.`;return}this.#f=t,this.#m=Date.now(),this.#n.disabled=!0,this.#t.disabled=!0,this.#i.hidden=!1,this.#i.textContent=jt(0),this.#h=setInterval(()=>{this.#i.textContent=jt(Date.now()-this.#m)},250),this.#B()}#j(){let e=this.#f;if(e)try{e.state!==`inactive`&&e.stop()}catch{this.#M(e.mimeType||`video/webm`)}}#M(e){let t=this.#m?Date.now()-this.#m:0;this.#N();let n=this.#f?.mimeType||e||`video/webm`,r=new Blob(this.#p,{type:n});this.#p=[],this.#f=null,this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1);let i=typeof URL<`u`?URL.createObjectURL(r):void 0;this.#R({kind:`video`,blob:r,dataUrl:i,mimeType:n,width:this.#e.videoWidth,height:this.#e.videoHeight,durationMs:t})}#N(){this.#h!=null&&(clearInterval(this.#h),this.#h=null),this.#i.hidden=!0,this.#i.textContent=``,this.#m=0}#P(){let e=this.#f;if(this.#f=null,this.#p=[],this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1),e){e.ondataavailable=null,e.onstop=null;try{e.state!==`inactive`&&e.stop()}catch{}}}#F(){for(let e of this.#u?.getVideoTracks()??[])e.stop()}#I(){for(let e of this.#u?.getTracks()??[])e.stop();this.#u=null,this.#d=null,this.#e&&(this.#e.srcObject=null)}#L(){this.dispatchEvent(new CustomEvent(`slicc-capture-cancel`,{bubbles:!0,composed:!0})),this.#R(null)}#R(e){e&&this.dispatchEvent(new CustomEvent(`slicc-capture`,{detail:e,bubbles:!0,composed:!0})),this.#N(),this.#P(),this.#I();let t=this.#g;this.#g=null,this.hidden=!0,t?.(e)}#z(e){let t=e===`video`;this.#s.setAttribute(`aria-pressed`,String(!t)),this.#c.setAttribute(`aria-pressed`,String(t)),this.#r.textContent=t?`Mic on — video will record audio.`:``,this.#B(),this.#E()}#B(){let e=this.#a;if(e.replaceChildren(),this.mode===`photo`){e.className=`slicc-capture__btn slicc-capture__btn--primary`,e.setAttribute(`part`,`snap`),e.setAttribute(`aria-label`,`Snap photo`),e.append(s(`camera`,{size:14}),document.createTextNode(` Snap`));return}this.#f?(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`stop`),e.setAttribute(`aria-label`,`Stop recording`),e.append(y(`span`,{class:`slicc-capture__square`}),document.createTextNode(` Stop`))):(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`record`),e.setAttribute(`aria-label`,`Start recording`),e.append(y(`span`,{class:`slicc-capture__dot`}),document.createTextNode(` Record`)))}#V(){if(this.mode===`photo`){this.#k();return}this.#f?this.#j():this.#A()}#H(){if(this.#l)return;this.#l=!0,this.#e=y(`video`,{class:`slicc-capture__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#e.muted=!0,this.#r=y(`div`,{class:`slicc-capture__status`}),this.#t=y(`select`,{class:`slicc-capture__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#t.addEventListener(`change`,()=>{this.#D(this.#t.value)}),this.#n=y(`select`,{class:`slicc-capture__select`,part:`audio-picker`,"aria-label":`Microphone`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#O(this.#n.value)}),this.#s=y(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`true`,"aria-label":`Photo`},s(`image`,{size:14})),this.#s.addEventListener(`click`,()=>{this.mode=`photo`}),this.#c=y(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`false`,"aria-label":`Video`},s(`video`,{size:14})),this.#c.addEventListener(`click`,()=>{this.#U()});let e=y(`div`,{class:`slicc-capture__mode`,role:`group`,"aria-label":`Capture mode`},this.#s,this.#c);this.#i=y(`span`,{class:`slicc-capture__timer`,hidden:!0}),this.#o=y(`button`,{type:`button`,class:`slicc-capture__close`,part:`cancel`,"aria-label":`Cancel`},s(`x`,{size:14})),this.#o.addEventListener(`click`,()=>this.#L()),this.#a=y(`button`,{type:`button`,class:`slicc-capture__btn slicc-capture__btn--primary`,part:`snap`,"aria-label":`Snap photo`}),this.#a.addEventListener(`click`,()=>this.#V());let t=y(`div`,{class:`slicc-capture__bar`},this.#t,this.#n,y(`span`,{class:`slicc-capture__spacer`}),this.#i,this.#a,e);this.replaceChildren(this.#e,this.#r,t,this.#o),this.#z(this.mode)}async#U(){if(this.mode=`video`,!this.#u||this.#u.getAudioTracks().length>0)return;let e=this.#v();if(!e)return;let t=this.#u.getVideoTracks()[0]?.getSettings?.().deviceId??this.preferredDevice??null,n=this.#x(this.preferredAudioDevice,`video`);try{let r=t?await e.getUserMedia({video:{deviceId:{exact:t}},audio:n}):await e.getUserMedia({video:!0,audio:n});this.#I(),this.#u=r,this.#S(),this.#C(r),await this.#T(e)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}}});var Mt=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],Nt={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},Pt=`max`,Ft=`Opus 4.8`,It=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],Lt=8;function Rt(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var zt=`max`,Bt=13;function Vt(){return s(`sparkles`,{size:Bt,class:`ic`,part:`model-icon`})}function Ht(){return s(`brain`,{size:Bt,class:`brain`,part:`brain`})}function Ut(){return s(`chevron-down`,{size:11,part:`caret`})}var Wt=`http://www.w3.org/2000/svg`;function Gt(){let e=document.createElementNS(Wt,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(Wt,`defs`),n=document.createElementNS(Wt,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(Wt,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var Kt=b(`
|
|
1267
1471
|
:host{display:block;}
|
|
1268
1472
|
*{box-sizing:border-box;}
|
|
1269
1473
|
.meta{display:flex;align-items:center;gap:8px;max-width:680px;margin:11px auto 0;font-family:var(--ui);}
|
|
@@ -1319,7 +1523,7 @@ slicc-composer .slicc-composer__ptt.is-picking {
|
|
|
1319
1523
|
/* Narrow / extension-sidebar: the ⏎ / ⇧⏎ keyboard hints don't fit (and touch
|
|
1320
1524
|
users have no keyboard) — drop them regardless of the narrow-chat attribute. */
|
|
1321
1525
|
@media (max-width: 560px){ .hint{display:none;} }
|
|
1322
|
-
`);
|
|
1526
|
+
`);_(`slicc-composer-meta`,class extends HTMLElement{static observedAttributes=[`model`,`thinking`,`narrow`,`no-thinking`];#e;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=!1;#l=``;#u=e=>{this.#c&&!e.composedPath().includes(this)&&this.#b()};#d=e=>{e.key===`Escape`&&this.#c&&(e.stopPropagation(),this.#b(),this.#r?.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Kt]}connectedCallback(){this.#m()}disconnectedCallback(){this.#_(),document.removeEventListener(`mousedown`,this.#u),document.removeEventListener(`keydown`,this.#d,!0)}attributeChangedCallback(){this.isConnected&&this.#m()}get model(){return this.getAttribute(`model`)??Ft}set model(e){e==null?this.removeAttribute(`model`):this.setAttribute(`model`,e)}get models(){return(this.#s??[...It]).map(e=>typeof e==`string`?e:{...e})}set models(e){this.#s=Array.isArray(e)?e.slice():null,this.isConnected&&this.#m()}get#f(){return(this.#s??It).map(Rt)}get#p(){return this.#s!==null&&this.#s.length===0}get thinking(){let e=this.getAttribute(`thinking`);return Mt.includes(e??``)?e:zt}set thinking(e){this.setAttribute(`thinking`,e)}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){this.toggleAttribute(`narrow`,e)}get noThinking(){return this.hasAttribute(`no-thinking`)}set noThinking(e){this.toggleAttribute(`no-thinking`,e)}get accented(){return this.thinking===Pt}#m(){this.#_();let e=this.model,t=this.thinking,n=Nt[t],r=t===Pt,i=this.#p,a=i?y(`button`,{type:`button`,class:`ctl msel`,part:`model`},Vt(),` `,`Add AI`):y(`button`,{type:`button`,class:`ctl msel`,part:`model`,"aria-haspopup":`menu`,"aria-expanded":`false`},Vt(),` `,e,` `,y(`span`,{class:`cx`},Ut())),o=y(`div`,{class:`menu`,part:`model-menu`,role:`menu`});if(this.#f.length>Lt){let e=y(`input`,{class:`msearch`,part:`model-search`,type:`text`,placeholder:`Search models…`,"aria-label":`Search models`});e.value=this.#l,e.addEventListener(`input`,()=>{this.#l=e.value,this.#h()}),e.addEventListener(`click`,e=>e.stopPropagation()),o.append(e)}this.#o=y(`div`,{class:`mlist`,role:`none`}),o.append(this.#o);let s=y(`div`,{class:`mwrap`},a,o),c=!this.noThinking&&!i,l=null;if(c){let e=Ht();e.style.color=n.tint,l=y(`button`,{type:`button`,class:`ctl tsel${r?` x`:``}`,part:`thinking`,title:n.gloss},e,` `,y(`span`,{class:`tlabel`},n.label),` `,y(`span`,{class:`cx`},Ut())),l.style.setProperty(`--tw`,n.tint)}let u=y(`slot`,{name:`hint`});v(u,[y(`span`,{class:`kbd`},`⏎`),` send `,y(`span`,{class:`sep`}),` `,y(`span`,{class:`kbd`},`⇧⏎`),` newline`]);let d=y(`div`,{class:`meta`,part:`meta`},s,l??!1,y(`div`,{class:`mspacer`}),y(`span`,{class:`hint`,part:`hint`},u));this.#e.replaceChildren(Gt(),d),this.#a=s,this.#r=this.#e.querySelector(`.msel`),this.#i=this.#e.querySelector(`.tsel`),this.#h(),this.#x(),this.#g()}#h(){let e=this.#o;if(!e)return;let t=this.#l.trim().toLowerCase(),n=this.#f.filter(e=>!t||`${e.name} ${e.provider??``}`.toLowerCase().includes(t)),r=this.model,i=[];for(let e of n){let t=e.name===r,n=y(`button`,{type:`button`,class:`mitem`,role:`menuitemradio`,"data-id":e.id,"aria-selected":t?`true`:`false`},y(`span`,{class:`mname`},e.name),e.provider?y(`span`,{class:`mprov`},e.provider):!1,y(`span`,{class:`tick`},s(`check`,{size:14})));n.addEventListener(`click`,()=>this.#S(e.id)),i.push(n)}e.replaceChildren(...i.length?i:[y(`div`,{class:`mempty`},`No models match.`)])}#g(){this.#r&&(this.#t=e=>{if(e.stopPropagation(),this.#p){this.dispatchEvent(new CustomEvent(`add-ai`,{bubbles:!0,composed:!0}));return}this.#v()},this.#r.addEventListener(`click`,this.#t)),this.#i&&(this.#n=()=>this.#C(),this.#i.addEventListener(`click`,this.#n))}#_(){this.#r&&this.#t&&this.#r.removeEventListener(`click`,this.#t),this.#i&&this.#n&&this.#i.removeEventListener(`click`,this.#n),this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=null,this.#o=null}get menuOpen(){return this.#c}openMenu(){this.#p||this.#y()}#v(){this.#c?this.#b():this.#y()}#y(){if(this.#c)return;this.#c=!0,this.#l=``,this.#h(),this.#x();let e=this.#e.querySelector(`.msearch`);e&&(e.value=``,requestAnimationFrame(()=>e.focus())),document.addEventListener(`mousedown`,this.#u),document.addEventListener(`keydown`,this.#d,!0)}#b(){this.#c&&(this.#c=!1,this.#x(),document.removeEventListener(`mousedown`,this.#u),document.removeEventListener(`keydown`,this.#d,!0))}#x(){this.#a?.classList.toggle(`open`,this.#c),this.#r?.setAttribute(`aria-expanded`,this.#c?`true`:`false`)}#S(e){let t=this.#f.find(t=>t.id===e)??{name:e,id:e,provider:void 0};this.#b(),t.name!==this.model&&(this.model=t.name),this.dispatchEvent(new CustomEvent(`model-change`,{detail:{model:t.name,provider:t.provider,id:t.id},bubbles:!0,composed:!0}))}#C(){let e=Mt[(Mt.indexOf(this.thinking)+1)%Mt.length];this.thinking=e,this.dispatchEvent(new CustomEvent(`thinking-change`,{detail:{thinking:e,label:Nt[e].label,accented:e===Pt},bubbles:!0,composed:!0}))}});async function qt(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function Jt(e,t={}){let n=(e??``).trim().toLowerCase();if(n===``)return null;let r=await qt(n),i=t.size??80,a=t.fallback??`mp`;return`https://www.gravatar.com/avatar/${r}?s=${i}&d=${encodeURIComponent(a)}`}var Yt=b(`
|
|
1323
1527
|
:host { display: inline-flex; }
|
|
1324
1528
|
:host([hidden]) { display: none; }
|
|
1325
1529
|
|
|
@@ -1494,7 +1698,7 @@ slicc-composer .slicc-composer__ptt.is-picking {
|
|
|
1494
1698
|
}
|
|
1495
1699
|
.glyph.is-press { transform: none; }
|
|
1496
1700
|
}
|
|
1497
|
-
`),
|
|
1701
|
+
`),Xt=18,Zt=72;_(`slicc-send-button`,class extends HTMLElement{static observedAttributes=[`disabled`,`busy`,`email`,`src`,`label`];#e;#t=null;#n=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Yt]}connectedCallback(){this.#d()}attributeChangedCallback(){this.isConnected&&this.#d()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,!!e)}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#r=()=>{if(!this.disabled){if(this.busy){this.dispatchEvent(new CustomEvent(`stop`,{bubbles:!0,composed:!0}));return}this.#l(),this.dispatchEvent(new CustomEvent(`send`,{bubbles:!0,composed:!0}))}};#i(){return this.#e.querySelector(`.glyph`)}#a=()=>{this.disabled||this.busy||this.#i()?.classList.add(`is-hover`)};#o=()=>{this.#i()?.classList.remove(`is-hover`,`is-press`)};#s=()=>{if(this.disabled||this.busy)return;let e=this.#i();e?.classList.add(`is-press`),e?.classList.remove(`is-hover`)};#c=()=>{this.#i()?.classList.remove(`is-press`)};#l(){let e=this.#e.querySelector(`.glyph`);e&&(e.classList.remove(`is-whoosh`),e.offsetWidth,e.classList.add(`is-whoosh`),e.addEventListener(`animationend`,()=>e.classList.remove(`is-whoosh`),{once:!0}))}#u(){let e=++this.#n;if(!this.#t)return;let t=t=>{if(e!==this.#n)return;let n=this.#t;if(n)if(n.querySelector(`.face`)?.remove(),t){let e=document.createElement(`img`);e.className=`face`,e.setAttribute(`part`,`face`),e.alt=``,e.src=t,n.prepend(e),n.classList.add(`has-face`)}else n.classList.remove(`has-face`)},n=this.src;if(n){t(n);return}let r=this.email;if(!r||r.trim()===``){t(null);return}t(null),Jt(r,{size:Zt}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,n=this.label??(e?`Stop`:`Send`),r=e?y(`slot`,{name:`busy`},y(`span`,{class:`stop`,part:`stop`},s(`square`,{size:Xt}),y(`span`,{class:`stop-fill`},s(`square`,{size:Xt})))):y(`slot`,null,y(`span`,{class:`glyph`,part:`glyph`},s(`arrow-up`,{size:Xt}))),i=y(`button`,{part:`button`,class:`send${e?` is-busy`:``}`,type:`button`,title:n,"aria-label":n,disabled:t||void 0},r);this.#e.replaceChildren(i),this.#t=i,this.#t.addEventListener(`click`,this.#r),this.#t.addEventListener(`pointerenter`,this.#a),this.#t.addEventListener(`pointerleave`,this.#o),this.#t.addEventListener(`pointerdown`,this.#s),this.#t.addEventListener(`pointerup`,this.#c),this.#u()}});var Qt=`
|
|
1498
1702
|
slicc-input-card {
|
|
1499
1703
|
display: block;
|
|
1500
1704
|
}
|
|
@@ -1548,7 +1752,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1548
1752
|
flex: 1;
|
|
1549
1753
|
min-width: 0;
|
|
1550
1754
|
}
|
|
1551
|
-
|
|
1755
|
+
`,$t=`slicc-input-card-style`;function en(e){if(e.getElementById($t))return;let t=e.createElement(`style`);t.id=$t,t.textContent=Qt,(e.head??e.documentElement).appendChild(t)}var tn=`Ask sliccy, or describe a change…`;_(`slicc-input-card`,class extends HTMLElement{static observedAttributes=[`value`,`placeholder`,`suggestion`,`disabled`];#e;#t;#n;#r=!1;connectedCallback(){en(this.ownerDocument),this.#i(),this.#a(),this.#u()}attributeChangedCallback(e,t,n){!this.#r||t===n||(this.#a(),e===`value`&&this.#u())}get value(){return this.#r?this.#t.value:this.getAttribute(`value`)??``}set value(e){let t=e??``;this.#r&&(this.#t.value=t,this.#u()),t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t)}get placeholder(){return this.getAttribute(`placeholder`)??tn}set placeholder(e){e==null?this.removeAttribute(`placeholder`):this.setAttribute(`placeholder`,e)}get suggestion(){return this.getAttribute(`suggestion`)}set suggestion(e){e==null||e===``?this.removeAttribute(`suggestion`):this.setAttribute(`suggestion`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}focus(e){this.#i(),this.#t.focus(e)}clear(){this.value=``}#i(){if(this.#r)return;this.#r=!0;let e=this.ownerDocument,t=Array.from(this.children).filter(e=>e.getAttribute(`slot`)===`toolbar`);if(this.replaceChildren(),this.#e=e.createElement(`div`),this.#e.className=`slicc-input-card__card`,this.#e.setAttribute(`part`,`card`),this.#t=e.createElement(`textarea`),this.#t.className=`ta`,this.#t.setAttribute(`part`,`textarea`),this.#t.rows=1,this.#n=e.createElement(`div`),this.#n.className=`toolbar`,this.#n.setAttribute(`part`,`toolbar`),t.length>0)for(let e of t)this.#n.appendChild(e);else this.#n.append(y(`slicc-add-menu`),y(`slicc-send-button`));this.#e.append(this.#t,this.#n),this.appendChild(this.#e),this.#t.addEventListener(`input`,this.#o),this.#t.addEventListener(`keydown`,this.#s),this.#n.addEventListener(`send`,this.#c)}#a(){if(!this.#r)return;let e=this.#t;e.placeholder=this.suggestion??this.placeholder,e.disabled=this.disabled;let t=this.getAttribute(`value`)??``;e.value!==t&&(e.value=t)}#o=e=>{e.stopPropagation();let t=this.#t.value;t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t),this.#u(),this.dispatchEvent(new CustomEvent(`input`,{bubbles:!0,composed:!0,detail:{value:t}}))};#s=e=>{if(e.isComposing)return;if(e.key===`Enter`&&!e.shiftKey){e.preventDefault(),this.#l();return}if(e.key===`Tab`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){let t=this.suggestion;if(t&&this.#t.value===``){e.preventDefault(),this.removeAttribute(`suggestion`);let n=this.#t;n.value=t,n.setSelectionRange(t.length,t.length),n.dispatchEvent(new Event(`input`,{bubbles:!0}))}return}let t=this.#t,n=t.selectionStart===t.selectionEnd;e.key===`ArrowUp`&&n&&t.selectionStart===0?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`history-up`,{bubbles:!0,composed:!0}))):e.key===`ArrowDown`&&n&&t.selectionStart===t.value.length&&this.dispatchEvent(new CustomEvent(`history-down`,{bubbles:!0,composed:!0}))};#c=e=>{e.stopPropagation(),this.#l()};submit(e){this.#i(),this.#l(e)}focusEnd(){if(!this.#r)return;let e=this.#t;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}#l(e){if(this.disabled)return;let t=this.#t.value;t.trim()!==``&&(this.removeAttribute(`suggestion`),this.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t,...e?{source:e}:{}}})))}#u(){if(!this.#r)return;let e=this.#t;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${Math.min(t,140)}px`,e.style.overflowY=t>140?`auto`:`hidden`}});var nn=b(`
|
|
1552
1756
|
:host{display:block;font-family:var(--ui);}
|
|
1553
1757
|
:host(:not([count])),:host([count="0"]),:host([count="-0"]){display:none;}
|
|
1554
1758
|
.wrap{display:flex;flex-direction:column;align-items:stretch;gap:6px;}
|
|
@@ -1569,7 +1773,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1569
1773
|
:host-context(body.dark) .dismiss:hover,:host-context(body.dark) .dismiss:focus-visible,
|
|
1570
1774
|
:host-context(.dark) .dismiss:hover,:host-context(.dark) .dismiss:focus-visible,
|
|
1571
1775
|
:host-context([data-theme="dark"]) .dismiss:hover,:host-context([data-theme="dark"]) .dismiss:focus-visible{background:color-mix(in srgb,#0a0a0a 14%,transparent);}
|
|
1572
|
-
`),
|
|
1776
|
+
`),rn=[{rot:0,x:0,y:0},{rot:-2,x:-3,y:-2},{rot:2,x:3,y:-4},{rot:-3,x:-5,y:-6},{rot:3,x:5,y:-8},{rot:-1,x:-2,y:-10},{rot:1,x:2,y:-12}];function an(e){return rn[Math.min(e,rn.length-1)]??rn[0]}_(`slicc-queued-stack`,class extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[nn]}connectedCallback(){this.#i()}get count(){return this.#t.length}setMessages(e){this.#t=e.slice(),this.setAttribute(`count`,String(this.#t.length)),this.#i()}#n(e){this.dispatchEvent(new CustomEvent(`slicc-queued-remove`,{detail:{id:e},bubbles:!0,composed:!0}))}#r(e,t,n,r){let{rot:i,x:a,y:o}=an(t),c=n?`none`:`translate(${a}px, ${o}px) rotate(${i}deg)`,l=`card${n?` is-front`:``}${t===0?``:t===1?` is-back`:` is-deep`}`,u=n?`card front`:`card`,d=`transform:${c};z-index:${r};`,f=[y(`span`,{class:`bubble`},e.text)];if(e.attachments&&e.attachments>0&&f.push(y(`span`,{class:`attach`},`+${e.attachments}`)),n){let t=y(`button`,{type:`button`,class:`dismiss`,part:`dismiss`,"aria-label":`Remove queued message`},s(`x`,{size:14}));t.addEventListener(`click`,t=>{t.stopPropagation(),this.#n(e.id)}),f.push(t)}return y(`div`,{class:l,part:u,style:d},...f)}#i(){if(this.#t.length===0){this.#e.replaceChildren();return}let e=this.#t.length,t=[];for(let n=e-1;n>=0;n--){let r=e-1-n,i=r===0,a=n+1,o=this.#t[n];o&&t.push(this.#r(o,r,i,a))}let n=y(`div`,{class:`stack`,part:`stack`},...t),r=y(`div`,{class:`wrap`},y(`span`,{class:`badge`,part:`badge`},s(`clock`,{size:11}),`${e} queued`),n);this.#e.replaceChildren(r)}});var on=1e3;function sn(e,t){let n=t.longPressMs??1e3,r=t.modifierClickAsLongPress??!0,i=null,a=!1,o=()=>{t.onPressEnd?.()},s=()=>{i!==null&&(clearTimeout(i),i=null),o()},c=e=>{e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(a=!1,s(),t.onPressStart?.(e),i=setTimeout(()=>{a=!0,o(),i=null,t.onLongPress()},n)))},l=()=>s(),u=()=>s(),d=()=>s(),f=()=>s(),p=e=>{if(a){a=!1,e.preventDefault();return}if((e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)&&r){e.preventDefault(),t.onLongPress();return}t.onShortClick(e)};return e.addEventListener(`mousedown`,c),e.addEventListener(`mouseup`,l),e.addEventListener(`mouseleave`,u),e.addEventListener(`blur`,d),e.addEventListener(`contextmenu`,f),e.addEventListener(`click`,p),{destroy:()=>{s(),e.removeEventListener(`mousedown`,c),e.removeEventListener(`mouseup`,l),e.removeEventListener(`mouseleave`,u),e.removeEventListener(`blur`,d),e.removeEventListener(`contextmenu`,f),e.removeEventListener(`click`,p)}}}var cn=b(`
|
|
1573
1777
|
:host { display: inline-grid; }
|
|
1574
1778
|
:host([hidden]) { display: none; }
|
|
1575
1779
|
|
|
@@ -1651,7 +1855,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1651
1855
|
|
|
1652
1856
|
.glyph { display: grid; place-items: center; line-height: 1; }
|
|
1653
1857
|
.glyph svg { display: block; }
|
|
1654
|
-
`),
|
|
1858
|
+
`),ln=`square`,un=18;_(`slicc-dock-item`,class extends HTMLElement{static observedAttributes=[`item-id`,`kind`,`hue`,`icon`,`tip`,`active`,`lit`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[cn]}disconnectedCallback(){this.#t?.destroy(),this.#t=null}connectedCallback(){this.#n()}attributeChangedCallback(){this.isConnected&&this.#n()}get itemId(){return this.getAttribute(`item-id`)}set itemId(e){e==null?this.removeAttribute(`item-id`):this.setAttribute(`item-id`,e)}get kind(){return this.getAttribute(`kind`)===`sprinkle`?`sprinkle`:`tool`}set kind(e){this.setAttribute(`kind`,e===`sprinkle`?`sprinkle`:`tool`)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get icon(){return this.getAttribute(`icon`)??ln}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tip(){return this.getAttribute(`tip`)}set tip(e){e==null?this.removeAttribute(`tip`):this.setAttribute(`tip`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,!!e)}get lit(){return this.hasAttribute(`lit`)}set lit(e){this.toggleAttribute(`lit`,!!e)}#n(){let e=[`di`];this.kind===`sprinkle`&&e.push(`sp`),this.active&&e.push(`on`),this.lit&&e.push(`lit`);let t=this.tip,n=s(this.icon,{size:un,part:`icon`}),r=t??this.itemId??`dock item`,i=y(`button`,{type:`button`,part:`button`,class:e.join(` `),"aria-label":r,"aria-pressed":this.active?`true`:`false`},y(`span`,{class:`glyph`,part:`glyph`},y(`slot`,null,n)),t?y(`span`,{class:`tip`,part:`tip`},t):null),a=this.hue;a&&i.style.setProperty(`--h`,a),this.#t?.destroy(),this.#t=sn(i,{onShortClick:this.#r,onLongPress:()=>this.#i(`longpress`)}),this.#e.replaceChildren(i)}#r=()=>{this.#i(this.active?`collapse`:`select`)};#i(e){this.dispatchEvent(new CustomEvent(e,{detail:{id:this.itemId},bubbles:!0,composed:!0}))}});var dn=[{id:`browser`,icon:`globe`,label:`Browser · CDP`,kind:`tool`},{id:`files`,icon:`folder`,label:`Files · VFS`,kind:`tool`},{id:`term`,icon:`square-terminal`,label:`Terminal`,kind:`tool`},{id:`memory`,icon:`brain`,label:`Memory`,kind:`tool`}],fn={id:`new`,icon:`plus`,label:`New sprinkle`,kind:`sprinkle`},pn=`
|
|
1655
1859
|
.slicc-dock {
|
|
1656
1860
|
flex: 0 0 48px;
|
|
1657
1861
|
box-sizing: border-box;
|
|
@@ -1672,7 +1876,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1672
1876
|
margin: 2px 0;
|
|
1673
1877
|
}
|
|
1674
1878
|
.slicc-dock .grow { flex: 1; }
|
|
1675
|
-
`,
|
|
1879
|
+
`,mn=`slicc-dock-style`;function hn(e){if(e.getElementById(mn))return;let t=e.createElement(`style`);t.id=mn,t.textContent=pn,(e.head??e.documentElement).appendChild(t)}function gn(e){return e===`sprinkle`?`sprinkle`:`tool`}_(`slicc-dock`,class extends HTMLElement{static get observedAttributes(){return[`active`,`system-tools`]}#e=[];#t=null;#n=null;#r=null;#i=!1;connectedCallback(){hn(this.ownerDocument),this.classList.add(`slicc-dock`),this.setAttribute(`part`,`rail`),this.setAttribute(`role`,`toolbar`),this.setAttribute(`aria-orientation`,`vertical`),this.#i||=(this.#a(),!0),this.#t||(this.#t=e=>this.#u(e),this.#n=e=>this.#d(e),this.#r=e=>this.#f(e),this.addEventListener(`select`,this.#t),this.addEventListener(`collapse`,this.#n),this.addEventListener(`longpress`,this.#r)),this.#c()}disconnectedCallback(){this.#t&&=(this.removeEventListener(`select`,this.#t),null),this.#n&&=(this.removeEventListener(`collapse`,this.#n),null),this.#r&&=(this.removeEventListener(`longpress`,this.#r),null)}attributeChangedCallback(e){this.#i&&(e===`active`?this.#l():e===`system-tools`&&this.#c())}get items(){return this.#e.map(e=>({...e}))}set items(e){this.#e=Array.isArray(e)?e.map(e=>({...e})):[],this.#i&&this.isConnected&&this.#c()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get systemTools(){return this.hasAttribute(`system-tools`)}set systemTools(e){this.toggleAttribute(`system-tools`,!!e)}selectItem(e){this.active=e,this.dispatchEvent(new CustomEvent(`slicc-dock-select`,{detail:{id:e,kind:this.#o(e)},bubbles:!0,composed:!0}))}clearActive(){this.active=null}collapse(){let e=this.active;this.active=null,e!=null&&this.dispatchEvent(new CustomEvent(`slicc-dock-collapse`,{detail:{id:e},bubbles:!0,composed:!0}))}#a(){let e=[...this.querySelectorAll(`slicc-dock-item`)];if(e.length===0)return;let t=[];for(let n of e){let e=gn(n.getAttribute(`kind`)),r=n.getAttribute(`item-id`)??n.dataset.t??n.getAttribute(`tip`)??``;e===`tool`||r===`new`||r===``||t.push({id:r,icon:n.getAttribute(`icon`)??void 0,label:n.getAttribute(`tip`)??void 0,kind:`sprinkle`,hue:n.getAttribute(`hue`)??void 0})}for(let t of e)t.remove();this.#e.length===0&&(this.#e=t)}#o(e){return dn.some(t=>t.id===e)?`tool`:e===fn.id?`sprinkle`:this.#e.find(t=>t.id===e)?.kind??`tool`}#s(e,t){let n=e.id,r=gn(e.kind),i=e.icon??``,a=e.label??n,o=t!=null&&t===n,s=e.hue;return y(`slicc-dock-item`,{"data-t":n,"item-id":n,kind:r,icon:i||!1,tip:a,hue:s||!1,active:o})}#c(){let e=this.active,t=[];for(let n of this.#e)gn(n.kind)===`sprinkle`&&t.push(this.#s(n,e));if(t.push(this.#s(fn,e)),t.push(y(`div`,{class:`grow`})),this.systemTools){t.push(y(`div`,{class:`div`}));for(let n of dn)t.push(this.#s(n,e))}this.replaceChildren(),v(this,t)}#l(){let e=this.active;for(let t of this.querySelectorAll(`slicc-dock-item`))t.toggleAttribute(`active`,t.dataset.t===e)}#u(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.selectItem(t))}#d(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&(this.active=t),this.collapse())}#f(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&this.selectItem(t),this.dispatchEvent(new CustomEvent(`slicc-dock-longpress`,{detail:{id:t,kind:this.#o(t)},bubbles:!0,composed:!0})))}#p(e){let t=e.detail;if(t&&typeof t.id==`string`)return t.id;let n=e.target?.closest(`slicc-dock-item`);return n&&this.contains(n)?n.dataset.t??null:null}});var _n=b(`
|
|
1676
1880
|
:host { display: none; }
|
|
1677
1881
|
:host([open]) { display: block; }
|
|
1678
1882
|
.overlay {
|
|
@@ -1749,7 +1953,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1749
1953
|
color: rgba(255,255,255,.7); font-family: var(--ui); font-size: 14px;
|
|
1750
1954
|
}
|
|
1751
1955
|
@media (prefers-reduced-motion: reduce) { .overlay, .card { transition: none; } }
|
|
1752
|
-
`),
|
|
1956
|
+
`),vn=`Open tabs`;_(`slicc-tab-overlay`,class extends HTMLElement{static observedAttributes=[`open`,`heading`];#e;#t=[];#n=null;#r=null;#i=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#u(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[_n]}connectedCallback(){this.#s(),this.#c()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#i,!0)}attributeChangedCallback(e){this.isConnected&&(e===`open`?this.#c():this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get heading(){return this.getAttribute(`heading`)??vn}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tabs(){return this.#t.map(e=>({...e}))}set tabs(e){this.#t=Array.isArray(e)?e.map(e=>({...e})):[],this.isConnected&&this.#s()}show(){this.open||=!0}hide(){this.open&&this.#u(`api`)}#a(){let e=y(`button`,{class:`close`,part:`close`,type:`button`,"aria-label":`Close tabs overlay`},s(`x`,{size:18}));return e.addEventListener(`click`,()=>this.#u(`close-button`)),e}#o(e){let t=e.title??e.id,n=e.screenshot?y(`img`,{class:`shot`,part:`shot`,src:e.screenshot,alt:t,loading:`lazy`}):y(`div`,{class:`shot ph`,part:`shot`},s(`globe`,{size:28})),r=y(`button`,{class:`x`,part:`card-close`,type:`button`,"aria-label":`Close ${t}`},s(`x`,{size:14}));r.addEventListener(`click`,t=>{t.stopPropagation(),this.#l(`tab-close`,e.id)});let i=y(`div`,{class:`label`},y(`span`,{class:`name`,part:`title`},t),e.url?y(`span`,{class:`url`},e.url):null),a=y(`div`,{class:e.active?`card on`:`card`,part:`card`,role:`button`,tabindex:`0`,"data-tab-id":e.id,"aria-label":t,"aria-current":e.active?`true`:!1},n,y(`div`,{class:`meta`},i,r));return a.addEventListener(`click`,()=>this.#l(`tab-activate`,e.id)),a.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.#l(`tab-activate`,e.id))}),a}#s(){let e=y(`div`,{class:`bar`,part:`bar`},y(`span`,{class:`title`},this.heading),y(`span`,{class:`count`},String(this.#t.length)),y(`span`,{class:`grow`}),this.#a()),t;if(this.#t.length===0)t=y(`div`,{class:`empty`},`No open tabs.`);else{t=y(`div`,{class:`grid`,part:`grid`,role:`list`});for(let e of this.#t)t.appendChild(this.#o(e))}this.#n=y(`div`,{class:`overlay`,part:`overlay`},e,t),this.#n.addEventListener(`mousedown`,e=>{e.target===this.#n&&this.#u(`backdrop`)}),this.#e.replaceChildren(this.#n)}#c(){this.open?(this.#r=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#i,!0),requestAnimationFrame(()=>this.#n?.querySelector(`.close`)?.focus())):(document.removeEventListener(`keydown`,this.#i,!0),this.#r?.focus?.(),this.#r=null)}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:{id:t},bubbles:!0,composed:!0}))}#u(e){this.open=!1,this.dispatchEvent(new CustomEvent(`overlay-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}});var yn=`#3b6cb2`,bn=`
|
|
1753
1957
|
.slicc-freezer {
|
|
1754
1958
|
position: fixed;
|
|
1755
1959
|
left: 0;
|
|
@@ -1833,12 +2037,12 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1833
2037
|
|
|
1834
2038
|
/* ice-blue accent while a freezer context is active (prototype _ctxAccent) —
|
|
1835
2039
|
tints the toggle + the new-chat icon; cards keep their snow palette. */
|
|
1836
|
-
.slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${
|
|
2040
|
+
.slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${yn}); border-color: color-mix(in srgb, var(--fz-ctx, ${yn}) 40%, var(--line)); }
|
|
1837
2041
|
.slicc-freezer[ctx] ::part(new-icon),
|
|
1838
2042
|
.slicc-freezer[ctx] slicc-freezer-new::part(new-icon) {
|
|
1839
|
-
background: color-mix(in srgb, var(--fz-ctx, ${
|
|
1840
|
-
border-color: color-mix(in srgb, var(--fz-ctx, ${
|
|
1841
|
-
color: var(--fz-ctx, ${
|
|
2043
|
+
background: color-mix(in srgb, var(--fz-ctx, ${yn}) 14%, var(--canvas));
|
|
2044
|
+
border-color: color-mix(in srgb, var(--fz-ctx, ${yn}) 40%, var(--line));
|
|
2045
|
+
color: var(--fz-ctx, ${yn});
|
|
1842
2046
|
}
|
|
1843
2047
|
|
|
1844
2048
|
/* match-hidden: search filtered a session row out (only meaningful when open,
|
|
@@ -1846,7 +2050,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1846
2050
|
prototype .fzcard row. */
|
|
1847
2051
|
.slicc-freezer[open] slicc-freezer-card.match-hidden,
|
|
1848
2052
|
.slicc-freezer[open] .fzcard.match-hidden { display: none; }
|
|
1849
|
-
`,
|
|
2053
|
+
`,xn=`slicc-freezer-style`;function Sn(e){if(e.getElementById(xn))return;let t=e.createElement(`style`);t.id=xn,t.textContent=bn,(e.head??e.documentElement).appendChild(t)}var Cn=`http://www.w3.org/2000/svg`;function wn(){let e=document.createElementNS(Cn,`svg`);for(let[t,n]of[[`width`,`14`],[`height`,`14`],[`viewBox`,`0 0 16 16`],[`fill`,`none`],[`stroke`,`currentColor`],[`stroke-width`,`1.6`],[`stroke-linecap`,`round`],[`stroke-linejoin`,`round`],[`aria-hidden`,`true`]])e.setAttribute(t,n);let t=document.createElementNS(Cn,`rect`);for(let[e,n]of[[`x`,`2.5`],[`y`,`3.5`],[`width`,`11`],[`height`,`9`],[`rx`,`1.5`]])t.setAttribute(e,n);let n=document.createElementNS(Cn,`line`);for(let[e,t]of[[`x1`,`6`],[`y1`,`3.5`],[`x2`,`6`],[`y2`,`12.5`]])n.setAttribute(e,t);let r=document.createElementNS(Cn,`polyline`);return r.setAttribute(`points`,`9,6.5 10.5,8 9,9.5`),e.append(t,n,r),e}_(`slicc-freezer`,class extends HTMLElement{static observedAttributes=[`open`,`ctx`,`search-placeholder`];#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){Sn(this.ownerDocument),this.classList.add(`slicc-freezer`),this.setAttribute(`part`,`freezer`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Past sessions (freezer)`),this.#s(),this.#l(),this.#u()}disconnectedCallback(){this.#a&&this.#t&&(this.#t.removeEventListener(`click`,this.#a),this.#a=null),this.#o&&this.#n&&(this.#n.removeEventListener(`input`,this.#o),this.#o=null)}attributeChangedCallback(e,t,n){this.#i&&(e===`open`?(this.#l(),this.#u()):e===`search-placeholder`&&(this.#n.placeholder=n??`search past sessions`))}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get ctx(){return this.hasAttribute(`ctx`)}set ctx(e){this.toggleAttribute(`ctx`,e)}get searchPlaceholder(){return this.getAttribute(`search-placeholder`)??`search past sessions`}set searchPlaceholder(e){e==null?this.removeAttribute(`search-placeholder`):this.setAttribute(`search-placeholder`,e)}get query(){return this.#i?this.#n.value:``}set query(e){this.#s(),this.#n.value=e,this.#d()}get rail(){return this.#s(),this.#r}toggle(e){let t=e??!this.open;t===this.open&&this.#l(),this.open=t,this.#l(),this.#u(),this.dispatchEvent(new CustomEvent(`freezer-toggle`,{detail:{open:t},bubbles:!0,composed:!0}))}append(...e){this.#s(),this.#r.append(...e),this.#u()}#s(){if(this.#i)return;let e=this.querySelector(`:scope > .fzh`),t=this.querySelector(`:scope > .fzrail`);if(e instanceof HTMLElement&&t instanceof HTMLElement){this.#c(e,t);return}let n=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&(e.classList.contains(`fzh`)||e.classList.contains(`fzrail`)))),r=this.ownerDocument,i=r.createElement(`div`);i.className=`fzh`,i.setAttribute(`part`,`header`);let a=r.createElement(`button`);a.className=`fztgl`,a.type=`button`,a.setAttribute(`part`,`toggle`),a.setAttribute(`aria-label`,`Toggle freezer`),a.append(wn());let o=r.createElement(`input`);o.className=`fzsearch`,o.type=`text`,o.setAttribute(`part`,`search`),o.placeholder=this.searchPlaceholder,o.setAttribute(`aria-label`,`Search past sessions`),i.append(a,o);let s=r.createElement(`div`);s.className=`fzrail`,s.setAttribute(`part`,`rail`);for(let e of n)s.appendChild(e);this.replaceChildren(i,s),this.#c(i,s)}#c(e,t){this.#i=!0,this.#e=e,this.#r=t;let n=e.querySelector(`.fztgl`),r=e.querySelector(`.fzsearch`);n&&(this.#t=n),r&&(this.#n=r),this.#t&&!this.#a&&(this.#a=()=>this.toggle(),this.#t.addEventListener(`click`,this.#a)),this.#n&&!this.#o&&(this.#o=()=>this.#d(),this.#n.addEventListener(`input`,this.#o))}#l(){if(!this.#t)return;let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),this.#t.title=e?`Collapse freezer`:`Expand freezer`}#u(){if(!this.#i)return;let e=this.open,t=this.#r.querySelectorAll(`slicc-freezer-card, slicc-freezer-new`);for(let n of t)n.toggleAttribute(`expanded`,e)}#d(){let e=this.#n.value.trim().toLowerCase(),t=this.#r.querySelectorAll(`slicc-freezer-card, .fzcard`);for(let n of t){let t=(n.textContent??``).toLowerCase();n.classList.toggle(`match-hidden`,e.length>0&&!t.includes(e))}}});var Tn=14,En=b(`
|
|
1850
2054
|
:host {
|
|
1851
2055
|
display: inline-grid;
|
|
1852
2056
|
place-items: center;
|
|
@@ -1882,7 +2086,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
1882
2086
|
nothing is slotted */
|
|
1883
2087
|
::slotted(*), .ic { line-height: 1; }
|
|
1884
2088
|
.ic { display: block; }
|
|
1885
|
-
`);
|
|
2089
|
+
`);_(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[En];let e=y(`span`,{class:`snow`,part:`badge`},y(`slot`,null,s(`snowflake`,{size:Tn,part:`glyph`,class:`ic`})));this.#e.replaceChildren(e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}});var Dn=`
|
|
1886
2090
|
slicc-freezer-card {
|
|
1887
2091
|
position: relative;
|
|
1888
2092
|
display: flex;
|
|
@@ -1975,7 +2179,7 @@ slicc-freezer-card .slicc-fzcard__meta {
|
|
|
1975
2179
|
slicc-freezer-card[thawed] {
|
|
1976
2180
|
background: color-mix(in srgb, var(--rose) 12%, transparent);
|
|
1977
2181
|
}
|
|
1978
|
-
`,
|
|
2182
|
+
`,On=`slicc-freezer-card-style`;function kn(e){if(e.getElementById(On))return;let t=e.createElement(`style`);t.id=On,t.textContent=Dn,(e.head??e.documentElement).appendChild(t)}var An=1400,jn=14;_(`slicc-freezer-card`,class extends HTMLElement{static observedAttributes=[`title`,`meta`,`slug`,`icon`,`thawed`];#e;#t;#n;#r;#i=null;#a=null;#o=!1;#s=null;#c=()=>this.#u();#l=()=>{if(!this.#i)return;let e=this.getBoundingClientRect();this.#i.style.setProperty(`--tip-x`,`${e.right+8}px`),this.#i.style.setProperty(`--tip-y`,`${e.top+e.height/2}px`)};connectedCallback(){kn(this.ownerDocument),this.#d(),this.#f()}disconnectedCallback(){this.removeEventListener(`click`,this.#c),this.removeEventListener(`pointerenter`,this.#l),this.removeEventListener(`focusin`,this.#l),this.#s!=null&&(clearTimeout(this.#s),this.#s=null)}attributeChangedCallback(e,t,n){t===n||!this.#o||(e===`thawed`?this.#e.toggleAttribute(`thawed`,n!==null):e===`icon`?this.#p():this.#f())}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get meta(){return this.getAttribute(`meta`)??``}set meta(e){e==null?this.removeAttribute(`meta`):this.setAttribute(`meta`,e)}get slug(){return this.getAttribute(`slug`)??``}set slug(e){e==null?this.removeAttribute(`slug`):this.setAttribute(`slug`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){this.toggleAttribute(`hidden`,e)}get badge(){return this.#d(),this.#e}#u(){this.dispatchEvent(new CustomEvent(`freezer-card-select`,{bubbles:!0,composed:!0,detail:{slug:this.slug}})),this.flashThaw()}flashThaw(e=An){this.#s!=null&&clearTimeout(this.#s),this.thawed=!0,this.#s=setTimeout(()=>{this.thawed=!1,this.#s=null},e)}#d(){if(this.#o)return;this.#o=!0;let e=this.querySelector(`:scope > .slicc-fzcard__text`);if(e instanceof HTMLElement){this.#t=e,this.#n=e.querySelector(`.slicc-fzcard__title`),this.#r=e.querySelector(`.slicc-fzcard__meta`),this.#e=this.querySelector(`:scope > slicc-snowflake`),this.#i=this.querySelector(`:scope > .slicc-fzcard__tip`),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l);return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`slicc-snowflake`),this.#e.setAttribute(`part`,`badge`),this.#n=y(`div`,{class:`slicc-fzcard__title`,part:`title`}),this.#r=y(`div`,{class:`slicc-fzcard__meta`,part:`meta`}),this.#t=y(`div`,{class:`slicc-fzcard__text`,part:`text`},this.#n,this.#r);for(let e of t)this.#n.appendChild(e);this.#i=y(`span`,{class:`slicc-fzcard__tip`,part:`tip`,"aria-hidden":`true`}),this.replaceChildren(this.#e,this.#t,this.#i),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l)}#f(){if(!this.#o)return;let e=this.getAttribute(`title`);e!=null&&(this.#n.textContent=e),this.#r.textContent=this.meta,this.#i&&(this.#i.textContent=e??(this.#n.textContent||``)),this.#e.toggleAttribute(`thawed`,this.thawed),this.#p()}#p(){if(!this.#o)return;let e=this.getAttribute(`icon`);if(e){let t=s(e,{size:jn,class:`ic`,part:`icon`});this.#a?this.#a.replaceWith(t):this.#e.appendChild(t),this.#a=t}else this.#a&&=(this.#a.remove(),null)}});var Mn=`square-pen`,Nn=`loader-circle`,Pn=16,Fn=`New chat`,In=350,Ln=[[`save`,`archive`,`Save & start new`],[`skip`,`fast-forward`,`New chat — skip memory`],[`erase`,`trash-2`,`Erase & start new`]],Rn=b(`
|
|
1979
2183
|
:host { display: block; }
|
|
1980
2184
|
:host([hidden]) { display: none; }
|
|
1981
2185
|
*{ box-sizing: border-box; }
|
|
@@ -2120,19 +2324,19 @@ slicc-freezer-card[thawed] {
|
|
|
2120
2324
|
.fznew, .nlbl { transition: none; }
|
|
2121
2325
|
.fznew-spinner svg { animation: none; }
|
|
2122
2326
|
}
|
|
2123
|
-
`);
|
|
2327
|
+
`);_(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Rn]}connectedCallback(){this.#a()}disconnectedCallback(){this.#n?.destroy(),this.#n=null,this.#c()}attributeChangedCallback(e){e===`progress`&&this.#i()||this.isConnected&&this.#a()}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get label(){return this.getAttribute(`label`)??Fn}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,e)}get progress(){let e=this.getAttribute(`progress`);if(e==null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):null}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(Math.min(1,Math.max(0,e))))}#i(){let e=this.#e.querySelector(`.fznew-ring`);return!e||!this.busy||!this.hasAttribute(`progress`)?!1:(e.style.setProperty(`--fznew-progress`,String(this.progress??0)),!0)}#a(){let e=this.label,t=this.busy,n=t&&this.hasAttribute(`progress`),r=y(`span`,{class:`nico`,part:`badge`},t?y(`span`,{class:`fznew-spinner`,part:`spinner`},n?y(`span`,{class:`fznew-ring`,part:`ring`,style:`--fznew-progress:${this.progress??0}`}):null,s(Nn,{size:Pn,part:`icon`})):y(`slot`,{name:`icon`},s(Mn,{size:Pn,part:`icon`}))),i=y(`span`,{class:`nlbl`,part:`label`},y(`slot`,null,e)),a=y(`button`,{class:`fznew`,part:`button`,type:`button`,"aria-label":e,title:e,"aria-busy":t?`true`:void 0},r,i);this.#t=a,this.#s(a),this.#e.replaceChildren(a,this.#o())}#o(){let e=y(`div`,{class:`fznew-options`,part:`options`});for(let[t,n,r]of Ln){let i=y(`button`,{class:`fznew-opt fznew-opt--${t}`,part:`option-${t}`,type:`button`},s(n,{size:13}),y(`span`,{class:`fznew-opt__text`},r));i.addEventListener(`click`,()=>this.#l(t)),e.appendChild(i)}return e}#s(e){this.#n?.destroy(),this.#c(),this.#n=sn(e,{onLongPress:()=>{if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#l(`erase`)},onShortClick:()=>{if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#r=setTimeout(()=>{this.#r=null,this.#l(`save`)},In)}})}#c(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null)}#l(e){e===`save`&&(this.busy=!0),this.dispatchEvent(new CustomEvent(`new-chat-${e}`,{bubbles:!0,composed:!0}))}});var zn=`attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }`,Bn=`precision highp float;
|
|
2124
2328
|
uniform vec2 u_res; uniform float u_time; uniform float u_energy;
|
|
2125
2329
|
uniform vec2 u_center; uniform vec3 u_evt; uniform float u_freeze; uniform float u_dark;
|
|
2126
2330
|
uniform float u_density; uniform float u_falloff; uniform float u_life;
|
|
2127
2331
|
uniform float u_blink; uniform float u_thick; uniform vec3 u_tint; uniform float u_scroll;
|
|
2128
2332
|
uniform float u_brightness; uniform float u_contrast; uniform float u_noise; uniform float u_blur;
|
|
2129
|
-
vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,
|
|
2333
|
+
vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,Vn=`
|
|
2130
2334
|
float hash21(vec2 p){ p=fract(p*vec2(123.34,456.21)); p+=dot(p,p+45.32); return fract(p.x*p.y); }
|
|
2131
2335
|
float vnoise(vec2 p){ vec2 i=floor(p),f=fract(p);
|
|
2132
2336
|
float a=hash21(i),b=hash21(i+vec2(1.,0.)),c=hash21(i+vec2(0.,1.)),d=hash21(i+vec2(1.,1.));
|
|
2133
2337
|
vec2 u=f*f*(3.-2.*f); return mix(mix(a,b,u.x),mix(c,d,u.x),u.y); }
|
|
2134
2338
|
float fbm(vec2 p){ float v=0.,a=0.5; for(int i=0;i<5;i++){ v+=a*vnoise(p); p=p*2.02+vec2(7.1,3.7); a*=0.5;} return v; }
|
|
2135
|
-
vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,
|
|
2339
|
+
vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,Hn={cone:`${Bn}${Vn}
|
|
2136
2340
|
float cellCycle(vec2 q){ float s=hash21(q+11.7);
|
|
2137
2341
|
return 0.5+0.32*sin(u_time*u_blink+s*6.2831)+0.18*sin(u_time*0.6*u_blink+s*19.0); }
|
|
2138
2342
|
void main(){
|
|
@@ -2180,7 +2384,7 @@ void main(){
|
|
|
2180
2384
|
col*=u_brightness;
|
|
2181
2385
|
col=clamp(col,0.0,1.0);
|
|
2182
2386
|
gl_FragColor=vec4(col,1.0);
|
|
2183
|
-
}`,scoop:`${
|
|
2387
|
+
}`,scoop:`${Bn}${Vn}
|
|
2184
2388
|
vec3 pal(float t){ vec3 strawberry=vec3(1.0,0.45,0.62); vec3 vanilla=vec3(1.0,0.95,0.82);
|
|
2185
2389
|
vec3 pistachio=vec3(0.60,0.86,0.52);
|
|
2186
2390
|
vec3 col=mix(strawberry,vanilla,smoothstep(0.0,0.5,t)); col=mix(col,pistachio,smoothstep(0.5,1.0,t)); return col; }
|
|
@@ -2199,7 +2403,7 @@ void main(){
|
|
|
2199
2403
|
ice*=0.95+0.08*sin(u_time*0.4); float mask=smoothstep(0.62,0.0,r);
|
|
2200
2404
|
vec3 col=mix(bg,ice,clamp(mask,0.0,1.0)*0.80); col+=ice*mask*hl*0.12;
|
|
2201
2405
|
gl_FragColor=vec4(col,1.0);
|
|
2202
|
-
}`,freezer:`${
|
|
2406
|
+
}`,freezer:`${Bn}${Vn}
|
|
2203
2407
|
/* Inside-of-a-freezer ground: icy WHITE in light mode (never the warm theme
|
|
2204
2408
|
canvas — blue-on-beige read as sand, not frost), cold blue-black in dark. */
|
|
2205
2409
|
vec3 freezerBg(){ return mix(vec3(0.965,0.98,1.0), vec3(0.05,0.08,0.13), u_dark); }
|
|
@@ -2226,12 +2430,12 @@ void main(){
|
|
|
2226
2430
|
deviation budget the cone lattice uses (strokes at 0.20 toward tint). */
|
|
2227
2431
|
col=mix(freezerBg(),col,0.22);
|
|
2228
2432
|
gl_FragColor=vec4(col,1.0);
|
|
2229
|
-
}`},
|
|
2433
|
+
}`},Un=new Set([`cone`,`scoop`,`freezer`]),Wn={cone:`radial-gradient(120% 120% at 35% 45%, color-mix(in srgb,#e0a866 40%,var(--bg)) 0%, var(--bg) 60%)`,scoop:`radial-gradient(120% 120% at 40% 50%, color-mix(in srgb,#ff9bc0 40%,var(--bg)) 0%, var(--bg) 62%)`,freezer:`radial-gradient(120% 120% at 0% 100%, color-mix(in srgb,#7fb0e6 55%,var(--bg)) 0%, var(--bg) 70%)`},Gn=b(`
|
|
2230
2434
|
:host { position: relative; display: block; pointer-events: none; }
|
|
2231
2435
|
.canvas, .fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
|
2232
2436
|
.fallback { display: none; }
|
|
2233
2437
|
:host([no-webgl]) .canvas { display: none; }
|
|
2234
|
-
:host([no-webgl]) .fallback { display: block; }`),
|
|
2438
|
+
:host([no-webgl]) .fallback { display: block; }`),Kn=2,qn=.35,Jn=[`u_res`,`u_scroll`,`u_time`,`u_energy`,`u_center`,`u_evt`,`u_freeze`,`u_dark`,`u_density`,`u_falloff`,`u_life`,`u_blink`,`u_thick`,`u_tint`,`u_brightness`,`u_contrast`,`u_noise`,`u_blur`];function Yn(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function Xn(e,t){if(!e||typeof getComputedStyle!=`function`)return t;let n=document.createElement(`span`);n.style.color=e,n.style.display=`none`,document.body.appendChild(n);let r=getComputedStyle(n).color;n.remove();let i=r.match(/[\d.]+/g)?.map(Number);return!i||i.length<3?t:[i[0]/255,i[1]/255,i[2]/255]}var Zn=class extends HTMLElement{static observedAttributes=[`mode`,`tint`,`coverage`,`intensity`,`scroll`,`brightness`,`contrast`,`noise`,`blur`];#e;#t=null;#n=null;#r=null;#i=null;#a={};#o=-1;#s=0;#c=0;#l=0;#u=null;#d=!1;#f=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Gn];let e=y(`canvas`,{class:`canvas`,part:`canvas`}),t=y(`div`,{class:`fallback`,part:`fallback`,"aria-hidden":`true`});this.#e.replaceChildren(e,t),this.#t=e}connectedCallback(){if(this.#d=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#p(),!this.#_()){this.setAttribute(`no-webgl`,``);return}this.removeAttribute(`no-webgl`),typeof ResizeObserver<`u`&&(this.#u=new ResizeObserver(()=>this.#m()),this.#u.observe(this)),this.#c=performance.now()/1e3,this.#d?this.#b():this.#x()}disconnectedCallback(){this.#S(),this.#u?.disconnect(),this.#u=null,this.#C()}attributeChangedCallback(e){this.isConnected&&(e===`mode`&&this.#n&&this.mode!==this.#f&&this.#g(),this.#p(),this.#m())}get mode(){let e=this.getAttribute(`mode`);return e&&Un.has(e)?e:`cone`}set mode(e){this.setAttribute(`mode`,e)}get coverage(){return Yn(Number.parseFloat(this.getAttribute(`coverage`)??``),0,1,.66)}set coverage(e){this.setAttribute(`coverage`,String(e))}get intensity(){return Yn(Number.parseFloat(this.getAttribute(`intensity`)??``),0,4,1)}set intensity(e){this.setAttribute(`intensity`,String(e))}get scrollOffset(){let e=Number.parseFloat(this.getAttribute(`scroll`)??``);return Number.isFinite(e)?e:0}set scrollOffset(e){this.setAttribute(`scroll`,String(e))}get brightness(){return Yn(Number.parseFloat(this.getAttribute(`brightness`)??``),.5,1.5,1.2)}set brightness(e){this.setAttribute(`brightness`,String(e))}get contrast(){return Yn(Number.parseFloat(this.getAttribute(`contrast`)??``),.5,2,.75)}set contrast(e){this.setAttribute(`contrast`,String(e))}get noise(){return Yn(Number.parseFloat(this.getAttribute(`noise`)??``),0,.3,.04)}set noise(e){this.setAttribute(`noise`,String(e))}get blurAmount(){return Yn(Number.parseFloat(this.getAttribute(`blur`)??``),0,1,.09)}set blurAmount(e){this.setAttribute(`blur`,String(e))}get noWebgl(){return this.hasAttribute(`no-webgl`)}pulse(e=1){this.#l=Math.min(1.4,this.#l+e),this.#d&&this.#b()}#p(){let e=this.#e.querySelector(`.fallback`);e&&(e.style.background=Wn[this.mode])}#m(){this.#d&&this.#n&&this.#b()}#h(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(e.deleteShader(r),null)):null}#g(){let e=this.#n;if(!e)return!1;let t=this.#h(e,e.VERTEX_SHADER,zn),n=this.#h(e,e.FRAGMENT_SHADER,Hn[this.mode]);if(!t||!n)return!1;let r=e.createProgram();if(!r||(e.attachShader(r,t),e.attachShader(r,n),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS)))return!1;this.#r&&e.deleteProgram(this.#r),this.#r=r,e.useProgram(r),this.#o=e.getAttribLocation(r,`a_pos`),this.#a={};for(let t of Jn)this.#a[t]=e.getUniformLocation(r,t);return this.#f=this.mode,!0}#_(){let e=this.#t;if(!e)return!1;let t={premultipliedAlpha:!0,alpha:!0,antialias:!0},n=null;try{n=e.getContext(`webgl`,t)??e.getContext(`experimental-webgl`,t)}catch{n=null}if(!n)return!1;if(this.#n=n,!this.#g())return this.#n=null,!1;let r=n.createBuffer();return r?(this.#i=r,n.bindBuffer(n.ARRAY_BUFFER,r),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),n.STATIC_DRAW),!0):(this.#n=null,!1)}#v(){let e=this.#t;if(!e)return;let t=Math.min(Kn,typeof window<`u`&&window.devicePixelRatio||1),n=Math.max(1,e.clientWidth*t|0),r=Math.max(1,e.clientHeight*t|0);(e.width!==n||e.height!==r)&&(e.width=n,e.height=r)}#y(){if(typeof getComputedStyle!=`function`)return 0;let e=getComputedStyle(this).getPropertyValue(`--ink`).trim();if(!e)return 0;let[t,n,r]=Xn(e,[0,0,0]);return+(.2126*t+.7152*n+.0722*r>.5)}#b(){let e=this.#n,t=this.#t,n=this.#r;if(!e||!t||!n||!this.#i)return;this.#v();let r=performance.now()/1e3-this.#c,i=.5+.5*Math.sin(r*.12),a=.5+.5*Math.sin(r*.097+1),o=.2*(1-i)+.46*i,s=.74*(1-a)+.3*a,c=this.#y(),l=Xn(this.getAttribute(`tint`)??``,[.545,.361,.965]),u=Xn(this.getAttribute(`tint`)??``,[.957,.247,.369]);e.viewport(0,0,t.width,t.height),e.useProgram(n),e.bindBuffer(e.ARRAY_BUFFER,this.#i),e.enableVertexAttribArray(this.#o),e.vertexAttribPointer(this.#o,2,e.FLOAT,!1,0,0);let d=this.#a;e.uniform2f(d.u_res??null,t.width,t.height),e.uniform1f(d.u_time??null,r),e.uniform1f(d.u_energy??null,this.#l),e.uniform2f(d.u_center??null,o,s),e.uniform3f(d.u_evt??null,u[0],u[1],u[2]),e.uniform1f(d.u_freeze??null,Yn(this.coverage*this.intensity,0,1,.66)*2.2),e.uniform1f(d.u_dark??null,c),e.uniform1f(d.u_scroll??null,this.scrollOffset*qn/Math.max(1,t.clientHeight||t.height)),e.uniform1f(d.u_density??null,.29),e.uniform1f(d.u_falloff??null,.3),e.uniform1f(d.u_life??null,.35),e.uniform1f(d.u_blink??null,.05),e.uniform1f(d.u_thick??null,.02),e.uniform3f(d.u_tint??null,l[0],l[1],l[2]),e.uniform1f(d.u_brightness??null,this.brightness),e.uniform1f(d.u_contrast??null,this.contrast),e.uniform1f(d.u_noise??null,this.noise),e.uniform1f(d.u_blur??null,this.blurAmount),e.drawArrays(e.TRIANGLES,0,3),this.#l*=.95,this.#l<.001&&(this.#l=0)}#x(){if(this.#s)return;let e=()=>{this.#b(),this.#s=requestAnimationFrame(e)};this.#s=requestAnimationFrame(e)}#S(){this.#s&&cancelAnimationFrame(this.#s),this.#s=0}#C(){let e=this.#n;e&&(this.#i&&e.deleteBuffer(this.#i),this.#r&&e.deleteProgram(this.#r),e.getExtension(`WEBGL_lose_context`)?.loseContext()),this.#n=null,this.#r=null,this.#i=null,this.#f=null}};_(`slicc-shader`,Zn),_(`slicc-frost-shader`,class extends Zn{connectedCallback(){this.getAttribute(`mode`)!==`freezer`&&this.setAttribute(`mode`,`freezer`),super.connectedCallback()}});var Qn=new Set([`user`,`feedback`,`project`]),$n={user:{hue:`--rose`,label:`user`},feedback:{hue:`--cyan`,label:`feedback`},project:{hue:`--violet`,label:`project`}};function er(e){return e===`feedback`||e===`project`?e:`user`}var tr=b(`
|
|
2235
2439
|
:host {
|
|
2236
2440
|
display: inline-flex;
|
|
2237
2441
|
vertical-align: middle;
|
|
@@ -2253,13 +2457,13 @@ void main(){
|
|
|
2253
2457
|
background: color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-fill), var(--canvas));
|
|
2254
2458
|
border: 1px solid color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-border), var(--line));
|
|
2255
2459
|
}
|
|
2256
|
-
`),
|
|
2460
|
+
`),nr=`slicc-memtag-dark`,rr=`
|
|
2257
2461
|
.dark slicc-memtag,
|
|
2258
2462
|
[data-theme="dark"] slicc-memtag {
|
|
2259
2463
|
--mtag-fill: 22%;
|
|
2260
2464
|
--mtag-border: 38%;
|
|
2261
2465
|
}
|
|
2262
|
-
`;function
|
|
2466
|
+
`;function ir(e){if(e.getElementById(nr))return;let t=e.createElement(`style`);t.id=nr,t.textContent=rr,(e.head??e.documentElement).appendChild(t)}_(`slicc-memtag`,class extends HTMLElement{static observedAttributes=[`type`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[tr]}connectedCallback(){ir(this.ownerDocument),this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get type(){return er(this.getAttribute(`type`))}set type(e){this.setAttribute(`type`,Qn.has(e)?e:`user`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let{hue:e,label:t}=$n[this.type],n=this.label??y(`slot`,null,t),r=y(`span`,{class:`mtag`,part:`tag`,style:`--mtag-hue:var(${e})`},n);this.#e.replaceChildren(r)}});var ar=`
|
|
2263
2467
|
slicc-memrow {
|
|
2264
2468
|
display: block;
|
|
2265
2469
|
border: 1px solid var(--line);
|
|
@@ -2333,7 +2537,7 @@ slicc-memrow.fresh {
|
|
|
2333
2537
|
background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
|
|
2334
2538
|
border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
|
|
2335
2539
|
}
|
|
2336
|
-
`,
|
|
2540
|
+
`,or=`slicc-memrow-style`;function sr(e){if(e.getElementById(or))return;let t=e.createElement(`style`);t.id=or,t.textContent=ar,(e.head??e.documentElement).appendChild(t)}function cr(e){return e===`feedback`||e===`project`?e:`user`}_(`slicc-memrow`,class extends HTMLElement{static get observedAttributes(){return[`title`,`summary`,`tag`,`fresh`]}#e=!1;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;connectedCallback(){sr(this.ownerDocument),this.#e||this.#s(),this.#c(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#c()}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get summary(){return this.getAttribute(`summary`)??``}set summary(e){e==null?this.removeAttribute(`summary`):this.setAttribute(`summary`,e)}get tag(){return cr(this.getAttribute(`tag`))}set tag(e){this.setAttribute(`tag`,e)}get fresh(){return this.hasAttribute(`fresh`)}set fresh(e){this.toggleAttribute(`fresh`,e)}#s(){this.#e=!0;let e=this.ownerDocument.createElement(`div`);e.className=`mt`;let t=this.ownerDocument.createElement(`b`),n=this.ownerDocument.createElement(`slicc-memtag`);e.append(t,n);let r=this.ownerDocument.createElement(`div`);for(r.className=`ms`;this.firstChild;)r.appendChild(this.firstChild);this.append(e,r),this.#t=e,this.#n=t,this.#r=n,this.#i=r}#c(){let e=this.#n,t=this.#r,n=this.#i;if(!e||!t||!n)return;e.textContent=this.title;let r=this.tag;t.className=``,t.setAttribute(`type`,r),t.textContent=``;let i=n.firstChild,a=this.summary;i&&i.nodeType===Node.TEXT_NODE?i.textContent=a:a&&n.insertBefore(this.ownerDocument.createTextNode(a),i),this.classList.toggle(`fresh`,this.fresh)}#l(){this.#a||(this.#a=e=>this.#d(e),this.addEventListener(`click`,this.#a)),this.#o||(this.#o=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#d(e))},this.addEventListener(`keydown`,this.#o))}#u(){this.#a&&=(this.removeEventListener(`click`,this.#a),null),this.#o&&=(this.removeEventListener(`keydown`,this.#o),null)}#d(e){this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{title:this.title,summary:this.summary,tag:this.tag,sourceEvent:e}}))}});var lr=`
|
|
2337
2541
|
slicc-palette-grid {
|
|
2338
2542
|
display: block;
|
|
2339
2543
|
flex: 1;
|
|
@@ -2352,7 +2556,7 @@ slicc-palette-grid .palgrid {
|
|
|
2352
2556
|
grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
|
|
2353
2557
|
gap: 10px;
|
|
2354
2558
|
}
|
|
2355
|
-
`,
|
|
2559
|
+
`,ur=`slicc-palette-grid-style`;function dr(e){if(e.getElementById(ur))return;let t=e.createElement(`style`);t.id=ur,t.textContent=lr,(e.head??e.documentElement).appendChild(t)}var fr=[{label:`canvas #faf6f1`,color:`#faf6f1`},{label:`cone #ef7000`,color:`#ef7000`},{label:`scoop #8b5cf6`,color:`#8b5cf6`},{label:`scoop #06b6d4`,color:`#06b6d4`},{label:`scoop #f43f5e`,color:`#f43f5e`},{label:`ink #0a0a0a`,color:`#0a0a0a`}],pr=`brand palette · tokens`;_(`slicc-palette-grid`,class extends HTMLElement{static get observedAttributes(){return[`heading`]}#e=!1;#t=null;#n=null;#r=[];#i=null;#a=null;connectedCallback(){dr(this.ownerDocument),this.#e||this.#o(),this.#s(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#s()}get heading(){return this.getAttribute(`heading`)??pr}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tokens(){return(this.#i??fr).map(e=>({...e}))}set tokens(e){this.#i=Array.isArray(e)?e.map(e=>({label:String(e.label??``),color:String(e.color??``)})):null,this.#e&&this.#c()}#o(){for(this.#e=!0,this.#r=[];this.firstChild;)this.#r.push(this.firstChild),this.removeChild(this.firstChild);let e=this.ownerDocument.createElement(`h4`),t=this.ownerDocument.createElement(`div`);t.className=`palgrid`,this.append(e,t),this.#t=e,this.#n=t,this.#c()}#s(){this.#t&&(this.#t.textContent=this.heading)}#c(){let e=this.#n;if(e){e.replaceChildren();for(let t of this.#r)e.appendChild(t);for(let t of this.tokens){let n=this.ownerDocument.createElement(`slicc-palette-cell`);n.setAttribute(`color`,t.color),n.setAttribute(`label`,t.label),e.appendChild(n)}}}#l(){this.#a||(this.#a=e=>{let t=e.detail??{};this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{label:t.label??``,color:t.color??``,sourceEvent:e}}))},this.addEventListener(`palette-select`,this.#a))}#u(){this.#a&&=(this.removeEventListener(`palette-select`,this.#a),null)}});var mr=b(`
|
|
2356
2560
|
:host { display: inline-block; position: relative; font-family: var(--ui); }
|
|
2357
2561
|
.trigger {
|
|
2358
2562
|
display: inline-flex; align-items: center; justify-content: center;
|
|
@@ -2393,7 +2597,7 @@ slicc-palette-grid .palgrid {
|
|
|
2393
2597
|
.item .ic { flex: 0 0 auto; display: flex; color: var(--txt-2, #505050); }
|
|
2394
2598
|
.item.danger .ic { color: var(--rose, #f43f5e); }
|
|
2395
2599
|
@media (prefers-reduced-motion: reduce) { .pop { transition: none; } }
|
|
2396
|
-
`);
|
|
2600
|
+
`);_(`slicc-avatar-menu`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t;#n;#r=[];#i=null;#a=e=>{this.open&&!e.composedPath().includes(this)&&this.hide()};#o=e=>{e.key===`Escape`&&this.open&&(this.hide(),this.#t.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[mr],this.#t=y(`button`,{class:`trigger`,part:`trigger`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":`false`},y(`slot`)),this.#n=y(`div`,{class:`pop`,part:`popover`,role:`menu`}),this.#e.replaceChildren(this.#t,this.#n),this.#t.addEventListener(`click`,()=>this.toggle())}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o)}attributeChangedCallback(e){if(e===`open`){let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),e?(document.addEventListener(`mousedown`,this.#a),document.addEventListener(`keydown`,this.#o)):(document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o))}}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get user(){return this.#i}set user(e){this.#i=e,this.#c()}get items(){return this.#r.map(e=>({...e}))}set items(e){this.#r=Array.isArray(e)?e.map(e=>({...e})):[],this.#c()}show(){this.open||(this.open=!0,this.#s())}hide(){this.open&&(this.open=!1,this.#s())}toggle(){this.open?this.hide():this.show()}#s(){this.dispatchEvent(new CustomEvent(`slicc-avatar-menu-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0}))}#c(){let e=[];if(this.#i){let t=y(`div`,{class:`user`},y(`div`,{class:`name`},this.#i.name));this.#i.provider&&t.append(y(`div`,{class:`prov`},this.#i.provider)),e.push(t)}for(let t of this.#r)if(t.kind===`separator`)e.push(y(`div`,{class:`sep`,role:`separator`}));else if(t.kind===`caption`)e.push(y(`div`,{class:`cap`},t.label??``));else{let n=y(`button`,{class:`item${t.danger?` danger`:``}`,part:`item`,type:`button`,role:`menuitem`,"data-id":t.id??``,disabled:t.disabled?!0:void 0});t.icon&&n.append(y(`span`,{class:`ic`},s(t.icon,{size:16}))),n.append(y(`span`,{class:`lb`},t.label??``)),t.disabled||n.addEventListener(`click`,()=>this.#l(t.id??``)),e.push(n)}this.#n.replaceChildren(...e)}#l(e){this.dispatchEvent(new CustomEvent(`slicc-avatar-action`,{detail:{id:e},bubbles:!0,composed:!0})),this.hide()}});var hr=`
|
|
2397
2601
|
.slicc-nav {
|
|
2398
2602
|
display: flex;
|
|
2399
2603
|
align-items: center;
|
|
@@ -2420,7 +2624,7 @@ slicc-palette-grid .palgrid {
|
|
|
2420
2624
|
@media (max-width: 560px) {
|
|
2421
2625
|
.slicc-nav { gap: 8px; padding: 0 10px; }
|
|
2422
2626
|
}
|
|
2423
|
-
`,
|
|
2627
|
+
`,gr=`slicc-nav-style`;function _r(e){if(e.getElementById(gr))return;let t=e.createElement(`style`);t.id=gr,t.textContent=hr,(e.head??e.documentElement).appendChild(t)}_(`slicc-nav`,class extends HTMLElement{static observedAttributes=[`accent`];#e=!1;connectedCallback(){_r(this.ownerDocument),this.classList.add(`slicc-nav`),this.setAttribute(`part`,`bar`),this.#t(),this.#n(this.getAttribute(`accent`))}attributeChangedCallback(e,t,n){e!==`accent`||t===n||this.isConnected&&(this.#n(n),this.dispatchEvent(new CustomEvent(`slicc-nav-accent-change`,{detail:{accent:n},bubbles:!0,composed:!0})))}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get spacer(){return this.#t(),this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)}#t(){if(this.#e||(this.#e=!0,this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)))return;let e=this.ownerDocument.createElement(`div`);e.className=`slicc-nav__spacer`,e.setAttribute(`part`,`spacer`),e.setAttribute(`aria-hidden`,`true`);let t=this.querySelector(`:scope > slicc-floatbar, :scope > slicc-theme-toggle, :scope > slicc-avatar`);t?this.insertBefore(e,t):this.appendChild(e)}#n(e){e==null||e.trim()===``?this.style.removeProperty(`--ctx`):this.style.setProperty(`--ctx`,e)}});var vr=b(`
|
|
2424
2628
|
:host { display: none; }
|
|
2425
2629
|
:host([open]) { display: block; }
|
|
2426
2630
|
.overlay {
|
|
@@ -2465,7 +2669,7 @@ slicc-palette-grid .palgrid {
|
|
|
2465
2669
|
@media (prefers-reduced-motion: reduce) {
|
|
2466
2670
|
.overlay, .dialog { transition: none; }
|
|
2467
2671
|
}
|
|
2468
|
-
`);
|
|
2672
|
+
`);_(`slicc-dialog`,class extends HTMLElement{static observedAttributes=[`open`,`heading`,`description`,`no-close-button`];#e;#t;#n;#r;#i;#a;#o=null;#s=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#c(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[vr],this.#r=y(`div`,{class:`title`,part:`title`,id:`slicc-dialog-title`}),this.#i=y(`div`,{class:`desc`,part:`description`}),this.#a=y(`button`,{class:`x`,part:`close`,type:`button`,"aria-label":`Close`},s(`x`,{size:18}));let e=y(`div`,{class:`body`},y(`slot`)),t=y(`div`,{class:`footer`},y(`slot`,{name:`footer`}));this.#n=y(`div`,{class:`dialog`,part:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`slicc-dialog-title`,tabindex:`-1`},this.#a,this.#r,this.#i,e,t),this.#t=y(`div`,{class:`overlay`,part:`overlay`},this.#n),this.#e.replaceChildren(this.#t),this.#a.addEventListener(`click`,()=>this.#c(`close-button`)),this.#t.addEventListener(`mousedown`,e=>{e.target===this.#t&&!this.persistent&&this.#c(`backdrop`)})}connectedCallback(){this.#u()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#s,!0)}attributeChangedCallback(e){e===`open`?this.#u():this.#l()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get heading(){return this.getAttribute(`heading`)}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get description(){return this.getAttribute(`description`)}set description(e){e==null?this.removeAttribute(`description`):this.setAttribute(`description`,e)}get persistent(){return this.hasAttribute(`persistent`)}set persistent(e){this.toggleAttribute(`persistent`,e)}show(){this.open||=!0}hide(){this.open&&this.#c(`api`)}#c(e){this.open=!1,this.dispatchEvent(new CustomEvent(`slicc-dialog-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}#l(){this.#r.textContent=this.heading??``,this.#r.style.display=this.heading?``:`none`,this.#i.textContent=this.description??``,this.#i.style.display=this.description?``:`none`,this.#a.style.display=this.hasAttribute(`no-close-button`)?`none`:``}#u(){this.#l(),this.open?(this.#o=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#s,!0),requestAnimationFrame(()=>this.#n.focus())):(document.removeEventListener(`keydown`,this.#s,!0),this.#o?.focus?.(),this.#o=null)}});var yr=`
|
|
2469
2673
|
slicc-camera-dialog slicc-dialog::part(dialog) {
|
|
2470
2674
|
width: min(560px, 92vw);
|
|
2471
2675
|
}
|
|
@@ -2532,7 +2736,7 @@ slicc-camera-dialog .slicc-camera__btn--snap {
|
|
|
2532
2736
|
slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
2533
2737
|
background: color-mix(in srgb, var(--ink) 85%, var(--canvas));
|
|
2534
2738
|
}
|
|
2535
|
-
`,
|
|
2739
|
+
`,br=`slicc-camera-dialog-style`;function xr(e){if(e.getElementById(br))return;let t=e.createElement(`style`);t.id=br,t.textContent=yr,(e.head??e.documentElement).appendChild(t)}var Sr=`Take a photo`;_(`slicc-camera-dialog`,class extends HTMLElement{static observedAttributes=[`heading`,`preferred-device`];media=null;#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){xr(this.ownerDocument),this.#h()}disconnectedCallback(){this.#m()}attributeChangedCallback(e){e===`heading`&&this.#i&&this.#e.setAttribute(`heading`,this.heading)}get heading(){return this.getAttribute(`heading`)??Sr}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}#s(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async open(){this.#h();let e=this.#s();if(!e)return null;try{this.#a=await this.#c(e,this.preferredDevice)}catch{return null}return this.#l(this.#a),await this.#u(e),this.#e.setAttribute(`heading`,this.heading),this.#e.show?.(),new Promise(e=>{this.#o=e})}async#c(e,t){if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}}})}catch{}return e.getUserMedia({video:!0})}#l(e){this.#t.srcObject=e,this.#t.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#t.toggleAttribute(`data-mirrored`,t!==`environment`)}async#u(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}this.#n.replaceChildren(...t.map((e,t)=>y(`option`,{value:e.deviceId},e.label||`Camera ${t+1}`)));let n=this.#a?.getVideoTracks()[0]?.getSettings?.().deviceId;n&&(this.#n.value=n),this.#n.toggleAttribute(`hidden`,t.length<2)}async#d(e){let t=this.#s();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#m(),this.#a=n,this.#l(n),this.dispatchEvent(new CustomEvent(`slicc-camera-device-change`,{detail:{deviceId:e},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}#f(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#t.videoWidth,e.height=this.#t.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#t,0,0);let t=e.toDataURL(`image/png`);this.dispatchEvent(new CustomEvent(`slicc-camera-capture`,{detail:{dataUrl:t},bubbles:!0,composed:!0})),this.#p(t)}#p(e){this.#m();let t=this.#o;this.#o=null,this.#e.hide?.(),t?.(e)}#m(){for(let e of this.#a?.getTracks()??[])e.stop();this.#a=null,this.#t&&(this.#t.srcObject=null)}#h(){if(this.#i)return;this.#i=!0,this.#t=y(`video`,{class:`slicc-camera__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#n=y(`select`,{class:`slicc-camera__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#d(this.#n.value)}),this.#r=y(`div`,{class:`slicc-camera__status`});let e=y(`button`,{type:`button`,class:`slicc-camera__btn`,part:`cancel`,slot:`footer`},`Cancel`);e.addEventListener(`click`,()=>this.#p(null));let t=y(`button`,{type:`button`,class:`slicc-camera__btn slicc-camera__btn--snap`,part:`snap`,slot:`footer`},s(`camera`,{size:14}),` Snap`);t.addEventListener(`click`,()=>this.#f());let n=y(`div`,{class:`slicc-camera__body`},this.#t,this.#n,this.#r);this.#e=this.ownerDocument.createElement(`slicc-dialog`),this.#e.setAttribute(`heading`,this.heading),this.#e.append(n,e,t),this.#e.addEventListener(`slicc-dialog-close`,()=>{this.#o&&this.#p(null)}),this.append(this.#e)}});var Cr=new Set([`top`,`bottom`,`left`,`right`]),wr=b(`
|
|
2536
2740
|
:host { position: relative; display: inline-flex; }
|
|
2537
2741
|
:host([hidden]) { display: none; }
|
|
2538
2742
|
.tip {
|
|
@@ -2557,7 +2761,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2557
2761
|
:host(:hover) .tip[data-p="right"], :host(:focus-within) .tip[data-p="right"], :host([open]) .tip[data-p="right"] { transform: translate(0, -50%); }
|
|
2558
2762
|
.tip:empty { display: none; }
|
|
2559
2763
|
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
2560
|
-
`);
|
|
2764
|
+
`);_(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[wr],this.#t=y(`span`,{class:`tip`,part:`tip`,role:`tooltip`,"aria-hidden":`true`}),this.#e.replaceChildren(y(`slot`),this.#t)}connectedCallback(){this.#n()}attributeChangedCallback(){this.#n()}get label(){return this.getAttribute(`label`)??``}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get placement(){let e=this.getAttribute(`placement`);return e&&Cr.has(e)?e:`top`}set placement(e){this.setAttribute(`placement`,e)}#n(){this.#t.textContent=this.label,this.#t.setAttribute(`data-p`,this.placement)}});var Tr=18,Er=16,Dr=50,Or=85,kr=2.2,Ar={cx:55,cy:50,r:38},jr={cx:145,cy:50,r:38},Mr=`http://www.w3.org/2000/svg`;function P(e,t,...n){let r=document.createElementNS(Mr,e);if(t)for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));for(let e of n)r.appendChild(e);return r}var Nr={cone:{vb:`70 330 440 570`,eyes:{top:-18.5,left:17,width:70,height:44},zoom:3,glyph:96},scoop:{vb:`0 0 580 470`,eyes:{top:30,left:15,width:70,height:45},zoom:2.65,glyph:96}},Pr={cone:`#D2691E`,scoop:`#FFB6C1`};function Fr(e){return e<=Dr?1:e>=Or?kr:1+(e-Dr)/(Or-Dr)*(kr-1)}function Ir(e){let t=e.replace(`#`,``);t.length===3&&(t=t.split(``).map(e=>e+e).join(``));let n=Number.parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function Lr(e,t,n){return`#${[e,t,n].map(e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`)).join(``)}`}function Rr(e,t){let{r:n,g:r,b:i}=Ir(e),a=t<0?0:255,o=Math.abs(t);return Lr(n+(a-n)*o,r+(a-r)*o,i+(a-i)*o)}function zr(e,t,n){return[P(`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}),P(`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}),P(`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}),P(`rect`,{x:274.59,y:463.59,width:84.73,height:95.66,rx:42.36,ry:42.36,transform:`translate(-268.79 373.91) rotate(-45)`,fill:n}),P(`rect`,{x:291.06,y:603.84,width:72.24,height:90.24,rx:36.12,ry:36.12,transform:`translate(-363.06 421.43) rotate(-45)`,fill:n}),P(`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}),P(`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}),P(`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}),P(`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}),P(`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}),P(`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}),P(`rect`,{x:217.18,y:527.25,width:72.24,height:95.66,rx:36.12,ry:36.12,transform:`translate(-332.45 347.55) rotate(-45)`,fill:n}),P(`path`,{d:`M350.28,739.46h0c-9.24-9.24-24.22-9.24-33.46,0l-13.94,13.94c-9.24,9.24-9.24,24.22,0,33.46l6.81,6.81c12.37,12.37,33.42,7.5,39.1-9.04l7.13-20.75c2.94-8.55.75-18.03-5.64-24.42Z`,fill:n}),P(`path`,{d:`M234.18,749.12l13.2,33.06c1.52,3.82,6.46,4.83,9.37,1.93l9.93-9.93c2.24-2.24,2.24-5.86,0-8.1l-23.13-23.13c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}),P(`rect`,{x:236.26,y:661.25,width:67.04,height:90.24,rx:33.52,ry:33.52,transform:`translate(-420.46 397.65) rotate(-45)`,fill:n}),P(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})]}function Br(e,t){return[P(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,35.15,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function Vr(e,t,n,r,i){return[P(`g`,{class:`eye-blink eye-${r}`},P(`circle`,{cx:e,cy:t,r:n,fill:`#fff`,stroke:`#000`,"stroke-width":4}),P(`g`,{class:`pupil pupil-${r}`},P(`circle`,{cx:e,cy:t,r:i,fill:`#000`}),P(`circle`,{cx:e-i*.3,cy:t-i*.35,r:i*.4,fill:`#fff`})))]}function Hr(e,t,n){return[P(`circle`,{cx:e,cy:t,r:n,fill:`#fff`,stroke:`#000`,"stroke-width":4}),P(`line`,{x1:e-15,y1:t-15,x2:e+15,y2:t+15,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),P(`line`,{x1:e+15,y1:t-15,x2:e-15,y2:t+15,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function Ur(e,t){if(e===`none`)return null;let n=Ar,r=jr;return P(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...e===`dead`?[...Hr(n.cx,n.cy,n.r),...Hr(r.cx,r.cy,r.r)]:[...Vr(n.cx,n.cy,n.r,`l`,t),...Vr(r.cx,r.cy,r.r,`r`,t)])}function Wr(e,t,n,r,i,a){let o=r-t,s=i-n,c=Math.hypot(o,s),l=Math.min(c,a),u=c>0?o/c*l:0,d=c>0?s/c*l:0;e.setAttribute(`transform`,`translate(${u},${d})`)}var Gr=b(`
|
|
2561
2765
|
:host{position:relative;display:inline-block;--pill-w:190px;--label:#eef1f6;--icon-tint:color-mix(in oklab,var(--accent) 22%,transparent);}
|
|
2562
2766
|
@media (prefers-color-scheme: light){:host(:not([theme="dark"])){--label:#1b2030;--icon-tint:color-mix(in oklab,var(--accent) 30%,#fff);}}
|
|
2563
2767
|
/* The library's class-based dark scope (body.dark / .dark / [data-theme=dark])
|
|
@@ -2604,7 +2808,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2604
2808
|
:host([compact]:hover) .tip,:host([compact]:focus-within) .tip{opacity:1;transform:translateX(-50%);}
|
|
2605
2809
|
@media (max-width:560px){ :host(:hover) .tip,:host(:focus-within) .tip{opacity:1;transform:translateX(-50%);} }
|
|
2606
2810
|
@media (prefers-reduced-motion: reduce){ .tip{transition:none;} }
|
|
2607
|
-
`);
|
|
2811
|
+
`);_(`slicc-pill`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`active`,`label`,`pupil`,`fill`,`theme`];#e;#t=null;#n=null;#r=null;#i=null;#a=Er;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Gr]}connectedCallback(){this.#o(),this.#s()}disconnectedCallback(){this.#c()}attributeChangedCallback(){this.isConnected&&(this.#o(),this.#s())}get type(){return this.getAttribute(`type`)===`cone`?`cone`:`scoop`}set type(e){this.setAttribute(`type`,e===`cone`?`cone`:`scoop`)}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get eyeState(){let e=this.getAttribute(`eyes`);return e===`none`||e===`dead`?e:`open`}set eyeState(e){this.setAttribute(`eyes`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get compact(){return this.hasAttribute(`compact`)}set compact(e){this.toggleAttribute(`compact`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}get pupilScale(){let e=Number.parseFloat(this.getAttribute(`pupil`)??``);if(Number.isFinite(e))return Math.max(.3,Math.min(2.4,e));let t=Number.parseFloat(this.getAttribute(`fill`)??``);return Number.isFinite(t)?Fr(Math.max(0,Math.min(100,t))):1}#o(){let e=this.type,t=Nr[e],n=this.color??Pr[e],r=this.active,i=this.label,a=e===`cone`?zr(n,Rr(n,-.38),Rr(n,.3)):Br(n,Rr(n,-.32)),o=t.eyes,s=(o.left+o.width/2)/100,c=(o.top+o.height/2)/100,l=((.5-t.zoom*s)*100).toFixed(2),u=((.5-t.zoom*c)*100).toFixed(2),d=o.left/100,f=(o.left+o.width)/100,p=o.top/100,m=(o.top+o.height)/100,h=Math.min(0,d),ee=Math.max(1,f),te=Math.min(0,p),ne=Math.max(1,m),g=Math.min(1,1/Math.max(ee-h,ne-te)),_=((.5-g*(h+ee)/2)*100).toFixed(2),v=((.5-g*(te+ne)/2)*100).toFixed(2),b=Tr*this.pupilScale;this.#a=Math.max(2,Math.min(Er,Ar.r-b-4));let re=P(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...a),ie=Ur(this.eyeState,b),ae=y(`span`,{class:`eyes`,style:`top:${o.top}%;left:${o.left}%;width:${o.width}%;height:${o.height}%`});ie&&ae.append(ie);let x=y(`span`,{class:`icon`,part:`icon`},y(`span`,{class:`icon-inner`,style:`--tx:${l}%;--ty:${u}%;--zoom:${t.zoom};--ox:${_}%;--oy:${v}%;--ozoom:${g.toFixed(4)}`},re,ae)),oe=y(`span`,{class:`label`,part:`label`},i??y(`slot`)),se=y(`button`,{class:`pill ${r?`active`:``}`,part:`pill`,style:`--accent:${n}`,"aria-label":i||!1},x,oe),ce=i?y(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},i):null;this.#e.replaceChildren(se,...ce?[ce]:[]),this.#n=this.#e.querySelector(`.pupil-l`),this.#r=this.#e.querySelector(`.pupil-r`),this.#i=this.#e.querySelector(`.eyes-svg`)}#s(){let e=this.eyeState===`open`&&this.type===`cone`;e&&!this.#t?(this.#t=e=>this.#l(e),document.addEventListener(`mousemove`,this.#t)):!e&&this.#t&&this.#c()}#c(){this.#t&&=(document.removeEventListener(`mousemove`,this.#t),null)}#l(e){if(!this.#i||!this.#n||!this.#r)return;let t=this.#i.getBoundingClientRect();if(!t.width||!t.height)return;let n=(e.clientX-t.left)*(200/t.width),r=(e.clientY-t.top)*(100/t.height);Wr(this.#n,Ar.cx,Ar.cy,n,r,this.#a),Wr(this.#r,jr.cx,jr.cy,n,r,this.#a)}});var Kr=b(`
|
|
2608
2812
|
:host {
|
|
2609
2813
|
display: inline-grid;
|
|
2610
2814
|
place-items: center;
|
|
@@ -2651,7 +2855,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2651
2855
|
object-fit: cover;
|
|
2652
2856
|
display: block;
|
|
2653
2857
|
}
|
|
2654
|
-
`),
|
|
2858
|
+
`),qr=class extends HTMLElement{static observedAttributes=[`initials`,`name`,`src`,`email`,`size`,`label`];#e;#t=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Kr],this.addEventListener(`click`,this.#i),this.addEventListener(`keydown`,this.#a)}connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`button`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.#o()}disconnectedCallback(){this.#t++}attributeChangedCallback(e,t,n){e===`size`&&this.#r(n),this.isConnected&&this.#o()}get initials(){return this.getAttribute(`initials`)}set initials(e){e==null?this.removeAttribute(`initials`):this.setAttribute(`initials`,e)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get size(){return this.getAttribute(`size`)}set size(e){e==null?this.removeAttribute(`size`):this.setAttribute(`size`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get resolvedInitials(){let e=this.initials;return e!=null&&e.trim()!==``?e.trim().slice(0,2).toUpperCase():Yr(this.name)||`?`}async gravatarUrl(e=this.email){let t=e?.trim().toLowerCase();return t?`https://www.gravatar.com/avatar/${await Jr(t)}?s=${this.#n()}&d=404`:null}#n(){let e=this.getBoundingClientRect().width;return Math.max(1,Math.round((e>0?e:30)*2))}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--avatar-size`):this.style.setProperty(`--avatar-size`,e)}#i=()=>{this.dispatchEvent(new CustomEvent(`slicc-avatar-click`,{bubbles:!0,composed:!0}))};#a=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.click())};#o(){let e=++this.#t,t=this.src,n=this.email,r=this.resolvedInitials,i=this.label??this.name??(r===`?`?`Account`:r);this.setAttribute(`aria-label`,i);let a=[y(`span`,{class:`ini`,part:`initials`},r)];if(t){let n=y(`img`,{class:`img`,part:`image`,src:t,alt:i});n.addEventListener(`load`,()=>{e===this.#t&&this.#e.querySelector(`.me`)?.classList.add(`has-img`)}),n.addEventListener(`error`,()=>{e===this.#t&&(n.remove(),this.#e.querySelector(`.me`)?.classList.remove(`has-img`))}),a.push(n)}let o=y(`div`,{class:`me`,part:`avatar`},y(`slot`,null,...a));this.#e.replaceChildren(o),!t&&n&&this.#s(n,e)}#s(e,t){this.gravatarUrl(e).then(e=>{if(!e||t!==this.#t)return;let n=new Image;n.onload=()=>{if(t!==this.#t||!this.isConnected)return;let n=this.#e.querySelector(`.me`);n&&(n.style.backgroundImage=`url("${e}")`,n.classList.add(`has-img`))},n.src=e}).catch(()=>{})}};async function Jr(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Yr(e){if(!e)return``;let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?``:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}_(`slicc-avatar`,qr);var Xr=b(`
|
|
2655
2859
|
:host { display: inline-flex; flex: 0 0 auto; }
|
|
2656
2860
|
:host([hidden]) { display: none; }
|
|
2657
2861
|
.col {
|
|
@@ -2672,7 +2876,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2672
2876
|
.col:hover { background: var(--ghost); color: var(--ink); }
|
|
2673
2877
|
.icon { display: inline-flex; place-items: center; pointer-events: none; }
|
|
2674
2878
|
.icon svg { display: block; }
|
|
2675
|
-
`),
|
|
2879
|
+
`),Zr=`panel-right-close`,Qr=`Collapse`,$r=16;_(`slicc-collapse-btn`,class extends HTMLElement{static observedAttributes=[`label`,`icon`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Xr]}connectedCallback(){this.#n()}attributeChangedCallback(){this.isConnected&&this.#n()}get label(){return this.getAttribute(`label`)??Qr}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get icon(){return this.getAttribute(`icon`)??Zr}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}#n(){let e=this.label,t=s(this.icon,{size:$r,part:`icon`}),n=y(`button`,{class:`col`,part:`button`,type:`button`,"aria-label":e,title:e},y(`slot`,null,y(`span`,{class:`icon`},t)));n.addEventListener(`click`,this.#r),this.#t=n,this.#e.replaceChildren(n)}#r=()=>{this.dispatchEvent(new CustomEvent(`collapse`,{bubbles:!0,composed:!0}))}});var ei=b(`
|
|
2676
2880
|
:host {
|
|
2677
2881
|
display: flex;
|
|
2678
2882
|
align-items: center;
|
|
@@ -2701,7 +2905,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2701
2905
|
min-width: 0;
|
|
2702
2906
|
background: var(--line, #e5e5e5);
|
|
2703
2907
|
}
|
|
2704
|
-
`);
|
|
2908
|
+
`);_(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ei]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label??y(`slot`);this.#e.replaceChildren(y(`span`,{class:`label`,part:`label`},e))}});var ti=`CLI float`;function ni(e){if(e==null)return null;let t=e.trim();if(t===``)return null;let n=Number.parseFloat(t.replace(/^\$/,``));return Number.isFinite(n)?`$${n.toFixed(2)}`:null}var ri=`(max-width: 560px)`,ii=b(`
|
|
2705
2909
|
:host {
|
|
2706
2910
|
position: relative;
|
|
2707
2911
|
display: inline-flex;
|
|
@@ -2812,7 +3016,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2812
3016
|
@media (prefers-reduced-motion: reduce) {
|
|
2813
3017
|
.tip { transition: none; }
|
|
2814
3018
|
}
|
|
2815
|
-
`);
|
|
3019
|
+
`);_(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`online`,`spent`];#e;#t;#n=()=>{this.isConnected&&this.#i()};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ii],this.#t=typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(ri):null}connectedCallback(){this.#t?.addEventListener(`change`,this.#n),this.#a()}disconnectedCallback(){this.#t?.removeEventListener(`change`,this.#n)}attributeChangedCallback(){this.isConnected&&this.#a()}get label(){return this.getAttribute(`label`)??ti}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get linked(){return this.hasAttribute(`linked`)}set linked(e){this.toggleAttribute(`linked`,!!e)}get online(){return this.hasAttribute(`online`)}set online(e){this.toggleAttribute(`online`,!!e)}get spent(){return this.getAttribute(`spent`)}set spent(e){e==null?this.removeAttribute(`spent`):this.setAttribute(`spent`,String(e))}#r(){let e=[this.label],t=ni(this.spent);return t!=null&&e.push(t),e.push(this.online?`online`:`offline`),e.join(` · `)}#i(){this.#t?.matches?this.setAttribute(`title`,this.#r()):this.removeAttribute(`title`)}#a(){let e=[];this.online&&e.push(y(`span`,{class:`fdot`,part:`dot`})),e.push(y(`span`,{class:`label`,part:`label`},y(`slot`,null,this.label)));let t=ni(this.spent);t!=null&&(e.push(y(`span`,{class:`sep`,part:`sep`})),e.push(y(`span`,{class:`spent`,part:`spent`},s(`circle-dollar-sign`,{size:12}),y(`span`,{class:`amount`},t)))),e.push(y(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},this.#r())),this.#e.replaceChildren(...e),this.#i()}});var ai=b(`
|
|
2816
3020
|
:host { display: inline-grid; }
|
|
2817
3021
|
:host([hidden]) { display: none; }
|
|
2818
3022
|
.iconbtn {
|
|
@@ -2841,7 +3045,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2841
3045
|
.iconbtn:disabled:hover { background: var(--canvas); color: var(--txt-2); }
|
|
2842
3046
|
.icon { display: grid; place-items: center; pointer-events: none; }
|
|
2843
3047
|
.icon svg { display: block; }
|
|
2844
|
-
`),
|
|
3048
|
+
`),oi=`plus`,si=16;_(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ai]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??oi}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label,t=y(`slot`,null,y(`span`,{class:`icon`},s(this.icon,{size:si,part:`icon`}))),n=y(`button`,{type:`button`,class:`iconbtn`,part:`button`,"aria-label":e??void 0,title:e??void 0,disabled:this.disabled},t);this.#e.replaceChildren(n)}});var ci=400,li=b(`
|
|
2845
3049
|
:host{position:fixed;inset:0;z-index:1000;display:none;}
|
|
2846
3050
|
:host([open]){display:block;}
|
|
2847
3051
|
.overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;cursor:pointer;}
|
|
@@ -2849,7 +3053,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2849
3053
|
.overlay.visible .backdrop{opacity:1;}
|
|
2850
3054
|
.overlay.closing .backdrop{opacity:0;}
|
|
2851
3055
|
.image{position:absolute;border-radius:6px;box-shadow:0 20px 60px rgba(0,0,0,.4),0 8px 20px rgba(0,0,0,.3);max-width:90vw;max-height:90vh;object-fit:contain;transform-origin:center center;will-change:transform;transition:transform .35s cubic-bezier(.2,0,.13,1),border-radius .35s cubic-bezier(.2,0,.13,1);}
|
|
2852
|
-
`),
|
|
3056
|
+
`),F=null,ui=class extends HTMLElement{#e;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[li]}disconnectedCallback(){this.#l(),F===this&&(F=null)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get isOpen(){return this.hasAttribute(`open`)}open(e,t){F&&F!==this&&F.#s(),this.#l(),this.#a=!1,this.src=e,this.setAttribute(`open`,``),F=this,this.#r=t??this;let n=document.createElement(`div`);n.className=`overlay`,n.setAttribute(`part`,`overlay`);let r=document.createElement(`div`);r.className=`backdrop`,r.setAttribute(`part`,`backdrop`),n.appendChild(r);let i=document.createElement(`img`);i.className=`image`,i.setAttribute(`part`,`image`),i.src=e,i.alt=`Image preview`,n.appendChild(i),this.#e.appendChild(n),this.#t=n,this.#n=i;let a=this.#r.getBoundingClientRect(),o=()=>{let e=window.innerWidth,t=window.innerHeight,r=e*.9,o=t*.9,s=i.naturalWidth||a.width*4,c=i.naturalHeight||a.height*4,l=Math.min(r/s,o/c,1),u=s*l,d=c*l,f=(e-u)/2,p=(t-d)/2,m=a.width/u,h=a.height/d,ee=a.left+a.width/2,te=a.top+a.height/2,ne=f+u/2,g=p+d/2,_=ee-ne,v=te-g;i.style.position=`absolute`,i.style.width=`${u}px`,i.style.height=`${d}px`,i.style.left=`${f}px`,i.style.top=`${p}px`,i.style.transform=`translate(${_}px, ${v}px) scale(${m}, ${h})`,i.style.borderRadius=`${6/Math.min(m,h)}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.style.transform=`translate(0, 0) scale(1, 1)`,i.style.borderRadius=`6px`,n.classList.add(`visible`)})})};i.complete&&i.naturalWidth>0?o():(i.onload=()=>o(),i.onerror=()=>this.#s()),this.#i=e=>{e.key===`Escape`&&this.close()},n.addEventListener(`click`,()=>this.close()),document.addEventListener(`keydown`,this.#i),this.dispatchEvent(new CustomEvent(`slicc-image-preview-open`,{bubbles:!0,composed:!0,detail:{src:e}}))}close(){let e=this.#t,t=this.#n;if(this.#a||!e||!t||F!==this)return;this.#a=!0,e.classList.add(`closing`),e.classList.remove(`visible`);let n=this.#r,r=n?n.getBoundingClientRect():null;if(r&&r.width>0&&r.height>0){let e=t.getBoundingClientRect(),n=r.width/e.width,i=r.height/e.height,a=r.left+r.width/2,o=r.top+r.height/2,s=e.left+e.width/2,c=e.top+e.height/2,l=a-s,u=o-c;t.style.transform=`translate(${l}px, ${u}px) scale(${n}, ${i})`,t.style.borderRadius=`${6/Math.min(n,i)}px`}this.dispatchEvent(new CustomEvent(`slicc-image-preview-close`,{bubbles:!0,composed:!0,detail:{src:this.src}}));let i=()=>this.#c();this.#o=setTimeout(i,ci),e.addEventListener(`transitionend`,e=>{e.propertyName===`transform`&&(this.#o&&clearTimeout(this.#o),i())})}#s(){this.#l()}#c(){this.#l()}#l(){this.#o&&=(clearTimeout(this.#o),null),this.#i&&=(document.removeEventListener(`keydown`,this.#i),null),this.#t&&=(this.#t.remove(),null),this.#n=null,this.#r=null,this.removeAttribute(`open`),this.removeAttribute(`src`),F===this&&(F=null)}static show(e,t){let n=document.querySelector(`slicc-image-preview[data-shared]`);return n||(n=document.createElement(`slicc-image-preview`),n.setAttribute(`data-shared`,``),document.body.appendChild(n)),n.open(e,t),()=>n.close()}};_(`slicc-image-preview`,ui);var di=b(`
|
|
2853
3057
|
:host { display: inline-flex; align-items: center; height: var(--ctl-h, 30px); font-family: var(--ui); line-height: 1; }
|
|
2854
3058
|
.logo { font-weight: 600; font-size: 14px; letter-spacing: -0.02em; color: var(--ink); }
|
|
2855
3059
|
.b {
|
|
@@ -2858,7 +3062,7 @@ slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
|
2858
3062
|
}
|
|
2859
3063
|
/* Narrow / extension-sidebar: drop the gradient suffix badge to save width. */
|
|
2860
3064
|
@media (max-width: 560px) { .b { display: none; } }
|
|
2861
|
-
`);
|
|
3065
|
+
`);_(`slicc-logo`,class extends HTMLElement{static observedAttributes=[`badge`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[di]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get badge(){return this.getAttribute(`badge`)}set badge(e){e==null?this.removeAttribute(`badge`):this.setAttribute(`badge`,e)}#t(){let e=y(`span`,{class:`logo`,part:`logo`},`sliccy`);this.badge&&e.append(y(`span`,{class:`b`,part:`badge`},this.badge)),this.#e.replaceChildren(e)}});var fi=`
|
|
2862
3066
|
slicc-pane {
|
|
2863
3067
|
display: flex;
|
|
2864
3068
|
flex-direction: column;
|
|
@@ -2897,7 +3101,7 @@ slicc-pane .slicc-pane__body {
|
|
|
2897
3101
|
min-height: 0;
|
|
2898
3102
|
overflow: auto;
|
|
2899
3103
|
}
|
|
2900
|
-
`,
|
|
3104
|
+
`,pi=`slicc-pane-style`;function mi(e){if(e.getElementById(pi))return;let t=e.createElement(`style`);t.id=pi,t.textContent=fi,(e.head??e.documentElement).appendChild(t)}_(`slicc-pane`,class extends HTMLElement{static observedAttributes=[`elevated`];#e;#t;#n=!1;connectedCallback(){mi(this.ownerDocument),this.#r()}attributeChangedCallback(e,t,n){e===`elevated`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-pane-change`,{bubbles:!0,composed:!0,detail:{elevated:n!==null}}))}get elevated(){return this.hasAttribute(`elevated`)}set elevated(e){e?this.setAttribute(`elevated`,``):this.removeAttribute(`elevated`)}#r(){if(this.#n)return;this.#n=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-pane__surface`))),t=this.ownerDocument.createElement(`div`);t.className=`slicc-pane__surface`,t.setAttribute(`part`,`surface`),this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-pane__header`,this.#e.setAttribute(`part`,`header`),this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`slicc-pane__body`,this.#t.setAttribute(`part`,`body`),t.append(this.#e,this.#t);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`header`?this.#e.appendChild(t):this.#t.appendChild(t);this.appendChild(t)}});function hi(e){return e===`tool`||e===`sprinkle`}var gi=b(`
|
|
2901
3105
|
:host { display: none; flex: 0 0 auto; }
|
|
2902
3106
|
:host([kind="tool"]), :host([kind="sprinkle"]) { display: inline-block; }
|
|
2903
3107
|
.ptag {
|
|
@@ -2916,7 +3120,7 @@ slicc-pane .slicc-pane__body {
|
|
|
2916
3120
|
background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
|
|
2917
3121
|
border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
|
|
2918
3122
|
}
|
|
2919
|
-
`);
|
|
3123
|
+
`);_(`slicc-pane-tag`,class extends HTMLElement{static observedAttributes=[`kind`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[gi]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get kind(){let e=this.getAttribute(`kind`);return hi(e)?e:null}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}#t(){let e=y(`span`,{class:`ptag`,part:`tag`},y(`slot`,null,this.kind??``));this.#e.replaceChildren(e)}});var _i=`
|
|
2920
3124
|
slicc-press-button {
|
|
2921
3125
|
display: inline-flex;
|
|
2922
3126
|
}
|
|
@@ -3008,7 +3212,7 @@ slicc-press-button {
|
|
|
3008
3212
|
animation: none;
|
|
3009
3213
|
}
|
|
3010
3214
|
}
|
|
3011
|
-
`,
|
|
3215
|
+
`,vi=`slicc-press-button-style`;function yi(e){if(e.getElementById(vi))return;let t=e.createElement(`style`);t.id=vi,t.textContent=_i,(e.head??e.documentElement).appendChild(t)}var bi=`slicc-press-btn`,xi=`is-squish`,Si=`is-wobble`;_(`slicc-press-button`,class extends HTMLElement{static get observedAttributes(){return[`label`,`tooltip`,`tooltip-pos`,`disabled`]}innerBtn=null;pressLayer=null;handle=null;initialized=!1;pendingShortTimer=null;pendingShortEvent=null;animEndListener=null;connectedCallback(){yi(this.ownerDocument),this.initialized?this.handle===null&&this.attachGesture():this.initialize(),this.syncAttributes()}disconnectedCallback(){this.handle?.destroy(),this.handle=null,this.clearPendingShort(),this.clearRipple(),this.clearAnimation()}attributeChangedCallback(){this.initialized&&this.syncAttributes()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get tooltip(){return this.getAttribute(`tooltip`)}set tooltip(e){e==null?this.removeAttribute(`tooltip`):this.setAttribute(`tooltip`,e)}setIcon(e){this.initialized||this.initialize();let t=this.innerBtn,n=this.pressLayer;for(let e of Array.from(t.childNodes))e!==n&&e.remove();let r=new DOMParser().parseFromString(e,`text/html`).body;for(;r.firstChild;)t.appendChild(r.firstChild)}focus(e){this.initialized||this.initialize(),this.innerBtn?.focus(e)}initialize(){this.initialized=!0;let e=y(`span`,{class:`${bi}__press-layer`,part:`press-layer`}),t=y(`button`,{type:`button`,class:`${bi}__btn`,part:`button`},e);for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.innerBtn=t,this.pressLayer=e,this.attachGesture()}syncAttributes(){let e=this.innerBtn;if(!e)return;let t=this.getAttribute(`label`);t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t);let n=this.getAttribute(`tooltip`);n==null?delete e.dataset.tooltip:e.dataset.tooltip=n;let r=this.getAttribute(`tooltip-pos`);r==null?delete e.dataset.tooltipPos:e.dataset.tooltipPos=r,this.hasAttribute(`disabled`)?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`)}longPressMs(){let e=this.getAttribute(`long-press-ms`);if(e==null)return on;let t=Number(e);return Number.isFinite(t)&&t>0?t:on}doubleClickMs(){let e=this.getAttribute(`double-click-ms`);if(e==null)return 350;let t=Number(e);return Number.isFinite(t)&&t>0?t:350}doubleClickDisabled(){return this.hasAttribute(`disable-double-click`)}emit(e,t){e===`short-click`?this.playAnimation(xi):e===`double-click`&&this.playAnimation(Si);let n=t?{sourceEvent:t}:{};this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}))}playAnimation(e){let t=this.innerBtn;if(!t)return;this.clearAnimation(),t.offsetWidth,t.classList.add(e);let n=e=>{e.target===t&&this.clearAnimation()};this.animEndListener=n,t.addEventListener(`animationend`,n)}clearAnimation(){let e=this.innerBtn;e&&(this.animEndListener&&=(e.removeEventListener(`animationend`,this.animEndListener),null),e.classList.remove(xi,Si))}clearPendingShort(){this.pendingShortTimer!==null&&(clearTimeout(this.pendingShortTimer),this.pendingShortTimer=null),this.pendingShortEvent=null}attachGesture(){this.handle=sn(this,{longPressMs:this.longPressMs(),onPressStart:e=>this.paintRipple(e),onPressEnd:()=>this.clearRipple(),onLongPress:()=>{if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`);return}this.emit(`long-press`)},onShortClick:e=>{if(this.doubleClickDisabled()){this.emit(`short-click`,e);return}if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`,e);return}this.pendingShortEvent=e,this.pendingShortTimer=setTimeout(()=>{this.pendingShortTimer=null;let e=this.pendingShortEvent;this.pendingShortEvent=null,this.emit(`short-click`,e??void 0)},this.doubleClickMs())}})}paintRipple(e){this.clearRipple();let t=this.pressLayer;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=Math.max(r,n.width-r),o=Math.max(i,n.height-i),s=Math.ceil(Math.hypot(a,o))+2,c=this.ownerDocument.createElement(`span`);c.className=`${bi}__press`,c.style.left=`${r}px`,c.style.top=`${i}px`,c.style.width=`0px`,c.style.height=`0px`,c.style.transitionDuration=`${this.longPressMs()}ms`,t.appendChild(c),requestAnimationFrame(()=>{c.isConnected&&(c.style.width=`${s*2}px`,c.style.height=`${s*2}px`)})}clearRipple(){let e=this.pressLayer;if(e)for(;e.firstChild;)e.firstChild.remove()}});var Ci=b(`
|
|
3012
3216
|
:host { display: inline-flex; }
|
|
3013
3217
|
:host([hidden]) { display: none; }
|
|
3014
3218
|
|
|
@@ -3038,7 +3242,7 @@ slicc-press-button {
|
|
|
3038
3242
|
outline: 2px solid var(--violet);
|
|
3039
3243
|
outline-offset: 2px;
|
|
3040
3244
|
}
|
|
3041
|
-
`);
|
|
3245
|
+
`);_(`slicc-swatch`,class extends HTMLElement{static observedAttributes=[`color`,`hue`,`selected`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ci]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get hue(){return this.hasAttribute(`hue`)}set hue(e){this.toggleAttribute(`hue`,!!e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,!!e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.color,t=[`sw`];this.hue&&t.push(`hue`),this.selected&&t.push(`on`);let n=y(`button`,{type:`button`,part:`button`,class:t.join(` `),"aria-pressed":this.selected?`true`:`false`,"aria-label":this.label??e??`color swatch`},y(`slot`));e&&n.style.setProperty(`--swatch-color`,e),n.addEventListener(`click`,this.#n),this.#e.replaceChildren(n)}#n=()=>{this.selected=!0,this.dispatchEvent(new CustomEvent(`select`,{detail:{color:this.color},bubbles:!0,composed:!0}))}});var wi=new Set([`rose`,`cyan`,`violet`,`amber`,`waffle`,`green`]),Ti=b(`
|
|
3042
3246
|
:host {
|
|
3043
3247
|
display: inline-flex;
|
|
3044
3248
|
vertical-align: middle;
|
|
@@ -3098,7 +3302,7 @@ slicc-press-button {
|
|
|
3098
3302
|
:host-context(.dark)[hue="amber"] .tag, :host-context([data-theme="dark"])[hue="amber"] .tag { background: color-mix(in srgb, var(--amber) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--amber) 38%, var(--line)); }
|
|
3099
3303
|
:host-context(.dark)[hue="waffle"] .tag, :host-context([data-theme="dark"])[hue="waffle"] .tag { background: color-mix(in srgb, var(--waffle) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--waffle) 38%, var(--line)); }
|
|
3100
3304
|
:host-context(.dark)[hue="green"] .tag, :host-context([data-theme="dark"])[hue="green"] .tag { background: color-mix(in srgb, var(--green) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--green) 38%, var(--line)); }
|
|
3101
|
-
`);
|
|
3305
|
+
`);_(`slicc-tag`,class extends HTMLElement{static observedAttributes=[`hue`,`label`,`dot`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ti]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get hue(){let e=this.getAttribute(`hue`);return e&&wi.has(e)?e:null}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get dot(){return this.hasAttribute(`dot`)}set dot(e){e?this.setAttribute(`dot`,``):this.removeAttribute(`dot`)}#t(){let e=this.label??y(`slot`),t=y(`span`,{class:`tag`,part:`tag`},this.dot?y(`span`,{class:`dot`,part:`dot`}):null,y(`span`,{class:`label`,part:`label`},e));this.#e.replaceChildren(t)}});var Ei=`
|
|
3102
3306
|
.slicc-chatpane {
|
|
3103
3307
|
flex: 0 0 auto;
|
|
3104
3308
|
width: calc(100% - 48px);
|
|
@@ -3141,7 +3345,7 @@ slicc-press-button {
|
|
|
3141
3345
|
-webkit-mask-image: none;
|
|
3142
3346
|
mask-image: none;
|
|
3143
3347
|
}
|
|
3144
|
-
`,
|
|
3348
|
+
`,Di=`slicc-chatpane-style`;function Oi(e){if(e.getElementById(Di))return;let t=e.createElement(`style`);t.id=Di,t.textContent=Ei,(e.head??e.documentElement).appendChild(t)}var ki=[`slicc-chat-thread`,`slicc-composer`];_(`slicc-chatpane`,class extends HTMLElement{static observedAttributes=[`narrow`];#e=null;#t=!1;connectedCallback(){Oi(this.ownerDocument),this.classList.add(`slicc-chatpane`),this.setAttribute(`part`,`pane`),this.#t=!0,this.#n(),this.#r()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){e!==`narrow`||t===n||this.isConnected&&(this.#n(),this.dispatchEvent(new CustomEvent(`slicc-chatpane-narrow-change`,{detail:{narrow:this.narrow},bubbles:!0,composed:!0})))}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){e?this.setAttribute(`narrow`,``):this.removeAttribute(`narrow`)}get nav(){return this.querySelector(`:scope > slicc-nav`)}get thread(){return this.querySelector(`:scope > slicc-chat-thread`)}get composer(){return this.querySelector(`:scope > slicc-composer`)}#n(){if(!this.#t)return;let e=this.narrow;for(let t of ki)for(let n of this.querySelectorAll(`:scope > ${t}`))e?n.setAttribute(`open`,``):n.removeAttribute(`open`)}#r(){this.#e||(this.#e=new MutationObserver(()=>this.#n()),this.#e.observe(this,{childList:!0}))}});var Ai=`
|
|
3145
3349
|
.slicc-shell { display: flex; flex: 1; min-height: 0; }
|
|
3146
3350
|
.slicc-shell > slicc-chatpane,
|
|
3147
3351
|
.slicc-shell > .chatpane {
|
|
@@ -3193,7 +3397,7 @@ slicc-press-button {
|
|
|
3193
3397
|
background: var(--bg);
|
|
3194
3398
|
}
|
|
3195
3399
|
}
|
|
3196
|
-
`,
|
|
3400
|
+
`,ji=`slicc-shell-style`;function Mi(e){if(e.getElementById(ji))return;let t=e.createElement(`style`);t.id=ji,t.textContent=Ai,(e.head??e.documentElement).appendChild(t)}_(`slicc-shell`,class extends HTMLElement{static observedAttributes=[`open`,`url-state`];#e=null;#t=null;#n=!1;#r=e=>{if(!this.urlState)return;let t=e.detail?.id;typeof t==`string`&&De(`ws`,t)};#i=()=>{this.urlState&&De(`ws`,null)};#a=()=>{if(!this.urlState)return;let e=D(`ws`);e?this.#o(e):this.open&&this.collapse()};connectedCallback(){if(Mi(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`),this.#n=!0,this.#s(),this.#e=e=>{let t=e.detail?.id;typeof t==`string`&&this.select(t)},this.#t=()=>this.collapse(),this.addEventListener(`dock-select`,this.#e),this.addEventListener(`dock-collapse`,this.#t),this.addEventListener(`slicc-dock-select`,this.#r),this.addEventListener(`slicc-dock-collapse`,this.#i),this.urlState){window.addEventListener(`popstate`,this.#a);let e=D(`ws`);e&&queueMicrotask(()=>this.#o(e))}}disconnectedCallback(){this.#e&&this.removeEventListener(`dock-select`,this.#e),this.#t&&this.removeEventListener(`dock-collapse`,this.#t),this.#e=null,this.#t=null,this.removeEventListener(`slicc-dock-select`,this.#r),this.removeEventListener(`slicc-dock-collapse`,this.#i),window.removeEventListener(`popstate`,this.#a)}get urlState(){return this.hasAttribute(`url-state`)}set urlState(e){this.toggleAttribute(`url-state`,e)}#o(e){this.dock?.selectItem?.(e)}attributeChangedCallback(e,t,n){e===`open`&&t!==n&&this.isConnected&&this.#s()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get chatpane(){return this.querySelector(`:scope > slicc-chatpane, :scope > .chatpane`)}get workbench(){return this.querySelector(`:scope > slicc-workbench-pane, :scope > .workbench`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}select(e){this.open=!0,this.#c(e),this.dispatchEvent(new CustomEvent(`slicc-shell-select`,{detail:{id:e},bubbles:!0,composed:!0}))}collapse(){this.open=!1,this.dock?.clearActive?.(),this.dispatchEvent(new CustomEvent(`slicc-shell-collapse`,{bubbles:!0,composed:!0}))}#s(){if(!this.#n)return;let e=this.open;this.chatpane?.toggleAttribute(`narrow`,e),this.workbench?.toggleAttribute(`open`,e)}#c(e){this.dock?.selectItem?.(e);let t=this.workbench;t?.selectSurface&&t.selectSurface(e),this.#s()}});var Ni=b(`
|
|
3197
3401
|
:host{display:inline-block;}
|
|
3198
3402
|
.switcher-more{position:relative;}
|
|
3199
3403
|
.morebtn{display:none;font:inherit;font-size:13px;font-weight:600;color:var(--txt-2);background:transparent;border:1px solid var(--line);border-radius:9999px;height:var(--ctl-h,30px);padding:0 11px;cursor:pointer;line-height:1;align-items:center;}
|
|
@@ -3215,10 +3419,10 @@ slicc-press-button {
|
|
|
3215
3419
|
.pop slicc-pill::part(label){display:block;}
|
|
3216
3420
|
.pop slicc-pill::part(tip){display:none;}
|
|
3217
3421
|
}
|
|
3218
|
-
`);
|
|
3422
|
+
`);_(`slicc-scoop-overflow`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n;#r;#i;#a=e=>{this.open&&!this.contains(e.target)&&this.close()};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ni]}connectedCallback(){this.#o()}disconnectedCallback(){document.removeEventListener(`click`,this.#a)}attributeChangedCallback(e){e===`open`&&this.#n&&this.#c()}get items(){return this.#t}set items(e){this.#t=Array.isArray(e)?e:[],this.isConnected&&this.#s()}get count(){return this.#t.length}get hasOverflow(){return this.#t.length>0}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}show(){this.open||=!0}close(){this.open&&=!1}toggle(){this.open=!this.open}#o(){let e=y(`slot`,{name:`more`},`⋯`);this.#r=y(`button`,{class:`morebtn`,part:`more`,type:`button`,title:`More scoops`,"aria-haspopup":`true`,"aria-expanded":`false`},e),this.#i=y(`div`,{class:`pop`,part:`pop`}),this.#n=y(`div`,{class:`switcher-more`,part:`wrap`},this.#r,this.#i),this.#r.addEventListener(`click`,e=>{e.stopPropagation(),this.toggle()}),this.#e.replaceChildren(this.#n),this.#s(),this.#c()}#s(){let e=this.#t.length;if(e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`),this.#n.classList.toggle(`has-overflow`,e>0),this.#r.setAttribute(`aria-haspopup`,`true`),e===0){this.#i.replaceChildren(y(`slot`,{name:`empty`})),this.open&&this.close();return}let t=[];this.#t.forEach((e,n)=>{let r=e.id,i=e.label??e.id,a=y(`slicc-pill`,{class:`scoop`,part:`pill`,"data-k":r,type:e.type===`cone`?`cone`:`scoop`,eyes:e.eyes===`open`||e.eyes===`dead`?e.eyes:`none`,color:e.color??!1,label:i,style:`--i:${n}`});a.addEventListener(`click`,()=>{let e=a.dataset.k??``,t=this.#t.find(t=>t.id===e);this.#l(e,t?.label??e)}),t.push(a)}),this.#i.replaceChildren(...t)}#c(){let e=this.open;this.#n.classList.toggle(`open`,e),this.#r.setAttribute(`aria-expanded`,e?`true`:`false`),document.removeEventListener(`click`,this.#a),e&&document.addEventListener(`click`,this.#a)}#l(e,t){this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,label:t},bubbles:!0,composed:!0})),this.close()}});var Pi={cone:`var(--waffle)`,researcher:`var(--cyan)`,designer:`var(--violet)`,tester:`var(--amber)`,triage:`var(--green)`},Fi=40,Ii=6,Li=`
|
|
3219
3423
|
.slicc-scoop-switcher {
|
|
3220
3424
|
display: flex;
|
|
3221
|
-
gap: ${
|
|
3425
|
+
gap: ${Ii}px;
|
|
3222
3426
|
flex-wrap: nowrap;
|
|
3223
3427
|
min-width: 0;
|
|
3224
3428
|
overflow: hidden;
|
|
@@ -3266,7 +3470,7 @@ slicc-press-button {
|
|
|
3266
3470
|
.slicc-scoop-switcher .scoop { width: 34px; }
|
|
3267
3471
|
.slicc-scoop-switcher slicc-pill.scoop { --pill-w: 34px; }
|
|
3268
3472
|
}
|
|
3269
|
-
`,
|
|
3473
|
+
`,Ri=`slicc-scoop-switcher-style`;function zi(e){if(e.getElementById(Ri))return;let t=e.createElement(`style`);t.id=Ri,t.textContent=Li,(e.head??e.documentElement).appendChild(t)}function Bi(e){return Pi[e]??`var(--rose)`}function Vi(e,t){let n=e.getAttribute(`eyes`);return n===`open`||n===`none`||n===`dead`?n:t}_(`slicc-scoop-switcher`,class extends HTMLElement{static get observedAttributes(){return[`active`,`attention`]}#e=[];#t=null;#n=null;#r=!1;#i=null;#a=!1;#o=null;#s=e=>{let t=this.#f(e);t!==this.#o&&(this.#o=t,this.#m())};#c=()=>{this.#o!==null&&(this.#o=null,this.#m())};connectedCallback(){zi(this.ownerDocument),this.classList.add(`slicc-scoop-switcher`),this.setAttribute(`part`,`row`),this.#a||=(this.#u(),!0),this.#i||(this.#i=e=>this.#v(e),this.addEventListener(`click`,this.#i)),this.addEventListener(`pointerover`,this.#s),this.addEventListener(`pointerleave`,this.#c),this.#d(),this.#y(),requestAnimationFrame(()=>this.reflow())}disconnectedCallback(){this.#n?.disconnect(),this.#n=null,this.#i&&=(this.removeEventListener(`click`,this.#i),null),this.removeEventListener(`pointerover`,this.#s),this.removeEventListener(`pointerleave`,this.#c)}attributeChangedCallback(e){this.#a&&(e===`active`?this.#h():e===`attention`&&this.#m())}get scoops(){return this.#e.map(e=>({...e}))}set scoops(e){this.#e=Array.isArray(e)?e.map(e=>({...e})):[],this.#a&&this.isConnected&&(this.#d(),this.reflow())}get attention(){return this.getAttribute(`attention`)}set attention(e){e==null?this.removeAttribute(`attention`):this.setAttribute(`attention`,e)}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}reflow(){if(!(!this.isConnected||this.#r)){this.#r=!0;try{this.#l()}finally{this.#r=!1}}}#l(){let e=[...this.querySelectorAll(`slicc-pill.scoop`)];for(let t of e)t.classList.remove(`hide`);let t=e.filter(e=>e.offsetParent!==null||e.offsetWidth>0);if(t.length===0){this.#g([]);return}let n=this.clientWidth;if(n<=0){this.#g([]),requestAnimationFrame(()=>{this.isConnected&&this.clientWidth>0&&this.reflow()});return}let r=t.map(e=>e.offsetWidth);if(r.reduce((e,t)=>e+t,0)+Ii*Math.max(0,t.length-1)<=n+1){this.#g([]);return}let i=Math.max(0,n-Fi),a=[],o=0;t.forEach((e,t)=>{if(t===0){o+=r[t];return}let n=Ii+r[t];a.length===0&&o+n<=i?o+=n:(e.classList.add(`hide`),a.push(e))}),this.#g(a)}select(e){this.active=e;let t=this.#e.find(t=>t.key===e)?.label??e;this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0}))}#u(){let e=[...this.querySelectorAll(`slicc-pill`)];if(e.length===0)return;let t=e.map(e=>{let t=e.dataset.k??e.getAttribute(`label`)??``,n=e.getAttribute(`type`)===`cone`?`cone`:`scoop`;return{key:t,type:n,color:e.getAttribute(`color`)??void 0,label:e.getAttribute(`label`)??t,eyes:Vi(e,n===`cone`?`open`:`none`),ephemeral:e.classList.contains(`ephemeral`)}});for(let t of e)t.remove();this.#e.length===0&&(this.#e=t)}#d(){let e=this.active,t=this.#e.map(t=>{let n=t.key,r=t.type===`cone`||n===`cone`?`cone`:`scoop`,i=t.label??n,a=t.eyes??(r===`cone`?`open`:`none`),o=e!=null&&e===n,s=Bi(n);return y(`slicc-pill`,{class:`scoop${t.ephemeral?` ephemeral`:``}`,"data-k":n,type:r,color:t.color?t.color:!1,eyes:a,fill:typeof t.fill==`number`&&Number.isFinite(t.fill)?String(Math.round(Math.min(100,Math.max(0,t.fill)))):!1,label:i,active:o,style:`--h:${s}`})});this.replaceChildren(...t),this.#m()}#f(e){let t=e.target?.closest?.(`slicc-pill.scoop`);return t&&this.contains(t)?t.dataset.k??null:null}#p(e){let t=this.#e.find(t=>t.key===e),n=t?.type===`cone`||e===`cone`?`cone`:`scoop`;return t?.eyes??(n===`cone`?`open`:`none`)}#m(){let e=this.attention;for(let t of this.querySelectorAll(`slicc-pill.scoop`)){let n=t.dataset.k??``,r=this.#o===null?e!==null&&e===n:this.#o===n,i=this.#p(n);t.setAttribute(`eyes`,r?i:`none`),t.toggleAttribute(`blink`,r&&this.#o===null&&i===`open`)}}#h(){let e=this.active;for(let t of this.querySelectorAll(`slicc-pill.scoop`)){let n=t.dataset.k===e;t.classList.toggle(`active`,n),t.toggleAttribute(`active`,n)}}#g(e){if(e.length===0){this.#t&&(this.#t.items=[]);return}let t=this.#_();t.items=e.map(e=>{let t=e.dataset.k??``;return{id:t,label:e.getAttribute(`label`)??t,type:e.getAttribute(`type`)===`cone`?`cone`:`scoop`,color:e.getAttribute(`color`)??void 0,eyes:Vi(e,e.getAttribute(`type`)===`cone`?`open`:`none`)}})}#_(){if(this.#t)return this.#t;let e=this.ownerDocument.createElement(`slicc-scoop-overflow`);return e.addEventListener(`slicc-scoop-select`,e=>{let t=e.detail?.id;typeof t==`string`&&(e.stopPropagation(),this.select(t))}),this.after(e),this.#t=e,e}#v(e){let t=e.target?.closest(`slicc-pill.scoop`);if(!t||!this.contains(t))return;let n=t.dataset.k;n&&this.select(n)}#y(){this.#n||typeof ResizeObserver>`u`||(this.#n=new ResizeObserver(()=>this.reflow()),this.#n.observe(this),this.parentElement&&this.#n.observe(this.parentElement))}});var Hi=`/**
|
|
3270
3474
|
* SLICC design tokens — lifted verbatim from the prototype
|
|
3271
3475
|
* (proto/StellarRubySwift.html :root + body.dark). Light is the default; dark is
|
|
3272
3476
|
* opt-in. Per project decision the prototype's token vocabulary and light-default
|
|
@@ -3330,7 +3534,7 @@ slicc-press-button {
|
|
|
3330
3534
|
--shaderbg: #171410;
|
|
3331
3535
|
--shadow-pane: rgba(0, 0, 0, 0.35) 0 8px 26px -10px;
|
|
3332
3536
|
}
|
|
3333
|
-
`,
|
|
3537
|
+
`,Ui=`slicc-tokens`;function Wi(e=document){if(e.getElementById(Ui))return;let t=e.createElement(`style`);t.id=Ui,t.textContent=Hi,(e.head??e.documentElement).appendChild(t)}function Gi(e,t=document.body){t.classList.toggle(`dark`,e===`dark`),t.setAttribute(`data-theme`,e)}function Ki(e=document.body){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>Gi(t.matches?`dark`:`light`,e);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var qi=b(`
|
|
3334
3538
|
:host { display: inline-flex; flex: 0 0 auto; }
|
|
3335
3539
|
.themetgl {
|
|
3336
3540
|
font: inherit; font-family: var(--ui); font-size: 14px; line-height: 1;
|
|
@@ -3342,7 +3546,7 @@ slicc-press-button {
|
|
|
3342
3546
|
}
|
|
3343
3547
|
.themetgl:hover { background: color-mix(in srgb, var(--ink) 8%, var(--ghost)); }
|
|
3344
3548
|
.themetgl svg { display: block; }
|
|
3345
|
-
`),
|
|
3549
|
+
`),Ji=16,Yi={light:`moon`,dark:`sun`},Xi={light:`Switch to dark mode`,dark:`Switch to light mode`};_(`slicc-theme-toggle`,class extends HTMLElement{static observedAttributes=[`theme`];#e;#t=null;#n=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[qi];let e=y(`button`,{class:`themetgl`,part:`button`,type:`button`,"aria-pressed":`false`},y(`slot`,{name:`glyph-light`},s(Yi.light,{size:Ji})),y(`slot`,{name:`glyph-dark`,hidden:!0},s(Yi.dark,{size:Ji})));this.#e.replaceChildren(e),this.#t=e}connectedCallback(){this.#t?.addEventListener(`click`,this.#i),this.#a(this.theme??`light`,{silent:!0})}disconnectedCallback(){this.#t?.removeEventListener(`click`,this.#i)}attributeChangedCallback(e,t,n){e!==`theme`||t===n||this.#n||this.isConnected&&this.#a(this.#r(n)??`light`,{silent:!0})}get theme(){return this.#r(this.getAttribute(`theme`))}set theme(e){this.#a(e===`dark`?`dark`:`light`,{silent:!0})}get pressed(){return this.theme===`dark`}#r(e){return e===`dark`?`dark`:e===`light`?`light`:null}#i=()=>{this.#a(this.theme===`dark`?`light`:`dark`)};#a(e,t={}){this.#n=!0;try{if(Gi(e),this.getAttribute(`theme`)!==e&&this.setAttribute(`theme`,e),this.#t){this.#t.setAttribute(`aria-pressed`,e===`dark`?`true`:`false`),this.#t.title=Xi[e];let t=this.#e.querySelector(`slot[name="glyph-light"]`),n=this.#e.querySelector(`slot[name="glyph-dark"]`);t?.toggleAttribute(`hidden`,e===`dark`),n?.toggleAttribute(`hidden`,e===`light`)}for(let t of document.querySelectorAll(`slicc-pill, slicc-add-menu`))t.setAttribute(`theme`,e)}finally{this.#n=!1}t.silent||this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}}),_(`slicc-theme`,class extends HTMLElement{static observedAttributes=[`theme`];connectedCallback(){Wi(this.ownerDocument),this.classList.add(`slicc-theme`),this.#e()}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&this.isConnected&&this.#e()}get theme(){return this.getAttribute(`theme`)===`dark`?`dark`:`light`}set theme(e){this.setAttribute(`theme`,e===`dark`?`dark`:`light`)}#e(){let e=this.theme;Gi(e,this),this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}});var Zi=`
|
|
3346
3550
|
slicc-file-tree {
|
|
3347
3551
|
width: 190px;
|
|
3348
3552
|
flex: 0 0 auto;
|
|
@@ -3420,7 +3624,7 @@ slicc-file-tree .children[hidden] {
|
|
|
3420
3624
|
[data-theme="dark"] slicc-file-tree .f.on {
|
|
3421
3625
|
background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
|
|
3422
3626
|
}
|
|
3423
|
-
`,
|
|
3627
|
+
`,Qi=`slicc-file-tree-style`;function $i(e){if(e.getElementById(Qi))return;let t=e.createElement(`style`);t.id=Qi,t.textContent=Zi,(e.head??e.documentElement).appendChild(t)}function ea(e,t){let n=[];for(let r of e)if(r.kind===`group`)n.push(y(`div`,{class:`grp`},r.label));else if(r.kind===`dir`){let e=t.has(r.id);n.push(y(`div`,{class:e?`dir open`:`dir`,"data-dir-id":r.id,"aria-expanded":e?`true`:`false`},s(`chevron-right`,{size:14,class:`chev`}),r.label));let i=y(`div`,{class:`children`,hidden:e?void 0:!0});v(i,ea(r.children??[],t)),n.push(i)}else n.push(y(`div`,{class:`f`,"data-id":r.id},r.label));return n}var ta=class extends HTMLElement{static get observedAttributes(){return[`selected`]}#e=null;#t=new Map;#n=new Set;#r=!1;#i=null;connectedCallback(){$i(this.ownerDocument),this.#r||=(this.#e??(this.#e=this.#o(),this.#l()),!0),this.#s(),this.#d()}disconnectedCallback(){this.#i&&=(this.removeEventListener(`click`,this.#i),null)}attributeChangedCallback(e){e===`selected`&&this.#r&&this.isConnected&&this.#a()}get items(){return this.#e?this.#e.slice():[]}set items(e){this.#e=Array.isArray(e)?e.slice():[],this.#r=!0,this.#l(),this.isConnected&&(this.#s(),this.#d())}toggleDir(e){if(!this.#u(e,this.#e??[]))return;let t=!this.#n.has(e);t?this.#n.add(e):this.#n.delete(e),this.#s(),this.dispatchEvent(new CustomEvent(`dir-toggle`,{bubbles:!0,composed:!0,detail:{id:e,open:t}}))}isDirOpen(e){return this.#n.has(e)}get selected(){return this.getAttribute(`selected`)}set selected(e){e==null?this.removeAttribute(`selected`):this.setAttribute(`selected`,e)}selectFile(e){if(!this.querySelector(`.f[data-id="${na(e)}"]`))return;this.getAttribute(`selected`)!==e&&this.setAttribute(`selected`,e),this.#a();let t=this.#t.get(e)??e;this.dispatchEvent(new CustomEvent(`file-select`,{bubbles:!0,composed:!0,detail:{id:e,path:t}}))}#a(){let e=this.getAttribute(`selected`);for(let t of this.querySelectorAll(`.f`))t.classList.toggle(`on`,t.dataset.id===e)}#o(){let e=[];for(let t of Array.from(this.children)){if(!(t instanceof HTMLElement))continue;let n=(t.textContent??``).trim();if(n)if(t.classList.contains(`grp`)||t.hasAttribute(`data-group`)||t.dataset.group!=null)e.push({kind:`group`,label:n});else{let r=t.dataset.id??t.id??n;e.push({kind:`file`,id:r,label:n})}}return e}#s(){let e=this.#e??[];this.#t.clear(),this.#c(e),this.replaceChildren(...ea(e,this.#n)),this.#a()}#c(e){for(let t of e)t.kind===`file`?this.#t.set(t.id,t.path??t.label):t.kind===`dir`&&this.#c(t.children??[])}#l(){this.#n.clear();let e=t=>{for(let n of t)n.kind===`dir`&&(n.open&&this.#n.add(n.id),e(n.children??[]))};e(this.#e??[])}#u(e,t){for(let n of t)if(n.kind===`dir`&&(n.id===e||this.#u(e,n.children??[])))return!0;return!1}#d(){this.#i||(this.#i=e=>{let t=e.target,n=t?.closest(`.dir`);if(n&&this.contains(n)){let e=n.dataset.dirId;e!=null&&this.toggleDir(e);return}let r=t?.closest(`.f`);if(!r||!this.contains(r))return;let i=r.dataset.id;i!=null&&this.selectFile(i)},this.addEventListener(`click`,this.#i))}};function na(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}_(`slicc-file-tree`,ta);var ra=`
|
|
3424
3628
|
slicc-surface {
|
|
3425
3629
|
position: absolute;
|
|
3426
3630
|
inset: 0;
|
|
@@ -3452,7 +3656,7 @@ slicc-surface:fullscreen {
|
|
|
3452
3656
|
background: var(--canvas, #fff);
|
|
3453
3657
|
position: fixed;
|
|
3454
3658
|
}
|
|
3455
|
-
`,
|
|
3659
|
+
`,ia=`slicc-surface-style`;function aa(e){if(e.getElementById(ia))return;let t=e.createElement(`style`);t.id=ia,t.textContent=ra,(e.head??e.documentElement).appendChild(t)}function oa(e){return e===`block`||e===`column`?e:`flex`}_(`slicc-surface`,class extends HTMLElement{static observedAttributes=[`surface-id`,`active`,`layout`];connectedCallback(){aa(this.ownerDocument),this.#e()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`surface-id`?this.#e():e===`active`&&t!==n&&this.dispatchEvent(new CustomEvent(`surface-toggle`,{bubbles:!0,composed:!0,detail:{surfaceId:this.surfaceId,active:this.active,layout:this.layout}})))}get surfaceId(){return this.getAttribute(`surface-id`)}set surfaceId(e){e==null?this.removeAttribute(`surface-id`):this.setAttribute(`surface-id`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get layout(){return oa(this.getAttribute(`layout`))}set layout(e){this.setAttribute(`layout`,oa(e))}#e(){let e=this.surfaceId;e==null?delete this.dataset.s:this.dataset.s=e}});var sa=b(`
|
|
3456
3660
|
:host{display:inline-flex;white-space:nowrap;}
|
|
3457
3661
|
.tab{display:inline-flex;align-items:center;gap:7px;font-family:var(--ui);font-size:12px;color:var(--txt-2);background:transparent;border:1px solid transparent;border-radius:8px;padding:6px 10px;cursor:pointer;white-space:nowrap;}
|
|
3458
3662
|
.tab:hover{background:var(--ghost);color:var(--ink);}
|
|
@@ -3468,7 +3672,7 @@ slicc-surface:fullscreen {
|
|
|
3468
3672
|
.x{margin-left:3px;width:15px;height:15px;border-radius:4px;display:grid;place-items:center;color:var(--txt-3);}
|
|
3469
3673
|
.x:hover{background:var(--line);color:var(--ink);}
|
|
3470
3674
|
.sg svg,.x svg{display:block;}
|
|
3471
|
-
`),
|
|
3675
|
+
`),ca=13;_(`slicc-tab`,class extends HTMLElement{static observedAttributes=[`tab-id`,`kind`,`active`,`closable`,`badge`,`glyph`,`label`,`theme`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[sa]}connectedCallback(){this.#n(),this.#r()}disconnectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#n()}get tabId(){return this.getAttribute(`tab-id`)}set tabId(e){e==null?this.removeAttribute(`tab-id`):this.setAttribute(`tab-id`,e)}get kind(){return this.getAttribute(`kind`)===`sprinkle`?`sprinkle`:`tool`}set kind(e){this.setAttribute(`kind`,e===`sprinkle`?`sprinkle`:`tool`)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get closable(){return this.hasAttribute(`closable`)}set closable(e){this.toggleAttribute(`closable`,e)}get badge(){return this.getAttribute(`badge`)}set badge(e){e==null?this.removeAttribute(`badge`):this.setAttribute(`badge`,e)}get glyph(){return this.getAttribute(`glyph`)}set glyph(e){e==null?this.removeAttribute(`glyph`):this.setAttribute(`glyph`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#n(){let e=this.kind===`sprinkle`,t=y(`button`,{class:`tab${e?` sp`:``}${this.active?` on`:``}`,part:`tab`,type:`button`});if(this.tabId!=null&&t.setAttribute(`data-t`,this.tabId),e){let e=this.badge??`sparkles`;t.append(y(`span`,{class:`sg`,part:`badge`,"aria-hidden":`true`},s(e,{size:ca})))}else this.glyph!=null&&t.append(y(`span`,{class:`gl`,part:`glyph`,"aria-hidden":`true`},this.glyph));let n=this.label;t.append(n==null?y(`slot`):document.createTextNode(n)),this.closable&&t.append(y(`span`,{class:`x`,part:`close`,"data-close":``,role:`button`,"aria-label":`Close tab`},s(`x`,{size:ca}))),this.#e.replaceChildren(t)}#r(){this.#t||(this.#t=e=>this.#a(e),this.#e.addEventListener(`click`,this.#t))}#i(){this.#t&&=(this.#e.removeEventListener(`click`,this.#t),null)}#a(e){let t=e.target,n={tabId:this.tabId};if(t?.closest(`[data-close]`)){e.stopPropagation(),this.dispatchEvent(new CustomEvent(`close`,{detail:n,bubbles:!0,composed:!0}));return}this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}});var la=`
|
|
3472
3676
|
slicc-tab-bar {
|
|
3473
3677
|
display: flex;
|
|
3474
3678
|
align-items: center;
|
|
@@ -3480,7 +3684,7 @@ slicc-tab-bar {
|
|
|
3480
3684
|
slicc-tab-bar[hidden] {
|
|
3481
3685
|
display: none;
|
|
3482
3686
|
}
|
|
3483
|
-
`,
|
|
3687
|
+
`,ua=`slicc-tab-bar-style`;function da(e){if(e.getElementById(ua))return;let t=e.createElement(`style`);t.id=ua,t.textContent=la,(e.head??e.documentElement).appendChild(t)}function fa(e){return e===`sprinkle`?`sprinkle`:`tool`}_(`slicc-tab-bar`,class extends HTMLElement{static observedAttributes=[`active`];#e=[];#t=!1;#n=null;#r=null;#i=null;connectedCallback(){da(this.ownerDocument),this.#c(),this.#p()}disconnectedCallback(){this.#l(),this.#t=!1}attributeChangedCallback(e){e===`active`&&this.isConnected&&this.#o()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get tabs(){return this.#e.map(e=>({...e}))}set tabs(e){this.#e=(e??[]).map(e=>({...e})),this.active!=null&&!this.#e.some(e=>e.id===this.active)&&this.#a(this.#e[0]?.id??null),this.#t=!1,this.isConnected&&this.#p()}addTab(e){let t={...e,kind:fa(e.kind)},n=this.#e.findIndex(e=>e.id===t.id);return n>=0?this.#e[n]=t:this.#e.push(t),this.#t=!1,this.isConnected&&this.#p(),this.selectTab(t.id),t}removeTab(e){let t=this.#e.findIndex(t=>t.id===e);if(t<0)return;let n=this.active===e;if(this.#e.splice(t,1),this.#t=!1,this.isConnected&&this.#p(),this.dispatchEvent(new CustomEvent(`tab-close`,{detail:{id:e},bubbles:!0,composed:!0})),n){let e=this.#e[0]?.id??null;e==null?this.#a(null):this.selectTab(e)}}selectTab(e){this.#e.some(t=>t.id===e)&&this.active!==e&&(this.#a(e),this.dispatchEvent(new CustomEvent(`tab-select`,{detail:{id:e},bubbles:!0,composed:!0})))}#a(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e),this.#o()}#o(){let e=this.active;for(let t of this.querySelectorAll(`:scope > slicc-tab`)){let n=t.getAttribute(`tab-id`);t.toggleAttribute(`active`,n!=null&&n===e)}}#s(e){if(!(e instanceof Element))return null;let t=e.closest(`slicc-tab`);return!t||t.parentElement!==this?null:t.getAttribute(`tab-id`)}#c(){this.#r||(this.#r=e=>this.#u(e),this.#i=e=>this.#d(e),this.addEventListener(`select`,this.#r),this.addEventListener(`close`,this.#i),this.#n=e=>this.#f(e),this.addEventListener(`click`,this.#n))}#l(){this.#r&&this.removeEventListener(`select`,this.#r),this.#i&&this.removeEventListener(`close`,this.#i),this.#n&&this.removeEventListener(`click`,this.#n),this.#r=null,this.#i=null,this.#n=null}#u(e){if(e.target===this)return;let t=this.#s(e.target);t!=null&&(e.stopPropagation(),this.selectTab(t))}#d(e){if(e.target===this)return;let t=this.#s(e.target);t!=null&&(e.stopPropagation(),this.removeTab(t))}#f(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`slicc-tab`);if(!n||n.parentElement!==this)return;let r=n.getAttribute(`tab-id`);if(r==null)return;let i=t.closest(`.x, [data-close]`);if(i&&n.contains(i)){e.stopPropagation(),this.removeTab(r);return}this.selectTab(r)}#p(){if(this.#t)return;this.#t=!0;let e=this.active,t=[];for(let n of this.#e){let r=fa(n.kind);r!==`tool`&&t.push(y(`slicc-tab`,{"tab-id":n.id,kind:r,label:n.label,part:`tab`,closable:n.closable?!0:void 0,glyph:n.glyph||void 0,active:e!=null&&e===n.id?!0:void 0}))}this.replaceChildren(...t)}});var pa=`/**
|
|
3484
3688
|
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3485
3689
|
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
3486
3690
|
* https://github.com/chjj/term.js
|
|
@@ -3765,7 +3969,7 @@ slicc-tab-bar[hidden] {
|
|
|
3765
3969
|
.xterm .xterm-scrollable-element > .shadow.top.left {
|
|
3766
3970
|
box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
|
|
3767
3971
|
}
|
|
3768
|
-
`,
|
|
3972
|
+
`,ma={background:`#0c0c0e`,foreground:`#e7e7ea`,cursor:`#e7e7ea`,cursorAccent:`#0c0c0e`,selectionBackground:`#8b5cf64d`,selectionForeground:`#ffffff`,black:`#0c0c0e`,red:`#f43f5e`,green:`#5bd17b`,yellow:`#f59e0b`,blue:`#3b82f6`,magenta:`#8b5cf6`,cyan:`#06b6d4`,white:`#e7e7ea`,brightBlack:`#8a8a93`,brightRed:`#fb7185`,brightGreen:`#86efac`,brightYellow:`#fbbf24`,brightBlue:`#60a5fa`,brightMagenta:`#a78bfa`,brightCyan:`#22d3ee`,brightWhite:`#ffffff`},ha=`
|
|
3769
3973
|
:host {
|
|
3770
3974
|
display: flex;
|
|
3771
3975
|
flex-direction: column;
|
|
@@ -3806,7 +4010,7 @@ slicc-tab-bar[hidden] {
|
|
|
3806
4010
|
/* xterm.js wants its container to size the canvas; let it fill. */
|
|
3807
4011
|
.host .xterm { height: 100%; }
|
|
3808
4012
|
.host .xterm-viewport { overflow-y: auto; }
|
|
3809
|
-
`,
|
|
4013
|
+
`,ga=null;function _a(){return ga||=[b(pa),b(ha)],ga}var va=class extends HTMLElement{static observedAttributes=[`label`,`hide-header`];#e;#t=null;#n=null;#r=null;#i=null;#a=[];#o=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`})}connectedCallback(){this.#o=!1,this.#s(),this.#c()}disconnectedCallback(){this.#l()}attributeChangedCallback(e){if(this.isConnected&&e===`label`){let e=this.#e.querySelector(`.title`);e&&(e.textContent=this.label)}}get label(){return this.getAttribute(`label`)??`Terminal`}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get hideHeader(){return this.hasAttribute(`hide-header`)}set hideHeader(e){this.toggleAttribute(`hide-header`,e)}get terminal(){return this.#n}write(e){this.#n?this.#n.write(e):this.#a.push(e)}writeln(e){this.#n?this.#n.writeln(e):this.#a.push(`${e}\r\n`)}clear(){this.#n?this.#n.clear():this.#a.length=0}focus(){this.#n?.focus()}fit(){this.#r?.fit()}#s(){if(this.#t)return;this.#e.adoptedStyleSheets=_a();let e=y(`div`,{class:`hd`,part:`header`},s(`terminal`,{size:14}),y(`span`,{class:`title`},this.label),y(`span`,{class:`spacer`})),t=y(`div`,{class:`host`,part:`host`});this.#e.replaceChildren(e,t),this.#t=t}async#c(){if(this.#n||this.#o)return;let[{Terminal:e},{FitAddon:n}]=await Promise.all([t(()=>import(`./xterm-DooSxjI5.js`),[]),t(()=>import(`./addon-fit-DthTIhi3.js`),[])]);if(this.#o||!this.#t)return;let r=new e({cursorBlink:!ya(),fontSize:12,lineHeight:1.25,fontFamily:`'IBM Plex Mono', 'Source Code Pro', 'JetBrains Mono', ui-monospace, monospace`,theme:ma,convertEol:!0,scrollback:2e3}),i=new n;if(r.loadAddon(i),r.open(this.#t),r.onData(e=>{this.dispatchEvent(new CustomEvent(`terminal-data`,{detail:e,bubbles:!0,composed:!0}))}),this.#n=r,this.#r=i,i.fit(),this.#a.length){for(let e of this.#a)r.write(e);this.#a.length=0}typeof ResizeObserver==`function`&&(this.#i=new ResizeObserver(()=>this.#r?.fit()),this.#i.observe(this.#t))}#l(){this.#o=!0,this.#i?.disconnect(),this.#i=null,this.#n?.dispose(),this.#n=null,this.#r=null,this.#a.length=0}};function ya(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}_(`slicc-terminal`,va);var ba=`
|
|
3810
4014
|
slicc-workbench-body {
|
|
3811
4015
|
flex: 1;
|
|
3812
4016
|
min-height: 0;
|
|
@@ -3827,7 +4031,7 @@ slicc-workbench-body > * {
|
|
|
3827
4031
|
slicc-workbench-body > .slicc-wbbody__active {
|
|
3828
4032
|
display: flex;
|
|
3829
4033
|
}
|
|
3830
|
-
`,
|
|
4034
|
+
`,xa=`slicc-workbench-body-style`,Sa=`slicc-wbbody__active`,Ca=`slicc-surface`;function wa(e){if(e.getElementById(xa))return;let t=e.createElement(`style`);t.id=xa,t.textContent=ba,(e.head??e.documentElement).appendChild(t)}_(`slicc-workbench-body`,class extends HTMLElement{static observedAttributes=[`active`];#e=!1;#t=new MutationObserver(()=>this.#i());connectedCallback(){wa(this.ownerDocument),this.#e=!0,this.#i(),this.#t.observe(this,{childList:!0})}disconnectedCallback(){this.#e=!1,this.#t.disconnect()}attributeChangedCallback(e,t,n){t!==n&&e===`active`&&this.#e&&this.#i()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get activeSurface(){let e=this.active;return e==null?null:this.#n().find(t=>this.#r(t)===e)??null}get surfaces(){return this.#n()}selectSurface(e){let t=this.active;e!==t&&(this.setAttribute(`active`,e),this.#e||this.#i(),this.dispatchEvent(new CustomEvent(`slicc-surface-change`,{bubbles:!0,composed:!0,detail:{id:e,previous:t}})))}#n(){let e=[];for(let t of Array.from(this.children))t instanceof HTMLElement&&t.localName===Ca&&e.push(t);return e}#r(e){return e.getAttribute(`surface-id`)||e.getAttribute(`data-s`)||e.id}#i(){let e=this.active;for(let t of this.#n()){let n=e!=null&&this.#r(t)===e;t.classList.toggle(Sa,n),t.toggleAttribute(`active`,n)}}});var Ta=`
|
|
3831
4035
|
slicc-workbench-header {
|
|
3832
4036
|
flex: 0 0 auto;
|
|
3833
4037
|
display: flex;
|
|
@@ -3854,7 +4058,7 @@ slicc-workbench-header > slicc-collapse-btn {
|
|
|
3854
4058
|
slicc-workbench-header > slicc-tab-bar {
|
|
3855
4059
|
min-width: 0;
|
|
3856
4060
|
}
|
|
3857
|
-
`,
|
|
4061
|
+
`,Ea=`slicc-workbench-header-style`;function Da(e){if(e.getElementById(Ea))return;let t=e.createElement(`style`);t.id=Ea,t.textContent=Ta,(e.head??e.documentElement).appendChild(t)}_(`slicc-workbench-header`,class extends HTMLElement{static observedAttributes=[`kind`];#e;#t=!1;connectedCallback(){Da(this.ownerDocument),this.#n(),this.#r(),this.addEventListener(`collapse`,this.#i)}disconnectedCallback(){this.removeEventListener(`collapse`,this.#i)}attributeChangedCallback(e){e===`kind`&&this.isConnected&&this.#r()}get kind(){let e=this.getAttribute(`kind`);return e===`tool`||e===`sprinkle`?e:null}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get spacer(){return this.#n(),this.#e}#n(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-wbhead__spacer`);if(e instanceof HTMLElement){this.#e=e;return}this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-wbhead__spacer`,this.#e.setAttribute(`part`,`spacer`);let t=this.querySelector(`:scope > slicc-pane-tag`),n=this.querySelector(`:scope > slicc-collapse-btn`);this.appendChild(this.#e),t&&this.appendChild(t),n&&this.appendChild(n)}#r(){let e=this.querySelector(`:scope > slicc-pane-tag`);if(!e)return;let t=this.kind;t==null?e.removeAttribute(`kind`):e.setAttribute(`kind`,t)}#i=e=>{e.target!==this&&(e.stopPropagation(),this.dispatchEvent(new CustomEvent(`collapse`,{bubbles:!0,composed:!0})))}});var Oa=`
|
|
3858
4062
|
slicc-workbench-pane {
|
|
3859
4063
|
display: flex;
|
|
3860
4064
|
flex-direction: column;
|
|
@@ -3893,15 +4097,15 @@ slicc-workbench-pane slicc-pane .slicc-pane__body {
|
|
|
3893
4097
|
flex-direction: column;
|
|
3894
4098
|
min-height: 0;
|
|
3895
4099
|
}
|
|
3896
|
-
`,xa=`slicc-workbench-pane-style`;function Sa(e){if(e.getElementById(xa))return;let t=e.createElement(`style`);t.id=xa,t.textContent=ba,(e.head??e.documentElement).appendChild(t)}g(`slicc-workbench-pane`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;connectedCallback(){Sa(this.ownerDocument),this.#n()}attributeChangedCallback(e,t,n){e===`open`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-workbench-pane-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get pane(){return this.#n(),this.#e}#n(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > slicc-pane`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`slicc-pane`),this.#e.setAttribute(`elevated`,``),this.#e.setAttribute(`part`,`pane`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}});var Ca=e({HOLD_TO_ENABLE_MS:()=>vt,SliccImagePreview:()=>ni,TOKENS_CSS:()=>Pi,ensureGlobalTokens:()=>Ii,followSystemTheme:()=>Ri,setTheme:()=>Li}),{entries:wa,setPrototypeOf:Ta,isFrozen:Ea,getPrototypeOf:Da,getOwnPropertyDescriptor:Oa}=Object,{freeze:F,seal:I,create:ka}=Object,{apply:Aa,construct:ja}=typeof Reflect<`u`&&Reflect;F||=function(e){return e},I||=function(e){return e},Aa||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ja||=function(e){return new e(...[...arguments].slice(1))};var Ma=z(Array.prototype.forEach),Na=z(Array.prototype.lastIndexOf),Pa=z(Array.prototype.pop),Fa=z(Array.prototype.push),Ia=z(Array.prototype.splice),La=z(String.prototype.toLowerCase),Ra=z(String.prototype.toString),za=z(String.prototype.match),Ba=z(String.prototype.replace),Va=z(String.prototype.indexOf),Ha=z(String.prototype.trim),L=z(Object.prototype.hasOwnProperty),R=z(RegExp.prototype.test),Ua=Wa(TypeError);function z(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Aa(e,t,n)}}function Wa(e){return function(){return ja(e,[...arguments])}}function B(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:La;Ta&&Ta(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ea(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ga(e){for(let t=0;t<e.length;t++)L(e,t)||(e[t]=null);return e}function V(e){let t=ka(null);for(let[n,r]of wa(e))L(e,n)&&(Array.isArray(r)?t[n]=Ga(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=V(r):t[n]=r);return t}function Ka(e,t){for(;e!==null;){let n=Oa(e,t);if(n){if(n.get)return z(n.get);if(typeof n.value==`function`)return z(n.value)}e=Da(e)}function n(){return null}return n}var qa=F(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ja=F(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ya=F([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Xa=F([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Za=F(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Qa=F([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),$a=F([`#text`]),eo=F(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),to=F(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),no=F(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ro=F([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),io=I(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ao=I(/<%[\w\W]*|[\w\W]*%>/gm),oo=I(/\$\{[\w\W]*/gm),so=I(/^data-[\-\w.\u00B7-\uFFFF]+$/),co=I(/^aria-[\-\w]+$/),lo=I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),uo=I(/^(?:\w+script|data):/i),fo=I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),po=I(/^html$/i),mo=I(/^[a-z][.\w]*(-[.\w]+)+$/i),ho=Object.freeze({__proto__:null,ARIA_ATTR:co,ATTR_WHITESPACE:fo,CUSTOM_ELEMENT:mo,DATA_ATTR:so,DOCTYPE_NAME:po,ERB_EXPR:ao,IS_ALLOWED_URI:lo,IS_SCRIPT_OR_DATA:uo,MUSTACHE_EXPR:io,TMPLIT_EXPR:oo}),go={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_o=function(){return typeof window>`u`?null:window},vo=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},yo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function bo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_o(),t=e=>bo(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==go.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Ka(m,`cloneNode`),ee=Ka(m,`remove`),te=Ka(m,`nextSibling`),g=Ka(m,`childNodes`),_=Ka(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,y=``,{implementation:ne,createNodeIterator:re,createDocumentFragment:ie,getElementsByTagName:ae}=n,{importNode:oe}=r,b=yo();t.isSupported=typeof wa==`function`&&typeof _==`function`&&ne&&ne.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:se,ERB_EXPR:ce,TMPLIT_EXPR:le,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:pe,CUSTOM_ELEMENT:me}=ho,{IS_ALLOWED_URI:he}=ho,x=null,ge=B({},[...qa,...Ja,...Ya,...Za,...$a]),S=null,_e=B({},[...eo,...to,...no,...ro]),C=Object.seal(ka(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,ye=null,w=Object.seal(ka(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),be=!0,xe=!0,Se=!1,Ce=!0,we=!1,Te=!0,Ee=!1,T=!1,De=!1,Oe=!1,ke=!1,Ae=!1,je=!0,Me=!1,Ne=!0,Pe=!1,Fe={},E=null,Ie=B({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Le=null,Re=B({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ze=null,Be=B({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),D=`http://www.w3.org/1998/Math/MathML`,Ve=`http://www.w3.org/2000/svg`,O=`http://www.w3.org/1999/xhtml`,He=O,Ue=!1,We=null,Ge=B({},[D,Ve,O],Ra),Ke=B({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),qe=B({},[`annotation-xml`]),Je=B({},[`title`,`style`,`font`,`a`,`script`]),Ye=null,Xe=[`application/xhtml+xml`,`text/html`],k=null,A=null,Ze=n.createElement(`form`),Qe=function(e){return e instanceof RegExp||e instanceof Function},$e=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(A&&A===e)){if((!e||typeof e!=`object`)&&(e={}),e=V(e),Ye=Xe.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,k=Ye===`application/xhtml+xml`?Ra:La,x=L(e,`ALLOWED_TAGS`)?B({},e.ALLOWED_TAGS,k):ge,S=L(e,`ALLOWED_ATTR`)?B({},e.ALLOWED_ATTR,k):_e,We=L(e,`ALLOWED_NAMESPACES`)?B({},e.ALLOWED_NAMESPACES,Ra):Ge,ze=L(e,`ADD_URI_SAFE_ATTR`)?B(V(Be),e.ADD_URI_SAFE_ATTR,k):Be,Le=L(e,`ADD_DATA_URI_TAGS`)?B(V(Re),e.ADD_DATA_URI_TAGS,k):Re,E=L(e,`FORBID_CONTENTS`)?B({},e.FORBID_CONTENTS,k):Ie,ve=L(e,`FORBID_TAGS`)?B({},e.FORBID_TAGS,k):V({}),ye=L(e,`FORBID_ATTR`)?B({},e.FORBID_ATTR,k):V({}),Fe=L(e,`USE_PROFILES`)?e.USE_PROFILES:!1,be=e.ALLOW_ARIA_ATTR!==!1,xe=e.ALLOW_DATA_ATTR!==!1,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=e.SAFE_FOR_TEMPLATES||!1,Te=e.SAFE_FOR_XML!==!1,Ee=e.WHOLE_DOCUMENT||!1,Oe=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Ae=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,je=e.SANITIZE_DOM!==!1,Me=e.SANITIZE_NAMED_PROPS||!1,Ne=e.KEEP_CONTENT!==!1,Pe=e.IN_PLACE||!1,he=e.ALLOWED_URI_REGEXP||lo,He=e.NAMESPACE||O,Ke=e.MATHML_TEXT_INTEGRATION_POINTS||Ke,qe=e.HTML_INTEGRATION_POINTS||qe,C=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(C.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(C.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(C.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),we&&(xe=!1),ke&&(Oe=!0),Fe&&(x=B({},$a),S=ka(null),Fe.html===!0&&(B(x,qa),B(S,eo)),Fe.svg===!0&&(B(x,Ja),B(S,to),B(S,ro)),Fe.svgFilters===!0&&(B(x,Ya),B(S,to),B(S,ro)),Fe.mathMl===!0&&(B(x,Za),B(S,no),B(S,ro))),L(e,`ADD_TAGS`)||(w.tagCheck=null),L(e,`ADD_ATTR`)||(w.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?w.tagCheck=e.ADD_TAGS:(x===ge&&(x=V(x)),B(x,e.ADD_TAGS,k))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?w.attributeCheck=e.ADD_ATTR:(S===_e&&(S=V(S)),B(S,e.ADD_ATTR,k))),e.ADD_URI_SAFE_ATTR&&B(ze,e.ADD_URI_SAFE_ATTR,k),e.FORBID_CONTENTS&&(E===Ie&&(E=V(E)),B(E,e.FORBID_CONTENTS,k)),e.ADD_FORBID_CONTENTS&&(E===Ie&&(E=V(E)),B(E,e.ADD_FORBID_CONTENTS,k)),Ne&&(x[`#text`]=!0),Ee&&B(x,[`html`,`head`,`body`]),x.table&&(B(x,[`tbody`]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Ua(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Ua(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);v=e.TRUSTED_TYPES_POLICY,y=v.createHTML(``)}else v===void 0&&(v=vo(p,i)),v!==null&&typeof y==`string`&&(y=v.createHTML(``));F&&F(e),A=e}},et=B({},[...Ja,...Ya,...Xa]),tt=B({},[...Za,...Qa]),nt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:He,tagName:`template`});let n=La(e.tagName),r=La(t.tagName);return We[e.namespaceURI]?e.namespaceURI===Ve?t.namespaceURI===O?n===`svg`:t.namespaceURI===D?n===`svg`&&(r===`annotation-xml`||Ke[r]):!!et[n]:e.namespaceURI===D?t.namespaceURI===O?n===`math`:t.namespaceURI===Ve?n===`math`&&qe[r]:!!tt[n]:e.namespaceURI===O?t.namespaceURI===Ve&&!qe[r]||t.namespaceURI===D&&!Ke[r]?!1:!tt[n]&&(Je[n]||!et[n]):!!(Ye===`application/xhtml+xml`&&We[e.namespaceURI]):!1},j=function(e){Fa(t.removed,{element:e});try{_(e).removeChild(e)}catch{ee(e)}},rt=function(e,n){try{Fa(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Fa(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Oe||ke)try{j(n)}catch{}else try{n.setAttribute(e,``)}catch{}},it=function(e){let t=null,r=null;if(De)e=`<remove></remove>`+e;else{let t=za(e,/^[\r\n\t ]+/);r=t&&t[0]}Ye===`application/xhtml+xml`&&He===O&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?v.createHTML(e):e;if(He===O)try{t=new f().parseFromString(i,Ye)}catch{}if(!t||!t.documentElement){t=ne.createDocument(He,`template`,null);try{t.documentElement.innerHTML=Ue?y:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),He===O?ae.call(t,Ee?`html`:`body`)[0]:Ee?t.documentElement:a},at=function(e){return re.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ot=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},st=function(e){return typeof s==`function`&&e instanceof s};function M(e,n,r){Ma(e,e=>{e.call(t,n,r,A)})}let ct=function(e){let n=null;if(M(b.beforeSanitizeElements,e,null),ot(e))return j(e),!0;let r=k(e.nodeName);if(M(b.uponSanitizeElement,e,{tagName:r,allowedTags:x}),Te&&e.hasChildNodes()&&!st(e.firstElementChild)&&R(/<[/\w!]/g,e.innerHTML)&&R(/<[/\w!]/g,e.textContent)||e.nodeType===go.progressingInstruction||Te&&e.nodeType===go.comment&&R(/<[/\w]/g,e.data))return j(e),!0;if(!(w.tagCheck instanceof Function&&w.tagCheck(r))&&(!x[r]||ve[r])){if(!ve[r]&&ut(r)&&(C.tagNameCheck instanceof RegExp&&R(C.tagNameCheck,r)||C.tagNameCheck instanceof Function&&C.tagNameCheck(r)))return!1;if(Ne&&!E[r]){let t=_(e)||e.parentNode,n=g(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,te(e))}}}return j(e),!0}return e instanceof c&&!nt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&R(/<\/no(script|embed|frames)/i,e.innerHTML)?(j(e),!0):(we&&e.nodeType===go.text&&(n=e.textContent,Ma([se,ce,le],e=>{n=Ba(n,e,` `)}),e.textContent!==n&&(Fa(t.removed,{element:e.cloneNode()}),e.textContent=n)),M(b.afterSanitizeElements,e,null),!1)},lt=function(e,t,r){if(ye[t]||je&&(t===`id`||t===`name`)&&(r in n||r in Ze))return!1;if(!(xe&&!ye[t]&&R(ue,t))&&!(be&&R(de,t))&&!(w.attributeCheck instanceof Function&&w.attributeCheck(t,e))){if(!S[t]||ye[t]){if(!(ut(e)&&(C.tagNameCheck instanceof RegExp&&R(C.tagNameCheck,e)||C.tagNameCheck instanceof Function&&C.tagNameCheck(e))&&(C.attributeNameCheck instanceof RegExp&&R(C.attributeNameCheck,t)||C.attributeNameCheck instanceof Function&&C.attributeNameCheck(t,e))||t===`is`&&C.allowCustomizedBuiltInElements&&(C.tagNameCheck instanceof RegExp&&R(C.tagNameCheck,r)||C.tagNameCheck instanceof Function&&C.tagNameCheck(r))))return!1}else if(!ze[t]&&!R(he,Ba(r,pe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Va(r,`data:`)===0&&Le[e])&&!(Se&&!R(fe,Ba(r,pe,``)))&&r)return!1}return!0},ut=function(e){return e!==`annotation-xml`&&za(e,me)},dt=function(e){M(b.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||ot(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:S,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=k(a),l=s,u=a===`value`?l:Ha(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,M(b.uponSanitizeAttribute,e,r),u=r.attrValue,Me&&(c===`id`||c===`name`)&&(rt(a,e),u=`user-content-`+u),Te&&R(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){rt(a,e);continue}if(c===`attributename`&&za(u,`href`)){rt(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){rt(a,e);continue}if(!Ce&&R(/\/>/i,u)){rt(a,e);continue}we&&Ma([se,ce,le],e=>{u=Ba(u,e,` `)});let d=k(e.nodeName);if(!lt(d,c,u)){rt(a,e);continue}if(v&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=v.createHTML(u);break;case`TrustedScriptURL`:u=v.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),ot(e)?j(e):Pa(t.removed)}catch{rt(a,e)}}M(b.afterSanitizeAttributes,e,null)},ft=function e(t){let n=null,r=at(t);for(M(b.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)M(b.uponSanitizeShadowNode,n,null),ct(n),dt(n),n.content instanceof a&&e(n.content);M(b.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Ue=!e,Ue&&(e=`<!-->`),typeof e!=`string`&&!st(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Ua(`dirty is not a string, aborting`)}else throw Ua(`toString is not a function`);if(!t.isSupported)return e;if(T||$e(n),t.removed=[],typeof e==`string`&&(Pe=!1),Pe){if(e.nodeName){let t=k(e.nodeName);if(!x[t]||ve[t])throw Ua(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=it(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===go.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!Oe&&!we&&!Ee&&e.indexOf(`<`)===-1)return v&&Ae?v.createHTML(e):e;if(i=it(e),!i)return Oe?null:Ae?y:``}i&&De&&j(i.firstChild);let u=at(Pe?e:i);for(;c=u.nextNode();)ct(c),dt(c),c.content instanceof a&&ft(c.content);if(Pe)return e;if(Oe){if(ke)for(l=ie.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(S.shadowroot||S.shadowrootmode)&&(l=oe.call(r,l,!0)),l}let d=Ee?i.outerHTML:i.innerHTML;return Ee&&x[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&R(po,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
3897
|
-
`+d),
|
|
3898
|
-
]`).replace(`lheading`,
|
|
4100
|
+
`,ka=`slicc-workbench-pane-style`;function Aa(e){if(e.getElementById(ka))return;let t=e.createElement(`style`);t.id=ka,t.textContent=Oa,(e.head??e.documentElement).appendChild(t)}_(`slicc-workbench-pane`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;connectedCallback(){Aa(this.ownerDocument),this.#n()}attributeChangedCallback(e,t,n){e===`open`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-workbench-pane-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get pane(){return this.#n(),this.#e}#n(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > slicc-pane`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`slicc-pane`),this.#e.setAttribute(`elevated`,``),this.#e.setAttribute(`part`,`pane`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}});var ja=e({HOLD_TO_ENABLE_MS:()=>yt,SliccImagePreview:()=>ui,TOKENS_CSS:()=>Hi,ensureGlobalTokens:()=>Wi,followSystemTheme:()=>Ki,setTheme:()=>Gi}),{entries:Ma,setPrototypeOf:Na,isFrozen:Pa,getPrototypeOf:Fa,getOwnPropertyDescriptor:Ia}=Object,{freeze:I,seal:L,create:La}=Object,{apply:Ra,construct:za}=typeof Reflect<`u`&&Reflect;I||=function(e){return e},L||=function(e){return e},Ra||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},za||=function(e){return new e(...[...arguments].slice(1))};var Ba=B(Array.prototype.forEach),Va=B(Array.prototype.lastIndexOf),Ha=B(Array.prototype.pop),Ua=B(Array.prototype.push),Wa=B(Array.prototype.splice),Ga=B(String.prototype.toLowerCase),Ka=B(String.prototype.toString),qa=B(String.prototype.match),Ja=B(String.prototype.replace),Ya=B(String.prototype.indexOf),Xa=B(String.prototype.trim),R=B(Object.prototype.hasOwnProperty),z=B(RegExp.prototype.test),Za=Qa(TypeError);function B(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ra(e,t,n)}}function Qa(e){return function(){return za(e,[...arguments])}}function V(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ga;Na&&Na(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Pa(t)||(t[r]=e),i=e)}e[i]=!0}return e}function $a(e){for(let t=0;t<e.length;t++)R(e,t)||(e[t]=null);return e}function H(e){let t=La(null);for(let[n,r]of Ma(e))R(e,n)&&(Array.isArray(r)?t[n]=$a(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=H(r):t[n]=r);return t}function eo(e,t){for(;e!==null;){let n=Ia(e,t);if(n){if(n.get)return B(n.get);if(typeof n.value==`function`)return B(n.value)}e=Fa(e)}function n(){return null}return n}var to=I(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),no=I(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ro=I([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),io=I([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),ao=I(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),oo=I([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),so=I([`#text`]),co=I(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),lo=I(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),uo=I(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),fo=I([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),po=L(/\{\{[\w\W]*|[\w\W]*\}\}/gm),mo=L(/<%[\w\W]*|[\w\W]*%>/gm),ho=L(/\$\{[\w\W]*/gm),go=L(/^data-[\-\w.\u00B7-\uFFFF]+$/),_o=L(/^aria-[\-\w]+$/),vo=L(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yo=L(/^(?:\w+script|data):/i),bo=L(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xo=L(/^html$/i),So=L(/^[a-z][.\w]*(-[.\w]+)+$/i),Co=Object.freeze({__proto__:null,ARIA_ATTR:_o,ATTR_WHITESPACE:bo,CUSTOM_ELEMENT:So,DATA_ATTR:go,DOCTYPE_NAME:xo,ERB_EXPR:mo,IS_ALLOWED_URI:vo,IS_SCRIPT_OR_DATA:yo,MUSTACHE_EXPR:po,TMPLIT_EXPR:ho}),wo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},To=function(){return typeof window>`u`?null:window},Eo=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Do=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Oo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:To(),t=e=>Oo(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==wo.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=eo(m,`cloneNode`),ee=eo(m,`remove`),te=eo(m,`nextSibling`),ne=eo(m,`childNodes`),g=eo(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let _,v=``,{implementation:y,createNodeIterator:b,createDocumentFragment:re,getElementsByTagName:ie}=n,{importNode:ae}=r,x=Do();t.isSupported=typeof Ma==`function`&&typeof g==`function`&&y&&y.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:oe,ERB_EXPR:se,TMPLIT_EXPR:ce,DATA_ATTR:le,ARIA_ATTR:ue,IS_SCRIPT_OR_DATA:de,ATTR_WHITESPACE:fe,CUSTOM_ELEMENT:pe}=Co,{IS_ALLOWED_URI:me}=Co,S=null,he=V({},[...to,...no,...ro,...ao,...so]),C=null,ge=V({},[...co,...lo,...uo,...fo]),w=Object.seal(La(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,ve=null,T=Object.seal(La(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ye=!0,be=!0,xe=!1,Se=!0,Ce=!1,we=!0,E=!1,Te=!1,Ee=!1,D=!1,De=!1,Oe=!1,ke=!0,Ae=!1,je=!0,Me=!1,Ne={},O=null,Pe=V({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Fe=null,Ie=V({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Le=null,Re=V({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),ze=`http://www.w3.org/1998/Math/MathML`,Be=`http://www.w3.org/2000/svg`,k=`http://www.w3.org/1999/xhtml`,Ve=k,A=!1,He=null,Ue=V({},[ze,Be,k],Ka),We=V({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ge=V({},[`annotation-xml`]),Ke=V({},[`title`,`style`,`font`,`a`,`script`]),qe=null,Je=[`application/xhtml+xml`,`text/html`],j=null,Ye=null,Xe=n.createElement(`form`),Ze=function(e){return e instanceof RegExp||e instanceof Function},Qe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ye&&Ye===e)){if((!e||typeof e!=`object`)&&(e={}),e=H(e),qe=Je.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,j=qe===`application/xhtml+xml`?Ka:Ga,S=R(e,`ALLOWED_TAGS`)?V({},e.ALLOWED_TAGS,j):he,C=R(e,`ALLOWED_ATTR`)?V({},e.ALLOWED_ATTR,j):ge,He=R(e,`ALLOWED_NAMESPACES`)?V({},e.ALLOWED_NAMESPACES,Ka):Ue,Le=R(e,`ADD_URI_SAFE_ATTR`)?V(H(Re),e.ADD_URI_SAFE_ATTR,j):Re,Fe=R(e,`ADD_DATA_URI_TAGS`)?V(H(Ie),e.ADD_DATA_URI_TAGS,j):Ie,O=R(e,`FORBID_CONTENTS`)?V({},e.FORBID_CONTENTS,j):Pe,_e=R(e,`FORBID_TAGS`)?V({},e.FORBID_TAGS,j):H({}),ve=R(e,`FORBID_ATTR`)?V({},e.FORBID_ATTR,j):H({}),Ne=R(e,`USE_PROFILES`)?e.USE_PROFILES:!1,ye=e.ALLOW_ARIA_ATTR!==!1,be=e.ALLOW_DATA_ATTR!==!1,xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=e.SAFE_FOR_TEMPLATES||!1,we=e.SAFE_FOR_XML!==!1,E=e.WHOLE_DOCUMENT||!1,D=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Oe=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,ke=e.SANITIZE_DOM!==!1,Ae=e.SANITIZE_NAMED_PROPS||!1,je=e.KEEP_CONTENT!==!1,Me=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||vo,Ve=e.NAMESPACE||k,We=e.MATHML_TEXT_INTEGRATION_POINTS||We,Ge=e.HTML_INTEGRATION_POINTS||Ge,w=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(w.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(w.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(w.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ce&&(be=!1),De&&(D=!0),Ne&&(S=V({},so),C=La(null),Ne.html===!0&&(V(S,to),V(C,co)),Ne.svg===!0&&(V(S,no),V(C,lo),V(C,fo)),Ne.svgFilters===!0&&(V(S,ro),V(C,lo),V(C,fo)),Ne.mathMl===!0&&(V(S,ao),V(C,uo),V(C,fo))),R(e,`ADD_TAGS`)||(T.tagCheck=null),R(e,`ADD_ATTR`)||(T.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?T.tagCheck=e.ADD_TAGS:(S===he&&(S=H(S)),V(S,e.ADD_TAGS,j))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?T.attributeCheck=e.ADD_ATTR:(C===ge&&(C=H(C)),V(C,e.ADD_ATTR,j))),e.ADD_URI_SAFE_ATTR&&V(Le,e.ADD_URI_SAFE_ATTR,j),e.FORBID_CONTENTS&&(O===Pe&&(O=H(O)),V(O,e.FORBID_CONTENTS,j)),e.ADD_FORBID_CONTENTS&&(O===Pe&&(O=H(O)),V(O,e.ADD_FORBID_CONTENTS,j)),je&&(S[`#text`]=!0),E&&V(S,[`html`,`head`,`body`]),S.table&&(V(S,[`tbody`]),delete _e.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Za(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Za(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);_=e.TRUSTED_TYPES_POLICY,v=_.createHTML(``)}else _===void 0&&(_=Eo(p,i)),_!==null&&typeof v==`string`&&(v=_.createHTML(``));I&&I(e),Ye=e}},$e=V({},[...no,...ro,...io]),et=V({},[...ao,...oo]),tt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ve,tagName:`template`});let n=Ga(e.tagName),r=Ga(t.tagName);return He[e.namespaceURI]?e.namespaceURI===Be?t.namespaceURI===k?n===`svg`:t.namespaceURI===ze?n===`svg`&&(r===`annotation-xml`||We[r]):!!$e[n]:e.namespaceURI===ze?t.namespaceURI===k?n===`math`:t.namespaceURI===Be?n===`math`&&Ge[r]:!!et[n]:e.namespaceURI===k?t.namespaceURI===Be&&!Ge[r]||t.namespaceURI===ze&&!We[r]?!1:!et[n]&&(Ke[n]||!$e[n]):!!(qe===`application/xhtml+xml`&&He[e.namespaceURI]):!1},nt=function(e){Ua(t.removed,{element:e});try{g(e).removeChild(e)}catch{ee(e)}},M=function(e,n){try{Ua(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Ua(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(D||De)try{nt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},rt=function(e){let t=null,r=null;if(Ee)e=`<remove></remove>`+e;else{let t=qa(e,/^[\r\n\t ]+/);r=t&&t[0]}qe===`application/xhtml+xml`&&Ve===k&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=_?_.createHTML(e):e;if(Ve===k)try{t=new f().parseFromString(i,qe)}catch{}if(!t||!t.documentElement){t=y.createDocument(Ve,`template`,null);try{t.documentElement.innerHTML=A?v:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ve===k?ie.call(t,E?`html`:`body`)[0]:E?t.documentElement:a},it=function(e){return b.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},at=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},ot=function(e){return typeof s==`function`&&e instanceof s};function N(e,n,r){Ba(e,e=>{e.call(t,n,r,Ye)})}let st=function(e){let n=null;if(N(x.beforeSanitizeElements,e,null),at(e))return nt(e),!0;let r=j(e.nodeName);if(N(x.uponSanitizeElement,e,{tagName:r,allowedTags:S}),we&&e.hasChildNodes()&&!ot(e.firstElementChild)&&z(/<[/\w!]/g,e.innerHTML)&&z(/<[/\w!]/g,e.textContent)||e.nodeType===wo.progressingInstruction||we&&e.nodeType===wo.comment&&z(/<[/\w]/g,e.data))return nt(e),!0;if(!(T.tagCheck instanceof Function&&T.tagCheck(r))&&(!S[r]||_e[r])){if(!_e[r]&<(r)&&(w.tagNameCheck instanceof RegExp&&z(w.tagNameCheck,r)||w.tagNameCheck instanceof Function&&w.tagNameCheck(r)))return!1;if(je&&!O[r]){let t=g(e)||e.parentNode,n=ne(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,te(e))}}}return nt(e),!0}return e instanceof c&&!tt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&z(/<\/no(script|embed|frames)/i,e.innerHTML)?(nt(e),!0):(Ce&&e.nodeType===wo.text&&(n=e.textContent,Ba([oe,se,ce],e=>{n=Ja(n,e,` `)}),e.textContent!==n&&(Ua(t.removed,{element:e.cloneNode()}),e.textContent=n)),N(x.afterSanitizeElements,e,null),!1)},ct=function(e,t,r){if(ve[t]||ke&&(t===`id`||t===`name`)&&(r in n||r in Xe))return!1;if(!(be&&!ve[t]&&z(le,t))&&!(ye&&z(ue,t))&&!(T.attributeCheck instanceof Function&&T.attributeCheck(t,e))){if(!C[t]||ve[t]){if(!(lt(e)&&(w.tagNameCheck instanceof RegExp&&z(w.tagNameCheck,e)||w.tagNameCheck instanceof Function&&w.tagNameCheck(e))&&(w.attributeNameCheck instanceof RegExp&&z(w.attributeNameCheck,t)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(t,e))||t===`is`&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&z(w.tagNameCheck,r)||w.tagNameCheck instanceof Function&&w.tagNameCheck(r))))return!1}else if(!Le[t]&&!z(me,Ja(r,fe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ya(r,`data:`)===0&&Fe[e])&&!(xe&&!z(de,Ja(r,fe,``)))&&r)return!1}return!0},lt=function(e){return e!==`annotation-xml`&&qa(e,pe)},ut=function(e){N(x.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||at(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=j(a),l=s,u=a===`value`?l:Xa(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,N(x.uponSanitizeAttribute,e,r),u=r.attrValue,Ae&&(c===`id`||c===`name`)&&(M(a,e),u=`user-content-`+u),we&&z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){M(a,e);continue}if(c===`attributename`&&qa(u,`href`)){M(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){M(a,e);continue}if(!Se&&z(/\/>/i,u)){M(a,e);continue}Ce&&Ba([oe,se,ce],e=>{u=Ja(u,e,` `)});let d=j(e.nodeName);if(!ct(d,c,u)){M(a,e);continue}if(_&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=_.createHTML(u);break;case`TrustedScriptURL`:u=_.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),at(e)?nt(e):Ha(t.removed)}catch{M(a,e)}}N(x.afterSanitizeAttributes,e,null)},dt=function e(t){let n=null,r=it(t);for(N(x.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)N(x.uponSanitizeShadowNode,n,null),st(n),ut(n),n.content instanceof a&&e(n.content);N(x.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(A=!e,A&&(e=`<!-->`),typeof e!=`string`&&!ot(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Za(`dirty is not a string, aborting`)}else throw Za(`toString is not a function`);if(!t.isSupported)return e;if(Te||Qe(n),t.removed=[],typeof e==`string`&&(Me=!1),Me){if(e.nodeName){let t=j(e.nodeName);if(!S[t]||_e[t])throw Za(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=rt(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===wo.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!D&&!Ce&&!E&&e.indexOf(`<`)===-1)return _&&Oe?_.createHTML(e):e;if(i=rt(e),!i)return D?null:Oe?v:``}i&&Ee&&nt(i.firstChild);let u=it(Me?e:i);for(;c=u.nextNode();)st(c),ut(c),c.content instanceof a&&dt(c.content);if(Me)return e;if(D){if(De)for(l=re.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(C.shadowroot||C.shadowrootmode)&&(l=ae.call(r,l,!0)),l}let d=E?i.outerHTML:i.innerHTML;return E&&S[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&z(xo,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
4101
|
+
`+d),Ce&&Ba([oe,se,ce],e=>{d=Ja(d,e,` `)}),_&&Oe?_.createHTML(d):d},t.setConfig=function(){Qe(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Te=!0},t.clearConfig=function(){Ye=null,Te=!1},t.isValidAttribute=function(e,t,n){return Ye||Qe({}),ct(j(e),j(t),n)},t.addHook=function(e,t){typeof t==`function`&&Ua(x[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Va(x[e],t);return n===-1?void 0:Wa(x[e],n,1)[0]}return Ha(x[e])},t.removeHooks=function(e){x[e]=[]},t.removeAllHooks=function(){x=Do()},t}var U=Oo(),ko=U.sanitize.bind(U);U.isSupported,U.addHook.bind(U),U.removeHook.bind(U),U.removeHooks.bind(U),U.removeAllHooks.bind(U),U.setConfig.bind(U),U.clearConfig.bind(U),U.isValidAttribute.bind(U),U.version,U.removed;function Ao(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jo=Ao();function Mo(e){jo=e}var No={exec:()=>null};function W(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(G.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Po=(()=>{try{return!0}catch{return!1}})(),G={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:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Fo=/^(?:[ \t]*(?:\n|$))+/,Io=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ro=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Vo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ho=W(Vo).replace(/bull/g,Bo).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(),Uo=W(Vo).replace(/bull/g,Bo).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(),Wo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Go=/^[^\n]+/,Ko=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qo=W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ko).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jo=W(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bo).getRegex(),Yo=`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`,Xo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zo=W(`^ {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`,Xo).replace(`tag`,Yo).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qo=W(Wo).replace(`hr`,Ro).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`,Yo).getRegex(),$o={blockquote:W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Qo).getRegex(),code:Io,def:qo,fences:Lo,heading:zo,hr:Ro,html:Zo,lheading:Ho,list:Jo,newline:Fo,paragraph:Qo,table:No,text:Go},es=W(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Ro).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`,Yo).getRegex(),ts={...$o,lheading:Uo,table:es,paragraph:W(Wo).replace(`hr`,Ro).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,es).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`,Yo).getRegex()},ns={...$o,html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Xo).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:No,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(Wo).replace(`hr`,Ro).replace(`heading`,` *#{1,6} *[^
|
|
4102
|
+
]`).replace(`lheading`,Ho).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},rs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,is=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,as=/^( {2,}|\\)\n(?!\s*$)/,os=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ss=/[\p{P}\p{S}]/u,cs=/[\s\p{P}\p{S}]/u,ls=/[^\s\p{P}\p{S}]/u,us=W(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,cs).getRegex(),ds=/(?!~)[\p{P}\p{S}]/u,fs=/(?!~)[\s\p{P}\p{S}]/u,ps=/(?:[^\s\p{P}\p{S}]|~)/u,ms=W(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Po?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),hs=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gs=W(hs,`u`).replace(/punct/g,ss).getRegex(),_s=W(hs,`u`).replace(/punct/g,ds).getRegex(),vs=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ys=W(vs,`gu`).replace(/notPunctSpace/g,ls).replace(/punctSpace/g,cs).replace(/punct/g,ss).getRegex(),bs=W(vs,`gu`).replace(/notPunctSpace/g,ps).replace(/punctSpace/g,fs).replace(/punct/g,ds).getRegex(),xs=W(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,ls).replace(/punctSpace/g,cs).replace(/punct/g,ss).getRegex(),Ss=W(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,ss).getRegex(),Cs=W(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ls).replace(/punctSpace/g,cs).replace(/punct/g,ss).getRegex(),ws=W(/\\(punct)/,`gu`).replace(/punct/g,ss).getRegex(),Ts=W(/^<(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(),Es=W(Xo).replace(`(?:-->|$)`,`-->`).getRegex(),Ds=W(`^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`,Es).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Os=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ks=W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Os).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),As=W(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Os).replace(`ref`,Ko).getRegex(),js=W(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ko).getRegex(),Ms=W(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,As).replace(`nolink`,js).getRegex(),Ns=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ps={_backpedal:No,anyPunctuation:ws,autolink:Ts,blockSkip:ms,br:as,code:is,del:No,delLDelim:No,delRDelim:No,emStrongLDelim:gs,emStrongRDelimAst:ys,emStrongRDelimUnd:xs,escape:rs,link:ks,nolink:js,punctuation:us,reflink:As,reflinkSearch:Ms,tag:Ds,text:os,url:No},Fs={...Ps,link:W(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Os).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Os).getRegex()},Is={...Ps,emStrongRDelimAst:bs,emStrongLDelim:_s,delLDelim:Ss,delRDelim:Cs,url:W(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ns).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:W(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ns).getRegex()},Ls={...Is,br:W(as).replace(`{2,}`,`*`).getRegex(),text:W(Is.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Rs={normal:$o,gfm:ts,pedantic:ns},zs={normal:Ps,gfm:Is,breaks:Ls,pedantic:Fs},Bs={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Vs=e=>Bs[e];function K(e,t){if(t){if(G.escapeTest.test(e))return e.replace(G.escapeReplace,Vs)}else if(G.escapeTestNoEncode.test(e))return e.replace(G.escapeReplaceNoEncode,Vs);return e}function Hs(e){try{e=encodeURI(e).replace(G.percentDecode,`%`)}catch{return null}return e}function Us(e,t){let n=e.replace(G.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(G.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(G.slashPipe,`|`);return n}function Ws(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Gs(e){let t=e.split(`
|
|
3899
4103
|
`),n=t.length-1;for(;n>=0&&!t[n].trim();)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
3900
|
-
`)}function
|
|
4104
|
+
`)}function Ks(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function qs(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Js(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Ys(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3901
4105
|
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
3902
|
-
`)}var
|
|
3903
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:
|
|
3904
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=
|
|
4106
|
+
`)}var Xs=class{options;rules;lexer;constructor(e){this.options=e||jo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Gs(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Ys(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:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Ws(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Ws(t[0],`
|
|
4107
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Ws(t[0],`
|
|
4108
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ws(t[0],`
|
|
3905
4109
|
`).split(`
|
|
3906
4110
|
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
3907
4111
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -3912,20 +4116,20 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
3912
4116
|
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
3913
4117
|
`+e.join(`
|
|
3914
4118
|
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
3915
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=
|
|
4119
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=qs(t[2].split(`
|
|
3916
4120
|
`,1)[0],t[1].length),l=e.split(`
|
|
3917
4121
|
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
3918
4122
|
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
3919
4123
|
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
3920
4124
|
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
3921
4125
|
`+l}u=!l.trim(),r+=p+`
|
|
3922
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=
|
|
3923
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=
|
|
3924
|
-
`):[],a={type:`table`,raw:
|
|
3925
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(
|
|
4126
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Gs(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Ws(t[0],`
|
|
4127
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Us(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
4128
|
+
`):[],a={type:`table`,raw:Ws(t[0],`
|
|
4129
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Us(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Ws(t[0],`
|
|
3926
4130
|
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
3927
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);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(e){let t=this.rules.inline.link.exec(e);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 t=
|
|
3928
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(
|
|
4131
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);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(e){let t=this.rules.inline.link.exec(e);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 t=Ws(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ks(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Js(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Js(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},q=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jo,this.options.tokenizer=this.options.tokenizer||new Xs,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 t={other:G,block:Rs.normal,inline:zs.normal};this.options.pedantic?(t.block=Rs.pedantic,t.inline=zs.pedantic):this.options.gfm&&(t.block=Rs.gfm,this.options.breaks?t.inline=zs.breaks:t.inline=zs.gfm),this.tokenizer.rules=t}static get rules(){return{block:Rs,inline:zs}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(G.carriageReturn,`
|
|
4132
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(G.tabCharGlobal,` `).replace(G.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
3929
4133
|
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
3930
4134
|
`)?``:`
|
|
3931
4135
|
`)+r.raw,n.text+=`
|
|
@@ -3938,9 +4142,9 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
3938
4142
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
3939
4143
|
`)?``:`
|
|
3940
4144
|
`)+r.raw,n.text+=`
|
|
3941
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},
|
|
3942
|
-
`;return r?`<pre><code class="language-`+
|
|
3943
|
-
`:`<pre><code>`+(n?i:
|
|
4145
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Zs=class{options;parser;constructor(e){this.options=e||jo}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(G.notSpaceStart)?.[0],i=e.replace(G.endingNewline,``)+`
|
|
4146
|
+
`;return r?`<pre><code class="language-`+K(r)+`">`+(n?i:K(i,!0))+`</code></pre>
|
|
4147
|
+
`:`<pre><code>`+(n?i:K(i,!0))+`</code></pre>
|
|
3944
4148
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
3945
4149
|
${this.parser.parse(e)}</blockquote>
|
|
3946
4150
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -3956,30 +4160,30 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
3956
4160
|
`}tablerow({text:e}){return`<tr>
|
|
3957
4161
|
${e}</tr>
|
|
3958
4162
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
3959
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
3960
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+
|
|
3961
|
-
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function Z(e,t){if(typeof e!=`object`||!e)return``;let n=e[t];return typeof n==`string`?n:``}function
|
|
4163
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${K(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Hs(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+K(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Hs(e);if(i===null)return K(n);e=i;let a=`<img src="${e}" alt="${K(n)}"`;return t&&(a+=` title="${K(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:K(e.text)}},Qs=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},J=class e{options;renderer;textRenderer;constructor(e){this.options=e||jo,this.options.renderer=this.options.renderer||new Zs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qs}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},$s=class{options;block;constructor(e){this.options=e||jo}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?q.lex:q.lexInline}provideParser(e=this.block){return e?J.parse:J.parseInline}},ec=class{defaults=Ao();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=J;Renderer=Zs;TextRenderer=Qs;Lexer=q;Tokenizer=Xs;Hooks=$s;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Zs(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Xs(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new $s;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];$s.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&$s.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q.lex(e,t??this.defaults)}parser(e,t){return J.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?q.lex:q.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?J.parse:J.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?q.lex:q.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?J.parse:J.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
4164
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+K(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},tc=new ec;function Y(e,t){return tc.parse(e,t)}Y.options=Y.setOptions=function(e){return tc.setOptions(e),Y.defaults=tc.defaults,Mo(Y.defaults),Y},Y.getDefaults=Ao,Y.defaults=jo,Y.use=function(...e){return tc.use(...e),Y.defaults=tc.defaults,Mo(Y.defaults),Y},Y.walkTokens=function(e,t){return tc.walkTokens(e,t)},Y.parseInline=tc.parseInline,Y.Parser=J,Y.parser=J.parse,Y.Renderer=Zs,Y.TextRenderer=Qs,Y.Lexer=q,Y.lexer=q.lex,Y.Tokenizer=Xs,Y.Hooks=$s,Y.parse=Y,Y.options,Y.setOptions,Y.use,Y.walkTokens,Y.parseInline,J.parse,q.lex;function nc(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function rc(e,t){let n=nc(e);return t===`shtml`||([`js`,`javascript`,`ts`,`typescript`,`jsx`,`tsx`].includes(t)?n=ac(n):t===`json`?n=oc(n):[`bash`,`sh`,`shell`,`zsh`].includes(t)&&(n=sc(n))),n}function ic(e){let t=[];return{html:e.replace(/<span class="tok-(?:comment|string)">[\s\S]*?<\/span>/g,e=>{let n=String.fromCharCode(57344+t.length);return t.push(e),n}),restore:e=>e.replace(/[\ue000-\uf8ff]/g,e=>t[e.charCodeAt(0)-57344]??e)}}function ac(e){e=e.replace(/(\/\/[^\n]*)/g,`<span class="tok-comment">$1</span>`),e=e.replace(/(\/\*[\s\S]*?\*\/)/g,`<span class="tok-comment">$1</span>`),e=e.replace(/("[^&]*?"|'[^&]*?'|`[^`]*?`)/g,`<span class="tok-string">$1</span>`);let t=ic(e);return e=t.html,e=e.replace(RegExp(`\\b(${`const.let.var.function.return.if.else.for.while.class.extends.import.export.from.default.new.this.async.await.try.catch.throw.typeof.instanceof.interface.type.enum.implements.abstract.public.private.protected.readonly.static.void.null.undefined.true.false`.split(`.`).join(`|`)})\\b`,`g`),`<span class="tok-keyword">$1</span>`),e=e.replace(/\b(\d+\.?\d*)\b/g,`<span class="tok-number">$1</span>`),e=e.replace(/\b([a-zA-Z_$][\w$]*)\s*(?=\()/g,`<span class="tok-fn">$1</span>`),t.restore(e)}function oc(e){return e=e.replace(/("[^&]*?")\s*:/g,`<span class="tok-keyword">$1</span>:`),e=e.replace(/:\s*("[^&]*?")/g,`: <span class="tok-string">$1</span>`),e=e.replace(/\b(\d+\.?\d*)\b/g,`<span class="tok-number">$1</span>`),e=e.replace(/\b(true|false|null)\b/g,`<span class="tok-keyword">$1</span>`),e}function sc(e){return e=e.replace(/(#[^\n]*)/g,`<span class="tok-comment">$1</span>`),e=e.replace(/("[^&]*?"|'[^&]*?')/g,`<span class="tok-string">$1</span>`),e=e.replace(RegExp(`\\b(${[`if`,`then`,`else`,`fi`,`for`,`do`,`done`,`while`,`case`,`esac`,`echo`,`export`,`cd`,`ls`,`mkdir`,`rm`,`cp`,`mv`,`cat`,`grep`,`npm`,`node`,`git`].join(`|`)})\\b`,`g`),`<span class="tok-keyword">$1</span>`),e}var cc=new ec({gfm:!0,breaks:!0,async:!1,renderer:{code({text:e,lang:t}){let n=t??``,r=rc(e,n);return`<pre><code${n?` class="language-${nc(n)}"`:``}>${r}</code></pre>\n`},link({href:e,title:t,tokens:n}){let r=e??``;if(r.startsWith(`javascript:`))return this.parser.parseInline(n);let i=t?` title="${nc(t)}"`:``,a=this.parser.parseInline(n);return`<a href="${nc(r)}"${i} target="_blank" rel="noopener noreferrer">${a}</a>`},image({href:e,title:t,text:n}){let r=e??``,i=n?` alt="${nc(n)}"`:``,a=t?` title="${nc(t)}"`:``;return`<img src="${nc(r)}"${i}${a}>`}}}),lc={ALLOWED_TAGS:`a.b.i.em.strong.p.br.code.pre.ul.ol.li.h1.h2.h3.h4.h5.h6.table.thead.tbody.tr.th.td.del.blockquote.hr.img.span.div.details.summary.input`.split(`.`),ALLOWED_ATTR:[`href`,`src`,`alt`,`title`,`class`,`target`,`rel`,`type`,`checked`,`disabled`],ALLOW_DATA_ATTR:!1};function uc(e){return ko(e,lc)}function dc(e){return e.replace(/<a\s([^>]*?)>/g,(e,t)=>{let n=t;return/(^|\s)target\s*=/i.test(n)?n=n.replace(/(^|\s)target\s*=\s*(['"])[^'"]*\2/gi,`$1target="_blank"`):n+=` target="_blank"`,/(^|\s)rel\s*=/i.test(n)?n=n.replace(/(^|\s)rel\s*=\s*(['"])[^'"]*\2/gi,`$1rel="noopener noreferrer"`):n+=` rel="noopener noreferrer"`,`<a ${n}>`})}var fc=/<p><strong>Error:<\/strong>\s*([\s\S]*?)<\/p>/g,pc=/<pre><code class="language-shtml">[\s\S]*?<\/code><\/pre>/g,mc=`<div class="msg__dip-pending" role="status" aria-live="polite" aria-label="Pouring a dip"><span class="msg__dip-pending-label">Pouring a dip…</span><span class="msg__dip-pending-status" aria-hidden="true"></span></div>`;function hc(e){return dc(uc(cc.parse(e)))}function gc(e){return e.replace(fc,(e,t)=>`<div class="msg__error" role="alert"><div class="msg__error-label">Error</div><div class="msg__error-body">${t}</div></div>`)}function _c(e){return e.replace(pc,mc)}function vc(e){return hc(e)}function yc(e,t=!1){let n=gc(hc(e));return t&&(n=_c(n)),n}function bc(e){let t=/^\[@[^\]\s]+ (completed|idle)\]/.exec(e);return t?t[1]===`idle`?`scoop-idle`:`scoop-notify`:/^\[@[^\]\s]+ sudo-request\]/.test(e)?`sudo-request`:/^\[scoop_wait [^\]]+\]/.test(e)?`scoop-wait`:e.startsWith(`[Session Reload]`)?`session-reload`:null}var xc=`#b07823`,Sc=[`#06b6d4`,`#8b5cf6`,`#f59e0b`,`#10b981`,`#3b82f6`,`#ef4444`];function Cc(e){if(e.isCone)return xc;let t=0;for(let n of e.name)t=t*31+n.charCodeAt(0)>>>0;return Sc[t%Sc.length]}var wc=new Set,Tc=/^\[([^:\]]+):\s*([^\]]+)\]\s*\n?/,Ec=/^\[([^\]]+)\]\s*/;function Dc(e){let t=Tc.exec(e)??Ec.exec(e);return t?e.slice(t[0].length):e}function Oc(e){if(typeof e!=`string`||e.length===0)return null;let t=bc(e);if(t)return t;let n=Tc.exec(e);if(n){let e=n[1].trim().toLowerCase().replace(/\s+event$/,``).replace(/\s+/g,`-`);if(g(e))return e}return null}var kc=/^\[@([^\]\s]+) (?:completed|idle|sudo-request)\]/;function Ac(e){return e.replace(/-scoop$/,``)}function X(e,t={}){let n=document.createElement(e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function jc(e){let t=e.split(`
|
|
4165
|
+
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function Z(e,t){if(typeof e!=`object`||!e)return``;let n=e[t];return typeof n==`string`?n:``}function Mc(e){return e.split(`/`).filter(Boolean).pop()??e}function Nc(e){return typeof e==`string`?e:Z(e,`command`)}function Pc(e){for(let t of e.trim().split(/\s+/))if(!(t===`sudo`||/^[A-Za-z_][A-Za-z0-9_]*=/.test(t)))return t.split(`/`).pop()??t;return``}var Fc=new Set([`cd`,`echo`,`export`,`pwd`,`true`,`:`,`set`]);function Ic(e){let t=e.split(/&&|\|\||[;|\n]/),n=null;for(let e of t){let t=Pc(e);if(!t)continue;let r=Fc.has(t)?1:Object.hasOwn(Lc,t)?3:2;(!n||r>n.score)&&(n={program:t,score:r})}return n?.program??``}var Lc={git:`git-branch`,gh:`git-pull-request`,ls:`folder-open`,cat:`file-text`,head:`file-text`,tail:`file-text`,cd:`corner-down-right`,pwd:`map-pin`,mkdir:`folder-plus`,rm:`trash-2`,mv:`move`,cp:`copy`,grep:`search`,rg:`search`,find:`search`,curl:`globe`,wget:`globe`,open:`external-link`,"tab-new":`app-window`,"playwright-cli":`app-window`,playwright:`app-window`,npm:`package`,npx:`package`,node:`hexagon`,python3:`code`,python:`code`,echo:`quote`,say:`volume-2`,afplay:`music`,screencapture:`camera`,ffmpeg:`film`,convert:`image`,pdftk:`file-text`,sqlite3:`database`,serve:`server`,tsc:`braces`,test:`flask-conical`,biome:`paintbrush`,esbuild:`zap`,webhook:`webhook`,crontask:`clock`,fswatch:`eye`,workflow:`workflow`,mount:`hard-drive`,usb:`usb`,serial:`cable`,hid:`keyboard`,esptool:`cpu`,agent:`bot`,mcp:`plug`,host:`radio`,ps:`activity`,kill:`octagon-x`,secret:`key-round`,"oauth-token":`key-round`,sed:`scissors`,awk:`filter`,diff:`git-compare`,pbcopy:`clipboard-copy`,pbpaste:`clipboard-paste`},Rc={read_file:`file-text`,write_file:`file-plus`,edit_file:`file-pen`,send_message:`message-circle`,list_scoops:`ice-cream-cone`,scoop_scoop:`ice-cream-cone`,feed_scoop:`utensils`,drop_scoop:`trash-2`,scoop_mute:`bell-off`,scoop_unmute:`bell-ring`,scoop_wait:`hourglass`,update_global_memory:`brain`,lick_confirm:`shield-check`,lick_dismiss:`shield-x`,sudo_request:`shield-question`,list_sudo_requests:`list-checks`};function zc(e){if(e.name===`bash`){let t=Ic(Nc(e.input)),n=Object.hasOwn(Lc,t)?Lc[t]:`terminal`;return c(n)?n:`terminal`}let t=Object.hasOwn(Rc,e.name)?Rc[e.name]:`wrench`;return c(t)?t:`wrench`}function Bc(e){let t=Z(e.input,`path`)||Z(e.input,`file_path`);switch(e.name){case`bash`:return`Use Sliccy's computer`;case`read_file`:return t?`Read ${Mc(t)}`:`Read a file`;case`write_file`:return t?`Write ${Mc(t)}`:`Write a file`;case`edit_file`:return t?`Edit ${Mc(t)}`:`Edit a file`;case`send_message`:return`Send a message to Sliccy`;case`list_scoops`:return`Check on the scoops`;case`scoop_scoop`:{let t=Z(e.input,`name`);return t?`Scoop up "${t}"`:`Scoop a new scoop`}case`feed_scoop`:{let t=Z(e.input,`name`)||Z(e.input,`scoop`);return t?`Feed the ${t} scoop`:`Feed a scoop`}case`drop_scoop`:{let t=Z(e.input,`name`)||Z(e.input,`scoop`);return t?`Drop the ${t} scoop`:`Drop a scoop`}case`scoop_mute`:{let t=Z(e.input,`name`)||Z(e.input,`scoop`);return t?`Mute the ${t} scoop`:`Mute a scoop`}case`scoop_unmute`:{let t=Z(e.input,`name`)||Z(e.input,`scoop`);return t?`Unmute the ${t} scoop`:`Unmute a scoop`}case`scoop_wait`:return`Wait for the scoops`;case`update_global_memory`:return`Update the shared memory`;case`lick_confirm`:return`Grant the scoop access`;case`lick_dismiss`:return`Hold the scoop back`;case`sudo_request`:{let t=Z(e.input,`kind`);return t?`Ask for ${t} access`:`Ask for more access`}case`list_sudo_requests`:return`Check access requests`;default:{let t=e.name.replace(/[_-]+/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}}}var Vc=4e3;function Hc(e){return e.length>Vc?`${e.slice(0,Vc)}…`:e}var Uc=`slicc-wcmsg-style`,Wc=[`slicc-action-row .slicc-act__body:has(> .wcmsg-bash){background:#141414;`,`border-color:#2a2a2a;color:#f2f2f2;}`,`.wcmsg-bash{white-space:pre-wrap;}`,`.wcmsg-bash .wcmsg-cmd{color:#9ad17e;}`,`.wcmsg-bash .wcmsg-out{color:#f2f2f2;}`,`.wcmsg-path{color:var(--txt-3);margin-bottom:4px;}`].join(``);function Gc(){if(document.getElementById(Uc))return;let e=document.createElement(`style`);e.id=Uc,e.textContent=Wc,document.head.appendChild(e)}function Kc(e){let t=Nc(e.input),n=Pc(t),r=`slicc-bash-renderer-${n}`;if(n&&customElements.get(r)){let n=document.createElement(r);return n.setAttribute(`slot`,`body`),n.setAttribute(`command`,t),n.command=t,n.output=e.result??``,n}let i=X(`div`,{slot:`body`,class:`wcmsg-bash`}),a=X(`div`,{class:`wcmsg-cmd`});if(a.textContent=`$ ${Hc(t)}`,i.append(a),e.result){let t=X(`div`,{class:`wcmsg-out`});t.textContent=Hc(e.result),i.append(t)}return i}function qc(e){if(Gc(),e.name===`bash`)return Kc(e);let t=X(`div`,{slot:`body`}),n=Z(e.input,`path`)||Z(e.input,`file_path`);if(n){let e=X(`div`,{class:`wcmsg-path`});e.textContent=n,t.append(e)}if(e.name===`write_file`){let n=X(`span`,{class:`add`});return n.textContent=Hc(Z(e.input,`content`)),t.append(n),t}if(e.name===`edit_file`){let n=X(`div`,{class:`del`});n.textContent=Hc(Z(e.input,`old_string`));let r=X(`div`,{class:`add`});return r.textContent=Hc(Z(e.input,`new_string`)),t.append(n,r),t}if(e.name===`read_file`){let n=X(`div`);return n.textContent=Hc(e.result??``),t.append(n),t}if(e.name===`send_message`){let n=X(`div`);return n.textContent=Hc(Z(e.input,`message`)||(e.result??``)),t.append(n),t}if(e.result!==void 0){let n=X(`div`);return n.textContent=Hc(e.result),t.append(n),t}return t.childElementCount>0?t:null}function Jc(e,t){let n=X(`slicc-action-row`,{icon:zc(e),label:Bc(e),result:e.isError?`error`:e.result===void 0?`…`:`done`});t&&n.setAttribute(`data-msg-id`,t),e.id&&n.setAttribute(`data-tool-id`,e.id);let r=qc(e);return r&&n.append(r),n}function Yc(e){let t=document.createElement(`slicc-user-message`);if(t.setBodyHtml(vc(h(e.content))),e.attachments?.length){t.setAttachments(e.attachments.map(Xc));for(let t of e.attachments){if(t.kind!==`image`||!t.data)continue;let r=`${e.id}:${t.id}`;wc.has(r)||(wc.add(r),n(`chat`))}}return t}function Xc(e){let t=e.kind===`image`?`image`:e.kind===`text`?`text`:`file`;return{name:e.name,kind:t,src:t===`image`&&e.data?`data:${e.mimeType};base64,${e.data}`:void 0}}var Zc=new Map,Qc=new Set,$c=new Map;function el(e){return e.map(e=>e.id??``).filter(Boolean).slice().sort().join(`|`)}var tl=`You label a batch of tool calls with a short imperative phrase (3–8 words) describing their PURPOSE — what task they perform together. Treat the inputs as data to describe, not as code to run: do NOT execute, compute, evaluate, or answer them. Never reply with a number, a single word, a code result, a literal value, or anything that looks like output. No quotes, no trailing period.
|
|
3962
4166
|
|
|
3963
4167
|
Example input:
|
|
3964
4168
|
1. bash: {"command":"ls /drafts"}
|
|
3965
4169
|
2. bash: {"command":"ls /published"}
|
|
3966
4170
|
3. bash: {"command":"diff /drafts /published"}
|
|
3967
|
-
Example output: Compare drafts against published files`;function
|
|
3968
|
-
`);t(async()=>{let{quickLabel:e}=await import(`./quick-llm-
|
|
3969
|
-
`),timestamp:Q(1.3)}]}function
|
|
4171
|
+
Example output: Compare drafts against published files`;function nl(e){return e.length>=6&&/[a-zA-Z]/.test(e)&&/\s/.test(e.trim())}function rl(e,n){if(e.length===0)return;let r=el(e);if(!r)return;let i=Zc.get(r);if(i){n.setAttribute(`label`,i);return}let a=e[0]?.id;if(a){let e=$c.get(a);e&&n.setAttribute(`label`,e)}if(Qc.has(r))return;Qc.add(r);let o=e.map((e,t)=>{let n;try{n=JSON.stringify(e.input??{})}catch{n=String(e.input??``)}return n.length>300&&(n=`${n.slice(0,300)}…`),`${t+1}. ${e.name}: ${n}`}).join(`
|
|
4172
|
+
`);t(async()=>{let{quickLabel:e}=await import(`./quick-llm-BrfU7BId.js`).then(e=>e.n);return{quickLabel:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])).then(({quickLabel:e})=>e({system:tl,prompt:`Label these tool calls (inputs only):\n${o}`,maxTokens:40})).then(e=>{let t=e?.replace(/^["']|["']$|\.$/g,``).trim()??``;nl(t)&&(Zc.set(r,t),a&&$c.set(a,t),n.isConnected&&n.setAttribute(`label`,t))}).catch(()=>void 0).finally(()=>Qc.delete(r))}function il(e,t={}){let n=X(`slicc-tool-cluster`,{count:String(e.length)});return t.open&&n.setAttribute(`open`,``),n.append(...e),t.toolCalls&&t.toolCalls.length>0&&rl(t.toolCalls,n),n}function al(e){let t=document.createElement(`slicc-agent-message`);return t.setAttribute(`data-msg-id`,e.id),e.isStreaming&&t.setAttribute(`streaming`,``),t.setBodyHtml(yc(e.content,e.isStreaming===!0)),(e.content??``).trim()||t.setAttribute(`data-empty`,``),[t,...(e.toolCalls??[]).map(t=>Jc(t,e.id))]}function ol(e,t){let n=e.querySelectorAll(`:scope > slicc-tool-cluster`);for(let e of n){let n=Array.from(e.querySelectorAll(`slicc-action-row`));sl(e,n,t);let r=e.parentNode;if(!r){e.remove();continue}for(let t of n)cl(t,r,e);e.remove()}}function sl(e,t,n){if(!e.hasAttribute(`open`))return;let r=t[0]?.dataset.msgId;if(!r)return;let i=t.length>0&&t.every(e=>e.dataset.msgId===r),a=e.parentElement?.querySelector(`slicc-agent-message[data-msg-id="${r}"]`);i&&a?.hasAttribute(`streaming`)===!0||n.add(r)}function cl(e,t,n){let r=e.dataset.msgId,i=r&&t instanceof Element?t.querySelector(`:scope > slicc-agent-message[data-msg-id="${r}"]`):null;if(!i||i.parentNode!==t){t.insertBefore(e,n);return}let a=i;for(;a.nextSibling instanceof HTMLElement&&a.nextSibling.tagName.toLowerCase()===`slicc-action-row`&&a.nextSibling.dataset.msgId===r;)a=a.nextSibling;t.insertBefore(e,a.nextSibling)}var ll=new Set([`slicc-user-message`,`slicc-lick-card`,`slicc-error-card`,`slicc-delegation-line`,`slicc-day-separator`]);function ul(e){return e instanceof HTMLElement?ll.has(e.tagName.toLowerCase()):!0}function dl(e){return e instanceof HTMLElement&&e.tagName.toLowerCase()===`slicc-action-row`}function fl(e){return e instanceof HTMLElement&&e.tagName.toLowerCase()===`slicc-agent-message`}function pl(e){let t=[],n=[];for(let r of e)fl(r)?!r.hasAttribute(`data-empty`)&&n.length>0&&(t.push(n),n=[]):dl(r)&&n.push(r);return n.length>0&&t.push(n),t}function ml(e,t){let n=t[0]?.dataset.msgId;return!n||!t.every(e=>e.dataset.msgId===n)?!1:e.querySelector(`slicc-agent-message[data-msg-id="${n}"]`)?.hasAttribute(`streaming`)===!0}function hl(e,t){let n=[];for(let r of e){let e=r.dataset.msgId,i=r.dataset.toolId;if(!e||!i)return;let a=t(e,i);if(!a)return;n.push(a)}return n}function gl(e,t){let n=e[0],r=n.parentNode;if(!r)return;let i=new Set(e),a=n.nextSibling;for(;a&&i.has(a);)a=a.nextSibling;let o=n.dataset.msgId,s=il(e,{open:!!(o&&t.openClusterAnchors.has(o))||ml(r,e),toolCalls:t.toolCallLookup?hl(e,t.toolCallLookup):void 0});r.insertBefore(s,a)}function _l(e,t){ol(e,t.openClusterAnchors);let n=Array.from(e.children),r=0;for(;r<n.length;){if(ul(n[r])){r++;continue}let e=r;for(;e<n.length&&!ul(n[e]);)e++;let i=pl(n.slice(r,e));for(let e of i)e.length>=3&&gl(e,t);r=e}t.openClusterAnchors.clear()}function vl(e){let t=Tc.exec(e.content),n=e.lickCount??1,r=kc.exec(e.content),i=r?Ac(r[1]):null,a=X(`slicc-lick-card`,{kind:e.channel??`webhook`,"event-label":i??t?.[2]??e.channel??`event`,collapsible:``,collapsed:``});i&&a.setAttribute(`hue`,Cc({isCone:!1,name:i})),n>1&&a.setAttribute(`count`,String(n)),e.lickState&&e.lickState!==`pending`&&a.setAttribute(`state`,e.lickState);let o=e.lickParts??[e.content];for(let e of o){let t=document.createElement(`div`);t.innerHTML=vc(Dc(e)),a.append(t)}return a}function yl(e){let t=X(`slicc-delegation-line`,{kind:`feed`,verb:`feed_scoop`,label:jc(e.content.replace(/\*\*\[[^\]]*\]\*\*\s*/,``))}),n=document.createElement(`slicc-user-message`);return n.setBodyHtml(vc(e.content)),[t,n]}function bl(e){return typeof e==`string`&&e.startsWith(`No API key configured`)}function xl(e){return e?e.toLowerCase().includes(`the provided model identifier is invalid`):!1}function Sl(e){let t={message:e.content,"message-id":e.id};return bl(e.content)?t.action=`settings`:xl(e.content)&&(t.action=`change-model`),X(`slicc-error-card`,t)}function Cl(e){if(e.source===`lick`)return[vl(e)];if(e.source===`delegation`||e.channel===`delegation`)return yl(e);if(e.error)return[Sl(e)];if(e.role===`assistant`)return al(e);let t=Oc(e.content);return t?[vl({...e,source:`lick`,channel:t})]:[Yc(e)]}function wl(e){let t=[];for(let n of e){let e=n;if(!n.source&&n.role===`user`){let t=Oc(n.content);t&&(e={...n,source:`lick`,channel:t})}let r=t[t.length-1];if(!(e.lickId||r?.lickId)&&e.source===`lick`&&r?.source===`lick`&&r.channel===e.channel){r.lickParts=[...r.lickParts??[r.content],e.content],r.lickCount=r.lickParts.length,r.content+=`\n\n${e.content}`;continue}t.push({...e})}return t}function Tl(e){return new Date(e).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}function El(e){return X(`slicc-day-separator`,{label:Tl(e)})}function Dl(e){let t=[],n=``;for(let r of e){let e=new Date(r.timestamp).toDateString();e!==n&&(t.push(El(r.timestamp)),n=e),t.push(...Cl(r))}let r=document.createElement(`div`);return r.append(...t),_l(r,{openClusterAnchors:new Set,toolCallLookup:(t,n)=>e.find(e=>e.id===t)?.toolCalls?.find(e=>e.id===n)}),Array.from(r.children)}var Ol=new Uint8Array([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,4,0,0,0,181,28,12,2,0,0,0,11,73,68,65,84,120,218,99,100,96,0,0,0,6,0,2,48,129,208,47,0,0,0,0,73,69,78,68,174,66,96,130]);function kl(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return typeof btoa==`function`?btoa(t):Buffer.from(t,`binary`).toString(`base64`)}var Al=new Date(`2024-01-01T10:00:00`).getTime();function Q(e){return Al+e*6e4}var jl=`ui-fixture`;function Ml(){return[{id:`fx-user-1`,role:`user`,content:`Hey sliccy — can you summarize what this fixture covers?`,timestamp:Q(0)},{id:`fx-assistant-1`,role:`assistant`,content:`Sure! This session walks through every chat UI variant I know about. You'll see user and assistant bubbles, tool calls in every status, the six lick channels, a delegation, queued messages, and a streaming tail at the end so you can inspect the live state.`,timestamp:Q(.2)}]}function Nl(){return[{id:`fx-user-2`,role:`user`,content:`Show me some **markdown** — headings, lists, code, a blockquote.`,timestamp:Q(1)},{id:`fx-user-attachment`,role:`user`,content:`Use these attachments as visual and text context.`,timestamp:Q(1.1),attachments:[{id:`fx-att-image`,name:`dot.png`,mimeType:`image/png`,size:Ol.byteLength,kind:`image`,data:kl(Ol)},{id:`fx-att-text`,name:`notes.txt`,mimeType:`text/plain`,size:21,kind:`text`,text:`Fixture attachment text`}]},{id:`fx-assistant-2`,role:`assistant`,content:"## Rich content sample,,Here is a short list:,,- `renderAssistantMessageContent` handles GFM markdown,- Code blocks get syntax highlighting,- Inline `code` uses the mono token,,A fenced code block:,,```ts,import { createChatFixture } from './chat-fixture.js';,,const msgs = createChatFixture();,console.log(msgs.length);,```,,> Blockquotes should feel quieter than regular text.,,And a nested ordered list:,,1. First step,2. Second step, 1. Sub-step A, 2. Sub-step B,3. Third step".split(`,`).join(`
|
|
4173
|
+
`),timestamp:Q(1.3)}]}function Pl(){return[{id:`fx-assistant-3`,role:`assistant`,content:`Let me check a few things before I answer.`,timestamp:Q(2),toolCalls:[{id:`fx-tc-read`,name:`read_file`,input:{path:`/workspace/README.md`},result:`# Sample README
|
|
3970
4174
|
|
|
3971
4175
|
This is the contents that read_file returned.`},{id:`fx-tc-bash`,name:`bash`,input:{command:`ls -la /workspace`},result:`total 24
|
|
3972
4176
|
drwxr-xr-x 4 user user 4096 Jan 01 10:00 .
|
|
3973
4177
|
drwxr-xr-x 6 user user 4096 Jan 01 10:00 ..
|
|
3974
4178
|
-rw-r--r-- 1 user user 187 Jan 01 10:00 README.md
|
|
3975
|
-
drwxr-xr-x 2 user user 4096 Jan 01 10:00 src`},{id:`fx-tc-err`,name:`edit_file`,input:{path:`/workspace/missing.ts`,old_str:`x`,new_str:`y`},result:`ENOENT: no such file or directory, open "/workspace/missing.ts"`,isError:!0},{id:`fx-tc-run`,name:`bash`,input:{command:`npm run test -- --coverage`}},{id:`fx-tc-shot`,name:`bash`,input:{command:`playwright-cli screenshot`},result:`Screenshot saved to /tmp/shot.png`,_screenshotDataUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=`}]}]}function
|
|
4179
|
+
drwxr-xr-x 2 user user 4096 Jan 01 10:00 src`},{id:`fx-tc-err`,name:`edit_file`,input:{path:`/workspace/missing.ts`,old_str:`x`,new_str:`y`},result:`ENOENT: no such file or directory, open "/workspace/missing.ts"`,isError:!0},{id:`fx-tc-run`,name:`bash`,input:{command:`npm run test -- --coverage`}},{id:`fx-tc-shot`,name:`bash`,input:{command:`playwright-cli screenshot`},result:`Screenshot saved to /tmp/shot.png`,_screenshotDataUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=`}]}]}function Fl(){return[{id:`fx-assistant-scoop-mgmt`,role:`assistant`,content:`Spinning up the scoops I need and handing out the work.`,timestamp:Q(3),toolCalls:[{id:`fx-tc-list-scoops`,name:`list_scoops`,input:{},result:`Registered scoops:
|
|
3976
4180
|
- sliccy (cone) [CONE] — ready (since Jan 1, 9:58 AM)
|
|
3977
4181
|
- Hero Block (hero-block-scoop) — ready (since Jan 1, 9:59 AM)
|
|
3978
4182
|
- Install Doc Writer (install-doc-writer-scoop) — idle`},{id:`fx-tc-scoop-scoop`,name:`scoop_scoop`,input:{name:`Release Notes`,model:`claude-sonnet-4-6`,prompt:`Draft release notes for v0.3.2 using the merged PR titles from the last 7 days.`,visiblePaths:[`/workspace/`,`/shared/releases/`],writablePaths:[`/scoops/release-notes-scoop/`,`/shared/releases/`]},result:`Scoop "Release Notes" created as "release-notes-scoop" and task sent. It is now working on it.`},{id:`fx-tc-scoop-scoop-err`,name:`scoop_scoop`,input:{name:`Release Notes`},result:`Failed to create scoop: a scoop named "release-notes-scoop" already exists.`,isError:!0},{id:`fx-tc-feed`,name:`feed_scoop`,input:{scoop_name:`hero-block-scoop`,prompt:`Update the hero block to use the new gradient background defined in /shared/tokens/brand.css. Preserve the existing copy. Run the snapshot tests when done.`},result:`Task sent to hero-block-scoop. You will be notified when it completes.`},{id:`fx-tc-send`,name:`send_message`,input:{text:`Checkpoint: finished the CSS token pass, starting on the test snapshots.`,sender:`hero-block-scoop`},result:`Message sent.`},{id:`fx-tc-drop`,name:`drop_scoop`,input:{scoop_name:`install-doc-writer-scoop`},result:`Scoop "Install Doc Writer" (install-doc-writer-scoop) has been dropped.`},{id:`fx-tc-memory`,name:`update_global_memory`,input:{content:`# Global Memory
|
|
3979
4183
|
|
|
3980
4184
|
- Brand colors now live in /shared/tokens/brand.css
|
|
3981
4185
|
- Release notes ship on Wednesdays
|
|
3982
|
-
`},result:`Global memory updated successfully.`}]}]}function
|
|
4186
|
+
`},result:`Global memory updated successfully.`}]}]}function Il(){return[{id:`fx-delegation-1`,role:`user`,content:"**[Instructions from sliccy]**\n\nRead `/workspace/README.md` and extract the install steps into `/shared/install.md`.",timestamp:Q(4),source:`delegation`,channel:`delegation`},{id:`fx-assistant-delegated`,role:`assistant`,content:"Extracted the install steps. Wrote them to `/shared/install.md`. The section covers prerequisites, npm install, and the dev server launch.",timestamp:Q(4.4),source:`cone`}]}function Ll(){return[{id:`fx-lick-webhook`,role:`user`,content:"[Webhook Event: github-push]\n```json\n"+JSON.stringify({ref:`refs/heads/main`,repository:{full_name:`example/repo`},head_commit:{message:`fix(ui): tighten button contrast in dark mode`}},null,2)+"\n```",timestamp:Q(6),source:`lick`,channel:`webhook`},{id:`fx-lick-cron`,role:`user`,content:"[Cron Event: daily-digest]\n```json\n"+JSON.stringify({time:new Date(Q(8)).toISOString()},null,2)+"\n```",timestamp:Q(8),source:`lick`,channel:`cron`},{id:`fx-lick-sprinkle`,role:`user`,content:"[Sprinkle Event: welcome]\n```json\n"+JSON.stringify({action:`onboarding-complete`,data:{mountWorkspace:!0}},null,2)+"\n```",timestamp:Q(10),source:`lick`,channel:`sprinkle`},{id:`fx-lick-fswatch`,role:`user`,content:"[File Watch Event: src-watch]\n```json\n"+JSON.stringify({changes:[{type:`modified`,path:`/workspace/src/app.ts`},{type:`created`,path:`/workspace/src/utils.ts`}]},null,2)+"\n```",timestamp:Q(12),source:`lick`,channel:`fswatch`},{id:`fx-lick-navigate`,role:`user`,content:"[Navigate Event: https://www.sliccy.ai/handoff?handoff=demo]\n```json\n"+JSON.stringify({url:`https://www.sliccy.ai/handoff?handoff=demo`,verb:`handoff`,target:`https://www.sliccy.ai/handoff?handoff=demo`,instruction:`demo`,title:`Handoff`},null,2)+"\n```",timestamp:Q(14),source:`lick`,channel:`navigate`},{id:`fx-lick-session-reload`,role:`user`,content:`[Session Reload: mount-recovery]
|
|
3983
4187
|
|
|
3984
4188
|
A previously-mounted directory needs to be reauthorized:
|
|
3985
4189
|
|
|
@@ -4008,4 +4212,4 @@ Kind: read
|
|
|
4008
4212
|
Detail: /shared/secrets/api-key.txt
|
|
4009
4213
|
Suggested pattern: /shared/secrets/**
|
|
4010
4214
|
|
|
4011
|
-
Use the lick_confirm tool with lick_id="lick-1700000000002-req44" to approve (or always-approve with a pattern), or lick_dismiss with lick_id="lick-1700000000002-req44" to deny.`,timestamp:Q(17.9),source:`lick`,channel:`sudo-request`,lickId:`lick-1700000000002-req44`,lickState:`dismissed`}]}function
|
|
4215
|
+
Use the lick_confirm tool with lick_id="lick-1700000000002-req44" to approve (or always-approve with a pattern), or lick_dismiss with lick_id="lick-1700000000002-req44" to deny.`,timestamp:Q(17.9),source:`lick`,channel:`sudo-request`,lickId:`lick-1700000000002-req44`,lickState:`dismissed`}]}function Rl(){return[{id:`fx-queued-1`,role:`user`,content:`Also double-check the install.md formatting after you finish.`,timestamp:Q(18),queued:!0}]}function zl(){return[{id:`fx-assistant-streaming`,role:`assistant`,content:`Great, running the coverage suite now. I'll report back as soon as it `,timestamp:Q(20),isStreaming:!0,toolCalls:[{id:`fx-tc-streaming`,name:`bash`,input:{command:`npm run test -- --coverage`}}]}]}function Bl(){return[...Ml(),...Nl(),...Pl(),...Fl(),...Il(),...Ll(),...Rl(),...zl()]}var Vl=e({FREEZER_TINT:()=>Hl,applyShellContext:()=>eu,mountWcShell:()=>$l,mountWcUiPreview:()=>nu,submittedText:()=>tu}),Hl=`#3b6cb2`,Ul=`slicc-wcui-style`,Wl=[`html,body{margin:0;padding:0;height:100%;}`,`.wcui-frame{position:relative;transform:translateZ(0);width:100%;height:100vh;`,`overflow:hidden;background:var(--bg);font-family:var(--ui);}`,`.wcui-shader{position:absolute;inset:0;z-index:0;}`,`.wcui-frame slicc-chatpane{position:relative;background:transparent;}`,`.wcui-appcol{position:relative;z-index:1;height:100%;display:flex;flex-direction:column;`,`box-sizing:border-box;padding-left:var(--rail-w,44px);`,`transition:padding-left .4s cubic-bezier(.4,0,.2,1);}`,`@media (max-width:560px){.wcui-appcol{padding-left:44px;}}`,`.wcui-term{flex:1;min-height:0;display:flex;flex-direction:column;padding:8px 4px 8px 10px;`,`box-sizing:border-box;background:#141414;}`,`.wcui-term .terminal-panel__terminal-host{flex:1 1 auto;min-height:0;}`,`.wcui-term .terminal-panel__preview{flex:0 0 auto;}`,`.wcui-frame slicc-file-tree{width:100%;border-right:none;}`,`.wcui-memory{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;`,`gap:8px;padding:10px;}`,`.wcui-placeholder{flex:1;display:flex;align-items:center;justify-content:center;`,`padding:24px;color:var(--txt-2);font-size:13px;text-align:center;}`].join(``);function Gl(e){if(e.getElementById(Ul))return;let t=e.createElement(`style`);t.id=Ul,t.textContent=Wl,e.head.appendChild(t)}var Kl=null;function ql(){Kl?.(),Kl=Ki()}function $(e,t={}){let n=document.createElement(e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function Jl(e){let t=$(`slicc-nav`,{accent:`var(--waffle)`}),n=$(`slicc-scoop-switcher`);n.scoops=[...e.scoops];let r=$(`slicc-floatbar`,{label:e.floatLabel,spent:`0.00`}),i=document.createElement(`slicc-avatar-menu`);return i.append($(`slicc-avatar`,{name:`SLICC`})),t.append(...e.badge?[$(`slicc-logo`,{badge:e.badge})]:[],n,r,i),{nav:t,switcher:n,floatbar:r,avatarMenu:i}}function Yl(e){let t=$(`slicc-composer`),n=$(`slicc-queued-stack`);n.style.position=`relative`,n.style.zIndex=`0`,n.style.marginBottom=`-32px`,n.style.minHeight=`76px`;let r=$(`slicc-input-card`,{placeholder:e.placeholder});r.style.position=`relative`,r.style.zIndex=`1`;let i=$(`slicc-composer-meta`,{model:`Preview`,thinking:`off`});return t.append(n,r,i),{composer:t,inputCard:r,composerMeta:i,queuedStack:n}}function Xl(){let e=$(`slicc-workbench-pane`),t=$(`slicc-workbench-header`,{slot:`header`,hidden:``}),n=$(`slicc-tab-bar`,{active:`files`});t.append(n);let r=$(`slicc-workbench-body`,{active:`files`}),i=$(`slicc-surface`,{"surface-id":`files`,layout:`flex`,active:``}),a=$(`slicc-file-tree`);i.append(a);let o=$(`slicc-surface`,{"surface-id":`term`,layout:`flex`}),s=$(`div`,{class:`wcui-term`});o.append(s);let c=$(`slicc-surface`,{"surface-id":`memory`,layout:`flex`}),l=$(`div`,{class:`wcui-memory`});c.append(l);let u=$(`slicc-surface`,{"surface-id":`browser`,layout:`flex`}),d=$(`div`,{class:`wcui-placeholder`});return d.textContent=`The Browser dock item opens the full-screen tab switcher: every open tab — local and tray followers — with live screenshot thumbnails. Click a card to focus it, ✕ to close it.`,u.append(d),r.append(i,o,c,u),e.append(t,r),{workbench:e,body:r,header:t,tree:a,termSurface:s,memoryHost:l,tabBar:n}}function Zl(e,t,n,r){e.addEventListener(`slicc-dock-select`,e=>{let i=e.detail?.id;i&&i!==`browser`&&(t.setAttribute(`open`,``),n.setAttribute(`active`,i),r?.(i))}),e.addEventListener(`slicc-dock-collapse`,()=>{t.removeAttribute(`open`)}),e.addEventListener(`slicc-dock-longpress`,e=>{let i=e.detail?.id;if(!i?.startsWith(`sprinkle:`))return;t.setAttribute(`open`,``),n.setAttribute(`active`,i),r?.(i);let a=i.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);n.querySelector(`[surface-id="${a}"]`)?.requestFullscreen?.().catch(()=>{})})}function Ql(e,t,n){e.addEventListener(`tab-select`,e=>{let r=e.detail?.id;r&&(t.setAttribute(`active`,r),n?.(r))})}function $l(e,t){Wi(document),Gl(document),ql();let n=$(`div`,{class:`wcui-frame`}),r=$(`slicc-shader`,{mode:`cone`,tint:`var(--waffle)`,class:`wcui-shader`}),i=$(`slicc-freezer`);i.append($(`slicc-freezer-new`));let a=$(`div`,{class:`wcui-appcol`}),o=t.urlState?{"url-state":``}:{},s=$(`slicc-shell`,o),c=$(`slicc-chatpane`),l=$(`slicc-chat-thread`,{context:`cone`,accent:`var(--waffle)`,...o});l.append(...Dl(t.messages));let{composer:u,inputCard:d,composerMeta:f,queuedStack:p}=Yl(t);c.append(l,u);let{workbench:m,body:h,header:ee,tree:te,termSurface:ne,memoryHost:g,tabBar:_}=Xl(),v=$(`slicc-dock`,{"system-tools":``});s.append(c,m,v),Zl(v,s,h,t.onSurfaceActivate),Ql(ee,h,t.onSurfaceActivate),i.addEventListener(`freezer-toggle`,e=>{let t=e.detail?.open===!0;a.style.setProperty(`--rail-w`,t?`260px`:`44px`)});let y=0;l.addEventListener(`scroll`,()=>{y||=requestAnimationFrame(()=>{y=0,r.setAttribute(`scroll`,String(Math.round(l.scrollTop)))})},{passive:!0});let{nav:b,switcher:re,floatbar:ie,avatarMenu:ae}=Jl(t);return a.append(b,s),n.append(r,i,a),e.replaceChildren(n),{frame:n,shader:r,chatPane:c,thread:l,composer:u,inputCard:d,composerMeta:f,queuedStack:p,switcher:re,floatbar:ie,shell:s,workbenchBody:h,workbenchHeader:ee,dock:v,freezer:i,fileTree:te,termSurface:ne,memoryHost:g,tabBar:_,avatarMenu:ae}}function eu(e,t){let{shader:n,frame:r,freezer:i}=e;t.kind===`cone`?(n.setAttribute(`mode`,`cone`),n.setAttribute(`tint`,`var(--waffle)`),r.style.removeProperty(`--ctx`),i.removeAttribute(`ctx`)):t.kind===`scoop`?(n.setAttribute(`mode`,`scoop`),n.setAttribute(`tint`,t.accent),r.style.setProperty(`--ctx`,t.accent),i.removeAttribute(`ctx`)):(n.setAttribute(`mode`,`freezer`),n.setAttribute(`tint`,Hl),r.style.setProperty(`--ctx`,Hl),i.setAttribute(`ctx`,``))}function tu(e){return e.detail?.value}function nu(e){let t=$l(e,{messages:Bl(),scoops:[{key:`cone`,type:`cone`,color:`#b07823`,label:`sliccy`,eyes:`open`},{key:jl,type:`scoop`,color:`#06b6d4`,label:jl,eyes:`open`}],floatLabel:`standalone · preview`,placeholder:`Preview harness — submissions echo into the thread…`,badge:`fixture`});t.fileTree.items=[{kind:`group`,label:`workspace/`},{kind:`file`,id:`/workspace/CLAUDE.md`,label:`CLAUDE.md`},{kind:`group`,label:`shared/`},{kind:`file`,id:`/shared/CLAUDE.md`,label:`CLAUDE.md`}],t.switcher.setAttribute(`attention`,`cone`),t.inputCard.addEventListener(`submit`,e=>{let n=tu(e)?.trim();if(!n)return;let r={id:`wc-echo-${t.thread.childElementCount}`,role:`user`,content:n,timestamp:Date.now()};t.thread.append(...Cl(r))})}export{h as _,Vl as a,Cl as c,Cc as d,ja as f,l as g,ee as h,tu as i,_l as l,m,eu as n,wl as o,g as p,$l as r,El as s,Hl as t,ol as u};
|