mcp-memory-bucket 0.3.0 → 0.4.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/dist/client/assets/{index-DIO48C0V.js → index-vdbzlLML.js} +317 -177
- package/dist/client/index.html +23 -3
- package/dist/src/config.js +9 -0
- package/dist/src/server.js +4 -1
- package/dist/src/shared/bucket-root-tool.js +66 -0
- package/dist/src/shared/search-tool.js +16 -1
- package/dist/src/skills/builtin/memory-bucket-authoring/SKILL.md +13 -0
- package/dist/src/skills/repository.js +16 -0
- package/dist/src/skills/tools.js +8 -0
- package/dist/src/store/date-extract.js +49 -0
- package/dist/src/store/db.js +9 -0
- package/dist/src/store/search.js +58 -0
- package/dist/src/store/sync.js +14 -0
- package/dist/src/web/routes.js +39 -12
- package/package.json +1 -1
|
@@ -1,26 +1,35 @@
|
|
|
1
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const J=globalThis,xe=J.ShadowRoot&&(J.ShadyCSS===void 0||J.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ke=Symbol(),Me=new WeakMap;let st=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==ke)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(xe&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=Me.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Me.set(t,e))}return e}toString(){return this.cssText}};const At=i=>new st(typeof i=="string"?i:i+"",void 0,ke),F=(i,...e)=>{const t=i.length===1?i[0]:e.reduce((s,r,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[n+1],i[0]);return new st(t,i,ke)},Tt=(i,e)=>{if(xe)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),r=J.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=t.cssText,i.appendChild(s)}},Ie=xe?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return At(t)})(i):i;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:Rt,defineProperty:Et,getOwnPropertyDescriptor:Ct,getOwnPropertyNames:zt,getOwnPropertySymbols:Pt,getPrototypeOf:Lt}=Object,re=globalThis,De=re.trustedTypes,Mt=De?De.emptyScript:"",It=re.reactiveElementPolyfillSupport,Q=(i,e)=>i,pe={toAttribute(i,e){switch(e){case Boolean:i=i?Mt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},it=(i,e)=>!Rt(i,e),Oe={attribute:!0,type:String,converter:pe,reflect:!1,useDefault:!1,hasChanged:it};Symbol.metadata??=Symbol("metadata"),re.litPropertyMetadata??=new WeakMap;let O=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Oe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(e,s,t);r!==void 0&&Et(this.prototype,e,r)}}static getPropertyDescriptor(e,t,s){const{get:r,set:n}=Ct(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:r,set(o){const a=r?.call(this);n?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Oe}static _$Ei(){if(this.hasOwnProperty(Q("elementProperties")))return;const e=Lt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Q("properties"))){const t=this.properties,s=[...zt(t),...Pt(t)];for(const r of s)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,r]of t)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const r=this._$Eu(t,s);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const r of s)t.unshift(Ie(r))}else e!==void 0&&t.push(Ie(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Tt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){const s=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,s);if(r!==void 0&&s.reflect===!0){const n=(s.converter?.toAttribute!==void 0?s.converter:pe).toAttribute(t,s.type);this._$Em=e,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(e,t){const s=this.constructor,r=s._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const n=s.getPropertyOptions(r),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:pe;this._$Em=r;const a=o.fromAttribute(t,n.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,s,r=!1,n){if(e!==void 0){const o=this.constructor;if(r===!1&&(n=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??it)(n,t)||s.useDefault&&s.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:r,wrapped:n},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,n]of this._$Ep)this[r]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,n]of s){const{wrapped:o}=n,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,n,a)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};O.elementStyles=[],O.shadowRootOptions={mode:"open"},O[Q("elementProperties")]=new Map,O[Q("finalized")]=new Map,It?.({ReactiveElement:O}),(re.reactiveElementVersions??=[]).push("2.1.2");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Be=/'/g,
|
|
13
|
+
*/const me=globalThis,Ne=i=>i,ee=me.trustedTypes,Ue=ee?ee.createPolicy("lit-html",{createHTML:i=>i}):void 0,rt="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+R,Dt=`<${nt}>`,P=document,K=()=>P.createComment(""),W=i=>i===null||typeof i!="object"&&typeof i!="function",$e=Array.isArray,Ot=i=>$e(i)||typeof i?.[Symbol.iterator]=="function",le=`[
|
|
14
|
+
\f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,He=/-->/g,qe=/>/g,E=RegExp(`>|${le}(?:([^\\s"'>=/]+)(${le}*=${le}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Be=/'/g,je=/"/g,ot=/^(?:script|style|textarea|title)$/i,Nt=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),f=Nt(1),L=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Ze=new WeakMap,z=P.createTreeWalker(P,129);function at(i,e){if(!$e(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ue!==void 0?Ue.createHTML(e):e}const Ut=(i,e)=>{const t=i.length-1,s=[];let r,n=e===2?"<svg>":e===3?"<math>":"",o=B;for(let a=0;a<t;a++){const l=i[a];let c,p,h=-1,d=0;for(;d<l.length&&(o.lastIndex=d,p=o.exec(l),p!==null);)d=o.lastIndex,o===B?p[1]==="!--"?o=He:p[1]!==void 0?o=qe:p[2]!==void 0?(ot.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=E):p[3]!==void 0&&(o=E):o===E?p[0]===">"?(o=r??B,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?E:p[3]==='"'?je:Be):o===je||o===Be?o=E:o===He||o===qe?o=B:(o=E,r=void 0);const k=o===E&&i[a+1].startsWith("/>")?" ":"";n+=o===B?l+Dt:h>=0?(s.push(c),l.slice(0,h)+rt+l.slice(h)+R+k):l+R+(h===-2?a:k)}return[at(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let ue=class lt{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let n=0,o=0;const a=e.length-1,l=this.parts,[c,p]=Ut(e,t);if(this.el=lt.createElement(c,s),z.currentNode=this.el.content,t===2||t===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=z.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith(rt)){const d=p[o++],k=r.getAttribute(h).split(R),b=/([.?@])?(.*)/.exec(d);l.push({type:1,index:n,name:b[2],strings:k,ctor:b[1]==="."?qt:b[1]==="?"?Bt:b[1]==="@"?jt:ne}),r.removeAttribute(h)}else h.startsWith(R)&&(l.push({type:6,index:n}),r.removeAttribute(h));if(ot.test(r.tagName)){const h=r.textContent.split(R),d=h.length-1;if(d>0){r.textContent=ee?ee.emptyScript:"";for(let k=0;k<d;k++)r.append(h[k],K()),z.nextNode(),l.push({type:2,index:++n});r.append(h[d],K())}}}else if(r.nodeType===8)if(r.data===nt)l.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf(R,h+1))!==-1;)l.push({type:7,index:n}),h+=R.length-1}n++}}static createElement(e,t){const s=P.createElement("template");return s.innerHTML=e,s}};function N(i,e,t=i,s){if(e===L)return e;let r=s!==void 0?t._$Co?.[s]:t._$Cl;const n=W(e)?void 0:e._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,t,s)),s!==void 0?(t._$Co??=[])[s]=r:t._$Cl=r),r!==void 0&&(e=N(i,r._$AS(i,e.values),r,s)),e}let Ht=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,r=(e?.creationScope??P).importNode(t,!0);z.currentNode=r;let n=z.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new V(n,n.nextSibling,this,e):l.type===1?c=new l.ctor(n,l.name,l.strings,this,e):l.type===6&&(c=new Zt(n,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(n=z.nextNode(),o++)}return z.currentNode=P,r}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}};class V{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=N(this,e,t),W(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==L&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ot(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&W(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=ue.createElement(at(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(t);else{const n=new Ht(r,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=Ze.get(e.strings);return t===void 0&&Ze.set(e.strings,t=new ue(e)),t}k(e){$e(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const n of e)r===t.length?t.push(s=new V(this.O(K()),this.O(K()),this,this.options)):s=t[r],s._$AI(n),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const s=Ne(e).nextSibling;Ne(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}let ne=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,r,n){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(e,t=this,s,r){const n=this.strings;let o=!1;if(n===void 0)e=N(this,e,t,0),o=!W(e)||e!==this._$AH&&e!==L,o&&(this._$AH=e);else{const a=e;let l,c;for(e=n[0],l=0;l<n.length-1;l++)c=N(this,a[s+l],t,l),c===L&&(c=this._$AH[l]),o||=!W(c)||c!==this._$AH[l],c===m?e=m:e!==m&&(e+=(c??"")+n[l+1]),this._$AH[l]=c}o&&!r&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},qt=class extends ne{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},Bt=class extends ne{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},jt=class extends ne{constructor(e,t,s,r,n){super(e,t,s,r,n),this.type=5}_$AI(e,t=this){if((e=N(this,e,t,0)??m)===L)return;const s=this._$AH,r=e===m&&s!==m||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==m&&(s===m||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Zt=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){N(this,e)}};const Qt=me.litHtmlPolyfillSupport;Qt?.(ue,V),(me.litHtmlVersions??=[]).push("3.3.3");const Kt=(i,e,t)=>{const s=t?.renderBefore??e;let r=s._$litPart$;if(r===void 0){const n=t?.renderBefore??null;s._$litPart$=r=new V(e.insertBefore(K(),n),n,void 0,t??{})}return r._$AI(i),r};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const
|
|
20
|
-
↳ while computing ${this._debugParent??"root"}`);this.#s=!0,this.#
|
|
19
|
+
*/const ve=globalThis;let S=class extends O{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Kt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};S._$litElement$=!0,S.finalized=!0,ve.litElementHydrateSupport?.({LitElement:S});const Wt=ve.litElementPolyfillSupport;Wt?.({LitElement:S});(ve.litElementVersions??=[]).push("4.2.2");var ct;let ce=0;const Qe=new Set;function Ft(i){ce++;try{i()}finally{ce--,ce===0&&Vt()}}function Vt(){const i=new Set(Qe);Qe.clear();for(const e of i)e()}function Gt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}function Yt(i){return i&&typeof i.deref=="function"}class we{static#t=0;#e;#s;#i=new Set;#r=ct.#t++;name;constructor(e,t){this.#e=e,this.#s=e,this.name=t}_get(){return u.activeConsumer&&u.activeConsumer.track(this),this.#e}_set(e){return Gt(e,this.#e)?(this.#s=this.#e,this.#e=e,this._notify(),!0):!1}subscribe(e,t=!1){let s=e;return t&&(s=new WeakRef(e)),this.#i.add(s),()=>this.#i.delete(s)}_notify(){const e=[...this.#i];for(const t of e){let s;if(Yt(t)){if(s=t.deref(),!s){this.#i.delete(t);continue}}else s=t;s()}}get id(){return this.#r}get previousValue(){return this.#s}toString(){return this.name?`${this.constructor.name}(${this.name})`:`${this.constructor.name}#${this.id}`}}ct=we;class u extends we{static#t=[];constructor(e,t){super(e,t)}static get activeConsumer(){return this.#t[this.#t.length-1]}static push(e){this.#t.push(e)}static pop(){this.#t.pop()}get(){return this._get()}set(e){Ft(()=>{this._set(e)})}get value(){return this.get()}set value(e){this.set(e)}update(e){this.set(e(this.get()))}}class Xt extends we{#t;#e=!0;#s=!1;#i=new Map;_debugParent;#r;#c=()=>{this.#e||(this.#e=!0,this._notify())};constructor(e,t,s){super(void 0,t),this.#t=e,this.#r=s?.weak??!0}track(e){if(this.#i.has(e))return;const t=e.subscribe(this.#c,this.#r);this.#i.set(e,t)}dispose(){this.#l()}#l(){for(const e of this.#i.values())e();this.#i.clear()}get(){if(u.activeConsumer&&u.activeConsumer.track(this),!this.#e)return this._get();if(this.#s)throw new Error(`Cycle detected in ${this}
|
|
20
|
+
↳ while computing ${this._debugParent??"root"}`);this.#s=!0,this.#l(),u.push(this);try{const e=this.#t();this._set(e)}finally{u.pop(),this.#e=!1,this.#s=!1}return this._get()}get value(){return this.get()}set value(e){throw new Error(`Cannot set value of Computed ${this}. Computed values are read-only.`)}subscribe(e,t=!1){const s=super.subscribe(e,t);return u.activeConsumer||this.get(),s}}class ye{#t;#e=new Map;_debugParent;constructor(e){this.#t=e,e.addController(this);const t=e,s=t.update,r=this;t.update=function(n){u.push(r);try{s.call(this,n)}finally{u.pop()}}}track(e){this.#e.has(e)||this.#e.set(e,e.subscribe(this.#s,!0))}#s=()=>{this.#t.requestUpdate()};hostUpdate(){for(const e of this.#e.values())e();this.#e.clear()}hostDisconnected(){for(const e of this.#e.values())e();this.#e.clear()}toString(){const e=this.#t;return`SignalWatcher(${e?.localName??e?.tagName??e?.constructor?.name??"unknown"})`}}function Jt(i){if(!i)return"unknown age";const e=new Date(i);return Number.isNaN(e.getTime())?"unknown age":e.toISOString().slice(0,10)}class es extends S{static{this.properties={results:{attribute:!1},showRoot:{attribute:!1},onSelect:{attribute:!1},selectedIds:{attribute:!1},onToggleSelect:{attribute:!1}}}static{this.styles=F`
|
|
21
21
|
:host { display: block; }
|
|
22
|
-
.
|
|
23
|
-
|
|
22
|
+
.count-header {
|
|
23
|
+
padding: 8px 14px;
|
|
24
|
+
font-size: 11px;
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
text-transform: uppercase;
|
|
27
|
+
opacity: 0.6;
|
|
28
|
+
background: var(--bg);
|
|
29
|
+
border-bottom: 1px solid var(--border);
|
|
30
|
+
}
|
|
31
|
+
.row { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 8px; }
|
|
32
|
+
.row:hover { background: var(--hover); }
|
|
24
33
|
.row.deprecated { opacity: 0.55; }
|
|
25
34
|
.row-checkbox { flex: 0 0 auto; margin-top: 2px; cursor: pointer; }
|
|
26
35
|
.row-body { flex: 1 1 auto; min-width: 0; }
|
|
@@ -30,22 +39,19 @@
|
|
|
30
39
|
.meta { opacity: 0.65; font-size: 11px; white-space: nowrap; }
|
|
31
40
|
.desc { font-size: 12px; opacity: 0.8; margin-top: 3px; }
|
|
32
41
|
.tags { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
|
|
33
|
-
.tag { font-size: 10px; border: 1px solid
|
|
42
|
+
.tag { font-size: 10px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 6px; }
|
|
34
43
|
.type-badge { font-size: 10px; text-transform: uppercase; opacity: 0.6; }
|
|
35
44
|
.root-badge {
|
|
36
|
-
font-size: 10px; text-transform: uppercase; opacity: 0.9; border: 1px solid
|
|
37
|
-
color:
|
|
45
|
+
font-size: 10px; text-transform: uppercase; opacity: 0.9; border: 1px solid var(--purple);
|
|
46
|
+
color: var(--purple-fg); background: var(--purple-tint); border-radius: 4px; padding: 0 4px;
|
|
38
47
|
}
|
|
39
48
|
.deprecated-badge {
|
|
40
|
-
font-size: 10px; text-transform: uppercase; border: 1px solid
|
|
41
|
-
color:
|
|
42
|
-
}
|
|
43
|
-
@media (prefers-color-scheme: dark) {
|
|
44
|
-
.root-badge { color: #d8caff; }
|
|
45
|
-
.deprecated-badge { color: #fca5a5; }
|
|
49
|
+
font-size: 10px; text-transform: uppercase; border: 1px solid var(--danger);
|
|
50
|
+
color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); border-radius: 4px; padding: 0 4px;
|
|
46
51
|
}
|
|
47
52
|
.empty { padding: 24px; opacity: 0.6; font-size: 13px; }
|
|
48
53
|
`}render(){return!this.results||this.results.length===0?f`<div class="empty">No results.</div>`:f`
|
|
54
|
+
<div class="count-header">${this.results.length} result${this.results.length===1?"":"s"}</div>
|
|
49
55
|
${this.results.map(e=>{const t=e._table==="skills"&&e.root==="builtin";return f`
|
|
50
56
|
<div class="row ${e.deprecated?"deprecated":""}" @click=${()=>this.onSelect(e)}>
|
|
51
57
|
<input
|
|
@@ -59,7 +65,7 @@
|
|
|
59
65
|
<div class="row-body">
|
|
60
66
|
<div class="top">
|
|
61
67
|
<span class="name">${e.name}</span>
|
|
62
|
-
<span class="meta">${
|
|
68
|
+
<span class="meta">${Jt(e.created_at)} · ${e.owner??"—"} · ${e.status}</span>
|
|
63
69
|
</div>
|
|
64
70
|
<div class="desc">${e.description}</div>
|
|
65
71
|
<div class="tags">
|
|
@@ -71,39 +77,39 @@
|
|
|
71
77
|
</div>
|
|
72
78
|
</div>
|
|
73
79
|
`})}
|
|
74
|
-
`}}customElements.define("result-list",
|
|
75
|
-
]`).replace("lheading",
|
|
76
|
-
`),t=e.length-1;for(;t>=0&&$.blankLine.test(e[t]);)t--;return e.length-t<=2?
|
|
77
|
-
`)}function
|
|
78
|
-
`).map(n=>{let o=n.match(t.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=
|
|
79
|
-
`)}var se=class{options;rules;lexer;constructor(
|
|
80
|
-
`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(
|
|
81
|
-
`)}}blockquote(
|
|
80
|
+
`}}customElements.define("result-list",es);function _e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var I=_e();function ht(i){I=i}var C={exec:()=>null};function D(i){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),r=e[s];return r||(r=i(s),e[s]=r),r}}function g(i,e=""){let t=typeof i=="string"?i:i.source,s={replace:(r,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace($.caret,"$1"),t=t.replace(r,o),s},getRegex:()=>new RegExp(t,e)};return s}var ts=((i="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+i)}catch{return!1}})(),$={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:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:D(i=>new RegExp(`^ {0,${i}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:D(i=>new RegExp(`^ {0,${i}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:D(i=>new RegExp(`^ {0,${i}}(?:\`\`\`|~~~)`)),headingBeginRegex:D(i=>new RegExp(`^ {0,${i}}#`)),htmlBeginRegex:D(i=>new RegExp(`^ {0,${i}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:D(i=>new RegExp(`^ {0,${i}}>`))},ss=/^(?:[ \t]*(?:\n|$))+/,is=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,G=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ns=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Se=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ut=g(pt).replace(/bull/g,Se).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),os=g(pt).replace(/bull/g,Se).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ae=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,as=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ls=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cs=g(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Se).getRegex(),oe="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",Re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,hs=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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",Re).replace("tag",oe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dt=i=>g(Ae).replace("hr",G).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",i).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex(),ps=dt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),us=dt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ds=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",us).getRegex(),Ee={blockquote:ds,code:is,def:ls,fences:rs,heading:ns,hr:G,html:hs,lheading:ut,list:cs,newline:ss,paragraph:ps,table:C,text:as},Ke=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",G).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex(),gs={...Ee,lheading:os,table:Ke,paragraph:g(Ae).replace("hr",G).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ke).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oe).getRegex()},fs={...Ee,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Re).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:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(Ae).replace("hr",G).replace("heading",` *#{1,6} *[^
|
|
81
|
+
]`).replace("lheading",ut).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gt=/^( {2,}|\\)\n(?!\s*$)/,ks=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,A=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,Y=/[^\s\p{P}\p{S}]/u,ms=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),$s=/[\p{Pi}\p{Ps}"']/u,ft=/(?!~)[\p{P}\p{S}]/u,vs=/(?!~)[\s\p{P}\p{S}]/u,ws=/(?:[^\s\p{P}\p{S}]|~)/u,ys=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ts?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,_s=g(bt,"u").replace(/punct/g,A).getRegex(),Ss=g(bt,"u").replace(/punct/g,ft).getRegex(),As=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ts=g(As,"u").replace(/openQuote/g,$s).replace(/punct/g,A).getRegex(),xt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rs=g(xt,"gu").replace(/notPunctSpace/g,Y).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Es=g(xt,"gu").replace(/notPunctSpace/g,ws).replace(/punctSpace/g,vs).replace(/punct/g,ft).getRegex(),Cs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",zs=g(Cs,"gu").replace(/notPunctSpace/g,Y).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Ps=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Y).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Ls="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ms=g(Ls,"gu").replace(/notPunctSpace/g,Y).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Is=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,A).getRegex(),Ds="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Os=g(Ds,"gu").replace(/notPunctSpace/g,Y).replace(/punctSpace/g,U).replace(/punct/g,A).getRegex(),Ns=g(/\\(punct)/,"gu").replace(/punct/g,A).getRegex(),Us=g(/^<(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(),Hs=g(Re).replace("(?:-->|$)","-->").getRegex(),qs=g("^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",Hs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Bs=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kt=g(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),mt=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),js=g("reflink|nolink(?!\\()","g").replace("reflink",kt).replace("nolink",mt).getRegex(),We=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ce={_backpedal:C,anyPunctuation:Ns,autolink:Us,blockSkip:ys,br:gt,code:xs,del:C,delLDelim:C,delRDelim:C,emStrongLDelim:_s,emStrongRDelimAst:Rs,emStrongRDelimUnd:Ps,escape:bs,link:Bs,nolink:mt,punctuation:ms,reflink:kt,reflinkSearch:js,tag:qs,text:ks,url:C},Zs={...Ce,emStrongLDelim:Ts,emStrongRDelimAst:zs,emStrongRDelimUnd:Ms,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},de={...Ce,emStrongRDelimAst:Es,emStrongLDelim:Ss,delLDelim:Is,delRDelim:Os,url:g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",We).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:g(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",We).getRegex()},Qs={...de,br:g(gt).replace("{2,}","*").getRegex(),text:g(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:Ee,gfm:gs,pedantic:fs},j={normal:Ce,gfm:de,breaks:Qs,pedantic:Zs},Ks={"&":"&","<":"<",">":">",'"':""","'":"'"},Fe=i=>Ks[i];function _(i,e){if(e){if($.escapeTest.test(i))return i.replace($.escapeReplace,Fe)}else if($.escapeTestNoEncode.test(i))return i.replace($.escapeReplaceNoEncode,Fe);return i}function Ve(i){try{i=encodeURI(i).replace($.percentDecode,"%")}catch{return null}return i}function Ge(i,e){let t=i.replace($.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=t.split($.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace($.slashPipe,"|");return s}function T(i,e,t){let s=i.length;if(s===0)return"";let r=0;for(;r<s&&i.charAt(s-r-1)===e;)r++;return i.slice(0,s-r)}function Ye(i){let e=i.split(`
|
|
82
|
+
`),t=e.length-1;for(;t>=0&&$.blankLine.test(e[t]);)t--;return e.length-t<=2?i:e.slice(0,t+1).join(`
|
|
83
|
+
`)}function Ws(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<i.length;s++)if(i[s]==="\\")s++;else if(i[s]===e[0])t++;else if(i[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function Fs(i,e=0){let t=e,s="";for(let r of i)if(r===" "){let n=4-t%4;s+=" ".repeat(n),t+=n}else s+=r,t++;return s}function Xe(i,e,t,s,r){let n=e.href,o=e.title||null,a=i[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:n,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function Vs(i,e,t){let s=i.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
84
|
+
`).map(n=>{let o=n.match(t.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=r.length?n.slice(r.length):n}).join(`
|
|
85
|
+
`)}var se=class{options;rules;lexer;constructor(i){this.options=i||I}space(i){let e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){let e=this.rules.block.code.exec(i);if(e){let t=this.options.pedantic?e[0]:Ye(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(i){let e=this.rules.block.fences.exec(i);if(e){let t=e[0],s=Vs(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(i){let e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=T(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:T(e[0],`
|
|
86
|
+
`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){let e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:T(e[0],`
|
|
87
|
+
`)}}blockquote(i){let e=this.rules.block.blockquote.exec(i);if(e){let t=T(e[0],`
|
|
82
88
|
`).split(`
|
|
83
|
-
`),s="",
|
|
89
|
+
`),s="",r="",n=[];for(;t.length>0;){let o=!1,a=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),o=!0;else if(!o)a.push(t[l]);else break;t=t.slice(l);let c=a.join(`
|
|
84
90
|
`),p=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
85
91
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
86
|
-
${c}`:c,
|
|
87
|
-
${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,n,!0),this.lexer.state.top=h,t.length===0)break;let
|
|
88
|
-
`),
|
|
89
|
-
`+b.replace(this.rules.other.blockquoteSetextReplace2,""),
|
|
90
|
-
${b}`,
|
|
92
|
+
${c}`:c,r=r?`${r}
|
|
93
|
+
${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,n,!0),this.lexer.state.top=h,t.length===0)break;let d=n.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let k=d,b=t.join(`
|
|
94
|
+
`),y=k.raw+`
|
|
95
|
+
`+b.replace(this.rules.other.blockquoteSetextReplace2,""),H=this.blockquote(y);n[n.length-1]=H,s=`${s}
|
|
96
|
+
${b}`,r=r.substring(0,r.length-k.text.length)+H.text;break}else if(d?.type==="list"){let k=d,b=k.raw+`
|
|
91
97
|
`+t.join(`
|
|
92
|
-
`),
|
|
93
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:n,text:
|
|
94
|
-
`,1)[0],e[1].length),
|
|
95
|
-
`,1)[0],
|
|
96
|
-
`,
|
|
97
|
-
`,1)[0],
|
|
98
|
-
`+
|
|
99
|
-
`+
|
|
100
|
-
`,
|
|
101
|
-
`),href:s,title:
|
|
102
|
-
`):[],n={type:"table",raw:
|
|
103
|
-
`),header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<t.length;o++)n.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:n.align[o]});for(let o of
|
|
104
|
-
`),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(
|
|
105
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(
|
|
106
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace($.tabCharGlobal," ").replace($.spaceLine,""));let
|
|
98
|
+
`),y=this.list(b);n[n.length-1]=y,s=s.substring(0,s.length-d.raw.length)+y.raw,r=r.substring(0,r.length-k.raw.length)+y.raw,t=b.substring(n.at(-1).raw.length).split(`
|
|
99
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:n,text:r}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim(),s=t.length>1,r={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let n=this.rules.other.listItemRegex(t),o=!1;for(;i;){let l=!1,c="",p="";if(!(e=n.exec(i))||this.rules.block.hr.test(i))break;c=e[0],i=i.substring(c.length);let h=Fs(e[2].split(`
|
|
100
|
+
`,1)[0],e[1].length),d=i.split(`
|
|
101
|
+
`,1)[0],k=!h.trim(),b=0;if(this.options.pedantic?(b=2,p=h.trimStart()):k?b=e[1].length+1:(b=h.search(this.rules.other.nonSpaceChar),b=b>4?1:b,p=h.slice(b),b+=e[1].length),k&&this.rules.other.blankLine.test(d)&&(c+=d+`
|
|
102
|
+
`,i=i.substring(d.length+1),l=!0),!l){let y=this.rules.other.nextBulletRegex(b),H=this.rules.other.hrRegex(b),Pe=this.rules.other.fencesBeginRegex(b),Le=this.rules.other.headingBeginRegex(b),_t=this.rules.other.htmlBeginRegex(b),St=this.rules.other.blockquoteBeginRegex(b);for(;i;){let ae=i.split(`
|
|
103
|
+
`,1)[0],q;if(d=ae,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),q=d):q=d.replace(this.rules.other.tabCharGlobal," "),Pe.test(d)||Le.test(d)||_t.test(d)||St.test(d)||y.test(d)||H.test(d))break;if(q.search(this.rules.other.nonSpaceChar)>=b||!d.trim())p+=`
|
|
104
|
+
`+q.slice(b);else{if(k||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Pe.test(h)||Le.test(h)||H.test(h))break;p+=`
|
|
105
|
+
`+d}k=!d.trim(),c+=ae+`
|
|
106
|
+
`,i=i.substring(ae.length+1),h=q.slice(b)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=c}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!r.loose){let c=l.tokens.filter(h=>h.type==="space"),p=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));r.loose=p}for(let l of r.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let h={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=h.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=h.raw+l.tokens[0].raw,l.tokens[0].text=h.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(h)):l.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):l.tokens.unshift(h)}}else l.task&&(l.task=!1)}if(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(i){let e=this.rules.block.html.exec(i);if(e){let t=Ye(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(i){let e=this.rules.block.def.exec(i);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:T(e[0],`
|
|
107
|
+
`),href:s,title:r}}}table(i){let e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Ge(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
108
|
+
`):[],n={type:"table",raw:T(e[0],`
|
|
109
|
+
`),header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<t.length;o++)n.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:n.align[o]});for(let o of r)n.rows.push(Ge(o,n.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[l]})));return n}}lheading(i){let e=this.rules.block.lheading.exec(i);if(e){let t=e[1].trim();return{type:"heading",raw:T(e[0],`
|
|
110
|
+
`),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(i){let e=this.rules.block.paragraph.exec(i);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
111
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){let e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){let e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){let e=this.rules.inline.tag.exec(i);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(i){let e=this.rules.inline.link.exec(i);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let n=T(t.slice(0,-1),"\\");if((t.length-n.length)%2===0)return}else{let n=Ws(e[2],"()");if(n===-2)return;if(n>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(s);n&&(s=n[1],r=n[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),Xe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let n=t[0].charAt(0);return{type:"text",raw:n,text:n}}return Xe(t,r,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(i);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,n,o,a=r,l=0,c=s[0][0],p=t===c,h=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*i.length+r);(s=h.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n)continue;if(o=[...n].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(r%3&&!((r+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let d=[...s[0]][0].length,k=i.slice(0,r+s.index+d+o);if(Math.min(r,o)%2){let y=k.slice(1,-1);return{type:"em",raw:k,text:y,tokens:this.lexer.inlineTokens(y)}}let b=k.slice(2,-2);return{type:"strong",raw:k,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(i){let e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){let e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i,e,t=""){let s=this.rules.inline.delLDelim.exec(i);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,n,o,a=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*i.length+r);(s=l.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n||(o=[...n].length,o!==r))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,p=i.slice(0,r+s.index+c+o),h=p.slice(r,-r);return{type:"del",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(i){let e=this.rules.inline.autolink.exec(i);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(i){let e;if(e=this.rules.inline.url.exec(i)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(i){let e=this.rules.inline.text.exec(i);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},v=class ge{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||I,this.options.tokenizer=this.options.tokenizer||new se,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:$,block:X.normal,inline:j.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=j.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=j.breaks:t.inline=j.gfm),this.tokenizer.rules=t}static get rules(){return{block:X,inline:j}}static lex(e,t){return new ge(t).lex(e)}static lexInline(e,t){return new ge(t).inlineTokens(e)}lex(e){e=e.replace($.carriageReturn,`
|
|
112
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace($.tabCharGlobal," ").replace($.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let n;if(this.options.extensions?.block?.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let a=t.at(-1);n.raw.length===1&&a!==void 0?a.raw+=`
|
|
107
113
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
108
114
|
`)?"":`
|
|
109
115
|
`)+n.raw,a.text+=`
|
|
@@ -116,34 +122,34 @@ ${b}`,i=i.substring(0,i.length-x.text.length)+q.text;break}else if(u?.type==="li
|
|
|
116
122
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
117
123
|
`)?"":`
|
|
118
124
|
`)+n.raw,a.text+=`
|
|
119
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}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 s=e;if(this.tokens.links){let a=Object.keys(this.tokens.links);a.length>0&&(s=s.replace(this.tokenizer.rules.inline.reflinkSearch,l=>a.includes(l.slice(l.lastIndexOf("[")+1,-1))?"["+"a".repeat(l.length-2)+"]":l))}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let
|
|
120
|
-
`;return s?'<pre><code class="language-'+_(s)+'">'+(t?
|
|
121
|
-
`:"<pre><code>"+(t?
|
|
122
|
-
`}blockquote({tokens:
|
|
123
|
-
${this.parser.parse(
|
|
124
|
-
`}html({text:
|
|
125
|
-
`}hr(
|
|
126
|
-
`}list(
|
|
127
|
-
`+s+"</"+
|
|
128
|
-
`}listitem(
|
|
129
|
-
`}checkbox({checked:
|
|
130
|
-
`}table(
|
|
125
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}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 s=e;if(this.tokens.links){let a=Object.keys(this.tokens.links);a.length>0&&(s=s.replace(this.tokenizer.rules.inline.reflinkSearch,l=>a.includes(l.slice(l.lastIndexOf("[")+1,-1))?"["+"a".repeat(l.length-2)+"]":l))}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let r=!1,n="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(n=""),r=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),h;this.options.extensions.startInline.forEach(d=>{h=d.call({lexer:this},p),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(n=a.raw.slice(-1)),r=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},ie=class{options;parser;constructor(i){this.options=i||I}space(i){return""}code({text:i,lang:e,escaped:t}){let s=(e||"").match($.notSpaceStart)?.[0],r=i.replace($.endingNewline,"")+`
|
|
126
|
+
`;return s?'<pre><code class="language-'+_(s)+'">'+(t?r:_(r,!0))+`</code></pre>
|
|
127
|
+
`:"<pre><code>"+(t?r:_(r,!0))+`</code></pre>
|
|
128
|
+
`}blockquote({tokens:i}){return`<blockquote>
|
|
129
|
+
${this.parser.parse(i)}</blockquote>
|
|
130
|
+
`}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:e}){return`<h${e}>${this.parser.parseInline(i)}</h${e}>
|
|
131
|
+
`}hr(i){return`<hr>
|
|
132
|
+
`}list(i){let e=i.ordered,t=i.start,s="";for(let o=0;o<i.items.length;o++){let a=i.items[o];s+=this.listitem(a)}let r=e?"ol":"ul",n=e&&t!==1?' start="'+t+'"':"";return"<"+r+n+`>
|
|
133
|
+
`+s+"</"+r+`>
|
|
134
|
+
`}listitem(i){return`<li>${this.parser.parse(i.tokens)}</li>
|
|
135
|
+
`}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
|
|
136
|
+
`}table(i){let e="",t="";for(let r=0;r<i.header.length;r++)t+=this.tablecell(i.header[r]);e+=this.tablerow({text:t});let s="";for(let r=0;r<i.rows.length;r++){let n=i.rows[r];t="";for(let o=0;o<n.length;o++)t+=this.tablecell(n[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
131
137
|
<thead>
|
|
132
138
|
`+e+`</thead>
|
|
133
139
|
`+s+`</table>
|
|
134
|
-
`}tablerow({text:
|
|
135
|
-
${
|
|
136
|
-
`}tablecell(
|
|
137
|
-
`}strong({tokens:
|
|
138
|
-
Please report this to https://github.com/markedjs/marked.`,
|
|
140
|
+
`}tablerow({text:i}){return`<tr>
|
|
141
|
+
${i}</tr>
|
|
142
|
+
`}tablecell(i){let e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
|
|
143
|
+
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${_(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let s=this.parser.parseInline(t),r=Ve(i);if(r===null)return s;i=r;let n='<a href="'+i+'"';return e&&(n+=' title="'+_(e)+'"'),n+=">"+s+"</a>",n}image({href:i,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=Ve(i);if(r===null)return _(t);i=r;let n=`<img src="${i}" alt="${_(t)}"`;return e&&(n+=` title="${_(e)}"`),n+=">",n}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:_(i.text)}},ze=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},w=class fe{options;renderer;textRenderer;constructor(e){this.options=e||I,this.options.renderer=this.options.renderer||new ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ze}static parse(e,t){return new fe(t).parse(e)}static parseInline(e,t){return new fe(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let o=r,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){t+=a||"";continue}}let n=r;switch(n.type){case"space":{t+=this.renderer.space(n);break}case"hr":{t+=this.renderer.hr(n);break}case"heading":{t+=this.renderer.heading(n);break}case"code":{t+=this.renderer.code(n);break}case"table":{t+=this.renderer.table(n);break}case"blockquote":{t+=this.renderer.blockquote(n);break}case"list":{t+=this.renderer.list(n);break}case"checkbox":{t+=this.renderer.checkbox(n);break}case"html":{t+=this.renderer.html(n);break}case"def":{t+=this.renderer.def(n);break}case"paragraph":{t+=this.renderer.paragraph(n);break}case"text":{t+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(n.type)){s+=a||"";continue}}let o=n;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"checkbox":{s+=t.checkbox(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},Z=class{options;block;constructor(i){this.options=i||I}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(i=this.block){return i?v.lex:v.lexInline}provideParser(i=this.block){return i?w.parse:w.parseInline}},Gs=class{defaults=_e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=w;Renderer=ie;TextRenderer=ze;Lexer=v;Tokenizer=se;Hooks=Z;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let s of i)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let n of r.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of r.rows)for(let o of n)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=s;t=t.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(n=>{let o=r[n].flat(1/0);t=t.concat(this.walkTokens(o,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let n=e.renderers[r.name];n?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=e[r.level];n?n.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new ie(this.defaults);for(let n in t.renderer){if(!(n in r))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=t.renderer[o],l=r[o];r[o]=(...c)=>{let p=a.apply(r,c);return p===!1&&(p=l.apply(r,c)),p||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new se(this.defaults);for(let n in t.tokenizer){if(!(n in r))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=t.tokenizer[o],l=r[o];r[o]=(...c)=>{let p=a.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new Z;for(let n in t.hooks){if(!(n in r))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=t.hooks[o],l=r[o];Z.passThroughHooks.has(n)?r[o]=c=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(n))return(async()=>{let h=await a.call(r,c);return l.call(r,h)})();let p=a.call(r,c);return l.call(r,p)}:r[o]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await a.apply(r,c);return h===!1&&(h=await l.apply(r,c)),h})();let p=a.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,n=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return v.lex(i,e??this.defaults)}parser(i,e){return w.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let s={...t},r={...this.defaults,...s},n=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=i),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer(i):i?v.lex:v.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser(i):i?w.parse:w.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(n);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer(i):i?v.lex:v.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(i):i?w.parse:w.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(i,e){return t=>{if(t.message+=`
|
|
144
|
+
Please report this to https://github.com/markedjs/marked.`,i){let s="<p>An error occurred:</p><pre>"+_(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},M=new Gs;function x(i,e){return M.parse(i,e)}x.options=x.setOptions=function(i){return M.setOptions(i),x.defaults=M.defaults,ht(x.defaults),x};x.getDefaults=_e;x.defaults=I;function Ys(...i){return M.use(...i),x.defaults=M.defaults,ht(x.defaults),x}x.use=Ys;x.walkTokens=function(i,e){return M.walkTokens(i,e)};x.parseInline=M.parseInline;x.Parser=w;x.parser=w.parse;x.Renderer=ie;x.TextRenderer=ze;x.Lexer=v;x.lexer=v.lex;x.Tokenizer=se;x.Hooks=Z;x.parse=x;x.options;x.setOptions;x.walkTokens;x.parseInline;w.parse;v.lex;/**
|
|
139
145
|
* @license
|
|
140
146
|
* Copyright 2017 Google LLC
|
|
141
147
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
142
|
-
*/const
|
|
148
|
+
*/const Xs={CHILD:2},Js=i=>(...e)=>({_$litDirective$:i,values:e});class ei{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
|
|
143
149
|
* @license
|
|
144
150
|
* Copyright 2017 Google LLC
|
|
145
151
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
|
-
*/class
|
|
152
|
+
*/class be extends ei{constructor(e){if(super(e),this.it=m,e.type!==Xs.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===m||e==null)return this._t=void 0,this.it=e;if(e===L)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}be.directiveName="unsafeHTML",be.resultType=1;const ti=Js(be),Je="mem-bucket-detail-view-mode";class si extends S{constructor(){super(...arguments),this._viewMode=localStorage.getItem(Je)??"markdown"}static{this.properties={selected:{attribute:!1},onChanged:{attribute:!1},_doc:{state:!0},_viewMode:{state:!0}}}static{this.styles=F`
|
|
147
153
|
:host { display: block; padding: 16px; }
|
|
148
154
|
h2 { margin: 0 0 4px; font-size: 16px; }
|
|
149
155
|
.meta { font-size: 12px; opacity: 0.7; margin-bottom: 12px; }
|
|
@@ -157,7 +163,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
157
163
|
pre {
|
|
158
164
|
white-space: pre-wrap;
|
|
159
165
|
font-size: 12px;
|
|
160
|
-
background:
|
|
166
|
+
background: var(--bg-subtle);
|
|
161
167
|
padding: 12px;
|
|
162
168
|
border-radius: 6px;
|
|
163
169
|
max-height: 60vh;
|
|
@@ -172,7 +178,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
172
178
|
.view-toggle button {
|
|
173
179
|
font-size: 11px;
|
|
174
180
|
padding: 3px 8px;
|
|
175
|
-
border: 1px solid
|
|
181
|
+
border: 1px solid var(--border);
|
|
176
182
|
background: transparent;
|
|
177
183
|
border-radius: 4px;
|
|
178
184
|
cursor: pointer;
|
|
@@ -180,7 +186,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
180
186
|
}
|
|
181
187
|
.view-toggle button.active {
|
|
182
188
|
opacity: 1;
|
|
183
|
-
background:
|
|
189
|
+
background: var(--hover);
|
|
184
190
|
font-weight: 600;
|
|
185
191
|
}
|
|
186
192
|
.markdown-body {
|
|
@@ -189,13 +195,13 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
189
195
|
max-height: 60vh;
|
|
190
196
|
overflow-y: auto;
|
|
191
197
|
padding: 12px;
|
|
192
|
-
background:
|
|
198
|
+
background: var(--bg-subtle);
|
|
193
199
|
border-radius: 6px;
|
|
194
200
|
}
|
|
195
201
|
.markdown-body :first-child { margin-top: 0; }
|
|
196
202
|
.markdown-body :last-child { margin-bottom: 0; }
|
|
197
203
|
.markdown-body pre {
|
|
198
|
-
background:
|
|
204
|
+
background: var(--hover);
|
|
199
205
|
max-height: none;
|
|
200
206
|
}
|
|
201
207
|
.markdown-body code {
|
|
@@ -210,18 +216,15 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
210
216
|
.actions button {
|
|
211
217
|
font-size: 11px;
|
|
212
218
|
padding: 4px 10px;
|
|
213
|
-
border: 1px solid
|
|
219
|
+
border: 1px solid var(--border);
|
|
214
220
|
background: transparent;
|
|
215
221
|
color: inherit;
|
|
216
222
|
border-radius: 4px;
|
|
217
223
|
cursor: pointer;
|
|
218
224
|
}
|
|
219
225
|
.actions button.danger {
|
|
220
|
-
border-color:
|
|
221
|
-
color:
|
|
222
|
-
}
|
|
223
|
-
@media (prefers-color-scheme: dark) {
|
|
224
|
-
.actions button.danger { color: #fca5a5; }
|
|
226
|
+
border-color: var(--danger);
|
|
227
|
+
color: var(--danger);
|
|
225
228
|
}
|
|
226
229
|
`}updated(e){e.has("selected")&&this.selected&&(this.#t(),this.scrollTop=0)}async#t(){const{table:e,id:t}=this.selected,s=await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`);this._doc=s.ok?await s.json():null,await this.updateComplete,this.shadowRoot?.querySelector(".markdown-body")?.scrollTo(0,0),this.shadowRoot?.querySelector("pre")?.scrollTo(0,0)}#e(){this._doc?.source_path&&navigator.clipboard?.writeText(this._doc.source_path)}#s(e){this._viewMode=e,localStorage.setItem(Je,e)}async#i(){const{table:e,id:t}=this.selected,s=!this._doc?.deprecated;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}/deprecated`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({deprecated:s})}),await this.#t(),this.onChanged?.()}async#r(){if(!window.confirm("Delete this doc? This can't be undone."))return;const{table:e,id:t}=this.selected;await fetch(`/api/entries/${e}/${encodeURIComponent(t)}`,{method:"DELETE"}),this._doc=null,this.onChanged?.()}render(){if(!this.selected)return f`<div class="empty">Select an entry to view its details.</div>`;if(!this._doc)return m;const e=this._doc,t=this.selected.table==="skills"&&e.root==="builtin";return f`
|
|
227
230
|
<h2>${e.name??e.key??e.id}</h2>
|
|
@@ -250,33 +253,33 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
250
253
|
Raw
|
|
251
254
|
</button>
|
|
252
255
|
</div>
|
|
253
|
-
${this._viewMode==="markdown"?f`<div class="markdown-body">${
|
|
256
|
+
${this._viewMode==="markdown"?f`<div class="markdown-body">${ti(x.parse(e.body??"",{async:!1}))}</div>`:f`<pre>${e.body}</pre>`}
|
|
254
257
|
<div class="source-path" title="click to copy" @click=${()=>this.#e()}>${e.source_path}</div>
|
|
255
|
-
`}}customElements.define("detail-panel",
|
|
258
|
+
`}}customElements.define("detail-panel",si);class ii extends S{static{this.properties={defaultKind:{attribute:!1},lockKind:{attribute:!1},onAdded:{attribute:!1},onCancel:{attribute:!1}}}#t=new u("skill");#e=new u("");#s=new u([]);#i=new u(null);#r=new u("");#c=new u("");#l=new u("");#o=new u(!1);#n=new u(!1);static{this.styles=F`
|
|
256
259
|
:host { display: block; }
|
|
257
260
|
.backdrop {
|
|
258
|
-
position: fixed; inset: 0; background:
|
|
261
|
+
position: fixed; inset: 0; background: var(--overlay);
|
|
259
262
|
display: flex; align-items: center; justify-content: center; z-index: 100;
|
|
260
263
|
}
|
|
261
264
|
.modal {
|
|
262
|
-
background: var(--
|
|
265
|
+
background: var(--bg);
|
|
263
266
|
color: inherit;
|
|
264
267
|
border-radius: 10px;
|
|
265
268
|
width: min(560px, 92vw);
|
|
266
269
|
max-height: 82vh;
|
|
267
270
|
display: flex;
|
|
268
271
|
flex-direction: column;
|
|
269
|
-
box-shadow: 0 8px 40px
|
|
270
|
-
border: 1px solid
|
|
272
|
+
box-shadow: 0 8px 40px var(--shadow);
|
|
273
|
+
border: 1px solid var(--border);
|
|
271
274
|
}
|
|
272
275
|
.header { padding: 16px 20px 8px; }
|
|
273
276
|
h2 { margin: 0; font-size: 16px; }
|
|
274
277
|
.kind-toggle { display: flex; gap: 8px; padding: 0 20px 12px; }
|
|
275
278
|
.kind-toggle button {
|
|
276
|
-
flex: 1; padding: 8px; border: 1px solid
|
|
279
|
+
flex: 1; padding: 8px; border: 1px solid var(--border-strong); background: none; color: inherit;
|
|
277
280
|
border-radius: 6px; cursor: pointer; font-size: 13px;
|
|
278
281
|
}
|
|
279
|
-
.kind-toggle button.active { background:
|
|
282
|
+
.kind-toggle button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
|
|
280
283
|
.breadcrumb-row {
|
|
281
284
|
padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
|
282
285
|
}
|
|
@@ -289,13 +292,13 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
289
292
|
cursor: pointer; white-space: nowrap; user-select: none;
|
|
290
293
|
}
|
|
291
294
|
.browser {
|
|
292
|
-
flex: 1; overflow-y: auto; border-top: 1px solid
|
|
295
|
+
flex: 1; overflow-y: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
|
|
293
296
|
min-height: 200px;
|
|
294
297
|
}
|
|
295
298
|
.entry {
|
|
296
299
|
padding: 8px 20px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px;
|
|
297
300
|
}
|
|
298
|
-
.entry:hover { background:
|
|
301
|
+
.entry:hover { background: var(--hover); }
|
|
299
302
|
.entry .icon { opacity: 0.6; }
|
|
300
303
|
.up { opacity: 0.7; }
|
|
301
304
|
.empty { padding: 16px 20px; opacity: 0.6; font-size: 13px; }
|
|
@@ -303,19 +306,22 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
303
306
|
.selected-row { font-size: 12px; }
|
|
304
307
|
.selected-row .path { font-family: monospace; opacity: 0.85; word-break: break-all; }
|
|
305
308
|
label { font-size: 12px; opacity: 0.7; display: block; margin-bottom: 4px; }
|
|
306
|
-
input[type='text'] {
|
|
309
|
+
input[type='text'] {
|
|
310
|
+
width: 100%; box-sizing: border-box; padding: 7px 9px; font-size: 13px;
|
|
311
|
+
border: 1px solid var(--border-strong); border-radius: 6px; background: none; color: inherit;
|
|
312
|
+
}
|
|
307
313
|
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
|
|
308
314
|
button.primary {
|
|
309
|
-
background:
|
|
315
|
+
background: var(--accent); border: 1px solid var(--accent); color: var(--accent-fg); padding: 7px 16px;
|
|
310
316
|
border-radius: 6px; cursor: pointer; font-size: 13px;
|
|
311
317
|
}
|
|
312
318
|
button.primary:disabled { opacity: 0.5; cursor: default; }
|
|
313
319
|
button.secondary {
|
|
314
|
-
background: none; border: 1px solid
|
|
320
|
+
background: none; border: 1px solid var(--border-strong); color: inherit; padding: 7px 16px;
|
|
315
321
|
border-radius: 6px; cursor: pointer; font-size: 13px;
|
|
316
322
|
}
|
|
317
|
-
.error { color:
|
|
318
|
-
`}constructor(){super(),new ye(this),this.defaultKind="skill",this.lockKind=!1}connectedCallback(){super.connectedCallback(),this.#t.set(this.defaultKind),this.#h()}async#h(e){const t=new URLSearchParams;e&&t.set("path",e),this.#n.value&&t.set("hidden","1");const s=await fetch(`/api/fs/list?${t.toString()}`);if(!s.ok){this.#
|
|
323
|
+
.error { color: var(--danger); font-size: 12px; }
|
|
324
|
+
`}constructor(){super(),new ye(this),this.defaultKind="skill",this.lockKind=!1}connectedCallback(){super.connectedCallback(),this.#t.set(this.defaultKind),this.#h()}async#h(e){const t=new URLSearchParams;e&&t.set("path",e),this.#n.value&&t.set("hidden","1");const s=await fetch(`/api/fs/list?${t.toString()}`);if(!s.ok){this.#l.set((await s.json()).error??"failed to list directory");return}const r=await s.json();this.#e.set(r.path),this.#i.set(r.parent),this.#s.set(r.entries),this.#l.set("")}#g(){this.#n.set(!this.#n.value),this.#h(this.#e.value)}#u(){this.#r.set(this.#e.value),this.#c.value||this.#c.set(this.#e.value.split("/").filter(Boolean).pop()??"")}async#d(){const e=this.#r.value||this.#e.value;if(e){this.#o.set(!0),this.#l.set("");try{const t=await fetch("/api/roots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:this.#t.value,name:this.#c.value||void 0,path:e})}),s=await t.json();if(!t.ok){this.#l.set(s.error??"failed to add root");return}this.onAdded()}finally{this.#o.set(!1)}}}render(){const e=this.#s.value;return f`
|
|
319
325
|
<div class="backdrop" @click=${t=>t.target===t.currentTarget&&this.onCancel()}>
|
|
320
326
|
<div class="modal">
|
|
321
327
|
<div class="header"><h2>Add a root</h2></div>
|
|
@@ -359,12 +365,12 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
359
365
|
<label>Root name</label>
|
|
360
366
|
<input
|
|
361
367
|
type="text"
|
|
362
|
-
.value=${this.#
|
|
368
|
+
.value=${this.#c.value}
|
|
363
369
|
placeholder="e.g. personal, company"
|
|
364
|
-
@input=${t=>this.#
|
|
370
|
+
@input=${t=>this.#c.set(t.target.value)}
|
|
365
371
|
/>
|
|
366
372
|
</div>
|
|
367
|
-
${this.#
|
|
373
|
+
${this.#l.value?f`<div class="error">${this.#l.value}</div>`:""}
|
|
368
374
|
<div class="actions">
|
|
369
375
|
<button class="secondary" @click=${()=>this.onCancel()}>Cancel</button>
|
|
370
376
|
<button
|
|
@@ -378,33 +384,36 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
378
384
|
</div>
|
|
379
385
|
</div>
|
|
380
386
|
</div>
|
|
381
|
-
`}}customElements.define("add-root-modal",
|
|
387
|
+
`}}customElements.define("add-root-modal",ii);let et=0;class ri extends S{static{this.properties={tags:{attribute:!1},active:{attribute:!1},onToggle:{attribute:!1}}}#t=new u("");#e=new u(!1);#s=new u(-1);#i;#r;static{this.styles=F`
|
|
382
388
|
:host {
|
|
383
389
|
display: inline-block;
|
|
384
390
|
position: relative;
|
|
385
391
|
width: 260px;
|
|
386
392
|
font: inherit;
|
|
393
|
+
font-size: 13px;
|
|
387
394
|
}
|
|
388
395
|
.field {
|
|
389
396
|
display: flex;
|
|
390
397
|
align-items: center;
|
|
391
398
|
flex-wrap: wrap;
|
|
392
399
|
gap: 4px;
|
|
393
|
-
border: 1px solid
|
|
400
|
+
border: 1px solid var(--border-strong);
|
|
394
401
|
border-radius: 6px;
|
|
395
402
|
background: none;
|
|
396
403
|
padding: 3px 4px 3px 8px;
|
|
404
|
+
min-height: 30px;
|
|
405
|
+
box-sizing: border-box;
|
|
397
406
|
}
|
|
398
407
|
.field:focus-within {
|
|
399
|
-
border-color:
|
|
400
|
-
box-shadow: 0 0 0 2px
|
|
408
|
+
border-color: var(--accent);
|
|
409
|
+
box-shadow: 0 0 0 2px var(--accent-tint);
|
|
401
410
|
}
|
|
402
411
|
.selected-chip {
|
|
403
412
|
display: inline-flex;
|
|
404
413
|
align-items: center;
|
|
405
414
|
gap: 4px;
|
|
406
|
-
background:
|
|
407
|
-
color:
|
|
415
|
+
background: var(--accent);
|
|
416
|
+
color: var(--accent-fg);
|
|
408
417
|
border-radius: 999px;
|
|
409
418
|
padding: 2px 6px 2px 10px;
|
|
410
419
|
font-size: 12px;
|
|
@@ -454,11 +463,11 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
454
463
|
list-style: none;
|
|
455
464
|
padding: 4px;
|
|
456
465
|
margin: 0;
|
|
457
|
-
border: 1px solid
|
|
466
|
+
border: 1px solid var(--border);
|
|
458
467
|
border-radius: 8px;
|
|
459
|
-
background: var(--
|
|
468
|
+
background: var(--bg);
|
|
460
469
|
color: inherit;
|
|
461
|
-
box-shadow: 0 8px 24px
|
|
470
|
+
box-shadow: 0 8px 24px var(--shadow);
|
|
462
471
|
max-height: 260px;
|
|
463
472
|
overflow-y: auto;
|
|
464
473
|
box-sizing: border-box;
|
|
@@ -476,10 +485,10 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
476
485
|
cursor: pointer;
|
|
477
486
|
font-size: 13px;
|
|
478
487
|
}
|
|
479
|
-
.option:hover, .option.highlighted { background:
|
|
488
|
+
.option:hover, .option.highlighted { background: var(--hover); }
|
|
480
489
|
.option input { margin: 0; pointer-events: none; }
|
|
481
490
|
.empty { padding: 6px 8px; opacity: 0.6; font-style: italic; font-size: 12px; }
|
|
482
|
-
`}constructor(){super(),new ye(this),this.tags=[],this.active=[],this.onToggle=()=>{},this.#i=`--tag-multiselect-${++
|
|
491
|
+
`}constructor(){super(),new ye(this),this.tags=[],this.active=[],this.onToggle=()=>{},this.#i=`--tag-multiselect-${++et}`,this.#r=`tag-multiselect-listbox-${et}`}#c=e=>{e.composedPath().includes(this)||this.#n()};connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#c)}disconnectedCallback(){document.removeEventListener("click",this.#c),super.disconnectedCallback()}get#l(){const e=this.#t.value.trim().toLowerCase();return e?this.tags.filter(t=>t.toLowerCase().includes(e)):this.tags}#o(){this.#e.set(!0),this.updateComplete.then(()=>{this.renderRoot.querySelector(".menu")?.showPopover()})}#n(){this.#e.set(!1),this.#s.set(-1),this.renderRoot.querySelector(".menu")?.hidePopover()}#h(){this.#e.value?this.#n():(this.#o(),this.renderRoot.querySelector(".input")?.focus())}#g(e){this.#t.set(e.target.value),this.#s.set(-1),this.#o()}#u(e){this.onToggle(e),this.#t.set(""),this.#s.set(-1)}#d(e){e.stopPropagation(),this.active.forEach(t=>this.onToggle(t)),this.#t.set(""),this.renderRoot.querySelector(".input")?.focus(),this.#o()}#f(e){const t=this.#l;if(e.key==="ArrowDown")e.preventDefault(),this.#o(),t.length&&this.#s.set((this.#s.value+1)%t.length);else if(e.key==="ArrowUp")e.preventDefault(),this.#o(),t.length&&this.#s.set((this.#s.value-1+t.length)%t.length);else if(e.key==="Enter"){const s=t[this.#s.value];s!==void 0&&(e.preventDefault(),this.#u(s))}else if(e.key==="Backspace"&&!this.#t.value&&this.active.length>0){const s=this.active[this.active.length-1];s!==void 0&&this.onToggle(s)}else e.key==="Escape"&&this.#n()}render(){const e=this.active,t=this.#l,s=this.#e.value,r=this.#s.value;return f`
|
|
483
492
|
<div class="field" style=${`anchor-name: ${this.#i}`}>
|
|
484
493
|
${e.map(n=>f`
|
|
485
494
|
<span class="selected-chip">
|
|
@@ -493,7 +502,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
493
502
|
aria-autocomplete="list"
|
|
494
503
|
aria-expanded=${s}
|
|
495
504
|
aria-controls=${this.#r}
|
|
496
|
-
aria-activedescendant=${
|
|
505
|
+
aria-activedescendant=${r>=0?`${this.#r}-opt-${r}`:""}
|
|
497
506
|
placeholder=${e.length===0?"Filter by tag…":""}
|
|
498
507
|
.value=${this.#t.value}
|
|
499
508
|
@input=${n=>this.#g(n)}
|
|
@@ -525,7 +534,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
525
534
|
id=${`${this.#r}-opt-${o}`}
|
|
526
535
|
role="option"
|
|
527
536
|
aria-selected=${e.includes(n)}
|
|
528
|
-
class=${o===
|
|
537
|
+
class=${o===r?"option highlighted":"option"}
|
|
529
538
|
@mousedown=${a=>a.preventDefault()}
|
|
530
539
|
@click=${()=>this.#u(n)}
|
|
531
540
|
>
|
|
@@ -534,46 +543,123 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
534
543
|
</li>
|
|
535
544
|
`):f`<li class="empty">No matches</li>`}
|
|
536
545
|
</ul>
|
|
537
|
-
`}}customElements.define("tag-multiselect",
|
|
538
|
-
:host { display:
|
|
546
|
+
`}}customElements.define("tag-multiselect",ri);const ni=[{value:"all",label:"All"},{value:"skill",label:"Skills"},{value:"memory",label:"Memories"}],oi={tags:[],statuses:[],owners:[],doc_types:[],key_types:[],roots:[]},ai={skill:[],memory:[]},$t="mem-bucket-split-pct",vt=20,wt=80;function li(){const i=Number(localStorage.getItem($t));return Number.isFinite(i)&&i>=vt&&i<=wt?i:40}const yt="mem-bucket-theme",he=["system","light","dark"],ci={system:"◐",light:"☀",dark:"☾"},hi={system:"Auto",light:"Light",dark:"Dark"};function pi(){const i=localStorage.getItem(yt);return i==="light"||i==="dark"?i:"system"}function tt(i){i==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",i)}class ui extends S{static{this.styles=F`
|
|
547
|
+
:host { display: flex; flex-direction: column; height: 100vh; }
|
|
548
|
+
.theme-toggle {
|
|
549
|
+
position: fixed;
|
|
550
|
+
top: 10px;
|
|
551
|
+
right: 12px;
|
|
552
|
+
z-index: 10;
|
|
553
|
+
width: 28px;
|
|
554
|
+
height: 28px;
|
|
555
|
+
border: 1px solid var(--border-strong);
|
|
556
|
+
border-radius: 50%;
|
|
557
|
+
background: var(--bg);
|
|
558
|
+
color: inherit;
|
|
559
|
+
cursor: pointer;
|
|
560
|
+
font-size: 14px;
|
|
561
|
+
line-height: 1;
|
|
562
|
+
display: flex;
|
|
563
|
+
align-items: center;
|
|
564
|
+
justify-content: center;
|
|
565
|
+
opacity: 0.75;
|
|
566
|
+
}
|
|
567
|
+
.theme-toggle:hover { opacity: 1; background: var(--hover); }
|
|
539
568
|
.filters {
|
|
540
569
|
padding: 12px 16px;
|
|
541
|
-
border-bottom: 1px solid
|
|
570
|
+
border-bottom: 1px solid var(--border);
|
|
542
571
|
display: flex;
|
|
543
572
|
flex-direction: column;
|
|
544
573
|
gap: 8px;
|
|
545
574
|
}
|
|
575
|
+
.search-field {
|
|
576
|
+
position: relative;
|
|
577
|
+
flex: 1 1 240px;
|
|
578
|
+
max-width: 480px;
|
|
579
|
+
}
|
|
546
580
|
.filters input[type='search'] {
|
|
547
|
-
font-size:
|
|
548
|
-
padding:
|
|
581
|
+
font-size: 13px;
|
|
582
|
+
padding: 6px 28px 6px 10px;
|
|
549
583
|
width: 100%;
|
|
550
|
-
|
|
584
|
+
box-sizing: border-box;
|
|
585
|
+
border: 1px solid var(--border-strong);
|
|
586
|
+
border-radius: 6px;
|
|
587
|
+
background: none;
|
|
588
|
+
color: inherit;
|
|
589
|
+
height: 30px;
|
|
590
|
+
}
|
|
591
|
+
.filters input[type='search']::-webkit-search-cancel-button { display: none; }
|
|
592
|
+
.search-clear-btn {
|
|
593
|
+
position: absolute;
|
|
594
|
+
right: 4px;
|
|
595
|
+
top: 50%;
|
|
596
|
+
transform: translateY(-50%);
|
|
597
|
+
border: none;
|
|
598
|
+
background: transparent;
|
|
599
|
+
cursor: pointer;
|
|
600
|
+
color: inherit;
|
|
601
|
+
opacity: 0.6;
|
|
602
|
+
font-size: 12px;
|
|
603
|
+
line-height: 1;
|
|
604
|
+
padding: 4px 6px;
|
|
605
|
+
border-radius: 50%;
|
|
606
|
+
}
|
|
607
|
+
.search-clear-btn:hover { opacity: 1; background: var(--hover); }
|
|
608
|
+
.date-range { display: flex; align-items: center; gap: 4px; }
|
|
609
|
+
.date-range input[type='date'] {
|
|
610
|
+
font-size: 13px;
|
|
611
|
+
padding: 5px 8px;
|
|
612
|
+
border: 1px solid var(--border-strong);
|
|
613
|
+
border-radius: 6px;
|
|
614
|
+
background: none;
|
|
615
|
+
color: inherit;
|
|
616
|
+
height: 30px;
|
|
551
617
|
box-sizing: border-box;
|
|
552
618
|
}
|
|
619
|
+
.date-range-sep { opacity: 0.5; font-size: 12px; }
|
|
620
|
+
.date-range-clear {
|
|
621
|
+
position: static;
|
|
622
|
+
transform: none;
|
|
623
|
+
opacity: 0.6;
|
|
624
|
+
font-size: 12px;
|
|
625
|
+
line-height: 1;
|
|
626
|
+
padding: 4px 6px;
|
|
627
|
+
border: none;
|
|
628
|
+
background: transparent;
|
|
629
|
+
cursor: pointer;
|
|
630
|
+
color: inherit;
|
|
631
|
+
border-radius: 50%;
|
|
632
|
+
}
|
|
633
|
+
.date-range-clear:hover { opacity: 1; background: var(--hover); }
|
|
634
|
+
.search-row { align-items: center; }
|
|
553
635
|
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
|
|
554
636
|
.filter-label { font-size: 12px; opacity: 0.6; font-weight: 600; }
|
|
637
|
+
.type-toggle { gap: 0; }
|
|
555
638
|
.type-toggle button {
|
|
556
|
-
border: 1px solid
|
|
639
|
+
border: 1px solid var(--border-strong);
|
|
557
640
|
background: none;
|
|
558
641
|
color: inherit;
|
|
559
|
-
padding:
|
|
642
|
+
padding: 6px 12px;
|
|
560
643
|
font-size: 13px;
|
|
561
644
|
cursor: pointer;
|
|
645
|
+
height: 30px;
|
|
646
|
+
box-sizing: border-box;
|
|
562
647
|
}
|
|
563
|
-
.type-toggle button.active { background:
|
|
648
|
+
.type-toggle button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
|
|
564
649
|
.type-toggle button:first-child { border-radius: 6px 0 0 6px; }
|
|
565
650
|
.type-toggle button:last-child { border-radius: 0 6px 6px 0; }
|
|
566
|
-
.
|
|
651
|
+
.type-toggle button:not(:first-child) { border-left: none; }
|
|
652
|
+
.body-region { display: flex; flex: 1 1 auto; min-height: 0; }
|
|
567
653
|
result-list { overflow-y: auto; flex: 0 0 auto; }
|
|
568
654
|
detail-panel { overflow-y: auto; flex: 1 1 auto; min-width: 0; }
|
|
569
655
|
.splitter {
|
|
570
656
|
flex: 0 0 auto;
|
|
571
657
|
width: 6px;
|
|
572
658
|
cursor: col-resize;
|
|
573
|
-
background:
|
|
659
|
+
background: var(--hover);
|
|
574
660
|
position: relative;
|
|
575
661
|
}
|
|
576
|
-
.splitter:hover, .splitter.dragging { background:
|
|
662
|
+
.splitter:hover, .splitter.dragging { background: var(--accent-tint); }
|
|
577
663
|
.splitter::after {
|
|
578
664
|
content: '';
|
|
579
665
|
position: absolute;
|
|
@@ -587,56 +673,69 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
587
673
|
align-items: center;
|
|
588
674
|
flex-wrap: wrap;
|
|
589
675
|
padding: 10px 16px;
|
|
590
|
-
border-bottom: 1px solid
|
|
591
|
-
background:
|
|
676
|
+
border-bottom: 1px solid var(--border);
|
|
677
|
+
background: var(--bg-subtle);
|
|
592
678
|
}
|
|
593
679
|
.root-chip {
|
|
594
|
-
border: 1px solid
|
|
680
|
+
border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 8px 3px 10px; font-size: 12px;
|
|
595
681
|
cursor: pointer; background: none; color: inherit; display: inline-flex; align-items: center; gap: 6px;
|
|
596
682
|
}
|
|
597
|
-
.root-chip.active { background:
|
|
598
|
-
@media (prefers-color-scheme: dark) {
|
|
599
|
-
.root-chip.active { background: #a78bfa33; border-color: #a78bfa; color: #d8caff; }
|
|
600
|
-
}
|
|
683
|
+
.root-chip.active { background: var(--purple-tint); border-color: var(--purple); color: var(--purple-fg); }
|
|
601
684
|
.root-chip .remove {
|
|
602
685
|
opacity: 0.6; font-size: 12px; line-height: 1; padding: 2px; border-radius: 50%;
|
|
603
686
|
}
|
|
604
|
-
.root-chip .remove:hover { opacity: 1; background:
|
|
687
|
+
.root-chip .remove:hover { opacity: 1; background: var(--hover-strong); }
|
|
605
688
|
.add-root-btn {
|
|
606
|
-
border: 1px dashed
|
|
689
|
+
border: 1px dashed var(--border-strong); border-radius: 999px; padding: 3px 10px; font-size: 12px;
|
|
607
690
|
cursor: pointer; background: none; color: inherit; opacity: 0.75;
|
|
608
691
|
}
|
|
609
692
|
.add-root-btn:hover { opacity: 1; }
|
|
610
693
|
.first-run {
|
|
611
694
|
display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
612
|
-
|
|
695
|
+
flex: 1 1 auto; gap: 16px; text-align: center; padding: 24px;
|
|
613
696
|
}
|
|
614
697
|
.first-run h1 { font-size: 18px; margin: 0; }
|
|
615
698
|
.first-run p { opacity: 0.7; font-size: 13px; max-width: 420px; margin: 0; }
|
|
616
|
-
select {
|
|
699
|
+
select {
|
|
700
|
+
font-size: 13px;
|
|
701
|
+
padding: 6px 8px;
|
|
702
|
+
height: 30px;
|
|
703
|
+
box-sizing: border-box;
|
|
704
|
+
border: 1px solid var(--border-strong);
|
|
705
|
+
border-radius: 6px;
|
|
706
|
+
background: none;
|
|
707
|
+
color: inherit;
|
|
708
|
+
}
|
|
617
709
|
.bulk-bar {
|
|
618
710
|
display: flex;
|
|
619
711
|
gap: 8px;
|
|
620
712
|
align-items: center;
|
|
621
713
|
padding: 6px 16px;
|
|
622
|
-
border-bottom: 1px solid
|
|
623
|
-
background:
|
|
714
|
+
border-bottom: 1px solid var(--border);
|
|
715
|
+
background: var(--accent-tint);
|
|
624
716
|
font-size: 12px;
|
|
625
717
|
}
|
|
626
718
|
.bulk-bar button {
|
|
627
719
|
font-size: 11px;
|
|
628
720
|
padding: 4px 10px;
|
|
629
|
-
border: 1px solid
|
|
721
|
+
border: 1px solid var(--border);
|
|
630
722
|
background: transparent;
|
|
631
723
|
color: inherit;
|
|
632
724
|
border-radius: 4px;
|
|
633
725
|
cursor: pointer;
|
|
634
726
|
}
|
|
635
|
-
.bulk-bar button.danger { border-color:
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
727
|
+
.bulk-bar button.danger { border-color: var(--danger); color: var(--danger); }
|
|
728
|
+
`}#t=new u("");#e=new u("all");#s=new u([]);#i=new u([]);#r=new u([]);#c=new u(oi);#l=new u(null);#o=new u(ai);#n=new u(!1);#h=new u("");#g=new u(!1);#u=new u(li());#d=new u(!1);#f=new u("mtime_desc");#$=new u(!1);#b=new u("");#x=new u("");#p=new u(new Set);#k=new u(pi());#w=e=>this.#z(e);#y=()=>this.#P();constructor(){super(),new ye(this),tt(this.#k.value)}#R(e){this.#k.set(e),localStorage.setItem(yt,e),tt(e)}#E(){const e=he[(he.indexOf(this.#k.value)+1)%he.length];this.#R(e)}#C(e){e.preventDefault(),this.#d.set(!0),document.addEventListener("pointermove",this.#w),document.addEventListener("pointerup",this.#y)}#z(e){const t=this.renderRoot.querySelector(".body-region");if(!t)return;const s=t.getBoundingClientRect(),r=(e.clientX-s.left)/s.width*100;this.#u.set(Math.min(wt,Math.max(vt,r)))}#P(){this.#d.set(!1),document.removeEventListener("pointermove",this.#w),document.removeEventListener("pointerup",this.#y),localStorage.setItem($t,String(this.#u.value))}#L=new Xt(()=>{const e=new URLSearchParams;this.#e.value!=="all"&&e.set("type",this.#e.value),this.#t.value.trim()&&e.set("q",this.#t.value.trim());for(const t of this.#s.value)e.append("tag",t);for(const t of this.#i.value)e.append("root",t);return this.#f.value!=="mtime_desc"&&e.set("sort",this.#f.value),this.#$.value&&e.set("deprecated","0"),this.#b.value&&e.set("date_from",this.#b.value),this.#x.value&&e.set("date_to",this.#x.value),e.toString()});connectedCallback(){super.connectedCallback(),this.#a(),this.#m(),this.#v()}async#a(){const e=await fetch(`/api/entries?${this.#L.value}`);this.#r.set(await e.json()),this.renderRoot.querySelector("result-list")?.scrollTo(0,0)}async#m(){const e=this.#e.value==="all"?"":`?type=${this.#e.value}`,t=await fetch(`/api/facets${e}`);this.#c.set(await t.json())}async#v(){const e=await fetch("/api/roots");this.#o.set(await e.json()),this.#g.set(!0)}#M(e){const t=this.#i.value;this.#i.set(t.includes(e)?t.filter(s=>s!==e):[...t,e]),this.#a()}async#I(e,t){if(t.stopPropagation(),window.prompt(`Type "${e.name}" to remove this ${e.kind} root (files on disk are untouched):`)===e.name){this.#h.set(e.name);try{await fetch(`/api/roots/${e.kind}/${encodeURIComponent(e.name)}`,{method:"DELETE"}),this.#i.set(this.#i.value.filter(r=>r!==e.name)),await Promise.all([this.#v(),this.#m(),this.#a()])}finally{this.#h.set("")}}}#_(){this.#n.set(!1),this.#v(),this.#m(),this.#a()}#D(){return[...this.#o.value.skill,...this.#o.value.memory]}#O(e){this.#e.set(e),this.#s.set([]),this.#m(),this.#a()}#N(e){const t=this.#s.value;this.#s.set(t.includes(e)?t.filter(s=>s!==e):[...t,e]),this.#a()}#U(e){this.#t.set(e.target.value),this.#a()}#H(){this.#t.set(""),this.#a()}#q(e){this.#l.set({table:e._table,id:e.id})}#B(e){this.#f.set(e.target.value),this.#a()}#j(e){this.#$.set(e.target.checked),this.#a()}#Z(e){this.#b.set(e.target.value),this.#a()}#Q(e){this.#x.set(e.target.value),this.#a()}#K(){this.#b.set(""),this.#x.set(""),this.#a()}#W(e){const t=new Set(this.#p.value);t.has(e.id)?t.delete(e.id):t.add(e.id),this.#p.set(t)}#F(){return new Map(this.#r.value.map(e=>[e.id,e]))}#S(){const e=new Map,t=this.#F();for(const s of this.#p.value){const r=t.get(s);if(!r)continue;const n=e.get(r._table)??[];n.push(s),e.set(r._table,n)}return e}async#A(e){const t=this.#S();await Promise.all([...t.entries()].map(([s,r])=>fetch(`/api/entries/${s}/bulk/deprecated`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:r,deprecated:e})}))),this.#p.set(new Set),await this.#a()}async#V(){if(!window.confirm(`Delete ${this.#p.value.size} doc(s)? This can't be undone.`))return;const e=this.#S();await Promise.all([...e.entries()].map(([t,s])=>fetch(`/api/entries/${t}/bulk/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:s})}))),this.#p.set(new Set),await this.#a()}#T(){const e=this.#k.value;return f`
|
|
729
|
+
<button
|
|
730
|
+
class="theme-toggle"
|
|
731
|
+
title=${`Theme: ${hi[e]} (click to change)`}
|
|
732
|
+
aria-label="Toggle color theme"
|
|
733
|
+
@click=${()=>this.#E()}
|
|
734
|
+
>
|
|
735
|
+
${ci[e]}
|
|
736
|
+
</button>
|
|
737
|
+
`}render(){const e=this.#c.value,t=this.#D();return this.#g.value&&t.length===0&&!this.#n.value?f`
|
|
738
|
+
${this.#T()}
|
|
640
739
|
<div class="first-run">
|
|
641
740
|
<h1>No roots configured yet</h1>
|
|
642
741
|
<p>
|
|
@@ -648,19 +747,24 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
648
747
|
${this.#n.value?f`<add-root-modal
|
|
649
748
|
.defaultKind=${"skill"}
|
|
650
749
|
.lockKind=${!1}
|
|
651
|
-
.onAdded=${()=>this.#
|
|
750
|
+
.onAdded=${()=>this.#_()}
|
|
652
751
|
.onCancel=${()=>this.#n.set(!1)}
|
|
653
752
|
></add-root-modal>`:""}
|
|
654
753
|
`:f`
|
|
754
|
+
${this.#T()}
|
|
655
755
|
<div class="roots-bar">
|
|
656
756
|
<span class="filter-label">Roots:</span>
|
|
657
757
|
${t.map(s=>f`
|
|
658
|
-
<button
|
|
758
|
+
<button
|
|
759
|
+
class="root-chip ${this.#i.value.includes(s.name)?"active":""}"
|
|
760
|
+
title=${s.path}
|
|
761
|
+
@click=${()=>this.#M(s.name)}
|
|
762
|
+
>
|
|
659
763
|
${s.name}
|
|
660
764
|
<span
|
|
661
765
|
class="remove"
|
|
662
766
|
title="Remove root"
|
|
663
|
-
@click=${
|
|
767
|
+
@click=${r=>this.#I(s,r)}
|
|
664
768
|
>${this.#h.value===s.name?"…":"✕"}</span
|
|
665
769
|
>
|
|
666
770
|
</button>
|
|
@@ -668,34 +772,70 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
668
772
|
<button class="add-root-btn" @click=${()=>this.#n.set(!0)}>+ Add root</button>
|
|
669
773
|
</div>
|
|
670
774
|
<div class="filters">
|
|
671
|
-
<
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
775
|
+
<div class="row search-row">
|
|
776
|
+
<div class="search-field">
|
|
777
|
+
<input
|
|
778
|
+
type="search"
|
|
779
|
+
placeholder="Search descriptions, bodies, tags..."
|
|
780
|
+
.value=${this.#t.value}
|
|
781
|
+
@input=${s=>this.#U(s)}
|
|
782
|
+
/>
|
|
783
|
+
${this.#t.value?f`
|
|
784
|
+
<button
|
|
785
|
+
class="search-clear-btn"
|
|
786
|
+
title="Clear search"
|
|
787
|
+
aria-label="Clear search"
|
|
788
|
+
@click=${()=>this.#H()}
|
|
789
|
+
>
|
|
790
|
+
✕
|
|
791
|
+
</button>
|
|
792
|
+
`:""}
|
|
793
|
+
</div>
|
|
794
|
+
<div class="row type-toggle">
|
|
795
|
+
${ni.map(s=>f`
|
|
796
|
+
<button
|
|
797
|
+
class=${this.#e.value===s.value?"active":""}
|
|
798
|
+
@click=${()=>this.#O(s.value)}
|
|
799
|
+
>
|
|
800
|
+
${s.label}
|
|
801
|
+
</button>
|
|
802
|
+
`)}
|
|
803
|
+
</div>
|
|
688
804
|
${e.tags.length===0?f`<span class="filter-label">Tags:</span> <label class="small">no tags yet</label>`:f`
|
|
689
805
|
<tag-multiselect
|
|
690
806
|
.tags=${e.tags}
|
|
691
807
|
.active=${this.#s.value}
|
|
692
|
-
.onToggle=${s=>this.#
|
|
808
|
+
.onToggle=${s=>this.#N(s)}
|
|
693
809
|
></tag-multiselect>
|
|
694
810
|
`}
|
|
695
|
-
|
|
696
|
-
|
|
811
|
+
<span class="filter-label">Dates:</span>
|
|
812
|
+
<div class="date-range">
|
|
813
|
+
<input
|
|
814
|
+
type="date"
|
|
815
|
+
aria-label="From date"
|
|
816
|
+
.value=${this.#b.value}
|
|
817
|
+
@change=${s=>this.#Z(s)}
|
|
818
|
+
/>
|
|
819
|
+
<span class="date-range-sep">–</span>
|
|
820
|
+
<input
|
|
821
|
+
type="date"
|
|
822
|
+
aria-label="To date"
|
|
823
|
+
.value=${this.#x.value}
|
|
824
|
+
@change=${s=>this.#Q(s)}
|
|
825
|
+
/>
|
|
826
|
+
${this.#b.value||this.#x.value?f`
|
|
827
|
+
<button
|
|
828
|
+
class="date-range-clear"
|
|
829
|
+
title="Clear date range"
|
|
830
|
+
aria-label="Clear date range"
|
|
831
|
+
@click=${()=>this.#K()}
|
|
832
|
+
>
|
|
833
|
+
✕
|
|
834
|
+
</button>
|
|
835
|
+
`:""}
|
|
836
|
+
</div>
|
|
697
837
|
<span class="filter-label">Sort:</span>
|
|
698
|
-
<select .value=${this.#f.value} @change=${s=>this.#
|
|
838
|
+
<select .value=${this.#f.value} @change=${s=>this.#B(s)}>
|
|
699
839
|
<option value="mtime_desc">Recently touched</option>
|
|
700
840
|
<option value="mtime_asc">Least recently touched</option>
|
|
701
841
|
<option value="created_at_asc">Oldest first</option>
|
|
@@ -704,8 +844,8 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
704
844
|
<label class="small">
|
|
705
845
|
<input
|
|
706
846
|
type="checkbox"
|
|
707
|
-
.checked=${this
|
|
708
|
-
@change=${s=>this.#
|
|
847
|
+
.checked=${this.#$.value}
|
|
848
|
+
@change=${s=>this.#j(s)}
|
|
709
849
|
/>
|
|
710
850
|
Hide deprecated
|
|
711
851
|
</label>
|
|
@@ -714,31 +854,31 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
714
854
|
${this.#p.value.size>0?f`
|
|
715
855
|
<div class="bulk-bar">
|
|
716
856
|
<span>${this.#p.value.size} selected</span>
|
|
717
|
-
<button @click=${()=>this.#
|
|
718
|
-
<button @click=${()=>this.#
|
|
719
|
-
<button class="danger" @click=${()=>this.#
|
|
857
|
+
<button @click=${()=>this.#A(!0)}>Mark deprecated</button>
|
|
858
|
+
<button @click=${()=>this.#A(!1)}>Un-deprecate</button>
|
|
859
|
+
<button class="danger" @click=${()=>this.#V()}>Delete</button>
|
|
720
860
|
<button @click=${()=>this.#p.set(new Set)}>Clear</button>
|
|
721
861
|
</div>
|
|
722
862
|
`:""}
|
|
723
863
|
<div class="body-region">
|
|
724
864
|
<result-list
|
|
725
|
-
style=${`width: ${this.#u.value}%; border-right: 1px solid
|
|
865
|
+
style=${`width: ${this.#u.value}%; border-right: 1px solid var(--border);`}
|
|
726
866
|
.results=${this.#r.value}
|
|
727
867
|
.showRoot=${t.length>1}
|
|
728
|
-
.onSelect=${s=>this.#
|
|
868
|
+
.onSelect=${s=>this.#q(s)}
|
|
729
869
|
.selectedIds=${this.#p.value}
|
|
730
|
-
.onToggleSelect=${s=>this.#
|
|
870
|
+
.onToggleSelect=${s=>this.#W(s)}
|
|
731
871
|
></result-list>
|
|
732
872
|
<div
|
|
733
873
|
class="splitter ${this.#d.value?"dragging":""}"
|
|
734
|
-
@pointerdown=${s=>this.#
|
|
874
|
+
@pointerdown=${s=>this.#C(s)}
|
|
735
875
|
></div>
|
|
736
|
-
<detail-panel .selected=${this.#
|
|
876
|
+
<detail-panel .selected=${this.#l.value} .onChanged=${()=>this.#a()}></detail-panel>
|
|
737
877
|
</div>
|
|
738
878
|
${this.#n.value?f`<add-root-modal
|
|
739
879
|
.defaultKind=${"skill"}
|
|
740
880
|
.lockKind=${!1}
|
|
741
|
-
.onAdded=${()=>this.#
|
|
881
|
+
.onAdded=${()=>this.#_()}
|
|
742
882
|
.onCancel=${()=>this.#n.set(!1)}
|
|
743
883
|
></add-root-modal>`:""}
|
|
744
|
-
`}}customElements.define("mem-bucket-app",
|
|
884
|
+
`}}customElements.define("mem-bucket-app",ui);
|